当前位置:网站首页>【XSS绕过-防护策略】理解防护策略,更好的绕过
【XSS绕过-防护策略】理解防护策略,更好的绕过
2022-07-03 04:33:00 【黑色地带(崛起)】
目录
一、简述
现在Web应用层有很多策略去处理XSS危害
eg:
特定标签过滤、事件过滤、敏感关键字过滤……
浏览器也会对XSS漏洞的利用进行限制(XSS Auditor、CSP等)
二、特定标签过滤
2.1、缺点:
过滤掉危险标签(如script、iframe等)就会导致无法执行脚本
2.2、现状:
任何一种标签,无论是否合法,都可以构造出XSS代码
<标签 οnclick="alert(/xss/)">快点我呀</标签>
2.3、利用:
属性值:输出点在HTML标签的属性中或在Javascript代码中,简单地闭合、拼接属性或Javascript代码就可以执行XSS代码
HTML:<video><source οnerrοr="alert(/xss/)">
三、事件过滤
3.1、简介:
一般会过滤掉许多HTML标签的事件属性,需要对所有可利用的事件属性进行遍历,测试是否存在遗漏(测试:Burp或编写脚本进行Fuzz)
3.2、常用的事件属性:
onafterprint、oninput、onscroll、onbeforeprint 、oninvalid 、onabort、onbeforeunload 、onreset 、oncanplay、onerror、 onselect 、oncanplaythrough、onhaschange、 onsubmit、 ondurationchange、onload 、onkeydown 、onemptied、onmessage 、onkeypress、 onended、onoffline、 onkeyup、 onerror、ononline 、onclick、 onloadeddata、onpagehide、 ondblclick、 onloadedmetadata、onpageshow 、ondrag、 onloadstart、onpopstate、 ondragend、 onpause、onredo、 ondragenter、 onplay、onresize 、ondragleave 、onplaying、onstorage 、ondragover 、onprogress、onundo、 ondragstart 、onratechange、onunload、 ondrop、 onreadystatechange、onblur 、onmousedown、 onseeked、onchange 、onmousemove 、onseeking、oncontextmenu 、onmouseout、 onstalled、onfocus、 onmouseover 、onsuspend、onformchange 、onmouseup 、ontimeupdate、onforminput、onmousewheel、 onvolumechange
3.3、非事件属性的标签
作用:可用于执行JavaScript代码
eg:JavaScript伪协议
<a href="javascript:alert(/xss/)">快点我呀</a>
四、敏感关键字(字符)过滤
(1)过滤“.”
(2)过滤“()”
(3)过滤空格
……
五、XSS Auditor
5.1、概述:
负责扫描网站的源代码,寻找类似跨站点脚本(XSS)攻击的模式,这种攻击可能试图在用户的浏览器中运行恶意代码 。通过检查输入的内容,判断该内容是否在输出中出现。如果符合XSS Auditor的过滤条件,则会直接阻止脚本执行。使反射型XSS漏洞的作用被逐步弱化。
六、内容安全策略(CSP)
6.1、概述:
内容安全策略(CSP)是目前最主要的Web安全保护机制之一,内容安全策略 (CSP) 是一个额外的安全层,用于检测并削弱某些特定类型的攻击,包括跨站脚本 (XSS) 和数据注入攻击等。
为了缓解潜在的跨站脚本问题,浏览器的扩展程序系统引入了内容安全策略(CSP),会使扩展程序在默认情况下更加安全,开发者可以创建并强制应用一些规则,管理网站允许加载的内容。开发人员可以使用这种工具以各种方式锁定其应用程序,降低内容注入漏洞(如跨站点脚本)的风险,并降低其应用程序执行的权限
内容安全策略以白名单的机制来管理网站要加载或执行的资源。在网页中,这样的策略是通过HTTP头信息或者meta标签来定义的。
虽然这个策略可以防止攻击者从外部网站跨域加载恶意代码,但是CSP并不能防止数据泄露。目前已经有很多安全研究人员提出了各种各样的技术来绕过内容安全策略,并利用该技术从目标网站中提取出所需数据。
七、推荐
【XSS跨站合集】反射型、存储型、DOM类XSS原理;输出在HTML、CSS、Javascript代码中
https://blog.csdn.net/qq_53079406/article/details/123694180?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165672818516782248534754%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165672818516782248534754&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-4-123694180-null-null.185^v2^control&utm_term=xss&spm=1018.2226.3001.4450【xss工具绕过】xss之burpsuite、前端、字典……
https://blog.csdn.net/qq_53079406/article/details/123901334?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165672818516782248534754%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165672818516782248534754&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-123901334-null-null.185^v2^control&utm_term=xss&spm=1018.2226.3001.4450
边栏推荐
- 2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
- [Thesis Writing] how to write the overall design of JSP tourism network
- X-ray normal based contour rendering
- How to choose cross-border e-commerce multi merchant system
- Jincang KFS data bidirectional synchronization scenario deployment
- 2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
- Mount NFS in kubesphere
- 多板块轮动策略编写技巧----策略编写学习教材
- [pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius
- Crazy scientist
猜你喜欢

Asp access teaching management system design finished product

Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found

一名外包仔的2022年中总结
![[free completion] development of course guidance platform (source code +lunwen)](/img/14/7c1c822bda050a805fa7fc25b802a4.jpg)
[free completion] development of course guidance platform (source code +lunwen)

7. Integrated learning

消息队列(MQ)介绍

Design and implementation of JSP logistics center storage information management system

Number of uniform strings of leetcode simple problem
![[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries](/img/56/386f0fd6553b8b9711e14c54705ae3.jpg)
[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries

使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
随机推荐
vulnhub HA: Natraj
多板块轮动策略编写技巧----策略编写学习教材
Busycal latest Chinese version
Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found
[文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
The simple problem of leetcode: dismantling bombs
Golang -- realize file transfer
[pat (basic level) practice] - [simple simulation] 1063 calculate the spectral radius
Leetcode simple question: check whether two string arrays are equal
Preliminary cognition of C language pointer
IPhone x forgot the boot password
Function introduction of member points mall system
金仓数据库KingbaseES 插件kdb_exists_expand
Classes in TS
Learning practice: comprehensive application of cycle and branch structure (I)
Matplotlib -- save graph
Integration of Android high-frequency interview questions (including reference answers)
Number of uniform strings of leetcode simple problem
Priv-app permission异常
2022 P cylinder filling test content and P cylinder filling simulation test questions