Middle East Turmoil

Israel, Hamas and the social media weapon

While the bombs and bullets fly, Israel and Hamas are investing in a less violent but very effective weapon: social media.

War, secrets & social media
VIDEO3:0803:08
War, secrets & social media

The Israel Defense Forces created its social media unit as part of its public affairs department in 2008 during Operation Cast Lead, another round of fighting against Hamas in Gaza that lasted three weeks.

Read MoreHamas' money troubles

The unit was formed by Lt. Col. Avital Leibovich, who retired from her post as head of the department two months before the current round of fighting broke out. Forty soldiers are in the unit, most ages 18 to 20, with four more experienced officers overseeing their work.

Three of the IDF unit's graphics are featured below:

"Social media is actually a war zone for us here in Israel," Leibovich said. Israel has complained for years about news coverage that it claims is slanted toward the Palestinians.

"Here we can have our own campaigns, we can decide on the size of the headline, what that headline will be and exactly which pictures and which footage to upload," she said.

The unit is based in a plain building in central Jerusalem. Nearby are many of the bureaus for international news organizations. The IDF social media team uses about 30 technology platforms and has different sections operating in six languages: Arabic, English, French, Spanish, Russian and Hebrew for domestic consumption.

The group's use of Twitter has been the medium most noticed and followed by the international media, Leibovich said, even though inside Israel, Twitter is the least popular of the social media networks.

Since Israel sent ground troops into Gaza on July 12, the IDF has tweeted hundreds of times. The images they send are clearly designed to get public opinion on Israel's side. The team designs highly produced graphics in coordination with intelligence units showing Hamas gunmen launching rockets from schools and firing from the windows of hospitals. The unit also uses YouTube to post videos collected from helicopter and fighter jet cockpits, and from cameras aboard Israeli drones.

Read MoreIsraelis rush to apps in Gaza conflict

Hamas gunmen firing from the windows of a home
VIDEO0:3000:30
Hamas gunmen firing from the windows of a home

Despite the unit's efforts however, it is clear that public opinion doesn't always line up behind Israel. "I think that proportionally you have more pro-Palestinians online," Leibovich said. She cites an aggressive online presence from the BDS movement, a group that advocates boycotts, divestment and sanctions against Israel, for "fueling the atmosphere online against Israel."

Hack attacks

Hamas did not respond to multiple requests through social media for a comment. But Hamas has an online network complete with Twitter accounts from the organization itself and personal accounts from the leadership. It also has a website in English, Arabic and Turkish. Hamas' website, however, has been in and out of service due to persistent hacking attacks.

Hamas has also proven it can hack back. Hamas took over the Facebook page of Domino's Pizza in Israel as the fighting was beginning this month, using it to post this warning: "Today we will strike the depths of Israel, Tel Aviv, Haifa, Jerusalem, Ashkelon, Ashdod more than 2,000 rockets."

You'd better not show your faces above ground.
IDF Tweet to Hamas, 2012

The IDF public affairs office has even used social media to communicate directly with Hamas leadership. Leibovich remembers warning members of Hamas during another war in 2012 "you'd better not show your faces above ground."

—By CNBC's Jason Gewirtz