赞
踩
IIS环境检测到网站存在响应头缺失漏洞解决办法:
1.webconfig中添加响应头
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <directoryBrowse enabled="false" /> <httpProtocol> <customHeaders> <add name="X-Content-Type-Options" value="nosniff" /> <add name="X-XSS-Protection" value="1" /> <add name="Content-Security-Policy" value="default-src 'self'" /> <add name="Strict-Transport-Security" value="max-age=31536000" /> <add name="Referrer-Policy" value="origin-when-cross-origin" /> <add name="X-Permitted-Cross-Domain-Policies" value="master-only" /> <add name="X-Download-Options" value="noopen" /> <add name="X-Frame-Options" value="deny" /> </customHeaders> </httpProtocol> </system.webServer> </configuration>
2.IIS中手动增加响应头:
设置完后IIS HTTP响应头设置界面显示如下:
修改web服务器配置,添加X-frame-options响应头。赋值有如下三种:
(1)DENY:不能被嵌入到任何iframe或frame中。
(2)SAMEORIGIN:页面只能被本站页面嵌入到iframe或者frame中。
(3)ALLOW-FROM uri:只能被嵌入到指定域名的框架中。也可在代码中加入,在PHP中加入:header(‘X-Frame-Options: deny’);
根据实际情况酌情进行添加!!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。