Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8d32c6

Browse files
committed
Merge branch 'release/v8.0.0.M25'
2 parents e9b1a10 + 9b0c4e6 commit d8d32c6

File tree

355 files changed

+90000
-984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

355 files changed

+90000
-984
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ webgoat-lessons/vulnerable-components/dependency-reduced-pom.xml
5050
webgoat.lck
5151
webgoat.log
5252
webgoat.properties
53-
webgoat.script
53+
webgoat.script
54+
TestClass.class

README.MD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ you are caught engaging in unauthorized hacking, most companies will fire you.
2727
Claiming that you were doing security research will not work as that is the
2828
first thing that all hackers claim.*
2929

30-
# Run Instructions:
30+
# Installation Instructions:
3131

3232
## 1. Standalone
3333

@@ -152,3 +152,7 @@ docker tag webgoat/webgoat-8.0 webgoat/webgoat-8.0:8.0
152152
docker login
153153
docker push webgoat/webgoat-8.0
154154
```
155+
156+
# Run Instructions:
157+
158+
Once installed connect to http://localhost:8080/WebGoat and http://localhost:9090/WebWolf

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>org.owasp.webgoat</groupId>
77
<artifactId>webgoat-parent</artifactId>
88
<packaging>pom</packaging>
9-
<version>v8.0.0.M24</version>
9+
<version>v8.0.0.M25</version>
1010

1111
<name>WebGoat Parent Pom</name>
1212
<description>Parent Pom for the WebGoat Project. A deliberately insecure Web Application</description>

webgoat-container/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<groupId>org.owasp.webgoat</groupId>
1212
<artifactId>webgoat-parent</artifactId>
13-
<version>v8.0.0.M24</version>
13+
<version>v8.0.0.M25</version>
1414
</parent>
1515

1616
<profiles>

webgoat-container/src/main/java/org/owasp/webgoat/MvcConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.owasp.webgoat.i18n.Language;
3535
import org.owasp.webgoat.i18n.Messages;
3636
import org.owasp.webgoat.i18n.PluginMessages;
37-
import org.owasp.webgoat.session.Course;
3837
import org.owasp.webgoat.session.LabelDebugger;
3938
import org.springframework.beans.factory.annotation.Autowired;
4039
import org.springframework.beans.factory.annotation.Qualifier;
@@ -132,6 +131,7 @@ public PluginMessages pluginMessages(Messages messages, Language language) {
132131
PluginMessages pluginMessages = new PluginMessages(messages, language);
133132
pluginMessages.setDefaultEncoding("UTF-8");
134133
pluginMessages.setBasenames("i18n/WebGoatLabels");
134+
pluginMessages.setFallbackToSystemLocale(false);
135135
return pluginMessages;
136136
}
137137

@@ -145,6 +145,7 @@ public Messages messageSource(Language language) {
145145
Messages messages = new Messages(language);
146146
messages.setDefaultEncoding("UTF-8");
147147
messages.setBasename("classpath:i18n/messages");
148+
messages.setFallbackToSystemLocale(false);
148149
return messages;
149150
}
150151

@@ -153,7 +154,7 @@ public LocaleResolver localeResolver() {
153154
SessionLocaleResolver slr = new SessionLocaleResolver();
154155
return slr;
155156
}
156-
157+
157158
@Bean
158159
public LabelDebugger labelDebugger() {
159160
return new LabelDebugger();

webgoat-container/src/main/java/org/owasp/webgoat/lessons/LessonMenuItem.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class LessonMenuItem {
4545
private List<LessonMenuItem> children = new ArrayList<LessonMenuItem>();
4646
private boolean complete;
4747
private String link;
48+
private int ranking;
4849
// private boolean showSource = true;
4950
// private boolean showHints = true;
5051

@@ -156,6 +157,13 @@ public void setLink(String link) {
156157
this.link = link;
157158
}
158159

160+
public void setRanking(int ranking) {
161+
this.ranking = ranking;
162+
}
163+
164+
public int getRanking() {
165+
return this.ranking;
166+
}
159167

160168

161169
}

webgoat-container/src/main/java/org/owasp/webgoat/service/LessonMenuService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.springframework.web.bind.annotation.ResponseBody;
4444

4545
import java.util.ArrayList;
46+
import java.util.Collections;
4647
import java.util.Comparator;
4748
import java.util.List;
4849
import java.util.stream.Collectors;
@@ -86,11 +87,13 @@ List<LessonMenuItem> showLeftNav() {
8687
LessonMenuItem lessonItem = new LessonMenuItem();
8788
lessonItem.setName(lesson.getTitle());
8889
lessonItem.setLink(lesson.getLink());
90+
lessonItem.setRanking(lesson.getRanking());
8991
lessonItem.setType(LessonMenuItemType.LESSON);
9092
LessonTracker lessonTracker = userTracker.getLessonTracker(lesson);
9193
lessonItem.setComplete(lessonTracker.isLessonSolved());
9294
categoryItem.addChild(lessonItem);
9395
}
96+
categoryItem.getChildren().sort((o1, o2) -> o1.getRanking() - o2.getRanking());
9497
menu.add(categoryItem);
9598
}
9699
return menu;

webgoat-container/src/main/java/org/owasp/webgoat/session/CreateDB.java

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,64 @@ private void createTransactionTable(Connection connection) throws SQLException {
982982
}
983983
}
984984

985+
/**
986+
* Creates the table used in SQL-Injections (introduction)
987+
*/
988+
private void createEmployeesTable(Connection connection) throws SQLException {
989+
Statement statement = connection.createStatement();
990+
991+
// Drop employees and access_log tables
992+
try {
993+
statement.executeUpdate("DROP TABLE employees");
994+
} catch (SQLException e) {
995+
System.out.println("Info - Could not drop employees table");
996+
}
997+
try {
998+
statement.executeUpdate("DROP TABLE access_log");
999+
} catch (SQLException e) {
1000+
System.out.println("Info - Could not drop access_log table");
1001+
}
1002+
1003+
// Create the employees table
1004+
try {
1005+
String createTableStatement = "CREATE TABLE employees ("
1006+
+ "userid varchar(6) not null primary key,"
1007+
+ "first_name varchar(20),"
1008+
+ "last_name varchar(20),"
1009+
+ "department varchar(20),"
1010+
+ "salary int,"
1011+
+ "auth_tan varchar(6)"
1012+
+ ")";
1013+
statement.executeUpdate(createTableStatement);
1014+
} catch (SQLException e) {
1015+
System.out.println("Error creating employees table " + e.getLocalizedMessage());
1016+
}
1017+
1018+
// Populate
1019+
String insertData1 = "INSERT INTO employees VALUES ('32147','Paulina', 'Travers', 'Accounting', 46000, 'P45JSI')";
1020+
String insertData2 = "INSERT INTO employees VALUES ('89762','Tobi', 'Barnett', 'Development', 77000, 'TA9LL1')";
1021+
String insertData3 = "INSERT INTO employees VALUES ('96134','Bob', 'Franco', 'Marketing', 83700, 'LO9S2V')";
1022+
String insertData4 = "INSERT INTO employees VALUES ('34477','Abraham ', 'Holman', 'Development', 50000, 'UU2ALK')";
1023+
String insertData5 = "INSERT INTO employees VALUES ('37648','John', 'Smith', 'Marketing', 64350, '3SL99A')";
1024+
statement.executeUpdate(insertData1);
1025+
statement.executeUpdate(insertData2);
1026+
statement.executeUpdate(insertData3);
1027+
statement.executeUpdate(insertData4);
1028+
statement.executeUpdate(insertData5);
1029+
1030+
// Create the logging table
1031+
try {
1032+
String createTableStatement = "CREATE TABLE access_log ("
1033+
+ "id int not null primary key identity,"
1034+
+ "time varchar(50),"
1035+
+ "action varchar(200)"
1036+
+ ")";
1037+
statement.executeUpdate(createTableStatement);
1038+
} catch (SQLException e) {
1039+
System.out.println("Error creating access_log table " + e.getLocalizedMessage());
1040+
}
1041+
}
1042+
9851043
/**
9861044
* Description of the Method
9871045
*
@@ -1009,6 +1067,7 @@ public void makeDB(Connection connection) throws SQLException {
10091067
createMFEImagesTable(connection);
10101068
createModifyWithSQLLessonTable(connection);
10111069
createJWTKeys(connection);
1070+
createEmployeesTable(connection);
10121071
System.out.println("Success: creating tables.");
10131072
}
10141073
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
.attack-container.quiz {
2+
background: none;
3+
border: none;
4+
}
5+
6+
#q_container p {
7+
font-weight: bold;
8+
}
9+
10+
#q_container .quiz_question {
11+
border: solid 2px white;
12+
padding: 4px;
13+
margin: 5px 2px 20px 2px;
14+
box-shadow: 0px 1px 3px 1px #e4e4e4;
15+
}
16+
17+
#q_container .quiz_question label {
18+
font-weight: normal;
19+
position: relative;
20+
top: -2px;
21+
}
22+
23+
#q_container .quiz_question input {
24+
-webkit-appearance: none;
25+
-moz-appearance: none;
26+
appearance: none;
27+
border: 2px solid #dadada;
28+
background: white;
29+
width: 15px;
30+
height: 15px;
31+
margin-right: 6px;
32+
}
33+
34+
#q_container .quiz_question input:checked {
35+
background: #51b7ff;
36+
}
37+
38+
#q_container .quiz_question input:hover,
39+
#q_container .quiz_question label:hover {
40+
cursor: pointer;
41+
}
42+
43+
#q_container .quiz_question.correct {
44+
border: solid 2px #ddf7dd;
45+
background: #ddf7dd;
46+
transition: all 300ms ease-in-out;
47+
}
48+
49+
#q_container .quiz_question.incorrect {
50+
border: solid 2px #f5d3d3;
51+
background: #f5d3d3;
52+
transition: all 300ms ease-in-out;
53+
}
54+
55+
input[name='Quiz_solutions'] {
56+
background: white;
57+
border: 1px solid gray;
58+
padding: 7px 10px;
59+
transition: 300ms all ease-in-out;
60+
}
61+
62+
input[name='Quiz_solutions']:hover {
63+
background: #51b7ff;
64+
color: white;
65+
border-color: white;
66+
transition: 300ms all ease-in-out;
67+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*Issue #, if available:*
2+
3+
*Description of changes:*
4+
5+
6+
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

0 commit comments

Comments
 (0)