A living-off-the-land binary (LOLBin) hunt asks whether trusted, signed system tools in your estate are being run by the wrong parent, with the wrong arguments, from the wrong place or by the wrong identity. This guide turns that question into a repeatable hunt: the hypotheses, the Windows telemetry you need, illustrative query logic, a baselining method that keeps noise manageable, and a triage path that ends in a decision.
Attackers favour built-in tools because they are already present, signed by the operating system vendor and used every day by administrators. MITRE ATT&CK groups much of this behaviour under System Binary Proxy Execution (T1218), with sub-techniques such as Mshta (T1218.005), Regsvr32 (T1218.010) and Rundll32 (T1218.011), alongside PowerShell (T1059.001), BITS Jobs (T1197) and Ingress Tool Transfer (T1105). CISA and partner agencies, including the NSA, FBI, NCSC-UK and ASD's ACSC, have published joint guidance on identifying and mitigating living off the land techniques, noting that many organisations lack the detection capability to tell this activity apart from legitimate behaviour.
For the full catalogue of LOLBins, prevention controls and a phased rollout, read the Living off the Land Guide. For hunting as a programme, see the Threat Hunting Guide. This page covers the hunt only. It describes detection and response, not how to abuse any tool.
Key takeaways
- LOLBin hunting is a context problem, not a binary list problem. The same executable is normal from one parent, path and account and suspicious from another.
- Process creation with full command lines and parent processes is the foundation. Sysmon event 1 or an EDR equivalent is essential; PowerShell script block logging (event 4104) and network and DNS telemetry make the hunt far sharper.
- Start from Microsoft's own list of applications that can bypass App Control, such as mshta.exe, msbuild.exe, wmic.exe, cscript.exe and wscript.exe, then narrow by context.
- Baseline by binary, parent, account type and host role before hunting. Most hits will be administrators and software deployment tools.
- Service accounts and other non-human identities running interactive-style tools are a strong signal, because their behaviour should be narrow and predictable.
- The best long-term result is fewer tools available to abuse: block what you do not need, and run Attack Surface Reduction rules in audit first to see what blocking would affect.
The hunt hypotheses
Write hypotheses before querying. Pick two or three per run rather than hunting every LOLBin at once.
- H1, proxy execution: "A signed Windows binary that can execute other code, such as mshta.exe, rundll32.exe or regsvr32.exe, is being launched by an Office application, browser, script host or archive tool, or is loading content from a remote or user-writable location."
- H2, scripted execution: "PowerShell or a script host is running obfuscated, encoded or download-and-run content on hosts or under accounts where that is not normal."
- H3, ingress transfer: "Built-in tools with download capability are fetching files from the internet onto endpoints or servers outside software deployment processes."
- H4, identity misuse: "Service accounts or other non-human identities are running discovery, scripting or remote execution tools that fall outside their defined function."
Define the window (14 to 30 days is typical given process telemetry volume), the host scope (workstations, servers and domain controllers as separate populations) and success criteria. Record them in the Threat Hunt Hypothesis Backlog Template.
Data sources and readiness checks
Process creation
Microsoft documents Sysmon event 1, Process creation, as providing extended information about a newly created process, including the command line and parent. Most EDR platforms record the same facts under their own field names. Without full command lines this hunt is close to impossible, so confirm they are captured and not truncated.
Script content
Microsoft documents PowerShell script block logging as recording the content of all script blocks PowerShell processes, as event ID 4104. For PowerShell 7 the documentation places these in the PowerShellCore Operational log; Windows PowerShell uses Microsoft-Windows-PowerShell/Operational. Microsoft warns that script block logging can capture sensitive data such as credentials and recommends Protected Event Logging, which encrypts the content with a certificate whose private key is kept off the logging machines.
Network and DNS
Sysmon event 3 (Network connection) and event 22 (DNS query) tie a process to its outbound activity. Microsoft notes that event 3 is disabled by default, so check your configuration. Event 11 (FileCreate) and event 29 (FileExecutableDetected) show what landed on disk after a download.
Attack Surface Reduction events
If you run Microsoft Defender for Endpoint, Attack Surface Reduction (ASR) rules in audit mode give you ready-made hunting leads. Microsoft documents advanced hunting ActionType values such as AsrOfficeChildProcessAudited, AsrObfuscatedScriptAudited, AsrScriptExecutableDownloadAudited, AsrPsexecWmiChildProcessAudited and AsrAbusedSystemToolAudited, with matching Blocked values in block mode.
Readiness checklist
- Process creation with full command line, parent process, user and integrity level from all hosts in scope.
- Script block logging enabled and, ideally, protected.
- Process-level network and DNS telemetry enabled.
- Host role tags (workstation, server, domain controller, jump host, build server).
- Account type tags (human, admin, service account, managed service account, machine).
Which binaries to start with
Microsoft publishes a list of applications that can bypass App Control allow policies and recommends blocking them unless your scenarios explicitly require them. It is a useful, primary-source starting set for hunting because each entry is a signed tool that can run other code. Examples from that list include:
| Group | Examples from Microsoft's list | Hunting angle |
|---|---|---|
| Script hosts | mshta.exe, cscript.exe, wscript.exe | Parent process, remote or user-writable script paths. |
| Build and compile tools | msbuild.exe, Microsoft.Workflow.Compiler.exe, aspnet_compiler.exe, csi.exe | Use outside developer and build hosts. |
| Management tools | wmic.exe | Remote node targets, process creation, use by non-admin accounts. |
| Debuggers | cdb.exe, windbg.exe, kd.exe, ntsd.exe | Presence at all on standard user endpoints. |
| Subsystem tools | bash.exe, wsl.exe, wslhost.exe | Use on hosts where WSL is not approved. |
| Installers and helpers | infdefaultinstall.exe, addinutil.exe, runscripthelper.exe | Any use outside known software deployment. |
Microsoft notes that msbuild.exe should be allowed where it is used to build managed applications and blocked otherwise, which is exactly the context a hunt should test. Add rundll32.exe, regsvr32.exe, PowerShell and BITS from the ATT&CK techniques above, and any remote monitoring and management tools you do not sanction.
Illustrative hunt queries
All logic below is illustrative pseudocode. Translate it to your EDR or SIEM schema, and see the KQL for Threat Hunting Guide or Splunk SPL for Threat Hunting Guide for syntax.
Query 1: unusual parents for proxy execution binaries (H1)
process_creation | where image in (mshta, rundll32, regsvr32, msbuild, cscript, wscript, wmic) | where parent_image in (Office apps, browsers, archive tools, email clients, script hosts) | summarise count by image, parent_image, host_role
Office or a browser launching a script host or proxy binary is rarely legitimate on a standard workstation.
Query 2: remote or user-writable payloads (H1, H3)
process_creation | where image in (proxy execution binaries) | where command_line contains (http, https, UNC path, \AppData\, \Temp\, \Users\Public\)
A signed binary told to load content from the internet, a network share or a temporary folder is a high-value lead.
Query 3: encoded or obfuscated PowerShell (H2)
script_block_events (4104) | where script_text has (base64 decoding, compressed stream, character joining, download string patterns) | summarise by host, user, first_seen
Pair with process creation to see what launched PowerShell. Encoded commands from Office, a script host or a scheduled task created in the window deserve priority.
Query 4: rare binary and host pairs (all hypotheses)
baseline = process_creation days -30 to -8, distinct (image, host) | recent = last 7 days | recent where (image, host) not in baseline and image in (starting set)
First-seen use of a LOLBin on a host where it has never run is one of the simplest and most effective filters.
Query 5: non-human identities running interactive tools (H4)
process_creation | where user in service_account_list | where image in (powershell, cmd, wmic, net, nltest, whoami, mshta, rundll32) | where parent_image not in expected service binaries
Service accounts should run a narrow set of processes under a known parent. A service account spawning discovery or scripting tools often means a stolen credential or a compromised application. The how-to on detecting service account misuse covers the identity side.
Query 6: LOLBin followed by outbound connection (H3)
join process_creation (starting set) with network_connection on process and host | where destination is external and rare across estate | where connection within 2 minutes of process start
Query 7: ASR audit hits as leads
asr_events | where ActionType in (AsrOfficeChildProcessAudited, AsrObfuscatedScriptAudited, AsrScriptExecutableDownloadAudited, AsrPsexecWmiChildProcessAudited, AsrAbusedSystemToolAudited) | summarise by ActionType, host, file, initiating_process
Microsoft notes that the copied or impersonated system tools rule can flag legitimate third-party executables based on heuristics, so treat these as leads to triage, not verdicts.
Baselining to cut noise
Expect most raw hits to be legitimate. Administrators, software deployment agents, endpoint management, build pipelines and monitoring tools use these binaries constantly. Build the baseline in four dimensions:
- Binary and parent: which parent processes normally launch each LOLBin in your estate.
- Binary and host role: build servers run msbuild, admin jump hosts run wmic and PowerShell remoting, standard workstations do neither.
- Binary and account type: human admins, standard users, service accounts and machine accounts each have a different normal.
- Command line shape: deployment tools tend to use the same arguments every time; group by a normalised command line and review the long tail.
Allow-list known patterns with an owner and a review date. Never allow-list a binary outright; allow-list the binary, parent, path and account combination.
Triage: what to do with each hit
Step 1: reconstruct the process tree
Walk up from the LOLBin to the first parent you can explain: a user opening an attachment, a scheduled task, a service, a remote session. Walk down to every child process, file and connection it produced.
Step 2: identify the identity
Which account ran it, and is that account human or non-human? Did the account log on from somewhere new before the activity? A service account or a human admin account used outside its normal hosts raises severity sharply.
Step 3: check for a change record
Many hits are administrators doing real work. Check change tickets, deployment schedules and the admin's own account of what they did.
Step 4: look for spread
Search for the same command line shape, payload path, hash or destination on other hosts. LOLBin activity during an intrusion rarely stays on one machine.
Step 5: decide
| Outcome | Action |
|---|---|
| Explained and expected | Add a narrow allow-list entry with owner and review date. |
| Legitimate but risky | Ask the owner to change the method, for example a signed deployment package instead of a script host. Raise a hardening ticket. |
| Unexplained or malicious | Escalate to incident response. Isolate the host, preserve telemetry, reset and review the credentials of the account involved, including any service account secrets on the host. |
Hardening that makes the next hunt quieter
- Block unneeded binaries. Apply Microsoft's recommended block rules through App Control for Business, keeping exceptions such as msbuild.exe only where needed. Microsoft notes that when a bypass is fixed in a newer version, earlier versions should be denied. See the App Control for Business (WDAC) guide.
- Roll out ASR rules from audit to block. Start with Block all Office applications from creating child processes, Block execution of potentially obfuscated scripts, Block JavaScript or VBScript from launching downloaded executable content and Block process creations originating from PSExec and WMI commands, in audit mode, and use this hunt's results to decide where blocking is safe. Microsoft notes that some script rules depend on cloud-delivered protection or AMSI.
- Protect script logs. Enable Protected Event Logging so script block logs do not become a store of captured credentials.
- Constrain service accounts. Deny interactive logon, restrict the hosts they can use and move them to managed accounts where possible.
- Separate admin work. Run administration from dedicated jump hosts, so LOLBin use elsewhere stands out.
Turning the hunt into detection
Promote tuned queries to rules:
- Office, browser or email client spawning a script host or proxy execution binary.
- Proxy execution binary with a URL, UNC path or temporary folder in its command line.
- First-seen LOLBin on a domain controller or other tier 0 host.
- Service account running discovery or scripting tools outside its known parent.
- Any ASR block event for these rules, plus a weekly review of audit events.
Rerun the hunt after every policy change and at least quarterly. Feed confirmed patterns back into your App Control policy.
Common failure patterns
- Hunting by binary name alone. Every admin shows up and analysts give up. Context is the signal.
- Truncated command lines. Collectors cut long command lines, removing the very arguments that matter.
- Script block logging off, or unprotected. Either no visibility into PowerShell, or a log full of secrets.
- Broad allow lists. Allow-listing a binary for all users and hosts creates a permanent blind spot that attackers can use.
- Ignoring service accounts. Non-human identities are excluded as noise when they should have the tightest baseline of all.
- Treating ASR audit as a verdict. Audit hits are leads; some are legitimate tools caught by heuristics.
- Never blocking. The hunt finds the same unneeded tools every quarter because nobody removes them.
Practitioner checklist
- Two or three hypotheses chosen and written down with window, scope and success criteria.
- Full command line and parent process captured for all hosts in scope.
- PowerShell script block logging enabled, with Protected Event Logging.
- Process-level network and DNS telemetry enabled, including Sysmon event 3 if you rely on Sysmon.
- Starting set of binaries drawn from Microsoft's App Control bypass list and the ATT&CK techniques.
- Baseline built by binary, parent, host role, account type and command line shape.
- Queries run and labelled illustrative; every hit dispositioned.
- Service accounts given their own tight baseline and alerts.
- ASR rules in audit, with a plan to move to block based on hunt findings.
- Unneeded LOLBins blocked through App Control and the hunt scheduled to repeat.
Standards and references
- Microsoft Learn: Applications that can bypass App Control and how to block them
- Microsoft Learn: Attack surface reduction rules reference
- Microsoft Learn: about_Logging_Windows (PowerShell script block logging)
- Microsoft Learn: Sysmon
- CISA: Identifying and Mitigating Living Off the Land Techniques
- MITRE ATT&CK: System Binary Proxy Execution (T1218)
- MITRE D3FEND: Executable Allowlisting
- NIST: SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management
Related NHI Mgmt Group resources: Living off the Land Guide · Threat Hunting Guide · App Control for Business (WDAC) · How to Detect Service Account Misuse