mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-24 16:01:52 +08:00
feat: support Apusic V10
This commit is contained in:
@@ -85,7 +85,8 @@ public enum Server {
|
|||||||
/**
|
/**
|
||||||
* 金蝶天燕中间件
|
* 金蝶天燕中间件
|
||||||
*/
|
*/
|
||||||
Apusic(new ApusicShell()),
|
Apusic9(new ApusicShell()),
|
||||||
|
Apusic10(new GlassFishShell()),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中创中间件
|
* 中创中间件
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.reajason.javaweb.memshell;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ReaJason
|
||||||
|
* @since 2025/6/11
|
||||||
|
*/
|
||||||
|
public class ServerType {
|
||||||
|
public static final String TOMCAT = "Tomcat";
|
||||||
|
public static final String JETTY = "Jetty";
|
||||||
|
public static final String JBOSS_AS = "JBossAS";
|
||||||
|
public static final String JBOSS_EAP6 = "JBossEAP6";
|
||||||
|
public static final String UNDERTOW = "Undertow";
|
||||||
|
public static final String JBOSS_EAP7 = "JBossEAP7";
|
||||||
|
public static final String WILDFLY = "Wildfly";
|
||||||
|
public static final String RESIN = "Resin";
|
||||||
|
public static final String GLASSFISH = "Glassfish";
|
||||||
|
public static final String PAYARA = "Payara";
|
||||||
|
public static final String WEBLOGIC = "WebLogic";
|
||||||
|
public static final String WEBSPHERE = "WebSphere";
|
||||||
|
public static final String SPRING_WEBMVC = "SpringWebMVC";
|
||||||
|
public static final String SPRING_WEBFLUX = "SpringWebFlux";
|
||||||
|
public static final String XXL_JOB = "XXL-JOB";
|
||||||
|
public static final String APUSIC = "Apusic";
|
||||||
|
public static final String BES = "BES";
|
||||||
|
public static final String INFORSUITE = "InforSuite";
|
||||||
|
public static final String PRIMETON = "Primeton";
|
||||||
|
public static final String TONGWEB6 = "TongWeb6";
|
||||||
|
public static final String TONGWEB7 = "TongWeb7";
|
||||||
|
public static final String TONGWEB8 = "TongWeb8";
|
||||||
|
}
|
||||||
@@ -21,18 +21,22 @@ class GeneratorMainTest {
|
|||||||
@Disabled
|
@Disabled
|
||||||
void test() {
|
void test() {
|
||||||
ShellConfig shellConfig = ShellConfig.builder()
|
ShellConfig shellConfig = ShellConfig.builder()
|
||||||
.server(Server.Apusic)
|
.server(Server.Tomcat)
|
||||||
.shellTool(ShellTool.Behinder)
|
.shellTool(ShellTool.Command)
|
||||||
.shellType(ShellType.LISTENER)
|
.shellType(ShellType.PROXY_VALVE)
|
||||||
.targetJreVersion(Opcodes.V1_8)
|
.targetJreVersion(Opcodes.V1_8)
|
||||||
.debug(true)
|
.debug(true)
|
||||||
|
// .shrink(true)
|
||||||
.build();
|
.build();
|
||||||
GodzillaConfig godzillaConfig = GodzillaConfig.builder()
|
GodzillaConfig godzillaConfig = GodzillaConfig.builder()
|
||||||
.pass("pass")
|
.pass("pass")
|
||||||
.key("key")
|
.key("key")
|
||||||
.headerName("User-Agent")
|
.headerName("User-Agent")
|
||||||
.headerValue("test123").build();
|
.headerValue("test123").build();
|
||||||
CommandConfig commandConfig = CommandConfig.builder().paramName("listener").build();
|
CommandConfig commandConfig = CommandConfig.builder()
|
||||||
|
.paramName("listener")
|
||||||
|
.encryptor(CommandConfig.Encryptor.DOUBLE_BASE64)
|
||||||
|
.build();
|
||||||
|
|
||||||
BehinderConfig behinderConfig = BehinderConfig.builder()
|
BehinderConfig behinderConfig = BehinderConfig.builder()
|
||||||
.pass("test123")
|
.pass("test123")
|
||||||
@@ -45,8 +49,10 @@ class GeneratorMainTest {
|
|||||||
|
|
||||||
InjectorConfig injectorConfig = new InjectorConfig();
|
InjectorConfig injectorConfig = new InjectorConfig();
|
||||||
|
|
||||||
GenerateResult generateResult = MemShellGenerator.generate(shellConfig, injectorConfig, behinderConfig);
|
GenerateResult generateResult = MemShellGenerator.generate(shellConfig, injectorConfig, commandConfig);
|
||||||
if (generateResult != null) {
|
if (generateResult != null) {
|
||||||
|
System.out.println(generateResult.getShellBytes().length);
|
||||||
|
// System.out.println(((JarPacker) Packers.AgentJar.getInstance()).packBytes(generateResult).length);
|
||||||
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.getEncoder().encodeToString(generateResult.getInjectorBytes()));
|
// System.out.println(Base64.getEncoder().encodeToString(generateResult.getInjectorBytes()));
|
||||||
|
|||||||
Reference in New Issue
Block a user