**💰 How a Simple RFI Turned into a $300 RCE Jackpot — A Hacker’s Wild Ride! 🚀**
A page parameter on a PHP site allowed remote file inclusion, letting the server fetch and execute an attacker-hosted file. The attacker escalated this to remote code execution by hosting a PHP web shell and running commands.
Published on krishna-cyber.medium.com
Imagine sipping on coffee ☕, casually testing a website, when suddenly — 💥 BAM! — you find an RFI vulnerability (Remote File Inclusion). Exciting, right?
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 page parameter was passed directly to a file-inclusion function without restricting it to local files or validating the input.
Impact
An attacker could run arbitrary commands on the server, leading to full remote code execution.
What the attacker needed
Target uses PHP with file inclusion; attacker can host a remote file; page parameter is user-controlled
How it was found
- Find a URL parameter named page that takes a file name.
- Try setting the parameter to a remote file URL to see if the server fetches it.
- Host a simple PHP web shell on an attacker-controlled server.
- Access the page parameter pointing to the shell and pass a command parameter to run commands.
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.
Remote File Inclusion (RFI) is when a website lets a user control which file it loads, and it can load a file from another server. If that file contains code the server runs, the attacker can make the server do anything, which is called Remote Code Execution (RCE).
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.