Israel has accused its enemy Hamas of building fake dating apps to woo soldiers into downloading malicious software on to their mobile phones.

Hundreds of Israel Defence Forces (IDF) troops were contacted via social media this year and asked to download one of two fake dating apps, WinkChat and GlanceLove, according to an official in the army’s intelligence directorate.

Once the bogus app was installed, it granted its creators the ability to see the owner’s location and contact list and to use the phone as a listening device and video camera.

“Whatever you can do with your phone, the malicious content can do,” the official said at a briefing to journalists on Tuesday, adding the operation targeted Android phones.

The soldiers were contacted via phony Facebook accounts, often with the stolen identities of young women, asking to chat on WhatsApp. They were then sent links to the apps, which were listed on the Google Play store and have since been removed.

He said a third sham app, Golden Cup, promoted as a World Cup live scores and fixtures aid, was advertised to soldiers in Hebrew on Facebook. The app streamed videos of impressive goals from previous tournaments and listed details about each team. “It was actually a very good one,” the official said.

The IDF said the hacks had failed to cause any “security damage at all” and said most soldiers and others working for the army who were approached to download the app had refused and reported the incident to their commanders.

However, it conceded that some soldiers had downloaded the apps. While it did not provide an exact figure, the military said “less than 100” installed at least one program on their phones.

The IDF, which had been monitoring the hack for months, called its operation Broken Heart as it claimed the honeytrap had failed to seduce its soldiers effectively. It said both serving men and women were targeted.

Hamas attempted a similar strategy in January 2017 but used less advanced apps sold as social chat platforms, according to the military.

As part of a new awareness programme to protect its secrets, the IDF has started to send its own fake messages to soldiers that asks them to click on a link. If the soldier opens the link, a warning pops up and they have to meet their commanding officers to debrief on online security.

An official for Hamas, the Palestinian militant and political faction that runs the Gaza Strip, declined to comment.