The Mindset
Understanding Windows defenses serves you three ways:- Identify what’s active — Defender? AppLocker? UAC enforcing? Each changes your approach
- Understand the restrictions — what’s blocked and why
- Find the gaps — defenses are only as strong as their configuration, and misconfigured controls are common
UAC — User Account Control
UAC is the prompt that asks “do you want to allow this app to make changes?” It exists because even administrator accounts run with a standard-user token by default. When admin rights are needed, UAC prompts to elevate to the full admin token. This creates the Medium vs High integrity distinction you saw inwhoami /groups:
Why It Matters
If you get a shell as a member of the Administrators group but at Medium integrity, you have admin membership but not admin power — many actions (writing toSystem32, reading other users’ data, dumping LSASS) will fail until you elevate to High.
UAC Bypasses
Bypassing UAC means going from Medium to High without triggering a prompt. There are dozens of techniques, generally abusing auto-elevating Windows binaries:Windows Defender
Defender is the built-in antivirus and EDR. On a modern, defended box it’s your biggest obstacle — it scans files, monitors behavior, and flags known offensive tools instantly.Check Defender Status
Working Around Defender
The realistic approaches, in order of preference:- Live off the land (LOLBins) — use built-in Windows tools that aren’t flagged (
certutil,rundll32,regsvr32, PowerShell). No malicious file to detect - In-memory execution — download cradles that never write to disk (
IEX (New-Object Net.WebClient).DownloadString(...)) - Obfuscation — modify tool signatures so they don’t match known patterns
- Exclusion paths — drop into a folder Defender doesn’t scan
AppLocker — Application Whitelisting
AppLocker controls which applications and scripts are allowed to run, based on rules (publisher, path, or file hash). Where it’s deployed, you can’t just drop and run an arbitrary.exe.
Check AppLocker Policy
Bypassing AppLocker
AppLocker bypasses exploit gaps in the rules. The most common:- Writable allowed paths — if a rule allows everything in
C:\Windowsbut a subfolder there is user-writable, drop your payload in that subfolder - LOLBins — trusted, signed Microsoft binaries that can execute code (
regsvr32,rundll32,mshta,msbuild) usually aren’t blocked - Alternate script hosts — if
.exeand.ps1are blocked but.htaor.jsaren’t, use those
Group Policy
Group Policy (GPO) is how Windows centrally enforces settings — security policies, software restrictions, scripts, and the configurations behind UAC, AppLocker, and Defender. On a domain, GPOs push down from the domain controller.- GPO reveals what’s enforced — password policy, restricted groups, audit settings
- GPP (Group Policy Preferences) historically stored credentials in SYSVOL with the famous
cpassword(decryptable with a public AES key) — covered in Pillaging - Logon/startup scripts defined in GPO run automatically — a writable one is an escalation path
Defenses at a Glance
This concludes the Windows chapter. From here, head to Windows Privilege Escalation to turn everything you’ve enumerated into SYSTEM.