Yet Another Signed Malware - Spymel
IntroductionThreatLabZ came across yet another malware family where the authors are using compromised digital certificates to evade detection. The malware family in this case is the information stealing Trojan Spymel and involved a .NET executable signed with a legitimate DigiCert issued certificate.
|Hardcoded URL for Spymel Download|
Information Stealer - Trojan SpymelThe downloaded malware executable is a highly obfuscated .NET binary, which is digitally signed with a certificate issued to “SBO INVEST”. The certificate was promptly revoked by DigiCert when notified and, therefore, is not active in any attack. We noticed a newer variant arose within two weeks of the first variant, using another certificate issued to "SBO INVEST' that is also revoked.
|Certificate used to sign Spymel|
Spymel Payload Hashes
Spymel drops itself as “svchost.exe” and “Startup32.1.exe” in the following location:
Following registry entries are created to remain persistent on the target system:
HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Run @ Sidebar(32.1)
HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run @ Sidebar(32.1)
Spymel Trojan configuration data including Command & Control server and File & Registry information is hardcoded within the executable as seen below:
During our analysis, we came across following modules in the malware executable:
This module logs all user keystrokes into a log file at the following location:
Below snapshot shows the keylogging module where the name of the class is "kyl":
This module allows Spymel to prevent the victim user from terminating malware and other running processes on the system using tools like TaskMgr, Procexp, ProcessHacker and Taskkill. The malware disables the 'OK' button on the confirmation prompt for Process Explorer as seen below:
Microsoft Taskkill command won't work as expected either despite the SUCCESS notification:
Below is the code snippet of class “ProtectMe”:
|Code of ProtectMe class|
The malware monitors application like Task Manager, Process Explorer, and Process Hacker. It uses GetForegroundWindow() API to get the handle of active window and changes it's functionality if process is from the above list.
It connects to a remote domain android.sh (184.108.40.206) on port 1216. Upon successful connection, Spymel starts sending information about the active process window. Below is a screenshot of network capture:
awt<Base64 endcoded active window title>djamelBelow are some of the commands that the malware can receive from the Command & Control server:
Sends information about user name, OS name, running processes, Video module flag, active window title.
Information about drives in system.
Information about folders and files for given location.
Deletes given file or folder
Executes given file.
Rename given file or folder
Upload keylogging file to C&C. *
Upload requested file to C&C *
Search for given string in all keylogging files.
Delete given keylogging file.
Sends Desktop snapshot
Download file from give URL
On|Off video recording
Provide settings of video recording for specific processes.
*File contents will be encrypted using base64 encoding.
|Recording video of browser processes|
ConclusionUsing digital certificate to disguise malware is common and Spymel is yet another example of this. Spymel is an information stealing malware that spies on all user activity on the compromised machine and relays it to the attacker. This malware typically arrives via spammed e-mail leveraging social engineering to infect the target system.
Zscaler’s ThreatLabZ has confirmed coverage for the initial downloader and Spymel payloads, ensuring protection for organizations using Zscaler’s Internet security platform.
Analysis by Tarun Dewan and Amandeep Kumar