How I Exploited an elFinder Vulnerability on Lookup
The report describes exploiting an elFinder file manager vulnerability to gain a reverse shell, then escalating privileges via a PATH hijack on a SUID binary and a sudo misconfiguration. An attacker could read sensitive files and ultimately obtain root access.
medium.com
Published on medium.com
Pwning a TryHackMe Lab with a Locked Login, a Leaky File Manager, and a Clever Privilege Escalation
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 elFinder version was vulnerable to a known exploit, and the system had a SUID binary that called 'id' without a full path, plus a sudo rule allowing 'look' to run as root.
Impact
The attacker could execute commands as the web server user and then escalate to root, potentially compromising the entire system.
What the attacker needed
Network access to the target; valid credentials for a user; vulnerable elFinder version
How it was found
- Scan ports and discover SSH and HTTP services.
- Enumerate web directories and find login pages.
- Brute-force credentials for user Jose using Hydra.
- Log in and access files.lookup.thm, find credentials.txt.
- Identify elFinder v2.1.47 and exploit it with Metasploit to get a shell as www-data.
- Escalate privileges by hijacking PATH for the pwm binary, then use sudo look to read root files.
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 is a walkthrough of a hacking challenge where the author found a file manager with a known security flaw, used it to run commands on the server, then tricked a program into running a fake command to become a more powerful user. Finally, a misconfigured command allowed reading files as the root administrator.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.