+
+
Lesson Plan Title: Http Basics
+
+
Concept / Topic To Teach:
+ This lesson presents the basics for understanding the transfer of data between the browser and the web application.
+
+
+
+ How HTTP works:
+
+ All HTTP transactions follow the same general format. Each client request and server response has three parts: the request or response line, a header section, and the entity body. The client initiates a transaction as follows:
+
+ The client contacts the server and sends a document request
+
+
+
+
GET /index.html?param=value HTTP/1.0
+ Next, the client sends optional header information to inform the server of its configuration and the document formats it will accept.
+
+
User-Agent: Mozilla/4.06 Accept: image/gif,image/jpeg, */*
+ After sending the request and headers, the client may send additional data. This data is mostly used by CGI programs using the POST method.
+
General Goal(s):
+ <%-- Start Instructions --%>
+ Enter your name in the input field below and press "go" to submit. The server will accept the request, reverse the input, and display it back to the user, illustrating the basics of handling an HTTP request.
+
+ The user should become familiar with the features of WebGoat by manipulating the above
+ buttons to view hints, show the HTTP request parameters, the HTTP request cookies, and the Java source code. You may also try using WebScarab for the first time.
+ <%-- Stop Instructions --%>
+
+
+
+
Close this Window
+
+
+
+<%
+ Course course = ((Course)session.getAttribute("course"));
+ WebSession webSession = ((WebSession)session.getAttribute("websession"));
+%>
+
+ <%--
+ This form posts to httpBasics.do. However, we must append the "menu" request parameter in order
+ for the current submenu to display properly, hence the getLink() call to build the form's
+ action attribute below.
+ --%>
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/pages/sections/hintsParamsAndCookies.jsp b/src/main/webapp/WEB-INF/pages/sections/hintsParamsAndCookies.jsp
new file mode 100644
index 000000000..aaf05658f
--- /dev/null
+++ b/src/main/webapp/WEB-INF/pages/sections/hintsParamsAndCookies.jsp
@@ -0,0 +1,45 @@
+<%@ page
+ language="java"
+ contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"
+ import="java.util.Iterator, org.owasp.webgoat.session.*, org.owasp.webgoat.lessons.AbstractLesson, org.owasp.webgoat.util.*"
+ errorPage=""
+ isELIgnored="false" %>
+
+<%
+Course course = ((Course)session.getAttribute("course"));
+WebSession webSession = ((WebSession)session.getAttribute("websession"));
+AbstractLesson currentLesson = webSession.getCurrentLesson();
+
+if (webSession.getHint() != null)
+{
+%>
+
<%= webSession.getHint() %>
+<%
+}
+
+if (webSession.getParams() != null)
+{
+ Iterator i = webSession.getParams().iterator();
+ while (i.hasNext())
+ {
+ Parameter p = (Parameter) i.next();
+%>
+
<%= p.getName()%> = <%= p.getValue() %>
+<%
+ }
+}
+
+
+if (webSession.getCookies() != null)
+{
+ Iterator i = webSession.getCookies().iterator();
+ while (i.hasNext())
+ {
+ Cookie c = (Cookie) i.next();
+%>
+
<%= c.getName() %>

<%= c.getValue() %>
+<%
+ }
+}
+%>
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/pages/sections/menu.jsp b/src/main/webapp/WEB-INF/pages/sections/menu.jsp
new file mode 100644
index 000000000..aa192f9cb
--- /dev/null
+++ b/src/main/webapp/WEB-INF/pages/sections/menu.jsp
@@ -0,0 +1,202 @@
+<%@ 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, org.owasp.webgoat.util.*, 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.RandomLessonAdapter"%>
+
+
+
+<%
+final String menuPrefix = WebSession.MENU;
+final String submenuPrefix = "submenu";
+final String mbutPrefix = "mbut";
+String printHint = "";
+String printParameters = "";
+String printCookies = "";
+String lessonComplete = "

";
+
+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();
+ %>
+
+ <%
+ 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();
+ %>
+ <%
+ }%>
+
+
+
+ <% if (currentLesson.getAvailableLanguages().size() != 0 )
+ {
+ %>
+
+ <%
+ } else {
+ %>
+ Internationalization is not available for this lesson
+ <%
+ }
+ %>
+
+
+

+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/spring-security.xml b/src/main/webapp/WEB-INF/spring-security.xml
new file mode 100644
index 000000000..a7a0082e4
--- /dev/null
+++ b/src/main/webapp/WEB-INF/spring-security.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/tiles-context.xml b/src/main/webapp/WEB-INF/tiles-context.xml
new file mode 100644
index 000000000..c4f1dccc7
--- /dev/null
+++ b/src/main/webapp/WEB-INF/tiles-context.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ /WEB-INF/tiles-definitions.xml
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/tiles-definitions.xml b/src/main/webapp/WEB-INF/tiles-definitions.xml
new file mode 100644
index 000000000..3f63bb5e7
--- /dev/null
+++ b/src/main/webapp/WEB-INF/tiles-definitions.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
index ea46dea27..1490812cc 100755
--- a/src/main/webapp/WEB-INF/web.xml
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -1,9 +1,9 @@
-
-
-
+
WebGoat
@@ -42,6 +42,16 @@
and comments about this application should be addressed.
+
+
+
+ contextConfigLocation
+
+ /WEB-INF/mvc-dispatcher-servlet.xml,
+ /WEB-INF/spring-security.xml
+
+
+
+
+ mvc-dispatcher
+ org.springframework.web.servlet.DispatcherServlet
+ 1
+
+
+
+ mvc-dispatcher
+ *.do
+
+
+
+
+ org.springframework.web.context.ContextLoaderListener
+
+
+
+
+
+
+ springSecurityFilterChain
+ org.springframework.web.filter.DelegatingFilterProxy
+
+
+
+ springSecurityFilterChain
+ /*
+
+
+
+
+
+
diff --git a/src/main/webapp/images/header/header.jpg b/src/main/webapp/images/header/header.jpg
index d5c71eeba..8900b1327 100644
Binary files a/src/main/webapp/images/header/header.jpg and b/src/main/webapp/images/header/header.jpg differ