| Original Text |
|---|
APT�C�26 �Lazarus) is a highly active advanced persistent group �APT)
known for its sophisticated and covert attack methods and techniques. The
group has a wide range of activities with goals ranging from cyber espionage
for gathering intelligence, custom ransomware attacks for financial gains and
causing cyber sabotage. The group is known for a wide range of highly
sophsiticated and well-known attacks that have caused massive damage and
got a notable recognition. These attacks reflect the huge amount of
resources and high technical capabilites the group posses.
In this research I wanna present a case study that I conducted on a new
division of the Lazarus group, which was discovered and documented by
Microsoft Threat Intelligence Center . The group is tracked as
Moonstone Sleet (formerly Strom-1789�. Moonstone Sleet is a slightly new
division of the massive Lazarus group, that is known for a few operations that
were conducted hand-by-hand with other North Korean threat actor affiliates
inculding .
It uses many tried-and-true techniques that were used by other North Korean
threat actors while using many of these techniques to conduct coordinated
attacks targeting a wide range of companies for financial and espionage
objectives, the group has shifted to its own infrastructure and attack methods
the most notable of which is using trojanized software that was distributed
through fake social media profiles, establishing itself a distinct and separate
division.
We are gonna take a look at the whole infection chain of an attack that was
linked to The Moonstone Sleet group, which involved the usage of a
trojanized PuTTY installer and was first documented by .
The whole point is to show the consistent usage of trojanized software and
code reuse across different attacks linked to the MoonStone Sleet group.
Microsoft observed in early August 2023 that Moonstone Sleet was
delivering a trojanized version of PuTTY, an open-source terminal emulator
through a variety of platforms including Linkedin, and Telegram. The threat
actor will send the target a zip archive containing two files: a trojanized
PuTTY installer and a text file containing an IP address and password to use.
The trojanized version triggers the infection upon the user entering the
password provided, by simply checking the user's entered password against
a hardcoded password, thereby assuring that only the targeted individuals
who entered the intended password will be infected.
The heavy and consistent use of the relatively uncommon stream cipher
HC-256 for encryption and decryption has been observed. In our case, the
next stage payload is decrypted using a hardcoded 32-byte HC�256 key.
After decryption, the data is decompressed before being mapped to memory.
After successfully decrypting and decompressing the next stage DLL, it
employs a traditional yet effective DLL loading mechanism. Rather than
allocating committed and RWX (read-write-execute) memory directly which
may raise some red flags, the mapping process consists of four steps:
1. Allocate memory with size equal to the image, reserved, and set to
PAGE_READWRITE. This can be done either at the original PE �Portable
Executable) image base or the system's preferred address.
2. Commit the previously allocated memory, then copy the headers and
sections of the payload into it.
3. Perform relocation fixups for any hardcoded addresses, populate the
Import Address Table �IAT�, and apply the appropriate section
permissions.
4. Call the DLL's entry point, passing a unique wide string that will be used
and carried through the subsequent stages.
The in-memory mapped DLL functions as an installer module that writes the
next stage module, referred to as SplitLoader , to disk. The name likely
comes from the fact that the loader is divided into two components. The first
component is decrypted using HC-256 , then decompressed, and
subsequently written to %APPDATA%..
\Local\Microsoft\Windows\usrgroup.dat .
The execution of the first part DLL� ) was setup in a very special
and dependent way such that the next part is only
parsed and decrypted properly if the usrgroup.dat's export was executed
with the proper arguments L"%APPDATA%\..\Local\Microsoft\Windows\
\usrgroup.dat, LoadDllW %APPDATA%\..\Local\Microsoft\Windows\
\Explorer\thumbcache_512.db \"zjWy\" 4701" . This is what we can call a
DLL checksum to enforce the execution of the DLL only when the intended
arguments are passed and prevent it from running in an automated analysis
environment or a sandbox.
This is a common theme or technique that was observed being heavily used
in later attacks linked to the Moonstone sleet.
The provided argument serves the path of the next part of the loader, the
first 4 bytes of the XOR decryption key that will be used to decrypt the next
stage embedded inside , and lastly the same magic wide
string which will prove useful in the next stage.
The process begins by attempting to obtain a file handle for
thumbcache_512.db and then parsing the file to extract the necessary
information for the next stage.
First, it reads the size of the encrypted and compressed next stage, which is
represented by the second set of four bytes from the beginning of the file
(the initial four bytes are not relevant). Next, it reads a four-byte magic value
to verify the integrity of thumbcache_512.db .
The second part of the loader is saved to %APPDATA%..
\Local\Microsoft\Windows\Explorer\thumbcache_512.db .
Before executing the first part , which will decrypt, decompress, and execute
the next part of the loader( ), it will set up persistence by
first creating a scheduled task using COM ITaskScheduler , and then it
creates an entry USBCheck under
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run .
After acquiring the size of the embedded payload and performing a sanity
check on the magic value, the process continues by reading the payload
along with an additional 28 bytes �0x1C) that follow the payload. From this,
only the first four bytes are utilized. These four bytes are combined with the
previously mentioned four-byte value "zJWy" to create an 8-byte XOR key,
which will be used to decrypt the payload.
Finally, the payload is decrypted using the 8-byte key assembled as
described. It is then decompressed using zlib and mapped into memory in
the same way previously explained to enhance its chances of not being
detected.
After calling DLLMain, which is the DLL entry point function, the execution of
the DLL is properly initialized. It then enumerates the exported functions'
names table, searching for the exported function named
"GetWindowSizedW" to finally call.
This Python script can parse , extracting, decrypting,
and decompressing the next stage.
import sys
import zlib
def decrypt_payload(enc_payload: bytes, full_xor_key: bytes) -> bytes:
"""XOR decrypts the payload using the extracted key."""
dec_payload = bytearray(enc_payload)
xor_key = full_xor_key[:8]
print(f"used key: {xor_key.hex()}")
print(f"used key length: {len(xor_key)}")
key_len = len(xor_key)
for i in range(len(enc_payload)):
dec_payload[i] ^= xor_key[i % key_len] # Cycle through the key
return bytes(dec_payload)
def main():
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} Decrypt the payload
if name == "main": main() This stage is the one before the last, where communication with the command and control �C2) server occurs. It begins by generating a 16-byte unique identifier, which will be used to authenticate with the C2 server. Once the C2 confirms the authenticity of the client, the final payload can be retrieved. The unique identifier is constructed by converting the DLL checksum to ASCII, appending "64," and adding ten random characters. It's important to note that Moonstone sleet obscures the final payload, which rarely changes. This is done using a multi-stage loader setup, where each stage triggers the next. To ensure proper execution, a DLL checksum is implemented, preventing it from running in automated analysis environments. In our case, the DLL checksum is utilized to create the Bot ID, which confirms the authenticity of the client and ensures that the payload is only accessed by an authentic client. The 16-byte identifier and the current system time and date is base64 encoded and added as part of a very large string of bytes, that will be sent to the Comamnd and Control(C2) server to autheticate Unfortunately, at the time of this writing, the C2 server is no longer operational, so we're unable to demonstrate how the HTTP POST is formatted. However, I found an excellent report that I will link in the references, which illustrates the network traffic and the structure of the request. After confirming a successful connection by checking the returned status code, the system proceeds to read the available data from the C2 server. The data received is decoded using a non-standard scheme before processing it. After successful mapping to memory, the DLL entry point is called for proper DLL initialization, and then the targeted export function is called. In a recent research published by the 360 Threat Research Institute, we observed the consistent use of both legitimate and trojanized software. In our case study, we focused on a trojanized version of PuTTY, while the other research analyzed the infection chain of another trojanized legitimate software called IPMsg. This comparison reveals that both attacks share significant similarities at the code level, and they employ the same tactics, techniques, and procedures �TTPs� as well as a multi-stage setup to obscure the final payload. Therefore, it is clear that both attacks were initiated by the same Lazarus group. • blockchain-newtech[.]com �C2 server) • f59035192098e44b86c4648a0de4078edbe80352260276f4755d15d354f 5fc58 �PuTTY installer) • fcb687685f71615c83e9af26087e6036d7dd52a91339ef5c58d3150fd402a 586 �SplitLoader installer | Dropper) • 00433ebf3b21c1c055d4ab8a599d3e84f03b328496236b54e56042cef21 46b1c �SplitLoader first part usrgroup.dat) • d65e05c961107c787310c4f369034b096f9484c328b43140d0eb90820c8 33f9f �SplitLoader second part thumbcache_512.db) • 63fb47c3b4693409ebadf8a5179141af5cf45a46d1e98e5f763ca0d7d64fb 17c �Trojan downloader) The decoded data is divided into five parts, separated by the "|" symbol. The data in these five parts respectively represent: the maximum size �KB) of the subsequent DLL execution result transmitted to C2 each time, the length of the encrypted payload that will be received next, the DLL export function name , the DLL checksum similar to the above, and the MD5 hash value of the payload. Next, the payload is received from the C2 server and is MD5 hashed to verify the integrity of the received payload before proceeding with decryption and execution. After verifying its integrity, the payload DLL is decrypted again using a hardcoded HC�256 32-byte key, decompressed, and then reflectively loaded into memory. |
| Original Text | ChatGPT 4o Paged |
|---|---|
APT�C�26 �Lazarus) is a highly active advanced persistent group �APT) known for its sophisticated and covert attack methods and techniques. The group has a wide range of activities with goals ranging from cyber espionage for gathering intelligence, custom ransomware attacks for financial gains and causing cyber sabotage. The group is known for a wide range of highly sophsiticated and well-known attacks that have caused massive damage and got a notable recognition. These attacks reflect the huge amount of resources and high technical capabilites the group posses. In this research I wanna present a case study that I conducted on a new division of the Lazarus group, which was discovered and documented by Microsoft Threat Intelligence Center . The group is tracked as Moonstone Sleet (formerly Strom-1789�. Moonstone Sleet is a slightly new division of the massive Lazarus group, that is known for a few operations that were conducted hand-by-hand with other North Korean threat actor affiliates inculding . It uses many tried-and-true techniques that were used by other North Korean threat actors while using many of these techniques to conduct coordinated attacks targeting a wide range of companies for financial and espionage objectives, the group has shifted to its own infrastructure and attack methods the most notable of which is using trojanized software that was distributed through fake social media profiles, establishing itself a distinct and separate division. |
Phase: Initial Access
Phase: Execution
Phase: Persistence
Phase: Defense Evasion
Phase: Credential Access
Phase: Lateral Movement
Phase: Collection
Phase: Impact
|
We are gonna take a look at the whole infection chain of an attack that was linked to The Moonstone Sleet group, which involved the usage of a trojanized PuTTY installer and was first documented by . The whole point is to show the consistent usage of trojanized software and code reuse across different attacks linked to the MoonStone Sleet group. Microsoft observed in early August 2023 that Moonstone Sleet was delivering a trojanized version of PuTTY, an open-source terminal emulator through a variety of platforms including Linkedin, and Telegram. The threat actor will send the target a zip archive containing two files: a trojanized PuTTY installer and a text file containing an IP address and password to use. The trojanized version triggers the infection upon the user entering the password provided, by simply checking the user's entered password against a hardcoded password, thereby assuring that only the targeted individuals who entered the intended password will be infected. The heavy and consistent use of the relatively uncommon stream cipher HC-256 for encryption and decryption has been observed. In our case, the next stage payload is decrypted using a hardcoded 32-byte HC�256 key. After decryption, the data is decompressed before being mapped to memory. |
Phase: Initial Access
Phase: Execution
Phase: Decryption
Phase: Payload Deployment
|
After successfully decrypting and decompressing the next stage DLL, it employs a traditional yet effective DLL loading mechanism. Rather than allocating committed and RWX (read-write-execute) memory directly which may raise some red flags, the mapping process consists of four steps: 1. Allocate memory with size equal to the image, reserved, and set to PAGE_READWRITE. This can be done either at the original PE �Portable Executable) image base or the system's preferred address. 2. Commit the previously allocated memory, then copy the headers and sections of the payload into it. 3. Perform relocation fixups for any hardcoded addresses, populate the Import Address Table �IAT�, and apply the appropriate section permissions. 4. Call the DLL's entry point, passing a unique wide string that will be used and carried through the subsequent stages. The in-memory mapped DLL functions as an installer module that writes the next stage module, referred to as SplitLoader , to disk. The name likely comes from the fact that the loader is divided into two components. The first component is decrypted using HC-256 , then decompressed, and subsequently written to %APPDATA%.. \Local\Microsoft\Windows\usrgroup.dat . |
Phase: Defense Evasion
Phase: Execution and Persistence
This structured flow allows a red team to emulate the tactics and procedures used by the threat actor effectively. |
The execution of the first part DLL� ) was setup in a very special and dependent way such that the next part is only parsed and decrypted properly if the usrgroup.dat's export was executed with the proper arguments L"%APPDATA%\..\Local\Microsoft\Windows\ \usrgroup.dat, LoadDllW %APPDATA%\..\Local\Microsoft\Windows\ \Explorer\thumbcache_512.db \"zjWy\" 4701" . This is what we can call a DLL checksum to enforce the execution of the DLL only when the intended arguments are passed and prevent it from running in an automated analysis environment or a sandbox. This is a common theme or technique that was observed being heavily used in later attacks linked to the Moonstone sleet. The provided argument serves the path of the next part of the loader, the first 4 bytes of the XOR decryption key that will be used to decrypt the next stage embedded inside , and lastly the same magic wide string which will prove useful in the next stage. The process begins by attempting to obtain a file handle for thumbcache_512.db and then parsing the file to extract the necessary information for the next stage. First, it reads the size of the encrypted and compressed next stage, which is represented by the second set of four bytes from the beginning of the file (the initial four bytes are not relevant). Next, it reads a four-byte magic value to verify the integrity of thumbcache_512.db . |
Phase: Execution and Anti-Analysis
Phase: Decryption and Execution
This structured procedure reflects the attacker’s method of ensuring controlled execution and preventing automated analysis interference. |
The second part of the loader is saved to %APPDATA%.. \Local\Microsoft\Windows\Explorer\thumbcache_512.db . Before executing the first part , which will decrypt, decompress, and execute the next part of the loader( ), it will set up persistence by first creating a scheduled task using COM ITaskScheduler , and then it creates an entry USBCheck under HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run . |
Phase: Execution
Phase: Persistence
|
After acquiring the size of the embedded payload and performing a sanity check on the magic value, the process continues by reading the payload along with an additional 28 bytes �0x1C) that follow the payload. From this, only the first four bytes are utilized. These four bytes are combined with the previously mentioned four-byte value "zJWy" to create an 8-byte XOR key, which will be used to decrypt the payload. Finally, the payload is decrypted using the 8-byte key assembled as described. It is then decompressed using zlib and mapped into memory in the same way previously explained to enhance its chances of not being detected. After calling DLLMain, which is the DLL entry point function, the execution of the DLL is properly initialized. It then enumerates the exported functions' names table, searching for the exported function named "GetWindowSizedW" to finally call. This Python script can parse , extracting, decrypting, and decompressing the next stage. |
Phase: Execution
Phase: Execution
Phase: Script Execution
|
import sys
import zlib
def decrypt_payload(enc_payload: bytes, full_xor_key: bytes) -> bytes:
"""XOR decrypts the payload using the extracted key."""
dec_payload = bytearray(enc_payload)
xor_key = full_xor_key[:8]
print(f"used key: {xor_key.hex()}")
print(f"used key length: {len(xor_key)}")
key_len = len(xor_key)
for i in range(len(enc_payload)):
dec_payload[i] ^= xor_key[i % key_len] # Cycle through the key
return bytes(dec_payload)
def main():
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} |
Phase: Execution
Phase: Defense Evasion
Optional Phase: Post-Exploitation Planning
|
Decrypt the payload
if name == "main": main() This stage is the one before the last, where communication with the command and control �C2) server occurs. It begins by generating a 16-byte unique identifier, which will be used to authenticate with the C2 server. Once the C2 confirms the authenticity of the client, the final payload can be retrieved. The unique identifier is constructed by converting the DLL checksum to ASCII, appending "64," and adding ten random characters. |
Phase: Defense Evasion
Phase: Execution
Phase: Command and Control
No explicit command lines were provided, but the described behaviors are inferred based on the report details. |
It's important to note that Moonstone sleet obscures the final payload, which rarely changes. This is done using a multi-stage loader setup, where each stage triggers the next. To ensure proper execution, a DLL checksum is implemented, preventing it from running in automated analysis environments. In our case, the DLL checksum is utilized to create the Bot ID, which confirms the authenticity of the client and ensures that the payload is only accessed by an authentic client. The 16-byte identifier and the current system time and date is base64 encoded and added as part of a very large string of bytes, that will be sent to the Comamnd and Control(C2) server to autheticate Unfortunately, at the time of this writing, the C2 server is no longer operational, so we're unable to demonstrate how the HTTP POST is formatted. However, I found an excellent report that I will link in the references, which illustrates the network traffic and the structure of the request. After confirming a successful connection by checking the returned status code, the system proceeds to read the available data from the C2 server. The data received is decoded using a non-standard scheme before processing it. |
Phase: Initial Access
Phase: Execution
Phase: Command and Control
|
After successful mapping to memory, the DLL entry point is called for proper DLL initialization, and then the targeted export function is called. In a recent research published by the 360 Threat Research Institute, we observed the consistent use of both legitimate and trojanized software. In our case study, we focused on a trojanized version of PuTTY, while the other research analyzed the infection chain of another trojanized legitimate software called IPMsg. This comparison reveals that both attacks share significant similarities at the code level, and they employ the same tactics, techniques, and procedures �TTPs� as well as a multi-stage setup to obscure the final payload. Therefore, it is clear that both attacks were initiated by the same Lazarus group. • blockchain-newtech[.]com �C2 server) • f59035192098e44b86c4648a0de4078edbe80352260276f4755d15d354f 5fc58 �PuTTY installer) • fcb687685f71615c83e9af26087e6036d7dd52a91339ef5c58d3150fd402a 586 �SplitLoader installer | Dropper) • 00433ebf3b21c1c055d4ab8a599d3e84f03b328496236b54e56042cef21 46b1c �SplitLoader first part usrgroup.dat) • d65e05c961107c787310c4f369034b096f9484c328b43140d0eb90820c8 33f9f �SplitLoader second part thumbcache_512.db) • 63fb47c3b4693409ebadf8a5179141af5cf45a46d1e98e5f763ca0d7d64fb 17c �Trojan downloader) |
Phase: Initial Access
Phase: Execution
Phase: Persistence
Phase: Command and Control
Phase: Impact
|
The decoded data is divided into five parts, separated by the "|" symbol. The data in these five parts respectively represent: the maximum size �KB) of the subsequent DLL execution result transmitted to C2 each time, the length of the encrypted payload that will be received next, the DLL export function name , the DLL checksum similar to the above, and the MD5 hash value of the payload. Next, the payload is received from the C2 server and is MD5 hashed to verify the integrity of the received payload before proceeding with decryption and execution. After verifying its integrity, the payload DLL is decrypted again using a hardcoded HC�256 32-byte key, decompressed, and then reflectively loaded into memory. |
Phase: Command and Control (C2) Interaction
|
| Gemini 2.0 |
|---|
Model: gemini-2.0-flashOkay, here's an extraction of the TTPs from the report, focusing on the procedures that a red team could emulate: Phase: Initial Access
Phase: Execution
Phase: Persistence
Phase: Payload Delivery and Execution
Phase: Post-Execution and Communication
Phase: Final Payload
Notes:
This structured breakdown should assist a red team in emulating key aspects of the Moonstone Sleet attack. Remember to adapt procedures to your specific environment and toolsets. |
| Gemini 2.5 |
|---|
Model: gemini-2.5-flash-preview-05-20Here's a structured analysis of the attack activities by Moonstone Sleet, focusing on procedures, techniques, and tools for red team emulation: Phase: Initial Access
Phase: Execution
Phase: Persistence
Phase: Command and Control
Phase: Defense Evasion
|