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
@@ -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;}";
}
}