2016-11-24 25 views

回答

3

「X-Powered-By:」實際上是從IIS根配置繼承而來的。刪除「X-Powered-By」標頭的腳本假設您安裝了Powershell和Web服務器(IIS)管理Cmdlet,並找出正確的咒語。

Import-Module WebAdministration; 
Clear-WebConfiguration "/system.webServer/httpProtocol/customHeaders/add[@name='X-Powered-By']" 

對於進一步的幫助,您可以參考https://www.troyhunt.com/shhh-dont-let-your-response-headers/

+0

Radadip,你的建議是專門針對X供電,通過在OP提到?我已經做了「Remove-WebConfigurationProperty -PSPath MACHINE/WEBROOT/APPHOST -Filter system.webServer/httpProtocol/customHeaders -Name。-AtElement @ {name ='X-Powered-By'}」 - 你的命令是否會影響diff標題? – Jonesome

+0

•\t服務器:網站運行的網絡服務器軟件。典型的例子包括「Microsoft-IIS/7.5」,「nginx/1.0.11」和「Apache」。 •\t X-Powered-By:由網站運行的應用程序框架集合(可以有多個)。典型的例子包括:「ASP.NET」,「PHP/5.2.17」和「UrlRewriter.NET 2.0.0」。 •\t X-AspNet-Version:很明顯只有ASP.NET的頭文件,典型的例子包括「2.0.50727」,「4.0.30319」和「1.1.4322」。 •\t X-AspNetMvc-Version:同樣,你只能在ASP.NET堆棧中看到這個,典型的例子包括「3.0」,「2.0」和「1.0」。 –

+0

我正在談論上面提到的項目符號標題。 –