Make report working again
This commit is contained in:
parent
e422da4c64
commit
e4ca0c4836
@ -32,6 +32,7 @@ import com.google.common.collect.Lists;
|
|||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.owasp.webgoat.i18n.PluginMessages;
|
||||||
import org.owasp.webgoat.lessons.AbstractLesson;
|
import org.owasp.webgoat.lessons.AbstractLesson;
|
||||||
import org.owasp.webgoat.session.Course;
|
import org.owasp.webgoat.session.Course;
|
||||||
import org.owasp.webgoat.session.WebSession;
|
import org.owasp.webgoat.session.WebSession;
|
||||||
@ -57,6 +58,7 @@ public class ReportCardService {
|
|||||||
private final WebSession webSession;
|
private final WebSession webSession;
|
||||||
private final UserTrackerRepository userTrackerRepository;
|
private final UserTrackerRepository userTrackerRepository;
|
||||||
private final Course course;
|
private final Course course;
|
||||||
|
private final PluginMessages pluginMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Endpoint which generates the report card for the current use to show the stats on the solved lessons
|
* Endpoint which generates the report card for the current use to show the stats on the solved lessons
|
||||||
@ -74,7 +76,7 @@ public class ReportCardService {
|
|||||||
for (AbstractLesson lesson : lessons) {
|
for (AbstractLesson lesson : lessons) {
|
||||||
LessonTracker lessonTracker = userTracker.getLessonTracker(lesson);
|
LessonTracker lessonTracker = userTracker.getLessonTracker(lesson);
|
||||||
LessonStatistics lessonStatistics = new LessonStatistics();
|
LessonStatistics lessonStatistics = new LessonStatistics();
|
||||||
lessonStatistics.setName(lesson.getTitle());
|
lessonStatistics.setName(pluginMessages.getMessage(lesson.getTitle()));
|
||||||
lessonStatistics.setNumberOfAttempts(lessonTracker.getNumberOfAttempts());
|
lessonStatistics.setNumberOfAttempts(lessonTracker.getNumberOfAttempts());
|
||||||
lessonStatistics.setSolved(lessonTracker.isLessonSolved());
|
lessonStatistics.setSolved(lessonTracker.isLessonSolved());
|
||||||
reportCard.lessonStatistics.add(lessonStatistics);
|
reportCard.lessonStatistics.add(lessonStatistics);
|
||||||
|
@ -89,10 +89,12 @@
|
|||||||
<!--<button type="button" id="admin-button" class="btn btn-default right_nav_button" title="Administrator">-->
|
<!--<button type="button" id="admin-button" class="btn btn-default right_nav_button" title="Administrator">-->
|
||||||
<!--<i class="fa fa-cog"></i>-->
|
<!--<i class="fa fa-cog"></i>-->
|
||||||
<!--</button>-->
|
<!--</button>-->
|
||||||
<button type="button" id="report-card-button" class="btn btn-default right_nav_button button-up"
|
<a href="#reportCard">
|
||||||
th:title="#{report.card}">
|
<button type="button" id="report-card-button" class="btn btn-default right_nav_button button-up"
|
||||||
<a href="#reportCard"><i class="fa fa-bar-chart-o"></i></a>
|
th:title="#{report.card}">
|
||||||
</button>
|
<i class="fa fa-bar-chart-o"></i>
|
||||||
|
</button>
|
||||||
|
</a>
|
||||||
<!--<button type="button" id="user-management" class="btn btn-default right_nav_button"-->
|
<!--<button type="button" id="user-management" class="btn btn-default right_nav_button"-->
|
||||||
<!--title="User management">-->
|
<!--title="User management">-->
|
||||||
<!--<i class="fa fa-users"></i>-->
|
<!--<i class="fa fa-users"></i>-->
|
||||||
|
@ -6,6 +6,7 @@ import org.junit.Test;
|
|||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
import org.mockito.runners.MockitoJUnitRunner;
|
||||||
|
import org.owasp.webgoat.i18n.PluginMessages;
|
||||||
import org.owasp.webgoat.lessons.AbstractLesson;
|
import org.owasp.webgoat.lessons.AbstractLesson;
|
||||||
import org.owasp.webgoat.session.Course;
|
import org.owasp.webgoat.session.Course;
|
||||||
import org.owasp.webgoat.session.WebSession;
|
import org.owasp.webgoat.session.WebSession;
|
||||||
@ -40,10 +41,12 @@ public class ReportCardServiceTest {
|
|||||||
private UserTrackerRepository userTrackerRepository;
|
private UserTrackerRepository userTrackerRepository;
|
||||||
@Mock
|
@Mock
|
||||||
private WebSession websession;
|
private WebSession websession;
|
||||||
|
@Mock
|
||||||
|
private PluginMessages pluginMessages;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.mockMvc = standaloneSetup(new ReportCardService(websession, userTrackerRepository, course)).build();
|
this.mockMvc = standaloneSetup(new ReportCardService(websession, userTrackerRepository, course, pluginMessages)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -56,7 +56,7 @@ public class ClientSideFiltering extends NewLesson {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "Client side filtering";
|
return "client.side.filtering.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
client.side.filtering.title=Client side filtering
|
||||||
ClientSideFilteringSelectUser=Select user:
|
ClientSideFilteringSelectUser=Select user:
|
||||||
ClientSideFilteringUserID=User ID
|
ClientSideFilteringUserID=User ID
|
||||||
ClientSideFilteringFirstName=First Name
|
ClientSideFilteringFirstName=First Name
|
||||||
|
@ -60,7 +60,7 @@ public class CrossSiteScripting extends NewLesson {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "Cross Site Scripting";
|
return "xss.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# XSS success, failure messages and hints
|
# XSS success, failure messages and hints
|
||||||
|
xss.title=Cross Site Scripting
|
||||||
xss-reflected-5a-success=well done, but alerts aren't very impressive are they? Please continue.
|
xss-reflected-5a-success=well done, but alerts aren't very impressive are they? Please continue.
|
||||||
xss-reflected-5a-failure=Try again. We do want to see this specific javascript (in case you are trying to do something more fancy)
|
xss-reflected-5a-failure=Try again. We do want to see this specific javascript (in case you are trying to do something more fancy)
|
||||||
xss-reflected-5b-success=Correct ... because <ul><li>The script was not triggered by the URL/QueryString</li><li>Even if you use the attack URL in a new tab, it won't execute (becuase of response type). Try it if you like.</li></ul>
|
xss-reflected-5b-success=Correct ... because <ul><li>The script was not triggered by the URL/QueryString</li><li>Even if you use the attack URL in a new tab, it won't execute (becuase of response type). Try it if you like.</li></ul>
|
||||||
|
@ -53,7 +53,7 @@ public class SqlInjectionAdvanced extends NewLesson {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "SQL Injection (advanced)";
|
return "sql.advanced.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,7 +60,7 @@ public class SqlInjection extends NewLesson {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "SQL Injection";
|
return "sql.injection.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,7 +53,7 @@ public class SqlInjectionMitigations extends NewLesson {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "SQL Injection (mitigations)";
|
return "sql.mitigation.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
#StringSqlInjection.java
|
#StringSqlInjection.java
|
||||||
StringSqlInjectionSecondStage=Now that you have successfully performed an SQL injection, try the same type of attack on a parameterized query. Restart the lesson if you wish to return to the injectable query.
|
StringSqlInjectionSecondStage=Now that you have successfully performed an SQL injection, try the same type of attack on a parameterized query. Restart the lesson if you wish to return to the injectable query.
|
||||||
EnterLastName=Enter your last name:
|
EnterLastName=Enter your last name:
|
||||||
|
|
||||||
|
sql.injection.title=SQL Injection
|
||||||
|
sql.mitigation.title=SQL Injection (mitigation)
|
||||||
|
sql.advanced.title=SQL Injection (advanced)
|
||||||
|
|
||||||
|
|
||||||
NoResultsMatched=No results matched. Try Again.
|
NoResultsMatched=No results matched. Try Again.
|
||||||
SqlStringInjectionHint1=The application is taking your input and inserting it at the end of a pre-formed SQL command.
|
SqlStringInjectionHint1=The application is taking your input and inserting it at the end of a pre-formed SQL command.
|
||||||
SqlStringInjectionHint2=This is the code for the query being built and issued by WebGoat:<br><br> "SELECT * FROM user_data WHERE last_name = "accountName"
|
SqlStringInjectionHint2=This is the code for the query being built and issued by WebGoat:<br><br> "SELECT * FROM user_data WHERE last_name = "accountName"
|
||||||
|
@ -58,7 +58,7 @@ public class XXE extends NewLesson {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return "XXE";
|
return "xxe.title";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
# projects.
|
# projects.
|
||||||
# <p>
|
# <p>
|
||||||
#
|
#
|
||||||
|
xxe.title=XXE
|
||||||
xxe.simple.output=Welcome {0} you can now login to our website
|
xxe.simple.output=Welcome {0} you can now login to our website
|
||||||
xxe.content.type.feedback.json=You are posting JSON which does not work with a XXE
|
xxe.content.type.feedback.json=You are posting JSON which does not work with a XXE
|
||||||
xxe.content.type.feedback.xml=You are posting XML but there is no XXE attack performed
|
xxe.content.type.feedback.xml=You are posting XML but there is no XXE attack performed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user