所以我现在一直在用telnet来玩telnet(即只需输入“telnet google.com 80”并输入随机GET和带有不同 Headers 的POST等)但是我遇到了谷歌的东西 . com传输我不知道的 Headers .
我一直在浏览http://www.w3.org/Protocols/rfc2616/rfc2616.html,并且没有找到谷歌似乎正在喷出的特定http-header的定义:
GET / HTTP/1.1
HTTP/1.1 200 OK
Date: Wed, 01 Feb 2012 03:42:24 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=6ddbc0a0342e7e63:FF=0:TM=1328067744:LM=1328067744:S=4d4farvCGl5Ww0C3; expires=Fri, 31-Jan-2014 03:42:24 GMT; path=/; domain=.google.com
Set-Cookie: NID=56=PgRwCKa8EltKnHS5clbFuhwyWsd3cPXiV1-iXzgyKsiy5RKXEKbg89gWWpjzYZjLPWTKrCWhOUhdInOlYU56LOb2W7XpC7uBnKAjMbxQSBw1UIprzw2BFK5dnaY7PRji; expires=Thu, 02-Aug-2012 03:42:24 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
1000
有谁知道“X-XSS-Protection”是什么?
4 回答
X-XSS-Protection是Internet Explorer 8(以及更新版本)可以理解的HTTP标头 . 此标头允许域打开和关闭IE8的“XSS过滤器”,这可以防止某些类别的XSS攻击 . IE8默认情况下已激活过滤器,但服务器可以通过设置关闭
另见http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx
X-XSS-Protection: 1
:强制XSS保护(如果用户禁用了XSS保护,则非常有用)X-XSS-Protection: 0
:禁用XSS保护如果检测到潜在的XSS反射(=非持久性)攻击,则令牌
mode=block
将阻止浏览器(IE8和Webkit浏览器)呈现页面(而不是清理) ./!\ Warning,
mode=block
在IE8中创建了一个漏洞(more info) .更多信息:http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx和http://blog.veracode.com/2014/03/guidelines-for-setting-security-headers/
此响应标头可用于配置用户代理's built in reflective XSS protection. Currently, only Microsoft'的Internet Explorer,Google Chrome和Safari(WebKit)支持此标头 .
Internet Explorer 8包含一项新功能,可帮助防止反映的跨站点脚本攻击,称为 XSS Filter . 此筛选器默认在Internet,受信任和受限制的安全区域中运行 . 本地Intranet区域页面可以使用相同的标头选择加入保护 .
关于您在问题中发布的 Headers ,
标头
X-XSS-Protection: 1; mode=block
启用XSS过滤器 . 检测到XSS攻击时,浏览器将阻止呈现页面,而不是清理页面 .How this filter works in IE ,
更多关于这篇文章,https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-iv-the-xss-filter/
资料来源:https://msdn.microsoft.com/en-us/library/dd565647(v=vs.85).aspx
Web开发人员可能希望禁用其内容的过滤器 . 他们可以通过设置HTTP标头来实现:
有关安全标头的更多信息,
Guidelines for Setting Security Headers
Security HTTP Headers - X-XSS-PROTECTION
MDN Docs X-XSS-Protection
你可以在这个List of useful HTTP headers中看到 .