Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2015-3306 PoC — ProFTPD mod_copy模块信息泄露漏洞

Source
Associated Vulnerability
Title:ProFTPD mod_copy模块信息泄露漏洞 (CVE-2015-3306)
Description:ProFTPD是ProFTPD团队的一套开源的FTP服务器软件。该软件具有可配置性强、安全、稳定等特点。 ProFTPD 1.3.5版本的mod_copy模块中存在安全漏洞。远程攻击者可借助site cpfr和site cpto命令利用该漏洞读取和写入任意文件。
Description
ProFTPd 1.3.5 - (mod_copy) Remote Command Execution exploit and vulnerable container
Readme
# ProFTPd 1.3.5 - (mod_copy) Remote Command Execution

ProFTPD is a highly configurable FTP daemon for Unix and Unix-like operating systems. ProFTPD grew from a desire for a secure and configurable FTP server. It was inspired by a significant admiration of the Apache web server. Unlike most other Unix FTP servers, it has not been derived from the old BSD `ftpd` code base, but is a completely new design and implementation.

## Vulnerable environment

To setup a vulnerable environment for your test you will need [Docker](https://docker.com) installed, and just run the following command:

    docker build -t vuln/cve-2015-3306 .
    docker run --rm -it -p 21:21 -p 80:80 vuln/cve-2015-3306

And it will spawn a vulnerable application on your host on `21` and `80` port

## Vulnerable code

The `mod_copy` module in ProFTPD 1.3.5 allows remote attackers to read and write to arbitrary files via the site cpfr and site cpto commands.
Any unauthenticated client can leverage these commands to copy files from any part of the filesystem to a chosen destination. The copy commands are executed with the rights of the ProFTPD service, which by default runs under the privileges of the 'nobody' user. By using `/proc/self/cmdline` to copy a PHP payload to the website directory, PHP remote code execution is made possible.

## Exploit

To exploit this target just run:

    ./exploit.py --host HOST --port PORT --path PATH

If you are using this vulnerable image, you can just run:

    ./exploit.py --host 127.0.0.1 --port 21 --path "/var/www/html/"

After the exploitation, a file called backdoor.php will be stored on the root folder of the web directory. And the exploit will drop you a shell where you can send commands to the backdoor:

	./exploit.py --host 127.0.0.1 --port 21 --path "/var/www/html/"
	[+] CVE-2015-3306 exploit by t0kx
	[+] Exploiting 127.0.0.1:21
	[+] Target exploited, acessing shell at http://127.0.0.1/backdoor.php
	[+] Running whoami: www-data
	[+] Done

## Credits

This vulnerability was found by Vadim Melihow.

## Disclaimer

This or previous program is for Educational purpose ONLY. Do not use it without permission. The usual disclaimer applies, especially the fact that me (t0kx) is not liable for any damages caused by direct or indirect use of the information or functionality provided by these programs. The author or any Internet provider bears NO responsibility for content or misuse of these programs or any derivatives thereof. By using these programs you accept the fact that any damage (dataloss, system crash, system compromise, etc.) caused by the use of these programs is not t0kx's responsibility.
File Snapshot

[4.0K] /data/pocs/2bf277c41a5fc43742340b8d51d73cd56ccaecd3 ├── [ 613] Dockerfile ├── [2.0K] exploit.py ├── [ 34K] LICENSE ├── [ 131] main.sh └── [2.6K] README.md 0 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.