Skip to content
RCE Write-up Intermediate

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

Stoic_Gang, on medium.com

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

  1. Scan ports and discover SSH and HTTP services.
  2. Enumerate web directories and find login pages.
  3. Brute-force credentials for user Jose using Hydra.
  4. Log in and access files.lookup.thm, find credentials.txt.
  5. Identify elFinder v2.1.47 and exploit it with Metasploit to get a shell as www-data.
  6. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.