Liam Reece Watts used specialist software to overload the Greater Manchester Police and Cheshire Police websites in separate attacks which temporarily brought down the sites.
He said the attack on Cheshire Police was in retaliation for a previous conviction over a bomb hoax which he made days after the Manchester Arena bombing.
The systems were targeted in distributed denial of service, or DDoS, attacks, in which websites are targeted by a network of computers, or botnet.
The attack on the Cheshire Police website also targeted the Cheshire police and crime commissioner's site.
Watts, from Chorley in Lancashire, bragged on social media and said he enjoyed bringing the sites down following the attacks in August 2018 and March 2019.
A Twitter account with the name Synic, which claimed responsibility for the attack in August, was traced back to Watts.
He admitted to carrying out the attack after police searched his home.
But while investigations into the first attack were still ongoing, a tweet posted on an account linked to Watts said: "@Cheshirepolice want to send me to prison for a bomb hoax I never did, here you f****** go, here is what I'm guilty of."
The 20-year-old pleaded guilty at Chester Crown Court to two counts of unauthorised acts with intent to impair operation of or prevent or hinder access to a computer.
Judge Patrick Thompson said the crimes were "an attack on law and order in this country".
Detective Sergeant Chris Maddocks from Cheshire Police described Watts as "an immature individual".
Watts was previously convicted of unauthorised use of a computer over a similar attack on his college, and also had a conviction for attempted robbery.
Patrick Williamson, defending, said Watts had "significant difficulties" including ADHD and an alcohol-related neuro development disorder.