Fix WebServices lessons to maintain a reference to WebgoatContext
Since the webservices lessons are also created automatically by Axis, which obviously does not have a reference to WebgoatContext, and wouldn't call setWebgoatContext even if it did, we need to ensure that each lesson created can still get to WebgoatContext. Do this by maintaining a static reference to WebgoatContext that all instances of the class can use. git-svn-id: http://webgoat.googlecode.com/svn/trunk@165 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
parent
76f654e820
commit
7dee412ee1
@ -26,6 +26,7 @@ import org.owasp.webgoat.session.DatabaseUtilities;
|
||||
import org.owasp.webgoat.session.ECSFactory;
|
||||
import org.owasp.webgoat.session.ParameterNotFoundException;
|
||||
import org.owasp.webgoat.session.WebSession;
|
||||
import org.owasp.webgoat.session.WebgoatContext;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -90,6 +91,24 @@ public class SoapRequest extends SequentialLessonAdapter
|
||||
|
||||
static int accessLoginCount;
|
||||
|
||||
private static WebgoatContext webgoatContext;
|
||||
|
||||
/**
|
||||
* We maintain a static reference to WebgoatContext, since this class
|
||||
* is also automatically instantiated by the Axis web services module,
|
||||
* which does not call setWebgoatContext()
|
||||
* (non-Javadoc)
|
||||
* @see org.owasp.webgoat.lessons.AbstractLesson#setWebgoatContext(org.owasp.webgoat.session.WebgoatContext)
|
||||
*/
|
||||
@Override
|
||||
public void setWebgoatContext(WebgoatContext webgoatContext) {
|
||||
SoapRequest.webgoatContext = webgoatContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebgoatContext getWebgoatContext() {
|
||||
return SoapRequest.webgoatContext;
|
||||
}
|
||||
|
||||
protected Category getDefaultCategory()
|
||||
{
|
||||
|
@ -37,6 +37,7 @@ import org.apache.ecs.html.Table;
|
||||
import org.owasp.webgoat.session.DatabaseUtilities;
|
||||
import org.owasp.webgoat.session.ECSFactory;
|
||||
import org.owasp.webgoat.session.WebSession;
|
||||
import org.owasp.webgoat.session.WebgoatContext;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -92,6 +93,24 @@ public class WSDLScanning extends LessonAdapter
|
||||
final static IMG CREDITS_LOGO = new IMG("images/logos/parasoft.jpg")
|
||||
.setAlt("Parasoft").setBorder(0).setHspace(0).setVspace(0);
|
||||
|
||||
private static WebgoatContext webgoatContext;
|
||||
|
||||
/**
|
||||
* We maintain a static reference to WebgoatContext, since this class
|
||||
* is also automatically instantiated by the Axis web services module,
|
||||
* which does not call setWebgoatContext()
|
||||
* (non-Javadoc)
|
||||
* @see org.owasp.webgoat.lessons.AbstractLesson#setWebgoatContext(org.owasp.webgoat.session.WebgoatContext)
|
||||
*/
|
||||
@Override
|
||||
public void setWebgoatContext(WebgoatContext webgoatContext) {
|
||||
WSDLScanning.webgoatContext = webgoatContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebgoatContext getWebgoatContext() {
|
||||
return WSDLScanning.webgoatContext;
|
||||
}
|
||||
|
||||
protected Category getDefaultCategory()
|
||||
{
|
||||
|
@ -26,6 +26,7 @@ import org.apache.ecs.html.PRE;
|
||||
import org.owasp.webgoat.session.DatabaseUtilities;
|
||||
import org.owasp.webgoat.session.ECSFactory;
|
||||
import org.owasp.webgoat.session.WebSession;
|
||||
import org.owasp.webgoat.session.WebgoatContext;
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -80,6 +81,25 @@ public class WsSqlInjection extends LessonAdapter
|
||||
*/
|
||||
static boolean completed;
|
||||
|
||||
private static WebgoatContext webgoatContext;
|
||||
|
||||
/**
|
||||
* We maintain a static reference to WebgoatContext, since this class
|
||||
* is also automatically instantiated by the Axis web services module,
|
||||
* which does not call setWebgoatContext()
|
||||
* (non-Javadoc)
|
||||
* @see org.owasp.webgoat.lessons.AbstractLesson#setWebgoatContext(org.owasp.webgoat.session.WebgoatContext)
|
||||
*/
|
||||
@Override
|
||||
public void setWebgoatContext(WebgoatContext webgoatContext) {
|
||||
WsSqlInjection.webgoatContext = webgoatContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebgoatContext getWebgoatContext() {
|
||||
return WsSqlInjection.webgoatContext;
|
||||
}
|
||||
|
||||
|
||||
protected Category getDefaultCategory()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user