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

Threats Icon

Nov 29, 2021

IKEA email systems hit by ongoing cyberattack

IKEA is battling an ongoing cyberattack where threat actors are targeting employees in internal phishing...

Threats Icon

Nov 28, 2021

Tardigrade Malware targets Biomanufacturing Facilities

An advanced persistent threat (APT) has been linked to cyberattacks on two biomanufacturing companies that...

Threats Icon

Nov 25, 2021

RATDispenser – Stealthy JavaScript Loader Dispensing RATs

Attackers are using an evasive JavaScript loader, RATDispenser, to distribute remote access Trojans (RATs) and...

Threats Icon

Nov 24, 2021

Memento Team uses password-protected archives to bypass...

Calling themselves "Memento team", actors use Python-based ransomware that they reconfigured after setbacks. This was...

Threats Icon

Nov 23, 2021

Squirrelwaffle Exploits ProxyShell and ProxyLogon to Hijack...

Squirrelwaffle emerged as a new loader that is spread through spam campaigns. It is known...

Threats Icon

Nov 22, 2021

Emotet Returns

Back in January 2021, law enforcement and judicial authorities worldwide took down the Emotet botnet....

Threats Icon

Nov 18, 2021

Iranian Government-Sponsored APT Cyber Actors Exploiting Microsoft...

The Iranian government-sponsored APT actors are actively targeting a broad range of victims across multiple...

Threats Icon

Nov 17, 2021

Web compromises in the Middle East with...

ESET researchers have discovered strategic web compromise (aka watering hole) attacks against high-profile websites in...

Threats Icon

Nov 16, 2021

MosesStaff techniques: Ideology over Money

Hacker group MosesStaff began targeting Israeli organizations, joining a wave of attacks which was started...

Threats Icon

Nov 15, 2021

Lyceum mass backdoor attacks

Lyceum backdoors appear to have targeted ISPs and telecommunication operators in Israel, Morocco, Tunisia, and...

Threats Icon

Nov 14, 2021

New Golang malware (BotenaGo) targeting millions of...

Analysts have found new malware written in the open source programming language Golang. Deployed with...

Threats Icon

Nov 10, 2021

Mekotio Banker – Improved Stealth and Ancient...

A banking Trojan called "Mekotio" that targeted Latin America countries in the past, now making...

Threats Icon

Nov 09, 2021

Targeted Attack Campaign Against ManageEngine ADSelfService Plus...

US Cybersecurity and Infrastructure Security Agency (CISA) released an alert warning that advanced persistent threat...

Threats Icon

Nov 08, 2021

SquirrelWaffle Leverages malspam to deliver Qakbot

Recently, a new threat, referred to as "SquirrelWaffle" is being spread more widely via spam...

Threats Icon

Nov 08, 2021

ProxyShell exploitation leads to Babuk ransomware

A new threat actor is exploiting ProxyShell flaws in attacks aimed at Microsoft Exchange servers...