在WEB服务中HTTP响应时会带上一些信息,其中包括IIS的版本信息,这存在这一定的安全隐患。本文主要介绍如何通过IIS的Rewrite组件来隐藏IIS的版本信息。
[root@VM-16-5-centos ~]# curl -I -X GET http://seo.cloudduo.cn
HTTP/1.1 403 Forbidden
Content-Type: text/html
Server: Microsoft-IIS/10.0 --显示web版本信息
Date: Sun, 23 May 2021 09:56:49 GMT
Content-Length: 1157
下载安装url rewrite组件。
https://www.iis.net/downloads/microsoft/url-rewrite
选择简体中文64位的下载即可。
然后直接右键点安装,
1、请您确认IIS的版本是否是IIS 7及以上版本并安装IIS Rewrite组件。
2、请您在对应站点下创建web.config文件,并将以下内容加入对应的<system.webServer>节中。
<system.webServer> <rewrite> <outboundRules> <rule name="REMOVE_RESPONSE_SERVER"> <match serverVariable="RESPONSE_SERVER" pattern=".*" /> <action type="Rewrite" /> </rule> </outboundRules> </rewrite> </system.webServer>
扫码赞赏,鼓励支持