mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
feat: support rhino and jinjava packer
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import org.mozilla.javascript.Context;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @author ReaJason
|
||||
* @since 2025/1/30
|
||||
*/
|
||||
public class RhinoServlet extends HttpServlet {
|
||||
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
String data = req.getParameter("data");
|
||||
try (Context cx = Context.enter()) {
|
||||
Scriptable scope = cx.initStandardObjects();
|
||||
Object result = cx.evaluateString(scope, data, null, 1, null);
|
||||
resp.getWriter().print(Context.toString(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user