A fifth grader has admitted of being the mastermind behind hacker attacks that took down government websites during the 2012 Quebec student protests and passing some of the hacked data to the Anonymous group in exchange for video games.

The 12-year-old Canadian boy has pleaded guilty to causing three incidents that paralyzed a number of government websites including that of the Quebec Institute of Public Health, and the Chilean government.



Some sites were out of service for as long as two days, the Toronto Sun reports, while thousands of students were rallying against tuition fee hikes in Quebec in 2012, clashing with police and disturbing public order.



Police estimate that the child caused $60,000 in damages, as he appeared before the court accompanied by his father and a lawyer on Thursday.



In court, the lawyer had told the judge that the 12-year-old's actions were not politically motivated.



"He saw it as a challenge, he was only 12 years old," his lawyer said. "There was no political purpose," as quoted by Toronto Sun.



The boy, who has been in hacking since the age of nine, was practicing three basic types of attacks, a police expert told the court.

Distributed denial of service (DDoS) attack was one of the methods used by the fifth grader to break the government servers by flooding them with traffic and rendering them ineffective.



Another way the young Montreal hacker disabled the systems was by altering information and making it appear as a homepage with his own information. In such an attack, known as website defacement, the hacker gets access to a web server of the target and replaces the original page with a fake one.



The child also exploited security holes to access database servers. The boy allegedly had managed to mine personal information belonging to the sites' administrators and users, and sent some of the mined information to the hacktivist group Anonymous in exchange for video games.



Others involved in the hacking attack have reportedly been arrested but it was the boy who opened the way.



“And he told others how to do it,” explaining it was easy to hack, but not so easy to remain untraced, a police expert testified in Montreal court on Thursday.



According to the paper, a detailed report into the allegations will be handed over next month when the 12-year-old is expected to be sentenced.



It is not the first time in Quebec’s history that a minor has plead guilty to hacking charges.



In 2001, a 17-year-old Canadian hacker was sentenced to an eight month juvenile term for crippling several web sites when he was 15-years-old, including that of Amazon, eBay, Yahoo and CNN, causing an estimated $1.7 million in damage.



Known as the "Mafiaboy," the teenager pleaded guilty to more than 50 charges related to the attacks. The judge in Montreal also banned the teenager from owning any non-commercial computer and talking to other hackers.



In his book, "Mafiaboy: A Portrait of the Hacker as a Young Man" published in 2001, Michael Calce (Mafiaboy's real name), said that his attacks in 2000 were "illegal, reckless and, in many ways, simply stupid."