All Projects → t0kx → Exploit Cve 2016 9920

t0kx / Exploit Cve 2016 9920

Licence: gpl-3.0
Roundcube 1.0.0 <= 1.2.2 Remote Code Execution exploit and vulnerable container

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Exploit Cve 2016 9920

SAP vulnerabilities
DoS PoC's for SAP products
Stars: ✭ 47 (+38.24%)
Mutual labels:  exploit, rce
Umbraco-RCE
Umbraco CMS 7.12.4 - (Authenticated) Remote Code Execution
Stars: ✭ 61 (+79.41%)
Mutual labels:  exploit, rce
exploit-CVE-2015-3306
ProFTPd 1.3.5 - (mod_copy) Remote Command Execution exploit and vulnerable container
Stars: ✭ 97 (+185.29%)
Mutual labels:  exploit, rce
Pwn jenkins
Notes about attacking Jenkins servers
Stars: ✭ 841 (+2373.53%)
Mutual labels:  exploit, rce
Commodity Injection Signatures
Commodity Injection Signatures, Malicious Inputs, XSS, HTTP Header Injection, XXE, RCE, Javascript, XSLT
Stars: ✭ 267 (+685.29%)
Mutual labels:  exploit, rce
Cve 2019 0708 Tool
A social experiment
Stars: ✭ 87 (+155.88%)
Mutual labels:  exploit, rce
PwnX.py
🏴‍☠️ Pwn misconfigured sites running ShareX custom image uploader API through chained exploit
Stars: ✭ 30 (-11.76%)
Mutual labels:  exploit, rce
CVE-2021-41773 CVE-2021-42013
Apache HTTP Server 2.4.49, 2.4.50 - Path Traversal & RCE
Stars: ✭ 20 (-41.18%)
Mutual labels:  exploit, rce
Jenkins Rce
😈 Jenkins RCE PoC. From unauthenticated user to remote code execution, it's a hacker's dream!
Stars: ✭ 262 (+670.59%)
Mutual labels:  exploit, rce
Exploit Cve 2017 7494
SambaCry exploit and vulnerable container (CVE-2017-7494)
Stars: ✭ 265 (+679.41%)
Mutual labels:  exploit, rce
Ciscoexploit
Cisco Exploit (CVE-2019-1821 Cisco Prime Infrastructure Remote Code Execution/CVE-2019-1653/Cisco SNMP RCE/Dump Cisco RV320 Password)
Stars: ✭ 73 (+114.71%)
Mutual labels:  exploit, rce
Penetration testing poc
渗透测试有关的POC、EXP、脚本、提权、小工具等---About penetration-testing python-script poc getshell csrf xss cms php-getshell domainmod-xss penetration-testing-poc csrf-webshell cobub-razor cve rce sql sql-poc poc-exp bypass oa-getshell cve-cms
Stars: ✭ 3,858 (+11247.06%)
Mutual labels:  rce, exploit
Vulmap
Vulmap 是一款 web 漏洞扫描和验证工具, 可对 webapps 进行漏洞扫描, 并且具备漏洞利用功能
Stars: ✭ 1,079 (+3073.53%)
Mutual labels:  exploit, rce
Gitlab rce
RCE for old gitlab version <= 11.4.7 & 12.4.0-12.8.1 and LFI for old gitlab versions 10.4 - 12.8.1
Stars: ✭ 104 (+205.88%)
Mutual labels:  exploit, rce
Cve 2018 18852
CERIO RCE CVE-2018-18852, authenticated (vendor defaults) web-based RCE as root user.
Stars: ✭ 42 (+23.53%)
Mutual labels:  exploit, rce
Exploit-Development
Exploit Development - Weaponized Exploit and Proof of Concepts (PoC)
Stars: ✭ 84 (+147.06%)
Mutual labels:  exploit, rce
Cve 2019 1003000 Jenkins Rce Poc
Jenkins RCE Proof-of-Concept: SECURITY-1266 / CVE-2019-1003000 (Script Security), CVE-2019-1003001 (Pipeline: Groovy), CVE-2019-1003002 (Pipeline: Declarative)
Stars: ✭ 270 (+694.12%)
Mutual labels:  exploit, rce
Sireprat
Remote Command Execution as SYSTEM on Windows IoT Core (releases available for Python2.7 & Python3)
Stars: ✭ 326 (+858.82%)
Mutual labels:  exploit, rce
Htshells
Self contained htaccess shells and attacks
Stars: ✭ 708 (+1982.35%)
Mutual labels:  exploit
K8cscan
K8Cscan大型内网渗透自定义插件化扫描神器,包含信息收集、网络资产、漏洞扫描、密码爆破、漏洞利用,程序采用多线程批量扫描大型内网多个IP段C段主机,目前插件包含: C段旁注扫描、子域名扫描、Ftp密码爆破、Mysql密码爆破、Oracle密码爆破、MSSQL密码爆破、Windows/Linux系统密码爆破、存活主机扫描、端口扫描、Web信息探测、操作系统版本探测、Cisco思科设备扫描等,支持调用任意外部程序或脚本,支持Cobalt Strike联动
Stars: ✭ 693 (+1938.24%)
Mutual labels:  exploit

Roundcube 1.0.0 <= 1.2.2 Remote Code Execution

Roundcube is a widely distributed open-source webmail software used by many organizations and companies around the globe. The mirror on SourceForge, for example, counts more than 260,000 downloads in the last 12 months which is only a small fraction of the actual users. Once Roundcube is installed on a server, it provides a web interface for authenticated users to send and receive emails with their web browser.

In Roundcube 1.2.2, and earlier, user-controlled input flows unsanitized into the fifth argument of a call to PHP's built-in function mail() which is documented as security critical. The problem is that the invocation of the mail() function will cause PHP to execute the sendmail program. The fifth argument allows to pass arguments to this execution which allows a configuration of sendmail. Since sendmail offers the -X option to log all mail traffic in a file, an attacker can abuse this option and spawn a malicious PHP file in the webroot directory of the attacked server. The following code lines trigger the vulnerability.

Requirements

The vulnerability has the following requirements for exploitation:

  • Roundcube must be configured to use PHP’s mail() function (by default, if no SMTP was specified [1])
  • PHP’s mail() function is configured to use sendmail (by default, see sendmail_path [2])
  • PHP is configured to have safe_mode turned off (by default, see safe_mode [3])
  • An attacker must know or guess the absolute path of the webroot

These requirements are not particular demanding which in turn means that there were a lot of vulnerable systems in the wild.

Vulnerable environment

To setup a vulnerable environment for your test you will need Docker installed, and just run the following command:

docker build -t vuln/cve-2016-9920 .
docker run --rm -it -p 80:80 vuln/cve-2016-9920

And it will spawn a vulnerable web application on your host on 80 port

Vulnerable code

In Roundcube 1.2.2 and earlier, user-controlled input flows unsanitized into the fifth argument of a call to PHP’s built-in function mail() which is documented as critical in terms of security. The problem is that the invocation of the mail() function will cause PHP to execute the sendmail program. The fifth argument allows passing additional parameters to this execution which allows a configuration of sendmail. Since sendmail offers the -X option to log all mail traffic in a file, an attacker can abuse this option and spawn a malicious PHP file in the webroot directory of the attacked server. Although this vulnerability is rare and not widely known, RIPS detected it within seconds. [4]

Exploit

To exploit this target just run:

./exploit.py --host HOST --user USERNAME --pwd PASSWORD --path PATH --www_path WEB_DIRECTORY

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

./exploit.py --host 127.0.0.1 --user username --pwd password --path roundcube --www_path "/var/www/html/roundcube"

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 --user username --pwd password --path roundcube --www_path "/var/www/html/roundcube"
[+] CVE-2016-9920 exploit by t0kx
[+] Exploiting 127.0.0.1
[+] Target exploited, acessing shell at http://127.0.0.1/roundcube/backdoor.php
[+] Running whoami: www-data
[+] Done

Credits

This flaw was found by Robin Peraglie [4]. The main text and the idea of this education stuff was created by opsxcq.

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.

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].