The smartphones of dozens of Israeli soldiers were hacked by Hamas militants pretending to be attractive young women online, Israeli military officials said on Wednesday.
Using fake profiles on social media with alluring photos, members of Islamist movement Hamas contacted the soldiers, luring them into long chats.
"Following reports from soldiers of suspicious activity of accounts on social media an operation was launched lasting several months led by military intelligence aimed at uncovering enemy accounts," Arabic-language spokesman Avichay Adraee said in a Facebook post.
"During the operation, we uncovered dozens of accounts working to leak and steal information from Israeli soldiers by installing malicious programmes on soldiers' smartphones that spy and record everything," he said.
"Hamas pretended to be fictitious characters, stole real accounts and people's names from around the world to use illegally," he added.
Officials however did not say how the army determined that those behind the scheme were from Hamas, the Islamist movement that runs the Gaza Strip.
"The enemy knows the language of young people and installed viruses that can control the telephones of dozens of soldiers," an Israeli military official told AFP.
The actual damage done to the army was limited and the virus has been dealt with, the official added, but the army has decided to raise the issue publicly to warn soldiers of the potential dangers of social networks.
"The existing potential threat can turn into a real threat to the security of Israel," the source said.
"We will disseminate and denounce the false profiles of Hamas, impose stricter rules for soldiers who are on social networks and train military personnel to react to attacks before it is too late."
Israel and Palestinian militants in Gaza have fought three wars since 2008.
While the border between Israel and Gaza is relatively quiet currently, the two sides remain enemies and technology has previously played a role in the conflict.
In March last year a Palestinian from Gaza was charged with hacking into Israeli military drones.