![注释掉 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 指令是否安全?](https://linux22.com/image/626102/%E6%B3%A8%E9%87%8A%E6%8E%89%20ScriptAlias%20%2Fcgi-bin%2F%20%2Fusr%2Flib%2Fcgi-bin%2F%20%E6%8C%87%E4%BB%A4%E6%98%AF%E5%90%A6%E5%AE%89%E5%85%A8%EF%BC%9F.png)
我正在设置一个支持 php 的服务器。
在网上的几天里,我受到了以下典型攻击(但没有成功):
"201.212.25.79 - - [29/Jan/2014:06:17:03 +0000] "POST /cgi-bin/php5?%2D%64+%61%6C%6C%6F%77%5F%75%72%6C%5F%69%6E%63%6C%75%64%65%3D%6F%6E+%2D%64+%73%61%66%65%5F%6D%6F%64%65%3D%6F%66%66+%2D%64+%73%75%68%6F%73%69%6E%2E%73%69%6D%75%6C%61%74%69%6F%6E%3D%6F%6E+%2D%64+%64%69%73%61%62%6C%65%5F%66%75%6E%63%74%69%6F%6E%73%3D%22%22+%2D%64+%6F%70%65%6E%5F%62%61%73%65%64%69%72%3D%6E%6F%6E%65+%2D%64+%61%75%74%6F%5F%70%72%65%70%65%6E%64%5F%66%69%6C%65%3D%70%68%70%3A%2F%2F%69%6E%70%75%74+%2D%64+%63%67%69%2E%66%6F%72%63%65%5F%72%65%64%69%72%65%63%74%3D%30+%2D%64+%63%67%69%2E%72%65%64%69%72%65%63%74%5F%73%74%61%74%75%73%5F%65%6E%76%3D%30+%2D%6E HTTP/1.1" 500 834 "-" "Mozilla/5.0 (compatible; Zollard; Linux)""
我担心这些攻击迟早会成功。我从 apache 配置文件中注释掉以下指令后发现:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
服务器可以更加安全。
apache 配置文件的这部分有什么用途?
答案1
我相信你面临的是这种漏洞:http://www.exploit-db.com/exploits/29290/
唯一/更好的解决方案是更新您的 PHP!
使用#CVE-2012-1823 修补的 PHP 二进制文件不受此次黑客攻击的影响。