Remove version and software information from HTTP headers
Removing version and software information from the HTTP response header is a security configuration that obscures information about your system, making it more difficult for malicious actors to identify and exploit potential vulnerabilities.
To remove "X-Powered-By" from HTTP headers:
- Open a command prompt.
- Run the following command:
appcmd.exe clear config /section:httpProtocol -customHeaders.[name='X-Powered-By']
- Perform IIS reset.
To remove "Server" from HTTP headers:
- Open a command prompt.
- Run the following command:
appcmd.exe set config /section:system.webServer/security/requestfiltering /removeServerHeader:true
- Perform IIS reset.
To disable ASP versions from HTTP headers:
- Open the Internet Information Services (IIS) Manager.
- On the Connections panel, select the server name.
- In the middle server home panel, under Management, select Configuration Editor.
- In the Section drop-down list, select system.web/httpRuntime.
- Select the enableVersionHeader attribute and set it to False.
- In the top right Actions panel, click Apply.
To hide Asp.NET MVC version from HTTP headers:
- Open the Internet Information Services (IIS) Manager and open URL Rewrite.
If you don't have URL Rewrite in the IIS manager, you can download it from the official Microsoft IIS website.
- Under Actions, click on View Server Variables.
- Add a server variable named RESPONSE_X-AspNetMvc-Version and click OK.
- Back to Actions, click on Add Rule(s).
- Under Outbound rules, select a Blank rule template and click OK.
- Set the outbound rule as follows:
Parameter Value Name: removeAspNetMvcVersionHeader Precondition: None. Matching scope: Server Variable Variable name: RESPONSE_X-AspNetMvc-Version Variable value: Matches the Pattern Using: Regular Expressions Pattern: .* Ignore case (checkbox) Selected. Action type: Rewrite Replace existing server variable value (checkbox) Selected. Stop processing of subsequent rules (checkbox) Unselected. - Click Apply.
Parent topic: Installation overview