feat: support ssti and expression packer

This commit is contained in:
ReaJason
2024-12-14 19:28:13 +08:00
parent 13ddea499a
commit 74cb677e98
61 changed files with 564 additions and 135 deletions
+28
View File
@@ -0,0 +1,28 @@
import ognl.Ognl;
import ognl.OgnlContext;
import ognl.OgnlException;
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 2024/12/14
*/
public class OgnlServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String data = req.getParameter("data");
OgnlContext context = new OgnlContext();
Object value = null;
try {
value = Ognl.getValue(data, context, context.getRoot());
} catch (OgnlException e) {
throw new RuntimeException(e);
}
resp.getWriter().println(value);
}
}