diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java index 24160a4f1..f29f60903 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AbstractLesson.java @@ -499,7 +499,7 @@ public abstract class AbstractLesson extends Screen implements Comparable } - public String getHtml(WebSession s) + public String getHtml_DELETE_ME(WebSession s) { String html = null; @@ -561,7 +561,6 @@ public abstract class AbstractLesson extends Screen implements Comparable public String getSolution(WebSession s) { - String source = null; String src = null; try @@ -587,8 +586,6 @@ public abstract class AbstractLesson extends Screen implements Comparable html.addElement(head); html.addElement(body); - source = html.toString(); - return src; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AccessControlMatrix.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AccessControlMatrix.java index b221b8adc..a4d1e366d 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AccessControlMatrix.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/AccessControlMatrix.java @@ -126,7 +126,7 @@ public class AccessControlMatrix extends LessonAdapter protected Category getDefaultCategory() { - return Category.A2; + return Category.ACCESS_CONTROL; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BackDoors.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BackDoors.java index 9d06acce3..4b2238001 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BackDoors.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BackDoors.java @@ -268,7 +268,7 @@ public class BackDoors extends SequentialLessonAdapter protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } protected Integer getDefaultRanking() @@ -278,6 +278,6 @@ public class BackDoors extends SequentialLessonAdapter public String getTitle() { - return ("How to Use Database Backdoors "); + return ("Database Backdoors "); } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BasicAuthentication.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BasicAuthentication.java index b3cb4bf68..a7c17a555 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BasicAuthentication.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BasicAuthentication.java @@ -205,12 +205,11 @@ public class BasicAuthentication extends SequentialLessonAdapter getLessonTracker(s, BASIC).store(s, this, BASIC); } - s - .setMessage("Congratulations, you have figured out the mechanics of basic authentication."); - s - .setMessage("  - Now you must try to make WebGoat reauthenticate you as: "); + s.setMessage("Congratulations, you have figured out the mechanics of basic authentication."); + s.setMessage("  - Now you must try to make WebGoat reauthenticate you as: "); s.setMessage("    - username: basic"); s.setMessage("    - password: basic"); + s.setMessage("Use the Basic Authentication Menu to start at login page."); // If the auth header is different but still the original user - tell the user // that the original cookie was posted bak and basic auth uses the cookie before the @@ -261,7 +260,7 @@ public class BasicAuthentication extends SequentialLessonAdapter protected Category getDefaultCategory() { - return Category.A3; + return Category.AUTHENTICATION; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BlindSqlInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BlindSqlInjection.java index 569605c98..1ef676b4b 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BlindSqlInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BlindSqlInjection.java @@ -145,7 +145,7 @@ public class BlindSqlInjection extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } /** @@ -298,7 +298,7 @@ public class BlindSqlInjection extends LessonAdapter */ public String getTitle() { - return ("How to Perform Blind SQL Injection"); + return ("Blind SQL Injection"); } /** diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BufferOverflow.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BufferOverflow.java index 1a32440f9..e99c9b428 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BufferOverflow.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/BufferOverflow.java @@ -64,7 +64,7 @@ public class BufferOverflow extends LessonAdapter protected Category getDefaultCategory() { - return Category.A5; + return Category.BUFFER_OVERFLOW; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CSRF.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CSRF.java index 125a74ef7..a05ff72bd 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CSRF.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CSRF.java @@ -278,7 +278,7 @@ public class CSRF extends LessonAdapter { @Override protected Category getDefaultCategory() { - return Category.A2; + return Category.ACCESS_CONTROL; } private final static Integer DEFAULT_RANKING = new Integer(120); @@ -308,7 +308,7 @@ public class CSRF extends LessonAdapter { */ public String getTitle() { - return ( "How to Perform Cross Site Request Forgery (CSRF)" ); + return ( "Cross Site Request Forgery (CSRF)" ); } private static String getNameroot( String name ) diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Category.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Category.java index 1a0d6d525..6a0a8a527 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Category.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Category.java @@ -32,145 +32,130 @@ import java.util.List; * for free software projects. * * For details, please see http://code.google.com/p/webgoat/ - * - * @author Bruce Mayhew WebGoat - * @created October 28, 2003 + * + * @author Bruce Mayhew WebGoat + * @created October 28, 2003 */ public class Category implements Comparable { - public final static Category A1 = new Category("Unvalidated Parameters", - new Integer(110)); + public final static Category UNVALIDATED_PARAMETERS = new Category("Unvalidated Parameters", new Integer(110)); - public final static Category A2 = new Category("Broken Access Control", - new Integer(210)); + public final static Category ACCESS_CONTROL = new Category("Access Control Flaws", new Integer(210)); - public final static Category A3 = new Category( - "Broken Authentication and Session Management", new Integer(310)); + public final static Category AUTHENTICATION = new Category("Authentication Flaws", new Integer(310)); - public final static Category A4 = new Category( - "Cross-Site Scripting (XSS)", new Integer(410)); + public final static Category SESSION_MANAGEMENT = new Category("Session Management Flaws", new Integer(320)); - public final static Category A5 = new Category("Buffer Overflows", - new Integer(510)); + public final static Category XSS = new Category("Cross-Site Scripting (XSS)", new Integer(410)); - public final static Category A6 = new Category("Injection Flaws", - new Integer(610)); + public final static Category BUFFER_OVERFLOW = new Category("Buffer Overflows", new Integer(510)); - public final static Category A7 = new Category("Improper Error Handling", - new Integer(710)); + public final static Category INJECTION = new Category("Injection Flaws", new Integer(610)); - public final static Category A8 = new Category("Insecure Storage", - new Integer(810)); + public final static Category ERROR_HANDLING = new Category("Improper Error Handling", new Integer(710)); - public final static Category A9 = new Category("Denial of Service", - new Integer(910)); + public final static Category INSECURE_STORAGE = new Category("Insecure Storage", new Integer(810)); - public final static Category A10 = new Category( - "Insecure Configuration Management", new Integer(1010)); + public final static Category DOS = new Category("Denial of Service", new Integer(910)); - public final static Category WEB_SERVICES = new Category("Web Services", - new Integer(1110)); + public final static Category INSECURE_CONFIGURATION = new Category("Insecure Configuration", new Integer(1010)); - public final static Category AJAX_SECURITY = new Category("AJAX Security", - new Integer(1150)); + public final static Category WEB_SERVICES = new Category("Web Services", new Integer(1110)); - public final static Category ADMIN_FUNCTIONS = new Category( - "Admin Functions", new Integer(10)); + public final static Category AJAX_SECURITY = new Category("AJAX Security", new Integer(1150)); - public final static Category GENERAL = new Category("General", new Integer( - 50)); + public final static Category ADMIN_FUNCTIONS = new Category("Admin Functions", new Integer(10)); - public final static Category CODE_QUALITY = new Category("Code Quality", - new Integer(70)); + public final static Category GENERAL = new Category("General", new Integer(50)); - public final static Category CHALLENGE = new Category("Challenge", - new Integer(2000)); + public final static Category CODE_QUALITY = new Category("Code Quality", new Integer(70)); - private static final List categories = new ArrayList(); - - private String category; + public final static Category CHALLENGE = new Category("Challenge", new Integer(2000)); - private Integer ranking; + private static final List categories = new ArrayList(); - static { - categories.add(A1); - categories.add(A2); - categories.add(A3); - categories.add(A4); - categories.add(A5); - categories.add(A6); - categories.add(A7); - categories.add(A8); - categories.add(A9); - categories.add(A10); + private String category; + + private Integer ranking; + + static + { + categories.add(UNVALIDATED_PARAMETERS); + categories.add(ACCESS_CONTROL); + categories.add(AUTHENTICATION); + categories.add(SESSION_MANAGEMENT); + categories.add(XSS); + categories.add(BUFFER_OVERFLOW); + categories.add(INJECTION); + categories.add(ERROR_HANDLING); + categories.add(INSECURE_STORAGE); + categories.add(DOS); + categories.add(INSECURE_CONFIGURATION); categories.add(WEB_SERVICES); categories.add(AJAX_SECURITY); categories.add(ADMIN_FUNCTIONS); categories.add(GENERAL); categories.add(CODE_QUALITY); categories.add(CHALLENGE); - } - - public static synchronized void addCategory(Category c) { - categories.add(c); - } - - public static synchronized Category getCategory(String name) { - Iterator it = categories.iterator(); - while (it.hasNext()) { - Category c = it.next(); - if (c.getName().equals(name)) - return c; - } - return null; - } - - public Category(String category, Integer ranking) - { - this.category = category; - this.ranking = ranking; - } - - public int compareTo(Object obj) - { - int value = 1; - - if (obj instanceof Category) - { - value = this.getRanking().compareTo(((Category) obj).getRanking()); } - return value; - } + public static synchronized void addCategory(Category c) + { + categories.add(c); + } + public static synchronized Category getCategory(String name) + { + Iterator it = categories.iterator(); + while (it.hasNext()) + { + Category c = it.next(); + if (c.getName().equals(name)) return c; + } + return null; + } - public Integer getRanking() - { - return ranking; - } + public Category(String category, Integer ranking) + { + this.category = category; + this.ranking = ranking; + } + public int compareTo(Object obj) + { + int value = 1; - public Integer setRanking(Integer ranking) - { - return this.ranking = ranking; - } + if (obj instanceof Category) + { + value = this.getRanking().compareTo(((Category) obj).getRanking()); + } + return value; + } - public String getName() - { - return category; - } + public Integer getRanking() + { + return ranking; + } + public Integer setRanking(Integer ranking) + { + return this.ranking = ranking; + } - public boolean equals(Object obj) - { - return (obj instanceof Category) && getName().equals(((Category) obj).getName()); - } + public String getName() + { + return category; + } + public boolean equals(Object obj) + { + return (obj instanceof Category) && getName().equals(((Category) obj).getName()); + } - public String toString() - { - return getName(); - } + public String toString() + { + return getName(); + } } \ No newline at end of file diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CommandInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CommandInjection.java index d2a2c8328..0fd458fd7 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CommandInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CommandInjection.java @@ -294,7 +294,7 @@ public class CommandInjection extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } @@ -348,6 +348,6 @@ public class CommandInjection extends LessonAdapter */ public String getTitle() { - return "How to Perform Command Injection"; + return "Command Injection"; } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CrossSiteScripting/CrossSiteScripting.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CrossSiteScripting/CrossSiteScripting.java index cc394ba60..dae791243 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CrossSiteScripting/CrossSiteScripting.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/CrossSiteScripting/CrossSiteScripting.java @@ -94,7 +94,7 @@ public class CrossSiteScripting extends GoatHillsFinancial */ public Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } /** diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBCrossSiteScripting/DBCrossSiteScripting.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBCrossSiteScripting/DBCrossSiteScripting.java index 5c149c70c..7c7494025 100755 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBCrossSiteScripting/DBCrossSiteScripting.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBCrossSiteScripting/DBCrossSiteScripting.java @@ -88,7 +88,7 @@ public class DBCrossSiteScripting extends GoatHillsFinancial */ public Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } /** diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBSQLInjection/DBSQLInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBSQLInjection/DBSQLInjection.java index e8ccedb4f..fdb94a858 100755 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBSQLInjection/DBSQLInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DBSQLInjection/DBSQLInjection.java @@ -89,7 +89,7 @@ public class DBSQLInjection extends GoatHillsFinancial */ public Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } /** diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DOS_Login.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DOS_Login.java index 3d6c80344..3e465fc79 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DOS_Login.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DOS_Login.java @@ -190,7 +190,7 @@ public class DOS_Login extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A9; + return Category.DOS; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Encoding.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Encoding.java index 6fe5333c6..8b9d98411 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Encoding.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Encoding.java @@ -405,7 +405,7 @@ public class Encoding extends LessonAdapter protected Category getDefaultCategory() { - return Category.A8; + return Category.INSECURE_STORAGE; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/FailOpenAuthentication.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/FailOpenAuthentication.java index e8ab424a8..d3d703804 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/FailOpenAuthentication.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/FailOpenAuthentication.java @@ -133,7 +133,7 @@ public class FailOpenAuthentication extends WeakAuthenticationCookie */ public Category getDefaultCategory() { - return Category.A7; + return Category.ERROR_HANDLING; } @@ -183,7 +183,7 @@ public class FailOpenAuthentication extends WeakAuthenticationCookie */ public String getTitle() { - return ("How to Bypass a Fail Open Authentication Scheme"); + return ("Fail Open Authentication Scheme"); } public Element getCredits() diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForcedBrowsing.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForcedBrowsing.java index fa6993d2c..c457b097b 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForcedBrowsing.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForcedBrowsing.java @@ -107,7 +107,7 @@ public class ForcedBrowsing extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A10; + return Category.INSECURE_CONFIGURATION; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForgotPassword.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForgotPassword.java index 7b1216f87..6d2bee5ca 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForgotPassword.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ForgotPassword.java @@ -290,7 +290,7 @@ public class ForgotPassword extends LessonAdapter protected Category getDefaultCategory() { - return Category.A3; + return Category.AUTHENTICATION; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HiddenFieldTampering.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HiddenFieldTampering.java index 97c4c20f7..55f0c15ef 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HiddenFieldTampering.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HiddenFieldTampering.java @@ -176,7 +176,7 @@ public class HiddenFieldTampering extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A1; + return Category.UNVALIDATED_PARAMETERS; } @@ -228,7 +228,7 @@ public class HiddenFieldTampering extends LessonAdapter */ public String getTitle() { - return ("How to Exploit Hidden Fields"); + return ("Exploit Hidden Fields"); } public Element getCredits() diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HtmlClues.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HtmlClues.java index 814203747..a18af7a8f 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HtmlClues.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HtmlClues.java @@ -250,7 +250,7 @@ public class HtmlClues extends LessonAdapter */ public String getTitle() { - return ("How to Discover Clues in the HTML"); + return ("Discover Clues in the HTML"); } public Element getCredits() diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpBasics.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpBasics.java index e31ba0406..9a96b453b 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpBasics.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpBasics.java @@ -99,6 +99,7 @@ public class HttpBasics extends LessonAdapter hints.add("Type in your name and press 'go'"); hints.add("Turn on Show Parameters or other features"); hints.add("Press the Show Lesson Plan button to view a lesson summary"); + hints.add("Press the Show Solution button to view a lesson solution"); return hints; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpOnly.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpOnly.java index b98a15d4d..a28ea80db 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpOnly.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/HttpOnly.java @@ -149,7 +149,7 @@ public class HttpOnly extends LessonAdapter { */ protected Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java index 5920131e0..90fd63c6d 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JSONInjection.java @@ -100,7 +100,7 @@ public class JSONInjection extends LessonAdapter Form form = new Form(getFormAction(), Form.POST).setName("form") .setEncType(""); - form.setOnSubmit("check();"); + form.setOnSubmit("return check();"); form.addElement(createContent(s)); @@ -127,13 +127,13 @@ public class JSONInjection extends LessonAdapter + TRAVEL_FROM + "');" + lineSep - + "if (fromField.value.length < 3 ) { return; }" + + "if (fromField.value.length < 3 || fromField.value!='BOS') { return; }" + lineSep + "var toField = document.getElementById('" + TRAVEL_TO + "');" + lineSep - + "if (toField.value.length < 3 ) { return; }" + + "if (toField.value.length < 3 || toField.value!='SEA') { return; }" + lineSep + "var url = '" + getLink() + "&from=ajax&" @@ -183,7 +183,7 @@ public class JSONInjection extends LessonAdapter + lineSep + " var node = card.flights[i];" + lineSep - + " strHTML = strHTML + '';" + + " strHTML = strHTML + '';" + lineSep + " strHTML = strHTML + card.flights[i].stops + '';" + lineSep @@ -205,13 +205,13 @@ public class JSONInjection extends LessonAdapter + lineSep + " if ( document.getElementById('radio0').checked )" + lineSep - + " { document.getElementById('price2Submit').value = document.getElementById('priceID0').innerText; }" + + " { document.getElementById('price2Submit').value = document.getElementById('priceID0').innerHTML; return true;}" + lineSep + " else if ( document.getElementById('radio1').checked )" + lineSep - + " { document.getElementById('price2Submit').value = document.getElementById('priceID1').innerText; }" + + " { document.getElementById('price2Submit').value = document.getElementById('priceID1').innerHTML; return true;}" + lineSep + " else " + lineSep - + " { alert('Please choose one flight'); }" + lineSep + "}" + + " { alert('Please choose one flight'); return false;}" + lineSep + "}" + lineSep + "" + lineSep; ec.addElement(new StringElement(script)); Table t1 = new Table().setCellSpacing(0).setCellPadding(0).setBorder(0) @@ -222,6 +222,7 @@ public class JSONInjection extends LessonAdapter tr.addElement(new TD("From: ")); Input in = new Input(Input.TEXT, TRAVEL_FROM, ""); in.addAttribute("onkeyup", "getFlights();"); + in.addAttribute("id", TRAVEL_FROM); tr.addElement(new TD(in)); t1.addElement(tr); @@ -230,6 +231,7 @@ public class JSONInjection extends LessonAdapter tr.addElement(new TD("To: ")); in = new Input(Input.TEXT, TRAVEL_TO, ""); in.addAttribute("onkeyup", "getFlights();"); + in.addAttribute("id", TRAVEL_TO); tr.addElement(new TD(in)); t1.addElement(tr); @@ -251,12 +253,13 @@ public class JSONInjection extends LessonAdapter Input price2Submit = new Input(); price2Submit.setType(Input.HIDDEN); price2Submit.setName("price2Submit"); + price2Submit.setValue(""); + price2Submit.addAttribute("id", "price2Submit"); ec.addElement(price2Submit); if (s.getParser().getRawParameter("radio0", "").equals("on")) { String price = s.getParser().getRawParameter("price2Submit", ""); price = price.replace("$", ""); - if (Integer.parseInt(price) < 600) { makeSuccess(s); @@ -272,7 +275,7 @@ public class JSONInjection extends LessonAdapter public Element getCredits() { - return super.getCustomCredits("Created by Sherif Koussa ", MAC_LOGO); + return super.getCustomCredits("Created by Sherif Koussa", MAC_LOGO); } protected Category getDefaultCategory() diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JavaScriptValidation.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JavaScriptValidation.java index 0640e3f51..84fad2cbd 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JavaScriptValidation.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/JavaScriptValidation.java @@ -270,7 +270,7 @@ public class JavaScriptValidation extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A1; + return Category.UNVALIDATED_PARAMETERS; } @@ -323,7 +323,7 @@ public class JavaScriptValidation extends LessonAdapter */ public String getTitle() { - return ("How to Bypass Client Side JavaScript Validation"); + return ("Bypass Client Side JavaScript Validation"); } public Element getCredits() diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/LogSpoofing.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/LogSpoofing.java index b299d9c02..13081b3af 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/LogSpoofing.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/LogSpoofing.java @@ -156,14 +156,14 @@ public class LogSpoofing extends LessonAdapter @Override public String getTitle() { - return "How to Perform Log Spoofing"; + return "Log Spoofing"; } @Override protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/NewLesson.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/NewLesson.java index a8d002f5b..978148880 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/NewLesson.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/NewLesson.java @@ -79,7 +79,7 @@ public class NewLesson extends LessonAdapter */ public String getTitle() { - return ("How to add a new WebGoat lesson"); + return ("Create a WebGoat Lesson"); } public Element getCredits() diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/PathBasedAccessControl.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/PathBasedAccessControl.java index 6677f0b38..2ee358c52 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/PathBasedAccessControl.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/PathBasedAccessControl.java @@ -46,258 +46,236 @@ import org.owasp.webgoat.session.WebSession; * for free software projects. * * For details, please see http://code.google.com/p/webgoat/ - * - * @author Bruce Mayhew WebGoat - * @created October 28, 2003 + * + * @author Bruce Mayhew WebGoat + * @created October 28, 2003 */ public class PathBasedAccessControl extends LessonAdapter { - private final static String FILE = "File"; + private final static String FILE = "File"; - - /** - * Description of the Method - * - * @param s Description of the Parameter - * @return Description of the Return Value - */ - protected Element createContent(WebSession s) - { - ElementContainer ec = new ElementContainer(); - - try + /** + * Description of the Method + * + * @param s + * Description of the Parameter + * @return Description of the Return Value + */ + protected Element createContent(WebSession s) { - String dir = s.getContext().getRealPath("/lesson_plans"); - File d = new File(dir); - - Table t = new Table().setCellSpacing(0).setCellPadding(2).setWidth( - "90%").setAlign("center"); - - if (s.isColor()) - { - t.setBorder(1); - } - - String[] list = d.list(); - String listing = "

Current Directory is: " - + Encoding.urlDecode(dir) - + "

Choose the file to view:

"; - - TR tr = new TR(); - tr.addElement(new TD().setColSpan(2).addElement( - new StringElement(listing))); - t.addElement(tr); - - tr = new TR(); - tr.addElement(new TD().setWidth("35%").addElement( - ECSFactory.makePulldown(FILE, list, "", 15))); - tr.addElement(new TD().addElement(ECSFactory - .makeButton("View File"))); - t.addElement(tr); - - ec.addElement(t); - - // FIXME: would be cool to allow encodings here -- hex, percent, url, etc... - String file = s.getParser().getRawParameter(FILE, ""); - - // defuse file searching - boolean illegalCommand = getWebgoatContext().isDefuseOSCommands(); - if (getWebgoatContext().isDefuseOSCommands()) - { - // allow them to look at any file in the webgoat hierachy. Don't allow them - // to look about the webgoat root, except to see the LICENSE file - if (upDirCount(file) == 3 && !file.endsWith("LICENSE")) - { - s.setMessage("Access denied"); - s - .setMessage("It appears that you are on the right track. " - + "Commands that may compromise the operating system have been disabled. " - + "You are only allowed to see one file in this directory. ");; - } - else if (upDirCount(file) > 3) - { - s.setMessage("Access denied"); - s - .setMessage("It appears that you are on the right track. " - + "Commands that may compromise the operating system have been disabled. " - + "You are only allowed to see files in the webgoat directory. "); - } - else - { - illegalCommand = false; - } - } - - // Using the URI supports encoding of the data. - // We could force the user to use encoded '/'s == %2f to make the lesson more difficult. - // We url Encode our dir name to avoid problems with special characters in our own path. - //File f = new File( new URI("file:///" + Encoding.urlEncode(dir).replaceAll("\\\\","/") + "/" + file.replaceAll("\\\\","/")) ); - File f = new File((dir + "\\" + file).replaceAll("\\\\", "/")); - - if (s.isDebug()) - { - - s.setMessage("File: " + file); - s.setMessage("Dir: " + dir); - //s.setMessage("File URI: " + "file:///" + (Encoding.urlEncode(dir) + "\\" + Encoding.urlEncode(file)).replaceAll("\\\\","/")); - s.setMessage(" - isFile(): " + f.isFile()); - s.setMessage(" - exists(): " + f.exists()); - } - if (!illegalCommand) - { - if (f.isFile() && f.exists()) - { - // Don't set completion if they are listing files in the - // directory listing we gave them. - if (upDirCount(file) >= 1) - { - s.setMessage("Congratulations! Access to file allowed"); - s.setMessage(" ==> " - + Encoding.urlDecode(f.getCanonicalPath())); - makeSuccess(s); - } - else - { - s - .setMessage("File is already in allowed directory - try again!"); - s.setMessage(" ==> " - + Encoding.urlDecode(f.getCanonicalPath())); - } - } - else if (file != null && file.length() != 0) - { - s.setMessage("Access to file/directory \"" - + Encoding.urlDecode(f.getCanonicalPath()) - + "\" denied"); - } - else - { - // do nothing, probably entry screen - } + ElementContainer ec = new ElementContainer(); try { - // Show them the file - // Strip out some of the extra html from the "help" file - ec.addElement(new BR()); - ec.addElement(new BR()); - ec.addElement(new HR().setWidth("100%")); - ec.addElement("Viewing file: " + f.getCanonicalPath()); - ec.addElement(new HR().setWidth("100%")); - if (f.length() > 80000) - { - throw new Exception("File is too large"); - } - String fileData = getFileText(new BufferedReader( - new FileReader(f)), false); - if (fileData.indexOf(0x00) != -1) - { - throw new Exception("File is binary"); - } - ec.addElement(new StringElement(fileData.replaceAll( - System.getProperty("line.separator"), "
") - .replaceAll("(?s)", "") - .replaceAll("

", "
").replaceAll( - "
\\s
", "
").replaceAll("<\\?", - "<").replaceAll("<(r|u|t)", "<$1"))); + String dir = s.getContext().getRealPath("/lesson_plans"); + File d = new File(dir); + + Table t = new Table().setCellSpacing(0).setCellPadding(2).setWidth("90%").setAlign("center"); + + if (s.isColor()) + { + t.setBorder(1); + } + + String[] list = d.list(); + String listing = "

Current Directory is: " + Encoding.urlDecode(dir) + + "

Choose the file to view:

"; + + TR tr = new TR(); + tr.addElement(new TD().setColSpan(2).addElement(new StringElement(listing))); + t.addElement(tr); + + tr = new TR(); + tr.addElement(new TD().setWidth("35%").addElement(ECSFactory.makePulldown(FILE, list, "", 15))); + tr.addElement(new TD().addElement(ECSFactory.makeButton("View File"))); + t.addElement(tr); + + ec.addElement(t); + + // FIXME: would be cool to allow encodings here -- hex, percent, + // url, etc... + String file = s.getParser().getRawParameter(FILE, ""); + + // defuse file searching + boolean illegalCommand = getWebgoatContext().isDefuseOSCommands(); + if (getWebgoatContext().isDefuseOSCommands()) + { + // allow them to look at any file in the webgoat hierachy. Don't + // allow them + // to look about the webgoat root, except to see the LICENSE + // file + if (upDirCount(file) == 3 && !file.endsWith("LICENSE")) + { + s.setMessage("Access denied"); + s.setMessage("It appears that you are on the right track. " + + "Commands that may compromise the operating system have been disabled. " + + "You are only allowed to see one file in this directory. "); + } else if (upDirCount(file) > 3) + { + s.setMessage("Access denied"); + s.setMessage("It appears that you are on the right track. " + + "Commands that may compromise the operating system have been disabled. " + + "You are only allowed to see files in the webgoat directory. "); + } else + { + illegalCommand = false; + } + } + + // Using the URI supports encoding of the data. + // We could force the user to use encoded '/'s == %2f to make the lesson more difficult. + // We url Encode our dir name to avoid problems with special characters in our own path. + // File f = new File( new URI("file:///" + + // Encoding.urlEncode(dir).replaceAll("\\\\","/") + "/" + + // file.replaceAll("\\\\","/")) ); + File f = new File((dir + "\\" + file).replaceAll("\\\\", "/")); + + if (s.isDebug()) + { + + s.setMessage("File: " + file); + s.setMessage("Dir: " + dir); + // s.setMessage("File URI: " + "file:///" + + // (Encoding.urlEncode(dir) + "\\" + + // Encoding.urlEncode(file)).replaceAll("\\\\","/")); + s.setMessage(" - isFile(): " + f.isFile()); + s.setMessage(" - exists(): " + f.exists()); + } + if (!illegalCommand) + { + if (f.isFile() && f.exists()) + { + // Don't set completion if they are listing files in the + // directory listing we gave them. + if (upDirCount(file) >= 1) + { + s.setMessage("Congratulations! Access to file allowed"); + s.setMessage(" ==> " + Encoding.urlDecode(f.getCanonicalPath())); + makeSuccess(s); + } else + { + s.setMessage("File is already in allowed directory - try again!"); + s.setMessage(" ==> " + Encoding.urlDecode(f.getCanonicalPath())); + } + } else if (file != null && file.length() != 0) + { + s.setMessage("Access to file/directory \"" + Encoding.urlDecode(f.getCanonicalPath()) + + "\" denied"); + } else + { + // do nothing, probably entry screen + } + + try + { + // Show them the file + // Strip out some of the extra html from the "help" file + ec.addElement(new BR()); + ec.addElement(new BR()); + ec.addElement(new HR().setWidth("100%")); + ec.addElement("Viewing file: " + f.getCanonicalPath()); + ec.addElement(new HR().setWidth("100%")); + if (f.length() > 80000) + { + throw new Exception("File is too large"); + } + String fileData = getFileText(new BufferedReader(new FileReader(f)), false); + if (fileData.indexOf(0x00) != -1) + { + throw new Exception("File is binary"); + } + ec + .addElement(new StringElement(fileData.replaceAll(System.getProperty("line.separator"), + "
").replaceAll("(?s)", "").replaceAll("

", "
") + .replaceAll("
\\s
", "
").replaceAll("<\\?", "<").replaceAll( + "<(r|u|t)", "<$1"))); + } + catch (Exception e) + { + ec.addElement(new BR()); + ec.addElement("The following error occurred while accessing the file: <"); + ec.addElement(e.getMessage()); + } + } } catch (Exception e) { - ec.addElement(new BR()); - ec - .addElement("The following error occurred while accessing the file: <"); - ec.addElement(e.getMessage()); + s.setMessage("Error generating " + this.getClass().getName()); + e.printStackTrace(); } - } + + return (ec); } - catch (Exception e) + + private int upDirCount(String fileName) { - s.setMessage("Error generating " + this.getClass().getName()); - e.printStackTrace(); + int count = 0; + int startIndex = fileName.indexOf(".."); + while (startIndex != -1) + { + count++; + startIndex = fileName.indexOf("..", startIndex + 1); + } + return count; } - return (ec); - } - - - private int upDirCount(String fileName) - { - int count = 0; - int startIndex = fileName.indexOf(".."); - while (startIndex != -1) + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + protected Category getDefaultCategory() { - count++; - startIndex = fileName.indexOf("..", startIndex + 1); + return Category.ACCESS_CONTROL; } - return count; - } + /** + * Gets the hints attribute of the AccessControlScreen object + * + * @return The hints value + */ + protected List getHints(WebSession s) + { + List hints = new ArrayList(); + hints.add("Most operating systems allow special characters in the path."); + hints.add("Use a file explorer to find the tomcat\\webapps\\WebGoat\\lesson_plans directory"); + hints.add("Try .. in the path"); + hints.add("Try ..\\..\\..\\LICENSE"); - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - protected Category getDefaultCategory() - { - return Category.A2; - } + return hints; + } + /** + * Gets the instructions attribute of the WeakAccessControl object + * + * @return The instructions value + */ + public String getInstructions(WebSession s) + { + String instructions = "The '" + s.getUserName() + "' user has access to all the files in the " + + "lesson_plans directory. Try to break the access control mechanism and access a " + + "resource that is not in the listed directory. After selecting a file to view, WebGoat " + + "will report if access to the file was granted. An interesting file to try and obtain might " + + "be a file like tomcat/conf/tomcat-users.xml"; - /** - * Gets the hints attribute of the AccessControlScreen object - * - * @return The hints value - */ - protected List getHints(WebSession s) - { - List hints = new ArrayList(); - hints - .add("Most operating systems allow special characters in the path."); - hints - .add("Use a file explorer to find the tomcat\\webapps\\WebGoat\\lesson_plans directory"); - hints.add("Try .. in the path"); - hints.add("Try ..\\..\\..\\LICENSE"); + return (instructions); + } - return hints; - } + private final static Integer DEFAULT_RANKING = new Integer(115); + protected Integer getDefaultRanking() + { + return DEFAULT_RANKING; + } - /** - * Gets the instructions attribute of the WeakAccessControl object - * - * @return The instructions value - */ - public String getInstructions(WebSession s) - { - String instructions = "The '" - + s.getUserName() - + "' user has access to all the files in the " - + "lesson_plans directory. Try to break the access control mechanism and access a " - + "resource that is not in the listed directory. After selecting a file to view, WebGoat " - + "will report if access to the file was granted. An interesting file to try and obtain might " - + "be a file like tomcat/conf/tomcat-users.xml"; - - return (instructions); - } - - private final static Integer DEFAULT_RANKING = new Integer(115); - - - protected Integer getDefaultRanking() - { - return DEFAULT_RANKING; - } - - - /** - * Gets the title attribute of the AccessControlScreen object - * - * @return The title value - */ - public String getTitle() - { - return ("How to Bypass a Path Based Access Control Scheme"); - } + /** + * Gets the title attribute of the AccessControlScreen object + * + * @return The title value + */ + public String getTitle() + { + return ("Bypass a Path Based Access Control Scheme"); + } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Phishing.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Phishing.java index d4ecb1e06..a9d1d2eae 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Phishing.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/Phishing.java @@ -265,7 +265,7 @@ public class Phishing extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ReflectedXSS.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ReflectedXSS.java index a7bec094b..3e3bb3ee8 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ReflectedXSS.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ReflectedXSS.java @@ -231,7 +231,7 @@ public class ReflectedXSS extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } @@ -288,7 +288,7 @@ public class ReflectedXSS extends LessonAdapter */ public String getTitle() { - return "How to Perform Reflected Cross Site Scripting (XSS) Attacks"; + return "Reflected XSS Attacks"; } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RemoteAdminFlaw.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RemoteAdminFlaw.java index 7bae6d0fd..2d673d925 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RemoteAdminFlaw.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RemoteAdminFlaw.java @@ -73,7 +73,7 @@ public class RemoteAdminFlaw extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A2; + return Category.ACCESS_CONTROL; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RoleBasedAccessControl/RoleBasedAccessControl.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RoleBasedAccessControl/RoleBasedAccessControl.java index 3c7098848..089fb3359 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RoleBasedAccessControl/RoleBasedAccessControl.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/RoleBasedAccessControl/RoleBasedAccessControl.java @@ -87,7 +87,7 @@ public class RoleBasedAccessControl extends GoatHillsFinancial */ public Category getDefaultCategory() { - return Category.A2; + return Category.ACCESS_CONTROL; } /** diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SQLInjection/SQLInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SQLInjection/SQLInjection.java index 4f6210f77..2eefe6f13 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SQLInjection/SQLInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SQLInjection/SQLInjection.java @@ -91,7 +91,7 @@ public class SQLInjection extends GoatHillsFinancial */ public Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } /** diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SilentTransactions.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SilentTransactions.java index 1e82528fb..ecb983b4e 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SilentTransactions.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SilentTransactions.java @@ -161,7 +161,7 @@ public class SilentTransactions extends LessonAdapter + lineSep + "}" + lineSep - + " var balanceValue = document.getElementById('balanceID').innerText;" + + " var balanceValue = document.getElementById('balanceID').innerHTML;" + lineSep + " balanceValue = balanceValue.replace( new RegExp('$') , '');" + lineSep @@ -183,7 +183,7 @@ public class SilentTransactions extends LessonAdapter + lineSep + "balanceValue = balanceValue.toFixed(2);" + lineSep - + "document.getElementById('balanceID').innerText = balanceValue + '$';" + + "document.getElementById('balanceID').innerHTML = balanceValue + '$';" + lineSep + "}" + lineSep @@ -225,6 +225,7 @@ public class SilentTransactions extends LessonAdapter tr = new TR(); tr.addElement(new TD(new StringElement("Transfer to Account:"))); Input newAccount = new Input(); + newAccount.addAttribute("id", "newAccount"); newAccount.setType(Input.TEXT); newAccount.setName("newAccount"); newAccount.setValue(""); @@ -234,6 +235,7 @@ public class SilentTransactions extends LessonAdapter tr = new TR(); tr.addElement(new TD(new StringElement("Transfer Amount:"))); Input amount = new Input(); + amount.addAttribute("id", "amount"); amount.setType(Input.TEXT); amount.setName("amount"); amount.setValue(0); @@ -248,6 +250,7 @@ public class SilentTransactions extends LessonAdapter Input b = new Input(); b.setType(Input.BUTTON); b.setName("confirm"); + b.addAttribute("id", "confirm"); b.setValue("Confirm"); b.setOnClick("processData();"); ec.addElement(b); diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SoapRequest.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SoapRequest.java index 906272639..c9b6b0616 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SoapRequest.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SoapRequest.java @@ -173,7 +173,7 @@ public class SoapRequest extends SequentialLessonAdapter public String getTitle() { - return "How to Create a SOAP Request"; + return "Create a SOAP Request"; } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlNumericInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlNumericInjection.java index 3c7d000e0..4e3c682c9 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlNumericInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlNumericInjection.java @@ -333,7 +333,7 @@ public class SqlNumericInjection extends SequentialLessonAdapter */ protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } @@ -374,7 +374,7 @@ public class SqlNumericInjection extends SequentialLessonAdapter */ public String getTitle() { - return ("How to Perform Numeric SQL Injection"); + return ("Numeric SQL Injection"); } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlStringInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlStringInjection.java index 24d45d39b..a48e3a8c3 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlStringInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/SqlStringInjection.java @@ -249,7 +249,7 @@ public class SqlStringInjection extends SequentialLessonAdapter */ protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } @@ -290,7 +290,7 @@ public class SqlStringInjection extends SequentialLessonAdapter */ public String getTitle() { - return ("How to Perform String SQL Injection"); + return ("String SQL Injection"); } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/StoredXss.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/StoredXss.java index d85c1931f..f5d75c112 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/StoredXss.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/StoredXss.java @@ -151,7 +151,7 @@ public class StoredXss extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } @@ -190,7 +190,7 @@ public class StoredXss extends LessonAdapter */ public String getTitle() { - return ("How to Perform Stored Cross Site Scripting (XSS)"); + return ("Stored XSS Attacks"); } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ThreadSafetyProblem.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ThreadSafetyProblem.java index ee6edc9b8..efb70a310 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ThreadSafetyProblem.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/ThreadSafetyProblem.java @@ -191,7 +191,7 @@ public class ThreadSafetyProblem extends LessonAdapter */ public String getTitle() { - return ("How to Exploit Thread Safety Problems"); + return ("Thread Safety Problems"); } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/TraceXSS.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/TraceXSS.java index e11078408..e8e569b78 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/TraceXSS.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/TraceXSS.java @@ -233,7 +233,7 @@ public class TraceXSS extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A4; + return Category.XSS; } @@ -281,6 +281,6 @@ public class TraceXSS extends LessonAdapter */ public String getTitle() { - return ("How to Perform Cross Site Tracing (XST) Attacks"); + return ("Cross Site Tracing (XST) Attacks"); } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/UncheckedEmail.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/UncheckedEmail.java index 91bbe9218..191be15ea 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/UncheckedEmail.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/UncheckedEmail.java @@ -204,7 +204,7 @@ public class UncheckedEmail extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A1; + return Category.UNVALIDATED_PARAMETERS; } @@ -257,7 +257,7 @@ public class UncheckedEmail extends LessonAdapter */ public String getTitle() { - return ("How to Exploit Unchecked Email"); + return ("Exploit Unchecked Email"); } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakAuthenticationCookie.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakAuthenticationCookie.java index 3a9e02ccd..02c673db6 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakAuthenticationCookie.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakAuthenticationCookie.java @@ -46,347 +46,338 @@ import org.owasp.webgoat.session.*; * for free software projects. * * For details, please see http://code.google.com/p/webgoat/ - * - * @author Jeff Williams Aspect Security - * @created October 28, 2003 + * + * @author Jeff Williams Aspect Security + * @created October 28, 2003 */ public class WeakAuthenticationCookie extends LessonAdapter { - public final static A ASPECT_LOGO = new A().setHref("http://www.aspectsecurity.com").addElement(new IMG("images/logos/aspect.jpg").setAlt("Aspect Security").setBorder(0).setHspace(0).setVspace(0)); - - /** - * Description of the Field - */ - protected final static String AUTHCOOKIE = "AuthCookie"; + public final static A ASPECT_LOGO = new A().setHref("http://www.aspectsecurity.com").addElement( + new IMG("images/logos/aspect.jpg").setAlt("Aspect Security").setBorder(0).setHspace(0).setVspace(0)); - /** - * Description of the Field - */ - protected final static String LOGOUT = "WACLogout"; + /** + * Description of the Field + */ + protected final static String AUTHCOOKIE = "AuthCookie"; - /** - * Description of the Field - */ - protected final static String PASSWORD = "Password"; + /** + * Description of the Field + */ + protected final static String LOGOUT = "WACLogout"; - /** - * Description of the Field - */ - protected final static String USERNAME = "Username"; + /** + * Description of the Field + */ + protected final static String PASSWORD = "Password"; + /** + * Description of the Field + */ + protected final static String USERNAME = "Username"; - /** - * Description of the Method - * - * @param s Description of the Parameter - * @return Description of the Return Value - * @exception Exception Description of the Exception - */ - protected String checkCookie(WebSession s) throws Exception - { - String cookie = getCookie(s); - - if (cookie != null) + /** + * Description of the Method + * + * @param s + * Description of the Parameter + * @return Description of the Return Value + * @exception Exception + * Description of the Exception + */ + protected String checkCookie(WebSession s) throws Exception { - if (cookie.equals(encode("webgoat12345"))) - { - return ("webgoat"); - } + String cookie = getCookie(s); - if (cookie.equals(encode("aspect12345"))) - { - return ("aspect"); - } + if (cookie != null) + { + if (cookie.equals(encode("webgoat12345"))) + { + return ("webgoat"); + } - if (cookie.equals(encode("alice12345"))) - { - makeSuccess(s); - return ("alice"); - } - else - { - s.setMessage("Invalid cookie"); - s.eatCookies(); - } + if (cookie.equals(encode("aspect12345"))) + { + return ("aspect"); + } + + if (cookie.equals(encode("alice12345"))) + { + makeSuccess(s); + return ("alice"); + } else + { + s.setMessage("Invalid cookie"); + s.eatCookies(); + } + } + + return (null); } - return (null); - } - - - /** - * Description of the Method - * - * @param s Description of the Parameter - * @return Description of the Return Value - * @exception Exception Description of the Exception - */ - protected String checkParams(WebSession s) throws Exception - { - String username = s.getParser().getStringParameter(USERNAME, ""); - String password = s.getParser().getStringParameter(PASSWORD, ""); - - if ((username.length() > 0) && (password.length() > 0)) + /** + * Description of the Method + * + * @param s + * Description of the Parameter + * @return Description of the Return Value + * @exception Exception + * Description of the Exception + */ + protected String checkParams(WebSession s) throws Exception { - String loginID = ""; + String username = s.getParser().getStringParameter(USERNAME, ""); + String password = s.getParser().getStringParameter(PASSWORD, ""); - if (username.equals("webgoat") && password.equals("webgoat")) - { - loginID = encode("webgoat12345"); - } - else if (username.equals("aspect") && password.equals("aspect")) - { - loginID = encode("aspect12345"); - } + if ((username.length() > 0) && (password.length() > 0)) + { + String loginID = ""; - if (loginID != "") - { - Cookie newCookie = new Cookie(AUTHCOOKIE, loginID); - s.setMessage("Your identity has been remembered"); - s.getResponse().addCookie(newCookie); + if (username.equals("webgoat") && password.equals("webgoat")) + { + loginID = encode("webgoat12345"); + } else if (username.equals("aspect") && password.equals("aspect")) + { + loginID = encode("aspect12345"); + } - return (username); - } - else - { - s.setMessage("Invalid username and password entered."); - } + if (loginID != "") + { + Cookie newCookie = new Cookie(AUTHCOOKIE, loginID); + s.setMessage("Your identity has been remembered"); + s.getResponse().addCookie(newCookie); + + return (username); + } else + { + s.setMessage("Invalid username and password entered."); + } + } + + return (null); } - return (null); - } - - - /** - * Description of the Method - * - * @param s Description of the Parameter - * @return Description of the Return Value - */ - protected Element createContent(WebSession s) - { - boolean logout = s.getParser().getBooleanParameter(LOGOUT, false); - - if (logout) + /** + * Description of the Method + * + * @param s + * Description of the Parameter + * @return Description of the Return Value + */ + protected Element createContent(WebSession s) { - s.setMessage("Goodbye! Your password has been forgotten"); - s.eatCookies(); + boolean logout = s.getParser().getBooleanParameter(LOGOUT, false); - return (makeLogin(s)); + if (logout) + { + s.setMessage("Goodbye! Your password has been forgotten"); + s.eatCookies(); + + return (makeLogin(s)); + } + + try + { + String user = checkCookie(s); + + if ((user != null) && (user.length() > 0)) + { + return (makeUser(s, user, "COOKIE")); + } + + user = checkParams(s); + + if ((user != null) && (user.length() > 0)) + { + return (makeUser(s, user, "PARAMETERS")); + } + } + catch (Exception e) + { + s.setMessage("Error generating " + this.getClass().getName()); + e.printStackTrace(); + } + + return (makeLogin(s)); } - try + /** + * Description of the Method + * + * @param value + * Description of the Parameter + * @return Description of the Return Value + */ + private String encode(String value) { - String user = checkCookie(s); + // + StringBuffer encoded = new StringBuffer(); - if ((user != null) && (user.length() > 0)) - { - return (makeUser(s, user, "COOKIE")); - } + for (int i = 0; i < value.length(); i++) + { + encoded.append(String.valueOf((char) (value.charAt(i) + 1))); + } - user = checkParams(s); - - if ((user != null) && (user.length() > 0)) - { - return (makeUser(s, user, "PARAMETERS")); - } - } - catch (Exception e) - { - s.setMessage("Error generating " + this.getClass().getName()); - e.printStackTrace(); + return encoded.reverse().toString(); + // } - return (makeLogin(s)); - } - - - /** - * Description of the Method - * - * @param value Description of the Parameter - * @return Description of the Return Value - */ - private String encode(String value) - { - // - StringBuffer encoded = new StringBuffer(); - - for (int i = 0; i < value.length(); i++) + /** + * Gets the category attribute of the WeakAuthenticationCookie object + * + * @return The category value + */ + protected Category getDefaultCategory() { - encoded.append(String.valueOf((char) (value.charAt(i) + 1))); + return Category.AUTHENTICATION; } - return encoded.reverse().toString(); - // - } - - - /** - * Gets the category attribute of the WeakAuthenticationCookie object - * - * @return The category value - */ - protected Category getDefaultCategory() - { - return Category.A3; - } - - - /** - * Gets the cookie attribute of the CookieScreen object - * - * @param s Description of the Parameter - * @return The cookie value - */ - protected String getCookie(WebSession s) - { - Cookie[] cookies = s.getRequest().getCookies(); - - for (int i = 0; i < cookies.length; i++) + /** + * Gets the cookie attribute of the CookieScreen object + * + * @param s + * Description of the Parameter + * @return The cookie value + */ + protected String getCookie(WebSession s) { - if (cookies[i].getName().equalsIgnoreCase(AUTHCOOKIE)) - { - return (cookies[i].getValue()); - } + Cookie[] cookies = s.getRequest().getCookies(); + + for (int i = 0; i < cookies.length; i++) + { + if (cookies[i].getName().equalsIgnoreCase(AUTHCOOKIE)) + { + return (cookies[i].getValue()); + } + } + + return (null); } - return (null); - } - - - /** - * Gets the hints attribute of the CookieScreen object - * - * @return The hints value - */ - protected List getHints(WebSession s) - { - List hints = new ArrayList(); - hints - .add("The server skips authentication if you send the right cookie."); - hints - .add("Is the AuthCookie value guessable knowing the username and password?"); - hints - .add("Add 'AuthCookie=********;' to the Cookie: header using WebScarab."); - - return hints; - } - - - /** - * Gets the instructions attribute of the WeakAuthenticationCookie object - * - * @return The instructions value - */ - public String getInstructions(WebSession s) - { - String instructions = "Login using the webgoat/webgoat account to see what happens. You may also try aspect/aspect. When you understand the authentication cookie, try changing your identity to alice."; - - return (instructions); - } - - private final static Integer DEFAULT_RANKING = new Integer(90); - - - protected Integer getDefaultRanking() - { - return DEFAULT_RANKING; - } - - - /** - * Gets the title attribute of the CookieScreen object - * - * @return The title value - */ - public String getTitle() - { - return ("How to Spoof an Authentication Cookie"); - } - - - /** - * Description of the Method - * - * @param s Description of the Parameter - * @return Description of the Return Value - */ - protected Element makeLogin(WebSession s) - { - ElementContainer ec = new ElementContainer(); - - ec.addElement(new H1().addElement("Sign In ")); - Table t = new Table().setCellSpacing(0).setCellPadding(2).setBorder(0) - .setWidth("90%").setAlign("center"); - - if (s.isColor()) + /** + * Gets the hints attribute of the CookieScreen object + * + * @return The hints value + */ + protected List getHints(WebSession s) { - t.setBorder(1); + List hints = new ArrayList(); + hints.add("The server authenticates the user using a cookie, if you send the right cookie."); + hints.add("Is the AuthCookie value guessable knowing the username and password?"); + hints.add("Add 'AuthCookie=********;' to the Cookie: header using " + + "WebScarab."); + hints.add("After logging in as webgoat a cookie is added. 65432ubphcfx
" + + "After logging in as aspect a cookie is added. 65432udfqtb
" + + "Is there anything similar about the cookies and the login names?"); + return hints; } - TR tr = new TR(); - tr - .addElement(new TH() - .addElement( - "Please sign in to your account. See the OWASP admin if you do not have an account.") - .setColSpan(2).setAlign("left")); - t.addElement(tr); + /** + * Gets the instructions attribute of the WeakAuthenticationCookie object + * + * @return The instructions value + */ + public String getInstructions(WebSession s) + { + String instructions = "Login using the webgoat/webgoat account to see what happens. You may also try aspect/aspect. When you understand the authentication cookie, try changing your identity to alice."; - tr = new TR(); - tr.addElement(new TD().addElement("*Required Fields").setWidth("30%")); - t.addElement(tr); + return (instructions); + } - tr = new TR(); - tr.addElement(new TD().addElement(" ").setColSpan(2)); - t.addElement(tr); + private final static Integer DEFAULT_RANKING = new Integer(90); - TR row1 = new TR(); - TR row2 = new TR(); - row1.addElement(new TD(new B(new StringElement("*User Name: ")))); - row2.addElement(new TD(new B(new StringElement("*Password: ")))); + protected Integer getDefaultRanking() + { + return DEFAULT_RANKING; + } - Input input1 = new Input(Input.TEXT, USERNAME, ""); - Input input2 = new Input(Input.PASSWORD, PASSWORD, ""); - row1.addElement(new TD(input1)); - row2.addElement(new TD(input2)); - t.addElement(row1); - t.addElement(row2); + /** + * Gets the title attribute of the CookieScreen object + * + * @return The title value + */ + public String getTitle() + { + return ("Spoof an Authentication Cookie"); + } - Element b = ECSFactory.makeButton("Login"); - t.addElement(new TR(new TD(b))); - ec.addElement(t); + /** + * Description of the Method + * + * @param s + * Description of the Parameter + * @return Description of the Return Value + */ + protected Element makeLogin(WebSession s) + { + ElementContainer ec = new ElementContainer(); - return (ec); - } + ec.addElement(new H1().addElement("Sign In ")); + Table t = new Table().setCellSpacing(0).setCellPadding(2).setBorder(0).setWidth("90%").setAlign("center"); + if (s.isColor()) + { + t.setBorder(1); + } - /** - * Description of the Method - * - * @param s Description of the Parameter - * @param user Description of the Parameter - * @param method Description of the Parameter - * @return Description of the Return Value - * @exception Exception Description of the Exception - */ - protected Element makeUser(WebSession s, String user, String method) - throws Exception - { - ElementContainer ec = new ElementContainer(); - ec.addElement(new P().addElement("Welcome, " + user)); - ec.addElement(new P().addElement("You have been authenticated with " - + method)); - ec.addElement(new P().addElement(ECSFactory.makeLink("Logout", LOGOUT, - true))); - ec.addElement(new P() - .addElement(ECSFactory.makeLink("Refresh", "", ""))); + TR tr = new TR(); + tr.addElement(new TH().addElement( + "Please sign in to your account. See the OWASP admin if you do not have an account.").setColSpan(2) + .setAlign("left")); + t.addElement(tr); - return (ec); - } - - public Element getCredits() - { - return super.getCustomCredits("", ASPECT_LOGO); - } + tr = new TR(); + tr.addElement(new TD().addElement("*Required Fields").setWidth("30%")); + t.addElement(tr); + + tr = new TR(); + tr.addElement(new TD().addElement(" ").setColSpan(2)); + t.addElement(tr); + + TR row1 = new TR(); + TR row2 = new TR(); + row1.addElement(new TD(new B(new StringElement("*User Name: ")))); + row2.addElement(new TD(new B(new StringElement("*Password: ")))); + + Input input1 = new Input(Input.TEXT, USERNAME, ""); + Input input2 = new Input(Input.PASSWORD, PASSWORD, ""); + row1.addElement(new TD(input1)); + row2.addElement(new TD(input2)); + t.addElement(row1); + t.addElement(row2); + + Element b = ECSFactory.makeButton("Login"); + t.addElement(new TR(new TD(b))); + ec.addElement(t); + + return (ec); + } + + /** + * Description of the Method + * + * @param s + * Description of the Parameter + * @param user + * Description of the Parameter + * @param method + * Description of the Parameter + * @return Description of the Return Value + * @exception Exception + * Description of the Exception + */ + protected Element makeUser(WebSession s, String user, String method) throws Exception + { + ElementContainer ec = new ElementContainer(); + ec.addElement(new P().addElement("Welcome, " + user)); + ec.addElement(new P().addElement("You have been authenticated with " + method)); + ec.addElement(new P().addElement(ECSFactory.makeLink("Logout", LOGOUT, true))); + ec.addElement(new P().addElement(ECSFactory.makeLink("Refresh", "", ""))); + + return (ec); + } + + public Element getCredits() + { + return super.getCustomCredits("", ASPECT_LOGO); + } } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakSessionID.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakSessionID.java index 4847ecf49..b331e3bed 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakSessionID.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/WeakSessionID.java @@ -90,7 +90,7 @@ public class WeakSessionID extends LessonAdapter } - protected String newCookie() + protected String newCookie(WebSession s) { long now = System.currentTimeMillis(); seq++; @@ -98,6 +98,7 @@ public class WeakSessionID extends LessonAdapter { String target = encode(seq++, lastTime + (now - lastTime) / 2); sessionList.add(target); + s.setMessage(target); if (sessionList.size() > 100) sessionList.remove(0); } @@ -149,7 +150,7 @@ public class WeakSessionID extends LessonAdapter */ protected Category getDefaultCategory() { - return Category.A3; + return Category.SESSION_MANAGEMENT; } @@ -161,12 +162,11 @@ public class WeakSessionID extends LessonAdapter protected List getHints(WebSession s) { List hints = new ArrayList(); - hints - .add("The server skips authentication if you send the right cookie."); - hints - .add("Is the cookie value predictable? Can you see gaps where someone else has acquired a cookie?"); + hints.add("The server skips authentication if you send the right cookie."); + hints.add("Is the cookie value predictable? Can you see gaps where someone else has acquired a cookie?"); hints.add("Try harder, you brute!"); - + hints.add("The first part of the cookie is a sequential number, the second part is milliseconds."); + hints.add("After the 29th try, the skipped identifier is printed to your screen. Use that to login."); return hints; } @@ -186,7 +186,7 @@ public class WeakSessionID extends LessonAdapter */ public String getTitle() { - return ("How to Hijack a Session"); + return ("Hijack a Session"); } @@ -204,7 +204,7 @@ public class WeakSessionID extends LessonAdapter if (weakid == null) { - weakid = newCookie(); + weakid = newCookie(s); Cookie cookie = new Cookie(SESSIONID, weakid); s.getResponse().addCookie(cookie); } diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XMLInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XMLInjection.java index 76229d9d4..726365dc1 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XMLInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XMLInjection.java @@ -107,10 +107,10 @@ public class XMLInjection extends LessonAdapter { String lineSep = System.getProperty("line.separator"); String xmlStr = "" + lineSep - + "WebGoat t-shirt 20 Pts" + + "WebGoat Mug 20 Pts" + lineSep - + "WebGoat Secure Kettle 50 Pts" - + lineSep + "WebGoat Mug 30 Pts" + + "WebGoat t-shirt 50 Pts" + + lineSep + "WebGoat Secure Kettle 30 Pts" + lineSep + ""; s.getResponse().setContentType("text/xml"); s.getResponse().setHeader("Cache-Control", "no-cache"); @@ -188,7 +188,7 @@ public class XMLInjection extends LessonAdapter + lineSep + " if (req.status == 200) { " + lineSep - + " var rewards = req.responseXML.getElementsByTagName('root')[0];" + + " var rewards = req.responseXML.getElementsByTagName('reward');" + lineSep + " var rewardsDiv = document.getElementById('rewardsDiv');" + lineSep @@ -198,13 +198,13 @@ public class XMLInjection extends LessonAdapter + lineSep + " strHTML = ' Rewards';" + lineSep - + " for(var i=0; i< rewards.childNodes.length; i++){" - + lineSep - + " var node = rewards.childNodes[i];" + + " for(var i=0; i< rewards.length; i++){" + //+ lineSep + //+ " var node = rewards.childNodes[i+1];" + lineSep + " strHTML = strHTML + '';" + lineSep - + " strHTML = strHTML + node.childNodes[0].nodeValue + '';" + + " strHTML = strHTML + rewards[i].firstChild.nodeValue + '';" + lineSep + " }" + lineSep @@ -254,7 +254,7 @@ public class XMLInjection extends LessonAdapter Input input1 = new Input(Input.TEXT, ACCOUNTID, ""); input1.addAttribute("onkeyup", "getRewards();"); - + input1.addAttribute("id", ACCOUNTID); tr.addElement(new TD(input1)); t1.addElement(tr); diff --git a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XPATHInjection.java b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XPATHInjection.java index cdfa1d427..ba98ab3d3 100644 --- a/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XPATHInjection.java +++ b/ webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/XPATHInjection.java @@ -224,7 +224,7 @@ public class XPATHInjection extends LessonAdapter protected Category getDefaultCategory() { - return Category.A6; + return Category.INJECTION; } @@ -259,7 +259,7 @@ public class XPATHInjection extends LessonAdapter public String getTitle() { - return "How to Perform XPATH Injection"; + return "XPATH Injection"; } -} +} \ No newline at end of file diff --git a/ webgoat/main/project/WebContent/css/menu.css b/ webgoat/main/project/WebContent/css/menu.css index 7fbac6ad4..0436f5aeb 100644 --- a/ webgoat/main/project/WebContent/css/menu.css +++ b/ webgoat/main/project/WebContent/css/menu.css @@ -4,4 +4,8 @@ .pviimenudiv a:link {color: #333333; text-decoration: underline} .pviimenudiv a:visited {color: #0066FF; text-decoration: underline} .pviimenudiv a:hover {color: red; text-decoration: underline} -.pviimenudiv a:active {color: #0066FF; text-decoration: underline} \ No newline at end of file +.pviimenudiv a:active {color: #0066FF; text-decoration: underline} +.pviimenudivstage a:link {color: #333333; font-size: 9px; display: block; margin-left: 2em; } +.pviimenudivstage a:visited {color: #0066FF; font-size: 9px; display: block; margin-left: 2em; } +.pviimenudivstage a:hover {color: red; font-size: 9px; display: block; margin-left: 2em; } +.pviimenudivstage a:active {color: #0066FF; font-size: 9px; display: block; margin-left: 2em; } diff --git a/ webgoat/main/project/WebContent/images/header/header.jpg b/ webgoat/main/project/WebContent/images/header/header.jpg index 9468a467b..9c230882f 100644 Binary files a/ webgoat/main/project/WebContent/images/header/header.jpg and b/ webgoat/main/project/WebContent/images/header/header.jpg differ diff --git a/ webgoat/main/project/WebContent/main.jsp b/ webgoat/main/project/WebContent/main.jsp index 9909203c5..fdd114c11 100644 --- a/ webgoat/main/project/WebContent/main.jsp +++ b/ webgoat/main/project/WebContent/main.jsp @@ -100,7 +100,7 @@ StringBuffer buildList = new StringBuffer(); String[] stages = rla.getStages(); for (int i=0; i - <%=(rla.isStageComplete(webSession, stages[i]) ? lessonComplete : "")%>Stage <%=i+1%>: <%=stages[i] %> + <%=(rla.isStageComplete(webSession, stages[i]) ? lessonComplete : "")%>Stage <%=i+1%>: <%=stages[i] %> <% } diff --git a/ webgoat/main/project/WebContent/webgoat.jsp b/ webgoat/main/project/WebContent/webgoat.jsp index 007a8ab0b..f279ff713 100644 --- a/ webgoat/main/project/WebContent/webgoat.jsp +++ b/ webgoat/main/project/WebContent/webgoat.jsp @@ -1,103 +1,124 @@ -<%@ page contentType="text/html; charset=ISO-8859-1" language="java" - errorPage="" %> +<%@ page contentType="text/html; charset=ISO-8859-1" language="java" + errorPage=""%> <%@page import="org.owasp.webgoat.session.WebSession"%> -<% WebSession webSession = ((WebSession)session.getAttribute("websession")); %> +<% +WebSession webSession = ((WebSession) session.getAttribute("websession")); +%> -WebGoat V5 +WebGoat V5.1RC2 -
-
-
-

Thank you for using WebGoat!

-

This program is a demonstration of common web application flaws. - The exercises are intended to provide hands on experience with application - penetration testing techniques. The WebGoat project is lead by Bruce Mayhew. Please send all - comments to Bruce at <%= webSession.getWebgoatContext().getFeedbackAddress() %>.

-
- - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +
OWASP Foundation
Aspect Security

WebGoat Design Team

Lesson Contributers
-
Bruce Mayhew
-
Laurence Casey
-
David Anderson
-
Eric Sheridan
-
Rogan Dawes
-
-
Aspect Security
-
Sherif Koussa
-
Alex Smolen
-
Chuck Willis
+
+
+
+

Thank you for using WebGoat!

+

This program is a demonstration of common web application flaws. +The exercises are intended to provide hands on experience with +application penetration testing techniques.

The WebGoat project is lead +by Bruce Mayhew. Please send all comments to Bruce at <%=webSession.getWebgoatContext().getFeedbackAddress()%>.

+
+ + + + + + + + + + + + - - - - - - - - - - - - - - - - - - -
+
OWASP Foundation
+
+
Aspect Security
+
+

+ WebGoat Design Team
+
+

+ Lesson Contributers
+
+
Bruce Mayhew
+
David Anderson
+
Rogan Dawes
+
Laurence Casey (Graphics)
+
+
Aspect Security
+
Sherif Koussa
+
Romain Brechet
+
-
Special Thanks for V5
Documentation Contributers
-
OWASP Autumn of Code
- (http://www.owasp.org/)
-
Sherif Koussa
(http://www.macadamian.com)
-
OWASP Spring of Code
- (http://www.owasp.org/)
-
Erwin Geirnaert
(http://www.zionsecurity.com)
-
Sherif Koussa
- (http://www.macadamian.com)
-
Robert Sullivan
- (http://www.unitedhealthgroup.com/)
-
Erwin Geirnaert
- (http://www.zionsecurity.com/)
-
To all who have sent comments
-
-
- -
-
-
 
-
-
-
 
-
 
-
 
-
WARNING
- While running this program, your machine is extremely vulnerable to attack. - You should disconnect from the network while using this program. -
-
- This program is for educational purposes only. - Use of these techniques without permission could lead to - job termination, financial liability, and/or criminal penalties. -
-
+
+
Special Thanks + for V5.1
+
+
Documentation + Contributers
+
+
OWASP Spring of Code
+
Erwin Geirnaert
+ (http://www.zionsecurity.com)
+
+
+
Sherif Koussa
+ (http://www.macadamian.com)
+
+
Erwin Geirnaert
+ (http://www.zionsecurity.com/)
+
+
To all who have sent comments
+
+
+
+
+
+
 
+
+
+
+
 
+
 
+
 
+
WARNING
+While running this program, your machine is extremely vulnerable to +attack. You should disconnect from the network while using this program. +
+
+This program is for educational purposes only. Use of these techniques +without permission could lead to job termination, financial liability, +and/or criminal penalties.
+
diff --git a/ webgoat/main/project/WebContent/webgoat_challenge.jsp b/ webgoat/main/project/WebContent/webgoat_challenge.jsp index 9d4b4fe56..b60683360 100644 --- a/ webgoat/main/project/WebContent/webgoat_challenge.jsp +++ b/ webgoat/main/project/WebContent/webgoat_challenge.jsp @@ -7,7 +7,7 @@ -WebGoat V5 +WebGoat V5.1RC2 @@ -19,7 +19,7 @@

Thank you for using WebGoat!

This program is a demonstration of common web application flaws. The exercises are intended to provide hands on experience with application - penetration testing techniques. The WebGoat project is lead by Bruce Mayhew. Please send all + penetration testing techniques.

The WebGoat project is lead by Bruce Mayhew. Please send all comments to Bruce at <%= webSession.getWebgoatContext().getFeedbackAddress() %>.