An American hacker ‘in his pyjamas’ has taken down North Korea’s internet in revenge for a cyber attack carried out against him by North Korea’s hackers.

The hacker named only as P4x, launched repeated ‘distributed denial of service’ (DDoS) attacks against North Korea, crippling the country’s government-operated public-access websites and slowing email traffic.

DoS attacks are attacks that flood a system with fake traffic, consuming available bandwidth and limiting processing capacity of servers so that a website becomes unavailable.

In North Korea just a small number of trusted officials and academics are permitted to use the World Wide Web or browser and only a small number of North Korean websites are connected to the wider global internet.

These include state airline Air Koryo and Naenara – the official web portal of the North Korean government – which spreads state news and propaganda on behalf of the leading Communist Party, headed by leader, Kim Jong Un.

In the last two weeks, these North Korean websites have come under a sustained attack from P4x, with Pyongyang thinking they were facing cyber attacks from a Western power.

North Korean government officials suspected the hacks were being done in response to the recent missile tests that have been carried out by Pyongyang.

But according to Wired Magazine, the DDoS attacks were not the work of the US intelligence agencies of any of the world’s big cyber powers like China, Russia or even the UK.

However, the report says ‘one American man in a T-shirt, pyjama pants and slippers, sitting in his living room night after night, watching Alien movies and eating spicy corn snacks,’ was responsible, .

The magazine added; ‘periodically walking over to his home office to check on the progress of the programs he was running to disrupt the internet of an entire country.’

P4x told Wired he was able to exploit vulnerabilities in North Korea’s out-of-date operating systems, and launch his attacks from the comfort of his own home.

‘It felt like the right thing to do here. If they don’t see we have teeth, it’s just going to keep coming,’ he told the publication. ‘I want them to understand that if you come at us, it means some of your infrastructure is going down for a while.’

He explained that his cyber attacks on the state came after he himself was unsuccessfully targeted by Pyongyang, with DPK hackers attempting to break into his own personal network a year ago to get access to his hacking technology.

He said he was able to catch the breach, then he opened the file the hackers used in an attempt to gain access to his network with a virtual computer (thus isolating the breach), and study it himself. He found the hack had been launched, to his surprise, from North Korea.

He added that he reported the incident to American authorities such as the FBI, but was ignored. ‘If no one’s going to help me, I’m going to help myself,’ he said.

The United Nations has reported 35 countries have been targeted by North Korea hackers in the country, targeting financial institutions and cryptocurrency exchanges – earning an estimated $2 billion.

In 2016, North Korean hackers stole $1 billion from the Bangladesh central bank.