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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.owasp.webgoat.container.assignments.AssignmentHints;
import org.owasp.webgoat.container.assignments.AttackResult;
import org.owasp.webgoat.container.session.Course;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.Assert;
Expand All @@ -42,10 +43,15 @@
public class CourseConfiguration {
private final List<Lesson> lessons;
private final List<AssignmentEndpoint> assignments;
private final String contextPath;

public CourseConfiguration(List<Lesson> lessons, List<AssignmentEndpoint> assignments) {
public CourseConfiguration(
List<Lesson> lessons,
List<AssignmentEndpoint> assignments,
@Value("${server.servlet.context-path}") String contextPath) {
this.lessons = lessons;
this.assignments = assignments;
this.contextPath = contextPath.equals("/") ? "" : contextPath;
}

private void attachToLessonInParentPackage(
Expand Down Expand Up @@ -124,7 +130,7 @@ private String getPath(Class<? extends AssignmentEndpoint> e) {
if (methodReturnTypeIsOfTypeAttackResult(m)) {
var mapping = getMapping(m);
if (mapping != null) {
return mapping;
return contextPath + mapping;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

package org.owasp.webgoat.lessons.sqlinjection.introduction;

import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.sql.*;
import org.owasp.webgoat.container.LessonDataSource;
Expand Down Expand Up @@ -52,8 +51,7 @@ public SqlInjectionLesson5b(LessonDataSource dataSource) {

@PostMapping("/SqlInjection/assignment5b")
@ResponseBody
public AttackResult completed(
@RequestParam String userid, @RequestParam String login_count, HttpServletRequest request)
public AttackResult completed(@RequestParam String userid, @RequestParam String login_count)
throws IOException {
return injectableQuery(login_count, userid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ define(['jquery',

this.showHintsView = function() {
var self=this;
console.log(self.name);
if (!this.lessonHintView) {
this.createLessonHintView();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ define(['jquery',
}
},

getCurrentPage: function () {
return this.currentPage;
},

makeFormsAjax: function () {
this.$form = $('form.attack-form');
// turn off standard submit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ define(['jquery',
var pages = [];

_.each(this.collection.models, function(model) {
//alert (model.get('solved'));
if (model.get('solved')) {
var key = model.get('assignment').path.replace(/\//g,'');
solvedMap[key] = model.get('assignment').name;
Expand All @@ -57,7 +56,6 @@ define(['jquery',

isAttackSolved = function (path) {
//strip
//var newPath = path.replace(/^\/WebGoat/,'');
var newPath = path.replace(/\//g,'');
if (typeof solvedMap[newPath] !== 'undefined') {
return true;
Expand Down