LokiBot Campaign Uses JScript Attachment and .NET Injector to Steal Credentials


A recent LokiBot campaign is using a malicious JScript email attachment, a PowerShell loader, a .NET injector and process injection to steal credentials from Windows systems. The infection chain ends with the LokiBot infostealer running inside a legitimate Windows process.

The campaign was analyzed by LevelBlue SpiderLabs, which described it as a multi-stage LokiBot sample from a recent campaign. The malware arrives through a script attachment, loads intermediate code in memory, and injects the final LokiBot payload into aspnet_compiler.exe.

LokiBot remains dangerous because it targets credentials across many applications. It can collect passwords and account data from browsers, email clients, FTP tools, cryptocurrency wallets and other software used on infected machines.

LokiBot remains active more than a decade after first appearing

LokiBot is not a new malware family. MITRE ATT&CK lists LokiBot as a widely distributed information stealer first reported in 2015. MITRE says it steals usernames, passwords, cryptocurrency wallets and other credentials, and can also create a backdoor for additional payloads.

LevelBlue notes that LokiBot was advertised in May 2015 by vendors using the names lokistov and carter. After source code leaked in 2018, multiple variants and forks appeared, adding new features and helping the malware stay active in criminal campaigns.

The latest campaign shows why older infostealers still matter. Attackers continue to refresh delivery methods and loaders even when the final malware family has existed for years.

StageComponentRole in the attack
Stage 1JScript attachmentRuns through Windows Script Host and launches the infection chain.
Stage 2PowerShell loaderDecrypts and loads a .NET assembly directly in memory.
Stage 3.NET injectorInjects the final payload into aspnet_compiler.exe.
Final stageLokiBot payloadSteals credentials, contacts C2 infrastructure and attempts persistence.

The attack starts with a JScript email attachment

The first stage is a malicious JScript file attached to a phishing email. When a victim opens it on Windows, the script runs through Windows Script Host.

The Microsoft wscript documentation says Windows Script Host provides an environment for executing scripts in several languages. It also notes that Windows script files commonly use extensions such as .wsf, .vbs and .js.

In this campaign, the JScript code uses obfuscation to slow analysis. LevelBlue says the script uses decoy functions and hexadecimal variable names, then decodes a Base64 PowerShell script, writes it to C:\Temp with a random filename, and runs it.

PowerShell loads a .NET injector in memory

The PowerShell stage acts as a .NET assembly loader. It decrypts a long encoded payload with XOR and a hard-coded key, then reflectively loads the resulting assembly into memory.

This approach reduces the amount of malicious code written to disk. It also gives attackers another layer between the initial script and the final LokiBot executable.

The .NET assembly is protected with ConfuserEx, a known .NET obfuscator. After it runs, it prepares the process injection stage and passes both the target executable path and LokiBot payload data to the injector logic.

  • The first stage uses an obfuscated JScript file.
  • The script decodes and launches PowerShell from C:\Temp.
  • PowerShell decrypts a .NET assembly using XOR.
  • The .NET assembly loads in memory instead of being written as a normal executable.
  • The final payload is injected into aspnet_compiler.exe.

Process injection hides LokiBot inside aspnet_compiler.exe

The injector spawns aspnet_compiler.exe, a legitimate Microsoft ASP.NET compiler process, and places the LokiBot payload inside its memory. This helps the malware run inside a trusted-looking process instead of launching as an obvious unknown executable.

According to LevelBlueโ€™s technical analysis, the injector uses Windows API functions commonly associated with process injection, including CreateProcessA, VirtualAllocEx, WriteProcessMemory, SetThreadContext and ResumeThread.

Once injected, the final LokiBot payload runs as a 32-bit Windows PE executable. It contains encrypted command-and-control addresses and resolves many Windows API functions at runtime through a custom hashing method.

Credential theft is the main goal

After initialization, LokiBot creates a mutex based on the MD5 hash of the systemโ€™s MachineGuid registry value. This helps ensure only one copy runs on the infected host.

The malware then calls dedicated credential-harvesting functions for different applications. The LokiBot techniques page lists credential theft from password stores, web browsers, email clients, FTP clients and SFTP clients among its known behaviors.

After collecting credentials, the malware compresses the stolen data using aPLib and sends it to its command-and-control server. LevelBlue says the C2 endpoint data is stored inside the binary using 3DES encryption.

Target areaWhy attackers want it
Web browsersCan contain saved usernames, passwords, cookies and account data.
Email clientsCan expose business accounts, contacts and password reset paths.
FTP and SFTP toolsCan provide access to servers, websites and file stores.
Cryptocurrency walletsCan lead directly to financial theft.
System detailsCan help attackers profile the host for follow-up activity.

Persistence appears broken in newer LokiBot samples

LokiBot attempts to copy itself to the AppData directory and create a registry run key for persistence. However, LevelBlue says newer samples created with custom builders may contain a broken persistence routine.

The issue appears tied to a patched decryption function. Instead of returning the intended registry path for startup persistence, the malware returns a configured C2 address, which breaks the registry run key logic.

Mutex-based verification (Source – LevelBlue)

Even with broken persistence, the infection remains serious. A single successful run can still steal stored credentials and send them to the attacker before the host is cleaned.

How defenders can detect this LokiBot campaign

Security teams should focus on both file indicators and behavior. Hashes and domains help with immediate hunting, but process chains often provide stronger detection over time.

Unexpected execution of .js attachments, PowerShell launched from script hosts, temporary PowerShell files in C:\Temp, and aspnet_compiler.exe appearing in unusual process trees should all trigger review. Defenders should also watch for outbound HTTP traffic to known LokiBot C2 paths.

The Windows Script Host execution path matters because this campaign starts with script-based delivery. Organizations that do not need users to open script attachments should restrict or block them through email and endpoint controls.

Detection areaSuspicious behavior
Email securityJScript attachments, especially random or long filenames.
Endpoint telemetrywscript.exe launching powershell.exe.
File systemRandom PowerShell files written to C:\Temp.
Process behavioraspnet_compiler.exe spawned outside normal development or build activity.
Network trafficHTTP requests to known LokiBot C2 endpoints.

Microsoft Defender controls can reduce script-based risk

Microsoft Defender for Endpoint includes attack surface reduction rules that can help block behavior used in campaigns like this. The Microsoft Defender ASR reference includes rules for blocking obfuscated scripts and blocking JavaScript or VBScript from launching downloaded executable content.

Microsoft says the obfuscated script rule detects suspicious properties inside obfuscated scripts. It also says the JavaScript or VBScript rule prevents scripts from launching potentially malicious downloaded content.

These controls should not replace email filtering, endpoint detection and user training. However, they can add an important layer against script-based malware chains that move from a file attachment to PowerShell and process injection.

Indicators of compromise

The following indicators were published with the campaign analysis. Defenders should use them for hunting, but should also combine them with behavioral detections because LokiBot infrastructure can change quickly.

TypeIndicatorDescription
Filenamegruijvdsdbcmcvbtryedfhpoibbedflokjqnb.jsMalicious JScript attachment
SHA256c099f965144bccd0b590f946659fc3c0747c54aef505b6caaca9078712f455fbJScript attachment hash
SHA25664c7dd0a3a3ae49977ac05913d3878000cce14e5d8c1ee05b782bdfd648bde91.NET injector or intermediate stage hash
SHA256ad10ff9043d6f327045943635fcbd0c5918acb79dc998db92ee4c7dee5224710Payload stage hash
SHA2564c9f271242f61f1a31b8146305e9a7ed512c521445d4f7a7a901e301307add3dLokiBot PE executable hash
SHA2565864a697bd7b339f56b05405f29a097cd027cafdcc4e63c2aaeccccbf930605fAdditional LokiBot sample hash
IP address158.94.211.95LokiBot C2 server IP address
Domainkbfvzoboss.bidLokiBot C2 domain
Domainalphastand.tradeLokiBot C2 domain
Domainalphastand.winLokiBot C2 domain
Domainalphastand.topLokiBot C2 domain
URLhxxp://158.94.211.95/kelly/five/fre.phpLokiBot C2 endpoint
URLhxxp://kbfvzoboss.bid/alien/fre.phpLokiBot C2 endpoint
URLhxxp://alphastand.trade/alien/fre.phpLokiBot C2 endpoint
URLhxxp://alphastand.win/alien/fre.phpLokiBot C2 endpoint
URLhxxp://alphastand.top/alien/fre.phpLokiBot C2 endpoint

Organizations should block script attachments at the mail gateway wherever possible. If business processes require scripts, teams should restrict which users can receive or run them and monitor all script-host activity closely.

Endpoint teams should review alerts involving wscript.exe, powershell.exe and aspnet_compiler.exe. A process chain that starts with a user-opened script and ends in PowerShell or a compiler process should be treated as suspicious.

Broken registry persistence (Source – LevelBlue)

The ASR rules reference gives administrators specific controls that can help block obfuscated scripts and script-driven payload launches. Security teams should test those rules in audit mode where needed, then move to block mode once compatibility is confirmed.

  • Block or quarantine .js attachments from external senders.
  • Monitor wscript.exe launching PowerShell.
  • Investigate aspnet_compiler.exe when it appears outside expected developer workflows.
  • Search hosts for the listed hashes and C2 indicators.
  • Reset credentials used on infected systems.
  • Review browser, email, FTP, VPN and financial account activity after infection.
  • Use behavior-based detection for reflective loading and process injection.

Bottom line

This LokiBot campaign shows how an old infostealer can remain effective when attackers wrap it in a newer loader chain. The JScript attachment starts the infection, PowerShell loads the intermediate stage, and the .NET injector places LokiBot inside aspnet_compiler.exe.

The final goal stays the same: steal credentials and send them to attacker-controlled infrastructure. That makes fast detection, credential rotation and script attachment controls essential.

Organizations should treat LokiBot infections as credential exposure events, not simple malware cleanup cases. Any system that ran the payload may have leaked passwords, browser secrets and application credentials before defenders saw the alert.

FAQ

What is LokiBot?

LokiBot is a Windows information stealer that has been active since 2015. It is designed to steal credentials from browsers, email clients, FTP tools, cryptocurrency wallets and other applications.

How does this LokiBot campaign start?

The campaign starts with a malicious JScript email attachment. When opened, the script runs through Windows Script Host, decodes a PowerShell loader and begins the next stage of the infection chain.

Why does the campaign use aspnet_compiler.exe?

The .NET injector launches aspnet_compiler.exe and injects the LokiBot payload into it. Running inside a legitimate Windows process can help the malware look less suspicious to some security tools.

What credentials can LokiBot steal?

LokiBot can steal credentials from web browsers, email clients, FTP and SFTP tools, cryptocurrency wallets, password stores and other software products installed on the infected system.

How can organizations defend against this LokiBot campaign?

Organizations should block script attachments, monitor wscript.exe launching PowerShell, investigate unusual aspnet_compiler.exe activity, enable behavior-based endpoint protection, use Microsoft Defender attack surface reduction rules and rotate credentials from infected systems.

Readers help support VPNCentral. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more

User forum

0 messages