iis

IIS 8.5 隐藏 X-Powered-By 及 X-Powered-By 信息

Posted by Sunday on 2018-09-14

Before

1
2
3
4
5
6
7
8
9
10
curl -I net.sundayle.com
HTTP/1.1 200 OK
Content-Length: 206
Content-Type: text/html
Last-Modified: Tue, 26 Dec 2017 07:15:34 GMT
Accept-Ranges: bytes
ETag: "b3754052197ed31:0"
Server: Microsoft-IIS/8.5
X-Powered-By: ASP.NET
Date: Fri, 14 Sep 2018 06:08:04 GMT

隐藏 SERVER HEADER

安装URL重写模块 https://www.iis.net/downloads/microsoft/url-rewrite
注:请在主页操作,网站的站点会继承的全局设置。如在网站的站点设置过,则不会继承。

主页 - URL重写 - 新建空白规则 - 名称: Remove Server Info - 匹配范围: 服务器变量 - 变量名称:RESPONSE_Server - 模式: .+ - 操作属性 值:APACHE-SERVER - 其他默认
11
11
11
11

隐藏 X-Powered-By

主页 - HTTP响应标头 - 修改 X-Powered-By 值
11
11

After

1
2
3
4
5
6
7
8
9
10
curl -I net.sundayle.com
HTTP/1.1 200 OK
Content-Length: 206
Content-Type: text/html
Last-Modified: Tue, 26 Dec 2017 07:15:34 GMT
Accept-Ranges: bytes
ETag: "b3754052197ed31:0"
Server: APACHE-SERVER
X-Powered-By: APACHE-SERVER
Date: Fri, 14 Sep 2018 06:08:04 GMT