The boxes contained hardware which enabled users to watch Virgin Media television services without subscribing.
Mark Brighty from Leicester was arrested following an investigation by the Federation Against Copyright Theft (Fact) and Leicestershire Police.
Fact said he had sold up to 300 of the devices, which he imported from China.
Officers found the boxes, which he was selling for Â£40 each, alongside Â£600 worth of cocaine at his property earlier this year.
Brighty pleaded guilty to two charges under the UK Fraud Act as well as possession with intent to supply a Class A drug.
"Intellectual property crime is not a victimless crime - it costs the creative industries and the UK economy hundreds of millions of pounds each year," said Kieron Sharp, director general of Fact.
"This case demonstrates that copyright theft is often considered by criminals to be a low risk activity with high returns and so is often used to fund other serious organised crime; in this case dealing Class A drugs."
Security expert Professor Alan Woodward from Surrey University said it was an "old school" approach to hacking.
"You tend to find that those trying to do this will sell you software that can run on some other piece of hardware. Supplying the hardware means the hacker is rather easier to track down," he told the BBC.
"However, set-top boxes are quite specialised so finding a piece of more generic hardware on which to run such software is not easy.
"You do see specialised hardware being sold for hacking but it tends to be to enable hackers to break into networks or conduct their hacking operations rather than being a one trick pony as in this case," he added.
"I'm quite surprised someone went to all this trouble as there are easier ways of illegally making money from hacking online."
A man has been sentenced to 32 months in prison for selling illegal TV set-top boxes online.