LOLBAS Detection

Living off the Land Binaries and Scripts (LOLBAS) refers to legitimate Windows binaries that attackers abuse to execute code, download payloads, evade detection, and persist on systems. Because these binaries are signed by Microsoft and present on every Windows installation, they bypass application allowlisting, antivirus signature matching, and many trust-based controls. LOLBAS detection is one of the highest-value additions to a Sysmon configuration.

ICS Watch Dog provides LOLBAS detection in three tiers, balancing high-signal coverage with the false positive sensitivity of OT environments.

Why LOLBAS Detection Matters in OT

OT environments are particularly vulnerable to LOLBAS abuse for three reasons:

  1. Application allowlisting often relies on signed binaries. AppLocker and similar controls trust Microsoft-signed binaries by default, so a LOLBAS technique using certutil or regsvr32 sails through allowlisting that would block a custom malware binary.
  2. OT systems should have very predictable process activity. An HMI or engineering workstation does not need to run mshta http://, powershell -encodedcommand, or wmic /node: process call create. When these patterns appear, they almost certainly indicate intrusion.
  3. Recent OT incidents involved LOLBAS. The 2021 Oldsmar water treatment plant incident, the 2024 ConnectWise ScreenConnect mass exploitation, and many ransomware affiliates targeting industrial environments all use LOLBAS as part of their initial access and lateral movement chains.

The Three-Tier Strategy

LOLBAS detection in ICS Watch Dog is organized into three tiers based on signal-to-noise ratio. Higher tiers add broader coverage at the cost of more potential false positives. Each tier opts users in further as they mature their monitoring program.

Tier Where it lives Rule count False positive expectation
Tier 1 -- Core Inline RuleGroup in all 8 curated configs ~17 composite Rules Near zero. Each rule scoped by command-line pattern.
Tier 2 -- Advanced Inline RuleGroup in 5 advanced configs (jumphost, server-ad, server-services, enhanced-ot, advanced-ot) ~22 rules (mix of composite and binary-only) Low to moderate. Some legitimate admin uses possible.
Tier 3 -- Comprehensive Opt-in modules in sysmon-configs/modules/lolbas/ 13 modules, 153 rules total Moderate. Sigma-level coverage requires environment-specific tuning.

How Tiers Build on Each Other

The three baseline configs (baseline-it-workstation, baseline-it-server, baseline-ot) ship with Tier 1 only. Their false positive profile is protected for environments that prioritize stability over detection breadth.

The five advanced configs ship with Tier 1 plus Tier 2. These configs (jump host, AD/DC, database/web servers, OT enhanced/advanced) assume the operator has a mature tuning program and accepts moderate noise in exchange for broader detection.

Advanced users can additionally merge Tier 3 modules into any base config using the module library to add Sigma-level coverage of specific LOLBAS technique families.

Tier 1: Core LOLBAS Detection (All Configs)

Twelve detections implemented as ~17 composite Rules. Each rule uses <Rule groupRelation="and"> with binary + command-line pattern matching to minimize false positives. Every match warrants investigation.

DetectionATT&CKWhat it catches
certutil -urlcacheT1105 / T1140certutil downloading a file from a URL. No legitimate OT use.
certutil -decodeT1140certutil decoding a base64-staged payload.
mshta http(s)://T1218.005 / T1105mshta loading a remote HTML application over HTTP.
regsvr32 /i:httpT1218.010Squiblydoo remote COM scriptlet load.
bitsadmin /transferT1197 / T1105BITS file transfer download. Replaced by PowerShell BITS module in modern admin work.
PowerShell -encodedcommand or -encT1059.001 / T1027Encoded PowerShell command. Covers powershell.exe, pwsh.exe, and powershell_ise.exe.
PowerShell DownloadStringT1059.001 / T1105Net.WebClient.DownloadString stager pattern. Covers all 3 PowerShell binaries.
PowerShell IEX(New-Object or Invoke-Expression(New-ObjectT1059.001In-memory PowerShell execution cradle. Covers all 3 PowerShell binaries.
WMIC /format:http or format:"httpT1220XSL script processing remote stylesheet.
WMIC /node: or process call createT1047 / T1021.003WMIC remote process execution lateral movement.
rundll32 javascript:T1218.011 / T1059.007Rundll32 JavaScript URL handler abuse.
msdt.exe PCWDiagnostic or ms-msdt:T1218Follina exploit pattern (CVE-2022-30190).

Tier 2: Advanced LOLBAS Detection (5 Configs)

Twenty additional detections in 22 XML rules added to jumphost, server-ad, server-services, enhanced-ot, and advanced-ot. Tier 2 broadens coverage with binary-only detections and additional command-line patterns.

DetectionATT&CKWhat it catches
certutil -encodeT1132 / T1027Base64 encode for exfiltration staging.
mshta vbscript: / javascript:T1218.005Inline mshta script execution without remote URL.
Generic mshta.exeT1218.005Any mshta.exe execution (binary-only detection).
Generic bitsadmin.exeT1197Any bitsadmin.exe execution (binary-only detection).
PowerShell -w hidden -nop comboT1059.001 / T1564.003Stealth PowerShell launcher pattern.
PowerShell -ep bypassT1059.001 / T1562.001Execution policy bypass.
PowerShell from AppData\Local\Temp\T1059.001 / T1564.001PowerShell binary copied to user temp directory.
InstallUtil /UT1218.004InstallUtil uninstall mode (Squiblytwo).
regasm.exe / regsvcs.exeT1218.009.NET utility execution.
msxsl.exeT1220Standalone XSL transformation utility.
cmstp /au / /sT1218.003Connection Manager profile install abuse.
wuauclt /UpdateDeploymentProviderT1218Windows Update client DLL sideload.
Generic msbuild.exeT1127.001MSBuild execution (tune for Visual Studio install paths).
csc.exe parented by PowerShell or cmdT1027.004C# compile-after-delivery from a shell parent.
mavinject.exeT1055.001App-V DLL injection utility.
pcalua.exeT1218Program Compatibility Assistant proxy.
forfiles with cmd in /cT1059.003 / T1218forfiles process execution proxy.
finger.exeT1105Legacy finger client used as exfil/download channel.

Tier 3: Comprehensive LOLBAS Modules

13 opt-in modules in sysmon-configs/modules/lolbas/ providing Sigma-level coverage organized by ATT&CK technique family. Use the merge tool to combine these modules with a base curated config.

ModuleRulesATT&CK Focus
include_signed_binary_proxy.xml25T1218 family comprehensive (mshta, regsvr32, rundll32, cmstp, msiexec, odbcconf, control, dfsvc, gpscript, ie4uinit, mmc, msconfig, pcwrun, presentationhost, rasautou, runonce, verclsid, xwizard)
include_powershell_offensive.xml15T1059.001 offensive patterns: triple stealth flag combo, FromBase64String, Reflection.Assembly Load, TCPClient reverse shell, Invoke-Mimikatz/Kerberoast/BloodHound, double-IEX, Set-MpPreference, web cradles, string concatenation evasion
include_wmic_abuse.xml10T1047 / T1021.003 / T1220 / discovery (process call create, /node:, XSL processing, qfe, computersystem, useraccount, group, service, startup)
include_certutil_abuse.xml8All certutil abuse modes (urlcache, decode, encode, decodehex, encodehex, ping, verifyctl, addstore root)
include_bitsadmin_abuse.xml6T1197 BITS abuse (transfer, addfile, setnotifycmdline, setminretrydelay, create, resume)
include_script_host_abuse.xml10T1059.005/T1059.007 cscript/wscript/jscript abuse (with .vbs/.js from temp/Recycle Bin/HTTP, parented by Office macros)
include_trusted_developer_utilities.xml12T1127 (msbuild generic and from temp, csc, vbc, jsc, ilasm, tracker /d, dnx, rcsi, csi, ngen)
include_xsl_script_processing.xml6T1220 XSL Script Processing (WMIC and msxsl variants)
include_persistence_via_lolbas.xml10T1547.001 / T1053.005 / T1543.003 / T1546.012 (at, schtasks variants, sc create binPath, reg add Run/RunOnce/IFEO)
include_discovery_recon.xml15T1033/T1069/T1087/T1018/T1057/T1082/T1016 discovery commands (whoami, net group, nltest, quser, qwinsta, tasklist /svc, systeminfo, route, arp)
include_amsi_bypass_patterns.xml8T1562.001 AMSI bypass strings in PowerShell command lines
include_dotnet_unmanaged_abuse.xml8T1218 / T1127 .NET unmanaged execution (csi, Microsoft.Workflow.Compiler, jsc, dotnet from temp/Public, InstallUtil/RegSvcs/RegAsm from AppData)
include_uncommon_lolbas.xml20T1218 long-tail rare LOLBAS plus WSL detection (replace, runscripthelper, AgentExecutor, AppInstaller, ConfigSecurityPolicy, dnscmd /serverlevelplugindll, hh, ttdinject, OfflineScannerShell, MSDeploy, Squirrel, Update.exe, WorkFolders, wsl.exe)
Total153--

AMSI Bypass Limitation

The AMSI bypass patterns module covers known string-based bypass techniques (amsiInitFailed, AmsiScanBuffer, AmsiContext, AmsiUtils, etc.). These strings are derived from public bypass tools. Determined attackers rotate strings or use unpublished bypass techniques not covered by this module. Treat this module as one signal among many, and pair with broader PowerShell behavioral analytics in your SIEM. Advanced users should extend the module with site-specific patterns observed in their environment.

OT False Positive Tuning Guide

LOLBAS detection in OT environments requires balancing detection coverage with operational stability. The Tier 1/Tier 2 split exists precisely for this reason: baseline configs stay conservative, advanced configs accept more noise.

Common False Positive Sources

Tuning Approach

  1. Deploy in a non-production lab or pilot environment first
  2. Monitor LOLBAS rule fire volume for 7-30 days
  3. Identify high-volume rules and the parent processes triggering them
  4. Add specific exclusions by parent process or full image path -- not by binary alone
  5. Document each exclusion in a per-site exclusion file or tuning notes
  6. Re-evaluate quarterly

Per-Rule Tuning Notes

Each LOLBAS rule in the curated configs (Tier 1 and Tier 2) has a maintainer XML comment block above it documenting the ATT&CK technique, the abuse pattern, OT-specific tuning notes, and investigation guidance. Read the source XML files for per-rule context. The Tier 3 modules also include header comments explaining false positive risks and tuning recommendations.

Composite Rule Logic

Tier 1 and most Tier 2 LOLBAS rules use Sysmon's composite <Rule groupRelation="and"> elements. A composite Rule fires only when ALL inner conditions match. This is essential for high-precision LOLBAS detection that scopes by binary AND command-line pattern simultaneously.

<Rule name="technique_id=T1218.005|T1105,technique=Mshta,detection=Mshta loading remote HTA over HTTP/HTTPS"
      groupRelation="and">
  <Image condition="end with">\mshta.exe</Image>
  <CommandLine condition="contains">http</CommandLine>
</Rule>

This rule fires only when both conditions match: the process is mshta.exe AND its command line contains http. Either condition alone would not trigger.

Schema compatibility: Composite Rules are supported in Sysmon schema 4.20 and later. The ICS Watch Dog baseline schema 4.50 (Sysmon v13+) supports them.

Tagging convention: Per the ATT&CK Rule Tagging convention, the parent <Rule> element receives the tagged name. Inner field conditions stay untagged to avoid duplicate names in the event log.

Comparison with Other Sysmon Configs

ProjectLOLBAS CoverageApproach
SwiftOnSecurity sysmon-config Heavy inline Single-file enterprise IT config with extensive LOLBAS rules baked in. Excellent coverage but no OT-specific FP profile.
olafhartong/sysmon-modular Heavy modular Dedicated include_living_off_the_land.xml module among 200+ modules. Sigma-level depth. Targets enterprise IT with Sysmon v15+.
SigmaHQ/sigma Very heavy (rules) Sigma rule library with comprehensive LOLBAS coverage. Sigma rules can be converted to Sysmon configs but are not Sysmon-native.
ICS Watch Dog Three-tier (inline + modules) Tier 1 baseline (12 detections), Tier 2 advanced configs (~20 detections), Tier 3 modules (153 rules across 13 modules). OT-friendly false positive profile preserved at the baseline level.

The three-tier strategy is unique to ICS Watch Dog among Sysmon configuration projects. It addresses the OT-specific need for stable, low-FP detection at the baseline level while still offering Sigma-level depth for advanced users.

References