Crypto-jackers slip Coinhive mining code into YouTube site ads

Trend Micro suggests disabling JavaScript in browsers

By Thomas Claburn in San Francisco


The hijacking of CPU cycles through crypto-mining JavaScript code has surged over the past few days, according to security biz Trend Micro.

The reason appears to be a distribution campaign that piggybacks on Google's DoubleClick ads that appear on YouTube among other sites.

"We detected an almost 285 per cent increase in the number of Coinhive miners on January 24," said Trend Micro researchers Chaoying Liu and Joseph C. Chen on Friday in a blog post, noting that traffic to five malicious domains picked up on January 18. "After closely examining the network traffic, we discovered that the traffic came from DoubleClick advertisements."

Coinhive is JavaScript code designed to mine Monero, a cryptocurrency favored by online criminals and others because of its privacy features. Its creators position the code as a way for websites to make money without relying on ads.

Stealth web crypto-cash miner Coinhive back to the drawing board as blockers move in


It's when the code gets used without consent that there's a problem. And that's been happening more frequently because it's almost a victimless crime. People may complain when their data gets stolen, but few even notice when their computer is asked to do covert calculations.

Liu and Chen say that the scheme relies on two separate web mining scripts, hosted on AWS, called from a web page that presents the DoubleClick ad. When the web page is loaded, a legitimate ad gets presented while a randomly generated number decides which of the two mining scripts gets called.

Ninety per cent of the time, coinhive.min.js runs; the other 10 per cent of the time, it's a script named mqoj_1.js – configured to contribute to a separate mining pool as a means of avoiding the 30 per cent CoinHive commission.

At least that's the breakdown seen by Trend Micro. Variant code posted to Pastebin shows the mqoj_1.js file being run only 3 per cent of the time.

Either way, the scripts are set to consume 80 per cent of the CPU resources on the computer in question.

Google says it took action against the ads once it became aware of them.

"Mining cryptocurrency through ads is a relatively new form of abuse that violates our policies and one that we’ve been monitoring actively," a spokesperson told The Register in an email. "We enforce our policies through a multi-layered detection system across our platforms which we update as new threats emerge. In this case, the ads were blocked in less than two hours and the malicious actors were quickly removed from our platforms."

The problem Google faces is that those abusing its systems rely on cloaking techniques to conceal the nature of the code and fake accounts that can be abandoned without consequence. As with email spammers, it's a game of Whac-A-Mole.

Google confronted a similar issue in November when it emerged that miscreants were misusing Google Tag Manager to distribute coin crunching code. The Chrome extension SafeBrowse was also spotted quietly taxing processors to collect Monero. ®

Sign up to our NewsletterGet IT in your inbox daily


More from The Register

Hackers latch onto new Apache Struts megavuln to mine cryptocurrency

Underground forums alight with Struts chat, we hear

Another banking trojan is trying to loot your cryptocurrency wallets

Trickbot variant adds Coinbase exchange to monitored sites

And Oracle E-biz suite makes 3: Package also vulnerable to exploit used by cryptocurrency miner

Hat trick!

UK reaches peak Bitcoin as bin firm accepts cryptocurrency

'It's not a publicity stunt,' says

Internet Society: Cryptocurrency probably not an identity system

ID on a blockchain? Maybe. ID on Bitcoin? Forget it

Paris Hilton inflates cryptocurrency bubble some more, backs Initial Coin Offering

Meanwhile, China says of ICOs: That's hot, we mean, er, banned

Dollar for dollar, crafting cryptocurrency sucks up 'more energy' than mining gold, copper, etc

Maybe time to put down that Bitcoin-mining rig and pick up that spade?

Bitcoin backer sues AT&T for $240m over stolen cryptocurrency

Michael Terpin not happy about funds-draining SIM swap fraud

Russia to block access to cryptocurrency exchanges' websites – report

Updated Central bank deputy governor calls them 'dubious'

China bans cryptocurrency fundraising schemes

Bitcoin, Ethereum values dip after 'Initial Coin Offerings' ruled dangerously disruptive