Snookums
Privilege Escalation via writable /etc/passwd
Summary
FTP allowed anonymous login but directory listing failed.
Apache server hosted vulnerable Simple PHP Photo Gallery v0.8.
LFI and RFI exploits led to remote code execution via PHP reverse shell.
MySQL
DBPASS
for root found in webroot PHP config.Credentials for local users recovered via double base64 decoding from MySQL.
Privilege escalation achieved by abusing write access to
/etc/passwd
.
🧵 Let's Unpack
🔎 Enumeration
FTP:
vsftpd 3.0.2
allowed anonymous login (but no directory listing)HTTP: Apache 2.4.6 hosted Simple PHP Photo Gallery v0.8
MySQL open on
3306
(unauth)Samba, RPCBind, and SSH present
⚡ Initial Foothold
Used LFI to read
/etc/passwd
and RFI to execute PHP shell
Reverse shell connection received, gained shell access
🔐 Credential Extraction
Found
db_config.php
in/var/www/html
:
Logged into MySQL using:
Extracted user credentials from
users
table (double base64 encoded):
Decoded credentials:
michael :
HockSydneyCertify123
josh :
MobilizeHissSeedtime747
serena :
OverallCrestLean000
SSH login as
michael
successful
🪜 Privilege Escalation
michael
had write access to/etc/passwd
Added root user manually using crafted password hash:
Gained root shell 🎉
Last updated
Was this helpful?