原文:http://zone.wooyun.org/content/1060
作者:GaRy
原文就不拷贝了,就是服务器如果有跑php fastcgi的,9000端口暴露在了外网,用nmap扫描下,显示tcpwrapped,说明可以被远程调用:
[root@KS-81 ~]# nmap -sV -p 9000 122.*.*.*
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2012-09-24 09:14 CST
Interesting ports on 122.*.*.*PORT STATE SERVICE VERSION
9000/tcp open tcpwrappedNmap finished: 1 IP address (1 host up) scanned in 0.522 seconds
然后GaRY就写了一个小程序,去调用它:
[root@test:~/work/fcgi]#./fcgi_exp read 122.*.*.* 9000 /etc/issue
X-Powered-By: PHP/5.3.2-1ubuntu4.9
Content-type: text/html
Ubuntu 10.04.3 LTS \n \l
下面GaRY给我们展示了各种入侵手段,这里也就不多复述了,可以到原文去围观下!同时GaRY也给我们说了,如何防护:
如何防止这个漏洞?很简单,千万不要把fcgi接口对公网暴露。同时也希望将来fcgi会有身份认证机制。
那就很简单了,把iptables规则改下,禁止9000端口暴露在外网。我一直以来认为,web服务器的iptables规则——只允许ssh和http端口通过,其他一切端口禁止!
下面是开启了iptables规则后,显示9000端口被禁止了。
[root@KS-81 ~]# nmap -sV -p 9000 122.*.*.*
Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2012-09-24 09:14 CST
Interesting ports on 122.*.*.*:
PORT STATE SERVICE VERSION
9000/tcp filtered unknownNmap finished: 1 IP address (1 host up) scanned in 0.522 seconds
原创文章,转载请注明: 转载自三叶草
特别声明:商业网站转载需经作者同意,否则视为侵权!
发表评论