当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2015-0100441

漏洞标题:精讯cms sql注入(直接提升为管理员)

相关厂商:jxcms.com

漏洞作者: 牛肉包子

提交时间:2015-03-10 16:11

修复时间:2015-06-08 16:40

公开时间:2015-06-08 16:40

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-03-10: 细节已通知厂商并且等待厂商处理中
2015-03-10: 厂商已经确认,细节仅向厂商公开
2015-03-13: 细节向第三方安全合作伙伴开放
2015-05-04: 细节向核心白帽子及相关领域专家公开
2015-05-14: 细节向普通白帽子公开
2015-05-24: 细节向实习白帽子公开
2015-06-08: 细节向公众公开

简要描述:

用户量挺大的一个cms

详细说明:

看到Lib\Action\MemberAction.class.php

public function profile() {
$this -> obj -> isLogin() or $this -> showMsg(L('LOGIN_FIRST'), Url :: getUrl('member', 'login'));
if ($this -> isSubmit) {
if ($this -> obj -> edit()) {
$this -> showMsg(L('OPERATE_SUCCESS'), $this -> referer);
} else $this -> showMsg($this -> obj -> error);
}
$member = $this -> obj -> find(get_cookie('userid'));
$tmp = explode('-', $member['birthday']);
$birthday = array('year' => intval($tmp[0]), 'month' => intval($tmp[1]), 'day' => intval($tmp[2]));
$birthday['timestamp'] = $member['birthday'] != '0000-00-00' ? Func :: timeStamp($member['birthday']) : '';
$this -> assign('birthday', $birthday);
$this -> assign('member', $member);
$this -> assign('title', L('USER_PROFILE'));
$this -> display('member_profile');
}


然后跟进edit

public function edit() {
$info = R('info', 'post');
$info['userid'] = intval($info['userid']);
if (!$info['userid']) {
$this -> error = $this -> L['NOPARAM'];
return false;
}
$data = $this -> find($info['userid']);
if (empty($data)) {
$this -> error = $this -> L['USER_IS_NOT_EXIST'];
return false;
}
$info['userid'] == get_cookie('userid') or show_error($this -> L['NO_PERMISSION']);
$info['birthday'] = R('birthyear') . '-' . R('birthmonth') . '-' . R('birthday');
return $this -> create($info) -> update();
}


意思就是将POST进来的info数组插入数据库,但是没判断字段名,导致我们可以自己添加,然后提升到管理员权限。
首先注册一个普通用户

14.png


在数据库里面可以看到管理员和普通会员在一个表里面,就只有一个groupid字段来判断权限
然后进入修改个人资料页面

17.png


然后登陆后台

18.png


成功登陆

19.png


搜索案例

20.png


然后再提供5个互联网实际案例,以下网址账号为wooyun,密码为wooyun123
http://test.tzks.cn/admin.php?a=defaults

21.png


http://qiushibang.com/admin.php?a=defaults

22.png


http://www.gsdedu.com/admin.php?a=defaults

23.png


http://www.cnekw.com/saes/admin.php?a=defaults

24.png


http://www.jiuyehangbiao.com/admin.php?a=defaults

25.png


漏洞证明:

http://test.tzks.cn/admin.php?a=defaults

21.png


http://qiushibang.com/admin.php?a=defaults

22.png


http://www.gsdedu.com/admin.php?a=defaults

23.png


http://www.cnekw.com/saes/admin.php?a=defaults

24.png


http://www.jiuyehangbiao.com/admin.php?a=defaults

25.png


修复方案:

判断一下吧

版权声明:转载请注明来源 牛肉包子@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:6

确认时间:2015-03-10 16:39

厂商回复:

数组方式简单,容易扩展,缺陷是可以另外添加字段,我们会增加安全字段的过滤,感觉发现BUG的作者!

最新状态:

暂无