diff --git a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6aTest.java b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6aTest.java
index 71d85443c..dc65e7eb3 100644
--- a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6aTest.java
+++ b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6aTest.java
@@ -30,7 +30,7 @@ public class SqlInjectionLesson6aTest extends LessonTest {
@Test
public void wrongSolution() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6a")
.param("userid_6a", "John"))
.andExpect(status().isOk())
@@ -39,7 +39,7 @@ public class SqlInjectionLesson6aTest extends LessonTest {
@Test
public void wrongNumberOfColumns() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6a")
.param("userid_6a", "Smith' union select userid,user_name, password,cookie from user_system_data --"))
.andExpect(status().isOk())
@@ -49,7 +49,7 @@ public class SqlInjectionLesson6aTest extends LessonTest {
@Test
public void wrongDataTypeOfColumns() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6a")
.param("userid_6a", "Smith' union select 1,password, 1,'2','3', '4',1 from user_system_data --"))
.andExpect(status().isOk())
@@ -59,16 +59,16 @@ public class SqlInjectionLesson6aTest extends LessonTest {
@Test
public void correctSolution() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6a")
.param("userid_6a", "Smith'; SELECT * from user_system_data; --"))
.andExpect(status().isOk())
- .andExpect(jsonPath("$.lessonCompleted", is(false)))
+ .andExpect(jsonPath("$.lessonCompleted", is(true)))
.andExpect(jsonPath("$.feedback", containsString("passW0rD")));
}
@Test
public void noResultsReturned() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6a")
.param("userid_6a", "Smith' and 1 = 2 --"))
.andExpect(status().isOk())
@@ -78,10 +78,11 @@ public class SqlInjectionLesson6aTest extends LessonTest {
@Test
public void noUnionUsed() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6a")
.param("userid_6a", "S'; Select * from user_system_data; --"))
.andExpect(status().isOk())
+ .andExpect(jsonPath("$.lessonCompleted", is(true)))
.andExpect(jsonPath("$.feedback", containsString("UNION")));
}
}
\ No newline at end of file
diff --git a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6bTest.java b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6bTest.java
index 7341a6d3a..cfb8aebfe 100644
--- a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6bTest.java
+++ b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/introduction/SqlInjectionLesson6bTest.java
@@ -29,7 +29,7 @@ public class SqlInjectionLesson6bTest extends LessonTest {
@Test
public void submitCorrectPassword() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6b")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6b")
.param("userid_6b", "passW0rD"))
.andExpect(status().isOk()).andExpect(jsonPath("$.lessonCompleted", is(true)));
@@ -37,7 +37,7 @@ public class SqlInjectionLesson6bTest extends LessonTest {
@Test
public void submitWrongPassword() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack6b")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionAdvanced/attack6b")
.param("userid_6b", "John"))
.andExpect(status().isOk()).andExpect(jsonPath("$.lessonCompleted", is(false)));
diff --git a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/mitigation/SqlInjectionLesson12aTest.java b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/mitigation/SqlInjectionLesson12aTest.java
index cee8e8c13..974d48b7f 100644
--- a/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/mitigation/SqlInjectionLesson12aTest.java
+++ b/webgoat-lessons/sql-injection/src/test/java/org/owasp/webgoat/plugin/mitigation/SqlInjectionLesson12aTest.java
@@ -38,7 +38,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void knownAccountShouldDisplayData() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "id"))
.andExpect(status().isOk());
@@ -46,7 +46,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void addressCorrectShouldOrderByHostname() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "CASE WHEN (SELECT ip FROM servers WHERE hostname='webgoat-prd') LIKE '104.%' THEN hostname ELSE id END"))
.andExpect(status().isOk()).andExpect(jsonPath("$[0].hostname", is("webgoat-acc")));
@@ -54,17 +54,17 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void addressCorrectShouldOrderByHostnameUsingSubstr() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "case when (select ip from servers where hostname='webgoat-prd' and substr(ip,1,1) = '1') IS NOT NULL then hostname else id end"))
.andExpect(status().isOk()).andExpect(jsonPath("$[0].hostname", is("webgoat-acc")));
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "case when (select ip from servers where hostname='webgoat-prd' and substr(ip,2,1) = '0') IS NOT NULL then hostname else id end"))
.andExpect(status().isOk()).andExpect(jsonPath("$[0].hostname", is("webgoat-acc")));
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "case when (select ip from servers where hostname='webgoat-prd' and substr(ip,3,1) = '4') IS NOT NULL then hostname else id end"))
.andExpect(status().isOk()).andExpect(jsonPath("$[0].hostname", is("webgoat-acc")));
@@ -72,7 +72,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void addressIncorrectShouldOrderByIdUsingSubstr() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "case when (select ip from servers where hostname='webgoat-prd' and substr(ip,1,1) = '9') IS NOT NULL then hostname else id end"))
.andExpect(status().isOk()).andExpect(jsonPath("$[0].hostname", is("webgoat-dev")));
@@ -80,7 +80,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void trueShouldSortByHostname() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "(case when (true) then hostname else id end)"))
.andExpect(status().isOk())
@@ -89,7 +89,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void falseShouldSortById() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "(case when (true) then hostname else id end)"))
.andExpect(status().isOk())
@@ -98,7 +98,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void addressIncorrectShouldOrderByHostname() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjection/servers")
+ mockMvc.perform(MockMvcRequestBuilders.get("/SqlInjectionMitigations/servers")
.param("column", "CASE WHEN (SELECT ip FROM servers WHERE hostname='webgoat-prd') LIKE '192.%' THEN hostname ELSE id END"))
.andExpect(status().isOk()).andExpect(jsonPath("$[0].hostname", is("webgoat-dev")));
@@ -106,7 +106,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void postingCorrectAnswerShouldPassTheLesson() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack12a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionMitigations/attack12a")
.param("ip", "104.130.219.202"))
.andExpect(status().isOk()).andExpect(jsonPath("$.lessonCompleted", is(true)));
@@ -114,7 +114,7 @@ public class SqlInjectionLesson12aTest extends LessonTest {
@Test
public void postingWrongAnswerShouldNotPassTheLesson() throws Exception {
- mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjection/attack12a")
+ mockMvc.perform(MockMvcRequestBuilders.post("/SqlInjectionMitigations/attack12a")
.param("ip", "192.168.219.202"))
.andExpect(status().isOk()).andExpect(jsonPath("$.lessonCompleted", is(false)));