The other week, I was looking at a photograph of a penis-shaped vegetable, wondering about its significance for geopolitics. The picture, and thousands like it, had been posted by a pro-Kremlin Twitter account popular in Germany. But between images of bum-like pumpkins, the handle retweeted horrific photographs of children wounded or killed as a result of the war in East Ukraine, their fates blamed on Kiev and the West.

The amusing vegetables were there to pull in followers; the other images to promote a political cause. Later the Twitter feed transformed, instead retweeting Kremlin state media and far-right parties.

Who was behind the account? The Kremlin itself? Activists? Information war profiteers? I’d come across it when researching foreign (dis)information operations during the German election. The campaigns came from all sorts of places. The German-language arm of Kremlin state broadcaster Sputnik was blatantly biased towards the anti-immigrant, far-right Alternative für Deutschland party. Pro-AfD (and most likely German) automated Twitter accounts would avidly retweet Sputnik stories, pushing them into social media spaces where Kremlin content sat cozily side by side with locally concocted conspiracy theories about how the vote would be rigged against the AfD. There were also US and European alt-right activists who congregated on the message board 4chan, and more obscure sites such as Discord, to create “meme factories”, partnering with German far-right movements to hijack Twitter hashtags. This helped the AfD dominate social media and, ultimately, win seats in parliament for the first time.

The manga-themed, racist memes were then reposted by a network of bots which turned out to be run from Nizhny Novgorod. The hacker behind it said he had done the work for free, as he shared “mutual benefits” with the AfD. He quoted a usual price of €2,000 for 15,000 posts and retweets. The botnet also specialised in smearing Russian opposition figures and promoting escort services in Dubai. Meanwhile, we found that the Epoch Times – a publication originally created to support the Chinese Falun Gong sect repressed by the government in Beijing – had become one of the more profitable “alternative” media outlets in Germany, with a mix of Kremlin-sourced, German anti-immigrant and pro-Falun Gong stories. Indeed, by the end of our research it was clear that one can’t really talk, as one could during the Cold War, of “foreign” information operations launched against a coherent domestic news space. Instead, one has transnational, ever-shifting networks of toxic speech and disinformation, including both state and non-state actors. These can operate for financial, ideological or simply personal reasons, allying and mutually reinforcing one another to pursue quite different agendas. Once upon a time, techno-utopians dreamed of a global information village. We have one. But it’s nasty.

This new worldwide web of disorder is the subject of David Patrikarakos’s timely and talented War in 140 Characters. The author has a suitably global background: as a British-Greek-Jewish-Iranian-Iraqi – and a Poynter fellow in journalism at Yale University – he has the ability to understand local dynamics as he relates stories from the Middle East to the Midlands, Ukraine to the West Coast of the US. He introduces us to the people on the front lines of digital battles, the personalities behind the internet accounts: guilt-ridden Russian trolls; young women groomed online by Isis; Facebook Sherlocks debunking Putin’s lies from suburban English bedrooms.

This, however, is not mere information war tourism. Patrikarakos has a provocative thesis. His argument is that social media is transforming both the nation state and war. No longer can we talk of one nation battling another through propaganda: the field is now swarming with individual actors, each a little propaganda state in their own right. And in this post-national landscape, the idea of war is also changed. There is no longer any clear dividing line between “peace” and “war”, ideas which belong to the logic of relations between nations who have sole authority to wage war and conclude peace. Rather there is a permanent smudge of tension, messy and always unstable.

One chapter brings out the dynamic between traditional state actors and new players particularly strikingly. Alberto Fernandez was the Arabic-speaking US diplomat charged with tackling Isis online. Before he arrived, US online information campaigns had followed a fluffy approach, trying to convince young people drawn towards Isis that the US held no ill will towards Islam, with videos of “happy Muslims” enjoying life in America. This failed. The reality of the US as a bringer of death and destruction to the Middle East was too strong to override. Isis propaganda showed graphic videos of US soldiers torturing Muslims at Abu Ghraib prison in Iraq.

Isis also used the cultural power of the US against it, with propaganda videos modelled on American computer games and films which enlisted recruits to the terror group’s cause. It distributed spectacular execution videos which were then amplified by the mainstream western media, while a seemingly unlimited number of social media activists proliferated its work. On social media, it is more important to have viral material which can spread through horizontal networks of users, rather than the “vertical” power of state-run broadcasters which wielded so much power during the 20th century.

Fernandez believed in taking the fight to Isis. He realised the terrorists’ weak spot was the difference between their professed claim of delivering the ideal caliphate, and the grim reality of the society they had created. With a team of 48, he created sarcastic videos such as one entitled “Welcome to Isis Land”. “Run, do not walk to Isis Land,” said the opening line, with footage of fighters throwing bodies of Muslims into a ditch. “You can learn useful skills for the global Muslim community. Blowing up mosques! Crucifying and executing Muslims!” This was followed by close-up shots of blindfolded Muslims tied to wooden stakes and being shot in the back of the head.

The video was a success, being viewed three million times. But Fernandez became frustrated by the logic of government, where messages have to be cleared, where political loyalties meant he could never criticise terrible US allies, where every video was branded with the US government’s logo. “We fell between two stools,” remembers Fernandez. “My vision was too edgy for government and not edgy enough for the space we were in.” He quit.

Patrikarakos’s book offers no easy answers as to how the present messaging mess can ever be cleared up. Top-down censorship is both unethical and unpractical. The only way forward, perhaps, is for tech companies, policymakers, civic groups and the media to team up and define what exactly constitutes unacceptable behaviour online, and how they can all counteract it. We are far away from that now, with governments frustrated by tech companies’ lack of co-operation. In the UK, MPs are pressuring tech firms to explore covert Kremlin digital campaigns. There have been tantalising if very slim signs of activity around Brexit and the Scottish referendum, which have already led to a slapstick face-off between the UK and Russian foreign ministers. More worryingly, researchers at Cardiff University have spotted Russian accounts which look to inflame ethnic and religious tensions after terrorist attacks.

In the meantime, all one can do is hope that groups who believe in spreading the values of human rights and accurate information become as good at acting online as the far right, the Kremlin or Isis. That will require well-meaning NGOs and a public service-minded media to step into the battles of the digital age, understand how their opponents co-ordinate across borders online, and learn to disrupt and counter them with better messages and ideas of their own. At present they are far behind.

War in 140 Characters: How Social Media is Reshaping Conflict in the Twenty-First Century

David Patrikarakos

Basic Books, 320pp, £25

Peter Pomerantsev is the author of “Nothing is True and Everything is Possible: Adventures in Modern Russia” (Faber & Faber)