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.

Lesson 7 of 16 · 12 min read · practice only with authorization

Diagram

Built-in tools in process telemetry

Follow the path. One example at a time.

Step 1 of 4

Logging

Process creation with full command line must be on.

Illustration: Logging
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.

  1. 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.
  2. 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.
  3. 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.

1 / 3

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.

Practice

  1. LabControl benchA failure is described. Choose the control that changes the outcome.

Glossary

  1. CardLiving off the landAn intruder uses built-in administration tools already on the host, so the activity resembles normal IT work.