mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
fix: tomcat6 jsp LinkageError
This commit is contained in:
@@ -20,10 +20,10 @@ public class GeneratorMain {
|
|||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
ShellConfig shellConfig = ShellConfig.builder()
|
ShellConfig shellConfig = ShellConfig.builder()
|
||||||
.server(Server.Resin)
|
.server(Server.Tomcat)
|
||||||
.shellTool(ShellTool.Command)
|
.shellTool(ShellTool.Command)
|
||||||
.shellType(Constants.FILTER)
|
.shellType(Constants.FILTER)
|
||||||
.targetJreVersion(Opcodes.V11)
|
.targetJreVersion(Opcodes.V1_6)
|
||||||
.build();
|
.build();
|
||||||
GodzillaConfig godzillaConfig = GodzillaConfig.builder()
|
GodzillaConfig godzillaConfig = GodzillaConfig.builder()
|
||||||
.pass("pass")
|
.pass("pass")
|
||||||
@@ -34,10 +34,10 @@ public class GeneratorMain {
|
|||||||
InjectorConfig injectorConfig = new InjectorConfig();
|
InjectorConfig injectorConfig = new InjectorConfig();
|
||||||
GenerateResult generateResult = generate(shellConfig, injectorConfig, commandConfig);
|
GenerateResult generateResult = generate(shellConfig, injectorConfig, commandConfig);
|
||||||
if (generateResult != null) {
|
if (generateResult != null) {
|
||||||
Files.write(Paths.get(generateResult.getInjectorClassName() + ".class"), generateResult.getInjectorBytes(), StandardOpenOption.CREATE_NEW);
|
// Files.write(Paths.get(generateResult.getInjectorClassName() + ".class"), generateResult.getInjectorBytes(), StandardOpenOption.CREATE_NEW);
|
||||||
Files.write(Paths.get(generateResult.getShellClassName() + ".class"), generateResult.getShellBytes(), StandardOpenOption.CREATE_NEW);
|
// Files.write(Paths.get(generateResult.getShellClassName() + ".class"), generateResult.getShellBytes(), StandardOpenOption.CREATE_NEW);
|
||||||
System.out.println(Base64.encodeBase64String(generateResult.getInjectorBytes()));
|
System.out.println(Base64.encodeBase64String(generateResult.getInjectorBytes()));
|
||||||
System.out.println(Base64.encodeBase64String(Packer.INSTANCE.JSP.getPacker().pack(generateResult)));
|
System.out.println(new String(Packer.INSTANCE.JSP.getPacker().pack(generateResult)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-1
@@ -50,7 +50,6 @@ public class ShellAssertionTool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void assertInjectIsOk(String url, String shellType, ShellTool shellTool, byte[] content, Packer.INSTANCE packer) {
|
public static void assertInjectIsOk(String url, String shellType, ShellTool shellTool, byte[] content, Packer.INSTANCE packer) {
|
||||||
log.info(new String(content));
|
|
||||||
switch (packer) {
|
switch (packer) {
|
||||||
case JSP -> {
|
case JSP -> {
|
||||||
String uploadEntry = url + "/upload";
|
String uploadEntry = url + "/upload";
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class VulTool {
|
|||||||
.url(uploadUrl).post(requestBody)
|
.url(uploadUrl).post(requestBody)
|
||||||
.build();
|
.build();
|
||||||
try (Response response = new OkHttpClient().newCall(request).execute()) {
|
try (Response response = new OkHttpClient().newCall(request).execute()) {
|
||||||
log.info(response.body().string());
|
// log.info(response.body().string());
|
||||||
Assertions.assertNotEquals(404, response.code());
|
Assertions.assertNotEquals(404, response.code());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -58,6 +58,7 @@ public class Tomcat6ContainerTest {
|
|||||||
@AfterAll
|
@AfterAll
|
||||||
static void tearDown() {
|
static void tearDown() {
|
||||||
String logs = container.getLogs();
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ dependencies {
|
|||||||
implementation 'org.apache.velocity:velocity:1.7'
|
implementation 'org.apache.velocity:velocity:1.7'
|
||||||
implementation 'ognl:ognl:2.7.3'
|
implementation 'ognl:ognl:2.7.3'
|
||||||
implementation 'org.springframework:spring-expression:4.3.30.RELEASE'
|
implementation 'org.springframework:spring-expression:4.3.30.RELEASE'
|
||||||
implementation 'de.odysseus.juel:juel-api:2.2.7'
|
providedCompile 'de.odysseus.juel:juel-api:2.2.7'
|
||||||
providedCompile "javax.servlet:servlet-api:2.5"
|
providedCompile "javax.servlet:servlet-api:2.5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<%--
|
||||||
|
Created by IntelliJ IDEA.
|
||||||
|
User: ReaJason
|
||||||
|
Date: 2024/12/14
|
||||||
|
Time: 20:29
|
||||||
|
To change this template use File | Settings | File Templates.
|
||||||
|
--%>
|
||||||
|
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>$Title$</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
$END$
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user