Jump to content

How to block Bitcoin Mining in your browser


Recommended Posts

Bitcoin mining can be profitable, and that is likely the reason why we have seen desktop miners and now also browser miners being pushed on to user devices.

The Piratebay experimented with running a Bitcoin miner instead of ads recently, and created quite the uproar as users started to notice that the new monetization method would yank up CPU usage to 100%.

An update of the Google Chrome extension SafeBrowse integrated a JavaScript miner as well in the extension, and led to the removal of the extension from Google's Chrome Web Store.

Any site you visit in the browser, and any browser extension, may run Bitcoin mining operations. While it seems highly unlikely that popular or user respecting sites or extensions will do that, it seems likely that these first incidents were just the first wave of mining operations to come.

Computer users have a couple of options when it comes to protecting their devices against browser-based Bitcoin mining.

While it is certainly possible to use content blocking extensions to prevent mining scripts to run in first place on sites, these usually won't block extension-based mining.

Probably the best option right now is to block known Bitcoin mining domains. One of the better options to do that is to add these to the hosts file of the operating system so that these domains redirect to localhost.

The effect is that sites and extensions won't be able to contact these domains anymore because of the redirect. Downside is that you need to add new domains and modify existing ones if the need arises manually.

hosts file block bitcoin mining

Windows users need to do the following to add Bitcoin mining domains to the hosts file:

  1. Open Explorer or another file manager on the system, and go to C:\Windows\System32\drivers\etc.
  2. Open the file hosts in a plain text editor, for instance Notepad.
  3. Add the line coin-hive.com to the end of the document. Make sure you press the Tab-key after entering the IP address
  4. Save the document.

What this does is redirect any request to coin-hive.com to the IP address (the local device).

Tip: On Linux, you can run sudo nano /etc/hosts, on Mac OS X, sudo nano /private/etc/hosts. Replace nano with whatever editor you favor.

This takes care of Bitcoin mining scripts hosted by coin-hive.com, the service that both the Pirate Bay and the Chrome extension used. Note that this won't take into account self-hosted scripts. You need to add those separately to the hosts file to block them as well.

Another option that you have is to disable JavaScript on these sites. This may not be possible all the time, as sites may require JavaScript for some or all of functionality, but Bitcoin miners based on JavaScript cannot run if JavaScript is disabled.

Check out these resources for additional information on the hosts file:


Article source https://www.ghacks.net/2017/09/22/how-to-block-bitcoin-mining-in-your-browser/


Link to comment
Share on other sites

  • Replies 4
  • Views 2k
  • Created
  • Last Reply

Just think if we would  of bought  these bitcoins some years ago when they was cheap we all be bloody rich by now  there  is a  blocker  for chrome  for this already  and for power users uMatrix  blocks it out the box  its just a 3rd party website  and any script blocker  can block  it . It's not hard to block.  I'm not going use  no software with a miner in it for free servires  like windscribe vpn are doing .



Windscribe too enters the miner business


Someone Made an Ad Blocker But for Cryptocurrency Mining



Link to comment
Share on other sites

Add these to:



This is going to help block all maybe.


Link to comment
Share on other sites

On 9/22/2017 at 4:23 AM, Togijak said:

Windows users need to do the following to add Bitcoin mining domains to the hosts file


Every time something bad comes up some entity/person says add it to your hosts file.  If I had done that every time it was said since I joined nsane I would have over 15,000 entries in my hosts file, which is about 14,750 too many (those numbers may be slightly exaggerated).  It is much easier, and OS friendly, to block the IPs in a firewall.  I have thousands of IPs blocked in mine and it has no effect on the OS or kernel like blocking them in the hosts file does.  On my newest system I use a whitelist in my firewall, and only allow connections from the IPs listed.  This is a much safer method of securing your system, though it requires a little work monitoring connection attempts and deciding which ones you want to let through. For those that run illegal software it makes it much easier since everything is blocked initially, so you don't need to worry about blocking something to keep the software running. It also allows the option of choosing an outbound or inbound connection without allowing both and designating the connection type: udp, tcp, or both.

Link to comment
Share on other sites

Thread moved from Security and Privacy News.....


As i feel it's more of a Tutorial than News.....

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...