{"id":11411,"date":"2018-02-07T16:40:10","date_gmt":"2018-02-08T00:40:10","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2018\/02\/07\/news-5182\/"},"modified":"2018-02-07T16:40:10","modified_gmt":"2018-02-08T00:40:10","slug":"news-5182","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2018\/02\/07\/news-5182\/","title":{"rendered":"The Growing Trend of Coin Miner JavaScript Infection"},"content":{"rendered":"<p><strong>Credit to Author: Eric Chong| Date: Wed, 07 Feb 2018 11:45:00 +0000<\/strong><\/p>\n<div class=\"entry\">\n<h3>1. CharCode JavaScript&nbsp;<\/h3>\n<p>On 6<sup>th<\/sup> December 2017, FortiGuard Labs discovered a compromised website &#8211;&nbsp;acenespargc[.]com. Looking into the source code, we noticed a suspicious encrypted script which the uses <strong>eval()<\/strong> function to convert all the characters into numbers. We used a tool called <a href=\"http:\/\/jdstiles.com\/java\/cct.html\">CharCode Translator<\/a> to reverse the numbers back into characters. We were then able to retrieve a link which redirects to a scam page or phishing website.<\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture1.png\" style=\"border-width: 0px; border-style: solid; width: 600px; height: 439px;\" \/><\/p>\n<p align=\"center\"><em>Part 1<\/em><\/p>\n<p>&nbsp;<\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture2.png\" style=\"border-width: 0px; border-style: solid; width: 636px; height: 333px;\" \/><\/p>\n<p align=\"center\"><em>Part 2 <\/em><\/p>\n<p>The above is just a simple example. The threat actor can actually customize the phishing content by geographical location, and to better avoid detection, it will also disappear when it detects that you have visited the phishing page before.<\/p>\n<p>Using this technique, threat actors are able to hide malicious\/phishing\/advertising URLs from being seen with the naked eye. &nbsp;<\/p>\n<p>As you will see below, this technique has now been adopted by threat actors to hide Cryptocurrency mining JavaScript in compromised websites, so that whoever visits the website will be &ldquo;infected&rdquo; and their computer will start cryptomining for the threat actor. We classify this activity as malicious because it uses other people&rsquo;s resources without their permission.<\/p>\n<p>&nbsp;<\/p>\n<h3>2. Packer tool hides CoinHive script <strong>&nbsp;&nbsp;<\/strong><\/h3>\n<p>On the 28<sup>th<\/sup> of December, FortiGuard Labs learned about another malicious website using the very obfuscation technique we described above &ndash; romance-fire[.]com &ndash; through a referral from a customer. This website contained obscured malicious code for cryptocurrency mining.<\/p>\n<p>We uncovered the encoded script, and by using the <a href=\"http:\/\/matthewfl.com\/unPacker.html\">packer tool<\/a> to unpack it, we found the script has a connection to CoinHive.<\/p>\n<p align=\"center\">  <img decoding=\"async\" alt=\"breaking-news\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture3.png\" style=\"border-width: 0px; border-style: solid; width: 577px; height: 372px;\" \/><\/p>\n<p align=\"center\"><em>JavaScript from the source code<\/em><\/p>\n<p align=\"center\">  <img decoding=\"async\" alt=\"unpack\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture4.png\" style=\"border-width: 0px; border-style: solid; width: 551px; height: 374px;\" \/><\/p>\n<p align=\"center\"><em>Unpacking the JavaScript &ndash; Part 1<\/em><\/p>\n<p>We noticed that the URL (hxxp:\/\/3117488091\/lib\/jquery-3.2.1.min.js?v=3.2.11) didn&rsquo;t seem like a valid IP or domain. We did some research and found that &lsquo;3117488091&rsquo; is the decimal IP of 185.209.23.219 after we converted it at <a href=\"http:\/\/www.kloth.net\/services\/iplocate.php\">KLOTH.NET<\/a>. Below is the result:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture5.png\" style=\"border-width: 0px; border-style: solid; width: 551px; height: 280px;\" \/><\/p>\n<p>This site converted the URL &nbsp;to hxxp:\/\/185.209.23.219\/lib\/jquery-3.2.1.min.js?v=3.2.11. From the URL, we retrieved the same pattern of JavaScript, so we unpacked the Script again.<\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture6.png\" style=\"border-width: 0px; border-style: solid; width: 551px; height: 384px;\" \/><\/p>\n<p align=\"center\"><em>Unpacking the JavaScript &ndash; Part 2<\/em><\/p>\n<p>After a final round of unpacking, we were finally able to retrieve the script that contains CoinHive URLs:<\/p>\n<p align=\"center\"><img decoding=\"async\" alt=\"unpack2\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture7.png\" style=\"border-width: 0px; border-style: solid; width: 551px; height: 346px;\" \/><\/p>\n<p align=\"center\"><em>Unpacking the JavaScript &ndash; Part 3<\/em><\/p>\n<h3>3. Coin miner from GitHub&nbsp;<\/h3>\n<p>On 26<sup>th<\/sup> January 2018, we discovered another website &ndash;&nbsp;sorteosrd[.]com &ndash; which also mines cryptocurrency&nbsp;by hijacking a visitor&rsquo;s CPU. This cryptomining malware again allows hijackers to benefits from mining digital currency without the computer user&rsquo;s permission. We believe that this site might have been compromised or used by the webmaster.<\/p>\n<p align=\"center\">  <img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture8.png\" style=\"border-width: 0px; border-style: solid; width: 451px; height: 266px;\" \/><\/p>\n<p align=\"center\"><em>Source code of the website&nbsp;hxxp:\/\/sorteosrd.com:<\/em><\/p>\n<p>&nbsp;<\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture9.png\" style=\"border-width: 0px; border-style: solid; width: 545px; height: 450px;\" \/><\/p>\n<p align=\"center\"><em>Impact of surreptitious cryptomining on user&rsquo;s device<\/em><\/p>\n<p>As we can see from the screenshot above, coin miner dramatically slows down the PC as its CPU is fully utilized after visiting the site.<\/p>\n<h3>4. Compromised website &ndash; BlackBerry infected with CryptoCoin mining&nbsp;<\/h3>\n<p>Another example of a CoinHive script was found at a surprising compromised website &ndash; blackberrymobile.com.<\/p>\n<p align=\"center\"><img decoding=\"async\" alt=\"9cae0885135b83c1b7d1637a5880c0bf\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture10.png\" style=\"border-width: 0px; border-style: solid; width: 528px; height: 322px;\" \/><\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture11.png\" style=\"border-width: 0px; border-style: solid; width: 552px; height: 279px;\" \/><\/p>\n<p align=\"center\"><em>Even the Blackberry site was compromised for a short time to mine for Monero cryptocurrency.<\/em><\/p>\n<h3>5. Compromised website &ndash; Milk New Zealand infected with deepMiner tool<\/h3>\n<p>In addition, we also discovered that one of the largest dairy farm groups in New Zealand, Milk New Zealand, had also been compromised. Our AV lab detected malicious activity from the site, so we look into the source code and found a script using the <a href=\"https:\/\/github.com\/deepwn\/deepMiner\">deepMiner<\/a> tool at github to Mine Monero, Electroneum, Sumokoin, etc. See the screenshot below:<\/p>\n<p>&nbsp;<\/p>\n<p align=\"center\"><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture12.png\" style=\"border-width: 0px; border-style: solid; width: 552px; height: 321px;\" \/><\/p>\n<p align=\"center\"><em>JavaScript using deepMiner<\/em><\/p>\n<p>Based on the data in the screenshot above, we learned that this kind of script uses DDNS for its domain and only increases CPU usage by 50% in order to be less noticeable to end users.<\/p>\n<h3>6. Even YouTube serves ads with coin mining<\/h3>\n<p>The problem of cryptocurrency-mining malware is getting serious. As the number of threat actors looking to earn from cryptomining by hijacking CPU cycles continues to grow, cryptomining malware is showing up in more and more places. A week ago, several malicious ads popped up on YouTube after a threat actor managed to inject a coin miner script into online ads. Luckily, YouTube found the issue and removed the affected ads within two hours.<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture13(1).png\" style=\"border-width: 0px; border-style: solid; width: 551px; height: 340px;\" \/><\/p>\n<p align=\"center\"><em>Malicious cryptomining YouTube ads<\/em><\/p>\n<p>What can you do to prevent or avoid Coin Miner hijacking?<\/p>\n<ol>\n<li>Clear your browser cache, or install ccleaner software to find and remove unwanted files and invalid Windows Registry entries from your computer<\/li>\n<li>Disable JavaScript in your browser or run a script blocker tool or extension<\/li>\n<li>Install Antivirus software such as FortiClient<\/li>\n<li>Install and run AdBlocker or similar tools, such as Ghostery<\/li>\n<\/ol>\n<p>FortiGuard has blacklisted all the URLs listed in this blog as Malicious. &nbsp;&nbsp;<\/p>\n<p><strong>IOCs:<\/strong><br \/>  Compromised Websites:<\/p>\n<ul>\n<li>acenespargc[.]com<\/li>\n<li>www[.]romance-fire[.]com<\/li>\n<li>milknewzealand[.]com<\/li>\n<\/ul>\n<p>Newly observed coin mining URLs:<\/p>\n<ul>\n<li>hxxp:\/\/coinhive[.]com<\/li>\n<li>hxxp:\/\/minerhills[.]com<\/li>\n<li>hxxp:\/\/crypto-webminer[.]com<\/li>\n<li>hxxp:\/\/sorteosrd[.]com<\/li>\n<li>hxxp:\/\/greenindex[.]dynamic-dns[.]net<\/li>\n<li>hxxps:\/\/github[.]com\/deepwn\/deepMiner<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><em>Sign up for our weekly FortiGuard&nbsp;<\/em><a href=\"https:\/\/fortiguard.com\/resources\/threat-brief\"><em>intel briefs<\/em><\/a>&nbsp;<em>or<\/em>&nbsp;<em>to be a part of our&nbsp;<\/em><a href=\"https:\/\/tis.fortiguard.com\/signup\/\"><em>open beta<\/em><\/a><em>&nbsp;of Fortinet&rsquo;s FortiGuard Threat Intelligence Service.<\/em><\/p>\n<\/div<br \/><a href=\"https:\/\/blog.fortinet.com\/2018\/02\/07\/the-growing-trend-of-coin-miner-javascript-infection\" target=\"bwo\" >https:\/\/blog.fortinet.com\/feed<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/d3gpjj9d20n0p3.cloudfront.net\/ngblog\/uploads\/files\/Coin%20Miner%20JavaScript-Picture1.png\"\/><\/p>\n<p><strong>Credit to Author: Eric Chong| Date: Wed, 07 Feb 2018 11:45:00 +0000<\/strong><\/p>\n<p>On 6th December 2017, FortiGuard Labs discovered a compromised website &#8211;\u00a0acenespargc[.]com. Looking into the source code, we noticed a suspicious encrypted script which the uses eval() function to convert all the characters into numbers. We used a tool called CharCode Translator to reverse the numbers back into characters. We were then able to retrieve a link which redirects to a scam page or phishing website.        Part 1    \u00a0    Part 2     The above is just a simple example. The threat actor can actually&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10424,10378],"tags":[],"class_list":["post-11411","post","type-post","status-publish","format-standard","hentry","category-fortinet","category-security"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/11411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=11411"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/11411\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=11411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=11411"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=11411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}