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

Aug 11, 2022

Cisco Talos shares insights related to recent...

Initial access to the Cisco VPN was achieved via the successful compromise of a Cisco...

Threats Icon

Aug 11, 2022

Andariel deploys DTrack and Maui ransomware

The CISA published an alert, entitled, "North Korean State-Sponsored Cyber Actors Use Maui Ransomware To...

Threats Icon

Aug 09, 2022

Albanian Government Organizations Targeted By Possible Iranian...

Mandiant identified the ROADSWEEP ransomware family and a Telegram persona which targeted the Albanian government...

Threats Icon

Aug 08, 2022

BumbleBee Roasts Its Way to Domain Admin

Threat actors used BumbleBee as the initial access vector. BumbleBee is a malware loader that...

Threats Icon

Aug 08, 2022

RapperBot – new evolving malware

FortiGuard Labs has been tracking a rapidly evolving IoT malware family known as "RapperBot". This...

Threats Icon

Aug 04, 2022

Google Drive And Dropbox Used By APT29...

Cloaked Ursa (aka: APT29) has been targeting governmental entities in several countries with spear-phishing campaigns...

Threats Icon

Aug 03, 2022

Manjusaka: A Chinese sibling of Sliver and...

Cisco Talos recently discovered a new attack framework called "Manjusaka" being used in the wild...

Threats Icon

Aug 03, 2022

macOS Targeted With The CloudMensis Multi-Staged Malware

ESET researchers discovered a previously unknown macOS backdoor that spies on users of the compromised...

Threats Icon

Aug 01, 2022

Attackers Target Ukraine With GoMet Backdoor

Since the Russian invasion of Ukraine began, Ukrainians have been under a nearly constant barrage...

Threats Icon

Jul 31, 2022

Untangling KNOTWEED: European private-sector offensive actor using...

The Microsoft Threat Intelligence Center (MSTIC) and the Microsoft Security Response Center (MSRC) found a...

Threats Icon

Jul 31, 2022

Untangling KNOTWEED: European private-sector offensive actor using...

The Microsoft Threat Intelligence Center (MSTIC) and the Microsoft Security Response Center (MSRC) found a...

Threats Icon

Jul 26, 2022

EvilNum Targets Cryptocurrency, Forex, Commodities

Proofpoint Threat Research observed the group Proofpoint calls TA4563 targeting various European financial and investment...

Threats Icon

Jul 25, 2022

Lightning Framework: New Undetected “Swiss Army Knife”...

Lightning is a previously undocumented and undetected Linux threat. Lightning is a modular framework we...

Threats Icon

Jul 24, 2022

Redeemer Ransomware

Redeemer 2.0 Being Distributed Via Affiliate Program Cyble Research Labs has constantly been tracking emerging...

Threats Icon

Jul 21, 2022

Cobalt Strikes again: UAC-0056 continues to target...

The Malwarebytes Threat Intelligence team recently reviewed a series of cyber attacks against Ukraine that...