* first objects and unit tests for making a fix for the lesson * example added * unit test for windows and linux * added unit tests hints and feedbacks and updated lesson pages * small typo correction
35 lines
1.0 KiB
Java
35 lines
1.0 KiB
Java
package org.owasp.webgoat;
|
|
|
|
import java.io.IOException;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
import org.dummy.insecure.framework.VulnerableTaskHolder;
|
|
import org.junit.Test;
|
|
import org.owasp.webgoat.deserialization.SerializationHelper;
|
|
|
|
public class DeserializationTest extends IntegrationTest {
|
|
|
|
private static String OS = System.getProperty("os.name").toLowerCase();
|
|
|
|
@Test
|
|
public void runTests() throws IOException {
|
|
startLesson("InsecureDeserialization");
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.clear();
|
|
|
|
if (OS.indexOf("win")>-1) {
|
|
params.put("token", SerializationHelper.toString(new VulnerableTaskHolder("wait", "ping localhost -n 5")));
|
|
} else {
|
|
params.put("token", SerializationHelper.toString(new VulnerableTaskHolder("wait", "sleep 5")));
|
|
}
|
|
checkAssignment(url("/WebGoat/InsecureDeserialization/task"),params,true);
|
|
|
|
checkResults("/InsecureDeserialization/");
|
|
|
|
}
|
|
|
|
|
|
}
|