[![Logo](https://www.paloaltonetworks.com/wp-content/uploads/2021/07/PANW_Parent.png)](https://www.paloaltonetworks.com/)  
[![Unit42 Logo](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/unit42-logo-white.svg)](https://unit42.paloaltonetworks.com/)  
Menu

* [Tools](https://unit42.paloaltonetworks.com/tools/)
* [ATOMs](https://unit42.paloaltonetworks.com/atoms/)
* [Security Consulting](https://www.paloaltonetworks.com/unit42)
* [About Us](https://unit42.paloaltonetworks.com/about-unit-42/)
* [**Under Attack?**](https://start.paloaltonetworks.com/contact-unit42.html)
* [Threat Research Center](https://unit42.paloaltonetworks.com "Threat Research")
* [Threat Research](https://unit42.paloaltonetworks.com/category/threat-research/ "Threat Research")
* [Cybercrime](https://unit42.paloaltonetworks.com/category/cybercrime/ "Cybercrime")  
  [Cybercrime](https://unit42.paloaltonetworks.com/category/cybercrime/)

# Unauthorized Coin Mining in the Browser

![Clock Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-clock.svg) 10 min read

* ![Profile Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-profile-grey.svg)  
  By:
  
  * [Wei Xu](https://unit42.paloaltonetworks.com/author/wei-xu/)
  * [Yuchen Zhou](https://unit42.paloaltonetworks.com/author/yuchen-zhou/)
  * [Wayne Xin](https://unit42.paloaltonetworks.com/author/wayne-xin/)

* ![Published Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-calendar-grey.svg)  
  Published:October 17, 2017

* ![Tags Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-category.svg)  
  Categories:
  
  * [Cybercrime](https://unit42.paloaltonetworks.com/category/cybercrime/)
  * [Threat Research](https://unit42.paloaltonetworks.com/category/threat-research/)

* ![Tags Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-tags-grey.svg)  
  Tags:
  
  * [Bitcoin](https://unit42.paloaltonetworks.com/tag/bitcoin/)
  * [Coinhive](https://unit42.paloaltonetworks.com/tag/coinhive/)
  * [Cryptocurrency](https://unit42.paloaltonetworks.com/tag/cryptocurrency/)
  * [Cryptocurrency mining](https://unit42.paloaltonetworks.com/tag/cryptocurrency-mining/)

* [![Download Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-download.svg)](https://unit42.paloaltonetworks.com/unit42-unauthorized-coin-mining-browser/?pdf=download&lg=en&_wpnonce=7bc5edd981 "Click here to download")

* [![Print Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-print.svg)](https://unit42.paloaltonetworks.com/unit42-unauthorized-coin-mining-browser/?pdf=print&lg=en&_wpnonce=7bc5edd981 "Click here to print")

Share![Down arrow](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/down-arrow.svg)

* ![Link Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-share-link.svg)
* [![Link Email](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-sms.svg)](mailto:?subject=Unauthorized%20Coin%20Mining%20in%20the%20Browser&body=Check%20out%20this%20article%20https%3A%2F%2Funit42.paloaltonetworks.com%2Funit42-unauthorized-coin-mining-browser%2F "Share in email")
* [![Facebook Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-fb-share.svg)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Funit42.paloaltonetworks.com%2Funit42-unauthorized-coin-mining-browser%2F "Share in Facebook")
* [![LinkedIn Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-linkedin-share.svg)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Funit42.paloaltonetworks.com%2Funit42-unauthorized-coin-mining-browser%2F&title=Unauthorized%20Coin%20Mining%20in%20the%20Browser "Share in LinkedIn")
* [![Twitter Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-twitter-share.svg)](https://twitter.com/intent/tweet?url=https%3A%2F%2Funit42.paloaltonetworks.com%2Funit42-unauthorized-coin-mining-browser%2F&text=Unauthorized%20Coin%20Mining%20in%20the%20Browser "Share in Twitter")
* [![Reddit Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-reddit-share.svg)](https://www.paloaltonetworks.com//www.reddit.com/submit?url=https%3A%2F%2Funit42.paloaltonetworks.com%2Funit42-unauthorized-coin-mining-browser%2F&ts=markdown "Share in Reddit")
* [![Mastodon Icon](https://unit42.paloaltonetworks.com/wp-content/themes/unit42-v6/dist/images/icons/icon-mastodon-share.svg)](https://mastodon.social/share?text=Unauthorized%20Coin%20Mining%20in%20the%20Browser%20https%3A%2F%2Funit42.paloaltonetworks.com%2Funit42-unauthorized-coin-mining-browser%2F "Share in Mastodon")
  Cryptocurrencies have taken the world by storm. From the biggest player Bitcoin to newcomers such as Monero and Ethereum, cryptocurrency mining has become a hot industry due in part to powerful, dedicated mining hardware or by utilizing graphics cards' parallel computing power. Recently, browser coin mining has taken off, for a lot of different reasons. Although the computing power per instance is much less than dedicated hardware provides, being able to utilize many users on various sites more than make up for it. There is already some media coverage on this, such as [BBC](https://www.bbc.com/news/technology-41518351), and [malwarebytes](https://malwaretips.com/blogs/remove-coinhive-miner-virus/). While we do not consider crypto-currency mining inside browsers malicious by itself, often such mining is going on without the end user's consent or even knowledge that makes this practice shady and despicable.

[Coinhive](https://coinhive.com/), one of the more popular browser-mining services out there offers site owners a piece of JavaScript for easy integration. Site owners use site visitors' CPU time to mine XMRs (Moneros) for Coinhive, and Coinhive pays out 70% of mined value to site owners. A new player, [crypto-loot](https://paloaltonetworks.sharepoint.com/sites/u42/Shared%20Documents/Publishing/Draft/crypto-loot.com) emerged recently which offers similar services but pays out 88% of revenue.

## Coinhive Integration

On the official Coinhive homepage, we found detailed documentation on how to integrate the mining scripts onto any given website. Owners can use the easy version:

var miner = new CoinHive.Anonymous('YOUR\_SITE\_KEY'); miner.start();

|-----|---------------------------------------------------------------------|
| 1 2 | var miner = new CoinHive.Anonymous('YOUR\_SITE\_KEY'); miner.start(); |

or more complicated version that gives control over how the end user's CPU time should be used, e.g. how many threads, should the mining throttle.  
var miner = new CoinHive.User('YOUR\_SITE\_KEY', 'john-doe', { threads: 4, autoThreads: false, throttle: 0.8, forceASMJS: false });

|-------------|-----------------------------------------------------------------------------------------------------------------------------------|
| 1 2 3 4 5 6 | var miner = new CoinHive.User('YOUR\_SITE\_KEY', 'john-doe', { threads: 4, autoThreads: false, throttle: 0.8, forceASMJS: false }); |

Higher thread number and/or lower throttle number will result in more CPU usage in client's browser. With higher CPU occupation percentage, end users will likely experience sluggish behavior and poor experience on the websites.

## Tracking Coinhive Integrations

We have been tracking the inclusion of Coinhive mining script (coinhive.min.js) for a week in our PANDB unknow