2019-03-29 Web安全扫描——去除Server版本号
2019-03-29 本文已影响0人
河的左岸
现象
![](https://img.haomeiwen.com/i3533840/a4e1b4350d62e08b.png)
安全软件扫描Web系统时,如果直接使用Nginx 往往会有很多选项不符合安全,认为是提供了版本号,给攻击提供了有利的信息:
- 使用绿盟会出现:“本插件检测远端HTTP Server信息。这可能使得攻击者了解远程系统类型以便进行下一步的攻击。”
- 使用VA会发现如下问题:
Service Banner Enumeration: We found that most of the services revealed their banners.
This could help a remote attacker to gain info about the version of software running on remote server and can launch an attack using known vulnerabilities in the specific version.
Remove Service banners wherever possible.
![](https://img.haomeiwen.com/i3533840/b1b0af87c716263e.png)
解决办法
- 首先,在编译Nginx时,需要添加一个Module:
tar -zxvf nginx-1.12.0.tar.gz
tar -zxvf headers-more-nginx-module-0.33.tar.gz
./configure --add-module=/home/YourRealPath/nginx/headers-more-nginx-module-0.33
make && make install
- 然后,在nginx.conf中可以添加如下配置(可以在server, http节点下配置)
more_clear_headers "Server";
![](https://img.haomeiwen.com/i3533840/dc8a8d873af122aa.png)
- 最后,在浏览器访问时验证下Response Header即可
附:headers-more-nginx-module包介绍
这个包不仅可以消除某些Header,还可以设置