feat: support spring response body writer

This commit is contained in:
ReaJason
2025-11-20 00:36:25 +08:00
parent fe86bc04c1
commit 44d087829d
8 changed files with 116 additions and 5 deletions
@@ -39,7 +39,7 @@ public class SpringBoot1ContainerTest {
void testJDK() {
String url = getUrlFromSpringBoot(container);
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
assertEquals("JDK|1.8.0_342|52", data);
assertEquals("JDK|1.8.0_472|52", data);
}
@Test
@@ -64,6 +64,13 @@ public class SpringBoot1ContainerTest {
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBodySpring() {
String url = getUrlFromSpringBoot(container);
ProbeAssertion.responseCommandIsOk(url, Server.SpringWebMvc, Opcodes.V1_6);
}
@Test
@SneakyThrows
void testBytecodeReqParamResponseBody() {
@@ -40,7 +40,7 @@ public class SpringBoot2ContainerTest {
void testJDK() {
String url = getUrlFromSpringBoot(container);
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
assertEquals("JRE|1.8.0_342|52", data);
assertEquals("JDK|1.8.0_472|52", data);
}
@Test
@@ -65,6 +65,13 @@ public class SpringBoot2ContainerTest {
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBodySpring() {
String url = getUrlFromSpringBoot(container);
ProbeAssertion.responseCommandIsOk(url, Server.SpringWebMvc, Opcodes.V1_6);
}
@Test
@SneakyThrows
void testBytecodeReqParamResponseBody() {
@@ -40,7 +40,7 @@ public class SpringBoot2JettyContainerTest {
void testJDK() {
String url = getUrlFromSpringBoot(container);
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
assertEquals("JDK|1.8.0_342|52", data);
assertEquals("JDK|1.8.0_472|52", data);
}
@Test
@@ -39,7 +39,7 @@ public class SpringBoot2UndertowContainerTest {
void testJDK() {
String url = getUrlFromSpringBoot(container);
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
assertEquals("JDK|1.8.0_342|52", data);
assertEquals("JDK|1.8.0_472|52", data);
}
@Test
@@ -64,6 +64,13 @@ public class SpringBoot2WarContainerTest {
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V1_6);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBodySpring() {
String url = getUrl(container);
ProbeAssertion.responseCommandIsOk(url, Server.SpringWebMvc, Opcodes.V1_6);
}
@Test
@SneakyThrows
void testBytecodeReqParamResponseBody() {
@@ -39,7 +39,7 @@ public class SpringBoot3ContainerTest {
void testJDK() {
String url = getUrlFromSpringBoot(container);
String data = VulTool.post(url + "/b64", DetectionTool.getJdkDetection());
assertEquals("JDK|17.0.2|61", data);
assertEquals("JDK|17.0.17|61", data);
}
@Test
@@ -64,6 +64,13 @@ public class SpringBoot3ContainerTest {
ProbeAssertion.responseCommandIsOk(url, Server.Tomcat, Opcodes.V17);
}
@Test
@SneakyThrows
void testCommandReqHeaderResponseBodySpring() {
String url = getUrlFromSpringBoot(container);
ProbeAssertion.responseCommandIsOk(url, Server.SpringWebMvc, Opcodes.V17);
}
@Test
@SneakyThrows
void testBytecodeReqParamResponseBody() {