├── .gitattributes
├── Database
├── polyglot.png
├── jackmasa-mind-map.png
└── event-handlers.md
├── LICENSE
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | * linguist-language=javascript
2 |
--------------------------------------------------------------------------------
/Database/polyglot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s0md3v/AwesomeXSS/HEAD/Database/polyglot.png
--------------------------------------------------------------------------------
/Database/jackmasa-mind-map.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s0md3v/AwesomeXSS/HEAD/Database/jackmasa-mind-map.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Somdev Sangwan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Database/event-handlers.md:
--------------------------------------------------------------------------------
1 | # 105 JavaScript Event Handlers
2 |
3 | This list is taken from [OWASP XSS Filter Evasion Cheat Sheet](https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet)
4 |
5 | FSCommand (attacker can use this when executed from within an embedded Flash object)
6 | onAbort (when user aborts the loading of an image)
7 | onActivate (when object is set as the active element)
8 | onAfterPrint (activates after user prints or previews print job)
9 | onAfterUpdate (activates on data object after updating data in the source object)
10 | onBeforeActivate (fires before the object is set as the active element)
11 | onBeforeCopy (attacker executes the attack string right before a selection is copied to the clipboard - attackers can do this with the execCommand("Copy") function)
12 | onBeforeCut (attacker executes the attack string right before a selection is cut)
13 | onBeforeDeactivate (fires right after the activeElement is changed from the current object)
14 | onBeforeEditFocus (Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected)
15 | onBeforePaste (user needs to be tricked into pasting or be forced into it using the execCommand("Paste") function)
16 | onBeforePrint (user would need to be tricked into printing or attacker could use the print or execCommand("Print") function).
17 | onBeforeUnload (user would need to be tricked into closing the browser - attacker cannot unload windows unless it was spawned from the parent)
18 | onBeforeUpdate (activates on data object before updating data in the source object)
19 | onBegin (the onbegin event fires immediately when the element's timeline begins)
20 | onBlur (in the case where another popup is loaded and window looses focus)
21 | onBounce (fires when the behavior property of the marquee object is set to "alternate" and the contents of the marquee reach one side of the window)
22 | onCellChange (fires when data changes in the data provider)
23 | onChange (select, text, or TEXTAREA field loses focus and its value has been modified)
24 | onClick (someone clicks on a form)
25 | onContextMenu (user would need to right click on attack area)
26 | onControlSelect (fires when the user is about to make a control selection of the object)
27 | onCopy (user needs to copy something or it can be exploited using the execCommand("Copy") command)
28 | onCut (user needs to copy something or it can be exploited using the execCommand("Cut") command)
29 | onDataAvailable (user would need to change data in an element, or attacker could perform the same function)
30 | onDataSetChanged (fires when the data set exposed by a data source object changes)
31 | onDataSetComplete (fires to indicate that all data is available from the data source object)
32 | onDblClick (user double-clicks a form element or a link)
33 | onDeactivate (fires when the activeElement is changed from the current object to another object in the parent document)
34 | onDrag (requires that the user drags an object)
35 | onDragEnd (requires that the user drags an object)
36 | onDragLeave (requires that the user drags an object off a valid location)
37 | onDragEnter (requires that the user drags an object into a valid location)
38 | onDragOver (requires that the user drags an object into a valid location)
39 | onDragDrop (user drops an object (e.g. file) onto the browser window)
40 | onDragStart (occurs when user starts drag operation)
41 | onDrop (user drops an object (e.g. file) onto the browser window)
42 | onEnd (the onEnd event fires when the timeline ends.
43 | onError (loading of a document or image causes an error)
44 | onErrorUpdate (fires on a databound object when an error occurs while updating the associated data in the data source object)
45 | onFilterChange (fires when a visual filter completes state change)
46 | onFinish (attacker can create the exploit when marquee is finished looping)
47 | onFocus (attacker executes the attack string when the window gets focus)
48 | onFocusIn (attacker executes the attack string when window gets focus)
49 | onFocusOut (attacker executes the attack string when window looses focus)
50 | onHashChange (fires when the fragment identifier part of the document's current address changed)
51 | onHelp (attacker executes the attack string when users hits F1 while the window is in focus)
52 | onInput (the text content of an element is changed through the user interface)
53 | onKeyDown (user depresses a key)
54 | onKeyPress (user presses or holds down a key)
55 | onKeyUp (user releases a key)
56 | onLayoutComplete (user would have to print or print preview)
57 | onLoad (attacker executes the attack string after the window loads)
58 | onLoseCapture (can be exploited by the releaseCapture method)
59 | onMediaComplete (When a streaming media file is used, this event could fire before the file starts playing)
60 | onMediaError (User opens a page in the browser that contains a media file, and the event fires when there is a problem)
61 | onMessage (fire when the document received a message)
62 | onMouseDown (the attacker would need to get the user to click on an image)
63 | onMouseEnter (cursor moves over an object or area)
64 | onMouseLeave (the attacker would need to get the user to mouse over an image or table and then off again)
65 | onMouseMove (the attacker would need to get the user to mouse over an image or table)
66 | onMouseOut (the attacker would need to get the user to mouse over an image or table and then off again)
67 | onMouseOver (cursor moves over an object or area)
68 | onMouseUp (the attacker would need to get the user to click on an image)
69 | onMouseWheel (the attacker would need to get the user to use their mouse wheel)
70 | onMove (user or attacker would move the page)
71 | onMoveEnd (user or attacker would move the page)
72 | onMoveStart (user or attacker would move the page)
73 | onOffline (occurs if the browser is working in online mode and it starts to work offline)
74 | onOnline (occurs if the browser is working in offline mode and it starts to work online)
75 | onOutOfSync (interrupt the element's ability to play its media as defined by the timeline)
76 | onPaste (user would need to paste or attacker could use the execCommand("Paste") function)
77 | onPause (the onpause event fires on every element that is active when the timeline pauses, including the body element)
78 | onPopState (fires when user navigated the session history)
79 | onProgress (attacker would use this as a flash movie was loading)
80 | onPropertyChange (user or attacker would need to change an element property)
81 | onReadyStateChange (user or attacker would need to change an element property)
82 | onRedo (user went forward in undo transaction history)
83 | onRepeat (the event fires once for each repetition of the timeline, excluding the first full cycle)
84 | onReset (user or attacker resets a form)
85 | onResize (user would resize the window; attacker could auto initialize with something like: )
86 | onResizeEnd (user would resize the window; attacker could auto initialize with something like: )
87 | onResizeStart (user would resize the window; attacker could auto initialize with something like: )
88 | onResume (the onresume event fires on every element that becomes active when the timeline resumes, including the body element)
89 | onReverse (if the element has a repeatCount greater than one, this event fires every time the timeline begins to play backward)
90 | onRowsEnter (user or attacker would need to change a row in a data source)
91 | onRowExit (user or attacker would need to change a row in a data source)
92 | onRowDelete (user or attacker would need to delete a row in a data source)
93 | onRowInserted (user or attacker would need to insert a row in a data source)
94 | onScroll (user would need to scroll, or attacker could use the scrollBy function)
95 | onSeek (the onreverse event fires when the timeline is set to play in any direction other than forward)
96 | onSelect (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand("SelectAll");)
97 | onSelectionChange (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand("SelectAll");)
98 | onSelectStart (user needs to select some text - attacker could auto initialize with something like: window.document.execCommand("SelectAll");)
99 | onStart (fires at the beginning of each marquee loop)
100 | onStop (user would need to press the stop button or leave the webpage)
101 | onStorage (storage area changed)
102 | onSyncRestored (user interrupts the element's ability to play its media as defined by the timeline to fire)
103 | onSubmit (requires attacker or user submits a form)
104 | onTimeError (user or attacker sets a time property, such as dur, to an invalid value)
105 | onTrackChange (user or attacker changes track in a playList)
106 | onUndo (user went backward in undo transaction history)
107 | onUnload (as the user clicks any link or presses the back button or attacker forces a click)
108 | onURLFlip (this event fires when an Advanced Streaming Format (ASF) file, played by a HTML+TIME (Timed Interactive Multimedia Extensions) media tag, processes script commands embedded in the ASF file)
109 | seekSegmentTime (this is a method that locates the specified point on the element's segment time line and begins playing from that point. The segment consists of one repetition of the time line including reverse play using the AUTOREVERSE attribute.)
110 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AwesomeXSS
2 | This repository is a collection of Awesome XSS resources. Contributions are welcome and should be submitted via an issue.
3 |
4 | ### Awesome contents
5 | - [Challenges](https://github.com/s0md3v/AwesomeXSS#awesome-challenges)
6 | - [Reads & Presentations](https://github.com/s0md3v/AwesomeXSS#awesome-reads--presentations)
7 | - [Tools](https://github.com/s0md3v/AwesomeXSS#awesome-tools)
8 | - [Mind maps](https://github.com/s0md3v/AwesomeXSS#awesome-xss-mind-maps)
9 | - [DOM XSS](https://github.com/s0md3v/AwesomeXSS#awesome-dom-xss)
10 | - [Payloads](https://github.com/s0md3v/AwesomeXSS#awesome-payloads)
11 | - [Polyglots](https://github.com/s0md3v/AwesomeXSS#awesome-polyglots)
12 | - [Tags and event handlers](https://github.com/s0md3v/AwesomeXSS#awesome-tags--event-handlers)
13 | - [Context breaking](https://github.com/s0md3v/AwesomeXSS#awesome-context-breaking)
14 | - [HTML context](https://github.com/s0md3v/AwesomeXSS#html-context)
15 | - [Attribute context](https://github.com/s0md3v/AwesomeXSS#attribute-context)
16 | - [JavaScript context](https://github.com/s0md3v/AwesomeXSS#javascript-context)
17 | - [Confirm Variants](https://github.com/s0md3v/AwesomeXSS#awesome-confirm-variants)
18 | - [Exploits](https://github.com/s0md3v/AwesomeXSS#awesome-exploits)
19 | - [Probing](https://github.com/s0md3v/AwesomeXSS#awesome-probing)
20 | - [Bypassing](https://github.com/s0md3v/AwesomeXSS#awesome-bypassing)
21 | - [Encoding](https://github.com/s0md3v/AwesomeXSS#awesome-encoding)
22 | - [Tips & tricks](https://github.com/s0md3v/AwesomeXSS#awesome-tips--tricks)
23 |
24 | ### Awesome Challenges
25 | - [prompt.ml](https://prompt.ml)
26 | - [alf.nu/alert1](https://alf.nu/alert1)
27 | - [xss-game.appspot.com](https://xss-game.appspot.com)
28 | - [polyglot.innerht.ml](https://polyglot.innerht.ml)
29 | - [sudo.co.il/xss](http://sudo.co.il/xss)
30 | - [root-me.org](https://www.root-me.org/?page=recherche&lang=en&recherche=xss)
31 | - [chefsecure.com](https://chefsecure.com/courses/xss/challenges)
32 | - [wechall.net](https://www.wechall.net/challs/XSS)
33 | - [codelatte.id/labs/xss](https://codelatte.id/labs/xss)
34 |
35 | ### Awesome Reads & Presentations
36 | - [Bypassing XSS Detection Mechanisms](https://github.com/s0md3v/MyPapers/tree/master/Bypassing-XSS-detection-mechanisms)
37 | - [XSS in Facebook via PNG Content Type](https://whitton.io/articles/xss-on-facebook-via-png-content-types/)
38 | - [How I met your girlfriend](https://www.youtube.com/watch?v=fWk_rMQiDGc)
39 | - [How to Find 1,352 Wordpress XSS Plugin Vulnerabilities in one hour](https://www.youtube.com/watch?v=9ADubsByGos)
40 | - [Blind XSS](https://www.youtube.com/watch?v=OT0fJEtz7aE)
41 | - [Copy Pest](https://www.slideshare.net/x00mario/copypest)
42 |
43 | ### Awesome Tools
44 | - [XSStrike](https://github.com/UltimateHackers/XSStrike)
45 | - [BeEF](https://github.com/beefproject/beef)
46 | - [JShell](https://github.com/UltimateHackers/JShell)
47 |
48 | ### Awesome XSS Mind Maps
49 | A beautiful XSS mind map by Jack Masa, [here](https://github.com/s0md3v/AwesomeXSS/blob/master/Database/jackmasa-mind-map.png)
50 |
51 | ### Awesome DOM XSS
52 |
53 | - Does your input go into a sink? `Vulnerable`
54 | - It doesn't? `Not vulnerable`
55 |
56 | **Source**: An input that could be controlled by an external (untrusted) source.
57 |
58 | ```
59 | document.URL
60 | document.documentURI
61 | document.URLUnencoded (IE 5.5 or later Only)
62 | document.baseURI
63 | location
64 | location.href
65 | location.search
66 | location.hash
67 | location.pathname
68 | document.cookie
69 | document.referrer
70 | window.name
71 | history.pushState()
72 | history.replaceState()
73 | localStorage
74 | sessionStorage
75 | ```
76 |
77 | **Sink**: A potentially dangerous method that could lead to a vulnerability. In this case a DOM Based XSS.
78 |
79 | ```
80 | eval
81 | Function
82 | setTimeout
83 | setInterval
84 | setImmediate
85 | execScript
86 | crypto.generateCRMFRequest
87 | ScriptElement.src
88 | ScriptElement.text
89 | ScriptElement.textContent
90 | ScriptElement.innerText
91 | anyTag.onEventName
92 | document.write
93 | document.writeln
94 | anyElement.innerHTML
95 | Range.createContextualFragment
96 | window.location
97 | document.location
98 | ```
99 |
100 | This comprehensive list of sinks and source is taken from [domxsswiki](https://github.com/wisec/domxsswiki).
101 |
102 | ### Awesome Payloads
103 | ```
104 | z
105 | [confirm``]"<">z
106 | z
107 |
108 | "/ondblclick=`<`[confir\u006d``]>z
110 | click
111 | click
112 |
117 |