Islamic State militants are harnessing the power of the Internet to create a militant network with near global reach just a quarter of a century since the creation of the World Wide Web, Hannigan said.
"The challenge to governments and their intelligence agencies is huge and it can only be met with greater co-operation from technology companies," Hannigan wrote in the Financial Times newspaper.
"If they are to meet this challenge, it means coming up with better arrangements for facilitating lawful investigation by security and law enforcement agencies than we have now."
Twitter and Facebook, which owns WhatsApp, declined immediate comment before U.S business hours. GCHQ also declined to comment on the article.
Such a strong public warning from one of the West's most powerful spies indicates the gravity of the perceived threat and a sense of frustration felt by many spies about the damage done by former National Security Agency contractor Edward Snowden.
Media reports based on previously top secret documents stolen by Snowden, a U.S. citizen who now lives in Moscow, laid bare the extent of American and British surveillance, including demands spies made to telephone and technology companies.
In the wake of the Snowden revelations, GCHQ, which stands for Government Communications Headquarters, was accused by privacy groups and some lawmakers of the widespread illegal monitoring of electronic communications.
British ministers denied any illegality and top spies dismissed any sinister intent, saying they sought only to defend the liberties of Western democracies.
The director general of the MI5 Security Service, Andrew Parker, warned last year that the revelations were a gift to terrorists because they had exposed GCHQ's ability to track, listen and watch plotters.
"Young foreign fighters have learnt and benefited from the leaks of the past two years," Hannigan said.
"ISIS IT department"
GCHQ, MI5 and Britain's foreign spy service, MI6, need greater support from the private sector, said Hannigan, who singled out U.S. technology companies in particular. No British-based companies were named.
Hannigan said Islamic State militants, who have seized swathes of land in Syria and Iraq, were harnessing the power of technology in a new and dangerous way.
While al Qaeda mainly hid in the shadows of the Internet using it as a modern drop box or secret ink, Islamic State is noisily using it to advertise itself, radicalise new recruits and intimidate with grotesque videos of beheadings, he said.
"The ISIS (Islamic State) leadership understands the power this gives them with a new generation," Hannigan said, adding that militants had used World Cup and Ebola hashtags on Twitter messages to pitch their views to a wider audience.
"The extremists of ISIS use messaging and social media services such as Twitter, Facebook and WhatsApp," he said.
Hannigan cast GCHQ, which fishes for intelligence in the world's cyber oceans from a futuristic building called the doughnut in the western English spa-town of Cheltenham, as hindered by technology companies and a mistaken assumption that privacy was an absolute right.
"It can seem that some technology companies are in denial about its misuse," he said. "I suspect most ordinary users of the Internet ... do not want the media platforms they use with their friends and families to facilitate murder or child abuse."
Emma Carr, director of the Big Brother Watch civil liberties group, said technology companies had assisted spy agencies and that the government had failed to provide evidence to substantiate claims the companies were being obstructive.
"The government and agencies have consistently failed to provide evidence that Internet companies are being actively obstructive," Carr said.
© Thomson Reuters 2014