public class WebSession extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ADMIN
Description of the Field
|
static String |
CHALLENGE
Description of the Field
|
static String |
COLOR
Description of the Field
|
static String |
COURSE
Constant
COURSE="course" |
static String |
DEBUG
Constant
DEBUG="debug" |
static int |
ERROR
Error screen number
|
static String |
JSESSION_ID
session id string
|
static String |
LANGUAGE
Constant
LANGUAGE="language" |
static String |
LOGOUT
Logout parameter name
|
static String |
MENU
menu parameter name
|
static String |
RESTART
Restart parameter name
|
static String |
SCREEN
Screen parameter name
|
static String |
SESSION
Description of the Field
|
static String |
SHOW
Constant
SHOW="show" |
static String |
SHOW_COOKIES
Constant
SHOW_COOKIES="Cookies" |
static String |
SHOW_NEXTHINT
Constant
SHOW_NEXTHINT="NextHint" |
static String |
SHOW_PARAMS
Constant
SHOW_PARAMS="Params" |
static String |
SHOW_PREVIOUSHINT
Constant
SHOW_PREVIOUSHINT="PreviousHint" |
static String |
SHOW_SOLUTION
Constant
SHOW_SOLUTION="Solution" |
static String |
SHOW_SOURCE
Constant
SHOW_SOURCE="Source" |
static String |
SHOWHINTS
Constant
SHOWHINTS="ShowHints" |
static String |
SHOWSOLUTION
Constant
SHOWSOLUTION="ShowSolution" |
static String |
SHOWSOURCE
Constant
SHOWSOURCE="ShowSource" |
static String |
STAGE
Constant
STAGE="stage" |
static String |
WEBGOAT_ADMIN
Tomcat role for a webgoat admin
|
static String |
WEBGOAT_USER
Tomcat role for a webgoat user
|
static int |
WELCOME
Description of the Field
|
| Constructor and Description |
|---|
WebSession(WebgoatContext webgoatContext,
javax.servlet.ServletContext context)
Constructor for the WebSession object
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String key,
Object value)
Description of the Method
|
void |
clearMessage()
Description of the Method
|
void |
closeLessonSession(AbstractLesson lesson)
closeLessonSession.
|
boolean |
completedHackableAdmin()
Has the user ever hacked the hackable admin
|
void |
eatCookies()
Marks all cookies but the JSESSIONID for deletion and adds them to the response.
|
Object |
get(String key)
Description of the Method
|
static Connection |
getConnection(WebSession s)
getConnection.
|
javax.servlet.ServletContext |
getContext()
Gets the context attribute of the WebSession object
|
String |
getCookie(String cookieName)
Gets the cookie attribute of the CookieScreen object
|
List<javax.servlet.http.Cookie> |
getCookies()
getCookies.
|
List<javax.servlet.http.Cookie> |
getCookiesOnLastRequest()
Getter for the field
cookiesOnLastRequest. |
Course |
getCourse()
Gets the course attribute of the WebSession object
|
AbstractLesson |
getCurrentLesson()
getCurrentLesson.
|
String |
getCurrentLink()
getCurrentLink.
|
int |
getCurrentMenu()
Getter for the field
currentMenu. |
int |
getCurrentScreen()
Gets the currentScreen attribute of the WebSession object
|
String |
getCurrrentLanguage()
getCurrrentLanguage.
|
String |
getHeader(String header)
getHeader.
|
String |
getHint()
getHint.
|
String |
getInstructions()
getInstructions.
|
AbstractLesson |
getLesson(int id)
getLesson.
|
List<AbstractLesson> |
getLessons(Category category)
getLessons.
|
LessonSession |
getLessonSession(AbstractLesson lesson)
getLessonSession.
|
String |
getMessage()
Gets the message attribute of the WebSession object
|
String |
getNextHint()
getNextHint.
|
List<Parameter> |
getParams()
getParams.
|
List<RequestParameter> |
getParmsOnLastRequest()
Getter for the field
parmsOnLastRequest. |
ParameterParser |
getParser()
Gets the parser attribute of the WebSession object
|
String |
getPreviousHint()
getPreviousHint.
|
int |
getPreviousScreen()
Gets the previousScreen attribute of the WebSession object
|
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the request attribute of the WebSession object
|
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the response attribute of the WebSession object
|
String |
getRestartLink()
getRestartLink.
|
String |
getRole()
getRole.
|
List<String> |
getRoles()
getRoles.
|
String |
getServletName()
Gets the servletName attribute of the WebSession object
|
String |
getSolution()
getSolution.
|
String |
getSource()
getSource.
|
int |
getUserIdInLesson()
getUserIdInLesson.
|
String |
getUserName()
Gets the userName attribute of the WebSession object
|
String |
getUserNameInLesson()
getUserNameInLesson.
|
WebgoatContext |
getWebgoatContext()
Getter for the field
webgoatContext. |
String |
getWebResource(String fileName)
Gets the sourceFile attribute of the WebSession object
|
boolean |
isAdmin()
Gets the admin attribute of the WebSession object
|
boolean |
isAuthenticated()
Gets the authenticated attribute of the WebSession object
|
boolean |
isAuthenticatedInLesson(AbstractLesson lesson)
isAuthenticatedInLesson.
|
boolean |
isAuthorizedInLesson(int employeeId,
String functionId)
isAuthorizedInLesson.
|
boolean |
isAuthorizedInLesson(String role,
String functionId)
isAuthorizedInLesson.
|
boolean |
isChallenge()
Gets the challenge attribute of the WebSession object
|
boolean |
isColor()
Gets the color attribute of the WebSession object
|
boolean |
isDebug()
isDebug.
|
boolean |
isHackedAdmin()
Gets the hackedAdmin attribute of the WebSession object
|
boolean |
isScreen(int value)
Gets the screen attribute of the WebSession object
|
boolean |
isUser()
Gets the user attribute of the WebSession object
|
void |
openLessonSession(AbstractLesson lesson)
openLessonSession.
|
void |
restartLesson(int lessonId)
restartLesson.
|
static void |
returnConnection(WebSession s)
returnConnection.
|
void |
setAdmin(boolean state)
Sets the admin flag - this routine is ONLY here to allow someone a backdoor to setting the user up as an admin.
|
void |
setCourse(Course course)
Setter for the field
course. |
void |
setCurrentMenu(Integer ranking)
Setter for the field
currentMenu. |
void |
setCurrentScreen(int screen)
Setter for the field
currentScreen. |
void |
setHasHackableAdmin(String role)
setHasHackableAdmin.
|
void |
setLineBreak(String text)
setLineBreak.
|
void |
setMessage(String text)
Sets the message attribute of the WebSession object
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Setter for the field
request. |
boolean |
showCookies()
Description of the Method
|
boolean |
showParams()
Description of the Method
|
boolean |
showRequest()
Description of the Method
|
boolean |
showSolution()
showSolution.
|
boolean |
showSource()
Description of the Method
|
void |
update(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String name)
Parse parameters from the given request, handle any servlet commands, and update this session based on the
parameters.
|
void |
updateLastAttackRequestInfo(javax.servlet.http.HttpServletRequest request)
updateLastAttackRequestInfo.
|
public static final String ADMIN
public static final String WEBGOAT_USER
public static final String WEBGOAT_ADMIN
public static final String CHALLENGE
public static final String COLOR
public static final String COURSE
COURSE="course"public static final int ERROR
public static final String STAGE
STAGE="stage"public static final String JSESSION_ID
public static final String LOGOUT
public static final String RESTART
public static final String MENU
public static final String SCREEN
public static final String SESSION
public static final String SHOWSOURCE
SHOWSOURCE="ShowSource"public static final String SHOWSOLUTION
SHOWSOLUTION="ShowSolution"public static final String SHOWHINTS
SHOWHINTS="ShowHints"public static final String SHOW
SHOW="show"public static final String SHOW_NEXTHINT
SHOW_NEXTHINT="NextHint"public static final String SHOW_PREVIOUSHINT
SHOW_PREVIOUSHINT="PreviousHint"public static final String SHOW_PARAMS
SHOW_PARAMS="Params"public static final String SHOW_COOKIES
SHOW_COOKIES="Cookies"public static final String SHOW_SOURCE
SHOW_SOURCE="Source"public static final String SHOW_SOLUTION
SHOW_SOLUTION="Solution"public static final String DEBUG
DEBUG="debug"public static final String LANGUAGE
LANGUAGE="language"public static final int WELCOME
public WebSession(WebgoatContext webgoatContext, javax.servlet.ServletContext context)
webgoatContext - a WebgoatContext object.context - Description of the Parameterpublic static Connection getConnection(WebSession s) throws SQLException
getConnection.
s - a WebSession object.Connection object.SQLException - if any.public static void returnConnection(WebSession s)
returnConnection.
s - a WebSession object.public void add(String key, Object value)
key - Description of the Parametervalue - Description of the Parameterpublic void clearMessage()
public void eatCookies()
public Object get(String key)
key - Description of the Parameterpublic javax.servlet.ServletContext getContext()
public void setAdmin(boolean state)
state - a boolean.public Course getCourse()
public void setCourse(Course course)
Setter for the field course.
course - a Course object.public int getCurrentScreen()
public void setCurrentScreen(int screen)
Setter for the field currentScreen.
screen - a int.public AbstractLesson getCurrentLesson()
getCurrentLesson.
AbstractLesson object.public AbstractLesson getLesson(int id)
getLesson.
id - a int.AbstractLesson object.public List<AbstractLesson> getLessons(Category category)
getLessons.
public String getCookie(String cookieName)
cookieName - a String object.public String getMessage()
public ParameterParser getParser()
public int getPreviousScreen()
public javax.servlet.http.HttpServletRequest getRequest()
public void setRequest(javax.servlet.http.HttpServletRequest request)
Setter for the field request.
request - a HttpServletRequest object.public javax.servlet.http.HttpServletResponse getResponse()
public String getServletName()
public String getWebResource(String fileName)
fileName - a String object.public boolean isAdmin()
public boolean isHackedAdmin()
public boolean completedHackableAdmin()
public boolean isAuthenticated()
public boolean isAuthenticatedInLesson(AbstractLesson lesson)
isAuthenticatedInLesson.
lesson - a AbstractLesson object.public boolean isAuthorizedInLesson(int employeeId,
String functionId)
isAuthorizedInLesson.
employeeId - a int.functionId - a String object.public boolean isAuthorizedInLesson(String role, String functionId)
isAuthorizedInLesson.
public int getUserIdInLesson()
throws ParameterNotFoundException
getUserIdInLesson.
ParameterNotFoundException - if any.public String getUserNameInLesson() throws ParameterNotFoundException
getUserNameInLesson.
String object.ParameterNotFoundException - if any.public void openLessonSession(AbstractLesson lesson)
openLessonSession.
lesson - a AbstractLesson object.public void closeLessonSession(AbstractLesson lesson)
closeLessonSession.
lesson - a AbstractLesson object.public LessonSession getLessonSession(AbstractLesson lesson)
getLessonSession.
lesson - a AbstractLesson object.LessonSession object.public boolean isChallenge()
public boolean isColor()
public boolean isScreen(int value)
value - Description of the Parameterpublic boolean isUser()
public void setMessage(String text)
text - The new message valuepublic void setLineBreak(String text)
setLineBreak.
text - a String object.public boolean showCookies()
public boolean showParams()
public boolean showRequest()
public boolean showSource()
public boolean showSolution()
showSolution.
public String getUserName()
public void update(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String name)
throws IOException
request - Description of the Parameterresponse - Description of the Parametername - Description of the ParameterIOException - if any.public void updateLastAttackRequestInfo(javax.servlet.http.HttpServletRequest request)
updateLastAttackRequestInfo.
request - a HttpServletRequest object.public void restartLesson(int lessonId)
restartLesson.
lessonId - a int.public void setHasHackableAdmin(String role)
setHasHackableAdmin.
role - a String object.public boolean isDebug()
isDebug.
public String getHeader(String header)
getHeader.
header - - request header value to returnString object.public void setCurrentMenu(Integer ranking)
Setter for the field currentMenu.
ranking - a Integer object.public int getCurrentMenu()
Getter for the field currentMenu.
public WebgoatContext getWebgoatContext()
Getter for the field webgoatContext.
WebgoatContext object.public String getCurrrentLanguage()
getCurrrentLanguage.
String object.public List<javax.servlet.http.Cookie> getCookiesOnLastRequest()
Getter for the field cookiesOnLastRequest.
public List<RequestParameter> getParmsOnLastRequest()
Getter for the field parmsOnLastRequest.
Copyright © 2006–2016 OWASP. All rights reserved.