The blister is a code-signed malware that drops a malicious DLL file on the victim’s system, which is then executed by the loader via rundll32.exe, resulting in the deployment of a RAT/ C2 beacon, thus allowing unauthorized access to the target system over the internet. Blister Malware campaigns have been active since 15 September 2021.
Part I of CloudSEK’s analysis provides a detailed understanding of how the loader functions. Part 2 will delve into the details of this campaign’s second stage, which is the .dll payload, and its internal working.
Dissecting the Malicious DLL – Blister Malware
As discussed in Part 1, the Blister dropper drops the malicious .dll
file in the Temp directory
of the user, inside a newly created folder. This malicious .dll
then carries out the second stage of the campaign, in which a RAT/ agent is deployed on the system to gain unauthorized access and steal data.
- The Blister dropper calls the function
LaunchColorCpl,
which is one of the functions exported by the .dll, viarundll32.exe.
Staging
- The exported function
LaunchColorCpl
retrieves the staging code from the resource section of the PE file. This staging code is protected by a simple XOR encoding scheme.
- After the iterative decoding of the staging code, the control is transferred to decoded code in the memory.
- The control flow is transferred to the staging code by calling the address in the EAX register.
Anti-Analysis
- The staging code is heavily obfuscated, and has a logic similar to a spaghetti code, to hinder analysis. All the calls to Windows APIs are obscured and dynamically resolved.
- The first thing that the staging code does is to make the malware go to sleep by calling the Sleep Windows API. This is a typical strategy used by most malicious codes to bypass security sandboxes and dynamic testing of security products.
- The hex value “927C0” is passed to
kernel32.759F9010
i.e the Sleep function. This value (927C0) translates to “600000” in decimal. Since the Sleep API takes arguments in milliseconds (ms), the 600000 ms get converted to 10 minutes. - When the malware resumes from sleep, it fetches the final payload from the resource section of the PE file.
- In the memory, the protected payload is decoded. The presence of a DOS header, in the payload bytes, confirms that the payload is in PE format and not a shellcode.
- An interesting observation from this analysis, is the addition of MZ byte after the decryption process. In the above image, the initial byte is not MZ, rather the MZ byte is later added at the beginning of the payload separately. This behavior is primarily for operational security.
Process Hollowing
In general, process hollowing allows an attacker to change the content of a legitimate process from genuine code to malicious code before it is executed by carving out the code logic within the target process.
- After decrypting the final payload, the malware prepares for execution.
- This is done by creating a new process to deploy the extracted code and then performing process hollowing to execute the payload in the remote process. The staging code retrieves the Rundll32.exe location from the compromised system.
- A new process of Rundll32.exe is created via the CreateProcessInternalW API in the suspended state.
- The malware uses the following Win32 APIs for process hollowing:
- ZwUnmapViewOfSection
- ZwReadVirtualMemory
- ZwWriteVirtualMemory
- ZwGetContextThread
- ZwSetContextThread
- NtResumeThread
- ZwWriteVirtualMemory is used to write malicious code into the target process.
- To make the thread of the new process point to newly written code, the attacker alters the entry point of the current thread via ZwGetContextThread and ZwSetContextThread.
- These functions are used to perform processor housekeeping activities on the data structure that stores the current context of the running thread. Process hollowing takes advantage of these features to make the process thread run the attacker code.
Step by Step Working of the DLL
- The staging code allocates a new memory via ZwAllocateVirtualMemory to transfer the previously decrypted final payload.
- The payload is then copied to a newly created buffer.. Based on CloudSEK’s testing on the extracted payload, one of the analyzed samples contained the Raccoon stealer as the final stage payload. However, other samples used Cobalt Strike beacon and BitRAT to compromise the target and gain unauthorized access.
- The staging code then injects the code into the newly created remote process i.e Rundll32.exe.
- Later, the memory protections are changed to appropriate ones for the execution of the residing code via NTProtectVirtualMemory.
- The thread context is retrieved via ZwGetContextThread API to change the entry point of the thread to execute the payload injected into the remote process.
- The ZwSetContextThread is used to modify the thread entry point to that of the newly copied PE file.
- At the final stage of process hollowing, the suspended thread of the
Rundll32.exe
is resumed viaNtResumeThread
. Then theRundll32.exe
process starts executing the malicious code hollowed into it by the malware.
- In the clean-up process, the staging code uses NtFreeVirtualMemory to release the allocated memory, which holds the payload assembly, one by one.
- The current process used for staging is terminated via the
NtTerminateProcess
.
Blister Malware – Maintaining Persistence
- The Blister malware achieves persistence on the target system by creating an “lnk” file named proamingsGames in the
C:\Users\<username>\AppData\Roaming\Microsft\Windows\Start Menu\Startup
directory. - Whenever the user logs in,
explorer.exe
executes any file in theStartup
folder. As a result, when the user signs into the account, following the boot process, the malware runs as a child process ofexplorer.exe
.
- The target for the lnk file is set as
C:\ProgramData\proamingsGames\proamingsGames.dll,LaunchColorCpl
. Here, the malware copies theRundll32.exe
asproamingsGames.exe
and the malicious .dll (initially intoC:\ProgramData\proamingsGames directory
) is dropped in theTemp
folder.
- Every time that the system powers up and the user logs in, the lnk file runs a malicious
.dll
through a renamed instance ofRundll32.exe
.
Conclusion
Given that threat actors are actively using valid code-signing certificates in Windows systems, to avoid detection by antivirus software, it is essential for network and endpoint security products to be updated with the malwares’ latest Indicators of Compromise (IoCs). The latest IoCs for the Blister Malware are enumerated in Part 1 of the technical analysis.