当前位置:网站首页>安全面试之XSS(跨站脚本攻击)
安全面试之XSS(跨站脚本攻击)
2022-07-06 09:23:00 【不知名白帽】
1、XSS原理:开发人员没有做好过滤,导致我们可以闭合标签进而插入并执行恶意JS代码
2、xss类型分类
DOM型:由DOM文档完成解析
反射型:即插即用,没有存储在数据库里面
存储型:被存储在数据库里面,造成持久型的攻击
3、常用的JS函数
document.cookie():弹出当前网址的浏览器cookie
console.log('xss'):在控制台输出日志
4、绕过方式
4.1.改变大小写:<SCript>
4.2.编码绕过(html实体编码、十进制十六进制八进制编码、unicode编码)、
4.3.关闭标签:利用大于号>关闭标签使得xss生效
4.4.双写饶过:<scr<script>ipt>
4.5.可以使用空格.换行,tab键或者/**/,/*!a*/,的形式绕过关键词的检测
4.6.用/代替空格
4.7.用反引号代替括号、双引号
4.8.用throw代替括号
4.9.用html实体编码:代替冒号
4.10.用jsfuck编码绕过大部分字符过滤
5、扫描工具
xsstrick
6、XSS钓鱼平台
kali工具:BEEF
免费平台:https://xss.pt/
钓鱼语句:<img src=https://xss.pt/hook.js>
7、xss防御
7.1、过滤敏感字符,例如:aler()、<script>、onerror
7.2、增加httponly:禁止前端执行JS代码
边栏推荐
- HackMyvm靶机系列(7)-Tron
- 外网打点(信息收集)
- xray與burp聯動 挖掘
- HackMyvm靶机系列(5)-warez
- 【VMware异常问题】问题分析&解决办法
- 7-1 output all primes between 2 and n (PTA programming)
- Implementation principle of automatic capacity expansion mechanism of ArrayList
- How to turn wechat applet into uniapp
- Package bedding of components
- 记一次猫舍由外到内的渗透撞库操作提取-flag
猜你喜欢
Applet Web Capture -fiddler
内网渗透之内网信息收集(五)
It's never too late to start. The tramp transformation programmer has an annual salary of more than 700000 yuan
canvas基础2 - arc - 画弧线
HackMyvm靶机系列(3)-visions
Meituan dynamic thread pool practice ideas, open source
7-5 走楼梯升级版(PTA程序设计)
Wei Shen of Peking University revealed the current situation: his class is not very good, and there are only 5 or 6 middle-term students left after leaving class
SRC mining ideas and methods
[VMware abnormal problems] problem analysis & Solutions
随机推荐
7-11 mechanic mustadio (PTA program design)
Using spacedesk to realize any device in the LAN as a computer expansion screen
【MySQL-表结构与完整性约束的修改(ALTER)】
[experiment index of educator database]
Strengthen basic learning records
Difference and understanding between detected and non detected anomalies
7-1 输出2到n之间的全部素数(PTA程序设计)
Detailed explanation of network foundation routing
Force deduction 152 question multiplier maximum subarray
7-3 construction hash table (PTA program design)
SQL注入
canvas基础2 - arc - 画弧线
Strengthen basic learning records
Brief introduction to XHR - basic use of XHR
Strengthen basic learning records
Hackmyvm target series (3) -visions
The difference between cookies and sessions
7-14 错误票据(PTA程序设计)
Attach the simplified sample database to the SQLSERVER database instance
7-11 机工士姆斯塔迪奥(PTA程序设计)