<%@ page contentType="text/html; charset=ISO-8859-1" language="java" import="org.owasp.webgoat.session.*, org.owasp.webgoat.lessons.Category, org.owasp.webgoat.lessons.AbstractLesson, java.util.*" errorPage="" %> <% Course course = ((Course)session.getAttribute("course")); WebSession webSession = ((WebSession)session.getAttribute("websession")); AbstractLesson currentLesson = webSession.getCurrentLesson(); %> <%@page import="org.owasp.webgoat.lessons.SequentialLessonAdapter"%> <%@page import="org.owasp.webgoat.lessons.RandomLessonAdapter"%> <%=currentLesson.getTitle()%> <% final String menuPrefix = "menu"; final String submenuPrefix = "submenu"; final String mbutPrefix = "mbut"; String printHint = ""; String printParameters = ""; String printCookies = ""; String lessonComplete = ""; String m = "menu"; String menu = request.getParameter(m); List categories = course.getCategories(); StringBuffer buildList = new StringBuffer(); Iterator iter1 = categories.iterator(); while(iter1.hasNext()) { Category category = (Category)iter1.next(); buildList.append("'"); buildList.append(menuPrefix); buildList.append(category.getRanking()); buildList.append("','"); buildList.append(submenuPrefix); buildList.append(category.getRanking()); buildList.append("','"); buildList.append(mbutPrefix); buildList.append(category.getRanking()); buildList.append("'"); if (iter1.hasNext()) buildList.append(","); }%>
<% int topCord = 140; int zIndex = 105; Iterator iter2 = categories.iterator(); while(iter2.hasNext()) { Category category = (Category)iter2.next(); %>
<%=category.getName()%>
<% topCord=topCord + 30; zIndex=zIndex + 1; } int topSubMenu = 72; Iterator iter3 = categories.iterator(); while(iter3.hasNext()) { Category category = (Category)iter3.next(); List lessons = webSession.getLessons(category); Iterator iter4 = lessons.iterator(); %> <% }%>
LogOut Help
<%=currentLesson.getTitle()%>
<% if (webSession.isAuthorizedInLesson(webSession.getRole(), WebSession.SHOWHINTS)) { %> Previous Hint Hints Next Hint <%}%> Show Params Show Cookies <% if (webSession.isAuthorizedInLesson(webSession.getRole(), WebSession.SHOWSOURCE)) { %> Show Java Lesson Plans <%}%>
<% if (currentLesson != null) { %> <% } if (webSession.getHint() != null) { printHint = "
" + webSession.getHint() + "

"; out.println(printHint); } if (webSession.getParams() != null) { Iterator i = webSession.getParams().iterator(); while (i.hasNext()) { Parameter p = (Parameter) i.next(); printParameters = "
" + p.getName() + "=" + p.getValue() + "

"; out.println(printParameters); } } if (webSession.getCookies() != null) { Iterator i = webSession.getCookies().iterator(); while (i.hasNext()) { Cookie c = (Cookie) i.next(); printCookies = "
" + c.getName() + " \"\" " + c.getValue() + "

"; out.println(printCookies); } }%> <% AbstractLesson al = webSession.getCurrentLesson(); if (!al.isCompleted(webSession)) { if (al instanceof SequentialLessonAdapter) { SequentialLessonAdapter sla = (SequentialLessonAdapter) al; if (webSession.isDebug()&& sla.getStageCount() > 1) { %>
<% } } else if (al instanceof RandomLessonAdapter) { RandomLessonAdapter rla = (RandomLessonAdapter) al; String[] stages = rla.getStages(); if (stages != null && stages.length > 0) { %>
<% } } } %>
<%=webSession.getInstructions()%>
<%=webSession.getMessage()%>
<% if (currentLesson.getTemplatePage(webSession) != null) { System.out.println("Main.jsp - current lesson: " + currentLesson.getName() ); System.out.println(" - template Page: " + currentLesson.getTemplatePage(webSession)); %> <% } else { %>
<%=currentLesson.getContent()%>
<% } %>
<% out.println(currentLesson.getCredits());%>
OWASP Foundation | Project WebGoat