当前位置:网站首页>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,用大小写绕过


看看源码,多了两个匹配项目
先到这里,后期情况更新
边栏推荐
- Some suggestions for young people who are about to enter the workplace in the graduation season
- Industry analysis
- On April 17, 2022, the five heart matchmaker team received double good news
- 可昇級合約的原理-DelegateCall
- [visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl
- Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
- BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
- Data analysis - Matplotlib sample code
- 由粒子加速器产生的反中子形成的白洞
- PHP query distance according to longitude and latitude
猜你喜欢

YYGH-BUG-04

What is the relationship between digital transformation of manufacturing industry and lean production

Always report errors when connecting to MySQL database

Develop scalable contracts based on hardhat and openzeppelin (II)

基于Hardhat和Openzeppelin开发可升级合约(一)

多文件程序X32dbg动态调试

Webauthn - official development document

电脑无缘无故黑屏,无法调节亮度。

HOW TO ADD P-VALUES TO GGPLOT FACETS

Power Spectral Density Estimates Using FFT---MATLAB
随机推荐
动态内存(进阶四)
预言机链上链下调研
Tiktok overseas tiktok: finalizing the final data security agreement with Biden government
Astparser parsing class files with enum enumeration methods
Easyexcel and Lombok annotations and commonly used swagger annotations
Precautions for scalable contract solution based on openzeppelin
时间格式化显示
Develop scalable contracts based on hardhat and openzeppelin (I)
Is it safe to open a stock account through the QR code of the securities manager? Or is it safe to open an account in a securities company?
How to Visualize Missing Data in R using a Heatmap
What week is a date obtained by QT
liftOver进行基因组坐标转换
[visual studio 2019] create and import cmake project
Data analysis - Matplotlib sample code
PX4 Position_Control RC_Remoter引入
基于Hardhat和Openzeppelin开发可升级合约(二)
Principle of scalable contract delegatecall
Attribute acquisition method and operation notes of C # multidimensional array
The computer screen is black for no reason, and the brightness cannot be adjusted.
Flesh-dect (media 2021) -- a viewpoint of material decomposition