mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
fix: rename struct2 -> struts2
This commit is contained in:
@@ -20,6 +20,6 @@ public class Server {
|
||||
public static final String SpringWebMvc = "SpringWebMvc";
|
||||
public static final String SpringWebFlux = "SpringWebFlux";
|
||||
public static final String XXLJOB = "XXLJOB";
|
||||
public static final String Struct2 = "Struct2";
|
||||
public static final String Struts2 = "Struts2";
|
||||
public static final String Dubbo = "Dubbo";
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ServerFactory {
|
||||
register(Server.SpringWebMvc, SpringWebMvc::new);
|
||||
register(Server.SpringWebFlux, SpringWebFlux::new);
|
||||
register(Server.XXLJOB, XxlJob::new);
|
||||
register(Server.Struct2, Struct2::new);
|
||||
register(Server.Struts2, Struts2::new);
|
||||
register(Server.Dubbo, Dubbo::new);
|
||||
|
||||
addToolMapping(ShellTool.Godzilla, ToolMapping.builder()
|
||||
@@ -82,7 +82,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, GodzillaUndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, Godzilla.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, Godzilla.class)
|
||||
.addShellClass(ACTION, GodzillaStruct2Action.class)
|
||||
.addShellClass(ACTION, GodzillaStruts2Action.class)
|
||||
.build());
|
||||
|
||||
addToolMapping(ShellTool.Behinder, ToolMapping.builder()
|
||||
@@ -107,7 +107,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, BehinderUndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, Behinder.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, Behinder.class)
|
||||
.addShellClass(ACTION, BehinderStruct2Action.class)
|
||||
.addShellClass(ACTION, BehinderStruts2Action.class)
|
||||
.build());
|
||||
|
||||
addToolMapping(ShellTool.AntSword, ToolMapping.builder()
|
||||
@@ -125,7 +125,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, AntSwordUndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, AntSword.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, AntSword.class)
|
||||
.addShellClass(ACTION, AntSwordStruct2Action.class)
|
||||
.addShellClass(ACTION, AntSwordStruts2Action.class)
|
||||
.build());
|
||||
|
||||
addToolMapping(ShellTool.Command, ToolMapping.builder()
|
||||
@@ -162,7 +162,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, CommandUndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, Command.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, Command.class)
|
||||
.addShellClass(ACTION, CommandStruct2Action.class)
|
||||
.addShellClass(ACTION, CommandStruts2Action.class)
|
||||
.addShellClass(ALIBABA_DUBBO_SERVICE, CommandDubboService.class)
|
||||
.addShellClass(APACHE_DUBBO_SERVICE, CommandDubboService.class)
|
||||
.build());
|
||||
@@ -190,7 +190,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, Suo5UndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, Suo5.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, Suo5.class)
|
||||
.addShellClass(ACTION, Suo5Struct2Action.class)
|
||||
.addShellClass(ACTION, Suo5Struts2Action.class)
|
||||
.build());
|
||||
|
||||
addToolMapping(ShellTool.Suo5v2, ToolMapping.builder()
|
||||
@@ -215,7 +215,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, Suo5v2UndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, Suo5v2.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, Suo5v2.class)
|
||||
.addShellClass(ACTION, Suo5v2Struct2Action.class)
|
||||
.addShellClass(ACTION, Suo5v2Struts2Action.class)
|
||||
.addShellClass(CUSTOMIZER, Suo5v2JettyCustomizer.class)
|
||||
.build());
|
||||
|
||||
@@ -241,7 +241,7 @@ public class ServerFactory {
|
||||
.addShellClass(UNDERTOW_AGENT_SERVLET_HANDLER, NeoreGeorgUndertowServletHandler.class)
|
||||
.addShellClass(WEBLOGIC_AGENT_SERVLET_CONTEXT, NeoreGeorg.class)
|
||||
.addShellClass(WAS_AGENT_FILTER_MANAGER, NeoreGeorg.class)
|
||||
.addShellClass(ACTION, NeoreGeorgStruct2Action.class)
|
||||
.addShellClass(ACTION, NeoreGeorgStruts2Action.class)
|
||||
.build());
|
||||
|
||||
addToolMapping(ShellTool.Proxy, ToolMapping.builder()
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package com.reajason.javaweb.memshell.injector.struct2;
|
||||
package com.reajason.javaweb.memshell.injector.struts2;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -15,7 +15,7 @@ import java.util.zip.GZIPInputStream;
|
||||
* @author ReaJason
|
||||
* @since 2025/12/8
|
||||
*/
|
||||
public class Struct2ActionInjector {
|
||||
public class Struts2ActionInjector {
|
||||
|
||||
private static String msg = "";
|
||||
private static boolean ok = false;
|
||||
@@ -32,7 +32,7 @@ public class Struct2ActionInjector {
|
||||
return "{{base64Str}}";
|
||||
}
|
||||
|
||||
public Struct2ActionInjector() {
|
||||
public Struts2ActionInjector() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
+3
-3
@@ -1,18 +1,18 @@
|
||||
package com.reajason.javaweb.memshell.server;
|
||||
|
||||
import com.reajason.javaweb.memshell.ShellType;
|
||||
import com.reajason.javaweb.memshell.injector.struct2.Struct2ActionInjector;
|
||||
import com.reajason.javaweb.memshell.injector.struts2.Struts2ActionInjector;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/12/8
|
||||
*/
|
||||
public class Struct2 extends AbstractServer {
|
||||
public class Struts2 extends AbstractServer {
|
||||
|
||||
@Override
|
||||
public InjectorMapping getShellInjectorMapping() {
|
||||
return InjectorMapping.builder()
|
||||
.addInjector(ShellType.ACTION, Struct2ActionInjector.class)
|
||||
.addInjector(ShellType.ACTION, Struts2ActionInjector.class)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@ import java.net.URLClassLoader;
|
||||
* @author ReaJason
|
||||
* @since 2025/02/18
|
||||
*/
|
||||
public class AntSwordStruct2Action {
|
||||
public class AntSwordStruts2Action {
|
||||
|
||||
public static String pass;
|
||||
public static String headerName;
|
||||
+1
-1
@@ -15,7 +15,7 @@ import java.util.Map;
|
||||
/**
|
||||
* @author ReaJason
|
||||
*/
|
||||
public class BehinderStruct2Action {
|
||||
public class BehinderStruts2Action {
|
||||
public static String pass;
|
||||
public static String headerName;
|
||||
public static String headerValue;
|
||||
+1
-1
@@ -10,7 +10,7 @@ import java.util.Scanner;
|
||||
* @author ReaJason
|
||||
* @since 2025/12/8
|
||||
*/
|
||||
public class CommandStruct2Action {
|
||||
public class CommandStruts2Action {
|
||||
private static String paramName;
|
||||
|
||||
public String execute() throws Exception {
|
||||
+1
-1
@@ -15,7 +15,7 @@ import java.net.URLClassLoader;
|
||||
* @author ReaJason
|
||||
* @since 2024/12/15
|
||||
*/
|
||||
public class GodzillaStruct2Action {
|
||||
public class GodzillaStruts2Action {
|
||||
private static String key;
|
||||
private static String pass;
|
||||
private static String md5;
|
||||
+1
-1
@@ -18,7 +18,7 @@ import java.util.zip.GZIPInputStream;
|
||||
* <p>
|
||||
* key: key
|
||||
*/
|
||||
public class NeoreGeorgStruct2Action {
|
||||
public class NeoreGeorgStruts2Action {
|
||||
public static String headerName;
|
||||
public static String headerValue;
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@ import java.util.HashMap;
|
||||
* @author ReaJason
|
||||
* @since 2024/12/15
|
||||
*/
|
||||
public class Suo5Struct2Action implements Runnable, HostnameVerifier, X509TrustManager {
|
||||
public class Suo5Struts2Action implements Runnable, HostnameVerifier, X509TrustManager {
|
||||
public static String headerName;
|
||||
public static String headerValue;
|
||||
public static HashMap addrs = collectAddr();
|
||||
@@ -25,10 +25,10 @@ public class Suo5Struct2Action implements Runnable, HostnameVerifier, X509TrustM
|
||||
InputStream gInStream;
|
||||
OutputStream gOutStream;
|
||||
|
||||
public Suo5Struct2Action() {
|
||||
public Suo5Struts2Action() {
|
||||
}
|
||||
|
||||
public Suo5Struct2Action(InputStream in, OutputStream out) {
|
||||
public Suo5Struts2Action(InputStream in, OutputStream out) {
|
||||
this.gInStream = in;
|
||||
this.gOutStream = out;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ public class Suo5Struct2Action implements Runnable, HostnameVerifier, X509TrustM
|
||||
|
||||
Thread t = null;
|
||||
try {
|
||||
Suo5Struct2Action p = new Suo5Struct2Action(scInStream, respOutStream);
|
||||
Suo5Struts2Action p = new Suo5Struts2Action(scInStream, respOutStream);
|
||||
t = new Thread(p);
|
||||
t.start();
|
||||
readReq(reqInputStream, scOutStream);
|
||||
+2
-2
@@ -14,11 +14,11 @@ import java.util.zip.GZIPInputStream;
|
||||
* @author ReaJason
|
||||
* @since 2025/12/9
|
||||
*/
|
||||
public class Suo5v2Struct2Action {
|
||||
public class Suo5v2Struts2Action {
|
||||
private static Class<?> suo5V2Class;
|
||||
private static String suo5V2GZipBase64;
|
||||
|
||||
public Suo5v2Struct2Action() {
|
||||
public Suo5v2Struts2Action() {
|
||||
}
|
||||
|
||||
public void execute() throws Exception {
|
||||
+2
-2
@@ -106,8 +106,8 @@ public class ResponseBodyGenerator extends ByteBuddyShellGenerator<ResponseBodyC
|
||||
return WebLogicWriter.class;
|
||||
case Server.Apusic:
|
||||
return ApusicWriter.class;
|
||||
case Server.Struct2:
|
||||
return Struct2Writer.class;
|
||||
case Server.Struts2:
|
||||
return Struts2Writer.class;
|
||||
default:
|
||||
throw new GenerationException("responseBody not supported for server: " + probeContentConfig.getServer());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.Set;
|
||||
* HTTP 服务类型识别,主要识别 Servlet 容器实现,例如 WildFly 识别为 Undertow,Payara 识别为 GlassFish
|
||||
* 很多国产中间件都是基于 GlassFish 改的,都会识别为 GlassFish
|
||||
* 额外需要注意:
|
||||
* 1. 不会识别 SpringWebMVC Struct2 这种框架,只识别其提供 HTTP 服务的 Servlet 容器类型
|
||||
* 1. 不会识别 SpringWebMVC Struts2 这种框架,只识别其提供 HTTP 服务的 Servlet 容器类型
|
||||
* 2. 识别的顺序很重要,部分类型的识别单独拿出来是不准确的,没有测试的情况下,不要以下的 if 判断顺序
|
||||
*
|
||||
* @author ReaJason
|
||||
|
||||
+2
-2
@@ -11,10 +11,10 @@ import java.lang.reflect.Method;
|
||||
* @author ReaJason
|
||||
* @since 2025/12/8
|
||||
*/
|
||||
public class Struct2Writer {
|
||||
public class Struts2Writer {
|
||||
private static boolean ok = false;
|
||||
|
||||
public Struct2Writer() {
|
||||
public Struts2Writer() {
|
||||
if (ok) {
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user