Chapter 16 Exercises: Windows Exploitation and Privilege Escalation
⚖️ Legal Note: All exercises must be performed on systems you own or have explicit authorization to test. Use your Student Home Lab Windows VMs.
Exercise 1: Windows Security Model Mapping
Difficulty: Beginner | Time: 20 minutes
Explore the Windows security model on your lab VM.
- Run
whoami /alland document every field: SID, groups, privileges, and integrity level. - Explain the meaning of each enabled/disabled privilege.
- Identify which privileges, if enabled, could be exploited for escalation.
- Compare the output for a standard user, a local administrator (non-elevated), and an elevated administrator.
Deliverable: A comparative table showing security contexts across the three privilege levels.
Exercise 2: Unquoted Service Path Discovery and Exploitation
Difficulty: Intermediate | Time: 30 minutes
- On your lab VM, create a service with an unquoted path containing spaces (e.g.,
C:\Program Files\My Custom App\service.exe). - Configure the service to run as SYSTEM with Auto start.
- Identify the service using
wmicand verify it appears in WinPEAS output. - Determine which path locations Windows will try to resolve.
- Place a benign executable (e.g., calc.exe renamed) at an injection point.
- Restart the service and verify which binary executes.
- Document the fix: quote the service path.
Deliverable: Step-by-step exploitation walkthrough with screenshots.
Exercise 3: Token Impersonation with PrintSpoofer
Difficulty: Intermediate | Time: 25 minutes
- Set up an IIS web server on your lab VM running as a service account.
- Obtain a web shell as the IIS service account (
iis apppool\defaultapppool). - Verify that
SeImpersonatePrivilegeis enabled usingwhoami /priv. - Transfer PrintSpoofer to the target and escalate to SYSTEM.
- Repeat the exercise using GodPotato.
- Document which Potato variant works on your specific Windows version.
Deliverable: Comparison of Potato attack variants with version compatibility notes.
Exercise 4: Service Permission Exploitation
Difficulty: Intermediate | Time: 30 minutes
- Create a vulnerable service where Authenticated Users have
SERVICE_CHANGE_CONFIGpermission. - As a standard user, use
sc configto change the service binary path to a payload. - Restart the service and verify SYSTEM-level execution.
- Restore the original service configuration.
- Fix the service permissions using
sc sdset.
Deliverable: Complete exploitation and remediation documentation.
Exercise 5: AlwaysInstallElevated Exploitation
Difficulty: Beginner | Time: 20 minutes
- Enable AlwaysInstallElevated in both HKLM and HKCU registry locations.
- Generate a malicious MSI using
msfvenom. - Install the MSI as a standard user and verify SYSTEM execution.
- Disable AlwaysInstallElevated and verify the fix.
Deliverable: Registry configuration screenshots and exploitation proof.
Exercise 6: DLL Hijacking Lab
Difficulty: Advanced | Time: 45 minutes
- Use Process Monitor (ProcMon) to identify DLL loading for a target service.
- Filter for
CreateFileoperations withNAME NOT FOUNDresults ending in.dll. - Identify a writable directory in the DLL search path.
- Create a malicious DLL that logs execution (rather than spawning a shell, for safety).
- Place the DLL and verify it is loaded when the service starts.
Deliverable: ProcMon filter setup documentation and DLL hijacking proof.
Exercise 7: Credential Hunting Methodology
Difficulty: Beginner | Time: 25 minutes
Systematically search for credentials on your lab VM.
- Check for saved credentials using
cmdkey /list. - Search for unattend.xml files in standard locations.
- Examine PowerShell history.
- Check for AutoLogon credentials in the registry.
- Examine SAM/SYSTEM backup files.
- Search IIS configuration files for connection strings.
- Document each finding and its exploitation potential.
Deliverable: Credential hunting checklist with findings.
Exercise 8: UAC Bypass Techniques
Difficulty: Intermediate | Time: 30 minutes
- Log in as a local administrator and verify your integrity level is Medium.
- Attempt to perform an administrative action without elevation (expect failure).
- Use the
fodhelper.exeUAC bypass technique to get a High integrity shell. - Verify your elevated privileges with
whoami /groups. - Test the
eventvwr.exebypass as an alternative. - Document the registry keys involved in each bypass.
Deliverable: UAC bypass documentation with before/after integrity level evidence.
Exercise 9: Windows Exploit Suggester
Difficulty: Beginner | Time: 20 minutes
- Capture
systeminfooutput from your lab VM. - Run Windows Exploit Suggester (wesng) against the output.
- Filter results for "Elevation of Privilege" impact.
- For each suggested exploit, research whether it applies to your specific Windows version.
- Create a prioritized list of exploits by likelihood of success.
Deliverable: Exploit assessment report with prioritized findings.
Exercise 10: WinPEAS vs. PowerUp Comparison
Difficulty: Beginner | Time: 30 minutes
- Run WinPEAS (executable version) on your lab VM.
- Run PowerUp's
Invoke-AllChecksin PowerShell. - Run Seatbelt with
-group=all. - Compare findings across all three tools.
- Identify findings unique to each tool.
- Evaluate which tool is most effective in different scenarios (e.g., when PowerShell is restricted, when AV is active).
Deliverable: Comparative analysis with recommendation matrix.
Exercise 11: Scheduled Task Exploitation
Difficulty: Intermediate | Time: 25 minutes
- Create a scheduled task that runs a script as SYSTEM.
- Make the script writable by standard users.
- As a standard user, modify the script to add a backdoor user.
- Wait for the scheduled task to run and verify the new user was created.
- Fix the vulnerability by correcting file permissions.
Deliverable: Exploitation proof and remediation steps.
Exercise 12: Registry Autorun Persistence and Escalation
Difficulty: Intermediate | Time: 20 minutes
- Examine all autorun registry keys on your lab VM.
- Check file permissions on each referenced binary.
- If any binary is writable, document the privilege escalation opportunity.
- Add a benign autorun entry to HKCU and verify it executes on login.
- Verify detection: check if Windows Defender or other AV alerts on the autorun modification.
Deliverable: Registry autorun analysis report.
Exercise 13: AMSI Bypass Lab
Difficulty: Advanced | Time: 30 minutes
- Attempt to run a PowerShell script detected by AMSI (e.g., Invoke-Mimikatz).
- Observe the AMSI block and error message.
- Research and implement an AMSI bypass technique.
- Verify the previously blocked script now executes.
- Document the bypass technique and its detection opportunities.
Deliverable: AMSI bypass documentation with defensive detection guidance.
Exercise 14: SeBackupPrivilege Exploitation
Difficulty: Advanced | Time: 30 minutes
- Create a user account with SeBackupPrivilege (add to Backup Operators group).
- Use the privilege to copy the SAM and SYSTEM registry hives.
- Transfer the hives to your attack machine.
- Extract password hashes using
secretsdump.py. - Crack a hash to verify the technique worked.
Deliverable: Complete exploitation chain with hash extraction evidence.
Exercise 15: Windows Privilege Escalation Report
Difficulty: Advanced | Time: 60 minutes
Using your lab VM configured with multiple vulnerabilities, perform a complete privilege escalation assessment.
- Start as a standard domain user.
- Run automated enumeration tools.
- Identify and exploit at least two different privilege escalation vectors.
- Write a professional penetration test report including executive summary, technical findings with evidence, risk ratings, and remediation recommendations.
Deliverable: Full penetration test report following industry standards.
🔵 Blue Team Exercise: Windows Hardening
Difficulty: Intermediate | Time: 45 minutes
- Audit all services for unquoted paths and fix them.
- Review and restrict service account privileges.
- Disable AlwaysInstallElevated.
- Enable Credential Guard and LSA Protection.
- Configure Windows Event Log monitoring for privilege escalation indicators (Event IDs 4672, 4673, 4674, 7045).
- Deploy and configure LAPS for local admin passwords.
- Run WinPEAS and verify minimal findings.
Deliverable: Windows hardening checklist with before/after evidence.