Exploiting ProFTPD 1.3.5 Remote Code Execution (CVE-2015–3306)
The ProFTPD 1.3.5 mod_copy vulnerability allowed an attacker to copy files into the Apache web root, leading to remote code execution. The attacker used Metasploit to write a PHP payload and execute a command to read a secret file.
Published on medium.com
While solving this Hackviser lab, the goal was straightforward, retrieve the secret stored inside /secret.txt.
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 mod_copy module in ProFTPD 1.3.5 allows unauthenticated users to copy files to arbitrary locations, which can lead to code execution if a writable web directory is present.
Impact
An attacker could execute arbitrary commands on the target system, leading to full compromise.
What the attacker needed
ProFTPD 1.3.5 with mod_copy enabled; Apache web server with writable directory; Network access to FTP and HTTP ports
How it was found
- Scan the target with Nmap to find open ports and services.
- Identify ProFTPD 1.3.5 as vulnerable to CVE-2015-3306.
- Load the Metasploit module exploit/unix/ftp/proftpd_modcopy_exec.
- Set the target IP, payload (cmd/unix/generic), and site path (/var/www/html).
- Set the command to copy /secret.txt to a web-accessible file.
- Run the exploit and retrieve the output file via HTTP.
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.
ProFTPD is an FTP server program. A bug in its mod_copy feature let an attacker copy files to places they shouldn't, like the web server's folder. The attacker then put a malicious PHP script there, which the web server ran, letting them execute commands on the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.