Exposing the Vulnerable: A Narrative of a Full System Takeover (T
A hidden web application on a non-standard port had a local file inclusion (LFI) vulnerability that allowed reading of configuration files containing hardcoded database credentials. Using those credentials, the attacker accessed an admin portal, found a cleartext password, and uploaded a PHP reverse shell to gain a foothold; later, a SUID misconfiguration on the find binary allowed full root compromise.
Published on medium.com
In this technical post-mortem, we detail the end-to-end compromise of “Expose,” a Linux target designed to test multi-stage exploitation. The attack path moved through non-standard service discovery, source code leakage via LFI, and ultimately, an escalation to root through misconfigured system binaries.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the root cause was a chain of misconfigurations: an unsanitised file parameter enabling LFI, hardcoded credentials in source code, insecure file upload validation, and a SUID binary that allowed privilege escalation.
Impact
The attacker could read sensitive files, execute arbitrary code as the web user, and ultimately gain full root control of the system.
What the attacker needed
Access to the web server on port 1337; ability to send HTTP requests; no authentication required for LFI
The fix
The vulnerabilities should be fixed by sanitising file paths, removing hardcoded credentials, validating file uploads properly, and removing unnecessary SUID permissions from binaries like find.
How it was found
- Scan the target with Nmap and discover a web server on port 1337.
- Fuzz directories on the web server and find a PHP script with a file parameter.
- Exploit local file inclusion to read /etc/passwd and then config.php, obtaining database credentials.
- Use the credentials to access an admin portal and find a cleartext password for an upload page.
- Upload a PHP reverse shell by bypassing the extension filter (e.g., shell.php.jpg) and renaming it to .php during transit.
- Use the LFI to read ssh_creds.txt from the user zeamkish's home directory, then SSH in as that user.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This report describes a series of mistakes that let an attacker take over a Linux machine step by step. First, a web page that lets you read files on the server (called local file inclusion) exposed a password file. That password led to an admin area where the attacker could upload a malicious script, and finally a misconfigured system program let them become the all-powerful root user.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.