Living off the land: detecting misuse of built-in admin tools
Attackers use PowerShell, WMI, certutil, and other built-in binaries so nothing new lands on disk. How to log command lines, baseline normal admin use, and write detections using LOLBAS as a reference.
Diagram
Built-in tools in process telemetry
Step 1 of 4
Logging
Process creation with full command line must be on.
Sysmon Event ID 1 / Windows 4688 with command line auditing PowerShell: Script Block Logging (Event 4104)
The example on the open step is one illustration, or the fix you can paste into an application you own.
What this page is made of
3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.
Command-line visibility
- What fails
- Without command lines, a powershell.exe event says almost nothing.
- Who is affected
- Investigators and detection engineers.
- What you would notice
- Process events without CommandLine fields.
- What you change
- Enable command-line auditing, Sysmon, or EDR telemetry.
Rare parent-child pairs
- What fails
- Office apps or browsers spawning shells is unusual.
- Who is affected
- Users whose documents start processes.
- What you would notice
- WINWORD.EXE or EXCEL.EXE parents for cmd, powershell, or mshta.
- What you change
- Alert on these pairs and block them with attack surface reduction rules.
Baselines
- What fails
- Admins use the same tools legitimately.
- Who is affected
- Analysts drowning in false positives.
- What you would notice
- Alerts on every PowerShell run.
- What you change
- Baseline per host role and user group, then alert on outliers.
Reference projects
The LOLBAS project lists Windows binaries and their dual-use functions, and GTFOBins does the same for Unix. Use them to decide which binaries need detections in your environment, and map them to MITRE ATT&CK techniques such as T1218 (System Binary Proxy Execution).
Prevention as well as detection
Microsoft Defender attack surface reduction rules can block Office apps from creating child processes and block obfuscated scripts. Turn them on in audit mode, review, then enforce.
Check yourself
Recognition and the fix. Nothing here is a procedure.
Which event is most suspicious?
Sibling techniques
Pages at the same depth, plus a lab and a glossary card for this one.
This page stands on its own. The lab and the glossary card are the next reading.