One Day Sec

How do you add a Jetty Servlet type memory shell using reflection?

The technique involves obtaining the `WebAppClassLoader` from a thread's context, then using reflection to access the `_context` and `_servletHandler` fields to get the servlet handler. Once you have the handler, you can create a new `ServletHolder` from the `Source.JAVAX_API` and add your malicious servlet along with a servlet mapping. A full code example is provided in the Java Exploitation Techniques - Jetty Servlet Type Memory Shell article.
JettyServletmemory shellJava exploitationWebAppClassLoaderreflectionServletHolder

Browse all Q&A →