Fresh Variant of Snake Keylogger Malware

The Excel sample, delivered as an attachment in a phishing email, contains malicious Macro VBA code
Once the yellow button ‘Enable Content’ is clicked by victim, the malicious VBA code is executed in the background. The malicious macro project that contains the malicious VBA code is password protected so it cannot be viewed by the analyzer.
However, it is possible to modify its binary file to remove this restriction.

The file “Wheahmnfpgaqse.exe” is a downloader of Snake Keylogger, which is a .Net program. When it starts, it sleeps 21 seconds to bypass those sandboxes with a strategy of killing a sample process when a timeout of no-action is triggered.
Twenty one seconds later, the downloader then invokes a function called ‘Consturctor()’.
It then invokes another function ‘Program.List_Types()’, where it downloads Snake Keylogger module from the link ‘hxxps[:]//store2[.]gofile[.]io/download/0283e6ba-afc6-4dcb-b2f4-3173d666e2c4/Huzeigtmvaplpinhoo.dll’, which is a RC4 encrypted DLL file. Next, it calls ‘ToRc()’ function to RC4 decrypt it using a decryption key “Dllzjn”.

It then proceeds to load the decrypted Dll module (a .Net Dll file, called ‘Huzeigtmvaplpinhoo.dll’), and enumerates its export functions to find “G6doICqoMU()”, which is invoked by executing ‘type.InvokeMember(“G6doICqoMU”, BindingFlags.InvokeMethod, null, null, null)’ in function Consturctor().
The decrypted .Net Dll is a dropper and installer of Snake Keylogger.

The decrypted Dll module (‘Huzeigtmvaplpinhoo.dll’) deploys Snake Keylogger onto a victim’s device and sets it as an auto-run program. It extracts an executable PE file into memory from the Resource directory and then performs process hollowing that injects the executable PE file into a newly created child process and executes it.

The full name of the export function ‘G6doICqoMU()’ is ‘Huzeigtmvaplpinhoo!pXfqpio3clcAoFxTnfJ.CORFgLoyRGlurYwdwIh.G6doICqoMU()’.
Again, for the same reason as before, it sleeps 35 seconds at the beginning of this function to bypass some malware analysis systems.

Next, it works to make this Snake Keylogger persistent on the infected Windows.
A Windows system has a ‘Startup’ folder inside the ‘Start Menu’.
The programs inside this folder are started when Windows starts. The full path to this folder is defined in the system registry with a string value of ‘HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersStartup’ and ‘HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell FoldersStartup’.
The value data of ‘Startup’ is C:Users{UserName}AppDataRoamingMicrosoftWindowsStart MenuProgramsStartup’ by default.

This variant of Snake Keylogger changes both the values of ‘Startup’ to other folders.
The process of extracting the payload file of Snake Keylogger is a little complicated.
It uses a tricky way to load the resource.
It has a local callback function defined by ResolveEventHandler that is registered to AppDomain.ResourceResolve, which is then called when it fails to load a resource by name.
It looks like an exception handler to Windows SEH strategy to handle exceptions.
In addition, it has another local callback function registered to AppDomain.AssemblyResolve, which is called when it fails to load an assembly (like a module) by name.
A while later, another PE file, decrypted from resource ‘{d977ee8c-85ce-4731-b9a1-323ba88c6eeb}‎’, appears in memory.
The program then creates a suspended child process and deploys the compressed Snake Keylogger payload into the child process.
It then resumes the child process to run. Meanwhile, the parent process exits by calling the function Environment.Exit(0).
It calles API CreateProcess() to create the child process with Creation Flag 134217732U (0x8000004), which means CREATE_NO_WINDOW and CREATE_SUSPENDED.

It then calls the API WriteProcessMemory() to copy the Snake Keylogger payload into the child process, section by section.
It next calls SetThreadContext() to make the child process point to the entry point function of Snake Keylogger.
The code of the Snake Keylogger payload file is fully obfuscated, to protect it from being analyzed.
The class and function names are unreadable.

It calls API SetWindowsHookExA() to register a hook callback function( this.callback_ProcessKey()) to monitor low-level keyboard input events.
The first parameter is the hook type, where ’13’ indicates WH_KEYBOARD_LL.

After that, the callback function is called by the Windows system when the victim types, so it is able to handle and record the keystrokes into a global string variable. It also records the foreground Window title to identify where the victim types by calling the APIs GetForegroundWindow() and GetWindowText ().

It also has a Timer (Timer0) that keeps sending the keylogger data to the attacker.

It is able to take screenshots of the victim’s device.
It has a Timer (Timer1), which captures the victim’s screenshots from time to time by calling API CopyFromScreen().
It saves the screenshot into a local Screenshot.png file in the system’s ‘MyDocuments’ folder.
It also sends this picture file to the attacker.

It has two Timers.
One (Time2) is used to collect system clipboard data by calling Clipboard.GetText() and save to a global variable.
The other (Time3) is used to send collected clipboard data to the attacker.

FEvery time it counts down it checks to see whether current clipboard data has been collected in the global variable main_cls.string_clipboard_data.
If not, it appends the current clipboard data to the global variable.

Based on my analysis, this variant’s main work is to steal credentials from the victim’s device.function.
Per the code of this variant of Snake Keylogger, it sends an email to the attacker (using SMTP protocol) to submit the stolen credentials data of the victim.

Snake Keylogger collects basic information regarding the victim’s Windows system, like User name, PC name, System Date and Time, Public IP address, and Country, which are put in the header of the collected credentials.

Sign Up For Threat Alerts

Loading...
Threats Icon

Jul 04, 2023

Rhysida Ransomware RaaS Crawls Out of Crimeware...

The Rhysida ransomware-as-a-service (RaaS) group has gone from a dubious newcomer to a fully-fledged ransomware...

Threats Icon

Jun 26, 2023

Operation Magalenha – Long-Running Campaign Pursues Portuguese...

The attackers can steal credentials and exfiltrate users' data and personal information, which can be...

Threats Icon

Apr 24, 2023

Lazarus Group Adds Linux Malware to Arsenal...

Researchers have discovered a new campaign conducted by Lazarus, known as "Operation DreamJob," which targets...

Threats Icon

Apr 23, 2023

Additional IOCs for 3cx breach

Recently an unexpected malicious activity emanating from a legitimate, signed binary, 3CXDesktopApp was observed.

Threats Icon

Apr 23, 2023

Ex-Conti and FIN7 Actors Collaborate with New...

IBM Security X-Force recently discovered a new malware family Analysts have called "Domino," which Analysts...

Threats Icon

Apr 20, 2023

AuKill EDR killer malware abuses Process Explorer...

The AuKill tool abuses an outdated version of the driver used by version 16.32 of...

Threats Icon

Apr 20, 2023

Fake Chrome updates spread malware

A campaign running since the end of last year is using hacked sites to push...

Threats Icon

Apr 20, 2023

QBot using new attack vector in its...

QBot, also known as QakBot, previously operated as a banking trojan and has since transformed...

Threats Icon

Apr 20, 2023

CrossLock Ransomware Emerges: New Golang – Based...

The CrossLock ransomware employs the double extortion technique to increase the likelihood of payment from...

Threats Icon

Apr 20, 2023

Windows Zero-Day Vulnerability CVE-2023-28252 Exploited by Nokoyawa...

A zero-day vulnerability in the Microsoft Windows system, which also affects Windows 11, has been...

Threats Icon

Apr 18, 2023

Additional IOcs for 3cx breach

Recently an unexpected malicious activity emanating from a legitimate, signed binary, 3CXDesktopApp was observed. As...

Threats Icon

Apr 18, 2023

Additional IOcs for 3cx breach

Recently an unexpected malicious activity emanating from a legitimate, signed binary, 3CXDesktopApp was observed. As...

Threats Icon

Apr 18, 2023

APT36 Expands Interest Within Indian Education Sector

Symantec described UPS in 2016 report as Buckeye (also known as APT3 Gothic Panda UPS...

Threats Icon

Apr 17, 2023

ChinaZ DDoS Bot Malware Distributed To Linux...

The ChinaZ DDoS bot malware was discovered targeting Linux systems while a version for Microsoft...

Threats Icon

Apr 16, 2023

Resurgence Of The Mexals Cryptojacking Campaign

The Mexals crypto jacking campaign has been in operation since at least 2021 and continues...