How to Remove the Server Header in IIS 8.5

Like all web servers, Microsoft’s Internet Information Server (IIS) sends its version number with every response:

Server: Microsoft-IIS/8.5

This information is in most cases no problem. However, hiding it may be a requirement because some security scanner mark it as a problem or your reports give you false positive results (like unsupported version while you have extended support). In this post, I explain you a different approach to the widely shared one with the registry key, then that key did not work for me and you may have the same problem.

If you want to remove this header for all sites on this server, open the IIS Manger and click on the top node in the server tree. If you just want to disable the server header for a single site, you can do the following steps starting with the home screen for that site.

Locate the IIS feature section and click on the icon for URL Rewrite:

click on the icon for URL Rewrite

You now have two sections, one for inbound rules and the other one for outbound rules. We want to modify the response; therefore, we need to add a rule in the outbound section. Right-click into the outbound section to open the context menu and select Add Rule(s)…

click on Add Rule(s)

Select Blank rule from the Outbound rules section:

Select Blank rule

The rule needs a few values, that you can copy from here and paste into the dialog:

Number Value
1 Remove Server Header
2 Server Variable (select from menu)
3 RESPONSE_SERVER
4 .*
5 Rewrite (select from menu)

Make sure that the Value in (6) is empty before you click on Apply (7):

Set the values in the rule dialog

You now have a rule that replaces everything inside the server header with an empty string:

Server: empty

That needs a few more steps than adding a registry key, but it works on my machines and I do not need to reboot the whole server.

2 thoughts on “How to Remove the Server Header in IIS 8.5”

  1. This solution does not work when intercept the request with burp and change the Method name in the request to something that is invalid name such as #@! which IIS server is sending as 400-Bad Request in the response, and in this response the Request does not reaches URL Rewrite hence the value is not overwritten.

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.