Living-off-the-land binaries are legitimate, signed Windows utilities that can download, decode, execute or proxy code. Blocking them outright usually breaks something, so detection has to be specific: which arguments, from which parent, with which network or file side effects. The LOLBAS project catalogues the abuses; the job is to turn that catalogue into tuned, tiered detections.
Signals at a Glance
| Binary | Abuse pattern | ATT&CK |
|---|---|---|
| certutil.exe | -urlcache -split -f to download; -decode or -decodehex to unpack | T1105 |
| mshta.exe | Remote or local .hta, javascript: or vbscript: URL on the command line | T1218.005 |
| bitsadmin.exe | /transfer, /addfile or /SetNotifyCmdLine to fetch or chain execution | T1197 |
| msiexec.exe | /i or /q with an http(s) URL or a package from a user-writable path | T1218.007 |
| Any LOLBin | Spawned by Office, a script host or a browser; outbound connection from the LOLBin | T1218 |
Arguments, Parents and Network
Start with a tight, high-fidelity set. Each of these usages is rare for a human administrator and common for malware. This query covers the four binaries in one pass; split it into separate rules when you tune:
// Microsoft Defender XDR (KQL) - high-signal LOLBin argument patterns
DeviceProcessEvents
| where Timestamp > ago(7d)
| where (FileName =~ "certutil.exe"
and ProcessCommandLine has_any ("-urlcache", "-verifyctl", "-decode", "-decodehex", "-encode"))
or (FileName =~ "mshta.exe"
and ProcessCommandLine matches regex @"(?i)(https?://|javascript:|vbscript:)")
or (FileName =~ "bitsadmin.exe"
and ProcessCommandLine has_any ("/transfer", "/addfile", "/SetNotifyCmdLine"))
or (FileName =~ "msiexec.exe"
and ProcessCommandLine matches regex @"(?i)\s/[iqjy].*https?://")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine
// tune/validate: software deployment tooling uses msiexec and bitsadmin the same way.
Argument matching alone misses renamed binaries and reordered flags, so add a rarity layer. In Splunk, rank command lines by how few hosts ever run them:
index=sysmon EventCode=1 (OriginalFileName IN ("CertUtil.exe","MSHTA.EXE","bitsadmin.exe","msiexec.exe"))
| eval exe=lower(OriginalFileName)
| stats count dc(host) as hosts values(ParentImage) as parents by exe, CommandLine
| where hosts <= 2 AND count < 5
| sort - count
`comment("tune/validate: OriginalFileName catches renamed copies; review parents first")`
Context That Separates Abuse
- Use
OriginalFileNamefrom the PE header, not the file name, so renamed copies of certutil or mshta still match. - Escalate when the parent is winword.exe, excel.exe, outlook.exe, a browser or wscript.exe; legitimate administration rarely starts from those.
- Join Sysmon Event 3 to find LOLBins that open outbound connections, especially mshta.exe and certutil.exe from workstations.
- Prioritise by LOLBAS category: download and execute capabilities deserve alerts; read-only capabilities may belong in hunting queries only.
- Pair detections with application control or ASR rules that block the worst offenders outright where the business allows.
Use LOLBAS as the catalogue of abuses, the SigmaHQ process-creation rules for each binary, Elastic’s LOLBin detections, Splunk ESCU content and Atomic Red Team tests for T1218 and T1105. Baseline your own environment — software distribution, installers and some management agents legitimately use these utilities.
Build Detections That Fire
Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.
- Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
- Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
- 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Stay ahead of emerging threats. Get notified when we publish new intelligence reports and advisories.
Subscribe to Alerts