Jerusalem (AFP) - Israel's military said on Sunday it had thwarted an attempted malware attack by Hamas that sought to gain access to soldiers' mobile phones by using seductive pictures of young women.

The phones of a few dozen soldiers were affected, but the military "does not assess that there has been a substantial breach of information", said Lieutenant Colonel Jonathan Conricus, an army spokesman.

Conricus said this was the third attempted malware attack by Hamas in less than four years, but that the latest effort indicated the Islamist group, which controls the Gaza Strip, had improved their capacity to wage cyber-warfare.

"What we are talking about today is more advanced," he said. "They are upping their game."

According to Conricus, the attacks began with messages that purported to be from young, "attractive-looking" women.

The texts were delivered through Facebook, WhatsApp and Instagram as well as the messaging application Telegram, which Israel said Hamas had not used previously.

To avoid engaging in voice calls with soldiers, the messengers posing as young women claimed to be hard of hearing or new immigrants with poor Hebrew, Conricus said.

Once contact was made, subsequent messages encouraged soldiers to click on a link to download an application that would allow for an easier exchange of photos.

These apps, which the military identified as Catch&See, ZatuApp and GrixyApp, sought to infect the soldiers phones with malware that would give Hamas total access to the device.

The army said the attack began several months ago and that Israel took "defensive activity" in recent days, but did not rule out further retaliation.

"Hostile actions by Hamas in the virtual world bear repercussion in the real world," Conricus said.

Hamas and Israel have fought three wars since 2008 but over the past year, the Islamists had gradually shaped an informal truce with Israel, under which the Jewish state has eased its crippling blockade of Gaza.

Israel justifies the blockade by the need to contain Hamas -- designated a terrorist organisation by much of the West -- which has controlled the Palestinian enclave since 2007.