webgoat
main
project
JavaSource
WebContent
META-INF
WEB-INF
css
database
images
javascript
instructor
DOMXSS.js
DOMXSS_backup.js
clientSideFiltering.js
clientSideValidation.js
escape.js
eval.js
javascript.js
lessonNav.js
makeWindow.js
menu_system.js
sameOrigin.js
toggle.js
lesson_plans
lesson_solutions
lessons
users
main.jsp
sideWindow.jsp
webgoat.jsp
webgoat_challenge.jsp
config
doc
build.xml
Eclipse-Workspace.zip
HOW TO create the WebGoat workspace.txt
build.xml
eclipse.bat
readme.txt
webgoat for SQL Server.bat
webgoat.bat
webgoat.sh
webgoat_8080.bat
webscarab.bat
git-svn-id: http://webgoat.googlecode.com/svn/trunk@272 4033779f-a91e-0410-96ef-6bf7bf53c507
101 lines
2.1 KiB
JavaScript
101 lines
2.1 KiB
JavaScript
|
|
|
|
|
|
function submitXHR(){
|
|
|
|
document.getElementById("responseTitle").innerHTML="Response: ";
|
|
|
|
document.getElementById("responseArea").innerHTML="";
|
|
|
|
alert("creating XHR request for: " + document.getElementById("requestedURL").value);
|
|
|
|
|
|
|
|
try{
|
|
ajaxFunction();
|
|
}
|
|
catch(err){
|
|
alert(err);
|
|
document.getElementById("requestedURL").value="";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function ajaxFunction()
|
|
{
|
|
var xmlHttp;
|
|
try
|
|
{
|
|
// Firefox, Opera 8.0+, Safari
|
|
xmlHttp=new XMLHttpRequest();
|
|
}
|
|
catch (e)
|
|
{
|
|
// Internet Explorer
|
|
try
|
|
{
|
|
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
|
|
}
|
|
catch (e)
|
|
{
|
|
try
|
|
{
|
|
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
}
|
|
catch (e)
|
|
{
|
|
alert("Your browser does not support AJAX!");
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
xmlHttp.onreadystatechange=function()
|
|
{
|
|
|
|
var result = xmlHttp.responseText;
|
|
if(xmlHttp.readyState==4)
|
|
{
|
|
|
|
|
|
document.getElementById("responseTitle").innerHTML="Response from: "
|
|
+ document.getElementById("requestedURL").value ;
|
|
|
|
document.getElementById("responseArea").innerHTML=result;
|
|
|
|
document.getElementById("requestedURL").value="";
|
|
|
|
}
|
|
}
|
|
|
|
xmlHttp.open("GET",document.getElementById("requestedURL").value,true);
|
|
xmlHttp.send(null);
|
|
}
|
|
|
|
|
|
|
|
function populate(url){
|
|
document.getElementById("requestedURL").value=url;
|
|
submitXHR();
|
|
|
|
|
|
var webGoatURL = "lessons/Ajax/sameOrigin.jsp";
|
|
var googleURL = "http://www.google.com/search?q=aspect+security";
|
|
|
|
var hiddenWGStatus = document.getElementById("hiddenWGStatus");
|
|
|
|
var hiddenGoogleStatus = document.getElementById("hiddenGoogleStatus");
|
|
|
|
|
|
if (url == webGoatURL){
|
|
hiddenWGStatus.value = 1;
|
|
}
|
|
|
|
if (url == googleURL){
|
|
hiddenGoogleStatus.value = 1;
|
|
}
|
|
|
|
if (hiddenWGStatus.value == 1 && hiddenGoogleStatus.value == 1){
|
|
document.form.submit();
|
|
}
|
|
} |