### 简要描述:
Sql Injection
### 详细说明:
注入在XDCMS企业管理系统后台的板块编辑处,\system\modules\xdcms\language.php文件:
管理员在编辑板块的时候会调用editsave()函数,七注入点就出现在该函数里:
```
public function editsave(){
$id=isset($_POST['id'])?intval($_POST['id']):0;
$title=safe_html($_POST['title']);//title中safe_html的规则可被大写字母绕过
$sitename=safe_html($_POST['sitename']);//同上
$dir=safe_html($_POST['dir']);//同上
$seo_title=safe_html($_POST['seo_title']);//同上
$seo_key=safe_html($_POST['seo_key']);//同上
$seo_des=safe_html($_POST['seo_des']);//同上
$copyright=$_POST['copyright'];//同上
if(empty($title)||empty($id)){
showmsg(C('material_not_complete'),'-1');
}
$this->mysql->db_update('language',"`title`='".$title."',`sitename`='".$sitename."',`dir`='".$dir."',`seo_title`='".$seo_title."',`seo_key`='".$seo_key."',`seo_des`='".$seo_des."',`copyright`='".$copyright."'",'`id`='.$id);
$this->language_cache();
showmsg(C('update_success'),'index.php?m=xdcms&c=language');
}
```
### 漏洞证明:
1.以title为例,点击编辑:
[<img src="https://images.seebug.org/upload/201402/1813232063b84188c05997c7f243b6abb8db888d.jpg" alt="xbb.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201402/1813232063b84188c05997c7f243b6abb8db888d.jpg)
2.发布后抓包添加exp:
[<img src="https://images.seebug.org/upload/201402/1813235079c08e1f660d3f3d34074c18f8790166.jpg" alt="xbb1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201402/1813235079c08e1f660d3f3d34074c18f8790166.jpg)
3.成功:
[<img src="https://images.seebug.org/upload/201402/181324140dfcf087b0f61f1f212f2cdf18392634.jpg" alt="xbb3.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201402/181324140dfcf087b0f61f1f212f2cdf18392634.jpg)
暂无评论