From 65d728dfffb3d3e4548866e205ac8b9f719c4393 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Tue, 7 Feb 2017 23:49:26 +0100 Subject: [PATCH] Solved issue with POST in vulnerable components lesson --- .../plugin/VulnerableComponentsLesson.java | 6 ++-- .../html/VulnerableComponents.html | 36 +++++++------------ 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/webgoat-lessons/vulnerable-components/src/main/java/org/owasp/webgoat/plugin/VulnerableComponentsLesson.java b/webgoat-lessons/vulnerable-components/src/main/java/org/owasp/webgoat/plugin/VulnerableComponentsLesson.java index 80933dfa2..be22ed45e 100644 --- a/webgoat-lessons/vulnerable-components/src/main/java/org/owasp/webgoat/plugin/VulnerableComponentsLesson.java +++ b/webgoat-lessons/vulnerable-components/src/main/java/org/owasp/webgoat/plugin/VulnerableComponentsLesson.java @@ -4,9 +4,9 @@ import com.thoughtworks.xstream.XStream; import org.owasp.webgoat.assignments.AssignmentEndpoint; import org.owasp.webgoat.assignments.AssignmentPath; import org.owasp.webgoat.assignments.AttackResult; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.io.IOException; @@ -49,11 +49,11 @@ import java.io.IOException; public class VulnerableComponentsLesson extends AssignmentEndpoint { @RequestMapping(method = RequestMethod.POST) - public @ResponseBody AttackResult completed(@RequestBody String payload) throws IOException { + public @ResponseBody AttackResult completed(@RequestParam String payload) throws IOException { String process = "open"; String arguments = "/Applications/Calculator.app"; - String payload2 = "" + + String payload2 = "" + "foo" + "" + "java.lang.Comparable" + diff --git a/webgoat-lessons/vulnerable-components/src/main/resources/plugin/VulnerableComponents/html/VulnerableComponents.html b/webgoat-lessons/vulnerable-components/src/main/resources/plugin/VulnerableComponents/html/VulnerableComponents.html index e35a3d6f4..8151c06ce 100644 --- a/webgoat-lessons/vulnerable-components/src/main/resources/plugin/VulnerableComponents/html/VulnerableComponents.html +++ b/webgoat-lessons/vulnerable-components/src/main/resources/plugin/VulnerableComponents/html/VulnerableComponents.html @@ -131,35 +131,23 @@
-
- -
- - - -
- Enter Your XML payload: -
- -
-
- -
- -
- - -
- +
+
+ + Enter Your XML payload: + +
+