缓解措施
为了防御这种***,您要调整的NGINX和FastCGI的一些标准配置。下面的设置是默认值,但是它们不是最佳的,应该根据自己的情况进行调整。我通常将超时设置为1-2秒。
FCGID.CONF
/etc/httpd/conf.d/fcgid.conf
123456# Number of seconds of idle time before a process is terminatedFcgidIOTimeout 1000 # maximum period of time the module will wait while trying to read from or write to a FastCGI applicationFcgidMaxProcessesPerClass 100 #maximum number of processes per class (user)FcgidIdleTimeout 240 # application processes which have not handled a request for this period of time will be terminatedFcgidProcessLifeTime 3600 # maximum lifetime of a single process (seconds)FcgidMaxProcesses 1000 #maximum number of FastCGI application processes which can be active at one time. Apache – Httpd.Conf
/etc/httpd/conf/httpd.conf
123456789Timeout 60KeepAliveTimeout 15KeepAlive OffMaxKeepAliveRequests 100StartServers 8MinSpareServers 5MaxSpareServers 20ServerLimit 256MaxClients 256 Php-Fpm.Conf
/etc/php-fpm.conf
12345; Time limit for child processes to wait for a reaction on signals from master.; Available units: s(econds), m(inutes), h(ours), or d(ays); Default Unit: seconds; Default Value: 0process_control_timeout = 10s /etc/php-fpm.d/domain.conf
1234; By default use ondemand spawning (this requires php-fpm >= 5.3.9)pm = ondemandpm.max_children = 50pm.process_idle_timeout = 60s PoC下载地址:https://github.com/nightlionsecurity/phpstress
本文由 安全客 翻译,作者:shan66
原文链接:https://n0where.net/phpstress/